@univerjs/core 0.1.0-alpha.1 → 0.1.0-alpha.2
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/LICENSE.txt +178 -0
- package/lib/cjs/index.js +11 -15323
- package/lib/es/index.js +7369 -0
- package/lib/types/basics/index.d.ts +15 -1
- package/lib/types/basics/registry.d.ts +12 -4
- package/lib/types/basics/univer-doc.d.ts +15 -1
- package/lib/types/basics/univer-sheet.d.ts +15 -1
- package/lib/types/basics/univer-slide.d.ts +15 -1
- package/lib/types/basics/univer.d.ts +18 -4
- package/lib/types/common/array.d.ts +13 -5
- package/lib/types/common/const.d.ts +15 -1
- package/lib/types/common/interceptor.d.ts +15 -1
- package/lib/types/common/memory-cursor.d.ts +15 -1
- package/lib/types/common/request-immediate-macro-task.d.ts +16 -0
- package/lib/types/common/sequence.d.ts +15 -1
- package/lib/types/common/type-utils.d.ts +13 -2
- package/lib/types/docs/data-model/__tests__/apply-utils.spec.d.ts +15 -1
- package/lib/types/docs/data-model/apply-utils/common.d.ts +15 -1
- package/lib/types/docs/data-model/apply-utils/delete-apply.d.ts +15 -1
- package/lib/types/docs/data-model/apply-utils/insert-apply.d.ts +15 -1
- package/lib/types/docs/data-model/apply-utils/update-apply.d.ts +15 -1
- package/lib/types/docs/data-model/document-data-model.d.ts +15 -1
- package/lib/types/docs/data-model/index.d.ts +15 -1
- package/lib/types/docs/data-model/mutation-types.d.ts +15 -1
- package/lib/types/docs/data-model/types.d.ts +15 -1
- package/lib/types/docs/index.d.ts +15 -1
- package/lib/types/index.d.ts +18 -3
- package/lib/types/observer/index.d.ts +15 -1
- package/lib/types/observer/observable-hooks.d.ts +15 -1
- package/lib/types/observer/observable.d.ts +15 -1
- package/lib/types/plugin/plugin.d.ts +15 -1
- package/lib/types/services/auth/auth.service.d.ts +15 -1
- package/lib/types/services/command/command.service.d.ts +30 -3
- package/lib/types/services/command/command.service.spec.d.ts +15 -1
- package/lib/types/services/config/config.service.d.ts +15 -1
- package/lib/types/services/context/context.d.ts +15 -1
- package/lib/types/services/context/context.service.d.ts +15 -1
- package/lib/types/services/error/error.service.d.ts +15 -1
- package/lib/types/services/floating-object/floating-object-interfaces.d.ts +15 -1
- package/lib/types/services/floating-object/floating-object-manager.service.d.ts +15 -1
- package/lib/types/services/instance/instance.service.d.ts +15 -1
- package/lib/types/services/lifecycle/lifecycle.d.ts +15 -1
- package/lib/types/services/lifecycle/lifecycle.service.d.ts +15 -1
- package/lib/types/services/local-storage/local-storage.service.d.ts +15 -1
- package/lib/types/services/locale/locale.service.d.ts +15 -1
- package/lib/types/services/log/log.service.d.ts +24 -6
- package/lib/types/services/permission/index.d.ts +15 -1
- package/lib/types/services/permission/permission-point.d.ts +15 -1
- package/lib/types/services/permission/permission.service.d.ts +15 -1
- package/lib/types/services/permission/univer.permission.service.d.ts +15 -1
- package/lib/types/services/resource-manager/resource-manager.service.d.ts +15 -1
- package/lib/types/services/resource-manager/type.d.ts +21 -1
- package/lib/types/services/theme/theme.service.d.ts +15 -1
- package/lib/types/services/undoredo/undoredo.service.d.ts +15 -1
- package/lib/types/shared/__test__/object-matrix.spec.d.ts +15 -1
- package/lib/types/shared/__test__/ref-alias.spec.d.ts +15 -1
- package/lib/types/shared/array-search.d.ts +15 -1
- package/lib/types/shared/blob.d.ts +16 -0
- package/lib/types/shared/color/color-builder.d.ts +15 -1
- package/lib/types/shared/color/color.d.ts +15 -1
- package/lib/types/shared/command-enum.d.ts +15 -1
- package/lib/types/shared/common.d.ts +15 -1
- package/lib/types/shared/compare.d.ts +15 -1
- package/lib/types/shared/doc-tool.d.ts +15 -1
- package/lib/types/shared/gen-name.d.ts +15 -1
- package/lib/types/shared/generate.d.ts +15 -1
- package/lib/types/shared/hash-algorithm.d.ts +15 -1
- package/lib/types/shared/index.d.ts +16 -12
- package/lib/types/shared/lifecycle.d.ts +15 -1
- package/lib/types/shared/locale.d.ts +15 -1
- package/lib/types/shared/lru/index.d.ts +15 -1
- package/lib/types/shared/lru/lru-helper.d.ts +15 -1
- package/lib/types/shared/lru/lru-map.d.ts +15 -1
- package/lib/types/shared/object-array.d.ts +15 -1
- package/lib/types/shared/object-matrix.d.ts +38 -2
- package/lib/types/shared/permission/index.d.ts +15 -1
- package/lib/types/shared/props-from.d.ts +15 -1
- package/lib/types/shared/rectangle.d.ts +15 -1
- package/lib/types/shared/ref-alias.d.ts +13 -9
- package/lib/types/shared/row-col-iter.d.ts +15 -1
- package/lib/types/shared/sequence.d.ts +13 -4
- package/lib/types/shared/sort-rules.d.ts +15 -1
- package/lib/types/shared/tools.d.ts +15 -1
- package/lib/types/shared/types.d.ts +13 -2
- package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +15 -1
- package/lib/types/sheets/__tests__/styles.spec.d.ts +15 -1
- package/lib/types/sheets/column-manager.d.ts +15 -8
- package/lib/types/sheets/range.d.ts +15 -15
- package/lib/types/sheets/reference.d.ts +15 -1
- package/lib/types/sheets/row-manager.d.ts +15 -1
- package/lib/types/sheets/styles.d.ts +17 -3
- package/lib/types/sheets/view-model.d.ts +19 -5
- package/lib/types/sheets/workbook.d.ts +17 -1
- package/lib/types/sheets/worksheet.d.ts +22 -3
- package/lib/types/slides/domain/index.d.ts +15 -1
- package/lib/types/slides/domain/slide-model.d.ts +15 -1
- package/lib/types/types/const/action-names.d.ts +15 -1
- package/lib/types/types/const/const.d.ts +15 -1
- package/lib/types/types/const/doc-action-names.d.ts +15 -1
- package/lib/types/types/const/extension-names.d.ts +13 -2
- package/lib/types/types/const/index.d.ts +15 -1
- package/lib/types/types/const/theme-color-map.d.ts +15 -1
- package/lib/types/types/enum/auto-fill-series.d.ts +11 -5
- package/lib/types/types/enum/border-style-types.d.ts +13 -2
- package/lib/types/types/enum/color-type.d.ts +13 -2
- package/lib/types/types/enum/common-hide-types.d.ts +13 -2
- package/lib/types/types/enum/condition-type.d.ts +13 -2
- package/lib/types/types/enum/copy-paste-type.d.ts +12 -4
- package/lib/types/types/enum/developer-metadata-visibility.d.ts +13 -2
- package/lib/types/types/enum/dimension.d.ts +12 -3
- package/lib/types/types/enum/direction.d.ts +15 -1
- package/lib/types/types/enum/format-type.d.ts +13 -2
- package/lib/types/types/enum/group-control-toggle-position.d.ts +13 -2
- package/lib/types/types/enum/index.d.ts +15 -1
- package/lib/types/types/enum/interpolation-point-type.d.ts +13 -2
- package/lib/types/types/enum/locale-type.d.ts +12 -3
- package/lib/types/types/enum/place-holder-type.d.ts +15 -1
- package/lib/types/types/enum/protection-type.d.ts +13 -2
- package/lib/types/types/enum/relative-date.d.ts +13 -2
- package/lib/types/types/enum/shape-type.d.ts +15 -1
- package/lib/types/types/enum/sheet-types.d.ts +13 -2
- package/lib/types/types/enum/text-style.d.ts +13 -2
- package/lib/types/types/enum/theme-color-type.d.ts +10 -19
- package/lib/types/types/interfaces/i-cell-data.d.ts +25 -9
- package/lib/types/types/interfaces/i-column-data.d.ts +15 -1
- package/lib/types/types/interfaces/i-document-data.d.ts +15 -1
- package/lib/types/types/interfaces/i-extra-model-data.d.ts +15 -1
- package/lib/types/types/interfaces/i-freeze.d.ts +13 -3
- package/lib/types/types/interfaces/i-image-properties.d.ts +13 -2
- package/lib/types/types/interfaces/i-placeholder.d.ts +15 -1
- package/lib/types/types/interfaces/i-range.d.ts +15 -1
- package/lib/types/types/interfaces/i-row-data.d.ts +15 -1
- package/lib/types/types/interfaces/i-selection-data.d.ts +15 -1
- package/lib/types/types/interfaces/i-service-data.d.ts +13 -2
- package/lib/types/types/interfaces/i-shape-properties.d.ts +15 -1
- package/lib/types/types/interfaces/i-slide-data.d.ts +15 -1
- package/lib/types/types/interfaces/i-style-data.d.ts +15 -1
- package/lib/types/types/interfaces/i-univer-data.d.ts +17 -1
- package/lib/types/types/interfaces/i-workbook-data.d.ts +15 -1
- package/lib/types/types/interfaces/i-worksheet-data.d.ts +19 -1
- package/lib/types/types/interfaces/i-worksheet-order-data.d.ts +13 -2
- package/lib/types/types/interfaces/index.d.ts +15 -1
- package/lib/umd/index.js +11 -0
- package/package.json +20 -15
- package/LICENSE +0 -21
- package/lib/esm/index.js +0 -14601
- package/lib/types/basics/index.d.ts.map +0 -1
- package/lib/types/basics/registry.d.ts.map +0 -1
- package/lib/types/basics/univer-doc.d.ts.map +0 -1
- package/lib/types/basics/univer-sheet.d.ts.map +0 -1
- package/lib/types/basics/univer-slide.d.ts.map +0 -1
- package/lib/types/basics/univer.d.ts.map +0 -1
- package/lib/types/common/array.d.ts.map +0 -1
- package/lib/types/common/color/color-builder.d.ts +0 -1
- package/lib/types/common/color/color-builder.d.ts.map +0 -1
- package/lib/types/common/const.d.ts.map +0 -1
- package/lib/types/common/interceptor.d.ts.map +0 -1
- package/lib/types/common/memory-cursor.d.ts.map +0 -1
- package/lib/types/common/sequence.d.ts.map +0 -1
- package/lib/types/common/type-utils.d.ts.map +0 -1
- package/lib/types/docs/data-model/__tests__/apply-utils.spec.d.ts.map +0 -1
- package/lib/types/docs/data-model/apply-utils/common.d.ts.map +0 -1
- package/lib/types/docs/data-model/apply-utils/delete-apply.d.ts.map +0 -1
- package/lib/types/docs/data-model/apply-utils/insert-apply.d.ts.map +0 -1
- package/lib/types/docs/data-model/apply-utils/update-apply.d.ts.map +0 -1
- package/lib/types/docs/data-model/document-data-model.d.ts.map +0 -1
- package/lib/types/docs/data-model/index.d.ts.map +0 -1
- package/lib/types/docs/data-model/mutation-types.d.ts.map +0 -1
- package/lib/types/docs/data-model/types.d.ts.map +0 -1
- package/lib/types/docs/index.d.ts.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/observer/index.d.ts.map +0 -1
- package/lib/types/observer/observable-hooks.d.ts.map +0 -1
- package/lib/types/observer/observable.d.ts.map +0 -1
- package/lib/types/plugin/plugin.d.ts.map +0 -1
- package/lib/types/services/auth/auth.service.d.ts.map +0 -1
- package/lib/types/services/command/command.service.d.ts.map +0 -1
- package/lib/types/services/command/command.service.spec.d.ts.map +0 -1
- package/lib/types/services/config/config.service.d.ts.map +0 -1
- package/lib/types/services/context/context.d.ts.map +0 -1
- package/lib/types/services/context/context.service.d.ts.map +0 -1
- package/lib/types/services/error/error.service.d.ts.map +0 -1
- package/lib/types/services/floating-object/floating-object-interfaces.d.ts.map +0 -1
- package/lib/types/services/floating-object/floating-object-manager.service.d.ts.map +0 -1
- package/lib/types/services/instance/instance.service.d.ts.map +0 -1
- package/lib/types/services/lifecycle/lifecycle.d.ts.map +0 -1
- package/lib/types/services/lifecycle/lifecycle.service.d.ts.map +0 -1
- package/lib/types/services/local-storage/local-storage.service.d.ts.map +0 -1
- package/lib/types/services/locale/locale.service.d.ts.map +0 -1
- package/lib/types/services/log/log.service.d.ts.map +0 -1
- package/lib/types/services/permission/index.d.ts.map +0 -1
- package/lib/types/services/permission/permission-point.d.ts.map +0 -1
- package/lib/types/services/permission/permission.service.d.ts.map +0 -1
- package/lib/types/services/permission/univer.permission.service.d.ts.map +0 -1
- package/lib/types/services/resource-manager/resource-manager.service.d.ts.map +0 -1
- package/lib/types/services/resource-manager/type.d.ts.map +0 -1
- package/lib/types/services/theme/theme.service.d.ts.map +0 -1
- package/lib/types/services/undoredo/undoredo.service.d.ts.map +0 -1
- package/lib/types/shared/__test__/object-matrix.spec.d.ts.map +0 -1
- package/lib/types/shared/__test__/ref-alias.spec.d.ts.map +0 -1
- package/lib/types/shared/array-search.d.ts.map +0 -1
- package/lib/types/shared/color/color-builder.d.ts.map +0 -1
- package/lib/types/shared/color/color.d.ts.map +0 -1
- package/lib/types/shared/color-builder.d.ts +0 -1
- package/lib/types/shared/color-builder.d.ts.map +0 -1
- package/lib/types/shared/command-enum.d.ts.map +0 -1
- package/lib/types/shared/common.d.ts.map +0 -1
- package/lib/types/shared/compare.d.ts.map +0 -1
- package/lib/types/shared/date-time.d.ts +0 -6
- package/lib/types/shared/date-time.d.ts.map +0 -1
- package/lib/types/shared/doc-tool.d.ts.map +0 -1
- package/lib/types/shared/drop-cell.d.ts +0 -1
- package/lib/types/shared/drop-cell.d.ts.map +0 -1
- package/lib/types/shared/excel-date-time.d.ts +0 -6
- package/lib/types/shared/excel-date-time.d.ts.map +0 -1
- package/lib/types/shared/gen-name.d.ts.map +0 -1
- package/lib/types/shared/generate.d.ts.map +0 -1
- package/lib/types/shared/group-model.d.ts +0 -4
- package/lib/types/shared/group-model.d.ts.map +0 -1
- package/lib/types/shared/hash-algorithm.d.ts.map +0 -1
- package/lib/types/shared/index.d.ts.map +0 -1
- package/lib/types/shared/io-http.d.ts +0 -84
- package/lib/types/shared/io-http.d.ts.map +0 -1
- package/lib/types/shared/io-socket.d.ts +0 -48
- package/lib/types/shared/io-socket.d.ts.map +0 -1
- package/lib/types/shared/lifecycle.d.ts.map +0 -1
- package/lib/types/shared/locale.d.ts.map +0 -1
- package/lib/types/shared/logger.d.ts +0 -12
- package/lib/types/shared/logger.d.ts.map +0 -1
- package/lib/types/shared/lru/index.d.ts.map +0 -1
- package/lib/types/shared/lru/lru-helper.d.ts.map +0 -1
- package/lib/types/shared/lru/lru-map.d.ts.map +0 -1
- package/lib/types/shared/migrate/border.d.ts +0 -3
- package/lib/types/shared/migrate/border.d.ts.map +0 -1
- package/lib/types/shared/migrate/index.d.ts +0 -2
- package/lib/types/shared/migrate/index.d.ts.map +0 -1
- package/lib/types/shared/migrate/migrate.d.ts +0 -3
- package/lib/types/shared/migrate/migrate.d.ts.map +0 -1
- package/lib/types/shared/object-array.d.ts.map +0 -1
- package/lib/types/shared/object-matrix.d.ts.map +0 -1
- package/lib/types/shared/permission/index.d.ts.map +0 -1
- package/lib/types/shared/props-from.d.ts.map +0 -1
- package/lib/types/shared/random.d.ts +0 -7
- package/lib/types/shared/random.d.ts.map +0 -1
- package/lib/types/shared/rect-tree/border-tree.d.ts +0 -30
- package/lib/types/shared/rect-tree/border-tree.d.ts.map +0 -1
- package/lib/types/shared/rect-tree/es-rect-tree.d.ts +0 -9
- package/lib/types/shared/rect-tree/es-rect-tree.d.ts.map +0 -1
- package/lib/types/shared/rect-tree/merge-tree.d.ts +0 -1
- package/lib/types/shared/rect-tree/merge-tree.d.ts.map +0 -1
- package/lib/types/shared/rect-tree/quick-select.d.ts +0 -3
- package/lib/types/shared/rect-tree/quick-select.d.ts.map +0 -1
- package/lib/types/shared/rect-tree/rect-tree.d.ts +0 -60
- package/lib/types/shared/rect-tree/rect-tree.d.ts.map +0 -1
- package/lib/types/shared/rect-tree/styles-tree.d.ts +0 -1
- package/lib/types/shared/rect-tree/styles-tree.d.ts.map +0 -1
- package/lib/types/shared/rectangle.d.ts.map +0 -1
- package/lib/types/shared/ref-alias.d.ts.map +0 -1
- package/lib/types/shared/row-col-iter.d.ts.map +0 -1
- package/lib/types/shared/sequence.d.ts.map +0 -1
- package/lib/types/shared/serialize/index.d.ts +0 -5
- package/lib/types/shared/serialize/index.d.ts.map +0 -1
- package/lib/types/shared/serialize/sequence.d.ts +0 -4
- package/lib/types/shared/serialize/sequence.d.ts.map +0 -1
- package/lib/types/shared/serialize/serialize-manager.d.ts +0 -17
- package/lib/types/shared/serialize/serialize-manager.d.ts.map +0 -1
- package/lib/types/shared/serialize/serialize.d.ts +0 -8
- package/lib/types/shared/serialize/serialize.d.ts.map +0 -1
- package/lib/types/shared/serialize/serializer.d.ts +0 -14
- package/lib/types/shared/serialize/serializer.d.ts.map +0 -1
- package/lib/types/shared/sort-rules.d.ts.map +0 -1
- package/lib/types/shared/tools.d.ts.map +0 -1
- package/lib/types/shared/tuples.d.ts +0 -12
- package/lib/types/shared/tuples.d.ts.map +0 -1
- package/lib/types/shared/type-store.d.ts +0 -10
- package/lib/types/shared/type-store.d.ts.map +0 -1
- package/lib/types/shared/types.d.ts.map +0 -1
- package/lib/types/sheets/__tests__/create-core-test-bed.d.ts.map +0 -1
- package/lib/types/sheets/__tests__/styles.spec.d.ts.map +0 -1
- package/lib/types/sheets/column-manager.d.ts.map +0 -1
- package/lib/types/sheets/range.d.ts.map +0 -1
- package/lib/types/sheets/reference.d.ts.map +0 -1
- package/lib/types/sheets/row-manager.d.ts.map +0 -1
- package/lib/types/sheets/styles.d.ts.map +0 -1
- package/lib/types/sheets/view-model.d.ts.map +0 -1
- package/lib/types/sheets/workbook.d.ts.map +0 -1
- package/lib/types/sheets/worksheet.d.ts.map +0 -1
- package/lib/types/slides/domain/index.d.ts.map +0 -1
- package/lib/types/slides/domain/slide-model.d.ts.map +0 -1
- package/lib/types/types/const/action-names.d.ts.map +0 -1
- package/lib/types/types/const/const.d.ts.map +0 -1
- package/lib/types/types/const/doc-action-names.d.ts.map +0 -1
- package/lib/types/types/const/extension-names.d.ts.map +0 -1
- package/lib/types/types/const/index.d.ts.map +0 -1
- package/lib/types/types/const/theme-color-map.d.ts.map +0 -1
- package/lib/types/types/enum/auto-fill-series.d.ts.map +0 -1
- package/lib/types/types/enum/border-style-types.d.ts.map +0 -1
- package/lib/types/types/enum/color-type.d.ts.map +0 -1
- package/lib/types/types/enum/common-hide-types.d.ts.map +0 -1
- package/lib/types/types/enum/condition-type.d.ts.map +0 -1
- package/lib/types/types/enum/copy-paste-type.d.ts.map +0 -1
- package/lib/types/types/enum/developer-metadata-visibility.d.ts.map +0 -1
- package/lib/types/types/enum/dimension.d.ts.map +0 -1
- package/lib/types/types/enum/direction.d.ts.map +0 -1
- package/lib/types/types/enum/format-type.d.ts.map +0 -1
- package/lib/types/types/enum/group-control-toggle-position.d.ts.map +0 -1
- package/lib/types/types/enum/index.d.ts.map +0 -1
- package/lib/types/types/enum/interpolation-point-type.d.ts.map +0 -1
- package/lib/types/types/enum/locale-type.d.ts.map +0 -1
- package/lib/types/types/enum/place-holder-type.d.ts.map +0 -1
- package/lib/types/types/enum/protection-type.d.ts.map +0 -1
- package/lib/types/types/enum/relative-date.d.ts.map +0 -1
- package/lib/types/types/enum/shape-type.d.ts.map +0 -1
- package/lib/types/types/enum/sheet-types.d.ts.map +0 -1
- package/lib/types/types/enum/text-style.d.ts.map +0 -1
- package/lib/types/types/enum/theme-color-type.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-cell-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-column-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-document-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-extra-model-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-freeze.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-image-properties.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-placeholder.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-range.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-row-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-selection-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-service-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-shape-properties.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-slide-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-style-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-univer-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-workbook-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-worksheet-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/i-worksheet-order-data.d.ts.map +0 -1
- package/lib/types/types/interfaces/index.d.ts.map +0 -1
package/lib/umd/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
(function(h,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("@wendellhu/redi"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@wendellhu/redi","rxjs"],m):(h=typeof globalThis<"u"?globalThis:h||self,m(h.UniverCore={},h["@wendellhu/redi"],h.rxjs))})(this,function(h,m,b){"use strict";var wo=Object.defineProperty;var Lo=(h,m,b)=>m in h?wo(h,m,{enumerable:!0,configurable:!0,writable:!0,value:b}):h[m]=b;var d=(h,m,b)=>(Lo(h,typeof m!="symbol"?m+"":m,b),b);var No,bo;class qt{constructor(){d(this,"_data",[])}static create(){return new qt}add(e){this._data.indexOf(e)>-1||this._data.push(e)}delete(e){const n=this._data.indexOf(e);this._data.splice(n,1)}getData(){return this._data}}class yt{constructor(){d(this,"_data",new Map)}static create(){return new yt}add(e,n){this._data.has(e)||this._data.set(e,n)}delete(e){this._data.delete(e)}getData(){return this._data}}var j=(t=>(t[t.Univer=0]="Univer",t[t.Doc=1]="Doc",t[t.Sheet=2]="Sheet",t[t.Slide=3]="Slide",t))(j||{});class He{constructor(e){d(this,"_name");this._name=e}onStarting(e){}onReady(){}onRendered(){}onSteady(){}onDestroy(){}getPluginName(){return this._name}}d(He,"type",0);class bt{constructor(){d(this,"plugins",[])}addPlugin(e){this.plugins.push(e)}removePlugins(){const e=this.plugins.slice();return this.plugins.length=0,e}forEachPlugin(e){this.plugins.forEach(e)}}class sr{constructor(){d(this,"pluginsRegisteredByBusiness",new Map)}registerPlugin(e,n){const s=e.type;this.pluginsRegisteredByBusiness.has(s)||this.pluginsRegisteredByBusiness.set(s,[]),this.pluginsRegisteredByBusiness.get(s).push({plugin:e,options:n})}getRegisterPlugins(e){return this.pluginsRegisteredByBusiness.get(e)||[]}}function Q(t,e){const n=t.indexOf(e);return n>-1?(t.splice(n,1),!0):!1}function rr(t){const e=new Set,n=[];for(const s of t)e.has(s)||(e.add(s),n.push(s));return n}function ir(t,e){for(let n=t.length-1;n>-1;n--){const s=t[n];if(e(s,n))return s}return null}async function We(t){for(const[e,n]of t.entries())try{if(!await n())return{index:e,result:!1}}catch(s){return{index:e,result:!1,error:s}}return{result:!0,index:-1}}function Be(t){for(const[e,n]of t.entries())try{if(!n())return{index:e,result:!1}}catch(s){return{index:e,result:!1,error:s}}return{result:!0,index:-1}}var te=function(t,e){return te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(n[r]=s[r])},te(t,e)};function ee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");te(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function Ge(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],s=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function wt(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var s=n.call(t),r,i=[],o;try{for(;(e===void 0||e-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(c){o={error:c}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i}function Lt(t,e,n){if(n||arguments.length===2)for(var s=0,r=e.length,i;s<r;s++)(i||!(s in e))&&(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;function et(t){return typeof t=="function"}function or(t){var e=function(s){Error.call(s),s.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var ne=or(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
2
|
+
`+n.map(function(s,r){return r+1+") "+s.toString()}).join(`
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function $e(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var se=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,s,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var c=Ge(o),u=c.next();!u.done;u=c.next()){var a=u.value;a.remove(this)}}catch(R){e={error:R}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(et(l))try{l()}catch(R){i=R instanceof ne?R.errors:[R]}var _=this._finalizers;if(_){this._finalizers=null;try{for(var f=Ge(_),g=f.next();!g.done;g=f.next()){var E=g.value;try{ke(E)}catch(R){i=i??[],R instanceof ne?i=Lt(Lt([],wt(i)),wt(R.errors)):i.push(R)}}}catch(R){s={error:R}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(s)throw s.error}}}if(i)throw new ne(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)ke(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&$e(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&$e(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();se.EMPTY;function pe(t){return t instanceof se||t&&"closed"in t&&et(t.remove)&&et(t.add)&&et(t.unsubscribe)}function ke(t){et(t)?t():t.unsubscribe()}class je{constructor(e=!1){d(this,"skipNextObservers");d(this,"lastReturnValue");d(this,"isStopPropagation",!1);this.initialize(e)}initialize(e=!1){return this.skipNextObservers=e,this}stopPropagation(){this.isStopPropagation=!0}}function Ve(t){return t instanceof vt}class vt{constructor(e,n){d(this,"_willBeUnregistered",!1);d(this,"unregisterOnNextCall",!1);this.callback=e,this.observable=n}dispose(){this.observable.remove(this)}}class Dt{constructor(e){d(this,"_observers",new Array);d(this,"_eventState");d(this,"_onObserverAdded");this._eventState=new je,e&&(this._onObserverAdded=e)}get observers(){return this._observers}add(e,n=!1,s=!1){if(!e)return null;const r=new vt(e,this);return r.unregisterOnNextCall=s,n?this._observers.unshift(r):this._observers.push(r),this._onObserverAdded&&this._onObserverAdded(r),r}addOnce(e){return this.add(e,void 0,!0)}remove(e){return e&&this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1}removeCallback(e){for(let n=0;n<this._observers.length;n++){const s=this._observers[n];if(!s._willBeUnregistered&&s.callback===e)return this._deferUnregister(s),!0}return!1}makeObserverTopPriority(e){this._remove(e),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e),this._observers.push(e)}notifyObservers(e){if(!this._observers.length)return null;const n=this._eventState;n.skipNextObservers=!1,n.lastReturnValue=e,n.isStopPropagation=!1;let s=!1;for(let r=0;r<this._observers.length;r++){const i=this._observers[r];if(!i._willBeUnregistered&&(n.lastReturnValue=i.callback(e,n),i.unregisterOnNextCall&&this._deferUnregister(i),n.isStopPropagation&&(s=!0),n.skipNextObservers))return{lastReturnValue:n.lastReturnValue,stopPropagation:s}}return{lastReturnValue:n.lastReturnValue,stopPropagation:s}}notifyObserversWithPromise(e){let n=Promise.resolve(e);if(!this._observers.length)return n;const s=this._eventState;s.skipNextObservers=!1;for(let r=0;r<this._observers.length;r++){const i=this._observers[r];s.skipNextObservers||i._willBeUnregistered||(n=n.then(()=>i.callback(e,s)),i.unregisterOnNextCall&&this._deferUnregister(i))}return n.then(()=>e)}notifyObserver(e,n){if(e._willBeUnregistered)return;const s=this._eventState;return s.skipNextObservers=!1,e.callback(n,s),e.unregisterOnNextCall&&this._deferUnregister(e),{lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}hasObservers(){return this._observers.length>0}clear(){this._observers=new Array,this._onObserverAdded=null}clone(){const e=new Dt;return e._observers=this._observers.slice(0),e}_deferUnregister(e){e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{this._remove(e)},0)}_remove(e){if(!e)return!1;const n=this._observers.indexOf(e);return n!==-1?(this._observers.splice(n,1),!0):!1}}function D(t){let e=!1;return pe(t)?{dispose:()=>{e||(e=!0,t.unsubscribe())}}:Ve(t)?{dispose:()=>{e||(e=!0,t.dispose())}}:{dispose:()=>{e||(e=!0,t())}}}function cr(t){return D(()=>{t.unsubscribe()})}class xe{constructor(){d(this,"_disposables",new Set)}add(e){return this._disposables.add(e),{dispose:()=>{e.dispose(),this._disposables.delete(e)}}}dispose(){this._disposables.forEach(e=>{e.dispose(),this._disposables.delete(e)})}}class M{constructor(){d(this,"_disposed",!1);d(this,"_collection",new xe)}disposeWithMe(e){return this._collection.add(e)}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class ar extends M{constructor(){super(...arguments);d(this,"dispose$",new b.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}const ct=m.createIdentifier("univer.context-service");class ze extends M{constructor(){super(...arguments);d(this,"_contextChanged$",new b.Subject);d(this,"contextChanged$",this._contextChanged$.asObservable());d(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(n){return this._contextMap.get(n)??!1}setContextValue(n,s){this._contextMap.set(n,s),this._contextChanged$.next()}}var Ke=(t=>(t[t.SILENT=0]="SILENT",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.VERBOSE=3]="VERBOSE",t))(Ke||{});const at=m.createIdentifier("univer.log");class Ye extends M{constructor(){super(...arguments);d(this,"_logLevel",0)}log(...n){if(this._logLevel<3||!n.length)return;const s=n[0];/^\[(.*?)\]/g.test(s)?console.log(`\x1B[97;104m${s}\x1B[0m:`,...n.slice(1)):console.log(...n)}warn(...n){this._logLevel>=2&&console.warn(...n)}error(...n){this._logLevel>=1&&console.error(...n)}setLogLevel(n){this._logLevel=n}}var lr=Object.defineProperty,ur=Object.getOwnPropertyDescriptor,hr=(t,e,n,s)=>{for(var r=s>1?void 0:s?ur(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&lr(e,n,r),r},Xe=(t,e)=>(n,s)=>e(n,s,t),Ut=(t=>(t[t.COMMAND=0]="COMMAND",t[t.OPERATION=1]="OPERATION",t[t.MUTATION=2]="MUTATION",t))(Ut||{});const Rt=m.createIdentifier("anywhere.command-service");class _r{constructor(){d(this,"_commands",new Map)}registerCommand(e){if(this._commands.has(e.id))throw new Error(`Command ${e.id} has registered before!`);return this._commands.set(e.id,e),D(()=>{var n;this._commands.delete(e.id),(n=e.onDispose)==null||n.call(e)})}getCommand(e){return this._commands.has(e)?[this._commands.get(e)]:null}}h.CommandService=class{constructor(e,n){d(this,"_commandRegistry");d(this,"_beforeCommandExecutionListeners",[]);d(this,"_commandExecutedListeners",[]);d(this,"_multiCommandDisposables",new Map);d(this,"_commandExecutingLevel",0);d(this,"_commandExecutionStack",[]);this._injector=e,this._log=n,this._commandRegistry=new _r}registerCommand(e){return this._registerCommand(e)}registerAsMultipleCommand(e){return this._registerMultiCommand(e)}beforeCommandExecuted(e){if(this._beforeCommandExecutionListeners.indexOf(e)===-1)return this._beforeCommandExecutionListeners.push(e),D(()=>{const n=this._beforeCommandExecutionListeners.indexOf(e);this._beforeCommandExecutionListeners.splice(n,1)});throw new Error("Could not add a listener twice.")}onCommandExecuted(e){if(this._commandExecutedListeners.indexOf(e)===-1)return this._commandExecutedListeners.push(e),D(()=>{const n=this._commandExecutedListeners.indexOf(e);this._commandExecutedListeners.splice(n,1)});throw new Error("Could not add a listener twice.")}async executeCommand(e,n,s){const r=this._commandRegistry.getCommand(e);if(r){const[i]=r,o={id:i.id,type:i.type,params:n},c=this._pushCommandExecutionStack(o);this._beforeCommandExecutionListeners.forEach(a=>a(o,s));const u=await this._execute(i,n);return this._commandExecutedListeners.forEach(a=>a(o,s)),c.dispose(),u}throw new Error(`[CommandService]: Command "${e}" is not registered.`)}syncExecuteCommand(e,n,s){const r=this._commandRegistry.getCommand(e);if(r){const[i]=r,o={id:i.id,type:i.type,params:n};if(i.type===2){const a=ir(this._commandExecutionStack,l=>l.type===0);a&&(o.params=o.params??{},o.params.trigger=a.id)}const c=this._pushCommandExecutionStack(o),u=this._syncExecute(i,n);return c.dispose(),this._commandExecutedListeners.forEach(a=>a(o,s)),u}throw new Error(`[CommandService]: Command "${e}" is not registered.`)}_pushCommandExecutionStack(e){return this._commandExecutionStack.push(e),D(()=>Q(this._commandExecutionStack,e))}_registerCommand(e){return this._commandRegistry.registerCommand(e)}_registerMultiCommand(e){const n=this._commandRegistry.getCommand(e.id);let s;if(!n)s=new dr(e.id),this._multiCommandDisposables.set(e.id,this._commandRegistry.registerCommand(s));else{if(n[0].multi!==!0)throw new Error("Command has registered as a single command.");s=n[0]}const r=s.registerImplementation(e);return D(()=>{var i;r.dispose(),s.hasImplementations()||(i=this._multiCommandDisposables.get(e.id))==null||i.dispose()})}async _execute(e,n){this._log.log("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${e.id}"`),this._commandExecutingLevel++;let s;try{s=await this._injector.invoke(e.handler,n),this._commandExecutingLevel--}catch(r){throw s=!1,this._commandExecutingLevel=0,r}return s}_syncExecute(e,n){this._log.log("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${e.id}".`),this._commandExecutingLevel++;let s;try{if(s=this._injector.invoke(e.handler,n),s instanceof Promise)throw new Error("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(r){throw s=!1,this._commandExecutingLevel=0,r}return s}},h.CommandService=hr([Xe(0,m.Inject(m.Injector)),Xe(1,at)],h.CommandService);class dr{constructor(e){d(this,"name");d(this,"multi",!0);d(this,"type",0);d(this,"priority",0);d(this,"_implementations",[]);d(this,"handler",async(e,n)=>{if(!this._implementations.length)return!1;const s=e.get(at),r=e.get(ct),i=e.get(m.Injector);for(const o of this._implementations){const c=o.command.preconditions;if(c!=null&&c(r)&&(s.log("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=e,this.name=e}registerImplementation(e){const n={command:e};return this._implementations.push(n),this._implementations.sort((s,r)=>r.command.priority-s.command.priority),D(()=>{var r;const s=this._implementations.indexOf(n);this._implementations.splice(s,1),(r=e.onDispose)==null||r.call(e)})}hasImplementations(){return this._implementations.length>0}}function re(t,e,n){const s=t.map(r=>()=>e.syncExecuteCommand(r.id,r.params,n));return Be(s)}function fr(t,e,n){const s=t.map(r=>()=>e.executeCommand(r.id,r.params,n));return We(s)}const Qe=m.createIdentifier("univer.config-service");class gr{constructor(){d(this,"_config",new Map)}getConfig(e){return this._config.get(e)}setConfig(e,n){this._config.set(e,n)}deleteConfig(e){this._config.delete(e)}}class Je extends M{constructor(){super(...arguments);d(this,"_error$",new b.Subject);d(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}const Er="__default_document_sub_component_id20231101__";class Ze{constructor(){d(this,"_managerInfo",new Map);d(this,"_remove$",new b.Subject);d(this,"remove$",this._remove$.asObservable());d(this,"_andOrUpdate$",new b.Subject);d(this,"andOrUpdate$",this._andOrUpdate$.asObservable());d(this,"_pluginUpdate$",new b.Subject);d(this,"pluginUpdate$",this._pluginUpdate$.asObservable())}getFloatObject(e){return this._getFloatingObject(e)}getFloatObjects(e){return this._getFloatingObjects(e)}dispose(){this._remove$.complete(),this._andOrUpdate$.complete(),this._pluginUpdate$.complete(),this._managerInfo.clear()}clear(e){const n=this._clearByParam(e);this._remove$.next(n)}addOrUpdate(e){const n=this._addByParam(e);this._andOrUpdate$.next(n)}BatchAddOrUpdate(e){const n=[];e.forEach(s=>{n.push(...this._addByParam(s))}),this._andOrUpdate$.next(n)}remove(e){const n=this._removeByParam(e);this._remove$.next(n)}pluginUpdateRefresh(e){this._pluginUpdate$.next(e)}_getFloatingObjects(e){var r;if(e==null)return;const{unitId:n,subComponentId:s}=e;return(r=this._managerInfo.get(n))==null?void 0:r.get(s)}_getFloatingObject(e){var i,o;if(e==null)return;const{unitId:n,subComponentId:s,floatingObjectId:r}=e;return(o=(i=this._managerInfo.get(n))==null?void 0:i.get(s))==null?void 0:o.get(r)}_addByParam(e){const{unitId:n,subComponentId:s,floatingObject:r,floatingObjectId:i}=e;this._managerInfo.has(n)||this._managerInfo.set(n,new Map);const o=this._managerInfo.get(n);return o.has(s)||o.set(s,new Map),o.get(s).set(i,r),[{unitId:n,subComponentId:s,floatingObjectId:i,floatingObject:r}]}_clearByParam(e){const n=this._getFloatingObjects(e),{unitId:s,subComponentId:r}=e,i=[];return n==null||n.forEach((o,c)=>{i.push({unitId:s,subComponentId:r,floatingObjectId:c,floatingObject:o})}),n==null||n.clear(),i}_removeByParam(e){const n=this._getFloatingObjects(e),s=n==null?void 0:n.get(e.floatingObjectId);return s==null?[]:(n==null||n.delete(e.floatingObjectId),[{...e,floatingObject:s}])}}const qe=m.createIdentifier("univer.floating-object.service");class ye{constructor(){d(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(e){this.cursor+=e}}function tn(t,e){let n=0,s=t.length-1;for(;n<=s;){const r=Math.floor((s+n)/2);if(e<t[r]&&(r===0||e>=t[r-1]))return r;if(e>=t[r])n=r+1;else if(e<t[r])s=r-1;else return-1}return-1}function en(t,e){let n=0,s=0,r=0,i=-1,o=t.length-1;for(;n<t.length&&o>=0&&o>=n;){if(s=t[o],o===0?r=0:r=t[o-1],e>=r&&e<=s){i=o;break}if(s=t[n],n===0?r=0:r=t[n-1],e>=r&&e<s){i=n;break}n++,o--}return i}function Rr(t,e){let n=t.length-1;return e<t[0]?-1:e>t[t.length-1]?1/0:(t.length<40||e<=t[20]||e>=t[n-20]?n=en(t,e):n=tn(t,e),n)}function Or(t){const e=new Blob([t],{type:"text/javascript"});return window.URL.createObjectURL(e)}var nn=(t=>(t[t.DEFAULT_SERIES=0]="DEFAULT_SERIES",t[t.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",t))(nn||{}),v=(t=>(t[t.NONE=0]="NONE",t[t.THIN=1]="THIN",t[t.HAIR=2]="HAIR",t[t.DOTTED=3]="DOTTED",t[t.DASHED=4]="DASHED",t[t.DASH_DOT=5]="DASH_DOT",t[t.DASH_DOT_DOT=6]="DASH_DOT_DOT",t[t.DOUBLE=7]="DOUBLE",t[t.MEDIUM=8]="MEDIUM",t[t.MEDIUM_DASHED=9]="MEDIUM_DASHED",t[t.MEDIUM_DASH_DOT=10]="MEDIUM_DASH_DOT",t[t.MEDIUM_DASH_DOT_DOT=11]="MEDIUM_DASH_DOT_DOT",t[t.SLANT_DASH_DOT=12]="SLANT_DASH_DOT",t[t.THICK=13]="THICK",t))(v||{}),sn=(t=>(t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right",t.NONE="none",t.ALL="all",t.OUTSIDE="outside",t.INSIDE="inside",t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(sn||{}),p=(t=>(t[t.UNSUPPORTED=0]="UNSUPPORTED",t[t.RGB=1]="RGB",t[t.HEX=2]="HEX",t[t.THEME=3]="THEME",t))(p||{}),rn=(t=>(t[t.ON=0]="ON",t[t.OFF=1]="OFF",t))(rn||{}),on=(t=>(t[t.CONDITION_TYPE_UNSPECIFIED=0]="CONDITION_TYPE_UNSPECIFIED",t[t.NUMNUMBER_BETWEENR_GREATER=1]="NUMNUMBER_BETWEENR_GREATER",t[t.NUMBER_GREATER_THAN_EQ=2]="NUMBER_GREATER_THAN_EQ",t[t.NUMBER_LESS=3]="NUMBER_LESS",t[t.NUMBER_LESS_THAN_EQ=4]="NUMBER_LESS_THAN_EQ",t[t.NUMBER_EQ=5]="NUMBER_EQ",t[t.NUMBER_NOT_EQ=6]="NUMBER_NOT_EQ",t[t.NUMBER_BETWEEN=7]="NUMBER_BETWEEN",t[t.NUMBER_NOT_BETWEEN=8]="NUMBER_NOT_BETWEEN",t[t.TEXT_CONTAINS=9]="TEXT_CONTAINS",t[t.TEXT_NOT_CONTAINS=10]="TEXT_NOT_CONTAINS",t[t.TEXT_STARTS_WITH=11]="TEXT_STARTS_WITH",t[t.TEXT_ENDS_WITH=12]="TEXT_ENDS_WITH",t[t.TEXT_EQ=13]="TEXT_EQ",t[t.TEXT_IS_EMAIL=14]="TEXT_IS_EMAIL",t[t.TEXT_IS_URL=15]="TEXT_IS_URL",t[t.DATE_EQ=16]="DATE_EQ",t[t.DATE_BEFORE=17]="DATE_BEFORE",t[t.DATE_AFTER=18]="DATE_AFTER",t[t.DATE_ON_OR_BEFORE=19]="DATE_ON_OR_BEFORE",t[t.DATE_ON_OR_AFTER=20]="DATE_ON_OR_AFTER",t[t.DATE_BETWEEN=21]="DATE_BETWEEN",t[t.DATE_NOT_BETWEEN=22]="DATE_NOT_BETWEEN",t[t.DATE_IS_VALID=23]="DATE_IS_VALID",t[t.ONE_OF_RANGE=24]="ONE_OF_RANGE",t[t.ONE_OF_LIST=25]="ONE_OF_LIST",t[t.BLANK=26]="BLANK",t[t.NOT_BLANK=27]="NOT_BLANK",t[t.CUSTOM_FORMULA=28]="CUSTOM_FORMULA",t[t.BOOLEAN=29]="BOOLEAN",t[t.TEXT_NOT_EQ=30]="TEXT_NOT_EQ",t[t.DATE_NOT_EQ=31]="DATE_NOT_EQ",t))(on||{}),cn=(t=>(t[t.PASTE_NORMAL=0]="PASTE_NORMAL",t[t.PASTE_NO_BORDERS=1]="PASTE_NO_BORDERS",t[t.PASTE_FORMAT=2]="PASTE_FORMAT",t[t.PASTE_FORMULA=3]="PASTE_FORMULA",t[t.PASTE_DATA_VALIDATION=4]="PASTE_DATA_VALIDATION",t[t.PASTE_VALUES=5]="PASTE_VALUES",t[t.PASTE_CONDITIONAL_FORMATTING=6]="PASTE_CONDITIONAL_FORMATTING",t[t.PASTE_COLUMN_WIDTHS=7]="PASTE_COLUMN_WIDTHS",t))(cn||{}),an=(t=>(t[t.DOCUMENT=0]="DOCUMENT",t[t.PROJECT=1]="PROJECT",t))(an||{}),ln=(t=>(t[t.COLUMNS=0]="COLUMNS",t[t.ROWS=1]="ROWS",t))(ln||{}),un=(t=>(t[t.UP=0]="UP",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.LEFT=3]="LEFT",t))(un||{});function Ar(t){switch(t){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var hn=(t=>(t[t.NUMBER_FORMAT_TYPE_UNSPECIFIED=0]="NUMBER_FORMAT_TYPE_UNSPECIFIED",t[t.TEXT=1]="TEXT",t[t.NUMBER=2]="NUMBER",t[t.PERCENT=3]="PERCENT",t[t.CURRENCY=4]="CURRENCY",t[t.DATE=5]="DATE",t[t.TIME=6]="TIME",t[t.DATE_TIME=7]="DATE_TIME",t[t.SCIENTIFIC=8]="SCIENTIFIC",t))(hn||{}),_n=(t=>(t[t.INTERPOLATION_POINT_TYPE_UNSPECIFIED=0]="INTERPOLATION_POINT_TYPE_UNSPECIFIED",t[t.MIN=1]="MIN",t[t.MAX=2]="MAX",t[t.NUMBER=3]="NUMBER",t[t.PERCENT=4]="PERCENT",t[t.PERCENTILE=5]="PERCENTILE",t))(_n||{}),Mt=(t=>(t.EN_US="enUS",t.ZH_CN="zhCN",t))(Mt||{}),dn=(t=>(t[t.RANGE=0]="RANGE",t[t.SHEET=1]="SHEET",t))(dn||{}),fn=(t=>(t[t.RELATIVE_DATE_UNSPECIFIED=0]="RELATIVE_DATE_UNSPECIFIED",t[t.PAST_YEAR=1]="PAST_YEAR",t[t.PAST_MONTH=2]="PAST_MONTH",t[t.PAST_WEEK=3]="PAST_WEEK",t[t.YESTERDAY=4]="YESTERDAY",t[t.TODAY=5]="TODAY",t[t.TOMORROW=6]="TOMORROW",t))(fn||{}),gn=(t=>(t[t.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",t[t.TEXT_BOX=1]="TEXT_BOX",t[t.RECTANGLE=2]="RECTANGLE",t[t.ROUND_RECTANGLE=3]="ROUND_RECTANGLE",t[t.ELLIPSE=4]="ELLIPSE",t[t.ARC=5]="ARC",t[t.BENT_ARROW=6]="BENT_ARROW",t[t.BENT_UP_ARROW=7]="BENT_UP_ARROW",t[t.BEVEL=8]="BEVEL",t[t.BLOCK_ARC=9]="BLOCK_ARC",t[t.BRACE_PAIR=10]="BRACE_PAIR",t[t.BRACKET_PAIR=11]="BRACKET_PAIR",t[t.CAN=12]="CAN",t[t.CHEVRON=13]="CHEVRON",t[t.CHORD=14]="CHORD",t[t.CLOUD=15]="CLOUD",t[t.CORNER=16]="CORNER",t[t.CUBE=17]="CUBE",t[t.CURVED_DOWN_ARROW=18]="CURVED_DOWN_ARROW",t[t.CURVED_LEFT_ARROW=19]="CURVED_LEFT_ARROW",t[t.CURVED_RIGHT_ARROW=20]="CURVED_RIGHT_ARROW",t[t.CURVED_UP_ARROW=21]="CURVED_UP_ARROW",t[t.DECAGON=22]="DECAGON",t[t.DIAGONAL_STRIPE=23]="DIAGONAL_STRIPE",t[t.DIAMOND=24]="DIAMOND",t[t.DODECAGON=25]="DODECAGON",t[t.DONUT=26]="DONUT",t[t.DOUBLE_WAVE=27]="DOUBLE_WAVE",t[t.DOWN_ARROW=28]="DOWN_ARROW",t[t.DOWN_ARROW_CALLOUT=29]="DOWN_ARROW_CALLOUT",t[t.FOLDED_CORNER=30]="FOLDED_CORNER",t[t.FRAME=31]="FRAME",t[t.HALF_FRAME=32]="HALF_FRAME",t[t.HEART=33]="HEART",t[t.HEPTAGON=34]="HEPTAGON",t[t.HEXAGON=35]="HEXAGON",t[t.HOME_PLATE=36]="HOME_PLATE",t[t.HORIZONTAL_SCROLL=37]="HORIZONTAL_SCROLL",t[t.IRREGULAR_SEAL_1=38]="IRREGULAR_SEAL_1",t[t.IRREGULAR_SEAL_2=39]="IRREGULAR_SEAL_2",t[t.LEFT_ARROW=40]="LEFT_ARROW",t[t.LEFT_ARROW_CALLOUT=41]="LEFT_ARROW_CALLOUT",t[t.LEFT_BRACE=42]="LEFT_BRACE",t[t.LEFT_BRACKET=43]="LEFT_BRACKET",t[t.LEFT_RIGHT_ARROW=44]="LEFT_RIGHT_ARROW",t[t.LEFT_RIGHT_ARROW_CALLOUT=45]="LEFT_RIGHT_ARROW_CALLOUT",t[t.LEFT_RIGHT_UP_ARROW=46]="LEFT_RIGHT_UP_ARROW",t[t.LEFT_UP_ARROW=47]="LEFT_UP_ARROW",t[t.LIGHTNING_BOLT=48]="LIGHTNING_BOLT",t[t.MATH_DIVIDE=49]="MATH_DIVIDE",t[t.MATH_EQUAL=50]="MATH_EQUAL",t[t.MATH_MINUS=51]="MATH_MINUS",t[t.MATH_MULTIPLY=52]="MATH_MULTIPLY",t[t.MATH_NOT_EQUAL=53]="MATH_NOT_EQUAL",t[t.MATH_PLUS=54]="MATH_PLUS",t[t.MOON=55]="MOON",t[t.NO_SMOKING=56]="NO_SMOKING",t[t.NOTCHED_RIGHT_ARROW=57]="NOTCHED_RIGHT_ARROW",t[t.OCTAGON=58]="OCTAGON",t[t.PARALLELOGRAM=59]="PARALLELOGRAM",t[t.PENTAGON=60]="PENTAGON",t[t.PIE=61]="PIE",t[t.PLAQUE=62]="PLAQUE",t[t.PLUS=63]="PLUS",t[t.QUAD_ARROW=64]="QUAD_ARROW",t[t.QUAD_ARROW_CALLOUT=65]="QUAD_ARROW_CALLOUT",t[t.RIBBON=66]="RIBBON",t[t.RIBBON_2=67]="RIBBON_2",t[t.RIGHT_ARROW=68]="RIGHT_ARROW",t[t.RIGHT_ARROW_CALLOUT=69]="RIGHT_ARROW_CALLOUT",t[t.RIGHT_BRACE=70]="RIGHT_BRACE",t[t.RIGHT_BRACKET=71]="RIGHT_BRACKET",t[t.ROUND_1_RECTANGLE=72]="ROUND_1_RECTANGLE",t[t.ROUND_2_DIAGONAL_RECTANGLE=73]="ROUND_2_DIAGONAL_RECTANGLE",t[t.ROUND_2_SAME_RECTANGLE=74]="ROUND_2_SAME_RECTANGLE",t[t.RIGHT_TRIANGLE=75]="RIGHT_TRIANGLE",t[t.SMILEY_FACE=76]="SMILEY_FACE",t[t.SNIP_1_RECTANGLE=77]="SNIP_1_RECTANGLE",t[t.SNIP_2_DIAGONAL_RECTANGLE=78]="SNIP_2_DIAGONAL_RECTANGLE",t[t.SNIP_2_SAME_RECTANGLE=79]="SNIP_2_SAME_RECTANGLE",t[t.SNIP_ROUND_RECTANGLE=80]="SNIP_ROUND_RECTANGLE",t[t.STAR_10=81]="STAR_10",t[t.STAR_12=82]="STAR_12",t[t.STAR_16=83]="STAR_16",t[t.STAR_24=84]="STAR_24",t[t.STAR_32=85]="STAR_32",t[t.STAR_4=86]="STAR_4",t[t.STAR_5=87]="STAR_5",t[t.STAR_6=88]="STAR_6",t[t.STAR_7=89]="STAR_7",t[t.STAR_8=90]="STAR_8",t[t.STRIPED_RIGHT_ARROW=91]="STRIPED_RIGHT_ARROW",t[t.SUN=92]="SUN",t[t.TRAPEZOID=93]="TRAPEZOID",t[t.TRIANGLE=94]="TRIANGLE",t[t.UP_ARROW=95]="UP_ARROW",t[t.UP_ARROW_CALLOUT=96]="UP_ARROW_CALLOUT",t[t.UP_DOWN_ARROW=97]="UP_DOWN_ARROW",t[t.UTURN_ARROW=98]="UTURN_ARROW",t[t.VERTICAL_SCROLL=99]="VERTICAL_SCROLL",t[t.WAVE=100]="WAVE",t[t.WEDGE_ELLIPSE_CALLOUT=101]="WEDGE_ELLIPSE_CALLOUT",t[t.WEDGE_RECTANGLE_CALLOUT=102]="WEDGE_RECTANGLE_CALLOUT",t[t.WEDGE_ROUND_RECTANGLE_CALLOUT=103]="WEDGE_ROUND_RECTANGLE_CALLOUT",t[t.FLOW_CHART_ALTERNATE_PROCESS=104]="FLOW_CHART_ALTERNATE_PROCESS",t[t.FLOW_CHART_COLLATE=105]="FLOW_CHART_COLLATE",t[t.FLOW_CHART_CONNECTOR=106]="FLOW_CHART_CONNECTOR",t[t.FLOW_CHART_DECISION=107]="FLOW_CHART_DECISION",t[t.FLOW_CHART_DELAY=108]="FLOW_CHART_DELAY",t[t.FLOW_CHART_DISPLAY=109]="FLOW_CHART_DISPLAY",t[t.FLOW_CHART_DOCUMENT=110]="FLOW_CHART_DOCUMENT",t[t.FLOW_CHART_EXTRACT=111]="FLOW_CHART_EXTRACT",t[t.FLOW_CHART_INPUT_OUTPUT=112]="FLOW_CHART_INPUT_OUTPUT",t[t.FLOW_CHART_INTERNAL_STORAGE=113]="FLOW_CHART_INTERNAL_STORAGE",t[t.FLOW_CHART_MAGNETIC_DISK=114]="FLOW_CHART_MAGNETIC_DISK",t[t.FLOW_CHART_MAGNETIC_DRUM=115]="FLOW_CHART_MAGNETIC_DRUM",t[t.FLOW_CHART_MAGNETIC_TAPE=116]="FLOW_CHART_MAGNETIC_TAPE",t[t.FLOW_CHART_MANUAL_INPUT=117]="FLOW_CHART_MANUAL_INPUT",t[t.FLOW_CHART_MANUAL_OPERATION=118]="FLOW_CHART_MANUAL_OPERATION",t[t.FLOW_CHART_MERGE=119]="FLOW_CHART_MERGE",t[t.FLOW_CHART_MULTIDOCUMENT=120]="FLOW_CHART_MULTIDOCUMENT",t[t.FLOW_CHART_OFFLINE_STORAGE=121]="FLOW_CHART_OFFLINE_STORAGE",t[t.FLOW_CHART_OFFPAGE_CONNECTOR=122]="FLOW_CHART_OFFPAGE_CONNECTOR",t[t.FLOW_CHART_ONLINE_STORAGE=123]="FLOW_CHART_ONLINE_STORAGE",t[t.FLOW_CHART_OR=124]="FLOW_CHART_OR",t[t.FLOW_CHART_PREDEFINED_PROCESS=125]="FLOW_CHART_PREDEFINED_PROCESS",t[t.FLOW_CHART_PREPARATION=126]="FLOW_CHART_PREPARATION",t[t.FLOW_CHART_PROCESS=127]="FLOW_CHART_PROCESS",t[t.FLOW_CHART_PUNCHED_CARD=128]="FLOW_CHART_PUNCHED_CARD",t[t.FLOW_CHART_PUNCHED_TAPE=129]="FLOW_CHART_PUNCHED_TAPE",t[t.FLOW_CHART_SORT=130]="FLOW_CHART_SORT",t[t.FLOW_CHART_SUMMING_JUNCTION=131]="FLOW_CHART_SUMMING_JUNCTION",t[t.FLOW_CHART_TERMINATOR=132]="FLOW_CHART_TERMINATOR",t[t.ARROW_EAST=133]="ARROW_EAST",t[t.ARROW_NORTH_EAST=134]="ARROW_NORTH_EAST",t[t.ARROW_NORTH=135]="ARROW_NORTH",t[t.SPEECH=136]="SPEECH",t[t.STARBURST=137]="STARBURST",t[t.TEARDROP=138]="TEARDROP",t[t.ELLIPSE_RIBBON=139]="ELLIPSE_RIBBON",t[t.ELLIPSE_RIBBON_2=140]="ELLIPSE_RIBBON_2",t[t.CLOUD_CALLOUT=141]="CLOUD_CALLOUT",t[t.CUSTOM=142]="CUSTOM",t))(gn||{}),ie=(t=>(t[t.GRID=0]="GRID",t[t.KANBAN=1]="KANBAN",t[t.GANTT=2]="GANTT",t))(ie||{}),Ot=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",t))(Ot||{}),En=(t=>(t[t.DASH=0]="DASH",t[t.DASH_DOT_DOT_HEAVY=1]="DASH_DOT_DOT_HEAVY",t[t.DASH_DOT_HEAVY=2]="DASH_DOT_HEAVY",t[t.DASHED_HEAVY=3]="DASHED_HEAVY",t[t.DASH_LONG=4]="DASH_LONG",t[t.DASH_LONG_HEAVY=5]="DASH_LONG_HEAVY",t[t.DOT_DASH=6]="DOT_DASH",t[t.DOT_DOT_DASH=7]="DOT_DOT_DASH",t[t.DOTTED=8]="DOTTED",t[t.DOTTED_HEAVY=9]="DOTTED_HEAVY",t[t.DOUBLE=10]="DOUBLE",t[t.NONE=11]="NONE",t[t.SINGLE=12]="SINGLE",t[t.THICK=13]="THICK",t[t.WAVE=14]="WAVE",t[t.WAVY_DOUBLE=15]="WAVY_DOUBLE",t[t.WAVY_HEAVY=16]="WAVY_HEAVY",t[t.WORDS=17]="WORDS",t))(En||{}),nt=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT",t[t.JUSTIFIED=4]="JUSTIFIED",t))(nt||{}),lt=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TOP=1]="TOP",t[t.MIDDLE=2]="MIDDLE",t[t.BOTTOM=3]="BOTTOM",t))(lt||{}),ut=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OVERFLOW=1]="OVERFLOW",t[t.CLIP=2]="CLIP",t[t.WRAP=3]="WRAP",t))(ut||{}),Tt=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ITALIC=1]="ITALIC",t))(Tt||{}),Pt=(t=>(t[t.NORMAL=0]="NORMAL",t[t.BOLD=1]="BOLD",t))(Pt||{}),Ft=(t=>(t[t.NORMAL=0]="NORMAL",t[t.SUBSCRIPT=1]="SUBSCRIPT",t[t.SUPERSCRIPT=2]="SUPERSCRIPT",t))(Ft||{}),C=(t=>(t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t))(C||{}),At=(t=>(t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER",t[t.BOOLEAN=3]="BOOLEAN",t[t.FORCE_STRING=4]="FORCE_STRING",t))(At||{}),H=(t=>(t[t.DARK1=0]="DARK1",t[t.LIGHT1=1]="LIGHT1",t[t.DARK2=2]="DARK2",t[t.LIGHT2=3]="LIGHT2",t[t.ACCENT1=4]="ACCENT1",t[t.ACCENT2=5]="ACCENT2",t[t.ACCENT3=6]="ACCENT3",t[t.ACCENT4=7]="ACCENT4",t[t.ACCENT5=8]="ACCENT5",t[t.ACCENT6=9]="ACCENT6",t[t.HYPERLINK=10]="HYPERLINK",t[t.FOLLOWED_HYPERLINK=11]="FOLLOWED_HYPERLINK",t))(H||{}),Ht=(t=>(t.OFFICE="Office",t.OFFICE_2007_2010="Office 2007-2010",t.GRAYSCALE="Grayscale",t.BLUE_WARM="Blue Warm",t.BLUE="Blue",t.BLUE_II="Blue II",t.BLUE_GREEN="Blue Green",t.GREEN="Green",t.GREEN_YELLOW="Green Yellow",t.YELLOW="Yellow",t.YELLOW_ORANGE="Yellow Orange",t.ORANGE="Orange",t.ORANGE_RED="Orange Red",t.RED_ORANGE="Red Orange",t.RED="Red",t.RED_VIOLET="Red Violet",t.VIOLET="Violet",t.VIOLET_II="Violet II",t.MEDIAN="Median",t.PAPER="Paper",t.MARQUEE="Marquee",t.SLIPSTREAM="Slipstream",t.Aspect="Aspect",t))(Ht||{});const Rn={[Ht.OFFICE]:{[H.ACCENT1]:"#4472C4",[H.ACCENT2]:"#ED7D31",[H.ACCENT3]:"#A5A5A5",[H.ACCENT4]:"#70AD47",[H.ACCENT5]:"#5B9BD5",[H.ACCENT6]:"#70AD47",[H.DARK1]:"#000000",[H.DARK2]:"#44546A",[H.LIGHT1]:"#FFFFFF",[H.LIGHT2]:"#E7E6E6",[H.HYPERLINK]:"#0563C1",[H.FOLLOWED_HYPERLINK]:"#954F72"}};class Wt{constructor(){d(this,"_themeValue",H.LIGHT1);d(this,"_themeColors");d(this,"_themeTint");d(this,"_rgbValue","");d(this,"_colorType");this._colorType=p.UNSUPPORTED,this._themeColors=Ht.OFFICE,this._themeTint=0}asRgbColor(){return new Bt(this._rgbValue,this)}asThemeColor(){return new Gt(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case p.THEME:return this.asThemeColor();case p.RGB:return this.asRgbColor();case p.UNSUPPORTED:throw Error("unsupported color type")}}setRgbColor(e){return this._colorType=p.RGB,this._rgbValue=e,this}setThemeColors(e){this._colorType=p.THEME,this._themeColors=e}setThemeTint(e){this._colorType=p.THEME,this._themeTint=e}setThemeColor(e){return this._colorType=p.THEME,this._themeValue=e,this}getColorType(){return this._colorType}}class st{constructor(e){d(this,"_builder");this._builder=e}static rgbColorToHexValue(e){return`#${((1<<24)+(e.getRed()<<16)+(e.getGreen()<<8)+e.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(e){e?e.indexOf("#")>-1&&(e=e.substring(1)):e="#000000";const n=+`0x${e[0]}${e[1]}`,s=+`0x${e[2]}${e[3]}`,r=+`0x${e[4]}${e[5]}`;return new Wt().setRgbColor(`rgb(${n},${s},${r})`).asRgbColor()}static hexToRgbString(e){const n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(n,(i,o,c,u)=>o+o+c+c+u+u);const s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let r=null;if(s){const i=parseInt(s[1],16),o=parseInt(s[2],16),c=parseInt(s[3],16);r=`rgba(${i},${o},${c})`}return r}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new st(this._builder)}equals(e){return!1}}class On{constructor(e){d(this,"_saturation",0);d(this,"_hue",0);d(this,"_lightness",0);d(this,"_alpha",0);const n=e.getRed()/255,s=e.getGreen()/255,r=e.getBlue()/255,i=e.getAlpha()/255,o=Math.min(n,Math.min(s,r)),c=Math.max(n,Math.max(s,r)),u=c-o;if(c===o){this._hue=0,this._saturation=0,this._lightness=c;return}this._lightness=(o+c)/2,this._lightness<.5?this._saturation=u/(c+o):this._saturation=u/(2-c-o),n===c&&(this._hue=(s-r)/u),s===c&&(this._hue=2+(r-n)/u),r===c&&(this._hue=4+(n-s)/u),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const e=new Wt;if(this._saturation===0)return e.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),e.asRgbColor();let n;this._lightness<.5?n=this._lightness*(1+this._saturation):n=this._lightness+this._saturation-this._lightness*this._saturation;const s=2*this._lightness-n,r=this._hue/360,i=r+1/3,o=this.setColor(n,s,i),c=this.setColor(n,s,r),u=r-1/3,a=this.setColor(n,s,u);return e.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(c*255)},${Math.round(a*255)},${this._alpha*255})`),e.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(e,n,s){s<0&&(s+=1),s>1&&(s-=1);let r;return 6*s<1?r=n+(e-n)*6*s:2*s<1?r=e:3*s<2?r=n+(e-n)*(2/3-s)*6:r=n,r}setLightness(e){this._lightness=e}}const k=class k extends st{constructor(n,s){super(s);d(this,"_cssString");d(this,"_red");d(this,"_green");d(this,"_blue");d(this,"_alpha");let r=n.match(k.RGBA_EXTRACT);if(r){const i=+r[1],o=+r[2],c=+r[3],u=+r[4];this._cssString=n,this._red=i,this._green=o,this._blue=c,this._alpha=u;return}if(r=n.match(k.RGB_EXTRACT),r){const i=+r[1],o=+r[2],c=+r[3];this._cssString=n,this._red=i,this._green=o,this._blue=c,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return st.rgbColorToHexValue(this)}getRed(){let n=this._red+k.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+k.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+k.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return p.RGB}clone(){return new k(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof k?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};d(k,"RGB_COLOR_AMT",0),d(k,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),d(k,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Bt=k;const q=class q extends st{constructor(n,s,r,i){super(i);d(this,"_themeColorType");d(this,"_themeTint");d(this,"_themeColors");this._themeColorType=n,this._themeTint=s,this._themeColors=r}lumValue(n,s){if(n==null)return s;let r;return n<0?r=s*(1+n):r=s*(1-n)+(255-255*(1-n)),r}asRgbColor(){const n=Rn[this._themeColors];if(n==null)throw new Error("not find themeColors type");const s=n[this._themeColorType];if(s==null)throw new Error("not find themeColors value");let r;if(q._cacheThemeColor.has(this._themeColors)){if(r=q._cacheThemeColor.get(this._themeColors),r.has(this._themeColorType))return r.get(this._themeColorType)}else r=new Map,q._cacheThemeColor.set(this._themeColors,r);const i=new On(st.hexValueToRgbColor(s));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return r.set(this._themeColorType,o),o}clone(){return new q(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof q?n._themeColorType===this._themeColorType:!1}getColorType(){return p.THEME}getThemeColorType(){return this._themeColorType}};d(q,"_cacheThemeColor",new Map);let Gt=q;var F=(t=>(t[t.COVER=0]="COVER",t[t.REPLACE=1]="REPLACE",t[t.INTERSECTION=2]="INTERSECTION",t))(F||{});let mr=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");const x=t=>t!=null,An=t=>{const e=Object.keys(t),n=/^\d+$/;let s=0;for(let r=0;r<e.length;r++){const i=e[r];if(!n.test(i))return-1;const o=parseInt(i)+1;o>s&&(s=o)}return s};class L{constructor(...e){d(this,"_objectArray");d(this,"_length",0);switch(e.length){case 0:{this._objectArray={},this._length=0;return}case 1:{if(typeof e[0]=="number"){this._objectArray={},this._length=e[0];return}const n=An(e[0]);if(n>-1){this._objectArray=e[0],this._length=n;return}throw new Error(`create object array error ${e[0]}`)}case 2:{if(An(e[0])>-1){this._objectArray=e[0],this._length=e[1];return}throw new Error(`create object array error ${JSON.stringify(e[0])}`)}}}static objectKeys(e){if(e){const n=Object.keys(e),s=n.indexOf("length");return s>-1&&n.splice(s,1),n}return[]}static getMaxLength(e){if(e){if(e.length)return e.length;const n=L.objectKeys(e);if(n.length)return Math.max(...n)+1}return 0}obtain(e,n){return this._objectArray[e]??n}getKeys(){return L.objectKeys(this._objectArray)}get(e){return this._objectArray[e]}set(e,n){if(e<0)throw new Error(`[ObjectArray]: index ${e} is invalid!`);const s=this._length;this._objectArray[e]=n,e>=s&&(this._length=e+1)}pop(){const e=this._length,n=this._objectArray;if(e>0){const s=e-1,r=n[s];return s>0&&(delete n[s],this._length--),r}return null}push(e){if(x(e)){let n=this._length;const s=this._objectArray;s[n++]=e,this._length=n}}first(){return this._objectArray[0]}last(){const e=this._length-1;return this._objectArray[e]}shift(){const e=this._length;if(e>0){const n=this._objectArray[0],s=e-1;let r;for(let i=0;i<s;i++)r=this._objectArray[i+1],x(r)&&(this._objectArray[i]=r);return this._length--,delete this._objectArray[s],n}return null}unshift(e){if(x(e)){const n=this._length,s=this._objectArray,r=n+1;let i=s[0];for(let o=1;o<r;o++){const c=this._objectArray[o];x(i)&&(s[o]=i),i=c}s[0]=e,this._length=r}}clear(){this._objectArray={},this._length=0}getLength(){return this._length}getSizeOf(){const e=this._objectArray;return Object.keys(e).length}toJSON(){return this._objectArray}toArray(){const e=new Array,n=this._objectArray,s=Object.keys(n),r=s.length;for(let i=0;i<r;i++){const o=+s[i];e[o]=n[o]}return e}forEach(e){const n=this._objectArray,s=Object.keys(n),r=s.length;for(let i=0;i<r;i++){const o=+s[i];if(e(o,n[o])===!1)return this}return this}clone(e){const n=new L;return e?this.forEach((s,r)=>{n.set(s,e(r))}):this.forEach((s,r)=>{n.set(s,r)}),n}isEmpty(){const e=this._objectArray;return Object.keys(e).length===0}delete(e){this.splice(e,1)}realDelete(e){if(this._length>0){const s=e+1,r=this._objectArray;let i=0;const o={};for(let c=e;c<s;c++){const u=r[c];x(u)&&(delete r[c],o[i]=u,i++)}}}includes(e){const n=this._objectArray,s=Object.keys(n),r=s.length;for(let i=0;i<r;i++){const o=+s[i];if(n[o]===e)return!0}return!1}slice(e,n){const s=this._objectArray;if(this._length>0){const i={};let o=0;for(let c=e;c<n;c++){const u=s[c];x(u)&&(i[o]=s[c],o++)}return new L(i,o)}return new L}concat(e){const n=this._objectArray,s=Object.keys(n),r=s.length,i=e._objectArray,o=Object.keys(i),c=o.length,u=new L(r+c),a=u._objectArray;let l=0;for(let _=0;_<r;_++,l++){const f=s[_];a[l]=n[f]}for(let _=0;_<c;_++,l++){const f=o[_];a[l]=i[f]}return u}find(e){const n=this._objectArray,s=Object.keys(n),r=s.length;for(let i=0;i<r;i++){const o=+s[i],c=n[o];if(e(o,c)===!0)return c}return null}splice(e,n){const s=this._length;if(s>0){const r=e+n,i=this._objectArray;let o=0;const c={};for(let l=e;l<r;l++){const _=i[l];x(_)&&(delete i[l],c[o]=_,o++)}const u=r-e,a=s;if(this._length-=u,this._length<=0)this._objectArray={},this._length=0;else for(let l=r;l<a;l++){const _=i[l];x(_)&&(i[l-u]=i[l],delete i[l])}return new L(c,o)}return new L}findIndex(e){const n=this._objectArray,s=Object.keys(n),r=s.length;for(let i=0;i<r;i++){const o=+s[i];if(e(o,n[o])===!0)return i}return-1}map(e){const n=this._objectArray,s=Object.keys(n),r=s.length,i={};for(let o=0;o<r;o++){const c=+s[o],u=n[c];i[o]=e(u)}return new L(i)}filter(e){const n=this._objectArray,s=Object.keys(n),r=s.length,i={};let o=0;for(let c=0;c<r;c++){const u=+s[c],a=n[u];e(u,a)&&(i[o]=a,o++)}return new L(i,o)}insert(e,n){const s=this._length,r=this._objectArray;for(let i=s-1;i>=e;i--)r[i+1]=r[i];return r[e]=n,this._length=s+1,this}move(e,n,s){const r=e>s;if(!r&&e+n>s)throw new Error("Invalid move operation");return r?this._moveBackward(e,n,s):this._moveForward(e,n,s),this}_moveBackward(e,n,s){const r=this._objectArray,i=[];for(let o=e;o<e+n;o++)i.push(r[o]);for(let o=e-1;o>=s;o--){const c=r[o];r[o+n]=c,c==null&&delete r[o+n]}i.forEach((o,c)=>{r[s+c]=o})}_moveForward(e,n,s){const r=this._objectArray,i=[];for(let o=e;o<e+n;o++)i.push(r[o]);for(let o=e+n;o<s;o++){const c=r[o];r[o-n]=c,c==null&&delete r[o-n]}i.forEach((o,c)=>{r[s+c-n]=o})}inserts(e,n){const s=n._objectArray,r=n._length,i=this._objectArray,c=this._length-1;for(let u=c;u>=e;u--){const a=i[u];x(a)&&(delete i[u],i[u+r]=a)}for(let u=0;u<r;u++){const a=s[u];x(a)&&(i[u+e]=s[u])}return this._length+=r,this}[Symbol.iterator](){return new $t(this)}}class $t{constructor(e){d(this,"_array");d(this,"_keys");d(this,"_cursor");this._array=e,this._keys=e.getKeys(),this._cursor=0}next(){const e=this._array,n=this._keys,s=this._cursor;if(s<n.length){const r=n[s],i=e.get(+r);return this._cursor++,{value:i,done:!1}}return{value:null,done:!0}}[Symbol.iterator](){return new $t(this._array)}}class W{constructor(e={}){d(this,"_option");d(this,"_matrix");this._setOriginValue(e)}static MakeObjectMatrixSize(e){return new W({[e-1]:{}})}getMatrix(){return this._matrix}forEach(e){const n=this._option.getKeys();for(let s=0;s<n.length;s++){const r=+n[s],i=this.getRow(r);if(e(r,i)===!1)return this}return this}forRow(e){const n=this._option.getKeys();for(let s=0;s<n.length;s++){const r=+n[s],i=this.getRow(r);if(e(r,i.getKeys().map(c=>+c))===!1)return}}forValue(e){const n=this._option.getKeys();for(let s=0;s<n.length;s++){const r=+n[s],i=this.getRow(r),o=i.getKeys(),c=o.length;for(let u=0;u<c;u++){const a=+o[u],l=i.get(a);if(e(r,a,l)===!1)return this}}return this}swapRow(e,n){const s=this._option.get(e),r=this._option.get(n);this._option.set(n,s),this._option.set(e,r)}getRow(e){const n=this._option.get(e);if(n)return new L(n)}getRowOrCreate(e){const n=this.getRow(e);if(n==null){const s={};return this._option.set(e,s),new L(s)}return n}reset(){this._setOriginValue({})}hasValue(){const e=this._option;for(const n of e)if(!new L(n).isEmpty())return!0;return!1}getValue(e,n){const s=this.getRow(e);return s?s.get(n):null}setValue(e,n,s){this.getRowOrCreate(e).set(n,s)}deleteValue(e,n){const s=this.getRow(e);s&&s.delete(n)}realDeleteValue(e,n){const s=this.getRow(e);s&&(s.realDelete(n),s.getSizeOf()||this._option.realDelete(e))}spliceRows(e,n){const s=this._option.splice(e,n);return new W(s.toJSON())}sliceRows(e,n){const s=this._option.slice(e,n);return new W(s.toJSON())}pushRow(e){this._option.push(e.toJSON())}moveRows(e,n,s){this._option.move(e,n,s)}moveColumns(e,n,s){this._option.forEach((r,i)=>{new L(i).move(e,n,s)})}insertRow(e,n){this._option.insert(e,n.toJSON())}insertRowCount(e,n){this._option.inserts(e,new L(n))}insertRows(e,n){this._option.inserts(e,n._option),console.dir(this._option)}spliceColumns(e,n){const s=new W;return this._option.forEach((r,i)=>{for(let c=e;c<e+n;c++)s.setValue(r,c-e,this.getValue(r,c));const o=this._option.get(r);o&&new L(o).splice(e,n)}),s}sliceColumns(e,n){const s=new W;return this._option.forEach((r,i)=>{for(let o=e;o<e+n;o++)s.setValue(r,o-e,this.getValue(r,o))}),s}insertColumns(e,n){let s=0;n.forEach(r=>{const i=n.getRow(r);if(i)return s=i.getLength(),!1}),this.forEach((r,i)=>{var o,c;for(let u=e;u<e+s;u++)(o=n.getRow(r))==null||o.get(u-e),i.insert(u,(c=n.getRow(r))==null?void 0:c.get(u-e))})}insertColumnCount(e,n){this.forEach((s,r)=>{r.inserts(e,new L(n))})}getFragment(e,n,s,r){const i=new W;for(let o=e;o<=n;o++){const c=new L;for(let u=s;u<=r;u++){const a=this.getValue(o,u);c.push(a)}i.pushRow(c)}return i}getSlice(e,n,s,r){const i=new W;for(let o=e;o<=n;o++)for(let c=s;c<=r;c++){const u=this.getValue(o,c);u&&i.setValue(o,c,A.deepClone(u))}return i}getSizeOf(){return this._option.getSizeOf()}getLength(){return this._option.getLength()}getRange(){const s=this.getLength()-1;let r=0;const i=this.getLength();for(let o=0;o<i;o++){const c=this.getRow(o);if(c){const u=c.getLength()-1;r=u>r?u:r}}return{startRow:0,startColumn:0,endRow:s,endColumn:r}}toNativeArray(){const e=new Array;return this.forValue((n,s,r)=>{e.push(r)}),e}toArray(){return this._option.toArray().map(e=>new L(e).toArray())}toJSON(){return this._matrix}getData(){const e=JSON.stringify(this);return JSON.parse(e)}getArrayData(){let e=0,n=0,s=!1,r=!1;const i=new W;return this.forEach((o,c)=>{s||(s=!0,e=o),c.forEach((u,a)=>{r?u<n&&(n=u):(r=!0,n=u);const l=this.getValue(o,u);i.setValue(o-e,u-n,l)})}),i.getData()}getDataRange(){let e=0,n=0,s=0,r=!1,i=!1;this.forEach((c,u)=>{r||(r=!0,e=c);const a=u.getLength()-1;a>s&&(s=a),u.forEach((l,_)=>{i?l<n&&(n=l):(i=!0,n=l)})});const o=e+this.getSizeOf()-1;return{startRow:e,startColumn:n,endRow:o,endColumn:s}}getDiscreteRanges(){const e=[];return this.forEach((n,s)=>{s.forEach((r,i)=>{let o=!1;for(const c of e)if(n>=c.startRow&&n<=c.endRow+1&&r>=c.startColumn&&r<=c.endColumn+1){c.endRow=Math.max(n,c.endRow),c.endColumn=Math.max(r,c.endColumn),o=!0;break}o||e.push({startRow:n,endRow:n,startColumn:r,endColumn:r})})}),e}merge(e){this.forValue((n,s)=>{const r=e.getValue(n,s);r!=null&&this.setValue(n,s,r)})}_setOriginValue(e={}){this._matrix=e,this._option=new L(e)}}const Ir=/^-ms-/,Cr=/-([a-z])/g,J=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];class A{static stringAt(e){let n="",s=e;for(;s>=J.length;)s/=J.length,s-=1,n+=J[s%J.length];const r=e%J.length;return n+=J[r],n}static indexAt(e){let n=0;for(let s=0;s<e.length-1;s+=1){const r=e.charCodeAt(s)-65,i=e.length-1-s;n+=J.length**i+J.length*r}return n+=e.charCodeAt(e.length-1)-65,n}static deleteBlank(e){return A.isString(e)?e.replace(/\s/g,""):e}static getSystemType(){const e=navigator.userAgent,n=navigator.platform==="Win32"||navigator.platform==="Windows",s=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(s)return"Mac";if(navigator.platform==="X11"&&!n&&!s)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(n){if(e.indexOf("Windows NT 5.0")>-1||e.indexOf("Windows 2000")>-1)return"Windows 2000";if(e.indexOf("Windows NT 5.1")>-1||e.indexOf("Windows XP")>-1)return"Windows XP";if(e.indexOf("Windows NT 5.2")>-1||e.indexOf("Windows 2003")>-1)return"Windows 2003";if(e.indexOf("Windows NT 6.0")>-1||e.indexOf("Windows Vista")>-1)return"Windows Vista";if(e.indexOf("Windows NT 6.1")>-1||e.indexOf("Windows 7")>-1)return"Windows 7";if(e.indexOf("Windows NT 10")>-1||e.indexOf("Windows 10")>-1)return"Windows 10";if(e.indexOf("Windows NT 11")>-1||e.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const e=navigator.userAgent,n=e.indexOf("Opera")>-1,s=e.indexOf("compatible")>-1&&e.indexOf("MSIE")>-1&&!n,r=e.indexOf("Trident")>-1&&e.indexOf("rv:11.0")>-1,i=e.indexOf("Edge")>-1,o=e.indexOf("Firefox")>-1,c=e.indexOf("Safari")>-1&&e.indexOf("Chrome")===-1,u=e.indexOf("Chrome")>-1&&e.indexOf("Safari")>-1;if(s){new RegExp("MSIE (\\d+\\.\\d+);").test(e);const l=parseFloat(RegExp.$1);return l===7?"IE7":l===8?"IE8":l===9?"IE9":l===10?"IE10":"0"}return o?"FF":n?"Opera":c?"Safari":u?"Chrome":i?"Edge":r?"IE11":"Unknown browser"}static generateRandomId(e=21){return mr(e)}static getClassName(e){return e.constructor.name}static deepMerge(e,...n){n.forEach(o=>o&&i(o));function s(o,c){o.forEach((u,a)=>{if(A.isArray(u)){const l=c[a]??[];c[a]=l,s(u,l);return}if(A.isObject(u)){const l=c[a]??{};c[a]=l,r(u,l);return}c[a]=u})}function r(o,c){Object.keys(o).forEach(u=>{const a=o[u];if(A.isObject(a)){const l=c[u]??{};c[u]=l,r(a,l);return}if(A.isArray(a)){const l=c[u]??[];c[u]=l,s(a,l);return}c[u]=a})}function i(o){Object.keys(o).forEach(c=>{const u=o[c];if(A.isArray(u)){const a=e[c]??[];e[c]=a,s(u,a);return}if(A.isObject(u)){const a=e[c]??{};e[c]=a,r(u,a);return}e[c]=u})}return e}static numberFixed(e,n){return Number(Number(e).toFixed(n))}static diffValue(e,n){function s(o,c){const u=A.getValueType(o),a=A.getValueType(c);return u!==a?!1:A.isArray(o)?r(o,c):A.isObject(o)?i(o,c):A.isDate(o)?o.getTime()===c.getTime():A.isRegExp(o)?o.toString()===c.toString():o===c}function r(o,c){if(e.length!==n.length)return!1;for(let u=0,a=o.length;u<a;u++){const l=o[u],_=c[u];if(!s(l,_))return!1}return!0}function i(o,c){const u=Object.keys(o),a=Object.keys(c);if(u.length!==a.length)return!1;for(const l of u){if(!a.includes(l))return!1;const _=o[l],f=c[l];if(!s(_,f))return!1}return!0}return s(e,n)}static deepClone(e){if(!this.isDefine(e))return e;if(this.isRegExp(e))return new RegExp(e);if(this.isDate(e))return new Date(e);if(this.isArray(e)){const n=[];return e.forEach((s,r)=>{n[r]=A.deepClone(s)}),n}if(this.isObject(e)){const n={};return Object.keys(e).forEach(s=>{const r=e[s];n[s]=A.deepClone(r)}),Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}return e}static getLanguage(){const e="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||e}static getValueType(e){return Object.prototype.toString.apply(e)}static isDefine(e){return e!=null}static isBlank(e){return this.isDefine(e)?this.isString(e)?e.trim()==="":!1:!0}static isAssignableFrom(e,n){return e instanceof n}static isBoolean(e){return this.getValueType(e)==="[object Boolean]"}static isPlainObject(e){return this.isDefine(e)?Object.getPrototypeOf(e)===Object.getPrototypeOf({}):!1}static isFunction(e){return this.getValueType(e)==="[object Function]"}static isDate(e){return this.getValueType(e)==="[object Date]"}static isRegExp(e){return this.getValueType(e)==="[object RegExp]"}static isArray(e){return this.getValueType(e)==="[object Array]"}static isString(e){return this.getValueType(e)==="[object String]"}static isNumber(e){return this.getValueType(e)==="[object Number]"}static isStringNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}static isObject(e){return this.getValueType(e)==="[object Object]"}static isEmptyObject(e){for(const n in e)return!1;return!0}static isMobile(){let e=0,n=0;return document.body.clientWidth&&(e=document.body.clientWidth),document.body.clientHeight&&(n=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||e<350&&n<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const e=navigator.userAgent.toLowerCase();return String(e.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const e=navigator.userAgent;return e.indexOf("Android")>-1||e.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static itCount(e){return n=>{for(let s=0;s<e;s++)n&&n()}}static hasLength(e,n){return A.isDefine(e)?A.isDefine(n)?e.length===n:e.length>0:!1}static capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}static fCamelCase(e,n){return n.toUpperCase()}static camelCase(e){return e.replace(Ir,"ms-").replace(Cr,this.fCamelCase)}static removeNull(e){return this.isObject(e)&&Object.keys(e).forEach(n=>{const s=e[n];s==null?delete e[n]:A.removeNull(s)}),e}static fillTwoDimensionalArray(e,n,s){return new Array(e).fill(s).map(r=>new Array(n).fill(s))}static fillObjectMatrix(e,n,s){const r=new W;for(let i=0;i<e;i++)for(let o=0;o<n;o++)r.setValue(i,o,s);return r.getData()}static numToWord(e){let n="";for(;e>0;){let s=e%26;s=s===0?s=26:s,n=String.fromCharCode(96+s)+n,e=(e-s)/26}return n.toLocaleUpperCase()}static ABCatNum(e){if(e==null||e.length===0)return NaN;const n=e.toLowerCase().split(""),s=n.length;let r=0,i=0;for(let o=0;o<s;o++)i=n[o].charCodeAt(0)-96,r+=i*26**(s-o-1);return r===0?NaN:r-1}static chatAtABC(e){let i="";for(;e>=0;)i=String.fromCharCode(e%26+97)+i,e=Math.floor(e/26)-1;return i.toUpperCase()}static randSort(e){for(let n=0,s=e.length;n<s;n++){const r=parseInt((Math.random()*s).toString()),i=e[r];e[r]=e[n],e[n]=i}return e}static commonExtend(e,n){const s={};for(const r in e)s[r]=e[r];for(const r in n)n[r]!=null&&(s[r]=n[r]);return s}static commonExtend1(e,n){for(const s in e)n[s]==null&&(n[s]=e[s]);return n}static arrayToObject(e){const n={};return e.forEach((s,r)=>{n[r]={},s.forEach((i,o)=>{n[r][o]=i})}),n}static createObjectArray(e){return e instanceof L?new L(e.toJSON()):new L(e)}static hasIntersectionBetweenTwoRanges(e,n,s,r){return n>=s&&r>=e}}function Sr(t){if(!t)return;const{actualRow:e,actualColumn:n,isMerged:s,isMergedMainCell:r,mergeInfo:i}=t;let{startY:o,endY:c,startX:u,endX:a}=t,l=e,_=n,f=e,g=n;if(s&&i){const{startRow:E,startColumn:R,endRow:O,endColumn:I,startY:S,endY:U,startX:G,endX:B}=i;l=E,_=R,f=O,g=I,o=S,c=U,u=G,a=B}return r&&(o=i.startY,c=i.endY,u=i.startX,a=i.endX,f=i.endRow,g=i.endColumn),{startRow:l,startColumn:_,endRow:f,endColumn:g,startY:o,endY:c,startX:u,endX:a}}function Nr(t){if(!t)return;const{actualRow:e,actualColumn:n,isMerged:s,isMergedMainCell:r,startRow:i,startColumn:o,endRow:c,endColumn:u}=t;let a=e,l=n,_=e,f=n;return(s||r)&&(a=i,l=o,_=c,f=u),{startRow:a,startColumn:l,endRow:_,endColumn:f}}function br(t){var n;return!t||(((n=t==null?void 0:t.v)==null?void 0:n.toString())||"").length===0&&!t.p}function z(t){if(t){if(t.rgb)return t.rgb;if(t.th)return new Wt().setThemeColor(t.th).asThemeColor().asRgbColor().getCssString()}return null}function wr(t){return A.isString(t)&&t.substring(0,1)==="="&&t.length>1}function Lr(t){return A.isString(t)&&t.indexOf("=")===-1&&t.length===6}function vr(t){return""}function Dr(t,e=!1){var i;let n="";const s=new Map([["ff",()=>{t.ff&&(n+=`font-family: ${t.ff}; `)}],["fs",()=>{if(t.fs){let o=t.fs;t.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{t.it&&(n+="font-style: italic; ")}],["bl",()=>{t.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=t.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," underline"):n+="text-decoration-line: underline; ",t.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${z(t.ul.cl)}; `),t.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${t.ul.t} `))}],["st",()=>{var o;(o=t.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," line-through"):n+="text-decoration-line: line-through; ",t.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${z(t.st.cl)}; `),t.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${t.st.t} `))}],["ol",()=>{var o;(o=t.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," overline"):n+="text-decoration-line: overline; ",t.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${z(t.ol.cl)}; `),t.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${t.ol.t} `))}],["bg",()=>{t.bg&&(n+=`background: ${z(t.bg)}; `)}],["bd",()=>{var o,c,u,a,l,_,f,g;(o=t.bd)!=null&&o.b&&(n+=`border-bottom: ${pt((c=t.bd)==null?void 0:c.b.s)} ${z(t.bd.b.cl)??""}; `),(u=t.bd)!=null&&u.t&&(n+=`border-top: ${pt((a=t.bd)==null?void 0:a.t.s)} ${z(t.bd.t.cl)??""}; `),(l=t.bd)!=null&&l.r&&(n+=`border-right: ${pt((_=t.bd)==null?void 0:_.r.s)} ${z(t.bd.r.cl)??""}; `),(f=t.bd)!=null&&f.l&&(n+=`border-left: ${pt((g=t.bd)==null?void 0:g.l.s)} ${z(t.bd.l.cl)??""}; `)}],["cl",()=>{t.cl&&(n+=`color: ${z(t.cl)}; `)}],["va",()=>{t.va===Ft.SUBSCRIPT?n+="vertical-align: sub; ":t.va===Ft.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{t.td===Ot.LEFT_TO_RIGHT?n+="direction: ltr; ":t.td===Ot.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,c,u;t.tr&&(n+=`data-rotate: (${(o=t.tr)==null?void 0:o.a}deg${(c=t.tr)!=null&&c.v?` ,${(u=t.tr)==null?void 0:u.v}`:""});`)}],["ht",()=>{t.ht===nt.LEFT?n+="text-align: left; ":t.ht===nt.RIGHT?n+="text-align: right; ":t.ht===nt.CENTER?n+="text-align: center; ":t.ht===nt.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{t.vt===lt.BOTTOM?n+="vertical-align: bottom; ":t.vt===lt.TOP?n+="vertical-align: top; ":t.vt===lt.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{t.tb===ut.CLIP?n+="text-overflow: clip; ":t.tb===ut.OVERFLOW?n+="text-break: overflow; ":t.tb===ut.WRAP&&(n+="word-wrap: break-word;")}],["pd",()=>{var l,_,f,g,E,R,O,I;const o=`${(l=t.pd)==null?void 0:l.b}pt`,c=`${(_=t.pd)==null?void 0:_.t}pt`,u=`${(f=t.pd)==null?void 0:f.l}pt`,a=`${(g=t.pd)==null?void 0:g.r}pt`;(E=t.pd)!=null&&E.b&&(n+=`padding-bottom: ${o}; `),(R=t.pd)!=null&&R.t&&(n+=`padding-top: ${c}; `),(O=t.pd)!=null&&O.l&&(n+=`padding-left: ${u}; `),(I=t.pd)!=null&&I.r&&(n+=`padding-right: ${a}; `)}]]),r=["bd","tr","tb"];for(const o in t)e&&r.includes(o)||(i=s.get(o))==null||i();return n}function pt(t){let e="";return t===v.NONE?e="none":t===v.THIN?e="0.5pt solid":t===v.HAIR?e="0.5pt double":t===v.DOTTED?e="0.5pt dotted":t===v.DASHED||t===v.DASH_DOT?e="0.5pt dashed":t===v.DASH_DOT_DOT?e="0.5pt dotted":t===v.DOUBLE?e="0.5pt double":t===v.MEDIUM?e="1pt solid":t===v.MEDIUM_DASHED||t===v.MEDIUM_DASH_DOT?e="1pt dashed":t===v.MEDIUM_DASH_DOT_DOT?e="1pt dotted":t===v.SLANT_DASH_DOT?e="0.5pt dashed":t===v.THICK&&(e="1.5pt solid"),e}function Ur(t){let e=0;if(t=t.trim(),t==="none")e=v.NONE;else if(t==="0.5pt solid")e=v.THIN;else if(t==="0.5pt double")e=v.HAIR;else if(t==="0.5pt dotted")e=v.DOTTED;else if(t==="0.5pt dashed")e=v.DASHED;else if(t==="1pt solid")e=v.MEDIUM;else if(t==="1pt dashed")e=v.MEDIUM_DASHED;else if(t==="1pt dotted")e=v.MEDIUM_DASH_DOT_DOT;else if(t==="1.5pt solid")e=v.THICK;else return v.NONE;return e}function kt(t,e){let n=t.body;if(e){const{headers:s,footers:r}=t;s!=null&&s[e]?n=s[e].body:r!=null&&r[e]&&(n=r[e].body)}return n}function oe(t,e){return Object.prototype.toString.call(t)===Object.prototype.toString.call(e)?Object.prototype.toString.call(t)==="[object Object]"||Object.prototype.toString.call(t)==="[object Array]"?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>oe(t[n],e[n])):t===e:!1}function mn(t,e){const n=t.ts||{},s=e.ts||{};return t.sId!==e.sId?!1:oe(n,s)}function ce(t,e,n,s){if(t>e&&([t,e]=[e,t]),n>s&&([n,s]=[s,n]),e<n||s<t)return[t,e];n<t&&(n=t),s>e&&(s=e);const r=s-n+1;let i=[];return t===n?i=[s+1-r,e-r]:e===s?i=[t,n-1]:i=[t,e-r],i}function Mr(t){if(t==null)return!1;const e=t.bullet;return(e==null?void 0:e.listId)!=null}function Tr(t){if(t==null)return!1;const e=t.paragraphStyle;return In(e)}function In(t){return!(t==null||(t.indentStart==null||t.indentStart===0)&&t.hanging==null||t.hanging===0)}function Cn(t,e,n){return t.slice(0,e)+n+t.slice(e)}function Sn(t,e,n){return e>n?t:t.slice(0,e)+t.slice(n)}class ae{constructor(){d(this,"_include");d(this,"_count");this._include=[],this._count=1}checked(e){return this._include.includes(e)}onlyName(e){let n=e,s=1;for(;this.checked(n);)n=e+s,s++;return this._include.push(n),n}sheetName(e="sheet1"){let n=e;for(;this.checked(n);)n=`sheet${this._count}`,this._count++;return this._include.push(n),n}}var Pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Nn={exports:{}};/*! @preserve
|
|
4
|
+
* numeral.js
|
|
5
|
+
* version : 2.0.6
|
|
6
|
+
* author : Adam Draper
|
|
7
|
+
* license : MIT
|
|
8
|
+
* http://adamwdraper.github.com/Numeral-js/
|
|
9
|
+
*/(function(t){(function(e,n){t.exports?t.exports=n():e.numeral=n()})(Pr,function(){var e,n,s="2.0.6",r={},i={},o={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},c={currentLocale:o.currentLocale,zeroFormat:o.zeroFormat,nullFormat:o.nullFormat,defaultFormat:o.defaultFormat,scalePercentBy100:o.scalePercentBy100};function u(a,l){this._input=a,this._value=l}return e=function(a){var l,_,f,g;if(e.isNumeral(a))l=a.value();else if(a===0||typeof a>"u")l=0;else if(a===null||n.isNaN(a))l=null;else if(typeof a=="string")if(c.zeroFormat&&a===c.zeroFormat)l=0;else if(c.nullFormat&&a===c.nullFormat||!a.replace(/[^0-9]+/g,"").length)l=null;else{for(_ in r)if(g=typeof r[_].regexps.unformat=="function"?r[_].regexps.unformat():r[_].regexps.unformat,g&&a.match(g)){f=r[_].unformat;break}f=f||e._.stringToNumber,l=f(a)}else l=Number(a)||null;return new u(a,l)},e.version=s,e.isNumeral=function(a){return a instanceof u},e._=n={numberToFormat:function(a,l,_){var f=i[e.options.currentLocale],g=!1,E=!1,R=0,O="",I=1e12,S=1e9,U=1e6,G=1e3,B="",Et=!1,$,tt,P,V,Fe,er,X;if(a=a||0,tt=Math.abs(a),e._.includes(l,"(")?(g=!0,l=l.replace(/[\(|\)]/g,"")):(e._.includes(l,"+")||e._.includes(l,"-"))&&(Fe=e._.includes(l,"+")?l.indexOf("+"):a<0?l.indexOf("-"):-1,l=l.replace(/[\+|\-]/g,"")),e._.includes(l,"a")&&($=l.match(/a(k|m|b|t)?/),$=$?$[1]:!1,e._.includes(l," a")&&(O=" "),l=l.replace(new RegExp(O+"a[kmbt]?"),""),tt>=I&&!$||$==="t"?(O+=f.abbreviations.trillion,a=a/I):tt<I&&tt>=S&&!$||$==="b"?(O+=f.abbreviations.billion,a=a/S):tt<S&&tt>=U&&!$||$==="m"?(O+=f.abbreviations.million,a=a/U):(tt<U&&tt>=G&&!$||$==="k")&&(O+=f.abbreviations.thousand,a=a/G)),e._.includes(l,"[.]")&&(E=!0,l=l.replace("[.]",".")),P=a.toString().split(".")[0],V=l.split(".")[1],er=l.indexOf(","),R=(l.split(".")[0].split(",")[0].match(/0/g)||[]).length,V?(e._.includes(V,"[")?(V=V.replace("]",""),V=V.split("["),B=e._.toFixed(a,V[0].length+V[1].length,_,V[1].length)):B=e._.toFixed(a,V.length,_),P=B.split(".")[0],e._.includes(B,".")?B=f.delimiters.decimal+B.split(".")[1]:B="",E&&Number(B.slice(1))===0&&(B="")):P=e._.toFixed(a,0,_),O&&!$&&Number(P)>=1e3&&O!==f.abbreviations.trillion)switch(P=String(Number(P)/1e3),O){case f.abbreviations.thousand:O=f.abbreviations.million;break;case f.abbreviations.million:O=f.abbreviations.billion;break;case f.abbreviations.billion:O=f.abbreviations.trillion;break}if(e._.includes(P,"-")&&(P=P.slice(1),Et=!0),P.length<R)for(var nr=R-P.length;nr>0;nr--)P="0"+P;return er>-1&&(P=P.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),l.indexOf(".")===0&&(P=""),X=P+B+(O||""),g?X=(g&&Et?"(":"")+X+(g&&Et?")":""):Fe>=0?X=Fe===0?(Et?"-":"+")+X:X+(Et?"-":"+"):Et&&(X="-"+X),X},stringToNumber:function(a){var l=i[c.currentLocale],_=a,f={thousand:3,million:6,billion:9,trillion:12},g,E,R;if(c.zeroFormat&&a===c.zeroFormat)E=0;else if(c.nullFormat&&a===c.nullFormat||!a.replace(/[^0-9]+/g,"").length)E=null;else{E=1,l.delimiters.decimal!=="."&&(a=a.replace(/\./g,"").replace(l.delimiters.decimal,"."));for(g in f)if(R=new RegExp("[^a-zA-Z]"+l.abbreviations[g]+"(?:\\)|(\\"+l.currency.symbol+")?(?:\\))?)?$"),_.match(R)){E*=Math.pow(10,f[g]);break}E*=(a.split("-").length+Math.min(a.split("(").length-1,a.split(")").length-1))%2?1:-1,a=a.replace(/[^0-9\.]+/g,""),E*=Number(a)}return E},isNaN:function(a){return typeof a=="number"&&isNaN(a)},includes:function(a,l){return a.indexOf(l)!==-1},insert:function(a,l,_){return a.slice(0,_)+l+a.slice(_)},reduce:function(a,l){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof l!="function")throw new TypeError(l+" is not a function");var _=Object(a),f=_.length>>>0,g=0,E;if(arguments.length===3)E=arguments[2];else{for(;g<f&&!(g in _);)g++;if(g>=f)throw new TypeError("Reduce of empty array with no initial value");E=_[g++]}for(;g<f;g++)g in _&&(E=l(E,_[g],g,_));return E},multiplier:function(a){var l=a.toString().split(".");return l.length<2?1:Math.pow(10,l[1].length)},correctionFactor:function(){var a=Array.prototype.slice.call(arguments);return a.reduce(function(l,_){var f=n.multiplier(_);return l>f?l:f},1)},toFixed:function(a,l,_,f){var g=a.toString().split("."),E=l-(f||0),R,O,I,S;return g.length===2?R=Math.min(Math.max(g[1].length,E),l):R=E,I=Math.pow(10,R),S=(_(a+"e+"+R)/I).toFixed(R),f>l-R&&(O=new RegExp("\\.?0{1,"+(f-(l-R))+"}$"),S=S.replace(O,"")),S}},e.options=c,e.formats=r,e.locales=i,e.locale=function(a){return a&&(c.currentLocale=a.toLowerCase()),c.currentLocale},e.localeData=function(a){if(!a)return i[c.currentLocale];if(a=a.toLowerCase(),!i[a])throw new Error("Unknown locale : "+a);return i[a]},e.reset=function(){for(var a in o)c[a]=o[a]},e.zeroFormat=function(a){c.zeroFormat=typeof a=="string"?a:null},e.nullFormat=function(a){c.nullFormat=typeof a=="string"?a:null},e.defaultFormat=function(a){c.defaultFormat=typeof a=="string"?a:"0.0"},e.register=function(a,l,_){if(l=l.toLowerCase(),this[a+"s"][l])throw new TypeError(l+" "+a+" already registered.");return this[a+"s"][l]=_,_},e.validate=function(a,l){var _,f,g,E,R,O,I,S;if(typeof a!="string"&&(a+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",a)),a=a.trim(),a.match(/^\d+$/))return!0;if(a==="")return!1;try{I=e.localeData(l)}catch{I=e.localeData(e.locale())}return g=I.currency.symbol,R=I.abbreviations,_=I.delimiters.decimal,I.delimiters.thousands==="."?f="\\.":f=I.delimiters.thousands,S=a.match(/^[^\d]+/),S!==null&&(a=a.substr(1),S[0]!==g)||(S=a.match(/[^\d]+$/),S!==null&&(a=a.slice(0,-1),S[0]!==R.thousand&&S[0]!==R.million&&S[0]!==R.billion&&S[0]!==R.trillion))?!1:(O=new RegExp(f+"{2}"),a.match(/[^\d.,]/g)?!1:(E=a.split(_),E.length>2?!1:E.length<2?!!E[0].match(/^\d+.*\d$/)&&!E[0].match(O):E[0].length===1?!!E[0].match(/^\d+$/)&&!E[0].match(O)&&!!E[1].match(/^\d+$/):!!E[0].match(/^\d+.*\d$/)&&!E[0].match(O)&&!!E[1].match(/^\d+$/)))},e.fn=u.prototype={clone:function(){return e(this)},format:function(a,l){var _=this._value,f=a||c.defaultFormat,g,E,R;if(l=l||Math.round,_===0&&c.zeroFormat!==null)E=c.zeroFormat;else if(_===null&&c.nullFormat!==null)E=c.nullFormat;else{for(g in r)if(f.match(r[g].regexps.format)){R=r[g].format;break}R=R||e._.numberToFormat,E=R(_,f,l)}return E},value:function(){return this._value},input:function(){return this._input},set:function(a){return this._value=Number(a),this},add:function(a){var l=n.correctionFactor.call(null,this._value,a);function _(f,g,E,R){return f+Math.round(l*g)}return this._value=n.reduce([this._value,a],_,0)/l,this},subtract:function(a){var l=n.correctionFactor.call(null,this._value,a);function _(f,g,E,R){return f-Math.round(l*g)}return this._value=n.reduce([a],_,Math.round(this._value*l))/l,this},multiply:function(a){function l(_,f,g,E){var R=n.correctionFactor(_,f);return Math.round(_*R)*Math.round(f*R)/Math.round(R*R)}return this._value=n.reduce([this._value,a],l,1),this},divide:function(a){function l(_,f,g,E){var R=n.correctionFactor(_,f);return Math.round(_*R)/Math.round(f*R)}return this._value=n.reduce([this._value,a],l),this},difference:function(a){return Math.abs(e(this._value).subtract(a).value())}},e.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){var l=a%10;return~~(a%100/10)===1?"th":l===1?"st":l===2?"nd":l===3?"rd":"th"},currency:{symbol:"$"}}),function(){e.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(a,l,_){var f=e._.includes(l," BPS")?" ":"",g;return a=a*1e4,l=l.replace(/\s?BPS/,""),g=e._.numberToFormat(a,l,_),e._.includes(g,")")?(g=g.split(""),g.splice(-1,0,f+"BPS"),g=g.join("")):g=g+f+"BPS",g},unformat:function(a){return+(e._.stringToNumber(a)*1e-4).toFixed(15)}})}(),function(){var a={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},l={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},_=a.suffixes.concat(l.suffixes.filter(function(g){return a.suffixes.indexOf(g)<0})),f=_.join("|");f="("+f.replace("B","B(?!PS)")+")",e.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(g,E,R){var O,I=e._.includes(E,"ib")?l:a,S=e._.includes(E," b")||e._.includes(E," ib")?" ":"",U,G,B;for(E=E.replace(/\s?i?b/,""),U=0;U<=I.suffixes.length;U++)if(G=Math.pow(I.base,U),B=Math.pow(I.base,U+1),g===null||g===0||g>=G&&g<B){S+=I.suffixes[U],G>0&&(g=g/G);break}return O=e._.numberToFormat(g,E,R),O+S},unformat:function(g){var E=e._.stringToNumber(g),R,O;if(E){for(R=a.suffixes.length-1;R>=0;R--){if(e._.includes(g,a.suffixes[R])){O=Math.pow(a.base,R);break}if(e._.includes(g,l.suffixes[R])){O=Math.pow(l.base,R);break}}E*=O||1}return E}})}(),function(){e.register("format","currency",{regexps:{format:/(\$)/},format:function(a,l,_){var f=e.locales[e.options.currentLocale],g={before:l.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:l.match(/([\+|\-|\)|\s|\$]*)$/)[0]},E,R,O;for(l=l.replace(/\s?\$\s?/,""),E=e._.numberToFormat(a,l,_),a>=0?(g.before=g.before.replace(/[\-\(]/,""),g.after=g.after.replace(/[\-\)]/,"")):a<0&&!e._.includes(g.before,"-")&&!e._.includes(g.before,"(")&&(g.before="-"+g.before),O=0;O<g.before.length;O++)switch(R=g.before[O],R){case"$":E=e._.insert(E,f.currency.symbol,O);break;case" ":E=e._.insert(E," ",O+f.currency.symbol.length-1);break}for(O=g.after.length-1;O>=0;O--)switch(R=g.after[O],R){case"$":E=O===g.after.length-1?E+f.currency.symbol:e._.insert(E,f.currency.symbol,-(g.after.length-(1+O)));break;case" ":E=O===g.after.length-1?E+" ":e._.insert(E," ",-(g.after.length-(1+O)+f.currency.symbol.length-1));break}return E}})}(),function(){e.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(a,l,_){var f,g=typeof a=="number"&&!e._.isNaN(a)?a.toExponential():"0e+0",E=g.split("e");return l=l.replace(/e[\+|\-]{1}0/,""),f=e._.numberToFormat(Number(E[0]),l,_),f+"e"+E[1]},unformat:function(a){var l=e._.includes(a,"e+")?a.split("e+"):a.split("e-"),_=Number(l[0]),f=Number(l[1]);f=e._.includes(a,"e-")?f*=-1:f;function g(E,R,O,I){var S=e._.correctionFactor(E,R),U=E*S*(R*S)/(S*S);return U}return e._.reduce([_,Math.pow(10,f)],g,1)}})}(),function(){e.register("format","ordinal",{regexps:{format:/(o)/},format:function(a,l,_){var f=e.locales[e.options.currentLocale],g,E=e._.includes(l," o")?" ":"";return l=l.replace(/\s?o/,""),E+=f.ordinal(a),g=e._.numberToFormat(a,l,_),g+E}})}(),function(){e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(a,l,_){var f=e._.includes(l," %")?" ":"",g;return e.options.scalePercentBy100&&(a=a*100),l=l.replace(/\s?\%/,""),g=e._.numberToFormat(a,l,_),e._.includes(g,")")?(g=g.split(""),g.splice(-1,0,f+"%"),g=g.join("")):g=g+f+"%",g},unformat:function(a){var l=e._.stringToNumber(a);return e.options.scalePercentBy100?l*.01:l}})}(),function(){e.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(a,l,_){var f=Math.floor(a/60/60),g=Math.floor((a-f*60*60)/60),E=Math.round(a-f*60*60-g*60);return f+":"+(g<10?"0"+g:g)+":"+(E<10?"0"+E:E)},unformat:function(a){var l=a.split(":"),_=0;return l.length===3?(_=_+Number(l[0])*60*60,_=_+Number(l[1])*60,_=_+Number(l[2])):l.length===2&&(_=_+Number(l[0])*60,_=_+Number(l[1])),Number(_)}})}(),e})})(Nn);var Hr=Nn.exports;const rt=Fr(Hr),le={v:"#VALUE!",n:"#NAME?",na:"#N/A",r:"#REF!",d:"#DIV/0!",nm:"#NUM!",nl:"#NULL!",sp:"#SPILL!"};function Wr(t){let e=!1;for(const n in le)if(t===le[n]){e=!0;break}return e}function it(t){return t===null||t.toString().replace(/\s/g,"")===""||typeof t=="boolean"?!1:!isNaN(t)}function Br(t){if(t===null||t.toString().length<5)return!1;if(e(t))return!0;return!1;function e(n){const s=/^(\d{4})-(\d{1,2})-(\d{1,2})(\s(\d{1,2}):(\d{1,2})(:(\d{1,2}))?)?$/,r=/^(\d{4})\/(\d{1,2})\/(\d{1,2})(\s(\d{1,2}):(\d{1,2})(:(\d{1,2}))?)?$/;if(!s.test(n)&&!r.test(n))return!1;const i=RegExp.$1,o=RegExp.$2,c=RegExp.$3;return!(i<1900||o>12||c>31||o===2&&(new Date(i,1,29).getDate()===29&&c>29||new Date(i,1,29).getDate()!==29&&c>28))}}let jt=new Date("2017-02-19T19:06:09.000Z");Number.isNaN(jt.getFullYear())&&(jt=new Date("2/19/17"));const Gr=jt.getFullYear()===2017;function $r(t,e){const n=new Date(t);if(Gr)return e>0?n.setTime(n.getTime()+n.getTimezoneOffset()*60*1e3):e<0&&n.setTime(n.getTime()-n.getTimezoneOffset()*60*1e3),n;if(t instanceof Date)return t;if(jt.getFullYear()===1917&&!Number.isNaN(n.getFullYear())){const i=n.getFullYear();return t.indexOf(`${i}`)>-1||n.setFullYear(n.getFullYear()+100),n}const s=t.match(/\d+/g)||["2017","2","19","0","0","0"];let r=new Date(+s[0],+s[1]-1,+s[2],+s[3]||0,+s[4]||0,+s[5]||0);return t.indexOf("Z")>-1&&(r=new Date(r.getTime()-r.getTimezoneOffset()*60*1e3)),r}const pr=new Date(1900,2,1,0,0,0);function bn(t,e){let n=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());const s=Date.UTC(1899,11,31,0,0,0);return e?n-=1461*24*60*60*1e3:t>=pr&&(n+=24*60*60*1e3),(n-s)/(24*60*60*1e3)}function kr(t){let e=null,n={},s=t;if(t===null)return null;if(/^-?[0-9]{1,}[,][0-9]{3}(.[0-9]{1,2})?$/.test(t)){e=t,s=Number(t.split(".")[0].replace(",",""));let r="#,##0";if(t.split(".")[1]){r="#,##0.";for(let i=0;i<t.split(".")[1].length;i++)r+=0}n={fa:r,t:"n"}}else if(t.toString().substr(0,1)==="'")e=t.toString().substr(1),n={fa:"@",t:"s"};else if(t.toString().toUpperCase()==="TRUE")e="TRUE",n={fa:"General",t:"b"},s=!0;else if(t.toString().toUpperCase()==="FALSE")e="FALSE",n={fa:"General",t:"b"},s=!1;else if(Wr(t))e=t.toString(),n={fa:"General",t:"e"};else if(/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(t))e=t.toString(),n={fa:"@",t:"s"};else if(it(t)&&Math.abs(parseFloat(t))>0&&(Math.abs(parseFloat(t))>=1e11||Math.abs(parseFloat(t))<1e-9)){s=rt(t).value();const r=s.toExponential();if(r.indexOf(".")>-1){let i=r.split(".")[1].split("e")[0].length;i>5&&(i=5),n={fa:`#0.${new Array(i+1).join("0")}E+00`,t:"n"}}else n={fa:"#0.E+00",t:"n"};e=Z.format(n.fa,s)}else if(t.toString().indexOf("%")>-1){const r=t.toString().indexOf("%"),i=t.toString().substr(0,r),o=i.replace(/,/g,"");if(r===t.toString().length-1&&it(o))if(i.indexOf(".")>-1)if(i.indexOf(".")===i.lastIndexOf(".")){const c=i.split(".")[0];let a=i.split(".")[1].length;if(a>9&&(a=9),c.indexOf(",")>-1){let l=!0;const _=c.split(",");for(let f=1;f<_.length;f++)if(_[f].length<3){l=!1;break}l?(n={fa:`#,##0.${new Array(a+1).join("0")}%`,t:"n"},s=rt(t).value(),e=Z.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else n={fa:`0.${new Array(a+1).join("0")}%`,t:"n"},s=rt(t).value(),e=Z.format(n.fa,s)}else e=t.toString(),n={fa:"@",t:"s"};else if(i.indexOf(",")>-1){let c=!0;const u=i.split(",");for(let a=1;a<u.length;a++)if(u[a].length<3){c=!1;break}c?(n={fa:"#,##0%",t:"n"},s=rt(t).value(),e=Z.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else n={fa:"0%",t:"n"},s=rt(t).value(),e=Z.format(n.fa,s);else e=t.toString(),n={fa:"@",t:"s"}}else if(t.toString().indexOf(".")>-1)if(t.toString().indexOf(".")===t.toString().lastIndexOf(".")){const r=t.toString().split(".")[0],i=t.toString().split(".")[1];let o=i.length;if(o>9&&(o=9),r.indexOf(",")>-1){let c=!0;const u=r.split(",");for(let a=1;a<u.length;a++)if(!it(u[a])||u[a].length<3){c=!1;break}c?(n={fa:`#,##0.${new Array(o+1).join("0")}`,t:"n"},s=rt(t).value(),e=Z.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else it(r)&&it(i)?(n={fa:`0.${new Array(o+1).join("0")}`,t:"n"},s=rt(t).value(),e=Z.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else e=t.toString(),n={fa:"@",t:"s"};else it(t)?(e=t.toString(),n={fa:"General",t:"n"},s=parseFloat(t)):Br(t)&&(t.toString().indexOf(".")>-1||t.toString().indexOf(":")>-1||t.toString().length<16)?(s=bn($r(t.toString().replace(/-/g,"/"))),s.toString().indexOf(".")>-1?t.toString().length>18?n.fa="yyyy-MM-dd hh:mm:ss":t.toString().length>11?n.fa="yyyy-MM-dd hh:mm":n.fa="yyyy-MM-dd":n.fa="yyyy-MM-dd",n.t="d",e=Z.format(n.fa,s)):(e=t,n.fa="General",n.t="g");return[e,n,s]}const Z={format(t,e){}},jr=(t,e)=>{};function Vr(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+(e<<6)+(e<<16)-e;return e>>>0}class mt{static hasLength(e,n){return e.length===n}static getValueType(e){return Object.prototype.toString.apply(e)}static isObject(e){return this.getValueType(e)==="[object Object]"}static isIterable(e){return e[Symbol.iterator]!=null}static isNumber(e){return this.getValueType(e)==="[object Number]"}}const w=Symbol("newer"),T=Symbol("older");class wn{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[w],{done:!1,value:e.key}):{done:!0,value:void 0}}}class Ln{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[w],{done:!1,value:e.value}):{done:!0,value:void 0}}}class vn{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[w],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}}}class ue{constructor(e,n){d(this,"key");d(this,"value");d(this,No);d(this,bo);this.key=e,this.value=n,this[w]=void 0,this[T]=void 0}toJSON(){return{key:this.key,value:this.value}}}No=w,bo=T;class xr{constructor(...e){d(this,"_keymap");d(this,"size",0);d(this,"limit");d(this,"oldest");d(this,"newest");d(this,"_onShiftListeners",[]);if(mt.hasLength(e,1)){if(mt.isNumber(e[0])){const n=e[0];this._initialize(n,void 0);return}if(mt.isIterable(e[0])){const n=e[0];this._initialize(0,n);return}return}if(mt.hasLength(e,2)){const n=e[0],s=e[1];this._initialize(n,s)}}onShift(e){if(this._onShiftListeners.indexOf(e)===-1)return this._onShiftListeners.push(e),D(()=>Q(this._onShiftListeners,e));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(e,n){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=e,this._keymap=new Map,n&&(this.assign(n),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[w]&&(e===this.oldest&&(this.oldest=e[w]),e[w][T]=e[T]),e[T]&&(e[T][w]=e[w]),e[w]=void 0,e[T]=this.newest,this.newest&&(this.newest[w]=e),this.newest=e)}assign(e){let n,s=this.limit||Number.MAX_VALUE;this._keymap.clear();const r=e[Symbol.iterator]();for(let i=r.next();!i.done;i=r.next()){const o=new ue(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[w]=o,o[T]=n):this.oldest=o,n=o,s--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(e,n){let s=this._keymap.get(e);return s?(s.value=n,this._markEntryAsUsed(s),this):(this._keymap.set(e,s=new ue(e,n)),this.newest?(this.newest[w]=s,s[T]=this.newest):this.oldest=s,this.newest=s,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const e=this.oldest;if(e)return this.oldest&&this.oldest[w]?(this.oldest=this.oldest[w],this.oldest[T]=void 0):(this.oldest=void 0,this.newest=void 0),e[w]=e[T]=void 0,this._keymap.delete(e.key),--this.size,this._onShiftListeners.forEach(n=>n(e)),[e.key,e.value]}get(e){const n=this._keymap.get(e);if(n)return this._markEntryAsUsed(n),n.value}has(e){return this._keymap.has(e)}find(e){const n=this._keymap.get(e);return n?n.value:void 0}delete(e){const n=this._keymap.get(e);if(n)return this._keymap.delete(n.key),n[w]&&n[T]?(n[T][w]=n[w],n[w][T]=n[T]):n[w]?(n[w][T]=void 0,this.oldest=n[w]):n[T]?(n[T][w]=void 0,this.newest=n[T]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new wn(this.oldest)}values(){return new Ln(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new vn(this.oldest)}forEach(e,n){typeof n!="object"&&(n=this);let s=this.oldest;for(;s;)e.call(n,s.value,s.key,this),s=s[w]}toJSON(){const e=new Array(this.size);let n=0,s=this.oldest;for(;s;)e[n++]={key:s.key,value:s.value},s=s[w];return e}toString(){let e="",n=this.oldest;for(;n;)e+=`${String(n.key)}:${n.value}`,n=n[w],n&&(e+=" < ");return e}}var he=(t=>(t.INIT="init",t.FETCHING="fetching",t.DONE="done",t))(he||{});class Dn{constructor(){d(this,"status","init")}}const zr=t=>t.some(e=>e.status==="init")?"init":t.some(e=>e.status==="fetching")?"fetching":"done";var K=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN",t[t.ALL=3]="ALL",t))(K||{}),Y=(t=>(t[t.NONE=0]="NONE",t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN",t[t.ALL=3]="ALL",t))(Y||{});function Kr(t){return[t.startRow,t.startColumn,t.endRow,t.endColumn]}const y=class y{static clone(e){return{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType}}static equals(e,n){return e.endRow===n.endRow&&e.endColumn===n.endColumn&&e.startRow===n.startRow&&e.startColumn===n.startColumn&&(e.rangeType===n.rangeType||e.rangeType===void 0&&n.rangeType===K.NORMAL||n.rangeType===void 0&&e.rangeType===K.NORMAL)}static intersects(e,n){const s=e.startRow,r=e.endRow,i=e.startColumn,o=e.endColumn,c=n.startRow,u=n.endRow,a=n.startColumn,l=n.endColumn,_=Math.abs(i+o-a-l),f=Math.abs(i-o)+Math.abs(a-l),g=Math.abs(s+r-c-u),E=Math.abs(s-r)+Math.abs(c-u);return _<=f&&g<=E}static getIntersects(e,n){const s=e.startRow,r=e.endRow,i=e.startColumn,o=e.endColumn,c=n.startRow,u=n.endRow,a=n.startColumn,l=n.endColumn;let _,f,g,E;if(c<=r)c>=s?f=c:f=s;else return null;if(u>=s)u>=r?E=r:E=u;else return null;if(a<=o)a>i?_=a:_=i;else return null;if(l>=i)l>=o?g=o:g=l;else return null;return{startRow:f,endRow:E,startColumn:_,endColumn:g,rangeType:K.NORMAL}}static contains(e,n){return e.startRow<=n.startRow&&e.endRow>=n.endRow&&e.startColumn<=n.startColumn&&e.endColumn>=n.endColumn}static realContain(e,n){return y.contains(e,n)&&(e.startRow<n.startRow||e.endRow>n.endRow||e.startColumn<n.startColumn||e.endColumn>n.endColumn)}static union(...e){return e.reduce((n,s)=>({startRow:Math.min(n.startRow,s.startRow),startColumn:Math.min(n.startColumn,s.startColumn),endRow:Math.max(n.endRow,s.endRow),endColumn:Math.max(n.endColumn,s.endColumn),rangeType:K.NORMAL}),e[0])}};d(y,"getRelativeRange",(e,n)=>({startRow:e.startRow-n.startRow,endRow:e.endRow-e.startRow,startColumn:e.startColumn-n.startColumn,endColumn:e.endColumn-e.startColumn})),d(y,"getPositionRange",(e,n)=>({startRow:e.startRow+n.startRow,endRow:e.endRow+e.startRow+n.startRow,startColumn:e.startColumn+n.startColumn,endColumn:e.endColumn+e.startColumn+n.startColumn})),d(y,"moveHorizontal",(e,n=0,s=0)=>({...e,startColumn:e.startColumn+n,endColumn:e.endColumn+n+s})),d(y,"moveVertical",(e,n=0,s=0)=>({...e,startRow:e.startRow+n,endRow:e.endRow+n+s})),d(y,"moveOffset",(e,n,s)=>({...e,startRow:e.startRow+s,endRow:e.endRow+s,startColumn:e.startColumn+n,endColumn:e.endColumn+n}));let ht=y;class Yr{constructor(e,n){d(this,"_values",[]);d(this,"_keys",[]);d(this,"_keyMaps",new Map);this._values=e,this._keys=n,e.forEach(s=>{this._initKeyMap(s)})}_initKeyMap(e){this._keys.forEach(n=>{const s=e[n],r=this._keyMaps.get(n)||new Map;r.set(s,e),this._keyMaps.set(n,r)})}getValue(e){for(let n=0;n<this._keys.length;n++){const s=this._keyMaps.get(this._keys[n]);if(s!=null&&s.has(e))return s.get(e)}return null}hasValue(e){for(let n=0;n<this._keys.length;n++){const s=this._keyMaps.get(this._keys[n]);if(s!=null&&s.has(e))return!0}return!1}addValue(e){this._values.push(e),this._initKeyMap(e)}setValue(e,n,s){const r=this.getValue(e);r&&Object.keys(r).includes(n)&&(r[n]=s)}deleteValue(e){const n=this.getValue(e);if(n){this._keys.forEach(r=>{const i=this._keyMaps.get(r),o=n[r];i==null||i.delete(o)});const s=this._values.findIndex(r=>r===n);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(e){var n;return[...((n=this._keyMaps.get(e))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function _e(t,e,n,s){return{forEach(r){for(let i=t;i<=e;i++)for(let o=n;o<=s;o++)r(i,o)}}}function Xr(t){if(t==null||t.length===0)return NaN;const e=t.toLowerCase().split(""),n=e.length,s=o=>o.charCodeAt(0)-96;let r=0,i=0;for(let o=0;o<n;o++)i=s(e[o]),r+=i*26**(n-o-1);return r===0?NaN:r-1}const Vt=65,Un=90,Qr=97;function Jr(t){const e=Un-Vt+1;let n="";for(;t>=0;)n=String.fromCharCode(t%e+Vt)+n,t=Math.floor(t/e)-1;return n}function Mn(t,e){let n="";for(;e>0;)n+=t,e--;return n}function Zr(t,e=!1){const n=Un-Vt+1;let s=Qr;e&&(s=Vt);const r=String.fromCharCode(t%n+s),i=Math.floor(t/n)+1;return Mn(r,i)}function qr(t,e){return t.zIndex>e.zIndex?1:t.zIndex===e.zIndex?0:-1}function yr(t,e){return t.zIndex>e.zIndex?-1:t.zIndex===e.zIndex?0:1}function _t(t="index",e=1){return(n,s)=>n[t]>s[t]?e:n[t]===s[t]?0:-e}var Tn=(t=>(t[t.PARAGRAPH=0]="PARAGRAPH",t[t.SECTION_BREAK=1]="SECTION_BREAK",t[t.TABLE=2]="TABLE",t[t.TABLE_ROW=3]="TABLE_ROW",t[t.TABLE_CELL=4]="TABLE_CELL",t))(Tn||{}),de=(t=>(t.PARAGRAPH="\r",t.SECTION_BREAK=`
|
|
10
|
+
`,t.TABLE_START="",t.TABLE_ROW_START="\x1B",t.TABLE_CELL_START="",t.TABLE_CELL_END="",t.TABLE_ROW_END="",t.TABLE_END="",t.CUSTOM_RANGE_START="",t.CUSTOM_RANGE_END="",t.COLUMN_BREAK="\v",t.PAGE_BREAK="\f",t.DOCS_END="\0",t.TAB=" ",t.CUSTOM_BLOCK="\b",t.LETTER="",t.SPACE=" ",t))(de||{});function Pn(t){const e=[];for(const n of t){const{st:s,ed:r}=n;if(s===r)continue;if(e.length===0){e.push(n);continue}const i=e.pop();mn(n,i)&&A.hasIntersectionBetweenTwoRanges(i.st,i.ed,n.st,n.ed)?e.push({...n,st:i.st,ed:r}):e.push(i,n)}return e}function Fn(t,e,n,s){const{textRuns:r}=t;if(r==null)return;const i=[],o=r.length;let c=!1;const u=e.textRuns??[];if(u.length)for(let a=0,l=u.length;a<l;a++){const _=u[a];_.st+=s,_.ed+=s}for(let a=0;a<o;a++){const l=r[a],{st:_,ed:f}=l;if(f<s)i.push(l);else if(s>=_&&s<=f)if(c)l.st+=n,l.ed+=n,i.push(l);else{c=!0,l.ed+=n;const g=[];if(u.length){const E={...l,st:_,ed:u[0].st};g.push(E),g.push(...u);const R=u[u.length-1],O={...l,st:R.ed,ed:f+n};g.push(O)}else g.push(l);i.push(...g)}else l.st+=n,l.ed+=n,c||(c=!0,i.push(...u)),i.push(l)}c||(c=!0,i.push(...u)),t.textRuns=Pn(i)}function fe(t,e,n,s){const{paragraphs:r}=t;if(r==null)return;const{paragraphs:i,dataStream:o}=e,c=[];let u=-1;for(let l=0,_=r.length;l<_;l++){const f=r[l],{startIndex:g}=f;g>=s&&(f.startIndex+=n),u===-1&&g>=s&&(u=l),c.push(f.startIndex)}let a=-1;if(i){for(let l=0,_=i.length;l<_;l++){const f=i[l];f.startIndex+=s;const g=f.startIndex;a=c.indexOf(g)}if(o===de.PARAGRAPH&&i.length===1){const l=r[u],_=i[0],f=l.paragraphStyle,g=l.bullet;l.paragraphStyle=_.paragraphStyle,l.bullet=_.bullet,_.paragraphStyle=f,_.bullet=g}a!==-1&&r.splice(a,1),r.push(...i),r.sort(_t("startIndex"))}}function ti(t,e,n,s){const{sectionBreaks:r}=t;if(r==null)return;for(let o=0,c=r.length;o<c;o++){const u=r[o],{startIndex:a}=u;a>=s&&(u.startIndex+=n)}const i=e.sectionBreaks;if(i){for(let o=0,c=i.length;o<c;o++){const u=i[o];u.startIndex+=s}r.push(...i),r.sort(_t("startIndex"))}}function Hn(t,e,n,s){const{customBlocks:r}=t;if(r==null)return;for(let o=0,c=r.length;o<c;o++){const u=r[o],{startIndex:a}=u;a>=s&&(u.startIndex+=n)}const i=e.customBlocks;if(i){for(let o=0,c=i.length;o<c;o++){const u=i[o];u.startIndex+=s}r.push(...i),r.sort(_t("startIndex"))}}function ge(t,e,n,s){const{tables:r}=t;if(r==null)return;for(let o=0,c=r.length;o<c;o++){const u=r[o],{startIndex:a,endIndex:l}=u;a>s?(u.startIndex+=n,u.endIndex+=n):l>=s-1&&(u.endIndex+=n)}const i=e.tables;if(i){for(let o=0,c=i.length;o<c;o++){const u=i[o];u.startIndex+=s,u.endIndex+=s}r.push(...i),r.sort(_t("startIndex"))}}function ei(t,e,n,s){const{customRanges:r}=t;if(r==null)return;for(let o=0,c=r.length;o<c;o++){const u=r[o],{startIndex:a,endIndex:l}=u;a>s?(u.startIndex+=n,u.endIndex+=n):l>=s-1&&(u.endIndex+=n)}const i=e.customRanges;if(i){for(let o=0,c=i.length;o<c;o++){const u=i[o];u.startIndex+=s,u.endIndex+=s}r.push(...i),r.sort(_t("startIndex"))}}function Wn(t,e,n){const{textRuns:s}=t,r=n,i=n+e,o=[];if(s){const c=[];for(let u=0,a=s.length;u<a;u++){const l=s[u],{st:_,ed:f}=l;if(r<=_&&i>=f){o.push({...l,st:_-r,ed:f-r});continue}else _<=r&&f>=i?(o.push({...l,st:r-r,ed:i-r}),l.ed-=e):r>=_&&r<f?(o.push({...l,st:r-r,ed:f-r}),l.ed=r):i>_&&i<=f?(o.push({...l,st:_-r,ed:i-r}),l.st=i-e,l.ed-=e):_>=i&&(l.st-=e,l.ed-=e);c.push(l)}t.textRuns=c}return o}function Bn(t,e,n){const{paragraphs:s}=t,r=n,i=n+e,o=[];if(s){const c=[];for(let u=0,a=s.length;u<a;u++){const l=s[u],{startIndex:_}=l;if(_>=r&&_<i){o.push({...l,startIndex:_-n});continue}else _>=i&&(l.startIndex-=e);c.push(l)}t.paragraphs=c}return o}function Gn(t,e,n){const{sectionBreaks:s}=t,r=n,i=n+e-1,o=[];if(s){const c=[];for(let u=0,a=s.length;u<a;u++){const l=s[u],{startIndex:_}=l;if(_>=r&&_<=i){o.push({...l,startIndex:_-n});continue}else _>i&&(l.startIndex-=e);c.push(l)}t.sectionBreaks=c}return o}function $n(t,e,n){const{customBlocks:s}=t,r=n,i=n+e-1,o=[];if(s){const c=[];for(let u=0,a=s.length;u<a;u++){const l=s[u],{startIndex:_}=l;if(_>=r&&_<=i){o.push({...l,startIndex:_-n});continue}else _>i&&(l.startIndex-=e);c.push(l)}t.customBlocks=c}return o}function pn(t,e,n){const{tables:s}=t,r=n,i=n+e-1,o=[];if(s){const c=[];for(let u=0,a=s.length;u<a;u++){const l=s[u],{startIndex:_,endIndex:f}=l;if(r<=_&&i>=f){o.push({...l,startIndex:_-n,endIndex:f-n});continue}else if(_<=r&&f>=i){const g=ce(_,f,r,i);l.startIndex=g[0],l.endIndex=g[1]}else i<_&&(l.startIndex-=e,l.endIndex-=e);c.push(l)}t.tables=c}return o}function kn(t,e,n){const{customRanges:s}=t,r=n,i=n+e-1,o=[];if(s){const c=[];for(let u=0,a=s.length;u<a;u++){const l=s[u],{startIndex:_,endIndex:f}=l;if(r<=_&&i>=f){o.push({...l,startIndex:_-n,endIndex:f-n});continue}else if(_<=r&&f>=i){const g=ce(_,f,r,i);l.startIndex=g[0],l.endIndex=g[1]}else i<_&&(l.startIndex-=e,l.endIndex-=e);c.push(l)}t.customRanges=c}return o}function ni(t,e,n){const{dataStream:s}=t,r=n,i=n+e,o=Wn(t,e,n),c=Bn(t,e,n),u=Gn(t,e,n),a=$n(t,e,n),l=pn(t,e,n),_=kn(t,e,n);let f="";return s&&(t.dataStream=Sn(s,r,i),f=s.slice(r,i)),{dataStream:f,textRuns:o,paragraphs:c,sectionBreaks:u,customBlocks:a,tables:l,customRanges:_}}function si(t,e,n,s){t.dataStream=Cn(t.dataStream,s,e.dataStream),Fn(t,e,n,s),fe(t,e,n,s),ti(t,e,n,s),Hn(t,e,n,s),ge(t,e,n,s),ei(t,e,n,s)}function ri(t,e,n,s,r){const i=ii(t,e,n,s,r),o=ci(t,e,n,s,r),c=ai(t,e,n,s,r),u=li(t,e,n,s,r),a=ui(t,e,n,s,r),l=hi(t,e,n,s,r);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:c,customBlocks:u,tables:a,customRanges:l}}function ii(t,e,n,s,r){const{textRuns:i}=t,{textRuns:o}=e;if(i==null||o==null)return;const c=Wn(t,n,s);if(r!==F.REPLACE){const u=oi(o,c,r);e.textRuns=u}return Fn(t,e,n,s),c}function oi(t,e,n){if(e.length===0)return t;t=A.deepClone(t),e=A.deepClone(e);const s=[],r=t.length,i=e.length;let o=0,c=0,u=null;function a(){return u?(s.push(u),u=null,!0):!1}for(;o<r&&c<i;){const{st:g,ed:E,ts:R}=t[o],{st:O,ed:I,ts:S,sId:U}=e[c];let G;n===F.COVER?G={...S,...R}:G={...R,...S},E<O?(a()||s.push(t[o]),o++):I<g?(a()||s.push(e[c]),c++):(s.push({st:Math.min(g,O),ed:Math.max(g,O),ts:g<O?{...R}:{...S},sId:g<O?void 0:U}),s.push({st:Math.max(g,O),ed:Math.min(E,I),ts:G,sId:U}),E<I?(o++,e[c].st=E):(c++,t[o].st=I),u={st:Math.min(E,I),ed:Math.max(E,I),ts:E<I?{...S}:{...R},sId:E<I?U:void 0})}a();const l=s[s.length-1],_=t[r-1],f=e[i-1];return l.ed!==Math.max(_.ed,f.ed)&&(_.ed>f.ed?s.push(_):s.push(f)),Pn(s)}function ci(t,e,n,s,r){const{paragraphs:i}=t,{paragraphs:o}=e;if(i==null||o==null)return;const c=Bn(t,n,s);if(r!==F.REPLACE){const u=[];for(const a of o){const{startIndex:l,paragraphStyle:_,bullet:f}=a;let g=[];for(const E of c){const{startIndex:R,paragraphStyle:O,bullet:I}=E;let S,U;if(r===F.COVER?(S={...O,..._},U={listId:"",nestingLevel:0,textStyle:{},...I,...f}):(S={..._,...O},U={listId:"",nestingLevel:0,textStyle:{},...f,...I}),l===R){g.push({startIndex:l,paragraphStyle:S,bullet:U});break}}u.push(...g),g=[]}e.paragraphs=u}return fe(t,e,n,s),c}function ai(t,e,n,s,r){const{sectionBreaks:i}=t,{sectionBreaks:o}=e;if(i==null||o==null)return;const c=Gn(t,n,s);if(r!==F.REPLACE){const u=[];for(const a of o){const{startIndex:l}=a;let _=[];for(const f of c){const{startIndex:g}=f;if(l===g){r===F.COVER?_.push({...f,...a}):_.push({...a,...f});break}}u.push(..._),_=[]}e.sectionBreaks=u}return fe(t,e,n,s),c}function li(t,e,n,s,r){const{customBlocks:i}=t,{customBlocks:o}=e;if(i==null||o==null)return;const c=$n(t,n,s);if(r!==F.REPLACE){const u=[];for(const a of o){const{startIndex:l}=a;let _=[];for(const f of c){const{startIndex:g}=f;if(l===g){r===F.COVER?_.push({...f,...a}):_.push({...a,...f});break}}u.push(..._),_=[]}e.customBlocks=u}return Hn(t,e,n,s),c}function ui(t,e,n,s,r){const{tables:i}=t,{tables:o}=e;if(i==null||o==null)return;const c=pn(t,n,s);if(r!==F.REPLACE){const u=[];for(const a of o){const{startIndex:l,endIndex:_}=a;let f=[];for(const g of c){const{startIndex:E,endIndex:R}=g;if(E>=l&&R<=_){r===F.COVER?f.push({...g,...a}):f.push({...a,...g});break}}u.push(...f),f=[]}e.tables=u}return ge(t,e,n,s),c}function hi(t,e,n,s,r){const{customRanges:i}=t,{tables:o}=e;if(i==null||o==null)return;const c=kn(t,n,s);if(r!==F.REPLACE){const u=[];for(const a of o){const{startIndex:l,endIndex:_}=a;let f=[];for(const g of c){const{startIndex:E,endIndex:R}=g;if(E>=l&&R<=_){r===F.COVER?f.push({...g,...a}):f.push({...a,...g});break}}u.push(...f),f=[]}e.customRanges=u}return ge(t,e,n,s),c}const Ee={id:"default_doc",documentStyle:{}};class _i{constructor(e){d(this,"snapshot");this.snapshot={...Ee,...e}}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get body(){return this.snapshot.body}get zoomRatio(){var e;return((e=this.snapshot.settings)==null?void 0:e.zoomRatio)||1}getBody(){return this.snapshot.body}getShouldRenderLoopImmediately(){return this.snapshot.shouldStartRenderingImmediately!==!1}getContainer(){return this.snapshot.container}getParentRenderUnitId(){return this.snapshot.parentRenderUnitId}getSnapshot(){return this.snapshot}updateDocumentId(e){this.snapshot.id=e}updateDocumentRenderConfig(e){const{documentStyle:n}=this.snapshot;n.renderConfig==null?n.renderConfig=e:n.renderConfig={...n.renderConfig,...e}}updateDocumentDataMargin(e){const{t:n,l:s,b:r,r:i}=e,{documentStyle:o}=this.snapshot;n!=null&&(o.marginTop=n),s!=null&&(o.marginLeft=s),r!=null&&(o.marginBottom=r),i!=null&&(o.marginRight=i)}updateDocumentDataPageSize(e,n){const{documentStyle:s}=this.snapshot;if(!s.pageSize){e=e??1/0,n=n??1/0,s.pageSize={width:e,height:n};return}e!==void 0&&(s.pageSize.width=e),n!==void 0&&(s.pageSize.height=n)}updateDrawing(e,n){const{drawings:s}=this,{width:r,height:i,left:o,top:c}=n,u=s==null?void 0:s[e];if(!u)return;const a=u.objectTransform;a.size.width=r,a.size.height=i,a.positionH.posOffset=o,a.positionV.posOffset=c}setZoomRatio(e=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:e}:this.snapshot.settings.zoomRatio=1}}class dt extends _i{constructor(n){super(n);d(this,"_unitId");d(this,"headerModelMap",new Map);d(this,"footerModelMap",new Map);const s=6;this._unitId=this.snapshot.id??A.generateRandomId(s),this._initializeHeaderFooterModel()}dispose(){this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()})}getRev(){return this.snapshot.rev??0}incrementRev(){this.snapshot.rev=this.getRev()+1}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...Ee,...n},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){const s=[],r=new ye;return r.reset(),n.forEach(i=>{if(i=A.deepClone(i),i.t==="r"){const{coverType:o,body:c,len:u,segmentId:a}=i;if(c!=null){const l=this._updateApply(c,u,r.cursor,o,a);s.push({...i,t:"r",coverType:F.REPLACE,body:l})}else s.push({...i,t:"r"});r.moveCursor(u)}else if(i.t==="i"){const{body:o,len:c,segmentId:u,line:a}=i;this._insertApply(o,c,r.cursor,u),r.moveCursor(c),s.push({t:"d",len:c,line:a,segmentId:u})}else if(i.t==="d"){const{len:o,segmentId:c}=i,u=this._deleteApply(o,r.cursor,c);s.push({...i,t:"i",body:u})}else throw new Error(`Unknown mutation type for mutation: ${i}.`)}),s}_updateApply(n,s,r,i=F.COVER,o){if(n==null)throw new Error("updateBody is none");const c=this.snapshot,u=kt(c,o);if(u==null)throw new Error("no body has changed");return ri(u,n,s,r,i)}_deleteApply(n,s,r){const i=this.snapshot,o=kt(i,r);if(o==null)throw new Error("no body has changed");return n<=0?{dataStream:""}:ni(o,n,s)}_insertApply(n,s,r,i){const o=this.snapshot,c=kt(o,i);if(s!==0){if(c==null)throw new Error("no body has changed");si(c,n,s,r)}}_initializeHeaderFooterModel(){const{headers:n,footers:s}=this.getSnapshot();if(n)for(const r in n){const i=n[r];this.headerModelMap.set(r,new dt(i))}if(s)for(const r in s){const i=s[r];this.footerModelMap.set(r,new dt(i))}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}var jn=(t=>(t.INSERT_ROW_DATA_ACTION="InsertRowDataAction",t.REMOVE_ROW_DATA_ACTION="RemoveRowDataAction",t.INSERT_ROW_ACTION="InsertRowAction",t.REMOVE_ROW_ACTION="RemoveRowAction",t.SET_RANGE_STYLE_ACTION="SetRangeStyleAction",t.SET_SELECTION_ACTION="SetSelectionActivateAction",t.SET_RANGE_DATA_ACTION="SetRangeDataAction",t.SET_RANGE_FORMATTED_VALUE_ACTION="SetRangeFormattedValueAction",t.SET_RANGE_NOTE_ACTION="SetRangeNoteAction",t.DELETE_RANGE_ACTION="DeleteRangeAction",t.INSERT_SHEET_ACTION="InsertSheetAction",t.REMOVE_SHEET_ACTION="RemoveSheetAction",t.CLEAR_RANGE_ACTION="ClearRangeAction",t.INSERT_RANGE_ACTION="InsertRangeAction",t.SET_TAB_COLOR_ACTION="SetTabColorAction",t.HIDE_SHEET_ACTION="SetWorkSheetHideAction",t.SET_WORKSHEET_ACTIVATE_ACTION="SetWorkSheetActivateAction",t.INSERT_COLUMN_ACTION="InsertColumnAction",t.INSERT_COLUMN_DATA_ACTION="InsertColumnDataAction",t.REMOVE_COLUMN_ACTION="RemoveColumnAction",t.REMOVE_COLUMN_DATA_ACTION="RemoveColumnDataAction",t.SET_HIDE_ROW_ACTION="SetRowHideAction",t.SET_HIDE_COLUMN_ACTION="SetColumnHideAction",t.SET_SHOW_ROW_ACTION="SetRowShowAction",t.SET_SHOW_COLUMN_ACTION="SetColumnShowAction",t.ADD_MERGE_ACTION="AddMergeAction",t.REMOVE_MERGE_ACTION="RemoveMergeAction",t.SET_WORKSHEET_NAME_ACTION="SetWorkSheetNameAction",t.SET_WORKSHEET_STATUS_ACTION="SetWorkSheetStatusAction",t.SET_BORDER_ACTION="SetBorderAction",t.SET_COLUMN_WIDTH_ACTION="SetColumnWidthAction",t.SET_ROW_HEIGHT_ACTION="SetRowHeightAction",t.SET_HIDDEN_GRIDLINES_ACTION="SetHiddenGridlinesAction",t.SET_RIGHT_TO_LEFT_ACTION="SetRightToLeftAction",t.DELETE_BANDING_ACTION="DeleteBandingAction",t.SET_BANDING_ACTION="SetBandingAction",t.ADD_BANDING_ACTION="AddBandingAction",t.DELETE_NAMED_RANGE_ACTION="DeleteNamedRangeAction",t.SET_NAMED_RANGE_ACTION="SetNamedRangeAction",t.ADD_NAMED_RANGE_ACTION="AddNamedRangeAction",t.SET_SHEET_ORDER_ACTION="SetSheetOrderAction",t.SET_ZOOM_RATIO_ACTION="SetZoomRatioAction",t.SET_FROZEN_COLUMNS_ACTION="SetFrozenColumnsAction",t.SET_FROZEN_ROWS_ACTION="SetFrozenRowsAction",t))(jn||{});const It={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},di={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},fi={startRow:0,startColumn:0,endRow:0,endColumn:0},gi={row:0,column:0},Vn={id:"",sheetOrder:[],name:"",appVersion:"",locale:Mt.ZH_CN,styles:{},sheets:{},resources:[]},xn=1e3,zn=20,Kn=19,Yn=73,Xn=46,Qn=20,xt={type:ie.GRID,name:"Sheet1",id:"sheet-01",tabColor:"",hidden:C.FALSE,rowCount:xn,columnCount:zn,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Yn,defaultRowHeight:Kn,mergeData:[],hideRow:[],hideColumn:[],cellData:{},rowData:{},columnData:{},status:C.FALSE,showGridlines:C.TRUE,rowHeader:{width:Xn,hidden:C.FALSE},columnHeader:{height:Qn,hidden:C.FALSE},selections:["A1"],rightToLeft:C.FALSE,pluginMeta:{}},zt={ff:"Times New Roman",fs:14,it:C.FALSE,bl:C.FALSE,ul:{s:C.FALSE},st:{s:C.FALSE},ol:{s:C.FALSE},tr:{a:0,v:C.FALSE},td:Ot.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:nt.UNSPECIFIED,vt:lt.UNSPECIFIED,tb:ut.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0}},Jn={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}};var Zn=(t=>(t.ARRAY_CONVERTOR="ARRAY_CONVERTOR",t.MATRIX_CONVERTOR="MATRIX_CONVERTOR",t))(Zn||{});class qn{constructor(e={},n=100){d(this,"_styles");d(this,"_cacheMap",new Map);d(this,"_maxCacheSize");this._styles=e,this._maxCacheSize=n,this._generateCacheMap()}each(e){return Object.entries(this._styles).forEach(e),this}search(e){const n=JSON.stringify(e);if(this._cacheMap.has(n)){const r=this._cacheMap.get(n);return this._cacheMap.delete(n),this._cacheMap.set(n,r),r}const s=this.getExistingStyleId(e);return s||"-1"}get(e){return typeof e!="string"?e:(e=String(e),this._styles[e])}add(e){const n=A.generateRandomId(6);this._styles[n]=e;const s=JSON.stringify(e);if(this._cacheMap.set(s,n),this._cacheMap.size>this._maxCacheSize){const r=this._cacheMap.entries().next().value;this._cacheMap.delete(r[0])}return n}setValue(e){if(e==null)return;const n=this.search(e);return n!=="-1"?n:this.add(e)}toJSON(){return this._styles}getStyleByCell(e){let n;e&&A.isObject(e.s)?n=e.s:n=(e==null?void 0:e.s)&&this.get(e.s);const s=e==null?void 0:e.interceptorStyle;return s?{...n,...s}:n}_generateCacheMap(){const{_styles:e,_cacheMap:n}=this;let s=0;for(const r in e){const i=JSON.stringify(e[r]);if(n.set(i,r),s++,s>=this._maxCacheSize)break}}getExistingStyleId(e){const{_styles:n}=this;for(const s in n)if(A.diffValue(n[s],e))return s;return null}}function Ei(t){return t&&(t.s!==void 0||t.p!==void 0||t.v!==void 0)||t.f!==void 0||t.si!==void 0}function Ri(t){if(t.t!==void 0)return t.t;if(typeof t.v=="string")return At.STRING;if(typeof t.v=="number")return At.NUMBER;if(typeof t.v=="boolean")return At.BOOLEAN}function Oi(t){if(t==null)return!0;const{v:e,f:n,si:s,p:r,s:i}=t;return!(!(e==null||typeof e=="string"&&e.length===0)||n!=null&&n.length>0||s!=null&&s.length>0||r!=null)}var yn=(t=>(t[t.character=0]="character",t[t.paragraph=1]="paragraph",t[t.table=2]="table",t[t.numbering=3]="numbering",t))(yn||{}),ts=(t=>(t[t.TAB=0]="TAB",t[t.SPACE=1]="SPACE",t[t.NOTHING=2]="NOTHING",t))(ts||{}),es=(t=>(t[t.GLYPH_TYPE_UNSPECIFIED=0]="GLYPH_TYPE_UNSPECIFIED",t[t.NONE=1]="NONE",t[t.DECIMAL=2]="DECIMAL",t[t.ZERO_DECIMAL=3]="ZERO_DECIMAL",t[t.UPPER_ALPHA=4]="UPPER_ALPHA",t[t.ALPHA=5]="ALPHA",t[t.UPPER_ROMAN=6]="UPPER_ROMAN",t[t.ROMAN=7]="ROMAN",t))(es||{}),ns=(t=>(t[t.BULLET_ALIGNMENT_UNSPECIFIED=0]="BULLET_ALIGNMENT_UNSPECIFIED",t[t.START=1]="START",t[t.CENTER=2]="CENTER",t[t.END=3]="END",t))(ns||{}),ss=(t=>(t[t.HYPERLINK=0]="HYPERLINK",t[t.FIELD=1]="FIELD",t[t.SDT=2]="SDT",t[t.BOOKMARK=3]="BOOKMARK",t[t.COMMENT=4]="COMMENT",t[t.CUSTOM=5]="CUSTOM",t))(ss||{}),rs=(t=>(t[t.DRAWING=0]="DRAWING",t[t.CUSTOM=1]="CUSTOM",t))(rs||{}),is=(t=>(t[t.DEFAULT=0]="DEFAULT",t[t.LINES=1]="LINES",t[t.LINES_AND_CHARS=2]="LINES_AND_CHARS",t[t.SNAP_TO_CHARS=3]="SNAP_TO_CHARS",t))(is||{}),os=(t=>(t[t.SECTION_TYPE_UNSPECIFIED=0]="SECTION_TYPE_UNSPECIFIED",t[t.CONTINUOUS=1]="CONTINUOUS",t[t.NEXT_PAGE=2]="NEXT_PAGE",t[t.EVEN_PAGE=3]="EVEN_PAGE",t[t.ODD_PAGE=4]="ODD_PAGE",t))(os||{}),cs=(t=>(t[t.COLUMN_SEPARATOR_STYLE_UNSPECIFIED=0]="COLUMN_SEPARATOR_STYLE_UNSPECIFIED",t[t.NONE=1]="NONE",t[t.BETWEEN_EACH_COLUMN=2]="BETWEEN_EACH_COLUMN",t))(cs||{}),as=(t=>(t[t.NORMAL=0]="NORMAL",t[t.TBRL=1]="TBRL",t[t.LRTBV=2]="LRTBV",t))(as||{}),ls=(t=>(t[t.TEXT_RUN=0]="TEXT_RUN",t[t.AUTO_TEXT=1]="AUTO_TEXT",t[t.PAGE_BREAK=2]="PAGE_BREAK",t[t.COLUMN_BREAK=3]="COLUMN_BREAK",t[t.FOOT_NOTE_REFERENCE=4]="FOOT_NOTE_REFERENCE",t[t.HORIZONTAL_RULE=5]="HORIZONTAL_RULE",t[t.EQUATION=6]="EQUATION",t[t.DRAWING=7]="DRAWING",t[t.PERSON=8]="PERSON",t[t.RICH_LINK=9]="RICH_LINK",t))(ls||{}),us=(t=>(t[t.BOTH_SIDES=0]="BOTH_SIDES",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.LARGEST=3]="LARGEST",t))(us||{}),hs=(t=>(t[t.INLINE=0]="INLINE",t[t.WRAP_NONE=1]="WRAP_NONE",t[t.WRAP_POLYGON=2]="WRAP_POLYGON",t[t.WRAP_SQUARE=3]="WRAP_SQUARE",t[t.WRAP_THROUGH=4]="WRAP_THROUGH",t[t.WRAP_TIGHT=5]="WRAP_TIGHT",t[t.WRAP_TOP_AND_BOTTOM=6]="WRAP_TOP_AND_BOTTOM",t))(hs||{}),_s=(t=>(t[t.NAMED_STYLE_TYPE_UNSPECIFIED=0]="NAMED_STYLE_TYPE_UNSPECIFIED",t[t.NORMAL_TEXT=1]="NORMAL_TEXT",t[t.TITLE=2]="TITLE",t[t.SUBTITLE=3]="SUBTITLE",t[t.HEADING_1=4]="HEADING_1",t[t.HEADING_2=5]="HEADING_2",t[t.HEADING_3=6]="HEADING_3",t[t.HEADING_4=7]="HEADING_4",t[t.HEADING_5=8]="HEADING_5",t[t.HEADING_6=9]="HEADING_6",t))(_s||{}),ds=(t=>(t[t.AUTO=0]="AUTO",t[t.AT_LEAST=1]="AT_LEAST",t[t.EXACT=2]="EXACT",t))(ds||{}),fs=(t=>(t[t.DASH_STYLE_UNSPECIFIED=0]="DASH_STYLE_UNSPECIFIED",t[t.SOLID=1]="SOLID",t[t.DOT=2]="DOT",t[t.DASH=3]="DASH",t))(fs||{}),gs=(t=>(t[t.TAB_STOP_ALIGNMENT_UNSPECIFIED=0]="TAB_STOP_ALIGNMENT_UNSPECIFIED",t[t.START=1]="START",t[t.CENTER=2]="CENTER",t[t.END=3]="END",t))(gs||{}),Es=(t=>(t.EVENLY_DISTRIBUTED="0",t.FIXED_WIDTH="1",t))(Es||{}),Rs=(t=>(t[t.CONTENT_ALIGNMENT_UNSPECIFIED=0]="CONTENT_ALIGNMENT_UNSPECIFIED",t[t.CONTENT_ALIGNMENT_UNSUPPORTED=1]="CONTENT_ALIGNMENT_UNSUPPORTED",t[t.TOP=2]="TOP",t[t.MIDDLE=3]="MIDDLE",t[t.BOTTOM=4]="BOTTOM",t))(Rs||{}),Os=(t=>(t.NORMAL="normal",t.BOLD="bold",t.ITALIC="italic",t))(Os||{}),As=(t=>(t[t.CHARACTER=0]="CHARACTER",t[t.COLUMN=1]="COLUMN",t[t.INSIDE_MARGIN=2]="INSIDE_MARGIN",t[t.LEFT_MARGIN=3]="LEFT_MARGIN",t[t.MARGIN=4]="MARGIN",t[t.OUTSIDE_MARGIN=5]="OUTSIDE_MARGIN",t[t.PAGE=6]="PAGE",t[t.RIGHT_MARGIN=7]="RIGHT_MARGIN",t))(As||{}),ms=(t=>(t[t.BOTTOM_MARGIN=0]="BOTTOM_MARGIN",t[t.INSIDE_MARGIN=1]="INSIDE_MARGIN",t[t.LINE=2]="LINE",t[t.MARGIN=3]="MARGIN",t[t.OUTSIDE_MARGIN=4]="OUTSIDE_MARGIN",t[t.PAGE=5]="PAGE",t[t.PARAGRAPH=6]="PARAGRAPH",t[t.TOP_MARGIN=7]="TOP_MARGIN",t))(ms||{}),Is=(t=>(t[t.POINT=0]="POINT",t[t.LINE=1]="LINE",t[t.CHARACTER=2]="CHARACTER",t))(Is||{}),Cs=(t=>(t[t.CENTER=0]="CENTER",t[t.INSIDE=1]="INSIDE",t[t.LEFT=2]="LEFT",t[t.OUTSIDE=3]="OUTSIDE",t[t.RIGHT=4]="RIGHT",t))(Cs||{}),Ss=(t=>(t[t.BOTTOM=0]="BOTTOM",t[t.CENTER=1]="CENTER",t[t.INSIDE=2]="INSIDE",t[t.OUTSIDE=3]="OUTSIDE",t[t.TOP=4]="TOP",t))(Ss||{}),Ns=(t=>(t[t.compressPunctuation=0]="compressPunctuation",t[t.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",t[t.doNotCompress=2]="doNotCompress",t))(Ns||{}),bs=(t=>(t[t.PORTRAIT=0]="PORTRAIT",t[t.LANDSCAPE=1]="LANDSCAPE",t))(bs||{}),Re=(t=>(t[t.SLIDE=0]="SLIDE",t[t.MASTER=1]="MASTER",t[t.LAYOUT=2]="LAYOUT",t[t.HANDOUT_MASTER=3]="HANDOUT_MASTER",t[t.NOTES_MASTER=4]="NOTES_MASTER",t))(Re||{}),ws=(t=>(t[t.SHAPE=0]="SHAPE",t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.SPREADSHEET=3]="SPREADSHEET",t[t.DOCUMENT=4]="DOCUMENT",t[t.SLIDE=5]="SLIDE",t))(ws||{}),Ls=(t=>(t[t.RELATIVE_SLIDE_LINK_UNSPECIFIED=0]="RELATIVE_SLIDE_LINK_UNSPECIFIED",t[t.NEXT_SLIDE=1]="NEXT_SLIDE",t[t.PREVIOUS_SLIDE=2]="PREVIOUS_SLIDE",t[t.FIRST_SLIDE=3]="FIRST_SLIDE",t[t.LAST_SLIDE=4]="LAST_SLIDE",t))(Ls||{});class Ai{constructor(e,n){d(this,"_columnData");this._config=e,this._columnData=A.createObjectArray(n)}getColumnData(){return this._columnData}getColVisible(e){const{_columnData:n}=this,s=n.get(e);return s?s.hd!==C.TRUE:!0}getHiddenCols(e=0,n=this._columnData.getLength()-1){const s=[];let r=!1,i=-1;for(let o=e;o<=n;o++){const c=this.getColVisible(o);r&&c?(r=!1,s.push({rangeType:K.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!r&&!c&&(r=!0,i=o)}return r&&s.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:K.COLUMN}),s}getColumnDatas(e,n){const s=new L;for(let r=e;r<e+n;r++){const i=this.getColumnOrCreate(r);s.push(i)}return s}getSize(){return this._columnData.getLength()}getColumnWidth(e){const{_columnData:n}=this,s=this._config;let r=0;return r=n.obtain(e,{hd:C.FALSE,w:s.defaultColumnWidth}).w||s.defaultColumnWidth,r}getColumn(e){const n=this._columnData.get(e);if(n)return n}getColumnOrCreate(e){const{_columnData:n}=this,s=this._config,r=n.get(e);if(r)return r;const i={w:s.defaultColumnWidth,hd:C.FALSE};return this._columnData.set(e,i),i}}function Kt(t,e){for(const n of e){const{ts:s={}}=n;if(s[t]==null)return C.FALSE;switch(t){case"bl":case"it":{if(s[t]===C.FALSE)return C.FALSE;break}case"ul":case"st":{if(s[t].s===C.FALSE)return C.FALSE;break}default:throw new Error(`unknown style key: ${t} in IStyleBase`)}}return C.TRUE}class ft{constructor(e,n,s){d(this,"_range");d(this,"_worksheet");this._deps=s,this._range=n,this._worksheet=e}static foreach(e,n){const{startRow:s,startColumn:r,endRow:i,endColumn:o}=e;for(let c=s;c<=i;c++)for(let u=r;u<=o;u++)n(c,u)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range,i=[];for(let o=e;o<=n;o++){const c=[];for(let u=s;u<=r;u++)c.push(this.getMatrix().getValue(o,u)||null);i.push(c)}return i}getMatrix(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),o=new W;for(let c=e;c<=n;c++)for(let u=s;u<=r;u++)o.setValue(c,u,i.getValue(c,u)||null);return o}getMatrixObject(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),o=new W;for(let c=e;c<=n;c++)for(let u=s;u<=r;u++)o.setValue(c-e,u-s,i.getValue(c,u)||{});return o}getA1Notation(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range;let i,o;return s<r?(i=A.numToWord(s+1)+(e+1),o=A.numToWord(r+1)+(n+1)):(i=A.numToWord(r+1)+(n+1),o=A.numToWord(s+1)+(e+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const e=this._deps.getStyles();return this.getValues().map(n=>n.map(s=>{var i;const r=e.getStyleByCell(s);return((i=r==null?void 0:r.bg)==null?void 0:i.rgb)||zt.bg.rgb}))}getCell(e,n){const{startRow:s,endRow:r,startColumn:i,endColumn:o}=this._range,c={startRow:s+e,endRow:s+e,startColumn:i+n,endColumn:i+n};return new ft(this._worksheet,c,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(e={}){return this.getObjectValues(e)[0][0]}getObjectValues(e={}){const{startRow:n,endRow:s,startColumn:r,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,s,r,i).getData();if(e.isIncludeStyle){const c=this._deps.getStyles();for(let u=0;u<=s-n;u++)for(let a=0;a<=i-r;a++){if(!o[u][a])continue;const l=o[u][a].s;l&&(o[u][a].s=c.get(l))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const e=this._deps.getStyles();return this.getValues().map(n=>n.map(s=>{var i;const r=e.getStyleByCell(s);return((i=r==null?void 0:r.cl)==null?void 0:i.rgb)||zt.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("ul",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?{s:C.TRUE}:{s:C.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("st",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?{s:C.TRUE}:{s:C.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){return this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("it",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?Tt.ITALIC:Tt.NORMAL:this.getFontStyles()[0][0]}getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("bl",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?Pt.BOLD:Pt.NORMAL:this.getFontWeights()[0][0]}getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:e,_worksheet:n}=this,{startRow:s,endRow:r}=e;let i=0;for(let o=0;o<=r-s;o++){const c=n.getRowHeight(o);i+=c}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:e,endColumn:n}=this._range;return n-e+1}getNumRows(){const{startRow:e,endRow:n}=this._range;return n-e+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(e=>e.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const e=this._deps.getStyles();return this.getValues().map(n=>n.map(s=>e.getStyleByCell(s)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:e,_worksheet:n}=this,{startColumn:s,endColumn:r}=e;let i=0;for(let o=0;o<=r-s;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWraps()[0][0]}getWraps(){return this._getStyles("tb")}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(e){ft.foreach(this._range,e)}_getStyles(e){const n=this._deps.getStyles();return this.getValues().map(s=>s.map(r=>{const i=n&&n.getStyleByCell(r);return i&&i[e]||zt[e]}))}}class mi{constructor(e,n){d(this,"_rowData");this._config=e,this._rowData=A.createObjectArray(n)}getRowData(){return this._rowData}getRowDatas(e,n){const s=new L;for(let r=e;r<e+n;r++){const i=this.getRowOrCreate(r);s.push(i)}return s}getRowHeight(e,n=1){const{_rowData:s}=this,r=this._config;let i=0;for(let o=0;o<n;o++){const c=s.obtain(o+e,{hd:C.FALSE,h:r.defaultRowHeight}),{isAutoHeight:u,ah:a,h:l=r.defaultRowHeight}=c;i+=(u==null||u)&&typeof a=="number"?a:l}return i}getRow(e){const{_rowData:n}=this;return n.get(e)}getRowOrCreate(e){const{_rowData:n}=this,s=n.get(e);if(s)return s;const r=this._config,i={hd:C.FALSE,h:r.defaultRowHeight};return n.set(e,i),i}getHiddenRows(e=0,n=this._rowData.getLength()-1){const s=[];let r=!1,i=-1;for(let o=e;o<=n;o++){const c=this.getRowVisible(o);r&&c?(r=!1,s.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:K.ROW})):!r&&!c&&(r=!0,i=o)}return r&&s.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:K.ROW}),s}getRowVisible(e){const n=this.getRow(e);return n?n.hd!==C.TRUE:!0}getSize(){return this._rowData.getLength()}}class vs extends M{constructor(){super(...arguments);d(this,"_cellContentInterceptors",[]);d(this,"_rowFilteredInterceptors",[]);d(this,"_rowVisibleInterceptors",[]);d(this,"_colVisibleInterceptors",[])}dispose(){super.dispose(),this._cellContentInterceptors.length=0,this._rowFilteredInterceptors.length=0,this._rowVisibleInterceptors.length=0,this._colVisibleInterceptors.length=0}getCell(n,s){for(const r of this._cellContentInterceptors){const i=r.getCell(n,s);if(typeof i<"u")return i}return null}registerCellContentInterceptor(n){if(this._cellContentInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptors.push(n),D(()=>Q(this._cellContentInterceptors,n))}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptors.push(n),D(()=>Q(this._rowFilteredInterceptors,n))}registerRowVisibleInterceptor(n){if(this._rowVisibleInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowVisibleInterceptors.push(n),D(()=>Q(this._rowVisibleInterceptors,n))}registerColVisibleInterceptor(n){if(this._colVisibleInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._colVisibleInterceptors.push(n),D(()=>Q(this._colVisibleInterceptors,n))}}class Ct{constructor(e,n){d(this,"_initialized");d(this,"_sheetId");d(this,"_snapshot");d(this,"_cellData");d(this,"_rowManager");d(this,"_columnManager");d(this,"_viewModel");this._styles=n;const s={...xt,mergeData:[],hideRow:[],hideColumn:[],cellData:{},rowData:{},columnData:{},rowHeader:{width:46,hidden:C.FALSE},columnHeader:{height:20,hidden:C.FALSE},selections:["A1"],rightToLeft:C.FALSE,pluginMeta:{},...e};this._snapshot=s;const{columnData:r,rowData:i,cellData:o}=this._snapshot;this._sheetId=this._snapshot.id??A.generateRandomId(6),this._initialized=!1,this._cellData=new W(o),this._rowManager=new mi(this._snapshot,i),this._columnManager=new Ai(this._snapshot,r),this._viewModel=new vs}__interceptViewModel(e){e(this._viewModel)}getSnapshot(){return this._snapshot}getCellMatrix(){return this._cellData}getRowManager(){return this._rowManager}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:e}=this,n=A.deepClone(e);return new Ct(n,this._styles)}getMergeData(){return this._snapshot.mergeData}getMergedCells(e,n){const s=this._snapshot.mergeData,r=[];for(let i=0;i<s.length;i++){const o=s[i];ht.intersects({startRow:e,startColumn:n,endRow:e,endColumn:n},o)&&r.push(o)}return r.length?r:null}getMergedCell(e,n){const s=this._snapshot.mergeData;for(let r=0;r<s.length;r++){const i=s[r];if(ht.intersects({startRow:e,startColumn:n,endRow:e,endColumn:n},i))return i}return null}getCell(e,n){return e<0||n<0?null:this._viewModel.getCell(e,n)}getCellRaw(e,n){return this.getCellMatrix().getValue(e,n)}getMatrixWithMergedCells(e,n,s,r){const i=this.getCellMatrix(),o=this._snapshot.mergeData.filter(u=>ht.intersects({startRow:e,startColumn:n,endRow:s,endColumn:r},u)),c=new W;return _e(e,s,n,r).forEach((u,a)=>{const l=i.getValue(u,a);l&&c.setValue(u,a,l)}),o.forEach(u=>{const{startColumn:a,startRow:l,endColumn:_,endRow:f}=u;_e(l,f,a,_).forEach((g,E)=>{g===l&&E===a&&c.setValue(g,E,{...i.getValue(g,E),rowSpan:f-l+1,colSpan:_-a+1}),(g!==l||E!==a)&&c.realDeleteValue(g,E)})}),c}getRange(e,n,s,r){return typeof e=="object"?new ft(this,e,{getStyles:()=>this._styles}):new ft(this,{startRow:e,startColumn:n,endColumn:r||n,endRow:s||e},{getStyles:()=>this._styles})}getStatus(){const{_snapshot:e}=this;return e.status}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:e}=this,{columnCount:n}=e;return n}getMaxRows(){const{_snapshot:e}=this,{rowCount:n}=e;return n}getType(){const{_snapshot:e}=this,{type:n}=e;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(e){this._snapshot.rowCount=e}getColumnCount(){return this._snapshot.columnCount}setColumnCount(e){this._snapshot.columnCount=e}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:e}=this,{showGridlines:n}=e;return n===0}getTabColor(){const{_snapshot:e}=this,{tabColor:n}=e;return n}getColumnWidth(e){return this.getColumnManager().getColumnWidth(e)}getRowHeight(e){return this.getRowManager().getRowHeight(e)}getRowVisible(e){return this.getRowManager().getRowVisible(e)}getHiddenRows(e,n){const s=this.getMaxColumns()-1,r=this._rowManager.getHiddenRows(e,n);return r.forEach(i=>i.endColumn=s),r}getColVisible(e){return this._columnManager.getColVisible(e)}getHiddenCols(e,n){const s=this.getMaxRows()-1,r=this._columnManager.getHiddenCols(e,n);return r.forEach(i=>i.endRow=s),r}isRightToLeft(){const{_snapshot:e}=this,{rightToLeft:n}=e;return n}getPluginMeta(e){return this._snapshot.pluginMeta[e]}setPluginMeta(e,n){this._snapshot.pluginMeta[e]=n}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}cellHasValue(e){return e&&(e.v!==void 0||e.f!==void 0||e.p!==void 0)}}var Ii=Object.defineProperty,Ci=Object.getOwnPropertyDescriptor,Si=(t,e,n,s)=>{for(var r=s>1?void 0:s?Ci(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&Ii(e,n,r),r},Ds=(t,e)=>(n,s)=>e(n,s,t);function Ni(t,e){return`${t.getUnitId()}|${e.getSheetId()}`}h.Workbook=class extends M{constructor(n={},s,r){super();d(this,"_sheetCreated$",new b.Subject);d(this,"sheetCreated$",this._sheetCreated$.asObservable());d(this,"_sheetDisposed$",new b.Subject);d(this,"sheetDisposed$",this._sheetDisposed$.asObservable());d(this,"_worksheets");d(this,"_styles");d(this,"_snapshot");d(this,"_unitId");this._genName=s,this._injector=r,this._snapshot=A.commonExtend(Vn,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=A.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new qn(i),this._worksheets=new Map,this._getDefaultWorkSheet()}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete()}save(){return this._snapshot}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getRev(){return this._snapshot.rev??1}incrementRev(){this._snapshot.rev=this.getRev()+1}getShouldRenderLoopImmediately(){return this._snapshot.shouldStartRenderingImmediately!==!1}getContainer(){return this._snapshot.container}addWorksheet(n,s,r){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=r,o.splice(s,0,n);const c=new Ct(r,this._styles);return this._worksheets.set(n,c),this._sheetCreated$.next(c),!0}getParentRenderUnitId(){return this._snapshot.parentRenderUnitId}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:s}=this._snapshot;return s.findIndex(r=>r===n)}getRawActiveSheet(){const{sheetOrder:n}=this._snapshot;return n.find(r=>this._worksheets.get(r).getStatus()===C.TRUE)}getActiveSheet(){const{sheetOrder:n}=this._snapshot,s=this.getRawActiveSheet();return s?this._worksheets.get(s):this._worksheets.get(n[0])}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(s=>this._worksheets.get(s).getStatus()===1)}getSheetSize(){return this._snapshot.sheetOrder.length}flush(){}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(s=>this._worksheets.get(s))}getSheetIndex(n){const{sheetOrder:s}=this._snapshot;return s.findIndex(r=>n.getSheetId()===r)}getSheetBySheetName(n){const{sheetOrder:s}=this._snapshot,r=s.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(r)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:s}=this._snapshot;return this._worksheets.get(s[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===C.TRUE).map(n=>n.getConfig().id)}transformRangeType(n){if(typeof n=="string")return this._getCellRange(n);if(typeof n!="string"&&"row"in n){const s=n;return{sheetId:"",range:{startRow:s.row[0],startColumn:s.column[0],endRow:s.row[1],endColumn:s.column[1]}}}return typeof n!="string"&&"startRow"in n?{sheetId:"",range:n}:It}load(n){this._snapshot=n}_getCellRange(n){var l,_,f,g,E;let s="",r="";if(n.indexOf("!")>-1){const R=n.split("!");s=R[0],r=R[1],s=s.replace(/\\'/g,"'").replace(/''/g,"'"),s.substring(0,1)==="'"&&s.substring(s.length-1,1)==="'"&&(s=s.substring(1,s.length-1))}else r=n;if(r.indexOf(":")===-1){const R=parseInt(r.replace(/[^0-9]/g,""),10)-1,O=A.ABCatNum(r.replace(/[^A-Za-z]/g,""));return!Number.isNaN(R)&&!Number.isNaN(O)?{sheetId:s,range:{startRow:R,endRow:R,startColumn:O,endColumn:O}}:It}r=r.split(":");const i=[0,0],o=[0,0],c=((l=this.getSheetBySheetName(s))==null?void 0:l.getMaxRows())||((_=this.getActiveSheet())==null?void 0:_.getMaxRows()),u=((f=this.getSheetBySheetName(s))==null?void 0:f.getMaxColumns())||((g=this.getActiveSheet())==null?void 0:g.getMaxColumns());return i[0]=parseInt(r[0].replace(/[^0-9]/g,""),10)-1,i[1]=parseInt(r[1].replace(/[^0-9]/g,""),10)-1,Number.isNaN(i[0])&&(i[0]=0),Number.isNaN(i[1])&&(i[1]=c),i[0]>i[1]||(o[0]=A.ABCatNum(r[0].replace(/[^A-Za-z]/g,"")),o[1]=A.ABCatNum(r[1].replace(/[^A-Za-z]/g,"")),Number.isNaN(o[0])&&(o[0]=0),Number.isNaN(o[1])&&(o[1]=u),o[0]>o[1])?It:{sheetId:((E=this.getSheetBySheetName(s))==null?void 0:E.getSheetId())||"",range:{startRow:i[0],endRow:i[1],startColumn:o[0],endColumn:o[1]}}}_getDefaultWorkSheet(){const{_snapshot:n,_worksheets:s}=this,{sheets:r,sheetOrder:i}=n;A.isEmptyObject(r)&&(r[xt.id]=Object.assign(xt,{status:C.TRUE}));for(const o in r){const c=r[o];c.name=this._genName.sheetName(c.name);const u=new Ct(c,this._styles);s.set(o,u),i.includes(o)||i.push(o)}}},h.Workbook=Si([Ds(1,m.Inject(m.forwardRef(()=>ae))),Ds(2,m.Inject(m.Injector))],h.Workbook);class Oe{constructor(e){d(this,"_snapshot");d(this,"_unitId");this._snapshot={...Jn,...e},this._unitId=this._snapshot.id??A.generateRandomId(6)}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var e;return(e=this._snapshot.body)==null?void 0:e.pages}getPageOrder(){var e;return(e=this._snapshot.body)==null?void 0:e.pageOrder}getPage(e){const n=this.getPages();return n==null?void 0:n[e]}getElementsByPage(e){var n;return(n=this.getPage(e))==null?void 0:n.pageElements}getElement(e,n){var s;return(s=this.getElementsByPage(e))==null?void 0:s[n]}getPageSize(){return this._snapshot.pageSize}addPage(){return{id:"cover_1",pageType:Re.SLIDE,zIndex:1,title:"cover",description:"this is first page, cover",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}}const Ae="FOCUSING_SHEET",me="FOCUSING_DOC",Ie="FOCUSING_SLIDE",bi="FOCUSING_EDITOR_BUT_HIDDEN",Us="FOCUSING_EDITOR",wi="FOCUSING_EDITOR_INPUT_FORMULA",Ms="FOCUSING_FORMULA_EDITOR";var Li=Object.defineProperty,vi=Object.getOwnPropertyDescriptor,Di=(t,e,n,s)=>{for(var r=s>1?void 0:s?vi(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&Li(e,n,r),r},Ui=(t,e)=>(n,s)=>e(n,s,t),Ts=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.DOC=1]="DOC",t[t.SHEET=2]="SHEET",t[t.SLIDE=3]="SLIDE",t))(Ts||{});const gt=m.createIdentifier("univer.current");let Ce=class extends M{constructor(e,n){super();d(this,"_focused$",new b.BehaviorSubject(null));d(this,"_focused",null);d(this,"focused$",this._focused$.asObservable());d(this,"_currentSheet$",new b.BehaviorSubject(null));d(this,"currentSheet$",this._currentSheet$.asObservable());d(this,"_currentDoc$",new b.BehaviorSubject(null));d(this,"currentDoc$",this._currentDoc$.asObservable());d(this,"_currentSlide$",new b.BehaviorSubject(null));d(this,"currentSlide$",this._currentSlide$.asObservable());d(this,"_sheetAdded$",new b.Subject);d(this,"sheetAdded$",this._sheetAdded$.asObservable());d(this,"_docAdded$",new b.Subject);d(this,"docAdded$",this._docAdded$.asObservable());d(this,"_slideAdded$",new b.Subject);d(this,"slideAdded$",this._slideAdded$.asObservable());d(this,"_sheetDisposed$",new b.Subject);d(this,"sheetDisposed$",this._sheetDisposed$.asObservable());d(this,"_docDisposed$",new b.Subject);d(this,"docDisposed$",this._docDisposed$.asObservable());d(this,"_slideDisposed$",new b.Subject);d(this,"slideDisposed$",this._slideDisposed$.asObservable());d(this,"_sheets",[]);d(this,"_docs",[]);d(this,"_slides",[]);this._handler=e,this._contextService=n}dispose(){super.dispose(),this._focused$.complete(),this._currentDoc$.complete(),this._currentSheet$.complete(),this._currentSlide$.complete(),this._sheetAdded$.complete(),this._docAdded$.complete(),this._slideAdded$.complete(),this._sheetDisposed$.complete(),this._docDisposed$.complete(),this._slideDisposed$.complete()}createDoc(e){return this._handler.createUniverDoc(e)}createSheet(e){return this._handler.createUniverSheet(e)}createSlide(e){return this._handler.createUniverSlide(e)}addSheet(e){this._sheets.push(e),this._sheetAdded$.next(e),this.setCurrentUniverSheetInstance(e.getUnitId())}changeDoc(e,n){const s=this._docs.find(r=>r.getUnitId()===e);if(s!=null){const r=this._docs.indexOf(s);this._docs.splice(r,1)}this.addDoc(n)}addDoc(e){this._docs.push(e),this._docAdded$.next(e),this.setCurrentUniverDocInstance(e.getUnitId())}addSlide(e){this._slides.push(e),this._slideAdded$.next(e),this.setCurrentUniverSlideInstance(e.getUnitId())}getUniverSheetInstance(e){return this._sheets.find(n=>n.getUnitId()===e)}getUniverDocInstance(e){return this._docs.find(n=>n.getUnitId()===e)}getUniverSlideInstance(e){return this._slides.find(n=>n.getUnitId()===e)}getAllUniverSheetsInstance(){return this._sheets}getAllUniverDocsInstance(){return this._docs}getAllUniverSlidesInstance(){return this._slides}setCurrentUniverSheetInstance(e){this._currentSheet$.next(this.getUniverSheetInstance(e)||null)}setCurrentUniverSlideInstance(e){this._currentSlide$.next(this.getUniverSlideInstance(e)||null)}setCurrentUniverDocInstance(e){this._currentDoc$.next(this.getUniverDocInstance(e)||null)}getCurrentUniverSheetInstance(){const e=this._currentSheet$.getValue();if(!e)throw new Error("No current sheet!");return e}getCurrentUniverDocInstance(){const e=this._currentDoc$.getValue();if(!e)throw new Error("No current doc!");return e}getCurrentUniverSlideInstance(){const e=this._currentSlide$.getValue();if(!e)throw new Error("No current slide!");return e}focusUniverInstance(e){e&&(this._focused=this.getUniverSheetInstance(e)||this.getUniverDocInstance(e)||this.getUniverSlideInstance(e)||null),this._focused$.next(e),[me,Ae,Ie].forEach(n=>this._contextService.setContextValue(n,!1)),this._focused instanceof h.Workbook?this._contextService.setContextValue(Ae,!0):this._focused instanceof dt?this._contextService.setContextValue(me,!0):this._focused instanceof Oe&&this._contextService.setContextValue(Ie,!0)}getFocusedUniverInstance(){return this._focused}getDocumentType(e){if(this.getUniverDocInstance(e))return 1;if(this.getUniverSheetInstance(e))return 2;if(this.getUniverSlideInstance(e))return 3;throw new Error(`[UniverInstanceService]: No document with unitID ${e}`)}disposeDocument(e){const n=this.getUniverDocInstance(e);if(n){const i=this._docs.indexOf(n);return this._docs.splice(i,1),this._docDisposed$.next(n),this.focusUniverInstance(null),!0}const s=this.getUniverSheetInstance(e);if(s){const i=this._sheets.indexOf(s);return this._sheets.splice(i,1),this._sheetDisposed$.next(s),this.focusUniverInstance(null),!0}const r=this.getUniverSlideInstance(e);if(r){const i=this._slides.indexOf(r);return this._slides.splice(i,1),this._slideDisposed$.next(r),this.focusUniverInstance(null),!0}return!1}};Ce=Di([Ui(1,ct)],Ce);var N=(t=>(t[t.Starting=0]="Starting",t[t.Ready=1]="Ready",t[t.Rendered=2]="Rendered",t[t.Steady=3]="Steady",t))(N||{});const Ps={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"},Yt=new Map;function Se(t,e){return function(r){Ne(t,e)}}function Ne(t,e){Yt.has(t)||Yt.set(t,[]),Yt.get(t).push(e)}var Mi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Fs=(t,e,n,s)=>{for(var r=s>1?void 0:s?Ti(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&Mi(e,n,r),r},be=(t,e)=>(n,s)=>e(n,s,t);h.LifecycleService=class extends M{constructor(n){super();d(this,"_lifecycle$",new b.BehaviorSubject(N.Starting));d(this,"lifecycle$",this._lifecycle$.asObservable());this._logService=n,this._logService.log("[LifecycleService]",`lifecycle progressed to "${Ps[N.Starting]}".`)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._logService.log("[LifecycleService]",`lifecycle progressed to "${Ps[n]}".`),this._lifecycle$.next(n))}subscribeWithPrevious(){return new b.Observable(n=>(this.stage===N.Starting||(this.stage===N.Ready?n.next(N.Starting):this.stage===N.Rendered?(n.next(N.Starting),n.next(N.Ready)):(n.next(N.Starting),n.next(N.Ready),n.next(N.Rendered))),this._lifecycle$.subscribe(n)))}},h.LifecycleService=Fs([be(0,at)],h.LifecycleService);let ot=class extends M{constructor(e,n){super();d(this,"_started",!1);this._lifecycleService=e,this._injector=n}start(){this._started||(this._started=!0,this.disposeWithMe(D(this._lifecycleService.subscribeWithPrevious().subscribe(e=>this.initModulesOnStage(e)))))}initModulesOnStage(e){const n=Yt.get(e);n==null||n.forEach(s=>{this._injector.has(s)&&this._injector.get(s)})}};ot=Fs([be(0,m.Inject(h.LifecycleService)),be(1,m.Inject(m.Injector))],ot);function Pi(t,e){if(t)try{return t[e]?t[e]:e.split(".").reduce((n,s)=>n[s],t)}catch{return console.warn("Key %s not found",e),e}}class St extends M{constructor(){super();d(this,"currentLocale",Mt.ZH_CN);d(this,"locales",null);d(this,"localeChanged$",new b.Subject);d(this,"t",n=>{if(!this.locales)throw new Error("Locale not initialized");return Pi(this.locales[this.currentLocale],n)??n});this.disposeWithMe(D(()=>this.localeChanged$.complete()))}load(n){this.locales=A.deepMerge(this.locales??{},n)}setLocale(n){this.currentLocale=n,this.localeChanged$.next()}getLocales(){var n;return(n=this.locales)==null?void 0:n[this.currentLocale]}getCurrentLocale(){return this.currentLocale}}function Fi(t){return et(t==null?void 0:t.lift)}function Hi(t){return function(e){if(Fi(e))return e.lift(function(n){try{return t(n,this)}catch(s){this.error(s)}});throw new TypeError("Unable to lift unknown Observable type")}}var Wi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},we={setTimeout:function(t,e){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];var r=we.delegate;return r!=null&&r.setTimeout?r.setTimeout.apply(r,Lt([t,e],wt(n))):setTimeout.apply(void 0,Lt([t,e],wt(n)))},clearTimeout:function(t){var e=we.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Bi(t){we.setTimeout(function(){throw t})}function Hs(){}var Ws=function(t){ee(e,t);function e(n){var s=t.call(this)||this;return s.isStopped=!1,n?(s.destination=n,pe(n)&&n.add(s)):s.destination=ji,s}return e.create=function(n,s,r){return new pi(n,s,r)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(se),Gi=Function.prototype.bind;function Le(t,e){return Gi.call(t,e)}var $i=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(s){Xt(s)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(s){Xt(s)}else Xt(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Xt(n)}},t}(),pi=function(t){ee(e,t);function e(n,s,r){var i=t.call(this)||this,o;if(et(n)||!n)o={next:n??void 0,error:s??void 0,complete:r??void 0};else{var c;i&&Wi.useDeprecatedNextContext?(c=Object.create(n),c.unsubscribe=function(){return i.unsubscribe()},o={next:n.next&&Le(n.next,c),error:n.error&&Le(n.error,c),complete:n.complete&&Le(n.complete,c)}):o=n}return i.destination=new $i(o),i}return e}(Ws);function Xt(t){Bi(t)}function ki(t){throw t}var ji={closed:!0,next:Hs,error:ki,complete:Hs};function Vi(t,e,n,s,r){return new xi(t,e,n,s,r)}var xi=function(t){ee(e,t);function e(n,s,r,i,o,c){var u=t.call(this,n)||this;return u.onFinalize=o,u.shouldUnsubscribe=c,u._next=s?function(a){try{s(a)}catch(l){n.error(l)}}:t.prototype._next,u._error=i?function(a){try{i(a)}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=r?function(){try{r()}catch(a){n.error(a)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;t.prototype.unsubscribe.call(this),!s&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Ws);function zi(t,e){return Hi(function(n,s){var r=0;n.subscribe(Vi(s,function(i){s.next(t.call(e,i,r++))}))})}const ve=m.createIdentifier("resource-manager-service"),Bs=m.createIdentifier("ResourcePersistenceService");Ne(N.Ready,Bs);var Ki=Object.defineProperty,Yi=Object.getOwnPropertyDescriptor,Xi=(t,e,n,s)=>{for(var r=s>1?void 0:s?Yi(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&Ki(e,n,r),r},Gs=(t,e)=>(n,s)=>e(n,s,t);const De=m.createIdentifier("univer.permission-service"),$s="PERMISSION";h.PermissionService=class extends M{constructor(n,s){super();d(this,"_permissionPointMap",new Map);d(this,"deletePermissionPoint",(n,s)=>{const r=this._permissionPointMap.get(n);if(r){const i=r.get(s);i&&(i.complete(),this._permissionPointMap.delete(s))}});d(this,"addPermissionPoint",(n,s)=>{const r=this._permissionPointMap.get(n)||new Map;return r.has(s.id)?!1:(r.set(s.id,new b.BehaviorSubject(s)),this._permissionPointMap.set(n,r),!0)});d(this,"updatePermissionPoint",(n,s,r)=>{const i=this._permissionPointMap.get(n);if(!i)return;const o=i.get(s);if(o){const c=o.getValue();c.value=r,c.status=he.DONE,o.next(c)}});d(this,"getPermissionPoint",(n,s)=>{const r=this._permissionPointMap.get(n);if(!r)return;const i=r.get(s);if(i)return i.getValue()});this._resourceManagerService=n,this._univerInstanceService=s}_init(){this.disposeWithMe(D(this._univerInstanceService.sheetAdded$.subscribe(n=>{this._resourceManagerService.registerPluginResource(n.getUnitId(),$s,{onChange:(s,r)=>{r.forEach(i=>{this.getPermissionPoint(s,i.id)?this.updatePermissionPoint(s,i.id,i.value):this.addPermissionPoint(s,i)})},toJson:s=>this._toJson(s),parseJson:s=>this._parseJson(s)})}))),this.disposeWithMe(D(this._univerInstanceService.sheetDisposed$.subscribe(n=>{this._resourceManagerService.disposePluginResource(n.getUnitId(),$s)})))}_toJson(n){const s=this._permissionPointMap.get(n);let r=[];return s&&(r=[...s.keys()].reduce((i,o)=>{const c=s.get(o);return c&&i.push(c.getValue()),i},[])),JSON.stringify(r)}_parseJson(n){return JSON.parse(n)}composePermission$(n,s){const r=this._permissionPointMap.get(n),i=s.map(o=>{const c=r==null?void 0:r.get(o);if(!c)throw new Error(`${o} permissionPoint is not exist`);return c.asObservable()});return b.combineLatest(i).pipe(zi(o=>(o.every(c=>this._permissionPointMap.get(c.id)),o)))}composePermission(n,s){const r=this._permissionPointMap.get(n);return s.map(o=>{const c=r==null?void 0:r.get(o);if(!c)throw new Error(`${o} permissionPoint is not exist`);return c.getValue()})}},h.PermissionService=Xi([Se(N.Starting,h.PermissionService),Gs(0,m.Inject(ve)),Gs(1,m.Inject(gt))],h.PermissionService);const ps="univer.editable";class Qt extends Dn{constructor(n){super();d(this,"id",ps);d(this,"value",!0);d(this,"unitID");this.unitID=n}}var Qi=Object.defineProperty,Ji=Object.getOwnPropertyDescriptor,Zi=(t,e,n,s)=>{for(var r=s>1?void 0:s?Ji(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&Qi(e,n,r),r},ks=(t,e)=>(n,s)=>e(n,s,t);h.UniverPermissionService=class extends M{constructor(e,n){super(),this._permissionService=e,this._univerInstanceService=n,this._init()}_init(){this._univerInstanceService.sheetAdded$.subscribe(e=>{const n=new Qt(e.getUnitId());this._permissionService.addPermissionPoint(e.getUnitId(),n)})}getEditable(e){let n=e;n||(n=this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId());const s=new Qt(n),r=this._permissionService.getPermissionPoint(n,s.id);return r==null?void 0:r.value}setEditable(e,n){const s=new Qt(e);this._permissionService.updatePermissionPoint(e,s.id,n)}},h.UniverPermissionService=Zi([Se(N.Starting,h.UniverPermissionService),ks(0,m.Inject(De)),ks(1,m.Inject(gt))],h.UniverPermissionService);class js extends M{constructor(){super(...arguments);d(this,"_resourceMap",new Map);d(this,"_register$",new b.Subject);d(this,"register$",this._register$.asObservable())}getAllResource(n){const s=this._resourceMap.get(n);return s?[...s.keys()].reduce((r,i)=>{const o=s.get(i);return o&&r.push({unitID:n,resourceName:i,hook:o}),r},[]):[]}registerPluginResource(n,s,r){const i=this._resourceMap.get(n)||new Map;if(i.has(s))throw new Error("the pluginName is registered");return i.set(s,r),this._resourceMap.set(n,i),this._register$.next({unitID:n,resourceName:s,hook:r}),D(()=>i.delete(s))}disposePluginResource(n,s){const r=this._resourceMap.get(n);r==null||r.delete(s)}dispose(){this._register$.complete(),this._resourceMap.clear()}}class Ue extends M{constructor(){super();d(this,"_currentTheme");d(this,"_currentTheme$",new b.BehaviorSubject({}));d(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(D(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}}const Vs="__defaultDocumentNormalEditorSpecialUnitId_20231006__",xs="__defaultDocumentFormulaBarEditorSpecialUnitId_20231012__",qi=`\r
|
|
11
|
+
`;var yi=Object.defineProperty,to=Object.getOwnPropertyDescriptor,eo=(t,e,n,s)=>{for(var r=s>1?void 0:s?to(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&yi(e,n,r),r},Me=(t,e)=>(n,s)=>e(n,s,t);const Jt=m.createIdentifier("univer.undo-redo.service"),no=20;h.LocalUndoRedoService=class extends M{constructor(n,s,r){super();d(this,"undoRedoStatus$");d(this,"_undoRedoStatus$",new b.BehaviorSubject({undos:0,redos:0}));d(this,"_undoStacks",new Map);d(this,"_redoStacks",new Map);this._univerInstanceService=n,this._commandService=s,this._contextService=r,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(Ks)),this.disposeWithMe(this._commandService.registerCommand(Ys)),this.disposeWithMe(D(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(D(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:s}=n,r=this._getRedoStack(s,!0),i=this._getUndoStack(s,!0);r.length=0,i.push(n),i.length>no&&i.splice(0,1),this._updateStatus()}clearUndoRedo(n){const s=this._getRedoStack(n);s&&(s.length=0);const r=this._getUndoStack(n);r&&(r.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getUndoStackForFocused();return n.length?n[n.length-1]:null}pitchTopRedoElement(){const n=this._getRedoStackForFocused();return n.length?n[n.length-1]:null}popUndoToRedo(){const s=this._getUndoStackForFocused().pop();s&&(this._getRedoStackForFocused().push(s),this._updateStatus())}popRedoToUndo(){const s=this._getRedoStackForFocused().pop();s&&(this._getUndoStackForFocused().push(s),this._updateStatus())}_updateStatus(){var i,o;const n=this._getFocusedUniverInstanceId(),s=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,r=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:s,redos:r})}_getUndoStack(n,s=!1){let r=this._undoStacks.get(n);return!r&&s&&(r=[],this._undoStacks.set(n,r)),r||null}_getRedoStack(n,s=!1){let r=this._redoStacks.get(n);return!r&&s&&(r=[],this._redoStacks.set(n,r)),r||null}_getUndoStackForFocused(){const n=this._getFocusedUniverInstanceId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUniverInstanceId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_getFocusedUniverInstanceId(){var s;let n="";return this._contextService.getContextValue(Ms)?n=xs:this._contextService.getContextValue(Us)?n=Vs:n=((s=this._univerInstanceService.getFocusedUniverInstance())==null?void 0:s.getUnitId())??"",n}},h.LocalUndoRedoService=eo([Me(0,gt),Me(1,Rt),Me(2,ct)],h.LocalUndoRedoService);class zs{dispose(){}async dispatchToHandlers(){return!1}}const Ks=new class extends zs{constructor(){super(...arguments);d(this,"type",Ut.COMMAND);d(this,"id","univer.command.undo")}async handler(e){const n=e.get(Jt),s=n.pitchTopUndoElement();if(!s)return!1;const r=e.get(Rt);return(s.undo?await s.undo(s.undoMutations):re(s.undoMutations,r))?(n.popUndoToRedo(),!0):!1}},Ys=new class extends zs{constructor(){super(...arguments);d(this,"type",Ut.COMMAND);d(this,"id","univer.command.redo")}async handler(e){const n=e.get(Jt),s=n.pitchTopRedoElement();if(!s)return!1;const r=e.get(Rt);return(s.redo?await s.redo(s.redoMutations):re(s.redoMutations,r))?(n.popRedoToUndo(),!0):!1}};var so=Object.defineProperty,ro=Object.getOwnPropertyDescriptor,io=(t,e,n,s)=>{for(var r=s>1?void 0:s?ro(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&so(e,n,r),r},Xs=(t,e)=>(n,s)=>e(n,s,t);h.UniverDoc=class extends M{constructor(n,s){super();d(this,"_pluginStore",new bt);this._injector=n,this._initService=s}start(){this._pluginStore.forEachPlugin(n=>n.onStarting(this._injector)),this._initService.initModulesOnStage(N.Starting)}ready(){this.disposeWithMe(D(this._injector.get(h.LifecycleService).subscribeWithPrevious().subscribe(n=>{if(n===N.Ready){this._pluginStore.forEachPlugin(s=>s.onReady()),this._initService.initModulesOnStage(N.Ready);return}if(n===N.Rendered){this._pluginStore.forEachPlugin(s=>s.onRendered()),this._initService.initModulesOnStage(N.Rendered);return}n===N.Steady&&(this._pluginStore.forEachPlugin(s=>s.onSteady()),this._initService.initModulesOnStage(N.Steady))})))}createDoc(n){return this._injector.createInstance(dt,n)}addPlugin(n,s){const r=this._injector.createInstance(n,s);r.onStarting(this._injector),this._pluginStore.addPlugin(r)}},h.UniverDoc=io([Xs(0,m.Inject(m.Injector)),Xs(1,m.Inject(ot))],h.UniverDoc);var oo=Object.defineProperty,co=Object.getOwnPropertyDescriptor,ao=(t,e,n,s)=>{for(var r=s>1?void 0:s?co(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&oo(e,n,r),r},Qs=(t,e)=>(n,s)=>e(n,s,t);h.UniverSheet=class extends M{constructor(n,s){super();d(this,"_pluginStore",new bt);this._injector=n,this._initService=s,this._initDependencies(n)}start(){this._pluginStore.forEachPlugin(n=>n.onStarting(this._injector)),this._initService.initModulesOnStage(N.Starting)}ready(){this.disposeWithMe(D(this._injector.get(h.LifecycleService).subscribeWithPrevious().subscribe(n=>{if(n===N.Ready){this._pluginStore.forEachPlugin(s=>s.onReady()),this._initService.initModulesOnStage(N.Ready);return}if(n===N.Rendered){this._pluginStore.forEachPlugin(s=>s.onRendered()),this._initService.initModulesOnStage(N.Rendered);return}n===N.Steady&&(this._pluginStore.forEachPlugin(s=>s.onSteady()),this._initService.initModulesOnStage(N.Steady))})))}createSheet(n){return this._injector.createInstance(h.Workbook,n)}dispose(){super.dispose(),this._pluginStore.removePlugins()}addPlugin(n,s){const r=this._injector.createInstance(n,s);this._pluginStore.addPlugin(r)}_initDependencies(n){[].forEach(r=>n.add(r))}},h.UniverSheet=ao([Qs(0,m.Inject(m.Injector)),Qs(1,m.Inject(ot))],h.UniverSheet);var lo=Object.defineProperty,uo=Object.getOwnPropertyDescriptor,ho=(t,e,n,s)=>{for(var r=s>1?void 0:s?uo(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&lo(e,n,r),r},Te=(t,e)=>(n,s)=>e(n,s,t);h.UniverSlide=class extends M{constructor(n,s,r){super();d(this,"_pluginStore",new bt);this._injector=n,this._lifecycleService=s,this._initializerService=r}start(){this._pluginStore.forEachPlugin(n=>n.onStarting(this._injector)),this._initializerService.initModulesOnStage(N.Starting)}ready(){this.disposeWithMe(D(this._lifecycleService.subscribeWithPrevious().subscribe(n=>{if(n===N.Ready){this._pluginStore.forEachPlugin(s=>s.onReady()),this._initializerService.initModulesOnStage(N.Ready);return}if(n===N.Rendered){this._pluginStore.forEachPlugin(s=>s.onRendered()),this._initializerService.initModulesOnStage(N.Rendered);return}n===N.Steady&&(this._pluginStore.forEachPlugin(s=>s.onSteady()),this._initializerService.initModulesOnStage(N.Steady))})))}createSlide(n){return this._injector.createInstance(Oe,n)}addPlugin(n,s){const r=this._injector.createInstance(n,s);this._pluginStore.addPlugin(r)}},h.UniverSlide=ho([Te(0,m.Inject(m.Injector)),Te(1,m.Inject(h.LifecycleService)),Te(2,m.Inject(ot))],h.UniverSlide);class _o{constructor(e={}){d(this,"_rootInjector");d(this,"_univerPluginStore",new bt);d(this,"_univerPluginRegistry",new sr);d(this,"_univerSheet",null);d(this,"_univerDoc",null);d(this,"_univerSlide",null);this._rootInjector=this._initDependencies();const{theme:n,locale:s,locales:r,logLevel:i}=e;n&&this._rootInjector.get(Ue).setTheme(n),r&&this._rootInjector.get(St).load(r),s&&this._rootInjector.get(St).setLocale(s),i&&this._rootInjector.get(at).setLogLevel(i)}get _univerInstanceService(){return this._rootInjector.get(gt)}__getInjector(){return this._rootInjector}dispose(){this._rootInjector.dispose()}registerPlugin(e,n){if(e.type===j.Univer)this._registerUniverPlugin(e,n);else if(e.type===j.Sheet)this._registerUniverSheets(e,n);else if(e.type===j.Doc)this._registerUniverDocs(e,n);else if(e.type===j.Slide)this._registerUniverSlides(e,n);else throw new Error(`Unimplemented plugin system for business: "${e.type}".`)}setLocale(e){this._rootInjector.get(St).setLocale(e)}createUniverSheet(e){let n;const s=()=>{n=this._univerSheet.createSheet(e),this._univerInstanceService.addSheet(n)};return this._univerSheet?s():(this._univerSheet=this._rootInjector.createInstance(h.UniverSheet),this._univerPluginRegistry.getRegisterPlugins(j.Sheet).forEach(r=>this._univerSheet.addPlugin(r.plugin,r.options)),this._tryStart(),this._univerSheet.start(),s(),this._tryProgressToReady(),this._univerSheet.ready()),n}createUniverDoc(e){let n;const s=()=>{n=this._univerDoc.createDoc(e),this._univerInstanceService.addDoc(n)};return this._univerDoc?s():(this._univerDoc=this._rootInjector.createInstance(h.UniverDoc),this._univerPluginRegistry.getRegisterPlugins(j.Doc).forEach(r=>this._univerDoc.addPlugin(r.plugin,r.options)),this._tryStart(),this._univerDoc.start(),s(),this._tryProgressToReady(),this._univerDoc.ready()),n}createUniverSlide(e){let n;const s=()=>{n=this._univerSlide.createSlide(e),this._univerInstanceService.addSlide(n)};return this._univerSlide?s():(this._univerSlide=this._rootInjector.createInstance(h.UniverSlide),this._univerPluginRegistry.getRegisterPlugins(j.Slide).forEach(r=>this._univerSlide.addPlugin(r.plugin,r.options)),this._tryStart(),this._univerSlide.ready(),s(),this._tryProgressToReady()),n}_initDependencies(){return new m.Injector([[gt,{useFactory:e=>new Ce({createUniverDoc:n=>this.createUniverDoc(n),createUniverSheet:n=>this.createUniverSheet(n),createUniverSlide:n=>this.createUniverSlide(n)},e),deps:[ct]}],[Je],[St],[Ue],[ae],[h.LifecycleService],[ot],[De,{useClass:h.PermissionService}],[h.UniverPermissionService],[at,{useClass:Ye,lazy:!0}],[Rt,{useClass:h.CommandService,lazy:!0}],[Jt,{useClass:h.LocalUndoRedoService,lazy:!0}],[Qe,{useClass:gr}],[ct,{useClass:ze}],[qe,{useClass:Ze,lazy:!0}],[ve,{useClass:js,lazy:!0}]])}_tryStart(){this._rootInjector.get(ot).start()}_tryProgressToReady(){this._rootInjector.get(h.LifecycleService).stage<N.Ready&&(this._rootInjector.get(h.LifecycleService).stage=N.Ready,this._univerPluginStore.forEachPlugin(n=>n.onReady()))}_registerUniverPlugin(e,n){const s=this._rootInjector.createInstance(e,n);s.onStarting(this._rootInjector),this._univerPluginStore.addPlugin(s)}_registerUniverSheets(e,n){this._univerPluginRegistry.registerPlugin(e,n)}_registerUniverDocs(e,n){this._univerPluginRegistry.registerPlugin(e,n)}_registerUniverSlides(e,n){this._univerPluginRegistry.registerPlugin(e,n)}_initializePluginsForDoc(e){this._univerPluginRegistry.getRegisterPlugins(j.Doc).forEach(s=>{e.addPlugin(s.plugin,s.options)})}_initializePluginsForSlide(e){this._univerPluginRegistry.getRegisterPlugins(j.Slide).forEach(s=>{e.addPlugin(s.plugin,s.options)})}}function fo(t){const e=new MessageChannel;let n=!1;return e.port1.onmessage=()=>{n||t()},e.port2.postMessage(null),()=>{n=!0}}class go extends Dt{add(e){if(!e)return null;const n=new vt(e,this);return this._observers=[n],this._onObserverAdded&&this._onObserverAdded(n),n}makeObserverTopPriority(){}makeObserverBottomPriority(){}}const Eo=m.createIdentifier("ILocalStorageService"),Ro=t=>`sheet_interceptor_${t}`,Js=t=>function(e,n){let s=-1;function r(i,o){if(i<=s)throw new Error("[SheetInterceptorService]: next() called multiple times!");return s=i,i===t.length?o:t[i].handler(o,n,r.bind(null,i+1))}return r(0,e)};class Oo{constructor(e){d(this,"_interceptorsByName",new Map);d(this,"_interceptorPoints");this._interceptorPoints=e}fetchThroughInterceptors(e){const n=e,s=this._interceptorsByName.get(n);return Js(s||[])}intercept(e,n){const s=e;this._interceptorsByName.has(s)||this._interceptorsByName.set(s,[]);const r=this._interceptorsByName.get(s);return r.push(n),this._interceptorsByName.set(s,r.sort((i,o)=>(o.priority??0)-(i.priority??0))),()=>Q(this._interceptorsByName.get(s),n)}getInterceptPoints(){return this._interceptorPoints}}const Zs=`'?\\[((?![\\/?:"<>|*\\\\]).)*\\]`,Ao=/[^0-9]/g,mo=/[^A-Za-z]/g;function Nt(t){const e=t[0]==="$",s=t.substring(1).indexOf("$")>-1;return e&&s?Y.ALL:e?Y.COLUMN:s?Y.ROW:Y.NONE}function Io(t){const e=t.split("!");e.length>1&&(t=e[e.length-1]);const n=t.split(":");return n.length>1?{startAbsoluteRefType:Nt(n[0]),endAbsoluteRefType:Nt(n[1])}:{startAbsoluteRefType:Nt(n[0])}}function qs(t=Y.NONE){let e="",n="";return t===Y.ROW?e="$":t===Y.COLUMN?n="$":t===Y.ALL&&(e="$",n="$"),{rowAbsoluteString:e,columnAbsoluteString:n}}function Zt(t){const{startColumn:e,startRow:n,endColumn:s,endRow:r,startAbsoluteRefType:i,endAbsoluteRefType:o}=t,c=qs(i),u=qs(o),a=`${c.columnAbsoluteString}${A.chatAtABC(e)}${c.rowAbsoluteString}${n+1}`,l=`${u.columnAbsoluteString}${A.chatAtABC(s)}${u.rowAbsoluteString}${r+1}`;return a===l?a:`${a}:${l}`}function ys(t,e){return`${t}!${Zt(e)}`}function tr(t,e,n){return`[${t}]${e}!${Zt(n)}`}function Co(t){const{unitId:e,sheetName:n,range:s}=t;return e!=null&&e.length>0&&n!=null&&n.length>0?tr(e,n,s):n!=null&&n.length>0?ys(n,s):Zt(s)}function Pe(t){const e=parseInt(t.replace(Ao,""))-1,n=A.ABCatNum(t.replace(mo,"")),s=Nt(t);return{row:e,column:n,absoluteRefType:s}}function So(t){const e=new RegExp(Zs).exec(t);let n="";e!=null&&(n=e[0],t=t.replace(new RegExp(Zs,"g"),""));const s=t.indexOf("!");let r="",i="";s>-1?(r=t.substring(0,s),i=t.substring(s)):i=t;const o=i.indexOf(":");if(o===-1){const R=Pe(i),O=R.row,I=R.column,S=R.absoluteRefType;return{unitId:n,sheetName:r,range:{startRow:O,startColumn:I,endRow:O,endColumn:I,startAbsoluteRefType:S,endAbsoluteRefType:S}}}const c=i.substring(0,o),u=i.substring(o+1),a=Pe(c),l=Pe(u),_=a.row,f=a.column,g=l.row,E=l.column;return{unitId:n,sheetName:r,range:{startRow:_,startColumn:f,endRow:g,endColumn:E,startAbsoluteRefType:a.absoluteRefType,endAbsoluteRefType:l.absoluteRefType}}}h.ABCToNumber=Xr,h.ACTION_NAMES=jn,h.AbsoluteRefType=Y,h.AlignTypeH=Cs,h.AlignTypeV=Ss,h.AutoFillSeries=nn,h.BaselineOffset=Ft,h.BlockType=rs,h.BooleanNumber=C,h.BorderStyleTypes=v,h.BorderType=sn,h.BulletAlignment=ns,h.CellValueType=At,h.Color=st,h.ColorBuilder=Wt,h.ColorType=p,h.ColumnSeparatorType=cs,h.CommandType=Ut,h.CommonHideTypes=rn,h.ConditionType=on,h.ContentAlignment=Rs,h.ContextService=ze,h.CopyPasteType=cn,h.CustomRangeType=ss,h.DEFAULT_CELL=gi,h.DEFAULT_DOC=Ee,h.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=Er,h.DEFAULT_EMPTY_DOCUMENT_VALUE=qi,h.DEFAULT_RANGE=di,h.DEFAULT_RANGE_ARRAY=It,h.DEFAULT_SELECTION=fi,h.DEFAULT_SLIDE=Jn,h.DEFAULT_STYLES=zt,h.DEFAULT_WORKBOOK=Vn,h.DEFAULT_WORKSHEET=xt,h.DEFAULT_WORKSHEET_COLUMN_COUNT=zn,h.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Qn,h.DEFAULT_WORKSHEET_COLUMN_WIDTH=Yn,h.DEFAULT_WORKSHEET_ROW_COUNT=xn,h.DEFAULT_WORKSHEET_ROW_HEIGHT=Kn,h.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Xn,h.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=xs,h.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=Vs,h.DashStyleType=fs,h.DataStreamTreeNodeType=Tn,h.DataStreamTreeTokenType=de,h.DesktopLogService=Ye,h.DeveloperMetadataVisibility=an,h.Dimension=ln,h.Direction=un,h.Disposable=M,h.DisposableCollection=xe,h.DocStyleType=yn,h.DocumentDataModel=dt,h.DocumentType=Ts,h.EXTENSION_NAMES=Zn,h.Entry=ue,h.EntryIterator=vn,h.ErrorService=Je,h.EventState=je,h.FOCUSING_DOC=me,h.FOCUSING_EDITOR=Us,h.FOCUSING_EDITOR_BUT_HIDDEN=bi,h.FOCUSING_EDITOR_INPUT_FORMULA=wi,h.FOCUSING_FORMULA_EDITOR=Ms,h.FOCUSING_SHEET=Ae,h.FOCUSING_SLIDE=Ie,h.FloatingObjectManagerService=Ze,h.FollowNumberWithType=ts,h.FontItalic=Tt,h.FontStyleType=Os,h.FontWeight=Pt,h.FormatType=hn,h.GenName=ae,h.GlyphType=es,h.GridType=is,h.HLSColor=On,h.HorizontalAlign=nt,h.ICommandService=Rt,h.IConfigService=Qe,h.IContextService=ct,h.IFloatingObjectManagerService=qe,h.ILocalStorageService=Eo,h.ILogService=at,h.IPermissionService=De,h.IResourceManagerService=ve,h.ISnapshotPersistenceService=Bs,h.IUndoRedoService=Jt,h.IUniverInstanceService=gt,h.InterceptorManager=Oo,h.InterpolationPointType=_n,h.KeyIterator=wn,h.LRUHelper=mt,h.LRUMap=xr,h.LifecycleStages=N,h.LocaleService=St,h.LocaleType=Mt,h.LogLevel=Ke,h.MemoryCursor=ye,h.NamedStyleType=_s,h.NumberUnitType=Is,h.ObjectArray=L,h.ObjectArrayIterableIterator=$t,h.ObjectMatrix=W,h.ObjectRelativeFromH=As,h.ObjectRelativeFromV=ms,h.Observable=Dt,h.ObservableHooks=go,h.Observer=vt,h.OnLifecycle=Se,h.PageElementType=ws,h.PageOrientType=bs,h.PageType=Re,h.ParagraphElementType=ls,h.PermissionPoint=Dn,h.PermissionStatus=he,h.Plugin=He,h.PluginType=j,h.PositionedObjectLayoutType=hs,h.ProtectionType=dn,h.RANGE_TYPE=K,h.Range=ft,h.Rectangle=ht,h.RedoCommand=Ys,h.RefAlias=Yr,h.Registry=qt,h.RegistryAsMap=yt,h.RelativeDate=fn,h.RelativeSlideLink=Ls,h.ResourceManagerService=js,h.RgbColor=Bt,h.RxDisposable=ar,h.SectionType=os,h.ShapeType=gn,h.SheetTypes=ie,h.SheetViewModel=vs,h.Slide=Oe,h.SpacingRule=ds,h.Styles=qn,h.THEME_COLORS=Rn,h.TabStopAlignment=gs,h.TextDecoration=En,h.TextDirection=Ot,h.TextDirectionType=as,h.ThemeColor=Gt,h.ThemeColorType=H,h.ThemeColors=Ht,h.ThemeService=Ue,h.Tools=A,h.UndoCommand=Ks,h.Univer=_o,h.UniverEditablePermission=Qt,h.UniverEditablePermissionPoint=ps,h.UpdateDocsAttributeType=F,h.ValueIterator=Ln,h.VerticalAlign=lt,h.WidthType=Es,h.Worksheet=Ct,h.WrapStrategy=ut,h.WrapTextType=us,h.binarySearchArray=tn,h.characterSpacingControlType=Ns,h.checkParagraphHasBullet=Mr,h.checkParagraphHasIndent=Tr,h.checkParagraphHasIndentByStyle=In,h.codeToBlob=Or,h.composeInterceptors=Js,h.createInterceptorKey=Ro,h.createRowColIter=_e,h.datenum_local=bn,h.dedupe=rr,h.deepCompare=oe,h.deleteContent=Sn,h.deserializeRangeWithSheet=So,h.error=le,h.fromObservable=cr,h.generate=kr,h.getAbsoluteRefTypeWitString=Io,h.getAbsoluteRefTypeWithSingleString=Nt,h.getBorderStyleType=Ur,h.getCellValueType=Ri,h.getColorStyle=z,h.getDocsUpdateBody=kt,h.getReverseDirection=Ar,h.getTypeFromPermissionItemList=zr,h.getWorksheetUID=Ni,h.handleJsonToDom=vr,h.handleStyleToString=Dr,h.hashAlgorithm=Vr,h.horizontalLineSegmentsSubtraction=ce,h.insertTextToContent=Cn,h.isEmptyCell=br,h.isFormulaId=Lr,h.isFormulaString=wr,h.isICellData=Ei,h.isNullCell=Oi,h.isObserver=Ve,h.isRealNum=it,h.isSameStyleTextRun=mn,h.makeCellRangeToRangeData=Nr,h.makeCellToSelection=Sr,h.numberToABC=Jr,h.numberToListABC=Zr,h.orderSearchArray=en,h.remove=Q,h.repeatStringNumTimes=Mn,h.requestImmediateMacroTask=fo,h.runOnLifecycle=Ne,h.searchArray=Rr,h.selectionToArray=Kr,h.sequence=Be,h.sequenceAsync=We,h.sequenceExecute=re,h.sequenceExecuteAsync=fr,h.serializeRange=Zt,h.serializeRangeToRefString=Co,h.serializeRangeWithSheet=ys,h.serializeRangeWithSpreadsheet=tr,h.sortRules=qr,h.sortRulesByDesc=yr,h.sortRulesFactory=_t,h.toDisposable=D,h.update=jr,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/core",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
4
|
-
"description": "Univer
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
|
+
"description": "Core library for Univer.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
7
7
|
"main": "./lib/cjs/index.js",
|
|
8
|
-
"module": "./lib/
|
|
8
|
+
"module": "./lib/es/index.js",
|
|
9
9
|
"types": "./lib/types/index.d.ts",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
-
"import": "./lib/
|
|
15
|
+
"import": "./lib/es/index.js",
|
|
16
16
|
"require": "./lib/cjs/index.js",
|
|
17
17
|
"types": "./lib/types/index.d.ts"
|
|
18
18
|
},
|
|
19
19
|
"./*": {
|
|
20
|
-
"import": "./lib/
|
|
20
|
+
"import": "./lib/es/*",
|
|
21
21
|
"require": "./lib/cjs/*",
|
|
22
22
|
"types": "./lib/types/index.d.ts"
|
|
23
23
|
}
|
|
@@ -29,31 +29,36 @@
|
|
|
29
29
|
"lib"
|
|
30
30
|
],
|
|
31
31
|
"private": false,
|
|
32
|
-
"license": "
|
|
32
|
+
"license": "Apache-2.0",
|
|
33
33
|
"homepage": "https://github.com/dream-num/univer",
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
36
36
|
"url": "https://github.com/dream-num/univer.git"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@wendellhu/redi": "^0.12.11",
|
|
40
39
|
"dayjs": "^1.11.10",
|
|
41
40
|
"nanoid": "5.0.4",
|
|
42
|
-
"numeral": "^2.0.6"
|
|
43
|
-
"rxjs": "^7.8.1"
|
|
41
|
+
"numeral": "^2.0.6"
|
|
44
42
|
},
|
|
45
43
|
"devDependencies": {
|
|
46
44
|
"@types/numeral": "^2.0.5",
|
|
47
|
-
"@vitest/coverage-istanbul": "^0.
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"typescript": "^5.3.
|
|
51
|
-
"
|
|
45
|
+
"@vitest/coverage-istanbul": "^1.0.2",
|
|
46
|
+
"@wendellhu/redi": "^0.12.12",
|
|
47
|
+
"rxjs": "^7.8.1",
|
|
48
|
+
"typescript": "^5.3.3",
|
|
49
|
+
"vite": "^5.0.7",
|
|
50
|
+
"vite-plugin-dts": "^3.6.4",
|
|
51
|
+
"vite-plugin-externals": "^0.6.2",
|
|
52
|
+
"vitest": "^1.0.2"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@wendellhu/redi": ">=0.12.12",
|
|
56
|
+
"rxjs": ">=7.0.0"
|
|
52
57
|
},
|
|
53
58
|
"scripts": {
|
|
54
59
|
"test": "vitest run",
|
|
55
60
|
"test:watch": "vitest",
|
|
56
61
|
"coverage": "vitest run --coverage",
|
|
57
|
-
"
|
|
62
|
+
"build": "tsc && vite build"
|
|
58
63
|
}
|
|
59
64
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020-present, DreamNum
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|