UNPKG

hyperformula

Version:

HyperFormula is a JavaScript engine for efficient processing of spreadsheet-like data and formulas

40 lines 548 kB
/*! * Copyright (c) HANDSONCODE sp. z o. o. * * HYPERFORMULA is a software distributed by HANDSONCODE sp. z o. o., a * Polish corporation based in Gdynia, Poland, at Aleja Zwyciestwa 96-98, * registered by the District Court in Gdansk under number 538651, * EU VAT: PL5862294002, share capital: PLN 62,800.00. * * This software is dual-licensed, giving you the option to use it under * either a proprietary license or the GNU General Public License version 3 * (GPLv3). The specific license under which you use the software is * determined by the license key you apply. Each licensing option comes with * its own terms and conditions as specified below. * * 1. PROPRIETARY LICENSE: * * Your use of this software is subject to the terms included in an * applicable proprietary license agreement between you and HANDSONCODE. * The proprietary license can be purchased from HANDSONCODE or an * authorized reseller. * * 2. GNU GENERAL PUBLIC LICENSE v3: * * This software is also available under the terms of the GNU General * Public License v3. You are permitted to run, modify, and distribute * this software under the terms of the GPLv3, as published by the Free * Software Foundation. The full text of the GPLv3 can be found at * https://www.gnu.org/licenses/. * * UNLESS EXPRESSLY AGREED OTHERWISE, HANDSONCODE PROVIDES THIS SOFTWARE ON * AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO * EVENT AND UNDER NO LEGAL THEORY, SHALL HANDSONCODE BE LIABLE TO YOU FOR * DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR * CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM USE OR INABILITY TO * USE THIS SOFTWARE. * * Version: 3.1.0 * Release date: 14/10/2025 (built at 14/10/2025 09:42:01) */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("chevrotain"),require("tiny-emitter")):"function"==typeof define&&define.amd?define("HyperFormula",["chevrotain","tiny-emitter"],t):"object"==typeof exports?exports.HyperFormula=t(require("chevrotain"),require("tiny-emitter")):e.HyperFormula=t(e.chevrotain,e.TinyEmitter)}("undefined"!=typeof self?self:this,function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(n,s,function(t){return e[t]}.bind(null,s));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(2);t.ArraySize=n.ArraySize;var s=r(106);t.CellError=s.CellError,t.CellType=s.CellType,t.CellValueDetailedType=s.CellValueDetailedType,t.CellValueType=s.CellValueType,t.ErrorType=s.ErrorType;var o=r(190);t.DetailedCellError=o.DetailedCellError;var a=r(191),i=r(195);t.AlwaysDense=i.AlwaysDense,t.AlwaysSparse=i.AlwaysSparse,t.DenseSparseChooseBasedOnThreshold=i.DenseSparseChooseBasedOnThreshold;var u=r(165);t.ConfigValueTooBigError=u.ConfigValueTooBigError,t.ConfigValueTooSmallError=u.ConfigValueTooSmallError,t.EvaluationSuspendedError=u.EvaluationSuspendedError,t.ExpectedOneOfValuesError=u.ExpectedOneOfValuesError,t.ExpectedValueOfTypeError=u.ExpectedValueOfTypeError,t.FunctionPluginValidationError=u.FunctionPluginValidationError,t.InvalidAddressError=u.InvalidAddressError,t.InvalidArgumentsError=u.InvalidArgumentsError,t.LanguageAlreadyRegisteredError=u.LanguageAlreadyRegisteredError,t.LanguageNotRegisteredError=u.LanguageNotRegisteredError,t.MissingTranslationError=u.MissingTranslationError,t.NamedExpressionDoesNotExistError=u.NamedExpressionDoesNotExistError,t.NamedExpressionNameIsAlreadyTakenError=u.NamedExpressionNameIsAlreadyTakenError,t.NamedExpressionNameIsInvalidError=u.NamedExpressionNameIsInvalidError,t.NoOperationToRedoError=u.NoOperationToRedoError,t.NoOperationToUndoError=u.NoOperationToUndoError,t.NoRelativeAddressesAllowedError=u.NoRelativeAddressesAllowedError,t.NoSheetWithIdError=u.NoSheetWithIdError,t.NoSheetWithNameError=u.NoSheetWithNameError,t.NotAFormulaError=u.NotAFormulaError,t.NothingToPasteError=u.NothingToPasteError,t.ProtectedFunctionTranslationError=u.ProtectedFunctionTranslationError,t.SheetNameAlreadyTakenError=u.SheetNameAlreadyTakenError,t.SheetSizeLimitExceededError=u.SheetSizeLimitExceededError,t.SourceLocationHasArrayError=u.SourceLocationHasArrayError,t.TargetLocationHasArrayError=u.TargetLocationHasArrayError,t.UnableToParseError=u.UnableToParseError;var l=r(218);t.ExportedCellChange=l.ExportedCellChange,t.ExportedNamedExpressionChange=l.ExportedNamedExpressionChange;var c=r(200);t.HyperFormula=c.HyperFormula;var h,d=(h=r(236))&&h.__esModule?h:{default:h},p=r(185);t.FunctionPlugin=p.FunctionPlugin,t.FunctionArgumentType=p.FunctionArgumentType,t.EmptyValue=p.EmptyValue;var m=function(e,t){if("function"==typeof WeakMap)var r=new WeakMap,n=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var s,o,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(s=t?n:r){if(s.has(e))return s.get(e);s.set(e,a)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((o=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(o.get||o.set)?s(a,t,o):a[t]=e[t]);return a}(e,t)}(r(237)),g=r(157);t.SimpleRangeValue=g.SimpleRangeValue;class E extends c.HyperFormula{}E.HyperFormula=c.HyperFormula,E.ErrorType=s.ErrorType,E.CellError=s.CellError,E.CellType=s.CellType,E.CellValueType=s.CellValueType,E.CellValueDetailedType=s.CellValueDetailedType,E.DetailedCellError=o.DetailedCellError,E.ExportedCellChange=l.ExportedCellChange,E.ExportedNamedExpressionChange=l.ExportedNamedExpressionChange,E.ConfigValueTooBigError=u.ConfigValueTooBigError,E.ConfigValueTooSmallError=u.ConfigValueTooSmallError,E.EvaluationSuspendedError=u.EvaluationSuspendedError,E.ExpectedOneOfValuesError=u.ExpectedOneOfValuesError,E.ExpectedValueOfTypeError=u.ExpectedValueOfTypeError,E.ArraySize=n.ArraySize,E.SimpleRangeValue=g.SimpleRangeValue,E.EmptyValue=p.EmptyValue,E.FunctionPlugin=p.FunctionPlugin,E.FunctionArgumentType=p.FunctionArgumentType,E.FunctionPluginValidationError=u.FunctionPluginValidationError,E.InvalidAddressError=u.InvalidAddressError,E.InvalidArgumentsError=u.InvalidArgumentsError,E.LanguageNotRegisteredError=u.LanguageNotRegisteredError,E.LanguageAlreadyRegisteredError=u.LanguageAlreadyRegisteredError,E.MissingTranslationError=u.MissingTranslationError,E.NamedExpressionDoesNotExistError=u.NamedExpressionDoesNotExistError,E.NamedExpressionNameIsAlreadyTakenError=u.NamedExpressionNameIsAlreadyTakenError,E.NamedExpressionNameIsInvalidError=u.NamedExpressionNameIsInvalidError,E.NoOperationToRedoError=u.NoOperationToRedoError,E.NoOperationToUndoError=u.NoOperationToUndoError,E.NoRelativeAddressesAllowedError=u.NoRelativeAddressesAllowedError,E.NoSheetWithIdError=u.NoSheetWithIdError,E.NoSheetWithNameError=u.NoSheetWithNameError,E.NotAFormulaError=u.NotAFormulaError,E.NothingToPasteError=u.NothingToPasteError,E.ProtectedFunctionTranslationError=u.ProtectedFunctionTranslationError,E.SheetNameAlreadyTakenError=u.SheetNameAlreadyTakenError,E.SheetSizeLimitExceededError=u.SheetSizeLimitExceededError,E.SourceLocationHasArrayError=u.SourceLocationHasArrayError,E.TargetLocationHasArrayError=u.TargetLocationHasArrayError,E.UnableToParseError=u.UnableToParseError;const T=a.Config.defaultConfig.language;c.HyperFormula.registerLanguage(T,d.default),c.HyperFormula.languages[d.default.langCode]=d.default;for(const e of Object.getOwnPropertyNames(m))e.startsWith("_")||c.HyperFormula.registerFunctionPlugin(m[e]);t.default=E},function(e,t,r){"use strict";t.__esModule=!0,t.ArraySizePredictor=t.ArraySize=void 0,r(3),r(73),r(84),r(94);var n=r(105),s=r(184),o=r(185),a=r(136);class i{constructor(e,t,r=!1){this.width=e,this.height=t,this.isRef=r}static error(){return new i(1,1,!0)}static scalar(){return new i(1,1,!1)}isScalar(){return 1===this.width&&1===this.height||this.isRef}}t.ArraySize=i;t.ArraySizePredictor=class{constructor(e,t){this.config=e,this.functionRegistry=t}checkArraySize(e,t){return this.checkArraySizeForAst(e,{formulaAddress:t,arraysFlag:this.config.useArrayArithmetic})}checkArraySizeForAst(e,t){switch(e.type){case a.AstNodeType.FUNCTION_CALL:return this.checkArraySizeForFunction(e,t);case a.AstNodeType.COLUMN_RANGE:case a.AstNodeType.ROW_RANGE:case a.AstNodeType.CELL_RANGE:{const r=n.AbsoluteCellRange.fromAstOrUndef(e,t.formulaAddress);return void 0===r?i.error():new i(r.width(),r.height(),!0)}case a.AstNodeType.ARRAY:{const r=[],n=[];for(const s of e.args){const e=s.map(e=>this.checkArraySizeForAst(e,t)),o=Math.min(...e.map(e=>e.height)),a=e.reduce((e,t)=>e+t.width,0);r.push(o),n.push(a)}const s=r.reduce((e,t)=>e+t,0),o=Math.min(...n);return new i(o,s)}case a.AstNodeType.STRING:case a.AstNodeType.NUMBER:return i.scalar();case a.AstNodeType.CELL_REFERENCE:return new i(1,1,!0);case a.AstNodeType.DIV_OP:case a.AstNodeType.CONCATENATE_OP:case a.AstNodeType.EQUALS_OP:case a.AstNodeType.GREATER_THAN_OP:case a.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case a.AstNodeType.LESS_THAN_OP:case a.AstNodeType.LESS_THAN_OR_EQUAL_OP:case a.AstNodeType.MINUS_OP:case a.AstNodeType.NOT_EQUAL_OP:case a.AstNodeType.PLUS_OP:case a.AstNodeType.POWER_OP:case a.AstNodeType.TIMES_OP:{const r=this.checkArraySizeForAst(e.left,t),n=this.checkArraySizeForAst(e.right,t);return!t.arraysFlag&&(r.height>1||r.width>1||n.height>1||n.width>1)?i.error():(s=r,o=n,new i(Math.max(s.width,o.width),Math.max(s.height,o.height)))}case a.AstNodeType.MINUS_UNARY_OP:case a.AstNodeType.PLUS_UNARY_OP:case a.AstNodeType.PERCENT_OP:{const n=this.checkArraySizeForAst(e.value,t);return!t.arraysFlag&&(n.height>1||n.width>1)?i.error():new i((r=n).width,r.height)}case a.AstNodeType.PARENTHESIS:return this.checkArraySizeForAst(e.expression,t);case a.AstNodeType.EMPTY:default:return i.error()}var r,s,o}checkArraySizeForFunction(e,t){const r=this.functionRegistry.getArraySizeFunction(e.procedureName);if(void 0!==r)return r(e,t);const n=this.functionRegistry.getMetadata(e.procedureName);if(void 0===n||n.expandRanges||!t.arraysFlag||n.vectorizationForbidden||void 0===n.parameters)return new i(1,1);const a=e.args.map(e=>{var r;return this.checkArraySizeForAst(e,new s.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.enableArrayArithmeticForArguments)&&void 0!==r&&r))}),u=[...n.parameters];if(void 0!==n.repeatLastArgs&&u.length<a.length&&(a.length-u.length)%n.repeatLastArgs!==0)return i.error();for(;u.length<a.length;){if(void 0===n.repeatLastArgs)return i.error();u.push(...u.slice(u.length-n.repeatLastArgs))}let l=1,c=1;for(let e=0;e<a.length;e++)u[e].argumentType!==o.FunctionArgumentType.RANGE&&u[e].argumentType!==o.FunctionArgumentType.ANY&&(c=Math.max(c,a[e].height),l=Math.max(l,a[e].width));return new i(l,c)}}},function(e,t,r){"use strict";var n=r(4),s=r(41),o=r(65),a=r(70),i=r(72);n({target:"Array",proto:!0,arity:1,forced:r(9)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=s(this),r=o(t),n=arguments.length;i(r+n);for(var u=0;u<n;u++)t[r]=arguments[u],r++;return a(t,r),r}})},function(e,t,r){"use strict";var n=r(5),s=r(7).f,o=r(45),a=r(49),i=r(39),u=r(57),l=r(69);e.exports=function(e,t){var r,c,h,d,p,m=e.target,g=e.global,E=e.stat;if(r=g?n:E?n[m]||i(m,{}):n[m]&&n[m].prototype)for(c in t){if(d=t[c],h=e.dontCallGetSet?(p=s(r,c))&&p.value:r[c],!l(g?c:m+(E?".":"#")+c,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;u(d,h)}(e.sham||h&&h.sham)&&o(d,"sham",!0),a(r,c,d,e)}}},function(e,t,r){"use strict";(function(t){var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()}).call(this,r(6))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n=r(8),s=r(10),o=r(12),a=r(13),i=r(14),u=r(20),l=r(40),c=r(43),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=i(e),t=u(t),c)try{return h(e,t)}catch(e){}if(l(e,t))return a(!s(o.f,e,t),e[t])}},function(e,t,r){"use strict";var n=r(9);e.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(e,t,r){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){"use strict";var n=r(11),s=Function.prototype.call;e.exports=n?s.bind(s):function(){return s.apply(s,arguments)}},function(e,t,r){"use strict";var n=r(9);e.exports=!n(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},function(e,t,r){"use strict";var n={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,o=s&&!n.call({1:2},1);t.f=o?function(e){var t=s(this,e);return!!t&&t.enumerable}:n},function(e,t,r){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){"use strict";var n=r(15),s=r(18);e.exports=function(e){return n(s(e))}},function(e,t,r){"use strict";var n=r(16),s=r(9),o=r(17),a=Object,i=n("".split);e.exports=s(function(){return!a("z").propertyIsEnumerable(0)})?function(e){return"String"===o(e)?i(e,""):a(e)}:a},function(e,t,r){"use strict";var n=r(11),s=Function.prototype,o=s.call,a=n&&s.bind.bind(o,o);e.exports=n?a:function(e){return function(){return o.apply(e,arguments)}}},function(e,t,r){"use strict";var n=r(16),s=n({}.toString),o=n("".slice);e.exports=function(e){return o(s(e),8,-1)}},function(e,t,r){"use strict";var n=r(19),s=TypeError;e.exports=function(e){if(n(e))throw new s("Can't call method on "+e);return e}},function(e,t,r){"use strict";e.exports=function(e){return null==e}},function(e,t,r){"use strict";var n=r(21),s=r(24);e.exports=function(e){var t=n(e,"string");return s(t)?t:t+""}},function(e,t,r){"use strict";var n=r(10),s=r(22),o=r(24),a=r(31),i=r(34),u=r(35),l=TypeError,c=u("toPrimitive");e.exports=function(e,t){if(!s(e)||o(e))return e;var r,u=a(e,c);if(u){if(void 0===t&&(t="default"),r=n(u,e,t),!s(r)||o(r))return r;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),i(e,t)}},function(e,t,r){"use strict";var n=r(23);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},function(e,t,r){"use strict";var n="object"==typeof document&&document.all;e.exports=void 0===n&&void 0!==n?function(e){return"function"==typeof e||e===n}:function(e){return"function"==typeof e}},function(e,t,r){"use strict";var n=r(25),s=r(23),o=r(26),a=r(27),i=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return s(t)&&o(t.prototype,i(e))}},function(e,t,r){"use strict";var n=r(5),s=r(23);e.exports=function(e,t){return arguments.length<2?(r=n[e],s(r)?r:void 0):n[e]&&n[e][t];var r}},function(e,t,r){"use strict";var n=r(16);e.exports=n({}.isPrototypeOf)},function(e,t,r){"use strict";var n=r(28);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,r){"use strict";var n=r(29),s=r(9),o=r(5).String;e.exports=!!Object.getOwnPropertySymbols&&!s(function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},function(e,t,r){"use strict";var n,s,o=r(5),a=r(30),i=o.process,u=o.Deno,l=i&&i.versions||u&&u.version,c=l&&l.v8;c&&(s=(n=c.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!s&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(s=+n[1]),e.exports=s},function(e,t,r){"use strict";var n=r(5).navigator,s=n&&n.userAgent;e.exports=s?String(s):""},function(e,t,r){"use strict";var n=r(32),s=r(19);e.exports=function(e,t){var r=e[t];return s(r)?void 0:n(r)}},function(e,t,r){"use strict";var n=r(23),s=r(33),o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(s(e)+" is not a function")}},function(e,t,r){"use strict";var n=String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},function(e,t,r){"use strict";var n=r(10),s=r(23),o=r(22),a=TypeError;e.exports=function(e,t){var r,i;if("string"===t&&s(r=e.toString)&&!o(i=n(r,e)))return i;if(s(r=e.valueOf)&&!o(i=n(r,e)))return i;if("string"!==t&&s(r=e.toString)&&!o(i=n(r,e)))return i;throw new a("Can't convert object to primitive value")}},function(e,t,r){"use strict";var n=r(5),s=r(36),o=r(40),a=r(42),i=r(28),u=r(27),l=n.Symbol,c=s("wks"),h=u?l.for||l:l&&l.withoutSetter||a;e.exports=function(e){return o(c,e)||(c[e]=i&&o(l,e)?l[e]:h("Symbol."+e)),c[e]}},function(e,t,r){"use strict";var n=r(37);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},function(e,t,r){"use strict";var n=r(38),s=r(5),o=r(39),a="__core-js_shared__",i=e.exports=s[a]||o(a,{});(i.versions||(i.versions=[])).push({version:"3.45.1",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE",source:"https://github.com/zloirock/core-js"})},function(e,t,r){"use strict";e.exports=!1},function(e,t,r){"use strict";var n=r(5),s=Object.defineProperty;e.exports=function(e,t){try{s(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},function(e,t,r){"use strict";var n=r(16),s=r(41),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(s(e),t)}},function(e,t,r){"use strict";var n=r(18),s=Object;e.exports=function(e){return s(n(e))}},function(e,t,r){"use strict";var n=r(16),s=0,o=Math.random(),a=n(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++s+o,36)}},function(e,t,r){"use strict";var n=r(8),s=r(9),o=r(44);e.exports=!n&&!s(function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){"use strict";var n=r(5),s=r(22),o=n.document,a=s(o)&&s(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},function(e,t,r){"use strict";var n=r(8),s=r(46),o=r(13);e.exports=n?function(e,t,r){return s.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){"use strict";var n=r(8),s=r(43),o=r(47),a=r(48),i=r(20),u=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",p="writable";t.f=n?o?function(e,t,r){if(a(e),t=i(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&p in r&&!r[p]){var n=c(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:d in r?r[d]:n[d],enumerable:h in r?r[h]:n[h],writable:!1})}return l(e,t,r)}:l:function(e,t,r){if(a(e),t=i(t),a(r),s)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new u("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){"use strict";var n=r(8),s=r(9);e.exports=n&&s(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},function(e,t,r){"use strict";var n=r(22),s=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(s(e)+" is not an object")}},function(e,t,r){"use strict";var n=r(23),s=r(46),o=r(50),a=r(39);e.exports=function(e,t,r,i){i||(i={});var u=i.enumerable,l=void 0!==i.name?i.name:t;if(n(r)&&o(r,l,i),i.global)u?e[t]=r:a(t,r);else{try{i.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=r:s.f(e,t,{value:r,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e}},function(e,t,r){"use strict";var n=r(16),s=r(9),o=r(23),a=r(40),i=r(8),u=r(51).CONFIGURABLE,l=r(52),c=r(53),h=c.enforce,d=c.get,p=String,m=Object.defineProperty,g=n("".slice),E=n("".replace),T=n([].join),f=i&&!s(function(){return 8!==m(function(){},"length",{value:8}).length}),y=String(String).split("String"),A=e.exports=function(e,t,r){"Symbol("===g(p(t),0,7)&&(t="["+E(p(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||u&&e.name!==t)&&(i?m(e,"name",{value:t,configurable:!0}):e.name=t),f&&r&&a(r,"arity")&&e.length!==r.arity&&m(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?i&&m(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);return a(n,"source")||(n.source=T(y,"string"==typeof t?t:"")),e};Function.prototype.toString=A(function(){return o(this)&&d(this).source||l(this)},"toString")},function(e,t,r){"use strict";var n=r(8),s=r(40),o=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,i=s(o,"name"),u=i&&"something"===function(){}.name,l=i&&(!n||n&&a(o,"name").configurable);e.exports={EXISTS:i,PROPER:u,CONFIGURABLE:l}},function(e,t,r){"use strict";var n=r(16),s=r(23),o=r(37),a=n(Function.toString);s(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},function(e,t,r){"use strict";var n,s,o,a=r(54),i=r(5),u=r(22),l=r(45),c=r(40),h=r(37),d=r(55),p=r(56),m="Object already initialized",g=i.TypeError,E=i.WeakMap;if(a||h.state){var T=h.state||(h.state=new E);T.get=T.get,T.has=T.has,T.set=T.set,n=function(e,t){if(T.has(e))throw new g(m);return t.facade=e,T.set(e,t),t},s=function(e){return T.get(e)||{}},o=function(e){return T.has(e)}}else{var f=d("state");p[f]=!0,n=function(e,t){if(c(e,f))throw new g(m);return t.facade=e,l(e,f,t),t},s=function(e){return c(e,f)?e[f]:{}},o=function(e){return c(e,f)}}e.exports={set:n,get:s,has:o,enforce:function(e){return o(e)?s(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=s(t)).type!==e)throw new g("Incompatible receiver, "+e+" required");return r}}}},function(e,t,r){"use strict";var n=r(5),s=r(23),o=n.WeakMap;e.exports=s(o)&&/native code/.test(String(o))},function(e,t,r){"use strict";var n=r(36),s=r(42),o=n("keys");e.exports=function(e){return o[e]||(o[e]=s(e))}},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";var n=r(40),s=r(58),o=r(7),a=r(46);e.exports=function(e,t,r){for(var i=s(t),u=a.f,l=o.f,c=0;c<i.length;c++){var h=i[c];n(e,h)||r&&n(r,h)||u(e,h,l(t,h))}}},function(e,t,r){"use strict";var n=r(25),s=r(16),o=r(59),a=r(68),i=r(48),u=s([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(i(e)),r=a.f;return r?u(t,r(e)):t}},function(e,t,r){"use strict";var n=r(60),s=r(67).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},function(e,t,r){"use strict";var n=r(16),s=r(40),o=r(14),a=r(61).indexOf,i=r(56),u=n([].push);e.exports=function(e,t){var r,n=o(e),l=0,c=[];for(r in n)!s(i,r)&&s(n,r)&&u(c,r);for(;t.length>l;)s(n,r=t[l++])&&(~a(c,r)||u(c,r));return c}},function(e,t,r){"use strict";var n=r(14),s=r(62),o=r(65),a=function(e){return function(t,r,a){var i=n(t),u=o(i);if(0===u)return!e&&-1;var l,c=s(a,u);if(e&&r!=r){for(;u>c;)if((l=i[c++])!=l)return!0}else for(;u>c;c++)if((e||c in i)&&i[c]===r)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},function(e,t,r){"use strict";var n=r(63),s=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?s(r+t,0):o(r,t)}},function(e,t,r){"use strict";var n=r(64);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},function(e,t,r){"use strict";var n=Math.ceil,s=Math.floor;e.exports=Math.trunc||function(e){var t=+e;return(t>0?s:n)(t)}},function(e,t,r){"use strict";var n=r(66);e.exports=function(e){return n(e.length)}},function(e,t,r){"use strict";var n=r(63),s=Math.min;e.exports=function(e){var t=n(e);return t>0?s(t,9007199254740991):0}},function(e,t,r){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,r){"use strict";t.f=Object.getOwnPropertySymbols},function(e,t,r){"use strict";var n=r(9),s=r(23),o=/#|\.prototype\./,a=function(e,t){var r=u[i(e)];return r===c||r!==l&&(s(t)?n(t):!!t)},i=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},u=a.data={},l=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},function(e,t,r){"use strict";var n=r(8),s=r(71),o=TypeError,a=Object.getOwnPropertyDescriptor,i=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=i?function(e,t){if(s(e)&&!a(e,"length").writable)throw new o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},function(e,t,r){"use strict";var n=r(17);e.exports=Array.isArray||function(e){return"Array"===n(e)}},function(e,t,r){"use strict";var n=TypeError;e.exports=function(e){if(e>9007199254740991)throw n("Maximum allowed index exceeded");return e}},function(e,t,r){"use strict";var n=r(4),s=r(5),o=r(74),a=r(48),i=r(23),u=r(75),l=r(77),c=r(78),h=r(9),d=r(40),p=r(35),m=r(79).IteratorPrototype,g=r(8),E=r(38),T="constructor",f="Iterator",y=p("toStringTag"),A=TypeError,R=s[f],N=E||!i(R)||R.prototype!==m||!h(function(){R({})}),S=function(){if(o(this,m),u(this)===m)throw new A("Abstract class Iterator not directly constructable")},C=function(e,t){g?l(m,e,{configurable:!0,get:function(){return t},set:function(t){if(a(this),this===m)throw new A("You can't redefine this property");d(this,e)?this[e]=t:c(this,e,t)}}):m[e]=t};d(m,y)||C(y,f),!N&&d(m,T)&&m[T]!==Object||C(T,S),S.prototype=m,n({global:!0,constructor:!0,forced:N},{Iterator:S})},function(e,t,r){"use strict";var n=r(26),s=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new s("Incorrect invocation")}},function(e,t,r){"use strict";var n=r(40),s=r(23),o=r(41),a=r(55),i=r(76),u=a("IE_PROTO"),l=Object,c=l.prototype;e.exports=i?l.getPrototypeOf:function(e){var t=o(e);if(n(t,u))return t[u];var r=t.constructor;return s(r)&&t instanceof r?r.prototype:t instanceof l?c:null}},function(e,t,r){"use strict";var n=r(9);e.exports=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},function(e,t,r){"use strict";var n=r(50),s=r(46);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),s.f(e,t,r)}},function(e,t,r){"use strict";var n=r(8),s=r(46),o=r(13);e.exports=function(e,t,r){n?s.f(e,t,o(0,r)):e[t]=r}},function(e,t,r){"use strict";var n,s,o,a=r(9),i=r(23),u=r(22),l=r(80),c=r(75),h=r(49),d=r(35),p=r(38),m=d("iterator"),g=!1;[].keys&&("next"in(o=[].keys())?(s=c(c(o)))!==Object.prototype&&(n=s):g=!0),!u(n)||a(function(){var e={};return n[m].call(e)!==e})?n={}:p&&(n=l(n)),i(n[m])||h(n,m,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},function(e,t,r){"use strict";var n,s=r(48),o=r(81),a=r(67),i=r(56),u=r(83),l=r(44),c=r(55),h="prototype",d="script",p=c("IE_PROTO"),m=function(){},g=function(e){return"<"+d+">"+e+"</"+d+">"},E=function(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t},T=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;T="undefined"!=typeof document?document.domain&&n?E(n):(t=l("iframe"),r="java"+d+":",t.style.display="none",u.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F):E(n);for(var s=a.length;s--;)delete T[h][a[s]];return T()};i[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(m[h]=s(e),r=new m,m[h]=null,r[p]=e):r=T(),void 0===t?r:o.f(r,t)}},function(e,t,r){"use strict";var n=r(8),s=r(47),o=r(46),a=r(48),i=r(14),u=r(82);t.f=n&&!s?Object.defineProperties:function(e,t){a(e);for(var r,n=i(t),s=u(t),l=s.length,c=0;l>c;)o.f(e,r=s[c++],n[r]);return e}},function(e,t,r){"use strict";var n=r(60),s=r(67);e.exports=Object.keys||function(e){return n(e,s)}},function(e,t,r){"use strict";var n=r(25);e.exports=n("document","documentElement")},function(e,t,r){"use strict";var n=r(4),s=r(10),o=r(32),a=r(48),i=r(85),u=r(86),l=r(91),c=r(89),h=r(92),d=r(93),p=r(38),m=!p&&!h("map",function(){}),g=!p&&!m&&d("map",TypeError),E=p||m||g,T=u(function(){var e=this.iterator,t=a(s(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)});n({target:"Iterator",proto:!0,real:!0,forced:E},{map:function(e){a(this);try{o(e)}catch(e){c(this,"throw",e)}return g?s(g,this,e):new T(i(this),{mapper:e})}})},function(e,t,r){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},function(e,t,r){"use strict";var n=r(10),s=r(80),o=r(45),a=r(87),i=r(35),u=r(53),l=r(31),c=r(79).IteratorPrototype,h=r(88),d=r(89),p=r(90),m=i("toStringTag"),g="IteratorHelper",E="WrapForValidIterator",T="normal",f="throw",y=u.set,A=function(e){var t=u.getterFor(e?E:g);return a(s(c),{next:function(){var r=t(this);if(e)return r.nextHandler();if(r.done)return h(void 0,!0);try{var n=r.nextHandler();return r.returnHandlerResult?n:h(n,r.done)}catch(e){throw r.done=!0,e}},return:function(){var r=t(this),s=r.iterator;if(r.done=!0,e){var o=l(s,"return");return o?n(o,s):h(void 0,!0)}if(r.inner)try{d(r.inner.iterator,T)}catch(e){return d(s,f,e)}if(r.openIters)try{p(r.openIters,T)}catch(e){return d(s,f,e)}return s&&d(s,T),h(void 0,!0)}})},R=A(!0),N=A(!1);o(N,m,"Iterator Helper"),e.exports=function(e,t,r){var n=function(n,s){s?(s.iterator=n.iterator,s.next=n.next):s=n,s.type=t?E:g,s.returnHandlerResult=!!r,s.nextHandler=e,s.counter=0,s.done=!1,y(this,s)};return n.prototype=t?R:N,n}},function(e,t,r){"use strict";var n=r(49);e.exports=function(e,t,r){for(var s in t)n(e,s,t[s],r);return e}},function(e,t,r){"use strict";e.exports=function(e,t){return{value:e,done:t}}},function(e,t,r){"use strict";var n=r(10),s=r(48),o=r(31);e.exports=function(e,t,r){var a,i;s(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){i=!0,a=e}if("throw"===t)throw r;if(i)throw a;return s(a),r}},function(e,t,r){"use strict";var n=r(89);e.exports=function(e,t,r){for(var s=e.length-1;s>=0;s--)if(void 0!==e[s])try{r=n(e[s].iterator,t,r)}catch(e){t="throw",r=e}if("throw"===t)throw r;return r}},function(e,t,r){"use strict";var n=r(48),s=r(89);e.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(t){s(e,"throw",t)}}},function(e,t,r){"use strict";e.exports=function(e,t){var r="function"==typeof Iterator&&Iterator.prototype[e];if(r)try{r.call({next:null},t).next()}catch(e){return!0}}},function(e,t,r){"use strict";var n=r(5);e.exports=function(e,t){var r=n.Iterator,s=r&&r.prototype,o=s&&s[e],a=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){a=!0}},-1)}catch(e){e instanceof t||(a=!1)}if(!a)return o}},function(e,t,r){"use strict";var n=r(4),s=r(95),o=r(32),a=r(48),i=r(85),u=r(89),l=r(93),c=r(104),h=r(9),d=TypeError,p=h(function(){[].keys().reduce(function(){},void 0)}),m=!p&&l("reduce",d);n({target:"Iterator",proto:!0,real:!0,forced:p||m},{reduce:function(e){a(this);try{o(e)}catch(e){u(this,"throw",e)}var t=arguments.length<2,r=t?void 0:arguments[1];if(m)return c(m,this,t?[e]:[e,r]);var n=i(this),l=0;if(s(n,function(n){t?(t=!1,r=n):r=e(r,n,l),l++},{IS_RECORD:!0}),t)throw new d("Reduce of empty iterator with no initial value");return r}})},function(e,t,r){"use strict";var n=r(96),s=r(10),o=r(48),a=r(33),i=r(98),u=r(65),l=r(26),c=r(100),h=r(101),d=r(89),p=TypeError,m=function(e,t){this.stopped=e,this.result=t},g=m.prototype;e.exports=function(e,t,r){var E,T,f,y,A,R,N,S=r&&r.that,C=!(!r||!r.AS_ENTRIES),v=!(!r||!r.IS_RECORD),M=!(!r||!r.IS_ITERATOR),w=!(!r||!r.INTERRUPTED),F=n(t,S),O=function(e){return E&&d(E,"normal"),new m(!0,e)},I=function(e){return C?(o(e),w?F(e[0],e[1],O):F(e[0],e[1])):w?F(e,O):F(e)};if(v)E=e.iterator;else if(M)E=e;else{if(!(T=h(e)))throw new p(a(e)+" is not iterable");if(i(T)){for(f=0,y=u(e);y>f;f++)if((A=I(e[f]))&&l(g,A))return A;return new m(!1)}E=c(e,T)}for(R=v?e.next:E.next;!(N=s(R,E)).done;){try{A=I(N.value)}catch(e){d(E,"throw",e)}if("object"==typeof A&&A&&l(g,A))return A}return new m(!1)}},function(e,t,r){"use strict";var n=r(97),s=r(32),o=r(11),a=n(n.bind);e.exports=function(e,t){return s(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},function(e,t,r){"use strict";var n=r(17),s=r(16);e.exports=function(e){if("Function"===n(e))return s(e)}},function(e,t,r){"use strict";var n=r(35),s=r(99),o=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(s.Array===e||a[o]===e)}},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";var n=r(10),s=r(32),o=r(48),a=r(33),i=r(101),u=TypeError;e.exports=function(e,t){var r=arguments.length<2?i(e):t;if(s(r))return o(n(r,e));throw new u(a(e)+" is not iterable")}},function(e,t,r){"use strict";var n=r(102),s=r(31),o=r(19),a=r(99),i=r(35)("iterator");e.exports=function(e){if(!o(e))return s(e,i)||s(e,"@@iterator")||a[n(e)]}},function(e,t,r){"use strict";var n=r(103),s=r(23),o=r(17),a=r(35)("toStringTag"),i=Object,u="Arguments"===o(function(){return arguments}());e.exports=n?o:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=i(e),a))?r:u?o(t):"Object"===(n=o(t))&&s(t.callee)?"Arguments":n}},function(e,t,r){"use strict";var n={};n[r(35)("toStringTag")]="z",e.exports="[object z]"===String(n)},function(e,t,r){"use strict";var n=r(11),s=Function.prototype,o=s.apply,a=s.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(o):function(){return a.apply(o,arguments)})},function(e,t,r){"use strict";t.__esModule=!0,t.WRONG_RANGE_SIZE=t.AbsoluteRowRange=t.AbsoluteColumnRange=t.AbsoluteCellRange=void 0,t.isSimpleCellRange=function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)return!1;{const t=e;return"start"in t&&(0,n.isSimpleCellAddress)(t.start)&&"end"in t&&(0,n.isSimpleCellAddress)(t.end)}},t.simpleCellRange=void 0,r(3);var n=r(106),s=r(165),o=r(136),a=r(159);const i=t.WRONG_RANGE_SIZE="AbsoluteCellRange: Wrong range size";t.simpleCellRange=(e,t)=>({start:e,end:t});class u{constructor(e,t){if(e.sheet!==t.sheet)throw new s.SheetsNotEqual(e.sheet,t.sheet);this.start=(0,n.simpleCellAddress)(e.sheet,e.col,e.row),this.end=(0,n.simpleCellAddress)(t.sheet,t.col,t.row)}get sheet(){return this.start.sheet}static fromSimpleCellAddresses(e,t){if(e.sheet!==t.sheet)throw new s.SheetsNotEqual(e.sheet,t.sheet);const r=t.col-e.col,n=t.row-e.row;return Number.isFinite(n)&&Number.isFinite(r)?new u(e,t):Number.isFinite(n)?new c(e.sheet,e.row,t.row):new l(e.sheet,e.col,t.col)}static fromAst(e,t){return e.type===o.AstNodeType.CELL_RANGE?u.fromCellRange(e,t):e.type===o.AstNodeType.COLUMN_RANGE?l.fromColumnRange(e,t):c.fromRowRangeAst(e,t)}static fromAstOrUndef(e,t){try{return u.fromAst(e,t)}catch(e){return}}static fromCellRange(e,t){return new u(e.start.toSimpleCellAddress(t),e.end.toSimpleCellAddress(t))}static spanFrom(e,t,r){const n=u.spanFromOrUndef(e,t,r);if(void 0===n)throw new Error(i);return n}static spanFromOrUndef(e,t,r){if(!Number.isFinite(t)&&Number.isFinite(r)){if(0!==e.col)return;return new c(e.sheet,e.row,e.row+r-1)}if(!Number.isFinite(r)&&Number.isFinite(t)){if(0!==e.row)return;return new l(e.sheet,e.col,e.col+t-1)}if(Number.isFinite(r)&&Number.isFinite(t))return new u(e,(0,n.simpleCellAddress)(e.sheet,e.col+t-1,e.row+r-1))}static fromCoordinates(e,t,r,s,o){return new u((0,n.simpleCellAddress)(e,t,r),(0,n.simpleCellAddress)(e,s,o))}isFinite(){return Number.isFinite(this.size())}doesOverlap(e){return this.start.sheet==e.start.sheet&&(!(this.end.row<e.start.row||this.start.row>e.end.row)&&!(this.end.col<e.start.col||this.start.col>e.end.col))}addressInRange(e){return this.sheet===e.sheet&&(this.start.row<=e.row&&this.end.row>=e.row&&this.start.col<=e.col&&this.end.col>=e.col)}columnInRange(e){return this.sheet===e.sheet&&(this.start.col<=e.col&&this.end.col>=e.col)}rowInRange(e){return this.sheet===e.sheet&&(this.start.row<=e.row&&this.end.row>=e.row)}containsRange(e){return this.addressInRange(e.start)&&this.addressInRange(e.end)}intersectionWith(e){if(this.sheet!==e.start.sheet)return;const t=Math.max(this.start.row,e.start.row),r=Math.min(this.end.row,e.end.row),s=Math.max(this.start.col,e.start.col),o=Math.min(this.end.col,e.end.col);return t>r||s>o?void 0:new u((0,n.simpleCellAddress)(this.sheet,s,t),(0,n.simpleCellAddress)(this.sheet,o,r))}includesRow(e){return this.start.row<e&&this.end.row>=e}includesColumn(e){return this.start.col<e&&this.end.col>=e}shiftByRows(e){this.start.row+=e,this.end.row+=e}expandByRows(e){this.end.row+=e}shiftByColumns(e){this.start.col+=e,this.end.col+=e}shifted(e,t){return u.spanFrom((0,n.simpleCellAddress)(this.sheet,this.start.col+e,this.start.row+t),this.width(),this.height())}expandByColumns(e){this.end.col+=e}moveToSheet(e){this.start.sheet=e,this.end.sheet=e}removeSpan(e){e instanceof a.RowsSpan?this.removeRows(e.start,e.end):this.removeColumns(e.start,e.end)}shouldBeRemoved(){return this.width()<=0||this.height()<=0}rangeWithSameWidth(e,t){return u.spanFrom((0,n.simpleCellAddress)(this.sheet,this.start.col,e),this.width(),t)}rangeWithSameHeight(e,t){return u.spanFrom((0,n.simpleCellAddress)(this.sheet,e,this.start.row),t,this.height())}toString(){return`${this.start.sheet},${this.start.col},${this.start.row},${this.end.col},${this.end.row}`}width(){return this.end.col-this.start.col+1}height(){return this.end.row-this.start.row+1}size(){return this.height()*this.width()}arrayOfAddressesInRange(){const e=[];for(let t=0;t<this.height();++t){e[t]=[];for(let r=0;r<this.width();++r){const s=(0,n.simpleCellAddress)(this.sheet,this.start.col+r,this.start.row+t);e[t].push(s)}}return e}withStart(e){return new u(e,this.end)}sameDimensionsAs(e){return this.width()===e.width()&&this.height()===e.height()}sameAs(e){return(0,n.equalSimpleCellAddress)(this.start,e.start)&&(0,n.equalSimpleCellAddress)(this.end,e.end)}addressesArrayMap(e,t){const r=[];let s=this.start.row;for(;s<=this.effectiveEndRow(e);){let o=this.start.col;const a=[];for(;o<=this.effectiveEndColumn(e);)a.push(t((0,n.simpleCellAddress)(this.start.sheet,o,s))),o++;r.push(a),s++}return r}addresses(e){const t=[];let r=this.start.row;const s=this.effectiveEndRow(e),o=this.effectiveEndColumn(e);for(;r<=s;){let e=this.start.col;for(;e<=o;)t.push((0,n.simpleCellAddress)(this.start.sheet,e,r)),e++;r++}return t}*addressesWithDirection(e,t,r){if(e>0)if(t>0){let e=this.effectiveEndRow(r);for(;e>=this.start.row;){let t=this.effectiveEndColumn(r);for(;t>=this.start.col;)yield(0,n.simpleCellAddress)(this.start.sheet,t,e),t-=1;e-=1}}else{let e=this.start.row;for(;e<=this.effectiveEndRow(r);){let t=this.effectiveEndColumn(r);for(;t>=this.start.col;)yield(0,n.simpleCellAddress)(this.start.sheet,t,e),t-=1;e+=1}}else if(t>0){let e=this.effectiveEndRow(r);for(;e>=this.start.row;){let t=this.start.col;for(;t<=this.effectiveEndColumn(r);)yield(0,n.simpleCellAddress)(this.start.sheet,t,e),t+=1;e-=1}}else{let e=this.start.row;for(;e<=this.effectiveEndRow(r);){let t=this.start.col;for(;t<=this.effectiveEndColumn(r);)yield(0,n.simpleCellAddress)(this.start.sheet,t,e),t+=1;e+=1}}}getAddress(e,t){if(e<0||t<0||t>this.height()-1||e>this.width()-1)throw Error("Index out of bound");return(0,n.simpleCellAddress)(this.start.sheet,this.start.col+e,this.start.row+t)}exceedsSheetSizeLimits(e,t){return this.end.col>=e||this.end.row>=t}effectiveEndColumn(e){return this.end.col}effectiveEndRow(e){return this.end.row}effectiveWidth(e){return this.width()}effectiveHeight(e){return this.height()}removeRows(e,t){if(!(e>this.end.row)){if(t<this.start.row){const r=t-e+1;return this.shiftByRows(-r)}e<=this.start.row&&(this.start.row=e),this.end.row-=Math.min(t,this.end.row)-e+1}}removeColumns(e,t){if(!(e>this.end.col)){if(t<this.start.col){const r=t-e+1;return this.shiftByColumns(-r)}e<=this.start.col&&(this.start.col=e),this.end.col-=Math.min(t,this.end.col)-e+1}}}t.AbsoluteCellRange=u;class l extends u{constructor(e,t,r){super((0,n.simpleCellAddress)(e,t,0),(0,n.simpleCellAddress)(e,r,Number.POSITIVE_INFINITY))}static fromColumnRange(e,t){const r=e.start.toSimpleColumnAddress(t),n=e.end.toSimpleColumnAddress(t);if(r.sheet!==n.sheet)throw new s.SheetsNotEqual(r.sheet,n.sheet);return new l(r.sheet,r.col,n.col)}shouldBeRemoved(){return this.width()<=0}shiftByRows(e){}expandByRows(e){}shifted(e,t){return new l(this.sheet,this.start.col+e,this.end.col+e)}rangeWithSameHeight(e,t){return new l(this.sheet,e,e+t-1)}exceedsSheetSizeLimits(e,t){return this.end.col>=e}effectiveEndRow(e){return this.effectiveHeight(e)-1}effectiveHeight(e){return e.getSheetHeight(this.sheet)}removeRows(e,t){}}t.AbsoluteColumnRange=l;class c extends u{constructor(e,t,r){super((0,n.simpleCellAddress)(e,0,t),(0,n.simpleCellAddress)(e,Number.POSITIVE_INFINITY,r))}static fromRowRangeAst(e,t){const r=e.start.toSimpleRowAddress(t),n=e.end.toSimpleRowAddress(t);if(r.sheet!==n.sheet)throw new s.SheetsNotEqual(r.sheet,n.sheet);return new c(r.sheet,r.row,n.row)}shouldBeRemoved(){return this.height()<=0}shiftByColumns(e){}expandByColumns(e){}shifted(e,t){return new c(this.sheet,this.start.row+t,this.end.row+t)}rangeWithSameWidth(e,t){return new c(this.sheet,e,e+t-1)}exceedsSheetSizeLimits(e,t){return this.end.row>=t}effectiveEndColumn(e){return this.effectiveWidth(e)-1}effectiveWidth(e){return e.getSheetWidth(this.sheet)}removeColumns(e,t){}}t.AbsoluteRowRange=c},function(e,t,r){"use strict";t.__esModule=!0,t.invalidSimpleRowAddress=t.invalidSimpleColumnAddress=t.invalidSimpleCellAddress=t.getCellValueType=t.getCellValueFormat=t.getCellValueDetailedType=t.getCellType=t.equalSimpleCellAddress=t.addressKey=t.absoluteSheetReference=t.ErrorType=t.CellValueTypeOrd=t.CellValueType=t.CellValueNoNumber=t.CellValueJustNumber=t.CellValueDetailedType=t.CellType=t.CellError=void 0,t.isSimpleCellAddress=function(e){var t,r,n;return e&&("object"==typeof e||"function"==typeof e)&&"number"==typeof(null===(t=e)||void 0===t?void 0:t.sheet)&&"number"==typeof(null===(r=e)||void 0===r?void 0:r.col)&&"number"==typeof(null===(n=e)||void 0===n?void 0:n.row)},t.simpleRowAddress=t.simpleColumnAddress=t.simpleCellAddress=t.movedSimpleCellAddress=void 0;var n,s,o=r(107),a=r(149),i=r(158),u=r(157);!function(e){e.DIV_BY_ZERO="DIV_BY_ZERO",e.NAME="NAME",e.VALUE="VALUE",e.NUM="NUM",e.NA="NA",e.CYCLE="CYCLE",e.REF="REF",e.SPILL="SPILL",e.LIC="LIC",e.ERROR="ERROR"}(n||(t.ErrorType=n={})),function(e){e.FORMULA="FORMULA",e.VALUE="VALUE",e.ARRAY="ARRAY",e.EMPTY="EMPTY",e.ARRAYFORMULA="ARRAYFORMULA"}(s||(t.CellType=s={}));var l,c;t.getCellType=(e,t)=>e instanceof o.ArrayVertex?e.isLeftCorner(t)?s.ARRAYFORMULA:s.ARRAY:e instanceof o.FormulaCellVertex||e instanceof o.ParsingErrorVertex?s.FORMULA:e instanceof o.ValueCellVertex?s.VALUE:s.EMPTY,function(e){e.EMPTY="EMPTY",e.NUMBER="NUMBER",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.ERROR="ERROR"}(l||(t.CellValueNoNumber=l={})),function(e){e.NUMBER="NUMBER"}(c||(t.CellValueJustNumber=c={}));const h=t.CellValueType=Object.assign(Object.assign({},l),c);t.CellValueDetailedType=Object.assign(Object.assign({},l),i.NumberType);t.CellValueTypeOrd=e=>{switch(e){case h.EMPTY:return 0;case h.NUMBER:return 1;case h.STRING:return 2;case h.BOOLEAN:return 3;case h.ERROR:return 4}throw new Error("Cell value not computed")};const d=e=>{if(e===i.EmptyValue)return h.EMPTY;if(e instanceof p||e instanceof u.SimpleRangeValue)return h.ERROR;if("string"==typeof e)return h.STRING;if((0,i.isExtendedNumber)(e))return h.NUMBER;if("boolean"==typeof e)return h.BOOLEAN;throw new Error("Cell value not computed")};t.getCellValueType=d;t.getCellValueDetailedType=e=>(0,i.isExtendedNumber)(e)?(0,i.getTypeOfExtendedNumber)(e):d(e);t.getCellValueFormat=e=>(0,i.isExtendedNumber)(e)?(0,i.getFormatOfExtendedNumber)(e):void 0;class p{constructor(e,t,r){this.type=e,this.message=t,this.root=r}static parsingError(e){return new p(n.ERROR,`${a.ErrorMessage.ParseError}${e?" "+e:""}`)}attachRootVertex(e){return void 0===this.root?new p(this.type,this.message,e):this}}t.CellError=p;t.simpleRowAddress=(e,t)=>({sheet:e,row:t});t.invalidSimpleRowAddress=e=>e.row<0;t.simpleColumnAddress=(e,t)=>({sheet:e,col:t});t.invalidSimpleColumnAddress=e=>e.col<0;const m=(e,t,r)=>({sheet:e,col:t,row:r});t.simpleCellAddress=m;t.invalidSimpleCellAddress=e=>e.col<0||e.row<0;t.movedSimpleCellAddress=(e,t,r,n)=>m(t,e.col+r,e.row+n);t.addressKey=e=>`${e.sheet},${e.row},${e.col}`;t.absoluteSheetReference=(e,t)=>{var r;return null!==(r=e.sheet)&&void 0!==r?r:t.sheet};t.equalSimpleCellAddress=(e,t)=>e.sheet===t.sheet&&e.col===t.col&&e.row===t.row},function(e,t,r){"use strict";t.__esModule=!0,t.ValueCellVertex=t.TopSort=t.SparseStrategy=t.SheetMapping=t.RangeVertex=t.RangeMapping=t.ParsingErrorVertex=t.Graph=t.FormulaCellVertex=t.EmptyCellVertex=t.DependencyGraph=t.DenseStrategy=t.ArrayVertex=t.ArrayMapping=t.AddressMapping=void 0;var n=r(108);t.DependencyGraph=n.DependencyGraph;var s=r(164);t.AddressMapping=s.AddressMapping;var o=r(171);t.Graph=o.Graph;var a=r(172);t.TopSort=a.TopSort;var i=r(174);t.RangeMapping=i.RangeMapping;var u=r(175);t.SheetMapping=u.SheetMapping;var l=r(166);t.ArrayMapping=l.ArrayMapping;var c=r(168);t.FormulaCellVertex=c.FormulaCellVertex,t.ArrayVertex=c.ArrayVertex;var h=r(178);t.EmptyCellVertex=h.EmptyCellVertex;var d=r(179);t.ValueCellVertex=d.ValueCellVertex;var p=r(180);t.ParsingErrorVertex=p.ParsingErrorVertex;var m=r(170);t.RangeVertex=m.RangeVertex;var g=r(182);t.SparseStrategy=g.SparseStrategy;var E=r(183);t.DenseStrategy=E.DenseStrategy},function(e,t,r){"use strict";t.__esModule=!0,t.DependencyGraph=void 0,r(3),r(73),r(109),r(110),r(84),r(111),r(122),r(124),r(126),r(128),r(130),r(133);var n=r(105),s=r(135),o=r(106),a=r(156),i=r(149),u=r(158),l=r(157),c=r(136),h=r(159),d=r(160),p=r(107),m=r(164),g=r(166),E=r(167),T=r(168),f=r(171),y=r(174),A=r(175);class R{constructor(e,t,r,i,u,l,h,d){this.addressMapping=e,this.rangeMapping=t,this.sheetMapping=r,this.arrayMapping=i,this.stats=u,this.lazilyTransformingAstService=l,this.functionRegistry=h,this.namedExpressions=d,this.changes=a.ContentChanges.empty(),this.dependencyQueryAddresses=e=>{if(e instanceof p.RangeVertex)return this.rangeDependencyQuery(e).map(([e,t])=>e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,r]=t;return r.map(t=>t instanceof c.NamedExpressionDependency?this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet).address:(0,o.isSimpleCellAddress)(t)?t:(0,n.simpleCellRange)(t.start,t.end))}return[]}},this.dependencyQueryVertices=e=>{if(e instanceof p.RangeVertex)return this.rangeDependencyQuery(e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,r]=t;return r.map(t=>{if(t instanceof n.AbsoluteCellRange)return[t.start,this.rangeMapping.fetchRange(t.start,t.end)];if(t instanceof c.NamedExpressionDependency){const r=this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet);return[r.address,this.addressMapping.fetchCell(r.address)]}return[t,this.addressMapping.fetchCell(t)]})}return[]}},this.rangeDependencyQuery=e=>{const t=[],{smallerRangeVertex:r,restRange:s}=this.rangeMapping.findSmallerRange(e.range);let o;void 0!==r&&this.graph.adjacentNodes(r).has(e)?(o=s,t.push([new n.AbsoluteCellRange(r.start,r.end),r])):o=e.range;for(const e of o.addresses(this)){const r=this.addressMapping.getCell(e);void 0!==r&&t.push([e,r])}return t},this.formulaDependencyQuery=e=>{let t,r;if(!(e instanceof T.FormulaVertex))return;r=e.getAddress(this.lazilyTransformingAstService),t=e.getFormula(this.lazilyTransformingAstService);const n=(0,c.collectDependencies)(t,this.functionRegistry);return[r,(0,s.absolutizeDependencies)(n,r)]},this.graph=new f.Graph(this.dependencyQueryVertices)}static buildEmpty(e,t,r,n,s){return new R(new m.AddressMapping(t.chooseAddressMappingPolicy),new y.RangeMapping,new A.SheetMapping(t.translationPackage),new g.ArrayMapping,s,e,r,n)}setFormulaToCell(e,t,r,n,s,o){const a=T.FormulaVertex.fromAst(t,e,n,this.lazilyTransformingAstService.version());return this.exchangeOrAddFormulaVertex(a),this.processCellDependencies(r,a),this.graph.markNodeAsDirty(a),s&&this.markAsVolatile(a),o&&this.markAsDependentOnStructureChange(a),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setParsingErrorToCell(e,t){const r=this.shrinkPossibleArrayAndGetCell(e);return this.exchangeOrAddGraphNode(r,t),this.addressMapping.setCell(e,t),this.graph.markNodeAsDirty(t),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setValueToCell(e,t){const r=this.shrinkPossibleArrayAndGetCell(e);if(r instanceof p.ArrayVertex&&this.arrayMapping.removeArray(r.getRange()),r instanceof p.ValueCellVertex){r.getValues().rawValue!==t.rawValue&&(r.setValues(t),this.graph.markNodeAsDirty(r))}else{const n=new p.ValueCellVertex(t.parsedValue,t.rawValue);this.exchangeOrAddGraphNode(r,n),this.addressMapping.setCell(e,n),this.graph.markNodeAsDirty(n)}return this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setCellEmpty(e){const t=this.shrinkPossibleArrayAndGetCell(e);if(void 0===t)return a.ContentChanges.empty();if(this.graph.adjacentNodes(t).size>0){const r=new p.EmptyCellVertex;this.exchangeGraphNode(t,r),0===this.graph.adjacentNodesCount(r)?(this.removeVertex(r),this.addressMapping.removeCell(e)):(this.graph.markNodeAsDirty(r),this.addressMapping.setCell(e,r))}else this.removeVertex(t),this.addressMapping.removeCell(e);return this.getAndClearContentChanges()}clearDirtyVertices(){this.graph.clearDirtyNodes()}verticesToRecompute(){return this.graph.getDirtyAndVolatileNodes()}processCellDependencies(e,t){const r=this.graph.getNodeId(t);e.forEach(e=>{if(e instanceof n.AbsoluteCellRange){const t=e;let n=this.getRange(t.start,t.end);void 0===n&&(n=new p.RangeVertex(t),this.rangeMapping