pdfjs-annotation-extension-for-react 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";const Kt=require("./index-D3SubjD7.cjs");function Ve(xe,Fe){for(var s=0;s<Fe.length;s++){const T=Fe[s];if(typeof T!="string"&&!Array.isArray(T)){for(const S in T)if(S!=="default"&&!(S in xe)){const m=Object.getOwnPropertyDescriptor(T,S);m&&Object.defineProperty(xe,S,m.get?m:{enumerable:!0,get:()=>T[S]})}}}return Object.freeze(Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"}))}function De(xe){throw new Error('Could not dynamically require "'+xe+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ze={exports:{}};var He;function qe(){return He||(He=1,(function(xe,Fe){(function(s){xe.exports=s()})((function(){return(function s(T,S,m){function a(t,e){if(!S[t]){if(!T[t]){var l=typeof De=="function"&&De;if(!e&&l)return l(t,!0);if(o)return o(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(f){return a(T[t][1][f]||f)}),i,i.exports,s,T,S,m)}return S[t].exports}for(var o=typeof De=="function"&&De,r=0;r<m.length;r++)a(m[r]);return a})({1:[function(s,T,S){const m=s("fs"),a=s("fast-csv"),o=s("dayjs/plugin/customParseFormat"),r=s("dayjs/plugin/utc"),t=s("dayjs").extend(o).extend(r),e=s("../utils/stream-buf"),{fs:{exists:l}}=s("../utils/utils"),n={true:!0,false:!1,"#N/A":{error:"#N/A"},"#REF!":{error:"#REF!"},"#NAME?":{error:"#NAME?"},"#DIV/0!":{error:"#DIV/0!"},"#NULL!":{error:"#NULL!"},"#VALUE!":{error:"#VALUE!"},"#NUM!":{error:"#NUM!"}};T.exports=class{constructor(i){this.workbook=i,this.worksheet=null}async readFile(i,f){if(f=f||{},!await l(i))throw new Error("File not found: "+i);const c=m.createReadStream(i),u=await this.read(c,f);return c.close(),u}read(i,f){return f=f||{},new Promise((c,u)=>{const d=this.workbook.addWorksheet(f.sheetName),h=f.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],w=f.map||function(A){if(A==="")return null;const N=Number(A);if(!Number.isNaN(N)&&N!==1/0)return N;const L=h.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},_=a.parse(f.parserOptions).on("data",A=>{d.addRow(A.map(w))}).on("end",()=>{_.emit("worksheet",d)});_.on("worksheet",c).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,f){return new Promise((c,u)=>{f=f||{};const d=this.workbook.getWorksheet(f.sheetName||f.sheetId),h=a.format(f.formatterOptions);i.on("finish",()=>{c()}),h.on("error",u),h.pipe(i);const{dateFormat:w,dateUTC:_}=f,A=f.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=f.includeEmptyRows===void 0||f.includeEmptyRows;let L=1;d&&d.eachRow((I,P)=>{if(N)for(;L++<P-1;)h.write([]);const{values:D}=I;D.shift(),h.write(D.map(A)),L=P}),h.end()})}writeFile(i,f){const c={encoding:(f=f||{}).encoding||"utf8"},u=m.createWriteStream(i,c);return this.write(u,f)}async writeBuffer(i){const f=new e;return await this.write(f,i),f.read()}}},{"../utils/stream-buf":24,"../utils/utils":27,dayjs:391,"dayjs/plugin/customParseFormat":392,"dayjs/plugin/utc":393,"fast-csv":424,fs:216}],2:[function(s,T,S){const m=s("../utils/col-cache");class a{constructor(r,t){let e=arguments.length>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 a||r==null?r:new a(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=a},{"../utils/col-cache":19}],3:[function(s,T,S){const m=s("../utils/col-cache"),a=s("../utils/under-dash"),o=s("./enums"),{slideFormula:r}=s("../utils/shared-formula"),t=s("./note");class e{constructor(i,f,c){if(!i||!f)throw new Error("A Cell needs a Row");this._row=i,this._column=f,m.validateAddress(c),this._address=c,this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(i.style,f.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,f,c){const u=i&&i.numFmt||f&&f.numFmt;u&&(c.numFmt=u);const d=i&&i.font||f&&f.font;d&&(c.font=d);const h=i&&i.alignment||f&&f.alignment;h&&(c.alignment=h);const w=i&&i.border||f&&f.border;w&&(c.border=w);const _=i&&i.fill||f&&f.fill;_&&(c.fill=_);const A=i&&i.protection||f&&f.protection;return A&&(c.protection=A),c}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,f){this._value.release(),this._value=l.create(e.Types.Merge,this,i),f||(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 a.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:f}=this.workbook;f.removeAllNames(this.fullAddress),i.forEach(c=>{f.addEx(this.fullAddress,c)})}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){this._value.release(),this._value=l.create(i.type,this),this._value.model=i,i.comment&&i.comment.type==="note"&&(this._comment=t.fromModel(i.comment)),i.style?this.style=i.style:this.style={}}}e.Types=o.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={},f=c=>{const u=n[c];u&&(i[c]=u)};return f("formula"),f("result"),f("ref"),f("shareType"),f("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?o.FormulaType.Master:this.model.sharedFormula?o.FormulaType.Shared:o.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?o.ValueType.Null:n instanceof String||typeof n=="string"?o.ValueType.String:typeof n=="number"?o.ValueType.Number:n instanceof Date?o.ValueType.Date:n.text&&n.hyperlink?o.ValueType.Hyperlink:n.formula?o.ValueType.Formula:o.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,f){const c=this.types[n];if(!c)throw new Error("Could not create Value of type "+n);return new c(i,f)}};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"),a=s("./enums"),o=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 o.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,f)=>{l(i.getCell(n),f)})}get values(){const e=[];return this.eachCell((l,n)=>{l&&l.type!==a.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,f)=>{this._worksheet.getCell(f+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,f)=>{i.isDefault?n&&(n=null):n&&i.equivalentTo(n)?n.max=f+1:(n={min:f+1,max:f+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,f=0;for(l=(l=l||[]).sort((function(c,u){return c.min-u.min}));f<l.length;){const c=l[f++];for(;i<c.min;)n.push(new r(e,i++));for(;i<=c.max;)n.push(new r(e,i++,c))}return n.length?n:null}}T.exports=r},{"../utils/col-cache":19,"../utils/under-dash":26,"./enums":7}],5:[function(s,T,S){T.exports=class{constructor(m){this.model=m||{}}add(m,a){return this.model[m]=a}find(m){return this.model[m]}remove(m){this.model[m]=void 0}}},{}],6:[function(s,T,S){const m=s("../utils/under-dash"),a=s("../utils/col-cache"),o=s("../utils/cell-matrix"),r=s("./range"),t=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;T.exports=class{constructor(){this.matrixMap={}}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new o)}add(e,l){const n=a.decodeEx(e);this.addEx(n,l)}addEx(e,l){const n=this.getMatrix(l);if(e.top)for(let i=e.left;i<=e.right;i++)for(let f=e.top;f<=e.bottom;f++){const c={sheetName:e.sheetName,address:a.n2l(i)+f,row:f,col:i};n.addCellEx(c)}else n.addCellEx(e)}remove(e,l){const n=a.decodeEx(e);this.removeEx(n,l)}removeEx(e,l){this.getMatrix(l).removeCellEx(e)}removeAllNames(e){m.each(this.matrixMap,l=>{l.removeCellEx(e)})}forEach(e){m.each(this.matrixMap,(l,n)=>{l.forEach(i=>{e(n,i)})})}getNames(e){return this.getNamesEx(a.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 f,c;function u(h,w){const _=e.findCellAt(n,h,l.col);return!(!_||!_.mark)&&(i[w]=h,_.mark=!1,!0)}for(c=l.row-1;u(c,"top");c--);for(c=l.row+1;u(c,"bottom");c++);function d(h,w){const _=[];for(c=i.top;c<=i.bottom;c++){const A=e.findCellAt(n,c,h);if(!A||!A.mark)return!1;_.push(A)}i[w]=h;for(let A=0;A<_.length;A++)_[A].mark=!1;return!0}for(f=l.col-1;d(f,"left");f--);for(f=l.col+1;d(f,"right");f++);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,f)=>{n&&(n.row===i&&n.col===f||(n.row=i,n.col=f,n.address=a.n2l(f)+i))})}spliceRows(e,l,n,i){m.each(this.matrixMap,f=>{f.spliceRows(e,l,n,i),this.normaliseMatrix(f,e)})}spliceColumns(e,l,n,i){m.each(this.matrixMap,f=>{f.spliceColumns(e,l,n,i),this.normaliseMatrix(f,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 o;n.ranges.forEach(f=>{t.test(f.split("!").pop()||"")&&i.addCell(f)})})}}},{"../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"),a=s("./anchor");T.exports=class{constructor(o,r){this.worksheet=o,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(o){let{type:r,imageId:t,range:e,hyperlinks:l}=o;if(this.type=r,this.imageId=t,r==="image")if(typeof e=="string"){const n=m.decode(e);this.range={tl:new a(this.worksheet,{col:n.left,row:n.top},-1),br:new a(this.worksheet,{col:n.right,row:n.bottom},0),editAs:"oneCell"}}else this.range={tl:new a(this.worksheet,e.tl,0),br:e.br&&new a(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 a{constructor(r){this.note=r}get model(){let r=null;return typeof this.note==="string"?r={type:"note",note:{texts:[{text:this.note}]}}:r={type:"note",note:this.note},m.deepMerge({},a.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 a;return t.model=r,t}}a.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},T.exports=a},{"../utils/under-dash":26}],10:[function(s,T,S){const m=s("../utils/col-cache");class a{constructor(){this.decode(arguments)}setTLBR(r,t,e,l,n){if(arguments.length<4){const i=m.decodeAddress(r),f=m.decodeAddress(t);this.model={top:Math.min(i.row,f.row),left:Math.min(i.col,f.col),bottom:Math.max(i.row,f.row),right:Math.max(i.col,f.col),sheetName:e},this.setTLBR(i.row,i.col,f.row,f.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 a)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||r<this.top)&&(this.top=r),(!this.model.left||t<this.left)&&(this.left=t),(!this.model.bottom||e>this.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.bottom<this.top)&&!(r.top>this.bottom)&&!(r.right<this.left)&&!(r.left>this.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=a},{"../utils/col-cache":19}],11:[function(s,T,S){const m=s("../utils/under-dash"),a=s("./enums"),o=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:o.l2n(t)}return this._cells[t-1]||this.getCellEx({address:o.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),f=2;f<n;f++)i[f-2]=arguments[f];const c=i.length-e,u=this._cells.length;let d,h,w;if(c<0)for(d=t+i.length;d<=u;d++)w=this._cells[d-1],h=this._cells[d-c-1],h?(w=this.getCell(d),w.value=h.value,w.style=h.style,w._comment=h._comment):w&&(w.value=null,w.style={},w._comment=void 0);else if(c>0)for(d=u;d>=l;d--)h=this._cells[d-1],h?(w=this.getCell(d+c),w.value=h.value,w.style=h.style,w._comment=h._comment):this._cells[d+c-1]=void 0;for(d=0;d<i.length;d++)w=this.getCell(t+d),w.value=i[d],w.style={},w._comment=void 0}eachCell(t,e){if(e||(e=t,t=null),t&&t.includeEmpty){const l=this._cells.length;for(let n=1;n<=l;n++)e(this.getCell(n),n)}else this._cells.forEach((l,n)=>{l&&l.type!==a.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,f={id:this._number,max:i,man:1};n&&(f.min=n),l.rowBreaks.push(f)}get values(){const t=[];return this._cells.forEach(e=>{e&&e.type!==a.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:o.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:o.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!==a.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!==a.ValueType.Null&&((!t||t>l.col)&&(t=l.col),e<l.col&&(e=l.col))}),t>0?{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<n.col&&(l=n.col),t.push(i))}}),this.height||t.length?{cells:t,number:this.number,min:e,max:l,height:this.height,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed}:null}set model(t){if(t.number!==this._number)throw new Error("Invalid row number in model");let e;this._cells=[],t.cells.forEach(l=>{switch(l.type){case r.Types.Merge:break;default:{let n;if(l.address)n=o.decodeAddress(l.address);else if(e){const{row:i}=e,f=e.col+1;n={row:i,col:f,address:o.encodeAddress(i,f),$col$row:`$${o.n2l(f)}$${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 a{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(o,r){this.worksheet=o,r&&(this.table=r,this.validate(),this.store())}getFormula(o){switch(o.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${o.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${o.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${o.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${o.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${o.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${o.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${o.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${o.name}])`;case"custom":return o.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+o.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:o}=this,r=(c,u,d)=>{c[u]===void 0&&(c[u]=d)};r(o,"headerRow",!0),r(o,"totalsRow",!1),r(o,"style",{}),r(o.style,"theme","TableStyleMedium2"),r(o.style,"showFirstColumn",!1),r(o.style,"showLastColumn",!1),r(o.style,"showRowStripes",!1),r(o.style,"showColumnStripes",!1);const t=(c,u)=>{if(!c)throw new Error(u)};t(o.ref,"Table must have ref"),t(o.columns,"Table must have column definitions"),t(o.rows,"Table must have row definitions"),o.tl=m.decodeAddress(o.ref);const{row:e,col:l}=o.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:f}=this;o.autoFilterRef=m.encode(e,l,e+i-1,l+n-1),o.tableRef=m.encode(e,l,e+f-1,l+n-1),o.columns.forEach((c,u)=>{t(c.name,`Column ${u} must have a name`),u===0?r(c,"totalsRowLabel","Total"):(r(c,"totalsRowFunction","none"),c.totalsRowFormula=this.getFormula(c))})}store(){const o=(i,f)=>{f&&Object.keys(f).forEach(c=>{i[c]=f[c]})},{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((f,c)=>{const{style:u,name:d}=f,h=i.getCell(l+c);h.value=d,o(h,u)})}if(t.rows.forEach(i=>{const f=r.getRow(e+n++);i.forEach((c,u)=>{const d=f.getCell(l+u);d.value=c,o(d,t.columns[u].style)})}),t.totalsRow){const i=r.getRow(e+n++);t.columns.forEach((f,c)=>{const u=i.getCell(l+c);if(c===0)u.value=f.totalsRowLabel;else{const d=this.getFormula(f);u.value=d?{formula:f.totalsRowFormula,result:f.totalsRowResult}:null}o(u,f.style)})}}load(o){const{table:r}=this,{row:t,col:e}=r.tl;let l=0;if(r.headerRow){const n=o.getRow(t+l++);r.columns.forEach((i,f)=>{n.getCell(e+f).value=i.name})}if(r.rows.forEach(n=>{const i=o.getRow(t+l++);n.forEach((f,c)=>{i.getCell(e+c).value=f})}),r.totalsRow){const n=o.getRow(t+l++);r.columns.forEach((i,f)=>{const c=n.getCell(e+f);f===0?c.value=i.totalsRowLabel:this.getFormula(i)&&(c.value={formula:i.totalsRowFormula,result:i.totalsRowResult})})}}get model(){return this.table}set model(o){this.table=o}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const o=m.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let r=0;r<this._cache.tableHeight;r++){const t=this.worksheet.getRow(o.row+r);for(let e=0;e<this._cache.width;e++)t.getCell(o.col+e).value=null}else{for(let r=this.tableHeight;r<this._cache.tableHeight;r++){const t=this.worksheet.getRow(o.row+r);for(let e=0;e<this._cache.width;e++)t.getCell(o.col+e).value=null}for(let r=0;r<this.tableHeight;r++){const t=this.worksheet.getRow(o.row+r);for(let e=this.width;e<this._cache.width;e++)t.getCell(o.col+e).value=null}}this.store()}addRow(o,r){this.cacheState(),r===void 0?this.table.rows.push(o):this.table.rows.splice(r,0,o)}removeRows(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(o,r)}getColumn(o){const r=this.table.columns[o];return new a(this,r,o)}addColumn(o,r,t){this.cacheState(),t===void 0?(this.table.columns.push(o),this.table.rows.forEach((e,l)=>{e.push(r[l])})):(this.table.columns.splice(t,0,o),this.table.rows.forEach((e,l)=>{e.splice(t,0,r[l])}))}removeColumns(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(o,r),this.table.rows.forEach(t=>{t.splice(o,r)})}_assign(o,r,t){this.cacheState(),o[r]=t}get ref(){return this.table.ref}set ref(o){this._assign(this.table,"ref",o)}get name(){return this.table.name}set name(o){this.table.name=o}get displayName(){return this.table.displyName||this.table.name}set displayNamename(o){this.table.displayName=o}get headerRow(){return this.table.headerRow}set headerRow(o){this._assign(this.table,"headerRow",o)}get totalsRow(){return this.table.totalsRow}set totalsRow(o){this._assign(this.table,"totalsRow",o)}get theme(){return this.table.style.name}set theme(o){this.table.style.name=o}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(o){this.table.style.showFirstColumn=o}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(o){this.table.style.showLastColumn=o}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(o){this.table.style.showRowStripes=o}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(o){this.table.style.showColumnStripes=o}}},{"../utils/col-cache":19}],13:[function(s,T,S){const m=s("./worksheet"),a=s("./defined-names"),o=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 a}get xlsx(){return this._xlsx||(this._xlsx=new o(this)),this._xlsx}get csv(){return this._csv||(this._csv=new r(this)),this._csv}get nextId(){for(let t=1;t<this._worksheets.length;t++)if(!this._worksheets[t])return t;return this._worksheets.length||1}addWorksheet(t,e){const l=this.nextId;e&&(typeof e=="string"?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),e={properties:{tabColor:{argb:e}}}):(e.argb||e.theme||e.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),e={properties:{tabColor:e}}));const n=this._worksheets.reduce((c,u)=>(u&&u.orderNo)>c?u.orderNo:c,0),i=Object.assign({},e,{id:l,name:t,orderNo:n+1,workbook:this}),f=new m(i);return this._worksheets[l]=f,f}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,f=t.sheets&&t.sheets.findIndex(c=>c.id===l);(this._worksheets[l]=new m({id:l,name:n,orderNo:f,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"),a=s("../utils/col-cache"),o=s("./range"),r=s("./row"),t=s("./column"),e=s("./enums"),l=s("./image"),n=s("./table"),i=s("./data-validations"),f=s("../utils/encryptor"),{copyStyle:c}=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 o;return this._rows.forEach(d=>{if(d){const h=d.dimensions;h&&u.expand(d.number,h.min,d.number,h.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 h=this._columns=[];u.forEach(w=>{const _=new t(this,d++,!1);h.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=a.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 h=this._rows.length;for(var w=arguments.length,_=new Array(w>2?w-2:0),A=2;A<w;A++)_[A-2]=arguments[A];if(_.length>0)for(let P=0;P<h;P++){const D=[u,d];_.forEach(B=>{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+_.length;P++)this.getColumn(P).defn=null;this.workbook.definedNames.spliceColumns(this.name,u,d,_.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let u=0;return this.eachRow(d=>{u=Math.max(u,d.cellCount)}),u}get actualColumnCount(){const u=[];let d=0;return this.eachRow(h=>{h.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 h=[];for(let w=u;w<u+d;w++)h.push(this.getRow(w));return h}addRow(u){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const h=this._nextRow,w=this.getRow(h);return w.values=u,this._setStyleOption(h,d[0]==="i"?d:"n"),w}addRows(u){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const h=[];return u.forEach(w=>{h.push(this.addRow(w,d))}),h}insertRow(u,d){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(u,0,d),this._setStyleOption(u,h),this.getRow(u)}insertRows(u,d){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(u,0,...d),h!=="n")for(let w=0;w<d.length;w++)h[0]==="o"&&this.findRow(d.length+u+w)!==void 0?this._copyStyle(d.length+u+w,u+w,h[1]==="+"):h[0]==="i"&&this.findRow(u-1)!==void 0&&this._copyStyle(u-1,u+w,h[1]==="+");return this.getRows(u,d.length)}_setStyleOption(u){let d=arguments.length>1&&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 h=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this.getRow(u),_=this.getRow(d);_.style=c(w.style),w.eachCell({includeEmpty:h},(A,N)=>{_.getCell(N).style=c(A.style)}),_.height=w.height}duplicateRow(u,d){let h=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,h?0:d,..._);for(let A=0;A<d;A++){const N=this._rows[u+A];N.style=w.style,N.height=w.height,w.eachCell({includeEmpty:!0},(L,I)=>{N.getCell(I).style=L.style})}}spliceRows(u,d){const h=u+d;for(var w=arguments.length,_=new Array(w>2?w-2:0),A=2;A<w;A++)_[A-2]=arguments[A];const N=_.length,L=N-d,I=this._rows.length;let P,D;if(L<0)for(u===I&&(this._rows[I-1]=void 0),P=h;P<=I;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)=>{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>=h;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<N;P++){const U=this.getRow(u+P);U.style={},U.values=_[P]}this.workbook.definedNames.spliceRows(this.name,u,d,N)}eachRow(u,d){if(d||(d=u,u=void 0),u&&u.includeEmpty){const h=this._rows.length;for(let w=1;w<=h;w++)d(this.getRow(w),w)}else this._rows.forEach(h=>{h&&h.hasValues&&d(h,h.number)})}getSheetValues(){const u=[];return this._rows.forEach(d=>{d&&(u[d.number]=d.values)}),u}findCell(u,d){const h=a.getAddress(u,d),w=this._rows[h.row-1];return w?w.findCell(h.col):void 0}getCell(u,d){const h=a.getAddress(u,d);return this.getRow(h.row).getCellEx(h)}mergeCells(){for(var u=arguments.length,d=new Array(u),h=0;h<u;h++)d[h]=arguments[h];const w=new o(d);this._mergeCellsInternal(w)}mergeCellsWithoutStyle(){for(var u=arguments.length,d=new Array(u),h=0;h<u;h++)d[h]=arguments[h];const w=new o(d);this._mergeCellsInternal(w,!0)}_mergeCellsInternal(u,d){m.each(this._merges,w=>{if(w.intersects(u))throw new Error("Cannot merge already merged cells")});const h=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(h,d);this._merges[h.address]=u}_unMergeMaster(u){const d=this._merges[u.address];if(d){for(let h=d.top;h<=d.bottom;h++)for(let w=d.left;w<=d.right;w++)this.getCell(h,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),h=0;h<u;h++)d[h]=arguments[h];const w=new o(d);for(let _=w.top;_<=w.bottom;_++)for(let A=w.left;A<=w.right;A++){const N=this.findCell(_,A);N&&(N.type===e.ValueType.Merge?this._unMergeMaster(N.master):this._merges[N.address]&&this._unMergeMaster(N))}}fillFormula(u,d,h){let w=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"shared";const _=a.decode(u),{top:A,left:N,bottom:L,right:I}=_,P=I-N+1,D=a.encodeAddress(A,N),U=w==="shared";let B;B=typeof h=="function"?h:Array.isArray(h)?Array.isArray(h[0])?(M,v)=>h[M-A][v-N]:(M,v)=>h[(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 h={type:"image",imageId:u,range:d};this._media.push(new l(this,h))}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(h=>{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=f.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=d&&"spinCount"in d?d.spinCount:1e5,this.sheetProtection.hashValue=f.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),h()})}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=[],h=u.dimensions=new o;return this._rows.forEach(w=>{const _=w&&w.model;_&&(h.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 h=new r(this,d.number);this._rows[h.number-1]=h,h.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,h)=>{const w=new n;return w.model=h,d[h.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")},a=s("./doc/enums");Object.keys(a).forEach(o=>{m[o]=a[o]}),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(a){return typeof a=="string"?a:m?m.decode(a):a.toString()}},{}],17:[function(s,T,S){const m=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:a}=s("buffer");S.stringToBuffer=function(o){return typeof o!="string"?o:m?a.from(m.encode(o).buffer):a.from(o)}},{buffer:220}],18:[function(s,T,S){const m=s("./under-dash"),a=s("./col-cache");T.exports=class{constructor(o){this.template=o,this.sheets={}}addCell(o){this.addCellEx(a.decodeEx(o))}getCell(o){return this.findCellEx(a.decodeEx(o),!0)}findCell(o){return this.findCellEx(a.decodeEx(o),!1)}findCellAt(o,r,t){const e=this.sheets[o],l=e&&e[r];return l&&l[t]}addCellEx(o){if(o.top)for(let r=o.top;r<=o.bottom;r++)for(let t=o.left;t<=o.right;t++)this.getCellAt(o.sheetName,r,t);else this.findCellEx(o,!0)}getCellEx(o){return this.findCellEx(o,!0)}findCellEx(o,r){const t=this.findSheet(o,r),e=this.findSheetRow(t,o,r);return this.findRowCell(e,o,r)}getCellAt(o,r,t){const e=this.sheets[o]||(this.sheets[o]=[]),l=e[r]||(e[r]=[]);return l[t]||(l[t]={sheetName:o,address:a.n2l(t)+r,row:r,col:t})}removeCellEx(o){const r=this.findSheet(o);if(!r)return;const t=this.findSheetRow(r,o);t&&delete t[o.col]}forEachInSheet(o,r){const t=this.sheets[o];t&&t.forEach((e,l)=>{e&&e.forEach((n,i)=>{n&&r(n,l,i)})})}forEach(o){m.each(this.sheets,(r,t)=>{this.forEachInSheet(t,o)})}map(o){const r=[];return this.forEach(t=>{r.push(o(t))}),r}findSheet(o,r){const t=o.sheetName;return this.sheets[t]?this.sheets[t]:r?this.sheets[t]=[]:void 0}findSheetRow(o,r,t){const{row:e}=r;return o&&o[e]?o[e]:t?o[e]=[]:void 0}findRowCell(o,r,t){const{col:e}=r;return o&&o[e]?o[e]:t?o[e]=this.template?Object.assign(r,JSON.parse(JSON.stringify(this.template))):r:void 0}spliceRows(o,r,t,e){const l=this.sheets[o];if(l){const n=[];for(let i=0;i<e;i++)n.push([]);l.splice(r,t,...n)}}spliceColumns(o,r,t,e){const l=this.sheets[o];if(l){const n=[];for(let i=0;i<e;i++)n.push(null);m.each(l,i=>{i.splice(r,t,...n)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(s,T,S){const m=/^[A-Z]+\d+$/,a={_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:o=>o<=26?1:o<=676?2:3,_fill(o){let r,t,e,l,n,i=1;if(o>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&o>=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&&o>=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&&o>=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(o){if(this._l2n[o]||this._fill(o.length),!this._l2n[o])throw new Error("Out of bounds. Invalid column letter: "+o);return this._l2n[o]},n2l(o){if(o<1||o>16384)throw new Error(o+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[o]||this._fill(this._level(o)),this._n2l[o]},_hash:{},validateAddress(o){if(!m.test(o))throw new Error("Invalid Address: "+o);return!0},decodeAddress(o){const r=o.length<5&&this._hash[o];if(r)return r;let t=!1,e="",l=0,n=!1,i="",f=0;for(let u,d=0;d<o.length;d++)if(u=o.charCodeAt(d),!n&&u>=65&&u<=90)t=!0,e+=o[d],l=26*l+u-64;else if(u>=48&&u<=57)n=!0,i+=o[d],f=10*f+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||(f=void 0);const c={address:o=e+i,col:l,row:f,$col$row:`$${e}$${i}`};return l<=100&&f<=100&&(this._hash[o]=c,this._hash[c.$col$row]=c),c},getAddress(o,r){if(r){const t=this.n2l(r)+o;return this.decodeAddress(t)}return this.decodeAddress(o)},decode(o){const r=o.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(o)},decodeEx(o){const r=o.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=r[1]||r[2],e=r[3],l=e.split(":");if(l.length>1){let i=this.decodeAddress(l[0]),f=this.decodeAddress(l[1]);const c=Math.min(i.row,f.row),u=Math.min(i.col,f.col),d=Math.max(i.row,f.row),h=Math.max(i.col,f.col);return i=this.n2l(u)+c,f=this.n2l(h)+d,{top:c,left:u,bottom:d,right:h,sheetName:t,tl:{address:i,col:u,row:c,$col$row:`$${this.n2l(u)}$${c}`,sheetName:t},br:{address:f,col:h,row:d,$col$row:`$${this.n2l(h)}$${d}`,sheetName:t},dimensions:`${i}:${f}`}}if(e.startsWith("#"))return t?{sheetName:t,error:e}:{error:e};const n=this.decodeAddress(e);return t?{sheetName:t,...n}:n},encodeAddress:(o,r)=>a.n2l(r)+o,encode(){switch(arguments.length){case 2:return a.encodeAddress(arguments[0],arguments[1]);case 4:return`${a.encodeAddress(arguments[0],arguments[1])}:${a.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(o,r){const[t,e,,l,n]=o,[i,f]=r;return i>=t&&i<=l&&f>=e&&f<=n}};T.exports=a},{}],20:[function(s,T,S){const m=(o,r)=>({...o,...r.reduce((t,e)=>(o[e]&&(t[e]={...o[e]}),t),{})}),a=function(o,r,t){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];o[t]&&(r[t]=m(o[t],e))};S.copyStyle=o=>{if(!o)return o;if(r=o,Object.keys(r).length===0)return{};var r;const t={...o};return a(o,t,"font",["color"]),a(o,t,"alignment"),a(o,t,"protection"),o.border&&(a(o,t,"border"),a(o.border,t.border,"top",["color"]),a(o.border,t.border,"left",["color"]),a(o.border,t.border,"bottom",["color"]),a(o.border,t.border,"right",["color"]),a(o.border,t.border,"diagonal",["color"])),o.fill&&(a(o,t,"fill",["fgColor","bgColor","center"]),o.fill.stops&&(t.fill.stops=o.fill.stops.map(e=>m(e,["color"])))),t}},{}],21:[function(s,T,S){(function(m){(function(){const a=s("crypto"),o={hash(r){const t=a.createHash(r);for(var e=arguments.length,l=new Array(e>1?e-1:0),n=1;n<e;n++)l[n-1]=arguments[n];return t.update(m.concat(l)),t.digest()},convertPasswordToHash(r,t,e,l){if(t=t.toLowerCase(),a.getHashes().indexOf(t)<0)throw new Error(`Hash algorithm '${t}' not supported!`);const n=m.from(r,"utf16le");let i=this.hash(t,m.from(e,"base64"),n);for(let f=0;f<l;f++){const c=m.alloc(4);c.writeUInt32LE(f,0),i=this.hash(t,i,c)}return i.toString("base64")},randomBytes:r=>a.randomBytes(r)};T.exports=o}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(s,T,S){const{SaxesParser:m}=s("saxes"),{PassThrough:a}=s("readable-stream"),{bufferToString:o}=s("./browser-buffer-decode");T.exports=async function*(r){r.pipe&&!r[Symbol.asyncIterator]&&(r=r.pipe(new a));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(o(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"),a=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,o=/^([$])?([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(a,(i,f,c,u,d)=>{if(d)return i;const h=o.exec(u);if(h){const w=h[1],_=h[2].toUpperCase(),A=h[3],N=h[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),(f||"")+(w||"")+m.n2l(L)+(A||"")+I}return i})}}},{"./col-cache":19}],24:[function(s,T,S){(function(m,a){(function(){const o=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,h,w){return this.toBuffer().copy(u,d,h,w)}toBuffer(){return this._buffer||(this._buffer=a.from(this._data,this._encoding)),this._buffer}}class l{constructor(u){this._data=u}get length(){return this._data.length}copy(u,d,h,w){return this._data._buf.copy(u,d,h,w)}toBuffer(){return this._data.toBuffer()}}class n{constructor(u){this._data=u}get length(){return this._data.length}copy(u,d,h,w){this._data.copy(u,d,h,w)}toBuffer(){return this._data}}class i{constructor(u){this.size=u,this.buffer=a.alloc(u),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const u=a.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=a.alloc(u),this.buffer.copy(d,0,this.iRead,u),this.iRead+=u,d)}write(u,d,h){const w=Math.min(h,this.size-this.iWrite);return u.copy(this.buffer,this.iWrite,d,d+w),this.iWrite+=w,w}}const f=function(c){c=c||{},this.bufSize=c.bufSize||1048576,this.buffers=[],this.batch=c.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};r.inherits(f,o.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return a.concat(this.buffers.map(c=>c.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const u=this.buffers[this.buffers.length-1];if(!u.full)return u}const c=new i(this.bufSize);return this.buffers.push(c),c},async _pipe(c){await Promise.all(this.pipes.map((function(u){return new Promise(d=>{u.write(c.toBuffer(),()=>{d()})})})))},_writeToBuffers(c){let u=0;const d=c.length;for(;u<d;)u+=this._getWritableBuffer().write(c,u,d-u)},async write(c,u,d){let h;if(u instanceof Function&&(d=u,u="utf8"),d=d||r.nop,c instanceof t)h=new l(c);else if(c instanceof a)h=new n(c);else{if(!(typeof c=="string"||c instanceof String||c instanceof ArrayBuffer))throw new Error("Chunk must be one of type String, Buffer or StringBuf.");h=new e(c,u)}if(this.pipes.length)if(this.batch)for(this._writeToBuffers(h);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(h),m.nextTick(d)):(await this._pipe(h),d());else this.paused||this.emit("data",h.toBuffer()),this._writeToBuffers(h),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(c,u,d){const h=w=>{w?d(w):(this._flush(),this.pipes.forEach(_=>{_.end()}),this.emit("finish"))};c?this.write(c,u,h):h()},read(c){let u;if(c){for(u=[];c&&this.buffers.length&&!this.buffers[0].eod;){const d=this.buffers[0],h=d.read(c);c-=h.length,u.push(h),d.eod&&d.full&&this.buffers.shift()}return a.concat(u)}return u=this.buffers.map(d=>d.toBuffer()).filter(Boolean),this.buffers=[],a.concat(u)},setEncoding(c){this.encoding=c},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(c){this.pipes.push(c),!this.paused&&this.buffers.length&&this.end()},unpipe(c){this.pipes=this.pipes.filter(u=>u!==c)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),T.exports=f}).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(a){this._buf=m.alloc(a&&a.size||16384),this._encoding=a&&a.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(a){a=a||0,this._buffer=void 0,this._inPos=a}_grow(a){let o=2*this._buf.length;for(;o<a;)o*=2;const r=m.alloc(o);this._buf.copy(r,0),this._buf=r}addText(a){this._buffer=void 0;let o=this._inPos+this._buf.write(a,this._inPos,this._encoding);for(;o>=this._buf.length-4;)this._grow(this._inPos+a.length),o=this._inPos+this._buf.write(a,this._inPos,this._encoding);this._inPos=o}addStringBuf(a){a.length&&(this._buffer=void 0,this.length+a.length>this.capacity&&this._grow(this.length+a.length),a._buf.copy(this._buf,this._inPos,0,a.length),this._inPos+=a.length)}}}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220}],26:[function(s,T,S){const{toString:m}=Object.prototype,a=/["&<>]/,o={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 f;if(e!==l)return!1;switch(typeof r){case"object":if(n||i)return!(!n||!i)&&r.length===t.length&&r.every((c,u)=>{const d=t[u];return o.isEqual(c,d)});if(r===null||t===null)return r===t;if(f=Object.keys(r),Object.keys(t).length!==f.length)return!1;for(const c of f)if(!t.hasOwnProperty(c))return!1;return o.every(r,(c,u)=>{const d=t[u];return o.isEqual(c,d)});default:return r===t}},escapeHtml(r){const t=a.exec(r);if(!t)return r;let e="",l="",n=0,i=t.index;for(;i<r.length;i++){switch(r.charAt(i)){case'"':l="&quot;";break;case"&":l="&amp;";break;case"'":l="&apos;";break;case"<":l="&lt;";break;case">":l="&gt;";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)=>r<t?-1:r>t?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(f,c){e=r[c],n=Array.isArray(f),o.isObject(f)||n?(n?(n=!1,l=e&&Array.isArray(e)?e:[]):l=e&&o.isObject(e)?e:{},r[c]=o.deepMerge(l,f)):o.isUndefined(f)||(r[c]=f)}for(let f=0;f<t;f++)o.each(arguments[f],i);return r}};T.exports=o},{}],27:[function(s,T,S){(function(m,a){(function(){const o=s("fs"),r=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:e=>new Promise(l=>{m.setImmediate?a(()=>{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(c=>{Object.defineProperty(e,c,Object.getOwnPropertyDescriptor(n,c))});const f={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};i&&Object.keys(i).forEach(c=>{f[c]=Object.getOwnPropertyDescriptor(i,c)}),e.prototype=Object.create(l.prototype,f)},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="",f=0,c=l.index;for(;c<e.length;c++){const u=e.charCodeAt(c);switch(u){case 34:i="&quot;";break;case 38:i="&amp;";break;case 39:i="&apos;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;case 127:i="";break;default:if(u<=31&&(u<=8||u>=11&&u!==13)){i="";break}continue}f!==c&&(n+=e.substring(f,c)),f=c+1,i&&(n+=i)}return f!==c?n+e.substring(f,c):n},xmlDecode:e=>e.replace(/&([a-z]*);/g,l=>{switch(l){case"&lt;":return"<";case"&gt;":return">";case"&amp;":return"&";case"&apos;":return"'";case"&quot;":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=>{o.access(e,o.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.commonjsGlobal<"u"?Kt.commonjsGlobal: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"),a=s("./utils");function o(e,l,n){e.push(` ${l}="${a.xmlEncode(n.toString())}"`)}function r(e,l){if(l){const n=[];m.each(l,(i,f)=>{i!==void 0&&o(n,f,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("<?xml"),r(n,l),n.push(`?>
1
+ "use strict";const Kt=require("./index-BII1amVb.cjs");function Ve(xe,Fe){for(var s=0;s<Fe.length;s++){const T=Fe[s];if(typeof T!="string"&&!Array.isArray(T)){for(const S in T)if(S!=="default"&&!(S in xe)){const m=Object.getOwnPropertyDescriptor(T,S);m&&Object.defineProperty(xe,S,m.get?m:{enumerable:!0,get:()=>T[S]})}}}return Object.freeze(Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"}))}function De(xe){throw new Error('Could not dynamically require "'+xe+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ze={exports:{}};var He;function qe(){return He||(He=1,(function(xe,Fe){(function(s){xe.exports=s()})((function(){return(function s(T,S,m){function a(t,e){if(!S[t]){if(!T[t]){var l=typeof De=="function"&&De;if(!e&&l)return l(t,!0);if(o)return o(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(f){return a(T[t][1][f]||f)}),i,i.exports,s,T,S,m)}return S[t].exports}for(var o=typeof De=="function"&&De,r=0;r<m.length;r++)a(m[r]);return a})({1:[function(s,T,S){const m=s("fs"),a=s("fast-csv"),o=s("dayjs/plugin/customParseFormat"),r=s("dayjs/plugin/utc"),t=s("dayjs").extend(o).extend(r),e=s("../utils/stream-buf"),{fs:{exists:l}}=s("../utils/utils"),n={true:!0,false:!1,"#N/A":{error:"#N/A"},"#REF!":{error:"#REF!"},"#NAME?":{error:"#NAME?"},"#DIV/0!":{error:"#DIV/0!"},"#NULL!":{error:"#NULL!"},"#VALUE!":{error:"#VALUE!"},"#NUM!":{error:"#NUM!"}};T.exports=class{constructor(i){this.workbook=i,this.worksheet=null}async readFile(i,f){if(f=f||{},!await l(i))throw new Error("File not found: "+i);const c=m.createReadStream(i),u=await this.read(c,f);return c.close(),u}read(i,f){return f=f||{},new Promise((c,u)=>{const d=this.workbook.addWorksheet(f.sheetName),h=f.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],w=f.map||function(A){if(A==="")return null;const N=Number(A);if(!Number.isNaN(N)&&N!==1/0)return N;const L=h.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},_=a.parse(f.parserOptions).on("data",A=>{d.addRow(A.map(w))}).on("end",()=>{_.emit("worksheet",d)});_.on("worksheet",c).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,f){return new Promise((c,u)=>{f=f||{};const d=this.workbook.getWorksheet(f.sheetName||f.sheetId),h=a.format(f.formatterOptions);i.on("finish",()=>{c()}),h.on("error",u),h.pipe(i);const{dateFormat:w,dateUTC:_}=f,A=f.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=f.includeEmptyRows===void 0||f.includeEmptyRows;let L=1;d&&d.eachRow((I,P)=>{if(N)for(;L++<P-1;)h.write([]);const{values:D}=I;D.shift(),h.write(D.map(A)),L=P}),h.end()})}writeFile(i,f){const c={encoding:(f=f||{}).encoding||"utf8"},u=m.createWriteStream(i,c);return this.write(u,f)}async writeBuffer(i){const f=new e;return await this.write(f,i),f.read()}}},{"../utils/stream-buf":24,"../utils/utils":27,dayjs:391,"dayjs/plugin/customParseFormat":392,"dayjs/plugin/utc":393,"fast-csv":424,fs:216}],2:[function(s,T,S){const m=s("../utils/col-cache");class a{constructor(r,t){let e=arguments.length>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 a||r==null?r:new a(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=a},{"../utils/col-cache":19}],3:[function(s,T,S){const m=s("../utils/col-cache"),a=s("../utils/under-dash"),o=s("./enums"),{slideFormula:r}=s("../utils/shared-formula"),t=s("./note");class e{constructor(i,f,c){if(!i||!f)throw new Error("A Cell needs a Row");this._row=i,this._column=f,m.validateAddress(c),this._address=c,this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(i.style,f.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,f,c){const u=i&&i.numFmt||f&&f.numFmt;u&&(c.numFmt=u);const d=i&&i.font||f&&f.font;d&&(c.font=d);const h=i&&i.alignment||f&&f.alignment;h&&(c.alignment=h);const w=i&&i.border||f&&f.border;w&&(c.border=w);const _=i&&i.fill||f&&f.fill;_&&(c.fill=_);const A=i&&i.protection||f&&f.protection;return A&&(c.protection=A),c}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,f){this._value.release(),this._value=l.create(e.Types.Merge,this,i),f||(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 a.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:f}=this.workbook;f.removeAllNames(this.fullAddress),i.forEach(c=>{f.addEx(this.fullAddress,c)})}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){this._value.release(),this._value=l.create(i.type,this),this._value.model=i,i.comment&&i.comment.type==="note"&&(this._comment=t.fromModel(i.comment)),i.style?this.style=i.style:this.style={}}}e.Types=o.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={},f=c=>{const u=n[c];u&&(i[c]=u)};return f("formula"),f("result"),f("ref"),f("shareType"),f("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?o.FormulaType.Master:this.model.sharedFormula?o.FormulaType.Shared:o.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?o.ValueType.Null:n instanceof String||typeof n=="string"?o.ValueType.String:typeof n=="number"?o.ValueType.Number:n instanceof Date?o.ValueType.Date:n.text&&n.hyperlink?o.ValueType.Hyperlink:n.formula?o.ValueType.Formula:o.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,f){const c=this.types[n];if(!c)throw new Error("Could not create Value of type "+n);return new c(i,f)}};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"),a=s("./enums"),o=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 o.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,f)=>{l(i.getCell(n),f)})}get values(){const e=[];return this.eachCell((l,n)=>{l&&l.type!==a.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,f)=>{this._worksheet.getCell(f+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,f)=>{i.isDefault?n&&(n=null):n&&i.equivalentTo(n)?n.max=f+1:(n={min:f+1,max:f+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,f=0;for(l=(l=l||[]).sort((function(c,u){return c.min-u.min}));f<l.length;){const c=l[f++];for(;i<c.min;)n.push(new r(e,i++));for(;i<=c.max;)n.push(new r(e,i++,c))}return n.length?n:null}}T.exports=r},{"../utils/col-cache":19,"../utils/under-dash":26,"./enums":7}],5:[function(s,T,S){T.exports=class{constructor(m){this.model=m||{}}add(m,a){return this.model[m]=a}find(m){return this.model[m]}remove(m){this.model[m]=void 0}}},{}],6:[function(s,T,S){const m=s("../utils/under-dash"),a=s("../utils/col-cache"),o=s("../utils/cell-matrix"),r=s("./range"),t=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;T.exports=class{constructor(){this.matrixMap={}}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new o)}add(e,l){const n=a.decodeEx(e);this.addEx(n,l)}addEx(e,l){const n=this.getMatrix(l);if(e.top)for(let i=e.left;i<=e.right;i++)for(let f=e.top;f<=e.bottom;f++){const c={sheetName:e.sheetName,address:a.n2l(i)+f,row:f,col:i};n.addCellEx(c)}else n.addCellEx(e)}remove(e,l){const n=a.decodeEx(e);this.removeEx(n,l)}removeEx(e,l){this.getMatrix(l).removeCellEx(e)}removeAllNames(e){m.each(this.matrixMap,l=>{l.removeCellEx(e)})}forEach(e){m.each(this.matrixMap,(l,n)=>{l.forEach(i=>{e(n,i)})})}getNames(e){return this.getNamesEx(a.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 f,c;function u(h,w){const _=e.findCellAt(n,h,l.col);return!(!_||!_.mark)&&(i[w]=h,_.mark=!1,!0)}for(c=l.row-1;u(c,"top");c--);for(c=l.row+1;u(c,"bottom");c++);function d(h,w){const _=[];for(c=i.top;c<=i.bottom;c++){const A=e.findCellAt(n,c,h);if(!A||!A.mark)return!1;_.push(A)}i[w]=h;for(let A=0;A<_.length;A++)_[A].mark=!1;return!0}for(f=l.col-1;d(f,"left");f--);for(f=l.col+1;d(f,"right");f++);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,f)=>{n&&(n.row===i&&n.col===f||(n.row=i,n.col=f,n.address=a.n2l(f)+i))})}spliceRows(e,l,n,i){m.each(this.matrixMap,f=>{f.spliceRows(e,l,n,i),this.normaliseMatrix(f,e)})}spliceColumns(e,l,n,i){m.each(this.matrixMap,f=>{f.spliceColumns(e,l,n,i),this.normaliseMatrix(f,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 o;n.ranges.forEach(f=>{t.test(f.split("!").pop()||"")&&i.addCell(f)})})}}},{"../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"),a=s("./anchor");T.exports=class{constructor(o,r){this.worksheet=o,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(o){let{type:r,imageId:t,range:e,hyperlinks:l}=o;if(this.type=r,this.imageId=t,r==="image")if(typeof e=="string"){const n=m.decode(e);this.range={tl:new a(this.worksheet,{col:n.left,row:n.top},-1),br:new a(this.worksheet,{col:n.right,row:n.bottom},0),editAs:"oneCell"}}else this.range={tl:new a(this.worksheet,e.tl,0),br:e.br&&new a(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 a{constructor(r){this.note=r}get model(){let r=null;return typeof this.note==="string"?r={type:"note",note:{texts:[{text:this.note}]}}:r={type:"note",note:this.note},m.deepMerge({},a.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 a;return t.model=r,t}}a.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},T.exports=a},{"../utils/under-dash":26}],10:[function(s,T,S){const m=s("../utils/col-cache");class a{constructor(){this.decode(arguments)}setTLBR(r,t,e,l,n){if(arguments.length<4){const i=m.decodeAddress(r),f=m.decodeAddress(t);this.model={top:Math.min(i.row,f.row),left:Math.min(i.col,f.col),bottom:Math.max(i.row,f.row),right:Math.max(i.col,f.col),sheetName:e},this.setTLBR(i.row,i.col,f.row,f.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 a)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||r<this.top)&&(this.top=r),(!this.model.left||t<this.left)&&(this.left=t),(!this.model.bottom||e>this.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.bottom<this.top)&&!(r.top>this.bottom)&&!(r.right<this.left)&&!(r.left>this.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=a},{"../utils/col-cache":19}],11:[function(s,T,S){const m=s("../utils/under-dash"),a=s("./enums"),o=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:o.l2n(t)}return this._cells[t-1]||this.getCellEx({address:o.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),f=2;f<n;f++)i[f-2]=arguments[f];const c=i.length-e,u=this._cells.length;let d,h,w;if(c<0)for(d=t+i.length;d<=u;d++)w=this._cells[d-1],h=this._cells[d-c-1],h?(w=this.getCell(d),w.value=h.value,w.style=h.style,w._comment=h._comment):w&&(w.value=null,w.style={},w._comment=void 0);else if(c>0)for(d=u;d>=l;d--)h=this._cells[d-1],h?(w=this.getCell(d+c),w.value=h.value,w.style=h.style,w._comment=h._comment):this._cells[d+c-1]=void 0;for(d=0;d<i.length;d++)w=this.getCell(t+d),w.value=i[d],w.style={},w._comment=void 0}eachCell(t,e){if(e||(e=t,t=null),t&&t.includeEmpty){const l=this._cells.length;for(let n=1;n<=l;n++)e(this.getCell(n),n)}else this._cells.forEach((l,n)=>{l&&l.type!==a.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,f={id:this._number,max:i,man:1};n&&(f.min=n),l.rowBreaks.push(f)}get values(){const t=[];return this._cells.forEach(e=>{e&&e.type!==a.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:o.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:o.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!==a.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!==a.ValueType.Null&&((!t||t>l.col)&&(t=l.col),e<l.col&&(e=l.col))}),t>0?{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<n.col&&(l=n.col),t.push(i))}}),this.height||t.length?{cells:t,number:this.number,min:e,max:l,height:this.height,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed}:null}set model(t){if(t.number!==this._number)throw new Error("Invalid row number in model");let e;this._cells=[],t.cells.forEach(l=>{switch(l.type){case r.Types.Merge:break;default:{let n;if(l.address)n=o.decodeAddress(l.address);else if(e){const{row:i}=e,f=e.col+1;n={row:i,col:f,address:o.encodeAddress(i,f),$col$row:`$${o.n2l(f)}$${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 a{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(o,r){this.worksheet=o,r&&(this.table=r,this.validate(),this.store())}getFormula(o){switch(o.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${o.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${o.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${o.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${o.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${o.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${o.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${o.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${o.name}])`;case"custom":return o.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+o.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:o}=this,r=(c,u,d)=>{c[u]===void 0&&(c[u]=d)};r(o,"headerRow",!0),r(o,"totalsRow",!1),r(o,"style",{}),r(o.style,"theme","TableStyleMedium2"),r(o.style,"showFirstColumn",!1),r(o.style,"showLastColumn",!1),r(o.style,"showRowStripes",!1),r(o.style,"showColumnStripes",!1);const t=(c,u)=>{if(!c)throw new Error(u)};t(o.ref,"Table must have ref"),t(o.columns,"Table must have column definitions"),t(o.rows,"Table must have row definitions"),o.tl=m.decodeAddress(o.ref);const{row:e,col:l}=o.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:f}=this;o.autoFilterRef=m.encode(e,l,e+i-1,l+n-1),o.tableRef=m.encode(e,l,e+f-1,l+n-1),o.columns.forEach((c,u)=>{t(c.name,`Column ${u} must have a name`),u===0?r(c,"totalsRowLabel","Total"):(r(c,"totalsRowFunction","none"),c.totalsRowFormula=this.getFormula(c))})}store(){const o=(i,f)=>{f&&Object.keys(f).forEach(c=>{i[c]=f[c]})},{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((f,c)=>{const{style:u,name:d}=f,h=i.getCell(l+c);h.value=d,o(h,u)})}if(t.rows.forEach(i=>{const f=r.getRow(e+n++);i.forEach((c,u)=>{const d=f.getCell(l+u);d.value=c,o(d,t.columns[u].style)})}),t.totalsRow){const i=r.getRow(e+n++);t.columns.forEach((f,c)=>{const u=i.getCell(l+c);if(c===0)u.value=f.totalsRowLabel;else{const d=this.getFormula(f);u.value=d?{formula:f.totalsRowFormula,result:f.totalsRowResult}:null}o(u,f.style)})}}load(o){const{table:r}=this,{row:t,col:e}=r.tl;let l=0;if(r.headerRow){const n=o.getRow(t+l++);r.columns.forEach((i,f)=>{n.getCell(e+f).value=i.name})}if(r.rows.forEach(n=>{const i=o.getRow(t+l++);n.forEach((f,c)=>{i.getCell(e+c).value=f})}),r.totalsRow){const n=o.getRow(t+l++);r.columns.forEach((i,f)=>{const c=n.getCell(e+f);f===0?c.value=i.totalsRowLabel:this.getFormula(i)&&(c.value={formula:i.totalsRowFormula,result:i.totalsRowResult})})}}get model(){return this.table}set model(o){this.table=o}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const o=m.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let r=0;r<this._cache.tableHeight;r++){const t=this.worksheet.getRow(o.row+r);for(let e=0;e<this._cache.width;e++)t.getCell(o.col+e).value=null}else{for(let r=this.tableHeight;r<this._cache.tableHeight;r++){const t=this.worksheet.getRow(o.row+r);for(let e=0;e<this._cache.width;e++)t.getCell(o.col+e).value=null}for(let r=0;r<this.tableHeight;r++){const t=this.worksheet.getRow(o.row+r);for(let e=this.width;e<this._cache.width;e++)t.getCell(o.col+e).value=null}}this.store()}addRow(o,r){this.cacheState(),r===void 0?this.table.rows.push(o):this.table.rows.splice(r,0,o)}removeRows(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(o,r)}getColumn(o){const r=this.table.columns[o];return new a(this,r,o)}addColumn(o,r,t){this.cacheState(),t===void 0?(this.table.columns.push(o),this.table.rows.forEach((e,l)=>{e.push(r[l])})):(this.table.columns.splice(t,0,o),this.table.rows.forEach((e,l)=>{e.splice(t,0,r[l])}))}removeColumns(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(o,r),this.table.rows.forEach(t=>{t.splice(o,r)})}_assign(o,r,t){this.cacheState(),o[r]=t}get ref(){return this.table.ref}set ref(o){this._assign(this.table,"ref",o)}get name(){return this.table.name}set name(o){this.table.name=o}get displayName(){return this.table.displyName||this.table.name}set displayNamename(o){this.table.displayName=o}get headerRow(){return this.table.headerRow}set headerRow(o){this._assign(this.table,"headerRow",o)}get totalsRow(){return this.table.totalsRow}set totalsRow(o){this._assign(this.table,"totalsRow",o)}get theme(){return this.table.style.name}set theme(o){this.table.style.name=o}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(o){this.table.style.showFirstColumn=o}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(o){this.table.style.showLastColumn=o}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(o){this.table.style.showRowStripes=o}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(o){this.table.style.showColumnStripes=o}}},{"../utils/col-cache":19}],13:[function(s,T,S){const m=s("./worksheet"),a=s("./defined-names"),o=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 a}get xlsx(){return this._xlsx||(this._xlsx=new o(this)),this._xlsx}get csv(){return this._csv||(this._csv=new r(this)),this._csv}get nextId(){for(let t=1;t<this._worksheets.length;t++)if(!this._worksheets[t])return t;return this._worksheets.length||1}addWorksheet(t,e){const l=this.nextId;e&&(typeof e=="string"?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),e={properties:{tabColor:{argb:e}}}):(e.argb||e.theme||e.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),e={properties:{tabColor:e}}));const n=this._worksheets.reduce((c,u)=>(u&&u.orderNo)>c?u.orderNo:c,0),i=Object.assign({},e,{id:l,name:t,orderNo:n+1,workbook:this}),f=new m(i);return this._worksheets[l]=f,f}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,f=t.sheets&&t.sheets.findIndex(c=>c.id===l);(this._worksheets[l]=new m({id:l,name:n,orderNo:f,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"),a=s("../utils/col-cache"),o=s("./range"),r=s("./row"),t=s("./column"),e=s("./enums"),l=s("./image"),n=s("./table"),i=s("./data-validations"),f=s("../utils/encryptor"),{copyStyle:c}=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 o;return this._rows.forEach(d=>{if(d){const h=d.dimensions;h&&u.expand(d.number,h.min,d.number,h.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 h=this._columns=[];u.forEach(w=>{const _=new t(this,d++,!1);h.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=a.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 h=this._rows.length;for(var w=arguments.length,_=new Array(w>2?w-2:0),A=2;A<w;A++)_[A-2]=arguments[A];if(_.length>0)for(let P=0;P<h;P++){const D=[u,d];_.forEach(B=>{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+_.length;P++)this.getColumn(P).defn=null;this.workbook.definedNames.spliceColumns(this.name,u,d,_.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let u=0;return this.eachRow(d=>{u=Math.max(u,d.cellCount)}),u}get actualColumnCount(){const u=[];let d=0;return this.eachRow(h=>{h.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 h=[];for(let w=u;w<u+d;w++)h.push(this.getRow(w));return h}addRow(u){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const h=this._nextRow,w=this.getRow(h);return w.values=u,this._setStyleOption(h,d[0]==="i"?d:"n"),w}addRows(u){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const h=[];return u.forEach(w=>{h.push(this.addRow(w,d))}),h}insertRow(u,d){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(u,0,d),this._setStyleOption(u,h),this.getRow(u)}insertRows(u,d){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(u,0,...d),h!=="n")for(let w=0;w<d.length;w++)h[0]==="o"&&this.findRow(d.length+u+w)!==void 0?this._copyStyle(d.length+u+w,u+w,h[1]==="+"):h[0]==="i"&&this.findRow(u-1)!==void 0&&this._copyStyle(u-1,u+w,h[1]==="+");return this.getRows(u,d.length)}_setStyleOption(u){let d=arguments.length>1&&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 h=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this.getRow(u),_=this.getRow(d);_.style=c(w.style),w.eachCell({includeEmpty:h},(A,N)=>{_.getCell(N).style=c(A.style)}),_.height=w.height}duplicateRow(u,d){let h=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,h?0:d,..._);for(let A=0;A<d;A++){const N=this._rows[u+A];N.style=w.style,N.height=w.height,w.eachCell({includeEmpty:!0},(L,I)=>{N.getCell(I).style=L.style})}}spliceRows(u,d){const h=u+d;for(var w=arguments.length,_=new Array(w>2?w-2:0),A=2;A<w;A++)_[A-2]=arguments[A];const N=_.length,L=N-d,I=this._rows.length;let P,D;if(L<0)for(u===I&&(this._rows[I-1]=void 0),P=h;P<=I;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)=>{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>=h;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<N;P++){const U=this.getRow(u+P);U.style={},U.values=_[P]}this.workbook.definedNames.spliceRows(this.name,u,d,N)}eachRow(u,d){if(d||(d=u,u=void 0),u&&u.includeEmpty){const h=this._rows.length;for(let w=1;w<=h;w++)d(this.getRow(w),w)}else this._rows.forEach(h=>{h&&h.hasValues&&d(h,h.number)})}getSheetValues(){const u=[];return this._rows.forEach(d=>{d&&(u[d.number]=d.values)}),u}findCell(u,d){const h=a.getAddress(u,d),w=this._rows[h.row-1];return w?w.findCell(h.col):void 0}getCell(u,d){const h=a.getAddress(u,d);return this.getRow(h.row).getCellEx(h)}mergeCells(){for(var u=arguments.length,d=new Array(u),h=0;h<u;h++)d[h]=arguments[h];const w=new o(d);this._mergeCellsInternal(w)}mergeCellsWithoutStyle(){for(var u=arguments.length,d=new Array(u),h=0;h<u;h++)d[h]=arguments[h];const w=new o(d);this._mergeCellsInternal(w,!0)}_mergeCellsInternal(u,d){m.each(this._merges,w=>{if(w.intersects(u))throw new Error("Cannot merge already merged cells")});const h=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(h,d);this._merges[h.address]=u}_unMergeMaster(u){const d=this._merges[u.address];if(d){for(let h=d.top;h<=d.bottom;h++)for(let w=d.left;w<=d.right;w++)this.getCell(h,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),h=0;h<u;h++)d[h]=arguments[h];const w=new o(d);for(let _=w.top;_<=w.bottom;_++)for(let A=w.left;A<=w.right;A++){const N=this.findCell(_,A);N&&(N.type===e.ValueType.Merge?this._unMergeMaster(N.master):this._merges[N.address]&&this._unMergeMaster(N))}}fillFormula(u,d,h){let w=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"shared";const _=a.decode(u),{top:A,left:N,bottom:L,right:I}=_,P=I-N+1,D=a.encodeAddress(A,N),U=w==="shared";let B;B=typeof h=="function"?h:Array.isArray(h)?Array.isArray(h[0])?(M,v)=>h[M-A][v-N]:(M,v)=>h[(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 h={type:"image",imageId:u,range:d};this._media.push(new l(this,h))}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(h=>{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=f.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=d&&"spinCount"in d?d.spinCount:1e5,this.sheetProtection.hashValue=f.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),h()})}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=[],h=u.dimensions=new o;return this._rows.forEach(w=>{const _=w&&w.model;_&&(h.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 h=new r(this,d.number);this._rows[h.number-1]=h,h.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,h)=>{const w=new n;return w.model=h,d[h.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")},a=s("./doc/enums");Object.keys(a).forEach(o=>{m[o]=a[o]}),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(a){return typeof a=="string"?a:m?m.decode(a):a.toString()}},{}],17:[function(s,T,S){const m=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:a}=s("buffer");S.stringToBuffer=function(o){return typeof o!="string"?o:m?a.from(m.encode(o).buffer):a.from(o)}},{buffer:220}],18:[function(s,T,S){const m=s("./under-dash"),a=s("./col-cache");T.exports=class{constructor(o){this.template=o,this.sheets={}}addCell(o){this.addCellEx(a.decodeEx(o))}getCell(o){return this.findCellEx(a.decodeEx(o),!0)}findCell(o){return this.findCellEx(a.decodeEx(o),!1)}findCellAt(o,r,t){const e=this.sheets[o],l=e&&e[r];return l&&l[t]}addCellEx(o){if(o.top)for(let r=o.top;r<=o.bottom;r++)for(let t=o.left;t<=o.right;t++)this.getCellAt(o.sheetName,r,t);else this.findCellEx(o,!0)}getCellEx(o){return this.findCellEx(o,!0)}findCellEx(o,r){const t=this.findSheet(o,r),e=this.findSheetRow(t,o,r);return this.findRowCell(e,o,r)}getCellAt(o,r,t){const e=this.sheets[o]||(this.sheets[o]=[]),l=e[r]||(e[r]=[]);return l[t]||(l[t]={sheetName:o,address:a.n2l(t)+r,row:r,col:t})}removeCellEx(o){const r=this.findSheet(o);if(!r)return;const t=this.findSheetRow(r,o);t&&delete t[o.col]}forEachInSheet(o,r){const t=this.sheets[o];t&&t.forEach((e,l)=>{e&&e.forEach((n,i)=>{n&&r(n,l,i)})})}forEach(o){m.each(this.sheets,(r,t)=>{this.forEachInSheet(t,o)})}map(o){const r=[];return this.forEach(t=>{r.push(o(t))}),r}findSheet(o,r){const t=o.sheetName;return this.sheets[t]?this.sheets[t]:r?this.sheets[t]=[]:void 0}findSheetRow(o,r,t){const{row:e}=r;return o&&o[e]?o[e]:t?o[e]=[]:void 0}findRowCell(o,r,t){const{col:e}=r;return o&&o[e]?o[e]:t?o[e]=this.template?Object.assign(r,JSON.parse(JSON.stringify(this.template))):r:void 0}spliceRows(o,r,t,e){const l=this.sheets[o];if(l){const n=[];for(let i=0;i<e;i++)n.push([]);l.splice(r,t,...n)}}spliceColumns(o,r,t,e){const l=this.sheets[o];if(l){const n=[];for(let i=0;i<e;i++)n.push(null);m.each(l,i=>{i.splice(r,t,...n)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(s,T,S){const m=/^[A-Z]+\d+$/,a={_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:o=>o<=26?1:o<=676?2:3,_fill(o){let r,t,e,l,n,i=1;if(o>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&o>=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&&o>=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&&o>=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(o){if(this._l2n[o]||this._fill(o.length),!this._l2n[o])throw new Error("Out of bounds. Invalid column letter: "+o);return this._l2n[o]},n2l(o){if(o<1||o>16384)throw new Error(o+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[o]||this._fill(this._level(o)),this._n2l[o]},_hash:{},validateAddress(o){if(!m.test(o))throw new Error("Invalid Address: "+o);return!0},decodeAddress(o){const r=o.length<5&&this._hash[o];if(r)return r;let t=!1,e="",l=0,n=!1,i="",f=0;for(let u,d=0;d<o.length;d++)if(u=o.charCodeAt(d),!n&&u>=65&&u<=90)t=!0,e+=o[d],l=26*l+u-64;else if(u>=48&&u<=57)n=!0,i+=o[d],f=10*f+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||(f=void 0);const c={address:o=e+i,col:l,row:f,$col$row:`$${e}$${i}`};return l<=100&&f<=100&&(this._hash[o]=c,this._hash[c.$col$row]=c),c},getAddress(o,r){if(r){const t=this.n2l(r)+o;return this.decodeAddress(t)}return this.decodeAddress(o)},decode(o){const r=o.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(o)},decodeEx(o){const r=o.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=r[1]||r[2],e=r[3],l=e.split(":");if(l.length>1){let i=this.decodeAddress(l[0]),f=this.decodeAddress(l[1]);const c=Math.min(i.row,f.row),u=Math.min(i.col,f.col),d=Math.max(i.row,f.row),h=Math.max(i.col,f.col);return i=this.n2l(u)+c,f=this.n2l(h)+d,{top:c,left:u,bottom:d,right:h,sheetName:t,tl:{address:i,col:u,row:c,$col$row:`$${this.n2l(u)}$${c}`,sheetName:t},br:{address:f,col:h,row:d,$col$row:`$${this.n2l(h)}$${d}`,sheetName:t},dimensions:`${i}:${f}`}}if(e.startsWith("#"))return t?{sheetName:t,error:e}:{error:e};const n=this.decodeAddress(e);return t?{sheetName:t,...n}:n},encodeAddress:(o,r)=>a.n2l(r)+o,encode(){switch(arguments.length){case 2:return a.encodeAddress(arguments[0],arguments[1]);case 4:return`${a.encodeAddress(arguments[0],arguments[1])}:${a.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(o,r){const[t,e,,l,n]=o,[i,f]=r;return i>=t&&i<=l&&f>=e&&f<=n}};T.exports=a},{}],20:[function(s,T,S){const m=(o,r)=>({...o,...r.reduce((t,e)=>(o[e]&&(t[e]={...o[e]}),t),{})}),a=function(o,r,t){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];o[t]&&(r[t]=m(o[t],e))};S.copyStyle=o=>{if(!o)return o;if(r=o,Object.keys(r).length===0)return{};var r;const t={...o};return a(o,t,"font",["color"]),a(o,t,"alignment"),a(o,t,"protection"),o.border&&(a(o,t,"border"),a(o.border,t.border,"top",["color"]),a(o.border,t.border,"left",["color"]),a(o.border,t.border,"bottom",["color"]),a(o.border,t.border,"right",["color"]),a(o.border,t.border,"diagonal",["color"])),o.fill&&(a(o,t,"fill",["fgColor","bgColor","center"]),o.fill.stops&&(t.fill.stops=o.fill.stops.map(e=>m(e,["color"])))),t}},{}],21:[function(s,T,S){(function(m){(function(){const a=s("crypto"),o={hash(r){const t=a.createHash(r);for(var e=arguments.length,l=new Array(e>1?e-1:0),n=1;n<e;n++)l[n-1]=arguments[n];return t.update(m.concat(l)),t.digest()},convertPasswordToHash(r,t,e,l){if(t=t.toLowerCase(),a.getHashes().indexOf(t)<0)throw new Error(`Hash algorithm '${t}' not supported!`);const n=m.from(r,"utf16le");let i=this.hash(t,m.from(e,"base64"),n);for(let f=0;f<l;f++){const c=m.alloc(4);c.writeUInt32LE(f,0),i=this.hash(t,i,c)}return i.toString("base64")},randomBytes:r=>a.randomBytes(r)};T.exports=o}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(s,T,S){const{SaxesParser:m}=s("saxes"),{PassThrough:a}=s("readable-stream"),{bufferToString:o}=s("./browser-buffer-decode");T.exports=async function*(r){r.pipe&&!r[Symbol.asyncIterator]&&(r=r.pipe(new a));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(o(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"),a=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,o=/^([$])?([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(a,(i,f,c,u,d)=>{if(d)return i;const h=o.exec(u);if(h){const w=h[1],_=h[2].toUpperCase(),A=h[3],N=h[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),(f||"")+(w||"")+m.n2l(L)+(A||"")+I}return i})}}},{"./col-cache":19}],24:[function(s,T,S){(function(m,a){(function(){const o=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,h,w){return this.toBuffer().copy(u,d,h,w)}toBuffer(){return this._buffer||(this._buffer=a.from(this._data,this._encoding)),this._buffer}}class l{constructor(u){this._data=u}get length(){return this._data.length}copy(u,d,h,w){return this._data._buf.copy(u,d,h,w)}toBuffer(){return this._data.toBuffer()}}class n{constructor(u){this._data=u}get length(){return this._data.length}copy(u,d,h,w){this._data.copy(u,d,h,w)}toBuffer(){return this._data}}class i{constructor(u){this.size=u,this.buffer=a.alloc(u),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const u=a.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=a.alloc(u),this.buffer.copy(d,0,this.iRead,u),this.iRead+=u,d)}write(u,d,h){const w=Math.min(h,this.size-this.iWrite);return u.copy(this.buffer,this.iWrite,d,d+w),this.iWrite+=w,w}}const f=function(c){c=c||{},this.bufSize=c.bufSize||1048576,this.buffers=[],this.batch=c.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};r.inherits(f,o.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return a.concat(this.buffers.map(c=>c.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const u=this.buffers[this.buffers.length-1];if(!u.full)return u}const c=new i(this.bufSize);return this.buffers.push(c),c},async _pipe(c){await Promise.all(this.pipes.map((function(u){return new Promise(d=>{u.write(c.toBuffer(),()=>{d()})})})))},_writeToBuffers(c){let u=0;const d=c.length;for(;u<d;)u+=this._getWritableBuffer().write(c,u,d-u)},async write(c,u,d){let h;if(u instanceof Function&&(d=u,u="utf8"),d=d||r.nop,c instanceof t)h=new l(c);else if(c instanceof a)h=new n(c);else{if(!(typeof c=="string"||c instanceof String||c instanceof ArrayBuffer))throw new Error("Chunk must be one of type String, Buffer or StringBuf.");h=new e(c,u)}if(this.pipes.length)if(this.batch)for(this._writeToBuffers(h);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(h),m.nextTick(d)):(await this._pipe(h),d());else this.paused||this.emit("data",h.toBuffer()),this._writeToBuffers(h),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(c,u,d){const h=w=>{w?d(w):(this._flush(),this.pipes.forEach(_=>{_.end()}),this.emit("finish"))};c?this.write(c,u,h):h()},read(c){let u;if(c){for(u=[];c&&this.buffers.length&&!this.buffers[0].eod;){const d=this.buffers[0],h=d.read(c);c-=h.length,u.push(h),d.eod&&d.full&&this.buffers.shift()}return a.concat(u)}return u=this.buffers.map(d=>d.toBuffer()).filter(Boolean),this.buffers=[],a.concat(u)},setEncoding(c){this.encoding=c},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(c){this.pipes.push(c),!this.paused&&this.buffers.length&&this.end()},unpipe(c){this.pipes=this.pipes.filter(u=>u!==c)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),T.exports=f}).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(a){this._buf=m.alloc(a&&a.size||16384),this._encoding=a&&a.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(a){a=a||0,this._buffer=void 0,this._inPos=a}_grow(a){let o=2*this._buf.length;for(;o<a;)o*=2;const r=m.alloc(o);this._buf.copy(r,0),this._buf=r}addText(a){this._buffer=void 0;let o=this._inPos+this._buf.write(a,this._inPos,this._encoding);for(;o>=this._buf.length-4;)this._grow(this._inPos+a.length),o=this._inPos+this._buf.write(a,this._inPos,this._encoding);this._inPos=o}addStringBuf(a){a.length&&(this._buffer=void 0,this.length+a.length>this.capacity&&this._grow(this.length+a.length),a._buf.copy(this._buf,this._inPos,0,a.length),this._inPos+=a.length)}}}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220}],26:[function(s,T,S){const{toString:m}=Object.prototype,a=/["&<>]/,o={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 f;if(e!==l)return!1;switch(typeof r){case"object":if(n||i)return!(!n||!i)&&r.length===t.length&&r.every((c,u)=>{const d=t[u];return o.isEqual(c,d)});if(r===null||t===null)return r===t;if(f=Object.keys(r),Object.keys(t).length!==f.length)return!1;for(const c of f)if(!t.hasOwnProperty(c))return!1;return o.every(r,(c,u)=>{const d=t[u];return o.isEqual(c,d)});default:return r===t}},escapeHtml(r){const t=a.exec(r);if(!t)return r;let e="",l="",n=0,i=t.index;for(;i<r.length;i++){switch(r.charAt(i)){case'"':l="&quot;";break;case"&":l="&amp;";break;case"'":l="&apos;";break;case"<":l="&lt;";break;case">":l="&gt;";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)=>r<t?-1:r>t?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(f,c){e=r[c],n=Array.isArray(f),o.isObject(f)||n?(n?(n=!1,l=e&&Array.isArray(e)?e:[]):l=e&&o.isObject(e)?e:{},r[c]=o.deepMerge(l,f)):o.isUndefined(f)||(r[c]=f)}for(let f=0;f<t;f++)o.each(arguments[f],i);return r}};T.exports=o},{}],27:[function(s,T,S){(function(m,a){(function(){const o=s("fs"),r=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:e=>new Promise(l=>{m.setImmediate?a(()=>{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(c=>{Object.defineProperty(e,c,Object.getOwnPropertyDescriptor(n,c))});const f={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};i&&Object.keys(i).forEach(c=>{f[c]=Object.getOwnPropertyDescriptor(i,c)}),e.prototype=Object.create(l.prototype,f)},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="",f=0,c=l.index;for(;c<e.length;c++){const u=e.charCodeAt(c);switch(u){case 34:i="&quot;";break;case 38:i="&amp;";break;case 39:i="&apos;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;case 127:i="";break;default:if(u<=31&&(u<=8||u>=11&&u!==13)){i="";break}continue}f!==c&&(n+=e.substring(f,c)),f=c+1,i&&(n+=i)}return f!==c?n+e.substring(f,c):n},xmlDecode:e=>e.replace(/&([a-z]*);/g,l=>{switch(l){case"&lt;":return"<";case"&gt;":return">";case"&amp;":return"&";case"&apos;":return"'";case"&quot;":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=>{o.access(e,o.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.commonjsGlobal<"u"?Kt.commonjsGlobal: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"),a=s("./utils");function o(e,l,n){e.push(` ${l}="${a.xmlEncode(n.toString())}"`)}function r(e,l){if(l){const n=[];m.each(l,(i,f)=>{i!==void 0&&o(n,f,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("<?xml"),r(n,l),n.push(`?>
2
2
  `)}openNode(l,n){const i=this.tos,f=this._xml;i&&this.open&&f.push(">"),this._stack.push(l),f.push("<"),f.push(l),r(f,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&&o(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(a.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("</"),n.push(l),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 a=s("events"),o=s("jszip"),r=s("./stream-buf"),{stringToBuffer:t}=s("./browser-buffer-encode");class e extends a.EventEmitter{constructor(n){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},n),this.zip=new o,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"),a=s("../../utils/xml-stream");class o{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 o?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 a;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 o.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 o.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 o.toAttribute(t,e,l)}static toFloatValue(t,e){return t===void 0?e:parseFloat(t)}}T.exports=o},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(s,T,S){const m=s("../base-xform"),a=s("../../../utils/col-cache");function o(t){try{return a.decodeEx(t),!0}catch{return!1}}function r(t){const e=[];let l=!1,n="";return t.split(",").forEach(i=>{if(!i)return;const f=(i.match(/'/g)||[]).length;if(!f)return void(l?n+=i+",":o(i)&&e.push(i));const c=f%2==0;!l&&c&&o(i)?e.push(i):l&&!c?(l=!1,o(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){return t.name==="definedName"?(this._parsedName=t.attributes.name,this._parsedLocalSheetId=t.attributes.localSheetId,this._parsedText=[],!0):!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"),a=s("../base-xform");T.exports=class extends a{render(o,r){o.leafNode("sheet",{sheetId:r.id,name:r.name,state:r.state,"r:id":r.rId})}parseOpen(o){return o.name==="sheet"&&(this.model={name:m.xmlDecode(o.attributes.name),id:parseInt(o.attributes.sheetId,10),state:o.attributes.state,rId:o.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(a,o){a.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:o.fullCalcOnLoad?1:void 0})}parseOpen(a){return a.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(a,o){a.leafNode("workbookPr",{date1904:o.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(a){return a.name==="workbookPr"&&(this.model={date1904:a.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(a,o){const r={xWindow:o.x||0,yWindow:o.y||0,windowWidth:o.width||12e3,windowHeight:o.height||24e3,firstSheet:o.firstSheet,activeTab:o.activeTab};o.visibility&&o.visibility!=="visible"&&(r.visibility=o.visibility),a.leafNode("workbookView",r)}parseOpen(a){if(a.name==="workbookView"){const o=this.model={},r=function(e,l,n){const i=l!==void 0?o[e]=l:n;i!==void 0&&(o[e]=i)},t=function(e,l,n){const i=l!==void 0?o[e]=parseInt(l,10):n;i!==void 0&&(o[e]=i)};return t("x",a.attributes.xWindow,0),t("y",a.attributes.yWindow,0),t("width",a.attributes.windowWidth,25e3),t("height",a.attributes.windowHeight,1e4),r("visibility",a.attributes.visibility,"visible"),t("activeTab",a.attributes.activeTab,void 0),t("firstSheet",a.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"),a=s("../../../utils/col-cache"),o=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"),f=s("./workbook-properties-xform"),c=s("./workbook-calc-properties-xform");class u extends r{constructor(){super(),this.map={fileVersion:u.STATIC_XFORMS.fileVersion,workbookPr:new f,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 c}}prepare(h){h.sheets=h.worksheets;const w=[];let _=0;h.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&&(h.definedNames=h.definedNames.concat(w)),(h.media||[]).forEach((A,N)=>{A.name=A.type+(N+1)})}render(h,w){h.openXml(o.StdDocAttributes),h.openNode("workbook",u.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(h),this.map.workbookPr.render(h,w.properties),this.map.bookViews.render(h,w.views),this.map.sheets.render(h,w.sheets),this.map.definedNames.render(h,w.definedNames),this.map.calcPr.render(h,w.calcProperties),h.closeNode()}parseOpen(h){return this.parser?(this.parser.parseOpen(h),!0):(h.name==="workbook"||(this.parser=this.map[h.name],this.parser&&this.parser.parseOpen(h)),!0)}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){return this.parser?(this.parser.parseClose(h)||(this.parser=void 0),!0):h==="workbook"?(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):!0}reconcile(h){const w=(h.workbookRels||[]).reduce((I,P)=>(I[P.Id]=P,I),{}),_=[];let A,N=0;(h.sheets||[]).forEach(I=>{const P=w[I.rId];P&&(A=h.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(h.definedNames,I=>{if(I.name==="_xlnm.Print_Area"){if(A=_[I.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=a.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)}),h.definedNames=L,h.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"),a=s("../../../utils/utils"),o=s("../base-xform"),r=T.exports=function(t){this.model=t};a.inherits(r,o,{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"),a=s("../../../utils/utils"),o=s("../base-xform"),r=s("./comment-xform"),t=T.exports=function(){this.map={comment:new r}};a.inherits(t,o,{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(a){super(),this._model=a}get tag(){return this._model&&this._model.tag}render(a,o,r){(o===r[2]||this.tag==="x:SizeWithCells"&&o===r[1])&&a.leafNode(this.tag)}parseOpen(a){return a.name===this.tag?(this.model={},this.model[this.tag]=!0,!0):!1}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{constructor(a){super(),this._model=a}get tag(){return this._model&&this._model.tag}render(a,o){a.leafNode(this.tag,null,o)}parseOpen(a){return a.name===this.tag?(this.text="",!0):!1}parseText(a){this.text=a}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(a){const o=Math.floor(a.left),r=Math.floor(68*(a.left-o)),t=Math.floor(a.top),e=Math.floor(18*(a.top-t)),l=Math.floor(a.right),n=Math.floor(68*(a.right-l)),i=Math.floor(a.bottom);return[o,r,t,e,l,n,i,Math.floor(18*(a.bottom-i))]}getDefaultRect(a){const o=a.col,r=Math.max(a.row-2,0);return[o,6,r,14,o+2,2,r+4,16]}render(a,o){const r=o.anchor?this.getAnchorRect(o.anchor):this.getDefaultRect(o.refAddress);a.leafNode("x:Anchor",null,r.join(", "))}parseOpen(a){return a.name===this.tag?(this.text="",!0):!1}parseText(a){this.text=a}parseClose(){return!1}}},{"../base-xform":32}],44:[function(s,T,S){const m=s("../base-xform"),a=s("./vml-anchor-xform"),o=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 a,"x:Locked":new o({tag:"x:Locked"}),"x:LockText":new o({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){return e.name===this.tag?(this.reset(),this.model={anchor:[],protection:{},editAs:""}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e===this.tag?(this.normalizeModel(),!1):!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"),a=s("../base-xform"),o=s("./vml-shape-xform");class r extends a{constructor(){super(),this.map={"v:shape":new o}}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){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?(this.reset(),this.model={comments:[]}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0):e!==this.tag}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"),a=s("./vml-textbox-xform"),o=s("./vml-client-data-xform");class r extends m{constructor(){super(),this.map={"v:textbox":new a,"x:ClientData":new o}}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){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?(this.reset(),this.model={margins:{insetmode:e.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e===this.tag?(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):!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(a,o,r){return`${parseFloat(a)*o.toFixed(2)}${r}`}reverseConversionUnit(a){return(a||"").split(",").map(o=>Number(parseFloat(this.conversionUnit(parseFloat(o),.1,"")).toFixed(2)))}render(a,o){const r={style:"mso-direction-alt:auto"};if(o&&o.note){let{inset:t}=o.note&&o.note.margins;Array.isArray(t)&&(t=t.map(e=>this.conversionUnit(e,10,"mm")).join(",")),t&&(r.inset=t)}a.openNode("v:textbox",r),a.leafNode("div",{style:"text-align:left"}),a.closeNode()}parseOpen(a){return a.name===this.tag&&(this.model={inset:this.reverseConversionUnit(a.attributes.inset)}),!0}parseText(){}parseClose(a){return a!==this.tag}}},{"../base-xform":32}],48:[function(s,T,S){const m=s("./base-xform");T.exports=class extends m{createNewModel(a){return{}}parseOpen(a){return this.parser=this.parser||this.map[a.name],this.parser?(this.parser.parseOpen(a),!0):a.name===this.tag&&(this.model=this.createNewModel(a),!0)}parseText(a){this.parser&&this.parser.parseText(a)}onParserClose(a,o){this.model[a]=o.model}parseClose(a){return this.parser?(this.parser.parseClose(a)||(this.onParserClose(a,this.parser),this.parser=void 0),!0):a!==this.tag}}},{"./base-xform":32}],49:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(a,o){a.openNode("HeadingPairs"),a.openNode("vt:vector",{size:2,baseType:"variant"}),a.openNode("vt:variant"),a.leafNode("vt:lpstr",void 0,"Worksheets"),a.closeNode(),a.openNode("vt:variant"),a.leafNode("vt:i4",void 0,o.length),a.closeNode(),a.closeNode(),a.closeNode()}parseOpen(a){return a.name==="HeadingPairs"}parseText(){}parseClose(a){return a!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(a,o){a.openNode("TitlesOfParts"),a.openNode("vt:vector",{size:o.length,baseType:"lpstr"}),o.forEach(r=>{a.leafNode("vt:lpstr",void 0,r.name)}),a.closeNode(),a.closeNode()}parseOpen(a){return a.name==="TitlesOfParts"}parseText(){}parseClose(a){return a!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(s,T,S){const m=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("../simple/string-xform"),r=s("./app-heading-pairs-xform"),t=s("./app-titles-of-parts-xform");class e extends a{constructor(){super(),this.map={Company:new o({tag:"Company"}),Manager:new o({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){return this.parser?(this.parser.parseOpen(n),!0):n.name==="Properties"?!0:(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==="Properties"?(this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1):!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"),a=s("../base-xform");class o extends a{render(t,e){t.openXml(m.StdDocAttributes),t.openNode("Types",o.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}}o.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},T.exports=o},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(s,T,S){const m=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("../simple/date-xform"),r=s("../simple/string-xform"),t=s("../simple/integer-xform");class e extends a{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 o({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 o({tag:"dcterms:created",attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new o({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(a,o){a.leafNode("Relationship",o)}parseOpen(a){return a.name==="Relationship"?(this.model=a.attributes,!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(s,T,S){const m=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("./relationship-xform");class r extends a{constructor(){super(),this.map={Relationship:new o}}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;if(e==="Relationships")return!1;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(a){return this.parser?(this.parser.parseOpen(a),!0):(a.name===this.tag?(this.reset(),this.model={range:{editAs:a.attributes.editAs||"oneCell"}}):(this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)),!0)}parseText(a){this.parser&&this.parser.parseText(a)}reconcilePicture(a,o){if(a&&a.rId){const r=o.rels[a.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){const t=r[1],e=o.mediaIndex[t];return o.media[e]}}}}},{"../base-xform":32}],57:[function(s,T,S){const m=s("../base-xform"),a=s("./blip-xform");T.exports=class extends m{constructor(){super(),this.map={"a:blip":new a}}get tag(){return"xdr:blipFill"}render(o,r){o.openNode(this.tag),this.map["a:blip"].render(o,r),o.openNode("a:stretch"),o.leafNode("a:fillRect"),o.closeNode(),o.closeNode()}parseOpen(o){return this.parser?(this.parser.parseOpen(o),!0):(o.name===this.tag?this.reset():(this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)),!0)}parseText(){}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.parser=void 0),!0):o===this.tag?(this.model=this.map["a:blip"].model,!1):!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(a,o){a.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":o.rId,cstate:"print"})}parseOpen(a){return a.name===this.tag&&(this.model={rId:a.attributes["r:embed"]}),!0}parseText(){}parseClose(a){return a!==this.tag}}},{"../base-xform":32}],59:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"xdr:cNvPicPr"}render(a){a.openNode(this.tag),a.leafNode("a:picLocks",{noChangeAspect:"1"}),a.closeNode()}parseOpen(a){switch(a.name){case this.tag:default:return!0}}parseText(){}parseClose(a){return a!==this.tag}}},{"../base-xform":32}],60:[function(s,T,S){const m=s("../base-xform"),a=s("./hlink-click-xform"),o=s("./ext-lst-xform");T.exports=class extends m{constructor(){super(),this.map={"a:hlinkClick":new a,"a:extLst":new o}}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){return this.parser?(this.parser.parseOpen(r),!0):(r.name===this.tag?this.reset():(this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)),!0)}parseText(){}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.parser=void 0),!0):r===this.tag?(this.model=this.map["a:hlinkClick"].model,!1):!0}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(s,T,S){const m=s("../base-xform"),a=s("../simple/integer-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.map={"xdr:col":new a({tag:"xdr:col",zero:!0}),"xdr:colOff":new a({tag:"xdr:colOff",zero:!0}),"xdr:row":new a({tag:"xdr:row",zero:!0}),"xdr:rowOff":new a({tag:"xdr:rowOff",zero:!0})}}render(o,r){o.openNode(this.tag),this.map["xdr:col"].render(o,r.nativeCol),this.map["xdr:colOff"].render(o,r.nativeColOff),this.map["xdr:row"].render(o,r.nativeRow),this.map["xdr:rowOff"].render(o,r.nativeRowOff),o.closeNode()}parseOpen(o){return this.parser?(this.parser.parseOpen(o),!0):(o.name===this.tag?this.reset():(this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)),!0)}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.parser=void 0),!0):o===this.tag?(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):!0}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(s,T,S){const m=s("../../../utils/col-cache"),a=s("../../../utils/xml-stream"),o=s("../base-xform"),r=s("./two-cell-anchor-xform"),t=s("./one-cell-anchor-xform");class e extends o{constructor(){super(),this.map={"xdr:twoCellAnchor":new r,"xdr:oneCellAnchor":new t}}prepare(n){n.anchors.forEach((i,f)=>{i.anchorType=(function(c){return(typeof c.range=="string"?m.decode(c.range):c.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"})(i),this.map[i.anchorType].prepare(i,{index:f})})}get tag(){return"xdr:wsDr"}render(n,i){n.openXml(a.StdDocAttributes),n.openNode(this.tag,e.DRAWING_ATTRIBUTES),i.anchors.forEach(f=>{this.map[f.anchorType].render(n,f)}),n.closeNode()}parseOpen(n){return this.parser?(this.parser.parseOpen(n),!0):(n.name===this.tag?(this.reset(),this.model={anchors:[]}):(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.anchors.push(this.parser.model),this.parser=void 0),!0):n!==this.tag}reconcile(n,i){n.anchors.forEach(f=>{f.br?this.map["xdr:twoCellAnchor"].reconcile(f,i):this.map["xdr:oneCellAnchor"].reconcile(f,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(a){a.openNode(this.tag),a.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),a.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),a.closeNode(),a.closeNode()}parseOpen(a){switch(a.name){case this.tag:default:return!0}}parseText(){}parseClose(a){return a!==this.tag}}},{"../base-xform":32}],64:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(a){super(),this.tag=a.tag,this.map={}}render(a,o){a.openNode(this.tag);const r=Math.floor(9525*o.width),t=Math.floor(9525*o.height);a.addAttribute("cx",r),a.addAttribute("cy",t),a.closeNode()}parseOpen(a){return a.name===this.tag&&(this.model={width:parseInt(a.attributes.cx||"0",10)/9525,height:parseInt(a.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(a,o){o.hyperlinks&&o.hyperlinks.rId&&a.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":o.hyperlinks.rId,tooltip:o.hyperlinks.tooltip})}parseOpen(a){return a.name===this.tag&&(this.model={hyperlinks:{rId:a.attributes["r:id"],tooltip:a.attributes.tooltip}}),!0}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(s,T,S){const m=s("../base-xform"),a=s("./c-nv-pr-xform"),o=s("./c-nv-pic-pr-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:cNvPr":new a,"xdr:cNvPicPr":new o}}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){return this.parser?(this.parser.parseOpen(r),!0):(r.name===this.tag?this.reset():(this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)),!0)}parseText(){}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.parser=void 0),!0):r===this.tag?(this.model=this.map["xdr:cNvPr"].model,!1):!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"),a=s("../static-xform"),o=s("./cell-position-xform"),r=s("./ext-xform"),t=s("./pic-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:from":new o({tag:"xdr:from"}),"xdr:ext":new r({tag:"xdr:ext"}),"xdr:pic":new t,"xdr:clientData":new a({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){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e===this.tag?(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):!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"),a=s("../static-xform"),o=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 o,"xdr:spPr":new a(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){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0):e!==this.tag}}},{"../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"),a=s("../static-xform"),o=s("./cell-position-xform"),r=s("./pic-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:from":new o({tag:"xdr:from"}),"xdr:to":new o({tag:"xdr:to"}),"xdr:pic":new r,"xdr:clientData":new a({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){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t===this.tag?(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):!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(a){super(),this.tag=a.tag,this.always=!!a.always,this.count=a.count,this.empty=a.empty,this.$count=a.$count||"count",this.$=a.$,this.childXform=a.childXform,this.maxItems=a.maxItems}prepare(a,o){const{childXform:r}=this;a&&a.forEach((t,e)=>{o.index=e,r.prepare(t,o)})}render(a,o){if(this.always||o&&o.length){a.openNode(this.tag,this.$),this.count&&a.addAttribute(this.$count,o&&o.length||0);const{childXform:r}=this;(o||[]).forEach((t,e)=>{r.render(a,t,e)}),a.closeNode()}else this.empty&&a.leafNode(this.tag)}parseOpen(a){return this.parser?(this.parser.parseOpen(a),!0):a.name===this.tag?(this.model=[],!0):!!this.childXform.parseOpen(a)&&(this.parser=this.childXform,!0)}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser){if(!this.parser.parseClose(a)&&(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(a,o){if(a){const{childXform:r}=this;a.forEach(t=>{r.reconcile(t,o)})}}}},{"./base-xform":32}],72:[function(s,T,S){const m=s("../../../utils/col-cache"),a=s("../base-xform");T.exports=class extends a{get tag(){return"autoFilter"}render(o,r){if(r)if(typeof r=="string")o.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&&o.leafNode("autoFilter",{ref:`${e}:${l}`})}}parseOpen(o){o.name==="autoFilter"&&(this.model=o.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(s,T,S){const m=s("../../../utils/utils"),a=s("../base-xform"),o=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 a{constructor(){super(),this.richTextXForm=new t}get tag(){return"c"}prepare(l,n){const i=n.styles.addStyleModel(l.style||{},(function(f){return f.type===r.ValueType.Formula?e(f.result):f.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 f=n.formulae[l.sharedFormula];if(!f)throw new Error("Shared Formula master must exist above and or left of clone for cell "+l.address);f.si===void 0?(f.shareType="shared",f.si=n.siFormulae++,f.range=new o(f.address,l.address)):f.range&&f.range.expandToAddress(l.address),l.si=f.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 f=n.hyperlinkMap[l.address];f&&(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=f);const c=n.commentsMap&&n.commentsMap[l.address];c&&(l.comment=c)}}},{"../../../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(a,o){a.leafNode(this.tag,{iconSet:o.iconSet,iconId:o.iconId})}parseOpen(a){let{attributes:o}=a;this.model={iconSet:o.iconSet,iconId:m.toIntValue(o.iconId)}}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],75:[function(s,T,S){const{v4:m}=s("uuid"),a=s("../../base-xform"),o=s("../../composite-xform"),r=s("./databar-ext-xform"),t=s("./icon-set-ext-xform"),e={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends o{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,f){if(l.isExt(f))switch(f.type){case"dataBar":this.renderDataBar(i,f);break;case"iconSet":this.renderIconSet(i,f)}}renderDataBar(i,f){i.openNode(this.tag,{type:"dataBar",id:f.x14Id}),this.databarXform.render(i,f),i.closeNode()}renderIconSet(i,f){i.openNode(this.tag,{type:"iconSet",priority:f.priority,id:f.x14Id||`{${m()}}`}),this.iconSetXform.render(i,f),i.closeNode()}createNewModel(i){let{attributes:f}=i;return{type:f.type,x14Id:f.id,priority:a.toIntValue(f.priority)}}onParserClose(i,f){Object.assign(this.model,f.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"),a=s("./f-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"xm:f":this.fExtXform=new a}}get tag(){return"x14:cfvo"}render(o,r){o.openNode(this.tag,{type:r.type}),r.value!==void 0&&this.fExtXform.render(o,r.value),o.closeNode()}createNewModel(o){return{type:o.attributes.type}}onParserClose(o,r){o==="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"),a=s("./sqref-ext-xform"),o=s("./cf-rule-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"xm:sqref":this.sqRef=new a,"x14:cfRule":this.cfRule=new o}}get tag(){return"x14:conditionalFormatting"}prepare(r,t){r.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(r,t){t.rules.some(o.isExt)&&(r.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(o.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"),a=s("./cf-rule-ext-xform"),o=s("./conditional-formatting-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new o}}get tag(){return"x14:conditionalFormattings"}hasContent(r){return r.hasExtContent===void 0&&(r.hasExtContent=r.some(t=>t.rules.some(a.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"),a=s("../../composite-xform"),o=s("../../style/color-xform"),r=s("./cfvo-ext-xform");T.exports=class extends a{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new r,"x14:borderColor":this.borderColorXform=new o("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new o("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new o("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new o("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(":");l==="cfvo"?this.model.cfvo.push(e.model):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(a,o){a.leafNode(this.tag,null,o)}parseOpen(){this.model=""}parseText(a){this.model+=a}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],81:[function(s,T,S){const m=s("../../base-xform"),a=s("../../composite-xform"),o=s("./cfvo-ext-xform"),r=s("./cf-icon-ext-xform");T.exports=class extends a{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new o,"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(a,o){a.leafNode(this.tag,null,o)}parseOpen(){this.model=""}parseText(a){this.model+=a}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],83:[function(s,T,S){const m=s("../../base-xform"),a=s("../../composite-xform"),o=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},f=u=>{const{type:d,operator:h}=u;switch(d){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:d};default:return{type:d,operator:h}}};class c extends a{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,h){switch(h.type){case"expression":this.renderExpression(d,h);break;case"cellIs":this.renderCellIs(d,h);break;case"top10":this.renderTop10(d,h);break;case"aboveAverage":this.renderAboveAverage(d,h);break;case"dataBar":this.renderDataBar(d,h);break;case"colorScale":this.renderColorScale(d,h);break;case"iconSet":this.renderIconSet(d,h);break;case"containsText":this.renderText(d,h);break;case"timePeriod":this.renderTimePeriod(d,h)}}renderExpression(d,h){d.openNode(this.tag,{type:"expression",dxfId:h.dxfId,priority:h.priority}),this.formulaXform.render(d,h.formulae[0]),d.closeNode()}renderCellIs(d,h){d.openNode(this.tag,{type:"cellIs",dxfId:h.dxfId,priority:h.priority,operator:h.operator}),h.formulae.forEach(w=>{this.formulaXform.render(d,w)}),d.closeNode()}renderTop10(d,h){d.leafNode(this.tag,{type:"top10",dxfId:h.dxfId,priority:h.priority,percent:m.toBoolAttribute(h.percent,!1),bottom:m.toBoolAttribute(h.bottom,!1),rank:m.toIntValue(h.rank,10,!0)})}renderAboveAverage(d,h){d.leafNode(this.tag,{type:"aboveAverage",dxfId:h.dxfId,priority:h.priority,aboveAverage:m.toBoolAttribute(h.aboveAverage,!0)})}renderDataBar(d,h){d.openNode(this.tag,{type:"dataBar",priority:h.priority}),this.databarXform.render(d,h),this.extLstRefXform.render(d,h),d.closeNode()}renderColorScale(d,h){d.openNode(this.tag,{type:"colorScale",priority:h.priority}),this.colorScaleXform.render(d,h),d.closeNode()}renderIconSet(d,h){c.isPrimitive(h)&&(d.openNode(this.tag,{type:"iconSet",priority:h.priority}),this.iconSetXform.render(d,h),d.closeNode())}renderText(d,h){d.openNode(this.tag,{type:h.operator,dxfId:h.dxfId,priority:h.priority,operator:m.toStringAttribute(h.operator,"containsText")});const w=(_=>{if(_.formulae&&_.formulae[0])return _.formulae[0];const A=new o(_.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}})(h);w&&this.formulaXform.render(d,w),d.closeNode()}renderTimePeriod(d,h){d.openNode(this.tag,{type:"timePeriod",dxfId:h.dxfId,priority:h.priority,timePeriod:h.timePeriod});const w=(_=>{if(_.formulae&&_.formulae[0])return _.formulae[0];const A=new o(_.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}})(h);w&&this.formulaXform.render(d,w),d.closeNode()}createNewModel(d){let{attributes:h}=d;return{...f(h),dxfId:m.toIntValue(h.dxfId),priority:m.toIntValue(h.priority),timePeriod:h.timePeriod,percent:m.toBoolValue(h.percent),bottom:m.toBoolValue(h.bottom),rank:m.toIntValue(h.rank),aboveAverage:m.toBoolValue(h.aboveAverage)}}onParserClose(d,h){switch(d){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,h.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(h.model)}}}T.exports=c},{"../../../../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(a,o){a.leafNode(this.tag,{type:o.type,val:o.value})}parseOpen(a){this.model={type:a.attributes.type,value:m.toFloatValue(a.attributes.val)}}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],85:[function(s,T,S){const m=s("../../composite-xform"),a=s("../../style/color-xform"),o=s("./cfvo-xform");T.exports=class extends m{constructor(){super(),this.map={cfvo:this.cfvoXform=new o,color:this.colorXform=new a}}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"),a=s("./cf-rule-xform");T.exports=class extends m{constructor(){super(),this.map={cfRule:new a}}get tag(){return"conditionalFormatting"}render(o,r){r.rules.some(a.isPrimitive)&&(o.openNode(this.tag,{sqref:r.ref}),r.rules.forEach(t=>{a.isPrimitive(t)&&(t.ref=r.ref,this.map.cfRule.render(o,t))}),o.closeNode())}createNewModel(o){let{attributes:r}=o;return{ref:r.sqref,rules:[]}}onParserClose(o,r){this.model.rules.push(r.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(s,T,S){const m=s("../../base-xform"),a=s("./conditional-formatting-xform");T.exports=class extends m{constructor(){super(),this.cfXform=new a}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(o,r){let t=o.reduce((e,l)=>Math.max(e,...l.rules.map(n=>n.priority||0)),1);o.forEach(e=>{e.rules.forEach(l=>{l.priority||(l.priority=t++),l.style&&(l.dxfId=r.styles.addDxfStyle(l.style))})})}render(o,r){r.forEach(t=>{this.cfXform.render(o,t)})}parseOpen(o){return this.parser?(this.parser.parseOpen(o),!0):o.name==="conditionalFormatting"?(this.parser=this.cfXform,this.parser.parseOpen(o),!0):!1}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){return!!this.parser&&(!!this.parser.parseClose(o)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(o,r){o.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"),a=s("../../style/color-xform"),o=s("./cfvo-xform");T.exports=class extends m{constructor(){super(),this.map={cfvo:this.cfvoXform=new o,color:this.colorXform=new a}}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"),a=s("../../composite-xform");class o 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 a{constructor(){super(),this.map={"x14:id":this.idXform=new o}}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 a{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(a,o){a.leafNode(this.tag,null,o)}parseOpen(){this.model=""}parseText(a){this.model+=a}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],91:[function(s,T,S){const m=s("../../base-xform"),a=s("../../composite-xform"),o=s("./cfvo-xform");T.exports=class extends a{constructor(){super(),this.map={cfvo:this.cfvoXform=new o}}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"),a=s("../base-xform");T.exports=class extends a{get tag(){return"col"}prepare(o,r){const t=r.styles.addStyleModel(o.style||{});t&&(o.styleId=t)}render(o,r){o.openNode("col"),o.addAttribute("min",r.min),o.addAttribute("max",r.max),r.width&&o.addAttribute("width",r.width),r.styleId&&o.addAttribute("style",r.styleId),r.hidden&&o.addAttribute("hidden","1"),r.bestFit&&o.addAttribute("bestFit","1"),r.outlineLevel&&o.addAttribute("outlineLevel",r.outlineLevel),r.collapsed&&o.addAttribute("collapsed","1"),o.addAttribute("customWidth","1"),o.closeNode()}parseOpen(o){if(o.name==="col"){const r=this.model={min:parseInt(o.attributes.min||"0",10),max:parseInt(o.attributes.max||"0",10),width:o.attributes.width===void 0?void 0:parseFloat(o.attributes.width||"0")};return o.attributes.style&&(r.styleId=parseInt(o.attributes.style,10)),m.parseBoolean(o.attributes.hidden)&&(r.hidden=!0),m.parseBoolean(o.attributes.bestFit)&&(r.bestFit=!0),o.attributes.outlineLevel&&(r.outlineLevel=parseInt(o.attributes.outlineLevel,10)),m.parseBoolean(o.attributes.collapsed)&&(r.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(o,r){o.styleId&&(o.style=r.styles.getStyleModel(o.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../../../utils/utils"),o=s("../../../utils/col-cache"),r=s("../base-xform"),t=s("../../../doc/range");function e(n,i,f,c){const u=i[f];u!==void 0?n[f]=u:c!==void 0&&(n[f]=c)}function l(n,i,f,c){const u=i[f];u!==void 0&&(n[f]=a.parseBoolean(u))}T.exports=class extends r{get tag(){return"dataValidations"}render(n,i){const f=(function(c){const u=m.map(c,(w,_)=>({address:_,dataValidation:w,marked:!1})).sort((w,_)=>m.strcmp(w.address,_.address)),d=m.keyBy(u,"address"),h=(w,_,A)=>{for(let N=0;N<_;N++){const L=o.encodeAddress(w.row+N,A);if(!c[L]||!m.isEqual(c[w.address],c[L]))return!1}return!0};return u.map(w=>{if(!w.marked){const _=o.decodeEx(w.address);if(_.dimensions)return d[_.dimensions].marked=!0,{...w.dataValidation,sqref:w.address};let A=1,N=o.encodeAddress(_.row+A,_.col);for(;c[N]&&m.isEqual(w.dataValidation,c[N]);)A++,N=o.encodeAddress(_.row+A,_.col);let L=1;for(;h(_,A,_.col+L);)L++;for(let I=0;I<A;I++)for(let P=0;P<L;P++)N=o.encodeAddress(_.row+I,_.col+P),d[N].marked=!0;if(A>1||L>1){const I=_.row+(A-1),P=_.col+(L-1);return{...w.dataValidation,sqref:`${w.address}:${o.encodeAddress(I,P)}`}}return{...w.dataValidation,sqref:w.address}}return null}).filter(Boolean)})(i);f.length&&(n.openNode("dataValidations",{count:f.length}),f.forEach(c=>{n.openNode("dataValidation"),c.type!=="any"&&(n.addAttribute("type",c.type),c.operator&&c.type!=="list"&&c.operator!=="between"&&n.addAttribute("operator",c.operator),c.allowBlank&&n.addAttribute("allowBlank","1")),c.showInputMessage&&n.addAttribute("showInputMessage","1"),c.promptTitle&&n.addAttribute("promptTitle",c.promptTitle),c.prompt&&n.addAttribute("prompt",c.prompt),c.showErrorMessage&&n.addAttribute("showErrorMessage","1"),c.errorStyle&&n.addAttribute("errorStyle",c.errorStyle),c.errorTitle&&n.addAttribute("errorTitle",c.errorTitle),c.error&&n.addAttribute("error",c.error),n.addAttribute("sqref",c.sqref),(c.formulae||[]).forEach((u,d)=>{n.openNode("formula"+(d+1)),c.type==="date"?n.writeText(a.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(f=>{this.model[f]=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=a.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(a,o){o&&a.leafNode("dimension",{ref:o})}parseOpen(a){return a.name==="dimension"&&(this.model=a.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(a,o){o&&a.leafNode(this.tag,{"r:id":o.rId})}parseOpen(a){return a.name===this.tag?(this.model={rId:a.attributes["r:id"]},!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(s,T,S){const m=s("../composite-xform"),a=s("./cf-ext/conditional-formattings-ext-xform");class o extends m{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new a}}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 o}}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(a,o){if(o){a.addRollback();let r=!1;a.openNode("headerFooter"),o.differentFirst&&(a.addAttribute("differentFirst","1"),r=!0),o.differentOddEven&&(a.addAttribute("differentOddEven","1"),r=!0),o.oddHeader&&typeof o.oddHeader=="string"&&(a.leafNode("oddHeader",null,o.oddHeader),r=!0),o.oddFooter&&typeof o.oddFooter=="string"&&(a.leafNode("oddFooter",null,o.oddFooter),r=!0),o.evenHeader&&typeof o.evenHeader=="string"&&(a.leafNode("evenHeader",null,o.evenHeader),r=!0),o.evenFooter&&typeof o.evenFooter=="string"&&(a.leafNode("evenFooter",null,o.evenFooter),r=!0),o.firstHeader&&typeof o.firstHeader=="string"&&(a.leafNode("firstHeader",null,o.firstHeader),r=!0),o.firstFooter&&typeof o.firstFooter=="string"&&(a.leafNode("firstFooter",null,o.firstFooter),r=!0),r?(a.closeNode(),a.commit()):a.rollback()}}parseOpen(a){switch(a.name){case"headerFooter":return this.model={},a.attributes.differentFirst&&(this.model.differentFirst=parseInt(a.attributes.differentFirst,0)===1),a.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(a.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(a){switch(this.currentNode){case"oddHeader":this.model.oddHeader=a;break;case"oddFooter":this.model.oddFooter=a;break;case"evenHeader":this.model.evenHeader=a;break;case"evenFooter":this.model.evenFooter=a;break;case"firstHeader":this.model.firstHeader=a;break;case"firstFooter":this.model.firstFooter=a}}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(a,o){this.isInternalLink(o)?a.leafNode("hyperlink",{ref:o.address,"r:id":o.rId,tooltip:o.tooltip,location:o.target}):a.leafNode("hyperlink",{ref:o.address,"r:id":o.rId,tooltip:o.tooltip})}parseOpen(a){return a.name==="hyperlink"&&(this.model={address:a.attributes.ref,rId:a.attributes["r:id"],tooltip:a.attributes.tooltip},a.attributes.location&&(this.model.target=a.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(a){return a.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(a.target)}}},{"../base-xform":32}],99:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"mergeCell"}render(a,o){a.leafNode("mergeCell",{ref:o})}parseOpen(a){return a.name==="mergeCell"&&(this.model=a.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../../../doc/range"),o=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 a(e)}}get mergeCells(){return m.map(this.merges,t=>t.range)}reconcile(t,e){m.each(t,l=>{const n=o.decode(l);for(let i=n.top;i<=n.bottom;i++){const f=e[i-1];for(let c=n.left;c<=n.right;c++){const u=f.cells[c-1];u?u.type===r.ValueType.Merge&&(u.master=n.tl):f.cells[c]={type:r.ValueType.Null,address:o.encodeAddress(i,c)}}}})}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"),a=o=>o!==void 0;T.exports=class extends m{get tag(){return"outlinePr"}render(o,r){return!(!r||!a(r.summaryBelow)&&!a(r.summaryRight))&&(o.leafNode(this.tag,{summaryBelow:a(r.summaryBelow)?Number(r.summaryBelow):void 0,summaryRight:a(r.summaryRight)?Number(r.summaryRight):void 0}),!0)}parseOpen(o){return o.name===this.tag&&(this.model={summaryBelow:a(o.attributes.summaryBelow)?!!Number(o.attributes.summaryBelow):void 0,summaryRight:a(o.attributes.summaryRight)?!!Number(o.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(a,o){a.leafNode("brk",o)}parseOpen(a){return a.name==="brk"&&(this.model=a.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../base-xform");T.exports=class extends a{get tag(){return"pageMargins"}render(o,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)&&o.leafNode(this.tag,t)}}parseOpen(o){return o.name===this.tag?(this.model={left:parseFloat(o.attributes.left||.7),right:parseFloat(o.attributes.right||.7),top:parseFloat(o.attributes.top||.75),bottom:parseFloat(o.attributes.bottom||.75),header:parseFloat(o.attributes.header||.3),footer:parseFloat(o.attributes.footer||.3)},!0):!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(a,o){return!(!o||!o.fitToPage)&&(a.leafNode(this.tag,{fitToPage:o.fitToPage?"1":void 0}),!0)}parseOpen(a){return a.name===this.tag&&(this.model={fitToPage:a.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../base-xform");function o(l){return l?"1":void 0}function r(l){if(l==="overThenDown")return l}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 a{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:o(n.blackAndWhite),draft:o(n.draft),cellComments:t(n.cellComments),errors:e(n.errors),scale:n.scale,fitToWidth:n.fitToWidth,fitToHeight:n.fitToHeight,firstPageNumber:n.firstPageNumber,useFirstPageNumber:o(n.firstPageNumber),usePrinterDefaults:o(n.usePrinterDefaults),copies:n.copies};m.some(i,f=>f!==void 0)&&l.leafNode(this.tag,i)}}parseOpen(l){if(l.name===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;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(a,o){o&&a.leafNode(this.tag,{"r:id":o.rId})}parseOpen(a){return a.name===this.tag?(this.model={rId:a.attributes["r:id"]},!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../base-xform");function o(r){return r?"1":void 0}T.exports=class extends a{get tag(){return"printOptions"}render(r,t){if(t){const e={headings:o(t.showRowColHeaders),gridLines:o(t.showGridLines),horizontalCentered:o(t.horizontalCentered),verticalCentered:o(t.verticalCentered)};m.some(e,l=>l!==void 0)&&r.leafNode(this.tag,e)}}parseOpen(r){return r.name===this.tag?(this.model={showRowColHeaders:r.attributes.headings==="1",showGridLines:r.attributes.gridLines==="1",horizontalCentered:r.attributes.horizontalCentered==="1",verticalCentered:r.attributes.verticalCentered==="1"},!0):!1}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(s,T,S){const m=s("./page-breaks-xform"),a=s("../list-xform");T.exports=class extends a{constructor(){super({tag:"rowBreaks",count:!0,childXform:new m})}render(o,r){if(r&&r.length){o.openNode(this.tag,this.$),this.count&&(o.addAttribute(this.$count,r.length),o.addAttribute("manualBreakCount",r.length));const{childXform:t}=this;r.forEach(e=>{t.render(o,e)}),o.closeNode()}else this.empty&&o.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(s,T,S){const m=s("../base-xform"),a=s("../../../utils/utils"),o=s("./cell-xform");T.exports=class extends m{constructor(r){super(),this.maxItems=r&&r.maxItems,this.map={c:new o}}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)),a.parseBoolean(r.attributes.hidden)&&(e.hidden=!0),a.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)),a.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"),a=s("../base-xform");T.exports=class extends a{get tag(){return"sheetFormatPr"}render(o,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)&&o.leafNode("sheetFormatPr",t)}}parseOpen(o){return o.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(o.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(o.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(o.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(o.attributes.outlineLevelCol||"0",10)},o.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(o.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(s,T,S){const m=s("../base-xform"),a=s("../style/color-xform"),o=s("./page-setup-properties-xform"),r=s("./outline-properties-xform");T.exports=class extends m{constructor(){super(),this.map={tabColor:new a("tabColor"),pageSetUpPr:new o,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"),a=s("../base-xform");function o(t,e){return t?e:void 0}function r(t,e){return t===e||void 0}T.exports=class extends a{get tag(){return"sheetProtection"}render(t,e){if(e){const l={sheet:o(e.sheet,"1"),selectLockedCells:e.selectLockedCells===!1?"1":void 0,selectUnlockedCells:e.selectUnlockedCells===!1?"1":void 0,formatCells:o(e.formatCells,"0"),formatColumns:o(e.formatColumns,"0"),formatRows:o(e.formatRows,"0"),insertColumns:o(e.insertColumns,"0"),insertRows:o(e.insertRows,"0"),insertHyperlinks:o(e.insertHyperlinks,"0"),deleteColumns:o(e.deleteColumns,"0"),deleteRows:o(e.deleteRows,"0"),sort:o(e.sort,"0"),autoFilter:o(e.autoFilter,"0"),pivotTables:o(e.pivotTables,"0")};e.sheet&&(l.algorithmName=e.algorithmName,l.hashValue=e.hashValue,l.saltValue=e.saltValue,l.spinCount=e.spinCount,l.objects=o(e.objects===!1,"1"),l.scenarios=o(e.scenarios===!1,"1")),m.some(l,n=>n!==void 0)&&t.leafNode(this.tag,l)}}parseOpen(t){return t.name===this.tag?(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):!1}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(s,T,S){const m=s("../../../utils/col-cache"),a=s("../base-xform"),o={frozen:"frozen",frozenSplit:"frozen",split:"split"};T.exports=class extends a{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(c,u,d){d&&r.addAttribute(c,u)};let l,n,i,f;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,f=(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:f,state:"frozen"}),r.leafNode("selection",{pane:f,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;return r==="sheetView"?(this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:o[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):!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(a,o){o&&a.leafNode(this.tag,{"r:id":o.rId})}parseOpen(a){return a.name===this.tag?(this.model={rId:a.attributes["r:id"]},!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../../../utils/col-cache"),o=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"),f=s("./dimension-xform"),c=s("./hyperlink-xform"),u=s("./merge-cell-xform"),d=s("./data-validations-xform"),h=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={},j={};return y.forEach(z=>{R[z.ref]=z,z.rules.forEach($=>{const{x14Id:W}=$;W&&(j[W]=$)})}),k.forEach(z=>{z.rules.forEach($=>{const W=j[$.x14Id];W?((O,H)=>{Object.keys(H).forEach(E=>{const C=O[E],F=H[E];C===void 0&&F!==void 0&&(O[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:j,ignoreNodes:z}=k||{};this.ignoreNodes=z||[],this.map={sheetPr:new h,dimension:new f,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:j}),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 c}),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 j=k.rels=[];function z(O){return"rId"+(O.length+1)}if(k.hyperlinks.forEach(O=>{const H=z(j);O.rId=H,j.push({Id:H,Type:r.Hyperlink,Target:O.target,TargetMode:"External"})}),k.comments.length>0){const O={Id:z(j),Type:r.Comments,Target:`../comments${k.id}.xml`};j.push(O);const H={Id:z(j),Type:r.VmlDrawing,Target:`../drawings/vmlDrawing${k.id}.vml`};j.push(H),k.comments.forEach(E=>{E.refAddress=a.decodeAddress(E.ref)}),R.commentRefs.push({commentName:"comments"+k.id,vmlDrawing:"vmlDrawing"+k.id})}const $=[];let W;k.media.forEach(O=>{if(O.type==="background"){const H=z(j);W=R.media[O.imageId],j.push({Id:H,Type:r.Image,Target:`../media/${W.name}.${W.extension}`}),k.background={rId:H},k.image=R.media[O.imageId]}else if(O.type==="image"){let{drawing:H}=k;W=R.media[O.imageId],H||(H=k.drawing={rId:z(j),name:"drawing"+ ++R.drawingsCount,anchors:[],rels:[]},R.drawings.push(H),j.push({Id:H.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${H.name}.xml`}));let E=this.preImageId===O.imageId?$[O.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:O.range};if(O.hyperlinks&&O.hyperlinks.hyperlink){const F=z(H.rels);$[H.rels.length]=F,C.picture.hyperlinks={tooltip:O.hyperlinks.tooltip,rId:F},H.rels.push({Id:F,Type:r.Hyperlink,Target:O.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=O.imageId,H.anchors.push(C)}}),k.tables.forEach(O=>{const H=z(j);O.rId=H,j.push({Id:H,Type:r.Table,Target:"../tables/"+O.target}),O.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(o.StdDocAttributes),k.openNode("worksheet",g.WORKSHEET_ATTRIBUTES);const j=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&&(j.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},O=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,j),this.map.cols.render(k,R.cols),this.map.sheetData.render(k,R.rows),this.map.sheetProtection.render(k,O),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;if(k==="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 j={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(j,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}else return!0}reconcile(k,R){const j=(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 O=R.vmlDrawings[W.Target].comments;k.comments.forEach((H,E)=>{H.note=Object.assign({},H.note,O[E])})}return $},{});if(R.commentsMap=(k.comments||[]).reduce(($,W)=>(W.ref&&($[W.ref]=W),$),{}),R.hyperlinkMap=(k.hyperlinks||[]).reduce(($,W)=>(W.rId&&($[W.address]=j[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 $=j[k.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if($){const W=$[1];R.drawings[W].anchors.forEach(O=>{if(O.medium){const H={type:"image",imageId:O.medium.index,range:O.range,hyperlinks:O.picture.hyperlinks};k.media.push(H)}})}}const z=k.background&&j[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=j[$.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(a){super(),this.tag=a.tag,this.attr=a.attr}render(a,o){o&&(a.openNode(this.tag),a.closeNode())}parseOpen(a){a.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(a){super(),this.tag=a.tag,this.attr=a.attr,this.attrs=a.attrs,this._format=a.format||function(o){try{return Number.isNaN(o.getTime())?"":o.toISOString()}catch{return""}},this._parse=a.parse||function(o){return new Date(o)}}render(a,o){o&&(a.openNode(this.tag),this.attrs&&a.addAttributes(this.attrs),this.attr?a.addAttribute(this.attr,this._format(o)):a.writeText(this._format(o)),a.closeNode())}parseOpen(a){a.name===this.tag&&(this.attr?this.model=this._parse(a.attributes[this.attr]):this.text=[])}parseText(a){this.attr||this.text.push(a)}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(a){super(),this.tag=a.tag,this.attr=a.attr,this.attrs=a.attrs,this.zero=a.zero}render(a,o){(o||this.zero)&&(a.openNode(this.tag),this.attrs&&a.addAttributes(this.attrs),this.attr?a.addAttribute(this.attr,o):a.writeText(o),a.closeNode())}parseOpen(a){return a.name===this.tag&&(this.attr?this.model=parseInt(a.attributes[this.attr],10):this.text=[],!0)}parseText(a){this.attr||this.text.push(a)}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(a){super(),this.tag=a.tag,this.attr=a.attr,this.attrs=a.attrs}render(a,o){o!==void 0&&(a.openNode(this.tag),this.attrs&&a.addAttributes(this.attrs),this.attr?a.addAttribute(this.attr,o):a.writeText(o),a.closeNode())}parseOpen(a){a.name===this.tag&&(this.attr?this.model=a.attributes[this.attr]:this.text=[])}parseText(a){this.attr||this.text.push(a)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(s,T,S){const m=s("./base-xform"),a=s("../../utils/xml-stream");T.exports=class extends m{constructor(o){super(),this._model=o}render(o){if(!this._xml){const r=new a;(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}o.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(o){return o!==this._model.tag}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(s,T,S){const m=s("./text-xform"),a=s("./rich-text-xform"),o=s("../base-xform");T.exports=class extends o{constructor(){super(),this.map={r:new a,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}return r!==this.tag}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(s,T,S){const m=s("./text-xform"),a=s("../style/font-xform"),o=s("../base-xform");class r extends o{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 a(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"),a=s("./rich-text-xform"),o=s("./phonetic-text-xform"),r=s("../base-xform");T.exports=class extends r{constructor(t){super(),this.model=t,this.map={r:new a,t:new m,rPh:new o}}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}return t!==this.tag}}},{"../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"),a=s("../base-xform"),o=s("./shared-string-xform");T.exports=class extends a{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 o)}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;if(r==="sst")return!1;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(a,o){a.openNode("t"),/^\s|\n|\s$/.test(o)&&a.addAttribute("xml:space","preserve"),a.writeText(o),a.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(a,o)=>String.fromCharCode(parseInt(o,16)))}parseOpen(a){return a.name==="t"?(this._text=[],!0):!1}parseText(a){this._text.push(a)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(s,T,S){const m=s("../../../doc/enums"),a=s("../../../utils/utils"),o=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){return e==="vertical"||(e=a.validInt(e))>=-90&&e<=90?e:void 0},indent:e=>(e=a.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=a.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 o{get tag(){return"alignment"}render(e,l){e.addRollback(),e.openNode("alignment");let n=!1;function i(f,c){c&&(e.addAttribute(f,c),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(f,c,u){f&&(l[c]=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",a.parseBoolean(e.attributes.wrapText)),i(e.attributes.shrinkToFit,"shrinkToFit",a.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"),a=s("../../../utils/utils"),o=s("./color-xform");class r extends m{constructor(e){super(),this.name=e,this.map={color:new o}}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,f){i&&!i.color&&e.color&&(i={...i,color:e.color}),f.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){return this.parser?(this.parser.parseOpen(t),!0):t.name==="border"?(this.reset(),this.diagonalUp=a.parseBoolean(t.attributes.diagonalUp),this.diagonalDown=a.parseBoolean(t.attributes.diagonalDown),!0):(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,f){i&&(f&&Object.assign(i,f),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(a){super(),this.name=a||"color"}get tag(){return this.name}render(a,o){return!!o&&(a.openNode(this.name),o.argb?a.addAttribute("rgb",o.argb):o.theme!==void 0?(a.addAttribute("theme",o.theme),o.tint!==void 0&&a.addAttribute("tint",o.tint)):o.indexed!==void 0?a.addAttribute("indexed",o.indexed):a.addAttribute("auto","1"),a.closeNode(),!0)}parseOpen(a){return a.name===this.name&&(a.attributes.rgb?this.model={argb:a.attributes.rgb}:a.attributes.theme?(this.model={theme:parseInt(a.attributes.theme,10)},a.attributes.tint&&(this.model.tint=parseFloat(a.attributes.tint))):a.attributes.indexed?this.model={indexed:parseInt(a.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"),a=s("./alignment-xform"),o=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 a,border:new o,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 f={id:i.numFmtId,formatCode:i.numFmt};this.map.numFmt.render(n,f)}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){return this.parser?(this.parser.parseOpen(n),!0):n.name===this.tag?(this.reset(),!0):(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"),a=s("./color-xform");class o extends m{constructor(){super(),this.map={color:new a}}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 a("fgColor"),bgColor:new a("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){return this.parser?(this.parser.parseOpen(n),!0):n.name==="patternFill"?(this.model={type:"pattern",pattern:n.attributes.patternType},!0):(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 o}}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 f=this.map.stop;i.stops.forEach(c=>{f.render(n,c)}),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){return this.parser?(this.parser.parseOpen(n),!0):n.name==="fill"?(this.model={},!0):(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=o,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"),a=s("../simple/boolean-xform"),o=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(f){super(),this.options=f||n.OPTIONS,this.map={b:{prop:"bold",xform:new a({tag:"b",attr:"val"})},i:{prop:"italic",xform:new a({tag:"i",attr:"val"})},u:{prop:"underline",xform:new t},charset:{prop:"charset",xform:new o({tag:"charset",attr:"val"})},color:{prop:"color",xform:new m},condense:{prop:"condense",xform:new a({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new a({tag:"extend",attr:"val"})},family:{prop:"family",xform:new o({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new a({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 a({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new a({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new o({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(f,c){const{map:u}=this;f.openNode(this.options.tagName),e.each(this.map,(d,h)=>{u[h].xform.render(f,c[d.prop])}),f.closeNode()}parseOpen(f){return this.parser?(this.parser.parseOpen(f),!0):this.map[f.name]?(this.parser=this.map[f.name].xform,this.parser.parseOpen(f)):f.name===this.options.tagName?(this.model={},!0):!1}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser&&!this.parser.parseClose(f)){const c=this.map[f];return this.parser.model&&(this.model[c.prop]=this.parser.model),this.parser=void 0,!0}return f!==this.options.tagName}}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"),a=s("../../defaultnumformats"),o=s("../base-xform"),r=(function(){const e={};return m.each(a,(l,n)=>{l.f&&(e[l.f]=parseInt(n,10))}),e})();class t extends o{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){return l.name==="numFmt"?(this.model={id:parseInt(l.attributes.numFmtId,10),formatCode:l.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0):!1}parseText(){}parseClose(){return!1}}t.getDefaultFmtId=function(e){return r[e]},t.getDefaultFmtCode=function(e){return a[e]&&a[e].f},T.exports=t},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(s,T,S){const m=s("../base-xform"),a={boolean:(o,r)=>o===void 0?r:o};T.exports=class extends m{get tag(){return"protection"}render(o,r){o.addRollback(),o.openNode("protection");let t=!1;function e(l,n){n!==void 0&&(o.addAttribute(l,n),t=!0)}e("locked",a.boolean(r.locked,!0)?void 0:"0"),e("hidden",a.boolean(r.hidden,!1)?"1":void 0),o.closeNode(),t?o.commit():o.rollback()}parseOpen(o){const r={locked:o.attributes.locked!=="0",hidden:o.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"),a=s("./alignment-xform"),o=s("./protection-xform");T.exports=class extends m{constructor(r){super(),this.xfId=!(!r||!r.xfId),this.map={alignment:new a,protection:new o}}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"),a=s("../../../utils/xml-stream"),o=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"),f=s("./style-xform"),c=s("./dxf-xform");class u extends o{constructor(h){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 f}),cellXfs:new t({tag:"cellXfs",count:!0,childXform:new f({xfId:!0})}),dxfs:new t({tag:"dxfs",always:!0,count:!0,childXform:new c}),numFmt:new i,font:new e,fill:new l,border:new n,style:new f({xfId:!0}),cellStyles:u.STATIC_XFORMS.cellStyles,tableStyles:u.STATIC_XFORMS.tableStyles,extLst:u.STATIC_XFORMS.extLst},h&&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(h,w){w=w||this.model,h.openXml(a.StdDocAttributes),h.openNode("styleSheet",u.STYLESHEET_ATTRIBUTES),this.index?(w.numFmts&&w.numFmts.length&&(h.openNode("numFmts",{count:w.numFmts.length}),w.numFmts.forEach(_=>{h.writeXml(_)}),h.closeNode()),w.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),h.openNode("fonts",{count:w.fonts.length,"x14ac:knownFonts":1}),w.fonts.forEach(_=>{h.writeXml(_)}),h.closeNode(),h.openNode("fills",{count:w.fills.length}),w.fills.forEach(_=>{h.writeXml(_)}),h.closeNode(),h.openNode("borders",{count:w.borders.length}),w.borders.forEach(_=>{h.writeXml(_)}),h.closeNode(),this.map.cellStyleXfs.render(h,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),h.openNode("cellXfs",{count:w.styles.length}),w.styles.forEach(_=>{h.writeXml(_)}),h.closeNode()):(this.map.numFmts.render(h,w.numFmts),this.map.fonts.render(h,w.fonts),this.map.fills.render(h,w.fills),this.map.borders.render(h,w.borders),this.map.cellStyleXfs.render(h,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(h,w.styles)),u.STATIC_XFORMS.cellStyles.render(h),this.map.dxfs.render(h,w.dxfs),u.STATIC_XFORMS.tableStyles.render(h),u.STATIC_XFORMS.extLst.render(h),h.closeNode()}parseOpen(h){return this.parser?(this.parser.parseOpen(h),!0):h.name==="styleSheet"?(this.initIndex(),!0):(this.parser=this.map[h.name],this.parser&&this.parser.parseOpen(h),!0)}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){if(this.parser)return this.parser.parseClose(h)||(this.parser=void 0),!0;switch(h){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(h,w){if(!h)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(h))return this.weakMap.get(h);const _={};if(w=w||m.ValueType.Number,h.numFmt)_.numFmtId=this._addNumFmtStr(h.numFmt);else switch(w){case m.ValueType.Number:_.numFmtId=this._addNumFmtStr("General");break;case m.ValueType.Date:_.numFmtId=this._addNumFmtStr("mm-dd-yy")}h.font&&(_.fontId=this._addFont(h.font)),h.border&&(_.borderId=this._addBorder(h.border)),h.fill&&(_.fillId=this._addFill(h.fill)),h.alignment&&(_.alignment=h.alignment),h.protection&&(_.protection=h.protection);const A=this._addStyle(_);return this.weakMap&&this.weakMap.set(h,A),A}getStyleModel(h){const w=this.model.styles[h];if(!w)return null;let _=this.index.model[h];if(_)return _;if(_=this.index.model[h]={},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(h){return h.numFmt&&(h.numFmtId=this._addNumFmtStr(h.numFmt)),this.model.dxfs.push(h),this.model.dxfs.length-1}getDxfStyle(h){return this.model.dxfs[h]}_addStyle(h){const w=this.map.style.toXml(h);let _=this.index.style[w];return _===void 0&&(_=this.index.style[w]=this.model.styles.length,this.model.styles.push(w)),_}_addNumFmtStr(h){let w=i.getDefaultFmtId(h);if(w!==void 0||(w=this.index.numFmt[h],w!==void 0))return w;w=this.index.numFmt[h]=164+this.model.numFmts.length;const _=this.map.numFmt.toXml({id:w,formatCode:h});return this.model.numFmts.push(_),w}_addFont(h){const w=this.map.font.toXml(h);let _=this.index.font[w];return _===void 0&&(_=this.index.font[w]=this.model.fonts.length,this.model.fonts.push(w)),_}_addBorder(h){const w=this.map.border.toXml(h);let _=this.index.border[w];return _===void 0&&(_=this.index.border[w]=this.model.borders.length,this.model.borders.push(w)),_}_addFill(h){const w=this.map.fill.toXml(h);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,h){return h===m.ValueType.Date?this.dateStyleId: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 a 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=a.Attributes[t];e&&r.leafNode("u",e)}}parseOpen(r){r.name==="u"&&(this.model=r.attributes.val||!0)}parseText(){}parseClose(){return!1}}a.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},T.exports=a},{"../base-xform":32}],137:[function(s,T,S){const m=s("../base-xform"),a=s("./filter-column-xform");T.exports=class extends m{constructor(){super(),this.map={filterColumn:new a}}get tag(){return"autoFilter"}prepare(o){o.columns.forEach((r,t)=>{this.map.filterColumn.prepare(r,{index:t})})}render(o,r){return o.openNode(this.tag,{ref:r.autoFilterRef}),r.columns.forEach(t=>{this.map.filterColumn.render(o,t)}),o.closeNode(),!0}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:return this.model={autoFilterRef:o.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[o.name],this.parser)return this.parseOpen(o),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(o))}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser)return this.parser.parseClose(o)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;if(o===this.tag)return!1;throw new Error("Unexpected xml node in parseClose: "+o)}}},{"../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(a,o){a.leafNode(this.tag,{val:o.val,operator:o.operator})}parseOpen(a){return a.name===this.tag&&(this.model={val:a.attributes.val,operator:a.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(s,T,S){const m=s("../base-xform"),a=s("../list-xform"),o=s("./custom-filter-xform"),r=s("./filter-xform");T.exports=class extends m{constructor(){super(),this.map={customFilters:new a({tag:"customFilters",count:!1,empty:!0,childXform:new o}),filters:new a({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){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t===this.tag?(this.model.customFilters=this.map.customFilters.model,!1):!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(a,o){a.leafNode(this.tag,{val:o.val})}parseOpen(a){return a.name===this.tag&&(this.model={val:a.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(a,o){a.id=o.index+1}render(a,o){return a.leafNode(this.tag,{id:o.id.toString(),name:o.name,totalsRowLabel:o.totalsRowLabel,totalsRowFunction:o.totalsRowFunction,dxfId:o.dxfId}),!0}parseOpen(a){if(a.name===this.tag){const{attributes:o}=a;return this.model={name:o.name,totalsRowLabel:o.totalsRowLabel,totalsRowFunction:o.totalsRowFunction,dxfId:o.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(a,o){return a.leafNode(this.tag,{name:o.theme?o.theme:void 0,showFirstColumn:o.showFirstColumn?"1":"0",showLastColumn:o.showLastColumn?"1":"0",showRowStripes:o.showRowStripes?"1":"0",showColumnStripes:o.showColumnStripes?"1":"0"}),!0}parseOpen(a){if(a.name===this.tag){const{attributes:o}=a;return this.model={theme:o.name?o.name:null,showFirstColumn:o.showFirstColumn==="1",showLastColumn:o.showLastColumn==="1",showRowStripes:o.showRowStripes==="1",showColumnStripes:o.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(s,T,S){const m=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("../list-xform"),r=s("./auto-filter-xform"),t=s("./table-column-xform"),e=s("./table-style-info-xform");class l extends a{constructor(){super(),this.map={autoFilter:new r,tableColumns:new o({tag:"tableColumns",count:!0,empty:!0,childXform:new t}),tableStyleInfo:new e}}prepare(i,f){this.map.autoFilter.prepare(i),this.map.tableColumns.prepare(i.columns,f)}get tag(){return"table"}render(i,f){i.openXml(m.StdDocAttributes),i.openNode(this.tag,{...l.TABLE_ATTRIBUTES,id:f.id,name:f.name,displayName:f.displayName||f.name,ref:f.tableRef,totalsRowCount:f.totalsRow?"1":void 0,totalsRowShown:f.totalsRow?void 0:"1",headerRowCount:f.headerRow?"1":"0"}),this.map.autoFilter.render(i,f),this.map.tableColumns.render(i,f.columns),this.map.tableStyleInfo.render(i,f.style),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;const{name:f,attributes:c}=i;return f===this.tag?(this.reset(),this.model={name:c.name,displayName:c.displayName||c.name,tableRef:c.ref,totalsRow:c.totalsRowCount==="1",headerRow:c.headerRowCount==="1"}):(this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)),!0}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return this.parser?(this.parser.parseClose(i)||(this.parser=void 0),!0):i===this.tag?(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((f,c)=>{this.model.columns[c].filterButton=f.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1):!0}reconcile(i,f){i.columns.forEach(c=>{c.dxfId!==void 0&&(c.style=f.styles.getDxfStyle(c.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,a){(function(){const o=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:f}=s("../utils/browser-buffer-decode"),c=s("./xform/style/styles-xform"),u=s("./xform/core/core-xform"),d=s("./xform/strings/shared-strings-xform"),h=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=o.createReadStream(M);try{const b=await this.read(p,v);return p.close(),b}catch(b){throw p.close(),b}}parseRels(M){return new h().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((O,H)=>(O[H.Id]=H,O),{}),($.anchors||[]).forEach(O=>{const H=O.picture&&O.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 j={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,j)}),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 h,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 j=new l;j.on("finish",()=>{v.mediaIndex[p]=v.media.length,v.mediaIndex[y]=v.media.length;const z={type:"image",name:y,extension:g,buffer:j.toBuffer()};v.media.push(z),k()}),M.on("error",z=>{R(z)}),M.pipe(j)})}}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 h,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(a.concat(p),v)}async load(M,v){let p;p=v&&v.base64?a.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 j;k=new t({writableObjectMode:!0,readableObjectMode:!0}),j=m.browser?f(await y.async("nodebuffer")):await y.async("string");const z=16384;for(let $=0;$<j.length;$+=z)k.write(j.substring($,$+z))}switch(k.end(),R){case"_rels/.rels":b.globalRels=await this.parseRels(k);break;case"xl/workbook.xml":{const j=await this.parseWorkbook(k);b.sheets=j.sheets,b.definedNames=j.definedNames,b.views=j.views,b.properties=j.properties,b.calcProperties=j.calcProperties;break}case"xl/_rels/workbook.xml.rels":b.workbookRels=await this.parseRels(k);break;case"xl/sharedStrings.xml":b.sharedStrings=new d,await b.sharedStrings.parseStream(k);break;case"xl/styles.xml":b.styles=new c,await b.styles.parseStream(k);break;case"docProps/app.xml":{const j=new _,z=await j.parseStream(k);b.company=z.company,b.manager=z.manager;break}case"docProps/core.xml":{const j=new u,z=await j.parseStream(k);Object.assign(b,z);break}default:{let j=R.match(/xl\/worksheets\/sheet(\d+)[.]xml/);if(j){await this._processWorksheetEntry(k,b,j[1],v,R);break}if(j=R.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml.rels/),j){await this._processWorksheetRelsEntry(k,b,j[1]);break}if(j=R.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),j){await this._processThemeEntry(k,b,j[1]);break}if(j=R.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),j){await this._processMediaEntry(k,b,j[1]);break}if(j=R.match(/xl\/drawings\/([a-zA-Z0-9]+)[.]xml/),j){await this._processDrawingEntry(k,b,j[1]);break}if(j=R.match(/xl\/(comments\d+)[.]xml/),j){await this._processCommentEntry(k,b,j[1]);break}if(j=R.match(/xl\/tables\/(table\d+)[.]xml/),j){await this._processTableEntry(k,b,j[1]);break}if(j=R.match(/xl\/drawings\/_rels\/([a-zA-Z0-9]+)[.]xml[.]rels/),j){await this._processDrawingRelsEntry(k,b,j[1]);break}if(j=R.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),j){await this._processVmlDrawingEntry(k,b,j[1]);break}}}}return this.reconcile(b,v),this.workbook.model=b,this.workbook}async addMedia(M,v){await Promise.all(v.media.map(async p=>{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,j)=>{o.readFile(y,k,(z,$)=>{z?j(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 h;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 h().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 h().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 h,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 c(!0):new c.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=o.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=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
3
  <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`},{}],146:[function(s,T,S){(function(m){(function(){Object.defineProperty(S,"__esModule",{value:!0}),S.CsvFormatterStream=void 0;const a=s("stream"),o=s("./formatter");class r extends a.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new o.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,(f,c)=>f?(i=!0,n(f)):(c&&c.forEach(u=>{this.push(m.from(u,"utf8"))}),i=!0,n()))}catch(f){if(i)throw f;n(f)}}_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 a;this.objectMode=!0,this.delimiter=",",this.rowDelimiter=`
4
4
  `,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?.quoteHeaders===void 0&&(this.quoteHeaders=this.quoteColumns),m?.quote===!0?this.quote='"':m?.quote===!1&&(this.quote=""),typeof m?.escape!="string"&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((a=m.writeHeaders)===null||a===void 0||a),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 a=m(s("lodash.isboolean")),o=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|
@@ -1,4 +1,4 @@
1
- import { c as Kt } from "./index-CzUW2GJH.js";
1
+ import { c as Kt } from "./index-FtElnBdx.js";
2
2
  function Ve(xe, Fe) {
3
3
  for (var s = 0; s < Fe.length; s++) {
4
4
  const T = Fe[s];
@@ -394,4 +394,4 @@ end`},cb=function(){for(var l=[],t=0;t<arguments.length;t++)l[t]=arguments[t];re
394
394
  font-weight: normal;
395
395
  font-style: normal;
396
396
  }
397
- `,document.head.appendChild(t),rh.add(l.value)}async function Tx(l){if(!(!l.external||!l.url||rh.has(l.value)))try{const t=new FontFace(l.value,`url(${l.url})`);await t.load(),document.fonts.add(t),rh.add(l.value)}catch{Sx(l)}}const Z0=80,Mx=({annotation:l,onAdd:t,default_signatures:e})=>{const{defaultOptions:n}=dr(),i=n.signature.colors,a=420,s=200,c=n.signature.type,o=n.signature.maxSize,r=n.signature.accept,U=600,Z=n.signature.defaultFont,{t:F}=si(["common","annotator"],{useSuspense:!1}),u=Rt.useRef(null),W=Rt.useRef(null),V=Rt.useRef(i[0]),R=Rt.useRef(null),[Q,S]=Rt.useState(!1),[N,G]=Rt.useState(V.current),[y,k]=Rt.useState(!0),[I,X]=Rt.useState([]),[Y,L]=Rt.useState(null),[g,j]=Rt.useState(""),[A,et]=Rt.useState(Z[0]?.value||"Arial"),[$,nt]=Rt.useState(null),[x,O]=Rt.useState(!1),P=Rt.useMemo(()=>e||n.signature.defaultSignature,[e]),tt=o;Rt.useEffect(()=>{V.current=N},[N]);const q=ct=>{t(ct)},Wt=async ct=>{const Nt=Z.find(St=>St.value===ct);Nt&&Nt.external&&await Tx(Nt),et(ct)},ut=()=>{if(!g.trim())return null;const ct=document.createElement("canvas");ct.width=a/1.1,ct.height=s;const Nt=ct.getContext("2d");if(!Nt)return null;const St=20;Nt.clearRect(0,0,ct.width,ct.height),Nt.font=`${Z0}px "${A}", cursive, sans-serif`;let Lt=Nt.measureText(g).width;const Ct=Lt+St*2>ct.width?(ct.width-St*2)/Lt:1;return Nt.font=`${Z0*Ct}px "${A}", cursive, sans-serif`,Nt.textAlign="center",Nt.textBaseline="middle",Nt.imageSmoothingEnabled=!0,Nt.shadowColor="rgba(0, 0, 0, 0.1)",Nt.shadowBlur=2,Nt.shadowOffsetX=1,Nt.shadowOffsetY=1,Nt.fillStyle=N,Nt.fillText(g,ct.width/2,ct.height/2),ct.toDataURL("image/png")},Qt=()=>{if(Y==="Upload"){$&&(X(ct=>[...ct,$]),q($),S(!1));return}if(Y==="Enter"){const ct=ut();ct&&(X(Nt=>[...Nt,ct]),q(ct),S(!1));return}if(Y==="Draw"){const ct=W.current?.toDataURL();ct&&(X(Nt=>[...Nt,ct]),q(ct),S(!1));return}},Xt=()=>{const ct=W.current;ct&&(ct.clear(),ct.getLayers().forEach(Nt=>Nt.destroyChildren()),k(!0)),j(""),nt(null)},ht=()=>{if(!u.current)return;const ct=new $t.Stage({container:u.current,width:a,height:s}),Nt=new $t.Layer;ct.add(Nt),W.current=ct;let St=!1,Lt=null;const Ct=()=>{St=!0;const At=ct.getPointerPosition();At&&(Lt=new $t.Line({stroke:V.current,strokeWidth:3,globalCompositeOperation:"source-over",lineCap:"round",lineJoin:"round",points:[At.x,At.y]}),Nt.add(Lt))},he=At=>{if(!St||!Lt)return;At.evt.preventDefault();const te=ct.getPointerPosition();if(!te)return;const le=Lt.points().concat([te.x,te.y]);Lt.points(le),k(!1)},Pt=()=>{St=!1,Lt=null};ct.on("mousedown touchstart",Ct),ct.on("mouseup touchend",Pt),ct.on("mousemove touchmove",he)},K=ct=>{G(ct),(W.current?.getLayers()[0].getChildren(St=>St.getClassName()==="Line")||[]).forEach(St=>St.stroke(ct))},it=ct=>{const Nt=ct.target,St=Nt.files;if(!St?.length)return;const Lt=St[0];if(Lt.size>tt){O(!0),setTimeout(()=>O(!1),3e3),Nt&&(Nt.value="");return}const Ct=new FileReader;Ct.onload=async he=>{const Pt=he.target?.result,At=new Image;At.src=Pt,At.onload=()=>{const te=U,le=U;let{width:ke,height:qe}=At;ke>qe&&ke>te?(qe=Math.round(qe*te/ke),ke=te):qe>le&&(ke=Math.round(ke*le/qe),qe=le);const ul=document.createElement("canvas"),Me=ul.getContext("2d");if(ul.width=ke,ul.height=qe,Me){Me.drawImage(At,0,0,ke,qe);const bl=ul.toDataURL("image/png");Nt.value="",nt(bl),k(!1)}}},Ct.readAsDataURL(Lt)};return Rt.useEffect(()=>{j(""),nt(null),(Y==="Enter"||Y==="Draw"||Y==="Upload")&&k(!0)},[Y]),Rt.useEffect(()=>{k(g.trim().length===0)},[g]),Rt.useEffect(()=>{Q&&(Wt(A),j(""),nt(null),L(c))},[Q]),Rt.useEffect(()=>{Q&&Y==="Draw"?setTimeout(()=>{ht()},300):(W.current?.destroy(),W.current=null)},[Y,Q]),B.jsxs(B.Fragment,{children:[B.jsxs(_o,{children:[B.jsx(qo,{children:B.jsx(Jd,{title:F(`annotator:tool.${l.name}`),icon:l.icon})}),B.jsx($o,{size:"1",style:{width:180},onCloseAutoFocus:ct=>ct.preventDefault(),children:B.jsxs("div",{className:fi.SignaturePop,children:[B.jsxs("ul",{className:fi.container,children:[P.map((ct,Nt)=>B.jsx(Xs,{children:B.jsx("li",{onClick:()=>q(ct),children:B.jsx("img",{src:ct})},Nt)},Nt)),I.map((ct,Nt)=>B.jsx(Xs,{children:B.jsx("li",{onClick:()=>q(ct),children:B.jsx("img",{src:ct})},Nt)},Nt))]}),B.jsx(Xs,{children:B.jsxs(Dl,{style:{width:"100%"},variant:"soft",onClick:()=>{S(!0)},children:[B.jsx(R2,{})," ",F("annotator:common.createSignature")]})})]})})]}),B.jsxs(ku,{open:Q,onOpenChange:S,children:[B.jsx(Du,{}),B.jsxs(Iu,{style:{width:"550px"},children:[B.jsx(zu,{children:F("annotator:common.createSignature")}),B.jsx(ye,{as:"span",justify:"center",mb:"4",children:B.jsxs(Eu,{size:"3",defaultValue:c,onValueChange:ct=>L(ct),radius:"full",children:[B.jsx(za,{value:"Enter",children:F("enter")}),B.jsx(za,{value:"Draw",children:F("draw")}),B.jsx(za,{value:"Upload",children:F("annotator:editor.signature.upload")})]})}),B.jsxs("div",{className:fi.SignatureTool,children:[B.jsxs("div",{className:fi.container,style:{width:a},children:[Y==="Enter"&&B.jsx("input",{autoFocus:!0,type:"text",value:g,onChange:ct=>j(ct.target.value),placeholder:F("annotator:editor.signature.area"),style:{height:s-2,width:a/1.1,color:N,fontFamily:`${A}`,fontSize:Z0,lineHeight:`${Z0}px`}}),Y==="Draw"&&B.jsxs(B.Fragment,{children:[B.jsx("div",{className:fi.info,children:F("annotator:editor.signature.area")}),B.jsx("div",{ref:u,style:{height:s,width:a}})]}),Y==="Upload"&&B.jsx("div",{style:{height:s,width:a},children:$?B.jsx("div",{className:fi.imagePreview,style:{height:s,width:a},children:B.jsx("img",{src:$,alt:"preview"})}):B.jsxs("div",{style:{height:s,width:a},children:[B.jsx("input",{style:{display:"none"},type:"file",ref:R,accept:r,onChange:it}),B.jsxs(ye,{height:`${s}px`,direction:"column",gap:"3",justify:"center",align:"center",children:[B.jsxs(Dl,{size:"3",onClick:()=>{R.current?.click()},children:[B.jsx(V2,{})," ",F("annotator:editor.signature.choose")]}),B.jsx(el,{color:"gray",size:"2",style:{textAlign:"center"},children:F("annotator:editor.signature.uploadHint",{format:r,maxSize:GF(o)})}),x&&B.jsx(Eh,{color:"red",mt:"3",children:B.jsx(xh,{children:F("fileSizeLimit",{value:GF(tt)})})})]})]})})]}),B.jsx("div",{className:fi.toolbar,style:{width:a},children:B.jsxs(ye,{justify:"between",align:"center",gap:"2",children:[B.jsxs("div",{className:fi.colorPalette,children:[Y!=="Upload"&&B.jsx(B.Fragment,{children:i.map(ct=>B.jsx("div",{onClick:()=>K(ct),className:`${fi.cell} ${ct===N?fi.active:""}`,children:B.jsx("span",{style:{backgroundColor:ct}})},ct))}),Y==="Enter"&&B.jsx(B.Fragment,{children:B.jsxs(ho,{onValueChange:async ct=>{await Wt(ct)},defaultValue:A,size:"1",children:[B.jsx(Uo,{}),B.jsx(Zo,{children:Z.map(ct=>B.jsx(ys,{value:ct.value,children:ct.label},ct.value))})]})})]}),B.jsx(Dl,{variant:"ghost",mr:"3",onClick:Xt,children:F("clear")})]})}),B.jsxs(ye,{gap:"3",mt:"4",justify:"end",children:[B.jsx(Bo,{children:B.jsx(Dl,{style:{width:100},variant:"soft",color:"gray",children:F("cancel")})}),B.jsx(Bo,{children:B.jsx(Dl,{disabled:y,style:{width:100},onClick:Qt,children:F("ok")})})]})]})]})]})]})},yx=({defaultAnnotationName:l,stamps:t,signatures:e})=>{const{t:n}=si(["annotator"],{useSuspense:!1}),{defaultOptions:i}=dr(),{painter:a}=Cd(),s=Rt.useRef(null),c=Rt.useCallback((S,N)=>{const G=S?.type??null;if(s.current===G)return;s.current=G;const y=[We.SIGNATURE,We.STAMP].includes(S?.type)?N:null;a?.activate(S,y)},[a]),o=Rt.useMemo(()=>l&&ki.find(S=>S.name===l)||null,[l]),r=Al(S=>S.currentAnnotationType),U=Al(S=>S.setCurrentAnnotationType),Z=r?.type,F=!r?.styleEditable?.color,[u,W]=Rt.useState(ki.filter(S=>S.webSelectionDependencies===!1));Rt.useEffect(()=>()=>{s.current=null,U(null),c(null,null)},[]),Rt.useEffect(()=>{o&&(U(o),c(o,null))},[o,U,c]);const V=Rt.useCallback((S,N)=>{U(S),c(S,N)},[c,U]);Rt.useEffect(()=>{c(r,null)},[r,c]);const R=S=>{if(!r)return;const N={...r,style:{...r.style,color:S}},G=u.map(y=>y.type===r.type?{...y,style:{...y.style,color:S}}:y);W(G),U(N),a?.activate(N,null)},Q=u.map((S,N)=>{const G=S.type===Z;switch(S.type){case We.STAMP:return B.jsx(Fx,{default_stamps:t,annotation:S,onAdd:y=>V(S,y)},N);case We.SIGNATURE:return B.jsx(Mx,{default_signatures:e,annotation:S,onAdd:y=>V(S,y)},N);default:return B.jsx(Jd,{selected:G,title:n(`annotator:tool.${S.name}`),icon:S.icon,onClick:()=>V(G?null:S,null)},N)}});return B.jsxs(ye,{gap:"3",align:"center",children:[B.jsx(IF,{}),B.jsx(ma,{orientation:"vertical"}),Q,B.jsx(ma,{orientation:"vertical"}),B.jsx(po,{value:r?.style?.color||i.colors[0],onChange:R,presets:i.colors,popover:!0,trigger:B.jsx(Jd,{disabled:F,icon:B.jsx(uk,{style:{color:r?.style?.color}})})})]})},Gx={colors:["#ff6b6b","#ffa94d","#ffe066","#b4fa56","#51cf66","#4dabf7","#228be6","#364fc7","#9c36b5","#e64980","#1272e8","#04861b","#da3324","#000000","#fefefe"],signature:{colors:["#000000","#ff0000","#1677ff"],type:"Enter",maxSize:1024*1024*5,accept:".png,.jpg,.jpeg,.bmp",defaultSignature:[],defaultFont:[{label:"楷体",value:"STKaiti",external:!1}]},stamp:{maxSize:1024*1024*5,accept:".png,.jpg,.jpeg,.bmp",defaultStamp:[],editor:{defaultBackgroundColor:"#2f9e44",defaultBorderColor:"#2b8a3e",defaultBorderStyle:"none",defaultTextColor:"#fff",defaultFont:[{label:"Arial",value:"Arial"},{label:"Times New Roman",value:"Times New Roman"},{label:"Georgia",value:"Georgia"},{label:"Verdana",value:"Verdana"},{label:"Tahoma",value:"Tahoma, Geneva, sans-serif"},{label:"Trebuchet MS",value:'"Trebuchet MS", sans-serif'},{label:"Courier New",value:'"Courier New", Courier, monospace'},{label:"Lucida Console",value:'"Lucida Console", Monaco, monospace'},{label:"宋体",value:'SimSun, Songti SC, STSong, 宋体, "Noto Serif SC", serif'},{label:"黑体",value:"Microsoft YaHei, PingFang SC, Heiti SC, SimHei, 黑体, sans-serif"},{label:"楷体",value:'KaiTi, KaiTi_GB2312, STFangsong, 楷体, "AR PL UKai CN", serif'}]}}},Jx="_filter_1lw4f_1",Xx="_sidebar_1lw4f_17",Yx="_list_1lw4f_17",Bx="_group_1lw4f_21",Lx="_comment_1lw4f_24",kx="_title_1lw4f_37",Ix="_username_1lw4f_42",zx="_tool_1lw4f_49",Dx="_reply_1lw4f_54",Ex="_selected_1lw4f_70",Kn={filter:Jx,sidebar:Xx,list:Yx,group:Bx,comment:Lx,title:kx,username:Ix,tool:zx,reply:Dx,selected:Ex},xx={Circle:B.jsx(Y2,{}),FreeText:B.jsx(J2,{}),Ink:B.jsx(Ms,{}),Highlight:B.jsx(Ou,{}),Underline:B.jsx(Hu,{}),Squiggly:B.jsx(B2,{}),StrikeOut:B.jsx(Ku,{}),Stamp:B.jsx(k2,{}),Line:B.jsx(Ms,{}),Square:B.jsx(X2,{}),Polygon:B.jsx(Ms,{}),PolyLine:B.jsx(D2,{}),Caret:B.jsx(L2,{}),Link:B.jsx(Ms,{}),Text:B.jsx(WF,{}),FileAttachment:B.jsx(Wk,{}),Popup:B.jsx(Ms,{}),Widget:B.jsx(Ms,{}),Note:B.jsx(WF,{}),Arrow:B.jsx(z2,{}),None:void 0},fZ={[ji.Accepted]:{labelKey:"annotator:comment.status.accepted",icon:B.jsx(FL,{})},[ji.Rejected]:{labelKey:"annotator:comment.status.rejected",icon:B.jsx(oL,{})},[ji.Cancelled]:{labelKey:"annotator:comment.status.cancelled",icon:B.jsx(mL,{})},[ji.Completed]:{labelKey:"annotator:comment.status.completed",icon:B.jsx(cL,{})},[ji.Closed]:{labelKey:"annotator:comment.status.closed",icon:B.jsx(RL,{})},[ji.None]:{labelKey:"annotator:comment.status.none",icon:B.jsx(WL,{})}},gx=l=>xx[l]||null,wx=({subtype:l})=>{const t=gx(l);return t?B.jsx("span",{style:{marginRight:5},children:t}):null},Cx=()=>{const l=Al(q=>q.annotations),t=Rt.useContext(zF),{isSidebarCollapsed:e}=Wa(),{painter:n}=Cd(),i=Al(q=>q.selectedAnnotation),a=Al(q=>q.setSelectedAnnotation),s=Al(q=>q.clearSelectedAnnotation),[c,o]=Rt.useState(null),[r,U]=Rt.useState(null),[Z,F]=Rt.useState(null),[u,W]=Rt.useState([]),[V,R]=Rt.useState([]),{t:Q}=si(["common","annotator"],{useSuspense:!1});Rt.useEffect(()=>{if(i&&i?.source===Ea.CANVAS&&!e){const q=i?.store?.title===t?.user?.name,Wt=i?.store?.contentsObj?.text==="",ut=i?.store?.comments?.length===0;q&&Wt&&ut?F(i.store):o(i.store)}},[i]);const S=Rt.useRef({}),N=Rt.useMemo(()=>{const q=new Map;return l.forEach(Wt=>{q.set(Wt.title,(q.get(Wt.title)||0)+1)}),Array.from(q.entries())},[l]),G=Rt.useMemo(()=>{const q=new Map;return l.forEach(Wt=>{q.set(Wt.subtype,(q.get(Wt.subtype)||0)+1)}),Array.from(q.entries())},[l]);Rt.useEffect(()=>{W(N.map(([q])=>q))},[N]),Rt.useEffect(()=>{R(G.map(([q])=>q))},[G]),Rt.useEffect(()=>()=>{o(null),U(null),F(null),s()},[]);const y=Rt.useMemo(()=>u.length===0||V.length===0?[]:Array.from(l.values()).filter(q=>u.includes(q.title)&&V.includes(q.subtype)),[l,u,V]),k=Rt.useMemo(()=>y.reduce((q,Wt)=>(q[Wt.pageNumber]||(q[Wt.pageNumber]=[]),q[Wt.pageNumber].push(Wt),q),{}),[y]),I=q=>{W(Wt=>Wt.includes(q)?Wt.filter(ut=>ut!==q):[...Wt,q])},X=q=>{R(Wt=>Wt.includes(q)?Wt.filter(ut=>ut!==q):[...Wt,q])},Y=B.jsxs("div",{className:Kn.filter,children:[B.jsx(el,{as:"div",children:Q("author")}),B.jsx("ul",{children:N.map(([q,Wt])=>B.jsx("li",{children:B.jsx(el,{as:"label",size:"2",children:B.jsxs(ye,{gap:"2",children:[B.jsx(Yo,{checked:u.includes(q),onCheckedChange:()=>I(q)}),q," (",Wt,")"]})})},q))}),B.jsx(el,{as:"div",children:Q("type")}),B.jsx("ul",{children:G.map(([q,Wt])=>B.jsx("li",{children:B.jsx(el,{as:"label",size:"2",children:B.jsxs(ye,{gap:"2",children:[B.jsx(Yo,{checked:V.includes(q),onCheckedChange:()=>X(q)}),q," (",Wt,")"]})})},q))}),B.jsxs(ye,{gap:"3",mt:"2",justify:"between",children:[B.jsx(Dl,{variant:"ghost",onClick:()=>{W(N.map(([q])=>q)),R(G.map(([q])=>q))},children:Q("selectAll")}),B.jsx(Dl,{variant:"ghost",onClick:()=>{W([]),R([])},children:Q("clear")})]})]}),L=q=>{const ut=[...q.comments||[]].reverse().find(Qt=>Qt.status!==void 0&&Qt.status!==null)?.status??ji.None;return fZ[ut]?.icon??fZ[ji.None].icon},g=q=>{a(q,Ea.SIDEBAR),n?.highlight(q)},j=(q,Wt)=>{n?.update(q.id,{contentsObj:{...q.contentsObj||{text:""},text:Wt},date:M0(Date.now())}),F(null)},A=(q,Wt,ut)=>{const Qt={id:vS(),title:t?.user?.name,date:M0(Date.now()),content:Wt,status:ut};n?.update(q.id,{comments:[...q.comments||[],Qt]}),o(null)},et=(q,Wt,ut)=>{const Qt=(q.comments||[]).map(Xt=>Xt.id===Wt.id?{...Xt,content:ut,date:M0(Date.now()),title:t?.user?.name||Xt.title}:Xt);n?.update(q.id,{comments:Qt}),U(null)},$=q=>{n?.delete(q.id,!0)},nt=(q,Wt)=>{const ut=(q.comments||[]).filter(Qt=>Qt.id!==Wt.id);n?.update(q.id,{comments:ut}),r?.id===Wt.id&&U(null)},x=Rt.useCallback(q=>{let Wt="";if(Z&&i?.store?.id===q.id){const ut=()=>{j(q,Wt),F(null)},Qt=Xt=>{Xt&&setTimeout(()=>{Xt.focus()},0)};return B.jsxs(B.Fragment,{children:[B.jsx(V0,{ref:Qt,defaultValue:q?.contentsObj?.text,autoFocus:!0,rows:4,style:{marginBottom:"8px",marginTop:"8px"},onBlur:()=>F(null),onChange:Xt=>Wt=Xt.target.value,onKeyDown:Xt=>{Xt.key==="Enter"&&!Xt.shiftKey&&(Xt.preventDefault(),ut())}}),B.jsx(Dl,{style:{width:"100%"},onMouseDown:ut,children:Q("confirm")})]})}return B.jsx(ye,{gap:"3",pl:"4",children:B.jsx(el,{as:"p",size:"2",truncate:!0,children:q?.contentsObj?.text})})},[Z,i]),O=Rt.useCallback(q=>{let Wt="";if(c&&i?.store?.id===q.id){const ut=()=>{A(q,Wt),o(null)},Qt=Xt=>{Xt&&setTimeout(()=>{Xt.focus()},0)};return B.jsxs(B.Fragment,{children:[B.jsx(V0,{ref:Qt,autoFocus:!0,rows:4,style:{marginBottom:"8px",marginTop:"8px"},onBlur:()=>o(null),onChange:Xt=>Wt=Xt.target.value,onKeyDown:Xt=>{Xt.key==="Enter"&&!Xt.shiftKey&&(Xt.preventDefault(),ut())}}),B.jsx(Dl,{style:{width:"100%"},onMouseDown:ut,children:Q("confirm")})]})}return null},[c,i]),P=Rt.useCallback((q,Wt)=>{let ut="";if(r&&r.id===Wt.id){const Qt=()=>{et(q,Wt,ut),U(null)},Xt=ht=>{ht&&setTimeout(()=>{ht.focus()},0)};return B.jsxs(B.Fragment,{children:[B.jsx(V0,{ref:Xt,defaultValue:r.content,autoFocus:!0,rows:4,style:{marginBottom:"8px"},onBlur:()=>U(null),onChange:ht=>ut=ht.target.value,onKeyDown:ht=>{ht.key==="Enter"&&!ht.shiftKey&&(ht.preventDefault(),Qt())}}),B.jsx(Dl,{style:{width:"100%"},onMouseDown:Qt,children:Q("confirm")})]})}return B.jsx(ye,{gap:"3",children:B.jsx(el,{as:"p",size:"2",truncate:!0,children:Wt.content})})},[c,r]),tt=Object.entries(k).map(([q,Wt])=>{const ut=Wt.sort((Qt,Xt)=>Qt.konvaClientRect.y-Xt.konvaClientRect.y);return B.jsxs("div",{className:Kn.group,children:[B.jsxs(ye,{gap:"2",justify:"between",p:"1",children:[B.jsx(el,{size:"2",children:Q("annotator:comment.page",{value:q})}),B.jsx(el,{size:"2",children:Q("annotator:comment.total",{value:Wt.length})})]}),ut.map(Qt=>{const ht={className:Qt.id===i?.store?.id?`${Kn.comment} ${Kn.selected}`:Kn.comment,id:`annotation-${Qt.id}`};return Rt.createElement("div",{...ht,key:Qt.id,onClick:()=>g(Qt),ref:K=>S.current[Qt.id]=K},B.jsxs("div",{className:Kn.title,children:[B.jsx(wx,{subtype:Qt.subtype}),B.jsxs("div",{className:Kn.username,children:[B.jsxs(ye,{justify:"start",children:[B.jsx(el,{size:"2",as:"div",truncate:!0,style:{maxWidth:150},children:Qt.title}),Qt.native&&B.jsx(wh,{content:Q("annotator:comment.nativeAnnotation"),children:B.jsx("span",{children:B.jsx(hL,{})})})]}),B.jsx(el,{color:"gray",size:"2",children:oh(Qt.date,!0)})]}),B.jsxs("span",{className:Kn.tool,children:[B.jsxs(Vd,{children:[B.jsx(bd,{children:B.jsx(Dl,{variant:"ghost",color:"gray",size:"2",style:{boxShadow:"none",color:"#000000"},m:"2",children:L(Qt)})}),B.jsx(Rd,{onCloseAutoFocus:K=>K.preventDefault(),children:Object.entries(fZ).map(([K,it])=>B.jsxs(vi,{onSelect:()=>{A(Qt,Q("annotator:comment.statusText",{value:Q(it.labelKey)}),K),o(null)},children:[it.icon," ",Q(it.labelKey)]},K))})]}),B.jsxs(Vd,{children:[B.jsx(bd,{children:B.jsx(Dl,{variant:"ghost",color:"gray",size:"2",m:"2",style:{boxShadow:"none",color:"#000000"},children:B.jsx(yW,{})})}),B.jsxs(Rd,{onCloseAutoFocus:K=>K.preventDefault(),children:[B.jsx(vi,{onSelect:K=>{K.stopPropagation(),o(Qt)},children:Q("reply")}),B.jsx(vi,{onSelect:K=>{K.stopPropagation(),F(Qt)},children:Q("edit")}),B.jsx(vi,{onSelect:K=>{K.stopPropagation(),$(Qt)},children:Q("delete")})]})]})]})]}),x(Qt),Qt.comments?.map((K,it)=>B.jsxs("div",{className:Kn.reply,children:[B.jsxs("div",{className:Kn.title,children:[B.jsxs("div",{className:Kn.username,children:[B.jsx(el,{truncate:!0,size:"2",as:"div",style:{maxWidth:200},children:K.title}),B.jsx(el,{as:"div",color:"gray",size:"2",children:oh(K.date,!0)})]}),B.jsx("span",{className:Kn.tool,children:B.jsxs(Vd,{children:[B.jsx(bd,{children:B.jsx(Dl,{variant:"outline",color:"gray",size:"2",style:{boxShadow:"none",color:"#000000"},children:B.jsx(yW,{})})}),B.jsxs(Rd,{onCloseAutoFocus:ct=>ct.preventDefault(),children:[B.jsx(vi,{onSelect:ct=>{ct.stopPropagation(),U(K)},children:Q("edit")}),B.jsx(vi,{onSelect:ct=>{ct.stopPropagation(),nt(Qt,K)},children:Q("delete")})]})]})})]}),P(Qt,K)]},it)),B.jsxs("div",{children:[O(Qt),!c&&!r&&!Z&&i?.store?.id===Qt.id&&B.jsx(Dl,{mt:"2",style:{width:"100%"},onClick:()=>o(Qt),children:Q("reply")})]}))})]},q)});return B.jsxs("div",{className:Kn.sidebar,children:[B.jsx(ye,{align:"center",justify:"start",p:"1",children:B.jsxs(_o,{children:[B.jsx(qo,{children:B.jsx(Dl,{variant:"outline",size:"2",color:"gray",style:{boxShadow:"none",color:"#000000",fontSize:"16px"},children:B.jsx(UL,{})})}),B.jsx($o,{children:Y})]})}),B.jsx("div",{className:Kn.list,children:tt})]})};class Ei{annotation;page;pdfDoc;constructor(t,e,n){this.pdfDoc=t,this.page=e,this.annotation=n}addAnnotationToPage(t,e){const n=t.node.lookup(ot.of("Annots"));n?n.push(e):t.node.set(ot.of("Annots"),t.doc.context.obj([e]))}}class fx extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=dn(t.konvaClientRect,e.getHeight()),a=n.context,s=a.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:i,NM:Ue.of(t.id),Contents:He(t.contentsObj?.text||""),Name:ot.of("Comment"),T:He(t.title||_l("normal.unknownUser")),M:Ue.of(t.date||""),C:Gn(t.color||"#000000"),Open:!1}),c=a.register(s);this.addAnnotationToPage(e,c);for(const o of t.comments||[]){const r=a.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:i,Contents:He(o.content),T:He(o.title||_l("normal.unknownUser")),M:Ue.of(o.date||""),C:Gn(t.color||"#000000"),IRT:c,RT:ot.of("R"),NM:Ue.of(o.id),Open:!1}),U=a.register(r);this.addAnnotationToPage(e,U)}}}var J0={exports:{}},vx=J0.exports,fb;function jx(){return fb||(fb=1,(function(l,t){(function(e,n){n()})(vx,function(){function e(r,U){return typeof U>"u"?U={autoBom:!1}:typeof U!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),U={autoBom:!U}),U.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(r.type)?new Blob(["\uFEFF",r],{type:r.type}):r}function n(r,U,Z){var F=new XMLHttpRequest;F.open("GET",r),F.responseType="blob",F.onload=function(){o(F.response,U,Z)},F.onerror=function(){console.error("could not download file")},F.send()}function i(r){var U=new XMLHttpRequest;U.open("HEAD",r,!1);try{U.send()}catch{}return 200<=U.status&&299>=U.status}function a(r){try{r.dispatchEvent(new MouseEvent("click"))}catch{var U=document.createEvent("MouseEvents");U.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),r.dispatchEvent(U)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Js=="object"&&Js.global===Js?Js:void 0,c=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!c?function(r,U,Z){var F=s.URL||s.webkitURL,u=document.createElement("a");U=U||r.name||"download",u.download=U,u.rel="noopener",typeof r=="string"?(u.href=r,u.origin===location.origin?a(u):i(u.href)?n(r,U,Z):a(u,u.target="_blank")):(u.href=F.createObjectURL(r),setTimeout(function(){F.revokeObjectURL(u.href)},4e4),setTimeout(function(){a(u)},0))}:"msSaveOrOpenBlob"in navigator?function(r,U,Z){if(U=U||r.name||"download",typeof r!="string")navigator.msSaveOrOpenBlob(e(r,Z),U);else if(i(r))n(r,U,Z);else{var F=document.createElement("a");F.href=r,F.target="_blank",setTimeout(function(){a(F)})}}:function(r,U,Z,F){if(F=F||open("","_blank"),F&&(F.document.title=F.document.body.innerText="downloading..."),typeof r=="string")return n(r,U,Z);var u=r.type==="application/octet-stream",W=/constructor/i.test(s.HTMLElement)||s.safari,V=/CriOS\/[\d]+/.test(navigator.userAgent);if((V||u&&W||c)&&typeof FileReader<"u"){var R=new FileReader;R.onloadend=function(){var N=R.result;N=V?N:N.replace(/^data:[^;]*;/,"data:attachment/file;"),F?F.location.href=N:location=N,F=null},R.readAsDataURL(r)}else{var Q=s.URL||s.webkitURL,S=Q.createObjectURL(r);F?F.location=S:location.href=S,F=null,setTimeout(function(){Q.revokeObjectURL(S)},4e4)}});s.saveAs=o.saveAs=o,l.exports=o})})(J0)),J0.exports}var aT=jx();class Ox extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),c=JSON.parse(t.konvaString).children.filter(Z=>Z.className==="Rect"),o=[];for(const Z of c){const{x:F,y:u,width:W,height:V}=Z.attrs,R=F,Q=a-u,S=F+W,N=a-(u+V);o.push(R,Q,S,Q,R,N,S,N)}const r=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Highlight"),Rect:dn(t.konvaClientRect,a),QuadPoints:o,C:Gn(t.color||"#000000"),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id)}),U=i.register(r);this.addAnnotationToPage(e,U);for(const Z of t.comments||[]){const F=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(Z.content),T:He(Z.title||_l("normal.unknownUser")),M:Ue.of(Z.date||""),C:Gn(t.color||"#000000"),IRT:U,RT:ot.of("R"),NM:Ue.of(Z.id),Open:!1}),u=i.register(F);this.addAnnotationToPage(e,u)}}}class Kx extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),c=JSON.parse(t.konvaString).children.filter(Z=>Z.className==="Rect"),o=[];for(const Z of c){const{x:F,y:u,width:W,height:V}=Z.attrs,R=F,Q=a-u,S=F+W,N=a-(u+V);o.push(R,Q,S,Q,R,N,S,N)}const r=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Underline"),Rect:dn(t.konvaClientRect,a),QuadPoints:o,C:Gn(t.color||"#000000"),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id)}),U=i.register(r);this.addAnnotationToPage(e,U);for(const Z of t.comments||[]){const F=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(Z.content),T:He(Z.title||_l("normal.unknownUser")),M:Ue.of(Z.date||""),C:Gn(t.color||"#000000"),IRT:U,RT:ot.of("R"),NM:Ue.of(Z.id),Open:!1}),u=i.register(F);this.addAnnotationToPage(e,u)}}}class Hx extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),c=JSON.parse(t.konvaString).children.filter(Z=>Z.className==="Rect"),o=[];for(const Z of c){const{x:F,y:u,width:W,height:V}=Z.attrs,R=F,Q=a-u,S=F+W,N=a-(u+V);o.push(R,Q,S,Q,R,N,S,N)}const r=i.obj({Type:ot.of("Annot"),Subtype:ot.of("StrikeOut"),Rect:dn(t.konvaClientRect,a),QuadPoints:o,C:Gn(t.color||"#000000"),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id)}),U=i.register(r);this.addAnnotationToPage(e,U);for(const Z of t.comments||[]){const F=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(Z.content),T:He(Z.title||_l("normal.unknownUser")),M:Ue.of(Z.date||""),C:Gn(t.color||"#000000"),IRT:U,RT:ot.of("R"),NM:Ue.of(Z.id),Open:!1}),u=i.register(F);this.addAnnotationToPage(e,u)}}}class Px extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),s=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Square"),Rect:dn(t.konvaClientRect,a),C:Gn(t.color||"#000000"),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id),Border:[0,0,1]}),c=i.register(s);this.addAnnotationToPage(e,c);for(const o of t.comments||[]){const r=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(o.content),T:He(o.title||_l("normal.unknownUser")),M:Ue.of(o.date||""),C:Gn(t.color||"#000000"),IRT:c,RT:ot.of("R"),NM:Ue.of(o.id),Open:!1}),U=i.register(r);this.addAnnotationToPage(e,U)}}}class Ax extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),s=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Circle"),Rect:dn(t.konvaClientRect,a),C:Gn(t.color||"#000000"),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id),Border:[0,0,1]}),c=i.register(s);this.addAnnotationToPage(e,c);for(const o of t.comments||[]){const r=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(o.content),T:He(o.title||_l("normal.unknownUser")),M:Ue.of(o.date||""),C:Gn(t.color||"#000000"),IRT:c,RT:ot.of("R"),NM:Ue.of(o.id),Open:!1}),U=i.register(r);this.addAnnotationToPage(e,U)}}}class _x extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),s=JSON.parse(t.konvaString),c=s.children.filter(I=>I.className==="Line"),o=s.attrs.x||0,r=s.attrs.y||0,U=s.attrs.scaleX||1,Z=s.attrs.scaleY||1,F=i.obj(c.map(I=>{const X=I.attrs.points,Y=[];for(let L=0;L<X.length;L+=2){const g=o+X[L]*U,j=r+X[L+1]*Z;Y.push(g,a-j)}return i.obj(Y)})),u=c[0]?.attrs||{},W=u.strokeWidth??1,V=u.opacity??1,R=u.stroke??t.color??"rgb(255, 0, 0)",[Q,S,N]=Gn(R),G=i.obj({W:de.of(W),S:ot.of("S")}),y=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Ink"),Rect:dn(t.konvaClientRect,a),InkList:F,C:i.obj([de.of(Q),de.of(S),de.of(N)]),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id),Border:i.obj([0,0,0]),BS:G,CA:de.of(V)}),k=i.register(y);this.addAnnotationToPage(e,k);for(const I of t.comments||[]){const X=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(I.content),T:He(I.title||_l("normal.unknownUser")),M:Ue.of(I.date||""),C:i.obj([de.of(Q),de.of(S),de.of(N)]),IRT:k,RT:ot.of("R"),NM:Ue.of(I.id),Open:!1}),Y=i.register(X);this.addAnnotationToPage(e,Y)}}}class qx extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,[i,,,a]=dn(t.konvaClientRect,e.getHeight()),s=n.context,c=e.getWidth(),o=e.getHeight(),r=20,U=Math.max(0,Math.min(i,c-r)),Z=Math.min(o,Math.max(a,r)),F=Z-r,u=[de.of(U),de.of(F),de.of(U+r),de.of(Z)],W=s.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:u,NM:Ue.of(t.id),Contents:He(t.contentsObj?.text||""),Name:ot.of("Comment"),T:He(t.title||_l("normal.unknownUser")),M:Ue.of(t.date||""),C:Gn(t.color||"#000000"),Open:!1}),V=s.register(W);this.addAnnotationToPage(e,V);for(const R of t.comments||[]){const Q=s.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:u,Contents:He(R.content),T:He(R.title||_l("normal.unknownUser")),M:Ue.of(R.date||""),C:Gn(t.color||"#000000"),IRT:V,RT:ot.of("R"),NM:Ue.of(R.id),Open:!1}),S=s.register(Q);this.addAnnotationToPage(e,S)}}}class $x extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,[a,s,c,o]=dn(t.konvaClientRect,e.getHeight()),r=e.getWidth(),U=e.getHeight(),Z=Math.max(0,Math.min(a,r)),F=Math.max(0,Math.min(s,U)),u=Math.max(Z,Math.min(c,r)),W=Math.max(F,Math.min(o,U)),V=[de.of(Z),de.of(F),de.of(u),de.of(W)];let R;if(t.contentsObj?.image){const G=t.contentsObj.image.replace(/^data:image\/png;base64,/,""),y=await n.embedPng(G),k=y.width,I=y.height,X=i.obj({Type:"XObject",Subtype:"Form",BBox:[0,0,k,I],Resources:i.obj({XObject:i.obj({Im1:y.ref})})}),Y=`q ${k} 0 0 ${I} 0 0 cm /Im1 Do Q`,L=new TextEncoder().encode(Y),g=yd.of(X,L),j=i.register(g);R=i.obj({N:j})}const Q={Type:ot.of("Annot"),Subtype:ot.of("Stamp"),Rect:V,NM:Ue.of(t.id),Contents:He(t.contentsObj?.text||""),T:He(t.title||_l("normal.unknownUser")),M:Ue.of(t.date||""),Open:!1,F:de.of(128)};R&&(Q.AP=R);const S=i.obj(Q),N=i.register(S);this.addAnnotationToPage(e,N);for(const G of t.comments||[]){const y=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,U),Contents:He(G.content),T:He(G.title||_l("normal.unknownUser")),M:Ue.of(G.date||""),IRT:N,RT:ot.of("R"),NM:Ue.of(G.id),Open:!1}),k=i.register(y);this.addAnnotationToPage(e,k)}}}class tg extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),s=JSON.parse(t.konvaString),c=s.children.filter(I=>I.className==="Arrow"),o=s.attrs.x||0,r=s.attrs.y||0,U=s.attrs.scaleX||1,Z=s.attrs.scaleY||1,F=i.obj(c.map(I=>{const X=I.attrs.points,Y=[];for(let L=0;L<X.length;L+=2){const g=o+X[L]*U,j=r+X[L+1]*Z;Y.push(g,a-j)}return i.obj(Y)})),u=c[0]?.attrs||{},W=u.strokeWidth??1,V=u.opacity??1,R=u.stroke??t.color??"rgb(255, 0, 0)",[Q,S,N]=Gn(R),G=i.obj({W:de.of(W),S:ot.of("S")}),y=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Ink"),Rect:dn(t.konvaClientRect,a),InkList:F,C:i.obj([de.of(Q),de.of(S),de.of(N)]),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id),Border:i.obj([0,0,0]),BS:G,CA:de.of(V)}),k=i.register(y);this.addAnnotationToPage(e,k);for(const I of t.comments||[]){const X=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(I.content),T:He(I.title||_l("normal.unknownUser")),M:Ue.of(I.date||""),C:i.obj([de.of(Q),de.of(S),de.of(N)]),IRT:k,RT:ot.of("R"),NM:Ue.of(I.id),Open:!1}),Y=i.register(X);this.addAnnotationToPage(e,Y)}}}function eg(l){const t=l.match(/[a-zA-Z][^a-zA-Z]*/g)||[],e=[];for(const n of t){const i=n[0],a=n.slice(1).trim().split(/[\s,]+/).map(parseFloat);if(i==="M"||i==="L")for(let s=0;s<a.length;s+=2)e.push(a[s],a[s+1]);else i==="Q"?a.length>=4&&e.push(a[2],a[3]):i==="C"&&a.length>=6&&e.push(a[4],a[5])}return e}class lg extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),s=JSON.parse(t.konvaString),c=s.children.filter(I=>I.className==="Path"),o=s.attrs.x||0,r=s.attrs.y||0,U=s.attrs.scaleX||1,Z=s.attrs.scaleY||1,F=i.obj(c.map(I=>{const X=eg(I.attrs.data),Y=[];for(let L=0;L<X.length;L+=2){const g=o+X[L]*U,j=r+X[L+1]*Z;Y.push(g,a-j)}return i.obj(Y)})),u=c[0]?.attrs||{},W=u.strokeWidth??1,V=u.opacity??1,R=u.stroke??t.color??"rgb(255, 0, 0)",[Q,S,N]=Gn(R),G=i.obj({W:de.of(W),S:ot.of("S")}),y=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Ink"),Rect:dn(t.konvaClientRect,a),InkList:F,C:i.obj([de.of(Q),de.of(S),de.of(N)]),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id),Border:i.obj([0,0,0]),BS:G,CA:de.of(V)}),k=i.register(y);this.addAnnotationToPage(e,k);for(const I of t.comments||[]){const X=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(I.content),T:He(I.title||_l("normal.unknownUser")),M:Ue.of(I.date||""),C:i.obj([de.of(Q),de.of(S),de.of(N)]),IRT:k,RT:ot.of("R"),NM:Ue.of(I.id),Open:!1}),Y=i.register(X);this.addAnnotationToPage(e,Y)}}}const ng={[Xl.TEXT]:fx,[Xl.HIGHLIGHT]:Ox,[Xl.UNDERLINE]:Kx,[Xl.STRIKEOUT]:Hx,[Xl.SQUARE]:Px,[Xl.CIRCLE]:Ax,[Xl.INK]:_x,[Xl.POLYLINE]:lg,[Xl.FREETEXT]:qx,[Xl.STAMP]:$x,[Xl.LINE]:tg};async function ig(l,t,e){const n=ng[l.pdfjsType];n?await new n(e,t,l).parse():console.warn("Unsupported annotation type:",l.pdfjsType)}function ag(l,t){const e=l.buffer.slice(l.byteOffset,l.byteOffset+l.byteLength),n=new Blob([e],{type:"application/pdf"});aT.saveAs(n,`${t}.pdf`)}function sg(l,t){const e=new Blob([l],{type:"application/octet-stream"});aT.saveAs(e,`${t}.xlsx`)}function dg(l){for(const t of l.getPages()){const e=ot.of("Annots");t.node.has(e)&&t.node.set(e,l.context.obj([]))}}async function cg(l,t,e){const n=await l.pdfDocument.getData(),i=await Ha.load(n);dg(i);for(const c of t){const o=i.getPages()[c.pageNumber-1];await ig(c,o,i)}const a=await i.save(),s=e||`annotated_${OS()}`;ag(a,s)}async function og(l,t,e){const n=[];t.sort((F,u)=>F.pageNumber!==u.pageNumber?F.pageNumber-u.pageNumber:pb(u.date)-pb(F.date));const i=F=>{const W=[...F.comments||[]].reverse().find(V=>V.status!==void 0&&V.status!==null)?.status??ji.None;return Vl.t(`annotator:comment.status.${W.toLowerCase()}`)};let a=1,s=0;t.forEach(F=>{const u=ki.find(V=>V.type===F.type)?.name,W=Vl.t(`annotator:tool.${u}`);n.push({index:`${a}`,id:F.id,page:F.pageNumber,annotationType:W,recordType:Vl.t("annotator:export.recordType.annotation"),author:F.title,content:F.contentsObj?.text||"",date:oh(F.date,!0),status:i(F)}),s=0,F.comments.forEach(V=>{s++,n.push({index:`${a}.${s}`,id:V.id,page:"",annotationType:"--",recordType:Vl.t("annotator:export.recordType.reply"),author:V.title,content:V.content,date:oh(V.date,!0),status:""})}),a++});const c=await Promise.resolve().then(()=>require("./exceljs.min-B5c5PPGJ.cjs")).then(F=>F.exceljs_min),o=new c.Workbook,r=o.addWorksheet("sheet1");r.columns=[{key:"index",header:"#",width:8,style:{alignment:{vertical:"middle"}}},{key:"id",header:Vl.t("annotator:export.fields.id"),width:20,style:{alignment:{vertical:"middle"}}},{key:"page",header:Vl.t("annotator:export.fields.page"),width:10,style:{alignment:{vertical:"middle"}}},{key:"annotationType",header:Vl.t("annotator:export.fields.annotationType"),width:18,style:{alignment:{vertical:"middle"}}},{key:"recordType",header:Vl.t("annotator:export.fields.recordType"),width:12,style:{alignment:{vertical:"middle"}}},{key:"author",header:Vl.t("annotator:export.fields.author"),width:16,style:{alignment:{vertical:"middle"}}},{key:"content",header:Vl.t("annotator:export.fields.content"),width:40,style:{alignment:{wrapText:!0,vertical:"top"}}},{key:"date",header:Vl.t("annotator:export.fields.date"),width:22,style:{alignment:{vertical:"middle"}}},{key:"status",header:Vl.t("annotator:export.fields.status"),width:14,style:{alignment:{vertical:"middle"}}}],n.forEach(F=>{const u=r.addRow(F),W=F.recordType===Vl.t("annotator:export.recordType.reply");u.font={size:12,color:{argb:W?"389e0d":"000000"}}}),r.getRow(1).eachCell(F=>{F.font={bold:!0,size:12},F.fill={type:"pattern",pattern:"solid",fgColor:{argb:"D9E1F2"}}}),r.eachRow(F=>{F.eachCell(u=>{u.border={top:{style:"thin",color:{argb:"000000"}},left:{style:"thin",color:{argb:"000000"}},bottom:{style:"thin",color:{argb:"000000"}},right:{style:"thin",color:{argb:"000000"}}}})});const U=await o.xlsx.writeBuffer(),Z=e||`annotated_${OS()}`;sg(U,Z)}async function rg(l,t,e){if(e.has(t))return e.get(t);const n=l.getPageView(t);if(!n?.pdfPage)return"";const a=(await n.pdfPage.getTextContent()).items.map(s=>s.str).join("");return e.set(t,a),a}function hg({pdfViewer:l}){const[t,e]=Rt.useState(""),[n,i]=Rt.useState([]),[a,s]=Rt.useState(!1),[c,o]=Rt.useState({caseSensitive:!1,entireWord:!1,matchDiacritics:!1}),r=Rt.useRef(new Map);async function U({pageNumber:u,matchIndex:W}){if(!l||!t)return;const V=l.findController;!V||!l.pdfDocument||(l.scrollPageIntoView({pageNumber:u}),V._selected={pageIdx:u-1,matchIdx:W},V._offset={pageIdx:u-1,matchIdx:W-1,wrapped:!1},V._highlightMatches=!0,l.eventBus.dispatch("find",{type:"again",query:t,caseSensitive:c.caseSensitive,entireWord:c.entireWord,findPrevious:!1,matchDiacritics:c.matchDiacritics,highlightAll:!0}))}const Z=Rt.useCallback(async(u,W)=>{if(!l)return;s(!0),e(u),o({...c,...W});const V=[];try{const R=await new Promise(Q=>{const S=l.pagesCount;let N=0;const G=60,y=200,k=({source:I})=>{const X=async()=>{if(I._pageMatches.length===S){l.eventBus.off("updatefindcontrolstate",k);const Y=[];for(let L=0;L<I._pageMatches.length;L++){const g=I._pageMatches[L];if(!g||g.length===0)continue;const j=await rg(l,L,r.current),A=g.map((et,$)=>{const x=Math.max(0,et-5),O=Math.min(j.length,et+u.length+30);return{matchIndex:$,charIndex:et,snippet:j.slice(x,O)}});Y.push({pageNumber:L+1,countTotal:g.length,matches:A})}Q({query:u,countTotal:I._matchesCountTotal,pageMatches:Y})}else N<G?(N++,setTimeout(X,y)):(l.eventBus.off("updatefindcontrolstate",k),Q({query:u,countTotal:0,pageMatches:[]}))};X()};l.eventBus.on("updatefindcontrolstate",k),l.eventBus.dispatch("find",{type:"highlightallchange",query:u,caseSensitive:W?.caseSensitive??!1,entireWord:W?.entireWord??!1,findPrevious:!1,matchDiacritics:W?.matchDiacritics??!1,highlightAll:!0})});V.push(R)}catch(R){console.error(R),V.push({query:u,countTotal:0,pageMatches:[]})}i(V),s(!1)},[l]),F=Rt.useCallback(()=>{l?.eventBus.dispatch("find",{query:""}),e(""),i([])},[l]);return{query:t,setQuery:e,results:n,searching:a,search:Z,clearSearch:F,jumpToMatch:U,searchOptions:c}}const sT=({pdfViewer:l})=>{const{query:t,setQuery:e,results:n,searching:i,search:a,clearSearch:s,jumpToMatch:c}=hg({pdfViewer:l}),{t:o}=si("viewer",{useSuspense:!1}),[r,U]=Rt.useState({caseSensitive:!1,entireWord:!1}),[Z,F]=Rt.useState(null),u=Rt.useRef({}),W=({text:L,query:g})=>{const j=(A,et,$)=>{if(!et)return A;const nt="gi",x=et.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),O=new RegExp(`(${x})`,nt);return A.split(O).map((P,tt)=>O.test(P)?B.jsx("mark",{style:{backgroundColor:"rgba(255, 255, 0, 0.2)",padding:"0 2px"},children:P},`${tt}-${P}`):P)};return B.jsx(B.Fragment,{children:j(L,g,r.caseSensitive)})},V=Rt.useCallback(L=>{L.trim()&&l&&(s(),F(null),a(L.trim(),{caseSensitive:r.caseSensitive,entireWord:r.entireWord}))},[l,a,s,r]),R=Rt.useCallback(L=>{switch(L.key){case"Escape":(n.length>0||t.trim()!=="")&&s();break;case"Enter":t.trim()===""&&n.length>0&&s(),t.trim()&&(s(),V(t));break}},[t,n,s,V]),Q=Rt.useCallback((L,g)=>{F({pageNumber:L,matchIndex:g}),c({pageNumber:L,matchIndex:g})},[c]),S=Rt.useCallback((L,g)=>{U(j=>({...j,[L]:g}))},[]),N=Rt.useCallback(()=>{const L=[];return n.forEach(g=>{g.pageMatches.forEach(j=>{j.matches.forEach(A=>{L.push({pageNumber:j.pageNumber,matchIndex:A.matchIndex,query:g.query})})})}),L},[n]),G=Rt.useCallback((L,g)=>{const j=u.current[`${L}-${g}`];j&&j.scrollIntoView({block:"center",inline:"center"})},[]),y=Rt.useCallback(()=>Z?N().findIndex(g=>g.pageNumber===Z.pageNumber&&g.matchIndex===Z.matchIndex):-1,[Z,N]),k=Rt.useCallback(()=>{if(!n.length)return;const L=N();if(!L.length)return;let g=0;Z&&(g=(y()+1)%L.length);const j=L[g];F({pageNumber:j.pageNumber,matchIndex:j.matchIndex}),c({pageNumber:j.pageNumber,matchIndex:j.matchIndex}),G(j.pageNumber,j.matchIndex)},[n,Z,N,y,c]),I=Rt.useCallback(()=>{if(!n.length)return;const L=N();if(!L.length)return;let g=L.length-1;Z&&(g=(y()-1+L.length)%L.length);const j=L[g];F({pageNumber:j.pageNumber,matchIndex:j.matchIndex}),c({pageNumber:j.pageNumber,matchIndex:j.matchIndex}),G(j.pageNumber,j.matchIndex)},[n,Z,N,y,c]);Rt.useEffect(()=>{t.trim()&&V(t.trim())},[r,V]),Rt.useEffect(()=>()=>{F(null),e("")},[s]);const X=Rt.useCallback(()=>!n.length||i?null:n.map(L=>B.jsxs(Bi,{children:[B.jsxs(ye,{pb:"2",justify:"between",align:"center",style:{position:"sticky",top:89,backgroundColor:"var(--bg-color-tertiary)",zIndex:1},children:[B.jsx(el,{size:"2",children:o("viewer:search.resultTotal",{total:L.countTotal})}),L.countTotal>0&&B.jsxs("div",{children:[B.jsx(ra,{onClick:I,variant:"soft",color:"gray",size:"1",mr:"1",children:B.jsx(b2,{})}),B.jsx(ra,{onClick:k,variant:"soft",color:"gray",size:"1",mr:"1",children:B.jsx(N2,{})})]})]}),L.pageMatches.map(g=>B.jsxs(Bi,{mt:"1",mb:"3",pl:"2",children:[B.jsxs(el,{size:"2",children:[o("viewer:search.page",{value:g.pageNumber})," (",g.countTotal,")"]}),g.matches.map(j=>{const A=Z&&Z.pageNumber===g.pageNumber&&Z.matchIndex===j.matchIndex,et=`${g.pageNumber}-${j.matchIndex}`;return B.jsx(Bi,{mt:"2",pl:"0",children:B.jsx(Dl,{ref:$=>u.current[et]=$,variant:A?"soft":"outline",color:A?void 0:"gray",type:"button",onClick:()=>Q(g.pageNumber,j.matchIndex),style:{width:"100%",textAlign:"left",justifyContent:"flex-start"},children:B.jsx(el,{truncate:!0,children:B.jsx(W,{text:j.snippet,query:L.query})})})},j.matchIndex)})]},g.pageNumber))]},L.query)),[n,i,Z,o,Q]),Y=Rt.useMemo(()=>i?B.jsxs(ye,{mt:"2",align:"center",gap:"2",children:[B.jsx(Dh,{}),B.jsx(el,{size:"2",children:o("viewer:search.searching")})]}):null,[i,o]);return B.jsxs(Bi,{p:"2",pt:"0",children:[B.jsxs(ye,{direction:"column",style:{position:"sticky",top:0,backgroundColor:"var(--bg-color-tertiary)",zIndex:1},children:[B.jsxs(Lo,{placeholder:o("viewer:search.placeholder"),value:t,onChange:L=>e(L.currentTarget.value),onKeyDown:R,"aria-label":o("viewer:search.placeholder"),mt:"3",children:[B.jsx(UF,{children:B.jsx(wu,{})}),B.jsx(UF,{children:t.trim()&&B.jsx(ra,{size:"1",variant:"ghost",onClick:()=>{e(""),n.length>0&&(s(),F(null))},children:B.jsx(sL,{})})})]}),B.jsxs(ye,{mt:"2",align:"center",gap:"2",children:[B.jsx(el,{as:"label",size:"2",children:B.jsxs(ye,{gap:"2",children:[B.jsx(Yo,{checked:r.caseSensitive,onCheckedChange:L=>S("caseSensitive",!!L),"aria-label":o("viewer:search.caseSensitive")}),o("viewer:search.caseSensitive")]})}),B.jsx(el,{as:"label",size:"2",children:B.jsxs(ye,{gap:"2",children:[B.jsx(Yo,{checked:r.entireWord,onCheckedChange:L=>S("entireWord",!!L),"aria-label":o("viewer:search.entireWord")}),o("viewer:search.entireWord")]})})]}),B.jsx(ma,{my:"2",size:"4"})]}),Y,X()]})},Ug=({enableRange:l="auto",theme:t="violet",title:e="PDF ANNOTATOR",url:n,locale:i="zh-CN",user:a={id:"null",name:"unknown"},defaultOptions:s,initialScale:c,enableNativeAnnotations:o=!1,initialAnnotations:r=[],defaultShowAnnotationsSidebar:U=!1,onSave:Z,onLoad:F,onAnnotationAdded:u,onAnnotationDeleted:W,onAnnotationSelected:V,onAnnotationUpdated:R,layoutStyle:Q,actions:S})=>{const N=Rt.useMemo(()=>({textLayerMode:1,annotationMode:0,externalLinkTarget:0,enableRange:l}),[]),{t:G}=si(["annotator","common"],{useSuspense:!1}),y=Rt.useMemo(()=>nT(Gx,s||{}),[s]),[k,I]=Rt.useState(()=>Eb());Rt.useEffect(()=>{const Y=setTimeout(()=>{const L=Eb();I(L)},0);return()=>clearTimeout(Y)},[]),Rt.useEffect(()=>{Vl.changeLanguage(i)},[i]);const X=()=>{const{painter:Y}=Cd(),{pdfViewer:L}=Wa(),g=()=>{if(Y){const et=Y.getData();Z?.(et)}},j=async et=>{if(Y&&L){const $=Y.getData();await cg(L,$,et)}},A=async et=>{if(Y&&L){const $=Y.getData();await og(L,$,et)}};if(S){if(typeof S=="function"){const et=S;return B.jsx(et,{save:g,getAnnotations:()=>Y?.getData()||[],exportToExcel:$=>{A($)},exportToPdf:$=>{j($)}})}return Rt.cloneElement(S,{save:g,getAnnotations:()=>Y?.getData()||[],exportToExcel:et=>{A(et)},exportToPdf:et=>{j(et)}})}return B.jsxs(B.Fragment,{children:[B.jsx(ma,{orientation:"vertical"}),B.jsxs(Vd,{children:[B.jsx(bd,{children:B.jsxs(Dl,{variant:"soft",children:[G("common:export"),B.jsx(gh,{})]})}),B.jsxs(Rd,{children:[B.jsxs(vi,{onClick:()=>j(),children:[G("common:export")," PDF"]}),B.jsxs(vi,{onClick:()=>A(),children:[G("common:export")," Excel"]})]})]}),B.jsxs(Dl,{onClick:g,children:[B.jsx(bL,{}),G("common:save")]})]})};return B.jsx(ba,{accentColor:t,children:B.jsx(SE,{children:B.jsx(qS.Provider,{value:{defaultOptions:y,primaryColor:k},children:B.jsx(Q2,{title:e,url:n,initialScale:c,user:a,...N,toolbar:B.jsx(yx,{defaultAnnotationName:""}),defaultActiveSidebarKey:U?"annotator-sidebar-toggle":null,sidebar:[{key:"search-sidebar",title:G("viewer:search.search"),icon:B.jsx(wu,{style:{width:18,height:18}}),render:Y=>B.jsx(sT,{pdfViewer:Y.pdfViewer})},{title:G("annotator:sidebar.toggle"),key:"annotator-sidebar-toggle",icon:B.jsx(I2,{style:{width:18,height:18}}),render:()=>B.jsx(Cx,{})}],actions:B.jsx(X,{}),style:Q,children:B.jsx(_E,{onLoad:()=>{F?.()},onAnnotationAdd:Y=>{u?.(Y)},onAnnotationDelete:Y=>{W?.(Y)},onAnnotationSelected:(Y,L)=>{V?.(Y,L)},onAnnotationChanged:Y=>{R?.(Y)},enableNativeAnnotations:o,annotations:r})})})})})},Zg=({onDocumentLoaded:l,onEventBusReady:t})=>{const{isReady:e,pdfViewer:n,eventBus:i,isSidebarCollapsed:a}=Wa();return Rt.useEffect(()=>{if(!e||!n||!i)return;t?.(i);const s=async()=>{l?.(n)};return n.pdfDocument?s():i.on("documentloaded",s),()=>{i.off("documentloaded",s)}},[e,n,i]),Rt.useEffect(()=>{i&&n&&i.dispatch("updateviewarea",{pdfViewer:n})},[a,i,n]),B.jsx(B.Fragment,{})},Fg=({actions:l})=>{const t=Wa();return l?typeof l=="function"?l(t):l:null},ug=({toolbar:l})=>{const t=Wa();return l?typeof l=="function"?B.jsxs(ye,{gap:"3",align:"center",children:[B.jsx(IF,{}),B.jsx(ma,{orientation:"vertical"}),l(t)]}):l:B.jsx(ye,{gap:"3",align:"center",children:B.jsx(IF,{})})},mg=({enableRange:l="auto",title:t="PDF VIEWER",url:e,locale:n="zh-CN",initialScale:i,layoutStyle:a,theme:s="violet",actions:c,sidebar:o,toolbar:r,showTextLayer:U=!0,defaultActiveSidebarKey:Z,onDocumentLoaded:F,onEventBusReady:u})=>{const{t:W}=si(["viewer"],{useSuspense:!1}),V=Rt.useMemo(()=>({textLayerMode:U?1:0,annotationMode:0,externalLinkTarget:0,enableRange:l}),[U]);return Rt.useEffect(()=>{Vl.changeLanguage(n)},[n]),B.jsx(ba,{accentColor:s,children:B.jsx(Q2,{title:t,url:e,sidebar:[{key:"search-sidebar",title:W("viewer:search.search"),icon:B.jsx(wu,{style:{width:18,height:18}}),render:R=>B.jsx(sT,{pdfViewer:R.pdfViewer})},...o||[]],defaultActiveSidebarKey:Z,toolbar:B.jsx(ug,{toolbar:r}),initialScale:i,...V,style:a,actions:B.jsx(Fg,{actions:c}),children:B.jsx(Zg,{onEventBusReady:u,onDocumentLoaded:F})})})};exports.PdfAnnotator=Ug;exports.PdfViewer=mg;exports.commonjsGlobal=Js;
397
+ `,document.head.appendChild(t),rh.add(l.value)}async function Tx(l){if(!(!l.external||!l.url||rh.has(l.value)))try{const t=new FontFace(l.value,`url(${l.url})`);await t.load(),document.fonts.add(t),rh.add(l.value)}catch{Sx(l)}}const Z0=80,Mx=({annotation:l,onAdd:t,default_signatures:e})=>{const{defaultOptions:n}=dr(),i=n.signature.colors,a=420,s=200,c=n.signature.type,o=n.signature.maxSize,r=n.signature.accept,U=600,Z=n.signature.defaultFont,{t:F}=si(["common","annotator"],{useSuspense:!1}),u=Rt.useRef(null),W=Rt.useRef(null),V=Rt.useRef(i[0]),R=Rt.useRef(null),[Q,S]=Rt.useState(!1),[N,G]=Rt.useState(V.current),[y,k]=Rt.useState(!0),[I,X]=Rt.useState([]),[Y,L]=Rt.useState(null),[g,j]=Rt.useState(""),[A,et]=Rt.useState(Z[0]?.value||"Arial"),[$,nt]=Rt.useState(null),[x,O]=Rt.useState(!1),P=Rt.useMemo(()=>e||n.signature.defaultSignature,[e]),tt=o;Rt.useEffect(()=>{V.current=N},[N]);const q=ct=>{t(ct)},Wt=async ct=>{const Nt=Z.find(St=>St.value===ct);Nt&&Nt.external&&await Tx(Nt),et(ct)},ut=()=>{if(!g.trim())return null;const ct=document.createElement("canvas");ct.width=a/1.1,ct.height=s;const Nt=ct.getContext("2d");if(!Nt)return null;const St=20;Nt.clearRect(0,0,ct.width,ct.height),Nt.font=`${Z0}px "${A}", cursive, sans-serif`;let Lt=Nt.measureText(g).width;const Ct=Lt+St*2>ct.width?(ct.width-St*2)/Lt:1;return Nt.font=`${Z0*Ct}px "${A}", cursive, sans-serif`,Nt.textAlign="center",Nt.textBaseline="middle",Nt.imageSmoothingEnabled=!0,Nt.shadowColor="rgba(0, 0, 0, 0.1)",Nt.shadowBlur=2,Nt.shadowOffsetX=1,Nt.shadowOffsetY=1,Nt.fillStyle=N,Nt.fillText(g,ct.width/2,ct.height/2),ct.toDataURL("image/png")},Qt=()=>{if(Y==="Upload"){$&&(X(ct=>[...ct,$]),q($),S(!1));return}if(Y==="Enter"){const ct=ut();ct&&(X(Nt=>[...Nt,ct]),q(ct),S(!1));return}if(Y==="Draw"){const ct=W.current?.toDataURL();ct&&(X(Nt=>[...Nt,ct]),q(ct),S(!1));return}},Xt=()=>{const ct=W.current;ct&&(ct.clear(),ct.getLayers().forEach(Nt=>Nt.destroyChildren()),k(!0)),j(""),nt(null)},ht=()=>{if(!u.current)return;const ct=new $t.Stage({container:u.current,width:a,height:s}),Nt=new $t.Layer;ct.add(Nt),W.current=ct;let St=!1,Lt=null;const Ct=()=>{St=!0;const At=ct.getPointerPosition();At&&(Lt=new $t.Line({stroke:V.current,strokeWidth:3,globalCompositeOperation:"source-over",lineCap:"round",lineJoin:"round",points:[At.x,At.y]}),Nt.add(Lt))},he=At=>{if(!St||!Lt)return;At.evt.preventDefault();const te=ct.getPointerPosition();if(!te)return;const le=Lt.points().concat([te.x,te.y]);Lt.points(le),k(!1)},Pt=()=>{St=!1,Lt=null};ct.on("mousedown touchstart",Ct),ct.on("mouseup touchend",Pt),ct.on("mousemove touchmove",he)},K=ct=>{G(ct),(W.current?.getLayers()[0].getChildren(St=>St.getClassName()==="Line")||[]).forEach(St=>St.stroke(ct))},it=ct=>{const Nt=ct.target,St=Nt.files;if(!St?.length)return;const Lt=St[0];if(Lt.size>tt){O(!0),setTimeout(()=>O(!1),3e3),Nt&&(Nt.value="");return}const Ct=new FileReader;Ct.onload=async he=>{const Pt=he.target?.result,At=new Image;At.src=Pt,At.onload=()=>{const te=U,le=U;let{width:ke,height:qe}=At;ke>qe&&ke>te?(qe=Math.round(qe*te/ke),ke=te):qe>le&&(ke=Math.round(ke*le/qe),qe=le);const ul=document.createElement("canvas"),Me=ul.getContext("2d");if(ul.width=ke,ul.height=qe,Me){Me.drawImage(At,0,0,ke,qe);const bl=ul.toDataURL("image/png");Nt.value="",nt(bl),k(!1)}}},Ct.readAsDataURL(Lt)};return Rt.useEffect(()=>{j(""),nt(null),(Y==="Enter"||Y==="Draw"||Y==="Upload")&&k(!0)},[Y]),Rt.useEffect(()=>{k(g.trim().length===0)},[g]),Rt.useEffect(()=>{Q&&(Wt(A),j(""),nt(null),L(c))},[Q]),Rt.useEffect(()=>{Q&&Y==="Draw"?setTimeout(()=>{ht()},300):(W.current?.destroy(),W.current=null)},[Y,Q]),B.jsxs(B.Fragment,{children:[B.jsxs(_o,{children:[B.jsx(qo,{children:B.jsx(Jd,{title:F(`annotator:tool.${l.name}`),icon:l.icon})}),B.jsx($o,{size:"1",style:{width:180},onCloseAutoFocus:ct=>ct.preventDefault(),children:B.jsxs("div",{className:fi.SignaturePop,children:[B.jsxs("ul",{className:fi.container,children:[P.map((ct,Nt)=>B.jsx(Xs,{children:B.jsx("li",{onClick:()=>q(ct),children:B.jsx("img",{src:ct})},Nt)},Nt)),I.map((ct,Nt)=>B.jsx(Xs,{children:B.jsx("li",{onClick:()=>q(ct),children:B.jsx("img",{src:ct})},Nt)},Nt))]}),B.jsx(Xs,{children:B.jsxs(Dl,{style:{width:"100%"},variant:"soft",onClick:()=>{S(!0)},children:[B.jsx(R2,{})," ",F("annotator:common.createSignature")]})})]})})]}),B.jsxs(ku,{open:Q,onOpenChange:S,children:[B.jsx(Du,{}),B.jsxs(Iu,{style:{width:"550px"},children:[B.jsx(zu,{children:F("annotator:common.createSignature")}),B.jsx(ye,{as:"span",justify:"center",mb:"4",children:B.jsxs(Eu,{size:"3",defaultValue:c,onValueChange:ct=>L(ct),radius:"full",children:[B.jsx(za,{value:"Enter",children:F("enter")}),B.jsx(za,{value:"Draw",children:F("draw")}),B.jsx(za,{value:"Upload",children:F("annotator:editor.signature.upload")})]})}),B.jsxs("div",{className:fi.SignatureTool,children:[B.jsxs("div",{className:fi.container,style:{width:a},children:[Y==="Enter"&&B.jsx("input",{autoFocus:!0,type:"text",value:g,onChange:ct=>j(ct.target.value),placeholder:F("annotator:editor.signature.area"),style:{height:s-2,width:a/1.1,color:N,fontFamily:`${A}`,fontSize:Z0,lineHeight:`${Z0}px`}}),Y==="Draw"&&B.jsxs(B.Fragment,{children:[B.jsx("div",{className:fi.info,children:F("annotator:editor.signature.area")}),B.jsx("div",{ref:u,style:{height:s,width:a}})]}),Y==="Upload"&&B.jsx("div",{style:{height:s,width:a},children:$?B.jsx("div",{className:fi.imagePreview,style:{height:s,width:a},children:B.jsx("img",{src:$,alt:"preview"})}):B.jsxs("div",{style:{height:s,width:a},children:[B.jsx("input",{style:{display:"none"},type:"file",ref:R,accept:r,onChange:it}),B.jsxs(ye,{height:`${s}px`,direction:"column",gap:"3",justify:"center",align:"center",children:[B.jsxs(Dl,{size:"3",onClick:()=>{R.current?.click()},children:[B.jsx(V2,{})," ",F("annotator:editor.signature.choose")]}),B.jsx(el,{color:"gray",size:"2",style:{textAlign:"center"},children:F("annotator:editor.signature.uploadHint",{format:r,maxSize:GF(o)})}),x&&B.jsx(Eh,{color:"red",mt:"3",children:B.jsx(xh,{children:F("fileSizeLimit",{value:GF(tt)})})})]})]})})]}),B.jsx("div",{className:fi.toolbar,style:{width:a},children:B.jsxs(ye,{justify:"between",align:"center",gap:"2",children:[B.jsxs("div",{className:fi.colorPalette,children:[Y!=="Upload"&&B.jsx(B.Fragment,{children:i.map(ct=>B.jsx("div",{onClick:()=>K(ct),className:`${fi.cell} ${ct===N?fi.active:""}`,children:B.jsx("span",{style:{backgroundColor:ct}})},ct))}),Y==="Enter"&&B.jsx(B.Fragment,{children:B.jsxs(ho,{onValueChange:async ct=>{await Wt(ct)},defaultValue:A,size:"1",children:[B.jsx(Uo,{}),B.jsx(Zo,{children:Z.map(ct=>B.jsx(ys,{value:ct.value,children:ct.label},ct.value))})]})})]}),B.jsx(Dl,{variant:"ghost",mr:"3",onClick:Xt,children:F("clear")})]})}),B.jsxs(ye,{gap:"3",mt:"4",justify:"end",children:[B.jsx(Bo,{children:B.jsx(Dl,{style:{width:100},variant:"soft",color:"gray",children:F("cancel")})}),B.jsx(Bo,{children:B.jsx(Dl,{disabled:y,style:{width:100},onClick:Qt,children:F("ok")})})]})]})]})]})]})},yx=({defaultAnnotationName:l,stamps:t,signatures:e})=>{const{t:n}=si(["annotator"],{useSuspense:!1}),{defaultOptions:i}=dr(),{painter:a}=Cd(),s=Rt.useRef(null),c=Rt.useCallback((S,N)=>{const G=S?.type??null;if(s.current===G)return;s.current=G;const y=[We.SIGNATURE,We.STAMP].includes(S?.type)?N:null;a?.activate(S,y)},[a]),o=Rt.useMemo(()=>l&&ki.find(S=>S.name===l)||null,[l]),r=Al(S=>S.currentAnnotationType),U=Al(S=>S.setCurrentAnnotationType),Z=r?.type,F=!r?.styleEditable?.color,[u,W]=Rt.useState(ki.filter(S=>S.webSelectionDependencies===!1));Rt.useEffect(()=>()=>{s.current=null,U(null),c(null,null)},[]),Rt.useEffect(()=>{o&&(U(o),c(o,null))},[o,U,c]);const V=Rt.useCallback((S,N)=>{U(S),c(S,N)},[c,U]);Rt.useEffect(()=>{c(r,null)},[r,c]);const R=S=>{if(!r)return;const N={...r,style:{...r.style,color:S}},G=u.map(y=>y.type===r.type?{...y,style:{...y.style,color:S}}:y);W(G),U(N),a?.activate(N,null)},Q=u.map((S,N)=>{const G=S.type===Z;switch(S.type){case We.STAMP:return B.jsx(Fx,{default_stamps:t,annotation:S,onAdd:y=>V(S,y)},N);case We.SIGNATURE:return B.jsx(Mx,{default_signatures:e,annotation:S,onAdd:y=>V(S,y)},N);default:return B.jsx(Jd,{selected:G,title:n(`annotator:tool.${S.name}`),icon:S.icon,onClick:()=>V(G?null:S,null)},N)}});return B.jsxs(ye,{gap:"3",align:"center",children:[B.jsx(IF,{}),B.jsx(ma,{orientation:"vertical"}),Q,B.jsx(ma,{orientation:"vertical"}),B.jsx(po,{value:r?.style?.color||i.colors[0],onChange:R,presets:i.colors,popover:!0,trigger:B.jsx(Jd,{disabled:F,icon:B.jsx(uk,{style:{color:r?.style?.color}})})})]})},Gx={colors:["#ff6b6b","#ffa94d","#ffe066","#b4fa56","#51cf66","#4dabf7","#228be6","#364fc7","#9c36b5","#e64980","#1272e8","#04861b","#da3324","#000000","#fefefe"],signature:{colors:["#000000","#ff0000","#1677ff"],type:"Enter",maxSize:1024*1024*5,accept:".png,.jpg,.jpeg,.bmp",defaultSignature:[],defaultFont:[{label:"楷体",value:"STKaiti",external:!1}]},stamp:{maxSize:1024*1024*5,accept:".png,.jpg,.jpeg,.bmp",defaultStamp:[],editor:{defaultBackgroundColor:"#2f9e44",defaultBorderColor:"#2b8a3e",defaultBorderStyle:"none",defaultTextColor:"#fff",defaultFont:[{label:"Arial",value:"Arial"},{label:"Times New Roman",value:"Times New Roman"},{label:"Georgia",value:"Georgia"},{label:"Verdana",value:"Verdana"},{label:"Tahoma",value:"Tahoma, Geneva, sans-serif"},{label:"Trebuchet MS",value:'"Trebuchet MS", sans-serif'},{label:"Courier New",value:'"Courier New", Courier, monospace'},{label:"Lucida Console",value:'"Lucida Console", Monaco, monospace'},{label:"宋体",value:'SimSun, Songti SC, STSong, 宋体, "Noto Serif SC", serif'},{label:"黑体",value:"Microsoft YaHei, PingFang SC, Heiti SC, SimHei, 黑体, sans-serif"},{label:"楷体",value:'KaiTi, KaiTi_GB2312, STFangsong, 楷体, "AR PL UKai CN", serif'}]}}},Jx="_filter_1lw4f_1",Xx="_sidebar_1lw4f_17",Yx="_list_1lw4f_17",Bx="_group_1lw4f_21",Lx="_comment_1lw4f_24",kx="_title_1lw4f_37",Ix="_username_1lw4f_42",zx="_tool_1lw4f_49",Dx="_reply_1lw4f_54",Ex="_selected_1lw4f_70",Kn={filter:Jx,sidebar:Xx,list:Yx,group:Bx,comment:Lx,title:kx,username:Ix,tool:zx,reply:Dx,selected:Ex},xx={Circle:B.jsx(Y2,{}),FreeText:B.jsx(J2,{}),Ink:B.jsx(Ms,{}),Highlight:B.jsx(Ou,{}),Underline:B.jsx(Hu,{}),Squiggly:B.jsx(B2,{}),StrikeOut:B.jsx(Ku,{}),Stamp:B.jsx(k2,{}),Line:B.jsx(Ms,{}),Square:B.jsx(X2,{}),Polygon:B.jsx(Ms,{}),PolyLine:B.jsx(D2,{}),Caret:B.jsx(L2,{}),Link:B.jsx(Ms,{}),Text:B.jsx(WF,{}),FileAttachment:B.jsx(Wk,{}),Popup:B.jsx(Ms,{}),Widget:B.jsx(Ms,{}),Note:B.jsx(WF,{}),Arrow:B.jsx(z2,{}),None:void 0},fZ={[ji.Accepted]:{labelKey:"annotator:comment.status.accepted",icon:B.jsx(FL,{})},[ji.Rejected]:{labelKey:"annotator:comment.status.rejected",icon:B.jsx(oL,{})},[ji.Cancelled]:{labelKey:"annotator:comment.status.cancelled",icon:B.jsx(mL,{})},[ji.Completed]:{labelKey:"annotator:comment.status.completed",icon:B.jsx(cL,{})},[ji.Closed]:{labelKey:"annotator:comment.status.closed",icon:B.jsx(RL,{})},[ji.None]:{labelKey:"annotator:comment.status.none",icon:B.jsx(WL,{})}},gx=l=>xx[l]||null,wx=({subtype:l})=>{const t=gx(l);return t?B.jsx("span",{style:{marginRight:5},children:t}):null},Cx=()=>{const l=Al(q=>q.annotations),t=Rt.useContext(zF),{isSidebarCollapsed:e}=Wa(),{painter:n}=Cd(),i=Al(q=>q.selectedAnnotation),a=Al(q=>q.setSelectedAnnotation),s=Al(q=>q.clearSelectedAnnotation),[c,o]=Rt.useState(null),[r,U]=Rt.useState(null),[Z,F]=Rt.useState(null),[u,W]=Rt.useState([]),[V,R]=Rt.useState([]),{t:Q}=si(["common","annotator"],{useSuspense:!1});Rt.useEffect(()=>{if(i&&i?.source===Ea.CANVAS&&!e){const q=i?.store?.title===t?.user?.name,Wt=i?.store?.contentsObj?.text==="",ut=i?.store?.comments?.length===0;q&&Wt&&ut?F(i.store):o(i.store)}},[i]);const S=Rt.useRef({}),N=Rt.useMemo(()=>{const q=new Map;return l.forEach(Wt=>{q.set(Wt.title,(q.get(Wt.title)||0)+1)}),Array.from(q.entries())},[l]),G=Rt.useMemo(()=>{const q=new Map;return l.forEach(Wt=>{q.set(Wt.subtype,(q.get(Wt.subtype)||0)+1)}),Array.from(q.entries())},[l]);Rt.useEffect(()=>{W(N.map(([q])=>q))},[N]),Rt.useEffect(()=>{R(G.map(([q])=>q))},[G]),Rt.useEffect(()=>()=>{o(null),U(null),F(null),s()},[]);const y=Rt.useMemo(()=>u.length===0||V.length===0?[]:Array.from(l.values()).filter(q=>u.includes(q.title)&&V.includes(q.subtype)),[l,u,V]),k=Rt.useMemo(()=>y.reduce((q,Wt)=>(q[Wt.pageNumber]||(q[Wt.pageNumber]=[]),q[Wt.pageNumber].push(Wt),q),{}),[y]),I=q=>{W(Wt=>Wt.includes(q)?Wt.filter(ut=>ut!==q):[...Wt,q])},X=q=>{R(Wt=>Wt.includes(q)?Wt.filter(ut=>ut!==q):[...Wt,q])},Y=B.jsxs("div",{className:Kn.filter,children:[B.jsx(el,{as:"div",children:Q("author")}),B.jsx("ul",{children:N.map(([q,Wt])=>B.jsx("li",{children:B.jsx(el,{as:"label",size:"2",children:B.jsxs(ye,{gap:"2",children:[B.jsx(Yo,{checked:u.includes(q),onCheckedChange:()=>I(q)}),q," (",Wt,")"]})})},q))}),B.jsx(el,{as:"div",children:Q("type")}),B.jsx("ul",{children:G.map(([q,Wt])=>B.jsx("li",{children:B.jsx(el,{as:"label",size:"2",children:B.jsxs(ye,{gap:"2",children:[B.jsx(Yo,{checked:V.includes(q),onCheckedChange:()=>X(q)}),q," (",Wt,")"]})})},q))}),B.jsxs(ye,{gap:"3",mt:"2",justify:"between",children:[B.jsx(Dl,{variant:"ghost",onClick:()=>{W(N.map(([q])=>q)),R(G.map(([q])=>q))},children:Q("selectAll")}),B.jsx(Dl,{variant:"ghost",onClick:()=>{W([]),R([])},children:Q("clear")})]})]}),L=q=>{const ut=[...q.comments||[]].reverse().find(Qt=>Qt.status!==void 0&&Qt.status!==null)?.status??ji.None;return fZ[ut]?.icon??fZ[ji.None].icon},g=q=>{a(q,Ea.SIDEBAR),n?.highlight(q)},j=(q,Wt)=>{n?.update(q.id,{contentsObj:{...q.contentsObj||{text:""},text:Wt},date:M0(Date.now())}),F(null)},A=(q,Wt,ut)=>{const Qt={id:vS(),title:t?.user?.name,date:M0(Date.now()),content:Wt,status:ut};n?.update(q.id,{comments:[...q.comments||[],Qt]}),o(null)},et=(q,Wt,ut)=>{const Qt=(q.comments||[]).map(Xt=>Xt.id===Wt.id?{...Xt,content:ut,date:M0(Date.now()),title:t?.user?.name||Xt.title}:Xt);n?.update(q.id,{comments:Qt}),U(null)},$=q=>{n?.delete(q.id,!0)},nt=(q,Wt)=>{const ut=(q.comments||[]).filter(Qt=>Qt.id!==Wt.id);n?.update(q.id,{comments:ut}),r?.id===Wt.id&&U(null)},x=Rt.useCallback(q=>{let Wt="";if(Z&&i?.store?.id===q.id){const ut=()=>{j(q,Wt),F(null)},Qt=Xt=>{Xt&&setTimeout(()=>{Xt.focus()},0)};return B.jsxs(B.Fragment,{children:[B.jsx(V0,{ref:Qt,defaultValue:q?.contentsObj?.text,autoFocus:!0,rows:4,style:{marginBottom:"8px",marginTop:"8px"},onBlur:()=>F(null),onChange:Xt=>Wt=Xt.target.value,onKeyDown:Xt=>{Xt.key==="Enter"&&!Xt.shiftKey&&(Xt.preventDefault(),ut())}}),B.jsx(Dl,{style:{width:"100%"},onMouseDown:ut,children:Q("confirm")})]})}return B.jsx(ye,{gap:"3",pl:"4",children:B.jsx(el,{as:"p",size:"2",truncate:!0,children:q?.contentsObj?.text})})},[Z,i]),O=Rt.useCallback(q=>{let Wt="";if(c&&i?.store?.id===q.id){const ut=()=>{A(q,Wt),o(null)},Qt=Xt=>{Xt&&setTimeout(()=>{Xt.focus()},0)};return B.jsxs(B.Fragment,{children:[B.jsx(V0,{ref:Qt,autoFocus:!0,rows:4,style:{marginBottom:"8px",marginTop:"8px"},onBlur:()=>o(null),onChange:Xt=>Wt=Xt.target.value,onKeyDown:Xt=>{Xt.key==="Enter"&&!Xt.shiftKey&&(Xt.preventDefault(),ut())}}),B.jsx(Dl,{style:{width:"100%"},onMouseDown:ut,children:Q("confirm")})]})}return null},[c,i]),P=Rt.useCallback((q,Wt)=>{let ut="";if(r&&r.id===Wt.id){const Qt=()=>{et(q,Wt,ut),U(null)},Xt=ht=>{ht&&setTimeout(()=>{ht.focus()},0)};return B.jsxs(B.Fragment,{children:[B.jsx(V0,{ref:Xt,defaultValue:r.content,autoFocus:!0,rows:4,style:{marginBottom:"8px"},onBlur:()=>U(null),onChange:ht=>ut=ht.target.value,onKeyDown:ht=>{ht.key==="Enter"&&!ht.shiftKey&&(ht.preventDefault(),Qt())}}),B.jsx(Dl,{style:{width:"100%"},onMouseDown:Qt,children:Q("confirm")})]})}return B.jsx(ye,{gap:"3",children:B.jsx(el,{as:"p",size:"2",truncate:!0,children:Wt.content})})},[c,r]),tt=Object.entries(k).map(([q,Wt])=>{const ut=Wt.sort((Qt,Xt)=>Qt.konvaClientRect.y-Xt.konvaClientRect.y);return B.jsxs("div",{className:Kn.group,children:[B.jsxs(ye,{gap:"2",justify:"between",p:"1",children:[B.jsx(el,{size:"2",children:Q("annotator:comment.page",{value:q})}),B.jsx(el,{size:"2",children:Q("annotator:comment.total",{value:Wt.length})})]}),ut.map(Qt=>{const ht={className:Qt.id===i?.store?.id?`${Kn.comment} ${Kn.selected}`:Kn.comment,id:`annotation-${Qt.id}`};return Rt.createElement("div",{...ht,key:Qt.id,onClick:()=>g(Qt),ref:K=>S.current[Qt.id]=K},B.jsxs("div",{className:Kn.title,children:[B.jsx(wx,{subtype:Qt.subtype}),B.jsxs("div",{className:Kn.username,children:[B.jsxs(ye,{justify:"start",children:[B.jsx(el,{size:"2",as:"div",truncate:!0,style:{maxWidth:150},children:Qt.title}),Qt.native&&B.jsx(wh,{content:Q("annotator:comment.nativeAnnotation"),children:B.jsx("span",{children:B.jsx(hL,{})})})]}),B.jsx(el,{color:"gray",size:"2",children:oh(Qt.date,!0)})]}),B.jsxs("span",{className:Kn.tool,children:[B.jsxs(Vd,{children:[B.jsx(bd,{children:B.jsx(Dl,{variant:"ghost",color:"gray",size:"2",style:{boxShadow:"none",color:"#000000"},m:"2",children:L(Qt)})}),B.jsx(Rd,{onCloseAutoFocus:K=>K.preventDefault(),children:Object.entries(fZ).map(([K,it])=>B.jsxs(vi,{onSelect:()=>{A(Qt,Q("annotator:comment.statusText",{value:Q(it.labelKey)}),K),o(null)},children:[it.icon," ",Q(it.labelKey)]},K))})]}),B.jsxs(Vd,{children:[B.jsx(bd,{children:B.jsx(Dl,{variant:"ghost",color:"gray",size:"2",m:"2",style:{boxShadow:"none",color:"#000000"},children:B.jsx(yW,{})})}),B.jsxs(Rd,{onCloseAutoFocus:K=>K.preventDefault(),children:[B.jsx(vi,{onSelect:K=>{K.stopPropagation(),o(Qt)},children:Q("reply")}),B.jsx(vi,{onSelect:K=>{K.stopPropagation(),F(Qt)},children:Q("edit")}),B.jsx(vi,{onSelect:K=>{K.stopPropagation(),$(Qt)},children:Q("delete")})]})]})]})]}),x(Qt),Qt.comments?.map((K,it)=>B.jsxs("div",{className:Kn.reply,children:[B.jsxs("div",{className:Kn.title,children:[B.jsxs("div",{className:Kn.username,children:[B.jsx(el,{truncate:!0,size:"2",as:"div",style:{maxWidth:200},children:K.title}),B.jsx(el,{as:"div",color:"gray",size:"2",children:oh(K.date,!0)})]}),B.jsx("span",{className:Kn.tool,children:B.jsxs(Vd,{children:[B.jsx(bd,{children:B.jsx(Dl,{variant:"outline",color:"gray",size:"2",style:{boxShadow:"none",color:"#000000"},children:B.jsx(yW,{})})}),B.jsxs(Rd,{onCloseAutoFocus:ct=>ct.preventDefault(),children:[B.jsx(vi,{onSelect:ct=>{ct.stopPropagation(),U(K)},children:Q("edit")}),B.jsx(vi,{onSelect:ct=>{ct.stopPropagation(),nt(Qt,K)},children:Q("delete")})]})]})})]}),P(Qt,K)]},it)),B.jsxs("div",{children:[O(Qt),!c&&!r&&!Z&&i?.store?.id===Qt.id&&B.jsx(Dl,{mt:"2",style:{width:"100%"},onClick:()=>o(Qt),children:Q("reply")})]}))})]},q)});return B.jsxs("div",{className:Kn.sidebar,children:[B.jsx(ye,{align:"center",justify:"start",p:"1",children:B.jsxs(_o,{children:[B.jsx(qo,{children:B.jsx(Dl,{variant:"outline",size:"2",color:"gray",style:{boxShadow:"none",color:"#000000",fontSize:"16px"},children:B.jsx(UL,{})})}),B.jsx($o,{children:Y})]})}),B.jsx("div",{className:Kn.list,children:tt})]})};class Ei{annotation;page;pdfDoc;constructor(t,e,n){this.pdfDoc=t,this.page=e,this.annotation=n}addAnnotationToPage(t,e){const n=t.node.lookup(ot.of("Annots"));n?n.push(e):t.node.set(ot.of("Annots"),t.doc.context.obj([e]))}}class fx extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=dn(t.konvaClientRect,e.getHeight()),a=n.context,s=a.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:i,NM:Ue.of(t.id),Contents:He(t.contentsObj?.text||""),Name:ot.of("Comment"),T:He(t.title||_l("normal.unknownUser")),M:Ue.of(t.date||""),C:Gn(t.color||"#000000"),Open:!1}),c=a.register(s);this.addAnnotationToPage(e,c);for(const o of t.comments||[]){const r=a.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:i,Contents:He(o.content),T:He(o.title||_l("normal.unknownUser")),M:Ue.of(o.date||""),C:Gn(t.color||"#000000"),IRT:c,RT:ot.of("R"),NM:Ue.of(o.id),Open:!1}),U=a.register(r);this.addAnnotationToPage(e,U)}}}var J0={exports:{}},vx=J0.exports,fb;function jx(){return fb||(fb=1,(function(l,t){(function(e,n){n()})(vx,function(){function e(r,U){return typeof U>"u"?U={autoBom:!1}:typeof U!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),U={autoBom:!U}),U.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(r.type)?new Blob(["\uFEFF",r],{type:r.type}):r}function n(r,U,Z){var F=new XMLHttpRequest;F.open("GET",r),F.responseType="blob",F.onload=function(){o(F.response,U,Z)},F.onerror=function(){console.error("could not download file")},F.send()}function i(r){var U=new XMLHttpRequest;U.open("HEAD",r,!1);try{U.send()}catch{}return 200<=U.status&&299>=U.status}function a(r){try{r.dispatchEvent(new MouseEvent("click"))}catch{var U=document.createEvent("MouseEvents");U.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),r.dispatchEvent(U)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Js=="object"&&Js.global===Js?Js:void 0,c=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!c?function(r,U,Z){var F=s.URL||s.webkitURL,u=document.createElement("a");U=U||r.name||"download",u.download=U,u.rel="noopener",typeof r=="string"?(u.href=r,u.origin===location.origin?a(u):i(u.href)?n(r,U,Z):a(u,u.target="_blank")):(u.href=F.createObjectURL(r),setTimeout(function(){F.revokeObjectURL(u.href)},4e4),setTimeout(function(){a(u)},0))}:"msSaveOrOpenBlob"in navigator?function(r,U,Z){if(U=U||r.name||"download",typeof r!="string")navigator.msSaveOrOpenBlob(e(r,Z),U);else if(i(r))n(r,U,Z);else{var F=document.createElement("a");F.href=r,F.target="_blank",setTimeout(function(){a(F)})}}:function(r,U,Z,F){if(F=F||open("","_blank"),F&&(F.document.title=F.document.body.innerText="downloading..."),typeof r=="string")return n(r,U,Z);var u=r.type==="application/octet-stream",W=/constructor/i.test(s.HTMLElement)||s.safari,V=/CriOS\/[\d]+/.test(navigator.userAgent);if((V||u&&W||c)&&typeof FileReader<"u"){var R=new FileReader;R.onloadend=function(){var N=R.result;N=V?N:N.replace(/^data:[^;]*;/,"data:attachment/file;"),F?F.location.href=N:location=N,F=null},R.readAsDataURL(r)}else{var Q=s.URL||s.webkitURL,S=Q.createObjectURL(r);F?F.location=S:location.href=S,F=null,setTimeout(function(){Q.revokeObjectURL(S)},4e4)}});s.saveAs=o.saveAs=o,l.exports=o})})(J0)),J0.exports}var aT=jx();class Ox extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),c=JSON.parse(t.konvaString).children.filter(Z=>Z.className==="Rect"),o=[];for(const Z of c){const{x:F,y:u,width:W,height:V}=Z.attrs,R=F,Q=a-u,S=F+W,N=a-(u+V);o.push(R,Q,S,Q,R,N,S,N)}const r=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Highlight"),Rect:dn(t.konvaClientRect,a),QuadPoints:o,C:Gn(t.color||"#000000"),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id)}),U=i.register(r);this.addAnnotationToPage(e,U);for(const Z of t.comments||[]){const F=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(Z.content),T:He(Z.title||_l("normal.unknownUser")),M:Ue.of(Z.date||""),C:Gn(t.color||"#000000"),IRT:U,RT:ot.of("R"),NM:Ue.of(Z.id),Open:!1}),u=i.register(F);this.addAnnotationToPage(e,u)}}}class Kx extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),c=JSON.parse(t.konvaString).children.filter(Z=>Z.className==="Rect"),o=[];for(const Z of c){const{x:F,y:u,width:W,height:V}=Z.attrs,R=F,Q=a-u,S=F+W,N=a-(u+V);o.push(R,Q,S,Q,R,N,S,N)}const r=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Underline"),Rect:dn(t.konvaClientRect,a),QuadPoints:o,C:Gn(t.color||"#000000"),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id)}),U=i.register(r);this.addAnnotationToPage(e,U);for(const Z of t.comments||[]){const F=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(Z.content),T:He(Z.title||_l("normal.unknownUser")),M:Ue.of(Z.date||""),C:Gn(t.color||"#000000"),IRT:U,RT:ot.of("R"),NM:Ue.of(Z.id),Open:!1}),u=i.register(F);this.addAnnotationToPage(e,u)}}}class Hx extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),c=JSON.parse(t.konvaString).children.filter(Z=>Z.className==="Rect"),o=[];for(const Z of c){const{x:F,y:u,width:W,height:V}=Z.attrs,R=F,Q=a-u,S=F+W,N=a-(u+V);o.push(R,Q,S,Q,R,N,S,N)}const r=i.obj({Type:ot.of("Annot"),Subtype:ot.of("StrikeOut"),Rect:dn(t.konvaClientRect,a),QuadPoints:o,C:Gn(t.color||"#000000"),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id)}),U=i.register(r);this.addAnnotationToPage(e,U);for(const Z of t.comments||[]){const F=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(Z.content),T:He(Z.title||_l("normal.unknownUser")),M:Ue.of(Z.date||""),C:Gn(t.color||"#000000"),IRT:U,RT:ot.of("R"),NM:Ue.of(Z.id),Open:!1}),u=i.register(F);this.addAnnotationToPage(e,u)}}}class Px extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),s=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Square"),Rect:dn(t.konvaClientRect,a),C:Gn(t.color||"#000000"),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id),Border:[0,0,1]}),c=i.register(s);this.addAnnotationToPage(e,c);for(const o of t.comments||[]){const r=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(o.content),T:He(o.title||_l("normal.unknownUser")),M:Ue.of(o.date||""),C:Gn(t.color||"#000000"),IRT:c,RT:ot.of("R"),NM:Ue.of(o.id),Open:!1}),U=i.register(r);this.addAnnotationToPage(e,U)}}}class Ax extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),s=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Circle"),Rect:dn(t.konvaClientRect,a),C:Gn(t.color||"#000000"),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id),Border:[0,0,1]}),c=i.register(s);this.addAnnotationToPage(e,c);for(const o of t.comments||[]){const r=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(o.content),T:He(o.title||_l("normal.unknownUser")),M:Ue.of(o.date||""),C:Gn(t.color||"#000000"),IRT:c,RT:ot.of("R"),NM:Ue.of(o.id),Open:!1}),U=i.register(r);this.addAnnotationToPage(e,U)}}}class _x extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),s=JSON.parse(t.konvaString),c=s.children.filter(I=>I.className==="Line"),o=s.attrs.x||0,r=s.attrs.y||0,U=s.attrs.scaleX||1,Z=s.attrs.scaleY||1,F=i.obj(c.map(I=>{const X=I.attrs.points,Y=[];for(let L=0;L<X.length;L+=2){const g=o+X[L]*U,j=r+X[L+1]*Z;Y.push(g,a-j)}return i.obj(Y)})),u=c[0]?.attrs||{},W=u.strokeWidth??1,V=u.opacity??1,R=u.stroke??t.color??"rgb(255, 0, 0)",[Q,S,N]=Gn(R),G=i.obj({W:de.of(W),S:ot.of("S")}),y=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Ink"),Rect:dn(t.konvaClientRect,a),InkList:F,C:i.obj([de.of(Q),de.of(S),de.of(N)]),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id),Border:i.obj([0,0,0]),BS:G,CA:de.of(V)}),k=i.register(y);this.addAnnotationToPage(e,k);for(const I of t.comments||[]){const X=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(I.content),T:He(I.title||_l("normal.unknownUser")),M:Ue.of(I.date||""),C:i.obj([de.of(Q),de.of(S),de.of(N)]),IRT:k,RT:ot.of("R"),NM:Ue.of(I.id),Open:!1}),Y=i.register(X);this.addAnnotationToPage(e,Y)}}}class qx extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,[i,,,a]=dn(t.konvaClientRect,e.getHeight()),s=n.context,c=e.getWidth(),o=e.getHeight(),r=20,U=Math.max(0,Math.min(i,c-r)),Z=Math.min(o,Math.max(a,r)),F=Z-r,u=[de.of(U),de.of(F),de.of(U+r),de.of(Z)],W=s.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:u,NM:Ue.of(t.id),Contents:He(t.contentsObj?.text||""),Name:ot.of("Comment"),T:He(t.title||_l("normal.unknownUser")),M:Ue.of(t.date||""),C:Gn(t.color||"#000000"),Open:!1}),V=s.register(W);this.addAnnotationToPage(e,V);for(const R of t.comments||[]){const Q=s.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:u,Contents:He(R.content),T:He(R.title||_l("normal.unknownUser")),M:Ue.of(R.date||""),C:Gn(t.color||"#000000"),IRT:V,RT:ot.of("R"),NM:Ue.of(R.id),Open:!1}),S=s.register(Q);this.addAnnotationToPage(e,S)}}}class $x extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,[a,s,c,o]=dn(t.konvaClientRect,e.getHeight()),r=e.getWidth(),U=e.getHeight(),Z=Math.max(0,Math.min(a,r)),F=Math.max(0,Math.min(s,U)),u=Math.max(Z,Math.min(c,r)),W=Math.max(F,Math.min(o,U)),V=[de.of(Z),de.of(F),de.of(u),de.of(W)];let R;if(t.contentsObj?.image){const G=t.contentsObj.image.replace(/^data:image\/png;base64,/,""),y=await n.embedPng(G),k=y.width,I=y.height,X=i.obj({Type:"XObject",Subtype:"Form",BBox:[0,0,k,I],Resources:i.obj({XObject:i.obj({Im1:y.ref})})}),Y=`q ${k} 0 0 ${I} 0 0 cm /Im1 Do Q`,L=new TextEncoder().encode(Y),g=yd.of(X,L),j=i.register(g);R=i.obj({N:j})}const Q={Type:ot.of("Annot"),Subtype:ot.of("Stamp"),Rect:V,NM:Ue.of(t.id),Contents:He(t.contentsObj?.text||""),T:He(t.title||_l("normal.unknownUser")),M:Ue.of(t.date||""),Open:!1,F:de.of(128)};R&&(Q.AP=R);const S=i.obj(Q),N=i.register(S);this.addAnnotationToPage(e,N);for(const G of t.comments||[]){const y=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,U),Contents:He(G.content),T:He(G.title||_l("normal.unknownUser")),M:Ue.of(G.date||""),IRT:N,RT:ot.of("R"),NM:Ue.of(G.id),Open:!1}),k=i.register(y);this.addAnnotationToPage(e,k)}}}class tg extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),s=JSON.parse(t.konvaString),c=s.children.filter(I=>I.className==="Arrow"),o=s.attrs.x||0,r=s.attrs.y||0,U=s.attrs.scaleX||1,Z=s.attrs.scaleY||1,F=i.obj(c.map(I=>{const X=I.attrs.points,Y=[];for(let L=0;L<X.length;L+=2){const g=o+X[L]*U,j=r+X[L+1]*Z;Y.push(g,a-j)}return i.obj(Y)})),u=c[0]?.attrs||{},W=u.strokeWidth??1,V=u.opacity??1,R=u.stroke??t.color??"rgb(255, 0, 0)",[Q,S,N]=Gn(R),G=i.obj({W:de.of(W),S:ot.of("S")}),y=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Ink"),Rect:dn(t.konvaClientRect,a),InkList:F,C:i.obj([de.of(Q),de.of(S),de.of(N)]),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id),Border:i.obj([0,0,0]),BS:G,CA:de.of(V)}),k=i.register(y);this.addAnnotationToPage(e,k);for(const I of t.comments||[]){const X=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(I.content),T:He(I.title||_l("normal.unknownUser")),M:Ue.of(I.date||""),C:i.obj([de.of(Q),de.of(S),de.of(N)]),IRT:k,RT:ot.of("R"),NM:Ue.of(I.id),Open:!1}),Y=i.register(X);this.addAnnotationToPage(e,Y)}}}function eg(l){const t=l.match(/[a-zA-Z][^a-zA-Z]*/g)||[],e=[];for(const n of t){const i=n[0],a=n.slice(1).trim().split(/[\s,]+/).map(parseFloat);if(i==="M"||i==="L")for(let s=0;s<a.length;s+=2)e.push(a[s],a[s+1]);else i==="Q"?a.length>=4&&e.push(a[2],a[3]):i==="C"&&a.length>=6&&e.push(a[4],a[5])}return e}class lg extends Ei{async parse(){const{annotation:t,page:e,pdfDoc:n}=this,i=n.context,a=e.getHeight(),s=JSON.parse(t.konvaString),c=s.children.filter(I=>I.className==="Path"),o=s.attrs.x||0,r=s.attrs.y||0,U=s.attrs.scaleX||1,Z=s.attrs.scaleY||1,F=i.obj(c.map(I=>{const X=eg(I.attrs.data),Y=[];for(let L=0;L<X.length;L+=2){const g=o+X[L]*U,j=r+X[L+1]*Z;Y.push(g,a-j)}return i.obj(Y)})),u=c[0]?.attrs||{},W=u.strokeWidth??1,V=u.opacity??1,R=u.stroke??t.color??"rgb(255, 0, 0)",[Q,S,N]=Gn(R),G=i.obj({W:de.of(W),S:ot.of("S")}),y=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Ink"),Rect:dn(t.konvaClientRect,a),InkList:F,C:i.obj([de.of(Q),de.of(S),de.of(N)]),T:He(t.title||_l("normal.unknownUser")),Contents:He(t.contentsObj?.text||""),M:Ue.of(t.date||""),NM:Ue.of(t.id),Border:i.obj([0,0,0]),BS:G,CA:de.of(V)}),k=i.register(y);this.addAnnotationToPage(e,k);for(const I of t.comments||[]){const X=i.obj({Type:ot.of("Annot"),Subtype:ot.of("Text"),Rect:dn(t.konvaClientRect,a),Contents:He(I.content),T:He(I.title||_l("normal.unknownUser")),M:Ue.of(I.date||""),C:i.obj([de.of(Q),de.of(S),de.of(N)]),IRT:k,RT:ot.of("R"),NM:Ue.of(I.id),Open:!1}),Y=i.register(X);this.addAnnotationToPage(e,Y)}}}const ng={[Xl.TEXT]:fx,[Xl.HIGHLIGHT]:Ox,[Xl.UNDERLINE]:Kx,[Xl.STRIKEOUT]:Hx,[Xl.SQUARE]:Px,[Xl.CIRCLE]:Ax,[Xl.INK]:_x,[Xl.POLYLINE]:lg,[Xl.FREETEXT]:qx,[Xl.STAMP]:$x,[Xl.LINE]:tg};async function ig(l,t,e){const n=ng[l.pdfjsType];n?await new n(e,t,l).parse():console.warn("Unsupported annotation type:",l.pdfjsType)}function ag(l,t){const e=l.buffer.slice(l.byteOffset,l.byteOffset+l.byteLength),n=new Blob([e],{type:"application/pdf"});aT.saveAs(n,`${t}.pdf`)}function sg(l,t){const e=new Blob([l],{type:"application/octet-stream"});aT.saveAs(e,`${t}.xlsx`)}function dg(l){for(const t of l.getPages()){const e=ot.of("Annots");t.node.has(e)&&t.node.set(e,l.context.obj([]))}}async function cg(l,t,e){const n=await l.pdfDocument.getData(),i=await Ha.load(n);dg(i);for(const c of t){const o=i.getPages()[c.pageNumber-1];await ig(c,o,i)}const a=await i.save(),s=e||`annotated_${OS()}`;ag(a,s)}async function og(l,t,e){const n=[];t.sort((F,u)=>F.pageNumber!==u.pageNumber?F.pageNumber-u.pageNumber:pb(u.date)-pb(F.date));const i=F=>{const W=[...F.comments||[]].reverse().find(V=>V.status!==void 0&&V.status!==null)?.status??ji.None;return Vl.t(`annotator:comment.status.${W.toLowerCase()}`)};let a=1,s=0;t.forEach(F=>{const u=ki.find(V=>V.type===F.type)?.name,W=Vl.t(`annotator:tool.${u}`);n.push({index:`${a}`,id:F.id,page:F.pageNumber,annotationType:W,recordType:Vl.t("annotator:export.recordType.annotation"),author:F.title,content:F.contentsObj?.text||"",date:oh(F.date,!0),status:i(F)}),s=0,F.comments.forEach(V=>{s++,n.push({index:`${a}.${s}`,id:V.id,page:"",annotationType:"--",recordType:Vl.t("annotator:export.recordType.reply"),author:V.title,content:V.content,date:oh(V.date,!0),status:""})}),a++});const c=await Promise.resolve().then(()=>require("./exceljs.min-BKE5BH2D.cjs")).then(F=>F.exceljs_min),o=new c.Workbook,r=o.addWorksheet("sheet1");r.columns=[{key:"index",header:"#",width:8,style:{alignment:{vertical:"middle"}}},{key:"id",header:Vl.t("annotator:export.fields.id"),width:20,style:{alignment:{vertical:"middle"}}},{key:"page",header:Vl.t("annotator:export.fields.page"),width:10,style:{alignment:{vertical:"middle"}}},{key:"annotationType",header:Vl.t("annotator:export.fields.annotationType"),width:18,style:{alignment:{vertical:"middle"}}},{key:"recordType",header:Vl.t("annotator:export.fields.recordType"),width:12,style:{alignment:{vertical:"middle"}}},{key:"author",header:Vl.t("annotator:export.fields.author"),width:16,style:{alignment:{vertical:"middle"}}},{key:"content",header:Vl.t("annotator:export.fields.content"),width:40,style:{alignment:{wrapText:!0,vertical:"top"}}},{key:"date",header:Vl.t("annotator:export.fields.date"),width:22,style:{alignment:{vertical:"middle"}}},{key:"status",header:Vl.t("annotator:export.fields.status"),width:14,style:{alignment:{vertical:"middle"}}}],n.forEach(F=>{const u=r.addRow(F),W=F.recordType===Vl.t("annotator:export.recordType.reply");u.font={size:12,color:{argb:W?"389e0d":"000000"}}}),r.getRow(1).eachCell(F=>{F.font={bold:!0,size:12},F.fill={type:"pattern",pattern:"solid",fgColor:{argb:"D9E1F2"}}}),r.eachRow(F=>{F.eachCell(u=>{u.border={top:{style:"thin",color:{argb:"000000"}},left:{style:"thin",color:{argb:"000000"}},bottom:{style:"thin",color:{argb:"000000"}},right:{style:"thin",color:{argb:"000000"}}}})});const U=await o.xlsx.writeBuffer(),Z=e||`annotated_${OS()}`;sg(U,Z)}async function rg(l,t,e){if(e.has(t))return e.get(t);const n=l.getPageView(t);if(!n?.pdfPage)return"";const a=(await n.pdfPage.getTextContent()).items.map(s=>s.str).join("");return e.set(t,a),a}function hg({pdfViewer:l}){const[t,e]=Rt.useState(""),[n,i]=Rt.useState([]),[a,s]=Rt.useState(!1),[c,o]=Rt.useState({caseSensitive:!1,entireWord:!1,matchDiacritics:!1}),r=Rt.useRef(new Map);async function U({pageNumber:u,matchIndex:W}){if(!l||!t)return;const V=l.findController;!V||!l.pdfDocument||(l.scrollPageIntoView({pageNumber:u}),V._selected={pageIdx:u-1,matchIdx:W},V._offset={pageIdx:u-1,matchIdx:W-1,wrapped:!1},V._highlightMatches=!0,l.eventBus.dispatch("find",{type:"again",query:t,caseSensitive:c.caseSensitive,entireWord:c.entireWord,findPrevious:!1,matchDiacritics:c.matchDiacritics,highlightAll:!0}))}const Z=Rt.useCallback(async(u,W)=>{if(!l)return;s(!0),e(u),o({...c,...W});const V=[];try{const R=await new Promise(Q=>{const S=l.pagesCount;let N=0;const G=60,y=200,k=({source:I})=>{const X=async()=>{if(I._pageMatches.length===S){l.eventBus.off("updatefindcontrolstate",k);const Y=[];for(let L=0;L<I._pageMatches.length;L++){const g=I._pageMatches[L];if(!g||g.length===0)continue;const j=await rg(l,L,r.current),A=g.map((et,$)=>{const x=Math.max(0,et-5),O=Math.min(j.length,et+u.length+30);return{matchIndex:$,charIndex:et,snippet:j.slice(x,O)}});Y.push({pageNumber:L+1,countTotal:g.length,matches:A})}Q({query:u,countTotal:I._matchesCountTotal,pageMatches:Y})}else N<G?(N++,setTimeout(X,y)):(l.eventBus.off("updatefindcontrolstate",k),Q({query:u,countTotal:0,pageMatches:[]}))};X()};l.eventBus.on("updatefindcontrolstate",k),l.eventBus.dispatch("find",{type:"highlightallchange",query:u,caseSensitive:W?.caseSensitive??!1,entireWord:W?.entireWord??!1,findPrevious:!1,matchDiacritics:W?.matchDiacritics??!1,highlightAll:!0})});V.push(R)}catch(R){console.error(R),V.push({query:u,countTotal:0,pageMatches:[]})}i(V),s(!1)},[l]),F=Rt.useCallback(()=>{l?.eventBus.dispatch("find",{query:""}),e(""),i([])},[l]);return{query:t,setQuery:e,results:n,searching:a,search:Z,clearSearch:F,jumpToMatch:U,searchOptions:c}}const sT=({pdfViewer:l})=>{const{query:t,setQuery:e,results:n,searching:i,search:a,clearSearch:s,jumpToMatch:c}=hg({pdfViewer:l}),{t:o}=si("viewer",{useSuspense:!1}),[r,U]=Rt.useState({caseSensitive:!1,entireWord:!1}),[Z,F]=Rt.useState(null),u=Rt.useRef({}),W=({text:L,query:g})=>{const j=(A,et,$)=>{if(!et)return A;const nt="gi",x=et.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),O=new RegExp(`(${x})`,nt);return A.split(O).map((P,tt)=>O.test(P)?B.jsx("mark",{style:{backgroundColor:"rgba(255, 255, 0, 0.2)",padding:"0 2px"},children:P},`${tt}-${P}`):P)};return B.jsx(B.Fragment,{children:j(L,g,r.caseSensitive)})},V=Rt.useCallback(L=>{L.trim()&&l&&(s(),F(null),a(L.trim(),{caseSensitive:r.caseSensitive,entireWord:r.entireWord}))},[l,a,s,r]),R=Rt.useCallback(L=>{switch(L.key){case"Escape":(n.length>0||t.trim()!=="")&&s();break;case"Enter":t.trim()===""&&n.length>0&&s(),t.trim()&&(s(),V(t));break}},[t,n,s,V]),Q=Rt.useCallback((L,g)=>{F({pageNumber:L,matchIndex:g}),c({pageNumber:L,matchIndex:g})},[c]),S=Rt.useCallback((L,g)=>{U(j=>({...j,[L]:g}))},[]),N=Rt.useCallback(()=>{const L=[];return n.forEach(g=>{g.pageMatches.forEach(j=>{j.matches.forEach(A=>{L.push({pageNumber:j.pageNumber,matchIndex:A.matchIndex,query:g.query})})})}),L},[n]),G=Rt.useCallback((L,g)=>{const j=u.current[`${L}-${g}`];j&&j.scrollIntoView({block:"center",inline:"center"})},[]),y=Rt.useCallback(()=>Z?N().findIndex(g=>g.pageNumber===Z.pageNumber&&g.matchIndex===Z.matchIndex):-1,[Z,N]),k=Rt.useCallback(()=>{if(!n.length)return;const L=N();if(!L.length)return;let g=0;Z&&(g=(y()+1)%L.length);const j=L[g];F({pageNumber:j.pageNumber,matchIndex:j.matchIndex}),c({pageNumber:j.pageNumber,matchIndex:j.matchIndex}),G(j.pageNumber,j.matchIndex)},[n,Z,N,y,c]),I=Rt.useCallback(()=>{if(!n.length)return;const L=N();if(!L.length)return;let g=L.length-1;Z&&(g=(y()-1+L.length)%L.length);const j=L[g];F({pageNumber:j.pageNumber,matchIndex:j.matchIndex}),c({pageNumber:j.pageNumber,matchIndex:j.matchIndex}),G(j.pageNumber,j.matchIndex)},[n,Z,N,y,c]);Rt.useEffect(()=>{t.trim()&&V(t.trim())},[r,V]),Rt.useEffect(()=>()=>{n.length>0&&s(),F(null),e("")},[s,n]);const X=Rt.useCallback(()=>!n.length||i?null:n.map(L=>B.jsxs(Bi,{children:[B.jsxs(ye,{pb:"2",justify:"between",align:"center",style:{position:"sticky",top:89,backgroundColor:"var(--bg-color-tertiary)",zIndex:1},children:[B.jsx(el,{size:"2",children:o("viewer:search.resultTotal",{total:L.countTotal})}),L.countTotal>0&&B.jsxs("div",{children:[B.jsx(ra,{onClick:I,variant:"soft",color:"gray",size:"1",mr:"1",children:B.jsx(b2,{})}),B.jsx(ra,{onClick:k,variant:"soft",color:"gray",size:"1",mr:"1",children:B.jsx(N2,{})})]})]}),L.pageMatches.map(g=>B.jsxs(Bi,{mt:"1",mb:"3",pl:"2",children:[B.jsxs(el,{size:"2",children:[o("viewer:search.page",{value:g.pageNumber})," (",g.countTotal,")"]}),g.matches.map(j=>{const A=Z&&Z.pageNumber===g.pageNumber&&Z.matchIndex===j.matchIndex,et=`${g.pageNumber}-${j.matchIndex}`;return B.jsx(Bi,{mt:"2",pl:"0",children:B.jsx(Dl,{ref:$=>u.current[et]=$,variant:A?"soft":"outline",color:A?void 0:"gray",type:"button",onClick:()=>Q(g.pageNumber,j.matchIndex),style:{width:"100%",textAlign:"left",justifyContent:"flex-start"},children:B.jsx(el,{truncate:!0,children:B.jsx(W,{text:j.snippet,query:L.query})})})},j.matchIndex)})]},g.pageNumber))]},L.query)),[n,i,Z,o,Q]),Y=Rt.useMemo(()=>i?B.jsxs(ye,{mt:"2",align:"center",gap:"2",children:[B.jsx(Dh,{}),B.jsx(el,{size:"2",children:o("viewer:search.searching")})]}):null,[i,o]);return B.jsxs(Bi,{p:"2",pt:"0",children:[B.jsxs(ye,{direction:"column",style:{position:"sticky",top:0,backgroundColor:"var(--bg-color-tertiary)",zIndex:1},children:[B.jsxs(Lo,{placeholder:o("viewer:search.placeholder"),value:t,onChange:L=>e(L.currentTarget.value),onKeyDown:R,"aria-label":o("viewer:search.placeholder"),mt:"3",children:[B.jsx(UF,{children:B.jsx(wu,{})}),B.jsx(UF,{children:t.trim()&&B.jsx(ra,{size:"1",variant:"ghost",onClick:()=>{e(""),n.length>0&&(s(),F(null))},children:B.jsx(sL,{})})})]}),B.jsxs(ye,{mt:"2",align:"center",gap:"2",children:[B.jsx(el,{as:"label",size:"2",children:B.jsxs(ye,{gap:"2",children:[B.jsx(Yo,{checked:r.caseSensitive,onCheckedChange:L=>S("caseSensitive",!!L),"aria-label":o("viewer:search.caseSensitive")}),o("viewer:search.caseSensitive")]})}),B.jsx(el,{as:"label",size:"2",children:B.jsxs(ye,{gap:"2",children:[B.jsx(Yo,{checked:r.entireWord,onCheckedChange:L=>S("entireWord",!!L),"aria-label":o("viewer:search.entireWord")}),o("viewer:search.entireWord")]})})]}),B.jsx(ma,{my:"2",size:"4"})]}),Y,X()]})},Ug=({enableRange:l="auto",theme:t="violet",title:e="PDF ANNOTATOR",url:n,locale:i="zh-CN",user:a={id:"null",name:"unknown"},defaultOptions:s,initialScale:c,enableNativeAnnotations:o=!1,initialAnnotations:r=[],defaultShowAnnotationsSidebar:U=!1,onSave:Z,onLoad:F,onAnnotationAdded:u,onAnnotationDeleted:W,onAnnotationSelected:V,onAnnotationUpdated:R,layoutStyle:Q,actions:S})=>{const N=Rt.useMemo(()=>({textLayerMode:1,annotationMode:0,externalLinkTarget:0,enableRange:l}),[]),{t:G}=si(["annotator","common"],{useSuspense:!1}),y=Rt.useMemo(()=>nT(Gx,s||{}),[s]),[k,I]=Rt.useState(()=>Eb());Rt.useEffect(()=>{const Y=setTimeout(()=>{const L=Eb();I(L)},0);return()=>clearTimeout(Y)},[]),Rt.useEffect(()=>{Vl.changeLanguage(i)},[i]);const X=()=>{const{painter:Y}=Cd(),{pdfViewer:L}=Wa(),g=()=>{if(Y){const et=Y.getData();Z?.(et)}},j=async et=>{if(Y&&L){const $=Y.getData();await cg(L,$,et)}},A=async et=>{if(Y&&L){const $=Y.getData();await og(L,$,et)}};if(S){if(typeof S=="function"){const et=S;return B.jsx(et,{save:g,getAnnotations:()=>Y?.getData()||[],exportToExcel:$=>{A($)},exportToPdf:$=>{j($)}})}return Rt.cloneElement(S,{save:g,getAnnotations:()=>Y?.getData()||[],exportToExcel:et=>{A(et)},exportToPdf:et=>{j(et)}})}return B.jsxs(B.Fragment,{children:[B.jsx(ma,{orientation:"vertical"}),B.jsxs(Vd,{children:[B.jsx(bd,{children:B.jsxs(Dl,{variant:"soft",children:[G("common:export"),B.jsx(gh,{})]})}),B.jsxs(Rd,{children:[B.jsxs(vi,{onClick:()=>j(),children:[G("common:export")," PDF"]}),B.jsxs(vi,{onClick:()=>A(),children:[G("common:export")," Excel"]})]})]}),B.jsxs(Dl,{onClick:g,children:[B.jsx(bL,{}),G("common:save")]})]})};return B.jsx(ba,{accentColor:t,children:B.jsx(SE,{children:B.jsx(qS.Provider,{value:{defaultOptions:y,primaryColor:k},children:B.jsx(Q2,{title:e,url:n,initialScale:c,user:a,...N,toolbar:B.jsx(yx,{defaultAnnotationName:""}),defaultActiveSidebarKey:U?"annotator-sidebar-toggle":null,sidebar:[{key:"search-sidebar",title:G("viewer:search.search"),icon:B.jsx(wu,{style:{width:18,height:18}}),render:Y=>B.jsx(sT,{pdfViewer:Y.pdfViewer})},{title:G("annotator:sidebar.toggle"),key:"annotator-sidebar-toggle",icon:B.jsx(I2,{style:{width:18,height:18}}),render:()=>B.jsx(Cx,{})}],actions:B.jsx(X,{}),style:Q,children:B.jsx(_E,{onLoad:()=>{F?.()},onAnnotationAdd:Y=>{u?.(Y)},onAnnotationDelete:Y=>{W?.(Y)},onAnnotationSelected:(Y,L)=>{V?.(Y,L)},onAnnotationChanged:Y=>{R?.(Y)},enableNativeAnnotations:o,annotations:r})})})})})},Zg=({onDocumentLoaded:l,onEventBusReady:t})=>{const{isReady:e,pdfViewer:n,eventBus:i,isSidebarCollapsed:a}=Wa();return Rt.useEffect(()=>{if(!e||!n||!i)return;t?.(i);const s=async()=>{l?.(n)};return n.pdfDocument?s():i.on("documentloaded",s),()=>{i.off("documentloaded",s)}},[e,n,i]),Rt.useEffect(()=>{i&&n&&i.dispatch("updateviewarea",{pdfViewer:n})},[a,i,n]),B.jsx(B.Fragment,{})},Fg=({actions:l})=>{const t=Wa();return l?typeof l=="function"?l(t):l:null},ug=({toolbar:l})=>{const t=Wa();return l?typeof l=="function"?B.jsxs(ye,{gap:"3",align:"center",children:[B.jsx(IF,{}),B.jsx(ma,{orientation:"vertical"}),l(t)]}):l:B.jsx(ye,{gap:"3",align:"center",children:B.jsx(IF,{})})},mg=({enableRange:l="auto",title:t="PDF VIEWER",url:e,locale:n="zh-CN",initialScale:i,layoutStyle:a,theme:s="violet",actions:c,sidebar:o,toolbar:r,showTextLayer:U=!0,defaultActiveSidebarKey:Z,onDocumentLoaded:F,onEventBusReady:u})=>{const{t:W}=si(["viewer"],{useSuspense:!1}),V=Rt.useMemo(()=>({textLayerMode:U?1:0,annotationMode:0,externalLinkTarget:0,enableRange:l}),[U]);return Rt.useEffect(()=>{Vl.changeLanguage(n)},[n]),B.jsx(ba,{accentColor:s,children:B.jsx(Q2,{title:t,url:e,sidebar:[{key:"search-sidebar",title:W("viewer:search.search"),icon:B.jsx(wu,{style:{width:18,height:18}}),render:R=>B.jsx(sT,{pdfViewer:R.pdfViewer})},...o||[]],defaultActiveSidebarKey:Z,toolbar:B.jsx(ug,{toolbar:r}),initialScale:i,...V,style:a,actions:B.jsx(Fg,{actions:c}),children:B.jsx(Zg,{onEventBusReady:u,onDocumentLoaded:F})})})};exports.PdfAnnotator=Ug;exports.PdfViewer=mg;exports.commonjsGlobal=Js;
@@ -58890,7 +58890,7 @@ async function N9(l, t, e) {
58890
58890
  });
58891
58891
  }), a++;
58892
58892
  });
58893
- const c = await import("./exceljs.min-DbvGAX2r.js").then((F) => F.e), o = new c.Workbook(), r = o.addWorksheet("sheet1");
58893
+ const c = await import("./exceljs.min-BxLGr6X2.js").then((F) => F.e), o = new c.Workbook(), r = o.addWorksheet("sheet1");
58894
58894
  r.columns = [
58895
58895
  {
58896
58896
  key: "index",
@@ -59192,8 +59192,8 @@ const mT = ({ pdfViewer: l }) => {
59192
59192
  Zl(() => {
59193
59193
  t.trim() && V(t.trim());
59194
59194
  }, [r, V]), Zl(() => () => {
59195
- F(null), e("");
59196
- }, [s]);
59195
+ n.length > 0 && s(), F(null), e("");
59196
+ }, [s, n]);
59197
59197
  const X = ll(() => !n.length || i ? null : n.map((B) => /* @__PURE__ */ zt(gi, { children: [
59198
59198
  /* @__PURE__ */ zt(
59199
59199
  Ge,
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-D3SubjD7.cjs");exports.PdfAnnotator=e.PdfAnnotator;exports.PdfViewer=e.PdfViewer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BII1amVb.cjs");exports.PdfAnnotator=e.PdfAnnotator;exports.PdfViewer=e.PdfViewer;
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as r, a as e } from "./index-CzUW2GJH.js";
1
+ import { P as r, a as e } from "./index-FtElnBdx.js";
2
2
  export {
3
3
  r as PdfAnnotator,
4
4
  e as PdfViewer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdfjs-annotation-extension-for-react",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A lightweight, extensible React PDF annotator and viewer built on top of PDF.js. Supporting the editing of existing PDF file annotations, posting comments, replying, submitting annotation data, and loading for further editing.",
5
5
  "keywords": [
6
6
  "pdf",