import{p as Ve,q as Kt,ei as De}from"./index-BPRWoLf4.js";function qe(Ee,Fe){for(var s=0;sT[S]})}}}return Object.freeze(Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"}))}var $e={exports:{}};/*! ExcelJS 19-10-2023 */(function(Ee,Fe){(function(s){Ee.exports=s()})(function(){return function s(T,S,m){function o(t,e){if(!S[t]){if(!T[t]){var l=typeof De=="function"&&De;if(!e&&l)return l(t,!0);if(a)return a(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var i=S[t]={exports:{}};T[t][0].call(i.exports,function(c){return o(T[t][1][c]||c)},i,i.exports,s,T,S,m)}return S[t].exports}for(var a=typeof De=="function"&&De,r=0;r{const d=this.workbook.addWorksheet(c.sheetName),f=c.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],w=c.map||function(A){if(A==="")return null;const N=Number(A);if(!Number.isNaN(N)&&N!==1/0)return N;const L=f.reduce((P,D)=>{if(P)return P;const U=t(A,D,!0);return U.isValid()?U:null},null);if(L)return new Date(L.valueOf());const I=n[A];return I!==void 0?I:A},_=o.parse(c.parserOptions).on("data",A=>{d.addRow(A.map(w))}).on("end",()=>{_.emit("worksheet",d)});_.on("worksheet",h).on("error",u),i.pipe(_)})}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(i,c){return new Promise((h,u)=>{c=c||{};const d=this.workbook.getWorksheet(c.sheetName||c.sheetId),f=o.format(c.formatterOptions);i.on("finish",()=>{h()}),f.on("error",u),f.pipe(i);const{dateFormat:w,dateUTC:_}=c,A=c.map||(I=>{if(I){if(I.text||I.hyperlink)return I.hyperlink||I.text||"";if(I.formula||I.result)return I.result||"";if(I instanceof Date)return w?_?t.utc(I).format(w):t(I).format(w):_?t.utc(I).format():t(I).format();if(I.error)return I.error;if(typeof I=="object")return JSON.stringify(I)}return I}),N=c.includeEmptyRows===void 0||c.includeEmptyRows;let L=1;d&&d.eachRow((I,P)=>{if(N)for(;L++2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=r,t)if(typeof t=="string"){const l=m.decodeAddress(t);this.nativeCol=l.col+e,this.nativeColOff=0,this.nativeRow=l.row+e,this.nativeRowOff=0}else t.nativeCol!==void 0?(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0):t.col!==void 0?(this.col=t.col+e,this.row=t.row+e):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(r){return r instanceof o||r==null?r:new o(r)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(r){this.nativeCol=Math.floor(r),this.nativeColOff=Math.floor((r-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(r){this.nativeRow=Math.floor(r),this.nativeRowOff=Math.floor((r-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(r){this.nativeCol=r.nativeCol,this.nativeColOff=r.nativeColOff,this.nativeRow=r.nativeRow,this.nativeRowOff=r.nativeRowOff}}T.exports=o},{"../utils/col-cache":19}],3:[function(s,T,S){const m=s("../utils/col-cache"),o=s("../utils/under-dash"),a=s("./enums"),{slideFormula:r}=s("../utils/shared-formula"),t=s("./note");class e{constructor(i,c,h){if(!i||!c)throw new Error("A Cell needs a Row");this._row=i,this._column=c,m.validateAddress(h),this._address=h,this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(i.style,c.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(i){this.style.numFmt=i}get font(){return this.style.font}set font(i){this.style.font=i}get alignment(){return this.style.alignment}set alignment(i){this.style.alignment=i}get border(){return this.style.border}set border(i){this.style.border=i}get fill(){return this.style.fill}set fill(i){this.style.fill=i}get protection(){return this.style.protection}set protection(i){this.style.protection=i}_mergeStyle(i,c,h){const u=i&&i.numFmt||c&&c.numFmt;u&&(h.numFmt=u);const d=i&&i.font||c&&c.font;d&&(h.font=d);const f=i&&i.alignment||c&&c.alignment;f&&(h.alignment=f);const w=i&&i.border||c&&c.border;w&&(h.border=w);const _=i&&i.fill||c&&c.fill;_&&(h.fill=_);const A=i&&i.protection||c&&c.protection;return A&&(h.protection=A),h}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===e.Types.Merge}merge(i,c){this._value.release(),this._value=l.create(e.Types.Merge,this,i),c||(this.style=i.style)}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(i){return this._value.type===e.Types.Merge&&this._value.isMergedTo(i)}get master(){return this.type===e.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===e.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(i){this.type!==e.Types.Merge?(this._value.release(),this._value=l.create(l.getType(i),this,i)):this._value.master.value=i}get note(){return this._comment&&this._comment.note}set note(i){this._comment=new t(i)}get text(){return this._value.toString()}get html(){return o.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(i){this.type===e.Types.String&&(this._value=l.create(e.Types.Hyperlink,this,{text:this._value.value,hyperlink:i}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:i}=this._row;return{sheetName:i.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(i){this.names=[i]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(i){const{definedNames:c}=this.workbook;c.removeAllNames(this.fullAddress),i.forEach(h=>{c.addEx(this.fullAddress,h)})}addName(i){this.workbook.definedNames.addEx(this.fullAddress,i)}removeName(i){this.workbook.definedNames.removeEx(this.fullAddress,i)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(i){this._dataValidations.add(this.address,i)}get model(){const{model:i}=this._value;return i.style=this.style,this._comment&&(i.comment=this._comment.model),i}set model(i){if(this._value.release(),this._value=l.create(i.type,this),this._value.model=i,i.comment)switch(i.comment.type){case"note":this._comment=t.fromModel(i.comment)}i.style?this.style=i.style:this.style={}}}e.Types=a.ValueType;const l={getType:n=>n==null?e.Types.Null:n instanceof String||typeof n=="string"?e.Types.String:typeof n=="number"?e.Types.Number:typeof n=="boolean"?e.Types.Boolean:n instanceof Date?e.Types.Date:n.text&&n.hyperlink?e.Types.Hyperlink:n.formula||n.sharedFormula?e.Types.Formula:n.richText?e.Types.RichText:n.sharedString?e.Types.SharedString:n.error?e.Types.Error:e.Types.JSON,types:[{t:e.Types.Null,f:class{constructor(n){this.model={address:n.address,type:e.Types.Null}}get value(){return null}set value(n){}get type(){return e.Types.Null}get effectiveType(){return e.Types.Null}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return""}release(){}toString(){return""}}},{t:e.Types.Number,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Number,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Number}get effectiveType(){return e.Types.Number}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.String,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:e.Types.Date,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Date,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Date}get effectiveType(){return e.Types.Date}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Hyperlink,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Hyperlink,text:i?i.text:void 0,hyperlink:i?i.hyperlink:void 0},i&&i.tooltip&&(this.model.tooltip=i.tooltip)}get value(){const n={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(n.tooltip=this.model.tooltip),n}set value(n){this.model={text:n.text,hyperlink:n.hyperlink},n.tooltip&&(this.model.tooltip=n.tooltip)}get text(){return this.model.text}set text(n){this.model.text=n}get hyperlink(){return this.model.hyperlink}set hyperlink(n){this.model.hyperlink=n}get type(){return e.Types.Hyperlink}get effectiveType(){return e.Types.Hyperlink}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:e.Types.Formula,f:class{constructor(n,i){this.cell=n,this.model={address:n.address,type:e.Types.Formula,shareType:i?i.shareType:void 0,ref:i?i.ref:void 0,formula:i?i.formula:void 0,sharedFormula:i?i.sharedFormula:void 0,result:i?i.result:void 0}}_copyModel(n){const i={},c=h=>{const u=n[h];u&&(i[h]=u)};return c("formula"),c("result"),c("ref"),c("shareType"),c("sharedFormula"),i}get value(){return this._copyModel(this.model)}set value(n){this.model=this._copyModel(n)}validate(n){switch(l.getType(n)){case e.Types.Null:case e.Types.String:case e.Types.Number:case e.Types.Date:break;case e.Types.Hyperlink:case e.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(n){this.model.formula=n}get formulaType(){return this.model.formula?a.FormulaType.Master:this.model.sharedFormula?a.FormulaType.Shared:a.FormulaType.None}get result(){return this.model.result}set result(n){this.model.result=n}get type(){return e.Types.Formula}get effectiveType(){const n=this.model.result;return n==null?a.ValueType.Null:n instanceof String||typeof n=="string"?a.ValueType.String:typeof n=="number"?a.ValueType.Number:n instanceof Date?a.ValueType.Date:n.text&&n.hyperlink?a.ValueType.Hyperlink:n.formula?a.ValueType.Formula:a.ValueType.Null}get address(){return this.model.address}set address(n){this.model.address=n}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:n}=this.cell,i=n.findCell(this.model.sharedFormula);this._translatedFormula=i&&r(i.formula,i.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:e.Types.Merge,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Merge,master:i?i.address:void 0},this._master=i,i&&i.addMergeRef()}get value(){return this._master.value}set value(n){n instanceof e?(this._master&&this._master.releaseMergeRef(),n.addMergeRef(),this._master=n):this._master.value=n}isMergedTo(n){return n===this._master}get master(){return this._master}get type(){return e.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:e.Types.JSON,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:JSON.stringify(i),rawValue:i}}get value(){return this.model.rawValue}set value(n){this.model.rawValue=n,this.model.value=JSON.stringify(n)}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:e.Types.SharedString,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.SharedString,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.SharedString}get effectiveType(){return e.Types.SharedString}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.RichText,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}toString(){return this.model.value.richText.map(n=>n.text).join("")}get type(){return e.Types.RichText}get effectiveType(){return e.Types.RichText}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:e.Types.Boolean,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Boolean,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Boolean}get effectiveType(){return e.Types.Boolean}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Error,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Error,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Error}get effectiveType(){return e.Types.Error}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((n,i)=>(n[i.t]=i.f,n),[]),create(n,i,c){const h=this.types[n];if(!h)throw new Error("Could not create Value of type "+n);return new h(i,c)}};T.exports=e},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(s,T,S){const m=s("../utils/under-dash"),o=s("./enums"),a=s("../utils/col-cache");class r{constructor(e,l,n){this._worksheet=e,this._number=l,n!==!1&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return a.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(e){e?(this.key=e.key,this.width=e.width!==void 0?e.width:9,this.outlineLevel=e.outlineLevel,e.style?this.style=e.style:this.style={},this.header=e.header,this._hidden=!!e.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(e){e!==void 0?(this._header=e,this.headers.forEach((l,n)=>{this._worksheet.getCell(n+1,this.number).value=l})):this._header=void 0}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&m.isEqual(this.style,e.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;const e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}get headerCount(){return this.headers.length}eachCell(e,l){const n=this.number;l||(l=e,e=null),this._worksheet.eachRow(e,(i,c)=>{l(i.getCell(n),c)})}get values(){const e=[];return this.eachCell((l,n)=>{l&&l.type!==o.ValueType.Null&&(e[n]=l.value)}),e}set values(e){if(!e)return;const l=this.number;let n=0;e.hasOwnProperty("0")&&(n=1),e.forEach((i,c)=>{this._worksheet.getCell(c+n,l).value=i})}_applyStyle(e,l){return this.style[e]=l,this.eachCell(n=>{n[e]=l}),l}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}static toModel(e){const l=[];let n=null;return e&&e.forEach((i,c)=>{i.isDefault?n&&(n=null):n&&i.equivalentTo(n)?n.max=c+1:(n={min:c+1,max:c+1,width:i.width!==void 0?i.width:9,style:i.style,isCustomWidth:i.isCustomWidth,hidden:i.hidden,outlineLevel:i.outlineLevel,collapsed:i.collapsed},l.push(n))}),l.length?l:void 0}static fromModel(e,l){const n=[];let i=1,c=0;for(l=(l=l||[]).sort(function(h,u){return h.min-u.min});c{l.removeCellEx(e)})}forEach(e){m.each(this.matrixMap,(l,n)=>{l.forEach(i=>{e(n,i)})})}getNames(e){return this.getNamesEx(o.decodeEx(e))}getNamesEx(e){return m.map(this.matrixMap,(l,n)=>l.findCellEx(e)&&n).filter(Boolean)}_explore(e,l){l.mark=!1;const{sheetName:n}=l,i=new r(l.row,l.col,l.row,l.col,n);let c,h;function u(f,w){const _=e.findCellAt(n,f,l.col);return!(!_||!_.mark)&&(i[w]=f,_.mark=!1,!0)}for(h=l.row-1;u(h,"top");h--);for(h=l.row+1;u(h,"bottom");h++);function d(f,w){const _=[];for(h=i.top;h<=i.bottom;h++){const A=e.findCellAt(n,h,f);if(!A||!A.mark)return!1;_.push(A)}i[w]=f;for(let A=0;A<_.length;A++)_[A].mark=!1;return!0}for(c=l.col-1;d(c,"left");c--);for(c=l.col+1;d(c,"right");c++);return i}getRanges(e,l){return(l=l||this.matrixMap[e])?(l.forEach(n=>{n.mark=!0}),{name:e,ranges:l.map(n=>n.mark&&this._explore(l,n)).filter(Boolean).map(n=>n.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,l){e.forEachInSheet(l,(n,i,c)=>{n&&(n.row===i&&n.col===c||(n.row=i,n.col=c,n.address=o.n2l(c)+i))})}spliceRows(e,l,n,i){m.each(this.matrixMap,c=>{c.spliceRows(e,l,n,i),this.normaliseMatrix(c,e)})}spliceColumns(e,l,n,i){m.each(this.matrixMap,c=>{c.spliceColumns(e,l,n,i),this.normaliseMatrix(c,e)})}get model(){return m.map(this.matrixMap,(e,l)=>this.getRanges(l,e)).filter(e=>e.ranges.length)}set model(e){const l=this.matrixMap={};e.forEach(n=>{const i=l[n.name]=new a;n.ranges.forEach(c=>{t.test(c.split("!").pop()||"")&&i.addCell(c)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(s,T,S){T.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(s,T,S){const m=s("../utils/col-cache"),o=s("./anchor");T.exports=class{constructor(a,r){this.worksheet=a,this.model=r}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(a){let{type:r,imageId:t,range:e,hyperlinks:l}=a;if(this.type=r,this.imageId=t,r==="image")if(typeof e=="string"){const n=m.decode(e);this.range={tl:new o(this.worksheet,{col:n.left,row:n.top},-1),br:new o(this.worksheet,{col:n.right,row:n.bottom},0),editAs:"oneCell"}}else this.range={tl:new o(this.worksheet,e.tl,0),br:e.br&&new o(this.worksheet,e.br,0),ext:e.ext,editAs:e.editAs,hyperlinks:l||e.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(s,T,S){const m=s("../utils/under-dash");class o{constructor(r){this.note=r}get model(){let r=null;switch(typeof this.note){case"string":r={type:"note",note:{texts:[{text:this.note}]}};break;default:r={type:"note",note:this.note}}return m.deepMerge({},o.DEFAULT_CONFIGS,r)}set model(r){const{note:t}=r,{texts:e}=t;e.length===1&&Object.keys(e[0]).length===1?this.note=e[0].text:this.note=t}static fromModel(r){const t=new o;return t.model=r,t}}o.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},T.exports=o},{"../utils/under-dash":26}],10:[function(s,T,S){const m=s("../utils/col-cache");class o{constructor(){this.decode(arguments)}setTLBR(r,t,e,l,n){if(arguments.length<4){const i=m.decodeAddress(r),c=m.decodeAddress(t);this.model={top:Math.min(i.row,c.row),left:Math.min(i.col,c.col),bottom:Math.max(i.row,c.row),right:Math.max(i.col,c.col),sheetName:e},this.setTLBR(i.row,i.col,c.row,c.col,n)}else this.model={top:Math.min(r,e),left:Math.min(t,l),bottom:Math.max(r,e),right:Math.max(t,l),sheetName:n}}decode(r){switch(r.length){case 5:this.setTLBR(r[0],r[1],r[2],r[3],r[4]);break;case 4:this.setTLBR(r[0],r[1],r[2],r[3]);break;case 3:this.setTLBR(r[0],r[1],r[2]);break;case 2:this.setTLBR(r[0],r[1]);break;case 1:{const t=r[0];if(t instanceof o)this.model={top:t.model.top,left:t.model.left,bottom:t.model.bottom,right:t.model.right,sheetName:t.sheetName};else if(t instanceof Array)this.decode(t);else if(t.top&&t.left&&t.bottom&&t.right)this.model={top:t.top,left:t.left,bottom:t.bottom,right:t.right,sheetName:t.sheetName};else{const e=m.decodeEx(t);e.top?this.model={top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName}:this.model={top:e.row,left:e.col,bottom:e.row,right:e.col,sheetName:e.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error("Invalid number of arguments to _getDimensions() - "+r.length)}}get top(){return this.model.top||1}set top(r){this.model.top=r}get left(){return this.model.left||1}set left(r){this.model.left=r}get bottom(){return this.model.bottom||1}set bottom(r){this.model.bottom=r}get right(){return this.model.right||1}set right(r){this.model.right=r}get sheetName(){return this.model.sheetName}set sheetName(r){this.model.sheetName=r}get _serialisedSheetName(){const{sheetName:r}=this.model;return r?/^[a-zA-Z0-9]*$/.test(r)?r+"!":`'${r}'!`:""}expand(r,t,e,l){(!this.model.top||rthis.bottom)&&(this.bottom=e),(!this.model.right||l>this.right)&&(this.right=l)}expandRow(r){if(r){const{dimensions:t,number:e}=r;t&&this.expand(e,t.min,e,t.max)}}expandToAddress(r){const t=m.decodeEx(r);this.expand(t.row,t.col,t.row,t.col)}get tl(){return m.n2l(this.left)+this.top}get $t$l(){return`$${m.n2l(this.left)}$${this.top}`}get br(){return m.n2l(this.right)+this.bottom}get $b$r(){return`$${m.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(r){return(!r.sheetName||!this.sheetName||r.sheetName===this.sheetName)&&!(r.bottomthis.bottom)&&!(r.rightthis.right)}contains(r){const t=m.decodeEx(r);return this.containsEx(t)}containsEx(r){return(!r.sheetName||!this.sheetName||r.sheetName===this.sheetName)&&r.row>=this.top&&r.row<=this.bottom&&r.col>=this.left&&r.col<=this.right}forEachAddress(r){for(let t=this.left;t<=this.right;t++)for(let e=this.top;e<=this.bottom;e++)r(m.encodeAddress(e,t),e,t)}}T.exports=o},{"../utils/col-cache":19}],11:[function(s,T,S){const m=s("../utils/under-dash"),o=s("./enums"),a=s("../utils/col-cache"),r=s("./cell");T.exports=class{constructor(t,e){this._worksheet=t,this._number=e,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(t){return this._cells[t-1]}getCellEx(t){let e=this._cells[t.col-1];if(!e){const l=this._worksheet.getColumn(t.col);e=new r(this,l,t.address),this._cells[t.col-1]=e}return e}getCell(t){if(typeof t=="string"){const e=this._worksheet.getColumnKey(t);t=e?e.number:a.l2n(t)}return this._cells[t-1]||this.getCellEx({address:a.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,e){const l=t+e;for(var n=arguments.length,i=new Array(n>2?n-2:0),c=2;c0)for(d=u;d>=l;d--)f=this._cells[d-1],f?(w=this.getCell(d+h),w.value=f.value,w.style=f.style,w._comment=f._comment):this._cells[d+h-1]=void 0;for(d=0;d{l&&l.type!==o.ValueType.Null&&e(l,n+1)})}addPageBreak(t,e){const l=this._worksheet,n=Math.max(0,t-1)||0,i=Math.max(0,e-1)||16838,c={id:this._number,max:i,man:1};n&&(c.min=n),l.rowBreaks.push(c)}get values(){const t=[];return this._cells.forEach(e=>{e&&e.type!==o.ValueType.Null&&(t[e.col]=e.value)}),t}set values(t){if(this._cells=[],t)if(t instanceof Array){let e=0;t.hasOwnProperty("0")&&(e=1),t.forEach((l,n)=>{l!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,n+e),row:this._number,col:n+e}).value=l)})}else this._worksheet.eachColumnKey((e,l)=>{t[l]!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,e.number),row:this._number,col:e.number}).value=t[l])})}get hasValues(){return m.some(this._cells,t=>t&&t.type!==o.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let t=0;return this.eachCell(()=>{t++}),t}get dimensions(){let t=0,e=0;return this._cells.forEach(l=>{l&&l.type!==o.ValueType.Null&&((!t||t>l.col)&&(t=l.col),e0?{min:t,max:e}:null}_applyStyle(t,e){return this.style[t]=e,this._cells.forEach(l=>{l&&(l[t]=e)}),e}get numFmt(){return this.style.numFmt}set numFmt(t){this._applyStyle("numFmt",t)}get font(){return this.style.font}set font(t){this._applyStyle("font",t)}get alignment(){return this.style.alignment}set alignment(t){this._applyStyle("alignment",t)}get protection(){return this.style.protection}set protection(t){this._applyStyle("protection",t)}get border(){return this.style.border}set border(t){this._applyStyle("border",t)}get fill(){return this.style.fill}set fill(t){this._applyStyle("fill",t)}get hidden(){return!!this._hidden}set hidden(t){this._hidden=t}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(t){this._outlineLevel=t}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const t=[];let e=0,l=0;return this._cells.forEach(n=>{if(n){const i=n.model;i&&((!e||e>n.col)&&(e=n.col),l{switch(l.type){case r.Types.Merge:break;default:{let n;if(l.address)n=a.decodeAddress(l.address);else if(e){const{row:i}=e,c=e.col+1;n={row:i,col:c,address:a.encodeAddress(i,c),$col$row:`$${a.n2l(c)}$${i}`}}e=n,this.getCellEx(n).model=l;break}}}),t.height?this.height=t.height:delete this.height,this.hidden=t.hidden,this.outlineLevel=t.outlineLevel||0,this.style=t.style&&JSON.parse(JSON.stringify(t.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(s,T,S){const m=s("../utils/col-cache");class o{constructor(r,t,e){this.table=r,this.column=t,this.index=e}_set(r,t){this.table.cacheState(),this.column[r]=t}get name(){return this.column.name}set name(r){this._set("name",r)}get filterButton(){return this.column.filterButton}set filterButton(r){this.column.filterButton=r}get style(){return this.column.style}set style(r){this.column.style=r}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(r){this._set("totalsRowLabel",r)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(r){this._set("totalsRowFunction",r)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(r){this._set("totalsRowResult",r)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(r){this._set("totalsRowFormula",r)}}T.exports=class{constructor(a,r){this.worksheet=a,r&&(this.table=r,this.validate(),this.store())}getFormula(a){switch(a.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${a.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${a.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${a.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${a.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${a.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${a.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${a.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${a.name}])`;case"custom":return a.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+a.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:a}=this,r=(h,u,d)=>{h[u]===void 0&&(h[u]=d)};r(a,"headerRow",!0),r(a,"totalsRow",!1),r(a,"style",{}),r(a.style,"theme","TableStyleMedium2"),r(a.style,"showFirstColumn",!1),r(a.style,"showLastColumn",!1),r(a.style,"showRowStripes",!1),r(a.style,"showColumnStripes",!1);const t=(h,u)=>{if(!h)throw new Error(u)};t(a.ref,"Table must have ref"),t(a.columns,"Table must have column definitions"),t(a.rows,"Table must have row definitions"),a.tl=m.decodeAddress(a.ref);const{row:e,col:l}=a.tl;t(e>0,"Table must be on valid row"),t(l>0,"Table must be on valid col");const{width:n,filterHeight:i,tableHeight:c}=this;a.autoFilterRef=m.encode(e,l,e+i-1,l+n-1),a.tableRef=m.encode(e,l,e+c-1,l+n-1),a.columns.forEach((h,u)=>{t(h.name,`Column ${u} must have a name`),u===0?r(h,"totalsRowLabel","Total"):(r(h,"totalsRowFunction","none"),h.totalsRowFormula=this.getFormula(h))})}store(){const a=(i,c)=>{c&&Object.keys(c).forEach(h=>{i[h]=c[h]})},{worksheet:r,table:t}=this,{row:e,col:l}=t.tl;let n=0;if(t.headerRow){const i=r.getRow(e+n++);t.columns.forEach((c,h)=>{const{style:u,name:d}=c,f=i.getCell(l+h);f.value=d,a(f,u)})}if(t.rows.forEach(i=>{const c=r.getRow(e+n++);i.forEach((h,u)=>{const d=c.getCell(l+u);d.value=h,a(d,t.columns[u].style)})}),t.totalsRow){const i=r.getRow(e+n++);t.columns.forEach((c,h)=>{const u=i.getCell(l+h);if(h===0)u.value=c.totalsRowLabel;else{const d=this.getFormula(c);u.value=d?{formula:c.totalsRowFormula,result:c.totalsRowResult}:null}a(u,c.style)})}}load(a){const{table:r}=this,{row:t,col:e}=r.tl;let l=0;if(r.headerRow){const n=a.getRow(t+l++);r.columns.forEach((i,c)=>{n.getCell(e+c).value=i.name})}if(r.rows.forEach(n=>{const i=a.getRow(t+l++);n.forEach((c,h)=>{i.getCell(e+h).value=c})}),r.totalsRow){const n=a.getRow(t+l++);r.columns.forEach((i,c)=>{const h=n.getCell(e+c);c===0?h.value=i.totalsRowLabel:this.getFormula(i)&&(h.value={formula:i.totalsRowFormula,result:i.totalsRowResult})})}}get model(){return this.table}set model(a){this.table=a}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const a=m.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(a,r)}getColumn(a){const r=this.table.columns[a];return new o(this,r,a)}addColumn(a,r,t){this.cacheState(),t===void 0?(this.table.columns.push(a),this.table.rows.forEach((e,l)=>{e.push(r[l])})):(this.table.columns.splice(t,0,a),this.table.rows.forEach((e,l)=>{e.splice(t,0,r[l])}))}removeColumns(a){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(a,r),this.table.rows.forEach(t=>{t.splice(a,r)})}_assign(a,r,t){this.cacheState(),a[r]=t}get ref(){return this.table.ref}set ref(a){this._assign(this.table,"ref",a)}get name(){return this.table.name}set name(a){this.table.name=a}get displayName(){return this.table.displyName||this.table.name}set displayNamename(a){this.table.displayName=a}get headerRow(){return this.table.headerRow}set headerRow(a){this._assign(this.table,"headerRow",a)}get totalsRow(){return this.table.totalsRow}set totalsRow(a){this._assign(this.table,"totalsRow",a)}get theme(){return this.table.style.name}set theme(a){this.table.style.name=a}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(a){this.table.style.showFirstColumn=a}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(a){this.table.style.showLastColumn=a}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(a){this.table.style.showRowStripes=a}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(a){this.table.style.showColumnStripes=a}}},{"../utils/col-cache":19}],13:[function(s,T,S){const m=s("./worksheet"),o=s("./defined-names"),a=s("../xlsx/xlsx"),r=s("../csv/csv");T.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new o}get xlsx(){return this._xlsx||(this._xlsx=new a(this)),this._xlsx}get csv(){return this._csv||(this._csv=new r(this)),this._csv}get nextId(){for(let t=1;t(u&&u.orderNo)>h?u.orderNo:h,0),i=Object.assign({},e,{id:l,name:t,orderNo:n+1,workbook:this}),c=new m(i);return this._worksheets[l]=c,c}removeWorksheetEx(t){delete this._worksheets[t.id]}removeWorksheet(t){const e=this.getWorksheet(t);e&&e.destroy()}getWorksheet(t){return t===void 0?this._worksheets.find(Boolean):typeof t=="number"?this._worksheets[t]:typeof t=="string"?this._worksheets.find(e=>e&&e.name===t):void 0}get worksheets(){return this._worksheets.slice(1).sort((t,e)=>t.orderNo-e.orderNo).filter(Boolean)}eachSheet(t){this.worksheets.forEach(e=>{t(e,e.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(t){const e=this.media.length;return this.media.push(Object.assign({},t,{type:"image"})),e}getImage(t){return this.media[t]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(t=>t.model),sheets:this.worksheets.map(t=>t.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(t){this.creator=t.creator,this.lastModifiedBy=t.lastModifiedBy,this.lastPrinted=t.lastPrinted,this.created=t.created,this.modified=t.modified,this.company=t.company,this.manager=t.manager,this.title=t.title,this.subject=t.subject,this.keywords=t.keywords,this.category=t.category,this.description=t.description,this.language=t.language,this.revision=t.revision,this.contentStatus=t.contentStatus,this.properties=t.properties,this.calcProperties=t.calcProperties,this._worksheets=[],t.worksheets.forEach(e=>{const{id:l,name:n,state:i}=e,c=t.sheets&&t.sheets.findIndex(h=>h.id===l);(this._worksheets[l]=new m({id:l,name:n,orderNo:c,state:i,workbook:this})).model=e}),this._definedNames.model=t.definedNames,this.views=t.views,this._themes=t.themes,this.media=t.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(s,T,S){const m=s("../utils/under-dash"),o=s("../utils/col-cache"),a=s("./range"),r=s("./row"),t=s("./column"),e=s("./enums"),l=s("./image"),n=s("./table"),i=s("./data-validations"),c=s("../utils/encryptor"),{copyStyle:h}=s("../utils/copy-style");T.exports=class{constructor(u){u=u||{},this._workbook=u.workbook,this.id=u.id,this.orderNo=u.orderNo,this.name=u.name,this.state=u.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},u.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!u.pageSetup||!u.pageSetup.fitToWidth&&!u.pageSetup.fitToHeight||u.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},u.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},u.headerFooter),this.dataValidations=new i,this.views=u.views||[],this.autoFilter=u.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(u){if(u===void 0&&(u="sheet"+this.id),this._name!==u){if(typeof u!="string")throw new Error("The name has to be a string.");if(u==="")throw new Error("The name can't be empty.");if(u==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(u))throw new Error(`Worksheet name ${u} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(u))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+u);if(u&&u.length>31&&(console.warn(`Worksheet name ${u} exceeds 31 chars. This will be truncated`),u=u.substring(0,31)),this._workbook._worksheets.find(d=>d&&d.name.toLowerCase()===u.toLowerCase()))throw new Error("Worksheet name already exists: "+u);this._name=u}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const u=new a;return this._rows.forEach(d=>{if(d){const f=d.dimensions;f&&u.expand(d.number,f.min,d.number,f.max)}}),u}get columns(){return this._columns}set columns(u){this._headerRowCount=u.reduce((w,_)=>{const A=(_.header?1:_.headers&&_.headers.length)||0;return Math.max(w,A)},0);let d=1;const f=this._columns=[];u.forEach(w=>{const _=new t(this,d++,!1);f.push(_),_.defn=w})}getColumnKey(u){return this._keys[u]}setColumnKey(u,d){this._keys[u]=d}deleteColumnKey(u){delete this._keys[u]}eachColumnKey(u){m.each(this._keys,u)}getColumn(u){if(typeof u=="string"){const d=this._keys[u];if(d)return d;u=o.l2n(u)}if(this._columns||(this._columns=[]),u>this._columns.length){let d=this._columns.length+1;for(;d<=u;)this._columns.push(new t(this,d++))}return this._columns[u-1]}spliceColumns(u,d){const f=this._rows.length;for(var w=arguments.length,_=new Array(w>2?w-2:0),A=2;A0)for(let P=0;P{D.push(B[P]||null)});const U=this.getRow(P+1);U.splice.apply(U,D)}else this._rows.forEach(P=>{P&&P.splice(u,d)});const N=_.length-d,L=u+d,I=this._columns.length;if(N<0)for(let P=u+_.length;P<=I;P++)this.getColumn(P).defn=this.getColumn(P-N).defn;else if(N>0)for(let P=I;P>=L;P--)this.getColumn(P+N).defn=this.getColumn(P).defn;for(let P=u;P{u=Math.max(u,d.cellCount)}),u}get actualColumnCount(){const u=[];let d=0;return this.eachRow(f=>{f.eachCell(w=>{let{col:_}=w;u[_]||(u[_]=!0,d++)})}),d}_commitRow(){}get _lastRowNumber(){const u=this._rows;let d=u.length;for(;d>0&&u[d-1]===void 0;)d--;return d}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(u){return this._rows[u-1]}findRows(u,d){return this._rows.slice(u-1,u-1+d)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let u=0;return this.eachRow(()=>{u++}),u}getRow(u){let d=this._rows[u-1];return d||(d=this._rows[u-1]=new r(this,u)),d}getRows(u,d){if(d<1)return;const f=[];for(let w=u;w1&&arguments[1]!==void 0?arguments[1]:"n";const f=this._nextRow,w=this.getRow(f);return w.values=u,this._setStyleOption(f,d[0]==="i"?d:"n"),w}addRows(u){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const f=[];return u.forEach(w=>{f.push(this.addRow(w,d))}),f}insertRow(u,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(u,0,d),this._setStyleOption(u,f),this.getRow(u)}insertRows(u,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(u,0,...d),f!=="n")for(let w=0;w1&&arguments[1]!==void 0?arguments[1]:"n";d[0]==="o"&&this.findRow(u+1)!==void 0?this._copyStyle(u+1,u,d[1]==="+"):d[0]==="i"&&this.findRow(u-1)!==void 0&&this._copyStyle(u-1,u,d[1]==="+")}_copyStyle(u,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this.getRow(u),_=this.getRow(d);_.style=h(w.style),w.eachCell({includeEmpty:f},(A,N)=>{_.getCell(N).style=h(A.style)}),_.height=w.height}duplicateRow(u,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this._rows[u-1],_=new Array(d).fill(w.values);this.spliceRows(u+1,f?0:d,..._);for(let A=0;A{N.getCell(I).style=L.style})}}spliceRows(u,d){const f=u+d;for(var w=arguments.length,_=new Array(w>2?w-2:0),A=2;A{U.getCell(x).style=B.style}),this._rows[P-1]=void 0}else this._rows[P+L-1]=void 0;else if(L>0)for(P=I;P>=f;P--)if(D=this._rows[P-1],D){const U=this.getRow(P+L);U.values=D.values,U.style=D.style,U.height=D.height,D.eachCell({includeEmpty:!0},(B,x)=>{if(U.getCell(x).style=B.style,B._value.constructor.name==="MergeValue"){const M=this.getRow(B._row._number+N).getCell(x),v=B._value._master,p=this.getRow(v._row._number+N).getCell(v._column._number);M.merge(p)}})}else this._rows[P+L-1]=void 0;for(P=0;P{f&&f.hasValues&&d(f,f.number)})}getSheetValues(){const u=[];return this._rows.forEach(d=>{d&&(u[d.number]=d.values)}),u}findCell(u,d){const f=o.getAddress(u,d),w=this._rows[f.row-1];return w?w.findCell(f.col):void 0}getCell(u,d){const f=o.getAddress(u,d);return this.getRow(f.row).getCellEx(f)}mergeCells(){for(var u=arguments.length,d=new Array(u),f=0;f{if(w.intersects(u))throw new Error("Cannot merge already merged cells")});const f=this.getCell(u.top,u.left);for(let w=u.top;w<=u.bottom;w++)for(let _=u.left;_<=u.right;_++)(w>u.top||_>u.left)&&this.getCell(w,_).merge(f,d);this._merges[f.address]=u}_unMergeMaster(u){const d=this._merges[u.address];if(d){for(let f=d.top;f<=d.bottom;f++)for(let w=d.left;w<=d.right;w++)this.getCell(f,w).unmerge();delete this._merges[u.address]}}get hasMerges(){return m.some(this._merges,Boolean)}unMergeCells(){for(var u=arguments.length,d=new Array(u),f=0;f3&&arguments[3]!==void 0?arguments[3]:"shared";const _=o.decode(u),{top:A,left:N,bottom:L,right:I}=_,P=I-N+1,D=o.encodeAddress(A,N),U=w==="shared";let B;B=typeof f=="function"?f:Array.isArray(f)?Array.isArray(f[0])?(M,v)=>f[M-A][v-N]:(M,v)=>f[(M-A)*P+(v-N)]:()=>{};let x=!0;for(let M=A;M<=L;M++)for(let v=N;v<=I;v++)x?(this.getCell(M,v).value={shareType:w,formula:d,ref:u,result:B(M,v)},x=!1):this.getCell(M,v).value=U?{sharedFormula:D,result:B(M,v)}:B(M,v)}addImage(u,d){const f={type:"image",imageId:u,range:d};this._media.push(new l(this,f))}getImages(){return this._media.filter(u=>u.type==="image")}addBackgroundImage(u){const d={type:"background",imageId:u};this._media.push(new l(this,d))}getBackgroundImageId(){const u=this._media.find(d=>d.type==="background");return u&&u.imageId}protect(u,d){return new Promise(f=>{this.sheetProtection={sheet:!0},d&&"spinCount"in d&&(d.spinCount=Number.isFinite(d.spinCount)?Math.round(Math.max(0,d.spinCount)):1e5),u&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=c.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=d&&"spinCount"in d?d.spinCount:1e5,this.sheetProtection.hashValue=c.convertPasswordToHash(u,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),d&&(this.sheetProtection=Object.assign(this.sheetProtection,d),!u&&"spinCount"in d&&delete this.sheetProtection.spinCount),f()})}unprotect(){this.sheetProtection=null}addTable(u){const d=new n(this,u);return this.tables[u.name]=d,d}getTable(u){return this.tables[u]}removeTable(u){delete this.tables[u]}getTables(){return Object.values(this.tables)}addConditionalFormatting(u){this.conditionalFormattings.push(u)}removeConditionalFormatting(u){typeof u=="number"?this.conditionalFormattings.splice(u,1):this.conditionalFormattings=u instanceof Function?this.conditionalFormattings.filter(u):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(u){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=u}get model(){const u={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(w=>w.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(w=>w.model),conditionalFormattings:this.conditionalFormattings};u.cols=t.toModel(this.columns);const d=u.rows=[],f=u.dimensions=new a;return this._rows.forEach(w=>{const _=w&&w.model;_&&(f.expand(_.number,_.min,_.number,_.max),d.push(_))}),u.merges=[],m.each(this._merges,w=>{u.merges.push(w.range)}),u}_parseRows(u){this._rows=[],u.rows.forEach(d=>{const f=new r(this,d.number);this._rows[f.number-1]=f,f.model=d})}_parseMergeCells(u){m.each(u.mergeCells,d=>{this.mergeCellsWithoutStyle(d)})}set model(u){this.name=u.name,this._columns=t.fromModel(this,u.cols),this._parseRows(u),this._parseMergeCells(u),this.dataValidations=new i(u.dataValidations),this.properties=u.properties,this.pageSetup=u.pageSetup,this.headerFooter=u.headerFooter,this.views=u.views,this.autoFilter=u.autoFilter,this._media=u.media.map(d=>new l(this,d)),this.sheetProtection=u.sheetProtection,this.tables=u.tables.reduce((d,f)=>{const w=new n;return w.model=f,d[f.name]=w,d},{}),this.conditionalFormattings=u.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(s,T,S){s("core-js/modules/es.promise"),s("core-js/modules/es.promise.finally"),s("core-js/modules/es.object.assign"),s("core-js/modules/es.object.keys"),s("core-js/modules/es.object.values"),s("core-js/modules/es.symbol"),s("core-js/modules/es.symbol.async-iterator"),s("core-js/modules/es.array.iterator"),s("core-js/modules/es.array.includes"),s("core-js/modules/es.array.find-index"),s("core-js/modules/es.array.find"),s("core-js/modules/es.string.from-code-point"),s("core-js/modules/es.string.includes"),s("core-js/modules/es.number.is-nan"),s("regenerator-runtime/runtime");const m={Workbook:s("./doc/workbook")},o=s("./doc/enums");Object.keys(o).forEach(a=>{m[a]=o[a]}),T.exports=m},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(s,T,S){const m=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");S.bufferToString=function(o){return typeof o=="string"?o:m?m.decode(o):o.toString()}},{}],17:[function(s,T,S){const m=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:o}=s("buffer");S.stringToBuffer=function(a){return typeof a!="string"?a:m?o.from(m.encode(a).buffer):o.from(a)}},{buffer:220}],18:[function(s,T,S){const m=s("./under-dash"),o=s("./col-cache");T.exports=class{constructor(a){this.template=a,this.sheets={}}addCell(a){this.addCellEx(o.decodeEx(a))}getCell(a){return this.findCellEx(o.decodeEx(a),!0)}findCell(a){return this.findCellEx(o.decodeEx(a),!1)}findCellAt(a,r,t){const e=this.sheets[a],l=e&&e[r];return l&&l[t]}addCellEx(a){if(a.top)for(let r=a.top;r<=a.bottom;r++)for(let t=a.left;t<=a.right;t++)this.getCellAt(a.sheetName,r,t);else this.findCellEx(a,!0)}getCellEx(a){return this.findCellEx(a,!0)}findCellEx(a,r){const t=this.findSheet(a,r),e=this.findSheetRow(t,a,r);return this.findRowCell(e,a,r)}getCellAt(a,r,t){const e=this.sheets[a]||(this.sheets[a]=[]),l=e[r]||(e[r]=[]);return l[t]||(l[t]={sheetName:a,address:o.n2l(t)+r,row:r,col:t})}removeCellEx(a){const r=this.findSheet(a);if(!r)return;const t=this.findSheetRow(r,a);t&&delete t[a.col]}forEachInSheet(a,r){const t=this.sheets[a];t&&t.forEach((e,l)=>{e&&e.forEach((n,i)=>{n&&r(n,l,i)})})}forEach(a){m.each(this.sheets,(r,t)=>{this.forEachInSheet(t,a)})}map(a){const r=[];return this.forEach(t=>{r.push(a(t))}),r}findSheet(a,r){const t=a.sheetName;return this.sheets[t]?this.sheets[t]:r?this.sheets[t]=[]:void 0}findSheetRow(a,r,t){const{row:e}=r;return a&&a[e]?a[e]:t?a[e]=[]:void 0}findRowCell(a,r,t){const{col:e}=r;return a&&a[e]?a[e]:t?a[e]=this.template?Object.assign(r,JSON.parse(JSON.stringify(this.template))):r:void 0}spliceRows(a,r,t,e){const l=this.sheets[a];if(l){const n=[];for(let i=0;i{i.splice(r,t,...n)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(s,T,S){const m=/^[A-Z]+\d+$/,o={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:a=>a<=26?1:a<=676?2:3,_fill(a){let r,t,e,l,n,i=1;if(a>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&a>=1){for(;i<=26;)r=this._dictionary[i-1],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=1}if(this._l2nFill<2&&a>=2){for(i=27;i<=702;)t=i-27,e=t%26,l=Math.floor(t/26),r=this._dictionary[l]+this._dictionary[e],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=2}if(this._l2nFill<3&&a>=3){for(i=703;i<=16384;)t=i-703,e=t%26,l=Math.floor(t/26)%26,n=Math.floor(t/676),r=this._dictionary[n]+this._dictionary[l]+this._dictionary[e],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=3}},l2n(a){if(this._l2n[a]||this._fill(a.length),!this._l2n[a])throw new Error("Out of bounds. Invalid column letter: "+a);return this._l2n[a]},n2l(a){if(a<1||a>16384)throw new Error(a+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[a]||this._fill(this._level(a)),this._n2l[a]},_hash:{},validateAddress(a){if(!m.test(a))throw new Error("Invalid Address: "+a);return!0},decodeAddress(a){const r=a.length<5&&this._hash[a];if(r)return r;let t=!1,e="",l=0,n=!1,i="",c=0;for(let u,d=0;d=65&&u<=90)t=!0,e+=a[d],l=26*l+u-64;else if(u>=48&&u<=57)n=!0,i+=a[d],c=10*c+u-48;else if(n&&t&&u!==36)break;if(t){if(l>16384)throw new Error("Out of bounds. Invalid column letter: "+e)}else l=void 0;n||(c=void 0);const h={address:a=e+i,col:l,row:c,$col$row:`$${e}$${i}`};return l<=100&&c<=100&&(this._hash[a]=h,this._hash[h.$col$row]=h),h},getAddress(a,r){if(r){const t=this.n2l(r)+a;return this.decodeAddress(t)}return this.decodeAddress(a)},decode(a){const r=a.split(":");if(r.length===2){const t=this.decodeAddress(r[0]),e=this.decodeAddress(r[1]),l={top:Math.min(t.row,e.row),left:Math.min(t.col,e.col),bottom:Math.max(t.row,e.row),right:Math.max(t.col,e.col)};return l.tl=this.n2l(l.left)+l.top,l.br=this.n2l(l.right)+l.bottom,l.dimensions=`${l.tl}:${l.br}`,l}return this.decodeAddress(a)},decodeEx(a){const r=a.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=r[1]||r[2],e=r[3],l=e.split(":");if(l.length>1){let i=this.decodeAddress(l[0]),c=this.decodeAddress(l[1]);const h=Math.min(i.row,c.row),u=Math.min(i.col,c.col),d=Math.max(i.row,c.row),f=Math.max(i.col,c.col);return i=this.n2l(u)+h,c=this.n2l(f)+d,{top:h,left:u,bottom:d,right:f,sheetName:t,tl:{address:i,col:u,row:h,$col$row:`$${this.n2l(u)}$${h}`,sheetName:t},br:{address:c,col:f,row:d,$col$row:`$${this.n2l(f)}$${d}`,sheetName:t},dimensions:`${i}:${c}`}}if(e.startsWith("#"))return t?{sheetName:t,error:e}:{error:e};const n=this.decodeAddress(e);return t?{sheetName:t,...n}:n},encodeAddress:(a,r)=>o.n2l(r)+a,encode(){switch(arguments.length){case 2:return o.encodeAddress(arguments[0],arguments[1]);case 4:return`${o.encodeAddress(arguments[0],arguments[1])}:${o.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(a,r){const[t,e,,l,n]=a,[i,c]=r;return i>=t&&i<=l&&c>=e&&c<=n}};T.exports=o},{}],20:[function(s,T,S){const m=(a,r)=>({...a,...r.reduce((t,e)=>(a[e]&&(t[e]={...a[e]}),t),{})}),o=function(a,r,t){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];a[t]&&(r[t]=m(a[t],e))};S.copyStyle=a=>{if(!a)return a;if(r=a,Object.keys(r).length===0)return{};var r;const t={...a};return o(a,t,"font",["color"]),o(a,t,"alignment"),o(a,t,"protection"),a.border&&(o(a,t,"border"),o(a.border,t.border,"top",["color"]),o(a.border,t.border,"left",["color"]),o(a.border,t.border,"bottom",["color"]),o(a.border,t.border,"right",["color"]),o(a.border,t.border,"diagonal",["color"])),a.fill&&(o(a,t,"fill",["fgColor","bgColor","center"]),a.fill.stops&&(t.fill.stops=a.fill.stops.map(e=>m(e,["color"])))),t}},{}],21:[function(s,T,S){(function(m){(function(){const o=s("crypto"),a={hash(r){const t=o.createHash(r);for(var e=arguments.length,l=new Array(e>1?e-1:0),n=1;no.randomBytes(r)};T.exports=a}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(s,T,S){const{SaxesParser:m}=s("saxes"),{PassThrough:o}=s("readable-stream"),{bufferToString:a}=s("./browser-buffer-decode");T.exports=async function*(r){r.pipe&&!r[Symbol.asyncIterator]&&(r=r.pipe(new o));const t=new m;let e;t.on("error",n=>{e=n});let l=[];t.on("opentag",n=>l.push({eventType:"opentag",value:n})),t.on("text",n=>l.push({eventType:"text",value:n})),t.on("closetag",n=>l.push({eventType:"closetag",value:n}));for await(const n of r){if(t.write(a(n)),e)throw e;yield l,l=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(s,T,S){const m=s("./col-cache"),o=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,a=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;T.exports={slideFormula:function(r,t,e){const l=m.decode(t),n=m.decode(e);return r.replace(o,(i,c,h,u,d)=>{if(d)return i;const f=a.exec(u);if(f){const w=f[1],_=f[2].toUpperCase(),A=f[3],N=f[4];if(_.length>3||_.length===3&&_>"XFD")return i;let L=m.l2n(_),I=parseInt(N,10);return w||(L+=n.col-l.col),A||(I+=n.row-l.row),(c||"")+(w||"")+m.n2l(L)+(A||"")+I}return i})}}},{"./col-cache":19}],24:[function(s,T,S){(function(m,o){(function(){const a=s("readable-stream"),r=s("./utils"),t=s("./string-buf");class e{constructor(u,d){this._data=u,this._encoding=d}get length(){return this.toBuffer().length}copy(u,d,f,w){return this.toBuffer().copy(u,d,f,w)}toBuffer(){return this._buffer||(this._buffer=o.from(this._data,this._encoding)),this._buffer}}class l{constructor(u){this._data=u}get length(){return this._data.length}copy(u,d,f,w){return this._data._buf.copy(u,d,f,w)}toBuffer(){return this._data.toBuffer()}}class n{constructor(u){this._data=u}get length(){return this._data.length}copy(u,d,f,w){this._data.copy(u,d,f,w)}toBuffer(){return this._data}}class i{constructor(u){this.size=u,this.buffer=o.alloc(u),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const u=o.alloc(this.iWrite-this.iRead);return this.buffer.copy(u,0,this.iRead,this.iWrite),u}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(u){let d;return u===0?null:u===void 0||u>=this.length?(d=this.toBuffer(),this.iRead=this.iWrite,d):(d=o.alloc(u),this.buffer.copy(d,0,this.iRead,u),this.iRead+=u,d)}write(u,d,f){const w=Math.min(f,this.size-this.iWrite);return u.copy(this.buffer,this.iWrite,d,d+w),this.iWrite+=w,w}}const c=function(h){h=h||{},this.bufSize=h.bufSize||1048576,this.buffers=[],this.batch=h.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};r.inherits(c,a.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return o.concat(this.buffers.map(h=>h.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const u=this.buffers[this.buffers.length-1];if(!u.full)return u}const h=new i(this.bufSize);return this.buffers.push(h),h},async _pipe(h){await Promise.all(this.pipes.map(function(u){return new Promise(d=>{u.write(h.toBuffer(),()=>{d()})})}))},_writeToBuffers(h){let u=0;const d=h.length;for(;u1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(f),m.nextTick(d)):(await this._pipe(f),d());else this.paused||this.emit("data",f.toBuffer()),this._writeToBuffers(f),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(h,u,d){const f=w=>{w?d(w):(this._flush(),this.pipes.forEach(_=>{_.end()}),this.emit("finish"))};h?this.write(h,u,f):f()},read(h){let u;if(h){for(u=[];h&&this.buffers.length&&!this.buffers[0].eod;){const d=this.buffers[0],f=d.read(h);h-=f.length,u.push(f),d.eod&&d.full&&this.buffers.shift()}return o.concat(u)}return u=this.buffers.map(d=>d.toBuffer()).filter(Boolean),this.buffers=[],o.concat(u)},setEncoding(h){this.encoding=h},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(h){this.pipes.push(h),!this.paused&&this.buffers.length&&this.end()},unpipe(h){this.pipes=this.pipes.filter(u=>u!==h)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),T.exports=c}).call(this)}).call(this,s("_process"),s("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(s,T,S){(function(m){(function(){T.exports=class{constructor(o){this._buf=m.alloc(o&&o.size||16384),this._encoding=o&&o.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=m.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(o){o=o||0,this._buffer=void 0,this._inPos=o}_grow(o){let a=2*this._buf.length;for(;a=this._buf.length-4;)this._grow(this._inPos+o.length),a=this._inPos+this._buf.write(o,this._inPos,this._encoding);this._inPos=a}addStringBuf(o){o.length&&(this._buffer=void 0,this.length+o.length>this.capacity&&this._grow(this.length+o.length),o._buf.copy(this._buf,this._inPos,0,o.length),this._inPos+=o.length)}}}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220}],26:[function(s,T,S){const{toString:m}=Object.prototype,o=/["&<>]/,a={each:function(r,t){r&&(Array.isArray(r)?r.forEach(t):Object.keys(r).forEach(e=>{t(r[e],e)}))},some:function(r,t){return!!r&&(Array.isArray(r)?r.some(t):Object.keys(r).some(e=>t(r[e],e)))},every:function(r,t){return!r||(Array.isArray(r)?r.every(t):Object.keys(r).every(e=>t(r[e],e)))},map:function(r,t){return r?Array.isArray(r)?r.map(t):Object.keys(r).map(e=>t(r[e],e)):[]},keyBy:(r,t)=>r.reduce((e,l)=>(e[l[t]]=l,e),{}),isEqual:function(r,t){const e=typeof r,l=typeof t,n=Array.isArray(r),i=Array.isArray(t);let c;if(e!==l)return!1;switch(typeof r){case"object":if(n||i)return!(!n||!i)&&r.length===t.length&&r.every((h,u)=>{const d=t[u];return a.isEqual(h,d)});if(r===null||t===null)return r===t;if(c=Object.keys(r),Object.keys(t).length!==c.length)return!1;for(const h of c)if(!t.hasOwnProperty(h))return!1;return a.every(r,(h,u)=>{const d=t[u];return a.isEqual(h,d)});default:return r===t}},escapeHtml(r){const t=o.exec(r);if(!t)return r;let e="",l="",n=0,i=t.index;for(;i":l=">";break;default:continue}n!==i&&(e+=r.substring(n,i)),n=i+1,e+=l}return n!==i?e+r.substring(n,i):e},strcmp:(r,t)=>rt?1:0,isUndefined:r=>m.call(r)==="[object Undefined]",isObject:r=>m.call(r)==="[object Object]",deepMerge(){const r=arguments[0]||{},{length:t}=arguments;let e,l,n;function i(c,h){e=r[h],n=Array.isArray(c),a.isObject(c)||n?(n?(n=!1,l=e&&Array.isArray(e)?e:[]):l=e&&a.isObject(e)?e:{},r[h]=a.deepMerge(l,c)):a.isUndefined(c)||(r[h]=c)}for(let c=0;c&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:e=>new Promise(l=>{m.setImmediate?o(()=>{l(e)}):setTimeout(()=>{l(e)},1)}),inherits:function(e,l,n,i){e.super_=l,i||(i=n,n=null),n&&Object.keys(n).forEach(h=>{Object.defineProperty(e,h,Object.getOwnPropertyDescriptor(n,h))});const c={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};i&&Object.keys(i).forEach(h=>{c[h]=Object.getOwnPropertyDescriptor(i,h)}),e.prototype=Object.create(l.prototype,c)},dateToExcel:(e,l)=>25569+e.getTime()/864e5-(l?1462:0),excelToDate(e,l){const n=Math.round(24*(e-25569+(l?1462:0))*3600*1e3);return new Date(n)},parsePath(e){const l=e.lastIndexOf("/");return{path:e.substring(0,l),name:e.substring(l+1)}},getRelsPath(e){const l=t.parsePath(e);return`${l.path}/_rels/${l.name}.rels`},xmlEncode(e){const l=r.exec(e);if(!l)return e;let n="",i="",c=0,h=l.index;for(;h=11&&u!==13)){i="";break}continue}c!==h&&(n+=e.substring(c,h)),c=h+1,i&&(n+=i)}return c!==h?n+e.substring(c,h):n},xmlDecode:e=>e.replace(/&([a-z]*);/g,l=>{switch(l){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return l}}),validInt(e){const l=parseInt(e,10);return Number.isNaN(l)?0:l},isDateFmt(e){return e?(e=(e=e.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:e=>new Promise(l=>{a.access(e,a.constants.F_OK,n=>{l(!n)})})},toIsoDateString:e=>e.toIsoString().subsstr(0,10),parseBoolean:e=>e===!0||e==="true"||e===1||e==="1"};T.exports=t}).call(this)}).call(this,typeof Kt<"u"?Kt:typeof self<"u"?self:typeof window<"u"?window:{},s("timers").setImmediate)},{fs:216,timers:523}],28:[function(s,T,S){const m=s("./under-dash"),o=s("./utils");function a(e,l,n){e.push(` ${l}="${o.xmlEncode(n.toString())}"`)}function r(e,l){if(l){const n=[];m.each(l,(i,c)=>{i!==void 0&&a(n,c,i)}),e.push(n.join(""))}}class t{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(l){const n=this._xml;n.push(" `)}openNode(l,n){const i=this.tos,c=this._xml;i&&this.open&&c.push(">"),this._stack.push(l),c.push("<"),c.push(l),r(c,n),this.leaf=!0,this.open=!0}addAttribute(l,n){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");n!==void 0&&a(this._xml,l,n)}addAttributes(l){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");r(this._xml,l)}writeText(l){const n=this._xml;this.open&&(n.push(">"),this.open=!1),this.leaf=!1,n.push(o.xmlEncode(l.toString()))}writeXml(l){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(l)}closeNode(){const l=this._stack.pop(),n=this._xml;this.leaf?n.push("/>"):(n.push("")),this.open=!1,this.leaf=!1}leafNode(l,n,i){this.openNode(l,n),i!==void 0&&this.writeText(i),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){const l=this._rollbacks.pop();this._xml.length>l.xml&&this._xml.splice(l.xml,this._xml.length-l.xml),this._stack.length>l.stack&&this._stack.splice(l.stack,this._stack.length-l.stack),this.leaf=l.leaf,this.open=l.open}get xml(){return this.closeAll(),this._xml.join("")}}t.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},T.exports=t},{"./under-dash":26,"./utils":27}],29:[function(s,T,S){(function(m){(function(){const o=s("events"),a=s("jszip"),r=s("./stream-buf"),{stringToBuffer:t}=s("./browser-buffer-encode");class e extends o.EventEmitter{constructor(n){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},n),this.zip=new a,this.stream=new r}append(n,i){i.hasOwnProperty("base64")&&i.base64?this.zip.file(i.name,n,{base64:!0}):(m.browser&&typeof n=="string"&&(n=t(n)),this.zip.file(i.name,n))}async finalize(){const n=await this.zip.generateAsync(this.options);this.stream.end(n),this.emit("finish")}read(n){return this.stream.read(n)}setEncoding(n){return this.stream.setEncoding(n)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(n,i){return this.stream.pipe(n,i)}unpipe(n){return this.stream.unpipe(n)}unshift(n){return this.stream.unshift(n)}wrap(n){return this.stream.wrap(n)}}T.exports={ZipWriter:e}}).call(this)}).call(this,s("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(s,T,S){T.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},28:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"年"m"月"d"日"',"zh-cn":'yyyy"年"m"月"d"日"',"ja-jp":'yyyy"年"m"月"d"日"',"ko-kr":'yyyy"년" mm"월" dd"일"'},32:{"zh-tw":'hh"時"mm"分"',"zh-cn":'h"时"mm"分"',"ja-jp":'h"時"mm"分"',"ko-kr":'h"시" mm"분"'},33:{"zh-tw":'hh"時"mm"分"ss"秒"',"zh-cn":'h"时"mm"分"ss"秒"',"ja-jp":'h"時"mm"分"ss"秒"',"ko-kr":'h"시" mm"분" ss"초"'},34:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},51:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},52:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'yyyy"年"m"月"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'m"月"d"日"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},55:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},58:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],31:[function(s,T,S){T.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],32:[function(s,T,S){const m=s("../../utils/parse-sax"),o=s("../../utils/xml-stream");class a{prepare(){}render(){}parseOpen(t){}parseText(t){}parseClose(t){}reconcile(t,e){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(t=>{t instanceof a?t.reset():t.xform&&t.xform.reset()})}mergeModel(t){this.model=Object.assign(this.model||{},t)}async parse(t){for await(const e of t)for(const{eventType:l,value:n}of e)if(l==="opentag")this.parseOpen(n);else if(l==="text")this.parseText(n);else if(l==="closetag"&&!this.parseClose(n.name))return this.model;return this.model}async parseStream(t){return this.parse(m(t))}get xml(){return this.toXml(this.model)}toXml(t){const e=new o;return this.render(e,t),e.xml}static toAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return e}else if(l||t!==e)return t.toString()}static toStringAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toStringValue(t,e){return t===void 0?e:t}static toBoolAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return e}else if(l||t!==e)return t?"1":"0"}static toBoolValue(t,e){return t===void 0?e:t==="1"}static toIntAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toIntValue(t,e){return t===void 0?e:parseInt(t,10)}static toFloatAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toFloatValue(t,e){return t===void 0?e:parseFloat(t)}}T.exports=a},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(s,T,S){const m=s("../base-xform"),o=s("../../../utils/col-cache");function a(t){try{return o.decodeEx(t),!0}catch{return!1}}function r(t){const e=[];let l=!1,n="";return t.split(",").forEach(i=>{if(!i)return;const c=(i.match(/'/g)||[]).length;if(!c)return void(l?n+=i+",":a(i)&&e.push(i));const h=c%2==0;!l&&h&&a(i)?e.push(i):l&&!h?(l=!1,a(n+i)&&e.push(n+i),n=""):(l=!0,n+=i+",")}),e}T.exports=class extends m{render(t,e){t.openNode("definedName",{name:e.name,localSheetId:e.localSheetId}),t.writeText(e.ranges.join(",")),t.closeNode()}parseOpen(t){switch(t.name){case"definedName":return this._parsedName=t.attributes.name,this._parsedLocalSheetId=t.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(t){this._parsedText.push(t)}parseClose(){return this.model={name:this._parsedName,ranges:r(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(s,T,S){const m=s("../../../utils/utils"),o=s("../base-xform");T.exports=class extends o{render(a,r){a.leafNode("sheet",{sheetId:r.id,name:r.name,state:r.state,"r:id":r.rId})}parseOpen(a){return a.name==="sheet"&&(this.model={name:m.xmlDecode(a.attributes.name),id:parseInt(a.attributes.sheetId,10),state:a.attributes.state,rId:a.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){o.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:a.fullCalcOnLoad?1:void 0})}parseOpen(o){return o.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){o.leafNode("workbookPr",{date1904:a.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(o){return o.name==="workbookPr"&&(this.model={date1904:o.attributes.date1904==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){const r={xWindow:a.x||0,yWindow:a.y||0,windowWidth:a.width||12e3,windowHeight:a.height||24e3,firstSheet:a.firstSheet,activeTab:a.activeTab};a.visibility&&a.visibility!=="visible"&&(r.visibility=a.visibility),o.leafNode("workbookView",r)}parseOpen(o){if(o.name==="workbookView"){const a=this.model={},r=function(e,l,n){const i=l!==void 0?a[e]=l:n;i!==void 0&&(a[e]=i)},t=function(e,l,n){const i=l!==void 0?a[e]=parseInt(l,10):n;i!==void 0&&(a[e]=i)};return t("x",o.attributes.xWindow,0),t("y",o.attributes.yWindow,0),t("width",o.attributes.windowWidth,25e3),t("height",o.attributes.windowHeight,1e4),r("visibility",o.attributes.visibility,"visible"),t("activeTab",o.attributes.activeTab,void 0),t("firstSheet",o.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../../../utils/col-cache"),a=s("../../../utils/xml-stream"),r=s("../base-xform"),t=s("../static-xform"),e=s("../list-xform"),l=s("./defined-name-xform"),n=s("./sheet-xform"),i=s("./workbook-view-xform"),c=s("./workbook-properties-xform"),h=s("./workbook-calc-properties-xform");class u extends r{constructor(){super(),this.map={fileVersion:u.STATIC_XFORMS.fileVersion,workbookPr:new c,bookViews:new e({tag:"bookViews",count:!1,childXform:new i}),sheets:new e({tag:"sheets",count:!1,childXform:new n}),definedNames:new e({tag:"definedNames",count:!1,childXform:new l}),calcPr:new h}}prepare(f){f.sheets=f.worksheets;const w=[];let _=0;f.sheets.forEach(A=>{if(A.pageSetup&&A.pageSetup.printArea&&A.pageSetup.printArea.split("&&").forEach(N=>{const L=N.split(":"),I={name:"_xlnm.Print_Area",ranges:[`'${A.name}'!$${L[0]}:$${L[1]}`],localSheetId:_};w.push(I)}),A.pageSetup&&(A.pageSetup.printTitlesRow||A.pageSetup.printTitlesColumn)){const N=[];if(A.pageSetup.printTitlesColumn){const I=A.pageSetup.printTitlesColumn.split(":");N.push(`'${A.name}'!$${I[0]}:$${I[1]}`)}if(A.pageSetup.printTitlesRow){const I=A.pageSetup.printTitlesRow.split(":");N.push(`'${A.name}'!$${I[0]}:$${I[1]}`)}const L={name:"_xlnm.Print_Titles",ranges:N,localSheetId:_};w.push(L)}_++}),w.length&&(f.definedNames=f.definedNames.concat(w)),(f.media||[]).forEach((A,N)=>{A.name=A.type+(N+1)})}render(f,w){f.openXml(a.StdDocAttributes),f.openNode("workbook",u.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(f),this.map.workbookPr.render(f,w.properties),this.map.bookViews.render(f,w.views),this.map.sheets.render(f,w.sheets),this.map.definedNames.render(f,w.definedNames),this.map.calcPr.render(f,w.calcProperties),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"workbook":return!0;default:return this.parser=this.map[f.name],this.parser&&this.parser.parseOpen(f),!0}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser)return this.parser.parseClose(f)||(this.parser=void 0),!0;switch(f){case"workbook":return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1;default:return!0}}reconcile(f){const w=(f.workbookRels||[]).reduce((I,P)=>(I[P.Id]=P,I),{}),_=[];let A,N=0;(f.sheets||[]).forEach(I=>{const P=w[I.rId];P&&(A=f.worksheetHash["xl/"+P.Target.replace(/^(\s|\/xl\/)+/,"")],A&&(A.name=I.name,A.id=I.id,A.state=I.state,_[N++]=A))});const L=[];m.each(f.definedNames,I=>{if(I.name==="_xlnm.Print_Area"){if(A=_[I.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=o.decodeEx(I.ranges[0]);A.pageSetup.printArea=A.pageSetup.printArea?`${A.pageSetup.printArea}&&${P.dimensions}`:P.dimensions}}else if(I.name==="_xlnm.Print_Titles"){if(A=_[I.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=I.ranges.join(","),D=/\$/g,U=/\$\d+:\$\d+/,B=P.match(U);if(B&&B.length){const v=B[0];A.pageSetup.printTitlesRow=v.replace(D,"")}const x=/\$[A-Z]+:\$[A-Z]+/,M=P.match(x);if(M&&M.length){const v=M[0];A.pageSetup.printTitlesColumn=v.replace(D,"")}}}else L.push(I)}),f.definedNames=L,f.media.forEach((I,P)=>{I.index=P})}}u.WORKBOOK_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x15","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},u.STATIC_XFORMS={fileVersion:new t({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},T.exports=u},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(s,T,S){const m=s("../strings/rich-text-xform"),o=s("../../../utils/utils"),a=s("../base-xform"),r=T.exports=function(t){this.model=t};o.inherits(r,a,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new m),this._richTextXform},render(t,e){e=e||this.model,t.openNode("comment",{ref:e.ref,authorId:0}),t.openNode("text"),e&&e.note&&e.note.texts&&e.note.texts.forEach(l=>{this.richTextXform.render(t,l)}),t.closeNode(),t.closeNode()},parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"comment":return this.model={type:"note",note:{texts:[]},...t.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(t),!0;default:return!1}},parseText(t){this.parser&&this.parser.parseText(t)},parseClose(t){switch(t){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(t),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../../../utils/utils"),a=s("../base-xform"),r=s("./comment-xform"),t=T.exports=function(){this.map={comment:new r}};o.inherits(t,a,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(e,l){l=l||this.model,e.openXml(m.StdDocAttributes),e.openNode("comments",t.COMMENTS_ATTRIBUTES),e.openNode("authors"),e.leafNode("author",null,"Author"),e.closeNode(),e.openNode("commentList"),l.comments.forEach(n=>{this.map.comment.render(e,n)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,a,r){(a===r[2]||this.tag==="x:SizeWithCells"&&a===r[1])&&o.leafNode(this.tag)}parseOpen(o){switch(o.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(o){switch(o.name){case this.tag:return this.text="",!0;default:return!1}}parseText(o){this.text=o}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"x:Anchor"}getAnchorRect(o){const a=Math.floor(o.left),r=Math.floor(68*(o.left-a)),t=Math.floor(o.top),e=Math.floor(18*(o.top-t)),l=Math.floor(o.right),n=Math.floor(68*(o.right-l)),i=Math.floor(o.bottom);return[a,r,t,e,l,n,i,Math.floor(18*(o.bottom-i))]}getDefaultRect(o){const a=o.col,r=Math.max(o.row-2,0);return[a,6,r,14,a+2,2,r+4,16]}render(o,a){const r=a.anchor?this.getAnchorRect(a.anchor):this.getDefaultRect(a.refAddress);o.leafNode("x:Anchor",null,r.join(", "))}parseOpen(o){switch(o.name){case this.tag:return this.text="",!0;default:return!1}}parseText(o){this.text=o}parseClose(){return!1}}},{"../base-xform":32}],44:[function(s,T,S){const m=s("../base-xform"),o=s("./vml-anchor-xform"),a=s("./style/vml-protection-xform"),r=s("./style/vml-position-xform"),t=["twoCells","oneCells","absolute"];T.exports=class extends m{constructor(){super(),this.map={"x:Anchor":new o,"x:Locked":new a({tag:"x:Locked"}),"x:LockText":new a({tag:"x:LockText"}),"x:SizeWithCells":new r({tag:"x:SizeWithCells"}),"x:MoveWithCells":new r({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(e,l){const{protection:n,editAs:i}=l.note;e.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(e,i,t),this.map["x:SizeWithCells"].render(e,i,t),this.map["x:Anchor"].render(e,l),this.map["x:Locked"].render(e,n.locked),e.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(e,n.lockText),e.leafNode("x:Row",null,l.refAddress.row-1),e.leafNode("x:Column",null,l.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:""};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){const e=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),l=Object.keys(e).length;this.model.editAs=t[l],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./vml-shape-xform");class r extends o{constructor(){super(),this.map={"v:shape":new a}}get tag(){return"xml"}render(e,l){e.openXml(m.StdDocAttributes),e.openNode(this.tag,r.DRAWING_ATTRIBUTES),e.openNode("o:shapelayout",{"v:ext":"edit"}),e.leafNode("o:idmap",{"v:ext":"edit",data:1}),e.closeNode(),e.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),e.leafNode("v:stroke",{joinstyle:"miter"}),e.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),e.closeNode(),l.comments.forEach((n,i)=>{this.map["v:shape"].render(e,n,i)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,l){e.anchors.forEach(n=>{n.br?this.map["xdr:twoCellAnchor"].reconcile(n,l):this.map["xdr:oneCellAnchor"].reconcile(n,l)})}}r.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"},T.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(s,T,S){const m=s("../base-xform"),o=s("./vml-textbox-xform"),a=s("./vml-client-data-xform");class r extends m{constructor(){super(),this.map={"v:textbox":new o,"x:ClientData":new a}}get tag(){return"v:shape"}render(e,l,n){e.openNode("v:shape",r.V_SHAPE_ATTRIBUTES(l,n)),e.leafNode("v:fill",{color2:"infoBackground [80]"}),e.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),e.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(e,l),this.map["x:ClientData"].render(e,l),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1;default:return!0}}}r.V_SHAPE_ATTRIBUTES=(t,e)=>({id:"_x0000_s"+(1025+e),type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":t.note.margins&&t.note.margins.insetmode}),T.exports=r},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"v:textbox"}conversionUnit(o,a,r){return`${parseFloat(o)*a.toFixed(2)}${r}`}reverseConversionUnit(o){return(o||"").split(",").map(a=>Number(parseFloat(this.conversionUnit(parseFloat(a),.1,"")).toFixed(2)))}render(o,a){const r={style:"mso-direction-alt:auto"};if(a&&a.note){let{inset:t}=a.note&&a.note.margins;Array.isArray(t)&&(t=t.map(e=>this.conversionUnit(e,10,"mm")).join(",")),t&&(r.inset=t)}o.openNode("v:textbox",r),o.leafNode("div",{style:"text-align:left"}),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:return this.model={inset:this.reverseConversionUnit(o.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],48:[function(s,T,S){const m=s("./base-xform");T.exports=class extends m{createNewModel(o){return{}}parseOpen(o){return this.parser=this.parser||this.map[o.name],this.parser?(this.parser.parseOpen(o),!0):o.name===this.tag&&(this.model=this.createNewModel(o),!0)}parseText(o){this.parser&&this.parser.parseText(o)}onParserClose(o,a){this.model[o]=a.model}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.onParserClose(o,this.parser),this.parser=void 0),!0):o!==this.tag}}},{"./base-xform":32}],49:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){o.openNode("HeadingPairs"),o.openNode("vt:vector",{size:2,baseType:"variant"}),o.openNode("vt:variant"),o.leafNode("vt:lpstr",void 0,"Worksheets"),o.closeNode(),o.openNode("vt:variant"),o.leafNode("vt:i4",void 0,a.length),o.closeNode(),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="HeadingPairs"}parseText(){}parseClose(o){return o!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){o.openNode("TitlesOfParts"),o.openNode("vt:vector",{size:a.length,baseType:"lpstr"}),a.forEach(r=>{o.leafNode("vt:lpstr",void 0,r.name)}),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="TitlesOfParts"}parseText(){}parseClose(o){return o!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../simple/string-xform"),r=s("./app-heading-pairs-xform"),t=s("./app-titles-of-parts-xform");class e extends o{constructor(){super(),this.map={Company:new a({tag:"Company"}),Manager:new a({tag:"Manager"}),HeadingPairs:new r,TitleOfParts:new t}}render(n,i){n.openXml(m.StdDocAttributes),n.openNode("Properties",e.PROPERTY_ATTRIBUTES),n.leafNode("Application",void 0,"Microsoft Excel"),n.leafNode("DocSecurity",void 0,"0"),n.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(n,i.worksheets),this.map.TitleOfParts.render(n,i.worksheets),this.map.Company.render(n,i.company||""),this.map.Manager.render(n,i.manager),n.leafNode("LinksUpToDate",void 0,"false"),n.leafNode("SharedDoc",void 0,"false"),n.leafNode("HyperlinksChanged",void 0,"false"),n.leafNode("AppVersion",void 0,"16.0300"),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"Properties":return!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){case"Properties":return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}}e.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3,6}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},T.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform");class a extends o{render(t,e){t.openXml(m.StdDocAttributes),t.openNode("Types",a.PROPERTY_ATTRIBUTES);const l={};(e.media||[]).forEach(n=>{if(n.type==="image"){const i=n.extension;l[i]||(l[i]=!0,t.leafNode("Default",{Extension:i,ContentType:"image/"+i}))}}),t.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),t.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),t.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),e.worksheets.forEach(n=>{const i=`/xl/worksheets/sheet${n.id}.xml`;t.leafNode("Override",{PartName:i,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),t.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),t.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),e.sharedStrings&&e.sharedStrings.count&&t.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),e.tables&&e.tables.forEach(n=>{t.leafNode("Override",{PartName:"/xl/tables/"+n.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),e.drawings&&e.drawings.forEach(n=>{t.leafNode("Override",{PartName:`/xl/drawings/${n.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),e.commentRefs&&(t.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),e.commentRefs.forEach(n=>{let{commentName:i}=n;t.leafNode("Override",{PartName:`/xl/${i}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),t.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),t.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}a.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},T.exports=a},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../simple/date-xform"),r=s("../simple/string-xform"),t=s("../simple/integer-xform");class e extends o{constructor(){super(),this.map={"dc:creator":new r({tag:"dc:creator"}),"dc:title":new r({tag:"dc:title"}),"dc:subject":new r({tag:"dc:subject"}),"dc:description":new r({tag:"dc:description"}),"dc:identifier":new r({tag:"dc:identifier"}),"dc:language":new r({tag:"dc:language"}),"cp:keywords":new r({tag:"cp:keywords"}),"cp:category":new r({tag:"cp:category"}),"cp:lastModifiedBy":new r({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new a({tag:"cp:lastPrinted",format:e.DateFormat}),"cp:revision":new t({tag:"cp:revision"}),"cp:version":new r({tag:"cp:version"}),"cp:contentStatus":new r({tag:"cp:contentStatus"}),"cp:contentType":new r({tag:"cp:contentType"}),"dcterms:created":new a({tag:"dcterms:created",attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new a({tag:"dcterms:modified",attrs:e.DateAttrs,format:e.DateFormat})}}render(n,i){n.openXml(m.StdDocAttributes),n.openNode("cp:coreProperties",e.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(n,i.creator),this.map["dc:title"].render(n,i.title),this.map["dc:subject"].render(n,i.subject),this.map["dc:description"].render(n,i.description),this.map["dc:identifier"].render(n,i.identifier),this.map["dc:language"].render(n,i.language),this.map["cp:keywords"].render(n,i.keywords),this.map["cp:category"].render(n,i.category),this.map["cp:lastModifiedBy"].render(n,i.lastModifiedBy),this.map["cp:lastPrinted"].render(n,i.lastPrinted),this.map["cp:revision"].render(n,i.revision),this.map["cp:version"].render(n,i.version),this.map["cp:contentStatus"].render(n,i.contentStatus),this.map["cp:contentType"].render(n,i.contentType),this.map["dcterms:created"].render(n,i.created),this.map["dcterms:modified"].render(n,i.modified),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[n.name],this.parser)return this.parser.parseOpen(n),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(n))}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+n)}}}e.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},T.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){o.leafNode("Relationship",a)}parseOpen(o){switch(o.name){case"Relationship":return this.model=o.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./relationship-xform");class r extends o{constructor(){super(),this.map={Relationship:new a}}render(e,l){l=l||this._values,e.openXml(m.StdDocAttributes),e.openNode("Relationships",r.RELATIONSHIPS_ATTRIBUTES),l.forEach(n=>{this.map.Relationship.render(e,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"Relationships":return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case"Relationships":return!1;default:throw new Error("Unexpected xml node in parseClose: "+e)}}}r.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},T.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:this.reset(),this.model={range:{editAs:o.attributes.editAs||"oneCell"}};break;default:this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)}return!0}parseText(o){this.parser&&this.parser.parseText(o)}reconcilePicture(o,a){if(o&&o.rId){const r=a.rels[o.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){const t=r[1],e=a.mediaIndex[t];return a.media[e]}}}}},{"../base-xform":32}],57:[function(s,T,S){const m=s("../base-xform"),o=s("./blip-xform");T.exports=class extends m{constructor(){super(),this.map={"a:blip":new o}}get tag(){return"xdr:blipFill"}render(a,r){a.openNode(this.tag),this.map["a:blip"].render(a,r),a.openNode("a:stretch"),a.leafNode("a:fillRect"),a.closeNode(),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset();break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(){}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.parser=void 0),!0;switch(a){case this.tag:return this.model=this.map["a:blip"].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"a:blip"}render(o,a){o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":a.rId,cstate:"print"})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:embed"]},!0;default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],59:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"xdr:cNvPicPr"}render(o){o.openNode(this.tag),o.leafNode("a:picLocks",{noChangeAspect:"1"}),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(s,T,S){const m=s("../base-xform"),o=s("./hlink-click-xform"),a=s("./ext-lst-xform");T.exports=class extends m{constructor(){super(),this.map={"a:hlinkClick":new o,"a:extLst":new a}}get tag(){return"xdr:cNvPr"}render(r,t){r.openNode(this.tag,{id:t.index,name:"Picture "+t.index}),this.map["a:hlinkClick"].render(r,t),this.map["a:extLst"].render(r,t),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){case this.tag:return this.model=this.map["a:hlinkClick"].model,!1;default:return!0}}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(s,T,S){const m=s("../base-xform"),o=s("../simple/integer-xform");T.exports=class extends m{constructor(a){super(),this.tag=a.tag,this.map={"xdr:col":new o({tag:"xdr:col",zero:!0}),"xdr:colOff":new o({tag:"xdr:colOff",zero:!0}),"xdr:row":new o({tag:"xdr:row",zero:!0}),"xdr:rowOff":new o({tag:"xdr:rowOff",zero:!0})}}render(a,r){a.openNode(this.tag),this.map["xdr:col"].render(a,r.nativeCol),this.map["xdr:colOff"].render(a,r.nativeColOff),this.map["xdr:row"].render(a,r.nativeRow),this.map["xdr:rowOff"].render(a,r.nativeRowOff),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset();break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.parser=void 0),!0;switch(a){case this.tag:return this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1;default:return!0}}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(s,T,S){const m=s("../../../utils/col-cache"),o=s("../../../utils/xml-stream"),a=s("../base-xform"),r=s("./two-cell-anchor-xform"),t=s("./one-cell-anchor-xform");class e extends a{constructor(){super(),this.map={"xdr:twoCellAnchor":new r,"xdr:oneCellAnchor":new t}}prepare(n){n.anchors.forEach((i,c)=>{i.anchorType=function(h){return(typeof h.range=="string"?m.decode(h.range):h.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"}(i),this.map[i.anchorType].prepare(i,{index:c})})}get tag(){return"xdr:wsDr"}render(n,i){n.openXml(o.StdDocAttributes),n.openNode(this.tag,e.DRAWING_ATTRIBUTES),i.anchors.forEach(c=>{this.map[c.anchorType].render(n,c)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)}return!0}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(n){case this.tag:return!1;default:return!0}}reconcile(n,i){n.anchors.forEach(c=>{c.br?this.map["xdr:twoCellAnchor"].reconcile(c,i):this.map["xdr:oneCellAnchor"].reconcile(c,i)})}}e.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},T.exports=e},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"a:extLst"}render(o){o.openNode(this.tag),o.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),o.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),o.closeNode(),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],64:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.map={}}render(o,a){o.openNode(this.tag);const r=Math.floor(9525*a.width),t=Math.floor(9525*a.height);o.addAttribute("cx",r),o.addAttribute("cy",t),o.closeNode()}parseOpen(o){return o.name===this.tag&&(this.model={width:parseInt(o.attributes.cx||"0",10)/9525,height:parseInt(o.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"a:hlinkClick"}render(o,a){a.hyperlinks&&a.hyperlinks.rId&&o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":a.hyperlinks.rId,tooltip:a.hyperlinks.tooltip})}parseOpen(o){switch(o.name){case this.tag:return this.model={hyperlinks:{rId:o.attributes["r:id"],tooltip:o.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(s,T,S){const m=s("../base-xform"),o=s("./c-nv-pr-xform"),a=s("./c-nv-pic-pr-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:cNvPr":new o,"xdr:cNvPicPr":new a}}get tag(){return"xdr:nvPicPr"}render(r,t){r.openNode(this.tag),this.map["xdr:cNvPr"].render(r,t),this.map["xdr:cNvPicPr"].render(r,t),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){case this.tag:return this.model=this.map["xdr:cNvPr"].model,!1;default:return!0}}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(s,T,S){const m=s("./base-cell-anchor-xform"),o=s("../static-xform"),a=s("./cell-position-xform"),r=s("./ext-xform"),t=s("./pic-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:ext":new r({tag:"xdr:ext"}),"xdr:pic":new t,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(e,l){this.map["xdr:pic"].prepare(e.picture,l)}render(e,l){e.openNode(this.tag,{editAs:l.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,l.range.tl),this.map["xdr:ext"].render(e,l.range.ext),this.map["xdr:pic"].render(e,l.picture),this.map["xdr:clientData"].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(e,l){e.medium=this.reconcilePicture(e.picture,l)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(s,T,S){const m=s("../base-xform"),o=s("../static-xform"),a=s("./blip-fill-xform"),r=s("./nv-pic-pr-xform"),t=s("./sp-pr");T.exports=class extends m{constructor(){super(),this.map={"xdr:nvPicPr":new r,"xdr:blipFill":new a,"xdr:spPr":new o(t)}}get tag(){return"xdr:pic"}prepare(e,l){e.index=l.index+1}render(e,l){e.openNode(this.tag),this.map["xdr:nvPicPr"].render(e,l),this.map["xdr:blipFill"].render(e,l),this.map["xdr:spPr"].render(e,l),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(s,T,S){T.exports={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]}},{}],70:[function(s,T,S){const m=s("./base-cell-anchor-xform"),o=s("../static-xform"),a=s("./cell-position-xform"),r=s("./pic-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:to":new a({tag:"xdr:to"}),"xdr:pic":new r,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(t,e){this.map["xdr:pic"].prepare(t.picture,e)}render(t,e){t.openNode(this.tag,{editAs:e.range.editAs||"oneCell"}),this.map["xdr:from"].render(t,e.range.tl),this.map["xdr:to"].render(t,e.range.br),this.map["xdr:pic"].render(t,e.picture),this.map["xdr:clientData"].render(t,{}),t.closeNode()}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){case this.tag:return this.model.range.tl=this.map["xdr:from"].model,this.model.range.br=this.map["xdr:to"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(t,e){t.medium=this.reconcilePicture(t.picture,e)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(s,T,S){const m=s("./base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.always=!!o.always,this.count=o.count,this.empty=o.empty,this.$count=o.$count||"count",this.$=o.$,this.childXform=o.childXform,this.maxItems=o.maxItems}prepare(o,a){const{childXform:r}=this;o&&o.forEach((t,e)=>{a.index=e,r.prepare(t,a)})}render(o,a){if(this.always||a&&a.length){o.openNode(this.tag,this.$),this.count&&o.addAttribute(this.$count,a&&a.length||0);const{childXform:r}=this;(a||[]).forEach((t,e)=>{r.render(o,t,e)}),o.closeNode()}else this.empty&&o.leafNode(this.tag)}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:return this.model=[],!0;default:return!!this.childXform.parseOpen(o)&&(this.parser=this.childXform,!0)}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser){if(!this.parser.parseClose(o)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(o,a){if(o){const{childXform:r}=this;o.forEach(t=>{r.reconcile(t,a)})}}}},{"./base-xform":32}],72:[function(s,T,S){const m=s("../../../utils/col-cache"),o=s("../base-xform");T.exports=class extends o{get tag(){return"autoFilter"}render(a,r){if(r)if(typeof r=="string")a.leafNode("autoFilter",{ref:r});else{const t=function(n){return typeof n=="string"?n:m.getAddress(n.row,n.column).address},e=t(r.from),l=t(r.to);e&&l&&a.leafNode("autoFilter",{ref:`${e}:${l}`})}}parseOpen(a){a.name==="autoFilter"&&(this.model=a.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(s,T,S){const m=s("../../../utils/utils"),o=s("../base-xform"),a=s("../../../doc/range"),r=s("../../../doc/enums"),t=s("../strings/rich-text-xform");function e(l){if(l==null)return r.ValueType.Null;if(l instanceof String||typeof l=="string")return r.ValueType.String;if(typeof l=="number")return r.ValueType.Number;if(typeof l=="boolean")return r.ValueType.Boolean;if(l instanceof Date)return r.ValueType.Date;if(l.text&&l.hyperlink)return r.ValueType.Hyperlink;if(l.formula)return r.ValueType.Formula;if(l.error)return r.ValueType.Error;throw new Error("I could not understand type of value")}T.exports=class extends o{constructor(){super(),this.richTextXForm=new t}get tag(){return"c"}prepare(l,n){const i=n.styles.addStyleModel(l.style||{},function(c){switch(c.type){case r.ValueType.Formula:return e(c.result);default:return c.type}}(l));switch(i&&(l.styleId=i),l.comment&&n.comments.push({...l.comment,ref:l.address}),l.type){case r.ValueType.String:case r.ValueType.RichText:n.sharedStrings&&(l.ssId=n.sharedStrings.add(l.value));break;case r.ValueType.Date:n.date1904&&(l.date1904=!0);break;case r.ValueType.Hyperlink:n.sharedStrings&&l.text!==void 0&&l.text!==null&&(l.ssId=n.sharedStrings.add(l.text)),n.hyperlinks.push({address:l.address,target:l.hyperlink,tooltip:l.tooltip});break;case r.ValueType.Merge:n.merges.add(l);break;case r.ValueType.Formula:if(n.date1904&&(l.date1904=!0),l.shareType==="shared"&&(l.si=n.siFormulae++),l.formula)n.formulae[l.address]=l;else if(l.sharedFormula){const c=n.formulae[l.sharedFormula];if(!c)throw new Error("Shared Formula master must exist above and or left of clone for cell "+l.address);c.si===void 0?(c.shareType="shared",c.si=n.siFormulae++,c.range=new a(c.address,l.address)):c.range&&c.range.expandToAddress(l.address),l.si=c.si}}}renderFormula(l,n){let i=null;switch(n.shareType){case"shared":i={t:"shared",ref:n.ref||n.range.range,si:n.si};break;case"array":i={t:"array",ref:n.ref};break;default:n.si!==void 0&&(i={t:"shared",si:n.si})}switch(e(n.result)){case r.ValueType.Null:l.leafNode("f",i,n.formula);break;case r.ValueType.String:l.addAttribute("t","str"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result);break;case r.ValueType.Number:l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result?1:0);break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result.error);break;case r.ValueType.Date:l.leafNode("f",i,n.formula),l.leafNode("v",null,m.dateToExcel(n.result,n.date1904));break;default:throw new Error("I could not understand type of value")}}render(l,n){if(n.type!==r.ValueType.Null||n.styleId){switch(l.openNode("c"),l.addAttribute("r",n.address),n.styleId&&l.addAttribute("s",n.styleId),n.type){case r.ValueType.Null:break;case r.ValueType.Number:l.leafNode("v",null,n.value);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("v",null,n.value?"1":"0");break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("v",null,n.value.error);break;case r.ValueType.String:case r.ValueType.RichText:n.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,n.ssId)):n.value&&n.value.richText?(l.addAttribute("t","inlineStr"),l.openNode("is"),n.value.richText.forEach(i=>{this.richTextXForm.render(l,i)}),l.closeNode("is")):(l.addAttribute("t","str"),l.leafNode("v",null,n.value));break;case r.ValueType.Date:l.leafNode("v",null,m.dateToExcel(n.value,n.date1904));break;case r.ValueType.Hyperlink:n.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,n.ssId)):(l.addAttribute("t","str"),l.leafNode("v",null,n.text));break;case r.ValueType.Formula:this.renderFormula(l,n);break;case r.ValueType.Merge:}l.closeNode()}}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case"c":return this.model={address:l.attributes.r},this.t=l.attributes.t,l.attributes.s&&(this.model.styleId=parseInt(l.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=l.attributes.si,this.model.shareType=l.attributes.t,this.model.ref=l.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(l),!0;default:return!1}}parseText(l){if(this.parser)this.parser.parseText(l);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+l:l;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+l:l:this.model.value=this.model.value?this.model.value+l:l}}parseClose(l){switch(l){case"c":{const{model:n}=this;if(n.formula||n.shareType)n.type=r.ValueType.Formula,n.value&&(this.t==="str"?n.result=m.xmlDecode(n.value):this.t==="b"?n.result=parseInt(n.value,10)!==0:this.t==="e"?n.result={error:n.value}:n.result=parseFloat(n.value),n.value=void 0);else if(n.value!==void 0)switch(this.t){case"s":n.type=r.ValueType.String,n.value=parseInt(n.value,10);break;case"str":n.type=r.ValueType.String,n.value=m.xmlDecode(n.value);break;case"inlineStr":n.type=r.ValueType.String;break;case"b":n.type=r.ValueType.Boolean,n.value=parseInt(n.value,10)!==0;break;case"e":n.type=r.ValueType.Error,n.value={error:n.value};break;default:n.type=r.ValueType.Number,n.value=parseFloat(n.value)}else n.styleId?n.type=r.ValueType.Null:n.type=r.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(l),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(l),!0)}}reconcile(l,n){const i=l.styleId&&n.styles&&n.styles.getStyleModel(l.styleId);switch(i&&(l.style=i),l.styleId!==void 0&&(l.styleId=void 0),l.type){case r.ValueType.String:typeof l.value=="number"&&n.sharedStrings&&(l.value=n.sharedStrings.getString(l.value)),l.value.richText&&(l.type=r.ValueType.RichText);break;case r.ValueType.Number:i&&m.isDateFmt(i.numFmt)&&(l.type=r.ValueType.Date,l.value=m.excelToDate(l.value,n.date1904));break;case r.ValueType.Formula:l.result!==void 0&&i&&m.isDateFmt(i.numFmt)&&(l.result=m.excelToDate(l.result,n.date1904)),l.shareType==="shared"&&(l.ref?n.formulae[l.si]=l.address:(l.sharedFormula=n.formulae[l.si],delete l.shareType),delete l.si)}const c=n.hyperlinkMap[l.address];c&&(l.type===r.ValueType.Formula?(l.text=l.result,l.result=void 0):(l.text=l.value,l.value=void 0),l.type=r.ValueType.Hyperlink,l.hyperlink=c);const h=n.commentsMap&&n.commentsMap[l.address];h&&(l.comment=h)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"x14:cfIcon"}render(o,a){o.leafNode(this.tag,{iconSet:a.iconSet,iconId:a.iconId})}parseOpen(o){let{attributes:a}=o;this.model={iconSet:a.iconSet,iconId:m.toIntValue(a.iconId)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],75:[function(s,T,S){const{v4:m}=s("uuid"),o=s("../../base-xform"),a=s("../../composite-xform"),r=s("./databar-ext-xform"),t=s("./icon-set-ext-xform"),e={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends a{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new r,"x14:iconSet":this.iconSetXform=new t}}get tag(){return"x14:cfRule"}static isExt(i){return i.type==="dataBar"?r.isExt(i):!(i.type!=="iconSet"||!i.custom&&!e[i.iconSet])}prepare(i){l.isExt(i)&&(i.x14Id=`{${m()}}`.toUpperCase())}render(i,c){if(l.isExt(c))switch(c.type){case"dataBar":this.renderDataBar(i,c);break;case"iconSet":this.renderIconSet(i,c)}}renderDataBar(i,c){i.openNode(this.tag,{type:"dataBar",id:c.x14Id}),this.databarXform.render(i,c),i.closeNode()}renderIconSet(i,c){i.openNode(this.tag,{type:"iconSet",priority:c.priority,id:c.x14Id||`{${m()}}`}),this.iconSetXform.render(i,c),i.closeNode()}createNewModel(i){let{attributes:c}=i;return{type:c.type,x14Id:c.id,priority:o.toIntValue(c.priority)}}onParserClose(i,c){Object.assign(this.model,c.model)}}T.exports=l},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(s,T,S){const m=s("../../composite-xform"),o=s("./f-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"xm:f":this.fExtXform=new o}}get tag(){return"x14:cfvo"}render(a,r){a.openNode(this.tag,{type:r.type}),r.value!==void 0&&this.fExtXform.render(a,r.value),a.closeNode()}createNewModel(a){return{type:a.attributes.type}}onParserClose(a,r){switch(a){case"xm:f":this.model.value=r.model?parseFloat(r.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(s,T,S){const m=s("../../composite-xform"),o=s("./sqref-ext-xform"),a=s("./cf-rule-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"xm:sqref":this.sqRef=new o,"x14:cfRule":this.cfRule=new a}}get tag(){return"x14:conditionalFormatting"}prepare(r,t){r.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(r,t){t.rules.some(a.isExt)&&(r.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(a.isExt).forEach(e=>this.cfRule.render(r,e)),this.sqRef.render(r,t.ref),r.closeNode())}createNewModel(){return{rules:[]}}onParserClose(r,t){switch(r){case"xm:sqref":this.model.ref=t.model;break;case"x14:cfRule":this.model.rules.push(t.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(s,T,S){const m=s("../../composite-xform"),o=s("./cf-rule-ext-xform"),a=s("./conditional-formatting-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new a}}get tag(){return"x14:conditionalFormattings"}hasContent(r){return r.hasExtContent===void 0&&(r.hasExtContent=r.some(t=>t.rules.some(o.isExt))),r.hasExtContent}prepare(r,t){r.forEach(e=>{this.cfXform.prepare(e,t)})}render(r,t){this.hasContent(t)&&(r.openNode(this.tag),t.forEach(e=>this.cfXform.render(r,e)),r.closeNode())}createNewModel(){return[]}onParserClose(r,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(s,T,S){const m=s("../../base-xform"),o=s("../../composite-xform"),a=s("../../style/color-xform"),r=s("./cfvo-ext-xform");T.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new r,"x14:borderColor":this.borderColorXform=new a("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new a("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new a("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new a("x14:axisColor")}}static isExt(t){return!t.gradient}get tag(){return"x14:dataBar"}render(t,e){t.openNode(this.tag,{minLength:m.toIntAttribute(e.minLength,0,!0),maxLength:m.toIntAttribute(e.maxLength,100,!0),border:m.toBoolAttribute(e.border,!1),gradient:m.toBoolAttribute(e.gradient,!0),negativeBarColorSameAsPositive:m.toBoolAttribute(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:m.toBoolAttribute(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:m.toAttribute(e.axisPosition,"auto"),direction:m.toAttribute(e.direction,"leftToRight")}),e.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),this.borderColorXform.render(t,e.borderColor),this.negativeBorderColorXform.render(t,e.negativeBorderColor),this.negativeFillColorXform.render(t,e.negativeFillColor),this.axisColorXform.render(t,e.axisColor),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],minLength:m.toIntValue(e.minLength,0),maxLength:m.toIntValue(e.maxLength,100),border:m.toBoolValue(e.border,!1),gradient:m.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:m.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:m.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:m.toStringValue(e.axisPosition,"auto"),direction:m.toStringValue(e.direction,"leftToRight")}}onParserClose(t,e){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(e.model);break;default:this.model[l]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"xm:f"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],81:[function(s,T,S){const m=s("../../base-xform"),o=s("../../composite-xform"),a=s("./cfvo-ext-xform"),r=s("./cf-icon-ext-xform");T.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new a,"x14:cfIcon":this.cfIconXform=new r}}get tag(){return"x14:iconSet"}render(t,e){t.openNode(this.tag,{iconSet:m.toStringAttribute(e.iconSet),reverse:m.toBoolAttribute(e.reverse,!1),showValue:m.toBoolAttribute(e.showValue,!0),custom:m.toBoolAttribute(e.icons,!1)}),e.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),e.icons&&e.icons.forEach((l,n)=>{l.iconId=n,this.cfIconXform.render(t,l)}),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],iconSet:m.toStringValue(e.iconSet,"3TrafficLights"),reverse:m.toBoolValue(e.reverse,!1),showValue:m.toBoolValue(e.showValue,!0)}}onParserClose(t,e){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(e.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(e.model);break;default:this.model[l]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"xm:sqref"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],83:[function(s,T,S){const m=s("../../base-xform"),o=s("../../composite-xform"),a=s("../../../../doc/range"),r=s("./databar-xform"),t=s("./ext-lst-ref-xform"),e=s("./formula-xform"),l=s("./color-scale-xform"),n=s("./icon-set-xform"),i={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},c=u=>{const{type:d,operator:f}=u;switch(d){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:d};default:return{type:d,operator:f}}};class h extends o{constructor(){super(),this.map={dataBar:this.databarXform=new r,extLst:this.extLstRefXform=new t,formula:this.formulaXform=new e,colorScale:this.colorScaleXform=new l,iconSet:this.iconSetXform=new n}}get tag(){return"cfRule"}static isPrimitive(d){return d.type!=="iconSet"||!d.custom&&!i[d.iconSet]}render(d,f){switch(f.type){case"expression":this.renderExpression(d,f);break;case"cellIs":this.renderCellIs(d,f);break;case"top10":this.renderTop10(d,f);break;case"aboveAverage":this.renderAboveAverage(d,f);break;case"dataBar":this.renderDataBar(d,f);break;case"colorScale":this.renderColorScale(d,f);break;case"iconSet":this.renderIconSet(d,f);break;case"containsText":this.renderText(d,f);break;case"timePeriod":this.renderTimePeriod(d,f)}}renderExpression(d,f){d.openNode(this.tag,{type:"expression",dxfId:f.dxfId,priority:f.priority}),this.formulaXform.render(d,f.formulae[0]),d.closeNode()}renderCellIs(d,f){d.openNode(this.tag,{type:"cellIs",dxfId:f.dxfId,priority:f.priority,operator:f.operator}),f.formulae.forEach(w=>{this.formulaXform.render(d,w)}),d.closeNode()}renderTop10(d,f){d.leafNode(this.tag,{type:"top10",dxfId:f.dxfId,priority:f.priority,percent:m.toBoolAttribute(f.percent,!1),bottom:m.toBoolAttribute(f.bottom,!1),rank:m.toIntValue(f.rank,10,!0)})}renderAboveAverage(d,f){d.leafNode(this.tag,{type:"aboveAverage",dxfId:f.dxfId,priority:f.priority,aboveAverage:m.toBoolAttribute(f.aboveAverage,!0)})}renderDataBar(d,f){d.openNode(this.tag,{type:"dataBar",priority:f.priority}),this.databarXform.render(d,f),this.extLstRefXform.render(d,f),d.closeNode()}renderColorScale(d,f){d.openNode(this.tag,{type:"colorScale",priority:f.priority}),this.colorScaleXform.render(d,f),d.closeNode()}renderIconSet(d,f){h.isPrimitive(f)&&(d.openNode(this.tag,{type:"iconSet",priority:f.priority}),this.iconSetXform.render(d,f),d.closeNode())}renderText(d,f){d.openNode(this.tag,{type:f.operator,dxfId:f.dxfId,priority:f.priority,operator:m.toStringAttribute(f.operator,"containsText")});const w=(_=>{if(_.formulae&&_.formulae[0])return _.formulae[0];const A=new a(_.ref),{tl:N}=A;switch(_.operator){case"containsText":return`NOT(ISERROR(SEARCH("${_.text}",${N})))`;case"containsBlanks":return`LEN(TRIM(${N}))=0`;case"notContainsBlanks":return`LEN(TRIM(${N}))>0`;case"containsErrors":return`ISERROR(${N})`;case"notContainsErrors":return`NOT(ISERROR(${N}))`;default:return}})(f);w&&this.formulaXform.render(d,w),d.closeNode()}renderTimePeriod(d,f){d.openNode(this.tag,{type:"timePeriod",dxfId:f.dxfId,priority:f.priority,timePeriod:f.timePeriod});const w=(_=>{if(_.formulae&&_.formulae[0])return _.formulae[0];const A=new a(_.ref),{tl:N}=A;switch(_.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${N},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${N},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${N},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${N},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${N},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${N},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${N},1)=TODAY()-1`;case"today":return`FLOOR(${N},1)=TODAY()`;case"tomorrow":return`FLOOR(${N},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${N},1)<=6,FLOOR(${N},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${N})=MONTH(EDATE(TODAY(),0-1)),YEAR(${N})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${N})=MONTH(TODAY()),YEAR(${N})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${N})=MONTH(EDATE(TODAY(),0+1)),YEAR(${N})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(f);w&&this.formulaXform.render(d,w),d.closeNode()}createNewModel(d){let{attributes:f}=d;return{...c(f),dxfId:m.toIntValue(f.dxfId),priority:m.toIntValue(f.priority),timePeriod:f.timePeriod,percent:m.toBoolValue(f.percent),bottom:m.toBoolValue(f.bottom),rank:m.toIntValue(f.rank),aboveAverage:m.toBoolValue(f.aboveAverage)}}onParserClose(d,f){switch(d){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,f.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(f.model)}}}T.exports=h},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"cfvo"}render(o,a){o.leafNode(this.tag,{type:a.type,val:a.value})}parseOpen(o){this.model={type:o.attributes.type,value:m.toFloatValue(o.attributes.val)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],85:[function(s,T,S){const m=s("../../composite-xform"),o=s("../../style/color-xform"),a=s("./cfvo-xform");T.exports=class extends m{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new o}}get tag(){return"colorScale"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),t.color.forEach(e=>{this.colorXform.render(r,e)}),r.closeNode()}createNewModel(r){return{cfvo:[],color:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(s,T,S){const m=s("../../composite-xform"),o=s("./cf-rule-xform");T.exports=class extends m{constructor(){super(),this.map={cfRule:new o}}get tag(){return"conditionalFormatting"}render(a,r){r.rules.some(o.isPrimitive)&&(a.openNode(this.tag,{sqref:r.ref}),r.rules.forEach(t=>{o.isPrimitive(t)&&(t.ref=r.ref,this.map.cfRule.render(a,t))}),a.closeNode())}createNewModel(a){let{attributes:r}=a;return{ref:r.sqref,rules:[]}}onParserClose(a,r){this.model.rules.push(r.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(s,T,S){const m=s("../../base-xform"),o=s("./conditional-formatting-xform");T.exports=class extends m{constructor(){super(),this.cfXform=new o}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(a,r){let t=a.reduce((e,l)=>Math.max(e,...l.rules.map(n=>n.priority||0)),1);a.forEach(e=>{e.rules.forEach(l=>{l.priority||(l.priority=t++),l.style&&(l.dxfId=r.styles.addDxfStyle(l.style))})})}render(a,r){r.forEach(t=>{this.cfXform.render(a,t)})}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"conditionalFormatting":return this.parser=this.cfXform,this.parser.parseOpen(a),!0;default:return!1}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){return!!this.parser&&(!!this.parser.parseClose(a)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(a,r){a.forEach(t=>{t.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=r.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(s,T,S){const m=s("../../composite-xform"),o=s("../../style/color-xform"),a=s("./cfvo-xform");T.exports=class extends m{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new o}}get tag(){return"dataBar"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),this.colorXform.render(r,t.color),r.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(r,t){switch(r){case"cfvo":this.model.cfvo.push(t.model);break;case"color":this.model.color=t.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(s,T,S){const m=s("../../base-xform"),o=s("../../composite-xform");class a extends m{get tag(){return"x14:id"}render(e,l){e.leafNode(this.tag,null,l)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}class r extends o{constructor(){super(),this.map={"x14:id":this.idXform=new a}}get tag(){return"ext"}render(e,l){e.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(e,l.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,l){this.model.x14Id=l.model}}T.exports=class extends o{constructor(){super(),this.map={ext:new r}}get tag(){return"extLst"}render(t,e){t.openNode(this.tag),this.map.ext.render(t,e),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){Object.assign(this.model,e.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"formula"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],91:[function(s,T,S){const m=s("../../base-xform"),o=s("../../composite-xform"),a=s("./cfvo-xform");T.exports=class extends o{constructor(){super(),this.map={cfvo:this.cfvoXform=new a}}get tag(){return"iconSet"}render(r,t){r.openNode(this.tag,{iconSet:m.toStringAttribute(t.iconSet,"3TrafficLights"),reverse:m.toBoolAttribute(t.reverse,!1),showValue:m.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),r.closeNode()}createNewModel(r){let{attributes:t}=r;return{iconSet:m.toStringValue(t.iconSet,"3TrafficLights"),reverse:m.toBoolValue(t.reverse),showValue:m.toBoolValue(t.showValue),cfvo:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(s,T,S){const m=s("../../../utils/utils"),o=s("../base-xform");T.exports=class extends o{get tag(){return"col"}prepare(a,r){const t=r.styles.addStyleModel(a.style||{});t&&(a.styleId=t)}render(a,r){a.openNode("col"),a.addAttribute("min",r.min),a.addAttribute("max",r.max),r.width&&a.addAttribute("width",r.width),r.styleId&&a.addAttribute("style",r.styleId),r.hidden&&a.addAttribute("hidden","1"),r.bestFit&&a.addAttribute("bestFit","1"),r.outlineLevel&&a.addAttribute("outlineLevel",r.outlineLevel),r.collapsed&&a.addAttribute("collapsed","1"),a.addAttribute("customWidth","1"),a.closeNode()}parseOpen(a){if(a.name==="col"){const r=this.model={min:parseInt(a.attributes.min||"0",10),max:parseInt(a.attributes.max||"0",10),width:a.attributes.width===void 0?void 0:parseFloat(a.attributes.width||"0")};return a.attributes.style&&(r.styleId=parseInt(a.attributes.style,10)),m.parseBoolean(a.attributes.hidden)&&(r.hidden=!0),m.parseBoolean(a.attributes.bestFit)&&(r.bestFit=!0),a.attributes.outlineLevel&&(r.outlineLevel=parseInt(a.attributes.outlineLevel,10)),m.parseBoolean(a.attributes.collapsed)&&(r.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(a,r){a.styleId&&(a.style=r.styles.getStyleModel(a.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../../../utils/utils"),a=s("../../../utils/col-cache"),r=s("../base-xform"),t=s("../../../doc/range");function e(n,i,c,h){const u=i[c];u!==void 0?n[c]=u:h!==void 0&&(n[c]=h)}function l(n,i,c,h){const u=i[c];u!==void 0&&(n[c]=o.parseBoolean(u))}T.exports=class extends r{get tag(){return"dataValidations"}render(n,i){const c=function(h){const u=m.map(h,(w,_)=>({address:_,dataValidation:w,marked:!1})).sort((w,_)=>m.strcmp(w.address,_.address)),d=m.keyBy(u,"address"),f=(w,_,A)=>{for(let N=0;N<_;N++){const L=a.encodeAddress(w.row+N,A);if(!h[L]||!m.isEqual(h[w.address],h[L]))return!1}return!0};return u.map(w=>{if(!w.marked){const _=a.decodeEx(w.address);if(_.dimensions)return d[_.dimensions].marked=!0,{...w.dataValidation,sqref:w.address};let A=1,N=a.encodeAddress(_.row+A,_.col);for(;h[N]&&m.isEqual(w.dataValidation,h[N]);)A++,N=a.encodeAddress(_.row+A,_.col);let L=1;for(;f(_,A,_.col+L);)L++;for(let I=0;I1||L>1){const I=_.row+(A-1),P=_.col+(L-1);return{...w.dataValidation,sqref:`${w.address}:${a.encodeAddress(I,P)}`}}return{...w.dataValidation,sqref:w.address}}return null}).filter(Boolean)}(i);c.length&&(n.openNode("dataValidations",{count:c.length}),c.forEach(h=>{n.openNode("dataValidation"),h.type!=="any"&&(n.addAttribute("type",h.type),h.operator&&h.type!=="list"&&h.operator!=="between"&&n.addAttribute("operator",h.operator),h.allowBlank&&n.addAttribute("allowBlank","1")),h.showInputMessage&&n.addAttribute("showInputMessage","1"),h.promptTitle&&n.addAttribute("promptTitle",h.promptTitle),h.prompt&&n.addAttribute("prompt",h.prompt),h.showErrorMessage&&n.addAttribute("showErrorMessage","1"),h.errorStyle&&n.addAttribute("errorStyle",h.errorStyle),h.errorTitle&&n.addAttribute("errorTitle",h.errorTitle),h.error&&n.addAttribute("error",h.error),n.addAttribute("sqref",h.sqref),(h.formulae||[]).forEach((u,d)=>{n.openNode("formula"+(d+1)),h.type==="date"?n.writeText(o.dateToExcel(new Date(u))):n.writeText(u),n.closeNode()}),n.closeNode()}),n.closeNode())}parseOpen(n){switch(n.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=n.attributes.sqref;const i={type:n.attributes.type||"any",formulae:[]};switch(n.attributes.type&&l(i,n.attributes,"allowBlank"),l(i,n.attributes,"showInputMessage"),l(i,n.attributes,"showErrorMessage"),i.type){case"any":case"list":case"custom":break;default:e(i,n.attributes,"operator","between")}return e(i,n.attributes,"promptTitle"),e(i,n.attributes,"prompt"),e(i,n.attributes,"errorStyle"),e(i,n.attributes,"errorTitle"),e(i,n.attributes,"error"),this._dataValidation=i,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(n){this._formula&&this._formula.push(n)}parseClose(n){switch(n){case"dataValidations":return!1;case"dataValidation":return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(i=>{i.includes(":")?new t(i).forEachAddress(c=>{this.model[c]=this._dataValidation}):this.model[i]=this._dataValidation}),!0;case"formula1":case"formula2":{let i=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":i=parseInt(i,10);break;case"decimal":i=parseFloat(i);break;case"date":i=o.excelToDate(parseFloat(i))}return this._dataValidation.formulae.push(i),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"dimension"}render(o,a){a&&o.leafNode("dimension",{ref:a})}parseOpen(o){return o.name==="dimension"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"drawing"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(s,T,S){const m=s("../composite-xform"),o=s("./cf-ext/conditional-formattings-ext-xform");class a extends m{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new o}}get tag(){return"ext"}hasContent(t){return this.conditionalFormattings.hasContent(t.conditionalFormattings)}prepare(t,e){this.conditionalFormattings.prepare(t.conditionalFormattings,e)}render(t,e){t.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(t,e.conditionalFormattings),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){this.model[t]=e.model}}T.exports=class extends m{constructor(){super(),this.map={ext:this.ext=new a}}get tag(){return"extLst"}prepare(r,t){this.ext.prepare(r,t)}hasContent(r){return this.ext.hasContent(r)}render(r,t){this.hasContent(t)&&(r.openNode("extLst"),this.ext.render(r,t),r.closeNode())}createNewModel(){return{}}onParserClose(r,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"headerFooter"}render(o,a){if(a){o.addRollback();let r=!1;o.openNode("headerFooter"),a.differentFirst&&(o.addAttribute("differentFirst","1"),r=!0),a.differentOddEven&&(o.addAttribute("differentOddEven","1"),r=!0),a.oddHeader&&typeof a.oddHeader=="string"&&(o.leafNode("oddHeader",null,a.oddHeader),r=!0),a.oddFooter&&typeof a.oddFooter=="string"&&(o.leafNode("oddFooter",null,a.oddFooter),r=!0),a.evenHeader&&typeof a.evenHeader=="string"&&(o.leafNode("evenHeader",null,a.evenHeader),r=!0),a.evenFooter&&typeof a.evenFooter=="string"&&(o.leafNode("evenFooter",null,a.evenFooter),r=!0),a.firstHeader&&typeof a.firstHeader=="string"&&(o.leafNode("firstHeader",null,a.firstHeader),r=!0),a.firstFooter&&typeof a.firstFooter=="string"&&(o.leafNode("firstFooter",null,a.firstFooter),r=!0),r?(o.closeNode(),o.commit()):o.rollback()}}parseOpen(o){switch(o.name){case"headerFooter":return this.model={},o.attributes.differentFirst&&(this.model.differentFirst=parseInt(o.attributes.differentFirst,0)===1),o.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(o.attributes.differentOddEven,0)===1),!0;case"oddHeader":return this.currentNode="oddHeader",!0;case"oddFooter":return this.currentNode="oddFooter",!0;case"evenHeader":return this.currentNode="evenHeader",!0;case"evenFooter":return this.currentNode="evenFooter",!0;case"firstHeader":return this.currentNode="firstHeader",!0;case"firstFooter":return this.currentNode="firstFooter",!0;default:return!1}}parseText(o){switch(this.currentNode){case"oddHeader":this.model.oddHeader=o;break;case"oddFooter":this.model.oddFooter=o;break;case"evenHeader":this.model.evenHeader=o;break;case"evenFooter":this.model.evenFooter=o;break;case"firstHeader":this.model.firstHeader=o;break;case"firstFooter":this.model.firstFooter=o}}parseClose(){switch(this.currentNode){case"oddHeader":case"oddFooter":case"evenHeader":case"evenFooter":case"firstHeader":case"firstFooter":return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"hyperlink"}render(o,a){this.isInternalLink(a)?o.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip,location:a.target}):o.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip})}parseOpen(o){return o.name==="hyperlink"&&(this.model={address:o.attributes.ref,rId:o.attributes["r:id"],tooltip:o.attributes.tooltip},o.attributes.location&&(this.model.target=o.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(o){return o.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(o.target)}}},{"../base-xform":32}],99:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"mergeCell"}render(o,a){o.leafNode("mergeCell",{ref:a})}parseOpen(o){return o.name==="mergeCell"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../../../doc/range"),a=s("../../../utils/col-cache"),r=s("../../../doc/enums");T.exports=class{constructor(){this.merges={}}add(t){if(this.merges[t.master])this.merges[t.master].expandToAddress(t.address);else{const e=`${t.master}:${t.address}`;this.merges[t.master]=new o(e)}}get mergeCells(){return m.map(this.merges,t=>t.range)}reconcile(t,e){m.each(t,l=>{const n=a.decode(l);for(let i=n.top;i<=n.bottom;i++){const c=e[i-1];for(let h=n.left;h<=n.right;h++){const u=c.cells[h-1];u?u.type===r.ValueType.Merge&&(u.master=n.tl):c.cells[h]={type:r.ValueType.Null,address:a.encodeAddress(i,h)}}}})}getMasterAddress(t){const e=this.hash[t];return e&&e.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(s,T,S){const m=s("../base-xform"),o=a=>a!==void 0;T.exports=class extends m{get tag(){return"outlinePr"}render(a,r){return!(!r||!o(r.summaryBelow)&&!o(r.summaryRight))&&(a.leafNode(this.tag,{summaryBelow:o(r.summaryBelow)?Number(r.summaryBelow):void 0,summaryRight:o(r.summaryRight)?Number(r.summaryRight):void 0}),!0)}parseOpen(a){return a.name===this.tag&&(this.model={summaryBelow:o(a.attributes.summaryBelow)?!!Number(a.attributes.summaryBelow):void 0,summaryRight:o(a.attributes.summaryRight)?!!Number(a.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"brk"}render(o,a){o.leafNode("brk",a)}parseOpen(o){return o.name==="brk"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../base-xform");T.exports=class extends o{get tag(){return"pageMargins"}render(a,r){if(r){const t={left:r.left,right:r.right,top:r.top,bottom:r.bottom,header:r.header,footer:r.footer};m.some(t,e=>e!==void 0)&&a.leafNode(this.tag,t)}}parseOpen(a){switch(a.name){case this.tag:return this.model={left:parseFloat(a.attributes.left||.7),right:parseFloat(a.attributes.right||.7),top:parseFloat(a.attributes.top||.75),bottom:parseFloat(a.attributes.bottom||.75),header:parseFloat(a.attributes.header||.3),footer:parseFloat(a.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"pageSetUpPr"}render(o,a){return!(!a||!a.fitToPage)&&(o.leafNode(this.tag,{fitToPage:a.fitToPage?"1":void 0}),!0)}parseOpen(o){return o.name===this.tag&&(this.model={fitToPage:o.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../base-xform");function a(l){return l?"1":void 0}function r(l){switch(l){case"overThenDown":return l;default:return}}function t(l){switch(l){case"atEnd":case"asDisplyed":return l;default:return}}function e(l){switch(l){case"dash":case"blank":case"NA":return l;default:return}}T.exports=class extends o{get tag(){return"pageSetup"}render(l,n){if(n){const i={paperSize:n.paperSize,orientation:n.orientation,horizontalDpi:n.horizontalDpi,verticalDpi:n.verticalDpi,pageOrder:r(n.pageOrder),blackAndWhite:a(n.blackAndWhite),draft:a(n.draft),cellComments:t(n.cellComments),errors:e(n.errors),scale:n.scale,fitToWidth:n.fitToWidth,fitToHeight:n.fitToHeight,firstPageNumber:n.firstPageNumber,useFirstPageNumber:a(n.firstPageNumber),usePrinterDefaults:a(n.usePrinterDefaults),copies:n.copies};m.some(i,c=>c!==void 0)&&l.leafNode(this.tag,i)}}parseOpen(l){switch(l.name){case this.tag:return this.model={paperSize:(n=l.attributes.paperSize,n!==void 0?parseInt(n,10):void 0),orientation:l.attributes.orientation||"portrait",horizontalDpi:parseInt(l.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(l.attributes.verticalDpi||"4294967295",10),pageOrder:l.attributes.pageOrder||"downThenOver",blackAndWhite:l.attributes.blackAndWhite==="1",draft:l.attributes.draft==="1",cellComments:l.attributes.cellComments||"None",errors:l.attributes.errors||"displayed",scale:parseInt(l.attributes.scale||"100",10),fitToWidth:parseInt(l.attributes.fitToWidth||"1",10),fitToHeight:parseInt(l.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(l.attributes.firstPageNumber||"1",10),useFirstPageNumber:l.attributes.useFirstPageNumber==="1",usePrinterDefaults:l.attributes.usePrinterDefaults==="1",copies:parseInt(l.attributes.copies||"1",10)},!0;default:return!1}var n}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"picture"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../base-xform");function a(r){return r?"1":void 0}T.exports=class extends o{get tag(){return"printOptions"}render(r,t){if(t){const e={headings:a(t.showRowColHeaders),gridLines:a(t.showGridLines),horizontalCentered:a(t.horizontalCentered),verticalCentered:a(t.verticalCentered)};m.some(e,l=>l!==void 0)&&r.leafNode(this.tag,e)}}parseOpen(r){switch(r.name){case this.tag:return this.model={showRowColHeaders:r.attributes.headings==="1",showGridLines:r.attributes.gridLines==="1",horizontalCentered:r.attributes.horizontalCentered==="1",verticalCentered:r.attributes.verticalCentered==="1"},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(s,T,S){const m=s("./page-breaks-xform"),o=s("../list-xform");T.exports=class extends o{constructor(){super({tag:"rowBreaks",count:!0,childXform:new m})}render(a,r){if(r&&r.length){a.openNode(this.tag,this.$),this.count&&(a.addAttribute(this.$count,r.length),a.addAttribute("manualBreakCount",r.length));const{childXform:t}=this;r.forEach(e=>{t.render(a,e)}),a.closeNode()}else this.empty&&a.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(s,T,S){const m=s("../base-xform"),o=s("../../../utils/utils"),a=s("./cell-xform");T.exports=class extends m{constructor(r){super(),this.maxItems=r&&r.maxItems,this.map={c:new a}}get tag(){return"row"}prepare(r,t){const e=t.styles.addStyleModel(r.style);e&&(r.styleId=e);const l=this.map.c;r.cells.forEach(n=>{l.prepare(n,t)})}render(r,t,e){r.openNode("row"),r.addAttribute("r",t.number),t.height&&(r.addAttribute("ht",t.height),r.addAttribute("customHeight","1")),t.hidden&&r.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&r.addAttribute("spans",`${t.min}:${t.max}`),t.styleId&&(r.addAttribute("s",t.styleId),r.addAttribute("customFormat","1")),r.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&r.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&r.addAttribute("collapsed","1");const l=this.map.c;t.cells.forEach(n=>{l.render(r,n,e)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;if(r.name==="row"){this.numRowsSeen+=1;const t=r.attributes.spans?r.attributes.spans.split(":").map(l=>parseInt(l,10)):[void 0,void 0],e=this.model={number:parseInt(r.attributes.r,10),min:t[0],max:t[1],cells:[]};return r.attributes.s&&(e.styleId=parseInt(r.attributes.s,10)),o.parseBoolean(r.attributes.hidden)&&(e.hidden=!0),o.parseBoolean(r.attributes.bestFit)&&(e.bestFit=!0),r.attributes.ht&&(e.height=parseFloat(r.attributes.ht)),r.attributes.outlineLevel&&(e.outlineLevel=parseInt(r.attributes.outlineLevel,10)),o.parseBoolean(r.attributes.collapsed)&&(e.collapsed=!0),!0}return this.parser=this.map[r.name],!!this.parser&&(this.parser.parseOpen(r),!0)}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(r,t){r.style=r.styleId?t.styles.getStyleModel(r.styleId):{},r.styleId!==void 0&&(r.styleId=void 0);const e=this.map.c;r.cells.forEach(l=>{e.reconcile(l,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../base-xform");T.exports=class extends o{get tag(){return"sheetFormatPr"}render(a,r){if(r){const t={defaultRowHeight:r.defaultRowHeight,outlineLevelRow:r.outlineLevelRow,outlineLevelCol:r.outlineLevelCol,"x14ac:dyDescent":r.dyDescent};r.defaultColWidth&&(t.defaultColWidth=r.defaultColWidth),r.defaultRowHeight&&r.defaultRowHeight===15||(t.customHeight="1"),m.some(t,e=>e!==void 0)&&a.leafNode("sheetFormatPr",t)}}parseOpen(a){return a.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(a.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(a.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(a.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(a.attributes.outlineLevelCol||"0",10)},a.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(a.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(s,T,S){const m=s("../base-xform"),o=s("../style/color-xform"),a=s("./page-setup-properties-xform"),r=s("./outline-properties-xform");T.exports=class extends m{constructor(){super(),this.map={tabColor:new o("tabColor"),pageSetUpPr:new a,outlinePr:new r}}get tag(){return"sheetPr"}render(t,e){if(e){t.addRollback(),t.openNode("sheetPr");let l=!1;l=this.map.tabColor.render(t,e.tabColor)||l,l=this.map.pageSetUpPr.render(t,e.pageSetup)||l,l=this.map.outlinePr.render(t,e.outlineProperties)||l,l?(t.closeNode(),t.commit()):t.rollback()}}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.reset(),!0):!!this.map[t.name]&&(this.parser=this.map[t.name],this.parser.parseOpen(t),!0)}parseText(t){return!!this.parser&&(this.parser.parseText(t),!0)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../base-xform");function a(t,e){return t?e:void 0}function r(t,e){return t===e||void 0}T.exports=class extends o{get tag(){return"sheetProtection"}render(t,e){if(e){const l={sheet:a(e.sheet,"1"),selectLockedCells:e.selectLockedCells===!1?"1":void 0,selectUnlockedCells:e.selectUnlockedCells===!1?"1":void 0,formatCells:a(e.formatCells,"0"),formatColumns:a(e.formatColumns,"0"),formatRows:a(e.formatRows,"0"),insertColumns:a(e.insertColumns,"0"),insertRows:a(e.insertRows,"0"),insertHyperlinks:a(e.insertHyperlinks,"0"),deleteColumns:a(e.deleteColumns,"0"),deleteRows:a(e.deleteRows,"0"),sort:a(e.sort,"0"),autoFilter:a(e.autoFilter,"0"),pivotTables:a(e.pivotTables,"0")};e.sheet&&(l.algorithmName=e.algorithmName,l.hashValue=e.hashValue,l.saltValue=e.saltValue,l.spinCount=e.spinCount,l.objects=a(e.objects===!1,"1"),l.scenarios=a(e.scenarios===!1,"1")),m.some(l,n=>n!==void 0)&&t.leafNode(this.tag,l)}}parseOpen(t){switch(t.name){case this.tag:return this.model={sheet:r(t.attributes.sheet,"1"),objects:t.attributes.objects!=="1"&&void 0,scenarios:t.attributes.scenarios!=="1"&&void 0,selectLockedCells:t.attributes.selectLockedCells!=="1"&&void 0,selectUnlockedCells:t.attributes.selectUnlockedCells!=="1"&&void 0,formatCells:r(t.attributes.formatCells,"0"),formatColumns:r(t.attributes.formatColumns,"0"),formatRows:r(t.attributes.formatRows,"0"),insertColumns:r(t.attributes.insertColumns,"0"),insertRows:r(t.attributes.insertRows,"0"),insertHyperlinks:r(t.attributes.insertHyperlinks,"0"),deleteColumns:r(t.attributes.deleteColumns,"0"),deleteRows:r(t.attributes.deleteRows,"0"),sort:r(t.attributes.sort,"0"),autoFilter:r(t.attributes.autoFilter,"0"),pivotTables:r(t.attributes.pivotTables,"0")},t.attributes.algorithmName&&(this.model.algorithmName=t.attributes.algorithmName,this.model.hashValue=t.attributes.hashValue,this.model.saltValue=t.attributes.saltValue,this.model.spinCount=parseInt(t.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(s,T,S){const m=s("../../../utils/col-cache"),o=s("../base-xform"),a={frozen:"frozen",frozenSplit:"frozen",split:"split"};T.exports=class extends o{get tag(){return"sheetView"}prepare(r){switch(r.state){case"frozen":case"split":break;default:r.state="normal"}}render(r,t){r.openNode("sheetView",{workbookViewId:t.workbookViewId||0});const e=function(h,u,d){d&&r.addAttribute(h,u)};let l,n,i,c;switch(e("rightToLeft","1",t.rightToLeft===!0),e("tabSelected","1",t.tabSelected),e("showRuler","0",t.showRuler===!1),e("showRowColHeaders","0",t.showRowColHeaders===!1),e("showGridLines","0",t.showGridLines===!1),e("zoomScale",t.zoomScale,t.zoomScale),e("zoomScaleNormal",t.zoomScaleNormal,t.zoomScaleNormal),e("view",t.style,t.style),t.state){case"frozen":n=t.xSplit||0,i=t.ySplit||0,l=t.topLeftCell||m.getAddress(i+1,n+1).address,c=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:l,activePane:c,state:"frozen"}),r.leafNode("selection",{pane:c,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":t.activePane==="topLeft"&&(t.activePane=void 0),r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),r.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&r.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}r.closeNode()}parseOpen(r){switch(r.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(r.attributes.workbookViewId,10),rightToLeft:r.attributes.rightToLeft==="1",tabSelected:r.attributes.tabSelected==="1",showRuler:r.attributes.showRuler!=="0",showRowColHeaders:r.attributes.showRowColHeaders!=="0",showGridLines:r.attributes.showGridLines!=="0",zoomScale:parseInt(r.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(r.attributes.zoomScaleNormal||"100",10),style:r.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(r.attributes.xSplit||"0",10),ySplit:parseInt(r.attributes.ySplit||"0",10),topLeftCell:r.attributes.topLeftCell,activePane:r.attributes.activePane||"topLeft",state:r.attributes.state},!0;case"selection":{const t=r.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:r.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(r){let t,e;switch(r){case"sheetView":return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:a[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state==="split"&&(t.activePane=this.pane.activePane),e=this.selections[this.pane.activePane],e&&e.activeCell&&(t.activeCell=e.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},e=this.selections.topLeft,e&&e.activeCell&&(t.activeCell=e.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"tablePart"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../../../utils/col-cache"),a=s("../../../utils/xml-stream"),r=s("../../rel-type"),t=s("./merges"),e=s("../base-xform"),l=s("../list-xform"),n=s("./row-xform"),i=s("./col-xform"),c=s("./dimension-xform"),h=s("./hyperlink-xform"),u=s("./merge-cell-xform"),d=s("./data-validations-xform"),f=s("./sheet-properties-xform"),w=s("./sheet-format-properties-xform"),_=s("./sheet-view-xform"),A=s("./sheet-protection-xform"),N=s("./page-margins-xform"),L=s("./page-setup-xform"),I=s("./print-options-xform"),P=s("./auto-filter-xform"),D=s("./picture-xform"),U=s("./drawing-xform"),B=s("./table-part-xform"),x=s("./row-breaks-xform"),M=s("./header-footer-xform"),v=s("./cf/conditional-formattings-xform"),p=s("./ext-lst-xform"),b=(y,k)=>{if(!k||!k.length)return y;if(!y||!y.length)return k;const R={},O={};return y.forEach(z=>{R[z.ref]=z,z.rules.forEach($=>{const{x14Id:W}=$;W&&(O[W]=$)})}),k.forEach(z=>{z.rules.forEach($=>{const W=O[$.x14Id];W?((j,H)=>{Object.keys(H).forEach(E=>{const C=j[E],F=H[E];C===void 0&&F!==void 0&&(j[E]=F)})})(W,$):R[z.ref]?R[z.ref].rules.push($):y.push({ref:z.ref,rules:[$]})})}),y};class g extends e{constructor(k){super();const{maxRows:R,maxCols:O,ignoreNodes:z}=k||{};this.ignoreNodes=z||[],this.map={sheetPr:new f,dimension:new c,sheetViews:new l({tag:"sheetViews",count:!1,childXform:new _}),sheetFormatPr:new w,cols:new l({tag:"cols",count:!1,childXform:new i}),sheetData:new l({tag:"sheetData",count:!1,empty:!0,childXform:new n({maxItems:O}),maxItems:R}),autoFilter:new P,mergeCells:new l({tag:"mergeCells",count:!0,childXform:new u}),rowBreaks:new x,hyperlinks:new l({tag:"hyperlinks",count:!1,childXform:new h}),pageMargins:new N,dataValidations:new d,pageSetup:new L,headerFooter:new M,printOptions:new I,picture:new D,drawing:new U,sheetProtection:new A,tableParts:new l({tag:"tableParts",count:!0,childXform:new B}),conditionalFormatting:new v,extLst:new p}}prepare(k,R){R.merges=new t,k.hyperlinks=R.hyperlinks=[],k.comments=R.comments=[],R.formulae={},R.siFormulae=0,this.map.cols.prepare(k.cols,R),this.map.sheetData.prepare(k.rows,R),this.map.conditionalFormatting.prepare(k.conditionalFormattings,R),k.mergeCells=R.merges.mergeCells;const O=k.rels=[];function z(j){return"rId"+(j.length+1)}if(k.hyperlinks.forEach(j=>{const H=z(O);j.rId=H,O.push({Id:H,Type:r.Hyperlink,Target:j.target,TargetMode:"External"})}),k.comments.length>0){const j={Id:z(O),Type:r.Comments,Target:`../comments${k.id}.xml`};O.push(j);const H={Id:z(O),Type:r.VmlDrawing,Target:`../drawings/vmlDrawing${k.id}.vml`};O.push(H),k.comments.forEach(E=>{E.refAddress=o.decodeAddress(E.ref)}),R.commentRefs.push({commentName:"comments"+k.id,vmlDrawing:"vmlDrawing"+k.id})}const $=[];let W;k.media.forEach(j=>{if(j.type==="background"){const H=z(O);W=R.media[j.imageId],O.push({Id:H,Type:r.Image,Target:`../media/${W.name}.${W.extension}`}),k.background={rId:H},k.image=R.media[j.imageId]}else if(j.type==="image"){let{drawing:H}=k;W=R.media[j.imageId],H||(H=k.drawing={rId:z(O),name:"drawing"+ ++R.drawingsCount,anchors:[],rels:[]},R.drawings.push(H),O.push({Id:H.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${H.name}.xml`}));let E=this.preImageId===j.imageId?$[j.imageId]:$[H.rels.length];E||(E=z(H.rels),$[H.rels.length]=E,H.rels.push({Id:E,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${W.name}.${W.extension}`}));const C={picture:{rId:E},range:j.range};if(j.hyperlinks&&j.hyperlinks.hyperlink){const F=z(H.rels);$[H.rels.length]=F,C.picture.hyperlinks={tooltip:j.hyperlinks.tooltip,rId:F},H.rels.push({Id:F,Type:r.Hyperlink,Target:j.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=j.imageId,H.anchors.push(C)}}),k.tables.forEach(j=>{const H=z(O);j.rId=H,O.push({Id:H,Type:r.Table,Target:"../tables/"+j.target}),j.columns.forEach(E=>{const{style:C}=E;C&&(E.dxfId=R.styles.addDxfStyle(C))})}),this.map.extLst.prepare(k,R)}render(k,R){k.openXml(a.StdDocAttributes),k.openNode("worksheet",g.WORKSHEET_ATTRIBUTES);const O=R.properties?{defaultRowHeight:R.properties.defaultRowHeight,dyDescent:R.properties.dyDescent,outlineLevelCol:R.properties.outlineLevelCol,outlineLevelRow:R.properties.outlineLevelRow}:void 0;R.properties&&R.properties.defaultColWidth&&(O.defaultColWidth=R.properties.defaultColWidth);const z={outlineProperties:R.properties&&R.properties.outlineProperties,tabColor:R.properties&&R.properties.tabColor,pageSetup:R.pageSetup&&R.pageSetup.fitToPage?{fitToPage:R.pageSetup.fitToPage}:void 0},$=R.pageSetup&&R.pageSetup.margins,W={showRowColHeaders:R.pageSetup&&R.pageSetup.showRowColHeaders,showGridLines:R.pageSetup&&R.pageSetup.showGridLines,horizontalCentered:R.pageSetup&&R.pageSetup.horizontalCentered,verticalCentered:R.pageSetup&&R.pageSetup.verticalCentered},j=R.sheetProtection;this.map.sheetPr.render(k,z),this.map.dimension.render(k,R.dimensions),this.map.sheetViews.render(k,R.views),this.map.sheetFormatPr.render(k,O),this.map.cols.render(k,R.cols),this.map.sheetData.render(k,R.rows),this.map.sheetProtection.render(k,j),this.map.autoFilter.render(k,R.autoFilter),this.map.mergeCells.render(k,R.mergeCells),this.map.conditionalFormatting.render(k,R.conditionalFormattings),this.map.dataValidations.render(k,R.dataValidations),this.map.hyperlinks.render(k,R.hyperlinks),this.map.printOptions.render(k,W),this.map.pageMargins.render(k,$),this.map.pageSetup.render(k,R.pageSetup),this.map.headerFooter.render(k,R.headerFooter),this.map.rowBreaks.render(k,R.rowBreaks),this.map.drawing.render(k,R.drawing),this.map.picture.render(k,R.background),this.map.tableParts.render(k,R.tables),this.map.extLst.render(k,R),R.rels&&R.rels.forEach(H=>{H.Type===r.VmlDrawing&&k.leafNode("legacyDrawing",{"r:id":H.Id})}),k.closeNode()}parseOpen(k){return this.parser?(this.parser.parseOpen(k),!0):k.name==="worksheet"?(m.each(this.map,R=>{R.reset()}),!0):(this.map[k.name]&&!this.ignoreNodes.includes(k.name)&&(this.parser=this.map[k.name],this.parser.parseOpen(k)),!0)}parseText(k){this.parser&&this.parser.parseText(k)}parseClose(k){if(this.parser)return this.parser.parseClose(k)||(this.parser=void 0),!0;switch(k){case"worksheet":{const R=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(R.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(R.outlineProperties=this.map.sheetPr.model.outlineProperties);const O={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},z=Object.assign(O,this.map.pageSetup.model,this.map.printOptions.model),$=b(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model["x14:conditionalFormattings"]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:R,views:this.map.sheetViews.model,pageSetup:z,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:$},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(k,R){const O=(k.relationships||[]).reduce(($,W)=>{if($[W.Id]=W,W.Type===r.Comments&&(k.comments=R.comments[W.Target].comments),W.Type===r.VmlDrawing&&k.comments&&k.comments.length){const j=R.vmlDrawings[W.Target].comments;k.comments.forEach((H,E)=>{H.note=Object.assign({},H.note,j[E])})}return $},{});if(R.commentsMap=(k.comments||[]).reduce(($,W)=>(W.ref&&($[W.ref]=W),$),{}),R.hyperlinkMap=(k.hyperlinks||[]).reduce(($,W)=>(W.rId&&($[W.address]=O[W.rId].Target),$),{}),R.formulae={},k.rows=k.rows&&k.rows.filter(Boolean)||[],k.rows.forEach($=>{$.cells=$.cells&&$.cells.filter(Boolean)||[]}),this.map.cols.reconcile(k.cols,R),this.map.sheetData.reconcile(k.rows,R),this.map.conditionalFormatting.reconcile(k.conditionalFormattings,R),k.media=[],k.drawing){const $=O[k.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if($){const W=$[1];R.drawings[W].anchors.forEach(j=>{if(j.medium){const H={type:"image",imageId:j.medium.index,range:j.range,hyperlinks:j.picture.hyperlinks};k.media.push(H)}})}}const z=k.background&&O[k.background.rId];if(z){const $=z.Target.split("/media/")[1],W=R.mediaIndex&&R.mediaIndex[$];W!==void 0&&k.media.push({type:"background",imageId:W})}k.tables=(k.tables||[]).map($=>{const W=O[$.rId];return R.tables[W.Target]}),delete k.relationships,delete k.hyperlinks,delete k.comments}}g.WORKSHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"},T.exports=g},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.attr=o.attr}render(o,a){a&&(o.openNode(this.tag),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this._format=o.format||function(a){try{return Number.isNaN(a.getTime())?"":a.toISOString()}catch{return""}},this._parse=o.parse||function(a){return new Date(a)}}render(o,a){a&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,this._format(a)):o.writeText(this._format(a)),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=this._parse(o.attributes[this.attr]):this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this.zero=o.zero}render(o,a){(a||this.zero)&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,a):o.writeText(a),o.closeNode())}parseOpen(o){return o.name===this.tag&&(this.attr?this.model=parseInt(o.attributes[this.attr],10):this.text=[],!0)}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs}render(o,a){a!==void 0&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,a):o.writeText(a),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=o.attributes[this.attr]:this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(s,T,S){const m=s("./base-xform"),o=s("../../utils/xml-stream");T.exports=class extends m{constructor(a){super(),this._model=a}render(a){if(!this._xml){const r=new o;(function t(e,l){e.openNode(l.tag,l.$),l.c&&l.c.forEach(n=>{t(e,n)}),l.t&&e.writeText(l.t),e.closeNode()})(r,this._model),this._xml=r.xml}a.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(a){switch(a){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(s,T,S){const m=s("./text-xform"),o=s("./rich-text-xform"),a=s("../base-xform");T.exports=class extends a{constructor(){super(),this.map={r:new o,t:new m}}get tag(){return"rPh"}render(r,t){if(r.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty("richText")&&t.richText){const{r:e}=this.map;t.richText.forEach(l=>{e.render(r,l)})}else t&&this.map.t.render(r,t.text);r.closeNode()}parseOpen(r){const{name:t}=r;return this.parser?(this.parser.parseOpen(r),!0):t===this.tag?(this.model={sb:parseInt(r.attributes.sb,10),eb:parseInt(r.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(r),!0))}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){switch(r){case"r":{let t=this.model.richText;t||(t=this.model.richText=[]),t.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}switch(r){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(s,T,S){const m=s("./text-xform"),o=s("../style/font-xform"),a=s("../base-xform");class r extends a{constructor(e){super(),this.model=e}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new m)}get fontXform(){return this._fontXform||(this._fontXform=new o(r.FONT_OPTIONS))}render(e,l){l=l||this.model,e.openNode("r"),l.font&&this.fontXform.render(e,l.font),this.textXform.render(e,l.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(e),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}}r.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},T.exports=r},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(s,T,S){const m=s("./text-xform"),o=s("./rich-text-xform"),a=s("./phonetic-text-xform"),r=s("../base-xform");T.exports=class extends r{constructor(t){super(),this.model=t,this.map={r:new o,t:new m,rPh:new a}}get tag(){return"si"}render(t,e){t.openNode(this.tag),e&&e.hasOwnProperty("richText")&&e.richText?e.richText.length?e.richText.forEach(l=>{this.map.r.render(t,l)}):this.map.t.render(t,""):e!=null&&this.map.t.render(t,e),t.closeNode()}parseOpen(t){const{name:e}=t;return this.parser?(this.parser.parseOpen(t),!0):e===this.tag?(this.model={},!0):(this.parser=this.map[e],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)){switch(t){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}switch(t){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./shared-string-xform");T.exports=class extends o{constructor(r){super(),this.model=r||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new a)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(r){return this.model.values[r]}add(r){return r.richText?this.addRichText(r):this.addText(r)}addText(r){let t=this.hash[r];return t===void 0&&(t=this.hash[r]=this.model.values.length,this.model.values.push(r)),this.model.count++,t}addRichText(r){const t=this.sharedStringXform.toXml(r);let e=this.rich[t];return e===void 0&&(e=this.rich[t]=this.model.values.length,this.model.values.push(r)),this.model.count++,e}render(r,t){t=t||this._values,r.openXml(m.StdDocAttributes),r.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});const e=this.sharedStringXform;t.values.forEach(l=>{e.render(r,l)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(r),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(r))}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(r){case"sst":return!1;default:throw new Error("Unexpected xml node in parseClose: "+r)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"t"}render(o,a){o.openNode("t"),/^\s|\n|\s$/.test(a)&&o.addAttribute("xml:space","preserve"),o.writeText(a),o.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(o,a)=>String.fromCharCode(parseInt(a,16)))}parseOpen(o){switch(o.name){case"t":return this._text=[],!0;default:return!1}}parseText(o){this._text.push(o)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(s,T,S){const m=s("../../../doc/enums"),o=s("../../../utils/utils"),a=s("../base-xform"),r={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),vertical(e){return e==="middle"?"center":this.verticalValues[e]?e:void 0},wrapText:e=>!!e||void 0,shrinkToFit:e=>!!e||void 0,textRotation(e){switch(e){case"vertical":return e;default:return(e=o.validInt(e))>=-90&&e<=90?e:void 0}},indent:e=>(e=o.validInt(e),Math.max(0,e)),readingOrder(e){switch(e){case"ltr":return m.ReadingOrder.LeftToRight;case"rtl":return m.ReadingOrder.RightToLeft;default:return}}},t={toXml(e){if(e=r.textRotation(e)){if(e==="vertical")return 255;const l=Math.round(e);if(l>=0&&l<=90)return l;if(l<0&&l>=-90)return 90-l}},toModel(e){const l=o.validInt(e);if(l!==void 0){if(l===255)return"vertical";if(l>=0&&l<=90)return l;if(l>90&&l<=180)return 90-l}}};T.exports=class extends a{get tag(){return"alignment"}render(e,l){e.addRollback(),e.openNode("alignment");let n=!1;function i(c,h){h&&(e.addAttribute(c,h),n=!0)}i("horizontal",r.horizontal(l.horizontal)),i("vertical",r.vertical(l.vertical)),i("wrapText",!!r.wrapText(l.wrapText)&&"1"),i("shrinkToFit",!!r.shrinkToFit(l.shrinkToFit)&&"1"),i("indent",r.indent(l.indent)),i("textRotation",t.toXml(l.textRotation)),i("readingOrder",r.readingOrder(l.readingOrder)),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){const l={};let n=!1;function i(c,h,u){c&&(l[h]=u,n=!0)}i(e.attributes.horizontal,"horizontal",e.attributes.horizontal),i(e.attributes.vertical,"vertical",e.attributes.vertical==="center"?"middle":e.attributes.vertical),i(e.attributes.wrapText,"wrapText",o.parseBoolean(e.attributes.wrapText)),i(e.attributes.shrinkToFit,"shrinkToFit",o.parseBoolean(e.attributes.shrinkToFit)),i(e.attributes.indent,"indent",parseInt(e.attributes.indent,10)),i(e.attributes.textRotation,"textRotation",t.toModel(e.attributes.textRotation)),i(e.attributes.readingOrder,"readingOrder",e.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=n?l:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(s,T,S){const m=s("../base-xform"),o=s("../../../utils/utils"),a=s("./color-xform");class r extends m{constructor(e){super(),this.name=e,this.map={color:new a}}get tag(){return this.name}render(e,l,n){const i=l&&l.color||n||this.defaultColor;e.openNode(this.name),l&&l.style&&(e.addAttribute("style",l.style),i&&this.map.color.render(e,i)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{const{style:l}=e.attributes;return this.model=l?{style:l}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(e){return r.validStyleValues[e]}}r.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((t,e)=>(t[e]=!0,t),{}),T.exports=class extends m{constructor(){super(),this.map={top:new r("top"),left:new r("left"),bottom:new r("bottom"),right:new r("right"),diagonal:new r("diagonal")}}render(t,e){const{color:l}=e;function n(i,c){i&&!i.color&&e.color&&(i={...i,color:e.color}),c.render(t,i,l)}t.openNode("border"),e.diagonal&&e.diagonal.style&&(e.diagonal.up&&t.addAttribute("diagonalUp","1"),e.diagonal.down&&t.addAttribute("diagonalDown","1")),n(e.left,this.map.left),n(e.right,this.map.right),n(e.top,this.map.top),n(e.bottom,this.map.bottom),n(e.diagonal,this.map.diagonal),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"border":return this.reset(),this.diagonalUp=o.parseBoolean(t.attributes.diagonalUp),this.diagonalDown=o.parseBoolean(t.attributes.diagonalDown),!0;default:return this.parser=this.map[t.name],!!this.parser&&(this.parser.parseOpen(t),!0)}}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;if(t==="border"){const e=this.model={},l=function(n,i,c){i&&(c&&Object.assign(i,c),e[n]=i)};l("left",this.map.left.model),l("right",this.map.right.model),l("top",this.map.top.model),l("bottom",this.map.bottom.model),l("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.name=o||"color"}get tag(){return this.name}render(o,a){return!!a&&(o.openNode(this.name),a.argb?o.addAttribute("rgb",a.argb):a.theme!==void 0?(o.addAttribute("theme",a.theme),a.tint!==void 0&&o.addAttribute("tint",a.tint)):a.indexed!==void 0?o.addAttribute("indexed",a.indexed):o.addAttribute("auto","1"),o.closeNode(),!0)}parseOpen(o){return o.name===this.name&&(o.attributes.rgb?this.model={argb:o.attributes.rgb}:o.attributes.theme?(this.model={theme:parseInt(o.attributes.theme,10)},o.attributes.tint&&(this.model.tint=parseFloat(o.attributes.tint))):o.attributes.indexed?this.model={indexed:parseInt(o.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(s,T,S){const m=s("../base-xform"),o=s("./alignment-xform"),a=s("./border-xform"),r=s("./fill-xform"),t=s("./font-xform"),e=s("./numfmt-xform"),l=s("./protection-xform");T.exports=class extends m{constructor(){super(),this.map={alignment:new o,border:new a,fill:new r,font:new t,numFmt:new e,protection:new l}}get tag(){return"dxf"}render(n,i){if(n.openNode(this.tag),i.font&&this.map.font.render(n,i.font),i.numFmt&&i.numFmtId){const c={id:i.numFmtId,formatCode:i.numFmt};this.map.numFmt.render(n,c)}i.fill&&this.map.fill.render(n,i.fill),i.alignment&&this.map.alignment.render(n,i.alignment),i.border&&this.map.border.render(n,i.border),i.protection&&this.map.protection.render(n,i.protection),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n),!0}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.parser=void 0),!0):n!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(s,T,S){const m=s("../base-xform"),o=s("./color-xform");class a extends m{constructor(){super(),this.map={color:new o}}get tag(){return"stop"}render(n,i){n.openNode("stop"),n.addAttribute("position",i.position),this.map.color.render(n,i.color),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"stop":return this.model={position:parseFloat(n.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(n),!0;default:return!1}}parseText(){}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class r extends m{constructor(){super(),this.map={fgColor:new o("fgColor"),bgColor:new o("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(n,i){n.openNode("patternFill"),n.addAttribute("patternType",i.pattern),i.fgColor&&this.map.fgColor.render(n,i.fgColor),i.bgColor&&this.map.bgColor.render(n,i.bgColor),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"patternFill":return this.model={type:"pattern",pattern:n.attributes.patternType},!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.parser.model&&(this.model[n]=this.parser.model),this.parser=void 0),!0)}}class t extends m{constructor(){super(),this.map={stop:new a}}get name(){return"gradient"}get tag(){return"gradientFill"}render(n,i){switch(n.openNode("gradientFill"),i.gradient){case"angle":n.addAttribute("degree",i.degree);break;case"path":n.addAttribute("type","path"),i.center.left&&(n.addAttribute("left",i.center.left),i.center.right===void 0&&n.addAttribute("right",i.center.left)),i.center.right&&n.addAttribute("right",i.center.right),i.center.top&&(n.addAttribute("top",i.center.top),i.center.bottom===void 0&&n.addAttribute("bottom",i.center.top)),i.center.bottom&&n.addAttribute("bottom",i.center.bottom)}const c=this.map.stop;i.stops.forEach(h=>{c.render(n,h)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"gradientFill":{const i=this.model={stops:[]};return n.attributes.degree?(i.gradient="angle",i.degree=parseInt(n.attributes.degree,10)):n.attributes.type==="path"&&(i.gradient="path",i.center={left:n.attributes.left?parseFloat(n.attributes.left):0,top:n.attributes.top?parseFloat(n.attributes.top):0},n.attributes.right!==n.attributes.left&&(i.center.right=n.attributes.right?parseFloat(n.attributes.right):0),n.attributes.bottom!==n.attributes.top&&(i.center.bottom=n.attributes.bottom?parseFloat(n.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(n),!0;default:return!1}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class e extends m{constructor(){super(),this.map={patternFill:new r,gradientFill:new t}}get tag(){return"fill"}render(n,i){switch(n.addRollback(),n.openNode("fill"),i.type){case"pattern":this.map.patternFill.render(n,i);break;case"gradient":this.map.gradientFill.render(n,i);break;default:return void n.rollback()}n.closeNode(),n.commit()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"fill":return this.model={},!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(n){return e.validPatternValues[n]}}e.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((l,n)=>(l[n]=!0,l),{}),e.StopXform=a,e.PatternFillXform=r,e.GradientFillXform=t,T.exports=e},{"../base-xform":32,"./color-xform":128}],131:[function(s,T,S){const m=s("./color-xform"),o=s("../simple/boolean-xform"),a=s("../simple/integer-xform"),r=s("../simple/string-xform"),t=s("./underline-xform"),e=s("../../../utils/under-dash"),l=s("../base-xform");class n extends l{constructor(c){super(),this.options=c||n.OPTIONS,this.map={b:{prop:"bold",xform:new o({tag:"b",attr:"val"})},i:{prop:"italic",xform:new o({tag:"i",attr:"val"})},u:{prop:"underline",xform:new t},charset:{prop:"charset",xform:new a({tag:"charset",attr:"val"})},color:{prop:"color",xform:new m},condense:{prop:"condense",xform:new o({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new o({tag:"extend",attr:"val"})},family:{prop:"family",xform:new a({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new o({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new r({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new r({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new o({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new o({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new a({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new r({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(c,h){const{map:u}=this;c.openNode(this.options.tagName),e.each(this.map,(d,f)=>{u[f].xform.render(c,h[d.prop])}),c.closeNode()}parseOpen(c){if(this.parser)return this.parser.parseOpen(c),!0;if(this.map[c.name])return this.parser=this.map[c.name].xform,this.parser.parseOpen(c);switch(c.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(c){this.parser&&this.parser.parseText(c)}parseClose(c){if(this.parser&&!this.parser.parseClose(c)){const h=this.map[c];return this.parser.model&&(this.model[h.prop]=this.parser.model),this.parser=void 0,!0}switch(c){case this.options.tagName:return!1;default:return!0}}}n.OPTIONS={tagName:"font",fontNameTag:"name"},T.exports=n},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../../defaultnumformats"),a=s("../base-xform"),r=function(){const e={};return m.each(o,(l,n)=>{l.f&&(e[l.f]=parseInt(n,10))}),e}();class t extends a{constructor(l,n){super(),this.id=l,this.formatCode=n}get tag(){return"numFmt"}render(l,n){l.leafNode("numFmt",{numFmtId:n.id,formatCode:n.formatCode})}parseOpen(l){switch(l.name){case"numFmt":return this.model={id:parseInt(l.attributes.numFmtId,10),formatCode:l.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0;default:return!1}}parseText(){}parseClose(){return!1}}t.getDefaultFmtId=function(e){return r[e]},t.getDefaultFmtCode=function(e){return o[e]&&o[e].f},T.exports=t},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(s,T,S){const m=s("../base-xform"),o={boolean:(a,r)=>a===void 0?r:a};T.exports=class extends m{get tag(){return"protection"}render(a,r){a.addRollback(),a.openNode("protection");let t=!1;function e(l,n){n!==void 0&&(a.addAttribute(l,n),t=!0)}e("locked",o.boolean(r.locked,!0)?void 0:"0"),e("hidden",o.boolean(r.hidden,!1)?"1":void 0),a.closeNode(),t?a.commit():a.rollback()}parseOpen(a){const r={locked:a.attributes.locked!=="0",hidden:a.attributes.hidden==="1"},t=!r.locked||r.hidden;this.model=t?r:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(s,T,S){const m=s("../base-xform"),o=s("./alignment-xform"),a=s("./protection-xform");T.exports=class extends m{constructor(r){super(),this.xfId=!(!r||!r.xfId),this.map={alignment:new o,protection:new a}}get tag(){return"xf"}render(r,t){r.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&r.addAttribute("xfId",t.xfId||0),t.numFmtId&&r.addAttribute("applyNumberFormat","1"),t.fontId&&r.addAttribute("applyFont","1"),t.fillId&&r.addAttribute("applyFill","1"),t.borderId&&r.addAttribute("applyBorder","1"),t.alignment&&r.addAttribute("applyAlignment","1"),t.protection&&r.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(r,t.alignment),t.protection&&this.map.protection.render(r,t.protection),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"xf":return this.model={numFmtId:parseInt(r.attributes.numFmtId,10),fontId:parseInt(r.attributes.fontId,10),fillId:parseInt(r.attributes.fillId,10),borderId:parseInt(r.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(r.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(r),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(r),!0;default:return!1}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):r!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(s,T,S){const m=s("../../../doc/enums"),o=s("../../../utils/xml-stream"),a=s("../base-xform"),r=s("../static-xform"),t=s("../list-xform"),e=s("./font-xform"),l=s("./fill-xform"),n=s("./border-xform"),i=s("./numfmt-xform"),c=s("./style-xform"),h=s("./dxf-xform");class u extends a{constructor(f){super(),this.map={numFmts:new t({tag:"numFmts",count:!0,childXform:new i}),fonts:new t({tag:"fonts",count:!0,childXform:new e,$:{"x14ac:knownFonts":1}}),fills:new t({tag:"fills",count:!0,childXform:new l}),borders:new t({tag:"borders",count:!0,childXform:new n}),cellStyleXfs:new t({tag:"cellStyleXfs",count:!0,childXform:new c}),cellXfs:new t({tag:"cellXfs",count:!0,childXform:new c({xfId:!0})}),dxfs:new t({tag:"dxfs",always:!0,count:!0,childXform:new h}),numFmt:new i,font:new e,fill:new l,border:new n,style:new c({xfId:!0}),cellStyles:u.STATIC_XFORMS.cellStyles,tableStyles:u.STATIC_XFORMS.tableStyles,extLst:u.STATIC_XFORMS.extLst},f&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:"pattern",pattern:"none"}),this._addFill({type:"pattern",pattern:"gray125"}),this.weakMap=new WeakMap}render(f,w){w=w||this.model,f.openXml(o.StdDocAttributes),f.openNode("styleSheet",u.STYLESHEET_ATTRIBUTES),this.index?(w.numFmts&&w.numFmts.length&&(f.openNode("numFmts",{count:w.numFmts.length}),w.numFmts.forEach(_=>{f.writeXml(_)}),f.closeNode()),w.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),f.openNode("fonts",{count:w.fonts.length,"x14ac:knownFonts":1}),w.fonts.forEach(_=>{f.writeXml(_)}),f.closeNode(),f.openNode("fills",{count:w.fills.length}),w.fills.forEach(_=>{f.writeXml(_)}),f.closeNode(),f.openNode("borders",{count:w.borders.length}),w.borders.forEach(_=>{f.writeXml(_)}),f.closeNode(),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),f.openNode("cellXfs",{count:w.styles.length}),w.styles.forEach(_=>{f.writeXml(_)}),f.closeNode()):(this.map.numFmts.render(f,w.numFmts),this.map.fonts.render(f,w.fonts),this.map.fills.render(f,w.fills),this.map.borders.render(f,w.borders),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(f,w.styles)),u.STATIC_XFORMS.cellStyles.render(f),this.map.dxfs.render(f,w.dxfs),u.STATIC_XFORMS.tableStyles.render(f),u.STATIC_XFORMS.extLst.render(f),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"styleSheet":return this.initIndex(),!0;default:return this.parser=this.map[f.name],this.parser&&this.parser.parseOpen(f),!0}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser)return this.parser.parseClose(f)||(this.parser=void 0),!0;switch(f){case"styleSheet":{this.model={};const w=(_,A)=>{A.model&&A.model.length&&(this.model[_]=A.model)};if(w("numFmts",this.map.numFmts),w("fonts",this.map.fonts),w("fills",this.map.fills),w("borders",this.map.borders),w("styles",this.map.cellXfs),w("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const _=this.index.numFmt;this.model.numFmts.forEach(A=>{_[A.id]=A.formatCode})}return!1}default:return!0}}addStyleModel(f,w){if(!f)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),this.weakMap&&this.weakMap.has(f))return this.weakMap.get(f);const _={};if(w=w||m.ValueType.Number,f.numFmt)_.numFmtId=this._addNumFmtStr(f.numFmt);else switch(w){case m.ValueType.Number:_.numFmtId=this._addNumFmtStr("General");break;case m.ValueType.Date:_.numFmtId=this._addNumFmtStr("mm-dd-yy")}f.font&&(_.fontId=this._addFont(f.font)),f.border&&(_.borderId=this._addBorder(f.border)),f.fill&&(_.fillId=this._addFill(f.fill)),f.alignment&&(_.alignment=f.alignment),f.protection&&(_.protection=f.protection);const A=this._addStyle(_);return this.weakMap&&this.weakMap.set(f,A),A}getStyleModel(f){const w=this.model.styles[f];if(!w)return null;let _=this.index.model[f];if(_)return _;if(_=this.index.model[f]={},w.numFmtId){const N=this.index.numFmt[w.numFmtId]||i.getDefaultFmtCode(w.numFmtId);N&&(_.numFmt=N)}function A(N,L,I){if(I||I===0){const P=L[I];P&&(_[N]=P)}}return A("font",this.model.fonts,w.fontId),A("border",this.model.borders,w.borderId),A("fill",this.model.fills,w.fillId),w.alignment&&(_.alignment=w.alignment),w.protection&&(_.protection=w.protection),_}addDxfStyle(f){return f.numFmt&&(f.numFmtId=this._addNumFmtStr(f.numFmt)),this.model.dxfs.push(f),this.model.dxfs.length-1}getDxfStyle(f){return this.model.dxfs[f]}_addStyle(f){const w=this.map.style.toXml(f);let _=this.index.style[w];return _===void 0&&(_=this.index.style[w]=this.model.styles.length,this.model.styles.push(w)),_}_addNumFmtStr(f){let w=i.getDefaultFmtId(f);if(w!==void 0||(w=this.index.numFmt[f],w!==void 0))return w;w=this.index.numFmt[f]=164+this.model.numFmts.length;const _=this.map.numFmt.toXml({id:w,formatCode:f});return this.model.numFmts.push(_),w}_addFont(f){const w=this.map.font.toXml(f);let _=this.index.font[w];return _===void 0&&(_=this.index.font[w]=this.model.fonts.length,this.model.fonts.push(w)),_}_addBorder(f){const w=this.map.border.toXml(f);let _=this.index.border[w];return _===void 0&&(_=this.index.border[w]=this.model.borders.length,this.model.borders.push(w)),_}_addFill(f){const w=this.map.fill.toXml(f);let _=this.index.fill[w];return _===void 0&&(_=this.index.fill[w]=this.model.fills.length,this.model.fills.push(w)),_}}u.STYLESHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac x16r2","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"},u.STATIC_XFORMS={cellStyles:new r({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new r({tag:"dxfs",$:{count:0}}),tableStyles:new r({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new r({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})},u.Mock=class extends u{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}],borders:[{}],fills:[{type:"pattern",pattern:"none"},{type:"pattern",pattern:"gray125"}]}}parseStream(d){return d.autodrain(),Promise.resolve()}addStyleModel(d,f){switch(f){case m.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){const d={numFmtId:i.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(d)}return this._dateStyleId}getStyleModel(){return{}}},T.exports=u},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(s,T,S){const m=s("../base-xform");class o extends m{constructor(r){super(),this.model=r}get tag(){return"u"}render(r,t){if((t=t||this.model)===!0)r.leafNode("u");else{const e=o.Attributes[t];e&&r.leafNode("u",e)}}parseOpen(r){r.name==="u"&&(this.model=r.attributes.val||!0)}parseText(){}parseClose(){return!1}}o.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},T.exports=o},{"../base-xform":32}],137:[function(s,T,S){const m=s("../base-xform"),o=s("./filter-column-xform");T.exports=class extends m{constructor(){super(),this.map={filterColumn:new o}}get tag(){return"autoFilter"}prepare(a){a.columns.forEach((r,t)=>{this.map.filterColumn.prepare(r,{index:t})})}render(a,r){return a.openNode(this.tag,{ref:r.autoFilterRef}),r.columns.forEach(t=>{this.map.filterColumn.render(a,t)}),a.closeNode(),!0}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:return this.model={autoFilterRef:a.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[a.name],this.parser)return this.parseOpen(a),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(a))}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(a){case this.tag:return!1;default:throw new Error("Unexpected xml node in parseClose: "+a)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"customFilter"}render(o,a){o.leafNode(this.tag,{val:a.val,operator:a.operator})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val,operator:o.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(s,T,S){const m=s("../base-xform"),o=s("../list-xform"),a=s("./custom-filter-xform"),r=s("./filter-xform");T.exports=class extends m{constructor(){super(),this.map={customFilters:new o({tag:"customFilters",count:!1,empty:!0,childXform:new a}),filters:new o({tag:"filters",count:!1,empty:!0,childXform:new r})}}get tag(){return"filterColumn"}prepare(t,e){t.colId=e.index.toString()}render(t,e){return e.customFilters?(t.openNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),this.map.customFilters.render(t,e.customFilters),t.closeNode(),!0):(t.leafNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),!0)}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;const{attributes:e}=t;switch(t.name){case this.tag:return this.model={filterButton:e.hiddenButton==="0"},!0;default:if(this.parser=this.map[t.name],this.parser)return this.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}}parseText(){}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"filter"}render(o,a){o.leafNode(this.tag,{val:a.val})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"tableColumn"}prepare(o,a){o.id=a.index+1}render(o,a){return o.leafNode(this.tag,{id:a.id.toString(),name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:a}=o;return this.model={name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"tableStyleInfo"}render(o,a){return o.leafNode(this.tag,{name:a.theme?a.theme:void 0,showFirstColumn:a.showFirstColumn?"1":"0",showLastColumn:a.showLastColumn?"1":"0",showRowStripes:a.showRowStripes?"1":"0",showColumnStripes:a.showColumnStripes?"1":"0"}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:a}=o;return this.model={theme:a.name?a.name:null,showFirstColumn:a.showFirstColumn==="1",showLastColumn:a.showLastColumn==="1",showRowStripes:a.showRowStripes==="1",showColumnStripes:a.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../list-xform"),r=s("./auto-filter-xform"),t=s("./table-column-xform"),e=s("./table-style-info-xform");class l extends o{constructor(){super(),this.map={autoFilter:new r,tableColumns:new a({tag:"tableColumns",count:!0,empty:!0,childXform:new t}),tableStyleInfo:new e}}prepare(i,c){this.map.autoFilter.prepare(i),this.map.tableColumns.prepare(i.columns,c)}get tag(){return"table"}render(i,c){i.openXml(m.StdDocAttributes),i.openNode(this.tag,{...l.TABLE_ATTRIBUTES,id:c.id,name:c.name,displayName:c.displayName||c.name,ref:c.tableRef,totalsRowCount:c.totalsRow?"1":void 0,totalsRowShown:c.totalsRow?void 0:"1",headerRowCount:c.headerRow?"1":"0"}),this.map.autoFilter.render(i,c),this.map.tableColumns.render(i,c.columns),this.map.tableStyleInfo.render(i,c.style),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;const{name:c,attributes:h}=i;switch(c){case this.tag:this.reset(),this.model={name:h.name,displayName:h.displayName||h.name,tableRef:h.ref,totalsRow:h.totalsRowCount==="1",headerRow:h.headerRowCount==="1"};break;default:this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)}return!0}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.parser=void 0),!0;switch(i){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((c,h)=>{this.model.columns[h].filterButton=c.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(i,c){i.columns.forEach(h=>{h.dxfId!==void 0&&(h.style=c.styles.getDxfStyle(h.dxfId))})}}l.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"},T.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(s,T,S){(function(m,o){(function(){const a=s("fs"),r=s("jszip"),{PassThrough:t}=s("readable-stream"),e=s("../utils/zip-stream"),l=s("../utils/stream-buf"),n=s("../utils/utils"),i=s("../utils/xml-stream"),{bufferToString:c}=s("../utils/browser-buffer-decode"),h=s("./xform/style/styles-xform"),u=s("./xform/core/core-xform"),d=s("./xform/strings/shared-strings-xform"),f=s("./xform/core/relationships-xform"),w=s("./xform/core/content-types-xform"),_=s("./xform/core/app-xform"),A=s("./xform/book/workbook-xform"),N=s("./xform/sheet/worksheet-xform"),L=s("./xform/drawing/drawing-xform"),I=s("./xform/table/table-xform"),P=s("./xform/comment/comments-xform"),D=s("./xform/comment/vml-notes-xform"),U=s("./xml/theme1");class B{constructor(M){this.workbook=M}async readFile(M,v){if(!await n.fs.exists(M))throw new Error("File not found: "+M);const p=a.createReadStream(M);try{const b=await this.read(p,v);return p.close(),b}catch(b){throw p.close(),b}}parseRels(M){return new f().parseStream(M)}parseWorkbook(M){return new A().parseStream(M)}parseSharedStrings(M){return new d().parseStream(M)}reconcile(M,v){const p=new A,b=new N(v),g=new L,y=new I;p.reconcile(M);const k={media:M.media,mediaIndex:M.mediaIndex};Object.keys(M.drawings).forEach(z=>{const $=M.drawings[z],W=M.drawingRels[z];W&&(k.rels=W.reduce((j,H)=>(j[H.Id]=H,j),{}),($.anchors||[]).forEach(j=>{const H=j.picture&&j.picture.hyperlinks;H&&k.rels[H.rId]&&(H.hyperlink=k.rels[H.rId].Target,delete H.rId)}),g.reconcile($,k))});const R={styles:M.styles};Object.values(M.tables).forEach(z=>{y.reconcile(z,R)});const O={styles:M.styles,sharedStrings:M.sharedStrings,media:M.media,mediaIndex:M.mediaIndex,date1904:M.properties&&M.properties.date1904,drawings:M.drawings,comments:M.comments,tables:M.tables,vmlDrawings:M.vmlDrawings};M.worksheets.forEach(z=>{z.relationships=M.worksheetRels[z.sheetNo],b.reconcile(z,O)}),delete M.worksheetHash,delete M.worksheetRels,delete M.globalRels,delete M.sharedStrings,delete M.workbookRels,delete M.sheetDefs,delete M.styles,delete M.mediaIndex,delete M.drawings,delete M.drawingRels,delete M.vmlDrawings}async _processWorksheetEntry(M,v,p,b,g){const y=new N(b),k=await y.parseStream(M);k.sheetNo=p,v.worksheetHash[g]=k,v.worksheets.push(k)}async _processCommentEntry(M,v,p){const b=new P,g=await b.parseStream(M);v.comments[`../${p}.xml`]=g}async _processTableEntry(M,v,p){const b=new I,g=await b.parseStream(M);v.tables[`../tables/${p}.xml`]=g}async _processWorksheetRelsEntry(M,v,p){const b=new f,g=await b.parseStream(M);v.worksheetRels[p]=g}async _processMediaEntry(M,v,p){const b=p.lastIndexOf(".");if(b>=1){const g=p.substr(b+1),y=p.substr(0,b);await new Promise((k,R)=>{const O=new l;O.on("finish",()=>{v.mediaIndex[p]=v.media.length,v.mediaIndex[y]=v.media.length;const z={type:"image",name:y,extension:g,buffer:O.toBuffer()};v.media.push(z),k()}),M.on("error",z=>{R(z)}),M.pipe(O)})}}async _processDrawingEntry(M,v,p){const b=new L,g=await b.parseStream(M);v.drawings[p]=g}async _processDrawingRelsEntry(M,v,p){const b=new f,g=await b.parseStream(M);v.drawingRels[p]=g}async _processVmlDrawingEntry(M,v,p){const b=new D,g=await b.parseStream(M);v.vmlDrawings[`../drawings/${p}.vml`]=g}async _processThemeEntry(M,v,p){await new Promise((b,g)=>{const y=new l;M.on("error",g),y.on("error",g),y.on("finish",()=>{v.themes[p]=y.read().toString(),b()}),M.pipe(y)})}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(M,v){!M[Symbol.asyncIterator]&&M.pipe&&(M=M.pipe(new t));const p=[];for await(const b of M)p.push(b);return this.load(o.concat(p),v)}async load(M,v){let p;p=v&&v.base64?o.from(M.toString(),"base64"):M;const b={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},g=await r.loadAsync(p);for(const y of Object.values(g.files))if(!y.dir){let k,R=y.name;if(R[0]==="/"&&(R=R.substr(1)),R.match(/xl\/media\//)||R.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))k=new t,k.write(await y.async("nodebuffer"));else{let O;k=new t({writableObjectMode:!0,readableObjectMode:!0}),O=m.browser?c(await y.async("nodebuffer")):await y.async("string");const z=16384;for(let $=0;${if(p.type==="image"){const b=`xl/media/${p.name}.${p.extension}`;if(p.filename){const g=await function(y,k){return new Promise((R,O)=>{a.readFile(y,k,(z,$)=>{z?O(z):R($)})})}(p.filename);return M.append(g,{name:b})}if(p.buffer)return M.append(p.buffer,{name:b});if(p.base64){const g=p.base64,y=g.substring(g.indexOf(",")+1);return M.append(y,{name:b,base64:!0})}}throw new Error("Unsupported media")}))}addDrawings(M,v){const p=new L,b=new f;v.worksheets.forEach(g=>{const{drawing:y}=g;if(y){p.prepare(y,{});let k=p.toXml(y);M.append(k,{name:`xl/drawings/${y.name}.xml`}),k=b.toXml(y.rels),M.append(k,{name:`xl/drawings/_rels/${y.name}.xml.rels`})}})}addTables(M,v){const p=new I;v.worksheets.forEach(b=>{const{tables:g}=b;g.forEach(y=>{p.prepare(y,{});const k=p.toXml(y);M.append(k,{name:"xl/tables/"+y.target})})})}async addContentTypes(M,v){const p=new w().toXml(v);M.append(p,{name:"[Content_Types].xml"})}async addApp(M,v){const p=new _().toXml(v);M.append(p,{name:"docProps/app.xml"})}async addCore(M,v){const p=new u;M.append(p.toXml(v),{name:"docProps/core.xml"})}async addThemes(M,v){const p=v.themes||{theme1:U};Object.keys(p).forEach(b=>{const g=p[b],y=`xl/theme/${b}.xml`;M.append(g,{name:y})})}async addOfficeRels(M){const v=new f().toXml([{Id:"rId1",Type:B.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:B.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:B.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);M.append(v,{name:"_rels/.rels"})}async addWorkbookRels(M,v){let p=1;const b=[{Id:"rId"+p++,Type:B.RelType.Styles,Target:"styles.xml"},{Id:"rId"+p++,Type:B.RelType.Theme,Target:"theme/theme1.xml"}];v.sharedStrings.count&&b.push({Id:"rId"+p++,Type:B.RelType.SharedStrings,Target:"sharedStrings.xml"}),v.worksheets.forEach(y=>{y.rId="rId"+p++,b.push({Id:y.rId,Type:B.RelType.Worksheet,Target:`worksheets/sheet${y.id}.xml`})});const g=new f().toXml(b);M.append(g,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(M,v){v.sharedStrings&&v.sharedStrings.count&&M.append(v.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(M,v){const{xml:p}=v.styles;p&&M.append(p,{name:"xl/styles.xml"})}async addWorkbook(M,v){const p=new A;M.append(p.toXml(v),{name:"xl/workbook.xml"})}async addWorksheets(M,v){const p=new N,b=new f,g=new P,y=new D;v.worksheets.forEach(k=>{let R=new i;p.render(R,k),M.append(R.xml,{name:`xl/worksheets/sheet${k.id}.xml`}),k.rels&&k.rels.length&&(R=new i,b.render(R,k.rels),M.append(R.xml,{name:`xl/worksheets/_rels/sheet${k.id}.xml.rels`})),k.comments.length>0&&(R=new i,g.render(R,k),M.append(R.xml,{name:`xl/comments${k.id}.xml`}),R=new i,y.render(R,k),M.append(R.xml,{name:`xl/drawings/vmlDrawing${k.id}.vml`}))})}_finalize(M){return new Promise((v,p)=>{M.on("finish",()=>{v(this)}),M.on("error",p),M.finalize()})}prepareModel(M,v){M.creator=M.creator||"ExcelJS",M.lastModifiedBy=M.lastModifiedBy||"ExcelJS",M.created=M.created||new Date,M.modified=M.modified||new Date,M.useSharedStrings=v.useSharedStrings===void 0||v.useSharedStrings,M.useStyles=v.useStyles===void 0||v.useStyles,M.sharedStrings=new d,M.styles=M.useStyles?new h(!0):new h.Mock;const p=new A,b=new N;p.prepare(M);const g={sharedStrings:M.sharedStrings,styles:M.styles,date1904:M.properties.date1904,drawingsCount:0,media:M.media};g.drawings=M.drawings=[],g.commentRefs=M.commentRefs=[];let y=0;M.tables=[],M.worksheets.forEach(k=>{k.tables.forEach(R=>{y++,R.target=`table${y}.xml`,R.id=y,M.tables.push(R)}),b.prepare(k,g)})}async write(M,v){v=v||{};const{model:p}=this.workbook,b=new e.ZipWriter(v.zip);return b.pipe(M),this.prepareModel(p,v),await this.addContentTypes(b,p),await this.addOfficeRels(b,p),await this.addWorkbookRels(b,p),await this.addWorksheets(b,p),await this.addSharedStrings(b,p),await this.addDrawings(b,p),await this.addTables(b,p),await Promise.all([this.addThemes(b,p),this.addStyles(b,p)]),await this.addMedia(b,p),await Promise.all([this.addApp(b,p),this.addCore(b,p)]),await this.addWorkbook(b,p),this._finalize(b)}writeFile(M,v){const p=a.createWriteStream(M);return new Promise((b,g)=>{p.on("finish",()=>{b()}),p.on("error",y=>{g(y)}),this.write(p,v).then(()=>{p.end()}).catch(y=>{g(y)})})}async writeBuffer(M){const v=new l;return await this.write(v,M),v.read()}}B.RelType=s("./rel-type"),T.exports=B}).call(this)}).call(this,s("_process"),s("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(s,T,S){T.exports=` `},{}],146:[function(s,T,S){(function(m){(function(){Object.defineProperty(S,"__esModule",{value:!0}),S.CsvFormatterStream=void 0;const o=s("stream"),a=s("./formatter");class r extends o.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new a.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,l,n){let i=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(e,(c,h)=>c?(i=!0,n(c)):(h&&h.forEach(u=>{this.push(m.from(u,"utf8"))}),i=!0,n()))}catch(c){if(i)throw c;n(c)}}_flush(e){this.rowFormatter.finish((l,n)=>l?e(l):(n&&n.forEach(i=>{this.push(m.from(i,"utf8"))}),e()))}}S.CsvFormatterStream=r}).call(this)}).call(this,s("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.FormatterOptions=void 0,S.FormatterOptions=class{constructor(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var o;this.objectMode=!0,this.delimiter=",",this.rowDelimiter=` `,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,m||{}),(m==null?void 0:m.quoteHeaders)===void 0&&(this.quoteHeaders=this.quoteColumns),(m==null?void 0:m.quote)===!0?this.quote='"':(m==null?void 0:m.quote)===!1&&(this.quote=""),typeof(m==null?void 0:m.escape)!="string"&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((o=m.writeHeaders)===null||o===void 0||o),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(s,T,S){var m=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(S,"__esModule",{value:!0}),S.FieldFormatter=void 0;const o=m(s("lodash.isboolean")),a=m(s("lodash.isnil")),r=m(s("lodash.escaperegexp"));S.FieldFormatter=class{constructor(t){this._headers=null,this.formatterOptions=t,t.headers!==null&&(this.headers=t.headers),this.REPLACE_REGEXP=new RegExp(t.quote,"g");const e=`[${t.delimiter}${r.default(t.rowDelimiter)}|\r| ]`;this.ESCAPE_REGEXP=new RegExp(e)}set headers(t){this._headers=t}shouldQuote(t,e){const l=e?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return o.default(l)?l:Array.isArray(l)?l[t]:this._headers!==null&&l[this._headers[t]]}format(t,e,l){const n=(""+(a.default(t)?"":t)).replace(/\0/g,""),{formatterOptions:i}=this;return i.quote!==""&&n.indexOf(i.quote)!==-1?this.quoteField(n.replace(this.REPLACE_REGEXP,i.escapedQuote)):n.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(e,l)?this.quoteField(n):n}quoteField(t){const{quote:e}=this.formatterOptions;return`${e}${t}${e}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(s,T,S){var m=function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(S,"__esModule",{value:!0}),S.RowFormatter=void 0;const o=m(s("lodash.isfunction")),a=m(s("lodash.isequal")),r=s("./FieldFormatter"),t=s("../types");class e{constructor(n){this.rowCount=0,this.formatterOptions=n,this.fieldFormatter=new r.FieldFormatter(n),this.headers=n.headers,this.shouldWriteHeaders=n.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),n.transform&&(this.rowTransform=n.transform)}static isRowHashArray(n){return!!Array.isArray(n)&&Array.isArray(n[0])&&n[0].length===2}static isRowArray(n){return Array.isArray(n)&&!this.isRowHashArray(n)}static gatherHeaders(n){return e.isRowHashArray(n)?n.map(i=>i[0]):Array.isArray(n)?n:Object.keys(n)}static createTransform(n){return t.isSyncTransform(n)?(i,c)=>{let h=null;try{h=n(i)}catch(u){return c(u)}return c(null,h)}:(i,c)=>{n(i,c)}}set rowTransform(n){if(!o.default(n))throw new TypeError("The transform should be a function");this._rowTransform=e.createTransform(n)}format(n,i){this.callTransformer(n,(c,h)=>{if(c)return i(c);if(!n)return i(null);const u=[];if(h){const{shouldFormatColumns:d,headers:f}=this.checkHeaders(h);if(this.shouldWriteHeaders&&f&&!this.hasWrittenHeaders&&(u.push(this.formatColumns(f,!0)),this.hasWrittenHeaders=!0),d){const w=this.gatherColumns(h);u.push(this.formatColumns(w,!1))}}return i(null,u)})}finish(n){const i=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return n(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));i.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&i.push(this.formatterOptions.rowDelimiter),n(null,i)}checkHeaders(n){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const i=e.gatherHeaders(n);return this.headers=i,this.fieldFormatter.headers=i,this.shouldWriteHeaders?{shouldFormatColumns:!a.default(i,n),headers:i}:{shouldFormatColumns:!0,headers:null}}gatherColumns(n){if(this.headers===null)throw new Error("Headers is currently null");return Array.isArray(n)?e.isRowHashArray(n)?this.headers.map((i,c)=>{const h=n[c];return h?h[1]:""}):e.isRowArray(n)&&!this.shouldWriteHeaders?n:this.headers.map((i,c)=>n[c]):this.headers.map(i=>n[i])}callTransformer(n,i){return this._rowTransform?this._rowTransform(n,i):i(null,n)}formatColumns(n,i){const c=n.map((u,d)=>this.fieldFormatter.format(u,d,i)).join(this.formatterOptions.delimiter),{rowCount:h}=this;return this.rowCount+=1,h?[this.formatterOptions.rowDelimiter,c].join(""):c}}S.RowFormatter=e},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.FieldFormatter=S.RowFormatter=void 0;var m=s("./RowFormatter");Object.defineProperty(S,"RowFormatter",{enumerable:!0,get:function(){return m.RowFormatter}});var o=s("./FieldFormatter");Object.defineProperty(S,"FieldFormatter",{enumerable:!0,get:function(){return o.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(s,T,S){(function(m){(function(){var o=Object.create?function(d,f,w,_){_===void 0&&(_=w),Object.defineProperty(d,_,{enumerable:!0,get:function(){return f[w]}})}:function(d,f,w,_){_===void 0&&(_=w),d[_]=f[w]},a=Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f},r=function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var w in d)w!=="default"&&Object.prototype.hasOwnProperty.call(d,w)&&o(f,d,w);return a(f,d),f},t=function(d,f){for(var w in d)w==="default"||Object.prototype.hasOwnProperty.call(f,w)||o(f,d,w)};Object.defineProperty(S,"__esModule",{value:!0}),S.writeToPath=S.writeToString=S.writeToBuffer=S.writeToStream=S.write=S.format=S.FormatterOptions=S.CsvFormatterStream=void 0;const e=s("util"),l=s("stream"),n=r(s("fs")),i=s("./FormatterOptions"),c=s("./CsvFormatterStream");t(s("./types"),S);var h=s("./CsvFormatterStream");Object.defineProperty(S,"CsvFormatterStream",{enumerable:!0,get:function(){return h.CsvFormatterStream}});var u=s("./FormatterOptions");Object.defineProperty(S,"FormatterOptions",{enumerable:!0,get:function(){return u.FormatterOptions}}),S.format=d=>new c.CsvFormatterStream(new i.FormatterOptions(d)),S.write=(d,f)=>{const w=S.format(f),_=e.promisify((A,N)=>{w.write(A,void 0,N)});return d.reduce((A,N)=>A.then(()=>_(N)),Promise.resolve()).then(()=>w.end()).catch(A=>{w.emit("error",A)}),w},S.writeToStream=(d,f,w)=>S.write(f,w).pipe(d),S.writeToBuffer=function(d){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const w=[],_=new l.Writable({write(A,N,L){w.push(A),L()}});return new Promise((A,N)=>{_.on("error",N).on("finish",()=>A(m.concat(w))),S.write(d,f).pipe(_)})},S.writeToString=(d,f)=>S.writeToBuffer(d,f).then(w=>w.toString()),S.writeToPath=(d,f,w)=>{const _=n.createWriteStream(d,{encoding:"utf8"});return S.write(f,w).pipe(_)}}).call(this)}).call(this,s("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.isSyncTransform=void 0,S.isSyncTransform=m=>m.length===1},{}],153:[function(s,T,S){(function(m){(function(){Object.defineProperty(S,"__esModule",{value:!0}),S.CsvParserStream=void 0;const o=s("string_decoder"),a=s("stream"),r=s("./transforms"),t=s("./parser");class e extends a.Transform{constructor(n){super({objectMode:n.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=n,this.parser=new t.Parser(n),this.headerTransformer=new r.HeaderTransformer(n),this.decoder=new o.StringDecoder(n.encoding),this.rowTransformerValidator=new r.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(n){return this.rowTransformerValidator.rowTransform=n,this}validate(n){return this.rowTransformerValidator.rowValidator=n,this}emit(n){if(n==="end")return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var i=arguments.length,c=new Array(i>1?i-1:0),h=1;h{const d=_=>_?i(_):u%100!=0?h(u+1):void m(()=>h(u+1));if(this.checkAndEmitHeaders(),u>=c||this.hasHitRowLimit)return i();if(this.parsedLineCount+=1,this.shouldSkipLine)return d();const f=n[u];this.rowCount+=1,this.parsedRowCount+=1;const w=this.rowCount;return this.transformRow(f,(_,A)=>{if(_)return this.rowCount-=1,d(_);if(!A)return d(new Error("expected transform result"));if(A.isValid){if(A.row)return this.pushRow(A.row,d)}else this.emit("data-invalid",A.row,w,A.reason);return d()})};h(0)}transformRow(n,i){try{this.headerTransformer.transform(n,(c,h)=>c?i(c):h?h.isValid?h.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(h.row,i):this.skipRow(i):(this.rowCount-=1,this.parsedRowCount-=1,i(null,{row:null,isValid:!0})):this.shouldEmitRows?i(null,{isValid:!1,row:n}):this.skipRow(i):i(new Error("Expected result from header transform")))}catch(c){i(c)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(n){return this.rowCount-=1,n(null,{row:null,isValid:!0})}pushRow(n,i){try{this.parserOptions.objectMode?this.push(n):this.push(JSON.stringify(n)),i()}catch(c){i(c)}}static wrapDoneCallback(n){let i=!1;return function(c){if(c){if(i)throw c;return i=!0,void n(c)}for(var h=arguments.length,u=new Array(h>1?h-1:0),d=1;d1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=o.default(this.delimiter),this.escapeChar=(t=this.escape)!==null&&t!==void 0?t:this.quote,this.supportsComments=!a.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(s,T,S){var m=Object.create?function(h,u,d,f){f===void 0&&(f=d),Object.defineProperty(h,f,{enumerable:!0,get:function(){return u[d]}})}:function(h,u,d,f){f===void 0&&(f=d),h[f]=u[d]},o=Object.create?function(h,u){Object.defineProperty(h,"default",{enumerable:!0,value:u})}:function(h,u){h.default=u},a=function(h){if(h&&h.__esModule)return h;var u={};if(h!=null)for(var d in h)d!=="default"&&Object.prototype.hasOwnProperty.call(h,d)&&m(u,h,d);return o(u,h),u},r=function(h,u){for(var d in h)d==="default"||Object.prototype.hasOwnProperty.call(u,d)||m(u,h,d)};Object.defineProperty(S,"__esModule",{value:!0}),S.parseString=S.parseFile=S.parseStream=S.parse=S.ParserOptions=S.CsvParserStream=void 0;const t=a(s("fs")),e=s("stream"),l=s("./ParserOptions"),n=s("./CsvParserStream");r(s("./types"),S);var i=s("./CsvParserStream");Object.defineProperty(S,"CsvParserStream",{enumerable:!0,get:function(){return i.CsvParserStream}});var c=s("./ParserOptions");Object.defineProperty(S,"ParserOptions",{enumerable:!0,get:function(){return c.ParserOptions}}),S.parse=h=>new n.CsvParserStream(new l.ParserOptions(h)),S.parseStream=(h,u)=>h.pipe(new n.CsvParserStream(new l.ParserOptions(u))),S.parseFile=function(h){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.createReadStream(h).pipe(new n.CsvParserStream(new l.ParserOptions(u)))},S.parseString=(h,u)=>{const d=new e.Readable;return d.push(h),d.push(null),d.pipe(new n.CsvParserStream(new l.ParserOptions(u)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.Parser=void 0;const m=s("./Scanner"),o=s("./RowParser"),a=s("./Token");class r{constructor(e){this.parserOptions=e,this.rowParser=new o.RowParser(this.parserOptions)}static removeBOM(e){return e&&e.charCodeAt(0)===65279?e.slice(1):e}parse(e,l){const n=new m.Scanner({line:r.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:l});return this.parserOptions.supportsComments?this.parseWithComments(n):this.parseWithoutComments(n)}parseWithoutComments(e){const l=[];let n=!0;for(;n;)n=this.parseRow(e,l);return{line:e.line,rows:l}}parseWithComments(e){const{parserOptions:l}=this,n=[];for(let i=e.nextCharacterToken;i!==null;i=e.nextCharacterToken)if(a.Token.isTokenComment(i,l)){if(e.advancePastLine()===null)return{line:e.lineFromCursor,rows:n};if(!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:n};e.truncateToCursor()}else if(!this.parseRow(e,n))break;return{line:e.line,rows:n}}parseRow(e,l){if(!e.nextNonSpaceToken)return!1;const n=this.rowParser.parse(e);return n!==null&&(this.parserOptions.ignoreEmpty&&o.RowParser.isEmptyRow(n)||l.push(n),!0)}}S.Parser=r},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.RowParser=void 0;const m=s("./column"),o=s("./Token");S.RowParser=class{constructor(a){this.parserOptions=a,this.columnParser=new m.ColumnParser(a)}static isEmptyRow(a){return a.join("").replace(/\s+/g,"")===""}parse(a){const{parserOptions:r}=this,{hasMoreData:t}=a,e=a,l=[];let n=this.getStartToken(e,l);for(;n;){if(o.Token.isTokenRowDelimiter(n))return e.advancePastToken(n),!e.hasMoreCharacters&&o.Token.isTokenCarriageReturn(n,r)&&t?null:(e.truncateToCursor(),l);if(!this.shouldSkipColumnParse(e,n,l)){const i=this.columnParser.parse(e);if(i===null)return null;l.push(i)}n=e.nextNonSpaceToken}return t?null:(e.truncateToCursor(),l)}getStartToken(a,r){const t=a.nextNonSpaceToken;return t!==null&&o.Token.isTokenDelimiter(t,this.parserOptions)?(r.push(""),a.nextNonSpaceToken):t}shouldSkipColumnParse(a,r,t){const{parserOptions:e}=this;if(o.Token.isTokenDelimiter(r,e)){a.advancePastToken(r);const l=a.nextCharacterToken;if(!a.hasMoreCharacters||l!==null&&o.Token.isTokenRowDelimiter(l)||l!==null&&o.Token.isTokenDelimiter(l,e))return t.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.Scanner=void 0;const m=s("./Token"),o=/((?:\r\n)|\n|\r)/;S.Scanner=class{constructor(a){this.cursor=0,this.line=a.line,this.lineLength=this.line.length,this.parserOptions=a.parserOptions,this.hasMoreData=a.hasMoreData,this.cursor=a.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:a}=this,r=this.parserOptions.NEXT_TOKEN_REGEXP;if(a.search(r)===-1)return null;const t=r.exec(a);if(t==null)return null;const e=t[1],l=this.cursor+(t.index||0);return new m.Token({token:e,startCursor:l,endCursor:l+e.length-1})}get nextCharacterToken(){const{cursor:a,lineLength:r}=this;return r<=a?null:new m.Token({token:this.line[a],startCursor:a,endCursor:a})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const a=o.exec(this.lineFromCursor);return a?(this.cursor+=(a.index||0)+a[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(a){return this.cursor=a,this}advanceToToken(a){return this.cursor=a.startCursor,this}advancePastToken(a){return this.cursor=a.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.Token=void 0,S.Token=class{constructor(m){this.token=m.token,this.startCursor=m.startCursor,this.endCursor=m.endCursor}static isTokenRowDelimiter(m){const o=m.token;return o==="\r"||o===` `||o===`\r `}static isTokenCarriageReturn(m,o){return m.token===o.carriageReturn}static isTokenComment(m,o){return o.supportsComments&&!!m&&m.token===o.comment}static isTokenEscapeCharacter(m,o){return m.token===o.escapeChar}static isTokenQuote(m,o){return m.token===o.quote}static isTokenDelimiter(m,o){return m.token===o.delimiter}}},{}],160:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.ColumnFormatter=void 0,S.ColumnFormatter=class{constructor(m){m.trim?this.format=o=>o.trim():m.ltrim?this.format=o=>o.trimLeft():m.rtrim?this.format=o=>o.trimRight():this.format=o=>o}}},{}],161:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.ColumnParser=void 0;const m=s("./NonQuotedColumnParser"),o=s("./QuotedColumnParser"),a=s("../Token");S.ColumnParser=class{constructor(r){this.parserOptions=r,this.quotedColumnParser=new o.QuotedColumnParser(r),this.nonQuotedColumnParser=new m.NonQuotedColumnParser(r)}parse(r){const{nextNonSpaceToken:t}=r;return t!==null&&a.Token.isTokenQuote(t,this.parserOptions)?(r.advanceToToken(t),this.quotedColumnParser.parse(r)):this.nonQuotedColumnParser.parse(r)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.NonQuotedColumnParser=void 0;const m=s("./ColumnFormatter"),o=s("../Token");S.NonQuotedColumnParser=class{constructor(a){this.parserOptions=a,this.columnFormatter=new m.ColumnFormatter(a)}parse(a){if(!a.hasMoreCharacters)return null;const{parserOptions:r}=this,t=[];let e=a.nextCharacterToken;for(;e&&!o.Token.isTokenDelimiter(e,r)&&!o.Token.isTokenRowDelimiter(e);e=a.nextCharacterToken)t.push(e.token),a.advancePastToken(e);return this.columnFormatter.format(t.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.QuotedColumnParser=void 0;const m=s("./ColumnFormatter"),o=s("../Token");S.QuotedColumnParser=class{constructor(a){this.parserOptions=a,this.columnFormatter=new m.ColumnFormatter(a)}parse(a){if(!a.hasMoreCharacters)return null;const r=a.cursor,{foundClosingQuote:t,col:e}=this.gatherDataBetweenQuotes(a);if(!t){if(a.advanceTo(r),!a.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${a.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(a),e}gatherDataBetweenQuotes(a){const{parserOptions:r}=this;let t=!1,e=!1;const l=[];let n=a.nextCharacterToken;for(;!e&&n!==null;n=a.nextCharacterToken){const i=o.Token.isTokenQuote(n,r);if(!t&&i)t=!0;else if(t)if(o.Token.isTokenEscapeCharacter(n,r)){a.advancePastToken(n);const c=a.nextCharacterToken;c!==null&&(o.Token.isTokenQuote(c,r)||o.Token.isTokenEscapeCharacter(c,r))?(l.push(c.token),n=c):i?e=!0:l.push(n.token)}else i?e=!0:l.push(n.token);a.advancePastToken(n)}return{col:this.columnFormatter.format(l.join("")),foundClosingQuote:e}}checkForMalformedColumn(a){const{parserOptions:r}=this,{nextNonSpaceToken:t}=a;if(t){const e=o.Token.isTokenDelimiter(t,r),l=o.Token.isTokenRowDelimiter(t);if(!e&&!l){const n=a.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${r.escapedDelimiter}' OR new line got: '${t.token}'. at '${n}`)}a.advanceToToken(t)}else a.hasMoreData||a.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.ColumnFormatter=S.QuotedColumnParser=S.NonQuotedColumnParser=S.ColumnParser=void 0;var m=s("./ColumnParser");Object.defineProperty(S,"ColumnParser",{enumerable:!0,get:function(){return m.ColumnParser}});var o=s("./NonQuotedColumnParser");Object.defineProperty(S,"NonQuotedColumnParser",{enumerable:!0,get:function(){return o.NonQuotedColumnParser}});var a=s("./QuotedColumnParser");Object.defineProperty(S,"QuotedColumnParser",{enumerable:!0,get:function(){return a.QuotedColumnParser}});var r=s("./ColumnFormatter");Object.defineProperty(S,"ColumnFormatter",{enumerable:!0,get:function(){return r.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.QuotedColumnParser=S.NonQuotedColumnParser=S.ColumnParser=S.Token=S.Scanner=S.RowParser=S.Parser=void 0;var m=s("./Parser");Object.defineProperty(S,"Parser",{enumerable:!0,get:function(){return m.Parser}});var o=s("./RowParser");Object.defineProperty(S,"RowParser",{enumerable:!0,get:function(){return o.RowParser}});var a=s("./Scanner");Object.defineProperty(S,"Scanner",{enumerable:!0,get:function(){return a.Scanner}});var r=s("./Token");Object.defineProperty(S,"Token",{enumerable:!0,get:function(){return r.Token}});var t=s("./column");Object.defineProperty(S,"ColumnParser",{enumerable:!0,get:function(){return t.ColumnParser}}),Object.defineProperty(S,"NonQuotedColumnParser",{enumerable:!0,get:function(){return t.NonQuotedColumnParser}}),Object.defineProperty(S,"QuotedColumnParser",{enumerable:!0,get:function(){return t.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(s,T,S){var m=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(S,"__esModule",{value:!0}),S.HeaderTransformer=void 0;const o=m(s("lodash.isundefined")),a=m(s("lodash.isfunction")),r=m(s("lodash.uniq")),t=m(s("lodash.groupby"));S.HeaderTransformer=class{constructor(e){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=e,e.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):a.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,l){return this.shouldMapRow(e)?l(null,this.processRow(e)):l(null,{row:null,isValid:!0})}shouldMapRow(e){const{parserOptions:l}=this;if(!this.headersTransform&&l.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(e)}return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};const{parserOptions:l}=this;if(!l.discardUnmappedColumns&&e.length>this.headersLength){if(!l.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return l.strictColumnHandling&&e.length!!i);if(r.default(n).length!==n.length){const i=t.default(n),c=Object.keys(i).filter(h=>i[h].length>1);throw new Error("Duplicate headers found "+JSON.stringify(c))}this.headers=e,this.receivedHeaders=!0,this.headersLength=((l=this.headers)===null||l===void 0?void 0:l.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(s,T,S){var m=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(S,"__esModule",{value:!0}),S.RowTransformerValidator=void 0;const o=m(s("lodash.isfunction")),a=s("../types");class r{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return a.isSyncTransform(e)?(l,n)=>{let i=null;try{i=e(l)}catch(c){return n(c)}return n(null,i)}:e}static createValidator(e){return a.isSyncValidate(e)?(l,n)=>{n(null,{row:l,isValid:e(l)})}:(l,n)=>{e(l,(i,c,h)=>i?n(i):n(null,c?{row:l,isValid:c,reason:h}:{row:l,isValid:!1,reason:h}))}}set rowTransform(e){if(!o.default(e))throw new TypeError("The transform should be a function");this._rowTransform=r.createTransform(e)}set rowValidator(e){if(!o.default(e))throw new TypeError("The validate should be a function");this._rowValidator=r.createValidator(e)}transformAndValidate(e,l){return this.callTransformer(e,(n,i)=>n?l(n):i?this.callValidator(i,(c,h)=>c?l(c):h&&!h.isValid?l(null,{row:i,isValid:!1,reason:h.reason}):l(null,{row:i,isValid:!0})):l(null,{row:null,isValid:!0}))}callTransformer(e,l){return this._rowTransform?this._rowTransform(e,l):l(null,e)}callValidator(e,l){return this._rowValidator?this._rowValidator(e,l):l(null,{row:e,isValid:!0})}}S.RowTransformerValidator=r},{"../types":169,"lodash.isfunction":446}],168:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.HeaderTransformer=S.RowTransformerValidator=void 0;var m=s("./RowTransformerValidator");Object.defineProperty(S,"RowTransformerValidator",{enumerable:!0,get:function(){return m.RowTransformerValidator}});var o=s("./HeaderTransformer");Object.defineProperty(S,"HeaderTransformer",{enumerable:!0,get:function(){return o.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.isSyncValidate=S.isSyncTransform=void 0,S.isSyncTransform=m=>m.length===1,S.isSyncValidate=m=>m.length===1},{}],170:[function(s,T,S){const m=S;m.bignum=s("bn.js"),m.define=s("./asn1/api").define,m.base=s("./asn1/base"),m.constants=s("./asn1/constants"),m.decoders=s("./asn1/decoders"),m.encoders=s("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(s,T,S){const m=s("./encoders"),o=s("./decoders"),a=s("inherits");function r(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}S.define=function(t,e){return new r(t,e)},r.prototype._createNamed=function(t){const e=this.name;function l(n){this._initNamed(n,e)}return a(l,t),l.prototype._initNamed=function(n,i){t.call(this,n,i)},new l(this)},r.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(o[t])),this.decoders[t]},r.prototype.decode=function(t,e,l){return this._getDecoder(e).decode(t,l)},r.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(m[t])),this.encoders[t]},r.prototype.encode=function(t,e,l){return this._getEncoder(e).encode(t,l)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(s,T,S){const m=s("inherits"),o=s("../base/reporter").Reporter,a=s("safer-buffer").Buffer;function r(e,l){o.call(this,l),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function t(e,l){if(Array.isArray(e))this.length=0,this.value=e.map(function(n){return t.isEncoderBuffer(n)||(n=new t(n,l)),this.length+=n.length,n},this);else if(typeof e=="number"){if(!(0<=e&&e<=255))return l.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if(typeof e=="string")this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return l.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}m(r,o),S.DecoderBuffer=r,r.isDecoderBuffer=function(e){return e instanceof r?!0:typeof e=="object"&&a.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"},r.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},r.prototype.restore=function(e){const l=new r(this.base);return l.offset=e.offset,l.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),l},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},r.prototype.skip=function(e,l){if(!(this.offset+e<=this.length))return this.error(l||"DecoderBuffer overrun");const n=new r(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},r.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},S.EncoderBuffer=t,t.isEncoderBuffer=function(e){return e instanceof t?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"},t.prototype.join=function(e,l){return e||(e=a.alloc(this.length)),l||(l=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,l),l+=n.length}):(typeof this.value=="number"?e[l]=this.value:typeof this.value=="string"?e.write(this.value,l):a.isBuffer(this.value)&&this.value.copy(e,l),l+=this.length)),e}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(s,T,S){const m=S;m.Reporter=s("./reporter").Reporter,m.DecoderBuffer=s("./buffer").DecoderBuffer,m.EncoderBuffer=s("./buffer").EncoderBuffer,m.Node=s("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(s,T,S){const m=s("../base/reporter").Reporter,o=s("../base/buffer").EncoderBuffer,a=s("../base/buffer").DecoderBuffer,r=s("minimalistic-assert"),t=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],e=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(t);function l(i,c,h){const u={};this._baseState=u,u.name=h,u.enc=i,u.parent=c||null,u.children=null,u.tag=null,u.args=null,u.reverseArgs=null,u.choice=null,u.optional=!1,u.any=!1,u.obj=!1,u.use=null,u.useDecoder=null,u.key=null,u.default=null,u.explicit=null,u.implicit=null,u.contains=null,u.parent||(u.children=[],this._wrap())}T.exports=l;const n=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const i=this._baseState,c={};n.forEach(function(u){c[u]=i[u]});const h=new this.constructor(c.parent);return h._baseState=c,h},l.prototype._wrap=function(){const i=this._baseState;e.forEach(function(c){this[c]=function(){const h=new this.constructor(this);return i.children.push(h),h[c].apply(h,arguments)}},this)},l.prototype._init=function(i){const c=this._baseState;r(c.parent===null),i.call(this),c.children=c.children.filter(function(h){return h._baseState.parent===this},this),r.equal(c.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(i){const c=this._baseState,h=i.filter(function(u){return u instanceof this.constructor},this);i=i.filter(function(u){return!(u instanceof this.constructor)},this),h.length!==0&&(r(c.children===null),c.children=h,h.forEach(function(u){u._baseState.parent=this},this)),i.length!==0&&(r(c.args===null),c.args=i,c.reverseArgs=i.map(function(u){if(typeof u!="object"||u.constructor!==Object)return u;const d={};return Object.keys(u).forEach(function(f){f==(0|f)&&(f|=0);const w=u[f];d[w]=f}),d}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(i){l.prototype[i]=function(){const c=this._baseState;throw new Error(i+" not implemented for encoding: "+c.enc)}}),t.forEach(function(i){l.prototype[i]=function(){const c=this._baseState,h=Array.prototype.slice.call(arguments);return r(c.tag===null),c.tag=i,this._useArgs(h),this}}),l.prototype.use=function(i){r(i);const c=this._baseState;return r(c.use===null),c.use=i,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(i){const c=this._baseState;return r(c.default===null),c.default=i,c.optional=!0,this},l.prototype.explicit=function(i){const c=this._baseState;return r(c.explicit===null&&c.implicit===null),c.explicit=i,this},l.prototype.implicit=function(i){const c=this._baseState;return r(c.explicit===null&&c.implicit===null),c.implicit=i,this},l.prototype.obj=function(){const i=this._baseState,c=Array.prototype.slice.call(arguments);return i.obj=!0,c.length!==0&&this._useArgs(c),this},l.prototype.key=function(i){const c=this._baseState;return r(c.key===null),c.key=i,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(i){const c=this._baseState;return r(c.choice===null),c.choice=i,this._useArgs(Object.keys(i).map(function(h){return i[h]})),this},l.prototype.contains=function(i){const c=this._baseState;return r(c.use===null),c.contains=i,this},l.prototype._decode=function(i,c){const h=this._baseState;if(h.parent===null)return i.wrapResult(h.children[0]._decode(i,c));let u,d=h.default,f=!0,w=null;if(h.key!==null&&(w=i.enterKey(h.key)),h.optional){let _=null;if(h.explicit!==null?_=h.explicit:h.implicit!==null?_=h.implicit:h.tag!==null&&(_=h.tag),_!==null||h.any){if(f=this._peekTag(i,_,h.any),i.isError(f))return f}else{const A=i.save();try{h.choice===null?this._decodeGeneric(h.tag,i,c):this._decodeChoice(i,c),f=!0}catch{f=!1}i.restore(A)}}if(h.obj&&f&&(u=i.enterObject()),f){if(h.explicit!==null){const A=this._decodeTag(i,h.explicit);if(i.isError(A))return A;i=A}const _=i.offset;if(h.use===null&&h.choice===null){let A;h.any&&(A=i.save());const N=this._decodeTag(i,h.implicit!==null?h.implicit:h.tag,h.any);if(i.isError(N))return N;h.any?d=i.raw(A):i=N}if(c&&c.track&&h.tag!==null&&c.track(i.path(),_,i.length,"tagged"),c&&c.track&&h.tag!==null&&c.track(i.path(),i.offset,i.length,"content"),h.any||(d=h.choice===null?this._decodeGeneric(h.tag,i,c):this._decodeChoice(i,c)),i.isError(d))return d;if(h.any||h.choice!==null||h.children===null||h.children.forEach(function(A){A._decode(i,c)}),h.contains&&(h.tag==="octstr"||h.tag==="bitstr")){const A=new a(d);d=this._getUse(h.contains,i._reporterState.obj)._decode(A,c)}}return h.obj&&f&&(d=i.leaveObject(u)),h.key===null||d===null&&f!==!0?w!==null&&i.exitKey(w):i.leaveKey(w,h.key,d),d},l.prototype._decodeGeneric=function(i,c,h){const u=this._baseState;return i==="seq"||i==="set"?null:i==="seqof"||i==="setof"?this._decodeList(c,i,u.args[0],h):/str$/.test(i)?this._decodeStr(c,i,h):i==="objid"&&u.args?this._decodeObjid(c,u.args[0],u.args[1],h):i==="objid"?this._decodeObjid(c,null,null,h):i==="gentime"||i==="utctime"?this._decodeTime(c,i,h):i==="null_"?this._decodeNull(c,h):i==="bool"?this._decodeBool(c,h):i==="objDesc"?this._decodeStr(c,i,h):i==="int"||i==="enum"?this._decodeInt(c,u.args&&u.args[0],h):u.use!==null?this._getUse(u.use,c._reporterState.obj)._decode(c,h):c.error("unknown tag: "+i)},l.prototype._getUse=function(i,c){const h=this._baseState;return h.useDecoder=this._use(i,c),r(h.useDecoder._baseState.parent===null),h.useDecoder=h.useDecoder._baseState.children[0],h.implicit!==h.useDecoder._baseState.implicit&&(h.useDecoder=h.useDecoder.clone(),h.useDecoder._baseState.implicit=h.implicit),h.useDecoder},l.prototype._decodeChoice=function(i,c){const h=this._baseState;let u=null,d=!1;return Object.keys(h.choice).some(function(f){const w=i.save(),_=h.choice[f];try{const A=_._decode(i,c);if(i.isError(A))return!1;u={type:f,value:A},d=!0}catch{return i.restore(w),!1}return!0},this),d?u:i.error("Choice not matched")},l.prototype._createEncoderBuffer=function(i){return new o(i,this.reporter)},l.prototype._encode=function(i,c,h){const u=this._baseState;if(u.default!==null&&u.default===i)return;const d=this._encodeValue(i,c,h);return d===void 0||this._skipDefault(d,c,h)?void 0:d},l.prototype._encodeValue=function(i,c,h){const u=this._baseState;if(u.parent===null)return u.children[0]._encode(i,c||new m);let d=null;if(this.reporter=c,u.optional&&i===void 0){if(u.default===null)return;i=u.default}let f=null,w=!1;if(u.any)d=this._createEncoderBuffer(i);else if(u.choice)d=this._encodeChoice(i,c);else if(u.contains)f=this._getUse(u.contains,h)._encode(i,c),w=!0;else if(u.children)f=u.children.map(function(_){if(_._baseState.tag==="null_")return _._encode(null,c,i);if(_._baseState.key===null)return c.error("Child should have a key");const A=c.enterKey(_._baseState.key);if(typeof i!="object")return c.error("Child expected, but input is not object");const N=_._encode(i[_._baseState.key],c,i);return c.leaveKey(A),N},this).filter(function(_){return _}),f=this._createEncoderBuffer(f);else if(u.tag==="seqof"||u.tag==="setof"){if(!u.args||u.args.length!==1)return c.error("Too many args for : "+u.tag);if(!Array.isArray(i))return c.error("seqof/setof, but data is not Array");const _=this.clone();_._baseState.implicit=null,f=this._createEncoderBuffer(i.map(function(A){const N=this._baseState;return this._getUse(N.args[0],i)._encode(A,c)},_))}else u.use!==null?d=this._getUse(u.use,h)._encode(i,c):(f=this._encodePrimitive(u.tag,i),w=!0);if(!u.any&&u.choice===null){const _=u.implicit!==null?u.implicit:u.tag,A=u.implicit===null?"universal":"context";_===null?u.use===null&&c.error("Tag could be omitted only for .use()"):u.use===null&&(d=this._encodeComposite(_,w,A,f))}return u.explicit!==null&&(d=this._encodeComposite(u.explicit,!1,"context",d)),d},l.prototype._encodeChoice=function(i,c){const h=this._baseState,u=h.choice[i.type];return u||r(!1,i.type+" not found in "+JSON.stringify(Object.keys(h.choice))),u._encode(i.value,c)},l.prototype._encodePrimitive=function(i,c){const h=this._baseState;if(/str$/.test(i))return this._encodeStr(c,i);if(i==="objid"&&h.args)return this._encodeObjid(c,h.reverseArgs[0],h.args[1]);if(i==="objid")return this._encodeObjid(c,null,null);if(i==="gentime"||i==="utctime")return this._encodeTime(c,i);if(i==="null_")return this._encodeNull();if(i==="int"||i==="enum")return this._encodeInt(c,h.args&&h.reverseArgs[0]);if(i==="bool")return this._encodeBool(c);if(i==="objDesc")return this._encodeStr(c,i);throw new Error("Unsupported tag: "+i)},l.prototype._isNumstr=function(i){return/^[0-9 ]*$/.test(i)},l.prototype._isPrintstr=function(i){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(i)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(s,T,S){const m=s("inherits");function o(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}function a(r,t){this.path=r,this.rethrow(t)}S.Reporter=o,o.prototype.isError=function(r){return r instanceof a},o.prototype.save=function(){const r=this._reporterState;return{obj:r.obj,pathLen:r.path.length}},o.prototype.restore=function(r){const t=this._reporterState;t.obj=r.obj,t.path=t.path.slice(0,r.pathLen)},o.prototype.enterKey=function(r){return this._reporterState.path.push(r)},o.prototype.exitKey=function(r){const t=this._reporterState;t.path=t.path.slice(0,r-1)},o.prototype.leaveKey=function(r,t,e){const l=this._reporterState;this.exitKey(r),l.obj!==null&&(l.obj[t]=e)},o.prototype.path=function(){return this._reporterState.path.join("/")},o.prototype.enterObject=function(){const r=this._reporterState,t=r.obj;return r.obj={},t},o.prototype.leaveObject=function(r){const t=this._reporterState,e=t.obj;return t.obj=r,e},o.prototype.error=function(r){let t;const e=this._reporterState,l=r instanceof a;if(t=l?r:new a(e.path.map(function(n){return"["+JSON.stringify(n)+"]"}).join(""),r.message||r,r.stack),!e.options.partial)throw t;return l||e.errors.push(t),t},o.prototype.wrapResult=function(r){const t=this._reporterState;return t.options.partial?{result:this.isError(r)?null:r,errors:t.errors}:r},m(a,Error),a.prototype.rethrow=function(r){if(this.message=r+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:440}],176:[function(s,T,S){function m(o){const a={};return Object.keys(o).forEach(function(r){(0|r)==r&&(r|=0);const t=o[r];a[t]=r}),a}S.tagClass={0:"universal",1:"application",2:"context",3:"private"},S.tagClassByName=m(S.tagClass),S.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},S.tagByName=m(S.tag)},{}],177:[function(s,T,S){const m=S;m._reverse=function(o){const a={};return Object.keys(o).forEach(function(r){(0|r)==r&&(r|=0);const t=o[r];a[t]=r}),a},m.der=s("./der")},{"./der":176}],178:[function(s,T,S){const m=s("inherits"),o=s("bn.js"),a=s("../base/buffer").DecoderBuffer,r=s("../base/node"),t=s("../constants/der");function e(c){this.enc="der",this.name=c.name,this.entity=c,this.tree=new l,this.tree._init(c.body)}function l(c){r.call(this,"der",c)}function n(c,h){let u=c.readUInt8(h);if(c.isError(u))return u;const d=t.tagClass[u>>6],f=(32&u)==0;if((31&u)==31){let w=u;for(u=0;(128&w)==128;){if(w=c.readUInt8(h),c.isError(w))return w;u<<=7,u|=127&w}}else u&=31;return{cls:d,primitive:f,tag:u,tagStr:t.tag[u]}}function i(c,h,u){let d=c.readUInt8(u);if(c.isError(d))return d;if(!h&&d===128)return null;if(!(128&d))return d;const f=127&d;if(f>4)return c.error("length octect is too long");d=0;for(let w=0;w=31?N.error("Multi-octet tag encoding unsupported"):(_||(L|=32),L|=r.tagClassByName[A||"universal"]<<6,L)}(n,i,c,this.reporter);if(h.length<128){const w=o.alloc(2);return w[0]=u,w[1]=h.length,this._createEncoderBuffer([w,h])}let d=1;for(let w=h.length;w>=256;w>>=8)d++;const f=o.alloc(2+d);f[0]=u,f[1]=128|d;for(let w=1+d,_=h.length;_>0;w--,_>>=8)f[w]=255&_;return this._createEncoderBuffer([f,h])},e.prototype._encodeStr=function(n,i){if(i==="bitstr")return this._createEncoderBuffer([0|n.unused,n.data]);if(i==="bmpstr"){const c=o.alloc(2*n.length);for(let h=0;h=40)return this.reporter.error("Second objid identifier OOB");n.splice(0,2,40*n[0]+n[1])}let h=0;for(let f=0;f=128;w>>=7)h++}const u=o.alloc(h);let d=u.length-1;for(let f=n.length-1;f>=0;f--){let w=n[f];for(u[d--]=127&w;(w>>=7)>0;)u[d--]=128|127&w}return this._createEncoderBuffer(u)},e.prototype._encodeTime=function(n,i){let c;const h=new Date(n);return i==="gentime"?c=[l(h.getUTCFullYear()),l(h.getUTCMonth()+1),l(h.getUTCDate()),l(h.getUTCHours()),l(h.getUTCMinutes()),l(h.getUTCSeconds()),"Z"].join(""):i==="utctime"?c=[l(h.getUTCFullYear()%100),l(h.getUTCMonth()+1),l(h.getUTCDate()),l(h.getUTCHours()),l(h.getUTCMinutes()),l(h.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+i+" time is not supported yet"),this._encodeStr(c,"octstr")},e.prototype._encodeNull=function(){return this._createEncoderBuffer("")},e.prototype._encodeInt=function(n,i){if(typeof n=="string"){if(!i)return this.reporter.error("String int or enum given, but no values map");if(!i.hasOwnProperty(n))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(n));n=i[n]}if(typeof n!="number"&&!o.isBuffer(n)){const u=n.toArray();!n.sign&&128&u[0]&&u.unshift(0),n=o.from(u)}if(o.isBuffer(n)){let u=n.length;n.length===0&&u++;const d=o.alloc(u);return n.copy(d),n.length===0&&(d[0]=0),this._createEncoderBuffer(d)}if(n<128)return this._createEncoderBuffer(n);if(n<256)return this._createEncoderBuffer([0,n]);let c=1;for(let u=n;u>=256;u>>=8)c++;const h=new Array(c);for(let u=h.length-1;u>=0;u--)h[u]=255&n,n>>=8;return 128&h[0]&&h.unshift(0),this._createEncoderBuffer(o.from(h))},e.prototype._encodeBool=function(n){return this._createEncoderBuffer(n?255:0)},e.prototype._use=function(n,i){return typeof n=="function"&&(n=n(i)),n._getEncoder("der").tree},e.prototype._skipDefault=function(n,i,c){const h=this._baseState;let u;if(h.default===null)return!1;const d=n.join();if(h.defaultBuffer===void 0&&(h.defaultBuffer=this._encodeValue(h.default,i,c).join()),d.length!==h.defaultBuffer.length)return!1;for(u=0;u=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}function n(x,M,v){var p=l(x,v);return v-1>=M&&(p|=l(x,v-1)<<4),p}function i(x,M,v,p){for(var b=0,g=Math.min(x.length,v),y=M;y=49?k-49+10:k>=17?k-17+10:k}return b}t.isBN=function(x){return x instanceof t||x!==null&&typeof x=="object"&&x.constructor.wordSize===t.wordSize&&Array.isArray(x.words)},t.max=function(x,M){return x.cmp(M)>0?x:M},t.min=function(x,M){return x.cmp(M)<0?x:M},t.prototype._init=function(x,M,v){if(typeof x=="number")return this._initNumber(x,M,v);if(typeof x=="object")return this._initArray(x,M,v);M==="hex"&&(M=16),a(M===(0|M)&&M>=2&&M<=36);var p=0;(x=x.toString().replace(/\s+/g,""))[0]==="-"&&(p++,this.negative=1),p=0;p-=3)g=x[p]|x[p-1]<<8|x[p-2]<<16,this.words[b]|=g<>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);else if(v==="le")for(p=0,b=0;p>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);return this.strip()},t.prototype._parseHex=function(x,M,v){this.length=Math.ceil((x.length-M)/6),this.words=new Array(this.length);for(var p=0;p=M;p-=2)b=n(x,M,p)<=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;else for(p=(x.length-M)%2==0?M+1:M;p=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;this.strip()},t.prototype._parseBase=function(x,M,v){this.words=[0],this.length=1;for(var p=0,b=1;b<=67108863;b*=M)p++;p--,b=b/M|0;for(var g=x.length-v,y=g%p,k=Math.min(g,g-y)+v,R=0,O=v;O1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},t.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(x,M,v){v.negative=M.negative^x.negative;var p=x.length+M.length|0;v.length=p,p=p-1|0;var b=0|x.words[0],g=0|M.words[0],y=b*g,k=67108863&y,R=y/67108864|0;v.words[0]=k;for(var O=1;O>>26,$=67108863&R,W=Math.min(O,M.length-1),j=Math.max(0,O-x.length+1);j<=W;j++){var H=O-j|0;z+=(y=(b=0|x.words[H])*(g=0|M.words[j])+$)/67108864|0,$=67108863&y}v.words[O]=0|$,R=0|z}return R!==0?v.words[O]=0|R:v.length--,v.strip()}t.prototype.toString=function(x,M){var v;if(M=0|M||1,(x=x||10)===16||x==="hex"){v="";for(var p=0,b=0,g=0;g>>24-p&16777215)!==0||g!==this.length-1?c[6-k.length]+k+v:k+v,(p+=2)>=26&&(p-=26,g--)}for(b!==0&&(v=b.toString(16)+v);v.length%M!=0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(x===(0|x)&&x>=2&&x<=36){var R=h[x],O=u[x];v="";var z=this.clone();for(z.negative=0;!z.isZero();){var $=z.modn(O).toString(x);v=(z=z.idivn(O)).isZero()?$+v:c[R-$.length]+$+v}for(this.isZero()&&(v="0"+v);v.length%M!=0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var x=this.words[0];return this.length===2?x+=67108864*this.words[1]:this.length===3&&this.words[2]===1?x+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-x:x},t.prototype.toJSON=function(){return this.toString(16)},t.prototype.toBuffer=function(x,M){return a(e!==void 0),this.toArrayLike(e,x,M)},t.prototype.toArray=function(x,M){return this.toArrayLike(Array,x,M)},t.prototype.toArrayLike=function(x,M,v){var p=this.byteLength(),b=v||Math.max(1,p);a(p<=b,"byte array longer than desired length"),a(b>0,"Requested array length <= 0"),this.strip();var g,y,k=M==="le",R=new x(b),O=this.clone();if(k){for(y=0;!O.isZero();y++)g=O.andln(255),O.iushrn(8),R[y]=g;for(;y=4096&&(v+=13,M>>>=13),M>=64&&(v+=7,M>>>=7),M>=8&&(v+=4,M>>>=4),M>=2&&(v+=2,M>>>=2),v+M},t.prototype._zeroBits=function(x){if(x===0)return 26;var M=x,v=0;return!(8191&M)&&(v+=13,M>>>=13),!(127&M)&&(v+=7,M>>>=7),!(15&M)&&(v+=4,M>>>=4),!(3&M)&&(v+=2,M>>>=2),!(1&M)&&v++,v},t.prototype.bitLength=function(){var x=this.words[this.length-1],M=this._countBits(x);return 26*(this.length-1)+M},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var x=0,M=0;Mx.length?this.clone().ior(x):x.clone().ior(this)},t.prototype.uor=function(x){return this.length>x.length?this.clone().iuor(x):x.clone().iuor(this)},t.prototype.iuand=function(x){var M;M=this.length>x.length?x:this;for(var v=0;vx.length?this.clone().iand(x):x.clone().iand(this)},t.prototype.uand=function(x){return this.length>x.length?this.clone().iuand(x):x.clone().iuand(this)},t.prototype.iuxor=function(x){var M,v;this.length>x.length?(M=this,v=x):(M=x,v=this);for(var p=0;px.length?this.clone().ixor(x):x.clone().ixor(this)},t.prototype.uxor=function(x){return this.length>x.length?this.clone().iuxor(x):x.clone().iuxor(this)},t.prototype.inotn=function(x){a(typeof x=="number"&&x>=0);var M=0|Math.ceil(x/26),v=x%26;this._expand(M),v>0&&M--;for(var p=0;p0&&(this.words[p]=~this.words[p]&67108863>>26-v),this.strip()},t.prototype.notn=function(x){return this.clone().inotn(x)},t.prototype.setn=function(x,M){a(typeof x=="number"&&x>=0);var v=x/26|0,p=x%26;return this._expand(v+1),this.words[v]=M?this.words[v]|1<x.length?(v=this,p=x):(v=x,p=this);for(var b=0,g=0;g>>26;for(;b!==0&&g>>26;if(this.length=v.length,b!==0)this.words[this.length]=b,this.length++;else if(v!==this)for(;gx.length?this.clone().iadd(x):x.clone().iadd(this)},t.prototype.isub=function(x){if(x.negative!==0){x.negative=0;var M=this.iadd(x);return x.negative=1,M._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(x),this.negative=1,this._normSign();var v,p,b=this.cmp(x);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;b>0?(v=this,p=x):(v=x,p=this);for(var g=0,y=0;y>26,this.words[y]=67108863&M;for(;g!==0&&y>26,this.words[y]=67108863&M;if(g===0&&y>>13,j=0|y[1],H=8191&j,E=j>>>13,C=0|y[2],F=8191&C,V=C>>>13,Y=0|y[3],q=8191&Y,K=Y>>>13,et=0|y[4],tt=8191&et,X=et>>>13,J=0|y[5],G=8191&J,nt=J>>>13,rt=0|y[6],st=8191&rt,at=rt>>>13,lt=0|y[7],ht=8191<,wt=lt>>>13,vt=0|y[8],mt=8191&vt,Et=vt>>>13,Mt=0|y[9],Tt=8191&Mt,Rt=Mt>>>13,_t=0|k[0],dt=8191&_t,xt=_t>>>13,Ct=0|k[1],kt=8191&Ct,Wt=Ct>>>13,te=0|k[2],Ot=8191&te,Gt=te>>>13,qt=0|k[3],Lt=8191&qt,ae=qt>>>13,Jt=0|k[4],Pt=8191&Jt,Yt=Jt>>>13,ie=0|k[5],Bt=8191&ie,Qt=ie>>>13,se=0|k[6],Ut=8191&se,Q=se>>>13,it=0|k[7],ut=8191&it,bt=it>>>13,jt=0|k[8],yt=8191&jt,Dt=jt>>>13,It=0|k[9],At=8191&It,zt=It>>>13;v.negative=x.negative^M.negative,v.length=19;var Ft=(O+(p=Math.imul($,dt))|0)+((8191&(b=(b=Math.imul($,xt))+Math.imul(W,dt)|0))<<13)|0;O=((g=Math.imul(W,xt))+(b>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,p=Math.imul(H,dt),b=(b=Math.imul(H,xt))+Math.imul(E,dt)|0,g=Math.imul(E,xt);var Ht=(O+(p=p+Math.imul($,kt)|0)|0)+((8191&(b=(b=b+Math.imul($,Wt)|0)+Math.imul(W,kt)|0))<<13)|0;O=((g=g+Math.imul(W,Wt)|0)+(b>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,p=Math.imul(F,dt),b=(b=Math.imul(F,xt))+Math.imul(V,dt)|0,g=Math.imul(V,xt),p=p+Math.imul(H,kt)|0,b=(b=b+Math.imul(H,Wt)|0)+Math.imul(E,kt)|0,g=g+Math.imul(E,Wt)|0;var ce=(O+(p=p+Math.imul($,Ot)|0)|0)+((8191&(b=(b=b+Math.imul($,Gt)|0)+Math.imul(W,Ot)|0))<<13)|0;O=((g=g+Math.imul(W,Gt)|0)+(b>>>13)|0)+(ce>>>26)|0,ce&=67108863,p=Math.imul(q,dt),b=(b=Math.imul(q,xt))+Math.imul(K,dt)|0,g=Math.imul(K,xt),p=p+Math.imul(F,kt)|0,b=(b=b+Math.imul(F,Wt)|0)+Math.imul(V,kt)|0,g=g+Math.imul(V,Wt)|0,p=p+Math.imul(H,Ot)|0,b=(b=b+Math.imul(H,Gt)|0)+Math.imul(E,Ot)|0,g=g+Math.imul(E,Gt)|0;var le=(O+(p=p+Math.imul($,Lt)|0)|0)+((8191&(b=(b=b+Math.imul($,ae)|0)+Math.imul(W,Lt)|0))<<13)|0;O=((g=g+Math.imul(W,ae)|0)+(b>>>13)|0)+(le>>>26)|0,le&=67108863,p=Math.imul(tt,dt),b=(b=Math.imul(tt,xt))+Math.imul(X,dt)|0,g=Math.imul(X,xt),p=p+Math.imul(q,kt)|0,b=(b=b+Math.imul(q,Wt)|0)+Math.imul(K,kt)|0,g=g+Math.imul(K,Wt)|0,p=p+Math.imul(F,Ot)|0,b=(b=b+Math.imul(F,Gt)|0)+Math.imul(V,Ot)|0,g=g+Math.imul(V,Gt)|0,p=p+Math.imul(H,Lt)|0,b=(b=b+Math.imul(H,ae)|0)+Math.imul(E,Lt)|0,g=g+Math.imul(E,ae)|0;var he=(O+(p=p+Math.imul($,Pt)|0)|0)+((8191&(b=(b=b+Math.imul($,Yt)|0)+Math.imul(W,Pt)|0))<<13)|0;O=((g=g+Math.imul(W,Yt)|0)+(b>>>13)|0)+(he>>>26)|0,he&=67108863,p=Math.imul(G,dt),b=(b=Math.imul(G,xt))+Math.imul(nt,dt)|0,g=Math.imul(nt,xt),p=p+Math.imul(tt,kt)|0,b=(b=b+Math.imul(tt,Wt)|0)+Math.imul(X,kt)|0,g=g+Math.imul(X,Wt)|0,p=p+Math.imul(q,Ot)|0,b=(b=b+Math.imul(q,Gt)|0)+Math.imul(K,Ot)|0,g=g+Math.imul(K,Gt)|0,p=p+Math.imul(F,Lt)|0,b=(b=b+Math.imul(F,ae)|0)+Math.imul(V,Lt)|0,g=g+Math.imul(V,ae)|0,p=p+Math.imul(H,Pt)|0,b=(b=b+Math.imul(H,Yt)|0)+Math.imul(E,Pt)|0,g=g+Math.imul(E,Yt)|0;var fe=(O+(p=p+Math.imul($,Bt)|0)|0)+((8191&(b=(b=b+Math.imul($,Qt)|0)+Math.imul(W,Bt)|0))<<13)|0;O=((g=g+Math.imul(W,Qt)|0)+(b>>>13)|0)+(fe>>>26)|0,fe&=67108863,p=Math.imul(st,dt),b=(b=Math.imul(st,xt))+Math.imul(at,dt)|0,g=Math.imul(at,xt),p=p+Math.imul(G,kt)|0,b=(b=b+Math.imul(G,Wt)|0)+Math.imul(nt,kt)|0,g=g+Math.imul(nt,Wt)|0,p=p+Math.imul(tt,Ot)|0,b=(b=b+Math.imul(tt,Gt)|0)+Math.imul(X,Ot)|0,g=g+Math.imul(X,Gt)|0,p=p+Math.imul(q,Lt)|0,b=(b=b+Math.imul(q,ae)|0)+Math.imul(K,Lt)|0,g=g+Math.imul(K,ae)|0,p=p+Math.imul(F,Pt)|0,b=(b=b+Math.imul(F,Yt)|0)+Math.imul(V,Pt)|0,g=g+Math.imul(V,Yt)|0,p=p+Math.imul(H,Bt)|0,b=(b=b+Math.imul(H,Qt)|0)+Math.imul(E,Bt)|0,g=g+Math.imul(E,Qt)|0;var me=(O+(p=p+Math.imul($,Ut)|0)|0)+((8191&(b=(b=b+Math.imul($,Q)|0)+Math.imul(W,Ut)|0))<<13)|0;O=((g=g+Math.imul(W,Q)|0)+(b>>>13)|0)+(me>>>26)|0,me&=67108863,p=Math.imul(ht,dt),b=(b=Math.imul(ht,xt))+Math.imul(wt,dt)|0,g=Math.imul(wt,xt),p=p+Math.imul(st,kt)|0,b=(b=b+Math.imul(st,Wt)|0)+Math.imul(at,kt)|0,g=g+Math.imul(at,Wt)|0,p=p+Math.imul(G,Ot)|0,b=(b=b+Math.imul(G,Gt)|0)+Math.imul(nt,Ot)|0,g=g+Math.imul(nt,Gt)|0,p=p+Math.imul(tt,Lt)|0,b=(b=b+Math.imul(tt,ae)|0)+Math.imul(X,Lt)|0,g=g+Math.imul(X,ae)|0,p=p+Math.imul(q,Pt)|0,b=(b=b+Math.imul(q,Yt)|0)+Math.imul(K,Pt)|0,g=g+Math.imul(K,Yt)|0,p=p+Math.imul(F,Bt)|0,b=(b=b+Math.imul(F,Qt)|0)+Math.imul(V,Bt)|0,g=g+Math.imul(V,Qt)|0,p=p+Math.imul(H,Ut)|0,b=(b=b+Math.imul(H,Q)|0)+Math.imul(E,Ut)|0,g=g+Math.imul(E,Q)|0;var Z=(O+(p=p+Math.imul($,ut)|0)|0)+((8191&(b=(b=b+Math.imul($,bt)|0)+Math.imul(W,ut)|0))<<13)|0;O=((g=g+Math.imul(W,bt)|0)+(b>>>13)|0)+(Z>>>26)|0,Z&=67108863,p=Math.imul(mt,dt),b=(b=Math.imul(mt,xt))+Math.imul(Et,dt)|0,g=Math.imul(Et,xt),p=p+Math.imul(ht,kt)|0,b=(b=b+Math.imul(ht,Wt)|0)+Math.imul(wt,kt)|0,g=g+Math.imul(wt,Wt)|0,p=p+Math.imul(st,Ot)|0,b=(b=b+Math.imul(st,Gt)|0)+Math.imul(at,Ot)|0,g=g+Math.imul(at,Gt)|0,p=p+Math.imul(G,Lt)|0,b=(b=b+Math.imul(G,ae)|0)+Math.imul(nt,Lt)|0,g=g+Math.imul(nt,ae)|0,p=p+Math.imul(tt,Pt)|0,b=(b=b+Math.imul(tt,Yt)|0)+Math.imul(X,Pt)|0,g=g+Math.imul(X,Yt)|0,p=p+Math.imul(q,Bt)|0,b=(b=b+Math.imul(q,Qt)|0)+Math.imul(K,Bt)|0,g=g+Math.imul(K,Qt)|0,p=p+Math.imul(F,Ut)|0,b=(b=b+Math.imul(F,Q)|0)+Math.imul(V,Ut)|0,g=g+Math.imul(V,Q)|0,p=p+Math.imul(H,ut)|0,b=(b=b+Math.imul(H,bt)|0)+Math.imul(E,ut)|0,g=g+Math.imul(E,bt)|0;var ot=(O+(p=p+Math.imul($,yt)|0)|0)+((8191&(b=(b=b+Math.imul($,Dt)|0)+Math.imul(W,yt)|0))<<13)|0;O=((g=g+Math.imul(W,Dt)|0)+(b>>>13)|0)+(ot>>>26)|0,ot&=67108863,p=Math.imul(Tt,dt),b=(b=Math.imul(Tt,xt))+Math.imul(Rt,dt)|0,g=Math.imul(Rt,xt),p=p+Math.imul(mt,kt)|0,b=(b=b+Math.imul(mt,Wt)|0)+Math.imul(Et,kt)|0,g=g+Math.imul(Et,Wt)|0,p=p+Math.imul(ht,Ot)|0,b=(b=b+Math.imul(ht,Gt)|0)+Math.imul(wt,Ot)|0,g=g+Math.imul(wt,Gt)|0,p=p+Math.imul(st,Lt)|0,b=(b=b+Math.imul(st,ae)|0)+Math.imul(at,Lt)|0,g=g+Math.imul(at,ae)|0,p=p+Math.imul(G,Pt)|0,b=(b=b+Math.imul(G,Yt)|0)+Math.imul(nt,Pt)|0,g=g+Math.imul(nt,Yt)|0,p=p+Math.imul(tt,Bt)|0,b=(b=b+Math.imul(tt,Qt)|0)+Math.imul(X,Bt)|0,g=g+Math.imul(X,Qt)|0,p=p+Math.imul(q,Ut)|0,b=(b=b+Math.imul(q,Q)|0)+Math.imul(K,Ut)|0,g=g+Math.imul(K,Q)|0,p=p+Math.imul(F,ut)|0,b=(b=b+Math.imul(F,bt)|0)+Math.imul(V,ut)|0,g=g+Math.imul(V,bt)|0,p=p+Math.imul(H,yt)|0,b=(b=b+Math.imul(H,Dt)|0)+Math.imul(E,yt)|0,g=g+Math.imul(E,Dt)|0;var ct=(O+(p=p+Math.imul($,At)|0)|0)+((8191&(b=(b=b+Math.imul($,zt)|0)+Math.imul(W,At)|0))<<13)|0;O=((g=g+Math.imul(W,zt)|0)+(b>>>13)|0)+(ct>>>26)|0,ct&=67108863,p=Math.imul(Tt,kt),b=(b=Math.imul(Tt,Wt))+Math.imul(Rt,kt)|0,g=Math.imul(Rt,Wt),p=p+Math.imul(mt,Ot)|0,b=(b=b+Math.imul(mt,Gt)|0)+Math.imul(Et,Ot)|0,g=g+Math.imul(Et,Gt)|0,p=p+Math.imul(ht,Lt)|0,b=(b=b+Math.imul(ht,ae)|0)+Math.imul(wt,Lt)|0,g=g+Math.imul(wt,ae)|0,p=p+Math.imul(st,Pt)|0,b=(b=b+Math.imul(st,Yt)|0)+Math.imul(at,Pt)|0,g=g+Math.imul(at,Yt)|0,p=p+Math.imul(G,Bt)|0,b=(b=b+Math.imul(G,Qt)|0)+Math.imul(nt,Bt)|0,g=g+Math.imul(nt,Qt)|0,p=p+Math.imul(tt,Ut)|0,b=(b=b+Math.imul(tt,Q)|0)+Math.imul(X,Ut)|0,g=g+Math.imul(X,Q)|0,p=p+Math.imul(q,ut)|0,b=(b=b+Math.imul(q,bt)|0)+Math.imul(K,ut)|0,g=g+Math.imul(K,bt)|0,p=p+Math.imul(F,yt)|0,b=(b=b+Math.imul(F,Dt)|0)+Math.imul(V,yt)|0,g=g+Math.imul(V,Dt)|0;var ft=(O+(p=p+Math.imul(H,At)|0)|0)+((8191&(b=(b=b+Math.imul(H,zt)|0)+Math.imul(E,At)|0))<<13)|0;O=((g=g+Math.imul(E,zt)|0)+(b>>>13)|0)+(ft>>>26)|0,ft&=67108863,p=Math.imul(Tt,Ot),b=(b=Math.imul(Tt,Gt))+Math.imul(Rt,Ot)|0,g=Math.imul(Rt,Gt),p=p+Math.imul(mt,Lt)|0,b=(b=b+Math.imul(mt,ae)|0)+Math.imul(Et,Lt)|0,g=g+Math.imul(Et,ae)|0,p=p+Math.imul(ht,Pt)|0,b=(b=b+Math.imul(ht,Yt)|0)+Math.imul(wt,Pt)|0,g=g+Math.imul(wt,Yt)|0,p=p+Math.imul(st,Bt)|0,b=(b=b+Math.imul(st,Qt)|0)+Math.imul(at,Bt)|0,g=g+Math.imul(at,Qt)|0,p=p+Math.imul(G,Ut)|0,b=(b=b+Math.imul(G,Q)|0)+Math.imul(nt,Ut)|0,g=g+Math.imul(nt,Q)|0,p=p+Math.imul(tt,ut)|0,b=(b=b+Math.imul(tt,bt)|0)+Math.imul(X,ut)|0,g=g+Math.imul(X,bt)|0,p=p+Math.imul(q,yt)|0,b=(b=b+Math.imul(q,Dt)|0)+Math.imul(K,yt)|0,g=g+Math.imul(K,Dt)|0;var St=(O+(p=p+Math.imul(F,At)|0)|0)+((8191&(b=(b=b+Math.imul(F,zt)|0)+Math.imul(V,At)|0))<<13)|0;O=((g=g+Math.imul(V,zt)|0)+(b>>>13)|0)+(St>>>26)|0,St&=67108863,p=Math.imul(Tt,Lt),b=(b=Math.imul(Tt,ae))+Math.imul(Rt,Lt)|0,g=Math.imul(Rt,ae),p=p+Math.imul(mt,Pt)|0,b=(b=b+Math.imul(mt,Yt)|0)+Math.imul(Et,Pt)|0,g=g+Math.imul(Et,Yt)|0,p=p+Math.imul(ht,Bt)|0,b=(b=b+Math.imul(ht,Qt)|0)+Math.imul(wt,Bt)|0,g=g+Math.imul(wt,Qt)|0,p=p+Math.imul(st,Ut)|0,b=(b=b+Math.imul(st,Q)|0)+Math.imul(at,Ut)|0,g=g+Math.imul(at,Q)|0,p=p+Math.imul(G,ut)|0,b=(b=b+Math.imul(G,bt)|0)+Math.imul(nt,ut)|0,g=g+Math.imul(nt,bt)|0,p=p+Math.imul(tt,yt)|0,b=(b=b+Math.imul(tt,Dt)|0)+Math.imul(X,yt)|0,g=g+Math.imul(X,Dt)|0;var pt=(O+(p=p+Math.imul(q,At)|0)|0)+((8191&(b=(b=b+Math.imul(q,zt)|0)+Math.imul(K,At)|0))<<13)|0;O=((g=g+Math.imul(K,zt)|0)+(b>>>13)|0)+(pt>>>26)|0,pt&=67108863,p=Math.imul(Tt,Pt),b=(b=Math.imul(Tt,Yt))+Math.imul(Rt,Pt)|0,g=Math.imul(Rt,Yt),p=p+Math.imul(mt,Bt)|0,b=(b=b+Math.imul(mt,Qt)|0)+Math.imul(Et,Bt)|0,g=g+Math.imul(Et,Qt)|0,p=p+Math.imul(ht,Ut)|0,b=(b=b+Math.imul(ht,Q)|0)+Math.imul(wt,Ut)|0,g=g+Math.imul(wt,Q)|0,p=p+Math.imul(st,ut)|0,b=(b=b+Math.imul(st,bt)|0)+Math.imul(at,ut)|0,g=g+Math.imul(at,bt)|0,p=p+Math.imul(G,yt)|0,b=(b=b+Math.imul(G,Dt)|0)+Math.imul(nt,yt)|0,g=g+Math.imul(nt,Dt)|0;var gt=(O+(p=p+Math.imul(tt,At)|0)|0)+((8191&(b=(b=b+Math.imul(tt,zt)|0)+Math.imul(X,At)|0))<<13)|0;O=((g=g+Math.imul(X,zt)|0)+(b>>>13)|0)+(gt>>>26)|0,gt&=67108863,p=Math.imul(Tt,Bt),b=(b=Math.imul(Tt,Qt))+Math.imul(Rt,Bt)|0,g=Math.imul(Rt,Qt),p=p+Math.imul(mt,Ut)|0,b=(b=b+Math.imul(mt,Q)|0)+Math.imul(Et,Ut)|0,g=g+Math.imul(Et,Q)|0,p=p+Math.imul(ht,ut)|0,b=(b=b+Math.imul(ht,bt)|0)+Math.imul(wt,ut)|0,g=g+Math.imul(wt,bt)|0,p=p+Math.imul(st,yt)|0,b=(b=b+Math.imul(st,Dt)|0)+Math.imul(at,yt)|0,g=g+Math.imul(at,Dt)|0;var Xt=(O+(p=p+Math.imul(G,At)|0)|0)+((8191&(b=(b=b+Math.imul(G,zt)|0)+Math.imul(nt,At)|0))<<13)|0;O=((g=g+Math.imul(nt,zt)|0)+(b>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,p=Math.imul(Tt,Ut),b=(b=Math.imul(Tt,Q))+Math.imul(Rt,Ut)|0,g=Math.imul(Rt,Q),p=p+Math.imul(mt,ut)|0,b=(b=b+Math.imul(mt,bt)|0)+Math.imul(Et,ut)|0,g=g+Math.imul(Et,bt)|0,p=p+Math.imul(ht,yt)|0,b=(b=b+Math.imul(ht,Dt)|0)+Math.imul(wt,yt)|0,g=g+Math.imul(wt,Dt)|0;var $t=(O+(p=p+Math.imul(st,At)|0)|0)+((8191&(b=(b=b+Math.imul(st,zt)|0)+Math.imul(at,At)|0))<<13)|0;O=((g=g+Math.imul(at,zt)|0)+(b>>>13)|0)+($t>>>26)|0,$t&=67108863,p=Math.imul(Tt,ut),b=(b=Math.imul(Tt,bt))+Math.imul(Rt,ut)|0,g=Math.imul(Rt,bt),p=p+Math.imul(mt,yt)|0,b=(b=b+Math.imul(mt,Dt)|0)+Math.imul(Et,yt)|0,g=g+Math.imul(Et,Dt)|0;var Vt=(O+(p=p+Math.imul(ht,At)|0)|0)+((8191&(b=(b=b+Math.imul(ht,zt)|0)+Math.imul(wt,At)|0))<<13)|0;O=((g=g+Math.imul(wt,zt)|0)+(b>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,p=Math.imul(Tt,yt),b=(b=Math.imul(Tt,Dt))+Math.imul(Rt,yt)|0,g=Math.imul(Rt,Dt);var Nt=(O+(p=p+Math.imul(mt,At)|0)|0)+((8191&(b=(b=b+Math.imul(mt,zt)|0)+Math.imul(Et,At)|0))<<13)|0;O=((g=g+Math.imul(Et,zt)|0)+(b>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var ee=(O+(p=Math.imul(Tt,At))|0)+((8191&(b=(b=Math.imul(Tt,zt))+Math.imul(Rt,At)|0))<<13)|0;return O=((g=Math.imul(Rt,zt))+(b>>>13)|0)+(ee>>>26)|0,ee&=67108863,R[0]=Ft,R[1]=Ht,R[2]=ce,R[3]=le,R[4]=he,R[5]=fe,R[6]=me,R[7]=Z,R[8]=ot,R[9]=ct,R[10]=ft,R[11]=St,R[12]=pt,R[13]=gt,R[14]=Xt,R[15]=$t,R[16]=Vt,R[17]=Nt,R[18]=ee,O!==0&&(R[19]=O,v.length++),v};function w(x,M,v){return new _().mulp(x,M,v)}function _(x,M){this.x=x,this.y=M}Math.imul||(f=d),t.prototype.mulTo=function(x,M){var v=this.length+x.length;return this.length===10&&x.length===10?f(this,x,M):v<63?d(this,x,M):v<1024?function(p,b,g){g.negative=b.negative^p.negative,g.length=p.length+b.length;for(var y=0,k=0,R=0;R>>26)|0)>>>26,O&=67108863}g.words[R]=z,y=O,O=k}return y!==0?g.words[R]=y:g.length--,g.strip()}(this,x,M):w(this,x,M)},_.prototype.makeRBT=function(x){for(var M=new Array(x),v=t.prototype._countBits(x)-1,p=0;p>=1;return p},_.prototype.permute=function(x,M,v,p,b,g){for(var y=0;y>>=1)b++;return 1<>>=13,v[2*g+1]=8191&b,b>>>=13;for(g=2*M;g>=26,M+=p/67108864|0,M+=b>>>26,this.words[v]=67108863&b}return M!==0&&(this.words[v]=M,this.length++),this},t.prototype.muln=function(x){return this.clone().imuln(x)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(x){var M=function(g){for(var y=new Array(g.bitLength()),k=0;k>>O}return y}(x);if(M.length===0)return new t(1);for(var v=this,p=0;p=0);var M,v=x%26,p=(x-v)/26,b=67108863>>>26-v<<26-v;if(v!==0){var g=0;for(M=0;M>>26-v}g&&(this.words[M]=g,this.length++)}if(p!==0){for(M=this.length-1;M>=0;M--)this.words[M+p]=this.words[M];for(M=0;M=0),p=M?(M-M%26)/26:0;var b=x%26,g=Math.min((x-b)/26,this.length),y=67108863^67108863>>>b<g)for(this.length-=g,R=0;R=0&&(O!==0||R>=p);R--){var z=0|this.words[R];this.words[R]=O<<26-b|z>>>b,O=z&y}return k&&O!==0&&(k.words[k.length++]=O),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},t.prototype.ishrn=function(x,M,v){return a(this.negative===0),this.iushrn(x,M,v)},t.prototype.shln=function(x){return this.clone().ishln(x)},t.prototype.ushln=function(x){return this.clone().iushln(x)},t.prototype.shrn=function(x){return this.clone().ishrn(x)},t.prototype.ushrn=function(x){return this.clone().iushrn(x)},t.prototype.testn=function(x){a(typeof x=="number"&&x>=0);var M=x%26,v=(x-M)/26,p=1<=0);var M=x%26,v=(x-M)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(M!==0&&v++,this.length=Math.min(v,this.length),M!==0){var p=67108863^67108863>>>M<=67108864;M++)this.words[M]-=67108864,M===this.length-1?this.words[M+1]=1:this.words[M+1]++;return this.length=Math.max(this.length,M+1),this},t.prototype.isubn=function(x){if(a(typeof x=="number"),a(x<67108864),x<0)return this.iaddn(-x);if(this.negative!==0)return this.negative=0,this.iaddn(x),this.negative=1,this;if(this.words[0]-=x,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var M=0;M>26)-(k/67108864|0),this.words[p+v]=67108863&b}for(;p>26,this.words[p+v]=67108863&b;if(y===0)return this.strip();for(a(y===-1),y=0,p=0;p>26,this.words[p]=67108863&b;return this.negative=1,this.strip()},t.prototype._wordDiv=function(x,M){var v=(this.length,x.length),p=this.clone(),b=x,g=0|b.words[b.length-1];(v=26-this._countBits(g))!==0&&(b=b.ushln(v),p.iushln(v),g=0|b.words[b.length-1]);var y,k=p.length-b.length;if(M!=="mod"){(y=new t(null)).length=k+1,y.words=new Array(y.length);for(var R=0;R=0;z--){var $=67108864*(0|p.words[b.length+z])+(0|p.words[b.length+z-1]);for($=Math.min($/g|0,67108863),p._ishlnsubmul(b,$,z);p.negative!==0;)$--,p.negative=0,p._ishlnsubmul(b,1,z),p.isZero()||(p.negative^=1);y&&(y.words[z]=$)}return y&&y.strip(),p.strip(),M!=="div"&&v!==0&&p.iushrn(v),{div:y||null,mod:p}},t.prototype.divmod=function(x,M,v){return a(!x.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&x.negative===0?(g=this.neg().divmod(x,M),M!=="mod"&&(p=g.div.neg()),M!=="div"&&(b=g.mod.neg(),v&&b.negative!==0&&b.iadd(x)),{div:p,mod:b}):this.negative===0&&x.negative!==0?(g=this.divmod(x.neg(),M),M!=="mod"&&(p=g.div.neg()),{div:p,mod:g.mod}):this.negative&x.negative?(g=this.neg().divmod(x.neg(),M),M!=="div"&&(b=g.mod.neg(),v&&b.negative!==0&&b.isub(x)),{div:g.div,mod:b}):x.length>this.length||this.cmp(x)<0?{div:new t(0),mod:this}:x.length===1?M==="div"?{div:this.divn(x.words[0]),mod:null}:M==="mod"?{div:null,mod:new t(this.modn(x.words[0]))}:{div:this.divn(x.words[0]),mod:new t(this.modn(x.words[0]))}:this._wordDiv(x,M);var p,b,g},t.prototype.div=function(x){return this.divmod(x,"div",!1).div},t.prototype.mod=function(x){return this.divmod(x,"mod",!1).mod},t.prototype.umod=function(x){return this.divmod(x,"mod",!0).mod},t.prototype.divRound=function(x){var M=this.divmod(x);if(M.mod.isZero())return M.div;var v=M.div.negative!==0?M.mod.isub(x):M.mod,p=x.ushrn(1),b=x.andln(1),g=v.cmp(p);return g<0||b===1&&g===0?M.div:M.div.negative!==0?M.div.isubn(1):M.div.iaddn(1)},t.prototype.modn=function(x){a(x<=67108863);for(var M=(1<<26)%x,v=0,p=this.length-1;p>=0;p--)v=(M*v+(0|this.words[p]))%x;return v},t.prototype.idivn=function(x){a(x<=67108863);for(var M=0,v=this.length-1;v>=0;v--){var p=(0|this.words[v])+67108864*M;this.words[v]=p/x|0,M=p%x}return this.strip()},t.prototype.divn=function(x){return this.clone().idivn(x)},t.prototype.egcd=function(x){a(x.negative===0),a(!x.isZero());var M=this,v=x.clone();M=M.negative!==0?M.umod(x):M.clone();for(var p=new t(1),b=new t(0),g=new t(0),y=new t(1),k=0;M.isEven()&&v.isEven();)M.iushrn(1),v.iushrn(1),++k;for(var R=v.clone(),O=M.clone();!M.isZero();){for(var z=0,$=1;!(M.words[0]&$)&&z<26;++z,$<<=1);if(z>0)for(M.iushrn(z);z-- >0;)(p.isOdd()||b.isOdd())&&(p.iadd(R),b.isub(O)),p.iushrn(1),b.iushrn(1);for(var W=0,j=1;!(v.words[0]&j)&&W<26;++W,j<<=1);if(W>0)for(v.iushrn(W);W-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(R),y.isub(O)),g.iushrn(1),y.iushrn(1);M.cmp(v)>=0?(M.isub(v),p.isub(g),b.isub(y)):(v.isub(M),g.isub(p),y.isub(b))}return{a:g,b:y,gcd:v.iushln(k)}},t.prototype._invmp=function(x){a(x.negative===0),a(!x.isZero());var M=this,v=x.clone();M=M.negative!==0?M.umod(x):M.clone();for(var p,b=new t(1),g=new t(0),y=v.clone();M.cmpn(1)>0&&v.cmpn(1)>0;){for(var k=0,R=1;!(M.words[0]&R)&&k<26;++k,R<<=1);if(k>0)for(M.iushrn(k);k-- >0;)b.isOdd()&&b.iadd(y),b.iushrn(1);for(var O=0,z=1;!(v.words[0]&z)&&O<26;++O,z<<=1);if(O>0)for(v.iushrn(O);O-- >0;)g.isOdd()&&g.iadd(y),g.iushrn(1);M.cmp(v)>=0?(M.isub(v),b.isub(g)):(v.isub(M),g.isub(b))}return(p=M.cmpn(1)===0?b:g).cmpn(0)<0&&p.iadd(x),p},t.prototype.gcd=function(x){if(this.isZero())return x.abs();if(x.isZero())return this.abs();var M=this.clone(),v=x.clone();M.negative=0,v.negative=0;for(var p=0;M.isEven()&&v.isEven();p++)M.iushrn(1),v.iushrn(1);for(;;){for(;M.isEven();)M.iushrn(1);for(;v.isEven();)v.iushrn(1);var b=M.cmp(v);if(b<0){var g=M;M=v,v=g}else if(b===0||v.cmpn(1)===0)break;M.isub(v)}return v.iushln(p)},t.prototype.invm=function(x){return this.egcd(x).a.umod(x)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(x){return this.words[0]&x},t.prototype.bincn=function(x){a(typeof x=="number");var M=x%26,v=(x-M)/26,p=1<>>26,y&=67108863,this.words[g]=y}return b!==0&&(this.words[g]=b,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(x){var M,v=x<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;if(this.strip(),this.length>1)M=1;else{v&&(x=-x),a(x<=67108863,"Number is too big");var p=0|this.words[0];M=p===x?0:px.length)return 1;if(this.length=0;v--){var p=0|this.words[v],b=0|x.words[v];if(p!==b){pb&&(M=1);break}}return M},t.prototype.gtn=function(x){return this.cmpn(x)===1},t.prototype.gt=function(x){return this.cmp(x)===1},t.prototype.gten=function(x){return this.cmpn(x)>=0},t.prototype.gte=function(x){return this.cmp(x)>=0},t.prototype.ltn=function(x){return this.cmpn(x)===-1},t.prototype.lt=function(x){return this.cmp(x)===-1},t.prototype.lten=function(x){return this.cmpn(x)<=0},t.prototype.lte=function(x){return this.cmp(x)<=0},t.prototype.eqn=function(x){return this.cmpn(x)===0},t.prototype.eq=function(x){return this.cmp(x)===0},t.red=function(x){return new U(x)},t.prototype.toRed=function(x){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),x.convertTo(this)._forceRed(x)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(x){return this.red=x,this},t.prototype.forceRed=function(x){return a(!this.red,"Already a number in reduction context"),this._forceRed(x)},t.prototype.redAdd=function(x){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},t.prototype.redIAdd=function(x){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},t.prototype.redSub=function(x){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},t.prototype.redISub=function(x){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},t.prototype.redShl=function(x){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},t.prototype.redMul=function(x){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},t.prototype.redIMul=function(x){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(x){return a(this.red&&!x.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,x)};var A={k256:null,p224:null,p192:null,p25519:null};function N(x,M){this.name=x,this.p=new t(M,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function L(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function I(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function D(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function U(x){if(typeof x=="string"){var M=t._prime(x);this.m=M.p,this.prime=M}else a(x.gtn(1),"modulus must be greater than 1"),this.m=x,this.prime=null}function B(x){U.call(this,x),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}N.prototype._tmp=function(){var x=new t(null);return x.words=new Array(Math.ceil(this.n/13)),x},N.prototype.ireduce=function(x){var M,v=x;do this.split(v,this.tmp),M=(v=(v=this.imulK(v)).iadd(this.tmp)).bitLength();while(M>this.n);var p=M0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},N.prototype.split=function(x,M){x.iushrn(this.n,0,M)},N.prototype.imulK=function(x){return x.imul(this.k)},r(L,N),L.prototype.split=function(x,M){for(var v=Math.min(x.length,9),p=0;p>>22,b=g}b>>>=22,x.words[p-10]=b,b===0&&x.length>10?x.length-=10:x.length-=9},L.prototype.imulK=function(x){x.words[x.length]=0,x.words[x.length+1]=0,x.length+=2;for(var M=0,v=0;v>>=26,x.words[v]=b,M=p}return M!==0&&(x.words[x.length++]=M),x},t._prime=function(x){if(A[x])return A[x];var M;if(x==="k256")M=new L;else if(x==="p224")M=new I;else if(x==="p192")M=new P;else{if(x!=="p25519")throw new Error("Unknown prime "+x);M=new D}return A[x]=M,M},U.prototype._verify1=function(x){a(x.negative===0,"red works only with positives"),a(x.red,"red works only with red numbers")},U.prototype._verify2=function(x,M){a((x.negative|M.negative)==0,"red works only with positives"),a(x.red&&x.red===M.red,"red works only with red numbers")},U.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):x.umod(this.m)._forceRed(this)},U.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},U.prototype.add=function(x,M){this._verify2(x,M);var v=x.add(M);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},U.prototype.iadd=function(x,M){this._verify2(x,M);var v=x.iadd(M);return v.cmp(this.m)>=0&&v.isub(this.m),v},U.prototype.sub=function(x,M){this._verify2(x,M);var v=x.sub(M);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},U.prototype.isub=function(x,M){this._verify2(x,M);var v=x.isub(M);return v.cmpn(0)<0&&v.iadd(this.m),v},U.prototype.shl=function(x,M){return this._verify1(x),this.imod(x.ushln(M))},U.prototype.imul=function(x,M){return this._verify2(x,M),this.imod(x.imul(M))},U.prototype.mul=function(x,M){return this._verify2(x,M),this.imod(x.mul(M))},U.prototype.isqr=function(x){return this.imul(x,x.clone())},U.prototype.sqr=function(x){return this.mul(x,x)},U.prototype.sqrt=function(x){if(x.isZero())return x.clone();var M=this.m.andln(3);if(a(M%2==1),M===3){var v=this.m.add(new t(1)).iushrn(2);return this.pow(x,v)}for(var p=this.m.subn(1),b=0;!p.isZero()&&p.andln(1)===0;)b++,p.iushrn(1);a(!p.isZero());var g=new t(1).toRed(this),y=g.redNeg(),k=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new t(2*R*R).toRed(this);this.pow(R,k).cmp(y)!==0;)R.redIAdd(y);for(var O=this.pow(R,p),z=this.pow(x,p.addn(1).iushrn(1)),$=this.pow(x,p),W=b;$.cmp(g)!==0;){for(var j=$,H=0;j.cmp(g)!==0;H++)j=j.redSqr();a(H=0;p--){for(var R=M.words[p],O=k-1;O>=0;O--){var z=R>>O&1;b!==v[0]&&(b=this.sqr(b)),z!==0||g!==0?(g<<=1,g|=z,(++y===4||p===0&&O===0)&&(b=this.mul(b,v[g]),y=0,g=0)):y=0}k=26}return b},U.prototype.convertTo=function(x){var M=x.umod(this.m);return M===x?M.clone():M},U.prototype.convertFrom=function(x){var M=x.clone();return M.red=null,M},t.mont=function(x){return new B(x)},r(B,U),B.prototype.convertTo=function(x){return this.imod(x.ushln(this.shift))},B.prototype.convertFrom=function(x){var M=this.imod(x.mul(this.rinv));return M.red=null,M},B.prototype.imul=function(x,M){if(x.isZero()||M.isZero())return x.words[0]=0,x.length=1,x;var v=x.imul(M),p=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=v.isub(p).iushrn(this.shift),g=b;return b.cmp(this.m)>=0?g=b.isub(this.m):b.cmpn(0)<0&&(g=b.iadd(this.m)),g._forceRed(this)},B.prototype.mul=function(x,M){if(x.isZero()||M.isZero())return new t(0)._forceRed(this);var v=x.mul(M),p=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=v.isub(p).iushrn(this.shift),g=b;return b.cmp(this.m)>=0?g=b.isub(this.m):b.cmpn(0)<0&&(g=b.iadd(this.m)),g._forceRed(this)},B.prototype.invm=function(x){return this.imod(x._invmp(this.m).mul(this.r2))._forceRed(this)}})(T===void 0||T)},{buffer:188}],185:[function(s,T,S){S.byteLength=function(i){var c=l(i),h=c[0],u=c[1];return 3*(h+u)/4-u},S.toByteArray=function(i){var c,h,u=l(i),d=u[0],f=u[1],w=new a(function(N,L,I){return 3*(L+I)/4-I}(0,d,f)),_=0,A=f>0?d-4:d;for(h=0;h>16&255,w[_++]=c>>8&255,w[_++]=255&c;return f===2&&(c=o[i.charCodeAt(h)]<<2|o[i.charCodeAt(h+1)]>>4,w[_++]=255&c),f===1&&(c=o[i.charCodeAt(h)]<<10|o[i.charCodeAt(h+1)]<<4|o[i.charCodeAt(h+2)]>>2,w[_++]=c>>8&255,w[_++]=255&c),w},S.fromByteArray=function(i){for(var c,h=i.length,u=h%3,d=[],f=0,w=h-u;fw?w:f+16383));return u===1?(c=i[h-1],d.push(m[c>>2]+m[c<<4&63]+"==")):u===2&&(c=(i[h-2]<<8)+i[h-1],d.push(m[c>>10]+m[c>>4&63]+m[c<<2&63]+"=")),d.join("")};for(var m=[],o=[],a=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");var h=i.indexOf("=");return h===-1&&(h=c),[h,h===c?0:4-h%4]}function n(i,c,h){for(var u,d,f=[],w=c;w>18&63]+m[d>>12&63]+m[d>>6&63]+m[63&d]);return f.join("")}o[45]=62,o[95]=63},{}],186:[function(s,T,S){(function(m,o){function a(v,p){if(!v)throw new Error(p||"Assertion failed")}function r(v,p){v.super_=p;var b=function(){};b.prototype=p.prototype,v.prototype=new b,v.prototype.constructor=v}function t(v,p,b){if(t.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&(p!=="le"&&p!=="be"||(b=p,p=10),this._init(v||0,p||10,b||"be"))}var e;typeof m=="object"?m.exports=t:(void 0).BN=t,t.BN=t,t.wordSize=26;try{e=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:s("buffer").Buffer}catch{}function l(v,p){var b=v.charCodeAt(p);return b>=48&&b<=57?b-48:b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:void a(!1,"Invalid character in "+v)}function n(v,p,b){var g=l(v,b);return b-1>=p&&(g|=l(v,b-1)<<4),g}function i(v,p,b,g){for(var y=0,k=0,R=Math.min(v.length,b),O=p;O=49?z-49+10:z>=17?z-17+10:z,a(z>=0&&k0?v:p},t.min=function(v,p){return v.cmp(p)<0?v:p},t.prototype._init=function(v,p,b){if(typeof v=="number")return this._initNumber(v,p,b);if(typeof v=="object")return this._initArray(v,p,b);p==="hex"&&(p=16),a(p===(0|p)&&p>=2&&p<=36);var g=0;(v=v.toString().replace(/\s+/g,""))[0]==="-"&&(g++,this.negative=1),g=0;g-=3)k=v[g]|v[g-1]<<8|v[g-2]<<16,this.words[y]|=k<>>26-R&67108863,(R+=24)>=26&&(R-=26,y++);else if(b==="le")for(g=0,y=0;g>>26-R&67108863,(R+=24)>=26&&(R-=26,y++);return this._strip()},t.prototype._parseHex=function(v,p,b){this.length=Math.ceil((v.length-p)/6),this.words=new Array(this.length);for(var g=0;g=p;g-=2)y=n(v,p,g)<=18?(k-=18,R+=1,this.words[R]|=y>>>26):k+=8;else for(g=(v.length-p)%2==0?p+1:p;g=18?(k-=18,R+=1,this.words[R]|=y>>>26):k+=8;this._strip()},t.prototype._parseBase=function(v,p,b){this.words=[0],this.length=1;for(var g=0,y=1;y<=67108863;y*=p)g++;g--,y=y/p|0;for(var k=v.length-b,R=k%g,O=Math.min(k,k-R)+b,z=0,$=b;$1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{t.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{t.prototype.inspect=h}else t.prototype.inspect=h;function h(){return(this.red?""}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];t.prototype.toString=function(v,p){var b;if(p=0|p||1,(v=v||10)===16||v==="hex"){b="";for(var g=0,y=0,k=0;k>>24-g&16777215,(g+=2)>=26&&(g-=26,k--),b=y!==0||k!==this.length-1?u[6-O.length]+O+b:O+b}for(y!==0&&(b=y.toString(16)+b);b.length%p!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(v===(0|v)&&v>=2&&v<=36){var z=d[v],$=f[v];b="";var W=this.clone();for(W.negative=0;!W.isZero();){var j=W.modrn($).toString(v);b=(W=W.idivn($)).isZero()?j+b:u[z-j.length]+j+b}for(this.isZero()&&(b="0"+b);b.length%p!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=67108864*this.words[1]:this.length===3&&this.words[2]===1?v+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},t.prototype.toJSON=function(){return this.toString(16,2)},e&&(t.prototype.toBuffer=function(v,p){return this.toArrayLike(e,v,p)}),t.prototype.toArray=function(v,p){return this.toArrayLike(Array,v,p)};function w(v,p,b){b.negative=p.negative^v.negative;var g=v.length+p.length|0;b.length=g,g=g-1|0;var y=0|v.words[0],k=0|p.words[0],R=y*k,O=67108863&R,z=R/67108864|0;b.words[0]=O;for(var $=1;$>>26,j=67108863&z,H=Math.min($,p.length-1),E=Math.max(0,$-v.length+1);E<=H;E++){var C=$-E|0;W+=(R=(y=0|v.words[C])*(k=0|p.words[E])+j)/67108864|0,j=67108863&R}b.words[$]=0|j,z=0|W}return z!==0?b.words[$]=0|z:b.length--,b._strip()}t.prototype.toArrayLike=function(v,p,b){this._strip();var g=this.byteLength(),y=b||Math.max(1,g);a(g<=y,"byte array longer than desired length"),a(y>0,"Requested array length <= 0");var k=function(R,O){return R.allocUnsafe?R.allocUnsafe(O):new R(O)}(v,y);return this["_toArrayLike"+(p==="le"?"LE":"BE")](k,g),k},t.prototype._toArrayLikeLE=function(v,p){for(var b=0,g=0,y=0,k=0;y>8&255),b>16&255),k===6?(b>24&255),g=0,k=0):(g=R>>>24,k+=2)}if(b=0&&(v[b--]=R>>8&255),b>=0&&(v[b--]=R>>16&255),k===6?(b>=0&&(v[b--]=R>>24&255),g=0,k=0):(g=R>>>24,k+=2)}if(b>=0)for(v[b--]=g;b>=0;)v[b--]=0},Math.clz32?t.prototype._countBits=function(v){return 32-Math.clz32(v)}:t.prototype._countBits=function(v){var p=v,b=0;return p>=4096&&(b+=13,p>>>=13),p>=64&&(b+=7,p>>>=7),p>=8&&(b+=4,p>>>=4),p>=2&&(b+=2,p>>>=2),b+p},t.prototype._zeroBits=function(v){if(v===0)return 26;var p=v,b=0;return!(8191&p)&&(b+=13,p>>>=13),!(127&p)&&(b+=7,p>>>=7),!(15&p)&&(b+=4,p>>>=4),!(3&p)&&(b+=2,p>>>=2),!(1&p)&&b++,b},t.prototype.bitLength=function(){var v=this.words[this.length-1],p=this._countBits(v);return 26*(this.length-1)+p},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,p=0;pv.length?this.clone().ior(v):v.clone().ior(this)},t.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},t.prototype.iuand=function(v){var p;p=this.length>v.length?v:this;for(var b=0;bv.length?this.clone().iand(v):v.clone().iand(this)},t.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},t.prototype.iuxor=function(v){var p,b;this.length>v.length?(p=this,b=v):(p=v,b=this);for(var g=0;gv.length?this.clone().ixor(v):v.clone().ixor(this)},t.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},t.prototype.inotn=function(v){a(typeof v=="number"&&v>=0);var p=0|Math.ceil(v/26),b=v%26;this._expand(p),b>0&&p--;for(var g=0;g0&&(this.words[g]=~this.words[g]&67108863>>26-b),this._strip()},t.prototype.notn=function(v){return this.clone().inotn(v)},t.prototype.setn=function(v,p){a(typeof v=="number"&&v>=0);var b=v/26|0,g=v%26;return this._expand(b+1),this.words[b]=p?this.words[b]|1<v.length?(b=this,g=v):(b=v,g=this);for(var y=0,k=0;k>>26;for(;y!==0&&k>>26;if(this.length=b.length,y!==0)this.words[this.length]=y,this.length++;else if(b!==this)for(;kv.length?this.clone().iadd(v):v.clone().iadd(this)},t.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var p=this.iadd(v);return v.negative=1,p._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var b,g,y=this.cmp(v);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;y>0?(b=this,g=v):(b=v,g=this);for(var k=0,R=0;R>26,this.words[R]=67108863&p;for(;k!==0&&R>26,this.words[R]=67108863&p;if(k===0&&R>>13,E=0|R[1],C=8191&E,F=E>>>13,V=0|R[2],Y=8191&V,q=V>>>13,K=0|R[3],et=8191&K,tt=K>>>13,X=0|R[4],J=8191&X,G=X>>>13,nt=0|R[5],rt=8191&nt,st=nt>>>13,at=0|R[6],lt=8191&at,ht=at>>>13,wt=0|R[7],vt=8191&wt,mt=wt>>>13,Et=0|R[8],Mt=8191&Et,Tt=Et>>>13,Rt=0|R[9],_t=8191&Rt,dt=Rt>>>13,xt=0|O[0],Ct=8191&xt,kt=xt>>>13,Wt=0|O[1],te=8191&Wt,Ot=Wt>>>13,Gt=0|O[2],qt=8191&Gt,Lt=Gt>>>13,ae=0|O[3],Jt=8191&ae,Pt=ae>>>13,Yt=0|O[4],ie=8191&Yt,Bt=Yt>>>13,Qt=0|O[5],se=8191&Qt,Ut=Qt>>>13,Q=0|O[6],it=8191&Q,ut=Q>>>13,bt=0|O[7],jt=8191&bt,yt=bt>>>13,Dt=0|O[8],It=8191&Dt,At=Dt>>>13,zt=0|O[9],Ft=8191&zt,Ht=zt>>>13;b.negative=v.negative^p.negative,b.length=19;var ce=($+(g=Math.imul(j,Ct))|0)+((8191&(y=(y=Math.imul(j,kt))+Math.imul(H,Ct)|0))<<13)|0;$=((k=Math.imul(H,kt))+(y>>>13)|0)+(ce>>>26)|0,ce&=67108863,g=Math.imul(C,Ct),y=(y=Math.imul(C,kt))+Math.imul(F,Ct)|0,k=Math.imul(F,kt);var le=($+(g=g+Math.imul(j,te)|0)|0)+((8191&(y=(y=y+Math.imul(j,Ot)|0)+Math.imul(H,te)|0))<<13)|0;$=((k=k+Math.imul(H,Ot)|0)+(y>>>13)|0)+(le>>>26)|0,le&=67108863,g=Math.imul(Y,Ct),y=(y=Math.imul(Y,kt))+Math.imul(q,Ct)|0,k=Math.imul(q,kt),g=g+Math.imul(C,te)|0,y=(y=y+Math.imul(C,Ot)|0)+Math.imul(F,te)|0,k=k+Math.imul(F,Ot)|0;var he=($+(g=g+Math.imul(j,qt)|0)|0)+((8191&(y=(y=y+Math.imul(j,Lt)|0)+Math.imul(H,qt)|0))<<13)|0;$=((k=k+Math.imul(H,Lt)|0)+(y>>>13)|0)+(he>>>26)|0,he&=67108863,g=Math.imul(et,Ct),y=(y=Math.imul(et,kt))+Math.imul(tt,Ct)|0,k=Math.imul(tt,kt),g=g+Math.imul(Y,te)|0,y=(y=y+Math.imul(Y,Ot)|0)+Math.imul(q,te)|0,k=k+Math.imul(q,Ot)|0,g=g+Math.imul(C,qt)|0,y=(y=y+Math.imul(C,Lt)|0)+Math.imul(F,qt)|0,k=k+Math.imul(F,Lt)|0;var fe=($+(g=g+Math.imul(j,Jt)|0)|0)+((8191&(y=(y=y+Math.imul(j,Pt)|0)+Math.imul(H,Jt)|0))<<13)|0;$=((k=k+Math.imul(H,Pt)|0)+(y>>>13)|0)+(fe>>>26)|0,fe&=67108863,g=Math.imul(J,Ct),y=(y=Math.imul(J,kt))+Math.imul(G,Ct)|0,k=Math.imul(G,kt),g=g+Math.imul(et,te)|0,y=(y=y+Math.imul(et,Ot)|0)+Math.imul(tt,te)|0,k=k+Math.imul(tt,Ot)|0,g=g+Math.imul(Y,qt)|0,y=(y=y+Math.imul(Y,Lt)|0)+Math.imul(q,qt)|0,k=k+Math.imul(q,Lt)|0,g=g+Math.imul(C,Jt)|0,y=(y=y+Math.imul(C,Pt)|0)+Math.imul(F,Jt)|0,k=k+Math.imul(F,Pt)|0;var me=($+(g=g+Math.imul(j,ie)|0)|0)+((8191&(y=(y=y+Math.imul(j,Bt)|0)+Math.imul(H,ie)|0))<<13)|0;$=((k=k+Math.imul(H,Bt)|0)+(y>>>13)|0)+(me>>>26)|0,me&=67108863,g=Math.imul(rt,Ct),y=(y=Math.imul(rt,kt))+Math.imul(st,Ct)|0,k=Math.imul(st,kt),g=g+Math.imul(J,te)|0,y=(y=y+Math.imul(J,Ot)|0)+Math.imul(G,te)|0,k=k+Math.imul(G,Ot)|0,g=g+Math.imul(et,qt)|0,y=(y=y+Math.imul(et,Lt)|0)+Math.imul(tt,qt)|0,k=k+Math.imul(tt,Lt)|0,g=g+Math.imul(Y,Jt)|0,y=(y=y+Math.imul(Y,Pt)|0)+Math.imul(q,Jt)|0,k=k+Math.imul(q,Pt)|0,g=g+Math.imul(C,ie)|0,y=(y=y+Math.imul(C,Bt)|0)+Math.imul(F,ie)|0,k=k+Math.imul(F,Bt)|0;var Z=($+(g=g+Math.imul(j,se)|0)|0)+((8191&(y=(y=y+Math.imul(j,Ut)|0)+Math.imul(H,se)|0))<<13)|0;$=((k=k+Math.imul(H,Ut)|0)+(y>>>13)|0)+(Z>>>26)|0,Z&=67108863,g=Math.imul(lt,Ct),y=(y=Math.imul(lt,kt))+Math.imul(ht,Ct)|0,k=Math.imul(ht,kt),g=g+Math.imul(rt,te)|0,y=(y=y+Math.imul(rt,Ot)|0)+Math.imul(st,te)|0,k=k+Math.imul(st,Ot)|0,g=g+Math.imul(J,qt)|0,y=(y=y+Math.imul(J,Lt)|0)+Math.imul(G,qt)|0,k=k+Math.imul(G,Lt)|0,g=g+Math.imul(et,Jt)|0,y=(y=y+Math.imul(et,Pt)|0)+Math.imul(tt,Jt)|0,k=k+Math.imul(tt,Pt)|0,g=g+Math.imul(Y,ie)|0,y=(y=y+Math.imul(Y,Bt)|0)+Math.imul(q,ie)|0,k=k+Math.imul(q,Bt)|0,g=g+Math.imul(C,se)|0,y=(y=y+Math.imul(C,Ut)|0)+Math.imul(F,se)|0,k=k+Math.imul(F,Ut)|0;var ot=($+(g=g+Math.imul(j,it)|0)|0)+((8191&(y=(y=y+Math.imul(j,ut)|0)+Math.imul(H,it)|0))<<13)|0;$=((k=k+Math.imul(H,ut)|0)+(y>>>13)|0)+(ot>>>26)|0,ot&=67108863,g=Math.imul(vt,Ct),y=(y=Math.imul(vt,kt))+Math.imul(mt,Ct)|0,k=Math.imul(mt,kt),g=g+Math.imul(lt,te)|0,y=(y=y+Math.imul(lt,Ot)|0)+Math.imul(ht,te)|0,k=k+Math.imul(ht,Ot)|0,g=g+Math.imul(rt,qt)|0,y=(y=y+Math.imul(rt,Lt)|0)+Math.imul(st,qt)|0,k=k+Math.imul(st,Lt)|0,g=g+Math.imul(J,Jt)|0,y=(y=y+Math.imul(J,Pt)|0)+Math.imul(G,Jt)|0,k=k+Math.imul(G,Pt)|0,g=g+Math.imul(et,ie)|0,y=(y=y+Math.imul(et,Bt)|0)+Math.imul(tt,ie)|0,k=k+Math.imul(tt,Bt)|0,g=g+Math.imul(Y,se)|0,y=(y=y+Math.imul(Y,Ut)|0)+Math.imul(q,se)|0,k=k+Math.imul(q,Ut)|0,g=g+Math.imul(C,it)|0,y=(y=y+Math.imul(C,ut)|0)+Math.imul(F,it)|0,k=k+Math.imul(F,ut)|0;var ct=($+(g=g+Math.imul(j,jt)|0)|0)+((8191&(y=(y=y+Math.imul(j,yt)|0)+Math.imul(H,jt)|0))<<13)|0;$=((k=k+Math.imul(H,yt)|0)+(y>>>13)|0)+(ct>>>26)|0,ct&=67108863,g=Math.imul(Mt,Ct),y=(y=Math.imul(Mt,kt))+Math.imul(Tt,Ct)|0,k=Math.imul(Tt,kt),g=g+Math.imul(vt,te)|0,y=(y=y+Math.imul(vt,Ot)|0)+Math.imul(mt,te)|0,k=k+Math.imul(mt,Ot)|0,g=g+Math.imul(lt,qt)|0,y=(y=y+Math.imul(lt,Lt)|0)+Math.imul(ht,qt)|0,k=k+Math.imul(ht,Lt)|0,g=g+Math.imul(rt,Jt)|0,y=(y=y+Math.imul(rt,Pt)|0)+Math.imul(st,Jt)|0,k=k+Math.imul(st,Pt)|0,g=g+Math.imul(J,ie)|0,y=(y=y+Math.imul(J,Bt)|0)+Math.imul(G,ie)|0,k=k+Math.imul(G,Bt)|0,g=g+Math.imul(et,se)|0,y=(y=y+Math.imul(et,Ut)|0)+Math.imul(tt,se)|0,k=k+Math.imul(tt,Ut)|0,g=g+Math.imul(Y,it)|0,y=(y=y+Math.imul(Y,ut)|0)+Math.imul(q,it)|0,k=k+Math.imul(q,ut)|0,g=g+Math.imul(C,jt)|0,y=(y=y+Math.imul(C,yt)|0)+Math.imul(F,jt)|0,k=k+Math.imul(F,yt)|0;var ft=($+(g=g+Math.imul(j,It)|0)|0)+((8191&(y=(y=y+Math.imul(j,At)|0)+Math.imul(H,It)|0))<<13)|0;$=((k=k+Math.imul(H,At)|0)+(y>>>13)|0)+(ft>>>26)|0,ft&=67108863,g=Math.imul(_t,Ct),y=(y=Math.imul(_t,kt))+Math.imul(dt,Ct)|0,k=Math.imul(dt,kt),g=g+Math.imul(Mt,te)|0,y=(y=y+Math.imul(Mt,Ot)|0)+Math.imul(Tt,te)|0,k=k+Math.imul(Tt,Ot)|0,g=g+Math.imul(vt,qt)|0,y=(y=y+Math.imul(vt,Lt)|0)+Math.imul(mt,qt)|0,k=k+Math.imul(mt,Lt)|0,g=g+Math.imul(lt,Jt)|0,y=(y=y+Math.imul(lt,Pt)|0)+Math.imul(ht,Jt)|0,k=k+Math.imul(ht,Pt)|0,g=g+Math.imul(rt,ie)|0,y=(y=y+Math.imul(rt,Bt)|0)+Math.imul(st,ie)|0,k=k+Math.imul(st,Bt)|0,g=g+Math.imul(J,se)|0,y=(y=y+Math.imul(J,Ut)|0)+Math.imul(G,se)|0,k=k+Math.imul(G,Ut)|0,g=g+Math.imul(et,it)|0,y=(y=y+Math.imul(et,ut)|0)+Math.imul(tt,it)|0,k=k+Math.imul(tt,ut)|0,g=g+Math.imul(Y,jt)|0,y=(y=y+Math.imul(Y,yt)|0)+Math.imul(q,jt)|0,k=k+Math.imul(q,yt)|0,g=g+Math.imul(C,It)|0,y=(y=y+Math.imul(C,At)|0)+Math.imul(F,It)|0,k=k+Math.imul(F,At)|0;var St=($+(g=g+Math.imul(j,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(j,Ht)|0)+Math.imul(H,Ft)|0))<<13)|0;$=((k=k+Math.imul(H,Ht)|0)+(y>>>13)|0)+(St>>>26)|0,St&=67108863,g=Math.imul(_t,te),y=(y=Math.imul(_t,Ot))+Math.imul(dt,te)|0,k=Math.imul(dt,Ot),g=g+Math.imul(Mt,qt)|0,y=(y=y+Math.imul(Mt,Lt)|0)+Math.imul(Tt,qt)|0,k=k+Math.imul(Tt,Lt)|0,g=g+Math.imul(vt,Jt)|0,y=(y=y+Math.imul(vt,Pt)|0)+Math.imul(mt,Jt)|0,k=k+Math.imul(mt,Pt)|0,g=g+Math.imul(lt,ie)|0,y=(y=y+Math.imul(lt,Bt)|0)+Math.imul(ht,ie)|0,k=k+Math.imul(ht,Bt)|0,g=g+Math.imul(rt,se)|0,y=(y=y+Math.imul(rt,Ut)|0)+Math.imul(st,se)|0,k=k+Math.imul(st,Ut)|0,g=g+Math.imul(J,it)|0,y=(y=y+Math.imul(J,ut)|0)+Math.imul(G,it)|0,k=k+Math.imul(G,ut)|0,g=g+Math.imul(et,jt)|0,y=(y=y+Math.imul(et,yt)|0)+Math.imul(tt,jt)|0,k=k+Math.imul(tt,yt)|0,g=g+Math.imul(Y,It)|0,y=(y=y+Math.imul(Y,At)|0)+Math.imul(q,It)|0,k=k+Math.imul(q,At)|0;var pt=($+(g=g+Math.imul(C,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(C,Ht)|0)+Math.imul(F,Ft)|0))<<13)|0;$=((k=k+Math.imul(F,Ht)|0)+(y>>>13)|0)+(pt>>>26)|0,pt&=67108863,g=Math.imul(_t,qt),y=(y=Math.imul(_t,Lt))+Math.imul(dt,qt)|0,k=Math.imul(dt,Lt),g=g+Math.imul(Mt,Jt)|0,y=(y=y+Math.imul(Mt,Pt)|0)+Math.imul(Tt,Jt)|0,k=k+Math.imul(Tt,Pt)|0,g=g+Math.imul(vt,ie)|0,y=(y=y+Math.imul(vt,Bt)|0)+Math.imul(mt,ie)|0,k=k+Math.imul(mt,Bt)|0,g=g+Math.imul(lt,se)|0,y=(y=y+Math.imul(lt,Ut)|0)+Math.imul(ht,se)|0,k=k+Math.imul(ht,Ut)|0,g=g+Math.imul(rt,it)|0,y=(y=y+Math.imul(rt,ut)|0)+Math.imul(st,it)|0,k=k+Math.imul(st,ut)|0,g=g+Math.imul(J,jt)|0,y=(y=y+Math.imul(J,yt)|0)+Math.imul(G,jt)|0,k=k+Math.imul(G,yt)|0,g=g+Math.imul(et,It)|0,y=(y=y+Math.imul(et,At)|0)+Math.imul(tt,It)|0,k=k+Math.imul(tt,At)|0;var gt=($+(g=g+Math.imul(Y,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(Y,Ht)|0)+Math.imul(q,Ft)|0))<<13)|0;$=((k=k+Math.imul(q,Ht)|0)+(y>>>13)|0)+(gt>>>26)|0,gt&=67108863,g=Math.imul(_t,Jt),y=(y=Math.imul(_t,Pt))+Math.imul(dt,Jt)|0,k=Math.imul(dt,Pt),g=g+Math.imul(Mt,ie)|0,y=(y=y+Math.imul(Mt,Bt)|0)+Math.imul(Tt,ie)|0,k=k+Math.imul(Tt,Bt)|0,g=g+Math.imul(vt,se)|0,y=(y=y+Math.imul(vt,Ut)|0)+Math.imul(mt,se)|0,k=k+Math.imul(mt,Ut)|0,g=g+Math.imul(lt,it)|0,y=(y=y+Math.imul(lt,ut)|0)+Math.imul(ht,it)|0,k=k+Math.imul(ht,ut)|0,g=g+Math.imul(rt,jt)|0,y=(y=y+Math.imul(rt,yt)|0)+Math.imul(st,jt)|0,k=k+Math.imul(st,yt)|0,g=g+Math.imul(J,It)|0,y=(y=y+Math.imul(J,At)|0)+Math.imul(G,It)|0,k=k+Math.imul(G,At)|0;var Xt=($+(g=g+Math.imul(et,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(et,Ht)|0)+Math.imul(tt,Ft)|0))<<13)|0;$=((k=k+Math.imul(tt,Ht)|0)+(y>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,g=Math.imul(_t,ie),y=(y=Math.imul(_t,Bt))+Math.imul(dt,ie)|0,k=Math.imul(dt,Bt),g=g+Math.imul(Mt,se)|0,y=(y=y+Math.imul(Mt,Ut)|0)+Math.imul(Tt,se)|0,k=k+Math.imul(Tt,Ut)|0,g=g+Math.imul(vt,it)|0,y=(y=y+Math.imul(vt,ut)|0)+Math.imul(mt,it)|0,k=k+Math.imul(mt,ut)|0,g=g+Math.imul(lt,jt)|0,y=(y=y+Math.imul(lt,yt)|0)+Math.imul(ht,jt)|0,k=k+Math.imul(ht,yt)|0,g=g+Math.imul(rt,It)|0,y=(y=y+Math.imul(rt,At)|0)+Math.imul(st,It)|0,k=k+Math.imul(st,At)|0;var $t=($+(g=g+Math.imul(J,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(J,Ht)|0)+Math.imul(G,Ft)|0))<<13)|0;$=((k=k+Math.imul(G,Ht)|0)+(y>>>13)|0)+($t>>>26)|0,$t&=67108863,g=Math.imul(_t,se),y=(y=Math.imul(_t,Ut))+Math.imul(dt,se)|0,k=Math.imul(dt,Ut),g=g+Math.imul(Mt,it)|0,y=(y=y+Math.imul(Mt,ut)|0)+Math.imul(Tt,it)|0,k=k+Math.imul(Tt,ut)|0,g=g+Math.imul(vt,jt)|0,y=(y=y+Math.imul(vt,yt)|0)+Math.imul(mt,jt)|0,k=k+Math.imul(mt,yt)|0,g=g+Math.imul(lt,It)|0,y=(y=y+Math.imul(lt,At)|0)+Math.imul(ht,It)|0,k=k+Math.imul(ht,At)|0;var Vt=($+(g=g+Math.imul(rt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(rt,Ht)|0)+Math.imul(st,Ft)|0))<<13)|0;$=((k=k+Math.imul(st,Ht)|0)+(y>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,g=Math.imul(_t,it),y=(y=Math.imul(_t,ut))+Math.imul(dt,it)|0,k=Math.imul(dt,ut),g=g+Math.imul(Mt,jt)|0,y=(y=y+Math.imul(Mt,yt)|0)+Math.imul(Tt,jt)|0,k=k+Math.imul(Tt,yt)|0,g=g+Math.imul(vt,It)|0,y=(y=y+Math.imul(vt,At)|0)+Math.imul(mt,It)|0,k=k+Math.imul(mt,At)|0;var Nt=($+(g=g+Math.imul(lt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(lt,Ht)|0)+Math.imul(ht,Ft)|0))<<13)|0;$=((k=k+Math.imul(ht,Ht)|0)+(y>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,g=Math.imul(_t,jt),y=(y=Math.imul(_t,yt))+Math.imul(dt,jt)|0,k=Math.imul(dt,yt),g=g+Math.imul(Mt,It)|0,y=(y=y+Math.imul(Mt,At)|0)+Math.imul(Tt,It)|0,k=k+Math.imul(Tt,At)|0;var ee=($+(g=g+Math.imul(vt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(vt,Ht)|0)+Math.imul(mt,Ft)|0))<<13)|0;$=((k=k+Math.imul(mt,Ht)|0)+(y>>>13)|0)+(ee>>>26)|0,ee&=67108863,g=Math.imul(_t,It),y=(y=Math.imul(_t,At))+Math.imul(dt,It)|0,k=Math.imul(dt,At);var re=($+(g=g+Math.imul(Mt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(Mt,Ht)|0)+Math.imul(Tt,Ft)|0))<<13)|0;$=((k=k+Math.imul(Tt,Ht)|0)+(y>>>13)|0)+(re>>>26)|0,re&=67108863;var oe=($+(g=Math.imul(_t,Ft))|0)+((8191&(y=(y=Math.imul(_t,Ht))+Math.imul(dt,Ft)|0))<<13)|0;return $=((k=Math.imul(dt,Ht))+(y>>>13)|0)+(oe>>>26)|0,oe&=67108863,z[0]=ce,z[1]=le,z[2]=he,z[3]=fe,z[4]=me,z[5]=Z,z[6]=ot,z[7]=ct,z[8]=ft,z[9]=St,z[10]=pt,z[11]=gt,z[12]=Xt,z[13]=$t,z[14]=Vt,z[15]=Nt,z[16]=ee,z[17]=re,z[18]=oe,$!==0&&(z[19]=$,b.length++),b};function A(v,p,b){b.negative=p.negative^v.negative,b.length=v.length+p.length;for(var g=0,y=0,k=0;k>>26)|0)>>>26,R&=67108863}b.words[k]=O,g=R,R=y}return g!==0?b.words[k]=g:b.length--,b._strip()}function N(v,p,b){return A(v,p,b)}Math.imul||(_=w),t.prototype.mulTo=function(v,p){var b=this.length+v.length;return this.length===10&&v.length===10?_(this,v,p):b<63?w(this,v,p):b<1024?A(this,v,p):N(this,v,p)},t.prototype.mul=function(v){var p=new t(null);return p.words=new Array(this.length+v.length),this.mulTo(v,p)},t.prototype.mulf=function(v){var p=new t(null);return p.words=new Array(this.length+v.length),N(this,v,p)},t.prototype.imul=function(v){return this.clone().mulTo(v,this)},t.prototype.imuln=function(v){var p=v<0;p&&(v=-v),a(typeof v=="number"),a(v<67108864);for(var b=0,g=0;g>=26,b+=y/67108864|0,b+=k>>>26,this.words[g]=67108863&k}return b!==0&&(this.words[g]=b,this.length++),p?this.ineg():this},t.prototype.muln=function(v){return this.clone().imuln(v)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(v){var p=function(k){for(var R=new Array(k.bitLength()),O=0;O>>$&1}return R}(v);if(p.length===0)return new t(1);for(var b=this,g=0;g=0);var p,b=v%26,g=(v-b)/26,y=67108863>>>26-b<<26-b;if(b!==0){var k=0;for(p=0;p>>26-b}k&&(this.words[p]=k,this.length++)}if(g!==0){for(p=this.length-1;p>=0;p--)this.words[p+g]=this.words[p];for(p=0;p=0),g=p?(p-p%26)/26:0;var y=v%26,k=Math.min((v-y)/26,this.length),R=67108863^67108863>>>y<k)for(this.length-=k,z=0;z=0&&($!==0||z>=g);z--){var W=0|this.words[z];this.words[z]=$<<26-y|W>>>y,$=W&R}return O&&$!==0&&(O.words[O.length++]=$),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},t.prototype.ishrn=function(v,p,b){return a(this.negative===0),this.iushrn(v,p,b)},t.prototype.shln=function(v){return this.clone().ishln(v)},t.prototype.ushln=function(v){return this.clone().iushln(v)},t.prototype.shrn=function(v){return this.clone().ishrn(v)},t.prototype.ushrn=function(v){return this.clone().iushrn(v)},t.prototype.testn=function(v){a(typeof v=="number"&&v>=0);var p=v%26,b=(v-p)/26,g=1<=0);var p=v%26,b=(v-p)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(p!==0&&b++,this.length=Math.min(b,this.length),p!==0){var g=67108863^67108863>>>p<=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},t.prototype.isubn=function(v){if(a(typeof v=="number"),a(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(O/67108864|0),this.words[g+b]=67108863&y}for(;g>26,this.words[g+b]=67108863&y;if(R===0)return this._strip();for(a(R===-1),R=0,g=0;g>26,this.words[g]=67108863&y;return this.negative=1,this._strip()},t.prototype._wordDiv=function(v,p){var b=(this.length,v.length),g=this.clone(),y=v,k=0|y.words[y.length-1];(b=26-this._countBits(k))!==0&&(y=y.ushln(b),g.iushln(b),k=0|y.words[y.length-1]);var R,O=g.length-y.length;if(p!=="mod"){(R=new t(null)).length=O+1,R.words=new Array(R.length);for(var z=0;z=0;W--){var j=67108864*(0|g.words[y.length+W])+(0|g.words[y.length+W-1]);for(j=Math.min(j/k|0,67108863),g._ishlnsubmul(y,j,W);g.negative!==0;)j--,g.negative=0,g._ishlnsubmul(y,1,W),g.isZero()||(g.negative^=1);R&&(R.words[W]=j)}return R&&R._strip(),g._strip(),p!=="div"&&b!==0&&g.iushrn(b),{div:R||null,mod:g}},t.prototype.divmod=function(v,p,b){return a(!v.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&v.negative===0?(k=this.neg().divmod(v,p),p!=="mod"&&(g=k.div.neg()),p!=="div"&&(y=k.mod.neg(),b&&y.negative!==0&&y.iadd(v)),{div:g,mod:y}):this.negative===0&&v.negative!==0?(k=this.divmod(v.neg(),p),p!=="mod"&&(g=k.div.neg()),{div:g,mod:k.mod}):this.negative&v.negative?(k=this.neg().divmod(v.neg(),p),p!=="div"&&(y=k.mod.neg(),b&&y.negative!==0&&y.isub(v)),{div:k.div,mod:y}):v.length>this.length||this.cmp(v)<0?{div:new t(0),mod:this}:v.length===1?p==="div"?{div:this.divn(v.words[0]),mod:null}:p==="mod"?{div:null,mod:new t(this.modrn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new t(this.modrn(v.words[0]))}:this._wordDiv(v,p);var g,y,k},t.prototype.div=function(v){return this.divmod(v,"div",!1).div},t.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},t.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},t.prototype.divRound=function(v){var p=this.divmod(v);if(p.mod.isZero())return p.div;var b=p.div.negative!==0?p.mod.isub(v):p.mod,g=v.ushrn(1),y=v.andln(1),k=b.cmp(g);return k<0||y===1&&k===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},t.prototype.modrn=function(v){var p=v<0;p&&(v=-v),a(v<=67108863);for(var b=(1<<26)%v,g=0,y=this.length-1;y>=0;y--)g=(b*g+(0|this.words[y]))%v;return p?-g:g},t.prototype.modn=function(v){return this.modrn(v)},t.prototype.idivn=function(v){var p=v<0;p&&(v=-v),a(v<=67108863);for(var b=0,g=this.length-1;g>=0;g--){var y=(0|this.words[g])+67108864*b;this.words[g]=y/v|0,b=y%v}return this._strip(),p?this.ineg():this},t.prototype.divn=function(v){return this.clone().idivn(v)},t.prototype.egcd=function(v){a(v.negative===0),a(!v.isZero());var p=this,b=v.clone();p=p.negative!==0?p.umod(v):p.clone();for(var g=new t(1),y=new t(0),k=new t(0),R=new t(1),O=0;p.isEven()&&b.isEven();)p.iushrn(1),b.iushrn(1),++O;for(var z=b.clone(),$=p.clone();!p.isZero();){for(var W=0,j=1;!(p.words[0]&j)&&W<26;++W,j<<=1);if(W>0)for(p.iushrn(W);W-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(z),y.isub($)),g.iushrn(1),y.iushrn(1);for(var H=0,E=1;!(b.words[0]&E)&&H<26;++H,E<<=1);if(H>0)for(b.iushrn(H);H-- >0;)(k.isOdd()||R.isOdd())&&(k.iadd(z),R.isub($)),k.iushrn(1),R.iushrn(1);p.cmp(b)>=0?(p.isub(b),g.isub(k),y.isub(R)):(b.isub(p),k.isub(g),R.isub(y))}return{a:k,b:R,gcd:b.iushln(O)}},t.prototype._invmp=function(v){a(v.negative===0),a(!v.isZero());var p=this,b=v.clone();p=p.negative!==0?p.umod(v):p.clone();for(var g,y=new t(1),k=new t(0),R=b.clone();p.cmpn(1)>0&&b.cmpn(1)>0;){for(var O=0,z=1;!(p.words[0]&z)&&O<26;++O,z<<=1);if(O>0)for(p.iushrn(O);O-- >0;)y.isOdd()&&y.iadd(R),y.iushrn(1);for(var $=0,W=1;!(b.words[0]&W)&&$<26;++$,W<<=1);if($>0)for(b.iushrn($);$-- >0;)k.isOdd()&&k.iadd(R),k.iushrn(1);p.cmp(b)>=0?(p.isub(b),y.isub(k)):(b.isub(p),k.isub(y))}return(g=p.cmpn(1)===0?y:k).cmpn(0)<0&&g.iadd(v),g},t.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var p=this.clone(),b=v.clone();p.negative=0,b.negative=0;for(var g=0;p.isEven()&&b.isEven();g++)p.iushrn(1),b.iushrn(1);for(;;){for(;p.isEven();)p.iushrn(1);for(;b.isEven();)b.iushrn(1);var y=p.cmp(b);if(y<0){var k=p;p=b,b=k}else if(y===0||b.cmpn(1)===0)break;p.isub(b)}return b.iushln(g)},t.prototype.invm=function(v){return this.egcd(v).a.umod(v)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(v){return this.words[0]&v},t.prototype.bincn=function(v){a(typeof v=="number");var p=v%26,b=(v-p)/26,g=1<>>26,R&=67108863,this.words[k]=R}return y!==0&&(this.words[k]=y,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(v){var p,b=v<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;if(this._strip(),this.length>1)p=1;else{b&&(v=-v),a(v<=67108863,"Number is too big");var g=0|this.words[0];p=g===v?0:gv.length)return 1;if(this.length=0;b--){var g=0|this.words[b],y=0|v.words[b];if(g!==y){gy&&(p=1);break}}return p},t.prototype.gtn=function(v){return this.cmpn(v)===1},t.prototype.gt=function(v){return this.cmp(v)===1},t.prototype.gten=function(v){return this.cmpn(v)>=0},t.prototype.gte=function(v){return this.cmp(v)>=0},t.prototype.ltn=function(v){return this.cmpn(v)===-1},t.prototype.lt=function(v){return this.cmp(v)===-1},t.prototype.lten=function(v){return this.cmpn(v)<=0},t.prototype.lte=function(v){return this.cmp(v)<=0},t.prototype.eqn=function(v){return this.cmpn(v)===0},t.prototype.eq=function(v){return this.cmp(v)===0},t.red=function(v){return new x(v)},t.prototype.toRed=function(v){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(v){return this.red=v,this},t.prototype.forceRed=function(v){return a(!this.red,"Already a number in reduction context"),this._forceRed(v)},t.prototype.redAdd=function(v){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},t.prototype.redIAdd=function(v){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},t.prototype.redSub=function(v){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},t.prototype.redISub=function(v){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},t.prototype.redShl=function(v){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},t.prototype.redMul=function(v){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},t.prototype.redIMul=function(v){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(v){return a(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var L={k256:null,p224:null,p192:null,p25519:null};function I(v,p){this.name=v,this.p=new t(p,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function P(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function D(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function U(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(v){if(typeof v=="string"){var p=t._prime(v);this.m=p.p,this.prime=p}else a(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}function M(v){x.call(this,v),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}I.prototype._tmp=function(){var v=new t(null);return v.words=new Array(Math.ceil(this.n/13)),v},I.prototype.ireduce=function(v){var p,b=v;do this.split(b,this.tmp),p=(b=(b=this.imulK(b)).iadd(this.tmp)).bitLength();while(p>this.n);var g=p0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},I.prototype.split=function(v,p){v.iushrn(this.n,0,p)},I.prototype.imulK=function(v){return v.imul(this.k)},r(P,I),P.prototype.split=function(v,p){for(var b=Math.min(v.length,9),g=0;g>>22,y=k}y>>>=22,v.words[g-10]=y,y===0&&v.length>10?v.length-=10:v.length-=9},P.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var p=0,b=0;b>>=26,v.words[b]=y,p=g}return p!==0&&(v.words[v.length++]=p),v},t._prime=function(v){if(L[v])return L[v];var p;if(v==="k256")p=new P;else if(v==="p224")p=new D;else if(v==="p192")p=new U;else{if(v!=="p25519")throw new Error("Unknown prime "+v);p=new B}return L[v]=p,p},x.prototype._verify1=function(v){a(v.negative===0,"red works only with positives"),a(v.red,"red works only with red numbers")},x.prototype._verify2=function(v,p){a((v.negative|p.negative)==0,"red works only with positives"),a(v.red&&v.red===p.red,"red works only with red numbers")},x.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):(c(v,v.umod(this.m)._forceRed(this)),v)},x.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},x.prototype.add=function(v,p){this._verify2(v,p);var b=v.add(p);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},x.prototype.iadd=function(v,p){this._verify2(v,p);var b=v.iadd(p);return b.cmp(this.m)>=0&&b.isub(this.m),b},x.prototype.sub=function(v,p){this._verify2(v,p);var b=v.sub(p);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},x.prototype.isub=function(v,p){this._verify2(v,p);var b=v.isub(p);return b.cmpn(0)<0&&b.iadd(this.m),b},x.prototype.shl=function(v,p){return this._verify1(v),this.imod(v.ushln(p))},x.prototype.imul=function(v,p){return this._verify2(v,p),this.imod(v.imul(p))},x.prototype.mul=function(v,p){return this._verify2(v,p),this.imod(v.mul(p))},x.prototype.isqr=function(v){return this.imul(v,v.clone())},x.prototype.sqr=function(v){return this.mul(v,v)},x.prototype.sqrt=function(v){if(v.isZero())return v.clone();var p=this.m.andln(3);if(a(p%2==1),p===3){var b=this.m.add(new t(1)).iushrn(2);return this.pow(v,b)}for(var g=this.m.subn(1),y=0;!g.isZero()&&g.andln(1)===0;)y++,g.iushrn(1);a(!g.isZero());var k=new t(1).toRed(this),R=k.redNeg(),O=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new t(2*z*z).toRed(this);this.pow(z,O).cmp(R)!==0;)z.redIAdd(R);for(var $=this.pow(z,g),W=this.pow(v,g.addn(1).iushrn(1)),j=this.pow(v,g),H=y;j.cmp(k)!==0;){for(var E=j,C=0;E.cmp(k)!==0;C++)E=E.redSqr();a(C=0;g--){for(var z=p.words[g],$=O-1;$>=0;$--){var W=z>>$&1;y!==b[0]&&(y=this.sqr(y)),W!==0||k!==0?(k<<=1,k|=W,(++R===4||g===0&&$===0)&&(y=this.mul(y,b[k]),R=0,k=0)):R=0}O=26}return y},x.prototype.convertTo=function(v){var p=v.umod(this.m);return p===v?p.clone():p},x.prototype.convertFrom=function(v){var p=v.clone();return p.red=null,p},t.mont=function(v){return new M(v)},r(M,x),M.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},M.prototype.convertFrom=function(v){var p=this.imod(v.mul(this.rinv));return p.red=null,p},M.prototype.imul=function(v,p){if(v.isZero()||p.isZero())return v.words[0]=0,v.length=1,v;var b=v.imul(p),g=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=b.isub(g).iushrn(this.shift),k=y;return y.cmp(this.m)>=0?k=y.isub(this.m):y.cmpn(0)<0&&(k=y.iadd(this.m)),k._forceRed(this)},M.prototype.mul=function(v,p){if(v.isZero()||p.isZero())return new t(0)._forceRed(this);var b=v.mul(p),g=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=b.isub(g).iushrn(this.shift),k=y;return y.cmp(this.m)>=0?k=y.isub(this.m):y.cmpn(0)<0&&(k=y.iadd(this.m)),k._forceRed(this)},M.prototype.invm=function(v){return this.imod(v._invmp(this.m).mul(this.r2))._forceRed(this)}})(T===void 0||T)},{buffer:188}],187:[function(s,T,S){var m;function o(r){this.rand=r}if(T.exports=function(r){return m||(m=new o(null)),m.generate(r)},T.exports.Rand=o,o.prototype.generate=function(r){return this._rand(r)},o.prototype._rand=function(r){if(this.rand.getBytes)return this.rand.getBytes(r);for(var t=new Uint8Array(r),e=0;e>>24]^N[D>>>16&255]^L[U>>>8&255]^I[255&B]^i[x++],f=A[D>>>24]^N[U>>>16&255]^L[B>>>8&255]^I[255&P]^i[x++],w=A[U>>>24]^N[B>>>16&255]^L[P>>>8&255]^I[255&D]^i[x++],_=A[B>>>24]^N[P>>>16&255]^L[D>>>8&255]^I[255&U]^i[x++],P=d,D=f,U=w,B=_;return d=(h[P>>>24]<<24|h[D>>>16&255]<<16|h[U>>>8&255]<<8|h[255&B])^i[x++],f=(h[D>>>24]<<24|h[U>>>16&255]<<16|h[B>>>8&255]<<8|h[255&P])^i[x++],w=(h[U>>>24]<<24|h[B>>>16&255]<<16|h[P>>>8&255]<<8|h[255&D])^i[x++],_=(h[B>>>24]<<24|h[P>>>16&255]<<16|h[D>>>8&255]<<8|h[255&U])^i[x++],[d>>>=0,f>>>=0,w>>>=0,_>>>=0]}var t=[0,1,2,4,8,16,32,64,128,27,54],e=function(){for(var n=new Array(256),i=0;i<256;i++)n[i]=i<128?i<<1:i<<1^283;for(var c=[],h=[],u=[[],[],[],[]],d=[[],[],[],[]],f=0,w=0,_=0;_<256;++_){var A=w^w<<1^w<<2^w<<3^w<<4;A=A>>>8^255&A^99,c[f]=A,h[A]=f;var N=n[f],L=n[N],I=n[L],P=257*n[A]^16843008*A;u[0][f]=P<<24|P>>>8,u[1][f]=P<<16|P>>>16,u[2][f]=P<<8|P>>>24,u[3][f]=P,P=16843009*I^65537*L^257*N^16843008*f,d[0][A]=P<<24|P>>>8,d[1][A]=P<<16|P>>>16,d[2][A]=P<<8|P>>>24,d[3][A]=P,f===0?f=w=1:(f=N^n[n[n[I^N]]],w^=n[n[w]])}return{SBOX:c,INV_SBOX:h,SUB_MIX:u,INV_SUB_MIX:d}}();function l(n){this._key=o(n),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var n=this._key,i=n.length,c=i+6,h=4*(c+1),u=[],d=0;d>>24,f=e.SBOX[f>>>24]<<24|e.SBOX[f>>>16&255]<<16|e.SBOX[f>>>8&255]<<8|e.SBOX[255&f],f^=t[d/i|0]<<24):i>6&&d%i==4&&(f=e.SBOX[f>>>24]<<24|e.SBOX[f>>>16&255]<<16|e.SBOX[f>>>8&255]<<8|e.SBOX[255&f]),u[d]=u[d-i]^f}for(var w=[],_=0;_>>24]]^e.INV_SUB_MIX[1][e.SBOX[N>>>16&255]]^e.INV_SUB_MIX[2][e.SBOX[N>>>8&255]]^e.INV_SUB_MIX[3][e.SBOX[255&N]]}this._nRounds=c,this._keySchedule=u,this._invKeySchedule=w},l.prototype.encryptBlockRaw=function(n){return r(n=o(n),this._keySchedule,e.SUB_MIX,e.SBOX,this._nRounds)},l.prototype.encryptBlock=function(n){var i=this.encryptBlockRaw(n),c=m.allocUnsafe(16);return c.writeUInt32BE(i[0],0),c.writeUInt32BE(i[1],4),c.writeUInt32BE(i[2],8),c.writeUInt32BE(i[3],12),c},l.prototype.decryptBlock=function(n){var i=(n=o(n))[1];n[1]=n[3],n[3]=i;var c=r(n,this._invKeySchedule,e.INV_SUB_MIX,e.INV_SBOX,this._nRounds),h=m.allocUnsafe(16);return h.writeUInt32BE(c[0],0),h.writeUInt32BE(c[3],4),h.writeUInt32BE(c[2],8),h.writeUInt32BE(c[1],12),h},l.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},T.exports.AES=l},{"safe-buffer":494}],190:[function(s,T,S){var m=s("./aes"),o=s("safe-buffer").Buffer,a=s("cipher-base"),r=s("inherits"),t=s("./ghash"),e=s("buffer-xor"),l=s("./incr32");function n(i,c,h,u){a.call(this);var d=o.alloc(4,0);this._cipher=new m.AES(c);var f=this._cipher.encryptBlock(d);this._ghash=new t(f),h=function(w,_,A){if(_.length===12)return w._finID=o.concat([_,o.from([0,0,0,1])]),o.concat([_,o.from([0,0,0,2])]);var N=new t(A),L=_.length,I=L%16;N.update(_),I&&(I=16-I,N.update(o.alloc(I,0))),N.update(o.alloc(8,0));var P=8*L,D=o.alloc(8);D.writeUIntBE(P,0,8),N.update(D),w._finID=N.state;var U=o.from(w._finID);return l(U),U}(this,h,f),this._prev=o.from(h),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=u,this._alen=0,this._len=0,this._mode=i,this._authTag=null,this._called=!1}r(n,a),n.prototype._update=function(i){if(!this._called&&this._alen){var c=16-this._alen%16;c<16&&(c=o.alloc(c,0),this._ghash.update(c))}this._called=!0;var h=this._mode.encrypt(this,i);return this._decrypt?this._ghash.update(i):this._ghash.update(h),this._len+=i.length,h},n.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var i=e(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(c,h){var u=0;c.length!==h.length&&u++;for(var d=Math.min(c.length,h.length),f=0;f16)throw new Error("unable to decrypt data");for(var f=-1;++f16)return u=this.cache.slice(0,16),this.cache=this.cache.slice(16),u}else if(this.cache.length>=16)return u=this.cache.slice(0,16),this.cache=this.cache.slice(16),u;return null},i.prototype.flush=function(){if(this.cache.length)return this.cache},S.createDecipher=function(h,u){var d=a[h.toLowerCase()];if(!d)throw new TypeError("invalid suite type");var f=l(u,!1,d.key,d.iv);return c(h,f.key,f.iv)},S.createDecipheriv=c},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(s,T,S){var m=s("./modes"),o=s("./authCipher"),a=s("safe-buffer").Buffer,r=s("./streamCipher"),t=s("cipher-base"),e=s("./aes"),l=s("evp_bytestokey");function n(u,d,f){t.call(this),this._cache=new c,this._cipher=new e.AES(d),this._prev=a.from(f),this._mode=u,this._autopadding=!0}s("inherits")(n,t),n.prototype._update=function(u){var d,f;this._cache.add(u);for(var w=[];d=this._cache.get();)f=this._mode.encrypt(this,d),w.push(f);return a.concat(w)};var i=a.alloc(16,16);function c(){this.cache=a.allocUnsafe(0)}function h(u,d,f){var w=m[u.toLowerCase()];if(!w)throw new TypeError("invalid suite type");if(typeof d=="string"&&(d=a.from(d)),d.length!==w.key/8)throw new TypeError("invalid key length "+d.length);if(typeof f=="string"&&(f=a.from(f)),w.mode!=="GCM"&&f.length!==w.iv)throw new TypeError("invalid iv length "+f.length);return w.type==="stream"?new r(w.module,d,f):w.type==="auth"?new o(w.module,d,f):new n(w.module,d,f)}n.prototype._final=function(){var u=this._cache.flush();if(this._autopadding)return u=this._mode.encrypt(this,u),this._cipher.scrub(),u;if(!u.equals(i))throw this._cipher.scrub(),new Error("data not multiple of block length")},n.prototype.setAutoPadding=function(u){return this._autopadding=!!u,this},c.prototype.add=function(u){this.cache=a.concat([this.cache,u])},c.prototype.get=function(){if(this.cache.length>15){var u=this.cache.slice(0,16);return this.cache=this.cache.slice(16),u}return null},c.prototype.flush=function(){for(var u=16-this.cache.length,d=a.allocUnsafe(u),f=-1;++f>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function r(t){this.h=t,this.state=m.alloc(16,0),this.cache=m.allocUnsafe(0)}r.prototype.ghash=function(t){for(var e=-1;++e0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,l&&(n[0]=n[0]^225<<24)}this.state=a(i)},r.prototype.update=function(t){var e;for(this.cache=m.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},r.prototype.final=function(t,e){return this.cache.length&&this.ghash(m.concat([this.cache,o],16)),this.ghash(a([0,t,0,e])),this.state},T.exports=r},{"safe-buffer":494}],195:[function(s,T,S){T.exports=function(m){for(var o,a=m.length;a--;){if((o=m.readUInt8(a))!==255){o++,m.writeUInt8(o,a);break}m.writeUInt8(0,a)}}},{}],196:[function(s,T,S){var m=s("buffer-xor");S.encrypt=function(o,a){var r=m(a,o._prev);return o._prev=o._cipher.encryptBlock(r),o._prev},S.decrypt=function(o,a){var r=o._prev;o._prev=a;var t=o._cipher.decryptBlock(a);return m(t,r)}},{"buffer-xor":219}],197:[function(s,T,S){var m=s("safe-buffer").Buffer,o=s("buffer-xor");function a(r,t,e){var l=t.length,n=o(t,r._cache);return r._cache=r._cache.slice(l),r._prev=m.concat([r._prev,e?t:n]),n}S.encrypt=function(r,t,e){for(var l,n=m.allocUnsafe(0);t.length;){if(r._cache.length===0&&(r._cache=r._cipher.encryptBlock(r._prev),r._prev=m.allocUnsafe(0)),!(r._cache.length<=t.length)){n=m.concat([n,a(r,t,e)]);break}l=r._cache.length,n=m.concat([n,a(r,t.slice(0,l),e)]),t=t.slice(l)}return n}},{"buffer-xor":219,"safe-buffer":494}],198:[function(s,T,S){var m=s("safe-buffer").Buffer;function o(r,t,e){for(var l,n,i=-1,c=0;++i<8;)l=t&1<<7-i?128:0,c+=(128&(n=r._cipher.encryptBlock(r._prev)[0]^l))>>i%8,r._prev=a(r._prev,e?l:n);return c}function a(r,t){var e=r.length,l=-1,n=m.allocUnsafe(r.length);for(r=m.concat([r,m.from([t])]);++l>7;return n}S.encrypt=function(r,t,e){for(var l=t.length,n=m.allocUnsafe(l),i=-1;++i=0||!l.umod(e.prime1)||!l.umod(e.prime2));return l}function t(e,l){var n=function(L){var I=r(L);return{blinder:I.toRed(o.mont(L.modulus)).redPow(new o(L.publicExponent)).fromRed(),unblinder:I.invm(L.modulus)}}(l),i=l.modulus.byteLength(),c=new o(e).mul(n.blinder).umod(l.modulus),h=c.toRed(o.mont(l.prime1)),u=c.toRed(o.mont(l.prime2)),d=l.coefficient,f=l.prime1,w=l.prime2,_=h.redPow(l.exponent1).fromRed(),A=u.redPow(l.exponent2).fromRed(),N=_.isub(A).imul(d).umod(f).imul(w);return A.iadd(N).imul(n.unblinder).umod(l.modulus).toArrayLike(m,"be",i)}t.getr=r,T.exports=t}).call(this)}).call(this,s("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(s,T,S){T.exports=s("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(s,T,S){T.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],212:[function(s,T,S){T.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],213:[function(s,T,S){var m=s("safe-buffer").Buffer,o=s("create-hash"),a=s("readable-stream"),r=s("inherits"),t=s("./sign"),e=s("./verify"),l=s("./algorithms.json");function n(u){a.Writable.call(this);var d=l[u];if(!d)throw new Error("Unknown message digest");this._hashType=d.hash,this._hash=o(d.hash),this._tag=d.id,this._signType=d.sign}function i(u){a.Writable.call(this);var d=l[u];if(!d)throw new Error("Unknown message digest");this._hash=o(d.hash),this._tag=d.id,this._signType=d.sign}function c(u){return new n(u)}function h(u){return new i(u)}Object.keys(l).forEach(function(u){l[u].id=m.from(l[u].id,"hex"),l[u.toLowerCase()]=l[u]}),r(n,a.Writable),n.prototype._write=function(u,d,f){this._hash.update(u),f()},n.prototype.update=function(u,d){return typeof u=="string"&&(u=m.from(u,d)),this._hash.update(u),this},n.prototype.sign=function(u,d){this.end();var f=this._hash.digest(),w=t(f,u,this._hashType,this._signType,this._tag);return d?w.toString(d):w},r(i,a.Writable),i.prototype._write=function(u,d,f){this._hash.update(u),f()},i.prototype.update=function(u,d){return typeof u=="string"&&(u=m.from(u,d)),this._hash.update(u),this},i.prototype.verify=function(u,d,f){typeof d=="string"&&(d=m.from(d,f)),this.end();var w=this._hash.digest();return e(d,w,u,this._signType,this._tag)},T.exports={Sign:c,Verify:h,createSign:c,createVerify:h}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(s,T,S){var m=s("safe-buffer").Buffer,o=s("create-hmac"),a=s("browserify-rsa"),r=s("elliptic").ec,t=s("bn.js"),e=s("parse-asn1"),l=s("./curves.json");function n(u,d,f,w){if((u=m.from(u.toArray())).length0&&f.ishrn(w),f}function c(u,d,f){var w,_;do{for(w=m.alloc(0);8*w.length=n)throw new Error("invalid sig")}T.exports=function(l,n,i,c,h){var u=r(i);if(u.type==="ec"){if(c!=="ecdsa"&&c!=="ecdsa/rsa")throw new Error("wrong public key type");return function(L,I,P){var D=t[P.data.algorithm.curve.join(".")];if(!D)throw new Error("unknown curve "+P.data.algorithm.curve.join("."));var U=new a(D),B=P.data.subjectPrivateKey.data;return U.verify(I,L,B)}(l,n,u)}if(u.type==="dsa"){if(c!=="dsa")throw new Error("wrong public key type");return function(L,I,P){var D=P.data.p,U=P.data.q,B=P.data.g,x=P.data.pub_key,M=r.signature.decode(L,"der"),v=M.s,p=M.r;e(v,U),e(p,U);var b=o.mont(D),g=v.invm(U);return B.toRed(b).redPow(new o(I).mul(g).mod(U)).fromRed().mul(x.toRed(b).redPow(p.mul(g).mod(U)).fromRed()).mod(D).mod(U).cmp(p)===0}(l,n,u)}if(c!=="rsa"&&c!=="ecdsa/rsa")throw new Error("wrong public key type");n=m.concat([h,n]);for(var d=u.modulus.byteLength(),f=[1],w=0;n.length+f.length+2>5==6?2:u>>4==14?3:u>>3==30?4:u>>6==2?-1:-2}function t(u){var d=this.lastTotal-this.lastNeed,f=function(w,_,A){if((192&_[0])!=128)return w.lastNeed=0,"�";if(w.lastNeed>1&&_.length>1){if((192&_[1])!=128)return w.lastNeed=1,"�";if(w.lastNeed>2&&_.length>2&&(192&_[2])!=128)return w.lastNeed=2,"�"}}(this,u);return f!==void 0?f:this.lastNeed<=u.length?(u.copy(this.lastChar,d,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(u.copy(this.lastChar,d,0,u.length),void(this.lastNeed-=u.length))}function e(u,d){if((u.length-d)%2==0){var f=u.toString("utf16le",d);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=u[u.length-1],u.toString("utf16le",d,u.length-1)}function l(u){var d=u&&u.length?this.write(u):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return d+this.lastChar.toString("utf16le",0,f)}return d}function n(u,d){var f=(u.length-d)%3;return f===0?u.toString("base64",d):(this.lastNeed=3-f,this.lastTotal=3,f===1?this.lastChar[0]=u[u.length-1]:(this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1]),u.toString("base64",d,u.length-f))}function i(u){var d=u&&u.length?this.write(u):"";return this.lastNeed?d+this.lastChar.toString("base64",0,3-this.lastNeed):d}function c(u){return u.toString(this.encoding)}function h(u){return u&&u.length?this.write(u):""}S.StringDecoder=a,a.prototype.write=function(u){if(u.length===0)return"";var d,f;if(this.lastNeed){if((d=this.fillLast(u))===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;return f=0?(I>0&&(_.lastNeed=I-1),I):--L=0?(I>0&&(_.lastNeed=I-2),I):--L=0?(I>0&&(I===2?I=0:_.lastNeed=I-3),I):0}(this,u,d);if(!this.lastNeed)return u.toString("utf8",d);this.lastTotal=f;var w=u.length-(f-this.lastNeed);return u.copy(this.lastChar,0,w),u.toString("utf8",d,w)},a.prototype.fillLast=function(u){if(this.lastNeed<=u.length)return u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,u.length),this.lastNeed-=u.length}},{"safe-buffer":217}],219:[function(s,T,S){(function(m){(function(){T.exports=function(o,a){for(var r=Math.min(o.length,a.length),t=new m(r),e=0;e2147483647)throw new RangeError('The value "'+E+'" is invalid for option "size"');var C=new Uint8Array(E);return C.__proto__=t.prototype,C}function t(E,C,F){if(typeof E=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return n(E)}return e(E,C,F)}function e(E,C,F){if(typeof E=="string")return function(q,K){if(typeof K=="string"&&K!==""||(K="utf8"),!t.isEncoding(K))throw new TypeError("Unknown encoding: "+K);var et=0|h(q,K),tt=r(et),X=tt.write(q,K);return X!==et&&(tt=tt.slice(0,X)),tt}(E,C);if(ArrayBuffer.isView(E))return i(E);if(E==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(j(E,ArrayBuffer)||E&&j(E.buffer,ArrayBuffer))return function(q,K,et){if(K<0||q.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|E}function h(E,C){if(t.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||j(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);var F=E.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&F===0)return 0;for(var Y=!1;;)switch(C){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return z(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*F;case"hex":return F>>>1;case"base64":return $(E).length;default:if(Y)return V?-1:z(E).length;C=(""+C).toLowerCase(),Y=!0}}function u(E,C,F){var V=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0)<=(C>>>=0))return"";for(E||(E="utf8");;)switch(E){case"hex":return M(this,C,F);case"utf8":case"utf-8":return U(this,C,F);case"ascii":return B(this,C,F);case"latin1":case"binary":return x(this,C,F);case"base64":return D(this,C,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,C,F);default:if(V)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),V=!0}}function d(E,C,F){var V=E[C];E[C]=E[F],E[F]=V}function f(E,C,F,V,Y){if(E.length===0)return-1;if(typeof F=="string"?(V=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),H(F=+F)&&(F=Y?0:E.length-1),F<0&&(F=E.length+F),F>=E.length){if(Y)return-1;F=E.length-1}else if(F<0){if(!Y)return-1;F=0}if(typeof C=="string"&&(C=t.from(C,V)),t.isBuffer(C))return C.length===0?-1:w(E,C,F,V,Y);if(typeof C=="number")return C&=255,typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(E,C,F):Uint8Array.prototype.lastIndexOf.call(E,C,F):w(E,[C],F,V,Y);throw new TypeError("val must be string, number or Buffer")}function w(E,C,F,V,Y){var q,K=1,et=E.length,tt=C.length;if(V!==void 0&&((V=String(V).toLowerCase())==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(E.length<2||C.length<2)return-1;K=2,et/=2,tt/=2,F/=2}function X(rt,st){return K===1?rt[st]:rt.readUInt16BE(st*K)}if(Y){var J=-1;for(q=F;qet&&(F=et-tt),q=F;q>=0;q--){for(var G=!0,nt=0;ntY&&(V=Y):V=Y;var q=C.length;V>q/2&&(V=q/2);for(var K=0;K>8,tt=K%256,X.push(tt),X.push(et);return X}(C,E.length-F),E,F,V)}function D(E,C,F){return C===0&&F===E.length?o.fromByteArray(E):o.fromByteArray(E.slice(C,F))}function U(E,C,F){F=Math.min(E.length,F);for(var V=[],Y=C;Y239?4:X>223?3:X>191?2:1;if(Y+G<=F)switch(G){case 1:X<128&&(J=X);break;case 2:(192&(q=E[Y+1]))==128&&(tt=(31&X)<<6|63&q)>127&&(J=tt);break;case 3:q=E[Y+1],K=E[Y+2],(192&q)==128&&(192&K)==128&&(tt=(15&X)<<12|(63&q)<<6|63&K)>2047&&(tt<55296||tt>57343)&&(J=tt);break;case 4:q=E[Y+1],K=E[Y+2],et=E[Y+3],(192&q)==128&&(192&K)==128&&(192&et)==128&&(tt=(15&X)<<18|(63&q)<<12|(63&K)<<6|63&et)>65535&&tt<1114112&&(J=tt)}J===null?(J=65533,G=1):J>65535&&(J-=65536,V.push(J>>>10&1023|55296),J=56320|1023&J),V.push(J),Y+=G}return function(nt){var rt=nt.length;if(rt<=4096)return String.fromCharCode.apply(String,nt);for(var st="",at=0;at"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),typeof Symbol<"u"&&Symbol.species!=null&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(E,C,F){return e(E,C,F)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(E,C,F){return function(V,Y,q){return l(V),V<=0?r(V):Y!==void 0?typeof q=="string"?r(V).fill(Y,q):r(V).fill(Y):r(V)}(E,C,F)},t.allocUnsafe=function(E){return n(E)},t.allocUnsafeSlow=function(E){return n(E)},t.isBuffer=function(E){return E!=null&&E._isBuffer===!0&&E!==t.prototype},t.compare=function(E,C){if(j(E,Uint8Array)&&(E=t.from(E,E.offset,E.byteLength)),j(C,Uint8Array)&&(C=t.from(C,C.offset,C.byteLength)),!t.isBuffer(E)||!t.isBuffer(C))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(E===C)return 0;for(var F=E.length,V=C.length,Y=0,q=Math.min(F,V);YC&&(E+=" ... "),""},t.prototype.compare=function(E,C,F,V,Y){if(j(E,Uint8Array)&&(E=t.from(E,E.offset,E.byteLength)),!t.isBuffer(E))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof E);if(C===void 0&&(C=0),F===void 0&&(F=E?E.length:0),V===void 0&&(V=0),Y===void 0&&(Y=this.length),C<0||F>E.length||V<0||Y>this.length)throw new RangeError("out of range index");if(V>=Y&&C>=F)return 0;if(V>=Y)return-1;if(C>=F)return 1;if(this===E)return 0;for(var q=(Y>>>=0)-(V>>>=0),K=(F>>>=0)-(C>>>=0),et=Math.min(q,K),tt=this.slice(V,Y),X=E.slice(C,F),J=0;J>>=0,isFinite(F)?(F>>>=0,V===void 0&&(V="utf8")):(V=F,F=void 0)}var Y=this.length-C;if((F===void 0||F>Y)&&(F=Y),E.length>0&&(F<0||C<0)||C>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");for(var q=!1;;)switch(V){case"hex":return _(this,E,C,F);case"utf8":case"utf-8":return A(this,E,C,F);case"ascii":return N(this,E,C,F);case"latin1":case"binary":return L(this,E,C,F);case"base64":return I(this,E,C,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,E,C,F);default:if(q)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),q=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function B(E,C,F){var V="";F=Math.min(E.length,F);for(var Y=C;YV)&&(F=V);for(var Y="",q=C;qF)throw new RangeError("Trying to access beyond buffer length")}function b(E,C,F,V,Y,q){if(!t.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>Y||CE.length)throw new RangeError("Index out of range")}function g(E,C,F,V,Y,q){if(F+V>E.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function y(E,C,F,V,Y){return C=+C,F>>>=0,Y||g(E,0,F,4),a.write(E,C,F,V,23,4),F+4}function k(E,C,F,V,Y){return C=+C,F>>>=0,Y||g(E,0,F,8),a.write(E,C,F,V,52,8),F+8}t.prototype.slice=function(E,C){var F=this.length;(E=~~E)<0?(E+=F)<0&&(E=0):E>F&&(E=F),(C=C===void 0?F:~~C)<0?(C+=F)<0&&(C=0):C>F&&(C=F),C>>=0,C>>>=0,F||p(E,C,this.length);for(var V=this[E],Y=1,q=0;++q>>=0,C>>>=0,F||p(E,C,this.length);for(var V=this[E+--C],Y=1;C>0&&(Y*=256);)V+=this[E+--C]*Y;return V},t.prototype.readUInt8=function(E,C){return E>>>=0,C||p(E,1,this.length),this[E]},t.prototype.readUInt16LE=function(E,C){return E>>>=0,C||p(E,2,this.length),this[E]|this[E+1]<<8},t.prototype.readUInt16BE=function(E,C){return E>>>=0,C||p(E,2,this.length),this[E]<<8|this[E+1]},t.prototype.readUInt32LE=function(E,C){return E>>>=0,C||p(E,4,this.length),(this[E]|this[E+1]<<8|this[E+2]<<16)+16777216*this[E+3]},t.prototype.readUInt32BE=function(E,C){return E>>>=0,C||p(E,4,this.length),16777216*this[E]+(this[E+1]<<16|this[E+2]<<8|this[E+3])},t.prototype.readIntLE=function(E,C,F){E>>>=0,C>>>=0,F||p(E,C,this.length);for(var V=this[E],Y=1,q=0;++q=(Y*=128)&&(V-=Math.pow(2,8*C)),V},t.prototype.readIntBE=function(E,C,F){E>>>=0,C>>>=0,F||p(E,C,this.length);for(var V=C,Y=1,q=this[E+--V];V>0&&(Y*=256);)q+=this[E+--V]*Y;return q>=(Y*=128)&&(q-=Math.pow(2,8*C)),q},t.prototype.readInt8=function(E,C){return E>>>=0,C||p(E,1,this.length),128&this[E]?-1*(255-this[E]+1):this[E]},t.prototype.readInt16LE=function(E,C){E>>>=0,C||p(E,2,this.length);var F=this[E]|this[E+1]<<8;return 32768&F?4294901760|F:F},t.prototype.readInt16BE=function(E,C){E>>>=0,C||p(E,2,this.length);var F=this[E+1]|this[E]<<8;return 32768&F?4294901760|F:F},t.prototype.readInt32LE=function(E,C){return E>>>=0,C||p(E,4,this.length),this[E]|this[E+1]<<8|this[E+2]<<16|this[E+3]<<24},t.prototype.readInt32BE=function(E,C){return E>>>=0,C||p(E,4,this.length),this[E]<<24|this[E+1]<<16|this[E+2]<<8|this[E+3]},t.prototype.readFloatLE=function(E,C){return E>>>=0,C||p(E,4,this.length),a.read(this,E,!0,23,4)},t.prototype.readFloatBE=function(E,C){return E>>>=0,C||p(E,4,this.length),a.read(this,E,!1,23,4)},t.prototype.readDoubleLE=function(E,C){return E>>>=0,C||p(E,8,this.length),a.read(this,E,!0,52,8)},t.prototype.readDoubleBE=function(E,C){return E>>>=0,C||p(E,8,this.length),a.read(this,E,!1,52,8)},t.prototype.writeUIntLE=function(E,C,F,V){E=+E,C>>>=0,F>>>=0,V||b(this,E,C,F,Math.pow(2,8*F)-1,0);var Y=1,q=0;for(this[C]=255&E;++q>>=0,F>>>=0,V||b(this,E,C,F,Math.pow(2,8*F)-1,0);var Y=F-1,q=1;for(this[C+Y]=255&E;--Y>=0&&(q*=256);)this[C+Y]=E/q&255;return C+F},t.prototype.writeUInt8=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,1,255,0),this[C]=255&E,C+1},t.prototype.writeUInt16LE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,2,65535,0),this[C]=255&E,this[C+1]=E>>>8,C+2},t.prototype.writeUInt16BE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,2,65535,0),this[C]=E>>>8,this[C+1]=255&E,C+2},t.prototype.writeUInt32LE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,4,4294967295,0),this[C+3]=E>>>24,this[C+2]=E>>>16,this[C+1]=E>>>8,this[C]=255&E,C+4},t.prototype.writeUInt32BE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,4,4294967295,0),this[C]=E>>>24,this[C+1]=E>>>16,this[C+2]=E>>>8,this[C+3]=255&E,C+4},t.prototype.writeIntLE=function(E,C,F,V){if(E=+E,C>>>=0,!V){var Y=Math.pow(2,8*F-1);b(this,E,C,F,Y-1,-Y)}var q=0,K=1,et=0;for(this[C]=255&E;++q>0)-et&255;return C+F},t.prototype.writeIntBE=function(E,C,F,V){if(E=+E,C>>>=0,!V){var Y=Math.pow(2,8*F-1);b(this,E,C,F,Y-1,-Y)}var q=F-1,K=1,et=0;for(this[C+q]=255&E;--q>=0&&(K*=256);)E<0&&et===0&&this[C+q+1]!==0&&(et=1),this[C+q]=(E/K>>0)-et&255;return C+F},t.prototype.writeInt8=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,1,127,-128),E<0&&(E=255+E+1),this[C]=255&E,C+1},t.prototype.writeInt16LE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,2,32767,-32768),this[C]=255&E,this[C+1]=E>>>8,C+2},t.prototype.writeInt16BE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,2,32767,-32768),this[C]=E>>>8,this[C+1]=255&E,C+2},t.prototype.writeInt32LE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,4,2147483647,-2147483648),this[C]=255&E,this[C+1]=E>>>8,this[C+2]=E>>>16,this[C+3]=E>>>24,C+4},t.prototype.writeInt32BE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,4,2147483647,-2147483648),E<0&&(E=4294967295+E+1),this[C]=E>>>24,this[C+1]=E>>>16,this[C+2]=E>>>8,this[C+3]=255&E,C+4},t.prototype.writeFloatLE=function(E,C,F){return y(this,E,C,!0,F)},t.prototype.writeFloatBE=function(E,C,F){return y(this,E,C,!1,F)},t.prototype.writeDoubleLE=function(E,C,F){return k(this,E,C,!0,F)},t.prototype.writeDoubleBE=function(E,C,F){return k(this,E,C,!1,F)},t.prototype.copy=function(E,C,F,V){if(!t.isBuffer(E))throw new TypeError("argument should be a Buffer");if(F||(F=0),V||V===0||(V=this.length),C>=E.length&&(C=E.length),C||(C=0),V>0&&V=this.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),E.length-C=0;--q)E[q+C]=this[q+F];else Uint8Array.prototype.set.call(E,this.subarray(F,V),C);return Y},t.prototype.fill=function(E,C,F,V){if(typeof E=="string"){if(typeof C=="string"?(V=C,C=0,F=this.length):typeof F=="string"&&(V=F,F=this.length),V!==void 0&&typeof V!="string")throw new TypeError("encoding must be a string");if(typeof V=="string"&&!t.isEncoding(V))throw new TypeError("Unknown encoding: "+V);if(E.length===1){var Y=E.charCodeAt(0);(V==="utf8"&&Y<128||V==="latin1")&&(E=Y)}}else typeof E=="number"&&(E&=255);if(C<0||this.length>>=0,F=F===void 0?this.length:F>>>0,E||(E=0),typeof E=="number")for(q=C;q55295&&F<57344){if(!Y){if(F>56319){(C-=3)>-1&&q.push(239,191,189);continue}if(K+1===V){(C-=3)>-1&&q.push(239,191,189);continue}Y=F;continue}if(F<56320){(C-=3)>-1&&q.push(239,191,189),Y=F;continue}F=65536+(Y-55296<<10|F-56320)}else Y&&(C-=3)>-1&&q.push(239,191,189);if(Y=null,F<128){if((C-=1)<0)break;q.push(F)}else if(F<2048){if((C-=2)<0)break;q.push(F>>6|192,63&F|128)}else if(F<65536){if((C-=3)<0)break;q.push(F>>12|224,F>>6&63|128,63&F|128)}else{if(!(F<1114112))throw new Error("Invalid code point");if((C-=4)<0)break;q.push(F>>18|240,F>>12&63|128,F>>6&63|128,63&F|128)}}return q}function $(E){return o.toByteArray(function(C){if((C=(C=C.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;C.length%4!=0;)C+="=";return C}(E))}function W(E,C,F,V){for(var Y=0;Y=C.length||Y>=E.length);++Y)C[Y+F]=E[Y];return Y}function j(E,C){return E instanceof C||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===C.name}function H(E){return E!=E}}).call(this)}).call(this,s("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(s,T,S){var m=s("safe-buffer").Buffer,o=s("stream").Transform,a=s("string_decoder").StringDecoder;function r(t){o.call(this),this.hashMode=typeof t=="string",this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}s("inherits")(r,o),r.prototype.update=function(t,e,l){typeof t=="string"&&(t=m.from(t,e));var n=this._update(t);return this.hashMode?this:(l&&(n=this._toString(n,l)),n)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(t,e,l){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{l(n)}},r.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(l){e=l}t(e)},r.prototype._finalOrDigest=function(t){var e=this.__final()||m.alloc(0);return t&&(e=this._toString(e,t,!0)),e},r.prototype._toString=function(t,e,l){if(this._decoder||(this._decoder=new a(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return l&&(n+=this._decoder.end()),n},T.exports=r},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(s,T,S){var m=s("../internals/is-callable"),o=s("../internals/try-to-string"),a=TypeError;T.exports=function(r){if(m(r))return r;throw new a(o(r)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(s,T,S){var m=s("../internals/is-constructor"),o=s("../internals/try-to-string"),a=TypeError;T.exports=function(r){if(m(r))return r;throw new a(o(r)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(s,T,S){var m=s("../internals/is-callable"),o=String,a=TypeError;T.exports=function(r){if(typeof r=="object"||m(r))return r;throw new a("Can't set "+o(r)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(s,T,S){var m=s("../internals/well-known-symbol"),o=s("../internals/object-create"),a=s("../internals/object-define-property").f,r=m("unscopables"),t=Array.prototype;t[r]===void 0&&a(t,r,{configurable:!0,value:o(null)}),T.exports=function(e){t[r][e]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(s,T,S){var m=s("../internals/object-is-prototype-of"),o=TypeError;T.exports=function(a,r){if(m(r,a))return a;throw new o("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(s,T,S){var m=s("../internals/is-object"),o=String,a=TypeError;T.exports=function(r){if(m(r))return r;throw new a(o(r)+" is not an object")}},{"../internals/is-object":289}],228:[function(s,T,S){var m=s("../internals/to-indexed-object"),o=s("../internals/to-absolute-index"),a=s("../internals/length-of-array-like"),r=function(t){return function(e,l,n){var i,c=m(e),h=a(c),u=o(n,h);if(t&&l!=l){for(;h>u;)if((i=c[u++])!=i)return!0}else for(;h>u;u++)if((t||u in c)&&c[u]===l)return t||u||0;return!t&&-1}};T.exports={includes:r(!0),indexOf:r(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(s,T,S){var m=s("../internals/function-bind-context"),o=s("../internals/function-uncurry-this"),a=s("../internals/indexed-object"),r=s("../internals/to-object"),t=s("../internals/length-of-array-like"),e=s("../internals/array-species-create"),l=o([].push),n=function(i){var c=i===1,h=i===2,u=i===3,d=i===4,f=i===6,w=i===7,_=i===5||f;return function(A,N,L,I){for(var P,D,U=r(A),B=a(U),x=m(N,L),M=t(B),v=0,p=I||e,b=c?p(A,M):h||w?p(A,0):void 0;M>v;v++)if((_||v in B)&&(D=x(P=B[v],v,U),i))if(c)b[v]=D;else if(D)switch(i){case 3:return!0;case 5:return P;case 6:return v;case 2:l(b,P)}else switch(i){case 4:return!1;case 7:l(b,P)}return f?-1:u||d?d:b}};T.exports={forEach:n(0),map:n(1),filter:n(2),some:n(3),every:n(4),find:n(5),findIndex:n(6),filterReject:n(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(s,T,S){var m=s("../internals/to-absolute-index"),o=s("../internals/length-of-array-like"),a=s("../internals/create-property"),r=Array,t=Math.max;T.exports=function(e,l,n){for(var i=o(e),c=m(l,i),h=m(n===void 0?i:n,i),u=r(t(h-c,0)),d=0;c0&&m[0]<4?1:+(m[0]+m[1])),!o&&r&&(!(m=r.match(/Edge\/(\d+)/))||m[1]>=74)&&(m=r.match(/Chrome\/(\d+)/))&&(o=+m[1]),T.exports=o},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(s,T,S){T.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(s,T,S){var m=s("../internals/global"),o=s("../internals/object-get-own-property-descriptor").f,a=s("../internals/create-non-enumerable-property"),r=s("../internals/define-built-in"),t=s("../internals/define-global-property"),e=s("../internals/copy-constructor-properties"),l=s("../internals/is-forced");T.exports=function(n,i){var c,h,u,d,f,w=n.target,_=n.global,A=n.stat;if(c=_?m:A?m[w]||t(w,{}):(m[w]||{}).prototype)for(h in i){if(d=i[h],u=n.dontCallGetSet?(f=o(c,h))&&f.value:c[h],!l(_?h:w+(A?".":"#")+h,n.forced)&&u!==void 0){if(typeof d==typeof u)continue;e(d,u)}(n.sham||u&&u.sham)&&a(d,"sham",!0),r(c,h,d,n)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(s,T,S){T.exports=function(m){try{return!!m()}catch{return!0}}},{}],261:[function(s,T,S){var m=s("../internals/function-bind-native"),o=Function.prototype,a=o.apply,r=o.call;T.exports=typeof Reflect=="object"&&Reflect.apply||(m?r.bind(a):function(){return r.apply(a,arguments)})},{"../internals/function-bind-native":263}],262:[function(s,T,S){var m=s("../internals/function-uncurry-this-clause"),o=s("../internals/a-callable"),a=s("../internals/function-bind-native"),r=m(m.bind);T.exports=function(t,e){return o(t),e===void 0?t:a?r(t,e):function(){return t.apply(e,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(s,T,S){var m=s("../internals/fails");T.exports=!m(function(){var o=(function(){}).bind();return typeof o!="function"||o.hasOwnProperty("prototype")})},{"../internals/fails":260}],264:[function(s,T,S){var m=s("../internals/function-bind-native"),o=Function.prototype.call;T.exports=m?o.bind(o):function(){return o.apply(o,arguments)}},{"../internals/function-bind-native":263}],265:[function(s,T,S){var m=s("../internals/descriptors"),o=s("../internals/has-own-property"),a=Function.prototype,r=m&&Object.getOwnPropertyDescriptor,t=o(a,"name"),e=t&&(function(){}).name==="something",l=t&&(!m||m&&r(a,"name").configurable);T.exports={EXISTS:t,PROPER:e,CONFIGURABLE:l}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(s,T,S){var m=s("../internals/function-uncurry-this"),o=s("../internals/a-callable");T.exports=function(a,r,t){try{return m(o(Object.getOwnPropertyDescriptor(a,r)[t]))}catch{}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(s,T,S){var m=s("../internals/classof-raw"),o=s("../internals/function-uncurry-this");T.exports=function(a){if(m(a)==="Function")return o(a)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(s,T,S){var m=s("../internals/function-bind-native"),o=Function.prototype,a=o.call,r=m&&o.bind.bind(a,a);T.exports=m?r:function(t){return function(){return a.apply(t,arguments)}}},{"../internals/function-bind-native":263}],269:[function(s,T,S){var m=s("../internals/global"),o=s("../internals/is-callable"),a=function(r){return o(r)?r:void 0};T.exports=function(r,t){return arguments.length<2?a(m[r]):m[r]&&m[r][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(s,T,S){var m=s("../internals/classof"),o=s("../internals/get-method"),a=s("../internals/is-null-or-undefined"),r=s("../internals/iterators"),t=s("../internals/well-known-symbol")("iterator");T.exports=function(e){if(!a(e))return o(e,t)||o(e,"@@iterator")||r[m(e)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(s,T,S){var m=s("../internals/function-call"),o=s("../internals/a-callable"),a=s("../internals/an-object"),r=s("../internals/try-to-string"),t=s("../internals/get-iterator-method"),e=TypeError;T.exports=function(l,n){var i=arguments.length<2?t(l):n;if(o(i))return a(m(i,l));throw new e(r(l)+" is not iterable")}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(s,T,S){var m=s("../internals/function-uncurry-this"),o=s("../internals/is-array"),a=s("../internals/is-callable"),r=s("../internals/classof-raw"),t=s("../internals/to-string"),e=m([].push);T.exports=function(l){if(a(l))return l;if(o(l)){for(var n=l.length,i=[],c=0;cL;L++)if((P=y(f[L]))&&l(d,P))return P;return new u(!1)}A=n(f,N)}for(D=M?f.next:A.next;!(U=o(D,A)).done;){try{P=y(U.value)}catch(k){c(A,"throw",k)}if(typeof P=="object"&&P&&l(d,P))return P}return new u(!1)}},{"../internals/an-object":227,"../internals/function-bind-context":262,"../internals/function-call":264,"../internals/get-iterator":271,"../internals/get-iterator-method":270,"../internals/is-array-iterator-method":283,"../internals/iterator-close":294,"../internals/length-of-array-like":299,"../internals/object-is-prototype-of":314,"../internals/try-to-string":349}],294:[function(s,T,S){var m=s("../internals/function-call"),o=s("../internals/an-object"),a=s("../internals/get-method");T.exports=function(r,t,e){var l,n;o(r);try{if(!(l=a(r,"return"))){if(t==="throw")throw e;return e}l=m(l,r)}catch(i){n=!0,l=i}if(t==="throw")throw e;if(n)throw l;return o(l),e}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(s,T,S){var m=s("../internals/iterators-core").IteratorPrototype,o=s("../internals/object-create"),a=s("../internals/create-property-descriptor"),r=s("../internals/set-to-string-tag"),t=s("../internals/iterators"),e=function(){return this};T.exports=function(l,n,i,c){var h=n+" Iterator";return l.prototype=o(m,{next:a(+!c,i)}),r(l,h,!1,!0),t[h]=e,l}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(s,T,S){var m=s("../internals/export"),o=s("../internals/function-call"),a=s("../internals/is-pure"),r=s("../internals/function-name"),t=s("../internals/is-callable"),e=s("../internals/iterator-create-constructor"),l=s("../internals/object-get-prototype-of"),n=s("../internals/object-set-prototype-of"),i=s("../internals/set-to-string-tag"),c=s("../internals/create-non-enumerable-property"),h=s("../internals/define-built-in"),u=s("../internals/well-known-symbol"),d=s("../internals/iterators"),f=s("../internals/iterators-core"),w=r.PROPER,_=r.CONFIGURABLE,A=f.IteratorPrototype,N=f.BUGGY_SAFARI_ITERATORS,L=u("iterator"),I=function(){return this};T.exports=function(P,D,U,B,x,M,v){e(U,D,B);var p,b,g,y=function(j){if(j===x&&$)return $;if(!N&&j&&j in O)return O[j];switch(j){case"keys":case"values":case"entries":return function(){return new U(this,j)}}return function(){return new U(this)}},k=D+" Iterator",R=!1,O=P.prototype,z=O[L]||O["@@iterator"]||x&&O[x],$=!N&&z||y(x),W=D==="Array"&&O.entries||z;if(W&&(p=l(W.call(new P)))!==Object.prototype&&p.next&&(a||l(p)===A||(n?n(p,A):t(p[L])||h(p,L,I)),i(p,k,!0,!0),a&&(d[k]=I)),w&&x==="values"&&z&&z.name!=="values"&&(!a&&_?c(O,"name","values"):(R=!0,$=function(){return o(z,this)})),x)if(b={values:y("values"),keys:M?$:y("keys"),entries:y("entries")},v)for(g in b)(N||R||!(g in O))&&h(O,g,b[g]);else m({target:D,proto:!0,forced:N||R},b);return a&&!v||O[L]===$||h(O,L,$,{name:x}),d[D]=$,b}},{"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/export":259,"../internals/function-call":264,"../internals/function-name":265,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/iterator-create-constructor":295,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-get-prototype-of":313,"../internals/object-set-prototype-of":318,"../internals/set-to-string-tag":331,"../internals/well-known-symbol":357}],297:[function(s,T,S){var m,o,a,r=s("../internals/fails"),t=s("../internals/is-callable"),e=s("../internals/is-object"),l=s("../internals/object-create"),n=s("../internals/object-get-prototype-of"),i=s("../internals/define-built-in"),c=s("../internals/well-known-symbol"),h=s("../internals/is-pure"),u=c("iterator"),d=!1;[].keys&&("next"in(a=[].keys())?(o=n(n(a)))!==Object.prototype&&(m=o):d=!0),!e(m)||r(function(){var f={};return m[u].call(f)!==f})?m={}:h&&(m=l(m)),t(m[u])||i(m,u,function(){return this}),T.exports={IteratorPrototype:m,BUGGY_SAFARI_ITERATORS:d}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(s,T,S){arguments[4][276][0].apply(S,arguments)},{dup:276}],299:[function(s,T,S){var m=s("../internals/to-length");T.exports=function(o){return m(o.length)}},{"../internals/to-length":343}],300:[function(s,T,S){var m=s("../internals/function-uncurry-this"),o=s("../internals/fails"),a=s("../internals/is-callable"),r=s("../internals/has-own-property"),t=s("../internals/descriptors"),e=s("../internals/function-name").CONFIGURABLE,l=s("../internals/inspect-source"),n=s("../internals/internal-state"),i=n.enforce,c=n.get,h=String,u=Object.defineProperty,d=m("".slice),f=m("".replace),w=m([].join),_=t&&!o(function(){return u(function(){},"length",{value:8}).length!==8}),A=String(String).split("String"),N=T.exports=function(L,I,P){d(h(I),0,7)==="Symbol("&&(I="["+f(h(I),/^Symbol\(([^)]*)\)/,"$1")+"]"),P&&P.getter&&(I="get "+I),P&&P.setter&&(I="set "+I),(!r(L,"name")||e&&L.name!==I)&&(t?u(L,"name",{value:I,configurable:!0}):L.name=I),_&&P&&r(P,"arity")&&L.length!==P.arity&&u(L,"length",{value:P.arity});try{P&&r(P,"constructor")&&P.constructor?t&&u(L,"prototype",{writable:!1}):L.prototype&&(L.prototype=void 0)}catch{}var D=i(L);return r(D,"source")||(D.source=w(A,typeof I=="string"?I:"")),L};Function.prototype.toString=N(function(){return a(this)&&c(this).source||l(this)},"toString")},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(s,T,S){var m=Math.ceil,o=Math.floor;T.exports=Math.trunc||function(a){var r=+a;return(r>0?o:m)(r)}},{}],302:[function(s,T,S){var m,o,a,r,t,e=s("../internals/global"),l=s("../internals/function-bind-context"),n=s("../internals/object-get-own-property-descriptor").f,i=s("../internals/task").set,c=s("../internals/queue"),h=s("../internals/engine-is-ios"),u=s("../internals/engine-is-ios-pebble"),d=s("../internals/engine-is-webos-webkit"),f=s("../internals/engine-is-node"),w=e.MutationObserver||e.WebKitMutationObserver,_=e.document,A=e.process,N=e.Promise,L=n(e,"queueMicrotask"),I=L&&L.value;if(!I){var P=new c,D=function(){var U,B;for(f&&(U=A.domain)&&U.exit();B=P.get();)try{B()}catch(x){throw P.head&&m(),x}U&&U.enter()};h||f||d||!w||!_?!u&&N&&N.resolve?((r=N.resolve(void 0)).constructor=N,t=l(r.then,r),m=function(){t(D)}):f?m=function(){A.nextTick(D)}:(i=l(i,e),m=function(){i(D)}):(o=!0,a=_.createTextNode(""),new w(D).observe(a,{characterData:!0}),m=function(){a.data=o=!o}),I=function(U){P.head||m(),P.add(U)}}T.exports=I},{"../internals/engine-is-ios":253,"../internals/engine-is-ios-pebble":252,"../internals/engine-is-node":254,"../internals/engine-is-webos-webkit":255,"../internals/function-bind-context":262,"../internals/global":274,"../internals/object-get-own-property-descriptor":309,"../internals/queue":328,"../internals/task":339}],303:[function(s,T,S){var m=s("../internals/a-callable"),o=TypeError,a=function(r){var t,e;this.promise=new r(function(l,n){if(t!==void 0||e!==void 0)throw new o("Bad Promise constructor");t=l,e=n}),this.resolve=m(t),this.reject=m(e)};T.exports.f=function(r){return new a(r)}},{"../internals/a-callable":222}],304:[function(s,T,S){var m=s("../internals/is-regexp"),o=TypeError;T.exports=function(a){if(m(a))throw new o("The method doesn't accept regular expressions");return a}},{"../internals/is-regexp":291}],305:[function(s,T,S){var m=s("../internals/descriptors"),o=s("../internals/function-uncurry-this"),a=s("../internals/function-call"),r=s("../internals/fails"),t=s("../internals/object-keys"),e=s("../internals/object-get-own-property-symbols"),l=s("../internals/object-property-is-enumerable"),n=s("../internals/to-object"),i=s("../internals/indexed-object"),c=Object.assign,h=Object.defineProperty,u=o([].concat);T.exports=!c||r(function(){if(m&&c({b:1},c(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var d={},f={},w=Symbol("assign detection");return d[w]=7,"abcdefghijklmnopqrst".split("").forEach(function(_){f[_]=_}),c({},d)[w]!==7||t(c({},f)).join("")!=="abcdefghijklmnopqrst"})?function(d,f){for(var w=n(d),_=arguments.length,A=1,N=e.f,L=l.f;_>A;)for(var I,P=i(arguments[A++]),D=N?u(t(P),N(P)):t(P),U=D.length,B=0;U>B;)I=D[B++],m&&!a(L,P,I)||(w[I]=P[I]);return w}:c},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/object-get-own-property-symbols":312,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-object":344}],306:[function(s,T,S){var m,o=s("../internals/an-object"),a=s("../internals/object-define-properties"),r=s("../internals/enum-bug-keys"),t=s("../internals/hidden-keys"),e=s("../internals/html"),l=s("../internals/document-create-element"),n=s("../internals/shared-key"),i=n("IE_PROTO"),c=function(){},h=function(f){return"