UNPKG

mr-excel

Version:

A versatile JavaScript library for effortlessly generating .xlsx files from input objects. Seamlessly create Excel spreadsheets with data, formatting, formulas, and more.

31 lines 85.7 kB
define(["require","exports"],function(ge,ae){"use strict";function dt(e){return e.replace(/ /g,"")}function pt(e){if(e=e.replace(/^#/,""),e.length==3){const t=e.charAt(0),r=e.charAt(1),o=e.charAt(2);return t+t+r+r+o+o}else return e}function qt(e){/^#?([a-f\d]{3})$/i.test(e)&&(e=pt(e));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:[0,0,0]}function ht(e){const t=qt(e);return t==null?void 0:(.299*t[0]+.587*t[1]+.114*t[2])/255>.5?"rgb(0,0,0)":"rgb(255,255,255)"}function ut(e){/^#?([a-f\d]{3})$/i.test(e)&&(e=pt(e));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?"rgb("+(255-parseInt(t[1],16))+","+(255-parseInt(t[2],16))+","+(255-parseInt(t[3],16))+")":"rgb(0,0,0)"}function ze(e){e=Number(e);var t=e.toString(16);return t.length==1?"0"+t:t}function fe(e){e=dt(e);let t=e.indexOf("rgba")>=0?e.substring(5,e.length-1).split(","):e.substring(4,e.length-1).split(","),r=t.reduce((o,n)=>o&&!Number.isNaN(Number(n)),!0);return t.length==4&&t[3]=="0"||t.length!=3&&t.length!=4||!r?null:(ze(t[0])+ze(t[1])+ze(t[2])).toUpperCase()}function pe(e,t){if(typeof e>"u"||e===null)return null;if(!t){let r=dt(e);r.indexOf("var(")==0&&r.lastIndexOf(")")==r.length-1&&(r=r.substring(4,r.length-1),e=getComputedStyle(document.documentElement).getPropertyValue(r))}if(e.indexOf("rgb")>=0){const r=fe(e);e=r||""}return e.replace(/^#/,"")}function zt(e){let t="";return e.indexOf("_")>0?e.replace(/[a-z]/g,"").length==e.length?t=e.split(/_/).reduce((r,o)=>r+o.charAt(0)+o.substring(1).toLowerCase()+" ","").trim():t=e.replace(/_/g," ").trim():(t=e.replace(/([A-Z])/g," $1").trim(),t=t.charAt(0).toUpperCase()+t.substring(1).trim()),t}function yt(e,t){let r=Object.keys(e).filter(l=>!t.includes(l)),o=[];return r.reduce((l,g)=>(l.push({label:g,text:zt(g)}),l),o)}const Ue={fileName:"MR-Excel",headerBackgroundColor:"#393E46",headerColor:"#EEEEEE",negativeColor:!1,rowBackgroundColor:"#EEEEEE",rowColor:"#393E46",filterKeys:[]},Ut=function(e,t={...Ue}){let r;if(typeof e=="object"&&Array.isArray(e))if(e.length>0)if(Array.isArray(e[0])){let m=[];for(let i=0;i<e.length;i++){const f=e[i];if(f.length>0){const v=yt(f[0],Array.isArray(t.filterKeys)?t.filterKeys:[]);m.push({headers:v,data:f})}}r={sheet:m}}else e.length>0?r={sheet:[{headers:yt(e[0],Array.isArray(t.filterKeys)?t.filterKeys:[]),data:e}]}:r={sheet:[]};else r={sheet:[]};else r=e;let o=t&&t.headerBackgroundColor?t.headerBackgroundColor:Ue.headerBackgroundColor,n=t&&t.rowBackgroundColor?t.rowBackgroundColor:Ue.rowBackgroundColor,l=t&&t.negativeColor?ut(o):t&&t.headerColor?t.headerColor:ht(o),g=t&&t.negativeColor?ut(n):t&&t.rowColor?t.rowColor:ht(n);typeof r.styles>"u"&&(r.styles={}),r.styles.themeStyleHeader={backgroundColor:o,color:l},r.styles.themeStyleBody={backgroundColor:n,color:g};const u=r.sheet.length;for(let m=0;m<u;m++)r.sheet[m].styleCellCondition=function(i,f,v,j,R,k){return R?"themeStyleHeader":"themeStyleBody"};return typeof(t==null?void 0:t.fileName)=="string"&&(r.fileName=t.fileName),r};async function Wt(e,t,r){let o={};const l=(await new Promise((m,i)=>ge(["./jszip.min-CGrYsaMq"],m,i)).then(m=>m.jszip_min)).default;let g;if(typeof e=="string"&&e.length){let m,i=!1;typeof(r==null?void 0:r.fetch)=="function"?(m=r==null?void 0:r.fetch,i=!0):m=fetch,g=await m(e).then(f=>{if(f==null||f==null)throw"response is null";return i?f:r!=null&&r.backend?f.arrayBuffer():f.blob()})}else g=r==null?void 0:r.data;let u=await l.loadAsync(g).then(async function(m){let i=Object.keys(m.files).filter(f=>f.indexOf("xl/worksheets/")==0&&f.length-4==f.lastIndexOf(".xml")||f=="xl/sharedStrings.xml");for(let f=0;f<i.length;f++){const v=i[f];await m.files[v].async("string").then(j=>{let R=j;Object.keys(t).forEach(k=>{var d;R=R.replace(new RegExp("{{"+k+"}}","g"),(d=t[k])==null?void 0:d.toString())}),o[v]=R})}return m});if(Object.keys(o).forEach(m=>{u.file(m,o[m])}),r!=null&&r.backend)return u.generateAsync({type:r.generateType?r.generateType:"nodebuffer"}).then(m=>m);if(r!=null&&r.notSave)return u.generateAsync({type:"blob"}).then(m=>m.slice(0,m.size,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"));{let m=await u.generateAsync({type:"blob"});(await new Promise((f,v)=>ge(["./FileSaver.min-DbxQUYqv"],f,v)).then(f=>f.FileSaver_min)).saveAs(m,(r!=null&&r.fileName?r==null?void 0:r.fileName:"tableRecord")+".xlsx")}}function Gt(e,t,r,o,n,l,g,u){let m=[],i="both",f=[];!t||t===0?(t=1,i="col"):f.push(t-1),!e||e===0?(e=0,i="row"):f.push(e-1);let v=n||{};v.mergeType=u&&u.mergeType?[...u.mergeType,i]:[i],v.mergeValue=u&&u.mergeValue?[...u.mergeValue,f]:[f],v.mergeStart=u&&u.mergeStart?[...u.mergeStart,r]:[r];for(let j=0;j<t;j++){let R=e;for(let k=0;k<o;k++)r<=k?R>=1?(v["c"+k]=l,l="",g+="*",R--):t>=2&&r==k?(v["c"+k]=l,l="",g+="+"):g+="-":j>0&&(g+="-");m.push({...v,mergeString:g}),v={},g=""}return m}function Zt(e,t,r,o,n){var v;if(!e&&!t)throw"Error: One of the function inputs is required.";let l;e?l=(v=document.querySelector(e))==null?void 0:v.querySelectorAll("tr"):l=t==null?void 0:t.querySelectorAll("tr");let g=[],u=[],m={header:{},rows:[]},i=40;if(l){let j=!1,R=0;l.forEach((k,d)=>{var Y=[].slice.call(k.children);const U=window.getComputedStyle(k,null);let J=fe(U.backgroundColor);if(!j)R=Y.length,j=!0,typeof o=="function"?i=o(Number(U.height.substring(0,U.height.length-2)),d,!0):i=Number(U.height.substring(0,U.height.length-2)),Y.forEach((N,oe)=>{let P=window.getComputedStyle(N,null),B=null;if(P.borderBottomWidth!=="0px"){const W=fe(P.borderBottomColor);W&&(B||(B={}),B.bottom={style:"thin",color:W})}if(P.borderTopWidth!=="0px"){const W=fe(P.borderTopColor);W&&(B||(B={}),B.top={style:"thin",color:W})}if(P.borderLeftWidth!=="0px"){const W=fe(P.borderLeftColor);W&&(B||(B={}),B.left={style:"thin",color:W})}if(P.borderRightWidth!=="0px"){const W=fe(P.borderRightColor);W&&(B||(B={}),B.right={style:"thin",color:W})}let X=fe(P.backgroundColor);!X&&J&&(X=J);const $=parseInt(P.fontSize.substring(0,P.fontSize.indexOf("p")));let L={...X?{backgroundColor:X}:{},bold:parseInt(P.fontWeight)>500,...isNaN($)?{}:{size:$},...B?{border:B}:{},alignment:{...typeof P.textAlign=="string"&&P.textAlign.length>0?{horizontal:P.textAlign}:{},vertical:"center",...P.direction=="rtl"?{rtl:!0}:{ltr:!0}}};m.header[d+"-"+oe]=L;let T;typeof n=="function"?T=n(Number(P.width.substring(0,P.width.length-2)),oe):T=Number(P.width.substring(0,P.width.length-2))*.15;const M=N.getAttribute("colspan"),V=N.getAttribute("rowspan");g.push({label:"c"+oe,...M?{colspan:M}:{},...V?{rowspan:V}:{},text:N.textContent,...isNaN(T)||T<=0?{}:{size:T}})});else{let N={},oe="",P=!1;u.length>=d&&(N=u[d-1],oe="mergeString"in N?N.mergeString:"",P=!0);let B=0;Y.forEach((X,$)=>{if("c"+($+B)in N)for(let K=0;K<=R+1&&"c"+($+K)in N;K++)B++;$+=B;let L=window.getComputedStyle(X,null);if(X.getAttribute("colspan")||X.getAttribute("rowspan")){let K=Gt(X.getAttribute("colspan")*1,X.getAttribute("rowspan")*1,$,R,N,X.textContent,oe,N);u.length<d?u.push(...K):K.forEach((we,Q)=>{u.length<d+Q?u.push(...K):u[d+Q]={...u[d+Q],...we}}),N=K[0],oe=K[0].mergeString,P=!0}else P||(oe+="-");let T=null;if(L.borderBottomWidth!=="0px"){const K=fe(L.borderBottomColor);K&&(T||(T={}),T.bottom={style:"thin",color:K})}if(L.borderTopWidth!=="0px"){const K=fe(L.borderTopColor);K&&(T||(T={}),T.top={style:"thin",color:K})}if(L.borderLeftWidth!=="0px"){const K=fe(L.borderLeftColor);K&&(T||(T={}),T.left={style:"thin",color:K})}if(L.borderRightWidth!=="0px"){const K=fe(L.borderRightColor);K&&(T||(T={}),T.right={style:"thin",color:K})}let M=fe(L.backgroundColor);!M&&J&&(M=J);const V=parseInt(L.fontSize.substring(0,L.fontSize.indexOf("p")));let W={...M?{backgroundColor:M}:{},bold:parseInt(L.fontWeight)>500,...isNaN(V)?{}:{size:V},...T?{border:T}:{},alignment:{...typeof L.textAlign=="string"&&L.textAlign.length>0?{horizontal:L.textAlign}:{},vertical:"center",...L.direction=="rtl"?{rtl:!0}:{ltr:!0}}};m.header[d+"-"+$]=W,N["c"+$]=X.textContent}),typeof o=="function"?N.height=o(Number(U.height.substring(0,U.height.length-2)),d,!1):N.height=U.height.substring(0,U.height.length-2),typeof N.height=="string"&&N.height.length==0&&delete N.height,u.length<d?u.push(N):u[d-1]=N}})}else throw"Error: DOM Element Not Found";return{styles:m.header,sheet:[{...i?{headerHeight:i}:{},styleCellCondition:function(j,R,k,d,Y,U){return r?U.includes(k-1+"-"+d)?k-1+"-"+d:"":null},data:u,headers:g}]}}function He(e,t,r="",o=[],n=-1){const l=e.length;for(let g=0;g<l;g++)o.push(r+e[g]);return t<o.length?o:He(e,t,o[n+1],o,n+1)}function Jt(e,t){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">`+(e.format.count>0?'<numFmts count="'+e.format.count+'">'+e.format.value+"</numFmts>":"")+'<fonts count="'+e.font.count+'"><font><sz val="11" /><color theme="1" /><name val="Calibri" /><family val="2" /><scheme val="minor" /></font><font><sz val="11" /><color rgb="FFFF0000" /><name val="Calibri" /><family val="2" /><scheme val="minor" /></font>'+e.font.value+'</fonts><fills count="'+e.fill.count+'"><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="lightGray" /></fill>'+e.fill.value+'</fills><borders count="'+e.border.count+'"><border />'+e.border.value+'</borders><cellStyleXfs count="1"><xf borderId="0" fillId="0" fontId="0" numFmtId="0" applyAlignment="1" applyFont="1" /></cellStyleXfs><cellXfs count="'+e.cell.count+'"><xf borderId="0" fillId="0" fontId="0" numFmtId="0" xfId="0" applyAlignment="1" applyFont="1"><alignment readingOrder="0" shrinkToFit="0" vertical="bottom" wrapText="0" /></xf><xf borderId="0" fillId="0" fontId="1" numFmtId="0" xfId="0" applyAlignment="1" applyFont="1"><alignment readingOrder="0" /></xf>'+e.cell.value+'</cellXfs><cellStyles count="1"><cellStyle xfId="0" name="Normal" builtinId="0" /></cellStyles> '+(t?'<dxfs count="'+e.conditionalFormatting.count+'" >'+e.conditionalFormatting.value+"</dxfs>":'<dxfs count="0" />')+"</styleSheet>"}function Xt(e,t,r,o,n,l,g){let u={};return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing" /><Default Extension="xml" ContentType="application/xml" /><Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" PartName="/xl/workbook.xml" /><Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" PartName="/xl/styles.xml" /><Override ContentType="application/vnd.openxmlformats-officedocument.theme+xml" PartName="/xl/theme/theme1.xml" />`+r.reduce((m,i)=>(i=i.toLowerCase(),u[i]?m:i=="svg"?(u.png=!0,u.svg=!0,m+'<Default Extension="png" ContentType="image/png"/><Default Extension="svg" ContentType="image/svg+xml"/>'):i=="jpeg"||i=="jpg"?(u.jpeg=!0,u.jpg=!0,m+'<Default Extension="'+i+'" ContentType="image/jpeg"/>'):(u[i]=!0,m+'<Default Extension="'+i+'" ContentType="image/'+i+'"/>')),"")+t.reduce((m,i)=>m+'<Override PartName="/xl/comments'+i+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml" />',"")+e+(g.length>0?g.reduce((m,i)=>m+'<Override PartName="/xl/tables/'+i+'" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"/>',""):"")+'<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" PartName="/xl/sharedStrings.xml" />'+(l?'<Override PartName="/xl/calcChain.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml"/>':"")+'<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />'+o.reduce((m,i)=>m+'<Override PartName="/xl/drawings/'+i+'" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml" />',"")+(n.length>0?n.reduce((m,i,f)=>m+'<Override PartName="/xl/ctrlProps/ctrlProp'+(f+1)+'.xml" ContentType="application/vnd.ms-excel.controlproperties+xml"/>',""):"")+'<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /></Types>'}function Qt(e,t){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>`+e+'</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="'+e+'" baseType="lpstr"> '+t+"</vt:vector></TitlesOfParts><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0300</AppVersion></Properties>"}function We(e,t,r,o){e=e.toUpperCase();let n="";if(t.formula){let i=t,f=i.formula.indexOf("=")==0?i.formula.substring(1):i.formula,v=e.indexOf(":")>0,j=i.referenceCells?i.referenceCells:e,R=v?e.substring(0,e.indexOf(":")):e,k=R.replace(/[0-9]/g,""),d=parseInt(e.substr(k.length)),Y=i.returnType?i.returnType:i.isArray||v?' t="str"':"",U="styleId"in i&&o&&typeof i.styleId=="string"&&o[i.styleId]?' s="'+o[i.styleId].index+'"':"",J=i.isArray||v?' t="array" ref="'+j+'"':"";return n='<c r="'+R+'"'+U+Y+"><f"+J+">"+f+"</f></c>",{column:k,row:d,needCalcChain:!1,isCustom:!0,cell:n}}let l=e.replace(/[0-9]/g,""),g=parseInt(e.substr(l.length)),u=!1,m="";if(t.noArgType){const i=t;if(i.noArgType=="NOW"||i.noArgType=="TODAY"){const f="styleId"in i&&o&&typeof i.styleId=="string"&&o[i.styleId]?' s="'+o[i.styleId].index+'"':"";n='<c r="'+e+'"'+f+"><f>"+i.noArgType+"()</f></c>"}else{let f="NOW()";const v="styleId"in i&&o&&typeof i.styleId=="string"&&o[i.styleId]?' s="'+o[i.styleId].index+'"':"";n='<c r="'+e+'"'+v+"><f>"+i.noArgType.substring(4)+"("+f+")</f></c>"}m='<c r="'+e+'" i="'+r+'"/>',u=!0}else if(t.referenceCell){const i=t;let f="";typeof i.value<"u"&&(f=","+i.value);let v="";i.type=="COT"&&(v="_xlfn.");const j="styleId"in i&&o&&typeof i.styleId=="string"&&o[i.styleId]?' s="'+o[i.styleId].index+'"':"";n='<c r="'+e+'"'+j+"><f>"+v+i.type+"("+i.referenceCell.toUpperCase()+f+")</f></c>",m='<c r="'+e+'" i="'+r+'"/>',u=!0}else{const i=t;n='<c r="'+e+'"'+(o&&typeof i.styleId=="string"&&o[i.styleId]?' s="'+o[i.styleId].index+'"':"")+"><f>"+i.type+"("+i.start.toUpperCase()+":"+i.end.toUpperCase()+")</f></c>"}return{column:l,row:g,cell:n,needCalcChain:u,chainCell:m}}function Ge(e,t,r){let o=!1,n,l;if(typeof e=="object"){if("author"in e&&e.author&&(o=!0,l=e.author),"styleId"in e&&typeof e.styleId=="string"){let g=t[e.styleId];typeof g=="string"&&(r=g)}n="comment"in e&&typeof e.comment=="string"?gt(e.comment):[""]}else n=e?gt(e):[""];return o&&n.unshift(l+":"),{hasAuthor:o,author:l,commentStyle:r,commentStr:n}}function gt(e){var t=e.split(/\r?\n|\r|\n/g);return t}function Ze(e,t,r,o){let n='<comment ref="'+e+'" authorId="'+Math.max(0,o-1)+'" shapeId="0"><text>',l="";return t.forEach((g,u)=>{let m="";if(g.length==0){l+=` `;return}u>0&&(m=' xml:space="preserve"',l+=` `),n+="<r>"+r+"<t"+m+">"+l+g+"</t></r>",l=""}),l.length>0&&n.indexOf("<r>")>0&&(n=n.substring(0,n.length-8)+l+"</t></r>"),n+="</text></comment>",n}const eo='<rPr><b /><sz val="9" /><color rgb="000000" /><rFont val="Tahoma" /></rPr>',Ne=function(e){return e.replace(/\&/g,"&amp;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;")};function Je(e,t,r){let o="";return e.forEach(n=>{typeof n.value=="string"&&(n.value=Ne(n.value)),o+="<r>"+(n.styleId&&t[n.styleId]?t[n.styleId]:t[r])+'<t xml:space="preserve">'+n.value+"</t></r>"}),"<si>"+o+"</si>"}const xt={percentage:{key:9},fraction:{key:13},short_date:{key:14},yen:{key:160,value:'<numFmt numFmtId="160" formatCode="_ [$¥-804]* #,##0.00_ ;_ [$¥-804]* \\-#,##0.00_ ;_ [$¥-804]* &quot;-&quot;??_ ;_ @_ " />'},"¥":{key:160,value:'<numFmt numFmtId="160" formatCode="_ [$¥-804]* #,##0.00_ ;_ [$¥-804]* \\-#,##0.00_ ;_ [$¥-804]* &quot;-&quot;??_ ;_ @_ " />'},euro:{key:161,value:'<numFmt numFmtId="161" formatCode="_([$€-2]\\ * #,##0.00_);_([$€-2]\\ * \\(#,##0.00\\);_([$€-2]\\ * &quot;-&quot;??_);_(@_)" />'},"€":{key:161,value:'<numFmt numFmtId="161" formatCode="_([$€-2]\\ * #,##0.00_);_([$€-2]\\ * \\(#,##0.00\\);_([$€-2]\\ * &quot;-&quot;??_);_(@_)" />'},pound:{key:162,value:'<numFmt numFmtId="162" formatCode="_-[$£-809]* #,##0.00_-;\\-[$£-809]* #,##0.00_-;_-[$£-809]* &quot;-&quot;??_-;_-@_-" />'},"£":{key:162,value:'<numFmt numFmtId="162" formatCode="_-[$£-809]* #,##0.00_-;\\-[$£-809]* #,##0.00_-;_-[$£-809]* &quot;-&quot;??_-;_-@_-" />'},dollar:{key:163,value:'<numFmt numFmtId="163" formatCode="_([$$-409]* #,##0.00_);_([$$-409]* \\(#,##0.00\\);_([$$-409]* &quot;-&quot;??_);_(@_)" />'},$:{key:163,value:'<numFmt numFmtId="163" formatCode="_([$$-409]* #,##0.00_);_([$$-409]* \\(#,##0.00\\);_([$$-409]* &quot;-&quot;??_);_(@_)" />'},float_3:{key:164,value:'<numFmt numFmtId="164" formatCode="0.000" />'},time:{key:165,value:'<numFmt numFmtId="165" formatCode="[$-F400]h:mm:ss\\ AM/PM" />'},ريال:{key:171,value:'<numFmt numFmtId="171" formatCode="_ * #,##0.00_-[$ريال-429]_ ;_ * #,##0.00\\-[$ريال-429]_ ;_ * &quot;-&quot;??_-[$ريال-429]_ ;_ @_ " />'},"₽3":{key:172,value:'<numFmt numFmtId="172" formatCode="_-* #,##0.00\\ [$₽-444]_-;\\-* #,##0.00\\ [$₽-444]_-;_-* &quot;-&quot;??\\ [$₽-444]_-;_-@_-" />'},"₽2":{key:173,value:'<numFmt numFmtId="173" formatCode="_-* #,##0.00\\ [$₽-485]_-;\\-* #,##0.00\\ [$₽-485]_-;_-* &quot;-&quot;??\\ [$₽-485]_-;_-@_-" />'},"₽1":{key:174,value:'<numFmt numFmtId="174" formatCode="_-* #,##0.00\\ [$₽-46D]_-;\\-* #,##0.00\\ [$₽-46D]_-;_-* &quot;-&quot;??\\ [$₽-46D]_-;_-@_-" />'},"₼1":{key:175,value:'<numFmt numFmtId="175" formatCode="_-* #,##0.00\\ [$₼-42C]_-;\\-* #,##0.00\\ [$₼-42C]_-;_-* &quot;-&quot;??\\ [$₼-42C]_-;_-@_-" />'},manat:{key:176,value:'<numFmt numFmtId="176" formatCode="_-* #,##0.00\\ [$₼-82C]_-;\\-* #,##0.00\\ [$₼-82C]_-;_-* &quot;-&quot;??\\ [$₼-82C]_-;_-@_-" />'},"₼":{key:176,value:'<numFmt numFmtId="176" formatCode="_-* #,##0.00\\ [$₼-82C]_-;\\-* #,##0.00\\ [$₼-82C]_-;_-* &quot;-&quot;??\\ [$₼-82C]_-;_-@_-" />'},"֏":{key:177,value:'<numFmt numFmtId="177" formatCode="_-* #,##0.00\\ [$֏-42B]_-;\\-* #,##0.00\\ [$֏-42B]_-;_-* &quot;-&quot;??\\ [$֏-42B]_-;_-@_-" />'},ruble:{key:178,value:'<numFmt numFmtId="178" formatCode="_-* #,##0.00\\ [$₽-419]_-;\\-* #,##0.00\\ [$₽-419]_-;_-* &quot;-&quot;??\\ [$₽-419]_-;_-@_-" />'},"₽":{key:178,value:'<numFmt numFmtId="178" formatCode="_-* #,##0.00\\ [$₽-419]_-;\\-* #,##0.00\\ [$₽-419]_-;_-* &quot;-&quot;??\\ [$₽-419]_-;_-@_-" />'},CHF:{key:179,value:'<numFmt numFmtId="179" formatCode="_-* #,##0.00\\ [$CHF-100C]_-;\\-* #,##0.00\\ [$CHF-100C]_-;_-* &quot;-&quot;??\\ [$CHF-100C]_-;_-@_-" />'},float_1:{key:180,value:'<numFmt numFmtId="180" formatCode="0.0" />'},float_2:{key:181,value:'<numFmt numFmtId="181" formatCode="0.00" />'},float_4:{key:182,value:'<numFmt numFmtId="182" formatCode="0.0000" />'},dollar_2:{key:183,value:'<numFmt numFmtId="183" formatCode="&quot;$&quot;#,##0.00" />'},num_sep:{key:184,value:'<numFmt numFmtId="184" formatCode="#,##0" />'},num_sep_1:{key:185,value:'<numFmt numFmtId="185" formatCode="#,##0.0" />'},num_sep_2:{key:186,value:'<numFmt numFmtId="186" formatCode="#,##0.00" />'},date:{key:187,value:'<numFmt numFmtId="187" formatCode="[$-F800]dddd\\,\\ mmmm\\ dd\\,\\ yyyy" />'},dollar_rounded:{key:188,value:'<numFmt numFmtId="188" formatCode="&quot;$&quot;#,##0" />'}},bt=["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"],Ct=(e,t,r=!1,o)=>{let n,l=!1;return typeof o=="function"?(n=o,l=!0):n=fetch,n(e).then(g=>l?g:r?g.arrayBuffer():g.blob()).then(g=>l||r?g:new File([g],t)).catch(g=>{throw g})};function Ae(e,t){e=e.toUpperCase();let r=e.replace(/[0-9]/g,"");if(r.length==0)throw"Invalid Column";let o=parseInt(e.substring(r.length));if(isNaN(o))throw"Invalid Row";o=Math.max(0,o-1);let n=t.indexOf(r);return n<0&&(t=He(t,Math.pow(10,r.length+1),""),n=t.indexOf(r),n<0&&(n=0)),{col:n,row:o}}let to={},Xe=new Proxy(to,{get(e,t){return t in e?e[t]:(this.set(e,t,{},!0),{})},set(e,t,r,o){return e[t]=r,!0}});function vt(e,t,r){Xe[e],Xe[e][t]=r}function wt(e,t,r){Object.keys(r).forEach(n=>{const l=r[n];typeof l=="object"?n!="data"&&n!="headers"&&wt(e,t.length>0?t+"."+n:n,l):vt(e,t.length>0?t+"."+n:n,l)})}function oo(e,t){wt(e,"",t)}function ro(e,t){let r=t,o=Xe[e];return Object.keys(o).forEach(l=>{const g=l.split(".");let u=r,m=o[l];for(let i=0;i<g.length;i++){const f=g[i];u[f]?u=u[f]:g.length-1==i?u[f]=m:(u[f]={},u=u[f])}}),r}function no(e){if(!Array.isArray(e)||!e.length)return"";const t=e.length;let r="<dataValidations>";for(let o=0;o<t;o++){const n=e[o],l=n.for.reduce((u,m)=>u+" "+m,""),g=n.option.join(",");r+='<dataValidation type="list" allowBlank="1" showErrorMessage="1" sqref="'+l.trim()+'"><formula1>&quot;'+g+"&quot;</formula1></dataValidation>"}return r+="</dataValidations>",r}async function Be(e,t=""){if(typeof t=="string"&&t.length>0&&(e=ro(t,e)),typeof e.creator=="string"&&e.creator.trim().length<=0)throw'length of "creator" most be bigger then 0';if(typeof e.created=="string"&&new Date(e.created).toString()=="Invalid Date")throw'"created" is not valid date';if(typeof e.modified=="string"&&new Date(e.modified).toString()=="Invalid Date")throw'"modified" is not valid date';let r=xt;e.formatMap&&typeof e.formatMap=="object"&&(r={...r,...e.formatMap});const o=e.backend,n={lt:"lessThan",gt:"greaterThan",between:"between",ct:"containsText",eq:"equal"};let l=[...bt];e.numberOfColumn&&e.numberOfColumn>25&&(l=He(l,e.numberOfColumn));const u=(await new Promise((w,a)=>ge(["./jszip.min-CGrYsaMq"],w,a)).then(w=>w.jszip_min)).default;let m=new u;e.sheet||(e.sheet=[{headers:[],data:[]}]);const i=e.sheet.length;let f=m.folder("xl"),v=null,j=null,R=null;e.styles||(e.styles={}),e.addDefaultTitleStyle&&(e.styles.titleStyle={alignment:{horizontal:"center",vertical:"center"}});const k=Object.keys(e.styles),d=eo,Y=e.activateConditionalFormatting?e.activateConditionalFormatting:!1,U={},J={};let N=k.reduce((w,a,b)=>{const x=e.styles[a];if(x.type&&(x.type=="headerFooter"||x.type=="HF")){let C="",G="-",me="Regular";if(x.fontFamily&&(G=x.fontFamily),x.bold&&(me="Bold"),x.italic&&(me=="Regular"&&(me=""),me+="Italic"),(G!="-"||me!="Regular")&&(C='&amp;"'+G+","+me+'"'),x.size&&(C+="&amp;"+x.size),x.doubleUnderline?C+="&amp;E":x.underline&&(C+="&amp;U"),x.color){const Se=pe(x.color,o);typeof Se=="string"&&Se.length>0&&(C+="&amp;K"+Se.toUpperCase())}return U[a]=C,w}if(Y&&typeof x.type=="string"&&x.type&&(x.type=="conditionalFormatting"||x.type.toUpperCase()=="CF")){J[a]=w.conditionalFormatting.count;let C=pe(x.color,o),G=pe(x.backgroundColor,o);return w.conditionalFormatting.value+='<dxf><font><color rgb="'+C+'"/></font><fill> <patternFill> <bgColor rgb="'+G+'"/></patternFill></fill></dxf>',w.conditionalFormatting.count++,w}const q={fillIndex:0,fontIndex:0,borderIndex:0,formatIndex:0};if(x.backgroundColor){let C=pe(x.backgroundColor,o);q.fillIndex=w.fill.count,w.fill.count++,w.fill.value=w.fill.value+'<fill><patternFill patternType="solid">'+(C?'<fgColor rgb="'+C.replace("#","")+'" />':"")+"</patternFill></fill>"}if(x.color||x.fontFamily||x.size||x.bold||x.italic||x.underline||x.doubleUnderline){const C=pe(x.color,o);q.fontIndex=w.font.count,w.font.count++,w.font.value=w.font.value+"<font>"+(x.bold?"<b/>":"")+(x.italic?"<i />":"")+(x.underline||x.doubleUnderline?"<u "+(x.doubleUnderline?' val="double" ':"")+"/>":"")+(x.size?'<sz val="'+x.size+'" />':"")+(C?'<color rgb="'+C.replace("#","")+'" />':"")+(x.fontFamily?'<name val="'+x.fontFamily+'" />':"")+"</font>",w.commentSyntax.value[a]="<rPr>"+(x.bold?"<b/>":"")+(x.italic?"<i/>":"")+(x.underline||x.doubleUnderline?"<u "+(x.doubleUnderline?'val="double" ':"")+"/>":"")+'<sz val="'+(x.size?x.size:"9")+'" />'+(C?'<color rgb="'+C.replace("#","")+'" />':"")+'<rFont val="'+(x.fontFamily?x.fontFamily:"Tahoma")+'" /></rPr>'}let ce="/>";x.alignment&&(x.alignment.rtl&&(x.alignment.readingOrder=2),delete x.alignment.rtl,x.alignment.ltr&&(x.alignment.readingOrder=1),delete x.alignment.ltr,ce=' applyAlignment="1"><alignment '+Object.keys(x.alignment).reduce((C,G)=>C+" "+G+'="'+x.alignment[G]+'" ',"")+" /></xf>");const H=x.border;let O="";if(typeof H=="object"&&((H.left||H.full)&&(O+='<left style="'+(H.left||H.full).style+'"><color rgb="'+pe((H.left||H.full).color,o).replace("#","")+'" /></left>'),(H.right||H.full)&&(O+='<right style="'+(H.right||H.full).style+'"><color rgb="'+pe((H.right||H.full).color,o).replace("#","")+'" /></right>'),(H.top||H.full)&&(O+='<top style="'+(H.top||H.full).style+'"><color rgb="'+pe((H.top||H.full).color,o).replace("#","")+'" /></top>'),(H.bottom||H.full)&&(O+='<bottom style="'+(H.bottom||H.full).style+'"><color rgb="'+pe((H.bottom||H.full).color,o).replace("#","")+'" /></bottom>'),q.borderIndex=w.border.count,w.border.count++,w.border.value+="<border>"+O+"<diagonal /></border>"),x.format){const C=r[x.format];C&&(q.formatIndex=C.key,"value"in C&&(w.format.count++,w.format.value+=C.value))}return w.cell.value=w.cell.value+'<xf numFmtId="'+q.formatIndex+'" fontId="'+q.fontIndex+'" fillId="'+q.fillIndex+'" borderId="'+q.borderIndex+'" xfId="0"'+(q.borderIndex>0?' applyBorder="1" ':"")+(q.fillIndex>0?' applyFill="1" ':"")+(q.fontIndex>=0?' applyFont="1" ':"")+(q.formatIndex>0?' applyNumberFormat="1" ':"")+ce,e.styles[a].index=w.cell.count,w.cell.count++,w},{conditionalFormatting:{count:Y?1:0,value:'<dxf><font><color rgb="FF9C0006"/></font><fill> <patternFill> <bgColor rgb="FFFFC7CE"/></patternFill></fill></dxf>'},commentSyntax:{value:{}},format:{count:0,value:""},border:{count:1,value:""},fill:{count:2,value:""},font:{count:2,value:""},cell:{count:2,value:""}});f==null||f.file("styles.xml",Jt(N,Y));let oe='<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" PartName="/xl/worksheets/sheet1.xml" />',P="",B=0,X="",$="",L={};const T={};let M="",V=4,W=!1,K=-1,we=[],Q=1;const xe={checkbox:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <formControlPr xmlns="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" objectType="CheckBox" **value** **fmlaLink** lockText="1" noThreeD="1"/>`};let Te=1024;const Ee={checkbox:`<v:shape id="***id***" type="#_x0000_t201" style='position:absolute; margin-left:1.5pt;margin-top:1.5pt;width:63pt;height:16.5pt;z-index:1; mso-wrap-style:tight' filled="f" fillcolor="window [65]" stroked="f" strokecolor="windowText [64]" o:insetmode="auto"> <v:path shadowok="t" strokeok="t" fillok="t"/> <o:lock v:ext="edit" rotation="t"/> <v:textbox style='mso-direction-alt:auto' o:singleclick="f"> <div style='text-align:left'><font face="Segoe UI" size="160" color="auto">***text***</font></div> </v:textbox> <x:ClientData ObjectType="Checkbox"> <x:SizeWithCells/> <x:Anchor> 0, 2, 0, 2, 0, 86, 1, 0</x:Anchor> <x:AutoFill>False</x:AutoFill> <x:AutoLine>False</x:AutoLine> <x:TextVAlign>Center</x:TextVAlign> <x:NoThreeD/> </x:ClientData> </v:shape>`},Oe={checkbox:`<v:shapetype id="_x0000_t201" coordsize="21600,21600" o:spt="201" path="m,l,21600r21600,l21600,xe"> <v:stroke joinstyle="miter"/> <v:path shadowok="f" o:extrusionok="f" strokeok="f" fillok="f" o:connecttype="rect"/> <o:lock v:ext="edit" shapetype="t"/> </v:shapetype>`};let ie=[],se="",be=!1,he=null;for(let w=0;w<i;w++){const a=e.sheet[w],b=w+1;let x={},q={start:"",end:""};const ce=a.asTable;let H="",O=a.shiftTop&&a.shiftTop>=0?a.shiftTop+1:1,C="",G="",me="",Se="",ke="",je="",nt=!1,It="",Pt="",jt="",Rt="",Ce=Object.assign([],a.merges),ye=Object.assign({},a.formula),lt=Object.assign([],a.conditionalFormatting),Re=!1,ue=[],Ke="",Ye=[],Dt=[],at=[],it=[],Fe={},De="",Le=!1,st="";if(a.rtl&&(ke+=' rightToLeft="1" '),a.pageBreak){const E=a.pageBreak;if(E.row&&Array.isArray(E.row)){je="pageBreakPreview";const s=E.row.length;st+='<rowBreaks count="'+s+'" manualBreakCount="'+s+'">'+E.row.reduce((y,p)=>y+'<brk id="'+p+'" max="16383" man="1"/>',"")+"</rowBreaks>"}if(E.column&&Array.isArray(E.column)){je="pageBreakPreview";const s=E.column.length;st+='<colBreaks count="'+s+'" manualBreakCount="'+s+'">'+E.column.reduce((y,p)=>y+'<brk id="'+p+'" max="16383" man="1"/>',"")+"</colBreaks>"}}let Lt="";if(a.pageOption){const E=a.pageOption;if(E.isPortrait&&(Le=!0),E.margin){const S=E.margin;let F={left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3};Object.keys(F).forEach(h=>{typeof S[h]=="number"&&(F[h]=S[h])}),Lt='<pageMargins left="'+F.left+'" right="'+F.right+'" top="'+F.top+'" bottom="'+F.bottom+'" header="'+F.header+'" footer="'+F.footer+'"/>'}let s="",y="",p="",c="";if(["header","footer"].forEach(S=>{const F=S.charAt(0).toUpperCase()+S.substring(1);if(E[S]){const h=E[S];typeof h=="object"&&Object.keys(h).forEach(A=>{s.indexOf(A)<0&&(s+=A);const le=h[A];let z="";if(Object.keys(le).reduce((D,I)=>(I=="l"?D.splice(0,0,I):I=="c"?D.splice(1,0,I):I=="r"&&D.splice(2,0,I),D),[]).forEach(D=>{const I=le[D];z+="&amp;"+D.toUpperCase(),I.styleId&&U[I.styleId]&&(z+=U[I.styleId]),I.text&&(z+=I.text)}),z="<"+A+F+">"+z+"</"+A+F+">",A=="odd")y+=z;else if(A=="even")p+=z;else if(A=="first")c+=z;else throw"type error"})}}),De=y+p+c,De.length>0){Le=!0;const S=s.length==7||s.length==12?' differentOddEven="1"':"",F=s.indexOf("first")>=0?' differentFirst="1"':"";De="<headerFooter"+S+F+">"+De+"</headerFooter>"}}if(a.viewOption){let E="";const s=a.viewOption;s.type&&(je=s.type),s.hideRuler&&(ke+=' showRuler="0" '),s.hideGrid&&(ke+=' showGridLines="0" '),s.hideHeadlines&&(ke+=' showRowColHeaders="0" ');let y=s.splitOption;if(typeof y>"u"&&(Le=!1,typeof s.frozenOption=="object")){const p=s.frozenOption;if(E=' state="frozen" ',p.type=="R"||p.type=="ROW"){let c;typeof p.index=="object"?c=p.index.r:c=p.index,y={startAt:{b:"A"+(c+1)},type:"H",split:c}}else if(p.type=="C"||p.type=="COLUMN"){let c;typeof p.index=="object"?c=p.index.c:c=p.index,c>l.length-1&&(l=He(l,c)),y={type:"V",startAt:{r:l[c]+1},split:c}}else if(p.type=="B"||p.type=="BOTH"){let c="",_;typeof p.index=="number"?(_=p.index,c=l[p.index]+(p.index+1)):(_={y:p.index.r,x:p.index.c},c=l[p.index.c]+(p.index.r+1)),y={startAt:{two:c},type:"B",split:_}}}if(y)if(y.type=="H"||y.type=="HORIZONTAL"){let p;y.startAt&&(p=y.startAt.b,y.startAt.t&&(ke+=' topLeftCell="'+y.startAt.t+'"')),p||(p="A1"),Se='<pane ySplit="'+(typeof y.split=="object"&&y.split.y||y.split)+'" topLeftCell="'+p+'" activePane="bottomLeft"'+E+"/>"}else if(y.type=="V"||y.type=="VERTICAL"){let p;y.startAt&&(p=y.startAt.r,y.startAt.l&&(ke+=' topLeftCell="'+y.startAt.l+'"')),p||(p="A1"),Se='<pane xSplit="'+(typeof y.split=="object"&&y.split.x||y.split)+'" topLeftCell="'+p+'" activePane="topLeft"'+E+"/>"}else{let p;y.startAt&&(p=y.startAt.two,y.startAt.one&&(ke+=' topLeftCell="'+y.startAt.one+'"')),p||(p="A1"),Se='<pane xSplit="'+(typeof y.split=="object"&&y.split.x||y.split)+'" ySplit="'+(typeof y.split=="object"&&y.split.y||y.split)+'" topLeftCell="'+p+'" activePane="bottomLeft"'+E+"/>"}}if(Le&&(je="pageLayout"),a.checkbox){nt=!0;const E=xe.checkbox;a.checkbox.forEach((s,y)=>{let p=E;if(s.link){let A=Ae(s.link,l);p=p.replace("**fmlaLink**",'fmlaLink="$'+l[A.col]+"$"+(A.row+1)+'"')}else p=p.replace("**fmlaLink**","");s.mixed?p=p.replace("**value**",'checked="Mixed"'):s.checked?p=p.replace("**value**",'checked="Checked"'):p=p.replace("**value**",""),s.threeD&&p.replace('noThreeD="1"',""),ie.push(p),Te++;let c=w+""+Te++;const _="_x0000_s"+c;Pt+=Ee.checkbox.replace("***id***",_).replace("***text***",s.text);let S=s.startStr,F=s.endStr,h={start:{col:0,row:0},end:{col:1,row:1}};if(s.col&&s.row&&(h={start:{col:s.col,row:s.row-1},end:{col:s.col,row:s.row}}),typeof S=="string"&&S.length>=2){let A=Ae(S,l);h.start={...A},h.end={col:A.col+1,row:A.row+1}}if(typeof F=="string"&&F.length>=2){let A=Ae(F,l);A.row+=1,A.col+=1,h.end={...A}}Rt+='<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice Requires="x14"><control shapeId="'+c+'" r:id="rId'+(7+y)+'" name="'+s.text+'"><controlPr defaultSize="0" autoFill="0" autoLine="0" autoPict="0"><anchor moveWithCells="1"><from><xdr:col>'+h.start.col+"</xdr:col><xdr:colOff>19050</xdr:colOff><xdr:row>"+h.start.row+"</xdr:row><xdr:rowOff>19050</xdr:rowOff></from><to><xdr:col>"+h.end.col+"</xdr:col><xdr:colOff>819150</xdr:colOff><xdr:row>"+h.end.row+"</xdr:row><xdr:rowOff>0</xdr:rowOff></to></anchor></controlPr></control></mc:Choice></mc:AlternateContent>",jt+='<Relationship Id="rId'+(7+y)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp" Target="../ctrlProps/ctrlProp'+ie.length+'.xml" />',It+='<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" Requires="a14"><xdr:twoCellAnchor editAs="oneCell"><xdr:from><xdr:col>'+h.start.col+"</xdr:col><xdr:colOff>19050</xdr:colOff><xdr:row>"+h.start.row+"</xdr:row><xdr:rowOff>19050</xdr:rowOff></xdr:from><xdr:to><xdr:col>"+h.end.col+"</xdr:col><xdr:colOff>819150</xdr:colOff><xdr:row>"+h.end.row+'</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:to><xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="'+c+'" name="'+s.text+'" hidden="1"><a:extLst><a:ext uri=""><a14:compatExt spid="'+_+'"/></a:ext><a:ext uri=""><a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id=""/></a:ext></a:extLst></xdr:cNvPr><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr bwMode="auto"><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/><a:ln><a:noFill/></a:ln></xdr:spPr><xdr:txBody><a:bodyPr vertOverflow="clip" wrap="square" lIns="27432" tIns="18288" rIns="0" bIns="18288" anchor="ctr" upright="1"/><a:lstStyle/><a:p><a:pPr algn="l" rtl="0"><a:defRPr sz="1000"/></a:pPr><a:r><a:rPr lang="en-US" sz="800" b="0" i="0" u="none" strike="noStrike" baseline="0"><a:solidFill><a:srgbClr val="000000"/></a:solidFill><a:latin typeface="Segoe UI"/><a:cs typeface="Segoe UI"/></a:rPr><a:t>'+s.text+"</a:t></a:r></a:p></xdr:txBody></xdr:sp><xdr:clientData/></xdr:twoCellAnchor></mc:Choice><mc:Fallback/></mc:AlternateContent>"})}let ct;if(a.backgroundImage){v==null&&(v=f==null?void 0:f.folder("media"));const E=a.backgroundImage;ct=new Promise(async(s,y)=>{let p=E.lastIndexOf("."),c;p>0?(c=E.substring(p+1).toLowerCase(),c.length>4&&(c.indexOf("gif")>=0?c="gif":c.indexOf("jpg")>=0?c="jpg":c.indexOf("jpeg")>=0?c="jpeg":c="png")):c="png";const _=Q++,S="image"+_+"."+c,F=await Ct(E,S,o,e.fetch);F||y("image not load"),we.push(c),s({name:S,type:c,image:F,ref:_})})}let ft;if(a.images&&(v==null&&(v=f==null?void 0:f.folder("media")),ft=Promise.all([...a.images.map(async(E,s)=>{let y=E.url.lastIndexOf("."),p;y>0?(p=E.url.substring(y+1).toLowerCase(),p.length>4&&(p.indexOf("gif")>=0?p="gif":p.indexOf("jpg")>=0?p="jpg":p.indexOf("jpeg")>=0?p="jpeg":p="png")):p="png",we.push(p);const c="image"+Q+++"."+p;return{type:p,image:await Ct(E.url,c,o,e.fetch),obj:E,i:s,name:c}})])),Array.isArray(a.headers)&&a.headers.length){const E=a.headers.length;let s="";if(a.title){const c=a.title,_=c.comment,S=c.shiftTop&&c.shiftTop>=0?c.shiftTop:0,F=a.shiftLeft&&a.shiftLeft>=0?a.shiftLeft:0,h=c.shiftLeft&&c.shiftLeft+F>=0?c.shiftLeft+F:F,A=c.consommeRow?c.consommeRow-1:1,le=c.consommeCol?c.consommeCol:E,z=A==0&&typeof c.height=="number"?' ht="'+c.height+'" customHeight="1" ':"",D=c.styleId?c.styleId:"titleStyle",I=l[h]+""+(O+S);if(Ce.push(I+":"+l[h+le-1]+(O+A+S)),typeof _<"u"){Re=!0;const ee=Ge(_,N.commentSyntax.value,d);let de=ue.length;if(ee.hasAuthor&&typeof ee.author<"u"){let Z=ee.author.toString();const re=ue.indexOf(Z);re<0?ue.push(Z):de=re}Ye.push({row:O+S-1,col:h}),Ke+=Ze(I,ee.commentStr,ee.commentStyle,de)}typeof c.text=="string"&&(x[O+S]={startTag:'<row r="'+(O+S)+'" '+z+' spans="1:'+Math.max(h+le-1,1)+'">',details:'<c r="'+I+'" '+(e.styles[D]?' s="'+e.styles[D].index+'" ':"")+' t="s"><v>'+B+"</v></c>",endTag:"</row>"},s+='<row r="'+(O+S)+'" '+z+' spans="1:'+Math.max(h+le-1,1)+'">',s+='<c r="'+I+'" '+(e.styles[D]?' s="'+e.styles[D].index+'" ':"")+' t="s"><v>'+B+"</v></c>",s+="</row>",B++,L[c.text]=c.text,c.multiStyleValue&&Array.isArray(c.multiStyleValue)?P+=Je(c.multiStyleValue,N.commentSyntax.value,D):P+="<si><t>"+Ne(c.text)+"</t></si>"),O+=S+A+1}let y=a.headerStyleKey?a.headerStyleKey:null,p=0;if(typeof a.shiftLeft=="number"&&a.shiftLeft>=0&&(p=a.shiftLeft),ce&&(H+='<tableColumns count="'+a.headers.length+'">',he||(he=f==null?void 0:f.folder("tables"))),q.start=l[p]+""+O,q.end=l[p+a.headers.length-1]+""+(O+a.data.length),a.headers.forEach((c,_)=>{if(ce&&(H+='<tableColumn id="'+(_+1)+'" name="'+c.text+'"/>'),p&&(_+=p),c.formula&&at.push(_),c.conditionalFormatting&&Y&&it.push(_),Dt.push(c.label),a.mergeRowDataCondition&&typeof a.mergeRowDataCondition=="function"&&a.mergeRowDataCondition(c,null,_,!0)===!0&&(Fe[l[_]]={inProgress:!0,start:O}),a.styleCellCondition&&typeof a.styleCellCondition=="function"&&(y=a.styleCellCondition(c,c,O,_,!0,k)||y),c.size&&c.size>0&&(G+='<col min="'+(_+1)+'" max="'+(_+1)+'" width="'+c.size+'" customWidth="1" />'),a.withoutHeader)return;const S=l[_]+""+O;if(typeof a.commentCondition=="function"){const h=a.commentCondition(c,null,c.label,O,_,!0);(typeof h=="string"||typeof h=="object"&&h!=null)&&(c.comment=h)}if(c.comment){Re=!0;const h=Ge(c.comment,N.commentSyntax.value,d);let A=ue.length;if(h.hasAuthor&&typeof h.author<"u"){let le=h.author.toString();const z=ue.indexOf(le);z<0?ue.push(le):A=z}Ye.push({row:O-1,col:_}),Ke+=Ze(S,h.commentStr,h.commentStyle,A)}const F=ye&&ye[S];if(F){const h=We(S,F,b,e.styles);h.needCalcChain&&(be=!0,se+=h.chainCell),C+=h.cell,delete ye[S]}else{if(C+='<c r="'+l[_]+O+'" '+(y&&e.styles&&e.styles[y]?' s="'+e.styles[y].index+'" ':"")+' t="s"><v>'+B+"</v></c>",typeof a.multiStyleCondition=="function"){const h=a.multiStyleCondition(c,null,c.label,O,_,!0);h&&(c.multiStyleValue=h)}c.multiStyleValue&&Array.isArray(c.multiStyleValue)?P+=Je(c.multiStyleValue,N.commentSyntax.value,y||""):P+="<si><t>"+Ne(c.text)+"</t></si>",L[c.text]=c.text,B++}}),ce&&(H+="</tableColumns>"),a.withoutHeader)C+=s;else{const c='<row r="'+O+'" spans="1:'+Math.max(E,1)+'" '+(a.headerHeight?'ht="'+a.headerHeight+'" customHeight="1"':"")+(a.headerRowOption?Object.keys(a.headerRowOption).reduce((_,S)=>_+" "+S+'="'+a.headerRowOption[S]+'" '," "):"")+">";x[O]={startTag:c,endTag:"</row>",details:C},C=s+c+C+"</row>",O++}if(Array.isArray(a.data)){const c=a.mapSheetDataOption&&a.mapSheetDataOption.outlineLevel?a.mapSheetDataOption.outlineLevel:"outlineLevel",_=a.mapSheetDataOption&&a.mapSheetDataOption.hidden?a.mapSheetDataOption.hidden:"hidden",S=a.mapSheetDataOption&&a.mapSheetDataOption.height?a.mapSheetDataOption.height:"height",F=a.data.length;a.data.forEach((h,A)=>{if(h.mergeType)for(let I=0;I<h.mergeType.length;I++){const ee=h.mergeType[I],de=h.mergeStart[I],Z=h.mergeValue[w];let re="";ee=="both"?re=l[de]+""+O+":"+l[de+Z[1]]+(O+Z[0]):ee=="col"?re=l[de]+""+O+":"+l[de+Z[0]]+O:re=l[de]+""+O+":"+l[de]+(O+Z[0]),Ce.push(re)}const le=h.rowStyle,z='<row r="'+O+'" spans="1:'+Math.max(E,1)+'" '+(S in h?'ht="'+h[S]+'" customHeight="1"':"")+(c in h?' outlineLevel="'+h[c]+'"':"")+(_ in h?' hidden="'+h[_]+'"':"")+" >";C+=z;let D="";Dt.forEach((I,ee)=>{p&&(ee+=p);const de=h[I]*1;let Z=a.convertStringToNumber&&!isNaN(de)?de:h[I];typeof Z=="boolean"&&(Z=Z+"");let re=le;if(a.styleCellCondition&&typeof a.styleCellCondition=="function"&&(re=a.styleCellCondition(Z,h,O,ee,!1,k)||le),a.mergeRowDataCondition&&typeof a.mergeRowDataCondition=="function"){let te=a.mergeRowDataCondition(Z,I,ee,!1);const ne=l[ee];let ve=Fe[ne];te===!0?(!ve||ve&&!ve.inProgress)&&(Fe[ne]={inProgress:!0,start:O}):ve&&ve.inProgress&&(Ce.push(ne+ve.start+":"+ne+(O-1)),Fe[ne]={inProgress:!1,start:-1})}typeof Z>"u"&&(Z="");const qe=l[ee]+""+O;if(typeof a.commentCondition=="function"){const te=a.commentCondition(Z,h,I,O,ee,!1);(typeof te=="string"||typeof te=="object"&&te!=null)&&(typeof h.comment!="object"&&(h.comment={}),h.comment[I]=te)}if(typeof h.comment=="object"&&I in h.comment){const te=h.comment[I];Re=!0;const ne=Ge(te,N.commentSyntax.value,d);ne.hasAuthor&&typeof ne.author<"u"&&ue.push(ne.author.toString()),Ye.push({row:O-1,col:ee});let ve=ue.length;if(ne.hasAuthor&&typeof ne.author<"u"){let Yt=ne.author.toString();const Vt=ue.indexOf(Yt);Vt<0?ue.push(Yt):ve=Vt}Ke+=Ze(qe,ne.commentStr,ne.commentStyle,ve)}const Kt=ye&&ye[qe];if(Kt){const te=We(qe,Kt,b);te.needCalcChain&&(be=!0,se+=te.chainCell),C+=te.cell,D+=te.cell,delete ye[qe]}else if(typeof Z=="string"){const te='<c r="'+l[ee]+O+'" t="s" '+(re&&e.styles&&e.styles[re]?'s="'+e.styles[re].index+'"':"")+"><v>"+B+"</v></c>";if(D+=te,C+=te,typeof a.multiStyleCondition=="function"){const ne=a.multiStyleCondition(Z,h,I,O,ee,!1);ne&&((!("multiStyleValue"in h)||typeof h.multiStyleValue>"u")&&(h.multiStyleValue={}),h.multiStyleValue[I]=ne)}"multiStyleValue"in h&&h.multiStyleValue&&I in h.multiStyleValue&&Array.isArray(h.multiStyleValue[I])?P+=Je(h.multiStyleValue[I],N.commentSyntax.value,re||""):P+="<si><t>"+Ne(Z)+"</t></si>",L[Z]=Z,B++}else{const te='<c r="'+l[ee]+O+'" '+(re&&e.styles&&e.styles[re]?'s="'+e.styles[re].index+'"':"")+"><v>"+Z+"</v></c>";C+=te,D+=te}}),F-1==A&&Object.keys(Fe).forEach(I=>{Fe[I].inProgress&&Ce.push(I+Fe[I].start+":"+I+O)}),x[O]={startTag:z,endTag:"</row>",details:D},O++,C+="</row>"}),a.sortAndFilter&&(a.sortAndFilter.mode=="all"?me+='<autoFilter ref="A1:'+l[E-1]+(O-1)+'" />':typeof a.sortAndFilter.ref=="string"&&a.sortAndFilter.ref.length>0&&(me+='<autoFilter ref="'+a.sortAndFilter.ref+'" />'))}if(at.length>0&&at.forEach(c=>{const _=a.shiftLeft?a.shiftLeft:0,S=a.headers[c-_],F=l[c];ye[F+""+O]={start:a.withoutHeader?F+"1":F+"2",end:F+""+(O-1),type:S.formula.type,...S.formula.styleId?{styleId:S.formula.styleId}:{}}}),it.length>0&&Y&&it.forEach(c=>{const _=a.headers[c];_.conditionalFormatting&&lt.push({..._.conditionalFormatting,start:a.withoutHeader?l[c]+"1":l[c]+"2",end:l[c]+""+(O-1)})}),ye){const c=Object.keys(ye).sort((_,S)=>_>S?1:-1);if(c.length){let _={};c.forEach(S=>{const F=We(S,ye[S],b,e.styles);F.needCalcChain&&(be=!0,se+=F.chainCell),_[F.row]?_[F.row]+=F.cell:_[F.row]=F.cell}),Object.keys(_).sort((S,F)=>+S>+F?1:-1).forEach(S=>{const F=S,h=_[F];let A=x[F];if(A){const le=A.startTag+A.details+h+A.endTag;let z=new RegExp(A.startTag+"[\\n\\s\\S]*?</row>");C=C.replace(z,le)}else C+='<row r="'+S+'" spans="1:'+Math.max(E,1)+'" >'+h+"</row>",x[F]={startTag:'<row r="'+S+'" spans="1:'+Math.max(E,1)+'" >',endTag:"</row>",details:h}})}}}w>0&&(oe+='<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" PartName="/xl/worksheets/sheet'+(w+1)+'.xml" />');const Ht=a.name?a.name:"sheet"+(w+1),So=a.state?a.state:"visible";X+='<sheet state="'+So+'" name="'+Ht+'" sheetId="'+(w+1)+'" r:id="rId'+(V+1)+'" />',$+='<Relationship Id="rId'+(V+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+(w+1)+'.xml" />',M+="<vt:lpstr>"+("sheet"+(w+1))+"</vt:lpstr>",a.selected&&(W=!0,K=w);const Nt=a.sortAndFilter?'filterMode="1"':"";let Bt=-1;ct&&await ct.then(E=>{let s=E;Bt=s.ref,v==null||v.file(s.name,s.image)});let Ve=!1,mt="",Mt="";ft&&(Ve=!0,await ft.then(E=>{let s="";E.forEach((y,p)=>{const c=p+1;let _=y.image;const S=y.name;let F=y.obj.from,h=y.obj.to,A=y.obj.margin,le=y.obj.type,z=y.obj.extent;typeof z>"u"&&(z={cx:2e5,cy:2e5});let D={start:{col:0,row:0,mL:0,mT:0},end:{col:1,row:1,mR:0,mB:0}};if(typeof F=="string"&&F.length>=2){let I=Ae(F,l);D.start={...I},D.end={col:I.col+1,row:I.row+1}}if(typeof h=="string"&&h.length>=2){let I=Ae(h,l);I.row+=1,I.col+=1,D.end={...I}}D.end.mR=0,D.end.mB=0,D.start.mL=0,D.start.mT=0,A&&((A.right||A.all)&&(D.end.mR=A.right||A.all),(A.bottom||A.all)&&(D.end.mB=A.bottom||A.all),(A.left||A.all)&&(D.start.mL=A.left||A.all),(A.top||A.all)&&(D.start.mT=A.top||A.all)),le=="one"?mt+="<xdr:oneCellAnchor><xdr:from><xdr:col>"+D.start.col+"</xdr:col><xdr:colOff>"+D.start.mT+"</xdr:colOff><xdr:row>"+D.start.row+"</xdr:row><xdr:rowOff>"+D.start.mL+'</xdr:rowOff></xdr:from><xdr:ext cx="'+z.cx+'" cy="'+z.cy+'"/><xdr:pic><xdr:nvPicPr><xdr:cNvPr id="'+c+'" name="Picture '+c+'"></xdr:cNvPr><xdr:cNvPicPr preferRelativeResize="0" /></xdr:nvPicPr><xdr:blipFill><a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId'+c+'"></a:blip><a:stretch><a:fillRect /></a:stretch></xdr:blipFill><xdr:spPr><a:prstGeom prst="rect"><a:avLst /></a:prstGeom><a:noFill /></xdr:spPr></xdr:pic><xdr:clientData /></xdr:oneCellAnchor>':mt+='<xdr:twoCellAnchor editAs="oneCell"><xdr:from><xdr:col>'+D.start.col+"</xdr:col><xdr:colOff>"+D.start.mT+"</xdr:colOff><xdr:row>"+D.start.row+"</xdr:row><xdr:rowOff>"+D.start.mL+"</xdr:rowOff></xdr:from><xdr:to><xdr:col>"+D.end.col+"</xdr:col><xdr:colOff>"+D.end.mB+"</xdr:colOff><xdr:row>"+D.end.row+"</xdr:row><xdr:rowOff>"+D.end.mR+'</xdr:rowOff></xdr:to><xdr:pic><xdr:nvPicPr><xdr:cNvPr id="'+c+'" name="Picture '+c+'"></xdr:cNvPr><xdr:cNvPicPr preferRelativeResize="0" /></xdr:nvPicPr><xdr:blipFill><a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId'+c+'"></a:blip><a:stretch><a:fillRect /></a:stretch></xdr:blipFill><xdr:spPr><a:prstGeom prst="rect"><a:avLst /></a:prstGeom><a:noFill /></xdr:spPr></xdr:pic><xdr:clientData /></xdr:twoCellAnchor>',v==null||v.file(S,_),s+='<Relationship Id="rId'+c+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/'+S+'" />'}),Mt=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`+s+"</Relationships>"})),Ce=[...new Set(Ce)];let $t="",Pe=1;lt.length>0&&Y&&($t=lt.reduce((E,s)=>{if(s.type=="cells")return s.operator=="ct"?E+'<conditionalFormatting sqref="'+s.start+":"+s.end+'"><cfRule type="containsText" dxfId="'+(s.styleId&&J[s.styleId]?J[s.styleId]:0)+'" priority="'+(s.priority?s.priority:Pe++)+'" operator="containsText" text="'+s.value+'"><formula>NOT(ISERROR(SEARCH("'+s.value+'",'+s.start+")))</formula></cfRule></conditionalFormatting>":typeof s.operator>"u"||typeof n[s.operator]>"u"?E:E+'<conditionalFormatting sqref="'+s.start+":"+s.end+'"><cfRule type="cellIs" dxfId="'+(s.styleId&&typeof J[s.styleId]<"u"?J[s.styleId]:0)+'" priority="'+(s.priority?s.priority:Pe++)+'" operator="'+n[s.operator]+'">'+(Array.isArray(s.value)?s.value.reduce((y,p)=>y+"<formula>"+p.value+"</formula>",""):"<formula>"+s.value+"</formula>")+"</cfRule></conditionalFormatting>";if(s.type=="top")return E+'<conditionalFormatting sqref="'+s.start+":"+s.end+'"><cfRule type="'+(s.operator?"aboveAverage":"top10")+'" dxfId="'+(s.styleId&&typeof J[s.styleId]<"u"?J[s.styleId]:0)+'" priority="'+(s.priority?s.priority:Pe++)+'" '+(s.bottom?'bottom="1"':"")+" "+(s.percent?'percent="1"':"")+' rank="'+s.value+'" '+(s.operator=="belowAverage"?'aboveAverage="0"':"")+"/></conditionalFormatting>";if(s.type=="iconSet"){let y="";return typeof s.operator>"u"?E:(s.operator.indexOf("5")==0?y='<cfvo type="percent" val="0"/><cfvo type="percent" val="20"/><cfvo type="percent" val="40"/><cfvo type="percent" val="60"/><cfvo type="percent" val="80"/>':s.operator.indexOf("4")==0?y='<cfvo type="percent" val="0"/><cfvo type="percent" val="25"/><cfvo type="percent" val="50"/><cfvo type="percent" val="75"/>':y='<cfvo type="percent" val="0"/><cfvo type="percent" val="33"/><cfvo type="percent" val="67"/>',E+'<conditionalFormatting sqref="'+s.start+":"+s.end+'"><cfRule type="iconSet" priority="'+(s.priority?s.priority:Pe++)+'"><iconSet iconSet="'+s.operator+'">'+y+"</iconSet></cfRule></conditionalFormatting>")}else return s.type=="colorScale"?E+'<conditionalFormatting sqref="'+s.start+":"+s.end+'"><cfRule type="colorScale" priority="'+(s.priority?s.priority:Pe++)+'"><colorScale><cfvo type="min"/>'+(s.operator=="percentile"?'<cfvo type="percentile" val="'+s.value+'"/>':"")+'<cfvo type="max"/>'+(s.colors&&Array.isArray(s.colors)?s.colors.reduce((y,p)=>y+'<color rgb="'+pe(p,o)+'"/>',""):'<color rgb="FFF8696B"/><color rgb="FFFFEB84"/><color rgb="FF63BE7B"/>')+"</colorScale></cfRule></conditionalFormatting>":s.type=="dataBar"?E+'<conditionalFormatting sqref="'+s.start+":"+s.end+'"><cfRule type="dataBar" priority="'+(s.priority?s.priority:Pe++)+'"><dataBar><cfvo type="min"/><cfvo type="max"/>'+(s.colors&&Array.isArray(s.colors)?s.colors.reduce((y,p)=>y+'<color rgb="'+pe(p,o)+'"/>',""):'<color rgb="FF638EC6"/>')+"</dataBar></cfRule></conditionalFormatting>":E},"")),(nt||Re||Ve)&&j==null&&(j=f==null?void 0:f.folder("drawings")),Ve&&R==null&&(R=j==null?void 0:j.folder("_rels")),T["sheet"+(w+1)]={indexId:V+1,key:"sheet"+(w+1),sheetName:Ht,sheetDataTableColumns:H,backgroundImageRef:Bt,sheetDimensions:q,asTable:ce||!1,sheetDataString:C,sheetDropDown:no(a.dropDowns),sheetBreakLine:st,viewType:je,hasComment:Re,drawersContent:mt,cFDataString:$t,sheetMargin:Lt,sheetHeaderFooter:De,isPortrait:Le,drawersRels:Mt,hasImages:Ve,hasCheckbox:nt,formRel:jt,checkboxDrawingContent:It,checkboxForm:ie,checkboxSheetContent:Rt,checkboxShape:Pt,commentString:Ke,commentAuthor:ue,shapeCommentRowCol:Ye,splitOption:Se,sheetViewProperties:ke,sheetSizeString:G.length>0?"<cols>"+G+"</cols>":"",protectionOption:a.protectionOption?Object.keys(a.protectionOption).reduce((E,s)=>E+" "+s+'="'+a.protectionOption[s]+'" ',"<sheetProtection ")+"/>":"",merges:Ce.length>0?Ce.reduce((E,s