mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-10-05 15:23:29 +01:00
Improve table display in Spinner.
This commit is contained in:
1 parent
d6adfea9b1
commit
df96b05863
8 files changed
+1061
-15
No files matched your search
@@ -38,7 +38,7 @@
|
||||
</form>
|
||||
|
||||
<!-- Data Rows -->
|
||||
<table>
|
||||
<table id="data-table" class="invisible">
|
||||
<tr>
|
||||
{{#each queryResult.columns}}
|
||||
<th>{{this}}</th>
|
||||
@@ -55,6 +55,7 @@
|
||||
{{else}}
|
||||
<div>Select a table from above and click 'browse'.</div>
|
||||
{{/if}}
|
||||
<div id="handson-table"></div>
|
||||
|
||||
<br />
|
||||
|
||||
@@ -70,6 +71,44 @@
|
||||
<input type="submit" name="action" value="last" {{#if pagingData.lastPage}}disabled{{/if}} />
|
||||
</form>
|
||||
|
||||
|
||||
<script src="/js/lib/handsontable.full.min.js"></script>
|
||||
|
||||
{{> partials/suffix}}
|
||||
|
||||
<script>
|
||||
function main() {
|
||||
const table = document.getElementById('data-table')
|
||||
if (!table) {
|
||||
return;
|
||||
}
|
||||
|
||||
const data = htmlToHandsonData(table)
|
||||
table.remove()
|
||||
|
||||
const renderers = []
|
||||
for (const header of data.headers) {
|
||||
renderers.push({ renderer: 'nullRenderer' })
|
||||
}
|
||||
|
||||
const hot = new Handsontable(document.getElementById('handson-table'), {
|
||||
data: data.rows,
|
||||
colHeaders: data.headers,
|
||||
columns: renderers,
|
||||
readOnly: true,
|
||||
filters: true,
|
||||
columnSorting: true,
|
||||
manualColumnResize: true,
|
||||
manualColumnMove: true,
|
||||
manualRowResize: true,
|
||||
dropdownMenu: ['filter_by_condition', 'filter_by_value', 'filter_action_bar'],
|
||||
viewportColumnRenderingOffset: 1000,
|
||||
licenseKey: 'non-commercial-and-evaluation'
|
||||
})
|
||||
}
|
||||
|
||||
main()
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,47 @@
|
||||
@charset "UTF-8";
|
||||
/*!
|
||||
* Copyright (c) HANDSONCODE sp. z o. o.
|
||||
*
|
||||
* HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., a Polish corporation based in
|
||||
* Gdynia, Poland, at Aleja Zwycięstwa 96-98, registered by the District Court in Gdansk under number
|
||||
* 538651, EU tax ID number: PL5862294002, share capital: PLN 62,800.00.
|
||||
*
|
||||
* This software is protected by applicable copyright laws, including international treaties, and dual-
|
||||
* licensed – depending on whether your use for commercial purposes, meaning intended for or
|
||||
* resulting in commercial advantage or monetary compensation, or not.
|
||||
*
|
||||
* If your use is strictly personal or solely for evaluation purposes, meaning for the purposes of testing
|
||||
* the suitability, performance, and usefulness of this software outside the production environment,
|
||||
* you agree to be bound by the terms included in the "handsontable-non-commercial-license.pdf" file.
|
||||
*
|
||||
* Your use of this software for commercial purposes is subject to the terms included in an applicable
|
||||
* license agreement.
|
||||
*
|
||||
* In any case, you must not make any such use of this software as to develop software which may be
|
||||
* considered competitive with this software.
|
||||
*
|
||||
* 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: 13.0.0
|
||||
* Release date: 22/06/2023 (built at 22/06/2023 12:52:47)
|
||||
*/.handsontable .table td,.handsontable .table th{border-top:none}.handsontable tr{background:#fff}.handsontable td{background-color:inherit}.handsontable .table caption+thead tr:first-child td,.handsontable .table caption+thead tr:first-child th,.handsontable .table colgroup+thead tr:first-child td,.handsontable .table colgroup+thead tr:first-child th,.handsontable .table thead:first-child tr:first-child td,.handsontable .table thead:first-child tr:first-child th{border-top:1px solid #ccc}.handsontable .table-bordered{border:0;border-collapse:separate}.handsontable .table-bordered td,.handsontable .table-bordered th{border-left:none}.handsontable .table-bordered td:first-child,.handsontable .table-bordered th:first-child{border-left:1px solid #ccc}.handsontable .table>tbody>tr>td,.handsontable .table>tbody>tr>th,.handsontable .table>tfoot>tr>td,.handsontable .table>tfoot>tr>th,.handsontable .table>thead>tr>td,.handsontable .table>thead>tr>th{line-height:21px;padding:0}.col-lg-1.handsontable,.col-lg-10.handsontable,.col-lg-11.handsontable,.col-lg-12.handsontable,.col-lg-2.handsontable,.col-lg-3.handsontable,.col-lg-4.handsontable,.col-lg-5.handsontable,.col-lg-6.handsontable,.col-lg-7.handsontable,.col-lg-8.handsontable,.col-lg-9.handsontable,.col-md-1.handsontable,.col-md-10.handsontable,.col-md-11.handsontable,.col-md-12.handsontable,.col-md-2.handsontable,.col-md-3.handsontable,.col-md-4.handsontable,.col-md-5.handsontable,.col-md-6.handsontable,.col-md-7.handsontable,.col-md-8.handsontable,.col-md-9.handsontable .col-sm-1.handsontable,.col-sm-10.handsontable,.col-sm-11.handsontable,.col-sm-12.handsontable,.col-sm-2.handsontable,.col-sm-3.handsontable,.col-sm-4.handsontable,.col-sm-5.handsontable,.col-sm-6.handsontable,.col-sm-7.handsontable,.col-sm-8.handsontable,.col-sm-9.handsontable .col-xs-1.handsontable,.col-xs-10.handsontable,.col-xs-11.handsontable,.col-xs-12.handsontable,.col-xs-2.handsontable,.col-xs-3.handsontable,.col-xs-4.handsontable,.col-xs-5.handsontable,.col-xs-6.handsontable,.col-xs-7.handsontable,.col-xs-8.handsontable,.col-xs-9.handsontable{padding-left:0;padding-right:0}.handsontable .table-striped>tbody>tr:nth-of-type(2n){background-color:#fff}.handsontable{position:relative}.handsontable .hide{display:none}.handsontable .relative{position:relative}.handsontable .wtHider{width:0}.handsontable .wtSpreader{height:auto;position:relative;width:0}.handsontable div,.handsontable input,.handsontable table,.handsontable tbody,.handsontable td,.handsontable textarea,.handsontable th,.handsontable thead{box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box}.handsontable input,.handsontable textarea{min-height:auto}.handsontable table.htCore{border-collapse:separate;border-spacing:0;border-width:0;cursor:default;margin:0;max-height:none;max-width:none;outline-width:0;table-layout:fixed;width:0}.handsontable col,.handsontable col.rowHeader{width:50px}.handsontable td,.handsontable th{background-color:#fff;border-bottom:1px solid #ccc;border-left-width:0;border-right:1px solid #ccc;border-top-width:0;empty-cells:show;height:22px;line-height:21px;outline-width:0;overflow:hidden;padding:0 4px;vertical-align:top;white-space:pre-wrap}[dir=rtl].handsontable td,[dir=rtl].handsontable th{border-left:1px solid #ccc;border-right-width:0}.handsontable th:last-child{border-bottom:1px solid #ccc;border-left:none;border-right:1px solid #ccc}[dir=rtl].handsontable th:last-child{border-left:1px solid #ccc;border-right:none}.handsontable td:first-of-type,.handsontable th:first-child,.handsontable th:nth-child(2){border-left:1px solid #ccc}[dir=rtl].handsontable td:first-of-type,[dir=rtl].handsontable th:first-child,[dir=rtl].handsontable th:nth-child(2){border-right:1px solid #ccc}.handsontable .ht_clone_top th:nth-child(2){border-left-width:0;border-right:1px solid #ccc}[dir=rtl].handsontable .ht_clone_top th:nth-child(2){border-left:1px solid #ccc;border-right-width:0}.handsontable.htRowHeaders thead tr th:nth-child(2){border-left:1px solid #ccc}[dir=rtl].handsontable.htRowHeaders thead tr th:nth-child(2){border-right:1px solid #ccc}.handsontable tr:first-child td,.handsontable tr:first-child th{border-top:1px solid #ccc}.ht_master:not(.innerBorderInlineStart):not(.emptyColumns)~.handsontable tbody tr th,.ht_master:not(.innerBorderInlineStart):not(.emptyColumns)~.handsontable:not(.ht_clone_top) thead tr th:first-child{border-left:1px solid #ccc;border-right-width:0}[dir=rtl].ht_master:not(.innerBorderInlineStart):not(.emptyColumns)~.handsontable tbody tr th,[dir=rtl].ht_master:not(.innerBorderInlineStart):not(.emptyColumns)~.handsontable:not(.ht_clone_top) thead tr th:first-child{border-left-width:0;border-right:1px solid #ccc}.ht_master:not(.innerBorderTop):not(.innerBorderBottom) thead tr.lastChild th,.ht_master:not(.innerBorderTop):not(.innerBorderBottom) thead tr:last-child th,.ht_master:not(.innerBorderTop):not(.innerBorderBottom)~.handsontable thead tr.lastChild th,.ht_mastLine truncated
|
||||
/*!
|
||||
* Pikaday
|
||||
* Copyright © 2014 David Bushell | BSD & MIT license | https://dbushell.com/
|
||||
*/.pika-single{background:#fff;border:1px solid;border-color:#ccc #ccc #bbb;color:#333;display:block;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;position:relative;z-index:9999}.pika-single:after,.pika-single:before{content:" ";display:table}.pika-single:after{clear:both}.pika-single.is-hidden{display:none}.pika-single.is-bound{box-shadow:0 5px 15px -5px rgba(0,0,0,.5);position:absolute}.pika-lendar{float:left;margin:8px;width:240px}.pika-title{position:relative;text-align:center}.pika-label{background-color:#fff;display:inline-block;font-size:14px;font-weight:700;line-height:20px;margin:0;overflow:hidden;padding:5px 3px;position:relative;z-index:9999}.pika-title select{cursor:pointer;left:0;margin:0;opacity:0;position:absolute;top:5px;z-index:9998}.pika-next,.pika-prev{background-color:transparent;background-position:50%;background-repeat:no-repeat;background-size:75% 75%;border:0;cursor:pointer;display:block;height:30px;opacity:.5;outline:none;overflow:hidden;padding:0;position:relative;text-indent:20px;white-space:nowrap;width:20px}.pika-next:hover,.pika-prev:hover{opacity:1}.is-rtl .pika-next,.pika-prev{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==");float:left}.is-rtl .pika-prev,.pika-next{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=");float:right}.pika-next.is-disabled,.pika-prev.is-disabled{cursor:default;opacity:.2}.pika-select{display:inline-block}.pika-table{border:0;border-collapse:collapse;border-spacing:0;width:100%}.pika-table td,.pika-table th{padding:0;width:14.2857142857%}.pika-table th{color:#999;font-size:12px;font-weight:700;line-height:25px;text-align:center}.pika-button{background:#f5f5f5;border:0;box-sizing:border-box;-moz-box-sizing:border-box;color:#666;cursor:pointer;display:block;font-size:12px;height:auto;line-height:15px;margin:0;outline:none;padding:5px;text-align:right;width:100%}.pika-week{color:#999;font-size:11px}.is-today .pika-button{color:#3af;font-weight:700}.has-event .pika-button,.is-selected .pika-button{background:#3af;border-radius:3px;box-shadow:inset 0 1px 3px #178fe5;color:#fff;font-weight:700}.has-event .pika-button{background:#005da9;box-shadow:inset 0 1px 3px #0076c9}.is-disabled .pika-button,.is-inrange .pika-button{background:#d5e9f7}.is-startrange .pika-button{background:#6cb31d;border-radius:3px;box-shadow:none;color:#fff}.is-endrange .pika-button{background:#3af;border-radius:3px;box-shadow:none;color:#fff}.is-disabled .pika-button{color:#999;cursor:default;opacity:.3;pointer-events:none}.is-outside-current-month .pika-button{color:#999;opacity:.3}.is-selection-disabled{cursor:default;pointer-events:none}.pika-button:hover,.pika-row.pick-whole-week:hover .pika-button{background:#ff8000;border-radius:3px;box-shadow:none;color:#fff}.pika-table abbr{border-bottom:none;cursor:help}.handsontable .htAutocompleteArrow{color:#eee;cursor:default;float:right;font-size:10px;text-align:center;width:16px}[dir=rtl].handsontable .htAutocompleteArrow{float:left}.handsontable td .htAutocompleteArrow:hover{color:#777}.handsontable td.area .htAutocompleteArrow{color:#d3d3d3}.handsontable .htCheckboxRendererInput{display:inline-block}.handsontable .htCheckboxRendererInput.noValue{opacity:.5}.handsontable .htCheckboxRendererLabel{cursor:pointer;display:inline-block;font-size:inherit;vertical-align:middle}.handsontable .htCheckboxRendererLabel.fullWidth{width:100%}.handsontable .htCommentCell{position:relative}.handsontable .htCommentCell:after{border-left:6px solid transparent;border-right:none;border-top:6px solid #000;content:"";left:unset;position:absolute;right:0;top:0}[dir=rtl].handsontable .htCommentCell:after{border-left:none;border-right:6px solid transparent;left:0;right:unset}.htCommentsContainer .htComments{display:none;position:absolute;z-index:1059}.htCommentsContainer .htCommentTextArea{-webkit-appearance:none;background-color:#fff;border:none;border-left:3px solid #ccc;box-shadow:0 1px 3px rgba(0,0,0,.118),0 1px 2px rgba(0,0,0,.239);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:12px;height:90px;outline:0!important;padding:5px;width:215px}[dir=rtl].htCommentsContainer .htCommentTextArea{border-left:none;border-right:3px solid #ccc}.htCommentsContainer .htCommentTextArea:focus{border-left:3px solid #5292f7;border-right:none;box-shadow:0 1px 3px rgba(0,0,0,.118),0 1px 2px rgba(0,0,0,.239),inset 0 0 0 1px #5292f7}[dir=rtl].htCommentsContainer .htCommentTextArea:focus{border-left:none;border-right:3px solid #5292f7}
|
||||
/*!
|
||||
* Handsontable ContextMenu
|
||||
*/.htContextMenu:not(.htGhostTable){display:none;position:absolute;z-index:1060}.htContextMenu .ht_clone_bottom,.htContextMenu .ht_clone_bottom_inline_start_corner,.htContextMenu .ht_clone_inline_start,.htContextMenu .ht_clone_top,.htContextMenu .ht_clone_top_inline_start_corner{display:none}.htContextMenu .ht_master table.htCore{border-color:#ccc;border-style:solid;border-width:1px 2px 2px 1px}[dir=rtl].htContextMenu .ht_master table.htCore{border-left-width:2px;border-right-width:1px}.htContextMenu .wtBorder{visibility:hidden}.htContextMenu table tbody tr td{background:#fff;border-width:0;cursor:pointer;overflow:hidden;padding:4px 6px 0;text-overflow:ellipsis;white-space:nowrap}.htContextMenu table tbody tr td:first-child{border-width:0}[dir=rtl].htContextMenu table tbody tr td:first-child{border-left-width:0;border-right-width:0}.htContextMenu table tbody tr td.htDimmed{color:#323232;font-style:normal}.htContextMenu table tbody tr td.current,.htContextMenu table tbody tr td.zeroclipboard-is-hover{background:#f3f3f3}.htContextMenu table tbody tr td.htSeparator{border-top:1px solid #e6e6e6;cursor:default;height:0;padding:0}.htContextMenu table tbody tr td.htDisabled{color:#999;cursor:default}.htContextMenu table tbody tr td.htDisabled:hover{background:#fff;color:#999;cursor:default}.htContextMenu table tbody tr.htHidden{display:none}.htContextMenu table tbody tr td .htItemWrapper{margin-left:10px;margin-right:6px}[dir=rtl].htContextMenu table tbody tr td .htItemWrapper{margin-left:6px;margin-right:10px}.htContextMenu table tbody tr td div span.selected{left:4px;margin-top:-2px;position:absolute;right:0}[dir=rtl].htContextMenu table tbody tr td div span.selected{left:0;right:4px}.htContextMenu .ht_master .wtHolder{overflow:hidden}textarea.HandsontableCopyPaste{opacity:0;outline:0 none!important;overflow:hidden;position:fixed!important;right:100%!important;top:0!important}
|
||||
/*!
|
||||
* Handsontable DropdownMenu
|
||||
*/.handsontable .changeType{background:#eee;border:1px solid #bbb;border-radius:2px;color:#bbb;float:right;font-size:9px;line-height:9px;margin:3px 1px 0 5px;padding:2px}[dir=rtl].handsontable .changeType{float:left}.handsontable .changeType:before{content:"▼ "}.handsontable .changeType:hover{border:1px solid #777;color:#777;cursor:pointer}.htDropdownMenu:not(.htGhostTable){display:none;position:absolute;z-index:1060}.htDropdownMenu .ht_clone_bottom,.htDropdownMenu .ht_clone_bottom_inline_start_corner,.htDropdownMenu .ht_clone_inline_start,.htDropdownMenu .ht_clone_top,.htDropdownMenu .ht_clone_top_inline_start_corner{display:none}.htDropdownMenu table.htCore{border-color:#ccc;border-style:solid;border-width:1px 2px 2px 1px}[dir=rtl].htDropdownMenu table.htCore{border-left-width:2px;border-right-width:1px}.htDropdownMenu .wtBorder{visibility:hidden}.htDropdownMenu table tbody tr td{background:#fff;border-width:0;cursor:pointer;overflow:hidden;padding:4px 6px 0;text-overflow:ellipsis;white-space:nowrap}.htDropdownMenu table tbody tr td:first-child{border-width:0}[dir=rtl].htDropdownMenu table tbody tr td:first-child{border-left-width:0;border-right-width:0}.htDropdownMenu table tbody tr td.htDimmed{color:#323232;font-style:normal}.htDropdownMenu table tbody tr td.current,.htDropdownMenu table tbody tr td.zeroclipboard-is-hover{background:#e9e9e9}.htDropdownMenu table tbody tr td.htSeparator{border-top:1px solid #e6e6e6;cursor:default;height:0;padding:0}.htDropdownMenu table tbody tr td.htDisabled{color:#999}.htDropdownMenu table tbody tr td.htDisabled:hover{background:#fff;color:#999;cursor:default}.htDropdownMenu:not(.htGhostTable) table tbody tr.htHidden{display:none}.htDropdownMenu table tbody tr td .htItemWrapper,[dir=rtl].htDropdownMenu table tbody tr td .htItemWrapper{margin-left:10px;margin-right:10px}.htDropdownMenu table tbody tr td div span.selected{left:4px;margin-top:-2px;position:absolute;right:0}[dir=rtl].htDropdownMenu table tbody tr td div span.selected{left:0;right:4px}.htDropdownMenu .ht_master .wtHolder{overflow:hidden}
|
||||
/*!
|
||||
* Handsontable Filters
|
||||
*/.htFiltersConditionsMenu:not(.htGhostTable){display:none;position:absolute;z-index:1070}.htFiltersConditionsMenu .ht_clone_bottom,.htFiltersConditionsMenu .ht_clone_bottom_inline_start_corner,.htFiltersConditionsMenu .ht_clone_inline_start,.htFiltersConditionsMenu .ht_clone_top,.htFiltersConditionsMenu .ht_clone_top_inline_start_corner{display:none}.htFiltersConditionsMenu table.htCore{border-color:#bbb;border-style:solid;border-width:1px 2px 2px 1px}.htFiltersConditionsMenu .wtBorder{visibility:hidden}.htFiltersConditionsMenu table tbody tr td{background:#fff;border-width:0;cursor:pointer;overflow:hidden;padding:4px 6px 0;text-overflow:ellipsis;white-space:nowrap}.htFiltersConditionsMenu table tbody tr td:first-child{border-width:0}[dir=rtl].htFiltersConditionsMenu table tbody tr td:first-child{border-left-width:0;border-right-width:0}.htFiltersConditionsMenu table tbody tr td.htDimmed{color:#323232;font-style:normal}.htFiltersConditionsMenu table tbody tr td.current,.htFiltersConditionsMenu table tbody tr td.zeroclipboard-is-hover{background:#e9e9e9}.htFiltersConditionsMenu table tbody tr td.htSeparator{border-top:1px solid #e6e6e6;height:0;padding:0}.htFiltersConditionsMenu table tbody tr td.htDisabled{color:#999}.htFiltersConditionsMenu table tbody tr td.htDisabled:hover{background:#fff;color:#999;cursor:default}.htFiltersConditionsMenu table tbody tr td .htItemWrapper{margin-left:10px;margin-right:10px}.htFiltersConditionsMenu table tbody tr td div span.selected{left:4px;margin-top:-2px;position:absolute}.htFiltersConditionsMenu .ht_master .wtHolder{overflow:hidden}.handsontable .htMenuFiltering{border-bottom:1px dotted #ccc;height:135px;overflow:hidden}.handsontable .ht_master table td.htCustomMenuRenderer{background-color:#fff;cursor:auto}.handsontable .htFiltersMenuLabel{font-size:.75em}.handsontable .htFiltersMenuActionBar{padding-bottom:3px;padding-top:10px;text-align:center}.handsontable .htFiltersMenuCondition.border{border-bottom:1px dotted #ccc!important}.handsontable .htFiltersMenuCondition .htUIInput{padding:0 0 5px}.handsontable .htFiltersMenuValue{border-bottom:1px dotted #ccc!important}.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch{padding:0}.handsontable .htFiltersMenuCondition .htUIInput input,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input{box-sizing:border-box;font-family:inherit;font-size:.75em;padding:4px;width:100%}.htUIMultipleSelect .ht_master .wtHolder{overflow-y:scroll}.handsontable .htFiltersActive .changeType{background-color:#d2e0d9;border:1px solid #509272;color:#18804e}.handsontable .htUISelectAll{margin-left:0;margin-right:10px}[dir=rtl].handsontable .htUISelectAll{margin-left:10px;margin-right:0}.handsontable .htUIClearAll,.handsontable .htUISelectAll{display:inline-block}.handsontable .htUIClearAll a,.handsontable .htUISelectAll a{font-size:.75em}.handsontable .htUISelectionControls{text-align:right}[dir=rtl].handsontable .htUISelectionControls{text-align:left}.handsontable .htCheckboxRendererInput{height:1em;margin:0 5px 0 0;vertical-align:middle}[dir=rtl].handsontable .htCheckboxRendererInput{margin-left:5px;margin-right:0}.handsontable .htUIInput{padding:3px 0 7px;position:relative;text-align:center}.handsontable .htUIInput input{border:1px solid #d2d1d1;border-radius:2px}.handsontable .htUIInput input:focus{outline:0}.handsontable .htUIInputIcon{position:absolute}.handsontable .htUIInput.htUIButton{cursor:pointer;display:inline-block}.handsontable .htUIInput.htUIButton input{background-color:#eee;color:#000;cursor:pointer;font-family:inherit;font-size:.75em;font-weight:700;height:19px;min-width:64px}.handsontable .htUIInput.htUIButton input:hover{border-color:#b9b9b9}.handsontable .htUIInput.htUIButtonOK{margin-left:0;margin-right:10px}[dir=rtl].handsontable .htUIInput.htUIButtonOK{margin-left:10px;margin-right:0}.handsontable .htUIInput.htUIButtonOK input{background-color:#0f9d58;border-color:#18804e;color:#fff}.handsontable .htUIInput.htUIButtonOK input:hover{border-color:#1a6f46}.handsontable .htUISelect{cursor:pointer;margin-bottom:7px;position:relative}.handsontable .htUISelectCaption{background-color:#e8e8e8;border:1px solid #d2d1d1;border-radius:2px;font-family:inherit;font-size:.75em;font-weight:700;overflow:hidden;padding:3px 20px 3px 10px;text-overflow:ellipsis;white-space:nowrap}.handsontable .htUISelectCaption:hover{background-color:#e8e8e8;border:1px solid #b9b9b9}.handsontable .htUISelectDropdown:after{content:"▲";font-size:7px;position:absolute;right:10px;top:0}.handsontable .htUISelectDropdown:before{content:"▼";font-size:7px;position:absolute;right:10px;top:8px}.handsontable .htUIMultipleSelect .handsontable .htCore{border:none}.handsontable .htUIMultipleSelect .handsontable .htCore td:hover{background-color:#f5f5f5}.handsontable .htUIMultipleSelectSearch input{border:1px solid #d2d1d1;border-radius:2px;padding:3px}.handsontable .htUIRadio{display:inline-block;height:100%;margin-left:0;margin-right:5px}[dir=rtlLine truncated
|
||||
/*!
|
||||
* Handsontable HiddenRows
|
||||
*/.handsontable th.afterHiddenRow:after,.handsontable th.beforeHiddenRow:before{color:#bbb;font-size:6pt;left:2px;line-height:6pt;position:absolute}.handsontable th.afterHiddenRow,.handsontable th.beforeHiddenRow{position:relative}.handsontable th.beforeHiddenRow:before{bottom:2px;content:"▲"}.handsontable th.afterHiddenRow:after{content:"▼";top:2px}.handsontable.ht__selection--rows tbody th.afterHiddenRow.ht__highlight:after,.handsontable.ht__selection--rows tbody th.beforeHiddenRow.ht__highlight:before{color:#eee}.handsontable td.afterHiddenRow.firstVisibleRow,.handsontable th.afterHiddenRow.firstVisibleRow{border-top:1px solid #ccc}.htRowHeaders .ht_master.innerBorderInlineStart~.ht_clone_inline_start td:first-of-type,.htRowHeaders .ht_master.innerBorderInlineStart~.ht_clone_top_inline_start_corner th:nth-child(2){border-left:0}.handsontable.ht__manualColumnMove.after-selection--columns thead th.ht__highlight{cursor:move;cursor:-moz-grab;cursor:-webkit-grab;cursor:grab}.handsontable.ht__manualColumnMove.on-moving--columns,.handsontable.ht__manualColumnMove.on-moving--columns thead th.ht__highlight{cursor:move;cursor:-moz-grabbing;cursor:-webkit-grabbing;cursor:grabbing}.handsontable.ht__manualColumnMove.on-moving--columns .manualColumnResizer{display:none}.handsontable .ht__manualColumnMove--backlight,.handsontable .ht__manualColumnMove--guideline{display:none;height:100%;position:absolute}.handsontable .ht__manualColumnMove--guideline{background:#757575;margin-inline-end:0;margin-inline-start:-1px;top:0;width:2px;z-index:205}.handsontable .ht__manualColumnMove--backlight{background:#343434;background:rgba(52,52,52,.25);display:none;pointer-events:none;z-index:205}.handsontable.on-moving--columns .ht__manualColumnMove--backlight,.handsontable.on-moving--columns.show-ui .ht__manualColumnMove--guideline{display:block}.handsontable .wtHider{position:relative}.handsontable.ht__manualRowMove.after-selection--rows tbody th.ht__highlight{cursor:move;cursor:-moz-grab;cursor:-webkit-grab;cursor:grab}.handsontable.ht__manualRowMove.on-moving--rows,.handsontable.ht__manualRowMove.on-moving--rows tbody th.ht__highlight{cursor:move;cursor:-moz-grabbing;cursor:-webkit-grabbing;cursor:grabbing}.handsontable.ht__manualRowMove.on-moving--rows .manualRowResizer{display:none}.handsontable .ht__manualRowMove--backlight,.handsontable .ht__manualRowMove--guideline{display:none;position:absolute;width:100%}.handsontable .ht__manualRowMove--guideline{background:#757575;height:2px;left:0;margin-top:-1px;z-index:205}.handsontable .ht__manualRowMove--backlight{background:#343434;background:rgba(52,52,52,.25);display:none;pointer-events:none;z-index:205}.handsontable.on-moving--rows .ht__manualRowMove--backlight,.handsontable.on-moving--rows.show-ui .ht__manualRowMove--guideline{display:block}.handsontable tbody td[rowspan][class*=area][class*=highlight]:not([class*=fullySelectedMergedCell]):before{opacity:0}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-0]:before,.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-multiple]:before{opacity:.1}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-1]:before{opacity:.2}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-2]:before{opacity:.27}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-3]:before{opacity:.35}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-4]:before{opacity:.41}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-5]:before{opacity:.47}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-6]:before{opacity:.54}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-7]:before{opacity:.58}.handsontable span.colHeader.columnSorting:after{font-size:8px;height:8px;left:unset;line-height:1.1;margin-top:-2px;padding-left:5px;padding-right:unset;position:absolute;right:-15px;text-decoration:underline;top:50%}[dir=rtl].handsontable span.colHeader.columnSorting:after{left:-15px;padding-left:unset;padding-right:5px;right:unset}.handsontable span.colHeader.columnSorting:after{text-decoration:none}.handsontable span.colHeader.columnSorting[class*=" sort-"]:after,.handsontable span.colHeader.columnSorting[class^=sort-]:after{content:"+"}.handsontable span.colHeader.columnSorting.sort-1:after{content:"1"}.handsontable span.colHeader.columnSorting.sort-2:after{content:"2"}.handsontable span.colHeader.columnSorting.sort-3:after{content:"3"}.handsontable span.colHeader.columnSorting.sort-4:after{content:"4"}.handsontable span.colHeader.columnSorting.sort-5:after{content:"5"}.handsontable span.colHeader.columnSorting.sort-6:after{content:"6"}.handsontable span.colHeader.columnSorting.sort-7:after{content:"Line truncated
|
||||
@@ -12,18 +12,12 @@ select, input {
|
||||
}
|
||||
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
th {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: #fff;
|
||||
.handsontable td.htDimmed {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.query-input {
|
||||
@@ -84,6 +78,10 @@ h2.collapse-header, h2.collapse-header+div {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.invisible {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
table.device-info {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,889 @@
|
||||
/*!
|
||||
* Copyright (c) HANDSONCODE sp. z o. o.
|
||||
*
|
||||
* HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., a Polish corporation based in
|
||||
* Gdynia, Poland, at Aleja Zwycięstwa 96-98, registered by the District Court in Gdansk under number
|
||||
* 538651, EU tax ID number: PL5862294002, share capital: PLN 62,800.00.
|
||||
*
|
||||
* This software is protected by applicable copyright laws, including international treaties, and dual-
|
||||
* licensed – depending on whether your use for commercial purposes, meaning intended for or
|
||||
* resulting in commercial advantage or monetary compensation, or not.
|
||||
*
|
||||
* If your use is strictly personal or solely for evaluation purposes, meaning for the purposes of testing
|
||||
* the suitability, performance, and usefulness of this software outside the production environment,
|
||||
* you agree to be bound by the terms included in the "handsontable-non-commercial-license.pdf" file.
|
||||
*
|
||||
* Your use of this software for commercial purposes is subject to the terms included in an applicable
|
||||
* license agreement.
|
||||
*
|
||||
* In any case, you must not make any such use of this software as to develop software which may be
|
||||
* considered competitive with this software.
|
||||
*
|
||||
* 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: 13.0.0
|
||||
* Release date: 22/06/2023 (built at 22/06/2023 12:52:47)
|
||||
*/
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Handsontable",[],t):"object"==typeof exports?exports.Handsontable=t():e.Handsontable=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=640)}([function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(271),o=n(98),i=n(698);r||o(Object.prototype,"toString",i,{unsafe:!0})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(427);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(89),o=n(168),i=n(174),a=n(107),s=n(84).f,u=n(269),l=n(270),c=n(114),d=n(55),h=a.set,f=a.getterFor("Array Iterator");e.exports=u(Array,"Array",(function(e,t){h(this,{type:"Array Iterator",target:r(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,l(void 0,!0)):l("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values");var p=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!c&&d&&"values"!==p.name)try{s(p,"name",{value:"values"})}catch(e){}},function(e,t,n){"use strict";var r=n(272).charAt,o=n(56),i=n(107),a=n(269),s=n(270),u=i.set,l=i.getterFor("String Iterator");a(String,"String",(function(e){u(this,{type:"String Iterator",string:o(e),index:0})}),(function(){var e,t=l(this),n=t.string,o=t.index;return o>=n.length?s(void 0,!0):(e=r(n,o),t.index+=e.length,s(e,!1))}))},function(e,t,n){var r=n(44),o=n(404),i=n(405),a=n(4),s=n(127),u=n(48),l=u("iterator"),c=u("toStringTag"),d=a.values,h=function(e,t){if(e){if(e[l]!==d)try{s(e,l,d)}catch(t){e[l]=d}if(e[c]||s(e,c,t),o[t])for(var n in a)if(e[n]!==a[n])try{s(e,n,a[n])}catch(t){e[n]=a[n]}}};for(var f in o)h(r[f]&&r[f].prototype,f);h(i,"DOMTokenList")},function(e,t,n){n(699)},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(22),o=n(106),i=n(129),a=n(753),s=n(428),u=n(62),l=n(63),c=n(123),d=n(28),h=o("Reflect","construct"),f=Object.prototype,p=[].push,g=d((function(){function e(){}return!(h((function(){}),[],e)instanceof e)})),m=!d((function(){h((function(){}))})),v=g||m;r({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(e,t){s(e),u(t);var n=arguments.length<3?e:s(arguments[2]);if(m&&!g)return h(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return i(p,r,t),new(i(a,e,r))}var o=n.prototype,d=c(l(o)?o:f),v=i(e,d,t);return l(v)?v:d}})},function(e,t,n){var r=n(571);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(14).default,o=n(35);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.clone=function(e){var t={};return l(e,(function(e,n){t[n]=e})),t},t.createObjectPropListener=function(Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class r extends Error{constructor(e){super("There's no sheet with id = "+e)}}class o extends Error{constructor(e){super(`There's no sheet with name '${e}'`)}}class i extends Error{constructor(e){super(`Sheet with name ${e} already exists`)}}class a extends Error{constructor(){super("Sheet size limit exceeded")}}class s extends Error{constructor(){super("This is not a formula")}}class u extends Error{constructor(e){super(`Address (row = ${e.row}, col = ${e.col}) is invalid`)}}class l extends Error{constructor(e){super("Invalid arguments, expected "+e)}}class c extends Error{constructor(e,t){super(`Sheets ${e} and ${t} are not equal.`)}}class d extends Error{constructor(e){super(`Name of Named Expression '${e}' is already present`)}}class h extends Error{constructor(e){super(`Name of Named Expression '${e}' is invalid`)}}class f extends Error{constructor(e){super(`Named Expression '${e}' does not exist`)}}class p extends Error{constructor(){super("There is no operation to undo")}}class g extends Error{constructor(){super("There is no operation to redo")}}class m extends Error{constructor(){super("There is nothing to paste")}}function v(e,t){switch(typeof t){case"function":case"symbol":return t.toString();case"bigint":return"BigInt("+t.toString()+")";default:return t instanceof RegExp?"RegExp("+t.toString()+")":t}}class y extends Error{constructor(e){super("Unable to parse value: "+JSON.stringify(e,v,4))}}class E extends Error{constructor(e,t){super(`Expected value of type: ${e} for config parameter: ${t}`)}}class T extends Error{constructor(e){super(`Config parameter ${e} cannot be empty.`)}}class C extends Error{constructor(e,t){super(`Config parameter ${e} should be at least ${t}`)}}class R extends Error{constructor(e,t){super(`Config parameter ${e} should be at most ${t}`)}}class w extends Error{constructor(e,t){super(`Expected one of ${e} for config parameter: ${t}`)}}class S extends Error{constructor(){super("Computations are suspended")}}class O extends Error{constructor(e){super(`Translation for ${e} is missing in the translation package you're using.`)}}class b extends Error{constructor(e){super("Cannot register translation for function with id: "+e)}}class A extends Error{constructor(){super("Language not registered.")}}class N extends Error{constructor(){super("Language already registered.")}}class M extends Error{static functionNotDeclaredInPlugin(e,t){return new M(`Function with id ${e} not declared in plugin ${t}`)}static functionMethodNotFound(e,t){return new M(`Function method ${e} not found in plugin ${t}`)}}class I extends Error{static cannotRegisterFunctionWithId(e){return new I("Cannot register function with id "+e)}static cannotUnregisterFunctionWithId(e){return new I("Cannot unregister function with id "+e)}static cannotUnregisterProtectedPlugin(){return new I("Cannot unregister protected plugin")}}class _ extends Error{constructor(){super("Cannot perform this operation, source location has an array inside.")}}class k extends Error{constructor(){super("Cannot perform this operation, target location has an array inside.")}}class x extends Error{constructor(){super("Relative addresses not allowed in named expressions.")}}class P extends Error{constructor(e,t){super(`Alias id ${e} in plugin ${t} already defined as a function or alias.`)}}},function(e,t,n){var r=n(167),o=Function.prototype,i=o.call,a=r&&o.bind.bind(i,i);e.exports=r?a:function(e){return function(){return i.apply(e,arguments)}}},function(e,t,n){"use strict";var r=n(22),o=n(267).includes,i=n(28),a=n(168);r({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},function(e,t,n){var r=n(710),o=n(410),i=n(282),a=n(711);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.r(t),n.d(t,"ErrorMessage",(function(){return r}));
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class r{}r.DistinctSigns="Distinct signs.",r.WrongArgNumber="Wrong number of arguments.",r.EmptyArg="Empty function argument.",r.EmptyArray="Empty array not allowed.",r.ArrayDimensions="Array dimensions are not compatible.",r.NoSpaceForArrayResult="No space for array result.",r.ValueSmall="Value too small.",r.ValueLarge="Value too large.",r.BadCriterion="Incorrect criterion.",r.RangeManySheets="Range spans more than one sheet.",r.CellRangeExpected="Cell range expected.",r.WrongDimension="Wrong range dimension.",r.ScalarExpected="Cell range not allowed.",r.NumberCoercion="Value cannot be coerced to number.",r.NumberExpected="Number argument expected.",r.IntegerExpected="Value needs to be an integer.",r.BadMode="Mode not recognized.",r.DateBounds="Date outside of bounds.",r.OutOfSheet="Resulting reference is out of the sheet.",r.WrongType="Wrong type of argument.",r.NaN="NaN or infinite value encountered.",r.EqualLength="Ranges need to be of equal length.",r.Negative="Value cannot be negative.",r.NotBinary="String does not represent a binary number.",r.NotOctal="String does not represent an octal number.",r.NotHex="String does not represent a hexadecimal number.",r.EndStartPeriod="End period needs to be at least start period.",r.CellRefExpected="Cell reference expected.",r.EmptyRange="Empty range not allowed.",r.BadRef="Address is not correct.",r.NumberRange="Number-only range expected.",r.ValueNotFound="Value not found.",r.ValueBaseLarge="Value in base too large.",r.ValueBaseSmall="Value in base too small.",r.ValueBaseLong="Value in base too long.",r.NegativeLength="Length cannot be negative.",r.PatternNotFound="Pattern not found.",r.OneValue="Needs at least one value.",r.TwoValues="Range needs to contain at least two elements.",r.ThreeValues="Range needs to contain at least three elements.",r.IndexBounds="Index out of bounds.",r.IndexLarge="Index too large.",r.Formula="Expected formula.",r.NegativeCount="Count cannot be negative.",r.ParseError="Parsing error.",r.SheetRef="Sheet does not exist.",r.PeriodLong="Period number cannot exceed life length.",r.InvalidDate="Invalid date.",r.BitshiftLong="Result of bitshift is too long.",r.EmptyString="Empty-string argument not allowed.",r.LengthBounds="Length out of bounds.",r.NegativeTime="Time cannot be negative.",r.NoDefault="No default option.",r.NoConditionMet="None of the conditions were met.",r.Selector="Selector cannot exceed the number of arguments.",r.StartEndDate="Start date needs to be earlier than end date.",r.IncorrectDateTime="String does not represent correct DateTime.",r.CharacterCodeBounds="Character code out of bounds.",r.NonZero="Argument cannot be 0.",r.LessThanOne="Argument cannot be less than 1.",r.WeekendString="Incorrect weekend bitmask string.",r.InvalidRoman="Invalid roman numeral.",r.WrongOrder="Wrong order of values.",r.ComplexNumberExpected="Complex number expected.",r.ShouldBeIorJ="Should be 'i' or 'j'.",r.SizeMismatch="Array dimensions mismatched.",r.FunctionName=e=>`Function name ${e} not recognized.`,r.NamedExpressionName=e=>`Named expression ${e} not recognized.`,r.LicenseKey=e=>`License key is ${e}.`},function(e,t,n){"use strict";var r=n(22),o=n(128).filter;r({target:"Array",proto:!0,forced:!n(181)("filter")},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.isNumeric=a,t.isNumericLike=function(e){return a(e,[","])},t.rangeEach=function(e,t,n){var r=-1;"function"==typeof t?(n=t,t=e):r=e-1;for(;++r<=t&&!1!==n(r););},t.rangeEachReverse=function(e,t,n){var r=e+1;"function"==typeof t&&(n=t,t=0);for(;--r>=t&&!1!==n(r););},t.valueAccordingPercent=function(e,t){return t=parseInt(t.toString().replace("%",""),10),t=isNaN(t)?0:t,parseInt(e*t/100,10)},n(50),n(85),n(57),n(47),n(5),n(4),n(1),n(52),n(6),n(20),n(148),n(95),n(149),n(78);var o=r(n(32)),i=r(n(14));function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,i.default)(e);if("number"===n)return!isNaN(e)&&isFinite(e);if("string"===n){if(0===e.length)return!1;if(1===e.length)return/\d/.test(e);var r=Array.from(new Set(["."].concat((0,o.default)(t)))).map((function(e){return"\\".concat(e)})).join("|");return new RegExp("^[+-]?\\s*(((".concat(r,")?\\d+((").concat(r,")\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$"),"i").test(e.trim())}return"object"===n&&!(!e||"number"!=typeof e.valueOf()||e instanceof Date)}},function(e,t,n){"use strict";var r=n(22),o=n(145),i=n(222),a=n(63),s=n(172),u=n(94),l=n(89),c=n(144),d=n(48),h=n(181),f=n(182),p=h("slice"),g=d("species"),m=Array,v=Math.max;r({target:"Array",proto:!0,forced:!p},{slice:function(e,t){var n,r,d,h=l(this),p=u(h),y=s(e,p),E=s(void 0===t?p:t,p);if(o(h)&&(n=h.constructor,(i(n)&&(n===m||o(n.prototype))||a(n)&&null===(n=n[g]))&&(n=void 0),n===m|Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const r=Symbol("Empty value");function o(e){return e instanceof i?e.val:e}class i{constructor(e,t){this.val=e,this.format=t}fromNumber(e){return new this.constructor(e)}}function a(e,t){if("number"==typeof e)return t;{const n=e.fromNumber(t);return n.format=e.format,n}}class s extends i{getDetailedType(){return f.NUMBER_DATE}}class u extends i{getDetailedType(){return f.NUMBER_CURRENCY}}class l extends i{getDetailedType(){return f.NUMBER_TIME}}class c extends i{getDetailedType(){return f.NUMBER_DATETIME}}class d extends i{getDetailedType(){return f.NUMBER_PERCENT}}function h(e){return"number"==typeof e||e instanceof i}var f;function p(e){return e instanceof i?e.getDetailedType():f.NUMBER_RAW}function g(e){return e instanceof i?e.format:void 0}function m(e){return e instanceof i?{type:e.getDetailedType(),format:e.format}:{type:f.NUMBER_RAW}}!function(e){e.NUMBER_RAW="NUMBER_RAW",e.NUMBER_DATE="NUMBER_DATE",e.NUMBER_TIME="NUMBER_TIME",e.NUMBER_DATETIME="NUMBER_DATETIME",e.NUMBER_CURRENCY="NUMBER_CURRENCY",e.NUMBER_PERCENT="NUMBER_PERCENT"}(f||(f={}))},function(e,t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},function(e,t,n){"use strict";n.r(t),n.d(t,"AbstractProduction",(function(){return s})),n.d(t,"NonTerminal",(function(){return u})),n.d(t,"Rule",(function(){return l})),n.d(t,"Flat",(function(){return c})),n.d(t,"Option",(function(){return d})),n.d(t,"RepetitionMandatory",(function(){return h})),n.d(t,"RepetitionMandatoryWithSeparator",(function(){return f})),n.d(t,"Repetition",(function(){return p})),n.d(t,"RepetitionWithSeparator",(function(){return g})),n.d(t,"Alternation",(function(){return m})),n.d(t,"Terminal",(function(){return v})),n.d(t,"serializeGrammar",(function(){return y})),n.d(t,"serializeProduction",(function(){return E}));var r,o=n(38),i=n(88),a=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=function(){function e(e){this.definition=e}return e.prototype.accept=function(e){e.visit(this),Object(o.forEach)(this.definition,(function(t){t.accept(e)}))},e}(),u=function(e){function t(t){var n=e.call(this,[])||this;return n.idx=1,Object(o.assign)(n,Object(o.pick)(t,(function(e){return void 0!==e}))),n}return a(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(e){},enumerable:!0,configurable:!0}),t.prototype.accept=function(e){e.visit(this)},t}(s),l=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.orgText="",Object(o.assign)(n,Object(o.pick)(t,(function(e){return void 0!==e}))),n}return a(t,e),t}(s),c=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.ignoreAmbiguities=!1,Object(o.assign)(n,Object(o.pick)(t,(function(e){return void 0!==e}))),n}return a(t,e),t}(s),d=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(o.assign)(n,Object(o.pick)(t,(function(e){return void 0!==e}))),n}return a(t,e),t}(s),h=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(o.assign)(n,Object(o.pick)(t,(function(e){return void 0!==e}))),n}return a(t,e),t}(s),f=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(o.assign)(n,Object(o.pick)(t,(function(e){return void 0!==e}))),n}return a(t,e),t}(s),p=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(o.assign)(n,Object(o.pick)(t,(function(e){return void 0!==e}))),n}return a(t,e),t}(s),g=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(o.assign)(n,Object(o.pick)(t,(function(e){return void 0!==e}))),n}return a(t,e),t}(s),m=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,n.ignoreAmbiguities=!1,n.hasPredicates=!1,Object(o.assign)(n,Object(o.pick)(t,(function(e){return void 0!==e}))),n}return a(t,e),t}(s),v=function(){function e(e){this.idx=1,Object(o.assign)(this,Object(o.pick)(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function y(e){return Object(o.map)(e,E)}function E(e){function t(e){return Object(o.map)(e,E)}if(e instanceof u)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof c)return{type:"Flat",definition:t(e.definition)};if(e instanceof d)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof h)return{type:"RepetitionMandatory",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof f)return{type:"RepetitionMandatoryWithSeparator",name:e.name,idx:Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class s{constructor(e,t,n,o){this._data=e,this.range=t,this.dependencyGraph=n,this._hasOnlyNumbers=o,this.size=void 0===e?new r.ArraySize(t.effectiveWidth(n),t.effectiveHeight(n)):new r.ArraySize(e[0].length,e.length)}get data(){return this.ensureThatComputed(),this._data}static fromRange(e,t,n){return new s(e,t,n,!0)}static onlyNumbers(e){return new s(e,void 0,void 0,!0)}static onlyValues(e){return new s(e,void 0,void 0,void 0)}static onlyRange(e,t){return new s(void 0,e,t,void 0)}static fromScalar(e){return new s([[e]],void 0,void 0,void 0)}isAdHoc(){return void 0===this.range}width(){return this.size.width}height(){return this.size.height}valuesFromTopLeftCorner(){this.ensureThatComputed();const e=[];for(let t=0;t<this._data.length;t++)for(let n=0;n<this._data[0].length;n++)e.push(this._data[t][n]);return e}*effectiveAddressesFromData(e){for(let t=0;t<this.data.length;++t){const n=this.data[t];for(let r=0;r<n.length;++r)yield Object(o.simpleCellAddress)(e.sheet,e.col+r,e.row+t)}}*entriesFromTopLeftCorner(e){this.ensureThatComputed();for(let t=0;t<this.size.height;++t)for(let n=0;n<this.size.width;++n)yield[this._data[t][n],Object(o.simpleCellAddress)(e.sheet,e.col+n,e.row+t)]}*iterateValuesFromTopLeftCorner(){yield*this.valuesFromTopLeftCorner()}numberOfElements(){return this.size.width*this.size.height}hasOnlyNumbers(){if(void 0===this._hasOnlyNumbers){this._hasOnlyNumbers=!0;for(const e of this.data)for(const t of e)if("number"!=typeof t)return this._hasOnlyNumbers=!1,!1}return this._hasOnlyNumbers}rawNumbers(){return this._data}rawData(){var e;return this.ensureThatComputed(),null!==(e=this._data)&&void 0!==e?e:[]}sameDimensionsAs(e){return this.width()===e.width()&&this.height()===e.height()}ensureThatComputed(){void 0===this._data&&(this._hasOnlyNumbers=!0,this._data=this.range.addressesArrayMap(this.dependencyGraph,e=>{const t=this.dependencyGraph.getCellValue(e);return t instanceof s?(this._hasOnlyNumbers=!1,new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.ScalarExpected)):(Object(a.isExtendedNumber)(t)||(this._hasOnlyNumbers=!1),t)}))}}},function(e,t,n){n(22)({target:"Number",stat:!0},{isInteger:n(718)})},function(e,t,n){"use strict";var r=n(22),o=n(114),i=n(55),a=n(44),s=n(415),u=n(30),l=n(217),c=n(54),d=n(280),h=n(115),f=n(170),p=n(388),g=n(28),m=n(143).f,v=n(117).f,y=n(84).f,E=n(416),T=n(417).trim,C=a.Number,R=s.Number,w=C.prototype,S=a.TypeError,O=u("".slice),b=u("".charCodeAt),A=function(e){var t=p(e,"number");return"bigint"==typeof t?t:N(t)},N=function(e){var t,n,r,o,i,a,s,u,l=p(e,"number");if(f(l))throw S("Cannot convert a Symbol value to a number");if("string"==typeof l&&l.length>2)if(l=T(l),43===(t=b(l,0))||45===t){if(88===(n=b(l,2))||120===n)return NaN}else if(48===t){switch(b(l,1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+l}for(a=(i=O(l,2)).length,s=0;s<a;s++)if((u=b(i,s))<48||u>o)return NaN;return parseInt(i,r)}return+l},M=l("Number",!C(" 0o1")||!C("0b1")||C("+0x1")),I=function(e){return h(w,e)&&g((function(){E(e)}))},_=function(e){var t=arguments.length<1?0:C(A(e));return I(this)?d(Object(t),this,_):t};_.prototype=w,M&&!o&&(w.constructor=_),r({global:!0,constructor:!0,wrap:!0,forced:M},{Number:_});var k=function(e,t){for(var n,r=i?m(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;r.length>o;o++)c(t,n=r[o])&&!c(e,n)&&y(e,n,v(t,n))};o&&R&&k(s.Number,R),(M||o)&&k(s.Number,C)},function(e,t,n){"use strict";t.__esModule=!0,t.isImmediatePropagationStopped=function(e){return!1===e.isImmediatePropagationEnabled},t.isLeftClick=function(e){return 0===e.button},t.isRightClick=function(e){return 2===e.button},t.stopImmediatePropagation=function(e){e.isImmediatePropagationEnabled=!1,e.cancelBubble=!0}},function(e,t,n){var r=n(749),o=n(567);e.exports=function(e,t){var n=o(e,t,"get");return r(e,n)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(750),o=n(567);e.exports=function(e,t,n){var i=o(e,t,"set");return r(e,i,n),n},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n(1),n(21),n(42),t.__esModule=!0;var r={IndexMapper:!0,getRegisteredMapsCounter:!0,getIncreasedIndexes:!0,getDecreasedIndexes:!0,alterUtilsFactory:!0};t.getRegisteredMapsCounter=t.getIncreasedIndexes=t.getDecreasedIndexes=t.alterUtilsFactory=t.IndexMapper=void 0;var o=n(798);t.IndexMapper=o.IndexMapper;var i=n(299);t.getRegisteredMapsCounter=i.getRegisteredMapsCounter;var a=n(586);t.getIncreasedIndexes=a.getIncreasedIndexes,t.getDecreasedIndexes=a.getDecreasedIndexes,t.alterUtilsFactory=a.alterUtilsFactory;var s=n(584);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===s[e]||(t[e]=s[e]))}))},function(e,t,n){var r=n(22),o=n(55),i=n(395),a=n(89),s=n(117),u=n(144);r({target:"Object",stat:!0,sham:!o},{getOwnPropertyDLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const s="AbsoluteCellRange: Wrong range size";function u(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&("start"in e&&Object(r.isSimpleCellAddress)(e.start)&&"end"in e&&Object(r.isSimpleCellAddress)(e.end))}const l=(e,t)=>({start:e,end:t});class c{constructor(e,t){if(e.sheet!==t.sheet)throw new o.SheetsNotEqual(e.sheet,t.sheet);this.start=Object(r.simpleCellAddress)(e.sheet,e.col,e.row),this.end=Object(r.simpleCellAddress)(t.sheet,t.col,t.row)}get sheet(){return this.start.sheet}static fromSimpleCellAddresses(e,t){if(e.sheet!==t.sheet)throw new o.SheetsNotEqual(e.sheet,t.sheet);const n=t.col-e.col,r=t.row-e.row;return Number.isFinite(r)&&Number.isFinite(n)?new c(e,t):Number.isFinite(r)?new h(e.sheet,e.row,t.row):new d(e.sheet,e.col,t.col)}static fromAst(e,t){return e.type===i.AstNodeType.CELL_RANGE?c.fromCellRange(e,t):e.type===i.AstNodeType.COLUMN_RANGE?d.fromColumnRange(e,t):h.fromRowRangeAst(e,t)}static fromAstOrUndef(e,t){try{return c.fromAst(e,t)}catch(e){return}}static fromCellRange(e,t){return new c(e.start.toSimpleCellAddress(t),e.end.toSimpleCellAddress(t))}static spanFrom(e,t,n){const r=c.spanFromOrUndef(e,t,n);if(void 0===r)throw new Error(s);return r}static spanFromOrUndef(e,t,n){if(!Number.isFinite(t)&&Number.isFinite(n)){if(0!==e.col)return;return new h(e.sheet,e.row,e.row+n-1)}if(!Number.isFinite(n)&&Number.isFinite(t)){if(0!==e.row)return;return new d(e.sheet,e.col,e.col+t-1)}if(Number.isFinite(n)&&Number.isFinite(t))return new c(e,Object(r.simpleCellAddress)(e.sheet,e.col+t-1,e.row+n-1))}static fromCoordinates(e,t,n,o,i){return new c(Object(r.simpleCellAddress)(e,t,n),Object(r.simpleCellAddress)(e,o,i))}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),n=Math.min(this.end.row,e.end.row),o=Math.max(this.start.col,e.start.col),i=Math.min(this.end.col,e.end.col);return t>n||o>i?void 0:new c(Object(r.simpleCellAddress)(this.sheet,o,t),Object(r.simpleCellAddress)(this.sheet,i,n))}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 c.spanFrom(Object(r.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 c.spanFrom(Object(r.simpleCellAddress)(this.sheet,this.start.col,e),this.width(),t)}rangeWithSameHeight(e,t){return c.spanFrom(Object(r.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 n=0;n<this.width();++n){const o=Object(r.simpleCellAddress)(this.sheet,this.start.col+n,this.start.row+t);e[t].push(o)}}return e}withStart(e){return new c(e,this.end)}sameDimensionsAs(e){return this.width()===e.width()&&this.height()===e.height()}sameAs(e){return Object(r.equalSimpleCellAddress)(this.start,e.start)&&Object(r.equalSimpleCellAddress)(this.end,e.end)}addressesArrayMap(e,t){const n=[];let o=this.start.row;for(;o<=this.effectiveEndRow(e);){let i=this.start.col;const a=[];for(;i<=this.effectiveEndColumn(e);)a.push(t(Object(r.simpleCellAddress)(this.start.sheet,i,o))),i++;n.push(a),o++}return n}addresses(e){const t=[];let n=this.start.row;const o=this.effectiveEndRow(e),i=this.effectiveEndColumn(e);for(;n<=o;){let e=this.start.col;for(;e<=i;)t.push(Object(r.simpleCellAddress)(this.start.sheet,e,n)),e++;n++}return t}*addressesWithDirection(e,t,n){if(e>0)if(t>0){let e=this.effectiveEndRow(n);for(;e>=this.start.row;){let t=this.effectiveEndColumn(n);for(;t>=this.start.col;)yield Object(r.simpleCellAddress)(this.start.sheet,t,e),t-=1;e-=1}}else{let e=this.start.row;for(;e<=this.effectiveEndRow(n);){let t=this.effectiveEndColumn(n);for(;t>=this.start.col;)yield Object(r.simpleCellAddress)(thiLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const l=new RegExp(`^(${s.SHEET_NAME_PATTERN})?(\\${s.ABSOLUTE_OPERATOR}?)([A-Za-z]+)(\\${s.ABSOLUTE_OPERATOR}?)([0-9]+)$`),c=new RegExp(`^(${s.SHEET_NAME_PATTERN})?(\\${s.ABSOLUTE_OPERATOR}?)([A-Za-z]+)$`),d=new RegExp(`^(${s.SHEET_NAME_PATTERN})?(\\${s.ABSOLUTE_OPERATOR}?)([0-9]+)$`),h=new RegExp(`^${s.UNQUOTED_SHEET_NAME_PATTERN}$`),f=(e,t,n)=>{const r=l.exec(t),o=T(r[6]);let a=w(r,e);if(void 0===a)return;null===a&&(a=void 0);const u=Number(r[8])-1;return r[5]===s.ABSOLUTE_OPERATOR&&r[7]===s.ABSOLUTE_OPERATOR?i.CellAddress.absolute(o,u,a):r[5]===s.ABSOLUTE_OPERATOR?i.CellAddress.absoluteCol(o,u-n.row,a):r[7]===s.ABSOLUTE_OPERATOR?i.CellAddress.absoluteRow(o-n.col,u,a):i.CellAddress.relative(o-n.col,u-n.row,a)},p=(e,t,n)=>{const r=c.exec(t);let o=w(r,e);if(void 0===o)return;null===o&&(o=void 0);const i=T(r[6]);return r[5]===s.ABSOLUTE_OPERATOR?a.ColumnAddress.absolute(i,o):a.ColumnAddress.relative(i-n.col,o)},g=(e,t,n)=>{const r=d.exec(t);let o=w(r,e);if(void 0===o)return;null===o&&(o=void 0);const i=Number(r[6])-1;return r[5]===s.ABSOLUTE_OPERATOR?u.RowAddress.absolute(i,o):u.RowAddress.relative(i-n.row,o)},m=(e,t,n)=>{const r=l.exec(t),i=T(r[6]);let a=w(r,e);if(void 0===a)return;null===a&&(a=n);const s=Number(r[8])-1;return Object(o.simpleCellAddress)(a,i,s)},v=(e,t,n)=>{const o=t.split(s.RANGE_OPERATOR);if(2!==o.length)return;const[i,a]=o,u=m(e,i,n);if(void 0===u)return;const l=m(e,a,u.sheet);return void 0!==l&&u.sheet===l.sheet?Object(r.simpleCellRange)(u,l):void 0},y=(e,t,n)=>{const r=C(t.col),o=R(t.sheet,e);if(void 0!==o)return n!==t.sheet?`${o}!${r}${t.row+1}`:`${r}${t.row+1}`},E=(e,t,n)=>{const r=y(e,t.start,n),o=y(e,t.end,t.start.sheet);return void 0===r||void 0===o?void 0:`${r}${s.RANGE_OPERATOR}${o}`};function T(e){return 1===e.length?e.toUpperCase().charCodeAt(0)-65:e.split("").reduce((e,t)=>26*e+(t.toUpperCase().charCodeAt(0)-64),0)-1}function C(e){let t="";for(;e>=0;)t=String.fromCharCode(e%26+97)+t,e=Math.floor(e/26)-1;return t.toUpperCase()}function R(e,t){let n=t(e);if(void 0!==n)return h.test(n)?n:(n=n.replace(/'/g,"''"),`'${n}'`)}function w(e,t){var n;let r=null!==(n=e[3])&&void 0!==n?n:e[2];return r?(r=r.replace(/''/g,"'"),t(r)):null}},function(e,t,n){"use strict";n.r(t),n.d(t,"tokenLabel",(function(){return a})),n.d(t,"tokenName",(function(){return s})),n.d(t,"hasTokenLabel",(function(){return u})),n.d(t,"createToken",(function(){return l})),n.d(t,"EOF",(function(){return c})),n.d(t,"createTokenInstance",(function(){return d})),n.d(t,"tokenMatcher",(function(){return h}));var r=n(38),o=n(137),i=n(157);function a(e){return u(e)?e.LABEL:e.name}function s(e){return e.name}function u(e){return Object(r.isString)(e.LABEL)&&""!==e.LABEL}function l(e){return function(e){var t=e.pattern,n={};n.name=e.name,Object(r.isUndefined)(t)||(n.PATTERN=t);if(Object(r.has)(e,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";Object(r.has)(e,"categories")&&(n.CATEGORIES=e.categories);Object(i.augmentTokenTypes)([n]),Object(r.has)(e,"label")&&(n.LABEL=e.label);Object(r.has)(e,"group")&&(n.GROUP=e.group);Object(r.has)(e,"pop_mode")&&(n.POP_MODE=e.pop_mode);Object(r.has)(e,"push_mode")&&(n.PUSH_MODE=e.push_mode);Object(r.has)(e,"longer_alt")&&(n.LONGER_ALT=e.longer_alt);Object(r.has)(e,"line_breaks")&&(n.LINE_BREAKS=e.line_breaks);Object(r.has)(e,"start_chars_hint")&&(n.START_CHARS_HINT=e.start_chars_hint);return n}(e)}var c=l({name:"EOF",pattern:o.Lexer.NA});function d(e,t,n,r,o,i,a,s){return{image:t,startOffset:n,endOffset:r,startLine:o,endLine:i,startColumn:a,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function h(e,t){return Object(i.tokenStructuredMatcher)(e,t)}Object(i.augmentTokenTypes)([c])},function(e,t,n){var r=n(166),o=n(82);e.exports=function(e){return r(o(e))}},function(e,t,n){"use strict";var r=n(22),o=n(30),i=n(125),a=n(83),s=n(94),u=n(413),l=n(56),c=n(28),d=n(713),h=n(146),f=n(714),p=n(715),g=n(169),m=n(716),v=[],y=o(v.sort),E=o(v.push),T=c((function(){v.sort(void 0)})),C=c((function(){v.sort(null)})),R=h("sort"),w=!c((function(){if(g)return g<70;if(!(f&&f>3)){if(p)return!0;if(m)return m<603;var e,t,n,r,o="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)v.push({k:t+r,v:n})}for(v.sort((function(e,t){return t.v-e.v})),r=0;r<v.length;r++)t=v[r].k.charAt(0),o.charAt(o.length-1)!==t&&(o+=t);return"DGBEFHACIJK"!==o}}));r({target:"Array",proto:!0,forced:T||!C||!R||!w},{sort:function(e){void 0!==e&&i(e);var t=a(this);if(w)return void 0===e?y(t):y(t,e);var n,r,o=[],c=s(t);for(r=0;r<c;r++)r in t&&E(o,t[r]);for(d(o,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:l(t)>l(n)?1:-1}}(e)),n=s(o),r=0;r<n;)t[r]=o[r++];for(;r<c;)u(t,r++);return t}})},function(e,t,n){"use strict";t.__esModule=!0,t.isChrome=function(){return i.chrome.value},t.isChromeWebKit=function(Line truncated
|
||||
//! moment.js
|
||||
o.version="2.29.4",t=bt,o.fn=vn,o.min=function(){var e=[].slice.call(arguments,0);return Mt("isBefore",e)},o.max=function(){var e=[].slice.call(arguments,0);return Mt("isAfter",e)},o.now=function(){return Date.now?Date.now():+new Date},o.utc=p,o.unix=function(e){return bt(1e3*e)},o.months=function(e,t){return Cn(e,t,"months")},o.isDate=d,o.locale=at,o.invalid=v,o.duration=Bt,o.isMoment=R,o.weekdays=function(e,t,n){return Rn(e,t,n,"weekdays")},o.parseZone=function(){return bt.apply(null,arguments).parseZone()},o.localeData=ut,o.isDuration=kt,o.monthsShort=function(e,t){return Cn(e,t,"monthsShort")},o.weekdaysMin=function(e,t,n){return Rn(e,t,n,"weekdaysMin")},o.defineLocale=st,o.updateLocale=function(e,t){if(null!=t){var n,r,o=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(M(tt[e]._config,t)):(null!=(r=it(e))&&(o=r._config),t=M(o,t),null==r&&(t.abbr=e),(n=new I(t)).parentLocale=tt[e],tt[e]=n),at(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===at()&&at(e)):null!=tt[e]&&delete tt[e]);return tt[e]},o.locales=function(){return O(tt)},o.weekdaysShort=function(e,t,n){return Rn(e,t,n,"weekdaysShort")},o.normalizeUnits=j,o.relativeTimeRounding=function(e){return void 0===e?zn:"function"==typeof e&&(zn=e,!0)},o.relativeTimeThreshold=function(e,t){return void 0!==Kn[e]&&(void 0===t?Kn[e]:(Kn[e]=t,"s"===e&&(Kn.ss=t-1),!0))},o.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},o.prototype=vn,o.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},o}(),window.moment=n(92)}).call(this,n(740)(e))},function(e,t,n){"use strict";n.r(t),n.d(t,"parsingError",(function(){return o})),n.d(t,"ParsingErrorType",(function(){return i})),n.d(t,"AstNodeType",(function(){return a})),n.d(t,"RangeSheetReferenceType",(function(){return s})),n.d(t,"buildEmptyArgAst",(function(){return u})),n.d(t,"buildNumberAst",(function(){return l})),n.d(t,"buildStringAst",(function(){return c})),n.d(t,"buildCellReferenceAst",(function(){return d})),n.d(t,"buildCellRangeAst",(function(){return h})),n.d(t,"buildColumnRangeAst",(function(){return f})),n.d(t,"buildRowRangeAst",(function(){return p})),n.d(t,"buildConcatenateOpAst",(function(){return g})),n.d(t,"buildEqualsOpAst",(function(){return m})),n.d(t,"buildNotEqualOpAst",(function(){return v})),n.d(t,"buildGreaterThanOpAst",(function(){return y})),n.d(t,"buildLessThanOpAst",(function(){return E})),n.d(t,"buildGreaterThanOrEqualOpAst",(function(){return T})),n.d(t,"buildLessThanOrEqualOpAst",(function(){return C})),n.d(t,"buildPlusOpAst",(function(){return R})),n.d(t,"buildMinusOpAst",(function(){return w})),n.d(t,"buildTimesOpAst",(function(){return S})),n.d(t,"buildDivOpAst",(function(){return O})),n.d(t,"buildPowerOpAst",(function(){return b})),n.d(t,"buildMinusUnaryOpAst",(function(){return A})),n.d(t,"buildPlusUnaryOpAst",(function(){return N})),n.d(t,"buildPercentOpAst",(function(){return M})),n.d(t,"buildProcedureAst",(function(){return I})),n.d(t,"buildArrayAst",(function(){return _})),n.d(t,"buildNamedExpressionAst",(function(){return k})),n.d(t,"buildParenthesisAst",(function(){return x})),n.d(t,"buildCellErrorAst",(function(){return P})),n.d(t,"buildErrorWithRawInputAst",(function(){return L})),n.d(t,"buildParsingErrorAst",(function(){return D})),n.d(t,"imageWithWhitespace",(function(){return U}));var r=n(17);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/const o=(e,t)=>({type:e,message:t});var i,a,s;!function(e){e.LexingError="LexingError",e.ParserError="ParsingError",e.StaticOffsetError="StaticOffsetError",e.StaticOffsetOutOfRangeError="StaticOffsetOutOfRangeError",e.RangeOffsetNotAllowed="RangeOffsetNotAllowed"}(i||(i={})),function(e){e.EMPTY="EMPTY",e.NUMBER="NUMBER",e.STRING="STRING",e.MINUS_UNARY_OP="MINUS_UNARY_OP",e.PLUS_UNARY_OP="PLUS_UNARY_OP",e.PERCENT_OP="PERCENT_OP",e.CONCATENATE_OP="CONCATENATE_OP",e.EQUALS_OP="EQUALS_OP",e.NOT_EQUAL_OP="NOT_EQUAL_OP",e.GREATER_THAN_OP="GREATER_THAN_OP",e.LESS_THAN_OP="LESS_THAN_OP",e.GREATER_THAN_OR_EQUAL_OP="GREATER_THAN_OR_EQUAL_OP",e.LESS_THAN_OR_EQUAL_OP="LESS_THAN_OR_EQUAL_OP",e.PLUS_OP="PLUS_OP",e.MINUS_OP="MINUS_OP",e.TIMES_OP="TIMES_OP",e.DIV_OP="DIV_OP",e.POWER_OP="POWER_OP",e.FUNCTION_CALL="FUNCTION_CALL",e.NAMED_EXPRESSION="NAMED_EXPRESSION",e.PARENTHESIS="PARENTHESES",e.CELL_REFERENCE="CELL_REFERENCE",e.CELL_RANGE="CELL_RANGE",e.COLUMN_RANGE="COLUMN_RANGE",e.ROW_RANGE="ROW_RANGE",e.ERROR="ERROR",e.ERROR_WITH_RAW_INPUT="ERROR_WITH_RAW_INPUT",e.ARRAY="ARRAY"}(a||(a={})),function(e){e[e.RELATIVE=0]="RELATIVE",e[e.START_ABSOLUTE=1]="START_ABSOLUTE",e[e.BOTH_ABSOLUTE=2]="BOTH_ABSOLUTE"}(s||(s={}));const u=e=>({type:a.EMPTY,leadingWhitespace:null==e?void 0:e.image}),l=(e,t)=>({type:a.NUMBER,value:e,leadingWhitespace:null==t?void 0:t.image}),c=e=>{var t;return{type:a.STRING,value:e.image.slice(1,-1),leadingWhitespace:null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image}},d=(e,t)=>({type:a.CELL_REFERENCE,reference:e,leadingWhitespace:null==t?void 0:t.image}),h=(e,t,n,r)=>(F(e,t,n),{type:a.CELL_RANGE,start:e,end:t,sheetReferenceType:n,leadingWhitespace:r}),f=(e,t,n,r)=>(F(e,t,n),{type:a.COLUMN_RANGE,start:e,end:t,sheetReferenceType:n,leadingWhitespace:null==r?void 0:r.image}),p=(e,t,n,r)=>(F(e,t,n),{type:a.ROW_RANGE,start:e,end:t,sheetReferenceType:n,leadingWhitespace:null==r?void 0:r.image}),g=(e,t,n)=>({type:a.CONCATENATE_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),m=(e,t,n)=>({type:a.EQUALS_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),v=(e,t,n)=>({type:a.NOT_EQUAL_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),y=(e,t,n)=>({type:a.GREATER_THAN_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),E=(e,t,n)=>({type:a.LESS_THAN_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),T=(e,t,n)=>({type:a.GREATER_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),C=(e,t,n)=>({type:a.LESS_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),R=(e,t,n)=>({type:a.PLUS_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),w=(e,t,n)=>({type:a.MINUS_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),S=(e,t,n)=>({type:a.TIMES_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),O=(e,t,n)=>({type:a.DIV_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),b=(e,t,n)=>({type:a.POWER_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}),A=(e,t)=>({type:a.MINUS_UNARY_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),N=(e,t)=>({type:a.PLUS_UNARY_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),M=(e,t)=>({type:a.PERCENT_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),I=(e,t,n,r,o)=>({type:a.FUNCTION_CALL,procedureName:e,args:t,leadingWhitespace:null==n?void 0:n.image,internalWhitespace:null==r?void 0:r.image,hyperlink:o}),_=(e,t,n)=>({type:a.ARRAY,args:e,leadingWhitespace:null==t?void 0:t.image,internalWhitespace:null==n?void 0:n.image}),k=(e,t)=>({type:a.NAMED_EXPRESSION,expressionName:e,leadingWhitespace:null==t?void 0:t.image}),x=(e,t,n)=>({type:a.PARENTHESIS,expression:e,leadingWhitespace:null==t?void 0:t.image,internalWhitespace:null==n?void 0:n.image}),P=(e,t)=>({type:a.ERROR,error:e,leadingWhitespace:null==t?void 0:t.image}),L=(e,t,n)=>({type:a.ERROR_WITH_RAW_INPUT,error:t,rawInput:e,leadingWhitespace:null==n?void 0:n.image}),D=()=>({type:a.ERROR,error:r.CellError.parsingError()});function F(e,t,n){if(void 0!==e.sheet&&void 0===t.sheet||void 0===e.sheet&&void 0!==t.sheet)throw new Error("Start address inconsistent with end address");if(void 0===e.sheet&&n!==s.RELATIVE||void 0!==e.sheet&&n===s.RELATIVE)throw new Error("Sheet address inconsistent with sheet reference type")}function U(e,t){return(null!=t?t:"")+e}},function(e,t,n){var r=n(126);e.exports=function(e){return r(e.length)}},function(e,t,n){"use strict";var r=n(176).PROPER,o=n(98),i=n(62),a=n(56),s=n(28),u=n(426),l=RegExp.prototype.toString,c=s((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),d=r&&"toString"!=l.name;(c||d)&&o(RegExp.prototype,"toString",(function(){var e=i(this);return"/"+a(e.source)+"/"+a(u(e))}),{unsafe:!0})},function(e,t,n){"use strict";t.__esModule=!0,t.align=function(e,t,n,o,i){(0,r.arrayEach)(e,(function(e){e.forAll((function(e,r){e>=0&&r>=0&&function(e,t,n,r,o,i){var u=o(e,t),l=r;u.className&&(l="vertical"===n?a(u.className,r):s(u.className,r));i(e,t,"classNameLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class s{constructor(e,t,n=!1){if(this.width=e,this.height=t,this.isRef=n,e<=0||t<=0)throw Error("Incorrect array size")}static fromArray(e){return new s(e.length>0?e[0].length:0,e.length)}static error(){return new s(1,1,!0)}static scalar(){return new s(1,1,!1)}isScalar(){return this.width<=1&&this.height<=1||this.isRef}}class u{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 n=r.AbsoluteCellRange.fromAstOrUndef(e,t.formulaAddress);return void 0===n?s.error():new s(n.width(),n.height(),!0)}case a.AstNodeType.ARRAY:{const n=[],r=[];for(const o of e.args){const e=o.map(e=>this.checkArraySizeForAst(e,t)),i=Math.min(...e.map(e=>e.height)),a=e.reduce((e,t)=>e+t.width,0);n.push(i),r.push(a)}const o=n.reduce((e,t)=>e+t,0),i=Math.min(...r);return new s(i,o)}case a.AstNodeType.STRING:case a.AstNodeType.NUMBER:return s.scalar();case a.AstNodeType.CELL_REFERENCE:return new s(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 n=this.checkArraySizeForAst(e.left,t),r=this.checkArraySizeForAst(e.right,t);return!t.arraysFlag&&(n.height>1||n.width>1||r.height>1||r.width>1)?s.error():(o=n,i=r,new s(Math.max(o.width,i.width),Math.max(o.height,i.height)))}case a.AstNodeType.MINUS_UNARY_OP:case a.AstNodeType.PLUS_UNARY_OP:case a.AstNodeType.PERCENT_OP:{const r=this.checkArraySizeForAst(e.value,t);return!t.arraysFlag&&(r.height>1||r.width>1)?s.error():new s((n=r).width,n.height)}case a.AstNodeType.PARENTHESIS:return this.checkArraySizeForAst(e.expression,t);case a.AstNodeType.EMPTY:default:return s.error()}var n,o,i}checkArraySizeForFunction(e,t){const n=this.functionRegistry.getMetadata(e.procedureName),r=this.functionRegistry.getArraySizeFunction(e.procedureName);if(void 0!==r)return r(e,t);const a=e.args.map(e=>{var r;return this.checkArraySizeForAst(e,new o.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))});if(void 0===n||n.expandRanges||!t.arraysFlag||n.vectorizationForbidden||void 0===n.parameters)return new s(1,1);const u=[...n.parameters];if(void 0===n.repeatLastArgs&&u.length<a.length)return s.error();if(void 0!==n.repeatLastArgs&&u.length<a.length&&(a.length-u.length)%n.repeatLastArgs!=0)return s.error();for(;u.length<a.length;)u.push(...u.slice(u.length-n.repeatLastArgs));let l=1,c=1;for(let e=0;e<a.length;e++)u[e].argumentType!==i.FunctionArgumentType.RANGE&&u[e].argumentType!==i.FunctionArgumentType.ANY&&(c=Math.max(c,a[e].height),l=Math.max(l,a[e].width));return new s(l,c)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"isRecognitionException",(function(){return i})),n.d(t,"MismatchedTokenException",(function(){return a})),n.d(t,"NoViableAltException",(function(){return s})),n.d(t,"NotAllInputParsedException",(function(){return u})),n.d(t,"EarlyExitException",(function(){return l}));var r=n(38),o=["MismatchedTokenException","NoViableAltException","EarlyExitException","NotAllInputParsedException"];function i(e){return Object(r.contains)(o,e.name)}function a(e,t,n){this.name="MismatchedTokenException",this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}function s(e,t,n){this.name="NoViableAltException",this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}function u(e,t){this.name="NotAllInputParsedException",this.message=e,this.token=t,this.resyncedTokens=[]}function l(e,t,n){this.name="EarlyExitException",this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}Object.freeze(o),a.prototype=Error.prototype,s.prototype=Error.prototype,u.prototype=Error.prototype,l.prototype=Error.prototype},function(e,t,n){"use strict";n.r(t),n.d(t,"ArithmeticHelper",(function(){return d})),n.d(t,"coerceComplexToString",(function(){return h})),n.d(t,"coerceToRange",(function(){return f})),n.d(t,"coerceToRangeNumbersOrError",(function(){return p})),n.d(t,"coerceBooleanToNumber",(function(){return g})),n.d(t,"coerceEmptyToValue",(function(){return m})),n.d(t,"coerceScalarToBoolean",(function(){return v})),n.d(t,"coerceScalarToString",(function(){return y})),n.d(t,"zeroIfEmpty",(function(){return E})),n.d(t,"numberCmp",(function(){return T})),n.d(t,"isNumberOverflow",(function(){return C})),n.d(t,"fixNegativeZero",(function(){return R})),n.d(t,"forceNormalizeString",(function(){return N})),n.d(t,"coerceRangeToScalar",(function(){return M})),n.d(t,"normalizLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const c=/^\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij]))\s*(([+-])\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij])))?$/;class d{constructor(e,t,n){this.config=e,this.dateTimeHelper=t,this.numberLiteralsHelper=n,this.lt=(e,t)=>this.compare(e,t)<0,this.leq=(e,t)=>this.compare(e,t)<=0,this.gt=(e,t)=>this.compare(e,t)>0,this.geq=(e,t)=>this.compare(e,t)>=0,this.eq=(e,t)=>0===this.compare(e,t),this.neq=(e,t)=>0!==this.compare(e,t),this.pow=(e,t)=>Math.pow(Object(u.getRawValue)(e),Object(u.getRawValue)(t)),this.addWithEpsilonRaw=(e,t)=>{const n=e+t;return Math.abs(n)<this.actualEps*Math.abs(e)?0:n},this.addWithEpsilon=(e,t)=>{const n=b(e,t);return this.ExtendedNumberFactory(this.addWithEpsilonRaw(Object(u.getRawValue)(e),Object(u.getRawValue)(t)),n)},this.unaryMinus=e=>Object(u.cloneNumber)(e,-Object(u.getRawValue)(e)),this.unaryPlus=e=>e,this.unaryPercent=e=>new u.PercentNumber(Object(u.getRawValue)(e)/100),this.concat=(e,t)=>e.concat(t),this.nonstrictadd=(e,t)=>e instanceof i.CellError?e:t instanceof i.CellError?t:"number"==typeof e?"number"==typeof t?this.addWithEpsilonRaw(e,t):e:"number"==typeof t?t:0,this.subtract=(e,t)=>{const n=b(e,t),r=Object(u.getRawValue)(e);let o=r-Object(u.getRawValue)(t);return Math.abs(o)<this.actualEps*Math.abs(r)&&(o=0),this.ExtendedNumberFactory(o,n)},this.divide=(e,t)=>{const n=Object(u.getRawValue)(e),r=Object(u.getRawValue)(t);if(0===r)return new i.CellError(i.ErrorType.DIV_BY_ZERO);{const o=A(e,t);return this.ExtendedNumberFactory(n/r,o)}},this.multiply=(e,t)=>{const n=A(e,t);return this.ExtendedNumberFactory(Object(u.getRawValue)(e)*Object(u.getRawValue)(t),n)},this.manyToExactComplex=e=>{const t=[];for(const n of e){if(n instanceof i.CellError)return n;if(Object(u.isExtendedNumber)(n)||"string"==typeof n){const e=this.coerceScalarToComplex(n);e instanceof i.CellError||t.push(e)}}return t},this.coerceNumbersExactRanges=e=>this.manyToNumbers(e,this.manyToExactNumbers),this.coerceNumbersCoerceRangesDropNulls=e=>this.manyToNumbers(e,this.manyToCoercedNumbersDropNulls),this.manyToExactNumbers=e=>{const t=[];for(const n of e){if(n instanceof i.CellError)return n;Object(u.isExtendedNumber)(n)&&t.push(Object(u.getRawValue)(n))}return t},this.manyToOnlyNumbersDropNulls=e=>{const t=[];for(const n of e){if(n instanceof i.CellError)return n;if(Object(u.isExtendedNumber)(n))t.push(Object(u.getRawValue)(n));else if(n!==u.EmptyValue)return new i.CellError(i.ErrorType.VALUE,a.ErrorMessage.NumberExpected)}return t},this.manyToCoercedNumbersDropNulls=e=>{const t=[];for(const n of e){if(n instanceof i.CellError)return n;if(n===u.EmptyValue)continue;const e=this.coerceScalarToNumberOrError(n);Object(u.isExtendedNumber)(e)&&t.push(Object(u.getRawValue)(e))}return t},this.collator=Object(s.collatorFromConfig)(e),this.actualEps=e.smartRounding?e.precisionEpsilon:0}eqMatcherFunction(e){const t=this.buildRegex(e);return e=>"string"==typeof e&&t.test(this.normalizeString(e))}neqMatcherFunction(e){const t=this.buildRegex(e);return e=>!("string"==typeof e&&t.test(this.normalizeString(e)))}searchString(e,t){var n;const r=this.buildRegex(e,!1).exec(t);return null!==(n=null==r?void 0:r.index)&&void 0!==n?n:-1}requiresRegex(e){if(!this.config.useRegularExpressions&&!this.config.useWildcards)return!this.config.matchWholeCell;for(let t=0;t<e.length;t++){const n=e.charAt(t);if(w(n)||this.config.useRegularExpressions&&O(n))return!0}return!1}floatCmp(e,t){const n=Object(u.getRawValue)(e),r=Object(u.getRawValue)(t),o=1+this.actualEps;return r>=0&&n*o>=r&&n<=r*o||r<=0&&n*o<=r&&n>=r*o?0:n>r?1:-1}coerceScalarToNumberOrError(e){var t;return e instanceof i.CellError?e:null!==(t=this.coerceToMaybeNumber(e))&&void 0!==t?t:new i.CellError(i.ErrorType.VALUE,a.ErrorMessage.NumberCoercion)}coerceToMaybeNumber(e){var t;return null!==(t=this.coerceNonDateScalarToMaybeNumber(e))&&void 0!==t?t:"string"==typeof e?this.dateTimeHelper.dateStringToDateNumber(e):void 0}coerceNonDateScalarToMaybeNumber(e){if(e===u.EmptyValue)return 0;if("string"==typeof e){if(""===e)return 0;const t=this.coerceStringToMaybePercentNumber(e);if(void 0!==t)return t;const n=this.coerceStringToMaybeCurrencyNumber(e);return void 0!==n?n:this.numberLiteralsHelper.numericStringToMaybeNumber(e.trim())}return Object(u.isExtendedNumber)(e)?e:"boolean"==typeof e?Number(e):void 0}coerceStringToMaybePercentNumber(e){const t=e.trim();if(t.endsWith("%")){const e=t.slice(0,t.length-1).trim(),n=this.numberLiteralsHelper.numericStringToMaybeNumber(e);if(void 0!==n)return new u.PercentNumber(n/100)}}coerceStringToMaybeCurrencyNumber(e){const t=this.currencyMatcher(e.trim());if(void 0!==t){const[e,n]=t,r=this.numberLiteralsHelper.numericStringToMaybeNumber(n);if(void 0!==r)return new u.CurrencyNumber(r,e)}}currencyMatcher(e){for(const t of this.config.currencySymbol){if(e.startsWith(t))return[t,e.slice(t.length).trim()];if(e.endsWith(t))return[t,e.slice(0,e.length-t.length).trim()]}}coerceComplexExactRanges(e){const t=[];for(const n of e)if(n instanceof lLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class c{constructor(e,t,n){this.formula=e,this.cellAddress=t,this.version=n}get width(){return 1}get height(){return 1}static fromAst(e,t,n,r){return n.isScalar()?new h(e,t,r):new d(e,t,n,r)}getFormula(e){return this.ensureRecentData(e),this.formula}ensureRecentData(e){if(this.version!=e.version()){const[t,n,r]=e.applyTransformations(this.formula,this.cellAddress,this.version);this.formula=t,this.cellAddress=n,this.version=r}}getAddress(e){return this.ensureRecentData(e),this.cellAddress}}class d extends c{constructor(e,t,n,r=0){super(e,t,r),n.isRef?this.array=new i.ErroredArray(new a.CellError(a.ErrorType.REF,s.ErrorMessage.NoSpaceForArrayResult),o.ArraySize.error()):this.array=new i.NotComputedArray(n)}get width(){return this.array.width()}get height(){return this.array.height()}get sheet(){return this.cellAddress.sheet}get leftCorner(){return this.cellAddress}setCellValue(e){if(e instanceof a.CellError)return this.setErrorValue(e),e;const t=i.ArrayValue.fromInterpreterValue(e);return t.resize(this.array.size),this.array=t,e}getCellValue(){if(this.array instanceof i.NotComputedArray)throw Error("Array not computed yet.");return this.array.simpleRangeValue()}valueOrUndef(){if(!(this.array instanceof i.NotComputedArray))return this.array.simpleRangeValue()}getArrayCellValue(e){const t=e.col-this.cellAddress.col,n=e.row-this.cellAddress.row;try{return this.array.get(t,n)}catch(e){return new a.CellError(a.ErrorType.REF)}}getArrayCellRawValue(e){const t=this.getArrayCellValue(e);return t instanceof a.CellError||t===u.EmptyValue?void 0:Object(u.getRawValue)(t)}setArrayCellValue(e,t){const n=e.col-this.cellAddress.col,r=e.row-this.cellAddress.row;this.array instanceof i.ArrayValue&&this.array.set(n,r,t)}setNoSpace(){return this.array=new i.ErroredArray(new a.CellError(a.ErrorType.SPILL,s.ErrorMessage.NoSpaceForArrayResult),o.ArraySize.error()),this.getCellValue()}getRange(){return r.AbsoluteCellRange.spanFrom(this.cellAddress,this.width,this.height)}getRangeOrUndef(){return r.AbsoluteCellRange.spanFromOrUndef(this.cellAddress,this.width,this.height)}setAddress(e){this.cellAddress=e}setFormula(e){this.formula=e}spansThroughSheetRows(e,t,n=t){return this.cellAddress.sheet===e&&this.cellAddress.row<=n&&t<this.cellAddress.row+this.height}spansThroughSheetColumn(e,t,n=t){return this.cellAddress.sheet===e&&this.cellAddress.col<=n&&t<this.cellAddress.col+this.width}isComputed(){return!(this.array instanceof i.NotComputedArray)}columnsFromArray(){return l.ColumnsSpan.fromNumberOfColumns(this.cellAddress.sheet,this.cellAddress.col,this.width)}rowsFromArray(){return l.RowsSpan.fromNumberOfRows(this.cellAddress.sheet,this.cellAddress.row,this.height)}ensureRecentData(e){}isLeftCorner(e){return Object(a.equalSimpleCellAddress)(this.cellAddress,e)}setErrorValue(e){this.array=new i.ErroredArray(e,this.array.size)}}class h extends c{constructor(e,t,n){super(e,t,n)}valueOrUndef(){return this.cachedCellValue}setCellValue(e){return this.cachedCellValue=e,this.cachedCellValue}getCellValue(){if(void 0!==this.cachedCellValue)return this.cachedCellValue;throw Error("Value of the formula cell is not computed.")}isComputed(){return void 0!==this.cachedCellValue}}},function(e,t,n){var r=n(44),o=n(49),i=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e]):r[e]&&r[e][t]}},function(e,t,n){var r,o,i,a=n(391),s=n(44),u=n(63),l=n(127),c=n(54),d=n(265),h=n(214),f=n(173),p=s.TypeError,g=s.WeakMap;if(a||d.state){var m=d.state||(d.state=new g);m.get=m.get,m.has=m.has,m.set=m.set,r=function(e,t){if(m.has(e))throw p("Object already initialized");return t.facade=e,m.set(e,t),t},o=function(e){return m.get(e)||{}},i=function(e){return m.has(e)}}else{var v=h("state");f[v]=!0,r=function(e,t){if(c(e,v))throw p("Object already initialized");return t.facade=e,l(e,v,t),t},o=function(e){return c(e,v)?e[v]:{}},i=function(e){return c(e,v)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=o(t)).type!==e)throw p("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.cancelAnimationFrame=function(e){window.cancelAnimationFrame(e)},t.getComparisonFunction=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i)return i;i="object"===("undefined"==typeof Intl?"undefined":(0,s.default)(Intl))?new Intl.Collator(e,t).compare:"function"==typeof String.prototype.localeCompare?function(e,t){return"".concat(e).localeCompare(t)}:function(e,t){return e===t?0:e>t?-1:1};return i},t.hasCaptionProblem=function(){void 0===o&&function(){var e=document.createElement("TABLE");e.style.borderSpacing="0",e.style.borderWidth="0",e.style.padding="0";var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="<tr><td>t<br>t</td></tr>";var n=document.createElLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i{performEagerTransformations(e,t){for(const n of e.arrayFormulaNodes()){const[r,o]=this.transformSingleAst(n.getFormula(e.lazilyTransformingAstService),n.getAddress(e.lazilyTransformingAstService)),i=t.rememberNewAst(r);n.setFormula(i),n.setAddress(o)}}transformSingleAst(e,t){return[this.transformAst(e,t),this.fixNodeAddress(t)]}transformAst(e,t){switch(e.type){case o.AstNodeType.CELL_REFERENCE:return this.transformCellReferenceAst(e,t);case o.AstNodeType.CELL_RANGE:return this.transformCellRangeAst(e,t);case o.AstNodeType.COLUMN_RANGE:return this.transformColumnRangeAst(e,t);case o.AstNodeType.ROW_RANGE:return this.transformRowRangeAst(e,t);case o.AstNodeType.EMPTY:case o.AstNodeType.ERROR:case o.AstNodeType.NUMBER:case o.AstNodeType.NAMED_EXPRESSION:case o.AstNodeType.ERROR_WITH_RAW_INPUT:case o.AstNodeType.STRING:return e;case o.AstNodeType.PERCENT_OP:case o.AstNodeType.MINUS_UNARY_OP:case o.AstNodeType.PLUS_UNARY_OP:return Object.assign(Object.assign({},e),{value:this.transformAst(e.value,t)});case o.AstNodeType.FUNCTION_CALL:return Object.assign(Object.assign({},e),{procedureName:e.procedureName,args:e.args.map(e=>this.transformAst(e,t))});case o.AstNodeType.PARENTHESIS:return Object.assign(Object.assign({},e),{expression:this.transformAst(e.expression,t)});case o.AstNodeType.ARRAY:return Object.assign(Object.assign({},e),{args:e.args.map(e=>e.map(e=>this.transformAst(e,t)))});default:return Object.assign(Object.assign({},e),{left:this.transformAst(e.left,t),right:this.transformAst(e.right,t)})}}transformCellReferenceAst(e,t){const n=this.transformCellAddress(e.reference,t);return n instanceof o.CellAddress?Object.assign(Object.assign({},e),{reference:n}):n===r.ErrorType.REF?Object(o.buildCellErrorAst)(new r.CellError(r.ErrorType.REF)):e}transformCellRangeAst(e,t){const n=this.transformCellRange(e.start,e.end,t);return Array.isArray(n)?Object.assign(Object.assign({},e),{start:n[0],end:n[1]}):n===r.ErrorType.REF?Object(o.buildCellErrorAst)(new r.CellError(r.ErrorType.REF)):e}transformColumnRangeAst(e,t){const n=this.transformColumnRange(e.start,e.end,t);return Array.isArray(n)?Object.assign(Object.assign({},e),{start:n[0],end:n[1]}):n===r.ErrorType.REF?Object(o.buildCellErrorAst)(new r.CellError(r.ErrorType.REF)):e}transformRowRangeAst(e,t){const n=this.transformRowRange(e.start,e.end,t);return Array.isArray(n)?Object.assign(Object.assign({},e),{start:n[0],end:n[1]}):n===r.ErrorType.REF?Object(o.buildCellErrorAst)(new r.CellError(r.ErrorType.REF)):e}}},function(e,t){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},function(e,t,n){var r,o=n(62),i=n(385),a=n(268),s=n(173),u=n(390),l=n(212),c=n(214),d=c("IE_PROTO"),h=function(){},f=function(e){return"<script>"+e+"<\/script>"},p=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t;g="undefined"!=typeof document?document.domain&&r?p(r):((t=l("iframe")).style.display="none",u.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):p(r);for(var n=a.length;n--;)delete g.prototype[a[n]];return g()};s[d]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h.prototype=o(e),n=new h,h.prototype=null,n[d]=e):n=g(),void 0===t?n:i.f(n,t)}},function(e,t,n){var r=n(125),o=n(97);e.exports=function(e,t){var n=e[t];return o(n)?void 0:r(n)}},function(e,t,n){var r=n(49),o=n(142),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a function")}},function(e,t,n){var r=n(116),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(55),o=n(84),i=n(175);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(178),o=n(30),i=n(166),a=n(83),s=n(94),u=n(281),l=o([].push),c=function(e){var t=1==e,n=2==e,o=3==e,c=4==e,d=6==e,h=7==e,f=5==e||d;return function(p,g,m,v){for(var y,E,T=a(p),C=i(T),R=r(g,m),w=s(C),S=0,O=v||u,b=t?O(p,w):n||h?O(p,0):void 0;w>S;S++)if((f||S in C)&&(E=R(y=C[S],S,T),e))if(t)b[S]=E;else if(E)switch(e){case 3:return!0;case 5:return y;case 6:return S;case 2:l(b,y)}else switch(e){case 4:return!1;case 7:l(b,y)}return d?-1:o||c?c:b}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},function(e,t,n){var r=n(167),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(i):function(){return a.apply(i,arguments)})},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.RegisteredEditor=f,t.getEditorInstance=t._getEditorInstance=function(e,t){var n;if("function"==typeof e)a.get(e)||p(null,e),n=a.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter');n=l(e)}if(!n)throw Error('No editor registered under name "'.concat(e,'"'));return n.getInstance(t)},t.getEditor=function(e){if("function"==typeoLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o{constructor(e){this.dependency=e}absolutize(e){return this.dependency.toSimpleCellAddress(e)}}class i{constructor(e,t){this.start=e,this.end=t}absolutize(e){return new r.AbsoluteCellRange(this.start.toSimpleCellAddress(e),this.end.toSimpleCellAddress(e))}}class a{constructor(e,t){this.start=e,this.end=t}absolutize(e){const t=this.start.toSimpleColumnAddress(e),n=this.end.toSimpleColumnAddress(e);return new r.AbsoluteColumnRange(t.sheet,t.col,n.col)}}class s{constructor(e,t){this.start=e,this.end=t}absolutize(e){const t=this.start.toSimpleRowAddress(e),n=this.end.toSimpleRowAddress(e);return new r.AbsoluteRowRange(t.sheet,t.row,n.row)}}class u{constructor(e){this.name=e}absolutize(e){return this}}},function(e,t,n){"use strict";n.r(t),n.d(t,"instanceOfSimpleDate",(function(){return a})),n.d(t,"instanceOfSimpleTime",(function(){return s})),n.d(t,"maxDate",(function(){return u})),n.d(t,"DateTimeHelper",(function(){return l})),n.d(t,"offsetMonth",(function(){return c})),n.d(t,"truncateDayInMonth",(function(){return d})),n.d(t,"roundToNearestSecond",(function(){return h})),n.d(t,"numberToSimpleTime",(function(){return f})),n.d(t,"timeToNumber",(function(){return p})),n.d(t,"toBasisEU",(function(){return g}));var r=n(43);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/const o=[31,28,31,30,31,30,31,31,30,31,30,31],i=[0,31,59,90,120,151,181,212,243,273,304,334];function a(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&("year"in e&&"number"==typeof e.year&&"month"in e&&"number"==typeof e.month&&"day"in e&&"number"==typeof e.day)}function s(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&("hours"in e&&"number"==typeof e.hours&&"minutes"in e&&"number"==typeof e.minutes&&"seconds"in e&&"number"==typeof e.seconds)}const u={year:9999,month:12,day:31};class l{constructor(e){this.config=e,this.minDateAbsoluteValue=this.dateToNumberFromZero(e.nullDate),this.maxDateValue=this.dateToNumber(u),this.leapYear1900=e.leapYear1900,!this.leapYear1900&&0<=this.dateToNumber({year:1900,month:2,day:28})?this.epochYearZero=this.numberToSimpleDate(2).year:this.epochYearZero=this.numberToSimpleDate(1).year,this.parseDateTime=e.parseDateTime}getWithinBounds(e){return e<=this.maxDateValue&&e>=0?e:void 0}dateStringToDateNumber(e){const{dateTime:t,dateFormat:n="",timeFormat:o=""}=this.parseDateTimeFromConfigFormats(e);if(void 0!==t)return s(t)?a(t)?new r.DateTimeNumber(p(t)+this.dateToNumber(t),n+" "+o):new r.TimeNumber(p(t),o):a(t)?new r.DateNumber(this.dateToNumber(t),n):0}parseDateTimeFromConfigFormats(e){return this.parseDateTimeFromFormats(e,this.config.dateFormats,this.config.timeFormats)}getNullYear(){return this.config.nullYear}getEpochYearZero(){return this.epochYearZero}isValidDate(e){return!(isNaN(e.year)||isNaN(e.month)||isNaN(e.day))&&(e.day===Math.round(e.day)&&e.month===Math.round(e.month)&&e.year===Math.round(e.year)&&(!(e.year<1582)&&(!(e.month<1||e.month>12)&&(!(e.day<1)&&(this.isLeapYear(e.year)&&2===e.month?e.day<=29:e.day<=o[e.month-1])))))}dateToNumber(e){return this.dateToNumberFromZero(e)-this.minDateAbsoluteValue}relativeNumberToAbsoluteNumber(e){return e+this.minDateAbsoluteValue-(this.leapYear1900?1:0)}numberToSimpleDate(e){const t=Math.floor(e)+this.minDateAbsoluteValue;let n=Math.floor(t/365.2425);this.dateToNumberFromZero({year:n+1,month:1,day:1})<=t?n++:this.dateToNumberFromZero({year:n-1,month:1,day:1})>t&&n--;const r=t-this.dateToNumberFromZero({year:n,month:1,day:1}),o=function(e){let t=0;i[t+6]<=e&&(t+=6);i[t+3]<=e&&(t+=3);i[t+2]<=e?t+=2:i[t+1]<=e&&(t+=1);return t}(r-(this.isLeapYear(n)&&r>=59?1:0));return{year:n,month:o+1,day:r-i[o]-(this.isLeapYear(n)&&o>1?1:0)+1}}numberToSimpleDateTime(e){const t=f(e%1),n=Math.floor(t.hours/24);t.hours=t.hours%24;const r=this.numberToSimpleDate(Math.floor(e)+n);return Object.assign(Object.assign({},r),t)}leapYearsCount(e){return Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400)+(this.config.leapYear1900&&e>=1900?1:0)}daysInMonth(e,t){return this.isLeapYear(e)&&2===t?29:o[t-1]}endOfMonth(e){return{year:e.year,month:e.month,day:this.daysInMonth(e.year,e.month)}}toBasisUS(e,t){return 31===e.day&&(e.day=30),30===e.day&&31===t.day&&(t.day=30),2===e.month&&e.day===this.daysInMonth(e.year,e.month)&&(e.day=30,2===t.month&&t.day===this.daysInMonth(t.year,t.month)&&(t.day=30)),[e,t]}yearLengthForBasis(e,t){return e.year!==t.year?e.year+1!==t.year||e.month<t.month||e.month===t.month&&e.day<t.day?(this.leapYearsCount(t.year)-this.leapYearsCount(e.year-1))/(t.year-e.year+1)+365:this.countLeapDays(t)!==this.countLeapDays({year:e.year,month:e.month,day:e.day-1})?366:365:this.isLeapYear(e.year)?366:365}parseSingleFormat(e,t,n){const r=this.parseDateTime(e,t,n);if(!a(r)||(r.year>=0&&r.year<100&&(r.year<this.getNullYear()?r.year+=2e3:r.year+=1900),this.isValidDate(r)))return r}parseDateTimeFromFormats(e,t,n){const r=0===t.length?[void 0]:t,o=0===n.length?[void 0]:n;for(const t of r)for(const n of o){const r=this.parseSingleFormat(e,t,n);if(void 0!==r)return{dateTime:r,timeFormat:n,dateFormat:t}}return{}}countLeapDays(e){return e.month>2||2===e.month&&e.day>=29?this.leapYearsCount(e.year):this.leapYearsCount(e.year-1)}dateToNumberFromZero(e){return 365*e.year+i[e.month-1]+e.day-1+(e.month<=2?this.leapYearsCount(e.year-1):this.leapYearsCount(e.year))}isLeapYear(e){return!(e%4)&&(!!(e%100)||(!(e%400)||1900===e&&this.config.leapYear1900))}}function c(e,t){const n=12*e.year+e.month-1+t;return{year:Math.floor(n/12),month:n%12+1,day:e.day}}function d(e){return{year:e.year,month:e.month,day:Math.min(e.day,o[e.month-1])}}function h(e){return Math.round(3600*e*24)/86400}function f(e){const t=24*e*60*60,n=function(e,t=1){return Math.round(e*t)/t}(t%60,1e5)%60,r=(t-n)/60,o=Math.round(r%60)%60,i=(r-o)/60;return{hours:Math.round(i),minutes:o,seconds:n}}function p(e){return((e.seconds/60+e.minutes)/60+e.hours)/24}function g(e){return{year:e.year,month:e.month,day:Math.min(30,e.day)}}},function(e,t,n){var r=n(114),o=n(265);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.31.0",mode:r?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(e,t,n){var r=n(16Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const r=":",o="$",i="\\s+",a="[ \\t\\n\\r]+",s="A-Za-zÀ-ʯ",u=s+"0-9_.",l=`[${s}0-9_]+`,c="'(((?!').|'')*)'",d=`(${l}|${c})!`,h=`(${d})?\\${o}?[A-Za-z]+\\${o}?[0-9]+`,f=`(${d})?\\${o}?[A-Za-z]+`,p=`(${d})?\\${o}?[0-9]+`,g="[rR][0-9]*[cC][0-9]*",m=`(${h})[^${u}]`,v=`[${s}_][${u}]*`,y=["0","1","2","3","4","5","6","7","8","9"],E=[...Array.from(Array(26)).map((e,t)=>t+"A".charCodeAt(0)),...Array.from(Array(26)).map((e,t)=>t+"a".charCodeAt(0)),...Array.from(Array(496)).map((e,t)=>t+192)].map(e=>String.fromCharCode(e))},function(e,t,n){"use strict";n.r(t),n.d(t,"tokenStructuredMatcher",(function(){return o})),n.d(t,"tokenStructuredMatcherNoCategories",(function(){return i})),n.d(t,"tokenShortNameIdx",(function(){return a})),n.d(t,"tokenIdxToClass",(function(){return s})),n.d(t,"augmentTokenTypes",(function(){return u})),n.d(t,"expandCategories",(function(){return l})),n.d(t,"assignTokenDefaultProps",(function(){return c})),n.d(t,"assignCategoriesTokensProp",(function(){return d})),n.d(t,"assignCategoriesMapProp",(function(){return h})),n.d(t,"singleAssignCategoriesToksMap",(function(){return f})),n.d(t,"hasShortKeyProperty",(function(){return p})),n.d(t,"hasCategoriesProperty",(function(){return g})),n.d(t,"hasExtendingTokensTypesProperty",(function(){return m})),n.d(t,"hasExtendingTokensTypesMapProperty",(function(){return v})),n.d(t,"isTokenType",(function(){return y}));var r=n(38);function o(e,t){var n=e.tokenTypeIdx;return n===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[n]}function i(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var a=1,s={};function u(e){var t=l(e);c(t),h(t),d(t),Object(r.forEach)(t,(function(e){e.isParent=e.categoryMatches.length>0}))}function l(e){for(var t=Object(r.cloneArr)(e),n=e,o=!0;o;){n=Object(r.compact)(Object(r.flatten)(Object(r.map)(n,(function(e){return e.CATEGORIES}))));var i=Object(r.difference)(n,t);t=t.concat(i),Object(r.isEmpty)(i)?o=!1:n=i}return t}function c(e){Object(r.forEach)(e,(function(e){p(e)||(s[a]=e,e.tokenTypeIdx=a++),g(e)&&!Object(r.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),g(e)||(e.CATEGORIES=[]),m(e)||(e.categoryMatches=[]),v(e)||(e.categoryMatchesMap={})}))}function d(e){Object(r.forEach)(e,(function(e){e.categoryMatches=[],Object(r.forEach)(e.categoryMatchesMap,(function(t,n){e.categoryMatches.push(s[n].tokenTypeIdx)}))}))}function h(e){Object(r.forEach)(e,(function(e){f([],e)}))}function f(e,t){Object(r.forEach)(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),Object(r.forEach)(t.CATEGORIES,(function(n){var o=e.concat(t);Object(r.contains)(o,n)||f(o,n)}))}function p(e){return Object(r.has)(e,"tokenTypeIdx")}function g(e){return Object(r.has)(e,"CATEGORIES")}function m(e){return Object(r.has)(e,"categoryMatches")}function v(e){return Object(r.has)(e,"categoryMatchesMap")}function y(e){return Object(r.has)(e,"tokenTypeIdx")}},function(e,t,n){"use strict";n.r(t),n.d(t,"isSequenceProd",(function(){return u})),n.d(t,"isOptionalProd",(function(){return l})),n.d(t,"isBranchingProd",(function(){return c})),n.d(t,"getProductionDslName",(function(){return d})),n.d(t,"DslMethodsCollectorVisitor",(function(){return h})),n.d(t,"collectMethods",(function(){return p}));var r,o=n(38),i=n(45),a=n(119),s=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function u(e){return e instanceof i.Flat||e instanceof i.Option||e instanceof i.Repetition||e instanceof i.RepetitionMandatory||e instanceof i.RepetitionMandatoryWithSeparator||e instanceof i.RepetitionWithSeparator||e instanceof i.Terminal||e instanceof i.Rule}function l(e,t){return void 0===t&&(t=[]),!!(e instanceof i.Option||e instanceof i.Repetition||e instanceof i.RepetitionWithSeparator)||(e instanceof i.Alternation?Object(o.some)(e.definition,(function(e){return l(e,t)})):!(e instanceof i.NonTerminal&&Object(o.contains)(t,e))&&(e instanceof i.AbstractProduction&&(e instanceof i.NonTerminal&&t.push(e),Object(o.every)(e.definition,(function(e){return l(e,t)})))))}function c(e){return e instanceof i.Alternation}function d(e){if(e instanceof i.NonTerminal)return"SUBRULE";if(e instanceof i.Option)return"OPTION";if(e instanceof i.Alternation)return"OR";if(e instanceof i.RepetitionMandatory)return"AT_LEAST_ONE";if(e instanceof i.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(e instanceof i.RepetitionWithSeparator)return"MANY_SEP";if(e instanceof i.Repetition)return"MANY";if(e instanceof i.Terminal)return"CONSUME";throw Error("non exhaustive match")}var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return s(t,e),t.prototype.reset=functionLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class r{constructor(e,t,n){if(this.sheet=e,this.rowStart=t,this.rowEnd=n,t<0)throw Error("Starting row cant be less than 0");if(n<t)throw Error("Row span cant end before start")}get numberOfRows(){return this.rowEnd-this.rowStart+1}get start(){return this.rowStart}get end(){return this.rowEnd}static fromNumberOfRows(e,t,n){return new r(e,t,t+n-1)}static fromRowStartAndEnd(e,t,n){return new r(e,t,n)}*rows(){for(let e=this.rowStart;e<=this.rowEnd;++e)yield e}intersect(e){if(this.sheet!==e.sheet)throw Error("Can't intersect spans from different sheets");const t=Math.max(this.rowStart,e.rowStart),n=Math.min(this.rowEnd,e.rowEnd);return t>n?null:new r(this.sheet,t,n)}firstRow(){return new r(this.sheet,this.rowStart,this.rowStart)}}class o{constructor(e,t,n){if(this.sheet=e,this.columnStart=t,this.columnEnd=n,t<0)throw Error("Starting column cant be less than 0");if(n<t)throw Error("Column span cant end before start")}get numberOfColumns(){return this.columnEnd-this.columnStart+1}get start(){return this.columnStart}get end(){return this.columnEnd}static fromNumberOfColumns(e,t,n){return new o(e,t,t+n-1)}static fromColumnStartAndEnd(e,t,n){return new o(e,t,n)}*columns(){for(let e=this.columnStart;e<=this.columnEnd;++e)yield e}intersect(e){if(this.sheet!==e.sheet)throw Error("Can't intersect spans from different sheets");const t=Math.max(this.columnStart,e.columnStart),n=Math.min(this.columnEnd,e.columnEnd);return t>n?null:new o(this.sheet,t,n)}firstColumn(){return new o(this.sheet,this.columnStart,this.columnStart)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"InterpreterState",(function(){return r}));
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class r{constructor(e,t,n){this.formulaAddress=e,this.arraysFlag=t,this.formulaVertex=n}}},function(e,t,n){"use strict";n.r(t),n.d(t,"DenseSparseChooseBasedOnThreshold",(function(){return i})),n.d(t,"AlwaysSparse",(function(){return a})),n.d(t,"AlwaysDense",(function(){return s}));var r=n(259),o=n(258);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i{constructor(e){this.threshold=e}call(e){return e>this.threshold?r.DenseStrategy:o.SparseStrategy}}class a{call(){return o.SparseStrategy}}class s{call(){return r.DenseStrategy}}},function(e,t,n){"use strict";n.r(t),n.d(t,"HyperFormula",(function(){return v}));var r=n(77),o=n(332),i=n(664),a=n(17),s=n(165),u=n(206),l=n(139),c=n(683),d=n(684),h=n(29),f=n(205),p=n(263),g=n(208),m=n(61);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class v{constructor(e,t,n,r,o,i,a,s,u,l,c,h,f,p){this._config=e,this._stats=t,this._dependencyGraph=n,this._columnSearch=r,this._parser=o,this._unparser=i,this._cellContentParser=a,this._evaluator=s,this._lazilyTransformingAstService=u,this._crudOperations=l,this._exporter=c,this._namedExpressions=h,this._serialization=f,this._functionRegistry=p,this._emitter=new d.Emitter,this._evaluationSuspended=!1}static get defaultConfig(){return Object(u.getDefaultConfig)()}get graph(){return this.dependencyGraph.graph}get rangeMapping(){return this.dependencyGraph.rangeMapping}get arrayMapping(){return this.dependencyGraph.arrayMapping}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}get dependencyGraph(){return this._dependencyGraph}get evaluator(){return this._evaluator}get columnSearch(){return this._columnSearch}get lazilyTransformingAstService(){return this._lazilyTransformingAstService}get licenseKeyValidityState(){return this._config.licenseKeyValidityState}static buildFromArray(e,t={},n=[]){return this.buildFromEngineState(i.BuildEngineFactory.buildFromSheet(e,t,n))}static buildFromSheets(e,t={},n=[]){return this.buildFromEngineState(i.BuildEngineFactory.buildFromSheets(e,t,n))}static buildEmpty(e={},t=[]){return this.buildFromEngineState(i.BuildEngineFactory.buildEmpty(e,t))}static getLanguage(e){Object(o.validateArgToType)(e,"string","languageCode");const t=this.registeredLanguages.get(e);if(void 0===t)throw new h.LanguageNotRegisteredError;return t}static registerLanguage(e,t){if(Object(o.validateArgToType)(e,"string","languageCode"),this.registeredLanguages.has(e))throw new h.LanguageAlreadyRegisteredError;this.registeredLanguages.set(e,Object(f.buildTranslationPackage)(t))}static unregisterLanguage(e){if(Object(o.validateArgToType)(e,"string","languageCode"),!this.registeredLanguages.has(e))throw new h.LanguageNotRegisteredError;this.registeredLanguages.delete(e)}static getRegisteredLanguagesCodes(){return Array.from(this.registeredLanguages.keys())}static registerFunctionPlugin(e,t){p.FunctionRegistry.registerFunctionPlugin(e,t)}static unregisterFunctionPlugin(e){p.FunctionRegistry.unregisterFunctionPlugin(e)}static registerFunction(e,t,n){Object(o.validateArgToType)(e,"string","functionId"),p.FunctionRegistry.registerFunction(e,t,n)}static unregisterFunction(e){Object(o.validateArgToType)(e,"string","functionId"),p.FunctionRegistry.unregisterFunction(e)}static unregisterAllFunctions(){p.FunctionRegistry.unregisterAll()}static getRegisteredFunctionNames(e){Object(o.validateArgToType)(e,"string","code");const t=p.FunctionRegistry.getRegisteredFunctionIds();return this.getLanguage(e).getFunctionTranslations(t)}static getFunctionPlugin(e){return Object(o.validateArgToType)(e,"string","functionId"),p.FunctionRegistry.getFunctionPlugin(e)}static getAllFunctionPlugins(){return p.FunctionRegistry.getPlugins()}static buildFromEngineState(e){return new v(e.config,e.stats,e.dependencyGraph,e.columnSearch,e.parser,e.unparser,e.cellContentParser,e.evaluator,e.lazilyTransformingAstService,e.crudOperations,e.exporter,e.namedExpressions,e.serialization,e.functionRegistry)}getCellValue(e){if(!Object(a.isSimpleCellAddress)(e))throw new h.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellValue(e)}getCellFormula(e){if(!Object(a.isSimpleCellAddress)(e))throw new h.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this._serialization.getCellFormula(e)}getCellHyperlink(e){if(!Object(a.isSimpleCellAddress)(e))throw new h.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellHyperlink(e)}getCellSerialized(e){if(!Object(a.isSimpleCellAddress)(e))throw new h.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellSerialized(e)}getSheetValues(e){return Object(o.validateArgToType)(e,"number","sheetId"),this.ensureEvaluationIsNotSuspended(),this._serialization.getSheetValues(e)}getSheetFormulas(e){return Object(o.validateArgToType)(e,"number","sheetId"),this._serialization.getSheetFormulas(e)}getSheetSerialized(e){return Object(o.validateArgToType)(e,"number","sheetId"),this.ensureEvaluationIsNotSuspended(),this._serialization.getSheetSerialized(e)}getAllSheetsDimensions(){return this._serialization.genericAllSheetsGetter(e=>this.getSheetDimensions(e))}getSheetDimensions(e){return Object(o.validateArgToType)(e,"number","sheetId"),{width:this.dependencyGraph.getSheetWidth(e),height:this.dependencyGraph.getSheetHeight(e)}}getAllSheetsValues(){return this.ensureEvaluationIsNotSuspended(),this._serialization.getAllSheetsValues()}getAllSheetsFormulas(){return this._serialization.getAllSheetsFormulas()}getAllSheetsSerialized(){return this.ensureEvaluationIsNotSuspended(),this._serialization.getAllSheetsSerialized()Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const a=(e,t)=>e.map(e=>e.absolutize(t)),s=e=>e.filter(e=>e instanceof i.NamedExpressionDependency||(e instanceof r.AbsoluteCellRange?!(Object(o.invalidSimpleCellAddress)(e.start)||Object(o.invalidSimpleCellAddress)(e.end)):!Object(o.invalidSimpleCellAddress)(e)))},function(e,t,n){"use strict";n.r(t),n.d(t,"CellReferenceType",(function(){return r})),n.d(t,"CellAddress",(function(){return u}));var r,o=n(17),i=n(87),a=n(198),s=n(199);!function(e){e.CELL_REFERENCE_RELATIVE="CELL_REFERENCE",e.CELL_REFERENCE_ABSOLUTE="CELL_REFERENCE_ABSOLUTE",e.CELL_REFERENCE_ABSOLUTE_COL="CELL_REFERENCE_ABSOLUTE_COL",e.CELL_REFERENCE_ABSOLUTE_ROW="CELL_REFERENCE_ABSOLUTE_ROW"}(r||(r={}));class u{constructor(e,t,n,r){this.col=e,this.row=t,this.type=n,this.sheet=r}static fromColAndRow(e,t,n){return(e.isColumnAbsolute()&&t.isRowAbsolute()?u.absolute.bind(this):e.isColumnAbsolute()?u.absoluteCol.bind(this):t.isRowAbsolute()?u.absoluteRow.bind(this):u.relative.bind(this))(e.col,t.row,n)}static relative(e,t,n){return new u(e,t,r.CELL_REFERENCE_RELATIVE,n)}static absolute(e,t,n){return new u(e,t,r.CELL_REFERENCE_ABSOLUTE,n)}static absoluteCol(e,t,n){return new u(e,t,r.CELL_REFERENCE_ABSOLUTE_COL,n)}static absoluteRow(e,t,n){return new u(e,t,r.CELL_REFERENCE_ABSOLUTE_ROW,n)}toSimpleCellAddress(e){const t=Object(o.absoluteSheetReference)(this,e);return this.type===r.CELL_REFERENCE_ABSOLUTE?Object(o.simpleCellAddress)(t,this.col,this.row):this.type===r.CELL_REFERENCE_ABSOLUTE_ROW?Object(o.simpleCellAddress)(t,e.col+this.col,this.row):this.type===r.CELL_REFERENCE_ABSOLUTE_COL?Object(o.simpleCellAddress)(t,this.col,e.row+this.row):Object(o.simpleCellAddress)(t,e.col+this.col,e.row+this.row)}toColumnAddress(){const e=this.isColumnRelative()?a.ReferenceType.RELATIVE:a.ReferenceType.ABSOLUTE;return new a.ColumnAddress(e,this.col,this.sheet)}toRowAddress(){const e=this.isRowRelative()?a.ReferenceType.RELATIVE:a.ReferenceType.ABSOLUTE;return new s.RowAddress(e,this.row,this.sheet)}toSimpleColumnAddress(e){const t=Object(o.absoluteSheetReference)(this,e);let n=this.col;return this.isColumnRelative()&&(n+=e.col),Object(o.simpleColumnAddress)(t,n)}toSimpleRowAddress(e){const t=Object(o.absoluteSheetReference)(this,e);let n=this.row;return this.isRowRelative()&&(n+=e.row),Object(o.simpleRowAddress)(t,n)}isRowAbsolute(){return this.type===r.CELL_REFERENCE_ABSOLUTE||this.type===r.CELL_REFERENCE_ABSOLUTE_ROW}isColumnAbsolute(){return this.type===r.CELL_REFERENCE_ABSOLUTE||this.type===r.CELL_REFERENCE_ABSOLUTE_COL}isColumnRelative(){return this.type===r.CELL_REFERENCE_RELATIVE||this.type===r.CELL_REFERENCE_ABSOLUTE_ROW}isRowRelative(){return this.type===r.CELL_REFERENCE_RELATIVE||this.type===r.CELL_REFERENCE_ABSOLUTE_COL}isAbsolute(){return this.type===r.CELL_REFERENCE_ABSOLUTE&&void 0!==this.sheet}shiftedByRows(e){return new u(this.col,this.row+e,this.type,this.sheet)}shiftedByColumns(e){return new u(this.col+e,this.row,this.type,this.sheet)}moved(e,t,n){const r=void 0===this.sheet?void 0:e;return new u(this.col+t,this.row+n,this.type,r)}withSheet(e){return new u(this.col,this.row,this.type,e)}isInvalid(e){return Object(o.invalidSimpleCellAddress)(this.toSimpleCellAddress(e))}shiftRelativeDimensions(e,t){const n=this.isColumnAbsolute()?this.col:this.col+e,r=this.isRowAbsolute()?this.row:this.row+t;return new u(n,r,this.type,this.sheet)}shiftAbsoluteDimensions(e,t){const n=this.isColumnRelative()?this.col:this.col+e,r=this.isRowRelative()?this.row:this.row+t;return new u(n,r,this.type,this.sheet)}hash(e){const t=e&&void 0!==this.sheet?"#"+this.sheet:"";switch(this.type){case r.CELL_REFERENCE_RELATIVE:return`${t}#${this.row}R${this.col}`;case r.CELL_REFERENCE_ABSOLUTE:return`${t}#${this.row}A${this.col}`;case r.CELL_REFERENCE_ABSOLUTE_COL:return`${t}#${this.row}AC${this.col}`;case r.CELL_REFERENCE_ABSOLUTE_ROW:return`${t}#${this.row}AR${this.col}`}}unparse(e){const t=this.toSimpleCellAddress(e);if(Object(o.invalidSimpleCellAddress)(t))return;const n=Object(i.columnIndexToLabel)(t.col),a=this.type===r.CELL_REFERENCE_ABSOLUTE||this.type===r.CELL_REFERENCE_ABSOLUTE_ROW?"$":"";return`${this.type===r.CELL_REFERENCE_ABSOLUTE||this.type===r.CELL_REFERENCE_ABSOLUTE_COL?"$":""}${n}${a}${t.row+1}`}exceedsSheetSizeLimits(e,t){return this.row>=t||this.col>=e}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ReferenceType",(function(){return r})),n.d(t,"ColumnAddress",(function(){return a}));var r,o=n(17),i=n(87);!function(e){e.RELATIVE="RELATIVE",e.ABSOLUTE="ABSOLUTE"}(r||(r={}));class a{constructor(e,t,n){this.type=e,this.col=t,this.sheet=n}static absolute(e,t){return new a(r.ABSOLUTE,e,t)}static relative(e,t){return new a(r.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,n)=>t.toSimpleColumnAddress(e).col-n.toSimpleColumnAddress(e).col}isColumnAbsolute(){return this.type===r.ABSOLUTE}isColumnRelative(){return this.type===r.RELATIVE}isAbsolute(){return this.type===r.ABSOLUTE&&void 0!==this.sheet}moved(e,t,n){const r=void 0===this.sheet?void 0:e;return new aLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i{constructor(e,t,n){this.type=e,this.row=t,this.sheet=n}static absolute(e,t){return new i(o.ReferenceType.ABSOLUTE,e,t)}static relative(e,t){return new i(o.ReferenceType.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,n)=>t.toSimpleRowAddress(e).row-n.toSimpleRowAddress(e).row}isRowAbsolute(){return this.type===o.ReferenceType.ABSOLUTE}isRowRelative(){return this.type===o.ReferenceType.RELATIVE}isAbsolute(){return this.type===o.ReferenceType.ABSOLUTE&&void 0!==this.sheet}moved(e,t,n){const r=void 0===this.sheet?void 0:e;return new i(this.type,this.row+n,r)}shiftedByRows(e){return new i(this.type,this.row+e,this.sheet)}toSimpleRowAddress(e){const t=Object(r.absoluteSheetReference)(this,e);let n=this.row;return this.isRowRelative()&&(n=e.row+this.row),Object(r.simpleRowAddress)(t,n)}shiftRelativeDimensions(e,t){const n=this.isRowRelative()?this.row+t:this.row;return new i(this.type,n,this.sheet)}shiftAbsoluteDimensions(e,t){const n=this.isRowAbsolute()?this.row+t:this.row;return new i(this.type,n,this.sheet)}withSheet(e){return new i(this.type,this.row,e)}isInvalid(e){return this.toSimpleRowAddress(e).row<0}hash(e){const t=e&&void 0!==this.sheet?"#"+this.sheet:"";switch(this.type){case o.ReferenceType.RELATIVE:return`${t}#ROWR${this.row}`;case o.ReferenceType.ABSOLUTE:return`${t}#ROWA${this.row}`}}unparse(e){const t=this.toSimpleRowAddress(e);if(Object(r.invalidSimpleRowAddress)(t))return;return`${this.type===o.ReferenceType.ABSOLUTE?"$":""}${t.row+1}`}exceedsSheetSizeLimits(e){return this.row>=e}}},function(e,t,n){"use strict";n.r(t),n.d(t,"clearCache",(function(){return g}));var r=n(239);n.d(t,"VERSION",(function(){return r.VERSION}));var o=n(68);n.d(t,"Parser",(function(){return o.Parser})),n.d(t,"CstParser",(function(){return o.CstParser})),n.d(t,"EmbeddedActionsParser",(function(){return o.EmbeddedActionsParser})),n.d(t,"ParserDefinitionErrorType",(function(){return o.ParserDefinitionErrorType})),n.d(t,"EMPTY_ALT",(function(){return o.EMPTY_ALT}));var i=n(137);n.d(t,"Lexer",(function(){return i.Lexer})),n.d(t,"LexerDefinitionErrorType",(function(){return i.LexerDefinitionErrorType}));var a=n(88);n.d(t,"createToken",(function(){return a.createToken})),n.d(t,"createTokenInstance",(function(){return a.createTokenInstance})),n.d(t,"EOF",(function(){return a.EOF})),n.d(t,"tokenLabel",(function(){return a.tokenLabel})),n.d(t,"tokenMatcher",(function(){return a.tokenMatcher})),n.d(t,"tokenName",(function(){return a.tokenName}));var s=n(120);n.d(t,"defaultGrammarResolverErrorProvider",(function(){return s.defaultGrammarResolverErrorProvider})),n.d(t,"defaultGrammarValidatorErrorProvider",(function(){return s.defaultGrammarValidatorErrorProvider})),n.d(t,"defaultParserErrorProvider",(function(){return s.defaultParserErrorProvider}));var u=n(100);n.d(t,"EarlyExitException",(function(){return u.EarlyExitException})),n.d(t,"isRecognitionException",(function(){return u.isRecognitionException})),n.d(t,"MismatchedTokenException",(function(){return u.MismatchedTokenException})),n.d(t,"NotAllInputParsedException",(function(){return u.NotAllInputParsedException})),n.d(t,"NoViableAltException",(function(){return u.NoViableAltException}));var l=n(243);n.d(t,"defaultLexerErrorProvider",(function(){return l.defaultLexerErrorProvider}));var c=n(45);n.d(t,"Alternation",(function(){return c.Alternation})),n.d(t,"Flat",(function(){return c.Flat})),n.d(t,"NonTerminal",(function(){return c.NonTerminal})),n.d(t,"Option",(function(){return c.Option})),n.d(t,"Repetition",(function(){return c.Repetition})),n.d(t,"RepetitionMandatory",(function(){return c.RepetitionMandatory})),n.d(t,"RepetitionMandatoryWithSeparator",(function(){return c.RepetitionMandatoryWithSeparator})),n.d(t,"RepetitionWithSeparator",(function(){return c.RepetitionWithSeparator})),n.d(t,"Rule",(function(){return c.Rule})),n.d(t,"Terminal",(function(){return c.Terminal})),n.d(t,"serializeGrammar",(function(){return c.serializeGrammar})),n.d(t,"serializeProduction",(function(){return c.serializeProduction}));var d=n(119);n.d(t,"GAstVisitor",(function(){return d.GAstVisitor}));var h=n(160);n.d(t,"assignOccurrenceIndices",(function(){return h.assignOccurrenceIndices})),n.d(t,"resolveGrammar",(function(){return h.resolveGrammar})),n.d(t,"validateGrammar",(function(){return h.validateGrammar}));var f=n(324);n.d(t,"createSyntaxDiagramsCode",(function(){return f.createSyntaxDiagramsCode}));var p=n(245);function g(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")}n.d(t,"generateParserFactory",(function(){return p.generateParserFactory})),n.d(t,"generateParserModule",(function(){return p.generateParserModule}))},function(e,t,n){"use strict";n.r(t),n.d(t,"validateGrammar",(function(){return f})),n.d(t,"identifyProductionForDuplicates",(function(){return p})),n.d(t,"OccurrenceValidationCollectLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const s=Object(r.createToken)({name:"AdditionOp",pattern:r.Lexer.NA}),u=Object(r.createToken)({name:"PlusOp",pattern:/\+/,categories:s}),l=Object(r.createToken)({name:"MinusOp",pattern:/-/,categories:s}),c=Object(r.createToken)({name:"MultiplicationOp",pattern:r.Lexer.NA}),d=Object(r.createToken)({name:"TimesOp",pattern:/\*/,categories:c}),h=Object(r.createToken)({name:"DivOp",pattern:/\//,categories:c}),f=Object(r.createToken)({name:"PowerOp",pattern:/\^/}),p=Object(r.createToken)({name:"PercentOp",pattern:/%/}),g=Object(r.createToken)({name:"BooleanOp",pattern:r.Lexer.NA}),m=Object(r.createToken)({name:"EqualsOp",pattern:/=/,categories:g}),v=Object(r.createToken)({name:"NotEqualOp",pattern:/<>/,categories:g}),y=Object(r.createToken)({name:"GreaterThanOp",pattern:/>/,categories:g}),E=Object(r.createToken)({name:"LessThanOp",pattern:/</,categories:g}),T=Object(r.createToken)({name:"GreaterThanOrEqualOp",pattern:/>=/,categories:g}),C=Object(r.createToken)({name:"LessThanOrEqualOp",pattern:/<=/,categories:g}),R=Object(r.createToken)({name:"ConcatenateOp",pattern:/&/}),w=Object(r.createToken)({name:"LParen",pattern:/\(/}),S=Object(r.createToken)({name:"RParen",pattern:/\)/}),O=Object(r.createToken)({name:"ArrayLParen",pattern:/{/}),b=Object(r.createToken)({name:"ArrayRParen",pattern:/}/}),A=Object(r.createToken)({name:"StringLiteral",pattern:/"([^"\\]*(\\.[^"\\]*)*)"/}),N=Object(r.createToken)({name:"ErrorLiteral",pattern:/#[A-Za-z0-9\/]+[?!]?/}),M=Object(r.createToken)({name:"RangeSeparator",pattern:new RegExp(o.RANGE_OPERATOR)}),I=Object(r.createToken)({name:"ColumnRange",pattern:new RegExp(`${o.COLUMN_REFERENCE_PATTERN}${o.RANGE_OPERATOR}${o.COLUMN_REFERENCE_PATTERN}`)}),_=Object(r.createToken)({name:"RowRange",pattern:new RegExp(`${o.ROW_REFERENCE_PATTERN}${o.RANGE_OPERATOR}${o.ROW_REFERENCE_PATTERN}`)}),k=Object(r.createToken)({name:"ProcedureName",pattern:new RegExp(`([${o.UNICODE_LETTER_PATTERN}][${o.NON_RESERVED_CHARACTER_PATTERN}]*)\\(`)}),x=new i.CellReferenceMatcher,P=Object(r.createToken)({name:"CellReference",pattern:x.match.bind(x),start_chars_hint:x.POSSIBLE_START_CHARACTERS,line_breaks:!1}),L=new a.NamedExpressionMatcher,D=Object(r.createToken)({name:"NamedExpression",pattern:L.match.bind(L),start_chars_hint:L.POSSIBLE_START_CHARACTERS,line_breaks:!1}),F=e=>{const t=e.translationPackage.getFunctionTranslation("OFFSET"),n=e.errorMapping,i=e.translationPackage.buildFunctionMapping(),a=new RegExp("standard"===e.ignoreWhiteSpace?o.ODFF_WHITESPACE_PATTERN:o.ALL_WHITESPACE_PATTERN),x=Object(r.createToken)({name:"WhiteSpace",pattern:a}),L=Object(r.createToken)({name:"ArrayRowSep",pattern:e.arrayRowSeparator}),F=Object(r.createToken)({name:"ArrayColSep",pattern:e.arrayColumnSeparator}),U=Object(r.createToken)({name:"NumberLiteral",pattern:new RegExp(`(([${e.decimalSeparator}]\\d+)|(\\d+([${e.decimalSeparator}]\\d*)?))(e[+-]?\\d+)?`)}),H=Object(r.createToken)({name:"OffsetProcedureName",pattern:new RegExp(t,"i")});let V,j;e.functionArgSeparator===e.arrayColumnSeparator?(V=F,j=[]):e.functionArgSeparator===e.arrayRowSeparator?(V=L,j=[]):(V=Object(r.createToken)({name:"ArgSeparator",pattern:e.functionArgSeparator}),j=[V]);return{ArgSeparator:V,NumberLiteral:U,OffsetProcedureName:H,ArrayRowSeparator:L,ArrayColSeparator:F,WhiteSpace:x,allTokens:[x,u,l,d,h,f,m,v,p,T,C,y,E,w,S,O,b,H,k,M,...j,I,_,U,A,N,R,g,s,c,P,D,L,F],errorMapping:n,functionMapping:i,decimalSeparator:e.decimalSeparator,maxColumns:e.maxColumns,maxRows:e.maxRows}}},function(e,t,n){"use strict";n.r(t),n.d(t,"UIElement",(function(){return r}));var r,o=n(257);n.d(t,"TranslationPackage",(function(){return o.TranslationPackage})),n.d(t,"buildTranslationPackage",(function(){return o.buildTranslationPackage})),function(e){e.NEW_SHEET_PREFIX="NEW_SHEET_PREFIX"}(r||(r={}))},function(e,t,n){"use strict";n.r(t),n.d(t,"Config",(function(){return h})),n.d(t,"getDefaultConfig",(function(){return p}));var r=n(332),o=n(333),i=n(139),a=n(163),s=n(29),u=n(261),l=n(662),c=n(164);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const d=new WeakMap;class h{constructor(e={},t=!0){const{accentSensitive:n,binarySearchThreshold:o,caseSensitive:a,caseFirst:s,chooseAddressMappingPolicy:u,currencySymbol:f,dateFormats:p,decimalSeparator:g,evaluateNullToZero:m,functionArgSeparator:v,functionPlugins:y,ignorePunctuation:E,leapYear1900:T,localeLang:C,language:R,ignoreWhiteSpace:w,licenseKey:S,matchWholeCell:O,arrayColumnSeparator:b,arrayRowSeparator:A,maxRows:N,maxColumns:M,nullYear:I,nullDate:_,parseDateTime:k,precisionEpsilon:x,precisionRounding:P,stringifyDateTime:L,stringifyDuration:D,smartRounding:F,timeFormats:U,thousandSeparator:H,useArrayArithmetic:V,useStats:j,undoLimit:B,useColumnIndex:W,useRegularExpressions:Y,useWildcards:G}=e;t&&h.warnDeprecatedOptions(e),this.useArrayArithmetic=Object(r.configValueFromParam)(V,"boolean","useArrayArithmetic"),this.accentSensitive=Object(r.configValueFromParam)(n,"boolean","accentSensitive"),this.caseSensitive=Object(r.configValueFromParam)(a,"boolean","caseSensitive"),this.caseFirst=Object(r.configValueFromParam)(s,["upper","lower","false"],"caseFirst"),this.ignorePunctuation=Object(r.configValueFromParam)(E,"boolean","ignorePunctuation"),this.chooseAddressMappingPolicy=null!=u?u:h.defaultConfig.chooseAddressMappingPolicy,this.dateFormats=[...Object(r.configValueFromParamCheck)(p,Array.isArray,"array","dateFormats")],this.timeFormats=[...Object(r.configValueFromParamCheck)(U,Array.isArray,"array","timeFormats")],this.functionArgSeparator=Object(r.configValueFromParam)(v,"string","functionArgSeparator"),this.decimalSeparator=Object(r.configValueFromParam)(g,[".",","],"decimalSeparator"),this.language=Object(r.configValueFromParam)(R,"string","language"),this.ignoreWhiteSpace=Object(r.configValueFromParam)(w,["standard","any"],"ignoreWhiteSpace"),this.licenseKey=Object(r.configValueFromParam)(S,"string","licenseKey"),this.thousandSeparator=Object(r.configValueFromParam)(H,["",","," ","."],"thousandSeparator"),this.arrayColumnSeparator=Object(r.configValueFromParam)(b,[",",";"],"arrayColumnSeparator"),this.arrayRowSeparator=Object(r.configValueFromParam)(A,[";","|"],"arrayRowSeparator"),this.localeLang=Object(r.configValueFromParam)(C,"string","localeLang"),this.functionPlugins=[...null!=y?y:h.defaultConfig.functionPlugins],this.smartRounding=Object(r.configValueFromParam)(F,"boolean","smartRounding"),this.evaluateNullToZero=Object(r.configValueFromParam)(m,"boolean","evaluateNullToZero"),this.nullYear=Object(r.configValueFromParam)(I,"number","nullYear"),Object(r.validateNumberToBeAtLeast)(this.nullYear,"nullYear",0),Object(r.validateNumberToBeAtMost)(this.nullYear,"nullYear",100),this.precisionRounding=Object(r.configValueFromParam)(P,"number","precisionRounding"),Object(r.validateNumberToBeAtLeast)(this.precisionRounding,"precisionRounding",0),this.precisionEpsilon=Object(r.configValueFromParam)(x,"number","precisionEpsilon"),Object(r.validateNumberToBeAtLeast)(this.precisionEpsilon,"precisionEpsilon",0),this.useColumnIndex=Object(r.configValueFromParam)(W,"boolean","useColumnIndex"),this.useStats=Object(r.configValueFromParam)(j,"boolean","useStats"),this.binarySearchThreshold=null!=o?o:h.defaultConfig.binarySearchThreshold,this.parseDateTime=Object(r.configValueFromParam)(k,"function","parseDateTime"),this.stringifyDateTime=Object(r.configValueFromParam)(L,"function","stringifyDateTime"),this.stringifyDuration=Object(r.configValueFromParam)(D,"function","stringifyDuration"),this.translationPackage=c.HyperFormula.getLanguage(this.language),this.errorMapping=this.translationPackage.buildErrorMapping(),this.nullDate=Object(r.configValueFromParamCheck)(_,i.instanceOfSimpleDate,"IDate","nullDate"),this.leapYear1900=Object(r.configValueFromParam)(T,"boolean","leapYear1900"),this.undoLimit=Object(r.configValueFromParam)(B,"number","undoLimit"),this.useRegularExpressions=Object(r.configValueFromParam)(Y,"boolean","useRegularExpressions"),this.useWildcards=Object(r.configValueFromParam)(G,"boolean","useWildcards"),this.matchWholeCell=Object(r.configValueFromParam)(O,"boolean","matchWholeCell"),Object(r.validateNumberToBeAtLeast)(this.undoLimit,"undoLimit",0),this.maxRows=Object(r.configValueFromParam)(N,"number","maxRows"),Object(r.validateNumberToBeAtLeast)(this.maxRows,"maxRows",1),this.maxColumns=Object(r.configValueFromParam)(M,"number","maxColumns"),this.currencySymbol=this.setupCurrencySymbol(f),Object(r.validateNumberToBeAtLeast)(this.maxColumns,"maxColumns",1),d.set(this,{licenseKeyValidityState:Object(l.checkLicenseKeyValidity)(this.licenseKey)}),Object(r.configCheckIfParametersNotInConflict)({value:this.decimalSeparator,name:"decimalSeparator"},{value:this.functionArgSeparator,name:"functionArgSeparator"},{value:this.thousandSeparator,name:"thousandSeparator"}),Object(r.configCheckIfParametersNotInConflict)({value:this.arrayRowSeparator,name:"arrayRowSeparator"},{value:this.arrayColumnSeparator,name:"arrayColumnSeparator"})}setupCurrencySymbol(e){const t=[...Object(r.configValueFromParamCheck)Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a{constructor(e,t,n,r){this.displayName=e,this.address=t,this.added=n,this.options=r}normalizeExpressionName(){return this.displayName.toLowerCase()}copy(){return new a(this.displayName,this.address,this.added,this.options)}}class s{constructor(){this.mapping=new Map}has(e){return this.mapping.has(this.normalizeExpressionName(e))}isNameAvailable(e){const t=this.normalizeExpressionName(e),n=this.mapping.get(t);return!(n&&n.added)}add(e){this.mapping.set(e.normalizeExpressionName(),e)}get(e){return this.mapping.get(this.normalizeExpressionName(e))}getExisting(e){const t=this.mapping.get(this.normalizeExpressionName(e));return t&&t.added?t:void 0}remove(e){const t=this.normalizeExpressionName(e),n=this.mapping.get(t);n&&(n.added=!1)}getAllNamedExpressions(){return Array.from(this.mapping.values()).filter(e=>e.added)}normalizeExpressionName(e){return e.toLowerCase()}}class u{constructor(){this.mapping=new Map}add(e){this.mapping.set(this.normalizeExpressionName(e.displayName),e)}get(e){return this.mapping.get(this.normalizeExpressionName(e))}has(e){return this.mapping.has(this.normalizeExpressionName(e))}getAllNamedExpressions(){return Array.from(this.mapping.values()).filter(e=>e.added)}isNameAvailable(e){const t=this.normalizeExpressionName(e);return!this.mapping.has(t)}remove(e){const t=this.normalizeExpressionName(e);this.mapping.get(t)&&this.mapping.delete(t)}normalizeExpressionName(e){return e.toLowerCase()}}class l{constructor(){this.nextNamedExpressionRow=0,this.workbookStore=new s,this.worksheetStores=new Map,this.addressCache=new Map}isNameAvailable(e,t){var n,r;return void 0===t?this.workbookStore.isNameAvailable(e):null===(r=null===(n=this.worksheetStore(t))||void 0===n?void 0:n.isNameAvailable(e))||void 0===r||r}namedExpressionInAddress(e){const t=this.addressCache.get(e);return t&&t.added?t:void 0}namedExpressionForScope(e,t){var n;return void 0===t?this.workbookStore.getExisting(e):null===(n=this.worksheetStore(t))||void 0===n?void 0:n.get(e)}nearestNamedExpression(e,t){var n,r;return null!==(r=null===(n=this.worksheetStore(t))||void 0===n?void 0:n.get(e))&&void 0!==r?r:this.workbookStore.getExisting(e)}isExpressionInScope(e,t){var n,r;return null!==(r=null===(n=this.worksheetStore(t))||void 0===n?void 0:n.has(e))&&void 0!==r&&r}isNameValid(e){const t=new RegExp(`^${i.CELL_REFERENCE_PATTERN}$`),n=new RegExp(`^${i.R1C1_CELL_REFERENCE_PATTERN}$`),r=new RegExp(`^${i.NAMED_EXPRESSION_PATTERN}$`);return!t.test(e)&&!n.test(e)&&r.test(e)}addNamedExpression(e,t,n){const r=void 0===t?this.workbookStore:this.worksheetStoreOrCreate(t);let o=r.get(e);return void 0!==o?(o.added=!0,o.displayName=e,o.options=n):(o=new a(e,this.nextAddress(),!0,n),r.add(o)),this.addressCache.set(o.address.row,o),o}restoreNamedExpression(e,t){const n=void 0===t?this.workbookStore:this.worksheetStoreOrCreate(t);return e.added=!0,n.add(e),this.addressCache.set(e.address.row,e),e}namedExpressionOrPlaceholder(e,t){var n;return null!==(n=this.worksheetStoreOrCreate(t).get(e))&&void 0!==n?n:this.workbookNamedExpressionOrPlaceholder(e)}workbookNamedExpressionOrPlaceholder(e){let t=this.workbookStore.get(e);return void 0===t&&(t=new a(e,this.nextAddress(),!1),this.workbookStore.add(t)),t}remove(e,t){let n;n=void 0===t?this.workbookStore:this.worksheetStore(t);const r=null==n?void 0:n.get(e);if(void 0===n||void 0===r||!r.added)throw Error("Named expression does not exist");n.remove(e),n instanceof u&&0===n.mapping.size&&this.worksheetStores.delete(t),this.addressCache.delete(r.address.row)}getAllNamedExpressionsNamesInScope(e){return this.getAllNamedExpressions().filter(({scope:t})=>t===e).map(e=>e.expression.displayName)}getAllNamedExpressionsNames(){return this.getAllNamedExpressions().map(e=>e.expression.displayName)}getAllNamedExpressions(){const e=[];return this.workbookStore.getAllNamedExpressions().forEach(t=>{e.push({expression:t,scope:void 0})}),this.worksheetStores.forEach((t,n)=>{t.getAllNamedExpressions().forEach(t=>{e.push({expression:t,scope:n})})}),e}getAllNamedExpressionsForScope(e){var t,n;return void 0===e?this.workbookStore.getAllNamedExpressions():null!==(n=null===(t=this.worksheetStores.get(e))||void 0===t?void 0:t.getAllNamedExpressions())&&void 0!==n?n:[]}worksheetStoreOrCreate(e){let t=this.worksheetStores.get(e);return t||(t=new u,this.worksheetStores.set(e,t)),t}worksheetStore(e){return this.worksheetStores.get(e)}nextAddress(){return Object(r.simpleCellAddress)(l.SHEET_FOR_WORKBOOK_EXPRESSIONS,0,this.nextNamedExpressionRow++)}}l.SHEET_FOR_WORKBOOK_EXPRESSIONS=-1;const c=e=>{switch(e.type){case o.AstNodeType.EMPTY:case o.AstNodeType.NUMBER:case o.AstNodeType.STRING:case o.AstNodeType.ERROR:case o.AstNodeType.ERROR_WITH_RAW_INPUT:return!1;case o.AstNodeType.CELL_REFERENCE:return!e.reference.isAbsolute();case o.AstNodeType.CELL_RANGE:case o.AstNodeType.COLUMN_RANGE:case o.AstNodeType.ROW_RANGE:return!e.start.isAbsolute();case o.AstNodeType.NAMED_EXPRESSION:return!1;case o.AstNodeType.PERCENT_OP:case o.AstNodLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class b{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return _(this.indexes)}rowsSpans(){return this.normalizedIndexes().map(e=>S.RowsSpan.fromNumberOfRows(this.sheet,e[0],e[1]))}}class A{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return k(this.indexes)}rowsSpans(){return this.normalizedIndexes().map(e=>S.RowsSpan.fromNumberOfRows(this.sheet,e[0],e[1]))}}class N{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return k(this.indexes)}columnsSpans(){return this.normalizedIndexes().map(e=>S.ColumnsSpan.fromNumberOfColumns(this.sheet,e[0],e[1]))}}class M{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return _(this.indexes)}columnsSpans(){return this.normalizedIndexes().map(e=>S.ColumnsSpan.fromNumberOfColumns(this.sheet,e[0],e[1]))}}class I{constructor(e,t,n,r,o,i,a,s,u){this.dependencyGraph=t,this.columnSearch=n,this.cellContentParser=r,this.parser=o,this.stats=i,this.lazilyTransformingAstService=a,this.namedExpressions=s,this.arraySizePredictor=u,this.changes=l.ContentChanges.empty(),this.allocateNamedExpressionAddressSpace(),this.maxColumns=e.maxColumns,this.maxRows=e.maxRows}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}removeRows(e){const t=[];for(const n of e.rowsSpans()){const e=this.doRemoveRows(n);e&&t.push(e)}return t}addRows(e){for(const t of e.rowsSpans())this.doAddRows(t)}addColumns(e){for(const t of e.columnsSpans())this.doAddColumns(t)}removeColumns(e){const t=[];for(const n of e.columnsSpans()){const e=this.doRemoveColumns(n);e&&t.push(e)}return t}removeSheet(e){let t;this.dependencyGraph.removeSheet(e),this.stats.measure(O.StatType.TRANSFORM_ASTS,()=>{const n=new y.RemoveSheetTransformer(e);n.performEagerTransformations(this.dependencyGraph,this.parser),t=this.lazilyTransformingAstService.addTransformation(n)}),this.sheetMapping.removeSheet(e),this.columnSearch.removeSheet(e);const n=this.namedExpressions.getAllNamedExpressionsForScope(e).map(t=>this.removeNamedExpression(t.normalizeExpressionName(),e));return{version:t,scopedNamedExpressions:n}}removeSheetByName(e){const t=this.sheetMapping.fetch(e);return this.removeSheet(t)}clearSheet(e){this.dependencyGraph.clearSheet(e),this.columnSearch.removeSheet(e)}addSheet(e){const t=this.sheetMapping.addSheet(e),n=[];return this.dependencyGraph.addressMapping.autoAddSheet(t,n,Object(w.findBoundaries)(n)),this.sheetMapping.fetchDisplayName(t)}renameSheet(e,t){return this.sheetMapping.renameSheet(e,t)}moveRows(e,t,n,r){const o=S.RowsSpan.fromNumberOfRows(e,r,n);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddRows(o),r<t&&(t+=n);const i=Object(a.simpleCellAddress)(e,0,t),s=Object(a.simpleCellAddress)(e,0,r);this.moveCells(i,Number.POSITIVE_INFINITY,n,s);const u=S.RowsSpan.fromNumberOfRows(e,t,n);return this.doRemoveRows(u),this.lazilyTransformingAstService.commitCombinedMode()}moveColumns(e,t,n,r){const o=S.ColumnsSpan.fromNumberOfColumns(e,r,n);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddColumns(o),r<t&&(t+=n);const i=Object(a.simpleCellAddress)(e,t,0),s=Object(a.simpleCellAddress)(e,r,0);this.moveCells(i,n,Number.POSITIVE_INFINITY,s);const u=S.ColumnsSpan.fromNumberOfColumns(e,t,n);return this.doRemoveColumns(u),this.lazilyTransformingAstService.commitCombinedMode()}moveCells(e,t,n,o){this.ensureItIsPossibleToMoveCells(e,t,n,o);const i=r.AbsoluteCellRange.spanFrom(e,t,n),a=r.AbsoluteCellRange.spanFrom(o,t,n),s=o.col-e.col,u=o.row-e.row,l=o.sheet,c=this.getRangeClipboardCells(a),d=this.dependencyGraph.rawValuesFromRange(a);this.columnSearch.removeValues(d);const h=this.dependencyGraph.rawValuesFromRange(i);let f;this.columnSearch.moveValues(h,s,u,l),this.stats.measure(O.StatType.TRANSFORM_ASTS,()=>{const e=new g.MoveCellsTransformer(i,s,u,l);e.performEagerTransformations(this.dependencyGraph,this.parser),f=this.lazilyTransformingAstService.addTransformation(e)}),this.dependencyGraph.moveCells(i,s,u,l);const p=this.updateNamedExpressionsForMovedCells(e,t,n,o);return{version:f,overwrittenCellsData:c,addedGlobalNamedExpressions:p}}setRowOrder(e,t){const n=[];let o=[];for(const[i,a]of t)if(i!==a){const t=r.AbsoluteCellRange.spanFrom({sheet:e,col:0,row:i},1/0,1),s=this.getRangeClipboardCells(t);o=o.concat(s),n.push(s.map(([{sheet:e,col:t},n])=>[{sheet:e,col:t,row:a},n]))}return n.forEach(t=>this.restoreClipboardCells(e,t.values())),o}setColumnOrder(e,t){const n=[];let o=[];for(const[i,a]of t)if(i!==a){const t=r.AbsoluteCellRange.spanFrom({sheet:e,col:i,row:0},1,1/0),s=this.getRangeClipboardCells(t);o=o.concat(s),n.push(s.map(([{sheet:e,col:t,row:n},r])=>[{sheet:e,col:a,row:n},r]))}return n.forEach(t=>this.restoreClipboardCells(e,t.values())),o}addNamedExpression(e,t,n,r){const o=this.namedExpressions.addNamedExpression(e,n,r);this.storeNamedExpressionInCell(o.address,t),this.adjustNamedExpressionEdges(o,e,n)}restoreNamedExpression(e,t,n){const r=e.displayName;this.restLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class c{constructor(e,t){this.address=e,this.newValue=t}get col(){return this.address.col}get row(){return this.address.row}get sheet(){return this.address.sheet}get value(){return this.newValue}}class d{constructor(e,t){this.name=e,this.newValue=t}}class h{constructor(e,t,n,r){this.config=e,this.namedExpressions=t,this.sheetIndexMapping=n,this.lazilyTransformingService=r}exportChange(e){const t=e.value,n=e.address;if(n.sheet===u.NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS){const e=this.namedExpressions.namedExpressionInAddress(n.row);if(!e)throw new Error("Missing named expression");return new d(e.displayName,this.exportScalarOrRange(t))}if(t instanceof s.SimpleRangeValue){const e=[];for(const[r,o]of t.entriesFromTopLeftCorner(n))e.push(new c(o,this.exportValue(r)));return e}return new c(n,this.exportValue(t))}exportValue(e){return e instanceof s.SimpleRangeValue?this.detailedError(new r.CellError(r.ErrorType.VALUE,i.ErrorMessage.ScalarExpected)):this.config.smartRounding&&Object(a.isExtendedNumber)(e)?this.cellValueRounding(Object(a.getRawValue)(e)):e instanceof r.CellError?this.detailedError(e):e===a.EmptyValue?null:Object(a.getRawValue)(e)}exportScalarOrRange(e){return e instanceof s.SimpleRangeValue?e.rawData().map(e=>e.map(e=>this.exportValue(e))):this.exportValue(e)}detailedError(e){var t,n;let r=void 0;const i=null===(t=e.root)||void 0===t?void 0:t.getAddress(this.lazilyTransformingService);return void 0!==i&&(r=i.sheet===u.NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS?null===(n=this.namedExpressions.namedExpressionInAddress(i.row))||void 0===n?void 0:n.displayName:Object(l.simpleCellAddressToString)(this.sheetIndexMapping,i,-1)),new o.DetailedCellError(e,this.config.translationPackage.getErrorTranslation(e.type),r)}cellValueRounding(e){if(0===e)return e;const t=Math.floor(Math.log10(Math.abs(e))),n=Math.pow(10,this.config.precisionRounding-t);return e<0?-Math.round(-e*n)/n:Math.round(e*n)/n}}},function(e,t,n){"use strict";n.r(t);var r=n(26);n.d(t,"FunctionPlugin",(function(){return r.FunctionPlugin})),n.d(t,"FunctionArgumentType",(function(){return r.FunctionArgumentType}))},function(e,t,n){var r=n(30),o=0,i=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},function(e,t,n){var r=n(44),o=n(63),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,n){var r=n(388),o=n(170);e.exports=function(e){var t=r(e,"string");return o(t)?t:t+""}},function(e,t,n){var r=n(140),o=n(211),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);t.f=i?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(28),o=n(49),i=/#|\.prototype\./,a=function(e,t){var n=u[s(e)];return n==c||n!=l&&(o(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},u=a.data={},l=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},function(e,t,n){var r=n(54),o=n(49),i=n(83),a=n(214),s=n(397),u=a("IE_PROTO"),l=Object,c=l.prototype;e.exports=s?l.getPrototypeOf:function(e){var t=i(e);if(r(t,u))return t[u];var n=t.constructor;return o(n)&&t instanceof n?n.prototype:t instanceof l?c:null}},function(e,t,n){var r=n(84).f,o=n(54),i=n(48)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!o(e,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(271),o=n(49),i=n(102),a=n(48)("toStringTag"),s=Object,u="Arguments"==i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?n:u?i(t):"Object"==(r=i(t))&&o(t.callee)?"Arguments":r}},function(e,t,n){"use strict";var r=n(22),o=n(44),i=n(30),a=n(217),s=n(98),u=n(177),l=n(277),c=n(279),d=n(49),h=n(97),f=n(63),p=n(28),g=n(402),m=n(219),v=n(280);e.exports=function(e,t,n){var y=-1!==e.indexOf("Map"),E=-1!==e.indexOf("Weak"),T=y?"set":"add",C=o[e],R=C&&C.prototype,w=C,S={},O=function(e){var t=i(R[e]);s(R,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(E&&!f(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return E&&!f(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(E&&!f(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(a(e,!d(C)||!(E||R.forEach&&!p((function(){(new C).entries().next()})))))w=n.getConstructor(t,e,y,T),u.enable();else if(a(e,!0)){var b=new w,A=b[T](E?{}:-0,1)!=b,N=p((function(){b.has(1)})),M=g((function(e){new C(e)})),I=!E&&p((function(){for(var e=new C,t=5;t--;)e[T](t,t);return!e.has(-0)}));M||((w=t((function(e,t){c(e,R);var n=v(new C,e,w);return h(t)||l(t,n[T],{that:n,AS_ENTRIES:y}),n}))).prototype=R,R.constructor=w),(N||I)&&(O("delete"),O("has"),y&&O("get")),(I||A)&&O(T),E&&R.clear&&delete R.clear}return S[e]=w,r({global:!0,constructor:!0,forced:w!=C}Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class g extends c.HyperFormula{}g.HyperFormula=c.HyperFormula,g.ErrorType=o.ErrorType,g.CellError=o.CellError,g.CellType=o.CellType,g.CellValueType=o.CellValueType,g.CellValueDetailedType=o.CellValueDetailedType,g.DetailedCellError=i.DetailedCellError,g.ExportedCellChange=l.ExportedCellChange,g.ExportedNamedExpressionChange=l.ExportedNamedExpressionChange,g.ConfigValueTooBigError=u.ConfigValueTooBigError,g.ConfigValueTooSmallError=u.ConfigValueTooSmallError,g.EvaluationSuspendedError=u.EvaluationSuspendedError,g.ExpectedOneOfValuesError=u.ExpectedOneOfValuesError,g.ExpectedValueOfTypeError=u.ExpectedValueOfTypeError,g.ArraySize=r.ArraySize,g.SimpleRangeValue=p.SimpleRangeValue,g.FunctionPlugin=h.FunctionPlugin,g.FunctionArgumentType=h.FunctionArgumentType,g.FunctionPluginValidationError=u.FunctionPluginValidationError,g.InvalidAddressError=u.InvalidAddressError,g.InvalidArgumentsError=u.InvalidArgumentsError,g.LanguageNotRegisteredError=u.LanguageNotRegisteredError,g.LanguageAlreadyRegisteredError=u.LanguageAlreadyRegisteredError,g.MissingTranslationError=u.MissingTranslationError,g.NamedExpressionDoesNotExistError=u.NamedExpressionDoesNotExistError,g.NamedExpressionNameIsAlreadyTakenError=u.NamedExpressionNameIsAlreadyTakenError,g.NamedExpressionNameIsInvalidError=u.NamedExpressionNameIsInvalidError,g.NoOperationToRedoError=u.NoOperationToRedoError,g.NoOperationToUndoError=u.NoOperationToUndoError,g.NoRelativeAddressesAllowedError=u.NoRelativeAddressesAllowedError,g.NoSheetWithIdError=u.NoSheetWithIdError,g.NoSheetWithNameError=u.NoSheetWithNameError,g.NotAFormulaError=u.NotAFormulaError,g.NothingToPasteError=u.NothingToPasteError,g.ProtectedFunctionTranslationError=u.ProtectedFunctionTranslationError,g.SheetNameAlreadyTakenError=u.SheetNameAlreadyTakenError,g.SheetSizeLimitExceededError=u.SheetSizeLimitExceededError,g.SourceLocationHasArrayError=u.SourceLocationHasArrayError,g.TargetLocationHasArrayError=u.TargetLocationHasArrayError,g.UnableToParseError=u.UnableToParseError;const m=a.Config.defaultConfig.language;c.HyperFormula.registerLanguage(m,d.default),c.HyperFormula.languages[d.default.langCode]=d.default;for(const e of Object.getOwnPropertyNames(f))e.startsWith("_")||c.HyperFormula.registerFunctionPlugin(f[e]);t.default=g,window.HyperFormula=n(238).default},function(e,t,n){"use strict";n.r(t),n.d(t,"VERSION",(function(){return r}));var r="6.5.0"},function(e,t,n){"use strict";n.r(t),n.d(t,"RestWalker",(function(){return i}));var r=n(38),o=n(45),i=function(){function e(){}return e.prototype.walk=function(e,t){var n=this;void 0===t&&(t=[]),Object(r.forEach)(e.definition,(function(i,a){var s=Object(r.drop)(e.definition,a+1);if(i instanceof o.NonTerminal)n.walkProdRef(i,s,t);else if(i instanceof o.Terminal)n.walkTerminal(i,s,t);else if(i instanceof o.Flat)n.walkFlat(i,s,t);else if(i instanceof o.Option)n.walkOption(i,s,t);else if(i instanceof o.RepetitionMandatory)n.walkAtLeastOne(i,s,t);else if(i instanceof o.RepetitionMandatoryWithSeparator)n.walkAtLeastOneSep(i,s,t);else if(i instanceof o.RepetitionWithSeparator)n.walkManySep(i,s,t);else if(i instanceof o.Repetition)n.walkMany(i,s,t);else{if(!(i instanceof o.Alternation))throw Error("non exhaustive match");n.walkOr(i,s,t)}}))},e.prototype.walkTerminal=function(e,t,n){},e.prototype.walkProdRef=function(e,t,n){},e.prototype.walkFlat=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkOption=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkAtLeastOne=function(e,t,n){var r=[new o.Option({definition:e.definition})].concat(t,n);this.walk(e,r)},e.prototype.walkAtLeastOneSep=function(e,t,n){var r=a(e,t,n);this.walk(e,r)},e.prototype.walkMany=function(e,t,n){var r=[new o.Option({definition:e.definition})].concat(t,n);this.walk(e,r)},e.prototype.walkManySep=function(e,t,n){var r=a(e,t,n);this.walk(e,r)},e.prototype.walkOr=function(e,t,n){var i=this,a=t.concat(n);Object(r.forEach)(e.definition,(function(e){var t=new o.Flat({definition:[e]});i.walk(t,a)}))},e}();function a(e,t,n){return[new o.Option({definition:[new o.Terminal({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}},function(e,t,n){var r,o,i;"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){function e(){}e.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},e.prototype.restoreState=function(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx},e.prototype.pattern=function(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");var t=this.disjunction();this.consumeChar("/");for(var n={type:"Flags",global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":s(n,"global");break;case"i":s(n,"ignoreCase");break;case"m":s(n,"multiLine");break;case"u":s(n,"unicode");break;case"y":s(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,valueLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class c extends r.EmbeddedActionsParser{constructor(e,t){super(e.allTokens,{outputCst:!1,maxLookahead:7}),this.booleanExpressionOrEmpty=this.RULE("booleanExpressionOrEmpty",()=>this.OR([{ALT:()=>this.SUBRULE(this.booleanExpression)},{ALT:Object(r.EMPTY_ALT)(Object(s.buildEmptyArgAst)())}])),this.procedureExpression=this.RULE("procedureExpression",()=>{var e;const t=this.CONSUME(l.ProcedureName),n=t.image.toUpperCase().slice(0,-1),r=null!==(e=this.lexerConfig.functionMapping[n])&&void 0!==e?e:n,o=[];let i=this.SUBRULE(this.booleanExpressionOrEmpty);this.MANY(()=>{var e;const t=this.CONSUME(this.lexerConfig.ArgSeparator);i.type===s.AstNodeType.EMPTY&&(i.leadingWhitespace=null===(e=t.leadingWhitespace)||void 0===e?void 0:e.image),o.push(i),i=this.SUBRULE2(this.booleanExpressionOrEmpty)}),o.push(i),1===o.length&&o[0].type===s.AstNodeType.EMPTY&&(o.length=0);const a=this.CONSUME(l.RParen);return Object(s.buildProcedureAst)(r,o,t.leadingWhitespace,a.leadingWhitespace)}),this.namedExpressionExpression=this.RULE("namedExpressionExpression",()=>{const e=this.CONSUME(l.NamedExpression);return Object(s.buildNamedExpressionAst)(e.image,e.leadingWhitespace)}),this.offsetProcedureExpression=this.RULE("offsetProcedureExpression",()=>{const e=[];return this.CONSUME(this.lexerConfig.OffsetProcedureName),this.CONSUME(l.LParen),this.MANY_SEP({SEP:this.lexerConfig.ArgSeparator,DEF:()=>{e.push(this.SUBRULE(this.booleanExpression))}}),this.CONSUME(l.RParen),this.handleOffsetHeuristic(e)}),this.columnRangeExpression=this.RULE("columnRangeExpression",()=>{const e=this.CONSUME(l.ColumnRange),[t,n]=e.image.split(":"),r=this.ACTION(()=>Object(a.columnAddressFromString)(this.sheetMapping,t,this.formulaAddress)),i=this.ACTION(()=>Object(a.columnAddressFromString)(this.sheetMapping,n,this.formulaAddress));if(void 0===r||void 0===i)return Object(s.buildCellErrorAst)(new o.CellError(o.ErrorType.REF));if(r.exceedsSheetSizeLimits(this.lexerConfig.maxColumns)||i.exceedsSheetSizeLimits(this.lexerConfig.maxColumns))return Object(s.buildErrorWithRawInputAst)(e.image,new o.CellError(o.ErrorType.NAME),e.leadingWhitespace);if(void 0===r.sheet&&void 0!==i.sheet)return this.parsingError(s.ParsingErrorType.ParserError,"Malformed range expression");const{firstEnd:u,secondEnd:d,sheetRefType:h}=c.fixSheetIdsForRangeEnds(r,i);return Object(s.buildColumnRangeAst)(u,d,h,e.leadingWhitespace)}),this.rowRangeExpression=this.RULE("rowRangeExpression",()=>{const e=this.CONSUME(l.RowRange),[t,n]=e.image.split(":"),r=this.ACTION(()=>Object(a.rowAddressFromString)(this.sheetMapping,t,this.formulaAddress)),i=this.ACTION(()=>Object(a.rowAddressFromString)(this.sheetMapping,n,this.formulaAddress));if(void 0===r||void 0===i)return Object(s.buildCellErrorAst)(new o.CellError(o.ErrorType.REF));if(r.exceedsSheetSizeLimits(this.lexerConfig.maxRows)||i.exceedsSheetSizeLimits(this.lexerConfig.maxRows))return Object(s.buildErrorWithRawInputAst)(e.image,new o.CellError(o.ErrorType.NAME),e.leadingWhitespace);if(void 0===r.sheet&&void 0!==i.sheet)return this.parsingError(s.ParsingErrorType.ParserError,"Malformed range expression");const{firstEnd:u,secondEnd:d,sheetRefType:h}=c.fixSheetIdsForRangeEnds(r,i);return Object(s.buildRowRangeAst)(u,d,h,e.leadingWhitespace)}),this.cellReference=this.RULE("cellReference",()=>{const e=this.CONSUME(l.CellReference),t=this.ACTION(()=>Object(a.cellAddressFromString)(this.sheetMapping,e.image,this.formulaAddress));return void 0===t?Object(s.buildErrorWithRawInputAst)(e.image,new o.CellError(o.ErrorType.REF),e.leadingWhitespace):t.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?Object(s.buildErrorWithRawInputAst)(e.image,new o.CellError(o.ErrorType.NAME),e.leadingWhitespace):Object(s.buildCellReferenceAst)(t,e.leadingWhitespace)}),this.endRangeReference=this.RULE("endRangeReference",e=>{var t;const n=this.CONSUME(l.CellReference),r=this.ACTION(()=>Object(a.cellAddressFromString)(this.sheetMapping,e.image,this.formulaAddress)),i=this.ACTION(()=>Object(a.cellAddressFromString)(this.sheetMapping,n.image,this.formulaAddress));return void 0===r||void 0===i?this.ACTION(()=>Object(s.buildErrorWithRawInputAst)(`${e.image}:${n.image}`,new o.CellError(o.ErrorType.REF),e.leadingWhitespace)):r.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)||i.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?this.ACTION(()=>Object(s.buildErrorWithRawInputAst)(`${e.image}:${n.image}`,new o.CellError(o.ErrorType.NAME),e.leadingWhitespace)):this.buildCellRange(r,i,null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image)}),this.endOfRangeExpression=this.RULE("endOfRangeExpression",e=>this.OR([{ALT:()=>this.SUBRULE(this.endRangeReference,{ARGS:[e]})},{ALT:()=>{var t;const n=this.SUBRULE(this.offsetProcedureExpression),r=this.ACTION(()=>Object(a.cellAddressFromString)(this.sheetMapping,e.image,this.formulaAddress));return void 0===r?Object(s.buildCellErrorAst)(new o.CellError(o.ErrorType.RELine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class u{constructor(e,t,n,r){this.config=e,this.lexerConfig=t,this.sheetMappingFn=n,this.namedExpressions=r}unparse(e,t){return"="+this.unparseAst(e,t)}unparseAst(e,t){var n,o;switch(e.type){case a.AstNodeType.EMPTY:return Object(a.imageWithWhitespace)("",e.leadingWhitespace);case a.AstNodeType.NUMBER:return Object(a.imageWithWhitespace)(l(e.value,this.config.decimalSeparator),e.leadingWhitespace);case a.AstNodeType.STRING:return Object(a.imageWithWhitespace)('"'+e.value+'"',e.leadingWhitespace);case a.AstNodeType.FUNCTION_CALL:{const n=e.args.map(e=>void 0!==e?this.unparseAst(e,t):"").join(this.config.functionArgSeparator),r=(this.config.translationPackage.isFunctionTranslated(e.procedureName)?this.config.translationPackage.getFunctionTranslation(e.procedureName):e.procedureName)+"("+n+Object(a.imageWithWhitespace)(")",e.internalWhitespace);return Object(a.imageWithWhitespace)(r,e.leadingWhitespace)}case a.AstNodeType.NAMED_EXPRESSION:{const r=null===(n=this.namedExpressions.nearestNamedExpression(e.expressionName,t.sheet))||void 0===n?void 0:n.displayName;return Object(a.imageWithWhitespace)(r||e.expressionName,e.leadingWhitespace)}case a.AstNodeType.CELL_REFERENCE:{let n;return n=void 0!==e.reference.sheet?this.unparseSheetName(e.reference.sheet)+"!":"",n+=null!==(o=e.reference.unparse(t))&&void 0!==o?o:this.config.translationPackage.getErrorTranslation(r.ErrorType.REF),Object(a.imageWithWhitespace)(n,e.leadingWhitespace)}case a.AstNodeType.COLUMN_RANGE:case a.AstNodeType.ROW_RANGE:case a.AstNodeType.CELL_RANGE:return Object(a.imageWithWhitespace)(this.formatRange(e,t),e.leadingWhitespace);case a.AstNodeType.PLUS_UNARY_OP:{const n=this.unparseAst(e.value,t);return Object(a.imageWithWhitespace)("+",e.leadingWhitespace)+n}case a.AstNodeType.MINUS_UNARY_OP:{const n=this.unparseAst(e.value,t);return Object(a.imageWithWhitespace)("-",e.leadingWhitespace)+n}case a.AstNodeType.PERCENT_OP:return this.unparseAst(e.value,t)+Object(a.imageWithWhitespace)("%",e.leadingWhitespace);case a.AstNodeType.ERROR:{const t=this.config.translationPackage.getErrorTranslation(e.error?e.error.type:r.ErrorType.ERROR);return Object(a.imageWithWhitespace)(t,e.leadingWhitespace)}case a.AstNodeType.ERROR_WITH_RAW_INPUT:return Object(a.imageWithWhitespace)(e.rawInput,e.leadingWhitespace);case a.AstNodeType.PARENTHESIS:{const n="("+this.unparseAst(e.expression,t)+Object(a.imageWithWhitespace)(")",e.internalWhitespace);return Object(a.imageWithWhitespace)(n,e.leadingWhitespace)}case a.AstNodeType.ARRAY:{const n="{"+e.args.map(e=>e.map(e=>this.unparseAst(e,t)).join(this.config.arrayColumnSeparator)).join(this.config.arrayRowSeparator)+Object(a.imageWithWhitespace)("}",e.internalWhitespace);return Object(a.imageWithWhitespace)(n,e.leadingWhitespace)}default:{const n=this.unparseAst(e.left,t),r=this.unparseAst(e.right,t);return n+Object(a.imageWithWhitespace)(s.binaryOpTokenMap[e.type],e.leadingWhitespace)+r}}}unparseSheetName(e){const t=Object(i.sheetIndexToString)(e,this.sheetMappingFn);if(void 0===t)throw new o.NoSheetWithIdError(e);return t}formatRange(e,t){let n="",o="";void 0!==e.start.sheet&&e.sheetReferenceType!==a.RangeSheetReferenceType.RELATIVE&&(n=this.unparseSheetName(e.start.sheet)+"!"),void 0!==e.end.sheet&&e.sheetReferenceType===a.RangeSheetReferenceType.BOTH_ABSOLUTE&&(o=this.unparseSheetName(e.end.sheet)+"!");const i=e.start.unparse(t),s=e.end.unparse(t);return void 0===i||void 0===s?this.config.translationPackage.getErrorTranslation(r.ErrorType.REF):`${n}${i}:${o}${s}`}}function l(e,t){return e.toString().replace(".",t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"ContentChanges",(function(){return i}));var r=n(17),o=n(69);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i{constructor(){this.changes=new Map}static empty(){return new i}addAll(e){for(const t of e.changes.values())this.add(t.address,t);return this}addChange(e,t,n){this.addInterpreterValue(e,t,n)}exportChanges(e){let t=[];return this.changes.forEach(n=>{const r=e.exportChange(n);Array.isArray(r)?t=t.concat(r):t.push(r)}),t}getChanges(){return Array.from(this.changes.values())}isEmpty(){return 0===this.changes.size}add(e,t){const n=t.value;if(n instanceof o.SimpleRangeValue)for(const t of n.effectiveAddressesFromData(e))this.changes.delete(`${t.sheet},${t.col},${t.row}`);this.changes.set(Object(r.addressKey)(e),t)}addInterpreterValue(e,t,n){this.add(t,{address:t,value:e,oldValue:n})}}},function(e,t,n){"use strict";n.r(t),n.d(t,"Statistics",(function(){return o}));var r=n(250);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o{constructor(){this.stats=new Map([[r.StatType.CRITERION_FUNCTION_FULL_CACHE_USED,0],[r.StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED,0]]),this.startTimes=new Map}incrementCriterionFunctionFullCacheUsed(){var e;const t=(null!==(e=this.stats.get(r.StatType.CRITERION_FUNCTION_FULL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(r.StatType.CRITERION_FUNCTION_FULL_CACHE_USED,t)}incrementCriterionFunctionPartialCacheUsed(){var e;const t=(null!==(e=this.stats.get(r.StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(r.StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED,t)}reset(){this.stats.clear(),this.startTimes.clear(),this.stats.set(r.StatType.CRITERION_FUNCTION_FULL_CACHE_USED,0),this.stats.set(r.StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED,0)}start(e){if(this.startTimes.get(e))throw Error(`Statistics ${e} already started`);this.startTimes.set(e,Date.now())}end(e){var t;const n=Date.now(),r=this.startTimes.get(e);if(!r)throw Error(`Statistics ${e} not started`);{let o=null!==(t=this.stats.get(e))&&void 0!==t?t:0;o+=n-r,this.stats.set(e,o),this.startTimes.delete(e)}}measure(e,t){this.start(e);const n=t();return this.end(e),n}snapshot(){return new Map(this.stats)}}},function(e,t,n){"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
var r;n.r(t),n.d(t,"StatType",(function(){return r})),function(e){e.BUILD_ENGINE_TOTAL="BUILD_ENGINE_TOTAL",e.PARSER="PARSER",e.GRAPH_BUILD="GRAPH_BUILD",e.COLLECT_DEPENDENCIES="COLLECT_DEPENDENCIES",e.PROCESS_DEPENDENCIES="PROCESS_DEPENDENCIES",e.TOP_SORT="TOP_SORT",e.BUILD_COLUMN_INDEX="BUILD_COLUMN_INDEX",e.EVALUATION="EVALUATION",e.VLOOKUP="VLOOKUP",e.TRANSFORM_ASTS="TRANSFORM_ASTS",e.TRANSFORM_ASTS_POSTPONED="TRANSFORM_ASTS_POSTPONED",e.ADJUSTING_ADDRESS_MAPPING="ADJUSTING_ADDRESS_MAPPING",e.ADJUSTING_ARRAY_MAPPING="ADJUSTING_ARRAY_MAPPING",e.ADJUSTING_RANGES="ADJUSTING_RANGES",e.ADJUSTING_GRAPH="ADJUSTING_GRAPH",e.CRITERION_FUNCTION_FULL_CACHE_USED="CRITERION_FUNCTION_FULL_CACHE_USED",e.CRITERION_FUNCTION_PARTIAL_CACHE_USED="CRITERION_FUNCTION_PARTIAL_CACHE_USED"}(r||(r={}))},function(e,t,n){"use strict";n.r(t),n.d(t,"AddressMapping",(function(){return a}));var r=n(29),o=n(43),i=n(112);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a{constructor(e){this.policy=e,this.mapping=new Map}getCell(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new r.NoSheetWithIdError(e.sheet);return t.getCell(e)}fetchCell(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new r.NoSheetWithIdError(e.sheet);const n=t.getCell(e);if(!n)throw Error("Vertex for address missing in AddressMapping");return n}strategyFor(e){const t=this.mapping.get(e);if(void 0===t)throw new r.NoSheetWithIdError(e);return t}addSheet(e,t){if(this.mapping.has(e))throw Error("Sheet already added");this.mapping.set(e,t)}autoAddSheet(e,t,n){const{height:r,width:o,fill:i}=n,a=this.policy.call(i);this.addSheet(e,new a(o,r))}getCellValue(e){const t=this.getCell(e);return void 0===t?o.EmptyValue:t instanceof i.ArrayVertex?t.getArrayCellValue(e):t.getCellValue()}getRawValue(e){const t=this.getCell(e);return t instanceof i.ValueCellVertex?t.getValues().rawValue:t instanceof i.ArrayVertex?t.getArrayCellRawValue(e):null}setCell(e,t){const n=this.mapping.get(e.sheet);if(!n)throw Error("Sheet not initialized");n.setCell(e,t)}moveCell(e,t){const n=this.mapping.get(e.sheet);if(!n)throw Error("Sheet not initialized.");if(e.sheet!==t.sheet)throw Error("Cannot move cells between sheets.");if(n.has(t))throw new Error("Cannot move cell. Destination already occupied.");const r=n.getCell(e);if(void 0===r)throw new Error("Cannot move cell. No cell with such address.");this.setCell(t,r),this.removeCell(e)}removeCell(e){const t=this.mapping.get(e.sheet);if(!t)throw Error("Sheet not initialized");t.removeCell(e)}has(e){const t=this.mapping.get(e.sheet);return void 0!==t&&t.has(e)}getHeight(e){const t=this.mapping.get(e);if(void 0===t)throw new r.NoSheetWithIdError(e);return t.getHeight()}getWidth(e){const t=this.mapping.get(e);if(!t)throw new r.NoSheetWithIdError(e);return t.getWidth()}addRows(e,t,n){const o=this.mapping.get(e);if(void 0===o)throw new r.NoSheetWithIdError(e);o.addRows(t,n)}removeRows(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new r.NoSheetWithIdError(e.sheet);t.removeRows(e)}removeSheet(e){this.mapping.delete(e)}addColumns(e,t,n){const o=this.mapping.get(e);if(void 0===o)throw new r.NoSheetWithIdError(e);o.addColumns(t,n)}removeColumns(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new r.NoSheetWithIdError(e.sheet);t.removeColumns(e)}*verticesFromRowsSpan(e){yield*this.mapping.get(e.sheet).verticesFromRowsSpan(e)}*verticesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).verticesFromColumnsSpan(e)}*entriesFromRowsSpan(e){yield*this.mapping.get(e.sheet).entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).entriesFromColumnsSpan(e)}*entries(){for(const[e,t]of this.mapping.entries())yield*t.getEntries(e)}*sheetEntries(e){const t=this.mapping.get(e);if(void 0===t)throw new r.NoSheetWithIdError(e);yield*t.getEntries(e)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ArrayMapping",(function(){return o}));var r=n(17);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o{constructor(){this.arrayMapping=new Map}getArray(e){const t=this.getArrayByCorner(e.start);if(null==t?void 0:t.getRange().sameAs(e))return t}getArrayByCorner(e){return this.arrayMapping.get(Object(r.addressKey)(e))}setArray(e,t){this.arrayMapping.set(Object(r.addressKey)(e.start),t)}removeArray(e){"string"==typeof e?this.arrayMapping.delete(e):this.arrayMapping.delete(Object(r.addressKey)(e.start))}count(){return this.arrayMapping.size}*arraysInRows(e){for(const[t,n]of this.arrayMapping.entries())n.spansThroughSheetRows(e.sheet,e.rowStart,e.rowEnd)&&(yield[t,n])}*arraysInCols(e){for(const[t,n]of this.arrayMapping.entries())n.spansThroughSheetColumn(e.sheet,e.columnStart,e.columnEnd)&&(yield[t,n])}isFormulaArrayInRow(e,t){for(const n of this.arrayMapping.values())if(n.spansThroughSheetRows(e,t))return!0;return!1}isFormulaArrayInAllRows(e){let t=!0;for(const n of e.rows())this.isFormulaArrayInRow(e.sheet,n)||(t=!1);return t}isFormulaArrayInColumn(e,t){for(const n of this.arrayMapping.values())if(n.spansThroughSheetColumn(e,t))return!0;return!1}isFormulaArrayInAllColumns(e){let t=!0;for(const n of e.columns())this.isFormulaArrayInColumn(e.sheet,n)||(t=!1);return t}isFormulaArrayInRange(e){for(const t of this.arrayMapping.values())if(t.getRange().doesOverlap(e))return!0;return!1}isFormulaArrayAtAddress(e){for(const t of this.arrayMapping.values())if(t.getRange().addressInRange(e))return!0;return!1}moveArrayVerticesAfterRowByRows(e,t,n){this.updateArrayVerticesInSheet(e,(e,r)=>{const o=r.getRange();return t<=o.start.row?[o.shifted(0,n),r]:void 0})}moveArrayVerticesAfterColumnByColumns(e,t,n){this.updateArrayVerticesInSheet(e,(e,r)=>{const o=r.getRange();return t<=o.start.col?[o.shifted(n,0),r]:void 0})}updateArrayVerticesInSheet(e,t){const n=Array();for(const[r,o]of this.arrayMapping.entries()){if(o.sheet!==e)continue;const i=t(r,o);void 0!==i&&(this.removeArray(r),n.push(i))}n.forEach(([e,t])=>{this.setArray(e,t)})}}},function(e,t,n){"use strict";n.r(t),n.d(t,"RangeVertex",(function(){return r}));
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class r{constructor(e){this.range=e,this.functionCache=new Map,this.criterionFunctionCache=new Map,this.dependentCacheRanges=new Set,this.bruteForce=!1}get start(){return this.range.start}get end(){return this.range.end}get sheet(){return this.range.start.sheet}getFunctionValue(e){return this.functionCache.get(e)}setFunctionValue(e,t){this.functionCache.set(e,t)}getCriterionFunctionValue(e,t){var n;return null===(n=this.getCriterionFunctionValues(e).get(t))||void 0===n?void 0:n[0]}getCriterionFunctionValues(e){var t;return null!==(t=this.criterionFunctionCache.get(e))&&void 0!==t?t:new Map}setCriterionFunctionValues(e,t){this.criterionFunctionCache.set(e,t)}addDependentCacheRange(e){e!==this&&this.dependentCacheRanges.add(e)}clearCache(){this.functionCache.clear(),this.criterionFunctionCache.clear(),this.dependentCacheRanges.forEach(e=>e.criterionFunctionCache.clear()),this.dependentCacheRanges.clear()}getStart(){return this.start}getEnd(){return this.end}}},function(e,t,n){"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
var r;n.r(t),n.d(t,"Graph",(function(){return o})),function(e){e[e.ON_STACK=0]="ON_STACK",e[e.PROCESSED=1]="PROCESSED",e[e.POPPED=2]="POPPED"}(r||(r={}));class o{constructor(e){this.dependencyQuery=e,this.nodes=new Set,this.specialNodes=new Set,this.specialNodesStructuralChanges=new Set,this.specialNodesRecentlyChanged=new Set,this.infiniteRanges=new Set,this.edges=new Map}addNode(e){this.nodes.add(e),this.edges.has(e)||this.edges.set(e,new Set)}addEdge(e,t){if(!this.nodes.has(e))throw new Error("Unknown node "+e);if(!this.nodes.has(t))throw new Error("Unknown node "+t);this.edges.get(e).add(t)}removeEdge(e,t){if(!this.existsEdge(e,t))throw new Error("Edge does not exist");this.edges.get(e).delete(t)}softRemoveEdge(e,t){var n;null===(n=this.edges.get(e))||void 0===n||n.delete(t)}removeIncomingEdges(e){this.edges.forEach(t=>{t.delete(e)})}adjacentNodes(e){return this.edges.get(e)}adjacentNodesCount(e){return this.adjacentNodes(e).size}hasNode(e){return this.nodes.has(e)}nodesCount(){return this.nodes.size}edgesCount(){let e=0;return this.edges.forEach(t=>e+=t.size),e}removeNode(e){for(const t of this.adjacentNodes(e).values())this.markNodeAsSpecialRecentlyChanged(t);return this.edges.delete(e),this.nodes.delete(e),this.specialNodes.delete(e),this.specialNodesRecentlyChanged.delete(e),this.specialNodesStructuralChanges.delete(e),this.infiniteRanges.delete(e),this.removeDependencies(e)}markNodeAsSpecial(e){this.specialNodes.add(e)}markNodeAsSpecialRecentlyChanged(e){this.nodes.has(e)&&this.specialNodesRecentlyChanged.add(e)}markNodeAsChangingWithStructure(e){this.specialNodesStructuralChanges.add(e)}clearSpecialNodesRecentlyChanged(){this.specialNodesRecentlyChanged.clear()}markNodeAsInfiniteRange(e){this.infiniteRanges.add(e)}existsEdge(e,t){var n,r;return null!==(r=null===(n=this.edges.get(e))||void 0===n?void 0:n.has(t))&&void 0!==r&&r}topSortWithScc(){return this.getTopSortedWithSccSubgraphFrom(Array.from(this.nodes),()=>!0,()=>{})}getTopSortedWithSccSubgraphFrom(e,t,n){const o=new Map,i=new Map,a=new Map,s=new Set,u=new Map,l=[];let c=0;const d=new Set;e.reverse(),e.forEach(e=>{if(void 0!==u.get(e))return;const t=[e],n=[];for(u.set(e,r.ON_STACK);t.length>0;){const e=t[t.length-1];switch(u.get(e)){case r.ON_STACK:o.set(e,c),i.set(e,c),n.push(e),c++,this.adjacentNodes(e).forEach(n=>{void 0===o.get(n)&&(t.push(n),a.set(n,e),u.set(n,r.ON_STACK))}),u.set(e,r.PROCESSED);break;case r.PROCESSED:{let c;if(c=o.get(e),this.adjacentNodes(e).forEach(t=>{s.has(t)||(c=a.get(t)===e?Math.min(c,i.get(t)):Math.min(c,o.get(t)))}),i.set(e,c),c===o.get(e)){const t=[];do{t.push(n[n.length-1]),n.pop()}while(t[t.length-1]!==e);t.forEach(e=>{s.add(e)}),l.push(...t),t.length>1&&t.forEach(e=>{d.add(e)})}t.pop(),u.set(e,r.POPPED);break}case r.POPPED:t.pop()}}});const h=new Set(e),f=[],p=[];return l.reverse(),l.forEach(e=>{d.has(e)||this.adjacentNodes(e).has(e)?(p.push(e),n(e),this.adjacentNodes(e).forEach(e=>h.add(e))):(f.push(e),h.has(e)&&t(e)&&this.adjacentNodes(e).forEach(e=>h.add(e)))}),{sorted:f,cycled:p}}getDependencies(e){const t=[];return this.edges.forEach((n,r)=>{n.has(e)&&t.push(r)}),t}removeDependencies(e){const t=this.dependencyQuery(e);for(const[n,r]of t)this.softRemoveEdge(r,e);return t}}},function(e,t,n){"use strict";n.r(t),n.d(t,"RangeMapping",(function(){return i}));var r=n(77),o=n(17);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i{constructor(){this.rangeMapping=new Map}getMappingSize(e){var t,n;return null!==(n=null===(t=this.rangeMapping.get(e))||void 0===t?void 0:t.size)&&void 0!==n?n:0}setRange(e){let t=this.rangeMapping.get(e.getStart().sheet);void 0===t&&(t=new Map,this.rangeMapping.set(e.getStart().sheet,t));const n=a(e.getStart(),e.getEnd());t.set(n,e)}removeRange(e){const t=e.getStart().sheet,n=this.rangeMapping.get(t);if(void 0===n)return;const r=a(e.getStart(),e.getEnd());n.delete(r),0===n.size&&this.rangeMapping.delete(t)}getRange(e,t){const n=this.rangeMapping.get(e.sheet),r=a(e,t);return null==n?void 0:n.get(r)}fetchRange(e,t){const n=this.getRange(e,t);if(!n)throw Error("Range does not exist");return n}truncateRanges(e,t){const n=Array(),r=Array(),o=Array(),i=e.sheet;for(const[a,s]of this.entriesFromSheet(e.sheet)){const u=s.range;e.start<=t(s.range.end)&&(u.removeSpan(e),u.shouldBeRemoved()?(this.removeByKey(i,a),n.push(s)):r.push([a,s]),o.push(s))}const u=[];r.sort((e,n)=>s(e[1],n[1],t));for(const[e,t]of r){const n=a((l=t.range).start,l.end);if(n===e)continue;const r=this.getByKey(i,n);this.removeByKey(i,e),void 0!==r&&t!=r?u.push([r,t]):this.setRange(t)}var l;return{verticesToRemove:n,verticesToMerge:u,verticesWithChangedSize:o}}moveAllRangesInSheetAfterRowByRows(e,t,n){return this.updateVerticesFromSheet(e,(e,r)=>t<=r.start.row?(r.range.shiftByRows(n),{changedSize:!1,vertex:r}):t>r.start.row&&t<=r.end.row?(r.range.expandByRows(n),{changedSize:!0,vertex:r}):void 0)}moveAllRangesInSheetAfterColumnByColumns(e,t,n){return this.updateVerticesFromSheet(e,(e,r)=>t<=r.start.col?(r.range.shiftByColumns(n),{changedSize:!1,vertex:r}):t>r.start.col&&t<=r.end.col?(r.range.expandByColumns(n),{changedSize:!0,vertex:r}):void 0)}moveRangesInsideSourceRange(e,t,n,r){this.updateVerticesFromSheet(e.sheet,(o,i)=>e.containsRange(i.range)?(i.range.shiftByColumns(t),i.range.shiftByRows(n),i.range.moveToSheet(r),{changedSize:!1,vertex:i}):void 0)}removeRangesInSheet(e){if(this.rangeMapping.has(e)){const t=this.rangeMapping.get(e).values();return this.rangeMapping.delete(e),t}return[][Symbol.iterator]()}*rangesInSheet(e){const t=this.rangeMapping.get(e);t&&(yield*t.values())}*rangeVerticesContainedInRange(e){for(const t of this.rangesInSheet(e.sheet))e.containsRange(t.range)&&(yield t)}findSmallerRange(e){if(e.height()>1&&Number.isFinite(e.height())){const t=Object(o.simpleCellAddress)(e.end.sheet,e.end.col,e.end.row-1),n=this.getRange(e.start,t);if(void 0!==n){return{smallerRangeVertex:n,restRange:r.AbsoluteCellRange.fromSimpleCellAddresses(Object(o.simpleCellAddress)(e.start.sheet,e.start.col,e.end.row),e.end)}}}return{restRange:e}}*entriesFromSheet(e){const t=this.rangeMapping.get(e);t&&(yield*t.entries())}removeByKey(e,t){this.rangeMapping.get(e).delete(t)}getByKey(e,t){var n;return null===(n=this.rangeMapping.get(e))||void 0===n?void 0:n.get(t)}updateVerticesFromSheet(e,t){const n=Array();for(const[r,o]of this.entriesFromSheet(e)){const i=t(r,o);void 0!==i&&(this.removeByKey(e,r),n.push(i))}return n.forEach(e=>{this.setRange(e.vertex)}),{verticesWithChangedSize:n.filter(e=>e.changedSize).map(e=>e.vertex)}}}function a(e,t){return`${e.col},${e.row},${t.col},${t.row}`}const s=(e,t,n)=>{const r=n(e.range.start),o=n(e.range.start);if(r===o){return n(e.range.end)-n(t.range.end)}return r-o}},function(e,t,n){"use strict";n.r(t),n.d(t,"SheetMapping",(function(){return s}));var r=n(29),o=n(205);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function i(e){return e.toLowerCase()}class a{constructor(e,t){this.id=e,this.displayName=t}get canonicalName(){return i(this.displayName)}}class s{constructor(e){this.languages=e,this.mappingFromCanonicalName=new Map,this.mappingFromId=new Map,this.lastSheetId=-1,this.fetch=e=>{const t=this.mappingFromCanonicalName.get(i(e));if(void 0===t)throw new r.NoSheetWithNameError(e);return t.id},this.get=e=>{var t;return null===(t=this.mappingFromCanonicalName.get(i(e)))||void 0===t?void 0:t.id},this.fetchDisplayName=e=>this.fetchSheetById(e).displayName,this.sheetNamePrefix=e.getUITranslation(o.UIElement.NEW_SHEET_PREFIX)}addSheet(e=`${this.sheetNamePrefix}${this.lastSheetId+2}`){const t=i(e);if(this.mappingFromCanonicalName.has(t))throw new r.SheetNameAlreadyTakenError(e);this.lastSheetId++;const n=new a(this.lastSheetId,e);return this.store(n),n.id}removeSheet(e){const t=this.fetchSheetById(e);e==this.lastSheetId&&--this.lastSheetId,this.mappingFromCanonicalName.delete(t.canonicalName),this.mappingFromId.delete(t.id)}getDisplayName(e){var t;return null===(t=this.mappingFromId.get(e))||void 0===t?void 0:t.displayName}*displayNames(){for(const e of this.mappingFromCanonicalName.values())yield e.displayName}numberOfSheets(){return this.mappingFromCanonicalName.size}hasSheetWithId(e){return this.mappingFromId.has(e)}hasSheetWithName(e){return this.mappingFromCanonicalName.has(i(e))}renameSheet(e,t){const n=this.fetchSheetById(e),o=n.displayName;if(o===t)return;const a=this.mappingFromCanonicalName.get(i(t));if(void 0!==a&&a.id!==n.id)throw new r.SheetNameAlreadyTakenError(t);const s=n.canonicalName;return this.mappingFromCanonicalName.delete(s),n.displayName=t,this.store(n),o}sheetNames(){return Array.from(this.mappingFromId.values()).map(e=>e.displayName)}store(e){this.mappingFromId.set(e.id,e),this.mappingFromCanonicalName.set(e.canonicalName,e)}fetchSheetById(e){const t=this.mappingFromId.get(e);if(void 0===t)throw new r.NoSheetWithIdError(e);return t}}},function(e,t,n){"use strict";n.r(t),n.d(t,"TranslationPackage",(function(){return a})),n.d(t,"buildTranslationPackage",(function(){return s}));var r=n(17),o=n(29),i=n(205);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a{constructor(e,t,n){this.functions=e,this.errors=t,this.ui=n,this._protectedTranslations={VERSION:"VERSION"},this.checkUI(),this.checkErrors(),this.checkFunctionTranslations(this.functions),Object.assign(this.functions,this._protectedTranslations)}extendFunctions(e){this.checkFunctionTranslations(e),Object.assign(this.functions,e)}buildFunctionMapping(){return Object.keys(this.functions).reduce((e,t)=>(e[this.functions[t]]=t,e),{})}buildErrorMapping(){return Object.keys(this.errors).reduce((e,t)=>(e[this.errors[t]]=t,e),{})}isFunctionTranslated(e){return void 0!==this.functions[e]}getFunctionTranslations(e){const t=[];for(const n of e)this.isFunctionTranslated(n)&&t.push(this.functions[n]);return t}getFunctionTranslation(e){const t=this.functions[e];if(void 0===t)throw new o.MissingTranslationError("functions."+e);return t}getMaybeFunctionTranslation(e){return this.functions[e]}getErrorTranslation(e){if(e===r.ErrorType.LIC)return`#${r.ErrorType.LIC}!`;const t=this.errors[e];if(void 0===t)throw new o.MissingTranslationError("errors."+e);return t}getUITranslation(e){const t=this.ui[e];if(void 0===t)throw new o.MissingTranslationError("ui."+e);return t}checkUI(){for(const e of Object.values(i.UIElement))if(!(e in this.ui))throw new o.MissingTranslationError("ui."+e)}checkErrors(){for(const e of Object.values(r.ErrorType))if(!(e in this.errors)&&e!==r.ErrorType.LIC)throw new o.MissingTranslationError("errors."+e)}checkFunctionTranslations(e){const t=new Set(Object.getOwnPropertyNames(e));for(const e of Object.getOwnPropertyNames(this._protectedTranslations))if(t.has(e))throw new o.ProtectedFunctionTranslationError(e)}}function s(e){return new a(Object.assign({},e.functions),Object.assign({},e.errors),Object.assign({},e.ui))}},function(e,t,n){"use strict";n.r(t),n.d(t,"SparseStrategy",(function(){return o}));var r=n(17);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o{constructor(e,t){this.width=e,this.height=t,this.mapping=new Map}getCell(e){var t;return null===(t=this.mapping.get(e.col))||void 0===t?void 0:t.get(e.row)}setCell(e,t){this.width=Math.max(this.width,e.col+1),this.height=Math.max(this.height,e.row+1);let n=this.mapping.get(e.col);n||(n=new Map,this.mapping.set(e.col,n)),n.set(e.row,t)}has(e){var t;return!!(null===(t=this.mapping.get(e.col))||void 0===t?void 0:t.get(e.row))}getHeight(){return this.height}getWidth(){return this.width}removeCell(e){var t;null===(t=this.mapping.get(e.col))||void 0===t||t.delete(e.row)}addRows(e,t){this.mapping.forEach(n=>{const r=new Map;n.forEach((o,i)=>{i>=e&&(r.set(i+t,o),n.delete(i))}),r.forEach((e,t)=>{n.set(t,e)})}),this.height+=t}addColumns(e,t){const n=new Map;this.mapping.forEach((r,o)=>{o>=e&&(n.set(o+t,r),this.mapping.delete(o))}),n.forEach((e,t)=>{this.mapping.set(t,e)}),this.width+=t}removeRows(e){this.mapping.forEach(t=>{const n=new Map;t.forEach((r,o)=>{o>=e.rowStart&&(t.delete(o),o>e.rowEnd&&n.set(o-e.numberOfRows,r))}),n.forEach((e,n)=>{t.set(n,e)})});const t=Math.min(this.height-1,e.rowEnd),n=Math.max(0,t-e.rowStart+1);this.height=Math.max(0,this.height-n)}removeColumns(e){const t=new Map;this.mapping.forEach((n,r)=>{r>=e.columnStart&&(this.mapping.delete(r),r>e.columnEnd&&t.set(r-e.numberOfColumns,n))}),t.forEach((e,t)=>{this.mapping.set(t,e)});const n=Math.min(this.width-1,e.columnEnd),r=Math.max(0,n-e.columnStart+1);this.width=Math.max(0,this.width-r)}*getEntries(e){for(const[t,n]of this.mapping)for(const[o,i]of n)yield[Object(r.simpleCellAddress)(e,t,o),i]}*verticesFromColumn(e){const t=this.mapping.get(e);if(void 0!==t)for(const[e,n]of t)yield n}*verticesFromRow(e){for(const t of this.mapping.values()){const n=t.get(e);void 0!==n&&(yield n)}}*verticesFromColumnsSpan(e){for(const t of e.columns()){const e=this.mapping.get(t);if(void 0!==e)for(const[t,n]of e)yield n}}*verticesFromRowsSpan(e){for(const t of this.mapping.values())for(const n of e.rows()){const e=t.get(n);void 0!==e&&(yield e)}}*entriesFromRowsSpan(e){for(const[t,n]of this.mapping.entries())for(const o of e.rows()){const i=n.get(o);void 0!==i&&(yield[Object(r.simpleCellAddress)(e.sheet,t,o),i])}}*entriesFromColumnsSpan(e){for(const t of e.columns()){const n=this.mapping.get(t);if(void 0!==n)for(const[o,i]of n.entries())yield[Object(r.simpleCellAddress)(e.sheet,t,o),i]}}*vertices(){for(const[e,t]of this.mapping)for(const[e,n]of t)void 0!==n&&(yield n)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"DenseStrategy",(function(){return o}));var r=n(17);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o{constructor(e,t){this.width=e,this.height=t,this.mapping=new Array(t);for(let n=0;n<t;n++)this.mapping[n]=new Array(e)}getCell(e){return this.getCellVertex(e.col,e.row)}setCell(e,t){this.width=Math.max(this.width,e.col+1),this.height=Math.max(this.height,e.row+1);this.mapping[e.row]||(this.mapping[e.row]=new Array(this.width)),this.mapping[e.row][e.col]=t}has(e){const t=this.mapping[e.row];return!!t&&!!t[e.col]}getHeight(){return this.height}getWidth(){return this.width}removeCell(e){void 0!==this.mapping[e.row]&&delete this.mapping[e.row][e.col]}addRows(e,t){const n=[];for(let e=0;e<t;e++)n.push(new Array(this.width));this.mapping.splice(e,0,...n),this.height+=t}addColumns(e,t){for(let n=0;n<this.height;n++)this.mapping[n].splice(e,0,...new Array(t));this.width+=t}removeRows(e){this.mapping.splice(e.rowStart,e.numberOfRows);const t=Math.min(this.height-1,e.rowEnd),n=Math.max(0,t-e.rowStart+1);this.height=Math.max(0,this.height-n)}removeColumns(e){for(let t=0;t<this.height;t++)this.mapping[t].splice(e.columnStart,e.numberOfColumns);const t=Math.min(this.width-1,e.columnEnd),n=Math.max(0,t-e.columnStart+1);this.width=Math.max(0,this.width-n)}*getEntries(e){for(let t=0;t<this.height;++t)for(let n=0;n<this.width;++n){const o=this.getCellVertex(n,t);o&&(yield[Object(r.simpleCellAddress)(e,n,t),o])}}*verticesFromColumn(e){for(let t=0;t<this.height;++t){const n=this.getCellVertex(e,t);n&&(yield n)}}*verticesFromRow(e){for(let t=0;t<this.width;++t){const n=this.getCellVertex(t,e);n&&(yield n)}}*verticesFromColumnsSpan(e){for(let t=e.columnStart;t<=e.columnEnd;++t)for(let e=0;e<this.height;++e){const n=this.getCellVertex(t,e);n&&(yield n)}}*verticesFromRowsSpan(e){for(let t=0;t<this.width;++t)for(let n=e.rowStart;n<=e.rowEnd;++n){const e=this.getCellVertex(t,n);e&&(yield e)}}*entriesFromRowsSpan(e){for(let t=0;t<this.width;++t)for(let n=e.rowStart;n<=e.rowEnd;++n){const o=this.getCellVertex(t,n);o&&(yield[Object(r.simpleCellAddress)(e.sheet,t,n),o])}}*entriesFromColumnsSpan(e){for(let t=e.columnStart;t<=e.columnEnd;++t)for(let n=0;n<this.height;++n){const o=this.getCellVertex(t,n);o&&(yield[Object(r.simpleCellAddress)(e.sheet,t,n),o])}}*vertices(){for(let e=0;e<this.height;++e)for(let t=0;t<this.width;++t){const n=this.getCellVertex(t,e);n&&(yield n)}}getCellVertex(e,t){var n;return null===(n=this.mapping[t])||void 0===n?void 0:n[e]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"DetailedCellError",(function(){return r}));
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class r{constructor(e,t,n){var r;this.value=t,this.address=n,this.type=e.type,this.message=null!==(r=e.message)&&void 0!==r?r:""}toString(){return this.value}valueOf(){return this.value}}},function(e,t,n){"use strict";n.r(t),n.d(t,"format",(function(){return a})),n.d(t,"padLeft",(function(){return s})),n.d(t,"padRight",(function(){return u})),n.d(t,"defaultStringifyDuration",(function(){return c})),n.d(t,"defaultStringifyDateTime",(function(){return d}));var r=n(333),o=n(139),i=n(661);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function a(e,t,n,r){const a=n.stringifyDateTime(r.numberToSimpleDateTime(e),t);if(void 0!==a)return a;const c=n.stringifyDuration(Object(o.numberToSimpleTime)(e),t);if(void 0!==c)return c;const d=Object(i.parseForNumberFormat)(t);return void 0!==d?function(e,t){let n="";for(let r=0;r<e.length;++r){const o=e[r];if(o.type===i.TokenType.FREE_TEXT){n+=o.value;continue}const a=o.value.split("."),c=a[0],d=a[1]||"",h=a[1]?".":"",f=Number(t.toFixed(d.length)).toString().split(".");let p=f[0]||"",g=f[1]||"";if(c.length>p.length){const e=l(c.substr(0,c.length-p.length),"0");p=s(p,e+p.length)}const m=l(d.substr(g.length,d.length-g.length),"0");g=u(g,m+g.length),n+=p+h+g}return n}(d.tokens,e):t}function s(e,t){let n=""+e;for(;n.length<t;)n="0"+n;return n}function u(e,t){let n=""+e;for(;n.length<t;)n+="0";return n}function l(e,t){return e.split(t).length-1}function c(e,t){const n=Object(i.parseForDateTimeFormat)(t);if(void 0===n)return;const o=n.tokens;let a="";for(const t of o)if(t.type!==i.TokenType.FREE_TEXT)switch(t.value.toLowerCase()){case"h":case"hh":a+=s(e.hours,t.value.length),e.hours=0;break;case"[hh]":a+=s(e.hours,t.value.length-2),e.hours=0;break;case"m":case"mm":a+=s(e.minutes,t.value.length),e.minutes=0;break;case"[mm]":a+=s(e.minutes+60*e.hours,t.value.length-2),e.minutes=0,e.hours=0;break;case"s":case"ss":a+=s(Math.floor(e.seconds),t.value.length);break;default:if(r.secondsExtendedRegexp.test(t.value)){const n=Math.max(t.value.length-3,0);a+=`${e.seconds<10?"0":""}${Math.floor(e.seconds*Math.pow(10,n))/Math.pow(10,n)}`;continue}return}else a+=t.value;return a}function d(e,t){const n=Object(i.parseForDateTimeFormat)(t);if(void 0===n)return;const o=n.tokens;let a="",u=!1;const l=o.some(e=>e.type===i.TokenType.FORMAT&&("a/p"===e.value||"A/P"===e.value||"am/pm"===e.value||"AM/PM"===e.value));for(let t=0;t<o.length;t++){const n=o[t];if(n.type!==i.TokenType.FREE_TEXT)switch(n.value.toLowerCase()){case"h":case"hh":u=!0,a+=s(l?(e.hours+11)%12+1:e.hours,n.value.length);break;case"d":case"dd":a+=s(e.day,n.value.length);break;case"s":case"ss":a+=s(Math.floor(e.seconds),n.value.length);break;case"m":case"mm":t+1<o.length&&o[t+1].value.startsWith(":")&&(u=!0),a+=s(u?e.minutes:e.month,n.value.length),u=!0;break;case"yy":a+=s(e.year%100,n.value.length);break;case"yyyy":a+=e.year;break;case"am/pm":case"a/p":{const[t,r]=n.value.split("/");a+=e.hours<12?t:r;break}default:if(r.secondsExtendedRegexp.test(n.value)){const t=n.value.length-3;a+=`${e.seconds<10?"0":""}${Math.floor(e.seconds*Math.pow(10,t))/Math.pow(10,t)}`;continue}return}else a+=n.value}return a}},function(e,t,n){"use strict";n.r(t),n.d(t,"validateAsSheet",(function(){return o})),n.d(t,"findBoundaries",(function(){return i}));var r=n(29);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/function o(e){if(!Array.isArray(e))throw new r.InvalidArgumentsError("an array of arrays.");for(let t=0;t<e.length;t++)if(!Array.isArray(e[t]))throw new r.InvalidArgumentsError("an array of arrays.")}function i(e){let t=0,n=0,r=0;for(let o=0;o<e.length;o++){let i=0;for(let t=0;t<e[o].length;t++){const n=e[o][t];null!=n&&(i=t+1,++r)}t=Math.max(t,i),i>0&&(n=o+1)}const o=t*n;return{height:n,width:t,fill:0===o?0:r/o}}},function(e,t,n){"use strict";n.r(t),n.d(t,"FunctionRegistry",(function(){return s}));var r=n(29),o=n(164),i=n(673);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function a(e,t){var n;let o=t.implementedFunctions[e];const i=null===(n=t.aliases)||void 0===n?void 0:n[e];if(void 0!==i){if(void 0!==o)throw new r.AliasAlreadyExisting(e,t.name);o=t.implementedFunctions[i]}if(void 0===o)throw r.FunctionPluginValidationError.functionNotDeclaredInPlugin(e,t.name);return o}class s{constructor(e){if(this.config=e,this.functions=new Map,this.arraySizeFunctions=new Map,this.volatileFunctions=new Set,this.arrayFunctions=new Set,this.structuralChangeFunctions=new Set,this.functionsWhichDoesNotNeedArgumentsToBeComputed=new Set,this.functionsMetadata=new Map,this.doesFunctionNeedArgumentToBeComputed=e=>this.functionsWhichDoesNotNeedArgumentsToBeComputed.has(e),this.isFunctionVolatile=e=>this.volatileFunctions.has(e),this.isArrayFunction=e=>this.arrayFunctions.has(e),this.isFunctionDependentOnSheetStructureChange=e=>this.structuralChangeFunctions.has(e),e.functionPlugins.length>0){this.instancePlugins=new Map;for(const t of e.functionPlugins)s.loadPluginFunctions(t,this.instancePlugins)}else this.instancePlugins=new Map(s.plugins);for(const[e,t]of s.protectedFunctions())s.loadFunctionUnprotected(t,e,this.instancePlugins);for(const[e,t]of this.instancePlugins.entries())this.categorizeFunction(e,a(e,t))}static registerFunctionPlugin(e,t){this.loadPluginFunctions(e,this.plugins),void 0!==t&&this.loadTranslations(t)}static registerFunction(e,t,n){this.loadPluginFunction(t,e,this.plugins),void 0!==n&&this.loadTranslations(n)}static unregisterFunction(e){if(this.functionIsProtected(e))throw r.ProtectedFunctionError.cannotUnregisterFunctionWithId(e);this.plugins.delete(e)}static unregisterFunctionPlugin(e){for(const t of this.protectedPlugins())if(t===e)throw r.ProtectedFunctionError.cannotUnregisterProtectedPlugin();for(const[t,n]of this.plugins.entries())n===e&&this.plugins.delete(t)}static unregisterAll(){this.plugins.clear()}static getRegisteredFunctionIds(){return[...Array.from(this.plugins.keys()),...Array.from(this._protectedPlugins.keys())]}static getPlugins(){return Array.from(new Set(this.plugins.values()).values())}static getFunctionPlugin(e){return this.functionIsProtected(e)?void 0:this.plugins.get(e)}static functionIsProtected(e){return this._protectedPlugins.has(e)}static loadTranslations(e){const t=new Set(o.HyperFormula.getRegisteredLanguagesCodes());Object.keys(e).forEach(n=>{t.has(n)&&o.HyperFormula.getLanguage(n).extendFunctions(e[n])})}static loadPluginFunctions(e,t){Object.keys(e.implementedFunctions).forEach(n=>{this.loadPluginFunction(e,n,t)}),void 0!==e.aliases&&Object.keys(e.aliases).forEach(n=>{this.loadPluginFunction(e,n,t)})}static loadPluginFunction(e,t,n){if(this.functionIsProtected(t))throw r.ProtectedFunctionError.cannotRegisterFunctionWithId(t);this.loadFunctionUnprotected(e,t,n)}static loadFunctionUnprotected(e,t,n){const o=a(t,e).method;if(!Object.prototype.hasOwnProperty.call(e.prototype,o))throw r.FunctionPluginValidationError.functionMethodNotFound(o,e.name);n.set(t,e)}static*protectedFunctions(){for(const[e,t]of this._protectedPlugins)void 0!==t&&(yield[e,t])}static*protectedPlugins(){for(const[,e]of this._protectedPlugins)void 0!==e&&(yield e)}initializePlugins(e){const t=[];for(const[n,r]of this.instancePlugins.entries()){let o=t.find(e=>e instanceof r);void 0===o&&(o=new r(e),t.push(o));const i=a(n,r),s=i.method;this.functions.set(n,[s,o]);const u=i.arraySizeMethod;void 0!==u&&this.arraySizeFunctions.set(n,[u,o])}}getFunctionPlugin(e){if(!s.functionIsProtected(e))return this.instancePlugins.get(e)}getFunction(e){const t=this.functions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){const[e,n]=t;return(t,r)=>n[e](t,r)}}getArraySizeFunction(e){const t=this.arraySizeFunctions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){const[e,n]=t;return(t,r)=>n[e](t,r)}}getMetadata(e){return this.functionsMetadata.get(e)}getPlugins(){const e=new Set;for(const[t,n]of this.instancePlugins)s.functionIsProtected(t)||e.add(n);return Array.from(e)}getRegisteredFunctionIds(){return Array.from(this.functions.keys())}categorizeFunction(e,t){t.isVolatile&&this.volatileFunctions.add(e),t.arrayFunction&&this.arrayFunctions.add(e),t.doesNotNeedArgumentsToBeComputed&&this.functionsWhichDoesNotNeedArgumentsToBeComputed.add(e),t.isDependentOnSheetStructureChange&&this.structuralChangeFunctions.add(e),this.functionsMetadata.set(e,t)}}s.plugins=new Map,s._protectedPlugins=new Map([["VERSION",i.VersionPlugin],["OFFSET",void 0]])},function(e,t,n){"use strict";n.r(t),n.d(t,"PI",(function(){return o})),n.d(t,"MathConstantsPlugin",(function(){return i}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/const o=parseFloat(Math.PI.toFixed(14));class i extends r.FunctionPlugin{pi(e,t){return this.runFunction(e.args,t,this.metadata("PI"),()=>o)}sqrtpi(e,t){return this.runFunction(e.args,t,this.metadata("SQRTPI"),e=>Math.sqrt(o*e))}}i.implementedFunctions={PI:{method:"pi",parameters:[]},SQRTPI:{method:"sqrtpi",parameters:[{argumentType:r.FunctionArgumentType.NUMBER,minValue:0}]}}},function(e,t,n){var r=n(44),o=n(266),i=r["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=i},function(e,t,n){var r=n(44),o=Object.defineProperty;e.exports=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},function(e,t,n){var r=n(89),o=n(172),i=n(94),a=function(e){return function(t,n,a){var s,u=r(t),l=i(u),c=o(a,l);if(e&&n!=n){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){"use strict";var r=n(22),o=n(64),i=n(114),a=n(176),s=n(49),u=n(695),l=n(218),c=n(398),d=n(219),h=n(127),f=n(98),p=n(48),g=n(174),m=n(396),v=a.PROPER,y=a.CONFIGURABLE,E=m.IteratorPrototype,T=m.BUGGY_SAFARI_ITERATORS,C=p("iterator"),R=function(){return this};e.exports=function(e,t,n,a,p,m,w){u(n,t,a);var S,O,b,A=function(e){if(e===p&&k)return k;if(!T&&e in I)return I[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},N=t+" Iterator",M=!1,I=e.prototype,_=I[C]||I["@@iterator"]||p&&I[p],k=!T&&_||A(p),x="Array"==t&&I.entries||_;if(x&&(S=l(x.call(new e)))!==Object.prototype&&S.next&&(i||l(S)===E||(c?c(S,E):s(S[C])||f(S,C,R)),d(S,N,!0,!0),i&&(g[N]=R)),v&&"values"==p&&_&&"values"!==_.name&&(!i&&y?h(I,"name","values"):(M=!0,k=function(){return o(_,this)})),p)if(O={values:A("values"),keys:m?k:A("keys"),entries:A("entries")},w)for(b in O)(T||M||!(b in I))&&f(I,b,O[b]);else r({target:t,proto:!0,forced:T||M},O);return i&&!w||I[C]===k||f(I,C,k,{name:p}),g[t]=k,O}},function(e,t){e.exports=function(e,t){return{value:e,done:t}}},function(e,t,n){var r={};r[n(48)("toStringTag")]="z",e.exports="[object z]"===String(r)},function(e,t,n){var r=n(30),o=n(116),i=n(56),a=n(82),s=r("".charAt),u=r("".charCodeAt),l=r("".slice),c=function(e){return function(t,n){var r,c,d=i(a(t)),h=o(n),f=d.length;return h<0||h>=f?e?"":void 0:(r=u(d,h))<55296||r>56319||h+1===f||(c=u(d,h+1))<56320||c>57343?e?s(d,h):r:e?l(d,h,h+2):c-56320+(r-55296<<10)+65536}};e.exports={codeAt:c(!1),charAt:c(!0)}},function(e,t,n){var r=n(28);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(e,t,n){var r=n(98);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t,n){var r=n(102),o=n(89),i=n(143).f,a=n(276),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"==r(e)?function(e){try{return i(e)}catch(e){return a(s)}}(e):i(o(e))}},function(e,t,n){var r=n(172),o=n(94),i=n(144),a=Array,s=Math.max;e.exports=function(e,t,n){for(var u=o(e),l=r(t,u),c=r(void 0===n?u:n,u),d=a(s(c-l,0)),h=0;l<c;l++,h++)i(d,h,e[l]);return d.length=h,d}},function(e,t,n){var r=n(178),o=n(64),i=n(62),a=n(142),s=n(399),u=n(94),l=n(115),c=n(400),d=n(278),h=n(401),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},g=p.prototype;e.exports=function(e,t,n){var m,v,y,E,T,C,R,w=n&&n.that,S=!(!n||!n.AS_ENTRIES),O=!(!n||!n.IS_RECORD),b=!(!n||!n.IS_ITERATOR),A=!(!n||!n.INTERRUPTED),N=r(t,w),M=function(e){return m&&h(m,"normal",e),new p(!0,e)},I=function(e){return S?(i(e),A?N(e[0],e[1],M):N(e[0],e[1])):A?N(e,M):N(e)};if(O)m=e.iterator;else if(b)m=e;else{if(!(v=d(e)))throw f(a(e)+" is not iterable");if(s(v)){for(y=0,E=u(e);E>y;y++)if((T=I(e[y]))&&l(g,T))return T;return new p(!1)}m=c(e,v)}for(C=O?e.next:m.next;!(R=o(C,m)).done;){try{T=I(R.value)}catch(e){h(m,"throw",e)}if("object"==typeof T&&T&&l(g,T))return T}return new p(!1)}},function(e,t,n){var r=n(220),o=n(124),i=n(97),a=n(174),s=n(48)("iterator");e.exports=function(e){if(!i(e))return o(e,s)||o(e,"@@iterator")||a[r(e)]}},function(e,t,n){var r=n(115),o=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw o("Incorrect invocation")}},function(e,t,n){var r=n(49),o=n(63),i=n(398);e.exports=function(e,t,n){var a,s;return i&&r(a=t.constructor)&&a!==n&&o(s=a.prototype)&&s!==n.prototype&&i(e,s),e}},function(e,t,n){var r=n(702);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},function(e,t,n){var r=n(408);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(28),o=nLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class C{constructor(e,t,n,s,u,l,d,h){this.addressMapping=e,this.rangeMapping=t,this.sheetMapping=n,this.arrayMapping=s,this.stats=u,this.lazilyTransformingAstService=l,this.functionRegistry=d,this.namedExpressions=h,this.changes=a.ContentChanges.empty(),this.dependencyQueryAddresses=e=>{if(e instanceof f.RangeVertex)return this.rangeDependencyQuery(e).map(([e,t])=>e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,n]=t;return n.map(t=>t instanceof c.NamedExpressionDependency?this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet).address:Object(i.isSimpleCellAddress)(t)?t:Object(r.simpleCellRange)(t.start,t.end))}return[]}},this.dependencyQueryVertices=e=>{if(e instanceof f.RangeVertex)return this.rangeDependencyQuery(e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,n]=t;return n.map(t=>{if(t instanceof r.AbsoluteCellRange)return[t.start,this.rangeMapping.fetchRange(t.start,t.end)];if(t instanceof c.NamedExpressionDependency){const n=this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet);return[n.address,this.addressMapping.fetchCell(n.address)]}return[t,this.addressMapping.fetchCell(t)]})}return[]}},this.rangeDependencyQuery=e=>{const t=[],{smallerRangeVertex:n,restRange:o}=this.rangeMapping.findSmallerRange(e.range);let i;void 0!==n&&this.graph.adjacentNodes(n).has(e)?(i=o,t.push([new r.AbsoluteCellRange(n.start,n.end),n])):i=e.range;for(const e of i.addresses(this)){const n=this.addressMapping.getCell(e);void 0!==n&&t.push([e,n])}return t},this.formulaDependencyQuery=e=>{let t,n;if(!(e instanceof v.FormulaVertex))return;n=e.getAddress(this.lazilyTransformingAstService),t=e.getFormula(this.lazilyTransformingAstService);const r=Object(c.collectDependencies)(t,this.functionRegistry);return[n,Object(o.absolutizeDependencies)(r,n)]},this.graph=new y.Graph(this.dependencyQueryVertices)}static buildEmpty(e,t,n,r,o){return new C(new p.AddressMapping(t.chooseAddressMappingPolicy),new E.RangeMapping,new T.SheetMapping(t.translationPackage),new g.ArrayMapping,o,e,n,r)}setFormulaToCell(e,t,n,r,o,i){const a=v.FormulaVertex.fromAst(t,e,r,this.lazilyTransformingAstService.version());return this.exchangeOrAddFormulaVertex(a),this.processCellDependencies(n,a),this.graph.markNodeAsSpecialRecentlyChanged(a),o&&this.markAsVolatile(a),i&&this.markAsDependentOnStructureChange(a),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setParsingErrorToCell(e,t){const n=this.shrinkPossibleArrayAndGetCell(e);return this.exchangeOrAddGraphNode(n,t),this.addressMapping.setCell(e,t),this.graph.markNodeAsSpecialRecentlyChanged(t),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setValueToCell(e,t){const n=this.shrinkPossibleArrayAndGetCell(e);if(n instanceof f.ArrayVertex&&this.arrayMapping.removeArray(n.getRange()),n instanceof f.ValueCellVertex){n.getValues().rawValue!==t.rawValue&&(n.setValues(t),this.graph.markNodeAsSpecialRecentlyChanged(n))}else{const r=new f.ValueCellVertex(t.parsedValue,t.rawValue);this.exchangeOrAddGraphNode(n,r),this.addressMapping.setCell(e,r),this.graph.markNodeAsSpecialRecentlyChanged(r)}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 n=new f.EmptyCellVertex;this.exchangeGraphNode(t,n),0===this.graph.adjacentNodesCount(n)?(this.removeVertex(n),this.addressMapping.removeCell(e)):(this.graph.markNodeAsSpecialRecentlyChanged(n),this.addressMapping.setCell(e,n))}else this.removeVertex(t),this.addressMapping.removeCell(e);return this.getAndClearContentChanges()}ensureThatVertexIsNonArrayCellVertex(e){if(e instanceof f.ArrayVertex)throw new Error("Illegal operation")}clearRecentlyChangedVertices(){this.graph.clearSpecialNodesRecentlyChanged()}verticesToRecompute(){return new Set([...this.graph.specialNodesRecentlyChanged,...this.volatileVertices()])}processCellDependencies(e,t){e.forEach(e=>{if(e instanceof r.AbsoluteCellRange){const n=e;let r=this.getRange(n.start,n.end);void 0===r&&(r=new f.RangeVertex(n),this.rangeMapping.setRange(r)),this.graph.addNode(r),n.isFinite()||this.graph.markNodeAsInfiniteRange(r);const{smallerRangeVertex:o,restRange:i}=this.rangeMapping.findSmallerRange(n);if(void 0!==o){if(this.graph.addEdge(o,r),r.bruteForce){r.bruteForce=!1;for(const e of n.addresses(this))this.graph.removeEdge(this.fetchCell(e),r)}}else r.bruteForce=!0;const a=this.arrayMapping.getArray(i);if(void 0!==a)this.graph.addEdge(a,r);else for(const e of i.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(e),r);this.graph.addEdge(r,t),n.isFinite()&&this.correctInfiniteRangesDependenciesByRangeVertex(r)}else if(e instanceof c.NamedExpressionDependency){const n=t.getAddress(this.lazilyTransformingAstService).sheet,r=this.fetchNamedExpressionVertex(e.name,n);this.graph.addEdge(r,t)}else this.graph.addEdge(this.fetchCellOrCreateEmLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class g{constructor(e,t,n){this.config=e,this.functionRegistry=t,this.sheetMapping=n,this.statsCacheUsed=0,this.lexerConfig=Object(d.buildLexerConfig)(e),this.lexer=new c.FormulaLexer(this.lexerConfig),this.formulaParser=new c.FormulaParser(this.lexerConfig,this.sheetMapping),this.cache=new l.Cache(this.functionRegistry)}parse(e,t){this.formulaAddress=t;const n=this.tokenizeFormula(e);if(n.errors.length>0){const e=n.errors.map(e=>({type:s.ParsingErrorType.LexingError,message:e.message}));return{ast:Object(i.buildParsingErrorAst)(),errors:e,hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]}}const r=this.computeHashFromTokens(n.tokens,t);let o=this.cache.get(r);if(void 0!==o)++this.statsCacheUsed;else{const e=this.bindWhitespacesToTokens(n.tokens),i=this.formulaParser.parseFromTokens(e,t);if(i.errors.length>0)return Object.assign(Object.assign({},i),{hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]});o=this.cache.set(r,i.ast)}const{ast:a,hasVolatileFunction:u,hasStructuralChangeFunction:l}=o,c=this.convertReversedRangesToRegularRanges(a);return{ast:c,errors:[],hasVolatileFunction:u,hasStructuralChangeFunction:l,dependencies:Object(i.collectDependencies)(c,this.functionRegistry)}}convertReversedRangesToRegularRanges(e){switch(e.type){case i.AstNodeType.EMPTY:case i.AstNodeType.NUMBER:case i.AstNodeType.STRING:case i.AstNodeType.ERROR:case i.AstNodeType.ERROR_WITH_RAW_INPUT:case i.AstNodeType.CELL_REFERENCE:case i.AstNodeType.NAMED_EXPRESSION:return e;case i.AstNodeType.CELL_RANGE:{const{start:t,end:n}=e,r=this.orderCellRangeEnds(t,n);return Object.assign(Object.assign({},e),{start:r.start,end:r.end})}case i.AstNodeType.COLUMN_RANGE:{const{start:t,end:n}=e,r=this.orderColumnRangeEnds(t,n);return Object.assign(Object.assign({},e),{start:r.start,end:r.end})}case i.AstNodeType.ROW_RANGE:{const{start:t,end:n}=e,r=this.orderRowRangeEnds(t,n);return Object.assign(Object.assign({},e),{start:r.start,end:r.end})}case i.AstNodeType.PERCENT_OP:case i.AstNodeType.PLUS_UNARY_OP:case i.AstNodeType.MINUS_UNARY_OP:{const t=this.convertReversedRangesToRegularRanges(e.value);return Object.assign(Object.assign({},e),{value:t})}case i.AstNodeType.CONCATENATE_OP:case i.AstNodeType.EQUALS_OP:case i.AstNodeType.NOT_EQUAL_OP:case i.AstNodeType.LESS_THAN_OP:case i.AstNodeType.GREATER_THAN_OP:case i.AstNodeType.LESS_THAN_OR_EQUAL_OP:case i.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case i.AstNodeType.MINUS_OP:case i.AstNodeType.PLUS_OP:case i.AstNodeType.TIMES_OP:case i.AstNodeType.DIV_OP:case i.AstNodeType.POWER_OP:{const t=this.convertReversedRangesToRegularRanges(e.left),n=this.convertReversedRangesToRegularRanges(e.right);return Object.assign(Object.assign({},e),{left:t,right:n})}case i.AstNodeType.PARENTHESIS:{const t=this.convertReversedRangesToRegularRanges(e.expression);return Object.assign(Object.assign({},e),{expression:t})}case i.AstNodeType.FUNCTION_CALL:{const t=e.args.map(e=>this.convertReversedRangesToRegularRanges(e));return Object.assign(Object.assign({},e),{args:t})}case i.AstNodeType.ARRAY:{const t=e.args.map(e=>e.map(e=>this.convertReversedRangesToRegularRanges(e)));return Object.assign(Object.assign({},e),{args:t})}}}orderCellRangeEnds(e,t){const n=[e,t],[r,o]=n.map(e=>e.toColumnAddress()).sort(f.ColumnAddress.compareByAbsoluteAddress(this.formulaAddress)),[a,s]=n.map(e=>e.toRowAddress()).sort(p.RowAddress.compareByAbsoluteAddress(this.formulaAddress)),[u,l]=n.map(e=>e.sheet).sort(g.compareSheetIds.bind(this));return{start:i.CellAddress.fromColAndRow(r,a,u),end:i.CellAddress.fromColAndRow(o,s,l)}}orderColumnRangeEnds(e,t){const n=[e,t],[r,o]=n.sort(f.ColumnAddress.compareByAbsoluteAddress(this.formulaAddress)),[i,a]=n.map(e=>e.sheet).sort(g.compareSheetIds.bind(this));return{start:new f.ColumnAddress(r.type,r.col,i),end:new f.ColumnAddress(o.type,o.col,a)}}orderRowRangeEnds(e,t){const n=[e,t],[r,o]=n.sort(p.RowAddress.compareByAbsoluteAddress(this.formulaAddress)),[i,a]=n.map(e=>e.sheet).sort(g.compareSheetIds.bind(this));return{start:new p.RowAddress(r.type,r.row,i),end:new p.RowAddress(o.type,o.row,a)}}static compareSheetIds(e,t){return(e=null!=e?e:1/0)-(t=null!=t?t:1/0)}fetchCachedResultForAst(e){const t=this.computeHashFromAst(e);return this.fetchCachedResult(t)}fetchCachedResult(e){const t=this.cache.get(e);if(void 0===t)throw new Error("There is no AST with such key in the cache");{const{ast:e,hasVolatileFunction:n,hasStructuralChangeFunction:r,relativeDependencies:o}=t;return{ast:e,errors:[],hasVolatileFunction:n,hasStructuralChangeFunction:r,dependencies:o}}}computeHashFromTokens(e,t){var n;let o="",i=0;for(;i<e.length;){const s=e[i];if(Object(r.tokenMatcher)(s,d.CellReference)){const e=Object(a.cellAddressFromString)(this.sheetMapping,s.image,t);o=void 0===e?o.concat(s.image):o.concat(e.hash(!0))}else if(Object(r.tokenMatcher)(s,d.ProcedureName)){const e=s.image.toUpperCase().slice(0,-1),t=null!==(n=this.lexerConfig.functionMapping[e])&&void 0!==n?n:e;o=o.concat(t,"(")}elLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/const o={[r.AstNodeType.PLUS_OP]:"+",[r.AstNodeType.MINUS_OP]:"-",[r.AstNodeType.TIMES_OP]:"*",[r.AstNodeType.DIV_OP]:"/",[r.AstNodeType.CONCATENATE_OP]:"&",[r.AstNodeType.POWER_OP]:"^",[r.AstNodeType.EQUALS_OP]:"=",[r.AstNodeType.NOT_EQUAL_OP]:"<>",[r.AstNodeType.GREATER_THAN_OP]:">",[r.AstNodeType.GREATER_THAN_OR_EQUAL_OP]:">=",[r.AstNodeType.LESS_THAN_OP]:"<",[r.AstNodeType.LESS_THAN_OR_EQUAL_OP]:"<="}},function(e,t,n){"use strict";n.r(t),n.d(t,"collectDependencies",(function(){return i}));var r=n(61);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/const o=(e,t,n,i)=>{switch(e.type){case r.AstNodeType.EMPTY:case r.AstNodeType.NUMBER:case r.AstNodeType.STRING:case r.AstNodeType.ERROR:return;case r.AstNodeType.NAMED_EXPRESSION:return void(i&&n.push(new r.NamedExpressionDependency(e.expressionName)));case r.AstNodeType.CELL_REFERENCE:return void(i&&n.push(new r.AddressDependency(e.reference)));case r.AstNodeType.CELL_RANGE:return void(i&&e.start.sheet===e.end.sheet&&n.push(new r.CellRangeDependency(e.start,e.end)));case r.AstNodeType.COLUMN_RANGE:return void(i&&e.start.sheet===e.end.sheet&&n.push(new r.ColumnRangeDependency(e.start,e.end)));case r.AstNodeType.ROW_RANGE:return void(i&&e.start.sheet===e.end.sheet&&n.push(new r.RowRangeDependency(e.start,e.end)));case r.AstNodeType.PERCENT_OP:case r.AstNodeType.PLUS_UNARY_OP:case r.AstNodeType.MINUS_UNARY_OP:return void o(e.value,t,n,!0);case r.AstNodeType.CONCATENATE_OP:case r.AstNodeType.EQUALS_OP:case r.AstNodeType.NOT_EQUAL_OP:case r.AstNodeType.LESS_THAN_OP:case r.AstNodeType.GREATER_THAN_OP:case r.AstNodeType.LESS_THAN_OR_EQUAL_OP:case r.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case r.AstNodeType.MINUS_OP:case r.AstNodeType.PLUS_OP:case r.AstNodeType.TIMES_OP:case r.AstNodeType.DIV_OP:case r.AstNodeType.POWER_OP:return o(e.left,t,n,!0),void o(e.right,t,n,!0);case r.AstNodeType.PARENTHESIS:return void o(e.expression,t,n,i);case r.AstNodeType.FUNCTION_CALL:{const r=!t.doesFunctionNeedArgumentToBeComputed(e.procedureName);return void e.args.forEach(e=>o(e,t,n,r))}}},i=(e,t)=>{const n=new Array;return o(e,t,n,!0),n}},function(e,t,n){"use strict";n.r(t),n.d(t,"EmptyStatistics",(function(){return o}));var r=n(249);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.Statistics{incrementCriterionFunctionFullCacheUsed(){}incrementCriterionFunctionPartialCacheUsed(){}start(e){}end(e){}}},function(e,t,n){"use strict";n.r(t),n.d(t,"NotComputedArray",(function(){return a})),n.d(t,"ArrayValue",(function(){return s})),n.d(t,"ErroredArray",(function(){return u}));var r=n(99),o=n(43),i=n(69);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a{constructor(e){this.size=e}width(){return this.size.width}height(){return this.size.height}get(e,t){throw Error("Array not computed yet.")}simpleRangeValue(){throw Error("Array not computed yet.")}}class s{constructor(e){this.size=new r.ArraySize(e.length>0?e[0].length:0,e.length),this.array=e}static fromInterpreterValue(e){return e instanceof i.SimpleRangeValue?new s(e.data):new s([[e]])}simpleRangeValue(){return i.SimpleRangeValue.onlyValues(this.array)}addRows(e,t){this.array.splice(e,0,...this.nullArrays(t,this.width())),this.size.height+=t}addColumns(e,t){for(let n=0;n<this.height();n++)this.array[n].splice(e,0,...new Array(t).fill(o.EmptyValue));this.size.width+=t}removeRows(e,t){if(this.outOfBound(0,e)||this.outOfBound(0,t))throw Error("Array index out of bound");const n=t-e+1;this.array.splice(e,n),this.size.height-=n}removeColumns(e,t){if(this.outOfBound(e,0)||this.outOfBound(t,0))throw Error("Array index out of bound");const n=t-e+1;for(const t of this.array)t.splice(e,n);this.size.width-=n}nullArrays(e,t){const n=[];for(let r=0;r<e;++r)n.push(new Array(t).fill(o.EmptyValue));return n}get(e,t){if(this.outOfBound(e,t))throw Error("Array index out of bound");return this.array[t][e]}set(e,t,n){if(this.outOfBound(e,t))throw Error("Array index out of bound");this.array[t][e]=n}width(){return this.size.width}height(){return this.size.height}raw(){return this.array}resize(e){if(this.height()<e.height&&isFinite(e.height)&&this.addRows(this.height(),e.height-this.height()),this.height()>e.height)throw Error("Resizing to smaller array");if(this.width()<e.width&&isFinite(e.width)&&this.addColumns(this.width(),e.width-this.width()),this.width()>e.width)throw Error("Resizing to smaller array")}outOfBound(e,t){return e<0||t<0||t>this.size.height-1||e>this.size.width-1}}class u{constructor(e,t){this.error=e,this.size=t}get(e,t){return this.error}width(){return this.size.width}height(){return this.size.height}simpleRangeValue(){return this.error}}},function(e,t,n){"use strict";n.r(t),n.d(t,"EmptyCellVertex",(function(){return o}));var r=n(43);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o{constructor(){}getCellValue(){return r.EmptyValue}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ValueCellVertex",(function(){return r}));
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class r{constructor(e,t){this.parsedValue=e,this.rawValue=t}getValues(){return{parsedValue:this.parsedValue,rawValue:this.rawValue}}setValues(e){this.parsedValue=e.parsedValue,this.rawValue=e.rawValue}getCellValue(){return this.parsedValue}setCellValue(e){throw Error("SetCellValue is deprecated for ValueCellVertex")}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ParsingErrorVertex",(function(){return o}));var r=n(17);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o{constructor(e,t){this.errors=e,this.rawInput=t}getCellValue(){return r.CellError.parsingError()}getFormula(){return this.rawInput}}},function(e,t,n){"use strict";n.r(t),n.d(t,"configValueFromParam",(function(){return i})),n.d(t,"validateNumberToBeAtLeast",(function(){return a})),n.d(t,"validateNumberToBeAtMost",(function(){return s})),n.d(t,"configValueFromParamCheck",(function(){return u})),n.d(t,"configCheckIfParametersNotInConflict",(function(){return l})),n.d(t,"validateArgToType",(function(){return c}));var r=n(206),o=n(29);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function i(e,t,n){if(void 0===e)return r.Config.defaultConfig[n];if("string"==typeof t){if(typeof e===t)return e;throw new o.ExpectedValueOfTypeError(t,n)}if(t.includes(e))return e;throw new o.ExpectedOneOfValuesError(t.map(e=>`'${e}'`).join(" "),n)}function a(e,t,n){if(e<n)throw new o.ConfigValueTooSmallError(t,n)}function s(e,t,n){if(e>n)throw new o.ConfigValueTooBigError(t,n)}function u(e,t,n,i){if(t(e))return e;if(void 0===e)return r.Config.defaultConfig[i];throw new o.ExpectedValueOfTypeError(n,i)}function l(...e){const t=new Map;e.forEach(e=>{const n=t.get(e.value)||[];n.push(e.name),t.set(e.value,n)});const n=[];for(const e of t.values())e.length>1&&n.push(e);if(n.length>0){n.forEach(e=>e.sort());const e=n.map(e=>`[${e}]`).join("; ");throw new Error("Config initialization failed. Parameters in conflict: "+e)}}function c(e,t,n){if(typeof e!==t)throw new o.ExpectedValueOfTypeError(t,n)}},function(e,t,n){"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function r(e,t,n){let r=(e=e.replace(/\s\s+/g," ").trim().toLowerCase()).substring(e.length-2);"am"===r||"pm"===r?e=e.substring(0,e.length-2).trim():(r=e.substring(e.length-1),"a"===r||"p"===r?e=e.substring(0,e.length-1).trim():r=void 0);const o=e.split(/[ /.-]/g);o.length>=2&&o[o.length-2].includes(":")&&(o[o.length-2]=o[o.length-2]+"."+o[o.length-1],o.pop());const s=o[o.length-1].split(":");if(void 0!==r&&s.push(r),1===o.length)return i(s,n);if(1===s.length)return a(o,t);const u=a(o.slice(0,o.length-1),t),l=i(s,n);return void 0===u||void 0===l?void 0:Object.assign(Object.assign({},u),l)}n.r(t),n.d(t,"defaultParseToDateTime",(function(){return r})),n.d(t,"secondsExtendedRegexp",(function(){return o}));const o=/^ss(\.(s+|0+))?$/;function i(e,t){if(void 0===t)return;(t=t.toLowerCase()).endsWith("am/pm")?t=t.substring(0,t.length-5).trim():t.endsWith("a/p")&&(t=t.substring(0,t.length-3).trim());const n=t.split(":");let r=void 0;if("am"===e[e.length-1]||"a"===e[e.length-1]?(r=!1,e.pop()):"pm"!==e[e.length-1]&&"p"!==e[e.length-1]||(r=!0,e.pop()),e.length!==n.length)return;const i=n.indexOf("hh"),a=n.indexOf("mm"),s=n.findIndex(e=>o.test(e)),u=-1!==i?e[i]:"0";if(!/^\d+$/.test(u))return;let l=Number(u);if(void 0!==r){if(l<0||l>12)return;l%=12,r&&(l+=12)}const c=-1!==a?e[a]:"0";if(!/^\d+$/.test(c))return;const d=Number(c),h=-1!==s?e[s]:"0";if(!/^\d+(\.\d+)?$/.test(h))return;return{hours:l,minutes:d,seconds:Math.round(1e3*Number(h))/1e3}}function a(e,t){if(void 0===t)return;const n=t.toLowerCase().split(/[ /.-]/g);if(e.length!==n.length)return;const r=n.indexOf("mm"),o=n.indexOf("dd"),i=n.indexOf("yyyy"),a=n.indexOf("yy");if(!(r in e)||!(o in e)||!(i in e)&&!(a in e))return;if(i in e&&a in e)return;let s;if(i in e){const t=e[i];if(!/^\d+$/.test(t))return;if(s=Number(t),s<1e3||s>9999)return}else{const t=e[a];if(!/^\d+$/.test(t))return;if(s=Number(t),s<0||s>99)return}const u=e[r];if(!/^\d+$/.test(u))return;const l=Number(u),c=e[o];if(!/^\d+$/.test(c))return;return{year:s,month:l,day:Number(c)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ClipboardCellType",(function(){return o})),n.d(t,"ClipboardOperations",(function(){return l}));var r,o,i=n(77),a=n(17),s=n(29);!function(e){e[e.COPY=0]="COPY",e[e.CUT=1]="CUT"}(r||(r={})),function(e){e[e.VALUE=0]="VALUE",e[e.EMPTY=1]="EMPTY",e[e.FORMULA=2]="FORMULA",e[e.PARSING_ERROR=3]="PARSING_ERROR"}(o||(o={}));class u{constructor(e,t,n,r,o){this.sourceLeftCorner=e,this.width=t,this.height=n,this.type=r,this.content=o}*getContent(e){if(void 0!==this.content)for(let t=0;t<this.height;++t)for(let n=0;n<this.width;++n)yield[Object(a.simpleCellAddress)(e.sheet,e.col+n,e.row+t),this.content[t][n]]}}class l{constructor(e,t,n){this.dependencyGraph=t,this.operations=n,this.maxRows=e.maxRows,this.maxColumns=e.maxColumns}cut(e,t,n){this.clipboard=new u(e,t,n,r.CUT)}copy(e,t,n){const o=[];for(let r=0;r<n;++r){o[r]=[];for(let n=0;n<t;++n){const t=this.operations.getClipboardCell(Object(a.simpleCellAddress)(e.sheet,e.col+n,e.row+r));o[r].push(t)}}this.clipboard=new u(e,t,n,r.COPY,o)}abortCut(){this.clipboard&&this.clipboard.type===r.CUT&&this.clear()}clear(){this.clipboard=void 0}ensureItIsPossibleToCopyPaste(e){if(void 0===this.clipboard)return;if(Object(a.invalidSimpleCellAddress)(e)||!this.dependencyGraph.sheetMapping.hasSheetWithId(e.sheet))throw new s.InvalidArgumentsError("a valid target address.");const t=i.AbsoluteCellRange.spanFrom(e,this.clipboard.width,this.clipboard.height);if(t.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new s.SheetSizeLimitExceededError;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new Error("It is not possible to paste onto an array")}isCutClipboard(){return void 0!==this.clipboard&&this.clipboard.type===r.CUT}isCopyClipboard(){return void 0!==this.clipboard&&this.clipboard.type===r.COPY}}},function(e,t,n){"use strict";n.r(t),n.d(t,"AddRowsTransformer",(function(){return i}));var r=n(17),o=n(121);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i extends o.Transformer{constructor(e){super(),this.rowsSpan=e}get sheet(){return this.rowsSpan.sheet}isIrreversible(){return!1}transformColumnRangeAst(e,t){return e}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){return this.transformRange(e,t,n)}transformColumnRange(e,t,n){throw Error("Not implemented")}transformCellAddress(e,t){const n=Object(r.absoluteSheetReference)(e,t);if(n!==this.rowsSpan.sheet&&t.sheet!==this.rowsSpan.sheet)return!1;const o=e.toSimpleRowAddress(t);return n===this.rowsSpan.sheet&&t.sheet!==this.rowsSpan.sheet?this.rowsSpan.rowStart<=o.row&&e.shiftedByRows(this.rowsSpan.numberOfRows):t.sheet===this.rowsSpan.sheet&&n!==this.rowsSpan.sheet?!e.isRowAbsolute()&&(!(t.row<this.rowsSpan.rowStart)&&e.shiftedByRows(-this.rowsSpan.numberOfRows)):e.isRowAbsolute()?!(e.row<this.rowsSpan.rowStart)&&e.shiftedByRows(this.rowsSpan.numberOfRows):o.row<this.rowsSpan.rowStart?!(t.row<this.rowsSpan.rowStart)&&e.shiftedByRows(-this.rowsSpan.numberOfRows):t.row<this.rowsSpan.rowStart&&e.shiftedByRows(this.rowsSpan.numberOfRows)}fixNodeAddress(e){return this.rowsSpan.sheet===e.sheet&&this.rowsSpan.rowStart<=e.row?Object.assign(Object.assign({},e),{row:e.row+this.rowsSpan.numberOfRows}):e}transformRange(e,t,n){const o=this.transformCellAddress(e,n),i=this.transformCellAddress(t,n);return o===r.ErrorType.REF||i===r.ErrorType.REF?r.ErrorType.REF:!(!o&&!i)&&[o||e,i||t]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"RemoveRowsTransformer",(function(){return i}));var r=n(17),o=n(121);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i extends o.Transformer{constructor(e){super(),this.rowsSpan=e}get sheet(){return this.rowsSpan.sheet}isIrreversible(){return!0}transformColumnRangeAst(e,t){return e}transformCellAddress(e,t){const n=Object(r.absoluteSheetReference)(e,t);if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet!==n)return!1;if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet===n){const n=e.toSimpleRowAddress(t);if(n.row<this.rowsSpan.rowStart)return!1;if(n.row>this.rowsSpan.rowEnd)return e.shiftedByRows(-this.rowsSpan.numberOfRows)}if(this.rowsSpan.sheet===t.sheet&&this.rowsSpan.sheet!==n){if(e.isRowAbsolute())return!1;if(t.row<this.rowsSpan.rowStart)return!1;if(t.row>this.rowsSpan.rowEnd)return e.shiftedByRows(this.rowsSpan.numberOfRows)}if(this.rowsSpan.sheet===t.sheet&&this.rowsSpan.sheet===n)if(e.isRowAbsolute()){if(e.row<this.rowsSpan.rowStart)return!1;if(e.row>this.rowsSpan.rowEnd)return e.shiftedByRows(-this.rowsSpan.numberOfRows)}else{const n=e.toSimpleRowAddress(t);if(n.row<this.rowsSpan.rowStart){if(t.row<this.rowsSpan.rowStart)return!1;if(t.row>this.rowsSpan.rowEnd)return e.shiftedByRows(this.rowsSpan.numberOfRows)}else if(n.row>this.rowsSpan.rowEnd){if(t.row<this.rowsSpan.rowStart)return e.shiftedByRows(-this.rowsSpan.numberOfRows);if(t.row>this.rowsSpan.rowEnd)return!1}}return r.ErrorType.REF}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){return this.transformRange(e,t,n)}transformColumnRange(e,t,n){throw Error("Not implemented")}fixNodeAddress(e){return this.rowsSpan.sheet===e.sheet&&this.rowsSpan.rowStart<=e.row?Object.assign(Object.assign({},e),{row:e.row-this.rowsSpan.numberOfRows}):e}transformRange(e,t,n){const o=Object(r.absoluteSheetReference)(e,n);let i=e,a=t;if(this.rowsSpan.sheet===o){const o=e.toSimpleRowAddress(n),s=t.toSimpleRowAddress(n);if(this.rowsSpan.rowStart<=o.row&&this.rowsSpan.rowEnd>=s.row)return r.ErrorType.REF;o.row>=this.rowsSpan.rowStart&&o.row<=this.rowsSpan.rowEnd&&(i=e.shiftedByRows(this.rowsSpan.rowEnd-o.row+1)),s.row>=this.rowsSpan.rowStart&&s.row<=this.rowsSpan.rowEnd&&(a=t.shiftedByRows(-(s.row-this.rowsSpan.rowStart+1)))}const s=this.transformCellAddress(i,n),u=this.transformCellAddress(a,n);return!1===s&&!1===u?[i,a]:s===r.ErrorType.REF||u===r.ErrorType.REF?r.ErrorType.REF:[s||i,u||a]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"BaseUndoEntry",(function(){return i})),n.d(t,"RemoveRowsUndoEntry",(function(){return a})),n.d(t,"MoveCellsUndoEntry",(function(){return s})),n.d(t,"AddRowsUndoEntry",(function(){return u})),n.d(t,"SetRowOrderUndoEntry",(function(){return l})),n.d(t,"SetColumnOrderUndoEntry",(function(){return c})),n.d(t,"SetSheetContentUndoEntry",(function(){return d})),n.d(t,"MoveRowsUndoEntry",(function(){return h})),n.d(t,"MoveColumnsUndoEntry",(function(){return f})),n.d(t,"AddColumnsUndoEntry",(function(){return p})),n.d(t,"RemoveColumnsUndoEntry",(function(){return g})),n.d(t,"AddSheetUndoEntry",(function(){return m})),n.d(t,"RemoveSheetUndoEntry",(function(){return v})),n.d(t,"RenameSheetUndoEntry",(function(){return y})),n.d(t,"ClearSheetUndoEntry",(function(){return E})),n.d(t,"SetCellContentsUndoEntry",(function(){return T})),n.d(t,"PasteUndoEntry",(function(){return C})),n.d(t,"AddNamedExpressionUndoEntry",(function(){return R})),n.d(t,"RemoveNamedExpressionUndoEntry",(function(){return w})),n.d(t,"ChangeNamedExpressionUndoEntry",(function(){return S})),n.d(t,"BatchUndoEntry",(function(){return O})),n.d(t,"UndoRedo",(function(){return b}));var r=n(17),o=n(208);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i{}class a extends i{constructor(e,t){super(),this.command=e,this.rowsRemovals=t}doUndo(e){e.undoRemoveRows(this)}doRedo(e){e.redoRemoveRows(this)}}class s extends i{constructor(e,t,n,r,o,i,a){super(),this.sourceLeftCorner=e,this.width=t,this.height=n,this.destinationLeftCorner=r,this.overwrittenCellsData=o,this.addedGlobalNamedExpressions=i,this.version=a}doUndo(e){e.undoMoveCells(this)}doRedo(e){e.redoMoveCells(this)}}class u extends i{constructor(e){super(),this.command=e}doUndo(e){e.undoAddRows(this)}doRedo(e){e.redoAddRows(this)}}class l extends i{constructor(e,t,n){super(),this.sheetId=e,this.rowMapping=t,this.oldContent=n}doUndo(e){e.undoSetRowOrder(this)}doRedo(e){e.redoSetRowOrder(this)}}class c extends i{constructor(e,t,n){super(),this.sheetId=e,this.columnMapping=t,this.oldContent=n}doUndo(e){e.undoSetColumnOrder(this)}doRedo(e){e.redoSetColumnOrder(this)}}class d extends i{constructor(e,t,n){super(),this.sheetId=e,this.oldSheetContent=t,this.newSheetContent=n}doUndo(e){e.undoSetSheetContent(this)}doRedo(e){e.redoSetSheetContent(this)}}class h extends i{constructor(e,t,n,r,o){super(),this.sheet=e,this.startRow=t,this.numberOfRows=n,this.targetRow=r,this.version=o,this.undoStart=this.startRow<this.targetRow?this.targetRow-this.numberOfRows:this.targetRow,this.undoEnd=this.startRow>this.targetRow?this.startRow+this.numberOfRows:this.startRow}doUndo(e){e.undoMoveRows(this)}doRedo(e){e.redoMoveRows(this)}}class f extends i{constructor(e,t,n,r,o){super(),this.sheet=e,this.startColumn=t,this.numberOfColumns=n,this.targetColumn=r,this.version=o,this.undoStart=this.startColumn<this.targetColumn?this.targetColumn-this.numberOfColumns:this.targetColumn,this.undoEnd=this.startColumn>this.targetColumn?this.startColumn+this.numberOfColumns:this.startColumn}doUndo(e){e.undoMoveColumns(this)}doRedo(e){e.redoMoveColumns(this)}}class p extends i{constructor(e){super(),this.command=e}doUndo(e){e.undoAddColumns(this)}doRedo(e){e.redoAddColumns(this)}}class g extends i{constructor(e,t){super(),this.command=e,this.columnsRemovals=t}doUndo(e){e.undoRemoveColumns(this)}doRedo(e){e.redoRemoveColumns(this)}}class m extends i{constructor(e){super(),this.sheetName=e}doUndo(e){e.undoAddSheet(this)}doRedo(e){e.redoAddSheet(this)}}class v extends i{constructor(e,t,n,r,o){super(),this.sheetName=e,this.sheetId=t,this.oldSheetContent=n,this.scopedNamedExpressions=r,this.version=o}doUndo(e){e.undoRemoveSheet(this)}doRedo(e){e.redoRemoveSheet(this)}}class y extends i{constructor(e,t,n){super(),this.sheetId=e,this.oldName=t,this.newName=n}doUndo(e){e.undoRenameSheet(this)}doRedo(e){e.redoRenameSheet(this)}}class E extends i{constructor(e,t){super(),this.sheetId=e,this.oldSheetContent=t}doUndo(e){e.undoClearSheet(this)}doRedo(e){e.redoClearSheet(this)}}class T extends i{constructor(e){super(),this.cellContents=e}doUndo(e){e.undoSetCellContents(this)}doRedo(e){e.redoSetCellContents(this)}}class C extends i{constructor(e,t,n,r){super(),this.targetLeftCorner=e,this.oldContent=t,this.newContent=n,this.addedGlobalNamedExpressions=r}doUndo(e){e.undoPaste(this)}doRedo(e){e.redoPaste(this)}}class R extends i{constructor(e,t,n,r){super(),this.name=e,this.newContent=t,this.scope=n,this.options=r}doUndo(e){e.undoAddNamedExpression(this)}doRedo(e){e.redoAddNamedExpression(this)}}class w extends i{constructor(e,t,n){super(),this.namedExpression=e,this.content=t,this.scope=n}doUndo(e){e.undoRemoveNamedExpression(this)}doRedo(e){e.redoRemoveNamedExpression(this)}}class S extends i{constructor(e,t,n,r,o){super(),this.namedExpression=e,this.newContent=t,this.oldContent=n,this.scope=r,this.options=o}doUndo(e){e.undoChangeNamedExpression(this)}doRedo(e){e.redoChangeNamedExpression(this)}}class O extends i{constructor(){super(...arguments),this.operations=[]}add(e){this.operations.push(e)}*reversedOperations(){for(let e=this.operations.length-1;e>=0;e--)yield this.operations[e]}doUndo(e){e.undoBatch(this)}doRedo(e){e.redoBatch(this)}}class b{constructor(e,t){this.operations=t,this.oldData=new Map,this.undoStack=[],this.redoStack=[],this.undoLimit=e.undoLimit}saveOperation(e){void 0!==this.batchUndoEntry?this.batchUndoEntry.add(e):this.addUndoEntry(e)}beginBatchMode(){this.batchUndoEntry=new O}commitBatchMode(){if(void 0===this.batchUndoEntry)throw Error("Batch mode wasn't started");this.addUndoEntry(this.batchUndoEntry),this.batchUndoEntry=void 0}storeDataForVersion(e,t,n){this.oldData.has(e)||this.oldData.set(e,[]);this.oldData.get(e).push([t,n])}clearRedoStack(){this.redoStack=[]}clearUndoStack(){this.undoStack=[]}isUndoStackEmpty(){return 0===this.undoStack.length}isRedoStackEmpty(){return 0===this.redoStack.length}undo(){const e=this.undoStack.pop();if(!e)throw Error("Attempted to undo without operation on stack");this.undoEntry(e),this.redoStack.push(e)}undoBatch(e){for(const t of e.reversedOperations())this.undoEntry(t)}undoRemoveRows(e){this.operations.forceApplyPostponedTransformations();const{command:{sheet:t},rowsRemovals:n}=e;for(let
Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.AdvancedFind{constructor(e){super(e),this.dependencyGraph=e}add(e,t){}remove(e,t){}change(e,t,n){}applyChanges(e){}addColumns(e){}removeColumns(e){}removeSheet(e){}moveValues(e,t,n,r){}removeValues(e){}find(e,t,n){return this.basicFind(e,t,"row",n)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"AdvancedFind",(function(){return a}));var r=n(43),o=n(101),i=n(679);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a{constructor(e){this.dependencyGraph=e}advancedFind(e,t){let n;const o=t.range;n=void 0===o?t.valuesFromTopLeftCorner():this.dependencyGraph.computeListOfValuesInRange(o);for(let t=0;t<n.length;t++)if(e(Object(r.getRawValue)(n[t])))return t;return-1}basicFind(e,t,n,{ordering:r,matchExactly:a}){const s="string"==typeof e?Object(o.forceNormalizeString)(e):e,u=t.range;return void 0===u?this.findNormalizedValue(s,t.valuesFromTopLeftCorner()):"none"===r?this.findNormalizedValue(s,this.dependencyGraph.computeListOfValuesInRange(u)):Object(i.findLastOccurrenceInOrderedRange)(s,u,{searchCoordinate:n,orderingDirection:r,matchExactly:a},this.dependencyGraph)}findNormalizedValue(e,t){return t.map(r.getRawValue).map(e=>"string"==typeof e?Object(o.forceNormalizeString)(e):e).indexOf(e)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"AddressPlugin",(function(){return u}));var r,o=n(87),i=n(26),a=n(17),s=n(33);!function(e){e[e.FullyAbsolute=1]="FullyAbsolute",e[e.RowAbsoluteColRelative=2]="RowAbsoluteColRelative",e[e.RowRelativeColAbsolute=3]="RowRelativeColAbsolute",e[e.FullyRelative=4]="FullyRelative"}(r||(r={}));class u extends i.FunctionPlugin{verifyAddressArguments(e,t,n,o){if(o){if(e<1||t<1)return new a.CellError(a.ErrorType.VALUE,s.ErrorMessage.LessThanOne)}else if(r.FullyAbsolute==n){if(e<1||t<1)return new a.CellError(a.ErrorType.VALUE,s.ErrorMessage.LessThanOne)}else if(r.RowAbsoluteColRelative==n){if(e<1)return new a.CellError(a.ErrorType.VALUE,s.ErrorMessage.LessThanOne)}else if(r.RowRelativeColAbsolute==n&&t<1)return new a.CellError(a.ErrorType.VALUE,s.ErrorMessage.LessThanOne)}address(e,t){return this.runFunction(e.args,t,this.metadata("ADDRESS"),(e,t,n,i,a)=>{const s=this.verifyAddressArguments(e,t,n,i);if(void 0!==s)return s;const u=Object(o.columnIndexToLabel)(t-1);let l="";null!=a&&(l=a+"!");const c=0==t?"C":`C[${t}]`,d=0==e?"R":`R[${e}]`;return r.FullyRelative==n?i?`${l}${u}${e}`:`${l}${d}${c}`:r.RowRelativeColAbsolute==n?i?`${l}$${u}${e}`:`${l}${d}C${t}`:r.RowAbsoluteColRelative==n?i?`${l}${u}$${e}`:`${l}R${e}${c}`:i?`${l}$${u}$${e}`:`${l}R${e}C${t}`})}}u.implementedFunctions={ADDRESS:{method:"address",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,defaultValue:1,minValue:1,maxValue:4},{argumentType:i.FunctionArgumentType.BOOLEAN,optionalArg:!0,defaultValue:!0},{argumentType:i.FunctionArgumentType.STRING,optionalArg:!0}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ArrayPlugin",(function(){return d}));var r=n(99),o=n(17),i=n(33),a=n(61),s=n(101),u=n(162),l=n(69),c=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class d extends c.FunctionPlugin{arrayformula(e,t){return this.runFunction(e.args,t,this.metadata("ARRAYFORMULA"),e=>e)}arrayformulaArraySize(e,t){if(1!==e.args.length)return r.ArraySize.error();const n=this.metadata("ARRAYFORMULA");return e.args.map(e=>{var r;return this.arraySizeForAst(e,new u.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))})[0]}arrayconstrain(e,t){return this.runFunction(e.args,t,this.metadata("ARRAY_CONSTRAIN"),(e,t,n)=>{t=Math.min(t,e.height()),n=Math.min(n,e.width());const r=e.data,o=[];for(let e=0;e<t;e++)o.push(r[e].slice(0,n));return l.SimpleRangeValue.onlyValues(o)})}arrayconstrainArraySize(e,t){if(3!==e.args.length)return r.ArraySize.error();const n=this.metadata("ARRAY_CONSTRAIN"),o=e.args.map(e=>{var r;return this.arraySizeForAst(e,new u.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))});let{height:i,width:s}=o[0];return e.args[1].type===a.AstNodeType.NUMBER&&(i=Math.min(i,e.args[1].value)),e.args[2].type===a.AstNodeType.NUMBER&&(s=Math.min(s,e.args[2].value)),i<1||s<1||!Number.isInteger(i)||!Number.isInteger(s)?r.ArraySize.error():new r.ArraySize(s,i)}filter(e,t){return this.runFunction(e.args,t,this.metadata("FILTER"),(e,...t)=>{for(const n of t)if(e.width()!==n.width()||e.height()!==n.height())return new o.CellError(o.ErrorType.NA,i.ErrorMessage.EqualLength);if(e.width()>1&&e.height()>1)return new o.CellError(o.ErrorType.NA,i.ErrorMessage.WrongDimension);const n=e.data,r=[];for(let o=0;o<e.height();o++){const i=[];for(let r=0;r<e.width();r++){let e=!0;for(const n of t){if(!0!==Object(s.coerceScalarToBoolean)(n.data[o][r])){e=!1;break}}e&&i.push(n[o][r])}i.length>0&&r.push(i)}return r.length>0?l.SimpleRangeValue.onlyValues(r):new o.CellError(o.ErrorType.NA,i.ErrorMessage.EmptyRange)})}filterArraySize(e,t){if(e.args.length<=1)return r.ArraySize.error();const n=this.metadata("FILTER"),o=e.args.map(e=>{var r;return this.arraySizeForAst(e,new u.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))}),i=Math.max(...o.map(e=>e.width)),a=Math.max(...o.map(e=>e.height));return new r.ArraySize(i,a)}}d.implementedFunctions={ARRAYFORMULA:{method:"arrayformula",arraySizeMethod:"arrayformulaArraySize",arrayFunction:!0,parameters:[{argumentType:c.FunctionArgumentType.ANY}]},ARRAY_CONSTRAIN:{method:"arrayconstrain",arraySizeMethod:"arrayconstrainArraySize",parameters:[{argumentType:c.FunctionArgumentType.RANGE},{argumentType:c.FunctionArgumentType.INTEGER,minValue:1},{argumentType:c.FunctionArgumentType.INTEGER,minValue:1}],vectorizationForbidden:!0},FILTER:{method:"filter",arraySizeMethod:"filterArraySize",arrayFunction:!0,parameters:[{argumentType:c.FunctionArgumentType.RANGE},{argumentType:c.FunctionArgumentType.RANGE}],repeatLastArgs:1}}},function(e,t,n){"use strict";n.r(t),n.d(t,"AbsPlugin",(function(){return o}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{abs(e,t){return this.runFunction(e.args,t,this.metadata("ABS"),Math.abs)}}o.implementedFunctions={ABS:{method:"abs",parameters:[{argumentType:r.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"BitShiftPlugin",(function(){return a}));var r=n(17),o=n(33),i=n(26);class a extends i.FunctionPlugin{bitlshift(e,t){return this.runFunction(e.args,t,this.metadata("BITLSHIFT"),s)}bitrshift(e,t){return this.runFunction(e.args,t,this.metadata("BITRSHIFT"),u)}}function s(e,t){return t<0?u(e,-t):l(e*Math.pow(2,t))}function u(e,t){return t<0?s(e,-t):l(Math.floor(e/Math.pow(2,t)))}function l(e){return e>0xffffffffffff?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.BitshiftLong):e}a.implementedFunctions={BITLSHIFT:{method:"bitlshift",parameters:[{argumentType:i.FunctionArgumentType.INTEGER,minValue:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:-53,maxValue:53}]},BITRSHIFT:{method:"bitrshift",parameters:[{argumentType:i.FunctionArgumentType.INTEGER,minValue:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:-53,maxValue:53}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"BitwiseLogicOperationsPlugin",(function(){return o}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{bitand(e,t){return this.runFunction(e.args,t,this.metadata("BITAND"),(e,t)=>e&t)}bitor(e,t){return this.runFunction(e.args,t,this.metadata("BITOR"),(e,t)=>e|t)}bitxor(e,t){return this.runFunction(e.args,t,this.metadata("BITXOR"),(e,t)=>e^t)}}o.implementedFunctions={BITAND:{method:"bitand",parameters:[{argumentType:r.FunctionArgumentType.INTEGER,minValue:0},{argumentType:r.FunctionArgumentType.INTEGER,minValue:0}]},BITOR:{method:"bitor",parameters:[{argumentType:r.FunctionArgumentType.INTEGER,minValue:0},{argumentType:r.FunctionArgumentType.INTEGER,minValue:0}]},BITXOR:{method:"bitxor",parameters:[{argumentType:r.FunctionArgumentType.INTEGER,minValue:0},{argumentType:r.FunctionArgumentType.INTEGER,minValue:0}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"BooleanPlugin",(function(){return a}));var r=n(17),o=n(33),i=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a extends i.FunctionPlugin{literalTrue(e,t){return this.runFunction(e.args,t,this.metadata("TRUE"),()=>!0)}literalFalse(e,t){return this.runFunction(e.args,t,this.metadata("FALSE"),()=>!1)}conditionalIf(e,t){return this.runFunction(e.args,t,this.metadata("IF"),(e,t,n)=>e?t:n)}ifs(e,t){return this.runFunction(e.args,t,this.metadata("IFS"),(...e)=>{for(let t=0;t<e.length;t+=2)if(e[t])return e[t+1];return new r.CellError(r.ErrorType.NA,o.ErrorMessage.NoConditionMet)})}and(e,t){return this.runFunction(e.args,t,this.metadata("AND"),(...e)=>e.filter(e=>void 0!==e).every(e=>!!e))}or(e,t){return this.runFunction(e.args,t,this.metadata("OR"),(...e)=>e.filter(e=>void 0!==e).some(e=>e))}not(e,t){return this.runFunction(e.args,t,this.metadata("NOT"),e=>!e)}xor(e,t){return this.runFunction(e.args,t,this.metadata("XOR"),(...e)=>{let t=0;return e.filter(e=>void 0!==e).forEach(e=>{e&&t++}),t%2==1})}switch(e,t){return this.runFunction(e.args,t,this.metadata("SWITCH"),(e,...t)=>{const n=t.length;let i=0;for(;i+1<n;i+=2)if(!(t[i]instanceof r.CellError)&&this.arithmeticHelper.eq(e,t[i]))return t[i+1];return i<n?t[i]:new r.CellError(r.ErrorType.NA,o.ErrorMessage.NoDefault)})}iferror(e,t){return this.runFunction(e.args,t,this.metadata("IFERROR"),(e,t)=>e instanceof r.CellError?t:e)}ifna(e,t){return this.runFunction(e.args,t,this.metadata("IFNA"),(e,t)=>e instanceof r.CellError&&e.type===r.ErrorType.NA?t:e)}choose(e,t){return this.runFunction(e.args,t,this.metadata("CHOOSE"),(e,...t)=>e>t.length?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.Selector):t[e-1])}}a.implementedFunctions={TRUE:{method:"literalTrue",parameters:[]},FALSE:{method:"literalFalse",parameters:[]},IF:{method:"conditionalIf",parameters:[{argumentType:i.FunctionArgumentType.BOOLEAN},{argumentType:i.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:i.FunctionArgumentType.SCALAR,defaultValue:!1,passSubtype:!0}]},IFS:{method:"ifs",parameters:[{argumentType:i.FunctionArgumentType.BOOLEAN},{argumentType:i.FunctionArgumentType.SCALAR,passSubtype:!0}],repeatLastArgs:2},AND:{method:"and",parameters:[{argumentType:i.FunctionArgumentType.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},OR:{method:"or",parameters:[{argumentType:i.FunctionArgumentType.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},XOR:{method:"xor",parameters:[{argumentType:i.FunctionArgumentType.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},NOT:{method:"not",parameters:[{argumentType:i.FunctionArgumentType.BOOLEAN}]},SWITCH:{method:"switch",parameters:[{argumentType:i.FunctionArgumentType.NOERROR},{argumentType:i.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:i.FunctionArgumentType.SCALAR,passSubtype:!0}],repeatLastArgs:1},IFERROR:{method:"iferror",parameters:[{argumentType:i.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:i.FunctionArgumentType.SCALAR,passSubtype:!0}]},IFNA:{method:"ifna",parameters:[{argumentType:i.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:i.FunctionArgumentType.SCALAR,passSubtype:!0}]},CHOOSE:{method:"choose",parameters:[{argumentType:i.FunctionArgumentType.INTEGER,minValue:1},{argumentType:i.FunctionArgumentType.SCALAR,passSubtype:!0}],repeatLastArgs:1}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CharPlugin",(function(){return a}));var r=n(17),o=n(33),i=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a extends i.FunctionPlugin{char(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),e=>e<1||e>=256?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.CharacterCodeBounds):String.fromCharCode(Math.trunc(e)))}unichar(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),e=>e<1||e>=1114112?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.CharacterCodeBounds):String.fromCodePoint(Math.trunc(e)))}}a.implementedFunctions={CHAR:{method:"char",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},UNICHAR:{method:"unichar",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CodePlugin",(function(){return a}));var r=n(17),o=n(33),i=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a extends i.FunctionPlugin{code(e,t){return this.runFunction(e.args,t,this.metadata("CODE"),e=>0===e.length?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.EmptyString):e.charCodeAt(0))}unicode(e,t){return this.runFunction(e.args,t,this.metadata("UNICODE"),e=>{var t;return null!==(t=e.codePointAt(0))&&void 0!==t?t:new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.EmptyString)})}}a.implementedFunctions={CODE:{method:"code",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},UNICODE:{method:"unicode",parameters:[{argumentType:i.FunctionArgumentType.STRING}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CountBlankPlugin",(function(){return i}));var r=n(43),o=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i extends o.FunctionPlugin{countblank(e,t){return this.runFunction(e.args,t,this.metadata("COUNTBLANK"),(...e)=>{let t=0;return e.forEach(e=>{e===r.EmptyValue&&t++}),t})}}i.implementedFunctions={COUNTBLANK:{method:"countblank",parameters:[{argumentType:o.FunctionArgumentType.SCALAR}],repeatLastArgs:1,expandRanges:!0}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CountUniquePlugin",(function(){return i}));var r=n(17),o=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i extends o.FunctionPlugin{countunique(e,t){return this.runFunction(e.args,t,this.metadata("COUNTUNIQUE"),(...e)=>{const t=new Set,n=new Set;for(const o of e)o instanceof r.CellError?n.add(o.type):""!==o&&t.add(o);return t.size+n.size})}}i.implementedFunctions={COUNTUNIQUE:{method:"countunique",parameters:[{argumentType:o.FunctionArgumentType.SCALAR}],repeatLastArgs:1,expandRanges:!0}}},function(e,t,n){"use strict";n.r(t),n.d(t,"DateTimePlugin",(function(){return l}));var r=n(17),o=n(139),i=n(33),a=n(261),s=n(43),u=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class l extends u.FunctionPlugin{constructor(){super(...arguments),this.isoweeknumCore=e=>{const t=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),n=this.dateTimeHelper.numberToSimpleDate(e),r=this.dateTimeHelper.dateToNumber({year:n.year,month:1,day:1}),o=this.dateTimeHelper.relativeNumberToAbsoluteNumber(r),i=o+((4-o)%7+7)%7,a=Math.floor((t-1)/7)-Math.floor((i-1)/7)+1;return 0===a?this.isoweeknumCore(e-7)+1:a},this.days360Core=(e,t,n)=>{const r=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);let a,s;return n?(a=Object(o.toBasisEU)(r),s=Object(o.toBasisEU)(i)):[a,s]=this.dateTimeHelper.toBasisUS(r,i),360*(s.year-a.year)+30*(s.month-a.month)+s.day-a.day}}date(e,t){return this.runFunction(e.args,t,this.metadata("DATE"),(e,t,n)=>{const o=Math.trunc(n);let a=Math.trunc(t),s=Math.trunc(e);s<this.dateTimeHelper.getEpochYearZero()&&(s+=this.dateTimeHelper.getEpochYearZero());const u=Math.floor((a-1)/12);s+=u,a-=12*u;const l={year:s,month:a,day:1};if(this.dateTimeHelper.isValidDate(l)){let e=this.dateTimeHelper.dateToNumber(l)+(o-1);return e=this.dateTimeHelper.getWithinBounds(e),void 0===e?new r.CellError(r.ErrorType.NUM,i.ErrorMessage.DateBounds):e}return new r.CellError(r.ErrorType.VALUE,i.ErrorMessage.InvalidDate)})}time(e,t){return this.runFunction(e.args,t,this.metadata("TIME"),(e,t,n)=>{const a=Object(o.timeToNumber)({hours:Math.trunc(e),minutes:Math.trunc(t),seconds:Math.trunc(n)});return a<0?new r.CellError(r.ErrorType.NUM,i.ErrorMessage.NegativeTime):a%1})}eomonth(e,t){return this.runFunction(e.args,t,this.metadata("EOMONTH"),(e,t)=>{const n=this.dateTimeHelper.numberToSimpleDate(e);let a=this.dateTimeHelper.dateToNumber(this.dateTimeHelper.endOfMonth(Object(o.offsetMonth)(n,t)));return a=this.dateTimeHelper.getWithinBounds(a),void 0===a?new r.CellError(r.ErrorType.NUM,i.ErrorMessage.DateBounds):a})}day(e,t){return this.runFunction(e.args,t,this.metadata("DAY"),e=>this.dateTimeHelper.numberToSimpleDate(e).day)}days(e,t){return this.runFunction(e.args,t,this.metadata("DAYS"),(e,t)=>Math.trunc(e)-Math.trunc(t))}month(e,t){return this.runFunction(e.args,t,this.metadata("MONTH"),e=>this.dateTimeHelper.numberToSimpleDate(e).month)}year(e,t){return this.runFunction(e.args,t,this.metadata("YEAR"),e=>this.dateTimeHelper.numberToSimpleDate(e).year)}hour(e,t){return this.runFunction(e.args,t,this.metadata("HOUR"),e=>Object(o.numberToSimpleTime)(Object(o.roundToNearestSecond)(e)%1).hours)}minute(e,t){return this.runFunction(e.args,t,this.metadata("MINUTE"),e=>Object(o.numberToSimpleTime)(Object(o.roundToNearestSecond)(e)%1).minutes)}second(e,t){return this.runFunction(e.args,t,this.metadata("SECOND"),e=>Object(o.numberToSimpleTime)(Object(o.roundToNearestSecond)(e)%1).seconds)}text(e,t){return this.runFunction(e.args,t,this.metadata("TEXT"),(e,t)=>Object(a.format)(e,t,this.config,this.dateTimeHelper))}weekday(e,t){return this.runFunction(e.args,t,this.metadata("WEEKDAY"),(e,t)=>{const n=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e));if(3===t)return(n-1)%7;const o=h.get(t);return void 0===o?new r.CellError(r.ErrorType.NUM,i.ErrorMessage.BadMode):(n-o)%7+1})}weeknum(e,t){return this.runFunction(e.args,t,this.metadata("WEEKNUM"),(e,t)=>{const n=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),o=this.dateTimeHelper.numberToSimpleDate(e),a=this.dateTimeHelper.dateToNumber({year:o.year,month:1,day:1}),s=this.dateTimeHelper.relativeNumberToAbsoluteNumber(a);if(21===t)return this.isoweeknumCore(e);const u=h.get(t);return void 0===u?new r.CellError(r.ErrorType.NUM,i.ErrorMessage.BadMode):Math.floor((n-u)/7)-Math.floor((s-u)/7)+1})}isoweeknum(e,t){return this.runFunction(e.args,t,this.metadata("ISOWEEKNUM"),this.isoweeknumCore)}datevalue(e,t){return this.runFunction(e.args,t,this.metadata("DATEVALUE"),e=>{const{dateTime:t}=this.dateTimeHelper.parseDateTimeFromConfigFormats(e);return void 0===t?new r.CellError(r.ErrorType.VALUE,i.ErrorMessage.IncorrectDateTime):Object(o.instanceOfSimpleDate)(t)?(Object(o.instanceOfSimpleTime)(t)?Math.trunc(Object(o.timeToNumber)(t)):0)+this.dateTimeHelper.dateToNumber(t):0})}timevalue(e,t){return this.runFunction(e.args,t,this.metadata("TIMEVALUE"),e=>{const t=this.dateTimeHelper.dateStringToDateNumber(e);return void 0===t?new r.CellError(r.ErrorType.VALUE,i.ErrorMessage.IncorrectDateTime):Object(s.getRawValue)(t)%1})}now(e,t){return this.runFunction(e.args,t,this.metadata("NOW"),()=>{const e=new Date(Date.now());return Object(o.timeToNumber)({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()})+this.dateTimeHelper.dateToNumber({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()})})}today(e,t){return this.runFunction(e.args,t,this.metadata("TODAY"),()=>{const e=new Date(Date.now());return this.dateTimeHelper.dateToNumber({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()})})}edate(e,t){return this.runFunction(e.args,t,this.metadata("EDATE"),(e,t)=>{const n=this.dateTimeHelLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{degrees(e,t){return this.runFunction(e.args,t,this.metadata("DEGREES"),e=>e*(180/Math.PI))}}o.implementedFunctions={DEGREES:{method:"degrees",parameters:[{argumentType:r.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"DeltaPlugin",(function(){return o}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{delta(e,t){return this.runFunction(e.args,t,this.metadata("DELTA"),(e,t)=>e===t?1:0)}}o.implementedFunctions={DELTA:{method:"delta",parameters:[{argumentType:r.FunctionArgumentType.NUMBER},{argumentType:r.FunctionArgumentType.NUMBER,defaultValue:0}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ExpPlugin",(function(){return o}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{exp(e,t){return this.runFunction(e.args,t,this.metadata("EXP"),Math.exp)}}o.implementedFunctions={EXP:{method:"exp",parameters:[{argumentType:r.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"FinancialPlugin",(function(){return s}));var r=n(17),o=n(33),i=n(43),a=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class s extends a.FunctionPlugin{pmt(e,t){return this.runFunction(e.args,t,this.metadata("PMT"),u)}ipmt(e,t){return this.runFunction(e.args,t,this.metadata("IPMT"),l)}ppmt(e,t){return this.runFunction(e.args,t,this.metadata("PPMT"),d)}fv(e,t){return this.runFunction(e.args,t,this.metadata("FV"),c)}cumipmt(e,t){return this.runFunction(e.args,t,this.metadata("CUMIPMT"),(e,t,n,i,a,s)=>{if(i>a)return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.EndStartPeriod);let u=0;for(let r=i;r<=a;r++)u+=l(e,r,t,n,0,s);return u})}cumprinc(e,t){return this.runFunction(e.args,t,this.metadata("CUMPRINC"),(e,t,n,i,a,s)=>{if(i>a)return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.EndStartPeriod);let u=0;for(let r=i;r<=a;r++)u+=d(e,r,t,n,0,s);return u})}db(e,t){return this.runFunction(e.args,t,this.metadata("DB"),(e,t,n,i,a)=>{if(12===a&&i>n||i>n+1)return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.PeriodLong);if(t>=e)return 0;const s=Math.round(1e3*(1-Math.pow(t/e,1/n)))/1e3,u=e*s*a/12;if(1===i)return u;let l=u;for(let t=0;t<i-2;t++)l+=(e-l)*s;return i===n+1?(e-l)*s*(12-a)/12:(e-l)*s})}ddb(e,t){return this.runFunction(e.args,t,this.metadata("DDB"),(e,t,n,o,i)=>{if(o>n)return new r.CellError(r.ErrorType.NUM);let a,s=i/n;s>=1?(s=1,a=1===o?e:0):a=e*Math.pow(1-s,o-1);const u=e*Math.pow(1-s,o);return Math.max(a-Math.max(t,u),0)})}dollarde(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARDE"),(e,t)=>{if(t<1)return new r.CellError(r.ErrorType.DIV_BY_ZERO);for(t=Math.trunc(t);t>10;)t/=10;return Math.trunc(e)+10*(e-Math.trunc(e))/t})}dollarfr(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARFR"),(e,t)=>{if(t<1)return new r.CellError(r.ErrorType.DIV_BY_ZERO);for(t=Math.trunc(t);t>10;)t/=10;return Math.trunc(e)+(e-Math.trunc(e))*t/10})}effect(e,t){return this.runFunction(e.args,t,this.metadata("EFFECT"),(e,t)=>(t=Math.trunc(t),Math.pow(1+e/t,t)-1))}ispmt(e,t){return this.runFunction(e.args,t,this.metadata("ISPMT"),(e,t,n,o)=>0===n?new r.CellError(r.ErrorType.DIV_BY_ZERO):o*e*(t/n-1))}nominal(e,t){return this.runFunction(e.args,t,this.metadata("NOMINAL"),(e,t)=>(t=Math.trunc(t),(Math.pow(e+1,1/t)-1)*t))}nper(e,t){return this.runFunction(e.args,t,this.metadata("NPER"),(e,t,n,o,i)=>0===e?0===t?new r.CellError(r.ErrorType.DIV_BY_ZERO):(-n-o)/t:(i&&(t*=1+e),Math.log((t-o*e)/(n*e+t))/Math.log(1+e)))}rate(e,t){return this.runFunction(e.args,t,this.metadata("RATE"),(e,t,n,o,i,a)=>{if(a<=-1)return new r.CellError(r.ErrorType.VALUE);let s=a;i=i?1:0;for(let a=0;a<50;a++){if(s<=-1)return new r.CellError(r.ErrorType.NUM);let a,u;if(Math.abs(s)<1e-7)a=n*(1+e*s)+t*(1+s*i)*e+o;else{const r=Math.pow(1+s,e);a=n*r+t*(1/s+i)*(r-1)+o}if(Math.abs(a)<1e-7)return s;if(Math.abs(s)<1e-7)u=n*e+t*i*e;else{const r=Math.pow(1+s,e),o=e*Math.pow(1+s,e-1);u=n*o+t*(1/s+i)*o+t*(-1/(s*s))*(r-1)}s-=a/u}return new r.CellError(r.ErrorType.NUM)})}pv(e,t){return this.runFunction(e.args,t,this.metadata("PV"),(e,t,n,o,i)=>(i=i?1:0,-1===e?0===t?new r.CellError(r.ErrorType.NUM):new r.CellError(r.ErrorType.DIV_BY_ZERO):0===e?-n*t-o:((1-Math.pow(1+e,t))*n*(1+e*i)/e-o)/Math.pow(1+e,t)))}rri(e,t){return this.runFunction(e.args,t,this.metadata("RRI"),(e,t,n)=>0===t||n<0&&t>0||n>0&&t<0?new r.CellError(r.ErrorType.NUM):Math.pow(n/t,1/e)-1)}sln(e,t){return this.runFunction(e.args,t,this.metadata("SLN"),(e,t,n)=>0===n?new r.CellError(r.ErrorType.DIV_BY_ZERO):(e-t)/n)}syd(e,t){return this.runFunction(e.args,t,this.metadata("SYD"),(e,t,n,o)=>o>n?new r.CellError(r.ErrorType.NUM):(e-t)*(n-o+1)*2/(n*(n+1)))}tbilleq(e,t){return this.runFunction(e.args,t,this.metadata("TBILLEQ"),(e,t,n)=>{if((e=Math.round(e))>=(t=Math.round(t)))return new r.CellError(r.ErrorType.NUM);const o=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);if(i.year>o.year+1||i.year===o.year+1&&(i.month>o.month||i.month===o.month&&i.day>o.day))return new r.CellError(r.ErrorType.NUM);const a=360-n*(t-e);return 0===a?0:a<0?new r.CellError(r.ErrorType.NUM):365*n/a})}tbillprice(e,t){return this.runFunction(e.args,t,this.metadata("TBILLPRICE"),(e,t,n)=>{if((e=Math.round(e))>=(t=Math.round(t)))return new r.CellError(r.ErrorType.NUM);const o=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);if(i.year>o.year+1||i.year===o.year+1&&(i.month>o.month||i.month===o.month&&i.day>o.day))return new r.CellError(r.ErrorType.NUM);const a=360-n*(t-e);return 0===a?0:a<0?new r.CellError(r.ErrorType.NUM):100*(1-n*(t-e)/360)})}tbillyield(e,t){return this.runFunction(e.args,t,this.metadata("TBILLYIELD"),(e,t,n)=>{if((e=Math.round(e))>=(t=Math.round(t)))return new r.CellError(r.ErrorType.NUM);const o=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);return i.year>o.year+1||i.year===o.year+1&&(i.month>o.month||i.month===o.month&&i.day>o.day)?new r.CellError(r.ErrorType.NUM):360*(100-n)/(n*(t-e))})}fvschedule(e,t){return this.runFunction(e.args,t,this.metadata("FVSCHEDULE"),(e,t)=>{const n=t.valuesFromTopLeftCorner();for(constLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class s extends i.FunctionPlugin{formulatext(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("FORMULATEXT"),()=>new r.CellError(r.ErrorType.NA,o.ErrorMessage.WrongArgNumber),e=>{var t;return null!==(t=this.serialization.getCellFormula(e))&&void 0!==t?t:new r.CellError(r.ErrorType.NA,o.ErrorMessage.Formula)})}}s.implementedFunctions={FORMULATEXT:{method:"formulatext",parameters:[{argumentType:a.FunctionArgumentType.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,isDependentOnSheetStructureChange:!0,vectorizationForbidden:!0}}},function(e,t,n){"use strict";n.r(t),n.d(t,"HyperlinkPlugin",(function(){return o}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{hyperlink(e,t){return this.runFunction(e.args,t,this.metadata("HYPERLINK"),(t,n)=>(e.hyperlink=t,null!=n?n:t))}}o.implementedFunctions={HYPERLINK:{method:"hyperlink",parameters:[{argumentType:r.FunctionArgumentType.STRING},{argumentType:r.FunctionArgumentType.STRING,optionalArg:!0}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"InformationPlugin",(function(){return c}));var r=n(17),o=n(105),i=n(33),a=n(61),s=n(43),u=n(69),l=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class c extends l.FunctionPlugin{isbinary(e,t){return this.runFunction(e.args,t,this.metadata("ISBINARY"),e=>/^[01]{1,10}$/.test(e))}iserr(e,t){return this.runFunction(e.args,t,this.metadata("ISERR"),e=>e instanceof r.CellError&&e.type!==r.ErrorType.NA)}iserror(e,t){return this.runFunction(e.args,t,this.metadata("ISERROR"),e=>e instanceof r.CellError)}isformula(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("ISFORMULA"),()=>new r.CellError(r.ErrorType.NA,i.ErrorMessage.WrongArgNumber),e=>this.dependencyGraph.addressMapping.getCell(e)instanceof o.FormulaVertex)}isblank(e,t){return this.runFunction(e.args,t,this.metadata("ISBLANK"),e=>e===s.EmptyValue)}isna(e,t){return this.runFunction(e.args,t,this.metadata("ISNA"),e=>e instanceof r.CellError&&e.type==r.ErrorType.NA)}isnumber(e,t){return this.runFunction(e.args,t,this.metadata("ISNUMBER"),s.isExtendedNumber)}islogical(e,t){return this.runFunction(e.args,t,this.metadata("ISLOGICAL"),e=>"boolean"==typeof e)}isref(e,t){return this.runFunction(e.args,t,this.metadata("ISREF"),e=>e instanceof r.CellError&&(e.type==r.ErrorType.REF||e.type==r.ErrorType.CYCLE))}istext(e,t){return this.runFunction(e.args,t,this.metadata("ISTEXT"),e=>"string"==typeof e)}isnontext(e,t){return this.runFunction(e.args,t,this.metadata("ISNONTEXT"),e=>!("string"==typeof e))}column(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("COLUMN"),()=>t.formulaAddress.col+1,e=>e.col+1)}columns(e,t){if(1!==e.args.length)return new r.CellError(r.ErrorType.NA,i.ErrorMessage.WrongArgNumber);if(e.args.some(e=>e.type===a.AstNodeType.EMPTY))return new r.CellError(r.ErrorType.NUM,i.ErrorMessage.EmptyArg);let n=e.args[0];for(;n.type===a.AstNodeType.PARENTHESIS;)n=n.expression;if(n.type===a.AstNodeType.CELL_RANGE||n.type===a.AstNodeType.COLUMN_RANGE)return n.end.col-n.start.col+1;if(n.type===a.AstNodeType.CELL_REFERENCE)return 1;if(n.type===a.AstNodeType.ROW_RANGE)return this.config.maxColumns;{const e=this.evaluateAst(n,t);return e instanceof u.SimpleRangeValue?e.width():e instanceof r.CellError?e:1}}row(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("ROW"),()=>t.formulaAddress.row+1,e=>e.row+1)}rows(e,t){if(1!==e.args.length)return new r.CellError(r.ErrorType.NA,i.ErrorMessage.WrongArgNumber);if(e.args.some(e=>e.type===a.AstNodeType.EMPTY))return new r.CellError(r.ErrorType.NUM,i.ErrorMessage.EmptyArg);let n=e.args[0];for(;n.type===a.AstNodeType.PARENTHESIS;)n=n.expression;if(n.type===a.AstNodeType.CELL_RANGE||n.type===a.AstNodeType.ROW_RANGE)return n.end.row-n.start.row+1;if(n.type===a.AstNodeType.CELL_REFERENCE)return 1;if(n.type===a.AstNodeType.COLUMN_RANGE)return this.config.maxRows;{const e=this.evaluateAst(n,t);return e instanceof u.SimpleRangeValue?e.height():e instanceof r.CellError?e:1}}index(e,t){return this.runFunction(e.args,t,this.metadata("INDEX"),(e,t,n)=>{var o,a,s,u,l,c;return n<1||t<1?new r.CellError(r.ErrorType.VALUE,i.ErrorMessage.LessThanOne):n>e.width()||t>e.height()?new r.CellError(r.ErrorType.NUM,i.ErrorMessage.ValueLarge):null!==(c=null!==(s=null===(a=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o[t-1])||void 0===a?void 0:a[n-1])&&void 0!==s?s:null===(l=null===(u=null==e?void 0:e.data)||void 0===u?void 0:u[0])||void 0===l?void 0:l[0])&&void 0!==c?c:new r.CellError(r.ErrorType.VALUE,i.ErrorMessage.CellRangeExpected)})}na(e,t){return new r.CellError(r.ErrorType.NA)}sheet(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEET"),()=>t.formulaAddress.sheet+1,e=>e.sheet+1,e=>{const t=this.dependencyGraph.sheetMapping.get(e);return void 0!==t?t+1:new r.CellError(r.ErrorType.NA,i.ErrorMessage.SheetRef)})}sheets(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEETS"),()=>this.dependencyGraph.sheetMapping.numberOfSheets(),()=>1,()=>new r.CellError(r.ErrorType.VALUE,i.ErrorMessage.CellRefExpected))}}c.implementedFunctions={COLUMN:{method:"column",parameters:[{argumentType:l.FunctionArgumentType.NOERROR,optionalArg:!0}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},COLUMNS:{method:"columns",parameters:[{argumentType:l.FunctionArgumentType.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISBINARY:{method:"isbinary",parameters:[{argumentType:l.FunctionArgumentType.STRING}]},ISERR:{method:"iserr",parameters:[{argumentType:l.FunctionArgumentType.SCALAR}]},ISFORMULA:{method:"isformula",parameters:[{argumentType:l.FunctionArgumentType.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISNA:{method:"isna",parameters:[{argumentType:l.FunctionArgumentType.SCALAR}]},ISREF:{method:"isref",parameters:[{argumentType:l.FunctionArgumentType.SCALAR}],vectorizationForbidden:!0},ISERROR:{method:"iserror",parameters:[{argumentType:l.FunctionArgumentType.SCALAR}]},ISBLANK:{method:"isblank",parameters:[{argumentType:l.FunctionArgumentType.SCALAR}]},Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{iseven(e,t){return this.runFunction(e.args,t,this.metadata("ISEVEN"),e=>e%2==0)}}o.implementedFunctions={ISEVEN:{method:"iseven",parameters:[{argumentType:r.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"IsOddPlugin",(function(){return o}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{isodd(e,t){return this.runFunction(e.args,t,this.metadata("ISODD"),e=>e%2==1)}}o.implementedFunctions={ISODD:{method:"isodd",parameters:[{argumentType:r.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"LogarithmPlugin",(function(){return o}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{log10(e,t){return this.runFunction(e.args,t,this.metadata("LOG10"),Math.log10)}log(e,t){return this.runFunction(e.args,t,this.metadata("LOG"),(e,t)=>Math.log(e)/Math.log(t))}ln(e,t){return this.runFunction(e.args,t,this.metadata("LN"),Math.log)}}o.implementedFunctions={LOG10:{method:"log10",parameters:[{argumentType:r.FunctionArgumentType.NUMBER}]},LOG:{method:"log",parameters:[{argumentType:r.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:r.FunctionArgumentType.NUMBER,defaultValue:10,greaterThan:0}]},LN:{method:"ln",parameters:[{argumentType:r.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"MatrixPlugin",(function(){return h}));var r=n(99),o=n(17),i=n(33),a=n(61),s=n(162),u=n(69),l=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function c(e,t){return new r.ArraySize(t.width,e.height)}function d(e,t,n){return new r.ArraySize(1+(e.width-t)/n,1+(e.height-t)/n)}class h extends l.FunctionPlugin{mmult(e,t){return this.runFunction(e.args,t,this.metadata("MMULT"),(e,t)=>{if(!e.hasOnlyNumbers()||!t.hasOnlyNumbers())return new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.NumberRange);if(t.height()!==e.width())return new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.ArrayDimensions);const n=c(e.size,t.size),r=this.createKernel((function(e,t,n){let r=0;for(let o=0;o<n;++o)r+=e[this.thread.y][o]*t[o][this.thread.x];return r}),n)(e.rawNumbers(),t.rawNumbers(),e.width());return u.SimpleRangeValue.onlyNumbers(r)})}mmultArraySize(e,t){if(2!==e.args.length)return r.ArraySize.error();const n=this.metadata("MMULT"),o=e.args.map(e=>{var r;return this.arraySizeForAst(e,new s.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))}),[i,a]=o;return c(i,a)}maxpool(e,t){return this.runFunction(e.args,t,this.metadata("MAXPOOL"),(e,t,n=t)=>{if(!e.hasOnlyNumbers())return new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.NumberRange);const r=d(e.size,t,n),a=this.createKernel((function(e,t,n){const r=this.thread.x*n,o=this.thread.y*n;let i=e[o][r];for(let n=0;n<t;n++)for(let a=0;a<t;a++)i=Math.max(i,e[o+n][r+a]);return i}),r)(e.rawNumbers(),t,n);return u.SimpleRangeValue.onlyNumbers(a)})}medianpool(e,t){return this.runFunction(e.args,t,this.metadata("MEDIANPOOL"),(e,t,n=t)=>{if(!e.hasOnlyNumbers())return new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.NumberRange);const r=d(e.size,t,n),a=this.createKernel((function(e,t,n){const r=this.thread.x*n,o=this.thread.y*n;let i=e[o][r];for(let n=0;n<t;n++)for(let a=0;a<t;a++)i=Math.max(i,e[o+n][r+a]);let a=e[o][r];for(let n=0;n<t;n++)for(let i=0;i<t;i++)a=Math.min(a,e[o+n][r+i]);const s=t*t;let u=a,l=i,c=42;for(let n=0;n<32;n++){const n=(u+l)/2;let i=0;for(let a=0;a<t;a++)for(let s=0;s<t;s++)e[o+a][r+s]>n&&i++;if(t%2==0){if(i===s/2){c=n;break}i>s/2?u=n:l=n}else{if(i===(s-1)/2){c=n;break}i>(s-1)/2?u=n:l=n}}return c}),r)(e.rawNumbers(),t,n);return u.SimpleRangeValue.onlyNumbers(a)})}maxpoolArraySize(e,t){if(e.args.length<2||e.args.length>3)return r.ArraySize.error();const n=this.metadata("MAXPOOL"),o=e.args.map(e=>{var r;return this.arraySizeForAst(e,new s.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))})[0],i=e.args[1];let u;u=i.type===a.AstNodeType.NUMBER?i.value:1;let l=u;if(3===e.args.length){const t=e.args[2];l=t.type===a.AstNodeType.NUMBER?t.value:1}return u>o.width||u>o.height||l>u||(o.width-u)%l!=0||(o.height-u)%l!=0?r.ArraySize.error():d(o,u,l)}medianpoolArraySize(e,t){return this.maxpoolArraySize(e,t)}transpose(e,t){return this.runFunction(e.args,t,this.metadata("TRANSPOSE"),e=>{const t=e.rawData(),n=e.size,r=[];for(let e=0;e<n.width;++e){r[e]=[];for(let o=0;o<n.height;++o)r[e][o]=t[o][e]}return u.SimpleRangeValue.onlyValues(r)})}transposeArraySize(e,t){if(1!==e.args.length)return r.ArraySize.error();const n=this.metadata("MMULT"),o=e.args.map(e=>{var r;return this.arraySizeForAst(e,new s.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))}),[i]=o;return new r.ArraySize(i.height,i.width)}createKernel(e,t){return function(...n){const r=[];for(let o=0;o<t.height;++o){r.push([]);for(let i=0;i<t.width;++i)r[o][i]=e.apply({thread:{x:i,y:o}},n)}return r}}}h.implementedFunctions={MMULT:{method:"mmult",arraySizeMethod:"mmultArraySize",parameters:[{argumentType:l.FunctionArgumentType.RANGE},{argumentType:l.FunctionArgumentType.RANGE}],vectorizationForbidden:!0},TRANSPOSE:{method:"transpose",arraySizeMethod:"transposeArraySize",parameters:[{argumentType:l.FunctionArgumentType.RANGE}],vectorizationForbidden:!0},MAXPOOL:{method:"maxpool",arraySizeMethod:"maxpoolArraySize",parameters:[{argumentType:l.FunctionArgumentType.RANGE},{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NUMBER,optionalArg:!0}],vectorizationForbidden:!0},MEDIANPOOL:{method:"medianpool",arraySizeMethod:"medianpoolArraySize",parameters:[{argumentType:l.FunctionArgumentType.RANGE},{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NUMBER,optionalArg:!0}],vectorizationForbidden:!0}}},function(e,t,n){"use strict";n.r(t),n.d(t,"MedianPlugin",(function(){return a}));var r=n(17),o=n(33),i=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a extends i.FunctionPlugin{median(e,t){return this.runFunction(e.args,t,this.metadata("MEDIAN"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof r.CellError?t:0===t.length?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.OneValue):(t.sort((e,t)=>e-t),t.length%2==0?(t[t.length/2-1]+t[t.length/2])/2:t[Math.floor(t.length/2)])})}large(e,t){return this.runFunction(e.args,t,this.metadata("LARGE"),(e,t)=>{const n=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return n instanceof r.CellError?n:(n.sort((e,t)=>e-t),(t=Math.trunc(t))>n.length?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueLarge):n[n.length-t])})}small(e,t){return this.runFunction(e.args,t,this.metadata("SMALL"),(e,t)=>{const n=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return n instanceof r.CellError?n:(n.sort((e,t)=>e-t),(t=Math.trunc(t))>n.length?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueLarge):n[t-1])})}}a.implementedFunctions={MEDIAN:{method:"median",parameters:[{argumentType:i.FunctionArgumentType.ANY}],repeatLastArgs:1},LARGE:{method:"large",parameters:[{argumentType:i.FunctionArgumentType.RANGE},{argumentType:i.FunctionArgumentType.NUMBER,minValue:1}]},SMALL:{method:"small",parameters:[{argumentType:i.FunctionArgumentType.RANGE},{argumentType:i.FunctionArgumentType.NUMBER,minValue:1}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ModuloPlugin",(function(){return i}));var r=n(17),o=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i extends o.FunctionPlugin{mod(e,t){return this.runFunction(e.args,t,this.metadata("MOD"),(e,t)=>0===t?new r.CellError(r.ErrorType.DIV_BY_ZERO):e%t)}}i.implementedFunctions={MOD:{method:"mod",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"NumericAggregationPlugin",(function(){return p}));var r=n(77),o=n(17),i=n(33),a=n(29),s=n(61),u=n(101),l=n(43),c=n(69),d=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function h(e){return Object(l.isExtendedNumber)(e)&&!Number.isFinite(Object(l.getRawValue)(e))?0:e}class f{constructor(e,t,n){this.sumsq=e,this.sum=t,this.count=n}static single(e){return new f(e*e,e,1)}compose(e){return new f(this.sumsq+e.sumsq,this.sum+e.sum,this.count+e.count)}averageValue(){return this.count>0?this.sum/this.count:void 0}varSValue(){return this.count>1?(this.sumsq-this.sum*this.sum/this.count)/(this.count-1):void 0}varPValue(){return this.count>0?(this.sumsq-this.sum*this.sum/this.count)/this.count:void 0}}f.empty=new f(0,0,0);class p extends d.FunctionPlugin{constructor(){super(...arguments),this.addWithEpsilonRaw=(e,t)=>this.arithmeticHelper.addWithEpsilonRaw(e,t)}sum(e,t){return this.doSum(e.args,t)}sumsq(e,t){return this.reduce(e.args,t,0,"SUMSQ",this.addWithEpsilonRaw,e=>Math.pow(Object(l.getRawValue)(e),2),g)}max(e,t){return this.doMax(e.args,t)}maxa(e,t){return h(this.reduce(e.args,t,Number.NEGATIVE_INFINITY,"MAXA",(e,t)=>Math.max(e,t),l.getRawValue,m))}min(e,t){return this.doMin(e.args,t)}mina(e,t){return h(this.reduce(e.args,t,Number.POSITIVE_INFINITY,"MINA",(e,t)=>Math.min(e,t),l.getRawValue,m))}count(e,t){return this.doCount(e.args,t)}counta(e,t){return this.doCounta(e.args,t)}average(e,t){return this.doAverage(e.args,t)}averagea(e,t){var n;const r=this.reduce(e.args,t,f.empty,"_AGGREGATE_A",(e,t)=>e.compose(t),e=>f.single(Object(l.getRawValue)(e)),m);return r instanceof o.CellError?r:null!==(n=r.averageValue())&&void 0!==n?n:new o.CellError(o.ErrorType.DIV_BY_ZERO)}vars(e,t){return this.doVarS(e.args,t)}varp(e,t){return this.doVarP(e.args,t)}vara(e,t){var n;const r=this.reduceAggregateA(e.args,t);return r instanceof o.CellError?r:null!==(n=r.varSValue())&&void 0!==n?n:new o.CellError(o.ErrorType.DIV_BY_ZERO)}varpa(e,t){var n;const r=this.reduceAggregateA(e.args,t);return r instanceof o.CellError?r:null!==(n=r.varPValue())&&void 0!==n?n:new o.CellError(o.ErrorType.DIV_BY_ZERO)}stdevs(e,t){return this.doStdevS(e.args,t)}stdevp(e,t){return this.doStdevP(e.args,t)}stdeva(e,t){const n=this.reduceAggregateA(e.args,t);if(n instanceof o.CellError)return n;{const e=n.varSValue();return void 0===e?new o.CellError(o.ErrorType.DIV_BY_ZERO):Math.sqrt(e)}}stdevpa(e,t){const n=this.reduceAggregateA(e.args,t);if(n instanceof o.CellError)return n;{const e=n.varPValue();return void 0===e?new o.CellError(o.ErrorType.DIV_BY_ZERO):Math.sqrt(e)}}product(e,t){return this.doProduct(e.args,t)}subtotal(e,t){if(e.args.length<2)return new o.CellError(o.ErrorType.NA,i.ErrorMessage.WrongArgNumber);const n=this.coerceToType(this.evaluateAst(e.args[0],t),{argumentType:d.FunctionArgumentType.NUMBER},t),r=e.args.slice(1);switch(n){case 1:case 101:return this.doAverage(r,t);case 2:case 102:return this.doCount(r,t);case 3:case 103:return this.doCounta(r,t);case 4:case 104:return this.doMax(r,t);case 5:case 105:return this.doMin(r,t);case 6:case 106:return this.doProduct(r,t);case 7:case 107:return this.doStdevS(r,t);case 8:case 108:return this.doStdevP(r,t);case 9:case 109:return this.doSum(r,t);case 10:case 110:return this.doVarS(r,t);case 11:case 111:return this.doVarP(r,t);default:return new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.BadMode)}}reduceAggregate(e,t){return this.reduce(e,t,f.empty,"_AGGREGATE",(e,t)=>e.compose(t),e=>f.single(Object(l.getRawValue)(e)),g)}reduceAggregateA(e,t){return this.reduce(e,t,f.empty,"_AGGREGATE_A",(e,t)=>e.compose(t),e=>f.single(Object(l.getRawValue)(e)),m)}doAverage(e,t){var n;const r=this.reduceAggregate(e,t);return r instanceof o.CellError?r:null!==(n=r.averageValue())&&void 0!==n?n:new o.CellError(o.ErrorType.DIV_BY_ZERO)}doVarS(e,t){var n;const r=this.reduceAggregate(e,t);return r instanceof o.CellError?r:null!==(n=r.varSValue())&&void 0!==n?n:new o.CellError(o.ErrorType.DIV_BY_ZERO)}doVarP(e,t){var n;const r=this.reduceAggregate(e,t);return r instanceof o.CellError?r:null!==(n=r.varPValue())&&void 0!==n?n:new o.CellError(o.ErrorType.DIV_BY_ZERO)}doStdevS(e,t){const n=this.reduceAggregate(e,t);if(n instanceof o.CellError)return n;{const e=n.varSValue();return void 0===e?new o.CellError(o.ErrorType.DIV_BY_ZERO):Math.sqrt(e)}}doStdevP(e,t){const n=this.reduceAggregate(e,t);if(n instanceof o.CellError)return n;{const e=n.varPValue();return void 0===e?new o.CellError(o.ErrorType.DIV_BY_ZERO):Math.sqrt(e)}}doCount(e,t){return this.reduce(e,t,0,"COUNT",(e,t)=>e+t,l.getRawValue,e=>Object(l.isExtendedNumber)(e)?1:0)}doCounta(e,t){return this.reduce(e,t,0,"COUNTA",(e,t)=>e+t,l.getRawValue,e=>e===l.EmptyValue?0:1)}doMax(e,t){return h(this.reduce(e,t,Number.NEGATIVE_INFINITY,"MAX",(e,t)=>Math.max(e,t),l.getRawValue,g))}doMin(e,t){return h(this.reduce(e,t,Number.POSITIVE_INFINITY,"MIN",(e,t)=>Math.min(e,t),l.getRawValue,g))}doSum(e,t){return this.reduce(e,t,0,"SUM",this.addWithEpsilonRaw,l.getRawValue,g)}doProduct(e,t){return this.reduce(e,t,1,"PRODUCT",(e,t)=>e*t,l.getRawValue,g)}reduce(e,t,n,r,a,u,l){return e.length<1?new o.CellError(o.ErrorType.NA,i.ErrorMessage.WrongArgNumLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{power(e,t){return this.runFunction(e.args,t,this.metadata("POWER"),Math.pow)}}o.implementedFunctions={POWER:{method:"power",parameters:[{argumentType:r.FunctionArgumentType.NUMBER},{argumentType:r.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"RadiansPlugin",(function(){return o}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{radians(e,t){return this.runFunction(e.args,t,this.metadata("RADIANS"),e=>e*(Math.PI/180))}}o.implementedFunctions={RADIANS:{method:"radians",parameters:[{argumentType:r.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"RadixConversionPlugin",(function(){return s}));var r=n(17),o=n(33),i=n(261),a=n(26);class s extends a.FunctionPlugin{dec2bin(e,t){return this.runFunction(e.args,t,this.metadata("DEC2BIN"),(e,t)=>l(e,2,t))}dec2oct(e,t){return this.runFunction(e.args,t,this.metadata("DEC2OCT"),(e,t)=>l(e,8,t))}dec2hex(e,t){return this.runFunction(e.args,t,this.metadata("DEC2HEX"),(e,t)=>l(e,16,t))}bin2dec(e,t){return this.runFunction(e.args,t,this.metadata("BIN2DEC"),e=>{const t=u(e,2,10);return void 0===t?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NotBinary):f(t,2)})}bin2oct(e,t){return this.runFunction(e.args,t,this.metadata("BIN2OCT"),(e,t)=>{const n=u(e,2,10);return void 0===n?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NotBinary):l(f(n,2),8,t)})}bin2hex(e,t){return this.runFunction(e.args,t,this.metadata("BIN2HEX"),(e,t)=>{const n=u(e,2,10);return void 0===n?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NotBinary):l(f(n,2),16,t)})}oct2dec(e,t){return this.runFunction(e.args,t,this.metadata("OCT2DEC"),e=>{const t=u(e,8,10);return void 0===t?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NotOctal):f(t,8)})}oct2bin(e,t){return this.runFunction(e.args,t,this.metadata("OCT2BIN"),(e,t)=>{const n=u(e,8,10);return void 0===n?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NotOctal):l(f(n,8),2,t)})}oct2hex(e,t){return this.runFunction(e.args,t,this.metadata("OCT2HEX"),(e,t)=>{const n=u(e,8,10);return void 0===n?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NotOctal):l(f(n,8),16,t)})}hex2dec(e,t){return this.runFunction(e.args,t,this.metadata("HEX2DEC"),e=>{const t=u(e,16,10);return void 0===t?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NotHex):f(t,16)})}hex2bin(e,t){return this.runFunction(e.args,t,this.metadata("HEX2BIN"),(e,t)=>{const n=u(e,16,10);return void 0===n?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NotHex):l(f(n,16),2,t)})}hex2oct(e,t){return this.runFunction(e.args,t,this.metadata("HEX2OCT"),(e,t)=>{const n=u(e,16,10);return void 0===n?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NotHex):l(f(n,16),8,t)})}base(e,t){return this.runFunction(e.args,t,this.metadata("BASE"),d)}decimal(e,t){return this.runFunction(e.args,t,this.metadata("DECIMAL"),(e,t)=>{const n=u(e,t,255);return void 0===n?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NotHex):parseInt(n,t)})}}function u(e,t,n){const r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".substr(0,t),o=new RegExp(`^[${r}]+$`);if(!(e.length>n)&&o.test(e))return e}function l(e,t,n){if(e>function(e){return-c(e)-1}(t))return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueBaseLarge);if(e<c(t))return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueBaseSmall);const a=h(e,t);return void 0===n||e<0?a:a.length>n?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueBaseLong):Object(i.padLeft)(a,n)}function c(e){return-Math.pow(e,10)/2}function d(e,t,n){const r=h(e,t);return void 0!==n&&n>r.length?Object(i.padLeft)(r,n):r}function h(e,t){return(e+(e<0?Math.pow(t,10):0)).toString(t).toUpperCase()}function f(e,t){const n=parseInt(e,t),r=Math.pow(t,10);return n>=r/2?n-r:n}s.implementedFunctions={DEC2BIN:{method:"dec2bin",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2OCT:{method:"dec2oct",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2HEX:{method:"dec2hex",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},BIN2DEC:{method:"bin2dec",parameters:[{argumentType:a.FunctionArgumentType.STRING}]},BIN2OCT:{method:"bin2oct",parameters:[{argumentType:a.FunctionArgumentType.STRING},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},BIN2HEX:{method:"bin2hex",parameters:[{argumentType:a.FunctionArgumentType.STRING},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},OCT2DEC:{method:"oct2dec",parameters:[{argumentType:a.FunctionArgumentType.STRING}]},OCT2BIN:{method:"oct2bin",parameters:[{argumentType:a.FunctionArgumentType.STRING},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},OCT2HEX:{method:"oct2hex",parameters:[{argumentType:a.FunctionArgumentType.STRING},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},HEX2DEC:{method:"hex2dec",parameters:[{argumentType:a.FunctionArgumentType.STRING}]},HEX2BIN:{method:"hex2bin",parameters:[{argumentType:a.FunctionArgumentType.STRING},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},HEX2OCT:{method:"hex2oct",parameters:Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a extends i.FunctionPlugin{rand(e,t){return this.runFunction(e.args,t,this.metadata("RAND"),Math.random)}randbetween(e,t){return this.runFunction(e.args,t,this.metadata("RANDBETWEEN"),(e,t)=>t<e?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.WrongOrder):((e=Math.ceil(e))===(t=Math.floor(t)+1)&&(t+=1),e+Math.floor(Math.random()*(t-e))))}}a.implementedFunctions={RAND:{method:"rand",parameters:[],isVolatile:!0},RANDBETWEEN:{method:"randbetween",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}],isVolatile:!0}}},function(e,t,n){"use strict";n.r(t),n.d(t,"findNextOddNumber",(function(){return a})),n.d(t,"findNextEvenNumber",(function(){return s})),n.d(t,"RoundingPlugin",(function(){return u}));var r=n(17),o=n(33),i=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function a(e){const t=Math.ceil(e);return t%2==1?t:t+1}function s(e){const t=Math.ceil(e);return t%2==0?t:t+1}class u extends i.FunctionPlugin{roundup(e,t){return this.runFunction(e.args,t,this.metadata("ROUNDDOWN"),(e,t)=>{const n=Math.pow(10,t);return e<0?-Math.ceil(-e*n)/n:Math.ceil(e*n)/n})}rounddown(e,t){return this.runFunction(e.args,t,this.metadata("ROUNDDOWN"),(e,t)=>{const n=Math.pow(10,t);return e<0?-Math.floor(-e*n)/n:Math.floor(e*n)/n})}round(e,t){return this.runFunction(e.args,t,this.metadata("ROUND"),(e,t)=>{const n=Math.pow(10,t);return e<0?-Math.round(-e*n)/n:Math.round(e*n)/n})}intFunc(e,t){return this.runFunction(e.args,t,this.metadata("INT"),e=>e<0?-Math.floor(-e):Math.floor(e))}even(e,t){return this.runFunction(e.args,t,this.metadata("EVEN"),e=>e<0?-s(-e):s(e))}odd(e,t){return this.runFunction(e.args,t,this.metadata("ODD"),e=>e<0?-a(-e):a(e))}ceilingmath(e,t){return this.runFunction(e.args,t,this.metadata("CEILING.MATH"),(e,t,n)=>0===t||0===e?0:(t=Math.abs(t),1===n&&e<0&&(t=-t),Math.ceil(e/t)*t))}ceiling(e,t){return this.runFunction(e.args,t,this.metadata("CEILING"),(e,t)=>0===e?0:0===t?new r.CellError(r.ErrorType.DIV_BY_ZERO):e>0&&t<0?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.DistinctSigns):Math.ceil(e/t)*t)}ceilingprecise(e,t){return this.runFunction(e.args,t,this.metadata("CEILING.PRECISE"),(e,t)=>0===t||0===e?0:(t=Math.abs(t),Math.ceil(e/t)*t))}floormath(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR.MATH"),(e,t,n)=>0===t||0===e?0:(t=Math.abs(t),1===n&&e<0&&(t*=-1),Math.floor(e/t)*t))}floor(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR"),(e,t)=>0===e?0:0===t?new r.CellError(r.ErrorType.DIV_BY_ZERO):e>0&&t<0?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.DistinctSigns):Math.floor(e/t)*t)}floorprecise(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR.PRECISE"),(e,t)=>0===t||0===e?0:(t=Math.abs(t),Math.floor(e/t)*t))}}u.implementedFunctions={ROUNDUP:{method:"roundup",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}]},ROUNDDOWN:{method:"rounddown",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}]},ROUND:{method:"round",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}]},INT:{method:"intFunc",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},EVEN:{method:"even",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},ODD:{method:"odd",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},"CEILING.MATH":{method:"ceilingmath",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:1},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}]},CEILING:{method:"ceiling",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}]},"CEILING.PRECISE":{method:"ceilingprecise",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:1}]},"FLOOR.MATH":{method:"floormath",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:1},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}]},FLOOR:{method:"floor",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}]},"FLOOR.PRECISE":{method:"floorprecise",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:1}]}},u.aliases={"ISO.CEILING":"CEILING.PRECISE",TRUNC:"ROUNDDOWN"}},function(e,t,n){"use strict";n.r(t),n.d(t,"SqrtPlugin",(function(){return o}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{sqrt(e,t){return this.runFunction(e.args,t,this.metadata("SQRT"),Math.sqrt)}}o.implementedFunctions={SQRT:{method:"sqrt",parameters:[{argumentType:r.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ConditionalAggregationPlugin",(function(){return d}));var r=n(17),o=n(33),i=n(688),a=n(43),s=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class u{constructor(e,t){this.sum=e,this.count=t}static single(e){return new u(e,1)}compose(e){return new u(this.sum+e.sum,this.count+e.count)}averageValue(){return this.count>0?this.sum/this.count:void 0}}function l(e){return Object(a.isExtendedNumber)(e)&&!Number.isFinite(Object(a.getRawValue)(e))?0:e}function c(e){return e instanceof r.CellError?e:Object(a.isExtendedNumber)(e)?Object(a.getRawValue)(e):void 0}u.empty=new u(0,0);class d extends s.FunctionPlugin{sumif(e,t){return this.runFunction(e.args,t,this.metadata("SUMIF"),(e,t,n)=>this.computeConditionalAggregationFunction(null!=n?n:e,[e,t],"SUMIF",0,(e,t)=>this.arithmeticHelper.nonstrictadd(e,t),c))}sumifs(e,t){return this.runFunction(e.args,t,this.metadata("SUMIFS"),(e,...t)=>this.computeConditionalAggregationFunction(e,t,"SUMIFS",0,(e,t)=>this.arithmeticHelper.nonstrictadd(e,t),c))}averageif(e,t){return this.runFunction(e.args,t,this.metadata("AVERAGEIF"),(e,t,n)=>{const o=this.computeConditionalAggregationFunction(null!=n?n:e,[e,t],"AVERAGEIF",u.empty,(e,t)=>e.compose(t),e=>Object(a.isExtendedNumber)(e)?u.single(Object(a.getRawValue)(e)):u.empty);return o instanceof r.CellError?o:o.averageValue()||new r.CellError(r.ErrorType.DIV_BY_ZERO)})}countif(e,t){return this.runFunction(e.args,t,this.metadata("COUNTIF"),(e,t)=>this.computeConditionalAggregationFunction(e,[e,t],"COUNTIF",0,(e,t)=>e+t,()=>1))}countifs(e,t){return this.runFunction(e.args,t,this.metadata("COUNTIFS"),(...e)=>this.computeConditionalAggregationFunction(e[0],e,"COUNTIFS",0,(e,t)=>e+t,()=>1))}minifs(e,t){const n=(e,t)=>void 0===t||void 0===e?void 0===t?e:t:Math.min(e,t);return this.runFunction(e.args,t,this.metadata("MINIFS"),(e,...t)=>l(this.computeConditionalAggregationFunction(e,t,"MINIFS",Number.POSITIVE_INFINITY,n,c)))}maxifs(e,t){const n=(e,t)=>void 0===t||void 0===e?void 0===t?e:t:Math.max(e,t);return this.runFunction(e.args,t,this.metadata("MAXIFS"),(e,...t)=>l(this.computeConditionalAggregationFunction(e,t,"MAXIFS",Number.NEGATIVE_INFINITY,n,c)))}computeConditionalAggregationFunction(e,t,n,a,s,u){const l=[];for(let e=0;e<t.length;e+=2){const n=t[e],a=this.interpreter.criterionBuilder.fromCellValue(t[e+1],this.arithmeticHelper);if(void 0===a)return new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.BadCriterion);l.push(new i.Condition(n,a))}return new i.CriterionFunctionCompute(this.interpreter,function(e){return t=>{const n=t.map(e=>`${e.conditionRange.range.sheet},${e.conditionRange.range.start.col},${e.conditionRange.range.start.row}`);return[e,...n].join(",")}}(n),a,s,u).compute(e,l)}}d.implementedFunctions={SUMIF:{method:"sumif",parameters:[{argumentType:s.FunctionArgumentType.RANGE},{argumentType:s.FunctionArgumentType.NOERROR},{argumentType:s.FunctionArgumentType.RANGE,optionalArg:!0}]},COUNTIF:{method:"countif",parameters:[{argumentType:s.FunctionArgumentType.RANGE},{argumentType:s.FunctionArgumentType.NOERROR}]},AVERAGEIF:{method:"averageif",parameters:[{argumentType:s.FunctionArgumentType.RANGE},{argumentType:s.FunctionArgumentType.NOERROR},{argumentType:s.FunctionArgumentType.RANGE,optionalArg:!0}]},SUMIFS:{method:"sumifs",parameters:[{argumentType:s.FunctionArgumentType.RANGE},{argumentType:s.FunctionArgumentType.RANGE},{argumentType:s.FunctionArgumentType.NOERROR}],repeatLastArgs:2},COUNTIFS:{method:"countifs",parameters:[{argumentType:s.FunctionArgumentType.RANGE},{argumentType:s.FunctionArgumentType.NOERROR}],repeatLastArgs:2},MINIFS:{method:"minifs",parameters:[{argumentType:s.FunctionArgumentType.RANGE},{argumentType:s.FunctionArgumentType.RANGE},{argumentType:s.FunctionArgumentType.NOERROR}],repeatLastArgs:2},MAXIFS:{method:"maxifs",parameters:[{argumentType:s.FunctionArgumentType.RANGE},{argumentType:s.FunctionArgumentType.RANGE},{argumentType:s.FunctionArgumentType.NOERROR}],repeatLastArgs:2}}},function(e,t,n){"use strict";n.r(t),n.d(t,"SumprodPlugin",(function(){return s}));var r=n(17),o=n(33),i=n(43),a=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class s extends a.FunctionPlugin{sumproduct(e,t){return this.runFunction(e.args,t,this.metadata("SUMPRODUCT"),(...e)=>{const t=e[0].width(),n=e[0].height();for(const i of e)if(i.width()!==t||i.height()!==n)return new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.EqualLength);let a=0;const s=e.map(e=>e.iterateValuesFromTopLeftCorner());for(let e=0;e<t*n;e++){let e=1;for(const t of s){const n=t.next().value;if(n instanceof r.CellError)return n;const o=this.coerceScalarToNumberOrError(n);Object(i.isExtendedNumber)(o)?e*=Object(i.getRawValue)(o):e=0}a+=e}return a})}}s.implementedFunctions={SUMPRODUCT:{method:"sumproduct",parameters:[{argumentType:a.FunctionArgumentType.RANGE}],repeatLastArgs:1}}},function(e,t,n){"use strict";n.r(t),n.d(t,"TextPlugin",(function(){return a}));var r=n(17),o=n(33),i=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a extends i.FunctionPlugin{concatenate(e,t){return this.runFunction(e.args,t,this.metadata("CONCATENATE"),(...e)=>"".concat(...e))}split(e,t){return this.runFunction(e.args,t,this.metadata("SPLIT"),(e,t)=>{const n=e.split(" ");return t>=n.length||t<0?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.IndexBounds):n[t]})}len(e,t){return this.runFunction(e.args,t,this.metadata("LEN"),e=>e.length)}lower(e,t){return this.runFunction(e.args,t,this.metadata("LOWER"),e=>e.toLowerCase())}trim(e,t){return this.runFunction(e.args,t,this.metadata("TRIM"),e=>e.replace(/^ +| +$/g,"").replace(/ +/g," "))}proper(e,t){return this.runFunction(e.args,t,this.metadata("PROPER"),e=>e.replace(/\p{L}+/gu,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()))}clean(e,t){return this.runFunction(e.args,t,this.metadata("CLEAN"),e=>e.replace(/[\u0000-\u001F]/g,""))}exact(e,t){return this.runFunction(e.args,t,this.metadata("EXACT"),(e,t)=>e===t)}rept(e,t){return this.runFunction(e.args,t,this.metadata("REPT"),(e,t)=>t<0?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.NegativeCount):e.repeat(t))}right(e,t){return this.runFunction(e.args,t,this.metadata("RIGHT"),(e,t)=>t<0?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.NegativeLength):0===t?"":e.slice(-t))}left(e,t){return this.runFunction(e.args,t,this.metadata("LEFT"),(e,t)=>t<0?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.NegativeLength):e.slice(0,t))}mid(e,t){return this.runFunction(e.args,t,this.metadata("MID"),(e,t,n)=>t<1?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.LessThanOne):n<0?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.NegativeLength):e.substring(t-1,t+n-1))}replace(e,t){return this.runFunction(e.args,t,this.metadata("REPLACE"),(e,t,n,i)=>t<1?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.LessThanOne):n<0?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.NegativeLength):e.substring(0,t-1)+i+e.substring(t+n-1))}search(e,t){return this.runFunction(e.args,t,this.metadata("SEARCH"),(e,t,n)=>{if(n<1||n>t.length)return new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.LengthBounds);const i=e.toLowerCase(),a=t.substring(n-1).toLowerCase(),s=this.arithmeticHelper.requiresRegex(i)?this.arithmeticHelper.searchString(i,a):a.indexOf(i);return s>-1?s+n:new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.PatternNotFound)})}substitute(e,t){return this.runFunction(e.args,t,this.metadata("SUBSTITUTE"),(e,t,n,i)=>{const a=new RegExp(t,"g");if(void 0===i)return e.replace(a,n);if(i<1)return new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.LessThanOne);let s,u=0;for(;null!==(s=a.exec(e));)if(i===++u)return e.substring(0,s.index)+n+e.substring(a.lastIndex);return e})}find(e,t){return this.runFunction(e.args,t,this.metadata("FIND"),(e,t,n)=>{if(n<1||n>t.length)return new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.IndexBounds);const i=t.substring(n-1).indexOf(e)+n;return i>0?i:new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.PatternNotFound)})}t(e,t){return this.runFunction(e.args,t,this.metadata("T"),e=>e instanceof r.CellError||"string"==typeof e?e:"")}upper(e,t){return this.runFunction(e.args,t,this.metadata("UPPER"),e=>e.toUpperCase())}}a.implementedFunctions={CONCATENATE:{method:"concatenate",parameters:[{argumentType:i.FunctionArgumentType.STRING}],repeatLastArgs:1,expandRanges:!0},EXACT:{method:"exact",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.STRING}]},SPLIT:{method:"split",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER}]},LEN:{method:"len",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},LOWER:{method:"lower",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},MID:{method:"mid",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}]},TRIM:{method:"trim",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},T:{method:"t",parameters:[{argumentType:i.FunctionArgumentType.SCALAR}]},PROPER:{method:"proper",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},CLEAN:{method:"clean",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},REPT:{method:"rept",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER}]},RIGHT:{method:"right",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:1}]},LEFT:{method:"left",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:1}]},REPLACE:{method:"replace",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.STRING}]},SEARCH:{method:"search",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:1}]},SUBSTITUTE:{mLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class s extends i.FunctionPlugin{acos(e,t){return this.runFunction(e.args,t,this.metadata("ACOS"),Math.acos)}asin(e,t){return this.runFunction(e.args,t,this.metadata("ASIN"),Math.asin)}cos(e,t){return this.runFunction(e.args,t,this.metadata("COS"),Math.cos)}sin(e,t){return this.runFunction(e.args,t,this.metadata("SIN"),Math.sin)}tan(e,t){return this.runFunction(e.args,t,this.metadata("TAN"),Math.tan)}atan(e,t){return this.runFunction(e.args,t,this.metadata("ATAN"),Math.atan)}atan2(e,t){return this.runFunction(e.args,t,this.metadata("ATAN2"),(e,t)=>0===e&&0===t?new r.CellError(r.ErrorType.DIV_BY_ZERO):Math.atan2(t,e))}cot(e,t){return this.runFunction(e.args,t,this.metadata("COT"),e=>0===e?new r.CellError(r.ErrorType.DIV_BY_ZERO):1/Math.tan(e))}acot(e,t){return this.runFunction(e.args,t,this.metadata("ACOT"),e=>0===e?a.PI/2:Math.atan(1/e))}sec(e,t){return this.runFunction(e.args,t,this.metadata("SEC"),e=>1/Math.cos(e))}csc(e,t){return this.runFunction(e.args,t,this.metadata("CSC"),e=>0===e?new r.CellError(r.ErrorType.DIV_BY_ZERO):1/Math.sin(e))}sinh(e,t){return this.runFunction(e.args,t,this.metadata("SINH"),Math.sinh)}asinh(e,t){return this.runFunction(e.args,t,this.metadata("ASINH"),Math.asinh)}cosh(e,t){return this.runFunction(e.args,t,this.metadata("COSH"),Math.cosh)}acosh(e,t){return this.runFunction(e.args,t,this.metadata("ACOSH"),Math.acosh)}tanh(e,t){return this.runFunction(e.args,t,this.metadata("TANH"),Math.tanh)}atanh(e,t){return this.runFunction(e.args,t,this.metadata("ATANH"),Math.atanh)}coth(e,t){return this.runFunction(e.args,t,this.metadata("COTH"),e=>0===e?new r.CellError(r.ErrorType.DIV_BY_ZERO):1/Math.tanh(e))}acoth(e,t){return this.runFunction(e.args,t,this.metadata("ACOTH"),e=>0===e?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.NonZero):Math.atanh(1/e))}sech(e,t){return this.runFunction(e.args,t,this.metadata("SECH"),e=>1/Math.cosh(e))}csch(e,t){return this.runFunction(e.args,t,this.metadata("CSCH"),e=>0===e?new r.CellError(r.ErrorType.DIV_BY_ZERO):1/Math.sinh(e))}}s.implementedFunctions={ACOS:{method:"acos",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},ASIN:{method:"asin",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},COS:{method:"cos",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},SIN:{method:"sin",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},TAN:{method:"tan",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},ATAN:{method:"atan",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},ATAN2:{method:"atan2",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}]},COT:{method:"cot",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},SEC:{method:"sec",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},CSC:{method:"csc",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},SINH:{method:"sinh",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},COSH:{method:"cosh",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},TANH:{method:"tanh",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},COTH:{method:"coth",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},SECH:{method:"sech",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},CSCH:{method:"csch",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},ACOT:{method:"acot",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},ASINH:{method:"asinh",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},ACOSH:{method:"acosh",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},ATANH:{method:"atanh",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]},ACOTH:{method:"acoth",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"LookupPlugin",(function(){return d}));var r=n(77),o=n(17),i=n(33),a=n(690),s=n(113),u=n(101),l=n(69),c=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class d extends c.FunctionPlugin{constructor(){super(...arguments),this.rowSearch=new a.RowSearchStrategy(this.dependencyGraph)}vlookup(e,t){return this.runFunction(e.args,t,this.metadata("VLOOKUP"),(e,t,n,r)=>{const a=t.range;return void 0===a?new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.WrongType):n<1?new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.LessThanOne):n>a.width()?new o.CellError(o.ErrorType.REF,i.ErrorMessage.IndexLarge):this.doVlookup(Object(u.zeroIfEmpty)(e),t,n-1,r)})}hlookup(e,t){return this.runFunction(e.args,t,this.metadata("HLOOKUP"),(e,t,n,r)=>{const a=t.range;return void 0===a?new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.WrongType):n<1?new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.LessThanOne):n>a.height()?new o.CellError(o.ErrorType.REF,i.ErrorMessage.IndexLarge):this.doHlookup(Object(u.zeroIfEmpty)(e),t,n-1,r)})}match(e,t){return this.runFunction(e.args,t,this.metadata("MATCH"),(e,t,n)=>this.doMatch(Object(u.zeroIfEmpty)(e),t,n))}searchInRange(e,t,n,r){if(!n&&"string"==typeof e&&this.arithmeticHelper.requiresRegex(e))return r.advancedFind(this.arithmeticHelper.eqMatcherFunction(e),t);{const o=n?{ordering:"asc"}:{ordering:"none",matchExactly:!0};return r.find(e,t,o)}}doVlookup(e,t,n,a){this.dependencyGraph.stats.start(s.StatType.VLOOKUP);const u=t.range;let c;c=void 0===u?l.SimpleRangeValue.onlyValues(t.data.map(e=>[e[0]])):l.SimpleRangeValue.onlyRange(r.AbsoluteCellRange.spanFrom(u.start,1,u.height()),this.dependencyGraph);const d=this.searchInRange(e,c,a,this.columnSearch);if(this.dependencyGraph.stats.end(s.StatType.VLOOKUP),-1===d)return new o.CellError(o.ErrorType.NA,i.ErrorMessage.ValueNotFound);let h;if(void 0===u)h=t.data[d][n];else{const e=Object(o.simpleCellAddress)(u.sheet,u.start.col+n,u.start.row+d);h=this.dependencyGraph.getCellValue(e)}return h instanceof l.SimpleRangeValue?new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.WrongType):h}doHlookup(e,t,n,a){const s=t.range;let u;u=void 0===s?l.SimpleRangeValue.onlyValues([t.data[0]]):l.SimpleRangeValue.onlyRange(r.AbsoluteCellRange.spanFrom(s.start,s.width(),1),this.dependencyGraph);const c=this.searchInRange(e,u,a,this.rowSearch);if(-1===c)return new o.CellError(o.ErrorType.NA,i.ErrorMessage.ValueNotFound);let d;if(void 0===s)d=t.data[n][c];else{const e=Object(o.simpleCellAddress)(s.sheet,s.start.col+c,s.start.row+n);d=this.dependencyGraph.getCellValue(e)}return d instanceof l.SimpleRangeValue?new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.WrongType):d}doMatch(e,t,n){if(![-1,0,1].includes(n))return new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.BadMode);if(t.width()>1&&t.height()>1)return new o.CellError(o.ErrorType.NA);const r=0===n?{ordering:"none",matchExactly:!0}:{ordering:-1===n?"desc":"asc"},a=(1===t.width()?this.columnSearch:this.rowSearch).find(e,t,r);return-1===a?new o.CellError(o.ErrorType.NA,i.ErrorMessage.ValueNotFound):a+1}}d.implementedFunctions={VLOOKUP:{method:"vlookup",parameters:[{argumentType:c.FunctionArgumentType.NOERROR},{argumentType:c.FunctionArgumentType.RANGE},{argumentType:c.FunctionArgumentType.NUMBER},{argumentType:c.FunctionArgumentType.BOOLEAN,defaultValue:!0}]},HLOOKUP:{method:"hlookup",parameters:[{argumentType:c.FunctionArgumentType.NOERROR},{argumentType:c.FunctionArgumentType.RANGE},{argumentType:c.FunctionArgumentType.NUMBER},{argumentType:c.FunctionArgumentType.BOOLEAN,defaultValue:!0}]},MATCH:{method:"match",parameters:[{argumentType:c.FunctionArgumentType.NOERROR},{argumentType:c.FunctionArgumentType.RANGE},{argumentType:c.FunctionArgumentType.NUMBER,defaultValue:1}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"RomanPlugin",(function(){return s}));var r=n(17),o=n(33),i=n(43),a=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class s extends a.FunctionPlugin{roman(e,t){return this.runFunction(e.args,t,this.metadata("ROMAN"),(e,t)=>(e=Math.trunc(e),!1===t?t=4:!0===t&&(t=0),(t=Object(i.getRawValue)(this.coerceScalarToNumberOrError(t)))instanceof r.CellError?t:(t=Math.trunc(t))<0?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.ValueSmall):t>4?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.ValueLarge):function(e,t){const n={val:e%1e3,acc:"M".repeat(Math.floor(e/1e3))};4===t&&(l(n,"IM",999,1e3),l(n,"ID",499,500));t>=3&&(l(n,"VM",995,1e3),l(n,"VD",495,500));t>=2&&(l(n,"XM",990,1e3),l(n,"XD",490,500));t>=1&&(l(n,"LM",950,1e3),l(n,"LD",450,500));l(n,"CM",900,1e3),l(n,"CD",400,500),l(n,"D",500,900),n.acc+="C".repeat(Math.floor(n.val/100)),n.val%=100,t>=2&&(l(n,"IC",99,100),l(n,"IL",49,50));t>=1&&(l(n,"VC",95,100),l(n,"VL",45,50));return l(n,"XC",90,100),l(n,"XL",40,50),l(n,"L",50,90),n.acc+="X".repeat(Math.floor(n.val/10)),n.val%=10,l(n,"IX",9,10),l(n,"IV",4,5),l(n,"V",5,9),n.acc+="I".repeat(n.val),n.acc}(e,t)))}arabic(e,t){return this.runFunction(e.args,t,this.metadata("ARABIC"),e=>{let t=!1;if((e=e.trim().toUpperCase()).startsWith("-")&&(t=!0,""===(e=e.slice(1))))return new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.InvalidRoman);const n={input:e,acc:0};return u(n,{token:"MMM",val:3e3},{token:"MM",val:2e3},{token:"M",val:1e3}),u(n,{token:"IM",val:999},{token:"VM",val:995},{token:"XM",val:990},{token:"LM",val:950},{token:"CM",val:900}),u(n,{token:"D",val:500},{token:"ID",val:499},{token:"VD",val:495},{token:"XD",val:490},{token:"LD",val:450},{token:"CD",val:400}),u(n,{token:"CCC",val:300},{token:"CC",val:200},{token:"C",val:100}),u(n,{token:"IC",val:99},{token:"VC",val:95},{token:"XC",val:90}),u(n,{token:"L",val:50},{token:"IL",val:49},{token:"VL",val:45},{token:"XL",val:40}),u(n,{token:"XXX",val:30},{token:"XX",val:20},{token:"X",val:10}),u(n,{token:"IX",val:9}),u(n,{token:"V",val:5},{token:"IV",val:4}),u(n,{token:"III",val:3},{token:"II",val:2},{token:"I",val:1}),""!==n.input?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.InvalidRoman):t?-n.acc:n.acc})}}function u(e,...t){for(const n of t)if(e.input.startsWith(n.token)){e.input=e.input.slice(n.token.length),e.acc+=n.val;break}}function l(e,t,n,r){e.val>=n&&e.val<r&&(e.val-=n,e.acc+=t)}s.implementedFunctions={ROMAN:{method:"roman",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:1,lessThan:4e3},{argumentType:a.FunctionArgumentType.NOERROR,optionalArg:!0,defaultValue:0}]},ARABIC:{method:"arabic",parameters:[{argumentType:a.FunctionArgumentType.STRING}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"SimpleArithmerticPlugin",(function(){return o}));var r=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.FunctionPlugin{add(e,t){return this.runFunction(e.args,t,this.metadata("HF.ADD"),this.arithmeticHelper.addWithEpsilon)}concat(e,t){return this.runFunction(e.args,t,this.metadata("HF.CONCAT"),this.arithmeticHelper.concat)}divide(e,t){return this.runFunction(e.args,t,this.metadata("HF.DIVIDE"),this.arithmeticHelper.divide)}eq(e,t){return this.runFunction(e.args,t,this.metadata("HF.EQ"),this.arithmeticHelper.eq)}gt(e,t){return this.runFunction(e.args,t,this.metadata("HF.GT"),this.arithmeticHelper.gt)}gte(e,t){return this.runFunction(e.args,t,this.metadata("HF.GTE"),this.arithmeticHelper.geq)}lt(e,t){return this.runFunction(e.args,t,this.metadata("HF.LT"),this.arithmeticHelper.lt)}lte(e,t){return this.runFunction(e.args,t,this.metadata("HF.LTE"),this.arithmeticHelper.leq)}minus(e,t){return this.runFunction(e.args,t,this.metadata("HF.MINUS"),this.arithmeticHelper.subtract)}multiply(e,t){return this.runFunction(e.args,t,this.metadata("HF.MULTIPLY"),this.arithmeticHelper.multiply)}ne(e,t){return this.runFunction(e.args,t,this.metadata("HF.NE"),this.arithmeticHelper.neq)}pow(e,t){return this.runFunction(e.args,t,this.metadata("HF.POW"),this.arithmeticHelper.pow)}uminus(e,t){return this.runFunction(e.args,t,this.metadata("HF.UMINUS"),this.arithmeticHelper.unaryMinus)}upercent(e,t){return this.runFunction(e.args,t,this.metadata("HF.UNARY_PERCENT"),this.arithmeticHelper.unaryPercent)}uplus(e,t){return this.runFunction(e.args,t,this.metadata("HF.UPLUS"),this.arithmeticHelper.unaryPlus)}}o.implementedFunctions={"HF.ADD":{method:"add",parameters:[{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.CONCAT":{method:"concat",parameters:[{argumentType:r.FunctionArgumentType.STRING,passSubtype:!0},{argumentType:r.FunctionArgumentType.STRING,passSubtype:!0}]},"HF.DIVIDE":{method:"divide",parameters:[{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.EQ":{method:"eq",parameters:[{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.GT":{method:"gt",parameters:[{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.GTE":{method:"gte",parameters:[{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.LT":{method:"lt",parameters:[{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.LTE":{method:"lte",parameters:[{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.MINUS":{method:"minus",parameters:[{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.MULTIPLY":{method:"multiply",parameters:[{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.NE":{method:"ne",parameters:[{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:r.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.POW":{method:"pow",parameters:[{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.UMINUS":{method:"uminus",parameters:[{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.UNARY_PERCENT":{method:"upercent",parameters:[{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.UPLUS":{method:"uplus",parameters:[{argumentType:r.FunctionArgumentType.NUMBER,passSubtype:!0}]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"StatisticalPlugin",(function(){return u}));var r=n(17),o=n(33),i=n(691),a=n(379),s=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class u extends s.FunctionPlugin{erf(e,t){return this.runFunction(e.args,t,this.metadata("ERF"),(e,t)=>void 0===t?Object(a.erf)(e):Object(a.erf)(t)-Object(a.erf)(e))}erfc(e,t){return this.runFunction(e.args,t,this.metadata("ERFC"),a.erfc)}expondist(e,t){return this.runFunction(e.args,t,this.metadata("EXPON.DIST"),(e,t,n)=>n?a.exponential.cdf(e,t):a.exponential.pdf(e,t))}fisher(e,t){return this.runFunction(e.args,t,this.metadata("FISHER"),e=>Math.log((1+e)/(1-e))/2)}fisherinv(e,t){return this.runFunction(e.args,t,this.metadata("FISHERINV"),e=>1-2/(Math.exp(2*e)+1))}gamma(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA"),a.gammafn)}gammadist(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.DIST"),(e,t,n,r)=>r?a.gamma.cdf(e,t,n):a.gamma.pdf(e,t,n))}gammaln(e,t){return this.runFunction(e.args,t,this.metadata("GAMMALN"),a.gammaln)}gammainv(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.INV"),a.gamma.inv)}gauss(e,t){return this.runFunction(e.args,t,this.metadata("GAUSS"),e=>a.normal.cdf(e,0,1)-.5)}betadist(e,t){return this.runFunction(e.args,t,this.metadata("BETA.DIST"),(e,t,n,i,s,u)=>e<=s?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueSmall):e>=u?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueLarge):(e=(e-s)/(u-s),i?a.beta.cdf(e,t,n):a.beta.pdf(e,t,n)))}betainv(e,t){return this.runFunction(e.args,t,this.metadata("BETA.INV"),(e,t,n,i,s)=>i>=s?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.WrongOrder):a.beta.inv(e,t,n)*(s-i)+i)}binomialdist(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.DIST"),(e,t,n,i)=>e>t?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.WrongOrder):(e=Math.trunc(e),t=Math.trunc(t),i?a.binomial.cdf(e,t,n):a.binomial.pdf(e,t,n)))}binomialinv(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.INV"),(e,t,n)=>{let r=-1,o=e=Math.trunc(e);for(;o>r+1;){const i=Math.trunc((r+o)/2);a.binomial.cdf(i,e,t)>=n?o=i:r=i}return o})}besselifn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELI"),(e,t)=>Object(i.besseli)(e,Math.trunc(t)))}besseljfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELJ"),(e,t)=>Object(i.besselj)(e,Math.trunc(t)))}besselkfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELK"),(e,t)=>Object(i.besselk)(e,Math.trunc(t)))}besselyfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELY"),(e,t)=>Object(i.bessely)(e,Math.trunc(t)))}chisqdist(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.DIST"),(e,t,n)=>(t=Math.trunc(t),n?a.chisquare.cdf(e,t):a.chisquare.pdf(e,t)))}chisqdistrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.DIST.RT"),(e,t)=>1-a.chisquare.cdf(e,Math.trunc(t)))}chisqinv(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV"),(e,t)=>a.chisquare.inv(e,Math.trunc(t)))}chisqinvrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV.RT"),(e,t)=>a.chisquare.inv(1-e,Math.trunc(t)))}fdist(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST"),(e,t,n,r)=>(t=Math.trunc(t),n=Math.trunc(n),r?a.centralF.cdf(e,t,n):a.centralF.pdf(e,t,n)))}fdistrt(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST.RT"),(e,t,n)=>1-a.centralF.cdf(e,Math.trunc(t),Math.trunc(n)))}finv(e,t){return this.runFunction(e.args,t,this.metadata("F.INV"),(e,t,n)=>a.centralF.inv(e,Math.trunc(t),Math.trunc(n)))}finvrt(e,t){return this.runFunction(e.args,t,this.metadata("F.INV.RT"),(e,t,n)=>a.centralF.inv(1-e,Math.trunc(t),Math.trunc(n)))}weibulldist(e,t){return this.runFunction(e.args,t,this.metadata("WEIBULL.DIST"),(e,t,n,r)=>r?a.weibull.cdf(e,n,t):a.weibull.pdf(e,n,t))}poissondist(e,t){return this.runFunction(e.args,t,this.metadata("POISSON.DIST"),(e,t,n)=>(e=Math.trunc(e),n?a.poisson.cdf(e,t):a.poisson.pdf(e,t)))}hypgeomdist(e,t){return this.runFunction(e.args,t,this.metadata("HYPGEOM.DIST"),(e,t,n,i,s)=>e>t||e>n||t>i||n>i||e+i<n+t?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueLarge):(e=Math.trunc(e),t=Math.trunc(t),n=Math.trunc(n),i=Math.trunc(i),s?a.hypgeom.cdf(e,i,n,t):a.hypgeom.pdf(e,i,n,t)))}tdist(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST"),(e,t,n)=>(t=Math.trunc(t),n?a.studentt.cdf(e,t):a.studentt.pdf(e,t)))}tdist2t(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.2T"),(e,t)=>2*(1-a.studentt.cdf(e,Math.trunc(t))))}tdistrt(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.RT"),(e,t)=>1-a.studentt.cdf(e,Math.trunc(t)))}tdistold(e,t){return this.runFunction(e.args,t,this.metadata("TDIST"),(e,t,n)=>n*(1-a.studentt.cdf(e,Math.trunc(t))))}tinv(e,t){return this.runFunction(e.args,t,this.metadata("T.INV"),(e,t)=>a.studentt.inv(e,Math.trunc(t)))}tinv2t(e,t){return this.runFunction(e.args,t,this.metadata("T.INV.2T"),(e,t)=>a.studentt.inv(1-e/2,Math.trunc(t)))}lognormdist(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.DIST"),(e,t,n,r)=>r?a.lognormal.cdf(e,t,n):a.lognormal.pdf(e,t,n))}lognorminv(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.INV"),(e,t,n)=>a.lognormal.inv(e,t,n))}normdist(e,t){return tLine truncated
|
||||
/**
|
||||
* @license
|
||||
Copyright (c) 2013 jStat
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
function r(e){const t=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18];let n,r,o,i,a=t.length-1,s=!1,u=0,l=0;if(0===e)return 0;for(e<0&&(e=-e,s=!0),n=2/(2+e),r=4*n-2;a>0;a--)o=u,u=r*u-l+t[a],l=o;return i=n*Math.exp(-e*e+.5*(t[0]+r*u)-l),s?i-1:1-i}function o(e){return 1-r(e)}function i(e){let t,n,r,i,a=0;if(e>=2)return-100;if(e<=0)return 100;for(i=e<1?e:2-e,r=Math.sqrt(-2*Math.log(i/2)),t=-.70711*((2.30753+.27061*r)/(1+r*(.99229+.04481*r))-r);a<2;a++)n=o(t)-i,t+=n/(1.1283791670955126*Math.exp(-t*t)-t*n);return e<1?t:-t}n.r(t),n.d(t,"erf",(function(){return r})),n.d(t,"erfc",(function(){return o})),n.d(t,"exponential",(function(){return a})),n.d(t,"gammafn",(function(){return s})),n.d(t,"gamma",(function(){return u})),n.d(t,"gammaln",(function(){return l})),n.d(t,"normal",(function(){return h})),n.d(t,"beta",(function(){return f})),n.d(t,"binomial",(function(){return E})),n.d(t,"factorialln",(function(){return R})),n.d(t,"factorial",(function(){return w})),n.d(t,"chisquare",(function(){return S})),n.d(t,"centralF",(function(){return O})),n.d(t,"weibull",(function(){return b})),n.d(t,"poisson",(function(){return A})),n.d(t,"hypgeom",(function(){return N})),n.d(t,"studentt",(function(){return M})),n.d(t,"lognormal",(function(){return I})),n.d(t,"negbin",(function(){return _})),n.d(t,"mean",(function(){return x})),n.d(t,"sumsqerr",(function(){return P})),n.d(t,"variance",(function(){return L})),n.d(t,"stdev",(function(){return D})),n.d(t,"normalci",(function(){return F})),n.d(t,"tci",(function(){return U})),n.d(t,"geomean",(function(){return H})),n.d(t,"covariance",(function(){return V})),n.d(t,"corrcoeff",(function(){return j}));const a={pdf:(e,t)=>e<0?0:t*Math.exp(-t*e),cdf:(e,t)=>e<0?0:1-Math.exp(-t*e)};function s(e){const t=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],n=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535];let r,o,i,a,s=!1,u=0,l=0,c=0,d=e;if(e>171.6243769536076)return 1/0;if(d<=0){if(a=d%1,!a)return 1/0;s=(1&d?-1:1)*Math.PI/Math.sin(Math.PI*a),d=1-d}for(i=d,o=d<1?d++:(d-=u=(0|d)-1)-1,r=0;r<8;++r)c=(c+t[r])*o,l=l*o+n[r];if(a=c/l+1,i<d)a/=i;else if(i>d)for(r=0;r<u;++r)a*=d,d++;return s&&(a=s/a),a}const u={pdf:function(e,t,n){return e<0?0:0===e&&1===t?1/n:Math.exp((t-1)*Math.log(e)-e/n-l(t)-t*Math.log(n))},cdf:function(e,t,n){return e<0?0:c(t,e/n)},inv:function(e,t,n){return d(e,t)*n}};function l(e){let t=0;const n=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];let r,o,i,a=1.000000000190015;for(i=(o=r=e)+5.5,i-=(r+.5)*Math.log(i);t<6;t++)a+=n[t]/++o;return Math.log(2.5066282746310007*a/r)-i}function c(e,t){const n=l(e);let r=e,o=1/e,i=o,a=t+1-e,s=1/1e-30,u=1/a,c=u,d=1;const h=-~(8.5*Math.log(e>=1?e:1/e)+.4*e+17);let f;if(t<0||e<=0)return NaN;if(t<e+1){for(;d<=h;d++)o+=i*=t/++r;return o*Math.exp(-t+e*Math.log(t)-n)}for(;d<=h;d++)f=-d*(d-e),a+=2,u=f*u+a,s=a+f/s,u=1/u,c*=u*s;return 1-c*Math.exp(-t+e*Math.log(t)-n)}function d(e,t){let n=0;const r=t-1,o=l(t);let i,a,s,u,d,h,f;if(e>=1)return Math.max(100,t+100*Math.sqrt(t));if(e<=0)return 0;for(t>1?(h=Math.log(r),f=Math.exp(r*(h-1)-o),d=e<.5?e:1-e,s=Math.sqrt(-2*Math.log(d)),i=(2.30753+.27061*s)/(1+s*(.99229+.04481*s))-s,e<.5&&(i=-i),i=Math.max(.001,t*Math.pow(1-1/(9*t)-i/(3*Math.sqrt(t)),3))):(s=1-t*(.253+.12*t),i=e<s?Math.pow(e/s,1/t):1-Math.log(1-(e-s)/(1-s)));n<12;n++){if(i<=0)return 0;if(a=c(t,i)-e,s=t>1?f*Math.exp(-(i-r)+r*(Math.log(i)-h)):Math.exp(-i+r*Math.log(i)-o),u=a/s,i-=s=u/(1-.5*Math.min(1,u*((t-1)/i-1))),i<=0&&(i=.5*(i+s)),Math.abs(s)<1e-8*i)break}return i}const h={pdf:function(e,t,n){return Math.exp(-.5*Math.log(2*Math.PI)-Math.log(n)-Math.pow(e-t,2)/(2*n*n))},cdf:function(e,t,n){return.5*(1+r((e-t)/Math.sqrt(2*n*n)))},inv:function(e,t,n){return-1.4142135623730951*n*i(2*e)+t}},f={pdf:function(e,t,n){return e>1||e<0?0:1==t&&1==n?1:t<512&&n<512?Math.pow(e,t-1)*Math.pow(1-e,n-1)/p(t,n):Math.exp((t-1)*Math.log(e)+(n-1)*Math.log(1-e)-g(t,n))},cdf:function(e,t,n){return e>1||e<0?+(e>1):v(e,t,n)},inv:function(e,t,n){return m(e,t,n)}};function p(e,t){if(!(e<=0||t<=0))return e+t>170?Math.exp(g(e,t)):s(e)*s(t)/s(e+t)}function g(e,t){return l(e)+l(t)-l(e+t)}function m(e,t,n){var r,o,i,a,s,u,c,d,h,f,p=t-1,g=n-1,m=0;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(i=e<.5?e:1-e,u=(2.30753+.27061*(a=Math.sqrt(-2*Math.log(i))))/(1+a*(.99229+.04481*a))-a,e<.5&&(u=-u),c=(u*u-3)/6,d=2/(1/(2*t-1)+1/(2*n-1)),h=u*Math.sqrt(c+d)Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a extends i.FunctionPlugin{fact(e,t){return this.runFunction(e.args,t,this.metadata("FACT"),e=>{e=Math.trunc(e);let t=1;for(let n=1;n<=e;n++)t*=n;return t})}factdouble(e,t){return this.runFunction(e.args,t,this.metadata("FACTDOUBLE"),e=>{let t=1;for(let n=e=Math.trunc(e);n>=1;n-=2)t*=n;return t})}combin(e,t){return this.runFunction(e.args,t,this.metadata("COMBIN"),(e,t)=>t>e?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.WrongOrder):s(e=Math.trunc(e),t=Math.trunc(t)))}combina(e,t){return this.runFunction(e.args,t,this.metadata("COMBINA"),(e,t)=>(e=Math.trunc(e))+(t=Math.trunc(t))-1>=1030?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueLarge):0===e&&0===t?1:s(e+t-1,t))}gcd(e,t){return this.runFunction(e.args,t,this.metadata("GCD"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof r.CellError)return t;let n=0;for(const e of t){if(e<0)return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueSmall);n=u(n,Math.trunc(e))}return n>Number.MAX_SAFE_INTEGER?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueLarge):n})}lcm(e,t){return this.runFunction(e.args,t,this.metadata("LCM"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof r.CellError)return t;let n=1;for(const e of t){if(e<0)return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueSmall);n=l(n,Math.trunc(e))}return n>Number.MAX_SAFE_INTEGER?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueLarge):n})}mround(e,t){return this.runFunction(e.args,t,this.metadata("MROUND"),(e,t)=>0===t?0:e>0&&t<0||e<0&&t>0?new r.CellError(r.ErrorType.NUM,o.ErrorMessage.DistinctSigns):Math.round(e/t)*t)}multinomial(e,t){return this.runFunction(e.args,t,this.metadata("MULTINOMIAL"),(...e)=>{let t=0,n=1;for(let i of e){if(i<0)return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueSmall);i=Math.trunc(i);for(let e=1;e<=i;e++)n*=(t+e)/e;t+=i}return Math.round(n)})}quotient(e,t){return this.runFunction(e.args,t,this.metadata("QUOTIENT"),(e,t)=>0===t?new r.CellError(r.ErrorType.DIV_BY_ZERO):Math.trunc(e/t))}seriessum(e,t){return this.runFunction(e.args,t,this.metadata("SERIESSUM"),(e,t,n,o)=>{const i=this.arithmeticHelper.manyToOnlyNumbersDropNulls(o.valuesFromTopLeftCorner());if(i instanceof r.CellError)return i;let a=0;i.reverse();for(const t of i)a*=Math.pow(e,n),a+=t;return a*Math.pow(e,t)})}sign(e,t){return this.runFunction(e.args,t,this.metadata("SIGN"),e=>e>0?1:e<0?-1:0)}sumx2my2(e,t){return this.runFunction(e.args,t,this.metadata("SUMX2MY2"),(e,t)=>{const n=e.valuesFromTopLeftCorner(),i=t.valuesFromTopLeftCorner();if(n.length!==i.length)return new r.CellError(r.ErrorType.NA,o.ErrorMessage.EqualLength);const a=n.length;let s=0;for(let e=0;e<a;e++){const t=n[e],o=i[e];if(t instanceof r.CellError)return t;if(o instanceof r.CellError)return o;"number"==typeof t&&"number"==typeof o&&(s+=Math.pow(t,2)-Math.pow(o,2))}return s})}sumx2py2(e,t){return this.runFunction(e.args,t,this.metadata("SUMX2PY2"),(e,t)=>{const n=e.valuesFromTopLeftCorner(),i=t.valuesFromTopLeftCorner();if(n.length!==i.length)return new r.CellError(r.ErrorType.NA,o.ErrorMessage.EqualLength);const a=n.length;let s=0;for(let e=0;e<a;e++){const t=n[e],o=i[e];if(t instanceof r.CellError)return t;if(o instanceof r.CellError)return o;"number"==typeof t&&"number"==typeof o&&(s+=Math.pow(t,2)+Math.pow(o,2))}return s})}sumxmy2(e,t){return this.runFunction(e.args,t,this.metadata("SUMXMY2"),(e,t)=>{const n=e.valuesFromTopLeftCorner(),i=t.valuesFromTopLeftCorner();if(n.length!==i.length)return new r.CellError(r.ErrorType.NA,o.ErrorMessage.EqualLength);const a=n.length;let s=0;for(let e=0;e<a;e++){const t=n[e],o=i[e];if(t instanceof r.CellError)return t;if(o instanceof r.CellError)return o;"number"==typeof t&&"number"==typeof o&&(s+=Math.pow(t-o,2))}return s})}}function s(e,t){2*t>e&&(t=e-t);let n=1;for(let r=1;r<=t;r++)n*=(e-t+r)/r;return Math.round(n)}function u(e,t){for(e<t&&([e,t]=[t,e]);t>0;)[e,t]=[t,e%t];return e}function l(e,t){return 0===e||0===t?0:e*(t/u(e,t))}a.implementedFunctions={FACT:{method:"fact",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0,maxValue:170}]},FACTDOUBLE:{method:"factdouble",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0,maxValue:288}]},COMBIN:{method:"combin",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0,lessThan:1030},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0}]},COMBINA:{method:"combina",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0}]},GCD:{method:"gcd",parameters:[{argumentType:i.FunctionArgumentType.ANY}],repeatLastArgs:1},LCM:{method:"lcm",parameters:[{argumentType:i.FunctionArgumentType.ANY}],repeatLastArgs:1},MROUND:{method:"mround",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}]},MULTINOMIAL:{method:"multinomial",parameters:[{argumentType:i.FunctionArgumentType.NUMBER}],repeatLastArgs:1Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class s extends a.FunctionPlugin{complex(e,t){return this.runFunction(e.args,t,this.metadata("COMPLEX"),(e,t,n)=>"i"!==n&&"j"!==n?new r.CellError(r.ErrorType.VALUE,o.ErrorMessage.ShouldBeIorJ):Object(i.coerceComplexToString)([e,t],n))}imabs(e,t){return this.runFunction(e.args,t,this.metadata("IMABS"),m)}imaginary(e,t){return this.runFunction(e.args,t,this.metadata("IMAGINARY"),([e,t])=>t)}imreal(e,t){return this.runFunction(e.args,t,this.metadata("IMREAL"),([e,t])=>e)}imargument(e,t){return this.runFunction(e.args,t,this.metadata("IMARGUMENT"),([e,t])=>0===e&&0===t?new r.CellError(r.ErrorType.DIV_BY_ZERO):Math.atan2(t,e))}imconjugate(e,t){return this.runFunction(e.args,t,this.metadata("IMCONJUGATE"),([e,t])=>Object(i.coerceComplexToString)([e,-t]))}imcos(e,t){return this.runFunction(e.args,t,this.metadata("IMCOS"),e=>Object(i.coerceComplexToString)(d(e)))}imcosh(e,t){return this.runFunction(e.args,t,this.metadata("IMCOSH"),e=>Object(i.coerceComplexToString)(h(e)))}imcot(e,t){return this.runFunction(e.args,t,this.metadata("IMCOT"),e=>Object(i.coerceComplexToString)(c(d(e),f(e))))}imcsc(e,t){return this.runFunction(e.args,t,this.metadata("IMCSC"),e=>Object(i.coerceComplexToString)(c([1,0],f(e))))}imcsch(e,t){return this.runFunction(e.args,t,this.metadata("IMCSCH"),e=>Object(i.coerceComplexToString)(c([1,0],p(e))))}imsec(e,t){return this.runFunction(e.args,t,this.metadata("IMSEC"),e=>Object(i.coerceComplexToString)(c([1,0],d(e))))}imsech(e,t){return this.runFunction(e.args,t,this.metadata("IMSECH"),e=>Object(i.coerceComplexToString)(c([1,0],h(e))))}imsin(e,t){return this.runFunction(e.args,t,this.metadata("IMSIN"),e=>Object(i.coerceComplexToString)(f(e)))}imsinh(e,t){return this.runFunction(e.args,t,this.metadata("IMSINH"),e=>Object(i.coerceComplexToString)(p(e)))}imtan(e,t){return this.runFunction(e.args,t,this.metadata("IMTAN"),e=>Object(i.coerceComplexToString)(c(f(e),d(e))))}imdiv(e,t){return this.runFunction(e.args,t,this.metadata("IMDIV"),(e,t)=>Object(i.coerceComplexToString)(c(e,t)))}improduct(e,t){return this.runFunction(e.args,t,this.metadata("IMPRODUCT"),(...e)=>{const t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof r.CellError)return t;let n=[1,0];for(const e of t)n=l(n,e);return Object(i.coerceComplexToString)(n)})}imsum(e,t){return this.runFunction(e.args,t,this.metadata("IMSUM"),(...e)=>{const t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof r.CellError)return t;let n=[0,0];for(const e of t)n=u(n,e);return Object(i.coerceComplexToString)(n)})}imsub(e,t){return this.runFunction(e.args,t,this.metadata("IMSUB"),(e,t)=>Object(i.coerceComplexToString)(function([e,t],[n,r]){return[e-n,t-r]}(e,t)))}imexp(e,t){return this.runFunction(e.args,t,this.metadata("IMEXP"),e=>Object(i.coerceComplexToString)(g(e)))}imln(e,t){return this.runFunction(e.args,t,this.metadata("IMLN"),e=>Object(i.coerceComplexToString)(v(e)))}imlog10(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG10"),e=>{const[t,n]=v(e),r=Math.log(10);return Object(i.coerceComplexToString)([t/r,n/r])})}imlog2(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG2"),e=>{const[t,n]=v(e),r=Math.log(2);return Object(i.coerceComplexToString)([t/r,n/r])})}impower(e,t){return this.runFunction(e.args,t,this.metadata("IMPOWER"),(e,t)=>Object(i.coerceComplexToString)(y(e,t)))}imsqrt(e,t){return this.runFunction(e.args,t,this.metadata("IMSQRT"),e=>Object(i.coerceComplexToString)(y(e,.5)))}}function u([e,t],[n,r]){return[e+n,t+r]}function l([e,t],[n,r]){return[e*n-t*r,e*r+n*t]}function c([e,t],[n,r]){const o=Math.pow(n,2)+Math.pow(r,2),[i,a]=l([e,t],[n,-r]);return[i/o,a/o]}function d([e,t]){return[Math.cos(e)*Math.cosh(t),-Math.sin(e)*Math.sinh(t)]}function h([e,t]){return[Math.cosh(e)*Math.cos(t),Math.sinh(e)*Math.sin(t)]}function f([e,t]){return[Math.sin(e)*Math.cosh(t),Math.cos(e)*Math.sinh(t)]}function p([e,t]){return[Math.sinh(e)*Math.cos(t),Math.cosh(e)*Math.sin(t)]}function g([e,t]){return[Math.exp(e)*Math.cos(t),Math.exp(e)*Math.sin(t)]}function m([e,t]){return Math.sqrt(e*e+t*t)}function v([e,t]){return[Math.log(m([e,t])),Math.atan2(t,e)]}function y(e,t){const[n,r]=v(e);return g([t*n,t*r])}s.implementedFunctions={COMPLEX:{method:"complex",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.STRING,defaultValue:"i"}]},IMABS:{method:"imabs",parameters:[{argumentType:a.FunctionArgumentType.COMPLEX}]},IMAGINARY:{method:"imaginary",parameters:[{argumentType:a.FunctionArgumentType.COMPLEX}]},IMREAL:{method:"imreal",parameters:[{argumentType:a.FunctionArgumentType.COMPLEX}]},IMARGUMENT:{method:"imargument",parameters:[{argumentType:a.FunctionArgumentType.COMPLEX}]},IMCONJUGATE:{method:"imconjugate",parameters:[{argumentType:a.FunctionArgumentType.COMPLEX}]},IMCOS:{method:"imcos",parameters:[{argumentType:a.FunctionArgumentType.COMPLEX}]},IMCOSH:{method:"imcosh",parameters:[{argumentType:a.FunctionArgumentType.COMPLEX}]},Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class u extends s.FunctionPlugin{avedev(e,t){return this.runFunction(e.args,t,this.metadata("AVEDEV"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof r.CellError)return t;if(0===t.length)return new r.CellError(r.ErrorType.DIV_BY_ZERO);const n=Object(a.mean)(t);return t.reduce((e,t)=>e+Math.abs(t-n),0)/t.length})}devsq(e,t){return this.runFunction(e.args,t,this.metadata("DEVSQ"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof r.CellError?t:0===t.length?0:Object(a.sumsqerr)(t)})}geomean(e,t){return this.runFunction(e.args,t,this.metadata("GEOMEAN"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof r.CellError)return t;if(0===t.length)return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.OneValue);for(const e of t)if(e<=0)return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueSmall);return Object(a.geomean)(t)})}harmean(e,t){return this.runFunction(e.args,t,this.metadata("HARMEAN"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof r.CellError)return t;if(0===t.length)return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.OneValue);for(const e of t)if(e<=0)return new r.CellError(r.ErrorType.NUM,o.ErrorMessage.ValueSmall);return t.length/t.reduce((e,t)=>e+1/t,0)})}correl(e,t){return this.runFunction(e.args,t,this.metadata("CORREL"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new r.CellError(r.ErrorType.NA,o.ErrorMessage.EqualLength);const n=l(e,t);if(n instanceof r.CellError)return n;return n[0].length<=1?new r.CellError(r.ErrorType.DIV_BY_ZERO,o.ErrorMessage.TwoValues):Object(a.corrcoeff)(n[0],n[1])})}rsq(e,t){return this.runFunction(e.args,t,this.metadata("RSQ"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new r.CellError(r.ErrorType.NA,o.ErrorMessage.EqualLength);const n=l(e,t);if(n instanceof r.CellError)return n;return n[0].length<=1?new r.CellError(r.ErrorType.DIV_BY_ZERO,o.ErrorMessage.TwoValues):Math.pow(Object(a.corrcoeff)(n[0],n[1]),2)})}covariancep(e,t){return this.runFunction(e.args,t,this.metadata("COVARIANCE.P"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new r.CellError(r.ErrorType.NA,o.ErrorMessage.EqualLength);const n=l(e,t);if(n instanceof r.CellError)return n;const i=n[0].length;return i<1?new r.CellError(r.ErrorType.DIV_BY_ZERO,o.ErrorMessage.OneValue):1===i?0:Object(a.covariance)(n[0],n[1])*(i-1)/i})}covariances(e,t){return this.runFunction(e.args,t,this.metadata("COVARIANCE.S"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new r.CellError(r.ErrorType.NA,o.ErrorMessage.EqualLength);const n=l(e,t);if(n instanceof r.CellError)return n;return n[0].length<=1?new r.CellError(r.ErrorType.DIV_BY_ZERO,o.ErrorMessage.TwoValues):Object(a.covariance)(n[0],n[1])})}ztest(e,t){return this.runFunction(e.args,t,this.metadata("Z.TEST"),(e,t,n)=>{const i=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(i instanceof r.CellError)return i;const s=i.length;if(void 0===n){if(s<2)return new r.CellError(r.ErrorType.DIV_BY_ZERO,o.ErrorMessage.TwoValues);n=Object(a.stdev)(i,!0)}return s<1?new r.CellError(r.ErrorType.NA,o.ErrorMessage.OneValue):0===n?new r.CellError(r.ErrorType.DIV_BY_ZERO):1-a.normal.cdf((Object(a.mean)(i)-t)/(n/Math.sqrt(s)),0,1)})}ftest(e,t){return this.runFunction(e.args,t,this.metadata("F.TEST"),(e,t)=>{const n=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),o=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(n instanceof r.CellError)return n;if(o instanceof r.CellError)return o;if(n.length<=1||o.length<=1)return new r.CellError(r.ErrorType.DIV_BY_ZERO);const i=Object(a.variance)(n,!0),s=Object(a.variance)(o,!0);if(0===i||0===s)return new r.CellError(r.ErrorType.DIV_BY_ZERO);const u=i/s,l=a.centralF.cdf(u,n.length-1,o.length-1);return 2*Math.min(l,1-l)})}steyx(e,t){return this.runFunction(e.args,t,this.metadata("STEYX"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new r.CellError(r.ErrorType.NA,o.ErrorMessage.EqualLength);const n=l(e,t);if(n instanceof r.CellError)return n;const i=n[0].length;return i<=2?new r.CellError(r.ErrorType.DIV_BY_ZERO,o.ErrorMessage.ThreeValues):Math.sqrt((Object(a.sumsqerr)(n[0])-Math.pow(Object(a.covariance)(n[0],n[1])*(i-1),2)/Object(a.sumsqerr)(n[1]))/(i-2))})}slope(e,t){return this.runFunction(e.args,t,this.metadata("SLOPE"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new r.CellError(r.ErrorType.NA,o.ErrorMessage.EqualLength);const n=l(e,t);if(n instanceof r.CellError)return n;const i=n[0].length;return i<=1?new r.CellError(r.ErrorType.DIV_BY_ZERO,o.ErrorMessage.TwoValues):Object(a.covariance)(n[0],n[1])*(i-1)/Object(a.sumsqerr)(n[1])})}chisqtest(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.TEST"),(e,t)=>{const n=e.height(),i=e.width();if(t.height()!==n||t.width()!==i)return new r.CellError(r.ErrorType.NA,o.ErrorMessage.EqualLength);const s=lLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o{constructor(e){this.functionRegistry=e,this.cache=new Map}set(e,t){const n=((e,t,n,r)=>({ast:e,relativeDependencies:t,hasVolatileFunction:n,hasStructuralChangeFunction:r}))(t,Object(r.collectDependencies)(t,this.functionRegistry),i(t,this.functionRegistry.isFunctionVolatile),i(t,this.functionRegistry.isFunctionDependentOnSheetStructureChange));return this.cache.set(e,n),n}get(e){return this.cache.get(e)}maybeSetAndThenGet(e,t){const n=this.cache.get(e);return void 0!==n?n.ast:(this.set(e,t),t)}}const i=(e,t)=>{switch(e.type){case r.AstNodeType.EMPTY:case r.AstNodeType.NUMBER:case r.AstNodeType.STRING:case r.AstNodeType.ERROR:case r.AstNodeType.ERROR_WITH_RAW_INPUT:case r.AstNodeType.CELL_REFERENCE:case r.AstNodeType.CELL_RANGE:case r.AstNodeType.COLUMN_RANGE:case r.AstNodeType.ROW_RANGE:case r.AstNodeType.NAMED_EXPRESSION:return!1;case r.AstNodeType.PERCENT_OP:case r.AstNodeType.PLUS_UNARY_OP:case r.AstNodeType.MINUS_UNARY_OP:return i(e.value,t);case r.AstNodeType.CONCATENATE_OP:case r.AstNodeType.EQUALS_OP:case r.AstNodeType.NOT_EQUAL_OP:case r.AstNodeType.LESS_THAN_OP:case r.AstNodeType.GREATER_THAN_OP:case r.AstNodeType.LESS_THAN_OR_EQUAL_OP:case r.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case r.AstNodeType.MINUS_OP:case r.AstNodeType.PLUS_OP:case r.AstNodeType.TIMES_OP:case r.AstNodeType.DIV_OP:case r.AstNodeType.POWER_OP:return i(e.left,t)||i(e.right,t);case r.AstNodeType.PARENTHESIS:return i(e.expression,t);case r.AstNodeType.FUNCTION_CALL:return!!t(e.procedureName)||e.args.some(e=>i(e,t));case r.AstNodeType.ARRAY:return e.args.some(e=>e.some(e=>i(e,t)))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CellReferenceMatcher",(function(){return o}));var r=n(156);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o{constructor(){this.POSSIBLE_START_CHARACTERS=[...r.ALL_UNICODE_LETTERS_ARRAY,...r.ALL_DIGITS_ARRAY,r.ABSOLUTE_OPERATOR,"'","_"],this.cellReferenceRegexp=new RegExp(r.CELL_REFERENCE_WITH_NEXT_CHARACTER_PATTERN,"y")}match(e,t){this.cellReferenceRegexp.lastIndex=t;const n=this.cellReferenceRegexp.exec(e+"@");return null==n||null==n[1]?null:(n[0]=n[1],n)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"NamedExpressionMatcher",(function(){return o}));var r=n(156);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o{constructor(){this.POSSIBLE_START_CHARACTERS=[...r.ALL_UNICODE_LETTERS_ARRAY,"_"],this.namedExpressionRegexp=new RegExp(r.NAMED_EXPRESSION_PATTERN,"y"),this.r1c1CellRefRegexp=new RegExp(`^${r.R1C1_CELL_REFERENCE_PATTERN}$`)}match(e,t){this.namedExpressionRegexp.lastIndex=t;const n=this.namedExpressionRegexp.exec(e);return null==n||null==n[0]||this.r1c1CellRefRegexp.test(n[0])?null:n}}},function(e,t,n){"use strict";n.r(t),n.d(t,"collectAddressesDependentToRange",(function(){return a}));var r=n(61),o=n(105),i=n(253);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const a=(e,t,n,a,s)=>{if(t instanceof i.RangeVertex){const e=t.range.intersectionWith(n);return void 0!==e?Array.from(e.addresses(s)):[]}let u,l;return t instanceof o.FormulaVertex?(u=t.getFormula(a),l=t.getAddress(a),Object(r.collectDependencies)(u,e).filter(e=>e instanceof r.AddressDependency).map(e=>e.dependency.toSimpleCellAddress(l)).filter(e=>n.addressInRange(e))):[]}},function(e,t,n){!function(t){"use strict";for(var n=[null,0,{}],r=function(e,t){this.codepoint=e,this.feature=t},o={},i=[],a=0;a<=255;++a)i[a]=0;var s=[function(e,t,o){return t<60||13311<t&&t<42607?new r(t,n):e(t,o)},function(e,t,n){var r=o[t];return r||(r=e(t,n)).feature&&++i[t>>8&255]>10&&(o[t]=r),r},function(e,t,n){return n?e(t,n):new r(t,null)},function(e,t,n){var o;if(t<4352||4371<=t&&t<44032||55204<t)return e(t,n);if(4352<=t&&t<4371){var i={},a=21*(t-4352);for(o=0;o<21;++o)i[4449+o]=44032+28*(o+a);return new r(t,[,,i])}var s=t-44032,u=s%28,l=[];if(0!==u)l[0]=[44032+s-u,4519+u];else for(l[0]=[4352+Math.floor(s/588),4449+Math.floor(s%588/28)],l[2]={},o=1;o<28;++o)l[2][4519+o]=t+o;return new r(t,l)},function(e,t,o){var i=(r.udata[65280&t]||{})[t];return new r(t,i||n)}];r.fromCharCode=s.reduceRight((function(e,t){return function(n,r){return t(e,n,r)}}),null),r.isHighSurrogate=function(e){return e>=55296&&e<=56319},r.isLowSurrogate=function(e){return e>=56320&&e<=57343},r.prototype.prepFeature=function(){this.feature||(this.feature=r.fromCharCode(this.codepoint,!0).feature)},r.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var e=this.codepoint-65536;return String.fromCharCode(Math.floor(e/1024)+55296,e%1024+56320)},r.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},r.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&256&this.feature[1]},r.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&512&this.feature[1]},r.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?255&this.feature[1]:0},r.prototype.getComposite=function(e){if(this.prepFeature(),!this.feature[2])return null;var t=this.feature[2][e.codepoint];return t?r.fromCharCode(t):null};var u=function(e){this.str=e,this.cursor=0};u.prototype.next=function(){if(this.str&&this.cursor<this.str.length){var e,t=this.str.charCodeAt(this.cursor++);return r.isHighSurrogate(t)&&this.cursor<this.str.length&&r.isLowSurrogate(e=this.str.charCodeAt(this.cursor))&&(t=1024*(t-55296)+(e-56320)+65536,++this.cursor),r.fromCharCode(t)}return this.str=null,null};var l=function(e,t){this.it=e,this.canonical=t,this.resBuf=[]};l.prototype.next=function(){if(0===this.resBuf.length){var e=this.it.next();if(!e)return null;this.resBuf=function e(t,n){var o=n.getDecomp();if(!o||t&&n.isCompatibility())return[n];for(var i=[],a=0;a<o.length;++a){var s=e(t,r.fromCharCode(o[a]));i=i.concat(s)}return i}(this.canonical,e)}return this.resBuf.shift()};var c=function(e){this.it=e,this.resBuf=[]};c.prototype.next=function(){var e;if(0===this.resBuf.length)do{var t=this.it.next();if(!t)break;e=t.getCanonicalClass();var n=this.resBuf.length;if(0!==e)for(;n>0;--n){if(this.resBuf[n-1].getCanonicalClass()<=e)break}this.resBuf.splice(n,0,t)}while(0!==e);return this.resBuf.shift()};var d=function(e){this.it=e,this.procBuf=[],this.resBuf=[],this.lastClass=null};d.prototype.next=function(){for(;0===this.resBuf.length;){var e=this.it.next();if(!e){this.resBuf=this.procBuf,this.procBuf=[];break}if(0===this.procBuf.length)this.lastClass=e.getCanonicalClass(),this.procBuf.push(e);else{var t=this.procBuf[0].getComposite(e),n=e.getCanonicalClass();t&&(this.lastClass<n||0===this.lastClass)?this.procBuf[0]=t:(0===n&&(this.resBuf=this.procBuf,this.procBuf=[]),this.lastClass=n,this.procBuf.push(e))}}return this.resBuf.shift()};var h=function(e,t){for(var n,r=function(e,t){switch(e){case"NFD":return new c(new l(new u(t),!0));case"NFKD":return new c(new l(new u(t),!1));case"NFC":return new d(new c(new l(new u(t),!0)));case"NFKC":return new d(new c(new l(new u(t),!1)))}throw e+" is invalid"}(e,t),o="";n=r.next();)o+=n.toString();return o};r.udata={0:{60:[,,{824:8814}],61:[,,{824:8800}],62:[,,{824:8815}],65:[,,{768:192,769:193,770:194,771:195,772:256,774:258,775:550,776:196,777:7842,778:197,780:461,783:512,785:514,803:7840,805:7680,808:260}],66:[,,{775:7682,803:7684,817:7686}],67:[,,{769:262,770:264,775:266,780:268,807:199}],68:[,,{775:7690,780:270,803:7692,807:7696,813:7698,817:7694}],69:[,,{768:200,769:201,770:202,771:7868,772:274,774:276,775:278,776:203,777:7866,780:282,783:516,785:518,803:7864,807:552,808:280,813:7704,816:7706}],70:[,,{775:7710}],71:[,,{769:500,770:284,772:7712,774:286,775:288,780:486,807:290}],72:[,,{770:292,775:7714,776:7718,780:542,803:7716,807:7720,814:7722}],73:[,,{768:204,769:205,770:206,771:296,772:298,774:300,775:304,776:207,777:7880,780:463,783:520,785:522,803:7882,808:302,816:7724}],74:[,,{770:308}],75:[,,{769:7728,780:488,803:7730,807:310,817:7732}]Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function r(e){const t=e.caseSensitive?e.accentSensitive?"variant":"case":e.accentSensitive?"accent":"base",n=e.caseFirst,r=e.ignorePunctuation;return new Intl.Collator(e.localeLang,{sensitivity:t,caseFirst:n,ignorePunctuation:r})}n.r(t),n.d(t,"collatorFromConfig",(function(){return r}))},function(e,t,n){"use strict";n.r(t),n.d(t,"TokenType",(function(){return i})),n.d(t,"formatToken",(function(){return s})),n.d(t,"FormatExpressionType",(function(){return a})),n.d(t,"parseForDateTimeFormat",(function(){return l})),n.d(t,"parseForNumberFormat",(function(){return c})),n.d(t,"parse",(function(){return d})),n.d(t,"isEscapeToken",(function(){return h}));
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const r=/(\\.|dd|DD|d|D|mm|MM|m|M|YYYY|YY|yyyy|yy|HH|hh|H|h|ss(\.(0+|s+))?|s|AM\/PM|am\/pm|A\/P|a\/p|\[mm]|\[MM]|\[hh]|\[HH])/g,o=/(\\.|[#0]+(\.[#0]*)?)/g;var i,a;function s(e,t){return{type:e,value:t}}function u(e,t){const n=[];let r=0;for(let o=0;o<e.length;++o){const a=e[o];if(a.index!==r){const e=t.substr(r,a.index-r);n.push(s(i.FREE_TEXT,e))}a[0].startsWith("\\")?n.push(s(i.FREE_TEXT,a[0])):n.push(s(i.FORMAT,a[0])),r=a.index+a[0].length}const o=e[e.length-1];if(o.index+o[0].length<t.length){const e=t.substr(o.index+o[0].length,t.length);n.push(s(i.FREE_TEXT,e))}return n}function l(e){const t=function(e){r.lastIndex=0;const t=[];let n;do{n=r.exec(e),null!==n&&t.push(n)}while(n);return t}(e);return t.every(e=>h(e))?void 0:{type:a.DATE,tokens:u(t,e)}}function c(e){const t=function(e){o.lastIndex=0;const t=o.exec(e);return null!==t?[t]:[]}(e);return t.every(e=>h(e))?void 0:{type:a.NUMBER,tokens:u(t,e)}}function d(e){var t,n;return null!==(n=null!==(t=l(e))&&void 0!==t?t:c(e))&&void 0!==n?n:{type:a.STRING,tokens:[{type:i.FREE_TEXT,value:e}]}}function h(e){return e[0].startsWith("\\")}!function(e){e.FORMAT="FORMAT",e.FREE_TEXT="FREE_TEXT"}(i||(i={})),function(e){e.DATE="DATE",e.NUMBER="NUMBER",e.STRING="STRING"}(a||(a={}))},function(e,t,n){"use strict";n.r(t),n.d(t,"checkLicenseKeyValidity",(function(){return a}));var r=n(663);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/const o={invalid:()=>"The license key for HyperFormula is invalid.",expired:({keyValidityDate:e})=>`The license key for HyperFormula expired on ${e}, and is not valid for the installed version.`,missing:()=>"The license key for HyperFormula is missing."};let i=!1;function a(e){const t={template:"missing",vars:{}};if("gpl-v3"===e||"internal-use-in-handsontable"===e)t.template="valid";else if("string"==typeof e&&Object(r.checkKeySchema)(e)){const[n,o,i]="29/05/2023".split("/"),a=Math.floor(new Date(`${o}/${n}/${i}`).getTime()/864e5),s=Object(r.extractTime)(e);t.vars.keyValidityDate=function(e){const t=["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()],n=e.getDate(),r=e.getFullYear();return`${t} ${n}, ${r}`}(new Date(864e5*(s+1))),t.template=a>s?"expired":"valid"}else""!==e&&(t.template="invalid");return i||"valid"===t.template||(console.warn(o[t.template](t.vars)),i=!0),t.template}},function(e,t,n){"use strict";n.r(t),n.d(t,"extractTime",(function(){return l})),n.d(t,"checkKeySchema",(function(){return c}));
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const r="length",o=e=>parseInt(e,16),i=e=>parseInt(e,10),a=e=>(e+"").replace(/\-/g,""),s=(e,t,n)=>e.substr(t,n),u=e=>e.codePointAt(0)-65;function l(e){return 25===a(e)[r]?o(s(a(e),o("12"),u("F")))/(o(s(a(e),u("C"),u("Y")>>4))||1+(~~![][r]<<3)):0}function c(e){if((e=(e+"").replace(/\-/g,""))[r]!==u("Z"))return!1;let t=0;return[[0,u("G")+1],[u("H"),u("H")-1],[u("G")+u("H"),u("G")]].reduce((n,[r,a],u)=>(n|=(i(""+i(o(s(e,t+r-(0===u?0:2),a+(u?2:0)))+(o(s(e,t+r+a,2))+[]).padStart(2,"0")))%97||2)>>1,t+=2,n),u("A"))===[]+1>>1}},function(e,t,n){"use strict";n.r(t),n.d(t,"BuildEngineFactory",(function(){return N}));var r=n(99),o=n(165),i=n(334),a=n(206),s=n(665),u=n(139),l=n(112),c=n(29),d=n(671),h=n(209),f=n(672),p=n(205),g=n(101),m=n(263),v=n(674),y=n(676),E=n(678),T=n(207),C=n(681),R=n(208),w=n(61),S=n(682),O=n(262),b=n(113),A=n(337);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class N{static buildFromSheets(e,t={},n=[]){const r=new a.Config(t);return this.buildEngine(r,e,n)}static buildFromSheet(e,t={},n=[]){const r=new a.Config(t),o=r.translationPackage.getUITranslation(p.UIElement.NEW_SHEET_PREFIX)+"1";return this.buildEngine(r,{[o]:e},n)}static buildEmpty(e={},t=[]){return this.buildEngine(new a.Config(e),{},t)}static rebuildWithConfig(e,t,n,r){return this.buildEngine(e,t,n,r)}static buildEngine(e,t={},n=[],a=(e.useStats?new b.Statistics:new b.EmptyStatistics)){a.start(b.StatType.BUILD_ENGINE_TOTAL);const p=new T.NamedExpressions,N=new m.FunctionRegistry(e),M=new y.LazilyTransformingAstService(a),I=l.DependencyGraph.buildEmpty(M,e,N,p,a),_=Object(E.buildColumnSearchStrategy)(I,e,a),k=I.sheetMapping,x=I.addressMapping;for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n];Object(O.validateAsSheet)(r);const o=Object(O.findBoundaries)(r);if(o.height>e.maxRows||o.width>e.maxColumns)throw new c.SheetSizeLimitExceededError;const i=k.addSheet(n);x.autoAddSheet(i,r,o)}const P=new w.ParserWithCaching(e,N,k.get);M.parser=P;const L=new w.Unparser(e,Object(w.buildLexerConfig)(e),k.fetchDisplayName,p),D=new u.DateTimeHelper(e),F=new C.NumberLiteralHelper(e),U=new g.ArithmeticHelper(e,D,F),H=new o.CellContentParser(e,D,F),V=new r.ArraySizePredictor(e,N),j=new R.Operations(e,I,_,H,P,a,M,p,V),B=new A.UndoRedo(e,j);M.undoRedo=B;const W=new i.ClipboardOperations(e,I,j),Y=new s.CrudOperations(e,j,B,W,I,_,P,H,M,p);n.forEach(e=>{Y.ensureItIsPossibleToAddNamedExpression(e.name,e.expression,e.scope),Y.operations.addNamedExpression(e.name,e.expression,e.scope,e.options)});const G=new h.Exporter(e,p,k.fetchDisplayName,M),z=new S.Serialization(I,L,G),K=new v.Interpreter(e,I,_,a,U,N,p,z,V,D);a.measure(b.StatType.GRAPH_BUILD,()=>{new f.GraphBuilder(I,_,P,H,a,V).buildGraph(t,a)});const X=new d.Evaluator(e,a,K,M,I,_);return X.run(),a.end(b.StatType.BUILD_ENGINE_TOTAL),{config:e,stats:a,dependencyGraph:I,columnSearch:_,parser:P,unparser:L,cellContentParser:H,evaluator:X,lazilyTransformingAstService:M,crudOperations:Y,exporter:G,namedExpressions:p,serialization:z,functionRegistry:N}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CrudOperations",(function(){return h}));var r=n(77),o=n(17),i=n(165),a=n(29),s=n(207),u=n(208),l=n(262),c=n(161),d=n(337);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class h{constructor(e,t,n,r,o,i,a,s,u,l){this.operations=t,this.undoRedo=n,this.clipboardOperations=r,this.dependencyGraph=o,this.columnSearch=i,this.parser=a,this.cellContentParser=s,this.lazilyTransformingAstService=u,this.namedExpressions=l,this.maxRows=e.maxRows,this.maxColumns=e.maxColumns}get sheetMapping(){return this.dependencyGraph.sheetMapping}addRows(e,...t){const n=new u.AddRowsCommand(e,t);this.ensureItIsPossibleToAddRows(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.operations.addRows(n),this.undoRedo.saveOperation(new d.AddRowsUndoEntry(n))}removeRows(e,...t){const n=new u.RemoveRowsCommand(e,t);this.ensureItIsPossibleToRemoveRows(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const r=this.operations.removeRows(n);this.undoRedo.saveOperation(new d.RemoveRowsUndoEntry(n,r))}addColumns(e,...t){const n=new u.AddColumnsCommand(e,t);this.ensureItIsPossibleToAddColumns(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.operations.addColumns(n),this.undoRedo.saveOperation(new d.AddColumnsUndoEntry(n))}removeColumns(e,...t){const n=new u.RemoveColumnsCommand(e,t);this.ensureItIsPossibleToRemoveColumns(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const r=this.operations.removeColumns(n);this.undoRedo.saveOperation(new d.RemoveColumnsUndoEntry(n,r))}moveCells(e,t,n,r){this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const{version:o,overwrittenCellsData:i,addedGlobalNamedExpressions:a}=this.operations.moveCells(e,t,n,r);this.undoRedo.saveOperation(new d.MoveCellsUndoEntry(e,t,n,r,i,a,o))}moveRows(e,t,n,r){this.ensureItIsPossibleToMoveRows(e,t,n,r),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const o=this.operations.moveRows(e,t,n,r);this.undoRedo.saveOperation(new d.MoveRowsUndoEntry(e,t,n,r,o))}moveColumns(e,t,n,r){this.ensureItIsPossibleToMoveColumns(e,t,n,r),this.undoRedo.clearRedoStack();const o=this.operations.moveColumns(e,t,n,r);this.undoRedo.saveOperation(new d.MoveColumnsUndoEntry(e,t,n,r,o))}cut(e,t,n){this.clipboardOperations.cut(e,t,n)}ensureItIsPossibleToCopy(e,t,n){if(!f(t))throw new a.InvalidArgumentsError("width to be positive integer.");if(!f(n))throw new a.InvalidArgumentsError("height to be positive integer.")}copy(e,t,n){this.ensureItIsPossibleToCopy(e,t,n),this.clipboardOperations.copy(e,t,n)}paste(e){const t=this.clipboardOperations.clipboard;if(void 0===t)throw new a.NothingToPasteError;if(this.clipboardOperations.isCutClipboard())this.moveCells(t.sourceLeftCorner,t.width,t.height,e);else if(this.clipboardOperations.isCopyClipboard()){this.clipboardOperations.ensureItIsPossibleToCopyPaste(e);const n=r.AbsoluteCellRange.spanFrom(e,t.width,t.height),o=this.operations.getRangeClipboardCells(n);this.undoRedo.clearRedoStack();const i=this.operations.restoreClipboardCells(t.sourceLeftCorner.sheet,t.getContent(e));this.undoRedo.saveOperation(new d.PasteUndoEntry(e,o,t.content,i))}}beginUndoRedoBatchMode(){this.undoRedo.beginBatchMode()}commitUndoRedoBatchMode(){this.undoRedo.commitBatchMode()}isClipboardEmpty(){return void 0===this.clipboardOperations.clipboard}clearClipboard(){this.clipboardOperations.clear()}addSheet(e){void 0!==e&&this.ensureItIsPossibleToAddSheet(e),this.undoRedo.clearRedoStack();const t=this.operations.addSheet(e);return this.undoRedo.saveOperation(new d.AddSheetUndoEntry(t)),t}removeSheet(e){this.ensureScopeIdIsValid(e),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const t=this.sheetMapping.fetchDisplayName(e),n=this.operations.getSheetClipboardCells(e),{version:r,scopedNamedExpressions:o}=this.operations.removeSheet(e);this.undoRedo.saveOperation(new d.RemoveSheetUndoEntry(t,e,n,o,r))}renameSheet(e,t){this.ensureItIsPossibleToRenameSheet(e,t);const n=this.operations.renameSheet(e,t);return void 0!==n&&(this.undoRedo.clearRedoStack(),this.undoRedo.saveOperation(new d.RenameSheetUndoEntry(e,n,t))),n}clearSheet(e){this.ensureScopeIdIsValid(e),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const t=this.operations.getSheetClipboardCells(e);this.operations.clearSheet(e),this.undoRedo.saveOperation(new d.ClearSheetUndoEntry(e,t))}setCellContents(e,t){if(t instanceof Array){for(let e=0;e<t.length;e++)if(!(t[e]instanceof Array))throw new a.InvalidArgumentsError("an array of arrays or a raw cell value.")}else t=[[t]];this.ensureItIsPossibleToChangeCellContents(e,t),this.undoRedo.clearRedoStack();const n=[];for(let r=0;r<t.length;r++)for(let o=0;o<t[r].length;o++){const i={sheet:e.sheet,row:e.row+r,col:e.col+o},a=t[r][o];this.clipboardOperations.abortCut();const s=this.operations.setCellContent(i,a);n.push({address:i,newContent:a,oldContent:s})}this.undoRedo.saveOperation(new d.SetCellContentsUndoEntry(n))}setSheetContent(e,t){this.ensureScopeIdIsValid(e),this.ensureItIsPossibleToChangeSheetContents(e,t),Object(l.validateAsSheet)(t),this.undoRedo.clearRedoStack(),this.clipboaLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i extends o.Transformer{constructor(e){super(),this.columnsSpan=e}get sheet(){return this.columnsSpan.sheet}isIrreversible(){return!1}transformRowRangeAst(e,t){return e}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){throw Error("Not implemented")}transformColumnRange(e,t,n){return this.transformRange(e,t,n)}transformCellAddress(e,t){const n=Object(r.absoluteSheetReference)(e,t);if(n!==this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet)return!1;const o=e.toSimpleColumnAddress(t);if(n===this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet)return this.columnsSpan.columnStart<=o.col&&e.shiftedByColumns(this.columnsSpan.numberOfColumns);if(t.sheet===this.columnsSpan.sheet&&n!==this.columnsSpan.sheet)return!e.isColumnAbsolute()&&(!(t.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(-this.columnsSpan.numberOfColumns));if(e.isColumnAbsolute())return!(e.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(this.columnsSpan.numberOfColumns);return e.toSimpleColumnAddress(t).col<this.columnsSpan.columnStart?!(t.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(-this.columnsSpan.numberOfColumns):t.col<this.columnsSpan.columnStart&&e.shiftedByColumns(this.columnsSpan.numberOfColumns)}fixNodeAddress(e){return this.columnsSpan.sheet===e.sheet&&this.columnsSpan.columnStart<=e.col?Object.assign(Object.assign({},e),{col:e.col+this.columnsSpan.numberOfColumns}):e}transformRange(e,t,n){const o=this.transformCellAddress(e,n),i=this.transformCellAddress(t,n);return o===r.ErrorType.REF||i===r.ErrorType.REF?r.ErrorType.REF:!(!o&&!i)&&[o||e,i||t]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CleanOutOfScopeDependenciesTransformer",(function(){return i}));var r=n(17),o=n(121);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i extends o.Transformer{constructor(e){super(),this.sheet=e}isIrreversible(){return!0}fixNodeAddress(e){return e}transformCellAddress(e,t){return!!e.isInvalid(t)&&r.ErrorType.REF}transformCellRange(e,t,n){return!(!e.isInvalid(n)&&!t.isInvalid(n))&&r.ErrorType.REF}transformColumnRange(e,t,n){return!(!e.isInvalid(n)&&!t.isInvalid(n))&&r.ErrorType.REF}transformRowRange(e,t,n){return!(!e.isInvalid(n)&&!t.isInvalid(n))&&r.ErrorType.REF}}},function(e,t,n){"use strict";n.r(t),n.d(t,"MoveCellsTransformer",(function(){return s})),n.d(t,"DependentFormulaTransformer",(function(){return u}));var r=n(17),o=n(61),i=n(199),a=n(121);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class s extends a.Transformer{constructor(e,t,n,r){super(),this.sourceRange=e,this.toRight=t,this.toBottom=n,this.toSheet=r,this.dependentFormulaTransformer=new u(e,t,n,r)}get sheet(){return this.sourceRange.sheet}isIrreversible(){return!0}transformSingleAst(e,t){if(this.sourceRange.addressInRange(t)){return[this.transformAst(e,t),this.fixNodeAddress(t)]}return this.dependentFormulaTransformer.transformSingleAst(e,t)}fixNodeAddress(e){return Object(r.simpleCellAddress)(this.toSheet,e.col+this.toRight,e.row+this.toBottom)}transformCellAddress(e,t){return this.transformAddress(e,t)}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformColumnRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){return this.transformRange(e,t,n)}transformAddress(e,t){const n=this.sourceRange;if(e instanceof o.CellAddress){const r=e.toSimpleCellAddress(t);if(n.addressInRange(r))return e.shiftAbsoluteDimensions(this.toRight,this.toBottom)}return e.shiftRelativeDimensions(-this.toRight,-this.toBottom)}transformRange(e,t,n){const r=this.sourceRange;if(e instanceof o.CellAddress&&t instanceof o.CellAddress){const o=e.toSimpleCellAddress(n),i=t.toSimpleCellAddress(n);if(r.addressInRange(o)&&r.addressInRange(i))return[e.shiftAbsoluteDimensions(this.toRight,this.toBottom),t.shiftAbsoluteDimensions(this.toRight,this.toBottom)]}return[e.shiftRelativeDimensions(-this.toRight,-this.toBottom),t.shiftRelativeDimensions(-this.toRight,-this.toBottom)]}}class u extends a.Transformer{constructor(e,t,n,r){super(),this.sourceRange=e,this.toRight=t,this.toBottom=n,this.toSheet=r}get sheet(){return this.sourceRange.sheet}isIrreversible(){return!0}fixNodeAddress(e){return e}transformCellAddress(e,t){return!!this.shouldMove(e,t)&&e.moved(this.toSheet,this.toRight,this.toBottom)}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformColumnRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){return this.transformRange(e,t,n)}shouldMove(e,t){return e instanceof o.CellAddress?this.sourceRange.addressInRange(e.toSimpleCellAddress(t)):e instanceof i.RowAddress?this.sourceRange.rowInRange(e.toSimpleRowAddress(t))&&!this.sourceRange.isFinite():this.sourceRange.columnInRange(e.toSimpleColumnAddress(t))&&!this.sourceRange.isFinite()}transformRange(e,t,n){const r=this.transformCellAddress(e,n),o=this.transformCellAddress(t,n);return!(!r||!o)&&[r,o]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"RemoveColumnsTransformer",(function(){return i}));var r=n(17),o=n(121);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i extends o.Transformer{constructor(e){super(),this.columnsSpan=e}get sheet(){return this.columnsSpan.sheet}isIrreversible(){return!0}transformRowRangeAst(e,t){return e}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){throw Error("Not implemented")}transformColumnRange(e,t,n){return this.transformRange(e,t,n)}transformCellAddress(e,t){const n=Object(r.absoluteSheetReference)(e,t);if(this.columnsSpan.sheet!==t.sheet&&this.columnsSpan.sheet!==n)return!1;if(this.columnsSpan.sheet!==t.sheet&&this.columnsSpan.sheet===n){const n=e.toSimpleColumnAddress(t);if(n.col<this.columnsSpan.columnStart)return!1;if(n.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns)}if(this.columnsSpan.sheet===t.sheet&&this.columnsSpan.sheet!==n){if(e.isColumnAbsolute())return!1;if(t.col<this.columnsSpan.columnStart)return!1;if(t.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(this.columnsSpan.numberOfColumns)}if(this.columnsSpan.sheet===t.sheet&&this.columnsSpan.sheet===n)if(e.isColumnAbsolute()){if(e.col<this.columnsSpan.columnStart)return!1;if(e.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns)}else{const n=e.toSimpleColumnAddress(t);if(n.col<this.columnsSpan.columnStart){if(t.col<this.columnsSpan.columnStart)return!1;if(t.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(this.columnsSpan.numberOfColumns)}else if(n.col>this.columnsSpan.columnEnd){if(t.col<this.columnsSpan.columnStart)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns);if(t.col>this.columnsSpan.columnEnd)return!1}}return r.ErrorType.REF}fixNodeAddress(e){return this.columnsSpan.sheet===e.sheet&&this.columnsSpan.columnStart<=e.col?Object.assign(Object.assign({},e),{col:e.col-this.columnsSpan.numberOfColumns}):e}transformRange(e,t,n){const o=Object(r.absoluteSheetReference)(e,n);let i=e,a=t;if(this.columnsSpan.sheet===o){const o=e.toSimpleColumnAddress(n),s=t.toSimpleColumnAddress(n);if(this.columnsSpan.columnStart<=o.col&&this.columnsSpan.columnEnd>=s.col)return r.ErrorType.REF;o.col>=this.columnsSpan.columnStart&&o.col<=this.columnsSpan.columnEnd&&(i=e.shiftedByColumns(this.columnsSpan.columnEnd-o.col+1)),s.col>=this.columnsSpan.columnStart&&s.col<=this.columnsSpan.columnEnd&&(a=t.shiftedByColumns(-(s.col-this.columnsSpan.columnStart+1)))}const s=this.transformCellAddress(i,n),u=this.transformCellAddress(a,n);if(!1===s&&!1===u)return[i,a];if(s===r.ErrorType.REF||u===r.ErrorType.REF)throw Error("Cannot happen");return[s||i,u||a]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"RemoveSheetTransformer",(function(){return i}));var r=n(17),o=n(121);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i extends o.Transformer{constructor(e){super(),this.sheet=e}isIrreversible(){return!0}performEagerTransformations(e,t){for(const t of e.arrayFormulaNodes()){const[n]=this.transformSingleAst(t.getFormula(e.lazilyTransformingAstService),t.getAddress(e.lazilyTransformingAstService));t.setFormula(n)}}fixNodeAddress(e){return e}transformCellAddress(e,t){return this.transformAddress(e)}transformCellRange(e,t,n){return this.transformAddress(e)}transformColumnRange(e,t,n){return this.transformAddress(e)}transformRowRange(e,t,n){return this.transformAddress(e)}transformAddress(e){return e.sheet===this.sheet&&r.ErrorType.REF}}},function(e,t,n){"use strict";n.r(t),n.d(t,"Evaluator",(function(){return f}));var r=n(77),o=n(196),i=n(17),a=n(248),s=n(112),u=n(105),l=n(162),c=n(43),d=n(69),h=n(113);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class f{constructor(e,t,n,r,o,i){this.config=e,this.stats=t,this.interpreter=n,this.lazilyTransformingAstService=r,this.dependencyGraph=o,this.columnSearch=i}run(){this.stats.start(h.StatType.TOP_SORT);const{sorted:e,cycled:t}=this.dependencyGraph.topSortWithScc();this.stats.end(h.StatType.TOP_SORT),this.stats.measure(h.StatType.EVALUATION,()=>{this.recomputeFormulas(t,e)})}partialRun(e){const t=a.ContentChanges.empty();return this.stats.measure(h.StatType.EVALUATION,()=>{this.dependencyGraph.graph.getTopSortedWithSccSubgraphFrom(e,e=>{if(e instanceof u.FormulaVertex){const n=e.isComputed()?e.getCellValue():void 0,r=this.recomputeFormulaVertexValue(e);if(r!==n){const o=e.getAddress(this.lazilyTransformingAstService);return t.addChange(r,o),this.columnSearch.change(Object(c.getRawValue)(n),Object(c.getRawValue)(r),o),!0}return!1}return!(e instanceof s.RangeVertex)||(e.clearCache(),!0)},e=>{if(e instanceof s.RangeVertex)e.clearCache();else if(e instanceof u.FormulaVertex){const n=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.remove(Object(c.getRawValue)(e.valueOrUndef()),n);const r=new i.CellError(i.ErrorType.CYCLE,void 0,e);e.setCellValue(r),t.addChange(r,n)}})}),t}runAndForget(e,t,n){const i=[];for(const e of Object(o.absolutizeDependencies)(n,t))if(e instanceof r.AbsoluteCellRange){const t=e;if(void 0===this.dependencyGraph.getRange(t.start,t.end)){const e=new s.RangeVertex(t);this.dependencyGraph.rangeMapping.setRange(e),i.push(e)}}const a=this.evaluateAstToCellValue(e,new l.InterpreterState(t,this.config.useArrayArithmetic));return i.forEach(e=>{this.dependencyGraph.rangeMapping.removeRange(e)}),a}recomputeFormulas(e,t){e.forEach(e=>{e instanceof u.FormulaVertex&&e.setCellValue(new i.CellError(i.ErrorType.CYCLE,void 0,e))}),t.forEach(e=>{if(e instanceof u.FormulaVertex){const t=this.recomputeFormulaVertexValue(e),n=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.add(Object(c.getRawValue)(t),n)}else e instanceof s.RangeVertex&&e.clearCache()})}recomputeFormulaVertexValue(e){const t=e.getAddress(this.lazilyTransformingAstService);if(e instanceof s.ArrayVertex&&(e.array.size.isRef||!this.dependencyGraph.isThereSpaceForArray(e)))return e.setNoSpace();{const n=e.getFormula(this.lazilyTransformingAstService),r=this.evaluateAstToCellValue(n,new l.InterpreterState(t,this.config.useArrayArithmetic,e));return e.setCellValue(r)}}evaluateAstToCellValue(e,t){const n=this.interpreter.evaluateAst(e,t);return n instanceof d.SimpleRangeValue?n:n===c.EmptyValue&&this.config.evaluateNullToZero?0:n}}},function(e,t,n){"use strict";n.r(t),n.d(t,"GraphBuilder",(function(){return c})),n.d(t,"SimpleStrategy",(function(){return d}));var r=n(196),o=n(99),i=n(17),a=n(165),s=n(112),u=n(43),l=n(113);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class c{constructor(e,t,n,r,o,i){this.dependencyGraph=e,this.columnSearch=t,this.parser=n,this.cellContentParser=r,this.stats=o,this.arraySizePredictor=i,this.buildStrategy=new d(e,t,n,o,r,i)}buildGraph(e,t){const n=t.measure(l.StatType.COLLECT_DEPENDENCIES,()=>this.buildStrategy.run(e));this.dependencyGraph.getAndClearContentChanges(),t.measure(l.StatType.PROCESS_DEPENDENCIES,()=>this.processDependencies(n))}processDependencies(e){e.forEach((e,t)=>{this.dependencyGraph.processCellDependencies(e,t)})}}class d{constructor(e,t,n,r,o,i){this.dependencyGraph=e,this.columnIndex=t,this.parser=n,this.stats=r,this.cellContentParser=o,this.arraySizePredictor=i}run(e){const t=new Map;for(const n in e){const c=this.dependencyGraph.getSheetId(n),d=e[n];for(let e=0;e<d.length;++e){const n=d[e];for(let d=0;d<n.length;++d){const h=n[d],f=Object(i.simpleCellAddress)(c,d,e),p=this.cellContentParser.parse(h);if(p instanceof a.CellContent.Formula){const e=this.stats.measure(l.StatType.PARSER,()=>this.parser.parse(p.formula,f));if(e.errors.length>0){this.shrinkArrayIfNeeded(f);const t=new s.ParsingErrorVertex(e.errors,p.formula);this.dependencyGraph.addVertex(f,t)}else{this.shrinkArrayIfNeeded(f);const n=this.arraySizePredictor.checkArraySize(e.ast,f);if(n.isScalar()){const n=new s.FormulaCellVertex(e.ast,f,0);t.set(n,Object(r.absolutizeDependencies)(e.dependencies,f)),this.dependencyGraph.addVertex(f,n),e.hasVolatileFunction&&this.dependencyGraph.markAsVolatile(n),e.hasStructuralChangeFunction&&this.dependencyGraph.markAsDependentOnStructureChange(n)}else{const i=new s.ArrayVertex(e.ast,f,new o.ArraySize(n.width,n.height));t.set(i,Object(r.absolutizeDependencies)(e.dependencies,f)),this.dependencyGraph.addArrayVertex(f,i)}}}else if(p instanceof a.CellContent.Empty);else{this.shrinkArrayIfNeeded(f);const e=new s.ValueCellVertex(p.value,h);this.columnIndex.add(Object(u.getRawValue)(p.value),f),this.dependencyGraph.addVertex(f,e)}}}}return t}shrinkArrayIfNeeded(e){const t=this.dependencyGraph.getCell(e);t instanceof s.ArrayVertex&&this.dependencyGraph.shrinkArrayToCorner(t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"VersionPlugin",(function(){return a}));var r=n(164),o=n(26);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
const i=new Map([["gpl-v3",1],["missing",2],["invalid",3],["expired",4]]);class a extends o.FunctionPlugin{version(e,t){return this.runFunction(e.args,t,this.metadata("VERSION"),()=>{const{licenseKeyValidityState:e,licenseKey:t}=this.config;let n;return i.has(t)?n=i.get(t):i.has(e)?n=i.get(e):"valid"===e&&(n=t.slice(-5)),`HyperFormula v${r.HyperFormula.version}, ${n}`})}}a.implementedFunctions={VERSION:{method:"version",parameters:[]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"Interpreter",(function(){return p}));var r=n(77),o=n(328),i=n(17),a=n(33),s=n(93),u=n(101),l=n(675),c=n(263),d=n(162),h=n(43),f=n(69);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class p{constructor(e,t,n,r,o,i,a,s,c,d){this.config=e,this.dependencyGraph=t,this.columnSearch=n,this.stats=r,this.arithmeticHelper=o,this.functionRegistry=i,this.namedExpressions=a,this.serialization=s,this.arraySizePredictor=c,this.dateTimeHelper=d,this.equalOp=(e,t)=>m(this.arithmeticHelper.eq,e,t),this.notEqualOp=(e,t)=>m(this.arithmeticHelper.neq,e,t),this.greaterThanOp=(e,t)=>m(this.arithmeticHelper.gt,e,t),this.lessThanOp=(e,t)=>m(this.arithmeticHelper.lt,e,t),this.greaterThanOrEqualOp=(e,t)=>m(this.arithmeticHelper.geq,e,t),this.lessThanOrEqualOp=(e,t)=>m(this.arithmeticHelper.leq,e,t),this.concatOp=(e,t)=>m(this.arithmeticHelper.concat,Object(u.coerceScalarToString)(e),Object(u.coerceScalarToString)(t)),this.plusOp=(e,t)=>m(this.arithmeticHelper.addWithEpsilon,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.minusOp=(e,t)=>m(this.arithmeticHelper.subtract,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.timesOp=(e,t)=>m(this.arithmeticHelper.multiply,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.powerOp=(e,t)=>m(this.arithmeticHelper.pow,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.divOp=(e,t)=>m(this.arithmeticHelper.divide,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.unaryMinusOp=e=>g(this.arithmeticHelper.unaryMinus,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.percentOp=e=>g(this.arithmeticHelper.unaryPercent,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.unaryPlusOp=e=>this.arithmeticHelper.unaryPlus(e),this.functionRegistry.initializePlugins(this),this.criterionBuilder=new l.CriterionBuilder(e)}evaluateAst(e,t){let n=this.evaluateAstWithoutPostprocessing(e,t);if(Object(h.isExtendedNumber)(n)){if(Object(u.isNumberOverflow)(Object(h.getRawValue)(n)))return new i.CellError(i.ErrorType.NUM,a.ErrorMessage.NaN);n=Object(h.cloneNumber)(n,Object(u.fixNegativeZero)(Object(h.getRawValue)(n)))}return n instanceof f.SimpleRangeValue&&1===n.height()&&1===n.width()&&([[n]]=n.data),function(e,t){if(e instanceof i.CellError&&void 0!==t)return e.attachRootVertex(t);return e}(n,t.formulaVertex)}evaluateAstWithoutPostprocessing(e,t){switch(e.type){case s.AstNodeType.EMPTY:return h.EmptyValue;case s.AstNodeType.CELL_REFERENCE:{const n=e.reference.toSimpleCellAddress(t.formulaAddress);return Object(i.invalidSimpleCellAddress)(n)?new i.CellError(i.ErrorType.REF,a.ErrorMessage.BadRef):this.dependencyGraph.getCellValue(n)}case s.AstNodeType.NUMBER:case s.AstNodeType.STRING:return e.value;case s.AstNodeType.CONCATENATE_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.concatOp,n,r,t)}case s.AstNodeType.EQUALS_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.equalOp,n,r,t)}case s.AstNodeType.NOT_EQUAL_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.notEqualOp,n,r,t)}case s.AstNodeType.GREATER_THAN_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOp,n,r,t)}case s.AstNodeType.LESS_THAN_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOp,n,r,t)}case s.AstNodeType.GREATER_THAN_OR_EQUAL_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOrEqualOp,n,r,t)}case s.AstNodeType.LESS_THAN_OR_EQUAL_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOrEqualOp,n,r,t)}case s.AstNodeType.PLUS_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.plusOp,n,r,t)}case s.AstNodeType.MINUS_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.minusOp,n,r,t)}case s.AstNodeType.TIMES_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.timesOp,n,r,t)}case s.AstNodeType.POWER_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.powerOp,n,r,t)}case s.AstNodeType.DIV_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.divOp,n,r,t)}case s.AstNodeType.PLUS_UNARY_OP:{const n=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryPlusOp,n,t)}case s.AstNodeType.MINUS_UNARY_OP:{const n=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryMinusOp,n,t)}case s.AstNodeType.PERCENT_OP:{const n=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.percentOp,n,t)}case s.AstNodeType.FUNCTION_CALL:{if("valLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/!function(e){e.GREATER_THAN="GREATER_THAN",e.GREATER_THAN_OR_EQUAL="GREATER_THAN_OR_EQUAL",e.LESS_THAN="LESS_THAN",e.LESS_THAN_OR_EQUAL="LESS_THAN_OR_EQUAL",e.NOT_EQUAL="NOT_EQUAL",e.EQUAL="EQUAL"}(r||(r={}));const i=(e,t)=>({operator:e,value:t});class a{constructor(e){var t,n,r,o;this.trueString=null!==(n=null===(t=e.translationPackage.getMaybeFunctionTranslation("TRUE"))||void 0===t?void 0:t.toLowerCase())&&void 0!==n?n:"true",this.falseString=null!==(o=null===(r=e.translationPackage.getMaybeFunctionTranslation("FALSE"))||void 0===r?void 0:r.toLowerCase())&&void 0!==o?o:"false"}fromCellValue(e,t){if("string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e)return;const n=this.parseCriterion(e,t);return void 0!==n?{raw:e,lambda:u(n,t)}:void 0}parseCriterion(e,t){if("number"==typeof e||"boolean"==typeof e)return i(r.EQUAL,e);if("string"==typeof e){const n=s.exec(e);let a,u;n?(u=function(e){switch(e){case">":return r.GREATER_THAN;case">=":return r.GREATER_THAN_OR_EQUAL;case"<":return r.LESS_THAN;case"<=":return r.LESS_THAN_OR_EQUAL;case"<>":return r.NOT_EQUAL;case"=":return r.EQUAL;default:return}}(n[1]),a=n[2]):(u=r.EQUAL,a=e);const l=t.coerceToMaybeNumber(a),c=a.toLowerCase()===this.trueString||a.toLowerCase()!==this.falseString&&void 0;if(void 0===u)return;if(""===a)return i(u,null);if(void 0!==l)return i(u,Object(o.getRawValue)(l));if(u===r.EQUAL||u===r.NOT_EQUAL)return i(u,null!=c?c:a)}}}const s=/([<>=]+)(.*)/;const u=(e,t)=>{switch(e.operator){case r.GREATER_THAN:return"number"==typeof e.value?n=>"number"==typeof n&&t.floatCmp(n,e.value)>0:e=>!1;case r.GREATER_THAN_OR_EQUAL:return"number"==typeof e.value?n=>"number"==typeof n&&t.floatCmp(n,e.value)>=0:e=>!1;case r.LESS_THAN:return"number"==typeof e.value?n=>"number"==typeof n&&t.floatCmp(n,e.value)<0:e=>!1;case r.LESS_THAN_OR_EQUAL:return"number"==typeof e.value?n=>"number"==typeof n&&t.floatCmp(n,e.value)<=0:e=>!1;case r.EQUAL:return"number"==typeof e.value?n=>{if("number"==typeof n)return 0===t.floatCmp(n,e.value);if("string"==typeof n){if(""===n)return!1;const r=t.coerceToMaybeNumber(n);return void 0!==r&&0===t.floatCmp(r,e.value)}return!1}:"string"==typeof e.value?t.eqMatcherFunction(e.value):"boolean"==typeof e.value?t=>"boolean"==typeof t&&t===e.value:e=>e===o.EmptyValue;case r.NOT_EQUAL:return"number"==typeof e.value?n=>{if("number"==typeof n)return 0!==t.floatCmp(n,e.value);if("string"==typeof n){if(""===n)return!0;const r=t.coerceToMaybeNumber(n);return void 0===r||0!==t.floatCmp(r,e.value)}return!0}:"string"==typeof e.value?t.neqMatcherFunction(e.value):"boolean"==typeof e.value?t=>"boolean"!=typeof t||t!==e.value:e=>e!==o.EmptyValue}}},function(e,t,n){"use strict";n.r(t),n.d(t,"LazilyTransformingAstService",(function(){return i}));var r=n(677),o=n(113);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class i{constructor(e){this.stats=e,this.transformations=[]}version(){return this.transformations.length}addTransformation(e){return void 0!==this.combinedTransformer?this.combinedTransformer.add(e):this.transformations.push(e),this.version()}beginCombinedMode(e){this.combinedTransformer=new r.CombinedTransformer(e)}commitCombinedMode(){if(void 0===this.combinedTransformer)throw Error("Combined mode wasn't started");return this.transformations.push(this.combinedTransformer),this.combinedTransformer=void 0,this.version()}applyTransformations(e,t,n){this.stats.start(o.StatType.TRANSFORM_ASTS_POSTPONED);for(let r=n;r<this.transformations.length;r++){const n=this.transformations[r];n.isIrreversible()&&(this.undoRedo.storeDataForVersion(r,t,this.parser.computeHashFromAst(e)),this.parser.rememberNewAst(e));const[o,i]=n.transformSingleAst(e,t);e=o,t=i}const r=this.parser.rememberNewAst(e);return this.stats.end(o.StatType.TRANSFORM_ASTS_POSTPONED),[r,t,this.transformations.length]}*getTransformationsFrom(e,t){for(let n=e;n<this.transformations.length;n++){const e=this.transformations[n];t&&!t(e)||(yield e)}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CombinedTransformer",(function(){return r}));
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class r{constructor(e){this.sheet=e,this.transformations=[]}add(e){this.transformations.push(e)}performEagerTransformations(e,t){this.transformations.forEach(n=>n.performEagerTransformations(e,t))}transformSingleAst(e,t){let[n,r]=[e,t];return this.transformations.forEach(e=>{[n,r]=e.transformSingleAst(n,r)}),[n,r]}isIrreversible(){return!0}}},function(e,t,n){"use strict";n.r(t),n.d(t,"buildColumnSearchStrategy",(function(){return i}));var r=n(338),o=n(680);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function i(e,t,n){return t.useColumnIndex?new o.ColumnIndex(e,t,n):new r.ColumnBinarySearch(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"findLastOccurrenceInOrderedRange",(function(){return i})),n.d(t,"findLastOccurrenceInOrderedArray",(function(){return a})),n.d(t,"findLastMatchingIndex",(function(){return s})),n.d(t,"compare",(function(){return u}));var r=n(17),o=n(43);function i(e,t,{searchCoordinate:n,orderingDirection:i,matchExactly:a},l){const c=t.start[n],d="col"===n?t.effectiveEndColumn(l):t.effectiveEndRow(l),h="col"===n?e=>Object(o.getRawValue)(l.getCellValue(Object(r.simpleCellAddress)(t.sheet,e,t.start.row))):e=>Object(o.getRawValue)(l.getCellValue(Object(r.simpleCellAddress)(t.sheet,t.start.col,e))),f="asc"===i?(e,t)=>u(e,t):(e,t)=>-u(e,t),p=s(t=>f(e,h(t))>=0,c,d),g=h(p);return-1===p||typeof g!=typeof e||a&&g!==e?-1:p-c}function a(e,t,n="asc"){return s("asc"===n?n=>u(e,t[n])>=0:n=>-u(e,t[n])>=0,0,t.length-1)}function s(e,t,n){let r=t,o=n;for(;r<o;){const t=Math.ceil((r+o)/2);e(t)?r=t:o=t-1}return r===o&&e(r)?r:-1}function u(e,t){return typeof e==typeof t?e===o.EmptyValue?0:e<t?-1:e>t?1:0:e===o.EmptyValue?-1:t===o.EmptyValue?1:t instanceof r.CellError||"number"==typeof e&&"string"==typeof t||"number"==typeof e&&"boolean"==typeof t?-1:"string"==typeof e&&"number"==typeof t?1:"string"==typeof e&&"boolean"==typeof t?-1:1}},function(e,t,n){"use strict";n.r(t),n.d(t,"ColumnIndex",(function(){return d})),n.d(t,"findInOrderedArray",(function(){return h}));var r=n(17),o=n(335),i=n(336),a=n(101),s=n(43),u=n(69),l=n(113),c=n(338);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class d{constructor(e,t,n){this.dependencyGraph=e,this.config=t,this.stats=n,this.index=new Map,this.transformingService=this.dependencyGraph.lazilyTransformingAstService,this.binarySearchStrategy=new c.ColumnBinarySearch(e)}add(e,t){if(!(e===s.EmptyValue||e instanceof r.CellError))if(e instanceof u.SimpleRangeValue)for(const[n,r]of e.entriesFromTopLeftCorner(t))this.addSingleCellValue(Object(s.getRawValue)(n),r);else this.addSingleCellValue(e,t)}remove(e,t){if(void 0!==e)if(e instanceof u.SimpleRangeValue)for(const[n,r]of e.entriesFromTopLeftCorner(t))this.removeSingleValue(Object(s.getRawValue)(n),r);else this.removeSingleValue(e,t)}change(e,t,n){e!==t&&(this.remove(e,n),this.add(t,n))}applyChanges(e){for(const t of e)void 0!==t.oldValue&&this.change(Object(s.getRawValue)(t.oldValue),Object(s.getRawValue)(t.value),t.address)}moveValues(e,t,n,o){for(const[i,a]of e){const e=Object(r.movedSimpleCellAddress)(a,o,t,n);this.remove(i,a),this.add(i,e)}}removeValues(e){for(const[t,n]of e)this.remove(t,n)}find(e,t,{ordering:n,matchExactly:r}){const o=!0===r?"findFirst":"findLast",i=this.findUsingColumnIndex(e,t,o);return void 0!==i?i:this.binarySearchStrategy.find(e,t,{ordering:n,matchExactly:r})}findUsingColumnIndex(e,t,n){const r=t.range;if(void 0===r)return;this.ensureRecentData(r.sheet,r.start.col,e);const o=this.getColumnMap(r.sheet,r.start.col);if(!o)return-1;const i="string"==typeof e?Object(a.forceNormalizeString)(e):e,s=o.get(i);if(!s||!s.index||0===s.index.length)return;const u=d.findRowBelongingToRange(s,r,n);return void 0!==u?u-r.start.row:void 0}static findRowBelongingToRange(e,t,n){const r=t.start.row,o=t.end.row,i="findFirst"===n?h(r,e.index,"upperBound"):h(o,e.index,"lowerBound");if(-1===i)return;const a=e.index[i];return a>=r&&a<=o?a:void 0}advancedFind(e,t){return this.binarySearchStrategy.advancedFind(e,t)}addColumns(e){const t=this.index.get(e.sheet);t&&t.splice(e.columnStart,0,...Array(e.numberOfColumns))}removeColumns(e){const t=this.index.get(e.sheet);t&&t.splice(e.columnStart,e.numberOfColumns)}removeSheet(e){this.index.delete(e)}getColumnMap(e,t){this.index.has(e)||this.index.set(e,[]);const n=this.index.get(e);let r=n[t];return r||(r=new Map,n[t]=r),r}getValueIndex(e,t,n){const r=this.getColumnMap(e,t);let o=this.getColumnMap(e,t).get(n);return o||(o={version:this.transformingService.version(),index:[]},r.set(n,o)),o}ensureRecentData(e,t,n){const r=this.getValueIndex(e,t,n),a=this.transformingService.version();if(r.version===a)return;const s=this.transformingService.getTransformationsFrom(r.version,t=>t.sheet===e&&(t instanceof o.AddRowsTransformer||t instanceof i.RemoveRowsTransformer));for(const e of s)e instanceof o.AddRowsTransformer?this.addRows(t,e.rowsSpan,n):e instanceof i.RemoveRowsTransformer&&this.removeRows(t,e.rowsSpan,n);r.version=a}addSingleCellValue(e,t){this.stats.measure(l.StatType.BUILD_COLUMN_INDEX,()=>{this.ensureRecentData(t.sheet,t.col,e),"string"==typeof e&&(e=Object(a.forceNormalizeString)(e));const n=this.getValueIndex(t.sheet,t.col,e);d.addValue(n,t.row)})}removeSingleValue(e,t){this.stats.measure(l.StatType.BUILD_COLUMN_INDEX,()=>{this.ensureRecentData(t.sheet,t.col,e);const n=this.getColumnMap(t.sheet,t.col);"string"==typeof e&&(e=Object(a.forceNormalizeString)(e));const r=n.get(e);if(!r)return;const o=h(t.row,r.index);o>-1&&r.index.splice(o,1),0===r.index.length&&n.delete(e),0===n.size&&delete this.index.get(t.sheet)[t.col]})}addRows(e,t,n){const r=this.getValueIndex(t.sheet,e,n);d.shiftRows(r,t.rowStart,t.numberOfRows)}removeRows(e,t,n){const r=this.getValueIndex(t.sheet,e,n);d.removeRowsFromValues(r,t),d.shiftRows(r,t.rowEnd+1,-t.numberOfRows)}static addValue(e,t){const n=h(t,e.index,"lowerBound");e.index[n]===t||e.index.splice(n+1,0,t)}static removeRowsFromValues(e,t){const n=h(t.rowStart,e.index,"upperBound"),r=h(t.rowEnd,e.index,"lowerBound");n>-1&&r>-1&&n<=r&&e.index[n]<=t.rowEnd&&e.index.splice(n,r-n+1)}static shiftRows(e,t,n){const r=h(t,e.index,"upperBound");if(-1!==r)for(let t=r;t<e.index.length;++t)e.index[t]+=n}}function h(e,t,n="upperBound"){let r=0,o=t.length-1;for(;r<=o;){const n=Math.floor((r+o)/2);if(e>t[n])r=n+1;else{if(!(e<t[n]))return n;o=n-1}}const i="lowerBound"===n?o:r;return i>=0&&i<=t.length?i:-1}},function(e,t,n){"use strict";n.r(t),n.d(t,"NumberLiteralHelper",(function(){return r}));
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class r{constructor(e){this.config=e;const t="."===this.config.thousandSeparator?"\\"+this.config.thousandSeparator:this.config.thousandSeparator,n="."===this.config.decimalSeparator?"\\"+this.config.decimalSeparator:this.config.decimalSeparator;this.numberPattern=new RegExp(`^([+-]?((${n}\\d+)|(\\d+(${t}\\d{3,})*(${n}\\d*)?)))(e[+-]?\\d+)?$`),this.allThousandSeparatorsRegex=new RegExp(""+t,"g")}numericStringToMaybeNumber(e){if(this.numberPattern.test(e)){const t=this.numericStringToNumber(e);if(isNaN(t))return;return t}}numericStringToNumber(e){const t=e.replace(this.allThousandSeparatorsRegex,"").replace(this.config.decimalSeparator,".");return Number(t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"Serialization",(function(){return a}));var r=n(17),o=n(112),i=n(61);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
class a{constructor(e,t,n){this.dependencyGraph=e,this.unparser=t,this.exporter=n}getCellHyperlink(e){const t=this.dependencyGraph.getCell(e);if(t instanceof o.FormulaCellVertex){const e=t.getFormula(this.dependencyGraph.lazilyTransformingAstService);if("HYPERLINK"===e.procedureName)return e.hyperlink}}getCellFormula(e,t){const n=this.dependencyGraph.getCell(e);if(n instanceof o.FormulaCellVertex){const r=n.getFormula(this.dependencyGraph.lazilyTransformingAstService);return t=null!=t?t:e,this.unparser.unparse(r,t)}if(n instanceof o.ArrayVertex){const r=n.getAddress(this.dependencyGraph.lazilyTransformingAstService);if(r.row!==e.row||r.col!==e.col||r.sheet!==e.sheet)return;t=null!=t?t:e;const o=n.getFormula(this.dependencyGraph.lazilyTransformingAstService);if(void 0!==o)return this.unparser.unparse(o,t)}else if(n instanceof o.ParsingErrorVertex)return n.getFormula()}getCellSerialized(e,t){var n;return null!==(n=this.getCellFormula(e,t))&&void 0!==n?n:this.getRawValue(e)}getCellValue(e){return this.exporter.exportValue(this.dependencyGraph.getScalarValue(e))}getRawValue(e){return this.dependencyGraph.getRawValue(e)}getSheetValues(e){return this.genericSheetGetter(e,e=>this.getCellValue(e))}getSheetFormulas(e){return this.genericSheetGetter(e,e=>this.getCellFormula(e))}genericSheetGetter(e,t){const n=this.dependencyGraph.getSheetHeight(e),o=this.dependencyGraph.getSheetWidth(e),i=new Array(n);for(let a=0;a<n;a++){i[a]=new Array(o);for(let n=0;n<o;n++){const o=Object(r.simpleCellAddress)(e,n,a);i[a][n]=t(o)}for(let e=o-1;e>=0&&(null===i[a][e]||void 0===i[a][e]);e--)i[a].pop()}for(let e=n-1;e>=0&&0===i[e].length;e--)i.pop();return i}genericAllSheetsGetter(e){const t={};for(const n of this.dependencyGraph.sheetMapping.displayNames()){const r=this.dependencyGraph.sheetMapping.fetch(n);t[n]=e(r)}return t}getSheetSerialized(e){return this.genericSheetGetter(e,e=>this.getCellSerialized(e))}getAllSheetsValues(){return this.genericAllSheetsGetter(e=>this.getSheetValues(e))}getAllSheetsFormulas(){return this.genericAllSheetsGetter(e=>this.getSheetFormulas(e))}getAllSheetsSerialized(){return this.genericAllSheetsGetter(e=>this.getSheetSerialized(e))}getAllNamedExpressionsSerialized(){const e=[];let t=0;for(const n of this.dependencyGraph.sheetMapping.displayNames()){const r=this.dependencyGraph.sheetMapping.fetch(n);e[r]=t,t++}return this.dependencyGraph.namedExpressions.getAllNamedExpressions().map(t=>({name:t.expression.displayName,expression:this.getCellSerialized(t.expression.address),scope:void 0!==t.scope?e[t.scope]:void 0,options:t.expression.options}))}withNewConfig(e,t){const n=new i.Unparser(e,Object(i.buildLexerConfig)(e),this.dependencyGraph.sheetMapping.fetchDisplayName,t);return new a(this.dependencyGraph,n,this.exporter)}}},function(e,t,n){"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function r(e){for(const[t,n]of Object.entries(e))n instanceof Function?e[t]=o(n):delete e[t]}function o(e){return()=>{throw new Error(`The "${e}" method cannot be called because this HyperFormula instance has been destroyed`)}}n.r(t),n.d(t,"objectDestroy",(function(){return r}))},function(e,t,n){"use strict";n.r(t),n.d(t,"Events",(function(){return r})),n.d(t,"Emitter",(function(){return i}));var r,o=n(685);!function(e){e.SheetAdded="sheetAdded",e.SheetRemoved="sheetRemoved",e.SheetRenamed="sheetRenamed",e.NamedExpressionAdded="namedExpressionAdded",e.NamedExpressionRemoved="namedExpressionRemoved",e.ValuesUpdated="valuesUpdated",e.EvaluationSuspended="evaluationSuspended",e.EvaluationResumed="evaluationResumed"}(r||(r={}));class i extends o.TinyEmitter{emit(e,...t){return super.emit(e,...t),this}}},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=n,e.exports.TinyEmitter=n},function(e,t,n){"use strict";n.r(t);t.default={errors:{CYCLE:"#CYCLE!",DIV_BY_ZERO:"#DIV/0!",ERROR:"#ERROR!",NA:"#N/A",NAME:"#NAME?",NUM:"#NUM!",REF:"#REF!",SPILL:"#SPILL!",VALUE:"#VALUE!"},functions:{FILTER:"FILTER",ADDRESS:"ADDRESS",ARRAY_CONSTRAIN:"ARRAY_CONSTRAIN",ARRAYFORMULA:"ARRAYFORMULA",ABS:"ABS",ACOS:"ACOS",ACOSH:"ACOSH",ACOT:"ACOT",ACOTH:"ACOTH",AND:"AND",ARABIC:"ARABIC",ASIN:"ASIN",ASINH:"ASINH",ATAN2:"ATAN2",ATAN:"ATAN",ATANH:"ATANH",AVERAGE:"AVERAGE",AVERAGEA:"AVERAGEA",AVERAGEIF:"AVERAGEIF",BASE:"BASE",BIN2DEC:"BIN2DEC",BIN2HEX:"BIN2HEX",BIN2OCT:"BIN2OCT",BITAND:"BITAND",BITLSHIFT:"BITLSHIFT",BITOR:"BITOR",BITRSHIFT:"BITRSHIFT",BITXOR:"BITXOR",CEILING:"CEILING",CHAR:"CHAR",CHOOSE:"CHOOSE",CLEAN:"CLEAN",CODE:"CODE",COLUMN:"COLUMN",COLUMNS:"COLUMNS",CONCATENATE:"CONCATENATE",CORREL:"CORREL",COS:"COS",COSH:"COSH",COT:"COT",COTH:"COTH",COUNT:"COUNT",COUNTA:"COUNTA",COUNTBLANK:"COUNTBLANK",COUNTIF:"COUNTIF",COUNTIFS:"COUNTIFS",COUNTUNIQUE:"COUNTUNIQUE",CSC:"CSC",CSCH:"CSCH",CUMIPMT:"CUMIPMT",CUMPRINC:"CUMPRINC",DATE:"DATE",DATEDIF:"DATEDIF",DATEVALUE:"DATEVALUE",DAY:"DAY",DAYS360:"DAYS360",DAYS:"DAYS",DB:"DB",DDB:"DDB",DEC2BIN:"DEC2BIN",DEC2HEX:"DEC2HEX",DEC2OCT:"DEC2OCT",DECIMAL:"DECIMAL",DEGREES:"DEGREES",DELTA:"DELTA",DOLLARDE:"DOLLARDE",DOLLARFR:"DOLLARFR",EDATE:"EDATE",EFFECT:"EFFECT",EOMONTH:"EOMONTH",ERF:"ERF",ERFC:"ERFC",EVEN:"EVEN",EXACT:"EXACT",EXP:"EXP",FALSE:"FALSE",FIND:"FIND",FORMULATEXT:"FORMULATEXT",FV:"FV",FVSCHEDULE:"FVSCHEDULE",HEX2BIN:"HEX2BIN",HEX2DEC:"HEX2DEC",HEX2OCT:"HEX2OCT",HLOOKUP:"HLOOKUP",HOUR:"HOUR",HYPERLINK:"HYPERLINK",IF:"IF",IFERROR:"IFERROR",IFNA:"IFNA",IFS:"IFS",INDEX:"INDEX",INT:"INT",INTERVAL:"INTERVAL",IPMT:"IPMT",ISBINARY:"ISBINARY",ISBLANK:"ISBLANK",ISERR:"ISERR",ISERROR:"ISERROR",ISEVEN:"ISEVEN",ISFORMULA:"ISFORMULA",ISLOGICAL:"ISLOGICAL",ISNA:"ISNA",ISNONTEXT:"ISNONTEXT",ISNUMBER:"ISNUMBER",ISODD:"ISODD",ISOWEEKNUM:"ISOWEEKNUM",ISPMT:"ISPMT",ISREF:"ISREF",ISTEXT:"ISTEXT",LEFT:"LEFT",LEN:"LEN",LN:"LN",LOG10:"LOG10",LOG:"LOG",LOWER:"LOWER",MATCH:"MATCH",MAX:"MAX",MAXA:"MAXA",MAXIFS:"MAXIFS",MAXPOOL:"MAXPOOL",MEDIAN:"MEDIAN",MEDIANPOOL:"MEDIANPOOL",MID:"MID",MIN:"MIN",MINA:"MINA",MINIFS:"MINIFS",MINUTE:"MINUTE",MIRR:"MIRR",MMULT:"MMULT",MOD:"MOD",MONTH:"MONTH",NA:"NA",NETWORKDAYS:"NETWORKDAYS","NETWORKDAYS.INTL":"NETWORKDAYS.INTL",NOMINAL:"NOMINAL",NOT:"NOT",NOW:"NOW",NPER:"NPER",NPV:"NPV",OCT2BIN:"OCT2BIN",OCT2DEC:"OCT2DEC",OCT2HEX:"OCT2HEX",ODD:"ODD",OFFSET:"OFFSET",OR:"OR",PI:"PI",PMT:"PMT",PDURATION:"PDURATION",PRODUCT:"PRODUCT",POWER:"POWER",PPMT:"PPMT",PROPER:"PROPER",PV:"PV",RADIANS:"RADIANS",RAND:"RAND",RATE:"RATE",REPLACE:"REPLACE",REPT:"REPT",RIGHT:"RIGHT",ROMAN:"ROMAN",ROUND:"ROUND",ROUNDDOWN:"ROUNDDOWN",ROUNDUP:"ROUNDUP",ROW:"ROW",ROWS:"ROWS",RRI:"RRI",SEARCH:"SEARCH",SEC:"SEC",SECH:"SECH",SECOND:"SECOND",SHEET:"SHEET",SHEETS:"SHEETS",SIN:"SIN",SINH:"SINH",SLN:"SLN",SPLIT:"SPLIT",SQRT:"SQRT",STDEVA:"STDEVA","STDEV.P":"STDEV.P",STDEVPA:"STDEVPA","STDEV.S":"STDEV.S",SUBSTITUTE:"SUBSTITUTE",SUBTOTAL:"SUBTOTAL",SUM:"SUM",SUMIF:"SUMIF",SUMIFS:"SUMIFS",SUMPRODUCT:"SUMPRODUCT",SUMSQ:"SUMSQ",SWITCH:"SWITCH",SYD:"SYD",T:"T",TAN:"TAN",TANH:"TANH",TBILLEQ:"TBILLEQ",TBILLPRICE:"TBILLPRICE",TBILLYIELD:"TBILLYIELD",TEXT:"TEXT",TIME:"TIME",TIMEVALUE:"TIMEVALUE",TODAY:"TODAY",TRANSPOSE:"TRANSPOSE",TRIM:"TRIM",TRUE:"TRUE",TRUNC:"TRUNC",UNICHAR:"UNICHAR",UNICODE:"UNICODE",UPPER:"UPPER",VARA:"VARA","VAR.P":"VAR.P",VARPA:"VARPA","VAR.S":"VAR.S",VLOOKUP:"VLOOKUP",WEEKDAY:"WEEKDAY",WEEKNUM:"WEEKNUM",WORKDAY:"WORKDAY","WORKDAY.INTL":"WORKDAY.INTL",XNPV:"XNPV",XOR:"XOR",YELine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/
|
||||
function*r(){}function o(e){const t=e[Symbol.iterator](),{done:n,value:o}=t.next();return n?{rest:r()}:{value:o,rest:t}}function i(e){const t=e[Symbol.iterator](),{done:n,value:r}=t.next();if(!n)return r}n.r(t),n.d(t,"empty",(function(){return r})),n.d(t,"split",(function(){return o})),n.d(t,"first",(function(){return i}))},function(e,t,n){"use strict";n.r(t),n.d(t,"RowSearchStrategy",(function(){return o}));var r=n(339);
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2023 Handsoncode. All rights reserved.
|
||||
*/class o extends r.AdvancedFind{constructor(e){super(e),this.dependencyGraph=e}find(e,t,n){return this.basicFind(e,t,"col",n)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"besselj",(function(){return T})),n.d(t,"bessely",(function(){return C})),n.d(t,"besseli",(function(){return R})),n.d(t,"besselk",(function(){return w}));
|
||||
/**
|
||||
* @license
|
||||
bessel.js (C) 2013-present SheetJS -- http://sheetjs.com
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright (C) 2013-present SheetJS LLC
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
var r=Math;function o(e,t){for(var n=0,r=0;n<e.length;++n)r=t*r+e[n];return r}function i(e,t,n,r,o){if(0===t)return n;if(1===t)return r;for(var i=2/e,a=r,s=1;s<t;++s)a=r*s*i+o*n,n=r,r=a;return a}function a(e,t,n,r,o){return function(n,a){if(r){if(0===n)return 1==r?-1/0:1/0;if(n<0)return NaN}return 0===a?e(n):1===a?t(n):a<0?NaN:i(n,a|=0,e(n),t(n),o)}}var s,u,l,c,d,h,f,p,g,m,v,y,E,T=function(){var e=.636619772,t=[57568490574,-13362590354,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse(),n=[57568490411,1029532985,9494680.718,59272.64853,267.8532712,1].reverse(),a=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),s=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34935152e-8].reverse();function u(i){var u=0,l=0,c=0,d=i*i;if(i<8)u=(l=o(t,d))/(c=o(n,d));else{var h=i-.785398164;l=o(a,d=64/d),c=o(s,d),u=r.sqrt(e/i)*(r.cos(h)*l-r.sin(h)*c*8/i)}return u}var l=[72362614232,-7895059235,242396853.1,-2972611.439,15704.4826,-30.16036606].reverse(),c=[144725228442,2300535178,18583304.74,99447.43394,376.9991397,1].reverse(),d=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),h=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse();function f(t){var n=0,i=0,a=0,s=t*t,u=r.abs(t)-2.356194491;return Math.abs(t)<8?n=(i=t*o(l,s))/(a=o(c,s)):(i=o(d,s=64/s),a=o(h,s),n=r.sqrt(e/r.abs(t))*(r.cos(u)*i-r.sin(u)*a*8/r.abs(t)),t<0&&(n=-n)),n}return function e(t,n){if(n=Math.round(n),!isFinite(t))return isNaN(t)?t:0;if(n<0)return(n%2?-1:1)*e(t,-n);if(t<0)return(n%2?-1:1)*e(-t,n);if(0===n)return u(t);if(1===n)return f(t);if(0===t)return 0;var o=0;if(t>n)o=i(t,n,u(t),f(t),-1);else{for(var a=!1,s=0,l=0,c=1,d=0,h=2/t,p=2*r.floor((n+r.floor(r.sqrt(40*n)))/2);p>0;p--)d=p*h*c-s,s=c,c=d,r.abs(c)>1e10&&(c*=1e-10,s*=1e-10,o*=1e-10,l*=1e-10),a&&(l+=c),a=!a,p==n&&(o=s);o/=l=2*l-c}return o}}(),C=(s=.636619772,u=[-2957821389,7062834065,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),l=[40076544269,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),c=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),d=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34945152e-8].reverse(),h=[-4900604943e3,127527439e4,-51534381390,734926455.1,-4237922.726,8511.937935].reverse(),f=[249958057e5,424441966400,3733650367,22459040.02,102042.605,354.9632885,1].reverse(),p=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),g=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse(),a((function(e){var t=0,n=0,i=0,a=e*e,h=e-.785398164;return e<8?t=(n=o(u,a))/(i=o(l,a))+s*T(e,0)*r.log(e):(n=o(c,a=64/a),i=o(d,a),t=r.sqrt(s/e)*(r.sin(h)*n+r.cos(h)*i*8/e)),t}),(function(e){var t=0,n=0,i=0,a=e*e,u=e-2.356194491;return e<8?t=(n=e*o(h,a))/(i=o(f,a))+s*(T(e,1)*r.log(e)-1/e):(n=o(p,a=64/a),i=o(g,a),t=r.sqrt(s/e)*(r.sin(u)*n+r.cos(u)*i*8/e)),t}),0,1,-1)),R=(m=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),v=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse(),y=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),E=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse(),function e(t,n){if(0===(n=Math.round(n)))return function(e){return e<=3.75?o(m,e*e/14.0625):r.exp(r.abs(e))/r.sqrt(r.abs(e))*o(v,3.75/r.abs(e))}(t);if(1===n)return function(e){return e<3.75?e*o(y,e*e/14.0625):(e<0?-1:1)*r.exp(r.abs(e))/r.sqrt(r.abs(e))*o(E,3.75/r.abs(e))}(t);if(n<0)return NaN;if(0===r.abs(t))return 0;if(t==1/0)return 1/0;var i,a=0,s=2/r.abs(t),u=0,l=1,c=0;for(i=2*r.round((n+r.round(r.sqrt(40*n)))/2);i>0;i--)c=i*s*l+u,u=l,l=c,r.abs(l)>1e10&&(l*=1e-10,u*=1e-10,a*=1e-10),i==n&&(a=u);return a*=e(t,0)/l,t<0&&n%2?-a:a}),w=function(){var e=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),t=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse();var n=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),i=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();return a((function(n){return n<=2?-r.log(n/2)*R(n,0)+o(e,n*n/4):r.exp(-n)/r.sqrt(n)*o(t,2/n)}),(function(e){return e<=2?r.log(e/2)*R(e,1)+1/e*o(n,e*e/4):r.exp(-e)/r.sqrt(e)*o(i,2/e)}),0,2,1)}()},function(e,t,n){"use strict";n(4),n(1),n(5),n(7),n(6),n(16);var r=n(0),o=n(14);t.__esModule=!0,t.default=void 0,n(703);var i=F(n(704));t.CellCoords=i.CellCoords,t.CellRange=i.CellRange;var a,s,u,l,c,d=n(847),h=F(n(51)),f=n(75),p=r(n(1087)),g=r(n(307)),m=F(n(290)),v=F(n(13)),y=F(n(91)),E=F(n(134)),T=F(n(611)),C=F(n(108)),R=F(n(58)),w=F(n(25)),S=F(n(36)),O=F(n(12)),b=F(n(79)),A=F(n(109)),N=F(n(15)),M=F(n(72)),I=n(130),_=n(185),k=n(186),x=n(190),P=n(228),L=n(39);function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(D=function(e){return e?n:t})(e)}function F(e,t){if(!t&&e&&e.__esLine truncated
|
||||
/**
|
||||
* @preserve
|
||||
* Authors: Handsoncode
|
||||
* Last updated: Nov 15, 2017
|
||||
*
|
||||
* Description: Definition file for English - United States language-country.
|
||||
*/
|
||||
function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}var l=(i={languageCode:"en-US"},(0,a.default)(i,s.CONTEXTMENU_ITEMS_NO_ITEMS,"No available options"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ROW_ABOVE,"Insert row above"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ROW_BELOW,"Insert row below"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_INSERT_LEFT,"Insert column left"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_INSERT_RIGHT,"Insert column right"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_REMOVE_ROW,["Remove row","Remove rows"]),(0,a.default)(i,s.CONTEXTMENU_ITEMS_REMOVE_COLUMN,["Remove column","Remove columns"]),(0,a.default)(i,s.CONTEXTMENU_ITEMS_UNDO,"Undo"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_REDO,"Redo"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_READ_ONLY,"Read only"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_CLEAR_COLUMN,"Clear column"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ALIGNMENT,"Alignment"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT,"Left"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER,"Center"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT,"Right"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY,"Justify"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ALIGNMENT_TOP,"Top"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE,"Middle"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM,"Bottom"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_FREEZE_COLUMN,"Freeze column"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN,"Unfreeze column"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_BORDERS,"Borders"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_BORDERS_TOP,"Top"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_BORDERS_RIGHT,"Right"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_BORDERS_BOTTOM,"Bottom"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_BORDERS_LEFT,"Left"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_REMOVE_BORDERS,"Remove border(s)"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_ADD_COMMENT,"Add comment"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_EDIT_COMMENT,"Edit comment"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_REMOVE_COMMENT,"Delete comment"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT,"Read-only comment"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_MERGE_CELLS,"Merge cells"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_UNMERGE_CELLS,"Unmerge cells"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_COPY,"Copy"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS,["Copy with header","Copy with headers"]),(0,a.default)(i,s.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS,["Copy with group header","Copy with group headers"]),(0,a.default)(i,s.CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY,["Copy header only","Copy headers only"]),(0,a.default)(i,s.CONTEXTMENU_ITEMS_CUT,"Cut"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD,"Insert child row"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD,"Detach from parent"),(0,a.default)(i,s.CONTEXTMENU_ITEMS_HIDE_COLUMN,["Hide column","Hide columns"]),(0,a.default)(i,s.CONTEXTMENU_ITEMS_SHOW_COLUMN,["Show column","Show columns"]),(0,a.default)(i,s.CONTEXTMENU_ITEMS_HIDE_ROW,["Hide row","Hide rows"]),(0,a.default)(i,s.CONTEXTMENU_ITEMS_SHOW_ROW,["Show row","Show rows"]),(0,a.default)(i,s.FILTERS_CONDITIONS_NONE,"None"),(0,a.default)(i,s.FILTERS_CONDITIONS_EMPTY,"Is empty"),(0,a.default)(i,s.FILTERS_CONDITIONS_NOT_EMPTY,"Is not empty"),(0,a.default)(i,s.FILTERS_CONDITIONS_EQUAL,"Is equal to"),(0,a.default)(i,s.FILTERS_CONDITIONS_NOT_EQUAL,"Is not equal to"),(0,a.default)(i,s.FILTERS_CONDITIONS_BEGINS_WITH,"Begins with"),(0,a.default)(i,s.FILTERS_CONDITIONS_ENDS_WITH,"Ends with"),(0,a.default)(i,s.FILTERS_CONDITIONS_CONTAINS,"Contains"),(0,a.default)(i,s.FILTERS_CONDITIONS_NOT_CONTAIN,"Does not contain"),(0,a.default)(i,s.FILTERS_CONDITIONS_GREATER_THAN,"Greater than"),(0,a.default)(i,s.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL,"Greater than or equal to"),(0,a.default)(i,s.FILTERS_CONDITIONS_LESS_THAN,"Less than"),(0,a.default)(i,s.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL,"Less than or equal to"),(0,a.default)(i,s.FILTERS_CONDITIONS_BETWEEN,"Is between"),(0,a.default)(i,s.FILTERS_CONDITIONS_NOT_BETWEEN,"Is not between"),(0,a.default)(i,s.FILTERS_CONDITIONS_AFTER,"After"),(0,a.default)(i,s.FILTERS_CONDITIONS_BEFORE,"Before"),(0,a.default)(i,s.FILTERS_CONDITIONS_TODAY,"Today"),(0,a.default)(i,s.FILTERS_CONDITIONS_TOMORROW,"Tomorrow"),(0,a.default)(i,s.FILTERS_CONDITIONS_YESTERDAY,"Yesterday"),(0,a.default)(i,s.FILTERS_VALUES_BLANK_CELLS,"Blank cells"),(0,a.default)(i,s.FILTERS_DIVS_FILTER_BY_CONDITION,"Filter by condition"),(0,a.default)(i,s.FILTERS_DIVS_FILTER_BY_VALUE,"Filter by value"),(0,a.default)(i,s.FILTERS_LABELS_CONJUNCTION,"And"),(0,a.default)(i,s.FILTERS_LABELS_DISJUNCTION,"Or"),(0,a.default)(i,s.FILTERS_BUTTONS_SELECT_ALL,"Select all"),(0,a.default)(i,s.FILTERS_BUTTONS_CLEAR,"Clear"),(0,a.default)(i,s.FILTERS_BUTTONS_OK,"OK"),(0,a.default)(i,s.FILTERS_BUTTONS_CANCEL,"Cancel"),(0,a.default)(i,s.FILTERS_BUTTONS_PLACEHOLDER_SEARCH,"Search"),(0,a.default)(i,s.FILTERS_BULine truncated
|
||||
/*!
|
||||
* Pikaday
|
||||
*
|
||||
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
|
||||
*/
|
||||
!function(t,r){"use strict";var o;try{o=n(92)}catch(e){}e.exports=function(e){var t="function"==typeof e,n=!!window.addEventListener,r=window.document,o=window.setTimeout,i=function(e,t,r,o){n?e.addEventListener(t,r,!!o):e.attachEvent("on"+t,r)},a=function(e,t,r,o){n?e.removeEventListener(t,r,!!o):e.detachEvent("on"+t,r)},s=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e,t){s(e,t)||(e.className=""===e.className?t:e.className+" "+t)},l=function(e,t){var n;e.className=(n=(" "+e.className+" ").replace(" "+t+" "," ")).trim?n.trim():n.replace(/^\s+|\s+$/g,"")},c=function(e){return/Array/.test(Object.prototype.toString.call(e))},d=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},h=function(e){var t=e.getDay();return 0===t||6===t},f=function(e){return e%4==0&&e%100!=0||e%400==0},p=function(e,t){return[31,f(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},g=function(e){d(e)&&e.setHours(0,0,0,0)},m=function(e,t){return e.getTime()===t.getTime()},v=function(e,t,n){var r,o;for(r in t)(o=void 0!==e[r])&&"object"==typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?d(t[r])?n&&(e[r]=new Date(t[r].getTime())):c(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=v({},t[r],n):!n&&o||(e[r]=t[r]);return e},y=function(e,t,n){var o;r.createEvent?((o=r.createEvent("HTMLEvents")).initEvent(t,!0,!1),o=v(o,n),e.dispatchEvent(o)):r.createEventObject&&(o=r.createEventObject(),o=v(o,n),e.fireEvent("on"+t,o))},E=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},T={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},C=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},R=function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month"),e.enableSelectionDaysInNextAndPreviousMonths||t.push("is-selection-disabled")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.hasEvent&&t.push("has-event"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},w=function(e,t,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(t?e.reverse():e).join("")+"</tr>"},S=function(e,t,n,r,o,i){var a,s,u,l,d,h=e._o,f=n===h.minYear,p=n===h.maxYear,g='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',m=!0,v=!0;for(u=[],a=0;a<12;a++)u.push('<option value="'+(n===o?a-t:12+a-t)+'"'+(a===r?' selected="selected"':"")+(f&&a<h.minMonth||p&&a>h.maxMonth?' disabled="disabled"':"")+">"+h.i18n.months[a]+"</option>");for(l='<div class="pika-label">'+h.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+u.join("")+"</select></div>",c(h.yearRange)?(a=h.yearRange[0],s=h.yearRange[1]+1):(a=n-h.yearRange,s=1+n+h.yearRange),u=[];a<s&&a<=h.maxYear;a++)a>=h.minYear&&u.push('<option value="'+a+'"'+(a===n?' selected="selected"':"")+">"+a+"</option>");return d='<div class="pika-label">'+n+h.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+u.join("")+"</select></div>",h.showMonthAfterYear?g+=d+l:g+=l+d,f&&(0===r||h.minMonth>=r)&&(m=!1),p&&(11===r||h.maxMonth<=r)&&(v=!1),0===t&&(g+='<button class="pika-prev'+(m?"":" is-disabled")+'" type="button">'+h.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(g+='<button class="pika-next'+(v?"":" is-disabled")+'" type="button">'+h.i18n.nextMonth+"</button>"),g+"</div>"},O=function(a){var u=this,l=u.config(a);u._onMouseDown=function(e){if(u._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(s(t,"is-disabled")||(!s(t,"pika-button")||s(t,"is-empty")||s(t.parLine truncated
|
||||
@@ -13,6 +13,45 @@ function init() {
|
||||
document.querySelector('#database-selector').onchange = (e) => {
|
||||
window.location.href = window.location.href.split('?')[0] + '?db=' + e.target.value;
|
||||
}
|
||||
|
||||
if (Handsontable) {
|
||||
Handsontable.renderers.registerRenderer('nullRenderer', nullRenderer)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function htmlToHandsonData(table) {
|
||||
const headers = []
|
||||
const rows = []
|
||||
|
||||
for (const row of table.querySelectorAll('tr')) {
|
||||
for (const th of row.querySelectorAll('th')) {
|
||||
headers.push(th.innerText)
|
||||
}
|
||||
|
||||
const cells = []
|
||||
|
||||
for (const td of row.querySelectorAll('td')) {
|
||||
cells.push(td.innerText)
|
||||
}
|
||||
|
||||
if (cells.length > 0) {
|
||||
rows.push(cells)
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
headers: headers,
|
||||
rows: rows
|
||||
}
|
||||
}
|
||||
|
||||
function nullRenderer(hot, td, row, column, props, value, cellProperties) {
|
||||
if (value === 'null') {
|
||||
td.innerHTML = `<em class="null">null</em>`
|
||||
} else {
|
||||
td.innerHTML = value
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
||||
@@ -8,7 +8,9 @@
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- handsontable -->
|
||||
<link href="/css/lib/handsontable.full.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Us -->
|
||||
<link href="/css/main.css" rel="stylesheet">
|
||||
<style type="text/css">
|
||||
</style>
|
||||
</head>
|
||||
@@ -29,7 +29,7 @@
|
||||
{{queryResult.timeToFirstRow}} ms to read the first row. <br />
|
||||
{{queryResult.timeToReadRows}} ms to read the rest of the rows. <br />
|
||||
<br />
|
||||
<table>
|
||||
<table id="data-table" class="invisible">
|
||||
<tr>
|
||||
{{#each queryResult.columns}}
|
||||
<th>{{this}}</th>
|
||||
@@ -43,10 +43,14 @@
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
|
||||
<div id="handson-table"></div>
|
||||
{{else}}
|
||||
No data.
|
||||
{{/if}}
|
||||
|
||||
<script src="/js/lib/handsontable.full.min.js"></script>
|
||||
|
||||
{{> partials/suffix}}
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sql-formatter/4.0.2/sql-formatter.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
@@ -87,6 +91,34 @@
|
||||
bindKey: {win: "Ctrl-Shift-F", mac: "Command-Shift-F"},
|
||||
exec: formatSql
|
||||
});
|
||||
|
||||
const table = document.getElementById('data-table')
|
||||
if (!table) {
|
||||
return;
|
||||
}
|
||||
|
||||
const data = htmlToHandsonData(table)
|
||||
table.remove()
|
||||
|
||||
const renderers = []
|
||||
for (const header of data.headers) {
|
||||
renderers.push({ renderer: 'nullRenderer' })
|
||||
}
|
||||
|
||||
const hot = new Handsontable(document.getElementById('handson-table'), {
|
||||
data: data.rows,
|
||||
colHeaders: data.headers,
|
||||
columns: renderers,
|
||||
readOnly: true,
|
||||
filters: true,
|
||||
columnSorting: true,
|
||||
manualColumnResize: true,
|
||||
manualColumnMove: true,
|
||||
manualRowResize: true,
|
||||
dropdownMenu: ['filter_by_condition', 'filter_by_value', 'filter_action_bar'],
|
||||
viewportColumnRenderingOffset: 1000,
|
||||
licenseKey: 'non-commercial-and-evaluation'
|
||||
})
|
||||
}
|
||||
|
||||
function onFormatClicked(e) {
|
||||
|
||||
@@ -61,8 +61,8 @@ internal class SpinnerServer(
|
||||
|
||||
try {
|
||||
return when {
|
||||
session.method == Method.GET && session.uri == "/css/main.css" -> newFileResponse("css/main.css", "text/css")
|
||||
session.method == Method.GET && session.uri == "/js/main.js" -> newFileResponse("js/main.js", "text/javascript")
|
||||
session.method == Method.GET && session.uri.startsWith("/css/") -> newFileResponse(session.uri.substring(1), "text/css")
|
||||
session.method == Method.GET && session.uri.startsWith("/js/") -> newFileResponse(session.uri.substring(1), "text/javascript")
|
||||
session.method == Method.GET && session.uri == "/" -> getIndex(dbParam, dbConfig.db())
|
||||
session.method == Method.GET && session.uri == "/browse" -> getBrowse(dbParam, dbConfig.db())
|
||||
session.method == Method.POST && session.uri == "/browse" -> postBrowse(dbParam, dbConfig, session)
|
||||
|
||||
Reference in new issue
Block a user