@nithishdts001/universal-report-module 1.0.1 → 1.0.3
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.
- package/dist/index.esm.js +8051 -12099
- package/dist/index.js +107 -211
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),S=require("react"),za=require("react-dom"),Ha=require("@emotion/react");require("@emotion/styled");const p=require("@mui/material");function Ld(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Be=Ld(S);function Bd(e){return e==null?"null":Array.isArray(e)?"array":typeof e=="object"?"object":typeof e=="number"?"number":typeof e=="boolean"?"boolean":typeof e=="string"?"string":"mixed"}function Go(e){if(!Array.isArray(e)||e.length===0)return[];const t=new Set;e.forEach(n=>{typeof n=="object"&&n!==null&&Object.keys(n).forEach(i=>t.add(i))});const r=[];return t.forEach(n=>{const i=new Set;let s=0;e.forEach(u=>{typeof u=="object"&&u!==null&&n in u&&(s++,i.add(Bd(u[n])))});const a=s===e.length,o=i.size>1&&!i.has("null");let f="mixed";if(i.size===1)f=Array.from(i)[0];else if(i.size===2&&i.has("null")){const u=Array.from(i).filter(d=>d!=="null");u.length===1&&(f=u[0])}r.push({name:n,type:f,required:a,hasConflict:o})}),r.sort((n,i)=>n.name.localeCompare(i.name))}function $d(e){return e.some(t=>t.hasConflict)}function Yo(e){return e==null}function Ud(e){return(t,r,n)=>{const i=Yo(t),s=Yo(r);if(i&&s)return 0;if(i)return 1;if(s)return-1;let a=0;switch(e){case"number":const o=Number(t),f=Number(r);a=o-f;break;case"boolean":a=(t?1:0)-(r?1:0);break;case"string":a=String(t).localeCompare(String(r));break;case"array":case"object":a=JSON.stringify(t).localeCompare(JSON.stringify(r));break;case"mixed":case"null":default:a=String(t).localeCompare(String(r));break}return n==="asc"?a:-a}}function Wd(e,t,r){if(!r||r.length===0)return e;const n=[...r].sort((i,s)=>i.priority-s.priority);return[...e].sort((i,s)=>{for(const a of n){const o=t.find(d=>d.name===a.column);if(!o)continue;const u=Ud(o.type)(i[a.column],s[a.column],a.direction);if(u!==0)return u}return 0})}function Vd(e){return e===null?"asc":e==="asc"?"desc":null}function zd(e){return e==="string"||e==="boolean"}function Hd(e){return e.filter(t=>zd(t.type))}function Gd(e,t){const r={};return t.forEach(n=>{if(n.type==="number"){const i=e.map(s=>s[n.name]).filter(s=>typeof s=="number");i.length>0&&(r[n.name]=i.reduce((s,a)=>s+a,0))}}),r}function Yd(e,t,r){if(!r.enabled||r.levels.length===0)return e;const n=Qc(e,r.levels,t);return e0(n,r.collapsedGroups||[])}function Qc(e,t,r,n="",i=0){if(i>=t.length)return e;const s=t[i].column,a=new Map;e.forEach(u=>{const d=u[s],h=d==null?"(empty)":String(d);a.has(h)||a.set(h,[]),a.get(h).push(u)});const o=[];return Array.from(a.keys()).sort().forEach(u=>{const d=a.get(u),h=`${s}:${u}`,m=n?`${n}|${h}`:h,l=Gd(d,r),v=i<t.length-1?Qc(d,t,r,m,i+1):d,g={key:m,level:i,column:s,value:u,rowCount:d.length,aggregates:l,children:v};o.push(g)}),o}function e0(e,t,r=[]){for(const n of e)if("key"in n&&"level"in n&&"children"in n){const i=t.includes(n.key);r.push({isGroupHeader:!0,groupKey:n.key,groupLevel:n.level,groupColumn:n.column,groupValue:n.value,rowCount:n.rowCount,aggregates:n.aggregates,isCollapsed:i}),!i&&n.children&&e0(n.children,t,r)}else r.push(n);return r}function Xd(e,t){const r=e.collapsedGroups||[],n=r.includes(t)?r.filter(i=>i!==t):[...r,t];return{...e,collapsedGroups:n}}function Kd(e,t){return e==null?"":typeof e=="number"?`Σ ${e.toLocaleString()}`:String(e)}function qd(e,t,r){return`${t}: ${r}`}function Wn(e,t){if(!t||!t.enabled||!t.levels||t.levels.length===0)return[...e];const r=t.levels.map(i=>i.column),n=e.filter(i=>!r.includes(i));return[...r,...n]}function t0(e,t,r){if(!t||!t.enabled||!t.levels||t.levels.length===0)return[...e];const n=t.levels.map(s=>s.column),i=e.filter(s=>!n.includes(s));if(r){const s=[],a=new Set(n),o=new Set(i);let f=0;for(const u of r)a.has(u)?s.push(u):o.has(u)&&f<i.length?(s.push(i[f]),f++):o.has(u)||s.push(u);for(let u=f;u<i.length;u++)s.includes(i[u])||s.push(i[u]);return s}return[...e]}function Xo(e){const t={},r=[],n={};return e.forEach(i=>{t[i.name]=!0,r.push(i.name),n[i.name]=150}),{id:"default-view",name:"Default View",description:"Unfiltered, unsorted baseline view",isDefault:!0,snapshot:{filters:[],sortStack:[],columnVisibility:t,columnOrder:r,columnWidths:n,grouping:null}}}function Jd(e,t,r,n,i,s,a,o){const f={},u=[],d={};r.forEach(l=>{f[l.name]=!0,u.push(l.name),d[l.name]=150});const m=t0(i||u,a||null,o||u);return{filters:e||[],sortStack:t||[],columnVisibility:n||f,columnOrder:m,columnWidths:s||d,grouping:a||null}}function Zd(e,t){return JSON.stringify(e.filters)!==JSON.stringify(t.filters)||JSON.stringify(e.sortStack)!==JSON.stringify(t.sortStack)||JSON.stringify(e.columnVisibility)!==JSON.stringify(t.columnVisibility)||JSON.stringify(e.columnOrder)!==JSON.stringify(t.columnOrder)||JSON.stringify(e.columnWidths)!==JSON.stringify(t.columnWidths)||JSON.stringify(e.grouping)!==JSON.stringify(t.grouping)}function Qd(e){return!e||e.length===0?"None":e.sort((t,r)=>t.priority-r.priority).map(t=>`${t.column} ${t.direction==="asc"?"↑":"↓"}`).join(", ")}function eh(e,t){var g,x,T;const r=[],n=JSON.stringify(e.filters),i=JSON.stringify(t.filters);if(n!==i){const b=e.filters.length,_=t.filters.length;b>_?r.push({category:"filters",label:"Filters Added",description:`${b-_} new filter${b-_>1?"s":""} added`}):b<_?r.push({category:"filters",label:"Filters Removed",description:`${_-b} filter${_-b>1?"s":""} removed`}):r.push({category:"filters",label:"Filters Modified",description:"Filter conditions have been changed"})}const s=JSON.stringify(e.sortStack),a=JSON.stringify(t.sortStack);if(s!==a){const b=e.sortStack.length,_=t.sortStack.length;b>_?r.push({category:"sorting",label:"Sorting Added",description:`${b-_} new sort rule${b-_>1?"s":""} added`}):b<_?r.push({category:"sorting",label:"Sorting Removed",description:`${_-b} sort rule${_-b>1?"s":""} removed`}):r.push({category:"sorting",label:"Sorting Modified",description:"Sort rules or order have been changed"})}const o=JSON.stringify(e.columnVisibility),f=JSON.stringify(t.columnVisibility);if(o!==f){const b=Object.values(e.columnVisibility).filter(k=>k).length,_=Object.values(t.columnVisibility).filter(k=>k).length;b>_?r.push({category:"visibility",label:"Columns Shown",description:`${b-_} column${b-_>1?"s":""} made visible`}):b<_?r.push({category:"visibility",label:"Columns Hidden",description:`${_-b} column${_-b>1?"s":""} hidden`}):r.push({category:"visibility",label:"Column Visibility Changed",description:"Column visibility settings have been modified"})}const u=JSON.stringify(e.columnOrder),d=JSON.stringify(t.columnOrder);u!==d&&r.push({category:"order",label:"Column Order Changed",description:"Columns have been reordered"});const h=JSON.stringify(e.columnWidths),m=JSON.stringify(t.columnWidths);if(h!==m){const b=Object.keys(e.columnWidths).filter(_=>e.columnWidths[_]!==t.columnWidths[_]).length;r.push({category:"widths",label:"Column Widths Adjusted",description:`${b} column width${b>1?"s":""} modified`})}const l=JSON.stringify(e.grouping),v=JSON.stringify(t.grouping);if(l!==v){const b=(g=e.grouping)==null?void 0:g.enabled,_=(x=t.grouping)==null?void 0:x.enabled;if(b&&!_){const k=((T=e.grouping)==null?void 0:T.levels.length)||0;r.push({category:"grouping",label:"Grouping Applied",description:`${k} grouping level${k>1?"s":""} added`})}else!b&&_?r.push({category:"grouping",label:"Grouping Removed",description:"All grouping has been cleared"}):r.push({category:"grouping",label:"Grouping Modified",description:"Grouping configuration has been changed"})}return r}const r0="urm_report_";function th(e,t){try{const r=`${r0}${e}`;localStorage.setItem(r,JSON.stringify(t))}catch(r){console.error("Failed to save report state:",r)}}function rh(e){try{const t=`${r0}${e}`,r=localStorage.getItem(t);return r?JSON.parse(r):null}catch(t){return console.error("Failed to load report state:",t),null}}/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var is={};is.version="0.18.5";var n0=1252,nh=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],i0=function(e){nh.indexOf(e)!=-1&&(n0=e)};function ih(){i0(1252)}var vi=function(e){i0(e)};function sh(){vi(1200),ih()}var Bi=function(t){return String.fromCharCode(t)},Ko=function(t){return String.fromCharCode(t)},ss,rn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function yi(e){for(var t="",r=0,n=0,i=0,s=0,a=0,o=0,f=0,u=0;u<e.length;)r=e.charCodeAt(u++),s=r>>2,n=e.charCodeAt(u++),a=(r&3)<<4|n>>4,i=e.charCodeAt(u++),o=(n&15)<<2|i>>6,f=i&63,isNaN(n)?o=f=64:isNaN(i)&&(f=64),t+=rn.charAt(s)+rn.charAt(a)+rn.charAt(o)+rn.charAt(f);return t}function Kr(e){var t="",r=0,n=0,i=0,s=0,a=0,o=0,f=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var u=0;u<e.length;)s=rn.indexOf(e.charAt(u++)),a=rn.indexOf(e.charAt(u++)),r=s<<2|a>>4,t+=String.fromCharCode(r),o=rn.indexOf(e.charAt(u++)),n=(a&15)<<4|o>>2,o!==64&&(t+=String.fromCharCode(n)),f=rn.indexOf(e.charAt(u++)),i=(o&3)<<6|f,f!==64&&(t+=String.fromCharCode(i));return t}var Ze=(function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node})(),Zr=(function(){if(typeof Buffer<"u"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch{e=!0}return e?function(t,r){return r?new Buffer(t,r):new Buffer(t)}:Buffer.from.bind(Buffer)}return function(){}})();function yn(e){return Ze?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function qo(e){return Ze?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}var Nr=function(t){return Ze?Zr(t,"binary"):t.split("").map(function(r){return r.charCodeAt(0)&255})};function Es(e){if(typeof ArrayBuffer>"u")return Nr(e);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n!=e.length;++n)r[n]=e.charCodeAt(n)&255;return t}function Oi(e){if(Array.isArray(e))return e.map(function(n){return String.fromCharCode(n)}).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function ah(e){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(e)}var Jt=Ze?function(e){return Buffer.concat(e.map(function(t){return Buffer.isBuffer(t)?t:Zr(t)}))}:function(e){if(typeof Uint8Array<"u"){var t=0,r=0;for(t=0;t<e.length;++t)r+=e[t].length;var n=new Uint8Array(r),i=0;for(t=0,r=0;t<e.length;r+=i,++t)if(i=e[t].length,e[t]instanceof Uint8Array)n.set(e[t],r);else{if(typeof e[t]=="string")throw"wtf";n.set(new Uint8Array(e[t]),r)}return n}return[].concat.apply([],e.map(function(s){return Array.isArray(s)?s:[].slice.call(s)}))};function oh(e){for(var t=[],r=0,n=e.length+250,i=yn(e.length+255),s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a<128)i[r++]=a;else if(a<2048)i[r++]=192|a>>6&31,i[r++]=128|a&63;else if(a>=55296&&a<57344){a=(a&1023)+64;var o=e.charCodeAt(++s)&1023;i[r++]=240|a>>8&7,i[r++]=128|a>>2&63,i[r++]=128|o>>6&15|(a&3)<<4,i[r++]=128|o&63}else i[r++]=224|a>>12&15,i[r++]=128|a>>6&63,i[r++]=128|a&63;r>n&&(t.push(i.slice(0,r)),r=0,i=yn(65535),n=65530)}return t.push(i.slice(0,r)),Jt(t)}var ui=/\u0000/g,$i=/[\u0001-\u0006]/g;function Hn(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function Rr(e,t){var r=""+e;return r.length>=t?r:Ot("0",t-r.length)+r}function Ga(e,t){var r=""+e;return r.length>=t?r:Ot(" ",t-r.length)+r}function as(e,t){var r=""+e;return r.length>=t?r:r+Ot(" ",t-r.length)}function lh(e,t){var r=""+Math.round(e);return r.length>=t?r:Ot("0",t-r.length)+r}function ch(e,t){var r=""+e;return r.length>=t?r:Ot("0",t-r.length)+r}var Jo=Math.pow(2,32);function Fn(e,t){if(e>Jo||e<-Jo)return lh(e,t);var r=Math.round(e);return ch(r,t)}function os(e,t){return t=t||0,e.length>=7+t&&(e.charCodeAt(t)|32)===103&&(e.charCodeAt(t+1)|32)===101&&(e.charCodeAt(t+2)|32)===110&&(e.charCodeAt(t+3)|32)===101&&(e.charCodeAt(t+4)|32)===114&&(e.charCodeAt(t+5)|32)===97&&(e.charCodeAt(t+6)|32)===108}var Zo=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],ea=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function uh(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var Dt={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},Qo={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},fh={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function ls(e,t,r){for(var n=e<0?-1:1,i=e*n,s=0,a=1,o=0,f=1,u=0,d=0,h=Math.floor(i);u<t&&(h=Math.floor(i),o=h*a+s,d=h*u+f,!(i-h<5e-8));)i=1/(i-h),s=a,a=o,f=u,u=d;if(d>t&&(u>t?(d=f,o=s):(d=u,o=a)),!r)return[0,n*o,d];var m=Math.floor(n*o/d);return[m,n*o-m*d,d]}function Ui(e,t,r){if(e>2958465||e<0)return null;var n=e|0,i=Math.floor(86400*(e-n)),s=0,a=[],o={D:n,T:i,u:86400*(e-n)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(o.u)<1e-6&&(o.u=0),t&&t.date1904&&(n+=1462),o.u>.9999&&(o.u=0,++i==86400&&(o.T=i=0,++n,++o.D)),n===60)a=r?[1317,10,29]:[1900,2,29],s=3;else if(n===0)a=r?[1317,8,29]:[1900,1,0],s=6;else{n>60&&--n;var f=new Date(1900,0,1);f.setDate(f.getDate()+n-1),a=[f.getFullYear(),f.getMonth()+1,f.getDate()],s=f.getDay(),n<60&&(s=(s+6)%7),r&&(s=vh(f,a))}return o.y=a[0],o.m=a[1],o.d=a[2],o.S=i%60,i=Math.floor(i/60),o.M=i%60,i=Math.floor(i/60),o.H=i,o.q=s,o}var s0=new Date(1899,11,31,0,0,0),dh=s0.getTime(),hh=new Date(1900,2,1,0,0,0);function a0(e,t){var r=e.getTime();return t?r-=1461*24*60*60*1e3:e>=hh&&(r+=1440*60*1e3),(r-(dh+(e.getTimezoneOffset()-s0.getTimezoneOffset())*6e4))/(1440*60*1e3)}function Ya(e){return e.indexOf(".")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function ph(e){return e.indexOf("E")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function gh(e){var t=e<0?12:11,r=Ya(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10),r.length<=t)?r:e.toExponential(5)}function mh(e){var t=Ya(e.toFixed(11));return t.length>(e<0?12:11)||t==="0"||t==="-0"?e.toPrecision(6):t}function xh(e){var t=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),r;return t>=-4&&t<=-1?r=e.toPrecision(10+t):Math.abs(t)<=9?r=gh(e):t===10?r=e.toFixed(10).substr(0,12):r=mh(e),Ya(ph(r.toUpperCase()))}function Ca(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):xh(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return an(14,a0(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function vh(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function yh(e,t,r,n){var i="",s=0,a=0,o=r.y,f,u=0;switch(e){case 98:o=r.y+543;case 121:switch(t.length){case 1:case 2:f=o%100,u=2;break;default:f=o%1e4,u=4;break}break;case 109:switch(t.length){case 1:case 2:f=r.m,u=t.length;break;case 3:return ea[r.m-1][1];case 5:return ea[r.m-1][0];default:return ea[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:f=r.d,u=t.length;break;case 3:return Zo[r.q][0];default:return Zo[r.q][1]}break;case 104:switch(t.length){case 1:case 2:f=1+(r.H+11)%12,u=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:f=r.H,u=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:f=r.M,u=t.length;break;default:throw"bad minute format: "+t}break;case 115:if(t!="s"&&t!="ss"&&t!=".0"&&t!=".00"&&t!=".000")throw"bad second format: "+t;return r.u===0&&(t=="s"||t=="ss")?Rr(r.S,t.length):(n>=2?a=n===3?1e3:100:a=n===1?10:1,s=Math.round(a*(r.S+r.u)),s>=60*a&&(s=0),t==="s"?s===0?"0":""+s/a:(i=Rr(s,2+n),t==="ss"?i.substr(0,2):"."+i.substr(2,t.length-1)));case 90:switch(t){case"[h]":case"[hh]":f=r.D*24+r.H;break;case"[m]":case"[mm]":f=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":f=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+t}u=t.length===3?1:2;break;case 101:f=o,u=1;break}var d=u>0?Rr(f,u):"";return d}function nn(e){var t=3;if(e.length<=t)return e;for(var r=e.length%t,n=e.substr(0,r);r!=e.length;r+=t)n+=(n.length>0?",":"")+e.substr(r,t);return n}var o0=/%/g;function wh(e,t,r){var n=t.replace(o0,""),i=t.length-n.length;return Gr(e,n,r*Math.pow(10,2*i))+Ot("%",i)}function Th(e,t,r){for(var n=t.length-1;t.charCodeAt(n-1)===44;)--n;return Gr(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}function l0(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+l0(e,-t);var i=e.indexOf(".");i===-1&&(i=e.indexOf("E"));var s=Math.floor(Math.log(t)*Math.LOG10E)%i;if(s<0&&(s+=i),r=(t/Math.pow(10,s)).toPrecision(n+1+(i+s)%i),r.indexOf("e")===-1){var a=Math.floor(Math.log(t)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(a-r.length+s):r+="E+"+(a-s);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,i)+"."+r.substr(2+i),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,f,u,d){return f+u+d.substr(0,(i+s)%i)+"."+d.substr(s)+"E"})}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var c0=/# (\?+)( ?)\/( ?)(\d+)/;function Sh(e,t,r){var n=parseInt(e[4],10),i=Math.round(t*n),s=Math.floor(i/n),a=i-s*n,o=n;return r+(s===0?"":""+s)+" "+(a===0?Ot(" ",e[1].length+1+e[4].length):Ga(a,e[1].length)+e[2]+"/"+e[3]+Rr(o,e[4].length))}function Eh(e,t,r){return r+(t===0?"":""+t)+Ot(" ",e[1].length+2+e[4].length)}var u0=/^#*0*\.([0#]+)/,f0=/\).*[0#]/,d0=/\(###\) ###\\?-####/;function ar(e){for(var t="",r,n=0;n!=e.length;++n)switch(r=e.charCodeAt(n)){case 35:break;case 63:t+=" ";break;case 48:t+="0";break;default:t+=String.fromCharCode(r)}return t}function el(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function tl(e,t){var r=e-Math.floor(e),n=Math.pow(10,t);return t<(""+Math.round(r*n)).length?0:Math.round(r*n)}function _h(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}function bh(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function _r(e,t,r){if(e.charCodeAt(0)===40&&!t.match(f0)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?_r("n",n,r):"("+_r("n",n,-r)+")"}if(t.charCodeAt(t.length-1)===44)return Th(e,t,r);if(t.indexOf("%")!==-1)return wh(e,t,r);if(t.indexOf("E")!==-1)return l0(t,r);if(t.charCodeAt(0)===36)return"$"+_r(e,t.substr(t.charAt(1)==" "?2:1),r);var i,s,a,o,f=Math.abs(r),u=r<0?"-":"";if(t.match(/^00+$/))return u+Fn(f,t.length);if(t.match(/^[#?]+$/))return i=Fn(r,0),i==="0"&&(i=""),i.length>t.length?i:ar(t.substr(0,t.length-i.length))+i;if(s=t.match(c0))return Sh(s,f,u);if(t.match(/^#+0+$/))return u+Fn(f,t.length-t.indexOf("0"));if(s=t.match(u0))return i=el(r,s[1].length).replace(/^([^\.]+)$/,"$1."+ar(s[1])).replace(/\.$/,"."+ar(s[1])).replace(/\.(\d*)$/,function(v,g){return"."+g+Ot("0",ar(s[1]).length-g.length)}),t.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),s=t.match(/^(0*)\.(#*)$/))return u+el(f,s[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=t.match(/^#{1,3},##0(\.?)$/))return u+nn(Fn(f,0));if(s=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+_r(e,t,-r):nn(""+(Math.floor(r)+_h(r,s[1].length)))+"."+Rr(tl(r,s[1].length),s[1].length);if(s=t.match(/^#,#*,#0/))return _r(e,t.replace(/^#,#*,/,""),r);if(s=t.match(/^([0#]+)(\\?-([0#]+))+$/))return i=Hn(_r(e,t.replace(/[\\-]/g,""),r)),a=0,Hn(Hn(t.replace(/\\/g,"")).replace(/[0#]/g,function(v){return a<i.length?i.charAt(a++):v==="0"?"0":""}));if(t.match(d0))return i=_r(e,"##########",r),"("+i.substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var d="";if(s=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(s[4].length,7),o=ls(f,Math.pow(10,a)-1,!1),i=""+u,d=Gr("n",s[1],o[1]),d.charAt(d.length-1)==" "&&(d=d.substr(0,d.length-1)+"0"),i+=d+s[2]+"/"+s[3],d=as(o[2],a),d.length<s[4].length&&(d=ar(s[4].substr(s[4].length-d.length))+d),i+=d,i;if(s=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(Math.max(s[1].length,s[4].length),7),o=ls(f,Math.pow(10,a)-1,!0),u+(o[0]||(o[1]?"":"0"))+" "+(o[1]?Ga(o[1],a)+s[2]+"/"+s[3]+as(o[2],a):Ot(" ",2*a+1+s[2].length+s[3].length));if(s=t.match(/^[#0?]+$/))return i=Fn(r,0),t.length<=i.length?i:ar(t.substr(0,t.length-i.length))+i;if(s=t.match(/^([#0?]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),a=i.indexOf(".");var h=t.indexOf(".")-a,m=t.length-i.length-h;return ar(t.substr(0,h)+i+t.substr(t.length-m))}if(s=t.match(/^00,000\.([#0]*0)$/))return a=tl(r,s[1].length),r<0?"-"+_r(e,t,-r):nn(bh(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(v){return"00,"+(v.length<3?Rr(0,3-v.length):"")+v})+"."+Rr(a,s[1].length);switch(t){case"###,##0.00":return _r(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var l=nn(Fn(f,0));return l!=="0"?u+l:"";case"###,###.00":return _r(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return _r(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function Ch(e,t,r){for(var n=t.length-1;t.charCodeAt(n-1)===44;)--n;return Gr(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}function Ah(e,t,r){var n=t.replace(o0,""),i=t.length-n.length;return Gr(e,n,r*Math.pow(10,2*i))+Ot("%",i)}function h0(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+h0(e,-t);var i=e.indexOf(".");i===-1&&(i=e.indexOf("E"));var s=Math.floor(Math.log(t)*Math.LOG10E)%i;if(s<0&&(s+=i),r=(t/Math.pow(10,s)).toPrecision(n+1+(i+s)%i),!r.match(/[Ee]/)){var a=Math.floor(Math.log(t)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(a-r.length+s):r+="E+"+(a-s),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,f,u,d){return f+u+d.substr(0,(i+s)%i)+"."+d.substr(s)+"E"})}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function $r(e,t,r){if(e.charCodeAt(0)===40&&!t.match(f0)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?$r("n",n,r):"("+$r("n",n,-r)+")"}if(t.charCodeAt(t.length-1)===44)return Ch(e,t,r);if(t.indexOf("%")!==-1)return Ah(e,t,r);if(t.indexOf("E")!==-1)return h0(t,r);if(t.charCodeAt(0)===36)return"$"+$r(e,t.substr(t.charAt(1)==" "?2:1),r);var i,s,a,o,f=Math.abs(r),u=r<0?"-":"";if(t.match(/^00+$/))return u+Rr(f,t.length);if(t.match(/^[#?]+$/))return i=""+r,r===0&&(i=""),i.length>t.length?i:ar(t.substr(0,t.length-i.length))+i;if(s=t.match(c0))return Eh(s,f,u);if(t.match(/^#+0+$/))return u+Rr(f,t.length-t.indexOf("0"));if(s=t.match(u0))return i=(""+r).replace(/^([^\.]+)$/,"$1."+ar(s[1])).replace(/\.$/,"."+ar(s[1])),i=i.replace(/\.(\d*)$/,function(v,g){return"."+g+Ot("0",ar(s[1]).length-g.length)}),t.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),s=t.match(/^(0*)\.(#*)$/))return u+(""+f).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=t.match(/^#{1,3},##0(\.?)$/))return u+nn(""+f);if(s=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+$r(e,t,-r):nn(""+r)+"."+Ot("0",s[1].length);if(s=t.match(/^#,#*,#0/))return $r(e,t.replace(/^#,#*,/,""),r);if(s=t.match(/^([0#]+)(\\?-([0#]+))+$/))return i=Hn($r(e,t.replace(/[\\-]/g,""),r)),a=0,Hn(Hn(t.replace(/\\/g,"")).replace(/[0#]/g,function(v){return a<i.length?i.charAt(a++):v==="0"?"0":""}));if(t.match(d0))return i=$r(e,"##########",r),"("+i.substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var d="";if(s=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(s[4].length,7),o=ls(f,Math.pow(10,a)-1,!1),i=""+u,d=Gr("n",s[1],o[1]),d.charAt(d.length-1)==" "&&(d=d.substr(0,d.length-1)+"0"),i+=d+s[2]+"/"+s[3],d=as(o[2],a),d.length<s[4].length&&(d=ar(s[4].substr(s[4].length-d.length))+d),i+=d,i;if(s=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(Math.max(s[1].length,s[4].length),7),o=ls(f,Math.pow(10,a)-1,!0),u+(o[0]||(o[1]?"":"0"))+" "+(o[1]?Ga(o[1],a)+s[2]+"/"+s[3]+as(o[2],a):Ot(" ",2*a+1+s[2].length+s[3].length));if(s=t.match(/^[#0?]+$/))return i=""+r,t.length<=i.length?i:ar(t.substr(0,t.length-i.length))+i;if(s=t.match(/^([#0]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),a=i.indexOf(".");var h=t.indexOf(".")-a,m=t.length-i.length-h;return ar(t.substr(0,h)+i+t.substr(t.length-m))}if(s=t.match(/^00,000\.([#0]*0)$/))return r<0?"-"+$r(e,t,-r):nn(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(v){return"00,"+(v.length<3?Rr(0,3-v.length):"")+v})+"."+Rr(0,s[1].length);switch(t){case"###,###":case"##,###":case"#,###":var l=nn(""+f);return l!=="0"?u+l:"";default:if(t.match(/\.[0#?]*$/))return $r(e,t.slice(0,t.lastIndexOf(".")),r)+ar(t.slice(t.lastIndexOf(".")))}throw new Error("unsupported format |"+t+"|")}function Gr(e,t,r){return(r|0)===r?$r(e,t,r):_r(e,t,r)}function Oh(e){for(var t=[],r=!1,n=0,i=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:t[t.length]=e.substr(i,n-i),i=n+1}if(t[t.length]=e.substr(i),r===!0)throw new Error("Format |"+e+"| unterminated string ");return t}var p0=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function g0(e){for(var t=0,r="",n="";t<e.length;)switch(r=e.charAt(t)){case"G":os(e,t)&&(t+=6),t++;break;case'"':for(;e.charCodeAt(++t)!==34&&t<e.length;);++t;break;case"\\":t+=2;break;case"_":t+=2;break;case"@":++t;break;case"B":case"b":if(e.charAt(t+1)==="1"||e.charAt(t+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(e.substr(t,3).toUpperCase()==="A/P"||e.substr(t,5).toUpperCase()==="AM/PM"||e.substr(t,5).toUpperCase()==="上午/下午")return!0;++t;break;case"[":for(n=r;e.charAt(t++)!=="]"&&t<e.length;)n+=e.charAt(t);if(n.match(p0))return!0;break;case".":case"0":case"#":for(;t<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++t))>-1||r=="\\"&&e.charAt(t+1)=="-"&&"0#".indexOf(e.charAt(t+2))>-1););break;case"?":for(;e.charAt(++t)===r;);break;case"*":++t,(e.charAt(t)==" "||e.charAt(t)=="*")&&++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t<e.length&&"0123456789".indexOf(e.charAt(++t))>-1;);break;case" ":++t;break;default:++t;break}return!1}function Dh(e,t,r,n){for(var i=[],s="",a=0,o="",f="t",u,d,h,m="H";a<e.length;)switch(o=e.charAt(a)){case"G":if(!os(e,a))throw new Error("unrecognized character "+o+" in "+e);i[i.length]={t:"G",v:"General"},a+=7;break;case'"':for(s="";(h=e.charCodeAt(++a))!==34&&a<e.length;)s+=String.fromCharCode(h);i[i.length]={t:"t",v:s},++a;break;case"\\":var l=e.charAt(++a),v=l==="("||l===")"?l:"t";i[i.length]={t:v,v:l},++a;break;case"_":i[i.length]={t:"t",v:" "},a+=2;break;case"@":i[i.length]={t:"T",v:t},++a;break;case"B":case"b":if(e.charAt(a+1)==="1"||e.charAt(a+1)==="2"){if(u==null&&(u=Ui(t,r,e.charAt(a+1)==="2"),u==null))return"";i[i.length]={t:"X",v:e.substr(a,2)},f=o,a+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":o=o.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0||u==null&&(u=Ui(t,r),u==null))return"";for(s=o;++a<e.length&&e.charAt(a).toLowerCase()===o;)s+=o;o==="m"&&f.toLowerCase()==="h"&&(o="M"),o==="h"&&(o=m),i[i.length]={t:o,v:s},f=o;break;case"A":case"a":case"上":var g={t:o,v:o};if(u==null&&(u=Ui(t,r)),e.substr(a,3).toUpperCase()==="A/P"?(u!=null&&(g.v=u.H>=12?"P":"A"),g.t="T",m="h",a+=3):e.substr(a,5).toUpperCase()==="AM/PM"?(u!=null&&(g.v=u.H>=12?"PM":"AM"),g.t="T",a+=5,m="h"):e.substr(a,5).toUpperCase()==="上午/下午"?(u!=null&&(g.v=u.H>=12?"下午":"上午"),g.t="T",a+=5,m="h"):(g.t="t",++a),u==null&&g.t==="T")return"";i[i.length]=g,f=o;break;case"[":for(s=o;e.charAt(a++)!=="]"&&a<e.length;)s+=e.charAt(a);if(s.slice(-1)!=="]")throw'unterminated "[" block: |'+s+"|";if(s.match(p0)){if(u==null&&(u=Ui(t,r),u==null))return"";i[i.length]={t:"Z",v:s.toLowerCase()},f=s.charAt(1)}else s.indexOf("$")>-1&&(s=(s.match(/\$([^-\[\]]*)/)||[])[1]||"$",g0(e)||(i[i.length]={t:"t",v:s}));break;case".":if(u!=null){for(s=o;++a<e.length&&(o=e.charAt(a))==="0";)s+=o;i[i.length]={t:"s",v:s};break}case"0":case"#":for(s=o;++a<e.length&&"0#?.,E+-%".indexOf(o=e.charAt(a))>-1;)s+=o;i[i.length]={t:"n",v:s};break;case"?":for(s=o;e.charAt(++a)===o;)s+=o;i[i.length]={t:o,v:s},f=o;break;case"*":++a,(e.charAt(a)==" "||e.charAt(a)=="*")&&++a;break;case"(":case")":i[i.length]={t:n===1?"t":o,v:o},++a;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(s=o;a<e.length&&"0123456789".indexOf(e.charAt(++a))>-1;)s+=e.charAt(a);i[i.length]={t:"D",v:s};break;case" ":i[i.length]={t:o,v:o},++a;break;case"$":i[i.length]={t:"t",v:"$"},++a;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(o)===-1)throw new Error("unrecognized character "+o+" in "+e);i[i.length]={t:"t",v:o},++a;break}var x=0,T=0,b;for(a=i.length-1,f="t";a>=0;--a)switch(i[a].t){case"h":case"H":i[a].t=m,f="h",x<1&&(x=1);break;case"s":(b=i[a].v.match(/\.0+$/))&&(T=Math.max(T,b[0].length-1)),x<3&&(x=3);case"d":case"y":case"M":case"e":f=i[a].t;break;case"m":f==="s"&&(i[a].t="M",x<2&&(x=2));break;case"X":break;case"Z":x<1&&i[a].v.match(/[Hh]/)&&(x=1),x<2&&i[a].v.match(/[Mm]/)&&(x=2),x<3&&i[a].v.match(/[Ss]/)&&(x=3)}switch(x){case 0:break;case 1:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M),u.M>=60&&(u.M=0,++u.H);break;case 2:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M);break}var _="",k;for(a=0;a<i.length;++a)switch(i[a].t){case"t":case"T":case" ":case"D":break;case"X":i[a].v="",i[a].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":i[a].v=yh(i[a].t.charCodeAt(0),i[a].v,u,T),i[a].t="t";break;case"n":case"?":for(k=a+1;i[k]!=null&&((o=i[k].t)==="?"||o==="D"||(o===" "||o==="t")&&i[k+1]!=null&&(i[k+1].t==="?"||i[k+1].t==="t"&&i[k+1].v==="/")||i[a].t==="("&&(o===" "||o==="n"||o===")")||o==="t"&&(i[k].v==="/"||i[k].v===" "&&i[k+1]!=null&&i[k+1].t=="?"));)i[a].v+=i[k].v,i[k]={v:"",t:";"},++k;_+=i[a].v,a=k-1;break;case"G":i[a].t="t",i[a].v=Ca(t,r);break}var F="",z,N;if(_.length>0){_.charCodeAt(0)==40?(z=t<0&&_.charCodeAt(0)===45?-t:t,N=Gr("n",_,z)):(z=t<0&&n>1?-t:t,N=Gr("n",_,z),z<0&&i[0]&&i[0].t=="t"&&(N=N.substr(1),i[0].v="-"+i[0].v)),k=N.length-1;var B=i.length;for(a=0;a<i.length;++a)if(i[a]!=null&&i[a].t!="t"&&i[a].v.indexOf(".")>-1){B=a;break}var M=i.length;if(B===i.length&&N.indexOf("E")===-1){for(a=i.length-1;a>=0;--a)i[a]==null||"n?".indexOf(i[a].t)===-1||(k>=i[a].v.length-1?(k-=i[a].v.length,i[a].v=N.substr(k+1,i[a].v.length)):k<0?i[a].v="":(i[a].v=N.substr(0,k+1),k=-1),i[a].t="t",M=a);k>=0&&M<i.length&&(i[M].v=N.substr(0,k+1)+i[M].v)}else if(B!==i.length&&N.indexOf("E")===-1){for(k=N.indexOf(".")-1,a=B;a>=0;--a)if(!(i[a]==null||"n?".indexOf(i[a].t)===-1)){for(d=i[a].v.indexOf(".")>-1&&a===B?i[a].v.indexOf(".")-1:i[a].v.length-1,F=i[a].v.substr(d+1);d>=0;--d)k>=0&&(i[a].v.charAt(d)==="0"||i[a].v.charAt(d)==="#")&&(F=N.charAt(k--)+F);i[a].v=F,i[a].t="t",M=a}for(k>=0&&M<i.length&&(i[M].v=N.substr(0,k+1)+i[M].v),k=N.indexOf(".")+1,a=B;a<i.length;++a)if(!(i[a]==null||"n?(".indexOf(i[a].t)===-1&&a!==B)){for(d=i[a].v.indexOf(".")>-1&&a===B?i[a].v.indexOf(".")+1:0,F=i[a].v.substr(0,d);d<i[a].v.length;++d)k<N.length&&(F+=N.charAt(k++));i[a].v=F,i[a].t="t",M=a}}}for(a=0;a<i.length;++a)i[a]!=null&&"n?".indexOf(i[a].t)>-1&&(z=n>1&&t<0&&a>0&&i[a-1].v==="-"?-t:t,i[a].v=Gr(i[a].t,i[a].v,z),i[a].t="t");var L="";for(a=0;a!==i.length;++a)i[a]!=null&&(L+=i[a].v);return L}var rl=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function nl(e,t){if(t==null)return!1;var r=parseFloat(t[2]);switch(t[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0;break}return!1}function kh(e,t){var r=Oh(e),n=r.length,i=r[n-1].indexOf("@");if(n<4&&i>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof t!="number")return[4,r.length===4||i>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=i>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=i>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=i>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var s=t>0?r[0]:t<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[n,s];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var a=r[0].match(rl),o=r[1].match(rl);return nl(t,a)?[n,r[0]]:nl(t,o)?[n,r[1]]:[n,r[a!=null&&o!=null?2:1]]}return[n,s]}function an(e,t,r){r==null&&(r={});var n="";switch(typeof e){case"string":e=="m/d/yy"&&r.dateNF?n=r.dateNF:n=e;break;case"number":e==14&&r.dateNF?n=r.dateNF:n=(r.table!=null?r.table:Dt)[e],n==null&&(n=r.table&&r.table[Qo[e]]||Dt[Qo[e]]),n==null&&(n=fh[e]||"General");break}if(os(n,0))return Ca(t,r);t instanceof Date&&(t=a0(t,r.date1904));var i=kh(n,t);if(os(i[1]))return Ca(t,r);if(t===!0)t="TRUE";else if(t===!1)t="FALSE";else if(t===""||t==null)return"";return Dh(i[1],t,r,i[0])}function m0(e,t){if(typeof t!="number"){t=+t||-1;for(var r=0;r<392;++r){if(Dt[r]==null){t<0&&(t=r);continue}if(Dt[r]==e){t=r;break}}t<0&&(t=391)}return Dt[t]=e,t}function _s(e){for(var t=0;t!=392;++t)e[t]!==void 0&&m0(e[t],t)}function bs(){Dt=uh()}var x0=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function Ih(e){var t=typeof e=="number"?Dt[e]:e;return t=t.replace(x0,"(\\d+)"),new RegExp("^"+t+"$")}function Fh(e,t,r){var n=-1,i=-1,s=-1,a=-1,o=-1,f=-1;(t.match(x0)||[]).forEach(function(h,m){var l=parseInt(r[m+1],10);switch(h.toLowerCase().charAt(0)){case"y":n=l;break;case"d":s=l;break;case"h":a=l;break;case"s":f=l;break;case"m":a>=0?o=l:i=l;break}}),f>=0&&o==-1&&i>=0&&(o=i,i=-1);var u=(""+(n>=0?n:new Date().getFullYear())).slice(-4)+"-"+("00"+(i>=1?i:1)).slice(-2)+"-"+("00"+(s>=1?s:1)).slice(-2);u.length==7&&(u="0"+u),u.length==8&&(u="20"+u);var d=("00"+(a>=0?a:0)).slice(-2)+":"+("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(f>=0?f:0)).slice(-2);return a==-1&&o==-1&&f==-1?u:n==-1&&i==-1&&s==-1?d:u+"T"+d}var Nh=(function(){var e={};e.version="1.2.0";function t(){for(var N=0,B=new Array(256),M=0;M!=256;++M)N=M,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,B[M]=N;return typeof Int32Array<"u"?new Int32Array(B):B}var r=t();function n(N){var B=0,M=0,L=0,W=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(L=0;L!=256;++L)W[L]=N[L];for(L=0;L!=256;++L)for(M=N[L],B=256+L;B<4096;B+=256)M=W[B]=M>>>8^N[M&255];var y=[];for(L=1;L!=16;++L)y[L-1]=typeof Int32Array<"u"?W.subarray(L*256,L*256+256):W.slice(L*256,L*256+256);return y}var i=n(r),s=i[0],a=i[1],o=i[2],f=i[3],u=i[4],d=i[5],h=i[6],m=i[7],l=i[8],v=i[9],g=i[10],x=i[11],T=i[12],b=i[13],_=i[14];function k(N,B){for(var M=B^-1,L=0,W=N.length;L<W;)M=M>>>8^r[(M^N.charCodeAt(L++))&255];return~M}function F(N,B){for(var M=B^-1,L=N.length-15,W=0;W<L;)M=_[N[W++]^M&255]^b[N[W++]^M>>8&255]^T[N[W++]^M>>16&255]^x[N[W++]^M>>>24]^g[N[W++]]^v[N[W++]]^l[N[W++]]^m[N[W++]]^h[N[W++]]^d[N[W++]]^u[N[W++]]^f[N[W++]]^o[N[W++]]^a[N[W++]]^s[N[W++]]^r[N[W++]];for(L+=15;W<L;)M=M>>>8^r[(M^N[W++])&255];return~M}function z(N,B){for(var M=B^-1,L=0,W=N.length,y=0,H=0;L<W;)y=N.charCodeAt(L++),y<128?M=M>>>8^r[(M^y)&255]:y<2048?(M=M>>>8^r[(M^(192|y>>6&31))&255],M=M>>>8^r[(M^(128|y&63))&255]):y>=55296&&y<57344?(y=(y&1023)+64,H=N.charCodeAt(L++)&1023,M=M>>>8^r[(M^(240|y>>8&7))&255],M=M>>>8^r[(M^(128|y>>2&63))&255],M=M>>>8^r[(M^(128|H>>6&15|(y&3)<<4))&255],M=M>>>8^r[(M^(128|H&63))&255]):(M=M>>>8^r[(M^(224|y>>12&15))&255],M=M>>>8^r[(M^(128|y>>6&63))&255],M=M>>>8^r[(M^(128|y&63))&255]);return~M}return e.table=r,e.bstr=k,e.buf=F,e.str=z,e})(),ht=(function(){var t={};t.version="1.2.1";function r(w,O){for(var E=w.split("/"),A=O.split("/"),D=0,I=0,Y=Math.min(E.length,A.length);D<Y;++D){if(I=E[D].length-A[D].length)return I;if(E[D]!=A[D])return E[D]<A[D]?-1:1}return E.length-A.length}function n(w){if(w.charAt(w.length-1)=="/")return w.slice(0,-1).indexOf("/")===-1?w:n(w.slice(0,-1));var O=w.lastIndexOf("/");return O===-1?w:w.slice(0,O+1)}function i(w){if(w.charAt(w.length-1)=="/")return i(w.slice(0,-1));var O=w.lastIndexOf("/");return O===-1?w:w.slice(O+1)}function s(w,O){typeof O=="string"&&(O=new Date(O));var E=O.getHours();E=E<<6|O.getMinutes(),E=E<<5|O.getSeconds()>>>1,w.write_shift(2,E);var A=O.getFullYear()-1980;A=A<<4|O.getMonth()+1,A=A<<5|O.getDate(),w.write_shift(2,A)}function a(w){var O=w.read_shift(2)&65535,E=w.read_shift(2)&65535,A=new Date,D=E&31;E>>>=5;var I=E&15;E>>>=4,A.setMilliseconds(0),A.setFullYear(E+1980),A.setMonth(I-1),A.setDate(D);var Y=O&31;O>>>=5;var ne=O&63;return O>>>=6,A.setHours(O),A.setMinutes(ne),A.setSeconds(Y<<1),A}function o(w){xr(w,0);for(var O={},E=0;w.l<=w.length-4;){var A=w.read_shift(2),D=w.read_shift(2),I=w.l+D,Y={};switch(A){case 21589:E=w.read_shift(1),E&1&&(Y.mtime=w.read_shift(4)),D>5&&(E&2&&(Y.atime=w.read_shift(4)),E&4&&(Y.ctime=w.read_shift(4))),Y.mtime&&(Y.mt=new Date(Y.mtime*1e3));break}w.l=I,O[A]=Y}return O}var f;function u(){return f||(f={})}function d(w,O){if(w[0]==80&&w[1]==75)return ir(w,O);if((w[0]|32)==109&&(w[1]|32)==105)return yt(w,O);if(w.length<512)throw new Error("CFB file size "+w.length+" < 512");var E=3,A=512,D=0,I=0,Y=0,ne=0,G=0,X=[],K=w.slice(0,512);xr(K,0);var ge=h(K);switch(E=ge[0],E){case 3:A=512;break;case 4:A=4096;break;case 0:if(ge[1]==0)return ir(w,O);default:throw new Error("Major Version: Expected 3 or 4 saw "+E)}A!==512&&(K=w.slice(0,A),xr(K,28));var ye=w.slice(0,A);m(K,E);var Ee=K.read_shift(4,"i");if(E===3&&Ee!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Ee);K.l+=4,Y=K.read_shift(4,"i"),K.l+=4,K.chk("00100000","Mini Stream Cutoff Size: "),ne=K.read_shift(4,"i"),D=K.read_shift(4,"i"),G=K.read_shift(4,"i"),I=K.read_shift(4,"i");for(var me=-1,Se=0;Se<109&&(me=K.read_shift(4,"i"),!(me<0));++Se)X[Se]=me;var Ne=l(w,A);x(G,I,Ne,A,X);var Ve=b(Ne,Y,X,A);Ve[Y].name="!Directory",D>0&&ne!==H&&(Ve[ne].name="!MiniFAT"),Ve[X[0]].name="!FAT",Ve.fat_addrs=X,Ve.ssz=A;var ze={},Ut=[],dn=[],hn=[];_(Y,Ve,Ne,Ut,D,ze,dn,ne),v(dn,hn,Ut),Ut.shift();var pn={FileIndex:dn,FullPaths:hn};return O&&O.raw&&(pn.raw={header:ye,sectors:Ne}),pn}function h(w){if(w[w.l]==80&&w[w.l+1]==75)return[0,0];w.chk(Q,"Header Signature: "),w.l+=16;var O=w.read_shift(2,"u");return[w.read_shift(2,"u"),O]}function m(w,O){var E=9;switch(w.l+=2,E=w.read_shift(2)){case 9:if(O!=3)throw new Error("Sector Shift: Expected 9 saw "+E);break;case 12:if(O!=4)throw new Error("Sector Shift: Expected 12 saw "+E);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+E)}w.chk("0600","Mini Sector Shift: "),w.chk("000000000000","Reserved: ")}function l(w,O){for(var E=Math.ceil(w.length/O)-1,A=[],D=1;D<E;++D)A[D-1]=w.slice(D*O,(D+1)*O);return A[E-1]=w.slice(E*O),A}function v(w,O,E){for(var A=0,D=0,I=0,Y=0,ne=0,G=E.length,X=[],K=[];A<G;++A)X[A]=K[A]=A,O[A]=E[A];for(;ne<K.length;++ne)A=K[ne],D=w[A].L,I=w[A].R,Y=w[A].C,X[A]===A&&(D!==-1&&X[D]!==D&&(X[A]=X[D]),I!==-1&&X[I]!==I&&(X[A]=X[I])),Y!==-1&&(X[Y]=A),D!==-1&&A!=X[A]&&(X[D]=X[A],K.lastIndexOf(D)<ne&&K.push(D)),I!==-1&&A!=X[A]&&(X[I]=X[A],K.lastIndexOf(I)<ne&&K.push(I));for(A=1;A<G;++A)X[A]===A&&(I!==-1&&X[I]!==I?X[A]=X[I]:D!==-1&&X[D]!==D&&(X[A]=X[D]));for(A=1;A<G;++A)if(w[A].type!==0){if(ne=A,ne!=X[ne])do ne=X[ne],O[A]=O[ne]+"/"+O[A];while(ne!==0&&X[ne]!==-1&&ne!=X[ne]);X[A]=-1}for(O[0]+="/",A=1;A<G;++A)w[A].type!==2&&(O[A]+="/")}function g(w,O,E){for(var A=w.start,D=w.size,I=[],Y=A;E&&D>0&&Y>=0;)I.push(O.slice(Y*y,Y*y+y)),D-=y,Y=mn(E,Y*4);return I.length===0?re(0):Jt(I).slice(0,w.size)}function x(w,O,E,A,D){var I=H;if(w===H){if(O!==0)throw new Error("DIFAT chain shorter than expected")}else if(w!==-1){var Y=E[w],ne=(A>>>2)-1;if(!Y)return;for(var G=0;G<ne&&(I=mn(Y,G*4))!==H;++G)D.push(I);x(mn(Y,A-4),O-1,E,A,D)}}function T(w,O,E,A,D){var I=[],Y=[];D||(D=[]);var ne=A-1,G=0,X=0;for(G=O;G>=0;){D[G]=!0,I[I.length]=G,Y.push(w[G]);var K=E[Math.floor(G*4/A)];if(X=G*4&ne,A<4+X)throw new Error("FAT boundary crossed: "+G+" 4 "+A);if(!w[K])break;G=mn(w[K],X)}return{nodes:I,data:fl([Y])}}function b(w,O,E,A){var D=w.length,I=[],Y=[],ne=[],G=[],X=A-1,K=0,ge=0,ye=0,Ee=0;for(K=0;K<D;++K)if(ne=[],ye=K+O,ye>=D&&(ye-=D),!Y[ye]){G=[];var me=[];for(ge=ye;ge>=0;){me[ge]=!0,Y[ge]=!0,ne[ne.length]=ge,G.push(w[ge]);var Se=E[Math.floor(ge*4/A)];if(Ee=ge*4&X,A<4+Ee)throw new Error("FAT boundary crossed: "+ge+" 4 "+A);if(!w[Se]||(ge=mn(w[Se],Ee),me[ge]))break}I[ye]={nodes:ne,data:fl([G])}}return I}function _(w,O,E,A,D,I,Y,ne){for(var G=0,X=A.length?2:0,K=O[w].data,ge=0,ye=0,Ee;ge<K.length;ge+=128){var me=K.slice(ge,ge+128);xr(me,64),ye=me.read_shift(2),Ee=Za(me,0,ye-X),A.push(Ee);var Se={name:Ee,type:me.read_shift(1),color:me.read_shift(1),L:me.read_shift(4,"i"),R:me.read_shift(4,"i"),C:me.read_shift(4,"i"),clsid:me.read_shift(16),state:me.read_shift(4,"i"),start:0,size:0},Ne=me.read_shift(2)+me.read_shift(2)+me.read_shift(2)+me.read_shift(2);Ne!==0&&(Se.ct=k(me,me.l-8));var Ve=me.read_shift(2)+me.read_shift(2)+me.read_shift(2)+me.read_shift(2);Ve!==0&&(Se.mt=k(me,me.l-8)),Se.start=me.read_shift(4,"i"),Se.size=me.read_shift(4,"i"),Se.size<0&&Se.start<0&&(Se.size=Se.type=0,Se.start=H,Se.name=""),Se.type===5?(G=Se.start,D>0&&G!==H&&(O[G].name="!StreamData")):Se.size>=4096?(Se.storage="fat",O[Se.start]===void 0&&(O[Se.start]=T(E,Se.start,O.fat_addrs,O.ssz)),O[Se.start].name=Se.name,Se.content=O[Se.start].data.slice(0,Se.size)):(Se.storage="minifat",Se.size<0?Se.size=0:G!==H&&Se.start!==H&&O[G]&&(Se.content=g(Se,O[G].data,(O[ne]||{}).data))),Se.content&&xr(Se.content,0),I[Ee]=Se,Y.push(Se)}}function k(w,O){return new Date((yr(w,O+4)/1e7*Math.pow(2,32)+yr(w,O)/1e7-11644473600)*1e3)}function F(w,O){return u(),d(f.readFileSync(w),O)}function z(w,O){var E=O&&O.type;switch(E||Ze&&Buffer.isBuffer(w)&&(E="buffer"),E||"base64"){case"file":return F(w,O);case"base64":return d(Nr(Kr(w)),O);case"binary":return d(Nr(w),O)}return d(w,O)}function N(w,O){var E=O||{},A=E.root||"Root Entry";if(w.FullPaths||(w.FullPaths=[]),w.FileIndex||(w.FileIndex=[]),w.FullPaths.length!==w.FileIndex.length)throw new Error("inconsistent CFB structure");w.FullPaths.length===0&&(w.FullPaths[0]=A+"/",w.FileIndex[0]={name:A,type:5}),E.CLSID&&(w.FileIndex[0].clsid=E.CLSID),B(w)}function B(w){var O="Sh33tJ5";if(!ht.find(w,"/"+O)){var E=re(4);E[0]=55,E[1]=E[3]=50,E[2]=54,w.FileIndex.push({name:O,type:2,content:E,size:4,L:69,R:69,C:69}),w.FullPaths.push(w.FullPaths[0]+O),M(w)}}function M(w,O){N(w);for(var E=!1,A=!1,D=w.FullPaths.length-1;D>=0;--D){var I=w.FileIndex[D];switch(I.type){case 0:A?E=!0:(w.FileIndex.pop(),w.FullPaths.pop());break;case 1:case 2:case 5:A=!0,isNaN(I.R*I.L*I.C)&&(E=!0),I.R>-1&&I.L>-1&&I.R==I.L&&(E=!0);break;default:E=!0;break}}if(!(!E&&!O)){var Y=new Date(1987,1,19),ne=0,G=Object.create?Object.create(null):{},X=[];for(D=0;D<w.FullPaths.length;++D)G[w.FullPaths[D]]=!0,w.FileIndex[D].type!==0&&X.push([w.FullPaths[D],w.FileIndex[D]]);for(D=0;D<X.length;++D){var K=n(X[D][0]);A=G[K],A||(X.push([K,{name:i(K).replace("/",""),type:1,clsid:ee,ct:Y,mt:Y,content:null}]),G[K]=!0)}for(X.sort(function(Ee,me){return r(Ee[0],me[0])}),w.FullPaths=[],w.FileIndex=[],D=0;D<X.length;++D)w.FullPaths[D]=X[D][0],w.FileIndex[D]=X[D][1];for(D=0;D<X.length;++D){var ge=w.FileIndex[D],ye=w.FullPaths[D];if(ge.name=i(ye).replace("/",""),ge.L=ge.R=ge.C=-(ge.color=1),ge.size=ge.content?ge.content.length:0,ge.start=0,ge.clsid=ge.clsid||ee,D===0)ge.C=X.length>1?1:-1,ge.size=0,ge.type=5;else if(ye.slice(-1)=="/"){for(ne=D+1;ne<X.length&&n(w.FullPaths[ne])!=ye;++ne);for(ge.C=ne>=X.length?-1:ne,ne=D+1;ne<X.length&&n(w.FullPaths[ne])!=n(ye);++ne);ge.R=ne>=X.length?-1:ne,ge.type=1}else n(w.FullPaths[D+1]||"")==n(ye)&&(ge.R=D+1),ge.type=2}}}function L(w,O){var E=O||{};if(E.fileType=="mad")return xt(w,E);switch(M(w),E.fileType){case"zip":return tr(w,E)}var A=(function(Ee){for(var me=0,Se=0,Ne=0;Ne<Ee.FileIndex.length;++Ne){var Ve=Ee.FileIndex[Ne];if(Ve.content){var ze=Ve.content.length;ze>0&&(ze<4096?me+=ze+63>>6:Se+=ze+511>>9)}}for(var Ut=Ee.FullPaths.length+3>>2,dn=me+7>>3,hn=me+127>>7,pn=dn+Se+Ut+hn,Vr=pn+127>>7,ni=Vr<=109?0:Math.ceil((Vr-109)/127);pn+Vr+ni+127>>7>Vr;)ni=++Vr<=109?0:Math.ceil((Vr-109)/127);var kr=[1,ni,Vr,hn,Ut,Se,me,0];return Ee.FileIndex[0].size=me<<6,kr[7]=(Ee.FileIndex[0].start=kr[0]+kr[1]+kr[2]+kr[3]+kr[4]+kr[5])+(kr[6]+7>>3),kr})(w),D=re(A[7]<<9),I=0,Y=0;{for(I=0;I<8;++I)D.write_shift(1,J[I]);for(I=0;I<8;++I)D.write_shift(2,0);for(D.write_shift(2,62),D.write_shift(2,3),D.write_shift(2,65534),D.write_shift(2,9),D.write_shift(2,6),I=0;I<3;++I)D.write_shift(2,0);for(D.write_shift(4,0),D.write_shift(4,A[2]),D.write_shift(4,A[0]+A[1]+A[2]+A[3]-1),D.write_shift(4,0),D.write_shift(4,4096),D.write_shift(4,A[3]?A[0]+A[1]+A[2]-1:H),D.write_shift(4,A[3]),D.write_shift(-4,A[1]?A[0]-1:H),D.write_shift(4,A[1]),I=0;I<109;++I)D.write_shift(-4,I<A[2]?A[1]+I:-1)}if(A[1])for(Y=0;Y<A[1];++Y){for(;I<236+Y*127;++I)D.write_shift(-4,I<A[2]?A[1]+I:-1);D.write_shift(-4,Y===A[1]-1?H:Y+1)}var ne=function(Ee){for(Y+=Ee;I<Y-1;++I)D.write_shift(-4,I+1);Ee&&(++I,D.write_shift(-4,H))};for(Y=I=0,Y+=A[1];I<Y;++I)D.write_shift(-4,_e.DIFSECT);for(Y+=A[2];I<Y;++I)D.write_shift(-4,_e.FATSECT);ne(A[3]),ne(A[4]);for(var G=0,X=0,K=w.FileIndex[0];G<w.FileIndex.length;++G)K=w.FileIndex[G],K.content&&(X=K.content.length,!(X<4096)&&(K.start=Y,ne(X+511>>9)));for(ne(A[6]+7>>3);D.l&511;)D.write_shift(-4,_e.ENDOFCHAIN);for(Y=I=0,G=0;G<w.FileIndex.length;++G)K=w.FileIndex[G],K.content&&(X=K.content.length,!(!X||X>=4096)&&(K.start=Y,ne(X+63>>6)));for(;D.l&511;)D.write_shift(-4,_e.ENDOFCHAIN);for(I=0;I<A[4]<<2;++I){var ge=w.FullPaths[I];if(!ge||ge.length===0){for(G=0;G<17;++G)D.write_shift(4,0);for(G=0;G<3;++G)D.write_shift(4,-1);for(G=0;G<12;++G)D.write_shift(4,0);continue}K=w.FileIndex[I],I===0&&(K.start=K.size?K.start-1:H);var ye=I===0&&E.root||K.name;if(X=2*(ye.length+1),D.write_shift(64,ye,"utf16le"),D.write_shift(2,X),D.write_shift(1,K.type),D.write_shift(1,K.color),D.write_shift(-4,K.L),D.write_shift(-4,K.R),D.write_shift(-4,K.C),K.clsid)D.write_shift(16,K.clsid,"hex");else for(G=0;G<4;++G)D.write_shift(4,0);D.write_shift(4,K.state||0),D.write_shift(4,0),D.write_shift(4,0),D.write_shift(4,0),D.write_shift(4,0),D.write_shift(4,K.start),D.write_shift(4,K.size),D.write_shift(4,0)}for(I=1;I<w.FileIndex.length;++I)if(K=w.FileIndex[I],K.size>=4096)if(D.l=K.start+1<<9,Ze&&Buffer.isBuffer(K.content))K.content.copy(D,D.l,0,K.size),D.l+=K.size+511&-512;else{for(G=0;G<K.size;++G)D.write_shift(1,K.content[G]);for(;G&511;++G)D.write_shift(1,0)}for(I=1;I<w.FileIndex.length;++I)if(K=w.FileIndex[I],K.size>0&&K.size<4096)if(Ze&&Buffer.isBuffer(K.content))K.content.copy(D,D.l,0,K.size),D.l+=K.size+63&-64;else{for(G=0;G<K.size;++G)D.write_shift(1,K.content[G]);for(;G&63;++G)D.write_shift(1,0)}if(Ze)D.l=D.length;else for(;D.l<D.length;)D.write_shift(1,0);return D}function W(w,O){var E=w.FullPaths.map(function(G){return G.toUpperCase()}),A=E.map(function(G){var X=G.split("/");return X[X.length-(G.slice(-1)=="/"?2:1)]}),D=!1;O.charCodeAt(0)===47?(D=!0,O=E[0].slice(0,-1)+O):D=O.indexOf("/")!==-1;var I=O.toUpperCase(),Y=D===!0?E.indexOf(I):A.indexOf(I);if(Y!==-1)return w.FileIndex[Y];var ne=!I.match($i);for(I=I.replace(ui,""),ne&&(I=I.replace($i,"!")),Y=0;Y<E.length;++Y)if((ne?E[Y].replace($i,"!"):E[Y]).replace(ui,"")==I||(ne?A[Y].replace($i,"!"):A[Y]).replace(ui,"")==I)return w.FileIndex[Y];return null}var y=64,H=-2,Q="d0cf11e0a1b11ae1",J=[208,207,17,224,161,177,26,225],ee="00000000000000000000000000000000",_e={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:H,FREESECT:-1,HEADER_SIGNATURE:Q,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:ee,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Ae(w,O,E){u();var A=L(w,E);f.writeFileSync(O,A)}function De(w){for(var O=new Array(w.length),E=0;E<w.length;++E)O[E]=String.fromCharCode(w[E]);return O.join("")}function oe(w,O){var E=L(w,O);switch(O&&O.type||"buffer"){case"file":return u(),f.writeFileSync(O.filename,E),E;case"binary":return typeof E=="string"?E:De(E);case"base64":return yi(typeof E=="string"?E:De(E));case"buffer":if(Ze)return Buffer.isBuffer(E)?E:Zr(E);case"array":return typeof E=="string"?Nr(E):E}return E}var ce;function C(w){try{var O=w.InflateRaw,E=new O;if(E._processChunk(new Uint8Array([3,0]),E._finishFlushFlag),E.bytesRead)ce=w;else throw new Error("zlib does not expose bytesRead")}catch(A){console.error("cannot use native zlib: "+(A.message||A))}}function j(w,O){if(!ce)return pr(w,O);var E=ce.InflateRaw,A=new E,D=A._processChunk(w.slice(w.l),A._finishFlushFlag);return w.l+=A.bytesRead,D}function R(w){return ce?ce.deflateRawSync(w):qe(w)}var P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],V=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],le=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function fe(w){var O=(w<<1|w<<11)&139536|(w<<5|w<<15)&558144;return(O>>16|O>>8|O)&255}for(var ue=typeof Uint8Array<"u",te=ue?new Uint8Array(256):[],Ie=0;Ie<256;++Ie)te[Ie]=fe(Ie);function ae(w,O){var E=te[w&255];return O<=8?E>>>8-O:(E=E<<8|te[w>>8&255],O<=16?E>>>16-O:(E=E<<8|te[w>>16&255],E>>>24-O))}function Pe(w,O){var E=O&7,A=O>>>3;return(w[A]|(E<=6?0:w[A+1]<<8))>>>E&3}function ke(w,O){var E=O&7,A=O>>>3;return(w[A]|(E<=5?0:w[A+1]<<8))>>>E&7}function pt(w,O){var E=O&7,A=O>>>3;return(w[A]|(E<=4?0:w[A+1]<<8))>>>E&15}function He(w,O){var E=O&7,A=O>>>3;return(w[A]|(E<=3?0:w[A+1]<<8))>>>E&31}function we(w,O){var E=O&7,A=O>>>3;return(w[A]|(E<=1?0:w[A+1]<<8))>>>E&127}function ut(w,O,E){var A=O&7,D=O>>>3,I=(1<<E)-1,Y=w[D]>>>A;return E<8-A||(Y|=w[D+1]<<8-A,E<16-A)||(Y|=w[D+2]<<16-A,E<24-A)||(Y|=w[D+3]<<24-A),Y&I}function je(w,O,E){var A=O&7,D=O>>>3;return A<=5?w[D]|=(E&7)<<A:(w[D]|=E<<A&255,w[D+1]=(E&7)>>8-A),O+3}function Rt(w,O,E){var A=O&7,D=O>>>3;return E=(E&1)<<A,w[D]|=E,O+1}function vt(w,O,E){var A=O&7,D=O>>>3;return E<<=A,w[D]|=E&255,E>>>=8,w[D+1]=E,O+8}function rt(w,O,E){var A=O&7,D=O>>>3;return E<<=A,w[D]|=E&255,E>>>=8,w[D+1]=E&255,w[D+2]=E>>>8,O+16}function kt(w,O){var E=w.length,A=2*E>O?2*E:O+5,D=0;if(E>=O)return w;if(Ze){var I=qo(A);if(w.copy)w.copy(I);else for(;D<w.length;++D)I[D]=w[D];return I}else if(ue){var Y=new Uint8Array(A);if(Y.set)Y.set(w);else for(;D<E;++D)Y[D]=w[D];return Y}return w.length=A,w}function Xe(w){for(var O=new Array(w),E=0;E<w;++E)O[E]=0;return O}function Ht(w,O,E){var A=1,D=0,I=0,Y=0,ne=0,G=w.length,X=ue?new Uint16Array(32):Xe(32);for(I=0;I<32;++I)X[I]=0;for(I=G;I<E;++I)w[I]=0;G=w.length;var K=ue?new Uint16Array(G):Xe(G);for(I=0;I<G;++I)X[D=w[I]]++,A<D&&(A=D),K[I]=0;for(X[0]=0,I=1;I<=A;++I)X[I+16]=ne=ne+X[I-1]<<1;for(I=0;I<G;++I)ne=w[I],ne!=0&&(K[I]=X[ne+16]++);var ge=0;for(I=0;I<G;++I)if(ge=w[I],ge!=0)for(ne=ae(K[I],A)>>A-ge,Y=(1<<A+4-ge)-1;Y>=0;--Y)O[ne|Y<<ge]=ge&15|I<<4;return A}var It=ue?new Uint16Array(512):Xe(512),Gt=ue?new Uint16Array(32):Xe(32);if(!ue){for(var Lt=0;Lt<512;++Lt)It[Lt]=0;for(Lt=0;Lt<32;++Lt)Gt[Lt]=0}(function(){for(var w=[],O=0;O<32;O++)w.push(5);Ht(w,Gt,32);var E=[];for(O=0;O<=143;O++)E.push(8);for(;O<=255;O++)E.push(9);for(;O<=279;O++)E.push(7);for(;O<=287;O++)E.push(8);Ht(E,It,288)})();var Bt=(function(){for(var O=ue?new Uint8Array(32768):[],E=0,A=0;E<le.length-1;++E)for(;A<le[E+1];++A)O[A]=E;for(;A<32768;++A)O[A]=29;var D=ue?new Uint8Array(259):[];for(E=0,A=0;E<V.length-1;++E)for(;A<V[E+1];++A)D[A]=E;function I(ne,G){for(var X=0;X<ne.length;){var K=Math.min(65535,ne.length-X),ge=X+K==ne.length;for(G.write_shift(1,+ge),G.write_shift(2,K),G.write_shift(2,~K&65535);K-- >0;)G[G.l++]=ne[X++]}return G.l}function Y(ne,G){for(var X=0,K=0,ge=ue?new Uint16Array(32768):[];K<ne.length;){var ye=Math.min(65535,ne.length-K);if(ye<10){for(X=je(G,X,+(K+ye==ne.length)),X&7&&(X+=8-(X&7)),G.l=X/8|0,G.write_shift(2,ye),G.write_shift(2,~ye&65535);ye-- >0;)G[G.l++]=ne[K++];X=G.l*8;continue}X=je(G,X,+(K+ye==ne.length)+2);for(var Ee=0;ye-- >0;){var me=ne[K];Ee=(Ee<<5^me)&32767;var Se=-1,Ne=0;if((Se=ge[Ee])&&(Se|=K&-32768,Se>K&&(Se-=32768),Se<K))for(;ne[Se+Ne]==ne[K+Ne]&&Ne<250;)++Ne;if(Ne>2){me=D[Ne],me<=22?X=vt(G,X,te[me+1]>>1)-1:(vt(G,X,3),X+=5,vt(G,X,te[me-23]>>5),X+=3);var Ve=me<8?0:me-4>>2;Ve>0&&(rt(G,X,Ne-V[me]),X+=Ve),me=O[K-Se],X=vt(G,X,te[me]>>3),X-=3;var ze=me<4?0:me-2>>1;ze>0&&(rt(G,X,K-Se-le[me]),X+=ze);for(var Ut=0;Ut<Ne;++Ut)ge[Ee]=K&32767,Ee=(Ee<<5^ne[K])&32767,++K;ye-=Ne-1}else me<=143?me=me+48:X=Rt(G,X,1),X=vt(G,X,te[me]),ge[Ee]=K&32767,++K}X=vt(G,X,0)-1}return G.l=(X+7)/8|0,G.l}return function(G,X){return G.length<8?I(G,X):Y(G,X)}})();function qe(w){var O=re(50+Math.floor(w.length*1.1)),E=Bt(w,O);return O.slice(0,E)}var Je=ue?new Uint16Array(32768):Xe(32768),gt=ue?new Uint16Array(32768):Xe(32768),Ft=ue?new Uint16Array(128):Xe(128),bt=1,cr=1;function Yt(w,O){var E=He(w,O)+257;O+=5;var A=He(w,O)+1;O+=5;var D=pt(w,O)+4;O+=4;for(var I=0,Y=ue?new Uint8Array(19):Xe(19),ne=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],G=1,X=ue?new Uint8Array(8):Xe(8),K=ue?new Uint8Array(8):Xe(8),ge=Y.length,ye=0;ye<D;++ye)Y[P[ye]]=I=ke(w,O),G<I&&(G=I),X[I]++,O+=3;var Ee=0;for(X[0]=0,ye=1;ye<=G;++ye)K[ye]=Ee=Ee+X[ye-1]<<1;for(ye=0;ye<ge;++ye)(Ee=Y[ye])!=0&&(ne[ye]=K[Ee]++);var me=0;for(ye=0;ye<ge;++ye)if(me=Y[ye],me!=0){Ee=te[ne[ye]]>>8-me;for(var Se=(1<<7-me)-1;Se>=0;--Se)Ft[Ee|Se<<me]=me&7|ye<<3}var Ne=[];for(G=1;Ne.length<E+A;)switch(Ee=Ft[we(w,O)],O+=Ee&7,Ee>>>=3){case 16:for(I=3+Pe(w,O),O+=2,Ee=Ne[Ne.length-1];I-- >0;)Ne.push(Ee);break;case 17:for(I=3+ke(w,O),O+=3;I-- >0;)Ne.push(0);break;case 18:for(I=11+we(w,O),O+=7;I-- >0;)Ne.push(0);break;default:Ne.push(Ee),G<Ee&&(G=Ee);break}var Ve=Ne.slice(0,E),ze=Ne.slice(E);for(ye=E;ye<286;++ye)Ve[ye]=0;for(ye=A;ye<30;++ye)ze[ye]=0;return bt=Ht(Ve,Je,286),cr=Ht(ze,gt,30),O}function Qe(w,O){if(w[0]==3&&!(w[1]&3))return[yn(O),2];for(var E=0,A=0,D=qo(O||1<<18),I=0,Y=D.length>>>0,ne=0,G=0;(A&1)==0;){if(A=ke(w,E),E+=3,A>>>1)A>>1==1?(ne=9,G=5):(E=Yt(w,E),ne=bt,G=cr);else{E&7&&(E+=8-(E&7));var X=w[E>>>3]|w[(E>>>3)+1]<<8;if(E+=32,X>0)for(!O&&Y<I+X&&(D=kt(D,I+X),Y=D.length);X-- >0;)D[I++]=w[E>>>3],E+=8;continue}for(;;){!O&&Y<I+32767&&(D=kt(D,I+32767),Y=D.length);var K=ut(w,E,ne),ge=A>>>1==1?It[K]:Je[K];if(E+=ge&15,ge>>>=4,(ge>>>8&255)===0)D[I++]=ge;else{if(ge==256)break;ge-=257;var ye=ge<8?0:ge-4>>2;ye>5&&(ye=0);var Ee=I+V[ge];ye>0&&(Ee+=ut(w,E,ye),E+=ye),K=ut(w,E,G),ge=A>>>1==1?Gt[K]:gt[K],E+=ge&15,ge>>>=4;var me=ge<4?0:ge-2>>1,Se=le[ge];for(me>0&&(Se+=ut(w,E,me),E+=me),!O&&Y<Ee&&(D=kt(D,Ee+100),Y=D.length);I<Ee;)D[I]=D[I-Se],++I}}}return O?[D,E+7>>>3]:[D.slice(0,I),E+7>>>3]}function pr(w,O){var E=w.slice(w.l||0),A=Qe(E,O);return w.l+=A[1],A[0]}function Xt(w,O){if(w)typeof console<"u"&&console.error(O);else throw new Error(O)}function ir(w,O){var E=w;xr(E,0);var A=[],D=[],I={FileIndex:A,FullPaths:D};N(I,{root:O.root});for(var Y=E.length-4;(E[Y]!=80||E[Y+1]!=75||E[Y+2]!=5||E[Y+3]!=6)&&Y>=0;)--Y;E.l=Y+4,E.l+=4;var ne=E.read_shift(2);E.l+=6;var G=E.read_shift(4);for(E.l=G,Y=0;Y<ne;++Y){E.l+=20;var X=E.read_shift(4),K=E.read_shift(4),ge=E.read_shift(2),ye=E.read_shift(2),Ee=E.read_shift(2);E.l+=8;var me=E.read_shift(4),Se=o(E.slice(E.l+ge,E.l+ge+ye));E.l+=ge+ye+Ee;var Ne=E.l;E.l=me+4,pe(E,X,K,I,Se),E.l=Ne}return I}function pe(w,O,E,A,D){w.l+=2;var I=w.read_shift(2),Y=w.read_shift(2),ne=a(w);if(I&8257)throw new Error("Unsupported ZIP encryption");for(var G=w.read_shift(4),X=w.read_shift(4),K=w.read_shift(4),ge=w.read_shift(2),ye=w.read_shift(2),Ee="",me=0;me<ge;++me)Ee+=String.fromCharCode(w[w.l++]);if(ye){var Se=o(w.slice(w.l,w.l+ye));(Se[21589]||{}).mt&&(ne=Se[21589].mt),((D||{})[21589]||{}).mt&&(ne=D[21589].mt)}w.l+=ye;var Ne=w.slice(w.l,w.l+X);switch(Y){case 8:Ne=j(w,K);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+Y)}var Ve=!1;I&8&&(G=w.read_shift(4),G==134695760&&(G=w.read_shift(4),Ve=!0),X=w.read_shift(4),K=w.read_shift(4)),X!=O&&Xt(Ve,"Bad compressed size: "+O+" != "+X),K!=E&&Xt(Ve,"Bad uncompressed size: "+E+" != "+K),Te(A,Ee,Ne,{unsafe:!0,mt:ne})}function tr(w,O){var E=O||{},A=[],D=[],I=re(1),Y=E.compression?8:0,ne=0,G=0,X=0,K=0,ge=0,ye=w.FullPaths[0],Ee=ye,me=w.FileIndex[0],Se=[],Ne=0;for(G=1;G<w.FullPaths.length;++G)if(Ee=w.FullPaths[G].slice(ye.length),me=w.FileIndex[G],!(!me.size||!me.content||Ee=="Sh33tJ5")){var Ve=K,ze=re(Ee.length);for(X=0;X<Ee.length;++X)ze.write_shift(1,Ee.charCodeAt(X)&127);ze=ze.slice(0,ze.l),Se[ge]=Nh.buf(me.content,0);var Ut=me.content;Y==8&&(Ut=R(Ut)),I=re(30),I.write_shift(4,67324752),I.write_shift(2,20),I.write_shift(2,ne),I.write_shift(2,Y),me.mt?s(I,me.mt):I.write_shift(4,0),I.write_shift(-4,Se[ge]),I.write_shift(4,Ut.length),I.write_shift(4,me.content.length),I.write_shift(2,ze.length),I.write_shift(2,0),K+=I.length,A.push(I),K+=ze.length,A.push(ze),K+=Ut.length,A.push(Ut),I=re(46),I.write_shift(4,33639248),I.write_shift(2,0),I.write_shift(2,20),I.write_shift(2,ne),I.write_shift(2,Y),I.write_shift(4,0),I.write_shift(-4,Se[ge]),I.write_shift(4,Ut.length),I.write_shift(4,me.content.length),I.write_shift(2,ze.length),I.write_shift(2,0),I.write_shift(2,0),I.write_shift(2,0),I.write_shift(2,0),I.write_shift(4,0),I.write_shift(4,Ve),Ne+=I.l,D.push(I),Ne+=ze.length,D.push(ze),++ge}return I=re(22),I.write_shift(4,101010256),I.write_shift(2,0),I.write_shift(2,0),I.write_shift(2,ge),I.write_shift(2,ge),I.write_shift(4,Ne),I.write_shift(4,K),I.write_shift(2,0),Jt([Jt(A),Jt(D),I])}var Ge={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function Oe(w,O){if(w.ctype)return w.ctype;var E=w.name||"",A=E.match(/\.([^\.]+)$/);return A&&Ge[A[1]]||O&&(A=(E=O).match(/[\.\\]([^\.\\])+$/),A&&Ge[A[1]])?Ge[A[1]]:"application/octet-stream"}function nt(w){for(var O=yi(w),E=[],A=0;A<O.length;A+=76)E.push(O.slice(A,A+76));return E.join(`\r
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),w=require("react"),vs=require("react-dom"),h=require("@mui/material");function B0(e){return e==null?"null":Array.isArray(e)?"array":typeof e=="object"?"object":typeof e=="number"?"number":typeof e=="boolean"?"boolean":typeof e=="string"?"string":"mixed"}function sa(e){if(!Array.isArray(e)||e.length===0)return[];const t=new Set;e.forEach(n=>{typeof n=="object"&&n!==null&&Object.keys(n).forEach(i=>t.add(i))});const r=[];return t.forEach(n=>{const i=new Set;let s=0;e.forEach(f=>{typeof f=="object"&&f!==null&&n in f&&(s++,i.add(B0(f[n])))});const a=s===e.length,c=i.size>1&&!i.has("null");let u="mixed";if(i.size===1)u=Array.from(i)[0];else if(i.size===2&&i.has("null")){const f=Array.from(i).filter(d=>d!=="null");f.length===1&&(u=f[0])}r.push({name:n,type:u,required:a,hasConflict:c})}),r.sort((n,i)=>n.name.localeCompare(i.name))}function U0(e){return e.some(t=>t.hasConflict)}function aa(e){return e==null}function W0(e){return(t,r,n)=>{const i=aa(t),s=aa(r);if(i&&s)return 0;if(i)return 1;if(s)return-1;let a=0;switch(e){case"number":const c=Number(t),u=Number(r);a=c-u;break;case"boolean":a=(t?1:0)-(r?1:0);break;case"string":a=String(t).localeCompare(String(r));break;case"array":case"object":a=JSON.stringify(t).localeCompare(JSON.stringify(r));break;case"mixed":case"null":default:a=String(t).localeCompare(String(r));break}return n==="asc"?a:-a}}function V0(e,t,r){if(!r||r.length===0)return e;const n=[...r].sort((i,s)=>i.priority-s.priority);return[...e].sort((i,s)=>{for(const a of n){const c=t.find(d=>d.name===a.column);if(!c)continue;const f=W0(c.type)(i[a.column],s[a.column],a.direction);if(f!==0)return f}return 0})}function z0(e){return e===null?"asc":e==="asc"?"desc":null}function H0(e){return e==="string"||e==="boolean"}function $0(e){return e.filter(t=>H0(t.type))}function G0(e,t){const r={};return t.forEach(n=>{if(n.type==="number"){const i=e.map(s=>s[n.name]).filter(s=>typeof s=="number");i.length>0&&(r[n.name]=i.reduce((s,a)=>s+a,0))}}),r}function X0(e,t,r){if(!r.enabled||r.levels.length===0)return e;const n=Fo(e,r.levels,t);return Io(n,r.collapsedGroups||[])}function Fo(e,t,r,n="",i=0){if(i>=t.length)return e;const s=t[i].column,a=new Map;e.forEach(f=>{const d=f[s],p=d==null?"(empty)":String(d);a.has(p)||a.set(p,[]),a.get(p).push(f)});const c=[];return Array.from(a.keys()).sort().forEach(f=>{const d=a.get(f),p=`${s}:${f}`,x=n?`${n}|${p}`:p,l=G0(d,r),y=i<t.length-1?Fo(d,t,r,x,i+1):d,g={key:x,level:i,column:s,value:f,rowCount:d.length,aggregates:l,children:y};c.push(g)}),c}function Io(e,t,r=[]){for(const n of e)if("key"in n&&"level"in n&&"children"in n){const i=t.includes(n.key);r.push({isGroupHeader:!0,groupKey:n.key,groupLevel:n.level,groupColumn:n.column,groupValue:n.value,rowCount:n.rowCount,aggregates:n.aggregates,isCollapsed:i}),!i&&n.children&&Io(n.children,t,r)}else r.push(n);return r}function Y0(e,t){const r=e.collapsedGroups||[],n=r.includes(t)?r.filter(i=>i!==t):[...r,t];return{...e,collapsedGroups:n}}function K0(e,t){return e==null?"":typeof e=="number"?`Σ ${e.toLocaleString()}`:String(e)}function q0(e,t,r){return`${t}: ${r}`}function fn(e,t){if(!t||!t.enabled||!t.levels||t.levels.length===0)return[...e];const r=t.levels.map(i=>i.column),n=e.filter(i=>!r.includes(i));return[...r,...n]}function No(e,t,r){if(!t||!t.enabled||!t.levels||t.levels.length===0)return[...e];const n=t.levels.map(s=>s.column),i=e.filter(s=>!n.includes(s));if(r){const s=[],a=new Set(n),c=new Set(i);let u=0;for(const f of r)a.has(f)?s.push(f):c.has(f)&&u<i.length?(s.push(i[u]),u++):c.has(f)||s.push(f);for(let f=u;f<i.length;f++)s.includes(i[f])||s.push(i[f]);return s}return[...e]}function oa(e){const t={},r=[],n={};return e.forEach(i=>{t[i.name]=!0,r.push(i.name),n[i.name]=150}),{id:"default-view",name:"Default View",description:"Unfiltered, unsorted baseline view",isDefault:!0,snapshot:{filters:[],sortStack:[],columnVisibility:t,columnOrder:r,columnWidths:n,grouping:null}}}function J0(e,t,r,n,i,s,a,c){const u={},f=[],d={};r.forEach(l=>{u[l.name]=!0,f.push(l.name),d[l.name]=150});const x=No(i||f,a||null,c||f);return{filters:e||[],sortStack:t||[],columnVisibility:n||u,columnOrder:x,columnWidths:s||d,grouping:a||null}}function Z0(e,t){return JSON.stringify(e.filters)!==JSON.stringify(t.filters)||JSON.stringify(e.sortStack)!==JSON.stringify(t.sortStack)||JSON.stringify(e.columnVisibility)!==JSON.stringify(t.columnVisibility)||JSON.stringify(e.columnOrder)!==JSON.stringify(t.columnOrder)||JSON.stringify(e.columnWidths)!==JSON.stringify(t.columnWidths)||JSON.stringify(e.grouping)!==JSON.stringify(t.grouping)}function Q0(e){return!e||e.length===0?"None":e.sort((t,r)=>t.priority-r.priority).map(t=>`${t.column} ${t.direction==="asc"?"↑":"↓"}`).join(", ")}function ef(e,t){var g,m,E;const r=[],n=JSON.stringify(e.filters),i=JSON.stringify(t.filters);if(n!==i){const D=e.filters.length,C=t.filters.length;D>C?r.push({category:"filters",label:"Filters Added",description:`${D-C} new filter${D-C>1?"s":""} added`}):D<C?r.push({category:"filters",label:"Filters Removed",description:`${C-D} filter${C-D>1?"s":""} removed`}):r.push({category:"filters",label:"Filters Modified",description:"Filter conditions have been changed"})}const s=JSON.stringify(e.sortStack),a=JSON.stringify(t.sortStack);if(s!==a){const D=e.sortStack.length,C=t.sortStack.length;D>C?r.push({category:"sorting",label:"Sorting Added",description:`${D-C} new sort rule${D-C>1?"s":""} added`}):D<C?r.push({category:"sorting",label:"Sorting Removed",description:`${C-D} sort rule${C-D>1?"s":""} removed`}):r.push({category:"sorting",label:"Sorting Modified",description:"Sort rules or order have been changed"})}const c=JSON.stringify(e.columnVisibility),u=JSON.stringify(t.columnVisibility);if(c!==u){const D=Object.values(e.columnVisibility).filter(N=>N).length,C=Object.values(t.columnVisibility).filter(N=>N).length;D>C?r.push({category:"visibility",label:"Columns Shown",description:`${D-C} column${D-C>1?"s":""} made visible`}):D<C?r.push({category:"visibility",label:"Columns Hidden",description:`${C-D} column${C-D>1?"s":""} hidden`}):r.push({category:"visibility",label:"Column Visibility Changed",description:"Column visibility settings have been modified"})}const f=JSON.stringify(e.columnOrder),d=JSON.stringify(t.columnOrder);f!==d&&r.push({category:"order",label:"Column Order Changed",description:"Columns have been reordered"});const p=JSON.stringify(e.columnWidths),x=JSON.stringify(t.columnWidths);if(p!==x){const D=Object.keys(e.columnWidths).filter(C=>e.columnWidths[C]!==t.columnWidths[C]).length;r.push({category:"widths",label:"Column Widths Adjusted",description:`${D} column width${D>1?"s":""} modified`})}const l=JSON.stringify(e.grouping),y=JSON.stringify(t.grouping);if(l!==y){const D=(g=e.grouping)==null?void 0:g.enabled,C=(m=t.grouping)==null?void 0:m.enabled;if(D&&!C){const N=((E=e.grouping)==null?void 0:E.levels.length)||0;r.push({category:"grouping",label:"Grouping Applied",description:`${N} grouping level${N>1?"s":""} added`})}else!D&&C?r.push({category:"grouping",label:"Grouping Removed",description:"All grouping has been cleared"}):r.push({category:"grouping",label:"Grouping Modified",description:"Grouping configuration has been changed"})}return r}const Ro="urm_report_";function tf(e,t){try{const r=`${Ro}${e}`;localStorage.setItem(r,JSON.stringify(t))}catch(r){console.error("Failed to save report state:",r)}}function rf(e){try{const t=`${Ro}${e}`,r=localStorage.getItem(t);return r?JSON.parse(r):null}catch(t){return console.error("Failed to load report state:",t),null}}/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var fi={};fi.version="0.18.5";var Po=1252,nf=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],jo=function(e){nf.indexOf(e)!=-1&&(Po=e)};function sf(){jo(1252)}var Pn=function(e){jo(e)};function af(){Pn(1200),sf()}var Jn=function(t){return String.fromCharCode(t)},la=function(t){return String.fromCharCode(t)},ui,Pr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function jn(e){for(var t="",r=0,n=0,i=0,s=0,a=0,c=0,u=0,f=0;f<e.length;)r=e.charCodeAt(f++),s=r>>2,n=e.charCodeAt(f++),a=(r&3)<<4|n>>4,i=e.charCodeAt(f++),c=(n&15)<<2|i>>6,u=i&63,isNaN(n)?c=u=64:isNaN(i)&&(u=64),t+=Pr.charAt(s)+Pr.charAt(a)+Pr.charAt(c)+Pr.charAt(u);return t}function kr(e){var t="",r=0,n=0,i=0,s=0,a=0,c=0,u=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var f=0;f<e.length;)s=Pr.indexOf(e.charAt(f++)),a=Pr.indexOf(e.charAt(f++)),r=s<<2|a>>4,t+=String.fromCharCode(r),c=Pr.indexOf(e.charAt(f++)),n=(a&15)<<4|c>>2,c!==64&&(t+=String.fromCharCode(n)),u=Pr.indexOf(e.charAt(f++)),i=(c&3)<<6|u,u!==64&&(t+=String.fromCharCode(i));return t}var $e=(function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node})(),Ir=(function(){if(typeof Buffer<"u"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch{e=!0}return e?function(t,r){return r?new Buffer(t,r):new Buffer(t)}:Buffer.from.bind(Buffer)}return function(){}})();function Gr(e){return $e?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function ca(e){return $e?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}var dr=function(t){return $e?Ir(t,"binary"):t.split("").map(function(r){return r.charCodeAt(0)&255})};function bi(e){if(typeof ArrayBuffer>"u")return dr(e);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n!=e.length;++n)r[n]=e.charCodeAt(n)&255;return t}function zn(e){if(Array.isArray(e))return e.map(function(n){return String.fromCharCode(n)}).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function of(e){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(e)}var Ot=$e?function(e){return Buffer.concat(e.map(function(t){return Buffer.isBuffer(t)?t:Ir(t)}))}:function(e){if(typeof Uint8Array<"u"){var t=0,r=0;for(t=0;t<e.length;++t)r+=e[t].length;var n=new Uint8Array(r),i=0;for(t=0,r=0;t<e.length;r+=i,++t)if(i=e[t].length,e[t]instanceof Uint8Array)n.set(e[t],r);else{if(typeof e[t]=="string")throw"wtf";n.set(new Uint8Array(e[t]),r)}return n}return[].concat.apply([],e.map(function(s){return Array.isArray(s)?s:[].slice.call(s)}))};function lf(e){for(var t=[],r=0,n=e.length+250,i=Gr(e.length+255),s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a<128)i[r++]=a;else if(a<2048)i[r++]=192|a>>6&31,i[r++]=128|a&63;else if(a>=55296&&a<57344){a=(a&1023)+64;var c=e.charCodeAt(++s)&1023;i[r++]=240|a>>8&7,i[r++]=128|a>>2&63,i[r++]=128|c>>6&15|(a&3)<<4,i[r++]=128|c&63}else i[r++]=224|a>>12&15,i[r++]=128|a>>6&63,i[r++]=128|a&63;r>n&&(t.push(i.slice(0,r)),r=0,i=Gr(65535),n=65530)}return t.push(i.slice(0,r)),Ot(t)}var An=/\u0000/g,Zn=/[\u0001-\u0006]/g;function dn(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function pr(e,t){var r=""+e;return r.length>=t?r:ft("0",t-r.length)+r}function ys(e,t){var r=""+e;return r.length>=t?r:ft(" ",t-r.length)+r}function hi(e,t){var r=""+e;return r.length>=t?r:r+ft(" ",t-r.length)}function cf(e,t){var r=""+Math.round(e);return r.length>=t?r:ft("0",t-r.length)+r}function ff(e,t){var r=""+e;return r.length>=t?r:ft("0",t-r.length)+r}var fa=Math.pow(2,32);function sn(e,t){if(e>fa||e<-fa)return cf(e,t);var r=Math.round(e);return ff(r,t)}function di(e,t){return t=t||0,e.length>=7+t&&(e.charCodeAt(t)|32)===103&&(e.charCodeAt(t+1)|32)===101&&(e.charCodeAt(t+2)|32)===110&&(e.charCodeAt(t+3)|32)===101&&(e.charCodeAt(t+4)|32)===114&&(e.charCodeAt(t+5)|32)===97&&(e.charCodeAt(t+6)|32)===108}var ua=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],Hi=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function uf(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var ut={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},ha={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},hf={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function pi(e,t,r){for(var n=e<0?-1:1,i=e*n,s=0,a=1,c=0,u=1,f=0,d=0,p=Math.floor(i);f<t&&(p=Math.floor(i),c=p*a+s,d=p*f+u,!(i-p<5e-8));)i=1/(i-p),s=a,a=c,u=f,f=d;if(d>t&&(f>t?(d=u,c=s):(d=f,c=a)),!r)return[0,n*c,d];var x=Math.floor(n*c/d);return[x,n*c-x*d,d]}function Qn(e,t,r){if(e>2958465||e<0)return null;var n=e|0,i=Math.floor(86400*(e-n)),s=0,a=[],c={D:n,T:i,u:86400*(e-n)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(c.u)<1e-6&&(c.u=0),t&&t.date1904&&(n+=1462),c.u>.9999&&(c.u=0,++i==86400&&(c.T=i=0,++n,++c.D)),n===60)a=r?[1317,10,29]:[1900,2,29],s=3;else if(n===0)a=r?[1317,8,29]:[1900,1,0],s=6;else{n>60&&--n;var u=new Date(1900,0,1);u.setDate(u.getDate()+n-1),a=[u.getFullYear(),u.getMonth()+1,u.getDate()],s=u.getDay(),n<60&&(s=(s+6)%7),r&&(s=yf(u,a))}return c.y=a[0],c.m=a[1],c.d=a[2],c.S=i%60,i=Math.floor(i/60),c.M=i%60,i=Math.floor(i/60),c.H=i,c.q=s,c}var Mo=new Date(1899,11,31,0,0,0),df=Mo.getTime(),pf=new Date(1900,2,1,0,0,0);function Lo(e,t){var r=e.getTime();return t?r-=1461*24*60*60*1e3:e>=pf&&(r+=1440*60*1e3),(r-(df+(e.getTimezoneOffset()-Mo.getTimezoneOffset())*6e4))/(1440*60*1e3)}function ws(e){return e.indexOf(".")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function xf(e){return e.indexOf("E")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function gf(e){var t=e<0?12:11,r=ws(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10),r.length<=t)?r:e.toExponential(5)}function mf(e){var t=ws(e.toFixed(11));return t.length>(e<0?12:11)||t==="0"||t==="-0"?e.toPrecision(6):t}function vf(e){var t=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),r;return t>=-4&&t<=-1?r=e.toPrecision(10+t):Math.abs(t)<=9?r=gf(e):t===10?r=e.toFixed(10).substr(0,12):r=mf(e),ws(xf(r.toUpperCase()))}function ss(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):vf(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return Mr(14,Lo(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function yf(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function wf(e,t,r,n){var i="",s=0,a=0,c=r.y,u,f=0;switch(e){case 98:c=r.y+543;case 121:switch(t.length){case 1:case 2:u=c%100,f=2;break;default:u=c%1e4,f=4;break}break;case 109:switch(t.length){case 1:case 2:u=r.m,f=t.length;break;case 3:return Hi[r.m-1][1];case 5:return Hi[r.m-1][0];default:return Hi[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:u=r.d,f=t.length;break;case 3:return ua[r.q][0];default:return ua[r.q][1]}break;case 104:switch(t.length){case 1:case 2:u=1+(r.H+11)%12,f=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:u=r.H,f=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:u=r.M,f=t.length;break;default:throw"bad minute format: "+t}break;case 115:if(t!="s"&&t!="ss"&&t!=".0"&&t!=".00"&&t!=".000")throw"bad second format: "+t;return r.u===0&&(t=="s"||t=="ss")?pr(r.S,t.length):(n>=2?a=n===3?1e3:100:a=n===1?10:1,s=Math.round(a*(r.S+r.u)),s>=60*a&&(s=0),t==="s"?s===0?"0":""+s/a:(i=pr(s,2+n),t==="ss"?i.substr(0,2):"."+i.substr(2,t.length-1)));case 90:switch(t){case"[h]":case"[hh]":u=r.D*24+r.H;break;case"[m]":case"[mm]":u=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":u=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+t}f=t.length===3?1:2;break;case 101:u=c,f=1;break}var d=f>0?pr(u,f):"";return d}function jr(e){var t=3;if(e.length<=t)return e;for(var r=e.length%t,n=e.substr(0,r);r!=e.length;r+=t)n+=(n.length>0?",":"")+e.substr(r,t);return n}var Bo=/%/g;function Tf(e,t,r){var n=t.replace(Bo,""),i=t.length-n.length;return Dr(e,n,r*Math.pow(10,2*i))+ft("%",i)}function _f(e,t,r){for(var n=t.length-1;t.charCodeAt(n-1)===44;)--n;return Dr(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}function Uo(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+Uo(e,-t);var i=e.indexOf(".");i===-1&&(i=e.indexOf("E"));var s=Math.floor(Math.log(t)*Math.LOG10E)%i;if(s<0&&(s+=i),r=(t/Math.pow(10,s)).toPrecision(n+1+(i+s)%i),r.indexOf("e")===-1){var a=Math.floor(Math.log(t)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(a-r.length+s):r+="E+"+(a-s);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,i)+"."+r.substr(2+i),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(c,u,f,d){return u+f+d.substr(0,(i+s)%i)+"."+d.substr(s)+"E"})}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var Wo=/# (\?+)( ?)\/( ?)(\d+)/;function Ef(e,t,r){var n=parseInt(e[4],10),i=Math.round(t*n),s=Math.floor(i/n),a=i-s*n,c=n;return r+(s===0?"":""+s)+" "+(a===0?ft(" ",e[1].length+1+e[4].length):ys(a,e[1].length)+e[2]+"/"+e[3]+pr(c,e[4].length))}function Sf(e,t,r){return r+(t===0?"":""+t)+ft(" ",e[1].length+2+e[4].length)}var Vo=/^#*0*\.([0#]+)/,zo=/\).*[0#]/,Ho=/\(###\) ###\\?-####/;function Wt(e){for(var t="",r,n=0;n!=e.length;++n)switch(r=e.charCodeAt(n)){case 35:break;case 63:t+=" ";break;case 48:t+="0";break;default:t+=String.fromCharCode(r)}return t}function da(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function pa(e,t){var r=e-Math.floor(e),n=Math.pow(10,t);return t<(""+Math.round(r*n)).length?0:Math.round(r*n)}function Cf(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}function bf(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function ar(e,t,r){if(e.charCodeAt(0)===40&&!t.match(zo)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?ar("n",n,r):"("+ar("n",n,-r)+")"}if(t.charCodeAt(t.length-1)===44)return _f(e,t,r);if(t.indexOf("%")!==-1)return Tf(e,t,r);if(t.indexOf("E")!==-1)return Uo(t,r);if(t.charCodeAt(0)===36)return"$"+ar(e,t.substr(t.charAt(1)==" "?2:1),r);var i,s,a,c,u=Math.abs(r),f=r<0?"-":"";if(t.match(/^00+$/))return f+sn(u,t.length);if(t.match(/^[#?]+$/))return i=sn(r,0),i==="0"&&(i=""),i.length>t.length?i:Wt(t.substr(0,t.length-i.length))+i;if(s=t.match(Wo))return Ef(s,u,f);if(t.match(/^#+0+$/))return f+sn(u,t.length-t.indexOf("0"));if(s=t.match(Vo))return i=da(r,s[1].length).replace(/^([^\.]+)$/,"$1."+Wt(s[1])).replace(/\.$/,"."+Wt(s[1])).replace(/\.(\d*)$/,function(y,g){return"."+g+ft("0",Wt(s[1]).length-g.length)}),t.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),s=t.match(/^(0*)\.(#*)$/))return f+da(u,s[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=t.match(/^#{1,3},##0(\.?)$/))return f+jr(sn(u,0));if(s=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+ar(e,t,-r):jr(""+(Math.floor(r)+Cf(r,s[1].length)))+"."+pr(pa(r,s[1].length),s[1].length);if(s=t.match(/^#,#*,#0/))return ar(e,t.replace(/^#,#*,/,""),r);if(s=t.match(/^([0#]+)(\\?-([0#]+))+$/))return i=dn(ar(e,t.replace(/[\\-]/g,""),r)),a=0,dn(dn(t.replace(/\\/g,"")).replace(/[0#]/g,function(y){return a<i.length?i.charAt(a++):y==="0"?"0":""}));if(t.match(Ho))return i=ar(e,"##########",r),"("+i.substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var d="";if(s=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(s[4].length,7),c=pi(u,Math.pow(10,a)-1,!1),i=""+f,d=Dr("n",s[1],c[1]),d.charAt(d.length-1)==" "&&(d=d.substr(0,d.length-1)+"0"),i+=d+s[2]+"/"+s[3],d=hi(c[2],a),d.length<s[4].length&&(d=Wt(s[4].substr(s[4].length-d.length))+d),i+=d,i;if(s=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(Math.max(s[1].length,s[4].length),7),c=pi(u,Math.pow(10,a)-1,!0),f+(c[0]||(c[1]?"":"0"))+" "+(c[1]?ys(c[1],a)+s[2]+"/"+s[3]+hi(c[2],a):ft(" ",2*a+1+s[2].length+s[3].length));if(s=t.match(/^[#0?]+$/))return i=sn(r,0),t.length<=i.length?i:Wt(t.substr(0,t.length-i.length))+i;if(s=t.match(/^([#0?]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),a=i.indexOf(".");var p=t.indexOf(".")-a,x=t.length-i.length-p;return Wt(t.substr(0,p)+i+t.substr(t.length-x))}if(s=t.match(/^00,000\.([#0]*0)$/))return a=pa(r,s[1].length),r<0?"-"+ar(e,t,-r):jr(bf(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(y){return"00,"+(y.length<3?pr(0,3-y.length):"")+y})+"."+pr(a,s[1].length);switch(t){case"###,##0.00":return ar(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var l=jr(sn(u,0));return l!=="0"?f+l:"";case"###,###.00":return ar(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return ar(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function Df(e,t,r){for(var n=t.length-1;t.charCodeAt(n-1)===44;)--n;return Dr(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}function Af(e,t,r){var n=t.replace(Bo,""),i=t.length-n.length;return Dr(e,n,r*Math.pow(10,2*i))+ft("%",i)}function $o(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+$o(e,-t);var i=e.indexOf(".");i===-1&&(i=e.indexOf("E"));var s=Math.floor(Math.log(t)*Math.LOG10E)%i;if(s<0&&(s+=i),r=(t/Math.pow(10,s)).toPrecision(n+1+(i+s)%i),!r.match(/[Ee]/)){var a=Math.floor(Math.log(t)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(a-r.length+s):r+="E+"+(a-s),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(c,u,f,d){return u+f+d.substr(0,(i+s)%i)+"."+d.substr(s)+"E"})}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function Tr(e,t,r){if(e.charCodeAt(0)===40&&!t.match(zo)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Tr("n",n,r):"("+Tr("n",n,-r)+")"}if(t.charCodeAt(t.length-1)===44)return Df(e,t,r);if(t.indexOf("%")!==-1)return Af(e,t,r);if(t.indexOf("E")!==-1)return $o(t,r);if(t.charCodeAt(0)===36)return"$"+Tr(e,t.substr(t.charAt(1)==" "?2:1),r);var i,s,a,c,u=Math.abs(r),f=r<0?"-":"";if(t.match(/^00+$/))return f+pr(u,t.length);if(t.match(/^[#?]+$/))return i=""+r,r===0&&(i=""),i.length>t.length?i:Wt(t.substr(0,t.length-i.length))+i;if(s=t.match(Wo))return Sf(s,u,f);if(t.match(/^#+0+$/))return f+pr(u,t.length-t.indexOf("0"));if(s=t.match(Vo))return i=(""+r).replace(/^([^\.]+)$/,"$1."+Wt(s[1])).replace(/\.$/,"."+Wt(s[1])),i=i.replace(/\.(\d*)$/,function(y,g){return"."+g+ft("0",Wt(s[1]).length-g.length)}),t.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),s=t.match(/^(0*)\.(#*)$/))return f+(""+u).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=t.match(/^#{1,3},##0(\.?)$/))return f+jr(""+u);if(s=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Tr(e,t,-r):jr(""+r)+"."+ft("0",s[1].length);if(s=t.match(/^#,#*,#0/))return Tr(e,t.replace(/^#,#*,/,""),r);if(s=t.match(/^([0#]+)(\\?-([0#]+))+$/))return i=dn(Tr(e,t.replace(/[\\-]/g,""),r)),a=0,dn(dn(t.replace(/\\/g,"")).replace(/[0#]/g,function(y){return a<i.length?i.charAt(a++):y==="0"?"0":""}));if(t.match(Ho))return i=Tr(e,"##########",r),"("+i.substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var d="";if(s=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(s[4].length,7),c=pi(u,Math.pow(10,a)-1,!1),i=""+f,d=Dr("n",s[1],c[1]),d.charAt(d.length-1)==" "&&(d=d.substr(0,d.length-1)+"0"),i+=d+s[2]+"/"+s[3],d=hi(c[2],a),d.length<s[4].length&&(d=Wt(s[4].substr(s[4].length-d.length))+d),i+=d,i;if(s=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(Math.max(s[1].length,s[4].length),7),c=pi(u,Math.pow(10,a)-1,!0),f+(c[0]||(c[1]?"":"0"))+" "+(c[1]?ys(c[1],a)+s[2]+"/"+s[3]+hi(c[2],a):ft(" ",2*a+1+s[2].length+s[3].length));if(s=t.match(/^[#0?]+$/))return i=""+r,t.length<=i.length?i:Wt(t.substr(0,t.length-i.length))+i;if(s=t.match(/^([#0]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),a=i.indexOf(".");var p=t.indexOf(".")-a,x=t.length-i.length-p;return Wt(t.substr(0,p)+i+t.substr(t.length-x))}if(s=t.match(/^00,000\.([#0]*0)$/))return r<0?"-"+Tr(e,t,-r):jr(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(y){return"00,"+(y.length<3?pr(0,3-y.length):"")+y})+"."+pr(0,s[1].length);switch(t){case"###,###":case"##,###":case"#,###":var l=jr(""+u);return l!=="0"?f+l:"";default:if(t.match(/\.[0#?]*$/))return Tr(e,t.slice(0,t.lastIndexOf(".")),r)+Wt(t.slice(t.lastIndexOf(".")))}throw new Error("unsupported format |"+t+"|")}function Dr(e,t,r){return(r|0)===r?Tr(e,t,r):ar(e,t,r)}function Of(e){for(var t=[],r=!1,n=0,i=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:t[t.length]=e.substr(i,n-i),i=n+1}if(t[t.length]=e.substr(i),r===!0)throw new Error("Format |"+e+"| unterminated string ");return t}var Go=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function Xo(e){for(var t=0,r="",n="";t<e.length;)switch(r=e.charAt(t)){case"G":di(e,t)&&(t+=6),t++;break;case'"':for(;e.charCodeAt(++t)!==34&&t<e.length;);++t;break;case"\\":t+=2;break;case"_":t+=2;break;case"@":++t;break;case"B":case"b":if(e.charAt(t+1)==="1"||e.charAt(t+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(e.substr(t,3).toUpperCase()==="A/P"||e.substr(t,5).toUpperCase()==="AM/PM"||e.substr(t,5).toUpperCase()==="上午/下午")return!0;++t;break;case"[":for(n=r;e.charAt(t++)!=="]"&&t<e.length;)n+=e.charAt(t);if(n.match(Go))return!0;break;case".":case"0":case"#":for(;t<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++t))>-1||r=="\\"&&e.charAt(t+1)=="-"&&"0#".indexOf(e.charAt(t+2))>-1););break;case"?":for(;e.charAt(++t)===r;);break;case"*":++t,(e.charAt(t)==" "||e.charAt(t)=="*")&&++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t<e.length&&"0123456789".indexOf(e.charAt(++t))>-1;);break;case" ":++t;break;default:++t;break}return!1}function kf(e,t,r,n){for(var i=[],s="",a=0,c="",u="t",f,d,p,x="H";a<e.length;)switch(c=e.charAt(a)){case"G":if(!di(e,a))throw new Error("unrecognized character "+c+" in "+e);i[i.length]={t:"G",v:"General"},a+=7;break;case'"':for(s="";(p=e.charCodeAt(++a))!==34&&a<e.length;)s+=String.fromCharCode(p);i[i.length]={t:"t",v:s},++a;break;case"\\":var l=e.charAt(++a),y=l==="("||l===")"?l:"t";i[i.length]={t:y,v:l},++a;break;case"_":i[i.length]={t:"t",v:" "},a+=2;break;case"@":i[i.length]={t:"T",v:t},++a;break;case"B":case"b":if(e.charAt(a+1)==="1"||e.charAt(a+1)==="2"){if(f==null&&(f=Qn(t,r,e.charAt(a+1)==="2"),f==null))return"";i[i.length]={t:"X",v:e.substr(a,2)},u=c,a+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":c=c.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0||f==null&&(f=Qn(t,r),f==null))return"";for(s=c;++a<e.length&&e.charAt(a).toLowerCase()===c;)s+=c;c==="m"&&u.toLowerCase()==="h"&&(c="M"),c==="h"&&(c=x),i[i.length]={t:c,v:s},u=c;break;case"A":case"a":case"上":var g={t:c,v:c};if(f==null&&(f=Qn(t,r)),e.substr(a,3).toUpperCase()==="A/P"?(f!=null&&(g.v=f.H>=12?"P":"A"),g.t="T",x="h",a+=3):e.substr(a,5).toUpperCase()==="AM/PM"?(f!=null&&(g.v=f.H>=12?"PM":"AM"),g.t="T",a+=5,x="h"):e.substr(a,5).toUpperCase()==="上午/下午"?(f!=null&&(g.v=f.H>=12?"下午":"上午"),g.t="T",a+=5,x="h"):(g.t="t",++a),f==null&&g.t==="T")return"";i[i.length]=g,u=c;break;case"[":for(s=c;e.charAt(a++)!=="]"&&a<e.length;)s+=e.charAt(a);if(s.slice(-1)!=="]")throw'unterminated "[" block: |'+s+"|";if(s.match(Go)){if(f==null&&(f=Qn(t,r),f==null))return"";i[i.length]={t:"Z",v:s.toLowerCase()},u=s.charAt(1)}else s.indexOf("$")>-1&&(s=(s.match(/\$([^-\[\]]*)/)||[])[1]||"$",Xo(e)||(i[i.length]={t:"t",v:s}));break;case".":if(f!=null){for(s=c;++a<e.length&&(c=e.charAt(a))==="0";)s+=c;i[i.length]={t:"s",v:s};break}case"0":case"#":for(s=c;++a<e.length&&"0#?.,E+-%".indexOf(c=e.charAt(a))>-1;)s+=c;i[i.length]={t:"n",v:s};break;case"?":for(s=c;e.charAt(++a)===c;)s+=c;i[i.length]={t:c,v:s},u=c;break;case"*":++a,(e.charAt(a)==" "||e.charAt(a)=="*")&&++a;break;case"(":case")":i[i.length]={t:n===1?"t":c,v:c},++a;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(s=c;a<e.length&&"0123456789".indexOf(e.charAt(++a))>-1;)s+=e.charAt(a);i[i.length]={t:"D",v:s};break;case" ":i[i.length]={t:c,v:c},++a;break;case"$":i[i.length]={t:"t",v:"$"},++a;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c)===-1)throw new Error("unrecognized character "+c+" in "+e);i[i.length]={t:"t",v:c},++a;break}var m=0,E=0,D;for(a=i.length-1,u="t";a>=0;--a)switch(i[a].t){case"h":case"H":i[a].t=x,u="h",m<1&&(m=1);break;case"s":(D=i[a].v.match(/\.0+$/))&&(E=Math.max(E,D[0].length-1)),m<3&&(m=3);case"d":case"y":case"M":case"e":u=i[a].t;break;case"m":u==="s"&&(i[a].t="M",m<2&&(m=2));break;case"X":break;case"Z":m<1&&i[a].v.match(/[Hh]/)&&(m=1),m<2&&i[a].v.match(/[Mm]/)&&(m=2),m<3&&i[a].v.match(/[Ss]/)&&(m=3)}switch(m){case 0:break;case 1:f.u>=.5&&(f.u=0,++f.S),f.S>=60&&(f.S=0,++f.M),f.M>=60&&(f.M=0,++f.H);break;case 2:f.u>=.5&&(f.u=0,++f.S),f.S>=60&&(f.S=0,++f.M);break}var C="",N;for(a=0;a<i.length;++a)switch(i[a].t){case"t":case"T":case" ":case"D":break;case"X":i[a].v="",i[a].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":i[a].v=wf(i[a].t.charCodeAt(0),i[a].v,f,E),i[a].t="t";break;case"n":case"?":for(N=a+1;i[N]!=null&&((c=i[N].t)==="?"||c==="D"||(c===" "||c==="t")&&i[N+1]!=null&&(i[N+1].t==="?"||i[N+1].t==="t"&&i[N+1].v==="/")||i[a].t==="("&&(c===" "||c==="n"||c===")")||c==="t"&&(i[N].v==="/"||i[N].v===" "&&i[N+1]!=null&&i[N+1].t=="?"));)i[a].v+=i[N].v,i[N]={v:"",t:";"},++N;C+=i[a].v,a=N-1;break;case"G":i[a].t="t",i[a].v=ss(t,r);break}var L="",Q,k;if(C.length>0){C.charCodeAt(0)==40?(Q=t<0&&C.charCodeAt(0)===45?-t:t,k=Dr("n",C,Q)):(Q=t<0&&n>1?-t:t,k=Dr("n",C,Q),Q<0&&i[0]&&i[0].t=="t"&&(k=k.substr(1),i[0].v="-"+i[0].v)),N=k.length-1;var V=i.length;for(a=0;a<i.length;++a)if(i[a]!=null&&i[a].t!="t"&&i[a].v.indexOf(".")>-1){V=a;break}var j=i.length;if(V===i.length&&k.indexOf("E")===-1){for(a=i.length-1;a>=0;--a)i[a]==null||"n?".indexOf(i[a].t)===-1||(N>=i[a].v.length-1?(N-=i[a].v.length,i[a].v=k.substr(N+1,i[a].v.length)):N<0?i[a].v="":(i[a].v=k.substr(0,N+1),N=-1),i[a].t="t",j=a);N>=0&&j<i.length&&(i[j].v=k.substr(0,N+1)+i[j].v)}else if(V!==i.length&&k.indexOf("E")===-1){for(N=k.indexOf(".")-1,a=V;a>=0;--a)if(!(i[a]==null||"n?".indexOf(i[a].t)===-1)){for(d=i[a].v.indexOf(".")>-1&&a===V?i[a].v.indexOf(".")-1:i[a].v.length-1,L=i[a].v.substr(d+1);d>=0;--d)N>=0&&(i[a].v.charAt(d)==="0"||i[a].v.charAt(d)==="#")&&(L=k.charAt(N--)+L);i[a].v=L,i[a].t="t",j=a}for(N>=0&&j<i.length&&(i[j].v=k.substr(0,N+1)+i[j].v),N=k.indexOf(".")+1,a=V;a<i.length;++a)if(!(i[a]==null||"n?(".indexOf(i[a].t)===-1&&a!==V)){for(d=i[a].v.indexOf(".")>-1&&a===V?i[a].v.indexOf(".")+1:0,L=i[a].v.substr(0,d);d<i[a].v.length;++d)N<k.length&&(L+=k.charAt(N++));i[a].v=L,i[a].t="t",j=a}}}for(a=0;a<i.length;++a)i[a]!=null&&"n?".indexOf(i[a].t)>-1&&(Q=n>1&&t<0&&a>0&&i[a-1].v==="-"?-t:t,i[a].v=Dr(i[a].t,i[a].v,Q),i[a].t="t");var B="";for(a=0;a!==i.length;++a)i[a]!=null&&(B+=i[a].v);return B}var xa=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function ga(e,t){if(t==null)return!1;var r=parseFloat(t[2]);switch(t[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0;break}return!1}function Ff(e,t){var r=Of(e),n=r.length,i=r[n-1].indexOf("@");if(n<4&&i>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof t!="number")return[4,r.length===4||i>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=i>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=i>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=i>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var s=t>0?r[0]:t<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[n,s];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var a=r[0].match(xa),c=r[1].match(xa);return ga(t,a)?[n,r[0]]:ga(t,c)?[n,r[1]]:[n,r[a!=null&&c!=null?2:1]]}return[n,s]}function Mr(e,t,r){r==null&&(r={});var n="";switch(typeof e){case"string":e=="m/d/yy"&&r.dateNF?n=r.dateNF:n=e;break;case"number":e==14&&r.dateNF?n=r.dateNF:n=(r.table!=null?r.table:ut)[e],n==null&&(n=r.table&&r.table[ha[e]]||ut[ha[e]]),n==null&&(n=hf[e]||"General");break}if(di(n,0))return ss(t,r);t instanceof Date&&(t=Lo(t,r.date1904));var i=Ff(n,t);if(di(i[1]))return ss(t,r);if(t===!0)t="TRUE";else if(t===!1)t="FALSE";else if(t===""||t==null)return"";return kf(i[1],t,r,i[0])}function Yo(e,t){if(typeof t!="number"){t=+t||-1;for(var r=0;r<392;++r){if(ut[r]==null){t<0&&(t=r);continue}if(ut[r]==e){t=r;break}}t<0&&(t=391)}return ut[t]=e,t}function Di(e){for(var t=0;t!=392;++t)e[t]!==void 0&&Yo(e[t],t)}function Ai(){ut=uf()}var Ko=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function If(e){var t=typeof e=="number"?ut[e]:e;return t=t.replace(Ko,"(\\d+)"),new RegExp("^"+t+"$")}function Nf(e,t,r){var n=-1,i=-1,s=-1,a=-1,c=-1,u=-1;(t.match(Ko)||[]).forEach(function(p,x){var l=parseInt(r[x+1],10);switch(p.toLowerCase().charAt(0)){case"y":n=l;break;case"d":s=l;break;case"h":a=l;break;case"s":u=l;break;case"m":a>=0?c=l:i=l;break}}),u>=0&&c==-1&&i>=0&&(c=i,i=-1);var f=(""+(n>=0?n:new Date().getFullYear())).slice(-4)+"-"+("00"+(i>=1?i:1)).slice(-2)+"-"+("00"+(s>=1?s:1)).slice(-2);f.length==7&&(f="0"+f),f.length==8&&(f="20"+f);var d=("00"+(a>=0?a:0)).slice(-2)+":"+("00"+(c>=0?c:0)).slice(-2)+":"+("00"+(u>=0?u:0)).slice(-2);return a==-1&&c==-1&&u==-1?f:n==-1&&i==-1&&s==-1?d:f+"T"+d}var Rf=(function(){var e={};e.version="1.2.0";function t(){for(var k=0,V=new Array(256),j=0;j!=256;++j)k=j,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,V[j]=k;return typeof Int32Array<"u"?new Int32Array(V):V}var r=t();function n(k){var V=0,j=0,B=0,X=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(B=0;B!=256;++B)X[B]=k[B];for(B=0;B!=256;++B)for(j=k[B],V=256+B;V<4096;V+=256)j=X[V]=j>>>8^k[j&255];var M=[];for(B=1;B!=16;++B)M[B-1]=typeof Int32Array<"u"?X.subarray(B*256,B*256+256):X.slice(B*256,B*256+256);return M}var i=n(r),s=i[0],a=i[1],c=i[2],u=i[3],f=i[4],d=i[5],p=i[6],x=i[7],l=i[8],y=i[9],g=i[10],m=i[11],E=i[12],D=i[13],C=i[14];function N(k,V){for(var j=V^-1,B=0,X=k.length;B<X;)j=j>>>8^r[(j^k.charCodeAt(B++))&255];return~j}function L(k,V){for(var j=V^-1,B=k.length-15,X=0;X<B;)j=C[k[X++]^j&255]^D[k[X++]^j>>8&255]^E[k[X++]^j>>16&255]^m[k[X++]^j>>>24]^g[k[X++]]^y[k[X++]]^l[k[X++]]^x[k[X++]]^p[k[X++]]^d[k[X++]]^f[k[X++]]^u[k[X++]]^c[k[X++]]^a[k[X++]]^s[k[X++]]^r[k[X++]];for(B+=15;X<B;)j=j>>>8^r[(j^k[X++])&255];return~j}function Q(k,V){for(var j=V^-1,B=0,X=k.length,M=0,ee=0;B<X;)M=k.charCodeAt(B++),M<128?j=j>>>8^r[(j^M)&255]:M<2048?(j=j>>>8^r[(j^(192|M>>6&31))&255],j=j>>>8^r[(j^(128|M&63))&255]):M>=55296&&M<57344?(M=(M&1023)+64,ee=k.charCodeAt(B++)&1023,j=j>>>8^r[(j^(240|M>>8&7))&255],j=j>>>8^r[(j^(128|M>>2&63))&255],j=j>>>8^r[(j^(128|ee>>6&15|(M&3)<<4))&255],j=j>>>8^r[(j^(128|ee&63))&255]):(j=j>>>8^r[(j^(224|M>>12&15))&255],j=j>>>8^r[(j^(128|M>>6&63))&255],j=j>>>8^r[(j^(128|M&63))&255]);return~j}return e.table=r,e.bstr=N,e.buf=L,e.str=Q,e})(),et=(function(){var t={};t.version="1.2.1";function r(v,S){for(var T=v.split("/"),_=S.split("/"),b=0,A=0,W=Math.min(T.length,_.length);b<W;++b){if(A=T[b].length-_[b].length)return A;if(T[b]!=_[b])return T[b]<_[b]?-1:1}return T.length-_.length}function n(v){if(v.charAt(v.length-1)=="/")return v.slice(0,-1).indexOf("/")===-1?v:n(v.slice(0,-1));var S=v.lastIndexOf("/");return S===-1?v:v.slice(0,S+1)}function i(v){if(v.charAt(v.length-1)=="/")return i(v.slice(0,-1));var S=v.lastIndexOf("/");return S===-1?v:v.slice(S+1)}function s(v,S){typeof S=="string"&&(S=new Date(S));var T=S.getHours();T=T<<6|S.getMinutes(),T=T<<5|S.getSeconds()>>>1,v.write_shift(2,T);var _=S.getFullYear()-1980;_=_<<4|S.getMonth()+1,_=_<<5|S.getDate(),v.write_shift(2,_)}function a(v){var S=v.read_shift(2)&65535,T=v.read_shift(2)&65535,_=new Date,b=T&31;T>>>=5;var A=T&15;T>>>=4,_.setMilliseconds(0),_.setFullYear(T+1980),_.setMonth(A-1),_.setDate(b);var W=S&31;S>>>=5;var J=S&63;return S>>>=6,_.setHours(S),_.setMinutes(J),_.setSeconds(W<<1),_}function c(v){er(v,0);for(var S={},T=0;v.l<=v.length-4;){var _=v.read_shift(2),b=v.read_shift(2),A=v.l+b,W={};switch(_){case 21589:T=v.read_shift(1),T&1&&(W.mtime=v.read_shift(4)),b>5&&(T&2&&(W.atime=v.read_shift(4)),T&4&&(W.ctime=v.read_shift(4))),W.mtime&&(W.mt=new Date(W.mtime*1e3));break}v.l=A,S[_]=W}return S}var u;function f(){return u||(u={})}function d(v,S){if(v[0]==80&&v[1]==75)return Bt(v,S);if((v[0]|32)==109&&(v[1]|32)==105)return nt(v,S);if(v.length<512)throw new Error("CFB file size "+v.length+" < 512");var T=3,_=512,b=0,A=0,W=0,J=0,U=0,z=[],H=v.slice(0,512);er(H,0);var se=p(H);switch(T=se[0],T){case 3:_=512;break;case 4:_=4096;break;case 0:if(se[1]==0)return Bt(v,S);default:throw new Error("Major Version: Expected 3 or 4 saw "+T)}_!==512&&(H=v.slice(0,_),er(H,28));var ue=v.slice(0,_);x(H,T);var me=H.read_shift(4,"i");if(T===3&&me!==0)throw new Error("# Directory Sectors: Expected 0 saw "+me);H.l+=4,W=H.read_shift(4,"i"),H.l+=4,H.chk("00100000","Mini Stream Cutoff Size: "),J=H.read_shift(4,"i"),b=H.read_shift(4,"i"),U=H.read_shift(4,"i"),A=H.read_shift(4,"i");for(var le=-1,pe=0;pe<109&&(le=H.read_shift(4,"i"),!(le<0));++pe)z[pe]=le;var De=l(v,_);m(U,A,De,_,z);var ke=D(De,W,z,_);ke[W].name="!Directory",b>0&&J!==ee&&(ke[J].name="!MiniFAT"),ke[z[0]].name="!FAT",ke.fat_addrs=z,ke.ssz=_;var Me={},Tt=[],Wr=[],Vr=[];C(W,ke,De,Tt,b,Me,Wr,J),y(Wr,Vr,Tt),Tt.shift();var zr={FileIndex:Wr,FullPaths:Vr};return S&&S.raw&&(zr.raw={header:ue,sectors:De}),zr}function p(v){if(v[v.l]==80&&v[v.l+1]==75)return[0,0];v.chk(Te,"Header Signature: "),v.l+=16;var S=v.read_shift(2,"u");return[v.read_shift(2,"u"),S]}function x(v,S){var T=9;switch(v.l+=2,T=v.read_shift(2)){case 9:if(S!=3)throw new Error("Sector Shift: Expected 9 saw "+T);break;case 12:if(S!=4)throw new Error("Sector Shift: Expected 12 saw "+T);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+T)}v.chk("0600","Mini Sector Shift: "),v.chk("000000000000","Reserved: ")}function l(v,S){for(var T=Math.ceil(v.length/S)-1,_=[],b=1;b<T;++b)_[b-1]=v.slice(b*S,(b+1)*S);return _[T-1]=v.slice(T*S),_}function y(v,S,T){for(var _=0,b=0,A=0,W=0,J=0,U=T.length,z=[],H=[];_<U;++_)z[_]=H[_]=_,S[_]=T[_];for(;J<H.length;++J)_=H[J],b=v[_].L,A=v[_].R,W=v[_].C,z[_]===_&&(b!==-1&&z[b]!==b&&(z[_]=z[b]),A!==-1&&z[A]!==A&&(z[_]=z[A])),W!==-1&&(z[W]=_),b!==-1&&_!=z[_]&&(z[b]=z[_],H.lastIndexOf(b)<J&&H.push(b)),A!==-1&&_!=z[_]&&(z[A]=z[_],H.lastIndexOf(A)<J&&H.push(A));for(_=1;_<U;++_)z[_]===_&&(A!==-1&&z[A]!==A?z[_]=z[A]:b!==-1&&z[b]!==b&&(z[_]=z[b]));for(_=1;_<U;++_)if(v[_].type!==0){if(J=_,J!=z[J])do J=z[J],S[_]=S[J]+"/"+S[_];while(J!==0&&z[J]!==-1&&J!=z[J]);z[_]=-1}for(S[0]+="/",_=1;_<U;++_)v[_].type!==2&&(S[_]+="/")}function g(v,S,T){for(var _=v.start,b=v.size,A=[],W=_;T&&b>0&&W>=0;)A.push(S.slice(W*M,W*M+M)),b-=M,W=Hr(T,W*4);return A.length===0?q(0):Ot(A).slice(0,v.size)}function m(v,S,T,_,b){var A=ee;if(v===ee){if(S!==0)throw new Error("DIFAT chain shorter than expected")}else if(v!==-1){var W=T[v],J=(_>>>2)-1;if(!W)return;for(var U=0;U<J&&(A=Hr(W,U*4))!==ee;++U)b.push(A);m(Hr(W,_-4),S-1,T,_,b)}}function E(v,S,T,_,b){var A=[],W=[];b||(b=[]);var J=_-1,U=0,z=0;for(U=S;U>=0;){b[U]=!0,A[A.length]=U,W.push(v[U]);var H=T[Math.floor(U*4/_)];if(z=U*4&J,_<4+z)throw new Error("FAT boundary crossed: "+U+" 4 "+_);if(!v[H])break;U=Hr(v[H],z)}return{nodes:A,data:Sa([W])}}function D(v,S,T,_){var b=v.length,A=[],W=[],J=[],U=[],z=_-1,H=0,se=0,ue=0,me=0;for(H=0;H<b;++H)if(J=[],ue=H+S,ue>=b&&(ue-=b),!W[ue]){U=[];var le=[];for(se=ue;se>=0;){le[se]=!0,W[se]=!0,J[J.length]=se,U.push(v[se]);var pe=T[Math.floor(se*4/_)];if(me=se*4&z,_<4+me)throw new Error("FAT boundary crossed: "+se+" 4 "+_);if(!v[pe]||(se=Hr(v[pe],me),le[se]))break}A[ue]={nodes:J,data:Sa([U])}}return A}function C(v,S,T,_,b,A,W,J){for(var U=0,z=_.length?2:0,H=S[v].data,se=0,ue=0,me;se<H.length;se+=128){var le=H.slice(se,se+128);er(le,64),ue=le.read_shift(2),me=Cs(le,0,ue-z),_.push(me);var pe={name:me,type:le.read_shift(1),color:le.read_shift(1),L:le.read_shift(4,"i"),R:le.read_shift(4,"i"),C:le.read_shift(4,"i"),clsid:le.read_shift(16),state:le.read_shift(4,"i"),start:0,size:0},De=le.read_shift(2)+le.read_shift(2)+le.read_shift(2)+le.read_shift(2);De!==0&&(pe.ct=N(le,le.l-8));var ke=le.read_shift(2)+le.read_shift(2)+le.read_shift(2)+le.read_shift(2);ke!==0&&(pe.mt=N(le,le.l-8)),pe.start=le.read_shift(4,"i"),pe.size=le.read_shift(4,"i"),pe.size<0&&pe.start<0&&(pe.size=pe.type=0,pe.start=ee,pe.name=""),pe.type===5?(U=pe.start,b>0&&U!==ee&&(S[U].name="!StreamData")):pe.size>=4096?(pe.storage="fat",S[pe.start]===void 0&&(S[pe.start]=E(T,pe.start,S.fat_addrs,S.ssz)),S[pe.start].name=pe.name,pe.content=S[pe.start].data.slice(0,pe.size)):(pe.storage="minifat",pe.size<0?pe.size=0:U!==ee&&pe.start!==ee&&S[U]&&(pe.content=g(pe,S[U].data,(S[J]||{}).data))),pe.content&&er(pe.content,0),A[me]=pe,W.push(pe)}}function N(v,S){return new Date((rr(v,S+4)/1e7*Math.pow(2,32)+rr(v,S)/1e7-11644473600)*1e3)}function L(v,S){return f(),d(u.readFileSync(v),S)}function Q(v,S){var T=S&&S.type;switch(T||$e&&Buffer.isBuffer(v)&&(T="buffer"),T||"base64"){case"file":return L(v,S);case"base64":return d(dr(kr(v)),S);case"binary":return d(dr(v),S)}return d(v,S)}function k(v,S){var T=S||{},_=T.root||"Root Entry";if(v.FullPaths||(v.FullPaths=[]),v.FileIndex||(v.FileIndex=[]),v.FullPaths.length!==v.FileIndex.length)throw new Error("inconsistent CFB structure");v.FullPaths.length===0&&(v.FullPaths[0]=_+"/",v.FileIndex[0]={name:_,type:5}),T.CLSID&&(v.FileIndex[0].clsid=T.CLSID),V(v)}function V(v){var S="Sh33tJ5";if(!et.find(v,"/"+S)){var T=q(4);T[0]=55,T[1]=T[3]=50,T[2]=54,v.FileIndex.push({name:S,type:2,content:T,size:4,L:69,R:69,C:69}),v.FullPaths.push(v.FullPaths[0]+S),j(v)}}function j(v,S){k(v);for(var T=!1,_=!1,b=v.FullPaths.length-1;b>=0;--b){var A=v.FileIndex[b];switch(A.type){case 0:_?T=!0:(v.FileIndex.pop(),v.FullPaths.pop());break;case 1:case 2:case 5:_=!0,isNaN(A.R*A.L*A.C)&&(T=!0),A.R>-1&&A.L>-1&&A.R==A.L&&(T=!0);break;default:T=!0;break}}if(!(!T&&!S)){var W=new Date(1987,1,19),J=0,U=Object.create?Object.create(null):{},z=[];for(b=0;b<v.FullPaths.length;++b)U[v.FullPaths[b]]=!0,v.FileIndex[b].type!==0&&z.push([v.FullPaths[b],v.FileIndex[b]]);for(b=0;b<z.length;++b){var H=n(z[b][0]);_=U[H],_||(z.push([H,{name:i(H).replace("/",""),type:1,clsid:ae,ct:W,mt:W,content:null}]),U[H]=!0)}for(z.sort(function(me,le){return r(me[0],le[0])}),v.FullPaths=[],v.FileIndex=[],b=0;b<z.length;++b)v.FullPaths[b]=z[b][0],v.FileIndex[b]=z[b][1];for(b=0;b<z.length;++b){var se=v.FileIndex[b],ue=v.FullPaths[b];if(se.name=i(ue).replace("/",""),se.L=se.R=se.C=-(se.color=1),se.size=se.content?se.content.length:0,se.start=0,se.clsid=se.clsid||ae,b===0)se.C=z.length>1?1:-1,se.size=0,se.type=5;else if(ue.slice(-1)=="/"){for(J=b+1;J<z.length&&n(v.FullPaths[J])!=ue;++J);for(se.C=J>=z.length?-1:J,J=b+1;J<z.length&&n(v.FullPaths[J])!=n(ue);++J);se.R=J>=z.length?-1:J,se.type=1}else n(v.FullPaths[b+1]||"")==n(ue)&&(se.R=b+1),se.type=2}}}function B(v,S){var T=S||{};if(T.fileType=="mad")return rt(v,T);switch(j(v),T.fileType){case"zip":return Pt(v,T)}var _=(function(me){for(var le=0,pe=0,De=0;De<me.FileIndex.length;++De){var ke=me.FileIndex[De];if(ke.content){var Me=ke.content.length;Me>0&&(Me<4096?le+=Me+63>>6:pe+=Me+511>>9)}}for(var Tt=me.FullPaths.length+3>>2,Wr=le+7>>3,Vr=le+127>>7,zr=Wr+pe+Tt+Vr,Cr=zr+127>>7,Sn=Cr<=109?0:Math.ceil((Cr-109)/127);zr+Cr+Sn+127>>7>Cr;)Sn=++Cr<=109?0:Math.ceil((Cr-109)/127);var fr=[1,Sn,Cr,Vr,Tt,pe,le,0];return me.FileIndex[0].size=le<<6,fr[7]=(me.FileIndex[0].start=fr[0]+fr[1]+fr[2]+fr[3]+fr[4]+fr[5])+(fr[6]+7>>3),fr})(v),b=q(_[7]<<9),A=0,W=0;{for(A=0;A<8;++A)b.write_shift(1,ne[A]);for(A=0;A<8;++A)b.write_shift(2,0);for(b.write_shift(2,62),b.write_shift(2,3),b.write_shift(2,65534),b.write_shift(2,9),b.write_shift(2,6),A=0;A<3;++A)b.write_shift(2,0);for(b.write_shift(4,0),b.write_shift(4,_[2]),b.write_shift(4,_[0]+_[1]+_[2]+_[3]-1),b.write_shift(4,0),b.write_shift(4,4096),b.write_shift(4,_[3]?_[0]+_[1]+_[2]-1:ee),b.write_shift(4,_[3]),b.write_shift(-4,_[1]?_[0]-1:ee),b.write_shift(4,_[1]),A=0;A<109;++A)b.write_shift(-4,A<_[2]?_[1]+A:-1)}if(_[1])for(W=0;W<_[1];++W){for(;A<236+W*127;++A)b.write_shift(-4,A<_[2]?_[1]+A:-1);b.write_shift(-4,W===_[1]-1?ee:W+1)}var J=function(me){for(W+=me;A<W-1;++A)b.write_shift(-4,A+1);me&&(++A,b.write_shift(-4,ee))};for(W=A=0,W+=_[1];A<W;++A)b.write_shift(-4,Se.DIFSECT);for(W+=_[2];A<W;++A)b.write_shift(-4,Se.FATSECT);J(_[3]),J(_[4]);for(var U=0,z=0,H=v.FileIndex[0];U<v.FileIndex.length;++U)H=v.FileIndex[U],H.content&&(z=H.content.length,!(z<4096)&&(H.start=W,J(z+511>>9)));for(J(_[6]+7>>3);b.l&511;)b.write_shift(-4,Se.ENDOFCHAIN);for(W=A=0,U=0;U<v.FileIndex.length;++U)H=v.FileIndex[U],H.content&&(z=H.content.length,!(!z||z>=4096)&&(H.start=W,J(z+63>>6)));for(;b.l&511;)b.write_shift(-4,Se.ENDOFCHAIN);for(A=0;A<_[4]<<2;++A){var se=v.FullPaths[A];if(!se||se.length===0){for(U=0;U<17;++U)b.write_shift(4,0);for(U=0;U<3;++U)b.write_shift(4,-1);for(U=0;U<12;++U)b.write_shift(4,0);continue}H=v.FileIndex[A],A===0&&(H.start=H.size?H.start-1:ee);var ue=A===0&&T.root||H.name;if(z=2*(ue.length+1),b.write_shift(64,ue,"utf16le"),b.write_shift(2,z),b.write_shift(1,H.type),b.write_shift(1,H.color),b.write_shift(-4,H.L),b.write_shift(-4,H.R),b.write_shift(-4,H.C),H.clsid)b.write_shift(16,H.clsid,"hex");else for(U=0;U<4;++U)b.write_shift(4,0);b.write_shift(4,H.state||0),b.write_shift(4,0),b.write_shift(4,0),b.write_shift(4,0),b.write_shift(4,0),b.write_shift(4,H.start),b.write_shift(4,H.size),b.write_shift(4,0)}for(A=1;A<v.FileIndex.length;++A)if(H=v.FileIndex[A],H.size>=4096)if(b.l=H.start+1<<9,$e&&Buffer.isBuffer(H.content))H.content.copy(b,b.l,0,H.size),b.l+=H.size+511&-512;else{for(U=0;U<H.size;++U)b.write_shift(1,H.content[U]);for(;U&511;++U)b.write_shift(1,0)}for(A=1;A<v.FileIndex.length;++A)if(H=v.FileIndex[A],H.size>0&&H.size<4096)if($e&&Buffer.isBuffer(H.content))H.content.copy(b,b.l,0,H.size),b.l+=H.size+63&-64;else{for(U=0;U<H.size;++U)b.write_shift(1,H.content[U]);for(;U&63;++U)b.write_shift(1,0)}if($e)b.l=b.length;else for(;b.l<b.length;)b.write_shift(1,0);return b}function X(v,S){var T=v.FullPaths.map(function(U){return U.toUpperCase()}),_=T.map(function(U){var z=U.split("/");return z[z.length-(U.slice(-1)=="/"?2:1)]}),b=!1;S.charCodeAt(0)===47?(b=!0,S=T[0].slice(0,-1)+S):b=S.indexOf("/")!==-1;var A=S.toUpperCase(),W=b===!0?T.indexOf(A):_.indexOf(A);if(W!==-1)return v.FileIndex[W];var J=!A.match(Zn);for(A=A.replace(An,""),J&&(A=A.replace(Zn,"!")),W=0;W<T.length;++W)if((J?T[W].replace(Zn,"!"):T[W]).replace(An,"")==A||(J?_[W].replace(Zn,"!"):_[W]).replace(An,"")==A)return v.FileIndex[W];return null}var M=64,ee=-2,Te="d0cf11e0a1b11ae1",ne=[208,207,17,224,161,177,26,225],ae="00000000000000000000000000000000",Se={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:ee,FREESECT:-1,HEADER_SIGNATURE:Te,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:ae,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Ne(v,S,T){f();var _=B(v,T);u.writeFileSync(S,_)}function be(v){for(var S=new Array(v.length),T=0;T<v.length;++T)S[T]=String.fromCharCode(v[T]);return S.join("")}function ze(v,S){var T=B(v,S);switch(S&&S.type||"buffer"){case"file":return f(),u.writeFileSync(S.filename,T),T;case"binary":return typeof T=="string"?T:be(T);case"base64":return jn(typeof T=="string"?T:be(T));case"buffer":if($e)return Buffer.isBuffer(T)?T:Ir(T);case"array":return typeof T=="string"?dr(T):T}return T}var _e;function O(v){try{var S=v.InflateRaw,T=new S;if(T._processChunk(new Uint8Array([3,0]),T._finishFlushFlag),T.bytesRead)_e=v;else throw new Error("zlib does not expose bytesRead")}catch(_){console.error("cannot use native zlib: "+(_.message||_))}}function P(v,S){if(!_e)return Jt(v,S);var T=_e.InflateRaw,_=new T,b=_._processChunk(v.slice(v.l),_._finishFlushFlag);return v.l+=_.bytesRead,b}function I(v){return _e?_e.deflateRawSync(v):Gt(v)}var R=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Y=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],xe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function ve(v){var S=(v<<1|v<<11)&139536|(v<<5|v<<15)&558144;return(S>>16|S>>8|S)&255}for(var ge=typeof Uint8Array<"u",oe=ge?new Uint8Array(256):[],Le=0;Le<256;++Le)oe[Le]=ve(Le);function Ce(v,S){var T=oe[v&255];return S<=8?T>>>8-S:(T=T<<8|oe[v>>8&255],S<=16?T>>>16-S:(T=T<<8|oe[v>>16&255],T>>>24-S))}function Xe(v,S){var T=S&7,_=S>>>3;return(v[_]|(T<=6?0:v[_+1]<<8))>>>T&3}function Ae(v,S){var T=S&7,_=S>>>3;return(v[_]|(T<=5?0:v[_+1]<<8))>>>T&7}function ht(v,S){var T=S&7,_=S>>>3;return(v[_]|(T<=4?0:v[_+1]<<8))>>>T&15}function Ue(v,S){var T=S&7,_=S>>>3;return(v[_]|(T<=3?0:v[_+1]<<8))>>>T&31}function de(v,S){var T=S&7,_=S>>>3;return(v[_]|(T<=1?0:v[_+1]<<8))>>>T&127}function st(v,S,T){var _=S&7,b=S>>>3,A=(1<<T)-1,W=v[b]>>>_;return T<8-_||(W|=v[b+1]<<8-_,T<16-_)||(W|=v[b+2]<<16-_,T<24-_)||(W|=v[b+3]<<24-_),W&A}function He(v,S,T){var _=S&7,b=S>>>3;return _<=5?v[b]|=(T&7)<<_:(v[b]|=T<<_&255,v[b+1]=(T&7)>>8-_),S+3}function Lt(v,S,T){var _=S&7,b=S>>>3;return T=(T&1)<<_,v[b]|=T,S+1}function yt(v,S,T){var _=S&7,b=S>>>3;return T<<=_,v[b]|=T&255,T>>>=8,v[b+1]=T,S+8}function lt(v,S,T){var _=S&7,b=S>>>3;return T<<=_,v[b]|=T&255,T>>>=8,v[b+1]=T&255,v[b+2]=T>>>8,S+16}function gt(v,S){var T=v.length,_=2*T>S?2*T:S+5,b=0;if(T>=S)return v;if($e){var A=ca(_);if(v.copy)v.copy(A);else for(;b<v.length;++b)A[b]=v[b];return A}else if(ge){var W=new Uint8Array(_);if(W.set)W.set(v);else for(;b<T;++b)W[b]=v[b];return W}return v.length=_,v}function Ye(v){for(var S=new Array(v),T=0;T<v;++T)S[T]=0;return S}function Ht(v,S,T){var _=1,b=0,A=0,W=0,J=0,U=v.length,z=ge?new Uint16Array(32):Ye(32);for(A=0;A<32;++A)z[A]=0;for(A=U;A<T;++A)v[A]=0;U=v.length;var H=ge?new Uint16Array(U):Ye(U);for(A=0;A<U;++A)z[b=v[A]]++,_<b&&(_=b),H[A]=0;for(z[0]=0,A=1;A<=_;++A)z[A+16]=J=J+z[A-1]<<1;for(A=0;A<U;++A)J=v[A],J!=0&&(H[A]=z[J+16]++);var se=0;for(A=0;A<U;++A)if(se=v[A],se!=0)for(J=Ce(H[A],_)>>_-se,W=(1<<_+4-se)-1;W>=0;--W)S[J|W<<se]=se&15|A<<4;return _}var wt=ge?new Uint16Array(512):Ye(512),$t=ge?new Uint16Array(32):Ye(32);if(!ge){for(var Nt=0;Nt<512;++Nt)wt[Nt]=0;for(Nt=0;Nt<32;++Nt)$t[Nt]=0}(function(){for(var v=[],S=0;S<32;S++)v.push(5);Ht(v,$t,32);var T=[];for(S=0;S<=143;S++)T.push(8);for(;S<=255;S++)T.push(9);for(;S<=279;S++)T.push(7);for(;S<=287;S++)T.push(8);Ht(T,wt,288)})();var Rt=(function(){for(var S=ge?new Uint8Array(32768):[],T=0,_=0;T<xe.length-1;++T)for(;_<xe[T+1];++_)S[_]=T;for(;_<32768;++_)S[_]=29;var b=ge?new Uint8Array(259):[];for(T=0,_=0;T<Y.length-1;++T)for(;_<Y[T+1];++_)b[_]=T;function A(J,U){for(var z=0;z<J.length;){var H=Math.min(65535,J.length-z),se=z+H==J.length;for(U.write_shift(1,+se),U.write_shift(2,H),U.write_shift(2,~H&65535);H-- >0;)U[U.l++]=J[z++]}return U.l}function W(J,U){for(var z=0,H=0,se=ge?new Uint16Array(32768):[];H<J.length;){var ue=Math.min(65535,J.length-H);if(ue<10){for(z=He(U,z,+(H+ue==J.length)),z&7&&(z+=8-(z&7)),U.l=z/8|0,U.write_shift(2,ue),U.write_shift(2,~ue&65535);ue-- >0;)U[U.l++]=J[H++];z=U.l*8;continue}z=He(U,z,+(H+ue==J.length)+2);for(var me=0;ue-- >0;){var le=J[H];me=(me<<5^le)&32767;var pe=-1,De=0;if((pe=se[me])&&(pe|=H&-32768,pe>H&&(pe-=32768),pe<H))for(;J[pe+De]==J[H+De]&&De<250;)++De;if(De>2){le=b[De],le<=22?z=yt(U,z,oe[le+1]>>1)-1:(yt(U,z,3),z+=5,yt(U,z,oe[le-23]>>5),z+=3);var ke=le<8?0:le-4>>2;ke>0&&(lt(U,z,De-Y[le]),z+=ke),le=S[H-pe],z=yt(U,z,oe[le]>>3),z-=3;var Me=le<4?0:le-2>>1;Me>0&&(lt(U,z,H-pe-xe[le]),z+=Me);for(var Tt=0;Tt<De;++Tt)se[me]=H&32767,me=(me<<5^J[H])&32767,++H;ue-=De-1}else le<=143?le=le+48:z=Lt(U,z,1),z=yt(U,z,oe[le]),se[me]=H&32767,++H}z=yt(U,z,0)-1}return U.l=(z+7)/8|0,U.l}return function(U,z){return U.length<8?A(U,z):W(U,z)}})();function Gt(v){var S=q(50+Math.floor(v.length*1.1)),T=Rt(v,S);return S.slice(0,T)}var Sr=ge?new Uint16Array(32768):Ye(32768),mt=ge?new Uint16Array(32768):Ye(32768),gr=ge?new Uint16Array(128):Ye(128),mr=1,ir=1;function Ct(v,S){var T=Ue(v,S)+257;S+=5;var _=Ue(v,S)+1;S+=5;var b=ht(v,S)+4;S+=4;for(var A=0,W=ge?new Uint8Array(19):Ye(19),J=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],U=1,z=ge?new Uint8Array(8):Ye(8),H=ge?new Uint8Array(8):Ye(8),se=W.length,ue=0;ue<b;++ue)W[R[ue]]=A=Ae(v,S),U<A&&(U=A),z[A]++,S+=3;var me=0;for(z[0]=0,ue=1;ue<=U;++ue)H[ue]=me=me+z[ue-1]<<1;for(ue=0;ue<se;++ue)(me=W[ue])!=0&&(J[ue]=H[me]++);var le=0;for(ue=0;ue<se;++ue)if(le=W[ue],le!=0){me=oe[J[ue]]>>8-le;for(var pe=(1<<7-le)-1;pe>=0;--pe)gr[me|pe<<le]=le&7|ue<<3}var De=[];for(U=1;De.length<T+_;)switch(me=gr[de(v,S)],S+=me&7,me>>>=3){case 16:for(A=3+Xe(v,S),S+=2,me=De[De.length-1];A-- >0;)De.push(me);break;case 17:for(A=3+Ae(v,S),S+=3;A-- >0;)De.push(0);break;case 18:for(A=11+de(v,S),S+=7;A-- >0;)De.push(0);break;default:De.push(me),U<me&&(U=me);break}var ke=De.slice(0,T),Me=De.slice(T);for(ue=T;ue<286;++ue)ke[ue]=0;for(ue=_;ue<30;++ue)Me[ue]=0;return mr=Ht(ke,Sr,286),ir=Ht(Me,mt,30),S}function Ge(v,S){if(v[0]==3&&!(v[1]&3))return[Gr(S),2];for(var T=0,_=0,b=ca(S||1<<18),A=0,W=b.length>>>0,J=0,U=0;(_&1)==0;){if(_=Ae(v,T),T+=3,_>>>1)_>>1==1?(J=9,U=5):(T=Ct(v,T),J=mr,U=ir);else{T&7&&(T+=8-(T&7));var z=v[T>>>3]|v[(T>>>3)+1]<<8;if(T+=32,z>0)for(!S&&W<A+z&&(b=gt(b,A+z),W=b.length);z-- >0;)b[A++]=v[T>>>3],T+=8;continue}for(;;){!S&&W<A+32767&&(b=gt(b,A+32767),W=b.length);var H=st(v,T,J),se=_>>>1==1?wt[H]:Sr[H];if(T+=se&15,se>>>=4,(se>>>8&255)===0)b[A++]=se;else{if(se==256)break;se-=257;var ue=se<8?0:se-4>>2;ue>5&&(ue=0);var me=A+Y[se];ue>0&&(me+=st(v,T,ue),T+=ue),H=st(v,T,U),se=_>>>1==1?$t[H]:mt[H],T+=se&15,se>>>=4;var le=se<4?0:se-2>>1,pe=xe[se];for(le>0&&(pe+=st(v,T,le),T+=le),!S&&W<me&&(b=gt(b,me+100),W=b.length);A<me;)b[A]=b[A-pe],++A}}}return S?[b,T+7>>>3]:[b.slice(0,A),T+7>>>3]}function Jt(v,S){var T=v.slice(v.l||0),_=Ge(T,S);return v.l+=_[1],_[0]}function bt(v,S){if(v)typeof console<"u"&&console.error(S);else throw new Error(S)}function Bt(v,S){var T=v;er(T,0);var _=[],b=[],A={FileIndex:_,FullPaths:b};k(A,{root:S.root});for(var W=T.length-4;(T[W]!=80||T[W+1]!=75||T[W+2]!=5||T[W+3]!=6)&&W>=0;)--W;T.l=W+4,T.l+=4;var J=T.read_shift(2);T.l+=6;var U=T.read_shift(4);for(T.l=U,W=0;W<J;++W){T.l+=20;var z=T.read_shift(4),H=T.read_shift(4),se=T.read_shift(2),ue=T.read_shift(2),me=T.read_shift(2);T.l+=8;var le=T.read_shift(4),pe=c(T.slice(T.l+se,T.l+se+ue));T.l+=se+ue+me;var De=T.l;T.l=le+4,ie(T,z,H,A,pe),T.l=De}return A}function ie(v,S,T,_,b){v.l+=2;var A=v.read_shift(2),W=v.read_shift(2),J=a(v);if(A&8257)throw new Error("Unsupported ZIP encryption");for(var U=v.read_shift(4),z=v.read_shift(4),H=v.read_shift(4),se=v.read_shift(2),ue=v.read_shift(2),me="",le=0;le<se;++le)me+=String.fromCharCode(v[v.l++]);if(ue){var pe=c(v.slice(v.l,v.l+ue));(pe[21589]||{}).mt&&(J=pe[21589].mt),((b||{})[21589]||{}).mt&&(J=b[21589].mt)}v.l+=ue;var De=v.slice(v.l,v.l+z);switch(W){case 8:De=P(v,H);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+W)}var ke=!1;A&8&&(U=v.read_shift(4),U==134695760&&(U=v.read_shift(4),ke=!0),z=v.read_shift(4),H=v.read_shift(4)),z!=S&&bt(ke,"Bad compressed size: "+S+" != "+z),H!=T&&bt(ke,"Bad uncompressed size: "+T+" != "+H),he(_,me,De,{unsafe:!0,mt:J})}function Pt(v,S){var T=S||{},_=[],b=[],A=q(1),W=T.compression?8:0,J=0,U=0,z=0,H=0,se=0,ue=v.FullPaths[0],me=ue,le=v.FileIndex[0],pe=[],De=0;for(U=1;U<v.FullPaths.length;++U)if(me=v.FullPaths[U].slice(ue.length),le=v.FileIndex[U],!(!le.size||!le.content||me=="Sh33tJ5")){var ke=H,Me=q(me.length);for(z=0;z<me.length;++z)Me.write_shift(1,me.charCodeAt(z)&127);Me=Me.slice(0,Me.l),pe[se]=Rf.buf(le.content,0);var Tt=le.content;W==8&&(Tt=I(Tt)),A=q(30),A.write_shift(4,67324752),A.write_shift(2,20),A.write_shift(2,J),A.write_shift(2,W),le.mt?s(A,le.mt):A.write_shift(4,0),A.write_shift(-4,pe[se]),A.write_shift(4,Tt.length),A.write_shift(4,le.content.length),A.write_shift(2,Me.length),A.write_shift(2,0),H+=A.length,_.push(A),H+=Me.length,_.push(Me),H+=Tt.length,_.push(Tt),A=q(46),A.write_shift(4,33639248),A.write_shift(2,0),A.write_shift(2,20),A.write_shift(2,J),A.write_shift(2,W),A.write_shift(4,0),A.write_shift(-4,pe[se]),A.write_shift(4,Tt.length),A.write_shift(4,le.content.length),A.write_shift(2,Me.length),A.write_shift(2,0),A.write_shift(2,0),A.write_shift(2,0),A.write_shift(2,0),A.write_shift(4,0),A.write_shift(4,ke),De+=A.l,b.push(A),De+=Me.length,b.push(Me),++se}return A=q(22),A.write_shift(4,101010256),A.write_shift(2,0),A.write_shift(2,0),A.write_shift(2,se),A.write_shift(2,se),A.write_shift(4,De),A.write_shift(4,H),A.write_shift(2,0),Ot([Ot(_),Ot(b),A])}var Be={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function we(v,S){if(v.ctype)return v.ctype;var T=v.name||"",_=T.match(/\.([^\.]+)$/);return _&&Be[_[1]]||S&&(_=(T=S).match(/[\.\\]([^\.\\])+$/),_&&Be[_[1]])?Be[_[1]]:"application/octet-stream"}function Ke(v){for(var S=jn(v),T=[],_=0;_<S.length;_+=76)T.push(S.slice(_,_+76));return T.join(`\r
|
|
2
2
|
`)+`\r
|
|
3
|
-
`}function
|
|
4
|
-
`&&(
|
|
5
|
-
=0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var
|
|
6
|
-
`),
|
|
7
|
-
`)}function
|
|
8
|
-
`))}function
|
|
9
|
-
`),
|
|
10
|
-
`),
|
|
11
|
-
`)}function
|
|
12
|
-
`,
|
|
13
|
-
`).replace(/<[^>]*>/g,""),i=0;i<e.length;++i)n=n.replace(e[i][0],e[i][1]);return n}})(),S0=/(^\s|\s$|\n)/;function Zt(e,t){return"<"+e+(t.match(S0)?' xml:space="preserve"':"")+">"+t+"</"+e+">"}function Si(e){return er(e).map(function(t){return" "+t+'="'+e[t]+'"'}).join("")}function xe(e,t,r){return"<"+e+(r!=null?Si(r):"")+(t!=null?(t.match(S0)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function Aa(e,t){try{return e.toISOString().replace(/\.\d*/,"")}catch(r){if(t)throw r}return""}function Gh(e,t){switch(typeof e){case"string":var r=xe("vt:lpwstr",lt(e));return r=r.replace(/"/g,"_x0022_"),r;case"number":return xe((e|0)==e?"vt:i4":"vt:r8",lt(String(e)));case"boolean":return xe("vt:bool",e?"true":"false")}if(e instanceof Date)return xe("vt:filetime",Aa(e));throw new Error("Unable to serialize "+e)}var Wt={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},Jn=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"],vr={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function Yh(e,t){for(var r=1-2*(e[t+7]>>>7),n=((e[t+7]&127)<<4)+(e[t+6]>>>4&15),i=e[t+6]&15,s=5;s>=0;--s)i=i*256+e[t+s];return n==2047?i==0?r*(1/0):NaN:(n==0?n=-1022:(n-=1023,i+=Math.pow(2,52)),r*Math.pow(2,n-52)*i)}function Xh(e,t,r){var n=(t<0||1/t==-1/0?1:0)<<7,i=0,s=0,a=n?-t:t;isFinite(a)?a==0?i=s=0:(i=Math.floor(Math.log(a)/Math.LN2),s=a*Math.pow(2,52-i),i<=-1023&&(!isFinite(s)||s<Math.pow(2,52))?i=-1022:(s-=Math.pow(2,52),i+=1023)):(i=2047,s=isNaN(t)?26985:0);for(var o=0;o<=5;++o,s/=256)e[r+o]=s&255;e[r+6]=(i&15)<<4|s&15,e[r+7]=i>>4|n}var ul=function(e){for(var t=[],r=10240,n=0;n<e[0].length;++n)if(e[0][n])for(var i=0,s=e[0][n].length;i<s;i+=r)t.push.apply(t,e[0][n].slice(i,i+r));return t},fl=Ze?function(e){return e[0].length>0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0].map(function(t){return Buffer.isBuffer(t)?t:Zr(t)})):ul(e)}:ul,dl=function(e,t,r){for(var n=[],i=t;i<r;i+=2)n.push(String.fromCharCode(oi(e,i)));return n.join("").replace(ui,"")},Za=Ze?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf16le",t,r).replace(ui,""):dl(e,t,r)}:dl,hl=function(e,t,r){for(var n=[],i=t;i<t+r;++i)n.push(("0"+e[i].toString(16)).slice(-2));return n.join("")},E0=Ze?function(e,t,r){return Buffer.isBuffer(e)?e.toString("hex",t,t+r):hl(e,t,r)}:hl,pl=function(e,t,r){for(var n=[],i=t;i<r;i++)n.push(String.fromCharCode(Vn(e,i)));return n.join("")},ki=Ze?function(t,r,n){return Buffer.isBuffer(t)?t.toString("utf8",r,n):pl(t,r,n)}:pl,_0=function(e,t){var r=yr(e,t);return r>0?ki(e,t+4,t+4+r-1):""},b0=_0,C0=function(e,t){var r=yr(e,t);return r>0?ki(e,t+4,t+4+r-1):""},A0=C0,O0=function(e,t){var r=2*yr(e,t);return r>0?ki(e,t+4,t+4+r-1):""},D0=O0,k0=function(t,r){var n=yr(t,r);return n>0?Za(t,r+4,r+4+n):""},I0=k0,F0=function(e,t){var r=yr(e,t);return r>0?ki(e,t+4,t+4+r):""},N0=F0,R0=function(e,t){return Yh(e,t)},us=R0,Qa=function(t){return Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array};Ze&&(b0=function(t,r){if(!Buffer.isBuffer(t))return _0(t,r);var n=t.readUInt32LE(r);return n>0?t.toString("utf8",r+4,r+4+n-1):""},A0=function(t,r){if(!Buffer.isBuffer(t))return C0(t,r);var n=t.readUInt32LE(r);return n>0?t.toString("utf8",r+4,r+4+n-1):""},D0=function(t,r){if(!Buffer.isBuffer(t))return O0(t,r);var n=2*t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+n-1)},I0=function(t,r){if(!Buffer.isBuffer(t))return k0(t,r);var n=t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+n)},N0=function(t,r){if(!Buffer.isBuffer(t))return F0(t,r);var n=t.readUInt32LE(r);return t.toString("utf8",r+4,r+4+n)},us=function(t,r){return Buffer.isBuffer(t)?t.readDoubleLE(r):R0(t,r)},Qa=function(t){return Buffer.isBuffer(t)||Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array});var Vn=function(e,t){return e[t]},oi=function(e,t){return e[t+1]*256+e[t]},Kh=function(e,t){var r=e[t+1]*256+e[t];return r<32768?r:(65535-r+1)*-1},yr=function(e,t){return e[t+3]*(1<<24)+(e[t+2]<<16)+(e[t+1]<<8)+e[t]},mn=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},qh=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function di(e,t){var r="",n,i,s=[],a,o,f,u;switch(t){case"dbcs":if(u=this.l,Ze&&Buffer.isBuffer(this))r=this.slice(this.l,this.l+2*e).toString("utf16le");else for(f=0;f<e;++f)r+=String.fromCharCode(oi(this,u)),u+=2;e*=2;break;case"utf8":r=ki(this,this.l,this.l+e);break;case"utf16le":e*=2,r=Za(this,this.l,this.l+e);break;case"wstr":return di.call(this,e,"dbcs");case"lpstr-ansi":r=b0(this,this.l),e=4+yr(this,this.l);break;case"lpstr-cp":r=A0(this,this.l),e=4+yr(this,this.l);break;case"lpwstr":r=D0(this,this.l),e=4+2*yr(this,this.l);break;case"lpp4":e=4+yr(this,this.l),r=I0(this,this.l),e&2&&(e+=2);break;case"8lpp4":e=4+yr(this,this.l),r=N0(this,this.l),e&3&&(e+=4-(e&3));break;case"cstr":for(e=0,r="";(a=Vn(this,this.l+e++))!==0;)s.push(Bi(a));r=s.join("");break;case"_wstr":for(e=0,r="";(a=oi(this,this.l+e))!==0;)s.push(Bi(a)),e+=2;e+=2,r=s.join("");break;case"dbcs-cont":for(r="",u=this.l,f=0;f<e;++f){if(this.lens&&this.lens.indexOf(u)!==-1)return a=Vn(this,u),this.l=u+1,o=di.call(this,e-f,a?"dbcs-cont":"sbcs-cont"),s.join("")+o;s.push(Bi(oi(this,u))),u+=2}r=s.join(""),e*=2;break;case"cpstr":case"sbcs-cont":for(r="",u=this.l,f=0;f!=e;++f){if(this.lens&&this.lens.indexOf(u)!==-1)return a=Vn(this,u),this.l=u+1,o=di.call(this,e-f,a?"dbcs-cont":"sbcs-cont"),s.join("")+o;s.push(Bi(Vn(this,u))),u+=1}r=s.join("");break;default:switch(e){case 1:return n=Vn(this,this.l),this.l++,n;case 2:return n=(t==="i"?Kh:oi)(this,this.l),this.l+=2,n;case 4:case-4:return t==="i"||(this[this.l+3]&128)===0?(n=(e>0?mn:qh)(this,this.l),this.l+=4,n):(i=yr(this,this.l),this.l+=4,i);case 8:case-8:if(t==="f")return e==8?i=us(this,this.l):i=us([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,i;e=8;case 16:r=E0(this,this.l,e);break}}return this.l+=e,r}var Jh=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24&255},Zh=function(e,t,r){e[r]=t&255,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},Qh=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255};function ep(e,t,r){var n=0,i=0;if(r==="dbcs"){for(i=0;i!=t.length;++i)Qh(this,t.charCodeAt(i),this.l+2*i);n=2*t.length}else if(r==="sbcs"){for(t=t.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=t.length;++i)this[this.l+i]=t.charCodeAt(i)&255;n=t.length}else if(r==="hex"){for(;i<e;++i)this[this.l++]=parseInt(t.slice(2*i,2*i+2),16)||0;return this}else if(r==="utf16le"){var s=Math.min(this.l+e,this.length);for(i=0;i<Math.min(t.length,e);++i){var a=t.charCodeAt(i);this[this.l++]=a&255,this[this.l++]=a>>8}for(;this.l<s;)this[this.l++]=0;return this}else switch(e){case 1:n=1,this[this.l]=t&255;break;case 2:n=2,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255;break;case 3:n=3,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255,t>>>=8,this[this.l+2]=t&255;break;case 4:n=4,Jh(this,t,this.l);break;case 8:if(n=8,r==="f"){Xh(this,t,this.l);break}case 16:break;case-4:n=4,Zh(this,t,this.l);break}return this.l+=n,this}function P0(e,t){var r=E0(this,this.l,e.length>>1);if(r!==e)throw new Error(t+"Expected "+e+" saw "+r);this.l+=e.length>>1}function xr(e,t){e.l=t,e.read_shift=di,e.chk=P0,e.write_shift=ep}function Wr(e,t){e.l+=t}function re(e){var t=yn(e);return xr(t,0),t}function fr(){var e=[],t=Ze?256:2048,r=function(u){var d=re(u);return xr(d,0),d},n=r(t),i=function(){n&&(n.length>n.l&&(n=n.slice(0,n.l),n.l=n.length),n.length>0&&e.push(n),n=null)},s=function(u){return n&&u<n.length-n.l?n:(i(),n=r(Math.max(u+1,t)))},a=function(){return i(),Jt(e)},o=function(u){i(),n=u,n.l==null&&(n.l=n.length),s(t)};return{next:s,push:o,end:a,_bufs:e}}function de(e,t,r,n){var i=+t,s;if(!isNaN(i)){n||(n=Yv[i].p||(r||[]).length||0),s=1+(i>=128?1:0)+1,n>=128&&++s,n>=16384&&++s,n>=2097152&&++s;var a=e.next(s);i<=127?a.write_shift(1,i):(a.write_shift(1,(i&127)+128),a.write_shift(1,i>>7));for(var o=0;o!=4;++o)if(n>=128)a.write_shift(1,(n&127)+128),n>>=7;else{a.write_shift(1,n);break}n>0&&Qa(r)&&e.push(r)}}function hi(e,t,r){var n=hr(e);if(t.s?(n.cRel&&(n.c+=t.s.c),n.rRel&&(n.r+=t.s.r)):(n.cRel&&(n.c+=t.c),n.rRel&&(n.r+=t.r)),!r||r.biff<12){for(;n.c>=256;)n.c-=256;for(;n.r>=65536;)n.r-=65536}return n}function gl(e,t,r){var n=hr(e);return n.s=hi(n.s,t.s,r),n.e=hi(n.e,t.s,r),n}function pi(e,t){if(e.cRel&&e.c<0)for(e=hr(e);e.c<0;)e.c+=t>8?16384:256;if(e.rRel&&e.r<0)for(e=hr(e);e.r<0;)e.r+=t>8?1048576:t>5?65536:16384;var r=ct(e);return!e.cRel&&e.cRel!=null&&(r=np(r)),!e.rRel&&e.rRel!=null&&(r=tp(r)),r}function ra(e,t){return e.s.r==0&&!e.s.rRel&&e.e.r==(t.biff>=12?1048575:t.biff>=8?65536:16384)&&!e.e.rRel?(e.s.cRel?"":"$")+rr(e.s.c)+":"+(e.e.cRel?"":"$")+rr(e.e.c):e.s.c==0&&!e.s.cRel&&e.e.c==(t.biff>=12?16383:255)&&!e.e.cRel?(e.s.rRel?"":"$")+Qt(e.s.r)+":"+(e.e.rRel?"":"$")+Qt(e.e.r):pi(e.s,t.biff)+":"+pi(e.e,t.biff)}function eo(e){return parseInt(rp(e),10)-1}function Qt(e){return""+(e+1)}function tp(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function rp(e){return e.replace(/\$(\d+)$/,"$1")}function to(e){for(var t=ip(e),r=0,n=0;n!==t.length;++n)r=26*r+t.charCodeAt(n)-64;return r-1}function rr(e){if(e<0)throw new Error("invalid column "+e);var t="";for(++e;e;e=Math.floor((e-1)/26))t=String.fromCharCode((e-1)%26+65)+t;return t}function np(e){return e.replace(/^([A-Z])/,"$$$1")}function ip(e){return e.replace(/^\$([A-Z])/,"$1")}function sp(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function Vt(e){for(var t=0,r=0,n=0;n<e.length;++n){var i=e.charCodeAt(n);i>=48&&i<=57?t=10*t+(i-48):i>=65&&i<=90&&(r=26*r+(i-64))}return{c:r-1,r:t-1}}function ct(e){for(var t=e.c+1,r="";t;t=(t-1)/26|0)r=String.fromCharCode((t-1)%26+65)+r;return r+(e.r+1)}function Sr(e){var t=e.indexOf(":");return t==-1?{s:Vt(e),e:Vt(e)}:{s:Vt(e.slice(0,t)),e:Vt(e.slice(t+1))}}function jt(e,t){return typeof t>"u"||typeof t=="number"?jt(e.s,e.e):(typeof e!="string"&&(e=ct(e)),typeof t!="string"&&(t=ct(t)),e==t?e:e+":"+t)}function wt(e){var t={s:{c:0,r:0},e:{c:0,r:0}},r=0,n=0,i=0,s=e.length;for(r=0;n<s&&!((i=e.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(t.s.c=--r,r=0;n<s&&!((i=e.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;if(t.s.r=--r,n===s||i!=10)return t.e.c=t.s.c,t.e.r=t.s.r,t;for(++n,r=0;n!=s&&!((i=e.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(t.e.c=--r,r=0;n!=s&&!((i=e.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;return t.e.r=--r,t}function ml(e,t){var r=e.t=="d"&&t instanceof Date;if(e.z!=null)try{return e.w=an(e.z,r?dr(t):t)}catch{}try{return e.w=an((e.XF||{}).numFmtId||(r?14:0),r?dr(t):t)}catch{return""+t}}function qr(e,t,r){return e==null||e.t==null||e.t=="z"?"":e.w!==void 0?e.w:(e.t=="d"&&!e.z&&r&&r.dateNF&&(e.z=r.dateNF),e.t=="e"?Ii[e.v]||e.v:t==null?ml(e,e.v):ml(e,t))}function bn(e,t){var r=t&&t.sheet?t.sheet:"Sheet1",n={};return n[r]=e,{SheetNames:[r],Sheets:n}}function j0(e,t,r){var n=r||{},i=e?Array.isArray(e):n.dense,s=e||(i?[]:{}),a=0,o=0;if(s&&n.origin!=null){if(typeof n.origin=="number")a=n.origin;else{var f=typeof n.origin=="string"?Vt(n.origin):n.origin;a=f.r,o=f.c}s["!ref"]||(s["!ref"]="A1:A1")}var u={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(s["!ref"]){var d=wt(s["!ref"]);u.s.c=d.s.c,u.s.r=d.s.r,u.e.c=Math.max(u.e.c,d.e.c),u.e.r=Math.max(u.e.r,d.e.r),a==-1&&(u.e.r=a=d.e.r+1)}for(var h=0;h!=t.length;++h)if(t[h]){if(!Array.isArray(t[h]))throw new Error("aoa_to_sheet expects an array of arrays");for(var m=0;m!=t[h].length;++m)if(!(typeof t[h][m]>"u")){var l={v:t[h][m]},v=a+h,g=o+m;if(u.s.r>v&&(u.s.r=v),u.s.c>g&&(u.s.c=g),u.e.r<v&&(u.e.r=v),u.e.c<g&&(u.e.c=g),t[h][m]&&typeof t[h][m]=="object"&&!Array.isArray(t[h][m])&&!(t[h][m]instanceof Date))l=t[h][m];else if(Array.isArray(l.v)&&(l.f=t[h][m][1],l.v=l.v[0]),l.v===null)if(l.f)l.t="n";else if(n.nullError)l.t="e",l.v=0;else if(n.sheetStubs)l.t="z";else continue;else typeof l.v=="number"?l.t="n":typeof l.v=="boolean"?l.t="b":l.v instanceof Date?(l.z=n.dateNF||Dt[14],n.cellDates?(l.t="d",l.w=an(l.z,dr(l.v))):(l.t="n",l.v=dr(l.v),l.w=an(l.z,l.v))):l.t="s";if(i)s[v]||(s[v]=[]),s[v][g]&&s[v][g].z&&(l.z=s[v][g].z),s[v][g]=l;else{var x=ct({c:g,r:v});s[x]&&s[x].z&&(l.z=s[x].z),s[x]=l}}}return u.s.c<1e7&&(s["!ref"]=jt(u)),s}function Zn(e,t){return j0(null,e,t)}function ap(e){return e.read_shift(4,"i")}function Pr(e,t){return t||(t=re(4)),t.write_shift(4,e),t}function nr(e){var t=e.read_shift(4);return t===0?"":e.read_shift(t,"dbcs")}function zt(e,t){var r=!1;return t==null&&(r=!0,t=re(4+2*e.length)),t.write_shift(4,e.length),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}function op(e){return{ich:e.read_shift(2),ifnt:e.read_shift(2)}}function lp(e,t){return t||(t=re(4)),t.write_shift(2,0),t.write_shift(2,0),t}function ro(e,t){var r=e.l,n=e.read_shift(1),i=nr(e),s=[],a={t:i,h:i};if((n&1)!==0){for(var o=e.read_shift(4),f=0;f!=o;++f)s.push(op(e));a.r=s}else a.r=[{ich:0,ifnt:0}];return e.l=r+t,a}function cp(e,t){var r=!1;return t==null&&(r=!0,t=re(15+4*e.t.length)),t.write_shift(1,0),zt(e.t,t),r?t.slice(0,t.l):t}var up=ro;function fp(e,t){var r=!1;return t==null&&(r=!0,t=re(23+4*e.t.length)),t.write_shift(1,1),zt(e.t,t),t.write_shift(4,1),lp({},t),r?t.slice(0,t.l):t}function Or(e){var t=e.read_shift(4),r=e.read_shift(2);return r+=e.read_shift(1)<<16,e.l++,{c:t,iStyleRef:r}}function Cn(e,t){return t==null&&(t=re(8)),t.write_shift(-4,e.c),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}function An(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}function On(e,t){return t==null&&(t=re(4)),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}var dp=nr,M0=zt;function no(e){var t=e.read_shift(4);return t===0||t===4294967295?"":e.read_shift(t,"dbcs")}function fs(e,t){var r=!1;return t==null&&(r=!0,t=re(127)),t.write_shift(4,e.length>0?e.length:4294967295),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}var hp=nr,Oa=no,io=fs;function L0(e){var t=e.slice(e.l,e.l+4),r=t[0]&1,n=t[0]&2;e.l+=4;var i=n===0?us([0,0,0,0,t[0]&252,t[1],t[2],t[3]],0):mn(t,0)>>2;return r?i/100:i}function B0(e,t){t==null&&(t=re(4));var r=0,n=0,i=e*100;if(e==(e|0)&&e>=-536870912&&e<1<<29?n=1:i==(i|0)&&i>=-536870912&&i<1<<29&&(n=1,r=1),n)t.write_shift(-4,((r?i:e)<<2)+(r+2));else throw new Error("unsupported RkNumber "+e)}function $0(e){var t={s:{},e:{}};return t.s.r=e.read_shift(4),t.e.r=e.read_shift(4),t.s.c=e.read_shift(4),t.e.c=e.read_shift(4),t}function pp(e,t){return t||(t=re(16)),t.write_shift(4,e.s.r),t.write_shift(4,e.e.r),t.write_shift(4,e.s.c),t.write_shift(4,e.e.c),t}var Dn=$0,Qn=pp;function ei(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function wn(e,t){return(t||re(8)).write_shift(8,e,"f")}function gp(e){var t={},r=e.read_shift(1),n=r>>>1,i=e.read_shift(1),s=e.read_shift(2,"i"),a=e.read_shift(1),o=e.read_shift(1),f=e.read_shift(1);switch(e.l++,n){case 0:t.auto=1;break;case 1:t.index=i;var u=_p[i];u&&(t.rgb=Al(u));break;case 2:t.rgb=Al([a,o,f]);break;case 3:t.theme=i;break}return s!=0&&(t.tint=s>0?s/32767:s/32768),t}function ds(e,t){if(t||(t=re(8)),!e||e.auto)return t.write_shift(4,0),t.write_shift(4,0),t;e.index!=null?(t.write_shift(1,2),t.write_shift(1,e.index)):e.theme!=null?(t.write_shift(1,6),t.write_shift(1,e.theme)):(t.write_shift(1,5),t.write_shift(1,0));var r=e.tint||0;if(r>0?r*=32767:r<0&&(r*=32768),t.write_shift(2,r),!e.rgb||e.theme!=null)t.write_shift(2,0),t.write_shift(1,0),t.write_shift(1,0);else{var n=e.rgb||"FFFFFF";typeof n=="number"&&(n=("000000"+n.toString(16)).slice(-6)),t.write_shift(1,parseInt(n.slice(0,2),16)),t.write_shift(1,parseInt(n.slice(2,4),16)),t.write_shift(1,parseInt(n.slice(4,6),16)),t.write_shift(1,255)}return t}function mp(e){var t=e.read_shift(1);e.l++;var r={fBold:t&1,fItalic:t&2,fUnderline:t&4,fStrikeout:t&8,fOutline:t&16,fShadow:t&32,fCondense:t&64,fExtend:t&128};return r}function xp(e,t){t||(t=re(2));var r=(e.italic?2:0)|(e.strike?8:0)|(e.outline?16:0)|(e.shadow?32:0)|(e.condense?64:0)|(e.extend?128:0);return t.write_shift(1,r),t.write_shift(1,0),t}var U0=2,mr=3,Vi=11,hs=19,zi=64,vp=65,yp=71,wp=4108,Tp=4126,qt=80,xl={1:{n:"CodePage",t:U0},2:{n:"Category",t:qt},3:{n:"PresentationFormat",t:qt},4:{n:"ByteCount",t:mr},5:{n:"LineCount",t:mr},6:{n:"ParagraphCount",t:mr},7:{n:"SlideCount",t:mr},8:{n:"NoteCount",t:mr},9:{n:"HiddenCount",t:mr},10:{n:"MultimediaClipCount",t:mr},11:{n:"ScaleCrop",t:Vi},12:{n:"HeadingPairs",t:wp},13:{n:"TitlesOfParts",t:Tp},14:{n:"Manager",t:qt},15:{n:"Company",t:qt},16:{n:"LinksUpToDate",t:Vi},17:{n:"CharacterCount",t:mr},19:{n:"SharedDoc",t:Vi},22:{n:"HyperlinksChanged",t:Vi},23:{n:"AppVersion",t:mr,p:"version"},24:{n:"DigSig",t:vp},26:{n:"ContentType",t:qt},27:{n:"ContentStatus",t:qt},28:{n:"Language",t:qt},29:{n:"Version",t:qt},255:{},2147483648:{n:"Locale",t:hs},2147483651:{n:"Behavior",t:hs},1919054434:{}},vl={1:{n:"CodePage",t:U0},2:{n:"Title",t:qt},3:{n:"Subject",t:qt},4:{n:"Author",t:qt},5:{n:"Keywords",t:qt},6:{n:"Comments",t:qt},7:{n:"Template",t:qt},8:{n:"LastAuthor",t:qt},9:{n:"RevNumber",t:qt},10:{n:"EditTime",t:zi},11:{n:"LastPrinted",t:zi},12:{n:"CreatedDate",t:zi},13:{n:"ModifiedDate",t:zi},14:{n:"PageCount",t:mr},15:{n:"WordCount",t:mr},16:{n:"CharCount",t:mr},17:{n:"Thumbnail",t:yp},18:{n:"Application",t:qt},19:{n:"DocSecurity",t:mr},255:{},2147483648:{n:"Locale",t:hs},2147483651:{n:"Behavior",t:hs},1919054434:{}};function Sp(e){return e.map(function(t){return[t>>16&255,t>>8&255,t&255]})}var Ep=Sp([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),_p=hr(Ep),Ii={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},bp={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},Hi={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},metadata:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",xlsb:"application/vnd.ms-excel.sheetMetadata"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};function W0(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function V0(e,t){var r=Ph(bp),n=[],i;n[n.length]=Mt,n[n.length]=xe("Types",null,{xmlns:Wt.CT,"xmlns:xsd":Wt.xsd,"xmlns:xsi":Wt.xsi}),n=n.concat([["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels","application/vnd.openxmlformats-package.relationships+xml"]].map(function(f){return xe("Default",null,{Extension:f[0],ContentType:f[1]})}));var s=function(f){e[f]&&e[f].length>0&&(i=e[f][0],n[n.length]=xe("Override",null,{PartName:(i[0]=="/"?"":"/")+i,ContentType:Hi[f][t.bookType]||Hi[f].xlsx}))},a=function(f){(e[f]||[]).forEach(function(u){n[n.length]=xe("Override",null,{PartName:(u[0]=="/"?"":"/")+u,ContentType:Hi[f][t.bookType]||Hi[f].xlsx})})},o=function(f){(e[f]||[]).forEach(function(u){n[n.length]=xe("Override",null,{PartName:(u[0]=="/"?"":"/")+u,ContentType:r[f][0]})})};return s("workbooks"),a("sheets"),a("charts"),o("themes"),["strs","styles"].forEach(s),["coreprops","extprops","custprops"].forEach(o),o("vba"),o("comments"),o("threadedcomments"),o("drawings"),a("metadata"),o("people"),n.length>2&&(n[n.length]="</Types>",n[1]=n[1].replace("/>",">")),n.join("")}var Ke={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function z0(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function Gn(e){var t=[Mt,xe("Relationships",null,{xmlns:Wt.RELS})];return er(e["!id"]).forEach(function(r){t[t.length]=xe("Relationship",null,e["!id"][r])}),t.length>2&&(t[t.length]="</Relationships>",t[1]=t[1].replace("/>",">")),t.join("")}function ot(e,t,r,n,i,s){if(i||(i={}),e["!id"]||(e["!id"]={}),e["!idx"]||(e["!idx"]=1),t<0)for(t=e["!idx"];e["!id"]["rId"+t];++t);if(e["!idx"]=t+1,i.Id="rId"+t,i.Type=n,i.Target=r,[Ke.HLINK,Ke.XPATH,Ke.XMISS].indexOf(i.Type)>-1&&(i.TargetMode="External"),e["!id"][i.Id])throw new Error("Cannot rewrite rId "+t);return e["!id"][i.Id]=i,e[("/"+i.Target).replace("//","/")]=i,t}function Cp(e){var t=[Mt];t.push(`<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">
|
|
3
|
+
`}function We(v){var S=v.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(z){var H=z.charCodeAt(0).toString(16).toUpperCase();return"="+(H.length==1?"0"+H:H)});S=S.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),S.charAt(0)==`
|
|
4
|
+
`&&(S="=0D"+S.slice(1)),S=S.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
|
|
5
|
+
=0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var T=[],_=S.split(`\r
|
|
6
|
+
`),b=0;b<_.length;++b){var A=_[b];if(A.length==0){T.push("");continue}for(var W=0;W<A.length;){var J=76,U=A.slice(W,W+J);U.charAt(J-1)=="="?J--:U.charAt(J-2)=="="?J-=2:U.charAt(J-3)=="="&&(J-=3),U=A.slice(W,W+J),W+=J,W<A.length&&(U+="="),T.push(U)}}return T.join(`\r
|
|
7
|
+
`)}function at(v){for(var S=[],T=0;T<v.length;++T){for(var _=v[T];T<=v.length&&_.charAt(_.length-1)=="=";)_=_.slice(0,_.length-1)+v[++T];S.push(_)}for(var b=0;b<S.length;++b)S[b]=S[b].replace(/[=][0-9A-Fa-f]{2}/g,function(A){return String.fromCharCode(parseInt(A.slice(1),16))});return dr(S.join(`\r
|
|
8
|
+
`))}function Ut(v,S,T){for(var _="",b="",A="",W,J=0;J<10;++J){var U=S[J];if(!U||U.match(/^\s*$/))break;var z=U.match(/^(.*?):\s*([^\s].*)$/);if(z)switch(z[1].toLowerCase()){case"content-location":_=z[2].trim();break;case"content-type":A=z[2].trim();break;case"content-transfer-encoding":b=z[2].trim();break}}switch(++J,b.toLowerCase()){case"base64":W=dr(kr(S.slice(J).join("")));break;case"quoted-printable":W=at(S.slice(J));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+b)}var H=he(v,_.slice(T.length),W,{unsafe:!0});A&&(H.ctype=A)}function nt(v,S){if(be(v.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var T=S&&S.root||"",_=($e&&Buffer.isBuffer(v)?v.toString("binary"):be(v)).split(`\r
|
|
9
|
+
`),b=0,A="";for(b=0;b<_.length;++b)if(A=_[b],!!/^Content-Location:/i.test(A)&&(A=A.slice(A.indexOf("file")),T||(T=A.slice(0,A.lastIndexOf("/")+1)),A.slice(0,T.length)!=T))for(;T.length>0&&(T=T.slice(0,T.length-1),T=T.slice(0,T.lastIndexOf("/")+1),A.slice(0,T.length)!=T););var W=(_[1]||"").match(/boundary="(.*?)"/);if(!W)throw new Error("MAD cannot find boundary");var J="--"+(W[1]||""),U=[],z=[],H={FileIndex:U,FullPaths:z};k(H);var se,ue=0;for(b=0;b<_.length;++b){var me=_[b];me!==J&&me!==J+"--"||(ue++&&Ut(H,_.slice(se,b),T),se=b)}return H}function rt(v,S){var T=S||{},_=T.boundary||"SheetJS";_="------="+_;for(var b=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+_.slice(2)+'"',"","",""],A=v.FullPaths[0],W=A,J=v.FileIndex[0],U=1;U<v.FullPaths.length;++U)if(W=v.FullPaths[U].slice(A.length),J=v.FileIndex[U],!(!J.size||!J.content||W=="Sh33tJ5")){W=W.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(De){return"_x"+De.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(De){return"_u"+De.charCodeAt(0).toString(16)+"_"});for(var z=J.content,H=$e&&Buffer.isBuffer(z)?z.toString("binary"):be(z),se=0,ue=Math.min(1024,H.length),me=0,le=0;le<=ue;++le)(me=H.charCodeAt(le))>=32&&me<128&&++se;var pe=se>=ue*4/5;b.push(_),b.push("Content-Location: "+(T.root||"file:///C:/SheetJS/")+W),b.push("Content-Transfer-Encoding: "+(pe?"quoted-printable":"base64")),b.push("Content-Type: "+we(J,W)),b.push(""),b.push(pe?We(H):Ke(H))}return b.push(_+`--\r
|
|
10
|
+
`),b.join(`\r
|
|
11
|
+
`)}function tt(v){var S={};return k(S,v),S}function he(v,S,T,_){var b=_&&_.unsafe;b||k(v);var A=!b&&et.find(v,S);if(!A){var W=v.FullPaths[0];S.slice(0,W.length)==W?W=S:(W.slice(-1)!="/"&&(W+="/"),W=(W+S).replace("//","/")),A={name:i(S),type:2},v.FileIndex.push(A),v.FullPaths.push(W),b||et.utils.cfb_gc(v)}return A.content=T,A.size=T?T.length:0,_&&(_.CLSID&&(A.clsid=_.CLSID),_.mt&&(A.mt=_.mt),_.ct&&(A.ct=_.ct)),A}function re(v,S){k(v);var T=et.find(v,S);if(T){for(var _=0;_<v.FileIndex.length;++_)if(v.FileIndex[_]==T)return v.FileIndex.splice(_,1),v.FullPaths.splice(_,1),!0}return!1}function ye(v,S,T){k(v);var _=et.find(v,S);if(_){for(var b=0;b<v.FileIndex.length;++b)if(v.FileIndex[b]==_)return v.FileIndex[b].name=i(T),v.FullPaths[b]=T,!0}return!1}function je(v){j(v,!0)}return t.find=X,t.read=Q,t.parse=d,t.write=ze,t.writeFile=Ne,t.utils={cfb_new:tt,cfb_add:he,cfb_del:re,cfb_mov:ye,cfb_gc:je,ReadShift:kn,CheckField:dl,prep_blob:er,bconcat:Ot,use_zlib:O,_deflateRaw:Gt,_inflateRaw:Jt,consts:Se},t})();function Pf(e){return typeof e=="string"?bi(e):Array.isArray(e)?of(e):e}function Hn(e,t,r){if(typeof Deno<"u"){if(r&&typeof t=="string")switch(r){case"utf8":t=new TextEncoder(r).encode(t);break;case"binary":t=bi(t);break;default:throw new Error("Unsupported encoding "+r)}return Deno.writeFileSync(e,t)}var n=r=="utf8"?Ln(t):t;if(typeof IE_SaveFile<"u")return IE_SaveFile(n,e);if(typeof Blob<"u"){var i=new Blob([Pf(n)],{type:"application/octet-stream"});if(typeof navigator<"u"&&navigator.msSaveBlob)return navigator.msSaveBlob(i,e);if(typeof saveAs<"u")return saveAs(i,e);if(typeof URL<"u"&&typeof document<"u"&&document.createElement&&URL.createObjectURL){var s=URL.createObjectURL(i);if(typeof chrome=="object"&&typeof(chrome.downloads||{}).download=="function")return URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(s)},6e4),chrome.downloads.download({url:s,filename:e,saveAs:!0});var a=document.createElement("a");if(a.download!=null)return a.download=e,a.href=s,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(s)},6e4),s}}if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var c=File(e);return c.open("w"),c.encoding="binary",Array.isArray(t)&&(t=zn(t)),c.write(t),c.close(),t}catch(u){if(!u.message||!u.message.match(/onstruct/))throw u}throw new Error("cannot save file "+e)}function It(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;++n)Object.prototype.hasOwnProperty.call(e,t[n])&&r.push(t[n]);return r}function ma(e,t){for(var r=[],n=It(e),i=0;i!==n.length;++i)r[e[n[i]][t]]==null&&(r[e[n[i]][t]]=n[i]);return r}function Ts(e){for(var t=[],r=It(e),n=0;n!==r.length;++n)t[e[r[n]]]=r[n];return t}function Oi(e){for(var t=[],r=It(e),n=0;n!==r.length;++n)t[e[r[n]]]=parseInt(r[n],10);return t}function jf(e){for(var t=[],r=It(e),n=0;n!==r.length;++n)t[e[r[n]]]==null&&(t[e[r[n]]]=[]),t[e[r[n]]].push(r[n]);return t}var xi=new Date(1899,11,30,0,0,0);function Kt(e,t){var r=e.getTime(),n=xi.getTime()+(e.getTimezoneOffset()-xi.getTimezoneOffset())*6e4;return(r-n)/(1440*60*1e3)}var qo=new Date,Mf=xi.getTime()+(qo.getTimezoneOffset()-xi.getTimezoneOffset())*6e4,va=qo.getTimezoneOffset();function Jo(e){var t=new Date;return t.setTime(e*24*60*60*1e3+Mf),t.getTimezoneOffset()!==va&&t.setTime(t.getTime()+(t.getTimezoneOffset()-va)*6e4),t}var ya=new Date("2017-02-19T19:06:09.000Z"),Zo=isNaN(ya.getFullYear())?new Date("2/19/17"):ya,Lf=Zo.getFullYear()==2017;function zt(e,t){var r=new Date(e);if(Lf)return t>0?r.setTime(r.getTime()+r.getTimezoneOffset()*60*1e3):t<0&&r.setTime(r.getTime()-r.getTimezoneOffset()*60*1e3),r;if(e instanceof Date)return e;if(Zo.getFullYear()==1917&&!isNaN(r.getFullYear())){var n=r.getFullYear();return e.indexOf(""+n)>-1||r.setFullYear(r.getFullYear()+100),r}var i=e.match(/\d+/g)||["2017","2","19","0","0","0"],s=new Date(+i[0],+i[1]-1,+i[2],+i[3]||0,+i[4]||0,+i[5]||0);return e.indexOf("Z")>-1&&(s=new Date(s.getTime()-s.getTimezoneOffset()*60*1e3)),s}function ki(e,t){if($e&&Buffer.isBuffer(e))return e.toString("binary");if(typeof TextDecoder<"u")try{var r={"€":"","‚":"",ƒ:"","„":"","…":"
","†":"","‡":"","ˆ":"","‰":"",Š:"","‹":"",Œ:"",Ž:"","‘":"","’":"","“":"","”":"","•":"","–":"","—":"","˜":"","™":"",š:"","›":"",œ:"",ž:"",Ÿ:""};return Array.isArray(e)&&(e=new Uint8Array(e)),new TextDecoder("latin1").decode(e).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(s){return r[s]||s})}catch{}for(var n=[],i=0;i!=e.length;++i)n.push(String.fromCharCode(e[i]));return n.join("")}function qt(e){if(typeof JSON<"u"&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if(typeof e!="object"||e==null)return e;if(e instanceof Date)return new Date(e.getTime());var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=qt(e[r]));return t}function ft(e,t){for(var r="";r.length<t;)r+=e;return r}function Ar(e){var t=Number(e);if(!isNaN(t))return isFinite(t)?t:NaN;if(!/\d/.test(e))return t;var r=1,n=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return r*=100,""});return!isNaN(t=Number(n))||(n=n.replace(/[(](.*)[)]/,function(i,s){return r=-r,s}),!isNaN(t=Number(n)))?t/r:t}var Bf=["january","february","march","april","may","june","july","august","september","october","november","december"];function Mn(e){var t=new Date(e),r=new Date(NaN),n=t.getYear(),i=t.getMonth(),s=t.getDate();if(isNaN(s))return r;var a=e.toLowerCase();if(a.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(a=a.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""),a.length>3&&Bf.indexOf(a)==-1)return r}else if(a.match(/[a-z]/))return r;return n<0||n>8099?r:(i>0||s>1)&&n!=101?t:e.match(/[^-0-9:,\/\\]/)?r:t}function Pe(e,t,r){if(e.FullPaths){if(typeof r=="string"){var n;return $e?n=Ir(r):n=lf(r),et.utils.cfb_add(e,t,n)}et.utils.cfb_add(e,t,r)}else e.file(t,r)}function _s(){return et.utils.cfb_new()}var xt=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
|
|
12
|
+
`,Uf={""":'"',"'":"'",">":">","<":"<","&":"&"},Es=Ts(Uf),Ss=/[&<>'"]/g,Wf=/[\u0000-\u0008\u000b-\u001f]/g;function Ze(e){var t=e+"";return t.replace(Ss,function(r){return Es[r]}).replace(Wf,function(r){return"_x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+"_"})}function wa(e){return Ze(e).replace(/ /g,"_x0020_")}var Qo=/[\u0000-\u001f]/g;function Vf(e){var t=e+"";return t.replace(Ss,function(r){return Es[r]}).replace(/\n/g,"<br/>").replace(Qo,function(r){return"&#x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+";"})}function zf(e){var t=e+"";return t.replace(Ss,function(r){return Es[r]}).replace(Qo,function(r){return"&#x"+r.charCodeAt(0).toString(16).toUpperCase()+";"})}function Hf(e){return e.replace(/(\r\n|[\r\n])/g," ")}function $f(e){switch(e){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function $i(e){for(var t="",r=0,n=0,i=0,s=0,a=0,c=0;r<e.length;){if(n=e.charCodeAt(r++),n<128){t+=String.fromCharCode(n);continue}if(i=e.charCodeAt(r++),n>191&&n<224){a=(n&31)<<6,a|=i&63,t+=String.fromCharCode(a);continue}if(s=e.charCodeAt(r++),n<240){t+=String.fromCharCode((n&15)<<12|(i&63)<<6|s&63);continue}a=e.charCodeAt(r++),c=((n&7)<<18|(i&63)<<12|(s&63)<<6|a&63)-65536,t+=String.fromCharCode(55296+(c>>>10&1023)),t+=String.fromCharCode(56320+(c&1023))}return t}function Ta(e){var t=Gr(2*e.length),r,n,i=1,s=0,a=0,c;for(n=0;n<e.length;n+=i)i=1,(c=e.charCodeAt(n))<128?r=c:c<224?(r=(c&31)*64+(e.charCodeAt(n+1)&63),i=2):c<240?(r=(c&15)*4096+(e.charCodeAt(n+1)&63)*64+(e.charCodeAt(n+2)&63),i=3):(i=4,r=(c&7)*262144+(e.charCodeAt(n+1)&63)*4096+(e.charCodeAt(n+2)&63)*64+(e.charCodeAt(n+3)&63),r-=65536,a=55296+(r>>>10&1023),r=56320+(r&1023)),a!==0&&(t[s++]=a&255,t[s++]=a>>>8,a=0),t[s++]=r%256,t[s++]=r>>>8;return t.slice(0,s).toString("ucs2")}function _a(e){return Ir(e,"binary").toString("utf8")}var ei="foo bar bazâð£",On=$e&&(_a(ei)==$i(ei)&&_a||Ta(ei)==$i(ei)&&Ta)||$i,Ln=$e?function(e){return Ir(e,"utf8").toString("binary")}:function(e){for(var t=[],r=0,n=0,i=0;r<e.length;)switch(n=e.charCodeAt(r++),!0){case n<128:t.push(String.fromCharCode(n));break;case n<2048:t.push(String.fromCharCode(192+(n>>6))),t.push(String.fromCharCode(128+(n&63)));break;case(n>=55296&&n<57344):n-=55296,i=e.charCodeAt(r++)-56320+(n<<10),t.push(String.fromCharCode(240+(i>>18&7))),t.push(String.fromCharCode(144+(i>>12&63))),t.push(String.fromCharCode(128+(i>>6&63))),t.push(String.fromCharCode(128+(i&63)));break;default:t.push(String.fromCharCode(224+(n>>12))),t.push(String.fromCharCode(128+(n>>6&63))),t.push(String.fromCharCode(128+(n&63)))}return t.join("")},Gf=(function(){var e=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(t){return[new RegExp("&"+t[0]+";","ig"),t[1]]});return function(r){for(var n=r.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,`
|
|
13
|
+
`).replace(/<[^>]*>/g,""),i=0;i<e.length;++i)n=n.replace(e[i][0],e[i][1]);return n}})(),el=/(^\s|\s$|\n)/;function kt(e,t){return"<"+e+(t.match(el)?' xml:space="preserve"':"")+">"+t+"</"+e+">"}function Bn(e){return It(e).map(function(t){return" "+t+'="'+e[t]+'"'}).join("")}function ce(e,t,r){return"<"+e+(r!=null?Bn(r):"")+(t!=null?(t.match(el)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function as(e,t){try{return e.toISOString().replace(/\.\d*/,"")}catch(r){if(t)throw r}return""}function Xf(e,t){switch(typeof e){case"string":var r=ce("vt:lpwstr",Ze(e));return r=r.replace(/"/g,"_x0022_"),r;case"number":return ce((e|0)==e?"vt:i4":"vt:r8",Ze(String(e)));case"boolean":return ce("vt:bool",e?"true":"false")}if(e instanceof Date)return ce("vt:filetime",as(e));throw new Error("Unable to serialize "+e)}var _t={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},vn=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"],tr={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function Yf(e,t){for(var r=1-2*(e[t+7]>>>7),n=((e[t+7]&127)<<4)+(e[t+6]>>>4&15),i=e[t+6]&15,s=5;s>=0;--s)i=i*256+e[t+s];return n==2047?i==0?r*(1/0):NaN:(n==0?n=-1022:(n-=1023,i+=Math.pow(2,52)),r*Math.pow(2,n-52)*i)}function Kf(e,t,r){var n=(t<0||1/t==-1/0?1:0)<<7,i=0,s=0,a=n?-t:t;isFinite(a)?a==0?i=s=0:(i=Math.floor(Math.log(a)/Math.LN2),s=a*Math.pow(2,52-i),i<=-1023&&(!isFinite(s)||s<Math.pow(2,52))?i=-1022:(s-=Math.pow(2,52),i+=1023)):(i=2047,s=isNaN(t)?26985:0);for(var c=0;c<=5;++c,s/=256)e[r+c]=s&255;e[r+6]=(i&15)<<4|s&15,e[r+7]=i>>4|n}var Ea=function(e){for(var t=[],r=10240,n=0;n<e[0].length;++n)if(e[0][n])for(var i=0,s=e[0][n].length;i<s;i+=r)t.push.apply(t,e[0][n].slice(i,i+r));return t},Sa=$e?function(e){return e[0].length>0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0].map(function(t){return Buffer.isBuffer(t)?t:Ir(t)})):Ea(e)}:Ea,Ca=function(e,t,r){for(var n=[],i=t;i<r;i+=2)n.push(String.fromCharCode(Dn(e,i)));return n.join("").replace(An,"")},Cs=$e?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf16le",t,r).replace(An,""):Ca(e,t,r)}:Ca,ba=function(e,t,r){for(var n=[],i=t;i<t+r;++i)n.push(("0"+e[i].toString(16)).slice(-2));return n.join("")},tl=$e?function(e,t,r){return Buffer.isBuffer(e)?e.toString("hex",t,t+r):ba(e,t,r)}:ba,Da=function(e,t,r){for(var n=[],i=t;i<r;i++)n.push(String.fromCharCode(un(e,i)));return n.join("")},$n=$e?function(t,r,n){return Buffer.isBuffer(t)?t.toString("utf8",r,n):Da(t,r,n)}:Da,rl=function(e,t){var r=rr(e,t);return r>0?$n(e,t+4,t+4+r-1):""},nl=rl,il=function(e,t){var r=rr(e,t);return r>0?$n(e,t+4,t+4+r-1):""},sl=il,al=function(e,t){var r=2*rr(e,t);return r>0?$n(e,t+4,t+4+r-1):""},ol=al,ll=function(t,r){var n=rr(t,r);return n>0?Cs(t,r+4,r+4+n):""},cl=ll,fl=function(e,t){var r=rr(e,t);return r>0?$n(e,t+4,t+4+r):""},ul=fl,hl=function(e,t){return Yf(e,t)},gi=hl,bs=function(t){return Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array};$e&&(nl=function(t,r){if(!Buffer.isBuffer(t))return rl(t,r);var n=t.readUInt32LE(r);return n>0?t.toString("utf8",r+4,r+4+n-1):""},sl=function(t,r){if(!Buffer.isBuffer(t))return il(t,r);var n=t.readUInt32LE(r);return n>0?t.toString("utf8",r+4,r+4+n-1):""},ol=function(t,r){if(!Buffer.isBuffer(t))return al(t,r);var n=2*t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+n-1)},cl=function(t,r){if(!Buffer.isBuffer(t))return ll(t,r);var n=t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+n)},ul=function(t,r){if(!Buffer.isBuffer(t))return fl(t,r);var n=t.readUInt32LE(r);return t.toString("utf8",r+4,r+4+n)},gi=function(t,r){return Buffer.isBuffer(t)?t.readDoubleLE(r):hl(t,r)},bs=function(t){return Buffer.isBuffer(t)||Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array});var un=function(e,t){return e[t]},Dn=function(e,t){return e[t+1]*256+e[t]},qf=function(e,t){var r=e[t+1]*256+e[t];return r<32768?r:(65535-r+1)*-1},rr=function(e,t){return e[t+3]*(1<<24)+(e[t+2]<<16)+(e[t+1]<<8)+e[t]},Hr=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},Jf=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function kn(e,t){var r="",n,i,s=[],a,c,u,f;switch(t){case"dbcs":if(f=this.l,$e&&Buffer.isBuffer(this))r=this.slice(this.l,this.l+2*e).toString("utf16le");else for(u=0;u<e;++u)r+=String.fromCharCode(Dn(this,f)),f+=2;e*=2;break;case"utf8":r=$n(this,this.l,this.l+e);break;case"utf16le":e*=2,r=Cs(this,this.l,this.l+e);break;case"wstr":return kn.call(this,e,"dbcs");case"lpstr-ansi":r=nl(this,this.l),e=4+rr(this,this.l);break;case"lpstr-cp":r=sl(this,this.l),e=4+rr(this,this.l);break;case"lpwstr":r=ol(this,this.l),e=4+2*rr(this,this.l);break;case"lpp4":e=4+rr(this,this.l),r=cl(this,this.l),e&2&&(e+=2);break;case"8lpp4":e=4+rr(this,this.l),r=ul(this,this.l),e&3&&(e+=4-(e&3));break;case"cstr":for(e=0,r="";(a=un(this,this.l+e++))!==0;)s.push(Jn(a));r=s.join("");break;case"_wstr":for(e=0,r="";(a=Dn(this,this.l+e))!==0;)s.push(Jn(a)),e+=2;e+=2,r=s.join("");break;case"dbcs-cont":for(r="",f=this.l,u=0;u<e;++u){if(this.lens&&this.lens.indexOf(f)!==-1)return a=un(this,f),this.l=f+1,c=kn.call(this,e-u,a?"dbcs-cont":"sbcs-cont"),s.join("")+c;s.push(Jn(Dn(this,f))),f+=2}r=s.join(""),e*=2;break;case"cpstr":case"sbcs-cont":for(r="",f=this.l,u=0;u!=e;++u){if(this.lens&&this.lens.indexOf(f)!==-1)return a=un(this,f),this.l=f+1,c=kn.call(this,e-u,a?"dbcs-cont":"sbcs-cont"),s.join("")+c;s.push(Jn(un(this,f))),f+=1}r=s.join("");break;default:switch(e){case 1:return n=un(this,this.l),this.l++,n;case 2:return n=(t==="i"?qf:Dn)(this,this.l),this.l+=2,n;case 4:case-4:return t==="i"||(this[this.l+3]&128)===0?(n=(e>0?Hr:Jf)(this,this.l),this.l+=4,n):(i=rr(this,this.l),this.l+=4,i);case 8:case-8:if(t==="f")return e==8?i=gi(this,this.l):i=gi([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,i;e=8;case 16:r=tl(this,this.l,e);break}}return this.l+=e,r}var Zf=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24&255},Qf=function(e,t,r){e[r]=t&255,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},eu=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255};function tu(e,t,r){var n=0,i=0;if(r==="dbcs"){for(i=0;i!=t.length;++i)eu(this,t.charCodeAt(i),this.l+2*i);n=2*t.length}else if(r==="sbcs"){for(t=t.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=t.length;++i)this[this.l+i]=t.charCodeAt(i)&255;n=t.length}else if(r==="hex"){for(;i<e;++i)this[this.l++]=parseInt(t.slice(2*i,2*i+2),16)||0;return this}else if(r==="utf16le"){var s=Math.min(this.l+e,this.length);for(i=0;i<Math.min(t.length,e);++i){var a=t.charCodeAt(i);this[this.l++]=a&255,this[this.l++]=a>>8}for(;this.l<s;)this[this.l++]=0;return this}else switch(e){case 1:n=1,this[this.l]=t&255;break;case 2:n=2,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255;break;case 3:n=3,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255,t>>>=8,this[this.l+2]=t&255;break;case 4:n=4,Zf(this,t,this.l);break;case 8:if(n=8,r==="f"){Kf(this,t,this.l);break}case 16:break;case-4:n=4,Qf(this,t,this.l);break}return this.l+=n,this}function dl(e,t){var r=tl(this,this.l,e.length>>1);if(r!==e)throw new Error(t+"Expected "+e+" saw "+r);this.l+=e.length>>1}function er(e,t){e.l=t,e.read_shift=kn,e.chk=dl,e.write_shift=tu}function Er(e,t){e.l+=t}function q(e){var t=Gr(e);return er(t,0),t}function Yt(){var e=[],t=$e?256:2048,r=function(f){var d=q(f);return er(d,0),d},n=r(t),i=function(){n&&(n.length>n.l&&(n=n.slice(0,n.l),n.l=n.length),n.length>0&&e.push(n),n=null)},s=function(f){return n&&f<n.length-n.l?n:(i(),n=r(Math.max(f+1,t)))},a=function(){return i(),Ot(e)},c=function(f){i(),n=f,n.l==null&&(n.l=n.length),s(t)};return{next:s,push:c,end:a,_bufs:e}}function te(e,t,r,n){var i=+t,s;if(!isNaN(i)){n||(n=Yx[i].p||(r||[]).length||0),s=1+(i>=128?1:0)+1,n>=128&&++s,n>=16384&&++s,n>=2097152&&++s;var a=e.next(s);i<=127?a.write_shift(1,i):(a.write_shift(1,(i&127)+128),a.write_shift(1,i>>7));for(var c=0;c!=4;++c)if(n>=128)a.write_shift(1,(n&127)+128),n>>=7;else{a.write_shift(1,n);break}n>0&&bs(r)&&e.push(r)}}function Fn(e,t,r){var n=qt(e);if(t.s?(n.cRel&&(n.c+=t.s.c),n.rRel&&(n.r+=t.s.r)):(n.cRel&&(n.c+=t.c),n.rRel&&(n.r+=t.r)),!r||r.biff<12){for(;n.c>=256;)n.c-=256;for(;n.r>=65536;)n.r-=65536}return n}function Aa(e,t,r){var n=qt(e);return n.s=Fn(n.s,t.s,r),n.e=Fn(n.e,t.s,r),n}function In(e,t){if(e.cRel&&e.c<0)for(e=qt(e);e.c<0;)e.c+=t>8?16384:256;if(e.rRel&&e.r<0)for(e=qt(e);e.r<0;)e.r+=t>8?1048576:t>5?65536:16384;var r=Qe(e);return!e.cRel&&e.cRel!=null&&(r=iu(r)),!e.rRel&&e.rRel!=null&&(r=ru(r)),r}function Gi(e,t){return e.s.r==0&&!e.s.rRel&&e.e.r==(t.biff>=12?1048575:t.biff>=8?65536:16384)&&!e.e.rRel?(e.s.cRel?"":"$")+jt(e.s.c)+":"+(e.e.cRel?"":"$")+jt(e.e.c):e.s.c==0&&!e.s.cRel&&e.e.c==(t.biff>=12?16383:255)&&!e.e.cRel?(e.s.rRel?"":"$")+Ft(e.s.r)+":"+(e.e.rRel?"":"$")+Ft(e.e.r):In(e.s,t.biff)+":"+In(e.e,t.biff)}function Ds(e){return parseInt(nu(e),10)-1}function Ft(e){return""+(e+1)}function ru(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function nu(e){return e.replace(/\$(\d+)$/,"$1")}function As(e){for(var t=su(e),r=0,n=0;n!==t.length;++n)r=26*r+t.charCodeAt(n)-64;return r-1}function jt(e){if(e<0)throw new Error("invalid column "+e);var t="";for(++e;e;e=Math.floor((e-1)/26))t=String.fromCharCode((e-1)%26+65)+t;return t}function iu(e){return e.replace(/^([A-Z])/,"$$$1")}function su(e){return e.replace(/^\$([A-Z])/,"$1")}function au(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function Et(e){for(var t=0,r=0,n=0;n<e.length;++n){var i=e.charCodeAt(n);i>=48&&i<=57?t=10*t+(i-48):i>=65&&i<=90&&(r=26*r+(i-64))}return{c:r-1,r:t-1}}function Qe(e){for(var t=e.c+1,r="";t;t=(t-1)/26|0)r=String.fromCharCode((t-1)%26+65)+r;return r+(e.r+1)}function nr(e){var t=e.indexOf(":");return t==-1?{s:Et(e),e:Et(e)}:{s:Et(e.slice(0,t)),e:Et(e.slice(t+1))}}function pt(e,t){return typeof t>"u"||typeof t=="number"?pt(e.s,e.e):(typeof e!="string"&&(e=Qe(e)),typeof t!="string"&&(t=Qe(t)),e==t?e:e+":"+t)}function it(e){var t={s:{c:0,r:0},e:{c:0,r:0}},r=0,n=0,i=0,s=e.length;for(r=0;n<s&&!((i=e.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(t.s.c=--r,r=0;n<s&&!((i=e.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;if(t.s.r=--r,n===s||i!=10)return t.e.c=t.s.c,t.e.r=t.s.r,t;for(++n,r=0;n!=s&&!((i=e.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(t.e.c=--r,r=0;n!=s&&!((i=e.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;return t.e.r=--r,t}function Oa(e,t){var r=e.t=="d"&&t instanceof Date;if(e.z!=null)try{return e.w=Mr(e.z,r?Kt(t):t)}catch{}try{return e.w=Mr((e.XF||{}).numFmtId||(r?14:0),r?Kt(t):t)}catch{return""+t}}function Fr(e,t,r){return e==null||e.t==null||e.t=="z"?"":e.w!==void 0?e.w:(e.t=="d"&&!e.z&&r&&r.dateNF&&(e.z=r.dateNF),e.t=="e"?Gn[e.v]||e.v:t==null?Oa(e,e.v):Oa(e,t))}function Jr(e,t){var r=t&&t.sheet?t.sheet:"Sheet1",n={};return n[r]=e,{SheetNames:[r],Sheets:n}}function pl(e,t,r){var n=r||{},i=e?Array.isArray(e):n.dense,s=e||(i?[]:{}),a=0,c=0;if(s&&n.origin!=null){if(typeof n.origin=="number")a=n.origin;else{var u=typeof n.origin=="string"?Et(n.origin):n.origin;a=u.r,c=u.c}s["!ref"]||(s["!ref"]="A1:A1")}var f={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(s["!ref"]){var d=it(s["!ref"]);f.s.c=d.s.c,f.s.r=d.s.r,f.e.c=Math.max(f.e.c,d.e.c),f.e.r=Math.max(f.e.r,d.e.r),a==-1&&(f.e.r=a=d.e.r+1)}for(var p=0;p!=t.length;++p)if(t[p]){if(!Array.isArray(t[p]))throw new Error("aoa_to_sheet expects an array of arrays");for(var x=0;x!=t[p].length;++x)if(!(typeof t[p][x]>"u")){var l={v:t[p][x]},y=a+p,g=c+x;if(f.s.r>y&&(f.s.r=y),f.s.c>g&&(f.s.c=g),f.e.r<y&&(f.e.r=y),f.e.c<g&&(f.e.c=g),t[p][x]&&typeof t[p][x]=="object"&&!Array.isArray(t[p][x])&&!(t[p][x]instanceof Date))l=t[p][x];else if(Array.isArray(l.v)&&(l.f=t[p][x][1],l.v=l.v[0]),l.v===null)if(l.f)l.t="n";else if(n.nullError)l.t="e",l.v=0;else if(n.sheetStubs)l.t="z";else continue;else typeof l.v=="number"?l.t="n":typeof l.v=="boolean"?l.t="b":l.v instanceof Date?(l.z=n.dateNF||ut[14],n.cellDates?(l.t="d",l.w=Mr(l.z,Kt(l.v))):(l.t="n",l.v=Kt(l.v),l.w=Mr(l.z,l.v))):l.t="s";if(i)s[y]||(s[y]=[]),s[y][g]&&s[y][g].z&&(l.z=s[y][g].z),s[y][g]=l;else{var m=Qe({c:g,r:y});s[m]&&s[m].z&&(l.z=s[m].z),s[m]=l}}}return f.s.c<1e7&&(s["!ref"]=pt(f)),s}function yn(e,t){return pl(null,e,t)}function ou(e){return e.read_shift(4,"i")}function xr(e,t){return t||(t=q(4)),t.write_shift(4,e),t}function Mt(e){var t=e.read_shift(4);return t===0?"":e.read_shift(t,"dbcs")}function St(e,t){var r=!1;return t==null&&(r=!0,t=q(4+2*e.length)),t.write_shift(4,e.length),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}function lu(e){return{ich:e.read_shift(2),ifnt:e.read_shift(2)}}function cu(e,t){return t||(t=q(4)),t.write_shift(2,0),t.write_shift(2,0),t}function Os(e,t){var r=e.l,n=e.read_shift(1),i=Mt(e),s=[],a={t:i,h:i};if((n&1)!==0){for(var c=e.read_shift(4),u=0;u!=c;++u)s.push(lu(e));a.r=s}else a.r=[{ich:0,ifnt:0}];return e.l=r+t,a}function fu(e,t){var r=!1;return t==null&&(r=!0,t=q(15+4*e.t.length)),t.write_shift(1,0),St(e.t,t),r?t.slice(0,t.l):t}var uu=Os;function hu(e,t){var r=!1;return t==null&&(r=!0,t=q(23+4*e.t.length)),t.write_shift(1,1),St(e.t,t),t.write_shift(4,1),cu({},t),r?t.slice(0,t.l):t}function cr(e){var t=e.read_shift(4),r=e.read_shift(2);return r+=e.read_shift(1)<<16,e.l++,{c:t,iStyleRef:r}}function Zr(e,t){return t==null&&(t=q(8)),t.write_shift(-4,e.c),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}function Qr(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}function en(e,t){return t==null&&(t=q(4)),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}var du=Mt,xl=St;function ks(e){var t=e.read_shift(4);return t===0||t===4294967295?"":e.read_shift(t,"dbcs")}function mi(e,t){var r=!1;return t==null&&(r=!0,t=q(127)),t.write_shift(4,e.length>0?e.length:4294967295),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}var pu=Mt,os=ks,Fs=mi;function gl(e){var t=e.slice(e.l,e.l+4),r=t[0]&1,n=t[0]&2;e.l+=4;var i=n===0?gi([0,0,0,0,t[0]&252,t[1],t[2],t[3]],0):Hr(t,0)>>2;return r?i/100:i}function ml(e,t){t==null&&(t=q(4));var r=0,n=0,i=e*100;if(e==(e|0)&&e>=-536870912&&e<1<<29?n=1:i==(i|0)&&i>=-536870912&&i<1<<29&&(n=1,r=1),n)t.write_shift(-4,((r?i:e)<<2)+(r+2));else throw new Error("unsupported RkNumber "+e)}function vl(e){var t={s:{},e:{}};return t.s.r=e.read_shift(4),t.e.r=e.read_shift(4),t.s.c=e.read_shift(4),t.e.c=e.read_shift(4),t}function xu(e,t){return t||(t=q(16)),t.write_shift(4,e.s.r),t.write_shift(4,e.e.r),t.write_shift(4,e.s.c),t.write_shift(4,e.e.c),t}var tn=vl,wn=xu;function Tn(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function Xr(e,t){return(t||q(8)).write_shift(8,e,"f")}function gu(e){var t={},r=e.read_shift(1),n=r>>>1,i=e.read_shift(1),s=e.read_shift(2,"i"),a=e.read_shift(1),c=e.read_shift(1),u=e.read_shift(1);switch(e.l++,n){case 0:t.auto=1;break;case 1:t.index=i;var f=Cu[i];f&&(t.rgb=Ua(f));break;case 2:t.rgb=Ua([a,c,u]);break;case 3:t.theme=i;break}return s!=0&&(t.tint=s>0?s/32767:s/32768),t}function vi(e,t){if(t||(t=q(8)),!e||e.auto)return t.write_shift(4,0),t.write_shift(4,0),t;e.index!=null?(t.write_shift(1,2),t.write_shift(1,e.index)):e.theme!=null?(t.write_shift(1,6),t.write_shift(1,e.theme)):(t.write_shift(1,5),t.write_shift(1,0));var r=e.tint||0;if(r>0?r*=32767:r<0&&(r*=32768),t.write_shift(2,r),!e.rgb||e.theme!=null)t.write_shift(2,0),t.write_shift(1,0),t.write_shift(1,0);else{var n=e.rgb||"FFFFFF";typeof n=="number"&&(n=("000000"+n.toString(16)).slice(-6)),t.write_shift(1,parseInt(n.slice(0,2),16)),t.write_shift(1,parseInt(n.slice(2,4),16)),t.write_shift(1,parseInt(n.slice(4,6),16)),t.write_shift(1,255)}return t}function mu(e){var t=e.read_shift(1);e.l++;var r={fBold:t&1,fItalic:t&2,fUnderline:t&4,fStrikeout:t&8,fOutline:t&16,fShadow:t&32,fCondense:t&64,fExtend:t&128};return r}function vu(e,t){t||(t=q(2));var r=(e.italic?2:0)|(e.strike?8:0)|(e.outline?16:0)|(e.shadow?32:0)|(e.condense?64:0)|(e.extend?128:0);return t.write_shift(1,r),t.write_shift(1,0),t}var yl=2,Qt=3,ti=11,yi=19,ri=64,yu=65,wu=71,Tu=4108,_u=4126,At=80,ka={1:{n:"CodePage",t:yl},2:{n:"Category",t:At},3:{n:"PresentationFormat",t:At},4:{n:"ByteCount",t:Qt},5:{n:"LineCount",t:Qt},6:{n:"ParagraphCount",t:Qt},7:{n:"SlideCount",t:Qt},8:{n:"NoteCount",t:Qt},9:{n:"HiddenCount",t:Qt},10:{n:"MultimediaClipCount",t:Qt},11:{n:"ScaleCrop",t:ti},12:{n:"HeadingPairs",t:Tu},13:{n:"TitlesOfParts",t:_u},14:{n:"Manager",t:At},15:{n:"Company",t:At},16:{n:"LinksUpToDate",t:ti},17:{n:"CharacterCount",t:Qt},19:{n:"SharedDoc",t:ti},22:{n:"HyperlinksChanged",t:ti},23:{n:"AppVersion",t:Qt,p:"version"},24:{n:"DigSig",t:yu},26:{n:"ContentType",t:At},27:{n:"ContentStatus",t:At},28:{n:"Language",t:At},29:{n:"Version",t:At},255:{},2147483648:{n:"Locale",t:yi},2147483651:{n:"Behavior",t:yi},1919054434:{}},Fa={1:{n:"CodePage",t:yl},2:{n:"Title",t:At},3:{n:"Subject",t:At},4:{n:"Author",t:At},5:{n:"Keywords",t:At},6:{n:"Comments",t:At},7:{n:"Template",t:At},8:{n:"LastAuthor",t:At},9:{n:"RevNumber",t:At},10:{n:"EditTime",t:ri},11:{n:"LastPrinted",t:ri},12:{n:"CreatedDate",t:ri},13:{n:"ModifiedDate",t:ri},14:{n:"PageCount",t:Qt},15:{n:"WordCount",t:Qt},16:{n:"CharCount",t:Qt},17:{n:"Thumbnail",t:wu},18:{n:"Application",t:At},19:{n:"DocSecurity",t:Qt},255:{},2147483648:{n:"Locale",t:yi},2147483651:{n:"Behavior",t:yi},1919054434:{}};function Eu(e){return e.map(function(t){return[t>>16&255,t>>8&255,t&255]})}var Su=Eu([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Cu=qt(Su),Gn={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},bu={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},ni={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},metadata:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",xlsb:"application/vnd.ms-excel.sheetMetadata"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};function wl(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function Tl(e,t){var r=jf(bu),n=[],i;n[n.length]=xt,n[n.length]=ce("Types",null,{xmlns:_t.CT,"xmlns:xsd":_t.xsd,"xmlns:xsi":_t.xsi}),n=n.concat([["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels","application/vnd.openxmlformats-package.relationships+xml"]].map(function(u){return ce("Default",null,{Extension:u[0],ContentType:u[1]})}));var s=function(u){e[u]&&e[u].length>0&&(i=e[u][0],n[n.length]=ce("Override",null,{PartName:(i[0]=="/"?"":"/")+i,ContentType:ni[u][t.bookType]||ni[u].xlsx}))},a=function(u){(e[u]||[]).forEach(function(f){n[n.length]=ce("Override",null,{PartName:(f[0]=="/"?"":"/")+f,ContentType:ni[u][t.bookType]||ni[u].xlsx})})},c=function(u){(e[u]||[]).forEach(function(f){n[n.length]=ce("Override",null,{PartName:(f[0]=="/"?"":"/")+f,ContentType:r[u][0]})})};return s("workbooks"),a("sheets"),a("charts"),c("themes"),["strs","styles"].forEach(s),["coreprops","extprops","custprops"].forEach(c),c("vba"),c("comments"),c("threadedcomments"),c("drawings"),a("metadata"),c("people"),n.length>2&&(n[n.length]="</Types>",n[1]=n[1].replace("/>",">")),n.join("")}var Ve={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function _l(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function pn(e){var t=[xt,ce("Relationships",null,{xmlns:_t.RELS})];return It(e["!id"]).forEach(function(r){t[t.length]=ce("Relationship",null,e["!id"][r])}),t.length>2&&(t[t.length]="</Relationships>",t[1]=t[1].replace("/>",">")),t.join("")}function Je(e,t,r,n,i,s){if(i||(i={}),e["!id"]||(e["!id"]={}),e["!idx"]||(e["!idx"]=1),t<0)for(t=e["!idx"];e["!id"]["rId"+t];++t);if(e["!idx"]=t+1,i.Id="rId"+t,i.Type=n,i.Target=r,[Ve.HLINK,Ve.XPATH,Ve.XMISS].indexOf(i.Type)>-1&&(i.TargetMode="External"),e["!id"][i.Id])throw new Error("Cannot rewrite rId "+t);return e["!id"][i.Id]=i,e[("/"+i.Target).replace("//","/")]=i,t}function Du(e){var t=[xt];t.push(`<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">
|
|
14
14
|
`),t.push(` <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>
|
|
15
15
|
`);for(var r=0;r<e.length;++r)t.push(' <manifest:file-entry manifest:full-path="'+e[r][0]+'" manifest:media-type="'+e[r][1]+`"/>
|
|
16
|
-
`);return t.push("</manifest:manifest>"),t.join("")}function
|
|
16
|
+
`);return t.push("</manifest:manifest>"),t.join("")}function Ia(e,t,r){return[' <rdf:Description rdf:about="'+e+`">
|
|
17
17
|
`,' <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/'+(r||"odf")+"#"+t+`"/>
|
|
18
18
|
`,` </rdf:Description>
|
|
19
|
-
`].join("")}function
|
|
19
|
+
`].join("")}function Au(e,t){return[' <rdf:Description rdf:about="'+e+`">
|
|
20
20
|
`,' <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="'+t+`"/>
|
|
21
21
|
`,` </rdf:Description>
|
|
22
|
-
`].join("")}function
|
|
23
|
-
`);for(var r=0;r!=e.length;++r)t.push(yl(e[r][0],e[r][1])),t.push(Ap("",e[r][0]));return t.push(yl("","Document","pkg")),t.push("</rdf:RDF>"),t.join("")}function H0(){return'<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS '+is.version+"</meta:generator></office:meta></office:document-meta>"}var xn=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]];function na(e,t,r,n,i){i[e]!=null||t==null||t===""||(i[e]=t,t=lt(t),n[n.length]=r?xe(e,t,r):Zt(e,t))}function G0(e,t){var r=t||{},n=[Mt,xe("cp:coreProperties",null,{"xmlns:cp":Wt.CORE_PROPS,"xmlns:dc":Wt.dc,"xmlns:dcterms":Wt.dcterms,"xmlns:dcmitype":Wt.dcmitype,"xmlns:xsi":Wt.xsi})],i={};if(!e&&!r.Props)return n.join("");e&&(e.CreatedDate!=null&&na("dcterms:created",typeof e.CreatedDate=="string"?e.CreatedDate:Aa(e.CreatedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},n,i),e.ModifiedDate!=null&&na("dcterms:modified",typeof e.ModifiedDate=="string"?e.ModifiedDate:Aa(e.ModifiedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},n,i));for(var s=0;s!=xn.length;++s){var a=xn[s],o=r.Props&&r.Props[a[1]]!=null?r.Props[a[1]]:e?e[a[1]]:null;o===!0?o="1":o===!1?o="0":typeof o=="number"&&(o=String(o)),o!=null&&na(a[0],o,null,n,i)}return n.length>2&&(n[n.length]="</cp:coreProperties>",n[1]=n[1].replace("/>",">")),n.join("")}var Yn=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]],Y0=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function X0(e){var t=[],r=xe;return e||(e={}),e.Application="SheetJS",t[t.length]=Mt,t[t.length]=xe("Properties",null,{xmlns:Wt.EXT_PROPS,"xmlns:vt":Wt.vt}),Yn.forEach(function(n){if(e[n[1]]!==void 0){var i;switch(n[2]){case"string":i=lt(String(e[n[1]]));break;case"bool":i=e[n[1]]?"true":"false";break}i!==void 0&&(t[t.length]=r(n[0],i))}}),t[t.length]=r("HeadingPairs",r("vt:vector",r("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+r("vt:variant",r("vt:i4",String(e.Worksheets))),{size:2,baseType:"variant"})),t[t.length]=r("TitlesOfParts",r("vt:vector",e.SheetNames.map(function(n){return"<vt:lpstr>"+lt(n)+"</vt:lpstr>"}).join(""),{size:e.Worksheets,baseType:"lpstr"})),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}function K0(e){var t=[Mt,xe("Properties",null,{xmlns:Wt.CUST_PROPS,"xmlns:vt":Wt.vt})];if(!e)return t.join("");var r=1;return er(e).forEach(function(i){++r,t[t.length]=xe("property",Gh(e[i]),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:r,name:lt(i)})}),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}var wl={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};function Dp(e,t){var r=[];return er(wl).map(function(n){for(var i=0;i<xn.length;++i)if(xn[i][1]==n)return xn[i];for(i=0;i<Yn.length;++i)if(Yn[i][1]==n)return Yn[i];throw n}).forEach(function(n){if(e[n[1]]!=null){var i=t&&t.Props&&t.Props[n[1]]!=null?t.Props[n[1]]:e[n[1]];switch(n[2]){case"date":i=new Date(i).toISOString().replace(/\.\d*Z/,"Z");break}typeof i=="number"?i=String(i):i===!0||i===!1?i=i?"1":"0":i instanceof Date&&(i=new Date(i).toISOString().replace(/\.\d*Z/,"")),r.push(Zt(wl[n[1]]||n[1],i))}}),xe("DocumentProperties",r.join(""),{xmlns:vr.o})}function kp(e,t){var r=["Worksheets","SheetNames"],n="CustomDocumentProperties",i=[];return e&&er(e).forEach(function(s){if(Object.prototype.hasOwnProperty.call(e,s)){for(var a=0;a<xn.length;++a)if(s==xn[a][1])return;for(a=0;a<Yn.length;++a)if(s==Yn[a][1])return;for(a=0;a<r.length;++a)if(s==r[a])return;var o=e[s],f="string";typeof o=="number"?(f="float",o=String(o)):o===!0||o===!1?(f="boolean",o=o?"1":"0"):o=String(o),i.push(xe(ol(s),o,{"dt:dt":f}))}}),t&&er(t).forEach(function(s){if(Object.prototype.hasOwnProperty.call(t,s)&&!(e&&Object.prototype.hasOwnProperty.call(e,s))){var a=t[s],o="string";typeof a=="number"?(o="float",a=String(a)):a===!0||a===!1?(o="boolean",a=a?"1":"0"):a instanceof Date?(o="dateTime.tz",a=a.toISOString()):a=String(a),i.push(xe(ol(s),a,{"dt:dt":o}))}}),"<"+n+' xmlns="'+vr.o+'">'+i.join("")+"</"+n+">"}function Ip(e){var t=typeof e=="string"?new Date(Date.parse(e)):e,r=t.getTime()/1e3+11644473600,n=r%Math.pow(2,32),i=(r-n)/Math.pow(2,32);n*=1e7,i*=1e7;var s=n/Math.pow(2,32)|0;s>0&&(n=n%Math.pow(2,32),i+=s);var a=re(8);return a.write_shift(4,n),a.write_shift(4,i),a}function Tl(e,t){var r=re(4),n=re(4);switch(r.write_shift(4,e==80?31:e),e){case 3:n.write_shift(-4,t);break;case 5:n=re(8),n.write_shift(8,t,"f");break;case 11:n.write_shift(4,t?1:0);break;case 64:n=Ip(t);break;case 31:case 80:for(n=re(4+2*(t.length+1)+(t.length%2?0:2)),n.write_shift(4,t.length+1),n.write_shift(0,t,"dbcs");n.l!=n.length;)n.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+t)}return Jt([r,n])}var q0=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function Fp(e){switch(typeof e){case"boolean":return 11;case"number":return(e|0)==e?3:5;case"string":return 31;case"object":if(e instanceof Date)return 64;break}return-1}function Sl(e,t,r){var n=re(8),i=[],s=[],a=8,o=0,f=re(8),u=re(8);if(f.write_shift(4,2),f.write_shift(4,1200),u.write_shift(4,1),s.push(f),i.push(u),a+=8+f.length,!t){u=re(8),u.write_shift(4,0),i.unshift(u);var d=[re(4)];for(d[0].write_shift(4,e.length),o=0;o<e.length;++o){var h=e[o][0];for(f=re(8+2*(h.length+1)+(h.length%2?0:2)),f.write_shift(4,o+2),f.write_shift(4,h.length+1),f.write_shift(0,h,"dbcs");f.l!=f.length;)f.write_shift(1,0);d.push(f)}f=Jt(d),s.unshift(f),a+=8+f.length}for(o=0;o<e.length;++o)if(!(t&&!t[e[o][0]])&&!(q0.indexOf(e[o][0])>-1||Y0.indexOf(e[o][0])>-1)&&e[o][1]!=null){var m=e[o][1],l=0;if(t){l=+t[e[o][0]];var v=r[l];if(v.p=="version"&&typeof m=="string"){var g=m.split(".");m=(+g[0]<<16)+(+g[1]||0)}f=Tl(v.t,m)}else{var x=Fp(m);x==-1&&(x=31,m=String(m)),f=Tl(x,m)}s.push(f),u=re(8),u.write_shift(4,t?l:2+o),i.push(u),a+=8+f.length}var T=8*(s.length+1);for(o=0;o<s.length;++o)i[o].write_shift(4,T),T+=s[o].length;return n.write_shift(4,a),n.write_shift(4,s.length),Jt([n].concat(i).concat(s))}function El(e,t,r,n,i,s){var a=re(i?68:48),o=[a];a.write_shift(2,65534),a.write_shift(2,0),a.write_shift(4,842412599),a.write_shift(16,ht.utils.consts.HEADER_CLSID,"hex"),a.write_shift(4,i?2:1),a.write_shift(16,t,"hex"),a.write_shift(4,i?68:48);var f=Sl(e,r,n);if(o.push(f),i){var u=Sl(i,null,null);a.write_shift(16,s,"hex"),a.write_shift(4,68+f.length),o.push(u)}return Jt(o)}function Np(e,t){t||(t=re(e));for(var r=0;r<e;++r)t.write_shift(1,0);return t}function Rp(e,t){return e.read_shift(t)===1}function or(e,t){return t||(t=re(2)),t.write_shift(2,+!!e),t}function J0(e){return e.read_shift(2,"u")}function br(e,t){return t||(t=re(2)),t.write_shift(2,e),t}function Z0(e,t,r){return r||(r=re(2)),r.write_shift(1,t=="e"?+e:+!!e),r.write_shift(1,t=="e"?1:0),r}function Q0(e,t,r){var n=e.read_shift(r&&r.biff>=12?2:1),i="sbcs-cont";if(r&&r.biff>=8,!r||r.biff==8){var s=e.read_shift(1);s&&(i="dbcs-cont")}else r.biff==12&&(i="wstr");r.biff>=2&&r.biff<=5&&(i="cpstr");var a=n?e.read_shift(n,i):"";return a}function Pp(e){var t=e.t||"",r=re(3);r.write_shift(2,t.length),r.write_shift(1,1);var n=re(2*t.length);n.write_shift(2*t.length,t,"utf16le");var i=[r,n];return Jt(i)}function jp(e,t,r){var n;if(r){if(r.biff>=2&&r.biff<=5)return e.read_shift(t,"cpstr");if(r.biff>=12)return e.read_shift(t,"dbcs-cont")}var i=e.read_shift(1);return i===0?n=e.read_shift(t,"sbcs-cont"):n=e.read_shift(t,"dbcs-cont"),n}function Mp(e,t,r){var n=e.read_shift(r&&r.biff==2?1:2);return n===0?(e.l++,""):jp(e,n,r)}function Lp(e,t,r){if(r.biff>5)return Mp(e,t,r);var n=e.read_shift(1);return n===0?(e.l++,""):e.read_shift(n,r.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function eu(e,t,r){return r||(r=re(3+2*e.length)),r.write_shift(2,e.length),r.write_shift(1,1),r.write_shift(31,e,"utf16le"),r}function _l(e,t){t||(t=re(6+e.length*2)),t.write_shift(4,1+e.length);for(var r=0;r<e.length;++r)t.write_shift(2,e.charCodeAt(r));return t.write_shift(2,0),t}function Bp(e){var t=re(512),r=0,n=e.Target;n.slice(0,7)=="file://"&&(n=n.slice(7));var i=n.indexOf("#"),s=i>-1?31:23;switch(n.charAt(0)){case"#":s=28;break;case".":s&=-3;break}t.write_shift(4,2),t.write_shift(4,s);var a=[8,6815827,6619237,4849780,83];for(r=0;r<a.length;++r)t.write_shift(4,a[r]);if(s==28)n=n.slice(1),_l(n,t);else if(s&2){for(a="e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),r=0;r<a.length;++r)t.write_shift(1,parseInt(a[r],16));var o=i>-1?n.slice(0,i):n;for(t.write_shift(4,2*(o.length+1)),r=0;r<o.length;++r)t.write_shift(2,o.charCodeAt(r));t.write_shift(2,0),s&8&&_l(i>-1?n.slice(i+1):"",t)}else{for(a="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "),r=0;r<a.length;++r)t.write_shift(1,parseInt(a[r],16));for(var f=0;n.slice(f*3,f*3+3)=="../"||n.slice(f*3,f*3+3)=="..\\";)++f;for(t.write_shift(2,f),t.write_shift(4,n.length-3*f+1),r=0;r<n.length-3*f;++r)t.write_shift(1,n.charCodeAt(r+3*f)&255);for(t.write_shift(1,0),t.write_shift(2,65535),t.write_shift(2,57005),r=0;r<6;++r)t.write_shift(4,0)}return t.slice(0,t.l)}function Tn(e,t,r,n){return n||(n=re(6)),n.write_shift(2,e),n.write_shift(2,t),n.write_shift(2,r||0),n}function $p(e,t,r){var n=r.biff>8?4:2,i=e.read_shift(n),s=e.read_shift(n,"i"),a=e.read_shift(n,"i");return[i,s,a]}function Up(e){var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(2),i=e.read_shift(2);return{s:{c:n,r:t},e:{c:i,r}}}function tu(e,t){return t||(t=re(8)),t.write_shift(2,e.s.r),t.write_shift(2,e.e.r),t.write_shift(2,e.s.c),t.write_shift(2,e.e.c),t}function so(e,t,r){var n=1536,i=16;switch(r.bookType){case"biff8":break;case"biff5":n=1280,i=8;break;case"biff4":n=4,i=6;break;case"biff3":n=3,i=6;break;case"biff2":n=2,i=4;break;case"xla":break;default:throw new Error("unsupported BIFF version")}var s=re(i);return s.write_shift(2,n),s.write_shift(2,t),i>4&&s.write_shift(2,29282),i>6&&s.write_shift(2,1997),i>8&&(s.write_shift(2,49161),s.write_shift(2,1),s.write_shift(2,1798),s.write_shift(2,0)),s}function Wp(e,t){var r=!t||t.biff==8,n=re(r?112:54);for(n.write_shift(t.biff==8?2:1,7),r&&n.write_shift(1,0),n.write_shift(4,859007059),n.write_shift(4,5458548|(r?0:536870912));n.l<n.length;)n.write_shift(1,r?0:32);return n}function Vp(e,t){var r=!t||t.biff>=8?2:1,n=re(8+r*e.name.length);n.write_shift(4,e.pos),n.write_shift(1,e.hs||0),n.write_shift(1,e.dt),n.write_shift(1,e.name.length),t.biff>=8&&n.write_shift(1,1),n.write_shift(r*e.name.length,e.name,t.biff<8?"sbcs":"utf16le");var i=n.slice(0,n.l);return i.l=n.l,i}function zp(e,t){var r=re(8);r.write_shift(4,e.Count),r.write_shift(4,e.Unique);for(var n=[],i=0;i<e.length;++i)n[i]=Pp(e[i]);var s=Jt([r].concat(n));return s.parts=[r.length].concat(n.map(function(a){return a.length})),s}function Hp(){var e=re(18);return e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,29280),e.write_shift(2,17600),e.write_shift(2,56),e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,1),e.write_shift(2,500),e}function Gp(e){var t=re(18),r=1718;return e&&e.RTL&&(r|=64),t.write_shift(2,r),t.write_shift(4,0),t.write_shift(4,64),t.write_shift(4,0),t.write_shift(4,0),t}function Yp(e,t){var r=e.name||"Arial",n=t&&t.biff==5,i=n?15+r.length:16+2*r.length,s=re(i);return s.write_shift(2,e.sz*20),s.write_shift(4,0),s.write_shift(2,400),s.write_shift(4,0),s.write_shift(2,0),s.write_shift(1,r.length),n||s.write_shift(1,1),s.write_shift((n?1:2)*r.length,r,n?"sbcs":"utf16le"),s}function Xp(e,t,r,n){var i=re(10);return Tn(e,t,n,i),i.write_shift(4,r),i}function Kp(e,t,r,n,i){var s=!i||i.biff==8,a=re(8+ +s+(1+s)*r.length);return Tn(e,t,n,a),a.write_shift(2,r.length),s&&a.write_shift(1,1),a.write_shift((1+s)*r.length,r,s?"utf16le":"sbcs"),a}function qp(e,t,r,n){var i=r&&r.biff==5;n||(n=re(i?3+t.length:5+2*t.length)),n.write_shift(2,e),n.write_shift(i?1:2,t.length),i||n.write_shift(1,1),n.write_shift((i?1:2)*t.length,t,i?"sbcs":"utf16le");var s=n.length>n.l?n.slice(0,n.l):n;return s.l==null&&(s.l=s.length),s}function Jp(e,t){var r=t.biff==8||!t.biff?4:2,n=re(2*r+6);return n.write_shift(r,e.s.r),n.write_shift(r,e.e.r+1),n.write_shift(2,e.s.c),n.write_shift(2,e.e.c+1),n.write_shift(2,0),n}function bl(e,t,r,n){var i=r&&r.biff==5;n||(n=re(i?16:20)),n.write_shift(2,0),e.style?(n.write_shift(2,e.numFmtId||0),n.write_shift(2,65524)):(n.write_shift(2,e.numFmtId||0),n.write_shift(2,t<<4));var s=0;return e.numFmtId>0&&i&&(s|=1024),n.write_shift(4,s),n.write_shift(4,0),i||n.write_shift(4,0),n.write_shift(2,0),n}function Zp(e){var t=re(8);return t.write_shift(4,0),t.write_shift(2,0),t.write_shift(2,0),t}function Qp(e,t,r,n,i,s){var a=re(8);return Tn(e,t,n,a),Z0(r,s,a),a}function eg(e,t,r,n){var i=re(14);return Tn(e,t,n,i),wn(r,i),i}function tg(e,t,r){if(r.biff<8)return rg(e,t,r);for(var n=[],i=e.l+t,s=e.read_shift(r.biff>8?4:2);s--!==0;)n.push($p(e,r.biff>8?12:6,r));if(e.l!=i)throw new Error("Bad ExternSheet: "+e.l+" != "+i);return n}function rg(e,t,r){e[e.l+1]==3&&e[e.l]++;var n=Q0(e,t,r);return n.charCodeAt(0)==3?n.slice(1):n}function ng(e){var t=re(2+e.length*8);t.write_shift(2,e.length);for(var r=0;r<e.length;++r)tu(e[r],t);return t}function ig(e){var t=re(24),r=Vt(e[0]);t.write_shift(2,r.r),t.write_shift(2,r.r),t.write_shift(2,r.c),t.write_shift(2,r.c);for(var n="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),i=0;i<16;++i)t.write_shift(1,parseInt(n[i],16));return Jt([t,Bp(e[1])])}function sg(e){var t=e[1].Tooltip,r=re(10+2*(t.length+1));r.write_shift(2,2048);var n=Vt(e[0]);r.write_shift(2,n.r),r.write_shift(2,n.r),r.write_shift(2,n.c),r.write_shift(2,n.c);for(var i=0;i<t.length;++i)r.write_shift(2,t.charCodeAt(i));return r.write_shift(2,0),r}function ag(e){return e||(e=re(4)),e.write_shift(2,1),e.write_shift(2,1),e}function og(e,t,r){if(!r.cellStyles)return Wr(e,t);var n=r&&r.biff>=12?4:2,i=e.read_shift(n),s=e.read_shift(n),a=e.read_shift(n),o=e.read_shift(n),f=e.read_shift(2);n==2&&(e.l+=2);var u={s:i,e:s,w:a,ixfe:o,flags:f};return(r.biff>=5||!r.biff)&&(u.level=f>>8&7),u}function lg(e,t){var r=re(12);r.write_shift(2,t),r.write_shift(2,t),r.write_shift(2,e.width*256),r.write_shift(2,0);var n=0;return e.hidden&&(n|=1),r.write_shift(1,n),n=e.level||0,r.write_shift(1,n),r.write_shift(2,0),r}function cg(e){for(var t=re(2*e),r=0;r<e;++r)t.write_shift(2,r+1);return t}function ug(e,t,r){var n=re(15);return Ni(n,e,t),n.write_shift(8,r,"f"),n}function fg(e,t,r){var n=re(9);return Ni(n,e,t),n.write_shift(2,r),n}var dg=(function(){var e={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},t=Xa({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(o,f){var u=[],d=yn(1);switch(f.type){case"base64":d=Nr(Kr(o));break;case"binary":d=Nr(o);break;case"buffer":case"array":d=o;break}xr(d,0);var h=d.read_shift(1),m=!!(h&136),l=!1,v=!1;switch(h){case 2:break;case 3:break;case 48:l=!0,m=!0;break;case 49:l=!0,m=!0;break;case 131:break;case 139:break;case 140:v=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+h.toString(16))}var g=0,x=521;h==2&&(g=d.read_shift(2)),d.l+=3,h!=2&&(g=d.read_shift(4)),g>1048576&&(g=1e6),h!=2&&(x=d.read_shift(2));var T=d.read_shift(2),b=f.codepage||1252;h!=2&&(d.l+=16,d.read_shift(1),d[d.l]!==0&&(b=e[d[d.l]]),d.l+=1,d.l+=2),v&&(d.l+=36);for(var _=[],k={},F=Math.min(d.length,h==2?521:x-10-(l?264:0)),z=v?32:11;d.l<F&&d[d.l]!=13;)switch(k={},k.name=ss.utils.decode(b,d.slice(d.l,d.l+z)).replace(/[\u0000\r\n].*$/g,""),d.l+=z,k.type=String.fromCharCode(d.read_shift(1)),h!=2&&!v&&(k.offset=d.read_shift(4)),k.len=d.read_shift(1),h==2&&(k.offset=d.read_shift(2)),k.dec=d.read_shift(1),k.name.length&&_.push(k),h!=2&&(d.l+=v?13:14),k.type){case"B":(!l||k.len!=8)&&f.WTF&&console.log("Skipping "+k.name+":"+k.type);break;case"G":case"P":f.WTF&&console.log("Skipping "+k.name+":"+k.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+k.type)}if(d[d.l]!==13&&(d.l=x-1),d.read_shift(1)!==13)throw new Error("DBF Terminator not found "+d.l+" "+d[d.l]);d.l=x;var N=0,B=0;for(u[0]=[],B=0;B!=_.length;++B)u[0][B]=_[B].name;for(;g-- >0;){if(d[d.l]===42){d.l+=T;continue}for(++d.l,u[++N]=[],B=0,B=0;B!=_.length;++B){var M=d.slice(d.l,d.l+_[B].len);d.l+=_[B].len,xr(M,0);var L=ss.utils.decode(b,M);switch(_[B].type){case"C":L.trim().length&&(u[N][B]=L.replace(/\s+$/,""));break;case"D":L.length===8?u[N][B]=new Date(+L.slice(0,4),+L.slice(4,6)-1,+L.slice(6,8)):u[N][B]=L;break;case"F":u[N][B]=parseFloat(L.trim());break;case"+":case"I":u[N][B]=v?M.read_shift(-4,"i")^2147483648:M.read_shift(4,"i");break;case"L":switch(L.trim().toUpperCase()){case"Y":case"T":u[N][B]=!0;break;case"N":case"F":u[N][B]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+L+"|")}break;case"M":if(!m)throw new Error("DBF Unexpected MEMO for type "+h.toString(16));u[N][B]="##MEMO##"+(v?parseInt(L.trim(),10):M.read_shift(4));break;case"N":L=L.replace(/\u0000/g,"").trim(),L&&L!="."&&(u[N][B]=+L||0);break;case"@":u[N][B]=new Date(M.read_shift(-8,"f")-621356832e5);break;case"T":u[N][B]=new Date((M.read_shift(4)-2440588)*864e5+M.read_shift(4));break;case"Y":u[N][B]=M.read_shift(4,"i")/1e4+M.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":u[N][B]=-M.read_shift(-8,"f");break;case"B":if(l&&_[B].len==8){u[N][B]=M.read_shift(8,"f");break}case"G":case"P":M.l+=_[B].len;break;case"0":if(_[B].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+_[B].type)}}}if(h!=2&&d.l<d.length&&d[d.l++]!=26)throw new Error("DBF EOF Marker missing "+(d.l-1)+" of "+d.length+" "+d[d.l-1].toString(16));return f&&f.sheetRows&&(u=u.slice(0,f.sheetRows)),f.DBF=_,u}function n(o,f){var u=f||{};u.dateNF||(u.dateNF="yyyymmdd");var d=Zn(r(o,u),u);return d["!cols"]=u.DBF.map(function(h){return{wch:h.len,DBF:h}}),delete u.DBF,d}function i(o,f){try{return bn(n(o,f),f)}catch(u){if(f&&f.WTF)throw u}return{SheetNames:[],Sheets:{}}}var s={B:8,C:250,L:1,D:8,"?":0,"":0};function a(o,f){var u=f||{};if(+u.codepage>=0&&vi(+u.codepage),u.type=="string")throw new Error("Cannot write DBF to JS string");var d=fr(),h=vs(o,{header:1,raw:!0,cellDates:!0}),m=h[0],l=h.slice(1),v=o["!cols"]||[],g=0,x=0,T=0,b=1;for(g=0;g<m.length;++g){if(((v[g]||{}).DBF||{}).name){m[g]=v[g].DBF.name,++T;continue}if(m[g]!=null){if(++T,typeof m[g]=="number"&&(m[g]=m[g].toString(10)),typeof m[g]!="string")throw new Error("DBF Invalid column name "+m[g]+" |"+typeof m[g]+"|");if(m.indexOf(m[g])!==g){for(x=0;x<1024;++x)if(m.indexOf(m[g]+"_"+x)==-1){m[g]+="_"+x;break}}}}var _=wt(o["!ref"]),k=[],F=[],z=[];for(g=0;g<=_.e.c-_.s.c;++g){var N="",B="",M=0,L=[];for(x=0;x<l.length;++x)l[x][g]!=null&&L.push(l[x][g]);if(L.length==0||m[g]==null){k[g]="?";continue}for(x=0;x<L.length;++x){switch(typeof L[x]){case"number":B="B";break;case"string":B="C";break;case"boolean":B="L";break;case"object":B=L[x]instanceof Date?"D":"C";break;default:B="C"}M=Math.max(M,String(L[x]).length),N=N&&N!=B?"C":B}M>250&&(M=250),B=((v[g]||{}).DBF||{}).type,B=="C"&&v[g].DBF.len>M&&(M=v[g].DBF.len),N=="B"&&B=="N"&&(N="N",z[g]=v[g].DBF.dec,M=v[g].DBF.len),F[g]=N=="C"||B=="N"?M:s[N]||0,b+=F[g],k[g]=N}var W=d.next(32);for(W.write_shift(4,318902576),W.write_shift(4,l.length),W.write_shift(2,296+32*T),W.write_shift(2,b),g=0;g<4;++g)W.write_shift(4,0);for(W.write_shift(4,0|(+t[n0]||3)<<8),g=0,x=0;g<m.length;++g)if(m[g]!=null){var y=d.next(32),H=(m[g].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);y.write_shift(1,H,"sbcs"),y.write_shift(1,k[g]=="?"?"C":k[g],"sbcs"),y.write_shift(4,x),y.write_shift(1,F[g]||s[k[g]]||0),y.write_shift(1,z[g]||0),y.write_shift(1,2),y.write_shift(4,0),y.write_shift(1,0),y.write_shift(4,0),y.write_shift(4,0),x+=F[g]||s[k[g]]||0}var Q=d.next(264);for(Q.write_shift(4,13),g=0;g<65;++g)Q.write_shift(4,0);for(g=0;g<l.length;++g){var J=d.next(b);for(J.write_shift(1,0),x=0;x<m.length;++x)if(m[x]!=null)switch(k[x]){case"L":J.write_shift(1,l[g][x]==null?63:l[g][x]?84:70);break;case"B":J.write_shift(8,l[g][x]||0,"f");break;case"N":var ee="0";for(typeof l[g][x]=="number"&&(ee=l[g][x].toFixed(z[x]||0)),T=0;T<F[x]-ee.length;++T)J.write_shift(1,32);J.write_shift(1,ee,"sbcs");break;case"D":l[g][x]?(J.write_shift(4,("0000"+l[g][x].getFullYear()).slice(-4),"sbcs"),J.write_shift(2,("00"+(l[g][x].getMonth()+1)).slice(-2),"sbcs"),J.write_shift(2,("00"+l[g][x].getDate()).slice(-2),"sbcs")):J.write_shift(8,"00000000","sbcs");break;case"C":var _e=String(l[g][x]!=null?l[g][x]:"").slice(0,F[x]);for(J.write_shift(1,_e,"sbcs"),T=0;T<F[x]-_e.length;++T)J.write_shift(1,32);break}}return d.next(1).write_shift(1,26),d.end()}return{to_workbook:i,to_sheet:n,from_sheet:a}})(),hg=(function(){var e={AA:"À",BA:"Á",CA:"Â",DA:195,HA:"Ä",JA:197,AE:"È",BE:"É",CE:"Ê",HE:"Ë",AI:"Ì",BI:"Í",CI:"Î",HI:"Ï",AO:"Ò",BO:"Ó",CO:"Ô",DO:213,HO:"Ö",AU:"Ù",BU:"Ú",CU:"Û",HU:"Ü",Aa:"à",Ba:"á",Ca:"â",Da:227,Ha:"ä",Ja:229,Ae:"è",Be:"é",Ce:"ê",He:"ë",Ai:"ì",Bi:"í",Ci:"î",Hi:"ï",Ao:"ò",Bo:"ó",Co:"ô",Do:245,Ho:"ö",Au:"ù",Bu:"ú",Cu:"û",Hu:"ü",KC:"Ç",Kc:"ç",q:"æ",z:"œ",a:"Æ",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},t=new RegExp("\x1BN("+er(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(m,l){var v=e[l];return typeof v=="number"?Ko(v):v},n=function(m,l,v){var g=l.charCodeAt(0)-32<<4|v.charCodeAt(0)-48;return g==59?m:Ko(g)};e["|"]=254;function i(m,l){switch(l.type){case"base64":return s(Kr(m),l);case"binary":return s(m,l);case"buffer":return s(Ze&&Buffer.isBuffer(m)?m.toString("binary"):Oi(m),l);case"array":return s(As(m),l)}throw new Error("Unrecognized type "+l.type)}function s(m,l){var v=m.split(/[\n\r]+/),g=-1,x=-1,T=0,b=0,_=[],k=[],F=null,z={},N=[],B=[],M=[],L=0,W;for(+l.codepage>=0&&vi(+l.codepage);T!==v.length;++T){L=0;var y=v[T].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,n).replace(t,r),H=y.replace(/;;/g,"\0").split(";").map(function(P){return P.replace(/\u0000/g,";")}),Q=H[0],J;if(y.length>0)switch(Q){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":H[1].charAt(0)=="P"&&k.push(y.slice(3).replace(/;;/g,";"));break;case"C":var ee=!1,_e=!1,Ae=!1,De=!1,oe=-1,ce=-1;for(b=1;b<H.length;++b)switch(H[b].charAt(0)){case"A":break;case"X":x=parseInt(H[b].slice(1))-1,_e=!0;break;case"Y":for(g=parseInt(H[b].slice(1))-1,_e||(x=0),W=_.length;W<=g;++W)_[W]=[];break;case"K":J=H[b].slice(1),J.charAt(0)==='"'?J=J.slice(1,J.length-1):J==="TRUE"?J=!0:J==="FALSE"?J=!1:isNaN(Yr(J))?isNaN(wi(J).getDate())||(J=lr(J)):(J=Yr(J),F!==null&&g0(F)&&(J=y0(J))),ee=!0;break;case"E":De=!0;var C=f1(H[b].slice(1),{r:g,c:x});_[g][x]=[_[g][x],C];break;case"S":Ae=!0,_[g][x]=[_[g][x],"S5S"];break;case"G":break;case"R":oe=parseInt(H[b].slice(1))-1;break;case"C":ce=parseInt(H[b].slice(1))-1;break;default:if(l&&l.WTF)throw new Error("SYLK bad record "+y)}if(ee&&(_[g][x]&&_[g][x].length==2?_[g][x][0]=J:_[g][x]=J,F=null),Ae){if(De)throw new Error("SYLK shared formula cannot have own formula");var j=oe>-1&&_[oe][ce];if(!j||!j[1])throw new Error("SYLK shared formula cannot find base");_[g][x][1]=d1(j[1],{r:g-oe,c:x-ce})}break;case"F":var R=0;for(b=1;b<H.length;++b)switch(H[b].charAt(0)){case"X":x=parseInt(H[b].slice(1))-1,++R;break;case"Y":for(g=parseInt(H[b].slice(1))-1,W=_.length;W<=g;++W)_[W]=[];break;case"M":L=parseInt(H[b].slice(1))/20;break;case"F":break;case"G":break;case"P":F=k[parseInt(H[b].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(M=H[b].slice(1).split(" "),W=parseInt(M[0],10);W<=parseInt(M[1],10);++W)L=parseInt(M[2],10),B[W-1]=L===0?{hidden:!0}:{wch:L},ao(B[W-1]);break;case"C":x=parseInt(H[b].slice(1))-1,B[x]||(B[x]={});break;case"R":g=parseInt(H[b].slice(1))-1,N[g]||(N[g]={}),L>0?(N[g].hpt=L,N[g].hpx=au(L)):L===0&&(N[g].hidden=!0);break;default:if(l&&l.WTF)throw new Error("SYLK bad record "+y)}R<1&&(F=null);break;default:if(l&&l.WTF)throw new Error("SYLK bad record "+y)}}return N.length>0&&(z["!rows"]=N),B.length>0&&(z["!cols"]=B),l&&l.sheetRows&&(_=_.slice(0,l.sheetRows)),[_,z]}function a(m,l){var v=i(m,l),g=v[0],x=v[1],T=Zn(g,l);return er(x).forEach(function(b){T[b]=x[b]}),T}function o(m,l){return bn(a(m,l),l)}function f(m,l,v,g){var x="C;Y"+(v+1)+";X"+(g+1)+";K";switch(m.t){case"n":x+=m.v||0,m.f&&!m.F&&(x+=";E"+lo(m.f,{r:v,c:g}));break;case"b":x+=m.v?"TRUE":"FALSE";break;case"e":x+=m.w||m.v;break;case"d":x+='"'+(m.w||m.v)+'"';break;case"s":x+='"'+m.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return x}function u(m,l){l.forEach(function(v,g){var x="F;W"+(g+1)+" "+(g+1)+" ";v.hidden?x+="0":(typeof v.width=="number"&&!v.wpx&&(v.wpx=ps(v.width)),typeof v.wpx=="number"&&!v.wch&&(v.wch=gs(v.wpx)),typeof v.wch=="number"&&(x+=Math.round(v.wch))),x.charAt(x.length-1)!=" "&&m.push(x)})}function d(m,l){l.forEach(function(v,g){var x="F;";v.hidden?x+="M0;":v.hpt?x+="M"+20*v.hpt+";":v.hpx&&(x+="M"+20*ms(v.hpx)+";"),x.length>2&&m.push(x+"R"+(g+1))})}function h(m,l){var v=["ID;PWXL;N;E"],g=[],x=wt(m["!ref"]),T,b=Array.isArray(m),_=`\r
|
|
24
|
-
`;
|
|
25
|
-
`),
|
|
26
|
-
`+
|
|
27
|
-
`,
|
|
28
|
-
`)}function t(
|
|
29
|
-
`),
|
|
22
|
+
`].join("")}function Ou(e){var t=[xt];t.push(`<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
|
23
|
+
`);for(var r=0;r!=e.length;++r)t.push(Ia(e[r][0],e[r][1])),t.push(Au("",e[r][0]));return t.push(Ia("","Document","pkg")),t.push("</rdf:RDF>"),t.join("")}function El(){return'<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS '+fi.version+"</meta:generator></office:meta></office:document-meta>"}var $r=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]];function Xi(e,t,r,n,i){i[e]!=null||t==null||t===""||(i[e]=t,t=Ze(t),n[n.length]=r?ce(e,t,r):kt(e,t))}function Sl(e,t){var r=t||{},n=[xt,ce("cp:coreProperties",null,{"xmlns:cp":_t.CORE_PROPS,"xmlns:dc":_t.dc,"xmlns:dcterms":_t.dcterms,"xmlns:dcmitype":_t.dcmitype,"xmlns:xsi":_t.xsi})],i={};if(!e&&!r.Props)return n.join("");e&&(e.CreatedDate!=null&&Xi("dcterms:created",typeof e.CreatedDate=="string"?e.CreatedDate:as(e.CreatedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},n,i),e.ModifiedDate!=null&&Xi("dcterms:modified",typeof e.ModifiedDate=="string"?e.ModifiedDate:as(e.ModifiedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},n,i));for(var s=0;s!=$r.length;++s){var a=$r[s],c=r.Props&&r.Props[a[1]]!=null?r.Props[a[1]]:e?e[a[1]]:null;c===!0?c="1":c===!1?c="0":typeof c=="number"&&(c=String(c)),c!=null&&Xi(a[0],c,null,n,i)}return n.length>2&&(n[n.length]="</cp:coreProperties>",n[1]=n[1].replace("/>",">")),n.join("")}var xn=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]],Cl=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function bl(e){var t=[],r=ce;return e||(e={}),e.Application="SheetJS",t[t.length]=xt,t[t.length]=ce("Properties",null,{xmlns:_t.EXT_PROPS,"xmlns:vt":_t.vt}),xn.forEach(function(n){if(e[n[1]]!==void 0){var i;switch(n[2]){case"string":i=Ze(String(e[n[1]]));break;case"bool":i=e[n[1]]?"true":"false";break}i!==void 0&&(t[t.length]=r(n[0],i))}}),t[t.length]=r("HeadingPairs",r("vt:vector",r("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+r("vt:variant",r("vt:i4",String(e.Worksheets))),{size:2,baseType:"variant"})),t[t.length]=r("TitlesOfParts",r("vt:vector",e.SheetNames.map(function(n){return"<vt:lpstr>"+Ze(n)+"</vt:lpstr>"}).join(""),{size:e.Worksheets,baseType:"lpstr"})),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}function Dl(e){var t=[xt,ce("Properties",null,{xmlns:_t.CUST_PROPS,"xmlns:vt":_t.vt})];if(!e)return t.join("");var r=1;return It(e).forEach(function(i){++r,t[t.length]=ce("property",Xf(e[i]),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:r,name:Ze(i)})}),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}var Na={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};function ku(e,t){var r=[];return It(Na).map(function(n){for(var i=0;i<$r.length;++i)if($r[i][1]==n)return $r[i];for(i=0;i<xn.length;++i)if(xn[i][1]==n)return xn[i];throw n}).forEach(function(n){if(e[n[1]]!=null){var i=t&&t.Props&&t.Props[n[1]]!=null?t.Props[n[1]]:e[n[1]];switch(n[2]){case"date":i=new Date(i).toISOString().replace(/\.\d*Z/,"Z");break}typeof i=="number"?i=String(i):i===!0||i===!1?i=i?"1":"0":i instanceof Date&&(i=new Date(i).toISOString().replace(/\.\d*Z/,"")),r.push(kt(Na[n[1]]||n[1],i))}}),ce("DocumentProperties",r.join(""),{xmlns:tr.o})}function Fu(e,t){var r=["Worksheets","SheetNames"],n="CustomDocumentProperties",i=[];return e&&It(e).forEach(function(s){if(Object.prototype.hasOwnProperty.call(e,s)){for(var a=0;a<$r.length;++a)if(s==$r[a][1])return;for(a=0;a<xn.length;++a)if(s==xn[a][1])return;for(a=0;a<r.length;++a)if(s==r[a])return;var c=e[s],u="string";typeof c=="number"?(u="float",c=String(c)):c===!0||c===!1?(u="boolean",c=c?"1":"0"):c=String(c),i.push(ce(wa(s),c,{"dt:dt":u}))}}),t&&It(t).forEach(function(s){if(Object.prototype.hasOwnProperty.call(t,s)&&!(e&&Object.prototype.hasOwnProperty.call(e,s))){var a=t[s],c="string";typeof a=="number"?(c="float",a=String(a)):a===!0||a===!1?(c="boolean",a=a?"1":"0"):a instanceof Date?(c="dateTime.tz",a=a.toISOString()):a=String(a),i.push(ce(wa(s),a,{"dt:dt":c}))}}),"<"+n+' xmlns="'+tr.o+'">'+i.join("")+"</"+n+">"}function Iu(e){var t=typeof e=="string"?new Date(Date.parse(e)):e,r=t.getTime()/1e3+11644473600,n=r%Math.pow(2,32),i=(r-n)/Math.pow(2,32);n*=1e7,i*=1e7;var s=n/Math.pow(2,32)|0;s>0&&(n=n%Math.pow(2,32),i+=s);var a=q(8);return a.write_shift(4,n),a.write_shift(4,i),a}function Ra(e,t){var r=q(4),n=q(4);switch(r.write_shift(4,e==80?31:e),e){case 3:n.write_shift(-4,t);break;case 5:n=q(8),n.write_shift(8,t,"f");break;case 11:n.write_shift(4,t?1:0);break;case 64:n=Iu(t);break;case 31:case 80:for(n=q(4+2*(t.length+1)+(t.length%2?0:2)),n.write_shift(4,t.length+1),n.write_shift(0,t,"dbcs");n.l!=n.length;)n.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+t)}return Ot([r,n])}var Al=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function Nu(e){switch(typeof e){case"boolean":return 11;case"number":return(e|0)==e?3:5;case"string":return 31;case"object":if(e instanceof Date)return 64;break}return-1}function Pa(e,t,r){var n=q(8),i=[],s=[],a=8,c=0,u=q(8),f=q(8);if(u.write_shift(4,2),u.write_shift(4,1200),f.write_shift(4,1),s.push(u),i.push(f),a+=8+u.length,!t){f=q(8),f.write_shift(4,0),i.unshift(f);var d=[q(4)];for(d[0].write_shift(4,e.length),c=0;c<e.length;++c){var p=e[c][0];for(u=q(8+2*(p.length+1)+(p.length%2?0:2)),u.write_shift(4,c+2),u.write_shift(4,p.length+1),u.write_shift(0,p,"dbcs");u.l!=u.length;)u.write_shift(1,0);d.push(u)}u=Ot(d),s.unshift(u),a+=8+u.length}for(c=0;c<e.length;++c)if(!(t&&!t[e[c][0]])&&!(Al.indexOf(e[c][0])>-1||Cl.indexOf(e[c][0])>-1)&&e[c][1]!=null){var x=e[c][1],l=0;if(t){l=+t[e[c][0]];var y=r[l];if(y.p=="version"&&typeof x=="string"){var g=x.split(".");x=(+g[0]<<16)+(+g[1]||0)}u=Ra(y.t,x)}else{var m=Nu(x);m==-1&&(m=31,x=String(x)),u=Ra(m,x)}s.push(u),f=q(8),f.write_shift(4,t?l:2+c),i.push(f),a+=8+u.length}var E=8*(s.length+1);for(c=0;c<s.length;++c)i[c].write_shift(4,E),E+=s[c].length;return n.write_shift(4,a),n.write_shift(4,s.length),Ot([n].concat(i).concat(s))}function ja(e,t,r,n,i,s){var a=q(i?68:48),c=[a];a.write_shift(2,65534),a.write_shift(2,0),a.write_shift(4,842412599),a.write_shift(16,et.utils.consts.HEADER_CLSID,"hex"),a.write_shift(4,i?2:1),a.write_shift(16,t,"hex"),a.write_shift(4,i?68:48);var u=Pa(e,r,n);if(c.push(u),i){var f=Pa(i,null,null);a.write_shift(16,s,"hex"),a.write_shift(4,68+u.length),c.push(f)}return Ot(c)}function Ru(e,t){t||(t=q(e));for(var r=0;r<e;++r)t.write_shift(1,0);return t}function Pu(e,t){return e.read_shift(t)===1}function Vt(e,t){return t||(t=q(2)),t.write_shift(2,+!!e),t}function Ol(e){return e.read_shift(2,"u")}function or(e,t){return t||(t=q(2)),t.write_shift(2,e),t}function kl(e,t,r){return r||(r=q(2)),r.write_shift(1,t=="e"?+e:+!!e),r.write_shift(1,t=="e"?1:0),r}function Fl(e,t,r){var n=e.read_shift(r&&r.biff>=12?2:1),i="sbcs-cont";if(r&&r.biff>=8,!r||r.biff==8){var s=e.read_shift(1);s&&(i="dbcs-cont")}else r.biff==12&&(i="wstr");r.biff>=2&&r.biff<=5&&(i="cpstr");var a=n?e.read_shift(n,i):"";return a}function ju(e){var t=e.t||"",r=q(3);r.write_shift(2,t.length),r.write_shift(1,1);var n=q(2*t.length);n.write_shift(2*t.length,t,"utf16le");var i=[r,n];return Ot(i)}function Mu(e,t,r){var n;if(r){if(r.biff>=2&&r.biff<=5)return e.read_shift(t,"cpstr");if(r.biff>=12)return e.read_shift(t,"dbcs-cont")}var i=e.read_shift(1);return i===0?n=e.read_shift(t,"sbcs-cont"):n=e.read_shift(t,"dbcs-cont"),n}function Lu(e,t,r){var n=e.read_shift(r&&r.biff==2?1:2);return n===0?(e.l++,""):Mu(e,n,r)}function Bu(e,t,r){if(r.biff>5)return Lu(e,t,r);var n=e.read_shift(1);return n===0?(e.l++,""):e.read_shift(n,r.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function Il(e,t,r){return r||(r=q(3+2*e.length)),r.write_shift(2,e.length),r.write_shift(1,1),r.write_shift(31,e,"utf16le"),r}function Ma(e,t){t||(t=q(6+e.length*2)),t.write_shift(4,1+e.length);for(var r=0;r<e.length;++r)t.write_shift(2,e.charCodeAt(r));return t.write_shift(2,0),t}function Uu(e){var t=q(512),r=0,n=e.Target;n.slice(0,7)=="file://"&&(n=n.slice(7));var i=n.indexOf("#"),s=i>-1?31:23;switch(n.charAt(0)){case"#":s=28;break;case".":s&=-3;break}t.write_shift(4,2),t.write_shift(4,s);var a=[8,6815827,6619237,4849780,83];for(r=0;r<a.length;++r)t.write_shift(4,a[r]);if(s==28)n=n.slice(1),Ma(n,t);else if(s&2){for(a="e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),r=0;r<a.length;++r)t.write_shift(1,parseInt(a[r],16));var c=i>-1?n.slice(0,i):n;for(t.write_shift(4,2*(c.length+1)),r=0;r<c.length;++r)t.write_shift(2,c.charCodeAt(r));t.write_shift(2,0),s&8&&Ma(i>-1?n.slice(i+1):"",t)}else{for(a="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "),r=0;r<a.length;++r)t.write_shift(1,parseInt(a[r],16));for(var u=0;n.slice(u*3,u*3+3)=="../"||n.slice(u*3,u*3+3)=="..\\";)++u;for(t.write_shift(2,u),t.write_shift(4,n.length-3*u+1),r=0;r<n.length-3*u;++r)t.write_shift(1,n.charCodeAt(r+3*u)&255);for(t.write_shift(1,0),t.write_shift(2,65535),t.write_shift(2,57005),r=0;r<6;++r)t.write_shift(4,0)}return t.slice(0,t.l)}function Yr(e,t,r,n){return n||(n=q(6)),n.write_shift(2,e),n.write_shift(2,t),n.write_shift(2,r||0),n}function Wu(e,t,r){var n=r.biff>8?4:2,i=e.read_shift(n),s=e.read_shift(n,"i"),a=e.read_shift(n,"i");return[i,s,a]}function Vu(e){var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(2),i=e.read_shift(2);return{s:{c:n,r:t},e:{c:i,r}}}function Nl(e,t){return t||(t=q(8)),t.write_shift(2,e.s.r),t.write_shift(2,e.e.r),t.write_shift(2,e.s.c),t.write_shift(2,e.e.c),t}function Is(e,t,r){var n=1536,i=16;switch(r.bookType){case"biff8":break;case"biff5":n=1280,i=8;break;case"biff4":n=4,i=6;break;case"biff3":n=3,i=6;break;case"biff2":n=2,i=4;break;case"xla":break;default:throw new Error("unsupported BIFF version")}var s=q(i);return s.write_shift(2,n),s.write_shift(2,t),i>4&&s.write_shift(2,29282),i>6&&s.write_shift(2,1997),i>8&&(s.write_shift(2,49161),s.write_shift(2,1),s.write_shift(2,1798),s.write_shift(2,0)),s}function zu(e,t){var r=!t||t.biff==8,n=q(r?112:54);for(n.write_shift(t.biff==8?2:1,7),r&&n.write_shift(1,0),n.write_shift(4,859007059),n.write_shift(4,5458548|(r?0:536870912));n.l<n.length;)n.write_shift(1,r?0:32);return n}function Hu(e,t){var r=!t||t.biff>=8?2:1,n=q(8+r*e.name.length);n.write_shift(4,e.pos),n.write_shift(1,e.hs||0),n.write_shift(1,e.dt),n.write_shift(1,e.name.length),t.biff>=8&&n.write_shift(1,1),n.write_shift(r*e.name.length,e.name,t.biff<8?"sbcs":"utf16le");var i=n.slice(0,n.l);return i.l=n.l,i}function $u(e,t){var r=q(8);r.write_shift(4,e.Count),r.write_shift(4,e.Unique);for(var n=[],i=0;i<e.length;++i)n[i]=ju(e[i]);var s=Ot([r].concat(n));return s.parts=[r.length].concat(n.map(function(a){return a.length})),s}function Gu(){var e=q(18);return e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,29280),e.write_shift(2,17600),e.write_shift(2,56),e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,1),e.write_shift(2,500),e}function Xu(e){var t=q(18),r=1718;return e&&e.RTL&&(r|=64),t.write_shift(2,r),t.write_shift(4,0),t.write_shift(4,64),t.write_shift(4,0),t.write_shift(4,0),t}function Yu(e,t){var r=e.name||"Arial",n=t&&t.biff==5,i=n?15+r.length:16+2*r.length,s=q(i);return s.write_shift(2,e.sz*20),s.write_shift(4,0),s.write_shift(2,400),s.write_shift(4,0),s.write_shift(2,0),s.write_shift(1,r.length),n||s.write_shift(1,1),s.write_shift((n?1:2)*r.length,r,n?"sbcs":"utf16le"),s}function Ku(e,t,r,n){var i=q(10);return Yr(e,t,n,i),i.write_shift(4,r),i}function qu(e,t,r,n,i){var s=!i||i.biff==8,a=q(8+ +s+(1+s)*r.length);return Yr(e,t,n,a),a.write_shift(2,r.length),s&&a.write_shift(1,1),a.write_shift((1+s)*r.length,r,s?"utf16le":"sbcs"),a}function Ju(e,t,r,n){var i=r&&r.biff==5;n||(n=q(i?3+t.length:5+2*t.length)),n.write_shift(2,e),n.write_shift(i?1:2,t.length),i||n.write_shift(1,1),n.write_shift((i?1:2)*t.length,t,i?"sbcs":"utf16le");var s=n.length>n.l?n.slice(0,n.l):n;return s.l==null&&(s.l=s.length),s}function Zu(e,t){var r=t.biff==8||!t.biff?4:2,n=q(2*r+6);return n.write_shift(r,e.s.r),n.write_shift(r,e.e.r+1),n.write_shift(2,e.s.c),n.write_shift(2,e.e.c+1),n.write_shift(2,0),n}function La(e,t,r,n){var i=r&&r.biff==5;n||(n=q(i?16:20)),n.write_shift(2,0),e.style?(n.write_shift(2,e.numFmtId||0),n.write_shift(2,65524)):(n.write_shift(2,e.numFmtId||0),n.write_shift(2,t<<4));var s=0;return e.numFmtId>0&&i&&(s|=1024),n.write_shift(4,s),n.write_shift(4,0),i||n.write_shift(4,0),n.write_shift(2,0),n}function Qu(e){var t=q(8);return t.write_shift(4,0),t.write_shift(2,0),t.write_shift(2,0),t}function eh(e,t,r,n,i,s){var a=q(8);return Yr(e,t,n,a),kl(r,s,a),a}function th(e,t,r,n){var i=q(14);return Yr(e,t,n,i),Xr(r,i),i}function rh(e,t,r){if(r.biff<8)return nh(e,t,r);for(var n=[],i=e.l+t,s=e.read_shift(r.biff>8?4:2);s--!==0;)n.push(Wu(e,r.biff>8?12:6,r));if(e.l!=i)throw new Error("Bad ExternSheet: "+e.l+" != "+i);return n}function nh(e,t,r){e[e.l+1]==3&&e[e.l]++;var n=Fl(e,t,r);return n.charCodeAt(0)==3?n.slice(1):n}function ih(e){var t=q(2+e.length*8);t.write_shift(2,e.length);for(var r=0;r<e.length;++r)Nl(e[r],t);return t}function sh(e){var t=q(24),r=Et(e[0]);t.write_shift(2,r.r),t.write_shift(2,r.r),t.write_shift(2,r.c),t.write_shift(2,r.c);for(var n="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),i=0;i<16;++i)t.write_shift(1,parseInt(n[i],16));return Ot([t,Uu(e[1])])}function ah(e){var t=e[1].Tooltip,r=q(10+2*(t.length+1));r.write_shift(2,2048);var n=Et(e[0]);r.write_shift(2,n.r),r.write_shift(2,n.r),r.write_shift(2,n.c),r.write_shift(2,n.c);for(var i=0;i<t.length;++i)r.write_shift(2,t.charCodeAt(i));return r.write_shift(2,0),r}function oh(e){return e||(e=q(4)),e.write_shift(2,1),e.write_shift(2,1),e}function lh(e,t,r){if(!r.cellStyles)return Er(e,t);var n=r&&r.biff>=12?4:2,i=e.read_shift(n),s=e.read_shift(n),a=e.read_shift(n),c=e.read_shift(n),u=e.read_shift(2);n==2&&(e.l+=2);var f={s:i,e:s,w:a,ixfe:c,flags:u};return(r.biff>=5||!r.biff)&&(f.level=u>>8&7),f}function ch(e,t){var r=q(12);r.write_shift(2,t),r.write_shift(2,t),r.write_shift(2,e.width*256),r.write_shift(2,0);var n=0;return e.hidden&&(n|=1),r.write_shift(1,n),n=e.level||0,r.write_shift(1,n),r.write_shift(2,0),r}function fh(e){for(var t=q(2*e),r=0;r<e;++r)t.write_shift(2,r+1);return t}function uh(e,t,r){var n=q(15);return Yn(n,e,t),n.write_shift(8,r,"f"),n}function hh(e,t,r){var n=q(9);return Yn(n,e,t),n.write_shift(2,r),n}var dh=(function(){var e={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},t=Ts({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(c,u){var f=[],d=Gr(1);switch(u.type){case"base64":d=dr(kr(c));break;case"binary":d=dr(c);break;case"buffer":case"array":d=c;break}er(d,0);var p=d.read_shift(1),x=!!(p&136),l=!1,y=!1;switch(p){case 2:break;case 3:break;case 48:l=!0,x=!0;break;case 49:l=!0,x=!0;break;case 131:break;case 139:break;case 140:y=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+p.toString(16))}var g=0,m=521;p==2&&(g=d.read_shift(2)),d.l+=3,p!=2&&(g=d.read_shift(4)),g>1048576&&(g=1e6),p!=2&&(m=d.read_shift(2));var E=d.read_shift(2),D=u.codepage||1252;p!=2&&(d.l+=16,d.read_shift(1),d[d.l]!==0&&(D=e[d[d.l]]),d.l+=1,d.l+=2),y&&(d.l+=36);for(var C=[],N={},L=Math.min(d.length,p==2?521:m-10-(l?264:0)),Q=y?32:11;d.l<L&&d[d.l]!=13;)switch(N={},N.name=ui.utils.decode(D,d.slice(d.l,d.l+Q)).replace(/[\u0000\r\n].*$/g,""),d.l+=Q,N.type=String.fromCharCode(d.read_shift(1)),p!=2&&!y&&(N.offset=d.read_shift(4)),N.len=d.read_shift(1),p==2&&(N.offset=d.read_shift(2)),N.dec=d.read_shift(1),N.name.length&&C.push(N),p!=2&&(d.l+=y?13:14),N.type){case"B":(!l||N.len!=8)&&u.WTF&&console.log("Skipping "+N.name+":"+N.type);break;case"G":case"P":u.WTF&&console.log("Skipping "+N.name+":"+N.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+N.type)}if(d[d.l]!==13&&(d.l=m-1),d.read_shift(1)!==13)throw new Error("DBF Terminator not found "+d.l+" "+d[d.l]);d.l=m;var k=0,V=0;for(f[0]=[],V=0;V!=C.length;++V)f[0][V]=C[V].name;for(;g-- >0;){if(d[d.l]===42){d.l+=E;continue}for(++d.l,f[++k]=[],V=0,V=0;V!=C.length;++V){var j=d.slice(d.l,d.l+C[V].len);d.l+=C[V].len,er(j,0);var B=ui.utils.decode(D,j);switch(C[V].type){case"C":B.trim().length&&(f[k][V]=B.replace(/\s+$/,""));break;case"D":B.length===8?f[k][V]=new Date(+B.slice(0,4),+B.slice(4,6)-1,+B.slice(6,8)):f[k][V]=B;break;case"F":f[k][V]=parseFloat(B.trim());break;case"+":case"I":f[k][V]=y?j.read_shift(-4,"i")^2147483648:j.read_shift(4,"i");break;case"L":switch(B.trim().toUpperCase()){case"Y":case"T":f[k][V]=!0;break;case"N":case"F":f[k][V]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+B+"|")}break;case"M":if(!x)throw new Error("DBF Unexpected MEMO for type "+p.toString(16));f[k][V]="##MEMO##"+(y?parseInt(B.trim(),10):j.read_shift(4));break;case"N":B=B.replace(/\u0000/g,"").trim(),B&&B!="."&&(f[k][V]=+B||0);break;case"@":f[k][V]=new Date(j.read_shift(-8,"f")-621356832e5);break;case"T":f[k][V]=new Date((j.read_shift(4)-2440588)*864e5+j.read_shift(4));break;case"Y":f[k][V]=j.read_shift(4,"i")/1e4+j.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":f[k][V]=-j.read_shift(-8,"f");break;case"B":if(l&&C[V].len==8){f[k][V]=j.read_shift(8,"f");break}case"G":case"P":j.l+=C[V].len;break;case"0":if(C[V].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+C[V].type)}}}if(p!=2&&d.l<d.length&&d[d.l++]!=26)throw new Error("DBF EOF Marker missing "+(d.l-1)+" of "+d.length+" "+d[d.l-1].toString(16));return u&&u.sheetRows&&(f=f.slice(0,u.sheetRows)),u.DBF=C,f}function n(c,u){var f=u||{};f.dateNF||(f.dateNF="yyyymmdd");var d=yn(r(c,f),f);return d["!cols"]=f.DBF.map(function(p){return{wch:p.len,DBF:p}}),delete f.DBF,d}function i(c,u){try{return Jr(n(c,u),u)}catch(f){if(u&&u.WTF)throw f}return{SheetNames:[],Sheets:{}}}var s={B:8,C:250,L:1,D:8,"?":0,"":0};function a(c,u){var f=u||{};if(+f.codepage>=0&&Pn(+f.codepage),f.type=="string")throw new Error("Cannot write DBF to JS string");var d=Yt(),p=Si(c,{header:1,raw:!0,cellDates:!0}),x=p[0],l=p.slice(1),y=c["!cols"]||[],g=0,m=0,E=0,D=1;for(g=0;g<x.length;++g){if(((y[g]||{}).DBF||{}).name){x[g]=y[g].DBF.name,++E;continue}if(x[g]!=null){if(++E,typeof x[g]=="number"&&(x[g]=x[g].toString(10)),typeof x[g]!="string")throw new Error("DBF Invalid column name "+x[g]+" |"+typeof x[g]+"|");if(x.indexOf(x[g])!==g){for(m=0;m<1024;++m)if(x.indexOf(x[g]+"_"+m)==-1){x[g]+="_"+m;break}}}}var C=it(c["!ref"]),N=[],L=[],Q=[];for(g=0;g<=C.e.c-C.s.c;++g){var k="",V="",j=0,B=[];for(m=0;m<l.length;++m)l[m][g]!=null&&B.push(l[m][g]);if(B.length==0||x[g]==null){N[g]="?";continue}for(m=0;m<B.length;++m){switch(typeof B[m]){case"number":V="B";break;case"string":V="C";break;case"boolean":V="L";break;case"object":V=B[m]instanceof Date?"D":"C";break;default:V="C"}j=Math.max(j,String(B[m]).length),k=k&&k!=V?"C":V}j>250&&(j=250),V=((y[g]||{}).DBF||{}).type,V=="C"&&y[g].DBF.len>j&&(j=y[g].DBF.len),k=="B"&&V=="N"&&(k="N",Q[g]=y[g].DBF.dec,j=y[g].DBF.len),L[g]=k=="C"||V=="N"?j:s[k]||0,D+=L[g],N[g]=k}var X=d.next(32);for(X.write_shift(4,318902576),X.write_shift(4,l.length),X.write_shift(2,296+32*E),X.write_shift(2,D),g=0;g<4;++g)X.write_shift(4,0);for(X.write_shift(4,0|(+t[Po]||3)<<8),g=0,m=0;g<x.length;++g)if(x[g]!=null){var M=d.next(32),ee=(x[g].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);M.write_shift(1,ee,"sbcs"),M.write_shift(1,N[g]=="?"?"C":N[g],"sbcs"),M.write_shift(4,m),M.write_shift(1,L[g]||s[N[g]]||0),M.write_shift(1,Q[g]||0),M.write_shift(1,2),M.write_shift(4,0),M.write_shift(1,0),M.write_shift(4,0),M.write_shift(4,0),m+=L[g]||s[N[g]]||0}var Te=d.next(264);for(Te.write_shift(4,13),g=0;g<65;++g)Te.write_shift(4,0);for(g=0;g<l.length;++g){var ne=d.next(D);for(ne.write_shift(1,0),m=0;m<x.length;++m)if(x[m]!=null)switch(N[m]){case"L":ne.write_shift(1,l[g][m]==null?63:l[g][m]?84:70);break;case"B":ne.write_shift(8,l[g][m]||0,"f");break;case"N":var ae="0";for(typeof l[g][m]=="number"&&(ae=l[g][m].toFixed(Q[m]||0)),E=0;E<L[m]-ae.length;++E)ne.write_shift(1,32);ne.write_shift(1,ae,"sbcs");break;case"D":l[g][m]?(ne.write_shift(4,("0000"+l[g][m].getFullYear()).slice(-4),"sbcs"),ne.write_shift(2,("00"+(l[g][m].getMonth()+1)).slice(-2),"sbcs"),ne.write_shift(2,("00"+l[g][m].getDate()).slice(-2),"sbcs")):ne.write_shift(8,"00000000","sbcs");break;case"C":var Se=String(l[g][m]!=null?l[g][m]:"").slice(0,L[m]);for(ne.write_shift(1,Se,"sbcs"),E=0;E<L[m]-Se.length;++E)ne.write_shift(1,32);break}}return d.next(1).write_shift(1,26),d.end()}return{to_workbook:i,to_sheet:n,from_sheet:a}})(),ph=(function(){var e={AA:"À",BA:"Á",CA:"Â",DA:195,HA:"Ä",JA:197,AE:"È",BE:"É",CE:"Ê",HE:"Ë",AI:"Ì",BI:"Í",CI:"Î",HI:"Ï",AO:"Ò",BO:"Ó",CO:"Ô",DO:213,HO:"Ö",AU:"Ù",BU:"Ú",CU:"Û",HU:"Ü",Aa:"à",Ba:"á",Ca:"â",Da:227,Ha:"ä",Ja:229,Ae:"è",Be:"é",Ce:"ê",He:"ë",Ai:"ì",Bi:"í",Ci:"î",Hi:"ï",Ao:"ò",Bo:"ó",Co:"ô",Do:245,Ho:"ö",Au:"ù",Bu:"ú",Cu:"û",Hu:"ü",KC:"Ç",Kc:"ç",q:"æ",z:"œ",a:"Æ",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},t=new RegExp("\x1BN("+It(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(x,l){var y=e[l];return typeof y=="number"?la(y):y},n=function(x,l,y){var g=l.charCodeAt(0)-32<<4|y.charCodeAt(0)-48;return g==59?x:la(g)};e["|"]=254;function i(x,l){switch(l.type){case"base64":return s(kr(x),l);case"binary":return s(x,l);case"buffer":return s($e&&Buffer.isBuffer(x)?x.toString("binary"):zn(x),l);case"array":return s(ki(x),l)}throw new Error("Unrecognized type "+l.type)}function s(x,l){var y=x.split(/[\n\r]+/),g=-1,m=-1,E=0,D=0,C=[],N=[],L=null,Q={},k=[],V=[],j=[],B=0,X;for(+l.codepage>=0&&Pn(+l.codepage);E!==y.length;++E){B=0;var M=y[E].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,n).replace(t,r),ee=M.replace(/;;/g,"\0").split(";").map(function(R){return R.replace(/\u0000/g,";")}),Te=ee[0],ne;if(M.length>0)switch(Te){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":ee[1].charAt(0)=="P"&&N.push(M.slice(3).replace(/;;/g,";"));break;case"C":var ae=!1,Se=!1,Ne=!1,be=!1,ze=-1,_e=-1;for(D=1;D<ee.length;++D)switch(ee[D].charAt(0)){case"A":break;case"X":m=parseInt(ee[D].slice(1))-1,Se=!0;break;case"Y":for(g=parseInt(ee[D].slice(1))-1,Se||(m=0),X=C.length;X<=g;++X)C[X]=[];break;case"K":ne=ee[D].slice(1),ne.charAt(0)==='"'?ne=ne.slice(1,ne.length-1):ne==="TRUE"?ne=!0:ne==="FALSE"?ne=!1:isNaN(Ar(ne))?isNaN(Mn(ne).getDate())||(ne=zt(ne)):(ne=Ar(ne),L!==null&&Xo(L)&&(ne=Jo(ne))),ae=!0;break;case"E":be=!0;var O=hd(ee[D].slice(1),{r:g,c:m});C[g][m]=[C[g][m],O];break;case"S":Ne=!0,C[g][m]=[C[g][m],"S5S"];break;case"G":break;case"R":ze=parseInt(ee[D].slice(1))-1;break;case"C":_e=parseInt(ee[D].slice(1))-1;break;default:if(l&&l.WTF)throw new Error("SYLK bad record "+M)}if(ae&&(C[g][m]&&C[g][m].length==2?C[g][m][0]=ne:C[g][m]=ne,L=null),Ne){if(be)throw new Error("SYLK shared formula cannot have own formula");var P=ze>-1&&C[ze][_e];if(!P||!P[1])throw new Error("SYLK shared formula cannot find base");C[g][m][1]=dd(P[1],{r:g-ze,c:m-_e})}break;case"F":var I=0;for(D=1;D<ee.length;++D)switch(ee[D].charAt(0)){case"X":m=parseInt(ee[D].slice(1))-1,++I;break;case"Y":for(g=parseInt(ee[D].slice(1))-1,X=C.length;X<=g;++X)C[X]=[];break;case"M":B=parseInt(ee[D].slice(1))/20;break;case"F":break;case"G":break;case"P":L=N[parseInt(ee[D].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(j=ee[D].slice(1).split(" "),X=parseInt(j[0],10);X<=parseInt(j[1],10);++X)B=parseInt(j[2],10),V[X-1]=B===0?{hidden:!0}:{wch:B},Ns(V[X-1]);break;case"C":m=parseInt(ee[D].slice(1))-1,V[m]||(V[m]={});break;case"R":g=parseInt(ee[D].slice(1))-1,k[g]||(k[g]={}),B>0?(k[g].hpt=B,k[g].hpx=Ll(B)):B===0&&(k[g].hidden=!0);break;default:if(l&&l.WTF)throw new Error("SYLK bad record "+M)}I<1&&(L=null);break;default:if(l&&l.WTF)throw new Error("SYLK bad record "+M)}}return k.length>0&&(Q["!rows"]=k),V.length>0&&(Q["!cols"]=V),l&&l.sheetRows&&(C=C.slice(0,l.sheetRows)),[C,Q]}function a(x,l){var y=i(x,l),g=y[0],m=y[1],E=yn(g,l);return It(m).forEach(function(D){E[D]=m[D]}),E}function c(x,l){return Jr(a(x,l),l)}function u(x,l,y,g){var m="C;Y"+(y+1)+";X"+(g+1)+";K";switch(x.t){case"n":m+=x.v||0,x.f&&!x.F&&(m+=";E"+Ps(x.f,{r:y,c:g}));break;case"b":m+=x.v?"TRUE":"FALSE";break;case"e":m+=x.w||x.v;break;case"d":m+='"'+(x.w||x.v)+'"';break;case"s":m+='"'+x.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return m}function f(x,l){l.forEach(function(y,g){var m="F;W"+(g+1)+" "+(g+1)+" ";y.hidden?m+="0":(typeof y.width=="number"&&!y.wpx&&(y.wpx=wi(y.width)),typeof y.wpx=="number"&&!y.wch&&(y.wch=Ti(y.wpx)),typeof y.wch=="number"&&(m+=Math.round(y.wch))),m.charAt(m.length-1)!=" "&&x.push(m)})}function d(x,l){l.forEach(function(y,g){var m="F;";y.hidden?m+="M0;":y.hpt?m+="M"+20*y.hpt+";":y.hpx&&(m+="M"+20*_i(y.hpx)+";"),m.length>2&&x.push(m+"R"+(g+1))})}function p(x,l){var y=["ID;PWXL;N;E"],g=[],m=it(x["!ref"]),E,D=Array.isArray(x),C=`\r
|
|
24
|
+
`;y.push("P;PGeneral"),y.push("F;P0;DG0G8;M255"),x["!cols"]&&f(y,x["!cols"]),x["!rows"]&&d(y,x["!rows"]),y.push("B;Y"+(m.e.r-m.s.r+1)+";X"+(m.e.c-m.s.c+1)+";D"+[m.s.c,m.s.r,m.e.c,m.e.r].join(" "));for(var N=m.s.r;N<=m.e.r;++N)for(var L=m.s.c;L<=m.e.c;++L){var Q=Qe({r:N,c:L});E=D?(x[N]||[])[L]:x[Q],!(!E||E.v==null&&(!E.f||E.F))&&g.push(u(E,x,N,L))}return y.join(C)+C+g.join(C)+C+"E"+C}return{to_workbook:c,to_sheet:a,from_sheet:p}})(),xh=(function(){function e(s,a){switch(a.type){case"base64":return t(kr(s),a);case"binary":return t(s,a);case"buffer":return t($e&&Buffer.isBuffer(s)?s.toString("binary"):zn(s),a);case"array":return t(ki(s),a)}throw new Error("Unrecognized type "+a.type)}function t(s,a){for(var c=s.split(`
|
|
25
|
+
`),u=-1,f=-1,d=0,p=[];d!==c.length;++d){if(c[d].trim()==="BOT"){p[++u]=[],f=0;continue}if(!(u<0)){var x=c[d].trim().split(","),l=x[0],y=x[1];++d;for(var g=c[d]||"";(g.match(/["]/g)||[]).length&1&&d<c.length-1;)g+=`
|
|
26
|
+
`+c[++d];switch(g=g.trim(),+l){case-1:if(g==="BOT"){p[++u]=[],f=0;continue}else if(g!=="EOD")throw new Error("Unrecognized DIF special command "+g);break;case 0:g==="TRUE"?p[u][f]=!0:g==="FALSE"?p[u][f]=!1:isNaN(Ar(y))?isNaN(Mn(y).getDate())?p[u][f]=y:p[u][f]=zt(y):p[u][f]=Ar(y),++f;break;case 1:g=g.slice(1,g.length-1),g=g.replace(/""/g,'"'),g&&g.match(/^=".*"$/)&&(g=g.slice(2,-1)),p[u][f++]=g!==""?g:null;break}if(g==="EOD")break}}return a&&a.sheetRows&&(p=p.slice(0,a.sheetRows)),p}function r(s,a){return yn(e(s,a),a)}function n(s,a){return Jr(r(s,a),a)}var i=(function(){var s=function(u,f,d,p,x){u.push(f),u.push(d+","+p),u.push('"'+x.replace(/"/g,'""')+'"')},a=function(u,f,d,p){u.push(f+","+d),u.push(f==1?'"'+p.replace(/"/g,'""')+'"':p)};return function(u){var f=[],d=it(u["!ref"]),p,x=Array.isArray(u);s(f,"TABLE",0,1,"sheetjs"),s(f,"VECTORS",0,d.e.r-d.s.r+1,""),s(f,"TUPLES",0,d.e.c-d.s.c+1,""),s(f,"DATA",0,0,"");for(var l=d.s.r;l<=d.e.r;++l){a(f,-1,0,"BOT");for(var y=d.s.c;y<=d.e.c;++y){var g=Qe({r:l,c:y});if(p=x?(u[l]||[])[y]:u[g],!p){a(f,1,0,"");continue}switch(p.t){case"n":var m=p.w;!m&&p.v!=null&&(m=p.v),m==null?p.f&&!p.F?a(f,1,0,"="+p.f):a(f,1,0,""):a(f,0,m,"V");break;case"b":a(f,0,p.v?1:0,p.v?"TRUE":"FALSE");break;case"s":a(f,1,0,isNaN(p.v)?p.v:'="'+p.v+'"');break;case"d":p.w||(p.w=Mr(p.z||ut[14],Kt(zt(p.v)))),a(f,0,p.w,"V");break;default:a(f,1,0,"")}}}a(f,-1,0,"EOD");var E=`\r
|
|
27
|
+
`,D=f.join(E);return D}})();return{to_workbook:n,to_sheet:r,from_sheet:i}})(),Rl=(function(){function e(p){return p.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,`
|
|
28
|
+
`)}function t(p){return p.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function r(p,x){for(var l=p.split(`
|
|
29
|
+
`),y=-1,g=-1,m=0,E=[];m!==l.length;++m){var D=l[m].trim().split(":");if(D[0]==="cell"){var C=Et(D[1]);if(E.length<=C.r)for(y=E.length;y<=C.r;++y)E[y]||(E[y]=[]);switch(y=C.r,g=C.c,D[2]){case"t":E[y][g]=e(D[3]);break;case"v":E[y][g]=+D[3];break;case"vtf":var N=D[D.length-1];case"vtc":switch(D[3]){case"nl":E[y][g]=!!+D[4];break;default:E[y][g]=+D[4];break}D[2]=="vtf"&&(E[y][g]=[E[y][g],N])}}}return x&&x.sheetRows&&(E=E.slice(0,x.sheetRows)),E}function n(p,x){return yn(r(p,x),x)}function i(p,x){return Jr(n(p,x),x)}var s=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(`
|
|
30
30
|
`),a=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(`
|
|
31
31
|
`)+`
|
|
32
|
-
`,
|
|
33
|
-
`),
|
|
34
|
-
`)}function d(
|
|
35
|
-
`)}return{to_workbook:i,to_sheet:n,from_sheet:d}})(),
|
|
36
|
-
`);var
|
|
37
|
-
`)}return{to_workbook:f,to_sheet:o,from_sheet:u}})(),Cl=(function(){function e(C,j,R){if(C){xr(C,C.l||0);for(var P=R.Enum||oe;C.l<C.length;){var V=C.read_shift(2),le=P[V]||P[65535],fe=C.read_shift(2),ue=C.l+fe,te=le.f&&le.f(C,fe,R);if(C.l=ue,j(te,le,V))return}}}function t(C,j){switch(j.type){case"base64":return r(Nr(Kr(C)),j);case"binary":return r(Nr(C),j);case"buffer":case"array":return r(C,j)}throw"Unsupported type "+j.type}function r(C,j){if(!C)return C;var R=j||{},P=R.dense?[]:{},V="Sheet1",le="",fe=0,ue={},te=[],Ie=[],ae={s:{r:0,c:0},e:{r:0,c:0}},Pe=R.sheetRows||0;if(C[2]==0&&(C[3]==8||C[3]==9)&&C.length>=16&&C[14]==5&&C[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(C[2]==2)R.Enum=oe,e(C,function(we,ut,je){switch(je){case 0:R.vers=we,we>=4096&&(R.qpro=!0);break;case 6:ae=we;break;case 204:we&&(le=we);break;case 222:le=we;break;case 15:case 51:R.qpro||(we[1].v=we[1].v.slice(1));case 13:case 14:case 16:je==14&&(we[2]&112)==112&&(we[2]&15)>1&&(we[2]&15)<15&&(we[1].z=R.dateNF||Dt[14],R.cellDates&&(we[1].t="d",we[1].v=y0(we[1].v))),R.qpro&&we[3]>fe&&(P["!ref"]=jt(ae),ue[V]=P,te.push(V),P=R.dense?[]:{},ae={s:{r:0,c:0},e:{r:0,c:0}},fe=we[3],V=le||"Sheet"+(fe+1),le="");var Rt=R.dense?(P[we[0].r]||[])[we[0].c]:P[ct(we[0])];if(Rt){Rt.t=we[1].t,Rt.v=we[1].v,we[1].z!=null&&(Rt.z=we[1].z),we[1].f!=null&&(Rt.f=we[1].f);break}R.dense?(P[we[0].r]||(P[we[0].r]=[]),P[we[0].r][we[0].c]=we[1]):P[ct(we[0])]=we[1];break}},R);else if(C[2]==26||C[2]==14)R.Enum=ce,C[2]==14&&(R.qpro=!0,C.l=0),e(C,function(we,ut,je){switch(je){case 204:V=we;break;case 22:we[1].v=we[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(we[3]>fe&&(P["!ref"]=jt(ae),ue[V]=P,te.push(V),P=R.dense?[]:{},ae={s:{r:0,c:0},e:{r:0,c:0}},fe=we[3],V="Sheet"+(fe+1)),Pe>0&&we[0].r>=Pe)break;R.dense?(P[we[0].r]||(P[we[0].r]=[]),P[we[0].r][we[0].c]=we[1]):P[ct(we[0])]=we[1],ae.e.c<we[0].c&&(ae.e.c=we[0].c),ae.e.r<we[0].r&&(ae.e.r=we[0].r);break;case 27:we[14e3]&&(Ie[we[14e3][0]]=we[14e3][1]);break;case 1537:Ie[we[0]]=we[1],we[0]==fe&&(V=we[1]);break}},R);else throw new Error("Unrecognized LOTUS BOF "+C[2]);if(P["!ref"]=jt(ae),ue[le||V]=P,te.push(le||V),!Ie.length)return{SheetNames:te,Sheets:ue};for(var ke={},pt=[],He=0;He<Ie.length;++He)ue[te[He]]?(pt.push(Ie[He]||te[He]),ke[Ie[He]]=ue[Ie[He]]||ue[te[He]]):(pt.push(Ie[He]),ke[Ie[He]]={"!ref":"A1"});return{SheetNames:pt,Sheets:ke}}function n(C,j){var R=j||{};if(+R.codepage>=0&&vi(+R.codepage),R.type=="string")throw new Error("Cannot write WK1 to JS string");var P=fr(),V=wt(C["!ref"]),le=Array.isArray(C),fe=[];ve(P,0,s(1030)),ve(P,6,f(V));for(var ue=Math.min(V.e.r,8191),te=V.s.r;te<=ue;++te)for(var Ie=Qt(te),ae=V.s.c;ae<=V.e.c;++ae){te===V.s.r&&(fe[ae]=rr(ae));var Pe=fe[ae]+Ie,ke=le?(C[te]||[])[ae]:C[Pe];if(!(!ke||ke.t=="z"))if(ke.t=="n")(ke.v|0)==ke.v&&ke.v>=-32768&&ke.v<=32767?ve(P,13,l(te,ae,ke.v)):ve(P,14,g(te,ae,ke.v));else{var pt=qr(ke);ve(P,15,h(te,ae,pt.slice(0,239)))}}return ve(P,1),P.end()}function i(C,j){var R=j||{};if(+R.codepage>=0&&vi(+R.codepage),R.type=="string")throw new Error("Cannot write WK3 to JS string");var P=fr();ve(P,0,a(C));for(var V=0,le=0;V<C.SheetNames.length;++V)(C.Sheets[C.SheetNames[V]]||{})["!ref"]&&ve(P,27,De(C.SheetNames[V],le++));var fe=0;for(V=0;V<C.SheetNames.length;++V){var ue=C.Sheets[C.SheetNames[V]];if(!(!ue||!ue["!ref"])){for(var te=wt(ue["!ref"]),Ie=Array.isArray(ue),ae=[],Pe=Math.min(te.e.r,8191),ke=te.s.r;ke<=Pe;++ke)for(var pt=Qt(ke),He=te.s.c;He<=te.e.c;++He){ke===te.s.r&&(ae[He]=rr(He));var we=ae[He]+pt,ut=Ie?(ue[ke]||[])[He]:ue[we];if(!(!ut||ut.t=="z"))if(ut.t=="n")ve(P,23,L(ke,He,fe,ut.v));else{var je=qr(ut);ve(P,22,N(ke,He,fe,je.slice(0,239)))}}++fe}}return ve(P,1),P.end()}function s(C){var j=re(2);return j.write_shift(2,C),j}function a(C){var j=re(26);j.write_shift(2,4096),j.write_shift(2,4),j.write_shift(4,0);for(var R=0,P=0,V=0,le=0;le<C.SheetNames.length;++le){var fe=C.SheetNames[le],ue=C.Sheets[fe];if(!(!ue||!ue["!ref"])){++V;var te=Sr(ue["!ref"]);R<te.e.r&&(R=te.e.r),P<te.e.c&&(P=te.e.c)}}return R>8191&&(R=8191),j.write_shift(2,R),j.write_shift(1,V),j.write_shift(1,P),j.write_shift(2,0),j.write_shift(2,0),j.write_shift(1,1),j.write_shift(1,2),j.write_shift(4,0),j.write_shift(4,0),j}function o(C,j,R){var P={s:{c:0,r:0},e:{c:0,r:0}};return j==8&&R.qpro?(P.s.c=C.read_shift(1),C.l++,P.s.r=C.read_shift(2),P.e.c=C.read_shift(1),C.l++,P.e.r=C.read_shift(2),P):(P.s.c=C.read_shift(2),P.s.r=C.read_shift(2),j==12&&R.qpro&&(C.l+=2),P.e.c=C.read_shift(2),P.e.r=C.read_shift(2),j==12&&R.qpro&&(C.l+=2),P.s.c==65535&&(P.s.c=P.e.c=P.s.r=P.e.r=0),P)}function f(C){var j=re(8);return j.write_shift(2,C.s.c),j.write_shift(2,C.s.r),j.write_shift(2,C.e.c),j.write_shift(2,C.e.r),j}function u(C,j,R){var P=[{c:0,r:0},{t:"n",v:0},0,0];return R.qpro&&R.vers!=20768?(P[0].c=C.read_shift(1),P[3]=C.read_shift(1),P[0].r=C.read_shift(2),C.l+=2):(P[2]=C.read_shift(1),P[0].c=C.read_shift(2),P[0].r=C.read_shift(2)),P}function d(C,j,R){var P=C.l+j,V=u(C,j,R);if(V[1].t="s",R.vers==20768){C.l++;var le=C.read_shift(1);return V[1].v=C.read_shift(le,"utf8"),V}return R.qpro&&C.l++,V[1].v=C.read_shift(P-C.l,"cstr"),V}function h(C,j,R){var P=re(7+R.length);P.write_shift(1,255),P.write_shift(2,j),P.write_shift(2,C),P.write_shift(1,39);for(var V=0;V<P.length;++V){var le=R.charCodeAt(V);P.write_shift(1,le>=128?95:le)}return P.write_shift(1,0),P}function m(C,j,R){var P=u(C,j,R);return P[1].v=C.read_shift(2,"i"),P}function l(C,j,R){var P=re(7);return P.write_shift(1,255),P.write_shift(2,j),P.write_shift(2,C),P.write_shift(2,R,"i"),P}function v(C,j,R){var P=u(C,j,R);return P[1].v=C.read_shift(8,"f"),P}function g(C,j,R){var P=re(13);return P.write_shift(1,255),P.write_shift(2,j),P.write_shift(2,C),P.write_shift(8,R,"f"),P}function x(C,j,R){var P=C.l+j,V=u(C,j,R);if(V[1].v=C.read_shift(8,"f"),R.qpro)C.l=P;else{var le=C.read_shift(2);k(C.slice(C.l,C.l+le),V),C.l+=le}return V}function T(C,j,R){var P=j&32768;return j&=-32769,j=(P?C:0)+(j>=8192?j-16384:j),(P?"":"$")+(R?rr(j):Qt(j))}var b={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},_=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function k(C,j){xr(C,0);for(var R=[],P=0,V="",le="",fe="",ue="";C.l<C.length;){var te=C[C.l++];switch(te){case 0:R.push(C.read_shift(8,"f"));break;case 1:le=T(j[0].c,C.read_shift(2),!0),V=T(j[0].r,C.read_shift(2),!1),R.push(le+V);break;case 2:{var Ie=T(j[0].c,C.read_shift(2),!0),ae=T(j[0].r,C.read_shift(2),!1);le=T(j[0].c,C.read_shift(2),!0),V=T(j[0].r,C.read_shift(2),!1),R.push(Ie+ae+":"+le+V)}break;case 3:if(C.l<C.length){console.error("WK1 premature formula end");return}break;case 4:R.push("("+R.pop()+")");break;case 5:R.push(C.read_shift(2));break;case 6:{for(var Pe="";te=C[C.l++];)Pe+=String.fromCharCode(te);R.push('"'+Pe.replace(/"/g,'""')+'"')}break;case 8:R.push("-"+R.pop());break;case 23:R.push("+"+R.pop());break;case 22:R.push("NOT("+R.pop()+")");break;case 20:case 21:ue=R.pop(),fe=R.pop(),R.push(["AND","OR"][te-20]+"("+fe+","+ue+")");break;default:if(te<32&&_[te])ue=R.pop(),fe=R.pop(),R.push(fe+_[te]+ue);else if(b[te]){if(P=b[te][1],P==69&&(P=C[C.l++]),P>R.length){console.error("WK1 bad formula parse 0x"+te.toString(16)+":|"+R.join("|")+"|");return}var ke=R.slice(-P);R.length-=P,R.push(b[te][0]+"("+ke.join(",")+")")}else return te<=7?console.error("WK1 invalid opcode "+te.toString(16)):te<=24?console.error("WK1 unsupported op "+te.toString(16)):te<=30?console.error("WK1 invalid opcode "+te.toString(16)):te<=115?console.error("WK1 unsupported function opcode "+te.toString(16)):console.error("WK1 unrecognized opcode "+te.toString(16))}}R.length==1?j[1].f=""+R[0]:console.error("WK1 bad formula parse |"+R.join("|")+"|")}function F(C){var j=[{c:0,r:0},{t:"n",v:0},0];return j[0].r=C.read_shift(2),j[3]=C[C.l++],j[0].c=C[C.l++],j}function z(C,j){var R=F(C);return R[1].t="s",R[1].v=C.read_shift(j-4,"cstr"),R}function N(C,j,R,P){var V=re(6+P.length);V.write_shift(2,C),V.write_shift(1,R),V.write_shift(1,j),V.write_shift(1,39);for(var le=0;le<P.length;++le){var fe=P.charCodeAt(le);V.write_shift(1,fe>=128?95:fe)}return V.write_shift(1,0),V}function B(C,j){var R=F(C);R[1].v=C.read_shift(2);var P=R[1].v>>1;if(R[1].v&1)switch(P&7){case 0:P=(P>>3)*5e3;break;case 1:P=(P>>3)*500;break;case 2:P=(P>>3)/20;break;case 3:P=(P>>3)/200;break;case 4:P=(P>>3)/2e3;break;case 5:P=(P>>3)/2e4;break;case 6:P=(P>>3)/16;break;case 7:P=(P>>3)/64;break}return R[1].v=P,R}function M(C,j){var R=F(C),P=C.read_shift(4),V=C.read_shift(4),le=C.read_shift(2);if(le==65535)return P===0&&V===3221225472?(R[1].t="e",R[1].v=15):P===0&&V===3489660928?(R[1].t="e",R[1].v=42):R[1].v=0,R;var fe=le&32768;return le=(le&32767)-16446,R[1].v=(1-fe*2)*(V*Math.pow(2,le+32)+P*Math.pow(2,le)),R}function L(C,j,R,P){var V=re(14);if(V.write_shift(2,C),V.write_shift(1,R),V.write_shift(1,j),P==0)return V.write_shift(4,0),V.write_shift(4,0),V.write_shift(2,65535),V;var le=0,fe=0,ue=0,te=0;return P<0&&(le=1,P=-P),fe=Math.log2(P)|0,P/=Math.pow(2,fe-31),te=P>>>0,(te&2147483648)==0&&(P/=2,++fe,te=P>>>0),P-=te,te|=2147483648,te>>>=0,P*=Math.pow(2,32),ue=P>>>0,V.write_shift(4,ue),V.write_shift(4,te),fe+=16383+(le?32768:0),V.write_shift(2,fe),V}function W(C,j){var R=M(C);return C.l+=j-14,R}function y(C,j){var R=F(C),P=C.read_shift(4);return R[1].v=P>>6,R}function H(C,j){var R=F(C),P=C.read_shift(8,"f");return R[1].v=P,R}function Q(C,j){var R=H(C);return C.l+=j-10,R}function J(C,j){return C[C.l+j-1]==0?C.read_shift(j,"cstr"):""}function ee(C,j){var R=C[C.l++];R>j-1&&(R=j-1);for(var P="";P.length<R;)P+=String.fromCharCode(C[C.l++]);return P}function _e(C,j,R){if(!(!R.qpro||j<21)){var P=C.read_shift(1);C.l+=17,C.l+=1,C.l+=2;var V=C.read_shift(j-21,"cstr");return[P,V]}}function Ae(C,j){for(var R={},P=C.l+j;C.l<P;){var V=C.read_shift(2);if(V==14e3){for(R[V]=[0,""],R[V][0]=C.read_shift(2);C[C.l];)R[V][1]+=String.fromCharCode(C[C.l]),C.l++;C.l++}}return R}function De(C,j){var R=re(5+C.length);R.write_shift(2,14e3),R.write_shift(2,j);for(var P=0;P<C.length;++P){var V=C.charCodeAt(P);R[R.l++]=V>127?95:V}return R[R.l++]=0,R}var oe={0:{n:"BOF",f:J0},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:o},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:m},14:{n:"NUMBER",f:v},15:{n:"LABEL",f:d},16:{n:"FORMULA",f:x},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:d},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:J},222:{n:"SHEETNAMELP",f:ee},65535:{n:""}},ce={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:z},23:{n:"NUMBER17",f:M},24:{n:"NUMBER18",f:B},25:{n:"FORMULA19",f:W},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:Ae},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:y},38:{n:"??"},39:{n:"NUMBER27",f:H},40:{n:"FORMULA28",f:Q},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:J},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:_e},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:n,book_to_wk3:i,to_workbook:t}})(),mg=/^\s|\s$|[\t\n\r]/;function nu(e,t){if(!t.bookSST)return"";var r=[Mt];r[r.length]=xe("sst",null,{xmlns:Jn[0],count:e.Count,uniqueCount:e.Unique});for(var n=0;n!=e.length;++n)if(e[n]!=null){var i=e[n],s="<si>";i.r?s+=i.r:(s+="<t",i.t||(i.t=""),i.t.match(mg)&&(s+=' xml:space="preserve"'),s+=">"+lt(i.t)+"</t>"),s+="</si>",r[r.length]=s}return r.length>2&&(r[r.length]="</sst>",r[1]=r[1].replace("/>",">")),r.join("")}function xg(e){return[e.read_shift(4),e.read_shift(4)]}function vg(e,t){return t||(t=re(8)),t.write_shift(4,e.Count),t.write_shift(4,e.Unique),t}var yg=cp;function wg(e){var t=fr();de(t,159,vg(e));for(var r=0;r<e.length;++r)de(t,19,yg(e[r]));return de(t,160),t.end()}function Tg(e){for(var t=[],r=e.split(""),n=0;n<r.length;++n)t[n]=r[n].charCodeAt(0);return t}function iu(e){var t=0,r,n=Tg(e),i=n.length+1,s,a,o,f,u;for(r=yn(i),r[0]=n.length,s=1;s!=i;++s)r[s]=n[s-1];for(s=i-1;s>=0;--s)a=r[s],o=(t&16384)===0?0:1,f=t<<1&32767,u=o|f,t=u^a;return t^52811}var Sg=(function(){function e(i,s){switch(s.type){case"base64":return t(Kr(i),s);case"binary":return t(i,s);case"buffer":return t(Ze&&Buffer.isBuffer(i)?i.toString("binary"):Oi(i),s);case"array":return t(As(i),s)}throw new Error("Unrecognized type "+s.type)}function t(i,s){var a=s||{},o=a.dense?[]:{},f=i.match(/\\trowd.*?\\row\b/g);if(!f.length)throw new Error("RTF missing table");var u={s:{c:0,r:0},e:{c:0,r:f.length-1}};return f.forEach(function(d,h){Array.isArray(o)&&(o[h]=[]);for(var m=/\\\w+\b/g,l=0,v,g=-1;v=m.exec(d);){switch(v[0]){case"\\cell":var x=d.slice(l,m.lastIndex-v[0].length);if(x[0]==" "&&(x=x.slice(1)),++g,x.length){var T={v:x,t:"s"};Array.isArray(o)?o[h][g]=T:o[ct({r:h,c:g})]=T}break}l=m.lastIndex}g>u.e.c&&(u.e.c=g)}),o["!ref"]=jt(u),o}function r(i,s){return bn(e(i,s),s)}function n(i){for(var s=["{\\rtf1\\ansi"],a=wt(i["!ref"]),o,f=Array.isArray(i),u=a.s.r;u<=a.e.r;++u){s.push("\\trowd\\trautofit1");for(var d=a.s.c;d<=a.e.c;++d)s.push("\\cellx"+(d+1));for(s.push("\\pard\\intbl"),d=a.s.c;d<=a.e.c;++d){var h=ct({r:u,c:d});o=f?(i[u]||[])[d]:i[h],!(!o||o.v==null&&(!o.f||o.F))&&(s.push(" "+(o.w||(qr(o),o.w))),s.push("\\cell"))}s.push("\\pard\\intbl\\row")}return s.join("")+"}"}return{to_workbook:r,to_sheet:e,from_sheet:n}})();function Al(e){for(var t=0,r=1;t!=3;++t)r=r*256+(e[t]>255?255:e[t]<0?0:e[t]);return r.toString(16).toUpperCase().slice(1)}var Eg=6,Xr=Eg;function ps(e){return Math.floor((e+Math.round(128/Xr)/256)*Xr)}function gs(e){return Math.floor((e-5)/Xr*100+.5)/100}function Da(e){return Math.round((e*Xr+5)/Xr*256)/256}function ao(e){e.width?(e.wpx=ps(e.width),e.wch=gs(e.wpx),e.MDW=Xr):e.wpx?(e.wch=gs(e.wpx),e.width=Da(e.wch),e.MDW=Xr):typeof e.wch=="number"&&(e.width=Da(e.wch),e.wpx=ps(e.width),e.MDW=Xr),e.customWidth&&delete e.customWidth}var _g=96,su=_g;function ms(e){return e*96/su}function au(e){return e*su/96}function bg(e){var t=["<numFmts>"];return[[5,8],[23,26],[41,44],[50,392]].forEach(function(r){for(var n=r[0];n<=r[1];++n)e[n]!=null&&(t[t.length]=xe("numFmt",null,{numFmtId:n,formatCode:lt(e[n])}))}),t.length===1?"":(t[t.length]="</numFmts>",t[0]=xe("numFmts",null,{count:t.length-2}).replace("/>",">"),t.join(""))}function Cg(e){var t=[];return t[t.length]=xe("cellXfs",null),e.forEach(function(r){t[t.length]=xe("xf",null,r)}),t[t.length]="</cellXfs>",t.length===2?"":(t[0]=xe("cellXfs",null,{count:t.length-2}).replace("/>",">"),t.join(""))}function ou(e,t){var r=[Mt,xe("styleSheet",null,{xmlns:Jn[0],"xmlns:vt":Wt.vt})],n;return e.SSF&&(n=bg(e.SSF))!=null&&(r[r.length]=n),r[r.length]='<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>',r[r.length]='<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>',r[r.length]='<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>',r[r.length]='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>',(n=Cg(t.cellXfs))&&(r[r.length]=n),r[r.length]='<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>',r[r.length]='<dxfs count="0"/>',r[r.length]='<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>',r.length>2&&(r[r.length]="</styleSheet>",r[1]=r[1].replace("/>",">")),r.join("")}function Ag(e,t){var r=e.read_shift(2),n=nr(e);return[r,n]}function Og(e,t,r){r||(r=re(6+4*t.length)),r.write_shift(2,e),zt(t,r);var n=r.length>r.l?r.slice(0,r.l):r;return r.l==null&&(r.l=r.length),n}function Dg(e,t,r){var n={};n.sz=e.read_shift(2)/20;var i=mp(e);i.fItalic&&(n.italic=1),i.fCondense&&(n.condense=1),i.fExtend&&(n.extend=1),i.fShadow&&(n.shadow=1),i.fOutline&&(n.outline=1),i.fStrikeout&&(n.strike=1);var s=e.read_shift(2);switch(s===700&&(n.bold=1),e.read_shift(2)){case 1:n.vertAlign="superscript";break;case 2:n.vertAlign="subscript";break}var a=e.read_shift(1);a!=0&&(n.underline=a);var o=e.read_shift(1);o>0&&(n.family=o);var f=e.read_shift(1);switch(f>0&&(n.charset=f),e.l++,n.color=gp(e),e.read_shift(1)){case 1:n.scheme="major";break;case 2:n.scheme="minor";break}return n.name=nr(e),n}function kg(e,t){t||(t=re(153)),t.write_shift(2,e.sz*20),xp(e,t),t.write_shift(2,e.bold?700:400);var r=0;e.vertAlign=="superscript"?r=1:e.vertAlign=="subscript"&&(r=2),t.write_shift(2,r),t.write_shift(1,e.underline||0),t.write_shift(1,e.family||0),t.write_shift(1,e.charset||0),t.write_shift(1,0),ds(e.color,t);var n=0;return n=2,t.write_shift(1,n),zt(e.name,t),t.length>t.l?t.slice(0,t.l):t}var Ig=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],ia,Fg=Wr;function Ol(e,t){t||(t=re(84)),ia||(ia=Xa(Ig));var r=ia[e.patternType];r==null&&(r=40),t.write_shift(4,r);var n=0;if(r!=40)for(ds({auto:1},t),ds({auto:1},t);n<12;++n)t.write_shift(4,0);else{for(;n<4;++n)t.write_shift(4,0);for(;n<12;++n)t.write_shift(4,0)}return t.length>t.l?t.slice(0,t.l):t}function Ng(e,t){var r=e.l+t,n=e.read_shift(2),i=e.read_shift(2);return e.l=r,{ixfe:n,numFmtId:i}}function lu(e,t,r){r||(r=re(16)),r.write_shift(2,t||0),r.write_shift(2,e.numFmtId||0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(1,0),r.write_shift(1,0);var n=0;return r.write_shift(1,n),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(1,0),r}function ii(e,t){return t||(t=re(10)),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(4,0),t.write_shift(4,0),t}var Rg=Wr;function Pg(e,t){return t||(t=re(51)),t.write_shift(1,0),ii(null,t),ii(null,t),ii(null,t),ii(null,t),ii(null,t),t.length>t.l?t.slice(0,t.l):t}function jg(e,t){return t||(t=re(52)),t.write_shift(4,e.xfId),t.write_shift(2,1),t.write_shift(1,0),t.write_shift(1,0),fs(e.name||"",t),t.length>t.l?t.slice(0,t.l):t}function Mg(e,t,r){var n=re(2052);return n.write_shift(4,e),fs(t,n),fs(r,n),n.length>n.l?n.slice(0,n.l):n}function Lg(e,t){if(t){var r=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(n){for(var i=n[0];i<=n[1];++i)t[i]!=null&&++r}),r!=0&&(de(e,615,Pr(r)),[[5,8],[23,26],[41,44],[50,392]].forEach(function(n){for(var i=n[0];i<=n[1];++i)t[i]!=null&&de(e,44,Og(i,t[i]))}),de(e,616))}}function Bg(e){var t=1;de(e,611,Pr(t)),de(e,43,kg({sz:12,color:{theme:1},name:"Calibri",family:2})),de(e,612)}function $g(e){var t=2;de(e,603,Pr(t)),de(e,45,Ol({patternType:"none"})),de(e,45,Ol({patternType:"gray125"})),de(e,604)}function Ug(e){var t=1;de(e,613,Pr(t)),de(e,46,Pg()),de(e,614)}function Wg(e){var t=1;de(e,626,Pr(t)),de(e,47,lu({numFmtId:0},65535)),de(e,627)}function Vg(e,t){de(e,617,Pr(t.length)),t.forEach(function(r){de(e,47,lu(r,0))}),de(e,618)}function zg(e){var t=1;de(e,619,Pr(t)),de(e,48,jg({xfId:0,name:"Normal"})),de(e,620)}function Hg(e){var t=0;de(e,505,Pr(t)),de(e,506)}function Gg(e){var t=0;de(e,508,Mg(t,"TableStyleMedium9","PivotStyleMedium4")),de(e,509)}function Yg(e,t){var r=fr();return de(r,278),Lg(r,e.SSF),Bg(r),$g(r),Ug(r),Wg(r),Vg(r,t.cellXfs),zg(r),Hg(r),Gg(r),de(r,279),r.end()}function cu(e,t){if(t&&t.themeXLSX)return t.themeXLSX;if(e&&typeof e.raw=="string")return e.raw;var r=[Mt];return r[r.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',r[r.length]="<a:themeElements>",r[r.length]='<a:clrScheme name="Office">',r[r.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',r[r.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',r[r.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',r[r.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',r[r.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',r[r.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',r[r.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',r[r.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',r[r.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',r[r.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',r[r.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',r[r.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',r[r.length]="</a:clrScheme>",r[r.length]='<a:fontScheme name="Office">',r[r.length]="<a:majorFont>",r[r.length]='<a:latin typeface="Cambria"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Times New Roman"/>',r[r.length]='<a:font script="Hebr" typeface="Times New Roman"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="MoolBoran"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Times New Roman"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:majorFont>",r[r.length]="<a:minorFont>",r[r.length]='<a:latin typeface="Calibri"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Arial"/>',r[r.length]='<a:font script="Hebr" typeface="Arial"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="DaunPenh"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Arial"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:minorFont>",r[r.length]="</a:fontScheme>",r[r.length]='<a:fmtScheme name="Office">',r[r.length]="<a:fillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="1"/>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="0"/>',r[r.length]="</a:gradFill>",r[r.length]="</a:fillStyleLst>",r[r.length]="<a:lnStyleLst>",r[r.length]='<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>',r[r.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]="</a:lnStyleLst>",r[r.length]="<a:effectStyleLst>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]='<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>',r[r.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',r[r.length]="</a:effectStyle>",r[r.length]="</a:effectStyleLst>",r[r.length]="<a:bgFillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]="</a:bgFillStyleLst>",r[r.length]="</a:fmtScheme>",r[r.length]="</a:themeElements>",r[r.length]="<a:objectDefaults>",r[r.length]="<a:spDef>",r[r.length]='<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>',r[r.length]="</a:spDef>",r[r.length]="<a:lnDef>",r[r.length]='<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>',r[r.length]="</a:lnDef>",r[r.length]="</a:objectDefaults>",r[r.length]="<a:extraClrSchemeLst/>",r[r.length]="</a:theme>",r.join("")}function Xg(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:nr(e)}}function Kg(e){var t=re(12+2*e.name.length);return t.write_shift(4,e.flags),t.write_shift(4,e.version),zt(e.name,t),t.slice(0,t.l)}function qg(e){for(var t=[],r=e.read_shift(4);r-- >0;)t.push([e.read_shift(4),e.read_shift(4)]);return t}function Jg(e){var t=re(4+8*e.length);t.write_shift(4,e.length);for(var r=0;r<e.length;++r)t.write_shift(4,e[r][0]),t.write_shift(4,e[r][1]);return t}function Zg(e,t){var r=re(8+2*t.length);return r.write_shift(4,e),zt(t,r),r.slice(0,r.l)}function Qg(e){return e.l+=4,e.read_shift(4)!=0}function e1(e,t){var r=re(8);return r.write_shift(4,e),r.write_shift(4,1),r}function t1(){var e=fr();return de(e,332),de(e,334,Pr(1)),de(e,335,Kg({name:"XLDAPR",version:12e4,flags:3496657072})),de(e,336),de(e,339,Zg(1,"XLDAPR")),de(e,52),de(e,35,Pr(514)),de(e,4096,Pr(0)),de(e,4097,br(1)),de(e,36),de(e,53),de(e,340),de(e,337,e1(1)),de(e,51,Jg([[1,0]])),de(e,338),de(e,333),e.end()}function uu(){var e=[Mt];return e.push(`<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray">
|
|
32
|
+
`,c=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(`
|
|
33
|
+
`),u="--SocialCalcSpreadsheetControlSave--";function f(p){if(!p||!p["!ref"])return"";for(var x=[],l=[],y,g="",m=nr(p["!ref"]),E=Array.isArray(p),D=m.s.r;D<=m.e.r;++D)for(var C=m.s.c;C<=m.e.c;++C)if(g=Qe({r:D,c:C}),y=E?(p[D]||[])[C]:p[g],!(!y||y.v==null||y.t==="z")){switch(l=["cell",g,"t"],y.t){case"s":case"str":l.push(t(y.v));break;case"n":y.f?(l[2]="vtf",l[3]="n",l[4]=y.v,l[5]=t(y.f)):(l[2]="v",l[3]=y.v);break;case"b":l[2]="vt"+(y.f?"f":"c"),l[3]="nl",l[4]=y.v?"1":"0",l[5]=t(y.f||(y.v?"TRUE":"FALSE"));break;case"d":var N=Kt(zt(y.v));l[2]="vtc",l[3]="nd",l[4]=""+N,l[5]=y.w||Mr(y.z||ut[14],N);break;case"e":continue}x.push(l.join(":"))}return x.push("sheet:c:"+(m.e.c-m.s.c+1)+":r:"+(m.e.r-m.s.r+1)+":tvf:1"),x.push("valueformat:1:text-wiki"),x.join(`
|
|
34
|
+
`)}function d(p){return[s,a,c,a,f(p),u].join(`
|
|
35
|
+
`)}return{to_workbook:i,to_sheet:n,from_sheet:d}})(),gh=(function(){function e(d,p,x,l,y){y.raw?p[x][l]=d:d===""||(d==="TRUE"?p[x][l]=!0:d==="FALSE"?p[x][l]=!1:isNaN(Ar(d))?isNaN(Mn(d).getDate())?p[x][l]=d:p[x][l]=zt(d):p[x][l]=Ar(d))}function t(d,p){var x=p||{},l=[];if(!d||d.length===0)return l;for(var y=d.split(/[\r\n]/),g=y.length-1;g>=0&&y[g].length===0;)--g;for(var m=10,E=0,D=0;D<=g;++D)E=y[D].indexOf(" "),E==-1?E=y[D].length:E++,m=Math.max(m,E);for(D=0;D<=g;++D){l[D]=[];var C=0;for(e(y[D].slice(0,m).trim(),l,D,C,x),C=1;C<=(y[D].length-m)/10+1;++C)e(y[D].slice(m+(C-1)*10,m+C*10).trim(),l,D,C,x)}return x.sheetRows&&(l=l.slice(0,x.sheetRows)),l}var r={44:",",9:" ",59:";",124:"|"},n={44:3,9:2,59:1,124:0};function i(d){for(var p={},x=!1,l=0,y=0;l<d.length;++l)(y=d.charCodeAt(l))==34?x=!x:!x&&y in r&&(p[y]=(p[y]||0)+1);y=[];for(l in p)Object.prototype.hasOwnProperty.call(p,l)&&y.push([p[l],l]);if(!y.length){p=n;for(l in p)Object.prototype.hasOwnProperty.call(p,l)&&y.push([p[l],l])}return y.sort(function(g,m){return g[0]-m[0]||n[g[1]]-n[m[1]]}),r[y.pop()[1]]||44}function s(d,p){var x=p||{},l="",y=x.dense?[]:{},g={s:{c:0,r:0},e:{c:0,r:0}};d.slice(0,4)=="sep="?d.charCodeAt(5)==13&&d.charCodeAt(6)==10?(l=d.charAt(4),d=d.slice(7)):d.charCodeAt(5)==13||d.charCodeAt(5)==10?(l=d.charAt(4),d=d.slice(6)):l=i(d.slice(0,1024)):x&&x.FS?l=x.FS:l=i(d.slice(0,1024));var m=0,E=0,D=0,C=0,N=0,L=l.charCodeAt(0),Q=!1,k=0,V=d.charCodeAt(0);d=d.replace(/\r\n/mg,`
|
|
36
|
+
`);var j=x.dateNF!=null?If(x.dateNF):null;function B(){var X=d.slice(C,N),M={};if(X.charAt(0)=='"'&&X.charAt(X.length-1)=='"'&&(X=X.slice(1,-1).replace(/""/g,'"')),X.length===0)M.t="z";else if(x.raw)M.t="s",M.v=X;else if(X.trim().length===0)M.t="s",M.v=X;else if(X.charCodeAt(0)==61)X.charCodeAt(1)==34&&X.charCodeAt(X.length-1)==34?(M.t="s",M.v=X.slice(2,-1).replace(/""/g,'"')):pd(X)?(M.t="n",M.f=X.slice(1)):(M.t="s",M.v=X);else if(X=="TRUE")M.t="b",M.v=!0;else if(X=="FALSE")M.t="b",M.v=!1;else if(!isNaN(D=Ar(X)))M.t="n",x.cellText!==!1&&(M.w=X),M.v=D;else if(!isNaN(Mn(X).getDate())||j&&X.match(j)){M.z=x.dateNF||ut[14];var ee=0;j&&X.match(j)&&(X=Nf(X,x.dateNF,X.match(j)||[]),ee=1),x.cellDates?(M.t="d",M.v=zt(X,ee)):(M.t="n",M.v=Kt(zt(X,ee))),x.cellText!==!1&&(M.w=Mr(M.z,M.v instanceof Date?Kt(M.v):M.v)),x.cellNF||delete M.z}else M.t="s",M.v=X;if(M.t=="z"||(x.dense?(y[m]||(y[m]=[]),y[m][E]=M):y[Qe({c:E,r:m})]=M),C=N+1,V=d.charCodeAt(C),g.e.c<E&&(g.e.c=E),g.e.r<m&&(g.e.r=m),k==L)++E;else if(E=0,++m,x.sheetRows&&x.sheetRows<=m)return!0}e:for(;N<d.length;++N)switch(k=d.charCodeAt(N)){case 34:V===34&&(Q=!Q);break;case L:case 10:case 13:if(!Q&&B())break e;break}return N-C>0&&B(),y["!ref"]=pt(g),y}function a(d,p){return!(p&&p.PRN)||p.FS||d.slice(0,4)=="sep="||d.indexOf(" ")>=0||d.indexOf(",")>=0||d.indexOf(";")>=0?s(d,p):yn(t(d,p),p)}function c(d,p){var x="",l=p.type=="string"?[0,0,0,0]:Ag(d,p);switch(p.type){case"base64":x=kr(d);break;case"binary":x=d;break;case"buffer":p.codepage==65001?x=d.toString("utf8"):p.codepage&&typeof ui<"u"||(x=$e&&Buffer.isBuffer(d)?d.toString("binary"):zn(d));break;case"array":x=ki(d);break;case"string":x=d;break;default:throw new Error("Unrecognized type "+p.type)}return l[0]==239&&l[1]==187&&l[2]==191?x=On(x.slice(3)):p.type!="string"&&p.type!="buffer"&&p.codepage==65001?x=On(x):p.type=="binary"&&typeof ui<"u",x.slice(0,19)=="socialcalc:version:"?Rl.to_sheet(p.type=="string"?x:On(x),p):a(x,p)}function u(d,p){return Jr(c(d,p),p)}function f(d){for(var p=[],x=it(d["!ref"]),l,y=Array.isArray(d),g=x.s.r;g<=x.e.r;++g){for(var m=[],E=x.s.c;E<=x.e.c;++E){var D=Qe({r:g,c:E});if(l=y?(d[g]||[])[E]:d[D],!l||l.v==null){m.push(" ");continue}for(var C=(l.w||(Fr(l),l.w)||"").slice(0,10);C.length<10;)C+=" ";m.push(C+(E===0?" ":""))}p.push(m.join(""))}return p.join(`
|
|
37
|
+
`)}return{to_workbook:u,to_sheet:c,from_sheet:f}})(),Ba=(function(){function e(O,P,I){if(O){er(O,O.l||0);for(var R=I.Enum||ze;O.l<O.length;){var Y=O.read_shift(2),xe=R[Y]||R[65535],ve=O.read_shift(2),ge=O.l+ve,oe=xe.f&&xe.f(O,ve,I);if(O.l=ge,P(oe,xe,Y))return}}}function t(O,P){switch(P.type){case"base64":return r(dr(kr(O)),P);case"binary":return r(dr(O),P);case"buffer":case"array":return r(O,P)}throw"Unsupported type "+P.type}function r(O,P){if(!O)return O;var I=P||{},R=I.dense?[]:{},Y="Sheet1",xe="",ve=0,ge={},oe=[],Le=[],Ce={s:{r:0,c:0},e:{r:0,c:0}},Xe=I.sheetRows||0;if(O[2]==0&&(O[3]==8||O[3]==9)&&O.length>=16&&O[14]==5&&O[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(O[2]==2)I.Enum=ze,e(O,function(de,st,He){switch(He){case 0:I.vers=de,de>=4096&&(I.qpro=!0);break;case 6:Ce=de;break;case 204:de&&(xe=de);break;case 222:xe=de;break;case 15:case 51:I.qpro||(de[1].v=de[1].v.slice(1));case 13:case 14:case 16:He==14&&(de[2]&112)==112&&(de[2]&15)>1&&(de[2]&15)<15&&(de[1].z=I.dateNF||ut[14],I.cellDates&&(de[1].t="d",de[1].v=Jo(de[1].v))),I.qpro&&de[3]>ve&&(R["!ref"]=pt(Ce),ge[Y]=R,oe.push(Y),R=I.dense?[]:{},Ce={s:{r:0,c:0},e:{r:0,c:0}},ve=de[3],Y=xe||"Sheet"+(ve+1),xe="");var Lt=I.dense?(R[de[0].r]||[])[de[0].c]:R[Qe(de[0])];if(Lt){Lt.t=de[1].t,Lt.v=de[1].v,de[1].z!=null&&(Lt.z=de[1].z),de[1].f!=null&&(Lt.f=de[1].f);break}I.dense?(R[de[0].r]||(R[de[0].r]=[]),R[de[0].r][de[0].c]=de[1]):R[Qe(de[0])]=de[1];break}},I);else if(O[2]==26||O[2]==14)I.Enum=_e,O[2]==14&&(I.qpro=!0,O.l=0),e(O,function(de,st,He){switch(He){case 204:Y=de;break;case 22:de[1].v=de[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(de[3]>ve&&(R["!ref"]=pt(Ce),ge[Y]=R,oe.push(Y),R=I.dense?[]:{},Ce={s:{r:0,c:0},e:{r:0,c:0}},ve=de[3],Y="Sheet"+(ve+1)),Xe>0&&de[0].r>=Xe)break;I.dense?(R[de[0].r]||(R[de[0].r]=[]),R[de[0].r][de[0].c]=de[1]):R[Qe(de[0])]=de[1],Ce.e.c<de[0].c&&(Ce.e.c=de[0].c),Ce.e.r<de[0].r&&(Ce.e.r=de[0].r);break;case 27:de[14e3]&&(Le[de[14e3][0]]=de[14e3][1]);break;case 1537:Le[de[0]]=de[1],de[0]==ve&&(Y=de[1]);break}},I);else throw new Error("Unrecognized LOTUS BOF "+O[2]);if(R["!ref"]=pt(Ce),ge[xe||Y]=R,oe.push(xe||Y),!Le.length)return{SheetNames:oe,Sheets:ge};for(var Ae={},ht=[],Ue=0;Ue<Le.length;++Ue)ge[oe[Ue]]?(ht.push(Le[Ue]||oe[Ue]),Ae[Le[Ue]]=ge[Le[Ue]]||ge[oe[Ue]]):(ht.push(Le[Ue]),Ae[Le[Ue]]={"!ref":"A1"});return{SheetNames:ht,Sheets:Ae}}function n(O,P){var I=P||{};if(+I.codepage>=0&&Pn(+I.codepage),I.type=="string")throw new Error("Cannot write WK1 to JS string");var R=Yt(),Y=it(O["!ref"]),xe=Array.isArray(O),ve=[];fe(R,0,s(1030)),fe(R,6,u(Y));for(var ge=Math.min(Y.e.r,8191),oe=Y.s.r;oe<=ge;++oe)for(var Le=Ft(oe),Ce=Y.s.c;Ce<=Y.e.c;++Ce){oe===Y.s.r&&(ve[Ce]=jt(Ce));var Xe=ve[Ce]+Le,Ae=xe?(O[oe]||[])[Ce]:O[Xe];if(!(!Ae||Ae.t=="z"))if(Ae.t=="n")(Ae.v|0)==Ae.v&&Ae.v>=-32768&&Ae.v<=32767?fe(R,13,l(oe,Ce,Ae.v)):fe(R,14,g(oe,Ce,Ae.v));else{var ht=Fr(Ae);fe(R,15,p(oe,Ce,ht.slice(0,239)))}}return fe(R,1),R.end()}function i(O,P){var I=P||{};if(+I.codepage>=0&&Pn(+I.codepage),I.type=="string")throw new Error("Cannot write WK3 to JS string");var R=Yt();fe(R,0,a(O));for(var Y=0,xe=0;Y<O.SheetNames.length;++Y)(O.Sheets[O.SheetNames[Y]]||{})["!ref"]&&fe(R,27,be(O.SheetNames[Y],xe++));var ve=0;for(Y=0;Y<O.SheetNames.length;++Y){var ge=O.Sheets[O.SheetNames[Y]];if(!(!ge||!ge["!ref"])){for(var oe=it(ge["!ref"]),Le=Array.isArray(ge),Ce=[],Xe=Math.min(oe.e.r,8191),Ae=oe.s.r;Ae<=Xe;++Ae)for(var ht=Ft(Ae),Ue=oe.s.c;Ue<=oe.e.c;++Ue){Ae===oe.s.r&&(Ce[Ue]=jt(Ue));var de=Ce[Ue]+ht,st=Le?(ge[Ae]||[])[Ue]:ge[de];if(!(!st||st.t=="z"))if(st.t=="n")fe(R,23,B(Ae,Ue,ve,st.v));else{var He=Fr(st);fe(R,22,k(Ae,Ue,ve,He.slice(0,239)))}}++ve}}return fe(R,1),R.end()}function s(O){var P=q(2);return P.write_shift(2,O),P}function a(O){var P=q(26);P.write_shift(2,4096),P.write_shift(2,4),P.write_shift(4,0);for(var I=0,R=0,Y=0,xe=0;xe<O.SheetNames.length;++xe){var ve=O.SheetNames[xe],ge=O.Sheets[ve];if(!(!ge||!ge["!ref"])){++Y;var oe=nr(ge["!ref"]);I<oe.e.r&&(I=oe.e.r),R<oe.e.c&&(R=oe.e.c)}}return I>8191&&(I=8191),P.write_shift(2,I),P.write_shift(1,Y),P.write_shift(1,R),P.write_shift(2,0),P.write_shift(2,0),P.write_shift(1,1),P.write_shift(1,2),P.write_shift(4,0),P.write_shift(4,0),P}function c(O,P,I){var R={s:{c:0,r:0},e:{c:0,r:0}};return P==8&&I.qpro?(R.s.c=O.read_shift(1),O.l++,R.s.r=O.read_shift(2),R.e.c=O.read_shift(1),O.l++,R.e.r=O.read_shift(2),R):(R.s.c=O.read_shift(2),R.s.r=O.read_shift(2),P==12&&I.qpro&&(O.l+=2),R.e.c=O.read_shift(2),R.e.r=O.read_shift(2),P==12&&I.qpro&&(O.l+=2),R.s.c==65535&&(R.s.c=R.e.c=R.s.r=R.e.r=0),R)}function u(O){var P=q(8);return P.write_shift(2,O.s.c),P.write_shift(2,O.s.r),P.write_shift(2,O.e.c),P.write_shift(2,O.e.r),P}function f(O,P,I){var R=[{c:0,r:0},{t:"n",v:0},0,0];return I.qpro&&I.vers!=20768?(R[0].c=O.read_shift(1),R[3]=O.read_shift(1),R[0].r=O.read_shift(2),O.l+=2):(R[2]=O.read_shift(1),R[0].c=O.read_shift(2),R[0].r=O.read_shift(2)),R}function d(O,P,I){var R=O.l+P,Y=f(O,P,I);if(Y[1].t="s",I.vers==20768){O.l++;var xe=O.read_shift(1);return Y[1].v=O.read_shift(xe,"utf8"),Y}return I.qpro&&O.l++,Y[1].v=O.read_shift(R-O.l,"cstr"),Y}function p(O,P,I){var R=q(7+I.length);R.write_shift(1,255),R.write_shift(2,P),R.write_shift(2,O),R.write_shift(1,39);for(var Y=0;Y<R.length;++Y){var xe=I.charCodeAt(Y);R.write_shift(1,xe>=128?95:xe)}return R.write_shift(1,0),R}function x(O,P,I){var R=f(O,P,I);return R[1].v=O.read_shift(2,"i"),R}function l(O,P,I){var R=q(7);return R.write_shift(1,255),R.write_shift(2,P),R.write_shift(2,O),R.write_shift(2,I,"i"),R}function y(O,P,I){var R=f(O,P,I);return R[1].v=O.read_shift(8,"f"),R}function g(O,P,I){var R=q(13);return R.write_shift(1,255),R.write_shift(2,P),R.write_shift(2,O),R.write_shift(8,I,"f"),R}function m(O,P,I){var R=O.l+P,Y=f(O,P,I);if(Y[1].v=O.read_shift(8,"f"),I.qpro)O.l=R;else{var xe=O.read_shift(2);N(O.slice(O.l,O.l+xe),Y),O.l+=xe}return Y}function E(O,P,I){var R=P&32768;return P&=-32769,P=(R?O:0)+(P>=8192?P-16384:P),(R?"":"$")+(I?jt(P):Ft(P))}var D={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},C=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function N(O,P){er(O,0);for(var I=[],R=0,Y="",xe="",ve="",ge="";O.l<O.length;){var oe=O[O.l++];switch(oe){case 0:I.push(O.read_shift(8,"f"));break;case 1:xe=E(P[0].c,O.read_shift(2),!0),Y=E(P[0].r,O.read_shift(2),!1),I.push(xe+Y);break;case 2:{var Le=E(P[0].c,O.read_shift(2),!0),Ce=E(P[0].r,O.read_shift(2),!1);xe=E(P[0].c,O.read_shift(2),!0),Y=E(P[0].r,O.read_shift(2),!1),I.push(Le+Ce+":"+xe+Y)}break;case 3:if(O.l<O.length){console.error("WK1 premature formula end");return}break;case 4:I.push("("+I.pop()+")");break;case 5:I.push(O.read_shift(2));break;case 6:{for(var Xe="";oe=O[O.l++];)Xe+=String.fromCharCode(oe);I.push('"'+Xe.replace(/"/g,'""')+'"')}break;case 8:I.push("-"+I.pop());break;case 23:I.push("+"+I.pop());break;case 22:I.push("NOT("+I.pop()+")");break;case 20:case 21:ge=I.pop(),ve=I.pop(),I.push(["AND","OR"][oe-20]+"("+ve+","+ge+")");break;default:if(oe<32&&C[oe])ge=I.pop(),ve=I.pop(),I.push(ve+C[oe]+ge);else if(D[oe]){if(R=D[oe][1],R==69&&(R=O[O.l++]),R>I.length){console.error("WK1 bad formula parse 0x"+oe.toString(16)+":|"+I.join("|")+"|");return}var Ae=I.slice(-R);I.length-=R,I.push(D[oe][0]+"("+Ae.join(",")+")")}else return oe<=7?console.error("WK1 invalid opcode "+oe.toString(16)):oe<=24?console.error("WK1 unsupported op "+oe.toString(16)):oe<=30?console.error("WK1 invalid opcode "+oe.toString(16)):oe<=115?console.error("WK1 unsupported function opcode "+oe.toString(16)):console.error("WK1 unrecognized opcode "+oe.toString(16))}}I.length==1?P[1].f=""+I[0]:console.error("WK1 bad formula parse |"+I.join("|")+"|")}function L(O){var P=[{c:0,r:0},{t:"n",v:0},0];return P[0].r=O.read_shift(2),P[3]=O[O.l++],P[0].c=O[O.l++],P}function Q(O,P){var I=L(O);return I[1].t="s",I[1].v=O.read_shift(P-4,"cstr"),I}function k(O,P,I,R){var Y=q(6+R.length);Y.write_shift(2,O),Y.write_shift(1,I),Y.write_shift(1,P),Y.write_shift(1,39);for(var xe=0;xe<R.length;++xe){var ve=R.charCodeAt(xe);Y.write_shift(1,ve>=128?95:ve)}return Y.write_shift(1,0),Y}function V(O,P){var I=L(O);I[1].v=O.read_shift(2);var R=I[1].v>>1;if(I[1].v&1)switch(R&7){case 0:R=(R>>3)*5e3;break;case 1:R=(R>>3)*500;break;case 2:R=(R>>3)/20;break;case 3:R=(R>>3)/200;break;case 4:R=(R>>3)/2e3;break;case 5:R=(R>>3)/2e4;break;case 6:R=(R>>3)/16;break;case 7:R=(R>>3)/64;break}return I[1].v=R,I}function j(O,P){var I=L(O),R=O.read_shift(4),Y=O.read_shift(4),xe=O.read_shift(2);if(xe==65535)return R===0&&Y===3221225472?(I[1].t="e",I[1].v=15):R===0&&Y===3489660928?(I[1].t="e",I[1].v=42):I[1].v=0,I;var ve=xe&32768;return xe=(xe&32767)-16446,I[1].v=(1-ve*2)*(Y*Math.pow(2,xe+32)+R*Math.pow(2,xe)),I}function B(O,P,I,R){var Y=q(14);if(Y.write_shift(2,O),Y.write_shift(1,I),Y.write_shift(1,P),R==0)return Y.write_shift(4,0),Y.write_shift(4,0),Y.write_shift(2,65535),Y;var xe=0,ve=0,ge=0,oe=0;return R<0&&(xe=1,R=-R),ve=Math.log2(R)|0,R/=Math.pow(2,ve-31),oe=R>>>0,(oe&2147483648)==0&&(R/=2,++ve,oe=R>>>0),R-=oe,oe|=2147483648,oe>>>=0,R*=Math.pow(2,32),ge=R>>>0,Y.write_shift(4,ge),Y.write_shift(4,oe),ve+=16383+(xe?32768:0),Y.write_shift(2,ve),Y}function X(O,P){var I=j(O);return O.l+=P-14,I}function M(O,P){var I=L(O),R=O.read_shift(4);return I[1].v=R>>6,I}function ee(O,P){var I=L(O),R=O.read_shift(8,"f");return I[1].v=R,I}function Te(O,P){var I=ee(O);return O.l+=P-10,I}function ne(O,P){return O[O.l+P-1]==0?O.read_shift(P,"cstr"):""}function ae(O,P){var I=O[O.l++];I>P-1&&(I=P-1);for(var R="";R.length<I;)R+=String.fromCharCode(O[O.l++]);return R}function Se(O,P,I){if(!(!I.qpro||P<21)){var R=O.read_shift(1);O.l+=17,O.l+=1,O.l+=2;var Y=O.read_shift(P-21,"cstr");return[R,Y]}}function Ne(O,P){for(var I={},R=O.l+P;O.l<R;){var Y=O.read_shift(2);if(Y==14e3){for(I[Y]=[0,""],I[Y][0]=O.read_shift(2);O[O.l];)I[Y][1]+=String.fromCharCode(O[O.l]),O.l++;O.l++}}return I}function be(O,P){var I=q(5+O.length);I.write_shift(2,14e3),I.write_shift(2,P);for(var R=0;R<O.length;++R){var Y=O.charCodeAt(R);I[I.l++]=Y>127?95:Y}return I[I.l++]=0,I}var ze={0:{n:"BOF",f:Ol},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:c},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:x},14:{n:"NUMBER",f:y},15:{n:"LABEL",f:d},16:{n:"FORMULA",f:m},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:d},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:ne},222:{n:"SHEETNAMELP",f:ae},65535:{n:""}},_e={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:Q},23:{n:"NUMBER17",f:j},24:{n:"NUMBER18",f:V},25:{n:"FORMULA19",f:X},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:Ne},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:M},38:{n:"??"},39:{n:"NUMBER27",f:ee},40:{n:"FORMULA28",f:Te},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:ne},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:Se},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:n,book_to_wk3:i,to_workbook:t}})(),mh=/^\s|\s$|[\t\n\r]/;function Pl(e,t){if(!t.bookSST)return"";var r=[xt];r[r.length]=ce("sst",null,{xmlns:vn[0],count:e.Count,uniqueCount:e.Unique});for(var n=0;n!=e.length;++n)if(e[n]!=null){var i=e[n],s="<si>";i.r?s+=i.r:(s+="<t",i.t||(i.t=""),i.t.match(mh)&&(s+=' xml:space="preserve"'),s+=">"+Ze(i.t)+"</t>"),s+="</si>",r[r.length]=s}return r.length>2&&(r[r.length]="</sst>",r[1]=r[1].replace("/>",">")),r.join("")}function vh(e){return[e.read_shift(4),e.read_shift(4)]}function yh(e,t){return t||(t=q(8)),t.write_shift(4,e.Count),t.write_shift(4,e.Unique),t}var wh=fu;function Th(e){var t=Yt();te(t,159,yh(e));for(var r=0;r<e.length;++r)te(t,19,wh(e[r]));return te(t,160),t.end()}function _h(e){for(var t=[],r=e.split(""),n=0;n<r.length;++n)t[n]=r[n].charCodeAt(0);return t}function jl(e){var t=0,r,n=_h(e),i=n.length+1,s,a,c,u,f;for(r=Gr(i),r[0]=n.length,s=1;s!=i;++s)r[s]=n[s-1];for(s=i-1;s>=0;--s)a=r[s],c=(t&16384)===0?0:1,u=t<<1&32767,f=c|u,t=f^a;return t^52811}var Eh=(function(){function e(i,s){switch(s.type){case"base64":return t(kr(i),s);case"binary":return t(i,s);case"buffer":return t($e&&Buffer.isBuffer(i)?i.toString("binary"):zn(i),s);case"array":return t(ki(i),s)}throw new Error("Unrecognized type "+s.type)}function t(i,s){var a=s||{},c=a.dense?[]:{},u=i.match(/\\trowd.*?\\row\b/g);if(!u.length)throw new Error("RTF missing table");var f={s:{c:0,r:0},e:{c:0,r:u.length-1}};return u.forEach(function(d,p){Array.isArray(c)&&(c[p]=[]);for(var x=/\\\w+\b/g,l=0,y,g=-1;y=x.exec(d);){switch(y[0]){case"\\cell":var m=d.slice(l,x.lastIndex-y[0].length);if(m[0]==" "&&(m=m.slice(1)),++g,m.length){var E={v:m,t:"s"};Array.isArray(c)?c[p][g]=E:c[Qe({r:p,c:g})]=E}break}l=x.lastIndex}g>f.e.c&&(f.e.c=g)}),c["!ref"]=pt(f),c}function r(i,s){return Jr(e(i,s),s)}function n(i){for(var s=["{\\rtf1\\ansi"],a=it(i["!ref"]),c,u=Array.isArray(i),f=a.s.r;f<=a.e.r;++f){s.push("\\trowd\\trautofit1");for(var d=a.s.c;d<=a.e.c;++d)s.push("\\cellx"+(d+1));for(s.push("\\pard\\intbl"),d=a.s.c;d<=a.e.c;++d){var p=Qe({r:f,c:d});c=u?(i[f]||[])[d]:i[p],!(!c||c.v==null&&(!c.f||c.F))&&(s.push(" "+(c.w||(Fr(c),c.w))),s.push("\\cell"))}s.push("\\pard\\intbl\\row")}return s.join("")+"}"}return{to_workbook:r,to_sheet:e,from_sheet:n}})();function Ua(e){for(var t=0,r=1;t!=3;++t)r=r*256+(e[t]>255?255:e[t]<0?0:e[t]);return r.toString(16).toUpperCase().slice(1)}var Sh=6,Or=Sh;function wi(e){return Math.floor((e+Math.round(128/Or)/256)*Or)}function Ti(e){return Math.floor((e-5)/Or*100+.5)/100}function ls(e){return Math.round((e*Or+5)/Or*256)/256}function Ns(e){e.width?(e.wpx=wi(e.width),e.wch=Ti(e.wpx),e.MDW=Or):e.wpx?(e.wch=Ti(e.wpx),e.width=ls(e.wch),e.MDW=Or):typeof e.wch=="number"&&(e.width=ls(e.wch),e.wpx=wi(e.width),e.MDW=Or),e.customWidth&&delete e.customWidth}var Ch=96,Ml=Ch;function _i(e){return e*96/Ml}function Ll(e){return e*Ml/96}function bh(e){var t=["<numFmts>"];return[[5,8],[23,26],[41,44],[50,392]].forEach(function(r){for(var n=r[0];n<=r[1];++n)e[n]!=null&&(t[t.length]=ce("numFmt",null,{numFmtId:n,formatCode:Ze(e[n])}))}),t.length===1?"":(t[t.length]="</numFmts>",t[0]=ce("numFmts",null,{count:t.length-2}).replace("/>",">"),t.join(""))}function Dh(e){var t=[];return t[t.length]=ce("cellXfs",null),e.forEach(function(r){t[t.length]=ce("xf",null,r)}),t[t.length]="</cellXfs>",t.length===2?"":(t[0]=ce("cellXfs",null,{count:t.length-2}).replace("/>",">"),t.join(""))}function Bl(e,t){var r=[xt,ce("styleSheet",null,{xmlns:vn[0],"xmlns:vt":_t.vt})],n;return e.SSF&&(n=bh(e.SSF))!=null&&(r[r.length]=n),r[r.length]='<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>',r[r.length]='<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>',r[r.length]='<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>',r[r.length]='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>',(n=Dh(t.cellXfs))&&(r[r.length]=n),r[r.length]='<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>',r[r.length]='<dxfs count="0"/>',r[r.length]='<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>',r.length>2&&(r[r.length]="</styleSheet>",r[1]=r[1].replace("/>",">")),r.join("")}function Ah(e,t){var r=e.read_shift(2),n=Mt(e);return[r,n]}function Oh(e,t,r){r||(r=q(6+4*t.length)),r.write_shift(2,e),St(t,r);var n=r.length>r.l?r.slice(0,r.l):r;return r.l==null&&(r.l=r.length),n}function kh(e,t,r){var n={};n.sz=e.read_shift(2)/20;var i=mu(e);i.fItalic&&(n.italic=1),i.fCondense&&(n.condense=1),i.fExtend&&(n.extend=1),i.fShadow&&(n.shadow=1),i.fOutline&&(n.outline=1),i.fStrikeout&&(n.strike=1);var s=e.read_shift(2);switch(s===700&&(n.bold=1),e.read_shift(2)){case 1:n.vertAlign="superscript";break;case 2:n.vertAlign="subscript";break}var a=e.read_shift(1);a!=0&&(n.underline=a);var c=e.read_shift(1);c>0&&(n.family=c);var u=e.read_shift(1);switch(u>0&&(n.charset=u),e.l++,n.color=gu(e),e.read_shift(1)){case 1:n.scheme="major";break;case 2:n.scheme="minor";break}return n.name=Mt(e),n}function Fh(e,t){t||(t=q(153)),t.write_shift(2,e.sz*20),vu(e,t),t.write_shift(2,e.bold?700:400);var r=0;e.vertAlign=="superscript"?r=1:e.vertAlign=="subscript"&&(r=2),t.write_shift(2,r),t.write_shift(1,e.underline||0),t.write_shift(1,e.family||0),t.write_shift(1,e.charset||0),t.write_shift(1,0),vi(e.color,t);var n=0;return n=2,t.write_shift(1,n),St(e.name,t),t.length>t.l?t.slice(0,t.l):t}var Ih=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],Yi,Nh=Er;function Wa(e,t){t||(t=q(84)),Yi||(Yi=Ts(Ih));var r=Yi[e.patternType];r==null&&(r=40),t.write_shift(4,r);var n=0;if(r!=40)for(vi({auto:1},t),vi({auto:1},t);n<12;++n)t.write_shift(4,0);else{for(;n<4;++n)t.write_shift(4,0);for(;n<12;++n)t.write_shift(4,0)}return t.length>t.l?t.slice(0,t.l):t}function Rh(e,t){var r=e.l+t,n=e.read_shift(2),i=e.read_shift(2);return e.l=r,{ixfe:n,numFmtId:i}}function Ul(e,t,r){r||(r=q(16)),r.write_shift(2,t||0),r.write_shift(2,e.numFmtId||0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(1,0),r.write_shift(1,0);var n=0;return r.write_shift(1,n),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(1,0),r}function Cn(e,t){return t||(t=q(10)),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(4,0),t.write_shift(4,0),t}var Ph=Er;function jh(e,t){return t||(t=q(51)),t.write_shift(1,0),Cn(null,t),Cn(null,t),Cn(null,t),Cn(null,t),Cn(null,t),t.length>t.l?t.slice(0,t.l):t}function Mh(e,t){return t||(t=q(52)),t.write_shift(4,e.xfId),t.write_shift(2,1),t.write_shift(1,0),t.write_shift(1,0),mi(e.name||"",t),t.length>t.l?t.slice(0,t.l):t}function Lh(e,t,r){var n=q(2052);return n.write_shift(4,e),mi(t,n),mi(r,n),n.length>n.l?n.slice(0,n.l):n}function Bh(e,t){if(t){var r=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(n){for(var i=n[0];i<=n[1];++i)t[i]!=null&&++r}),r!=0&&(te(e,615,xr(r)),[[5,8],[23,26],[41,44],[50,392]].forEach(function(n){for(var i=n[0];i<=n[1];++i)t[i]!=null&&te(e,44,Oh(i,t[i]))}),te(e,616))}}function Uh(e){var t=1;te(e,611,xr(t)),te(e,43,Fh({sz:12,color:{theme:1},name:"Calibri",family:2})),te(e,612)}function Wh(e){var t=2;te(e,603,xr(t)),te(e,45,Wa({patternType:"none"})),te(e,45,Wa({patternType:"gray125"})),te(e,604)}function Vh(e){var t=1;te(e,613,xr(t)),te(e,46,jh()),te(e,614)}function zh(e){var t=1;te(e,626,xr(t)),te(e,47,Ul({numFmtId:0},65535)),te(e,627)}function Hh(e,t){te(e,617,xr(t.length)),t.forEach(function(r){te(e,47,Ul(r,0))}),te(e,618)}function $h(e){var t=1;te(e,619,xr(t)),te(e,48,Mh({xfId:0,name:"Normal"})),te(e,620)}function Gh(e){var t=0;te(e,505,xr(t)),te(e,506)}function Xh(e){var t=0;te(e,508,Lh(t,"TableStyleMedium9","PivotStyleMedium4")),te(e,509)}function Yh(e,t){var r=Yt();return te(r,278),Bh(r,e.SSF),Uh(r),Wh(r),Vh(r),zh(r),Hh(r,t.cellXfs),$h(r),Gh(r),Xh(r),te(r,279),r.end()}function Wl(e,t){if(t&&t.themeXLSX)return t.themeXLSX;if(e&&typeof e.raw=="string")return e.raw;var r=[xt];return r[r.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',r[r.length]="<a:themeElements>",r[r.length]='<a:clrScheme name="Office">',r[r.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',r[r.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',r[r.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',r[r.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',r[r.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',r[r.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',r[r.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',r[r.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',r[r.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',r[r.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',r[r.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',r[r.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',r[r.length]="</a:clrScheme>",r[r.length]='<a:fontScheme name="Office">',r[r.length]="<a:majorFont>",r[r.length]='<a:latin typeface="Cambria"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Times New Roman"/>',r[r.length]='<a:font script="Hebr" typeface="Times New Roman"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="MoolBoran"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Times New Roman"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:majorFont>",r[r.length]="<a:minorFont>",r[r.length]='<a:latin typeface="Calibri"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Arial"/>',r[r.length]='<a:font script="Hebr" typeface="Arial"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="DaunPenh"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Arial"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:minorFont>",r[r.length]="</a:fontScheme>",r[r.length]='<a:fmtScheme name="Office">',r[r.length]="<a:fillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="1"/>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="0"/>',r[r.length]="</a:gradFill>",r[r.length]="</a:fillStyleLst>",r[r.length]="<a:lnStyleLst>",r[r.length]='<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>',r[r.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]="</a:lnStyleLst>",r[r.length]="<a:effectStyleLst>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]='<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>',r[r.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',r[r.length]="</a:effectStyle>",r[r.length]="</a:effectStyleLst>",r[r.length]="<a:bgFillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]="</a:bgFillStyleLst>",r[r.length]="</a:fmtScheme>",r[r.length]="</a:themeElements>",r[r.length]="<a:objectDefaults>",r[r.length]="<a:spDef>",r[r.length]='<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>',r[r.length]="</a:spDef>",r[r.length]="<a:lnDef>",r[r.length]='<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>',r[r.length]="</a:lnDef>",r[r.length]="</a:objectDefaults>",r[r.length]="<a:extraClrSchemeLst/>",r[r.length]="</a:theme>",r.join("")}function Kh(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:Mt(e)}}function qh(e){var t=q(12+2*e.name.length);return t.write_shift(4,e.flags),t.write_shift(4,e.version),St(e.name,t),t.slice(0,t.l)}function Jh(e){for(var t=[],r=e.read_shift(4);r-- >0;)t.push([e.read_shift(4),e.read_shift(4)]);return t}function Zh(e){var t=q(4+8*e.length);t.write_shift(4,e.length);for(var r=0;r<e.length;++r)t.write_shift(4,e[r][0]),t.write_shift(4,e[r][1]);return t}function Qh(e,t){var r=q(8+2*t.length);return r.write_shift(4,e),St(t,r),r.slice(0,r.l)}function ed(e){return e.l+=4,e.read_shift(4)!=0}function td(e,t){var r=q(8);return r.write_shift(4,e),r.write_shift(4,1),r}function rd(){var e=Yt();return te(e,332),te(e,334,xr(1)),te(e,335,qh({name:"XLDAPR",version:12e4,flags:3496657072})),te(e,336),te(e,339,Qh(1,"XLDAPR")),te(e,52),te(e,35,xr(514)),te(e,4096,xr(0)),te(e,4097,or(1)),te(e,36),te(e,53),te(e,340),te(e,337,td(1)),te(e,51,Zh([[1,0]])),te(e,338),te(e,333),e.end()}function Vl(){var e=[xt];return e.push(`<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray">
|
|
38
38
|
<metadataTypes count="1">
|
|
39
39
|
<metadataType name="XLDAPR" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1" cellMeta="1"/>
|
|
40
40
|
</metadataTypes>
|
|
@@ -52,20 +52,20 @@
|
|
|
52
52
|
<rc t="1" v="0"/>
|
|
53
53
|
</bk>
|
|
54
54
|
</cellMetadata>
|
|
55
|
-
</metadata>`),e.join("")}function
|
|
55
|
+
</metadata>`),e.join("")}function nd(e){var t={};t.i=e.read_shift(4);var r={};r.r=e.read_shift(4),r.c=e.read_shift(4),t.r=Qe(r);var n=e.read_shift(1);return n&2&&(t.l="1"),n&8&&(t.a="1"),t}var hn=1024;function zl(e,t){for(var r=[21600,21600],n=["m0,0l0",r[1],r[0],r[1],r[0],"0xe"].join(","),i=[ce("xml",null,{"xmlns:v":tr.v,"xmlns:o":tr.o,"xmlns:x":tr.x,"xmlns:mv":tr.mv}).replace(/\/>/,">"),ce("o:shapelayout",ce("o:idmap",null,{"v:ext":"edit",data:e}),{"v:ext":"edit"}),ce("v:shapetype",[ce("v:stroke",null,{joinstyle:"miter"}),ce("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:r.join(","),path:n})];hn<e*1e3;)hn+=1e3;return t.forEach(function(s){var a=Et(s[0]),c={color2:"#BEFF82",type:"gradient"};c.type=="gradient"&&(c.angle="-180");var u=c.type=="gradient"?ce("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null,f=ce("v:fill",u,c),d={on:"t",obscured:"t"};++hn,i=i.concat(["<v:shape"+Bn({id:"_x0000_s"+hn,type:"#_x0000_t202",style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10"+(s[1].hidden?";visibility:hidden":""),fillcolor:"#ECFAD4",strokecolor:"#edeaa1"})+">",f,ce("v:shadow",null,d),ce("v:path",null,{"o:connecttype":"none"}),'<v:textbox><div style="text-align:left"></div></v:textbox>','<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",kt("x:Anchor",[a.c+1,0,a.r+1,0,a.c+3,20,a.r+5,20].join(",")),kt("x:AutoFill","False"),kt("x:Row",String(a.r)),kt("x:Column",String(a.c)),s[1].hidden?"":"<x:Visible/>","</x:ClientData>","</v:shape>"])}),i.push("</xml>"),i.join("")}function Hl(e){var t=[xt,ce("comments",null,{xmlns:vn[0]})],r=[];return t.push("<authors>"),e.forEach(function(n){n[1].forEach(function(i){var s=Ze(i.a);r.indexOf(s)==-1&&(r.push(s),t.push("<author>"+s+"</author>")),i.T&&i.ID&&r.indexOf("tc="+i.ID)==-1&&(r.push("tc="+i.ID),t.push("<author>tc="+i.ID+"</author>"))})}),r.length==0&&(r.push("SheetJ5"),t.push("<author>SheetJ5</author>")),t.push("</authors>"),t.push("<commentList>"),e.forEach(function(n){var i=0,s=[];if(n[1][0]&&n[1][0].T&&n[1][0].ID?i=r.indexOf("tc="+n[1][0].ID):n[1].forEach(function(u){u.a&&(i=r.indexOf(Ze(u.a))),s.push(u.t||"")}),t.push('<comment ref="'+n[0]+'" authorId="'+i+'"><text>'),s.length<=1)t.push(kt("t",Ze(s[0]||"")));else{for(var a=`Comment:
|
|
56
56
|
`+s[0]+`
|
|
57
|
-
`,
|
|
58
|
-
`+s[
|
|
59
|
-
`;t.push(Zt("t",lt(a)))}t.push("</text></comment>")}),t.push("</commentList>"),t.length>2&&(t[t.length]="</comments>",t[1]=t[1].replace("/>",">")),t.join("")}function n1(e,t,r){var n=[Mt,xe("ThreadedComments",null,{xmlns:Wt.TCMNT}).replace(/[\/]>/,">")];return e.forEach(function(i){var s="";(i[1]||[]).forEach(function(a,o){if(!a.T){delete a.ID;return}a.a&&t.indexOf(a.a)==-1&&t.push(a.a);var f={ref:i[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+r.tcid++).slice(-12)+"}"};o==0?s=f.id:f.parentId=s,a.ID=f.id,a.a&&(f.personId="{54EE7950-7262-4200-6969-"+("000000000000"+t.indexOf(a.a)).slice(-12)+"}"),n.push(xe("threadedComment",Zt("text",a.t||""),f))})}),n.push("</ThreadedComments>"),n.join("")}function i1(e){var t=[Mt,xe("personList",null,{xmlns:Wt.TCMNT,"xmlns:x":Jn[0]}).replace(/[\/]>/,">")];return e.forEach(function(r,n){t.push(xe("person",null,{displayName:r,id:"{54EE7950-7262-4200-6969-"+("000000000000"+n).slice(-12)+"}",userId:r,providerId:"None"}))}),t.push("</personList>"),t.join("")}function s1(e){var t={};t.iauthor=e.read_shift(4);var r=Dn(e);return t.rfx=r.s,t.ref=ct(r.s),e.l+=16,t}function a1(e,t){return t==null&&(t=re(36)),t.write_shift(4,e[1].iauthor),Qn(e[0],t),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t}var o1=nr;function l1(e){return zt(e.slice(0,54))}function c1(e){var t=fr(),r=[];return de(t,628),de(t,630),e.forEach(function(n){n[1].forEach(function(i){r.indexOf(i.a)>-1||(r.push(i.a.slice(0,54)),de(t,632,l1(i.a)))})}),de(t,631),de(t,633),e.forEach(function(n){n[1].forEach(function(i){i.iauthor=r.indexOf(i.a);var s={s:Vt(n[0]),e:Vt(n[0])};de(t,635,a1([s,i])),i.t&&i.t.length>0&&de(t,637,fp(i)),de(t,636),delete i.iauthor})}),de(t,634),de(t,629),t.end()}function u1(e,t){t.FullPaths.forEach(function(r,n){if(n!=0){var i=r.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");i.slice(-1)!=="/"&&ht.utils.cfb_add(e,i,t.FileIndex[n].content)}})}var hu=["xlsb","xlsm","xlam","biff8","xla"],f1=(function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,t={r:0,c:0};function r(n,i,s,a){var o=!1,f=!1;s.length==0?f=!0:s.charAt(0)=="["&&(f=!0,s=s.slice(1,-1)),a.length==0?o=!0:a.charAt(0)=="["&&(o=!0,a=a.slice(1,-1));var u=s.length>0?parseInt(s,10)|0:0,d=a.length>0?parseInt(a,10)|0:0;return o?d+=t.c:--d,f?u+=t.r:--u,i+(o?"":"$")+rr(d)+(f?"":"$")+Qt(u)}return function(i,s){return t=s,i.replace(e,r)}})(),oo=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,lo=(function(){return function(t,r){return t.replace(oo,function(n,i,s,a,o,f){var u=to(a)-(s?0:r.c),d=eo(f)-(o?0:r.r),h=d==0?"":o?d+1:"["+d+"]",m=u==0?"":s?u+1:"["+u+"]";return i+"R"+h+"C"+m})}})();function d1(e,t){return e.replace(oo,function(r,n,i,s,a,o){return n+(i=="$"?i+s:rr(to(s)+t.c))+(a=="$"?a+o:Qt(eo(o)+t.r))})}function h1(e){return e.length!=1}function Pt(e){e.l+=1}function on(e,t){var r=e.read_shift(2);return[r&16383,r>>14&1,r>>15&1]}function pu(e,t,r){var n=2;if(r){if(r.biff>=2&&r.biff<=5)return gu(e);r.biff==12&&(n=4)}var i=e.read_shift(n),s=e.read_shift(n),a=on(e),o=on(e);return{s:{r:i,c:a[0],cRel:a[1],rRel:a[2]},e:{r:s,c:o[0],cRel:o[1],rRel:o[2]}}}function gu(e){var t=on(e),r=on(e),n=e.read_shift(1),i=e.read_shift(1);return{s:{r:t[0],c:n,cRel:t[1],rRel:t[2]},e:{r:r[0],c:i,cRel:r[1],rRel:r[2]}}}function p1(e,t,r){if(r.biff<8)return gu(e);var n=e.read_shift(r.biff==12?4:2),i=e.read_shift(r.biff==12?4:2),s=on(e),a=on(e);return{s:{r:n,c:s[0],cRel:s[1],rRel:s[2]},e:{r:i,c:a[0],cRel:a[1],rRel:a[2]}}}function mu(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return g1(e);var n=e.read_shift(r&&r.biff==12?4:2),i=on(e);return{r:n,c:i[0],cRel:i[1],rRel:i[2]}}function g1(e){var t=on(e),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function m1(e){var t=e.read_shift(2),r=e.read_shift(2);return{r:t,c:r&255,fQuoted:!!(r&16384),cRel:r>>15,rRel:r>>15}}function x1(e,t,r){var n=r&&r.biff?r.biff:8;if(n>=2&&n<=5)return v1(e);var i=e.read_shift(n>=12?4:2),s=e.read_shift(2),a=(s&16384)>>14,o=(s&32768)>>15;if(s&=16383,o==1)for(;i>524287;)i-=1048576;if(a==1)for(;s>8191;)s=s-16384;return{r:i,c:s,cRel:a,rRel:o}}function v1(e){var t=e.read_shift(2),r=e.read_shift(1),n=(t&32768)>>15,i=(t&16384)>>14;return t&=16383,n==1&&t>=8192&&(t=t-16384),i==1&&r>=128&&(r=r-256),{r:t,c:r,cRel:i,rRel:n}}function y1(e,t,r){var n=(e[e.l++]&96)>>5,i=pu(e,r.biff>=2&&r.biff<=5?6:8,r);return[n,i]}function w1(e,t,r){var n=(e[e.l++]&96)>>5,i=e.read_shift(2,"i"),s=8;if(r)switch(r.biff){case 5:e.l+=12,s=6;break;case 12:s=12;break}var a=pu(e,s,r);return[n,i,a]}function T1(e,t,r){var n=(e[e.l++]&96)>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[n]}function S1(e,t,r){var n=(e[e.l++]&96)>>5,i=e.read_shift(2),s=8;if(r)switch(r.biff){case 5:e.l+=12,s=6;break;case 12:s=12;break}return e.l+=s,[n,i]}function E1(e,t,r){var n=(e[e.l++]&96)>>5,i=p1(e,t-1,r);return[n,i]}function _1(e,t,r){var n=(e[e.l++]&96)>>5;return e.l+=r.biff==2?6:r.biff==12?14:7,[n]}function Dl(e){var t=e[e.l+1]&1,r=1;return e.l+=4,[t,r]}function b1(e,t,r){e.l+=2;for(var n=e.read_shift(r&&r.biff==2?1:2),i=[],s=0;s<=n;++s)i.push(e.read_shift(r&&r.biff==2?1:2));return i}function C1(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=2,[n,e.read_shift(r&&r.biff==2?1:2)]}function A1(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=2,[n,e.read_shift(r&&r.biff==2?1:2)]}function O1(e){var t=e[e.l+1]&255?1:0;return e.l+=2,[t,e.read_shift(2)]}function D1(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=r&&r.biff==2?3:4,[n]}function xu(e){var t=e.read_shift(1),r=e.read_shift(1);return[t,r]}function k1(e){return e.read_shift(2),xu(e)}function I1(e){return e.read_shift(2),xu(e)}function F1(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=mu(e,0,r);return[n,i]}function N1(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=x1(e,0,r);return[n,i]}function R1(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=e.read_shift(2);r&&r.biff==5&&(e.l+=12);var s=mu(e,0,r);return[n,i,s]}function P1(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=e.read_shift(r&&r.biff<=3?1:2);return[Pm[i],wu[i],n]}function j1(e,t,r){var n=e[e.l++],i=e.read_shift(1),s=r&&r.biff<=3?[n==88?-1:0,e.read_shift(1)]:M1(e);return[i,(s[0]===0?wu:Rm)[s[1]]]}function M1(e){return[e[e.l+1]>>7,e.read_shift(2)&32767]}function L1(e,t,r){e.l+=r&&r.biff==2?3:4}function B1(e,t,r){if(e.l++,r&&r.biff==12)return[e.read_shift(4,"i"),0];var n=e.read_shift(2),i=e.read_shift(r&&r.biff==2?1:2);return[n,i]}function $1(e){return e.l++,Ii[e.read_shift(1)]}function U1(e){return e.l++,e.read_shift(2)}function W1(e){return e.l++,e.read_shift(1)!==0}function V1(e){return e.l++,ei(e)}function z1(e,t,r){return e.l++,Q0(e,t-1,r)}function H1(e,t){var r=[e.read_shift(1)];if(t==12)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2;break}switch(r[0]){case 4:r[1]=Rp(e,1)?"TRUE":"FALSE",t!=12&&(e.l+=7);break;case 37:case 16:r[1]=Ii[e[e.l]],e.l+=t==12?4:8;break;case 0:e.l+=8;break;case 1:r[1]=ei(e);break;case 2:r[1]=Lp(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function G1(e,t,r){for(var n=e.read_shift(r.biff==12?4:2),i=[],s=0;s!=n;++s)i.push((r.biff==12?Dn:Up)(e));return i}function Y1(e,t,r){var n=0,i=0;r.biff==12?(n=e.read_shift(4),i=e.read_shift(4)):(i=1+e.read_shift(1),n=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--n,--i==0&&(i=256));for(var s=0,a=[];s!=n&&(a[s]=[]);++s)for(var o=0;o!=i;++o)a[s][o]=H1(e,r.biff);return a}function X1(e,t,r){var n=e.read_shift(1)>>>5&3,i=!r||r.biff>=8?4:2,s=e.read_shift(i);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12;break}return[n,0,s]}function K1(e,t,r){if(r.biff==5)return q1(e);var n=e.read_shift(1)>>>5&3,i=e.read_shift(2),s=e.read_shift(4);return[n,i,s]}function q1(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var n=e.read_shift(2);return e.l+=12,[t,r,n]}function J1(e,t,r){var n=e.read_shift(1)>>>5&3;e.l+=r&&r.biff==2?3:4;var i=e.read_shift(r&&r.biff==2?1:2);return[n,i]}function Z1(e,t,r){var n=e.read_shift(1)>>>5&3,i=e.read_shift(r&&r.biff==2?1:2);return[n,i]}function Q1(e,t,r){var n=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,r.biff==12&&(e.l+=2),[n]}function em(e,t,r){var n=(e[e.l++]&96)>>5,i=e.read_shift(2),s=4;if(r)switch(r.biff){case 5:s=15;break;case 12:s=6;break}return e.l+=s,[n,i]}var tm=Wr,rm=Wr,nm=Wr;function Fi(e,t,r){return e.l+=2,[m1(e)]}function co(e){return e.l+=6,[]}var im=Fi,sm=co,am=co,om=Fi;function vu(e){return e.l+=2,[J0(e),e.read_shift(2)&1]}var lm=Fi,cm=vu,um=co,fm=Fi,dm=Fi,hm=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function pm(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),i=e.read_shift(2),s=e.read_shift(2),a=hm[r>>2&31];return{ixti:t,coltype:r&3,rt:a,idx:n,c:i,C:s}}function gm(e){return e.l+=2,[e.read_shift(4)]}function mm(e,t,r){return e.l+=5,e.l+=2,e.l+=r.biff==2?1:4,["PTGSHEET"]}function xm(e,t,r){return e.l+=r.biff==2?4:5,["PTGENDSHEET"]}function vm(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function ym(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function wm(e){return e.l+=4,[0,0]}var kl={1:{n:"PtgExp",f:B1},2:{n:"PtgTbl",f:nm},3:{n:"PtgAdd",f:Pt},4:{n:"PtgSub",f:Pt},5:{n:"PtgMul",f:Pt},6:{n:"PtgDiv",f:Pt},7:{n:"PtgPower",f:Pt},8:{n:"PtgConcat",f:Pt},9:{n:"PtgLt",f:Pt},10:{n:"PtgLe",f:Pt},11:{n:"PtgEq",f:Pt},12:{n:"PtgGe",f:Pt},13:{n:"PtgGt",f:Pt},14:{n:"PtgNe",f:Pt},15:{n:"PtgIsect",f:Pt},16:{n:"PtgUnion",f:Pt},17:{n:"PtgRange",f:Pt},18:{n:"PtgUplus",f:Pt},19:{n:"PtgUminus",f:Pt},20:{n:"PtgPercent",f:Pt},21:{n:"PtgParen",f:Pt},22:{n:"PtgMissArg",f:Pt},23:{n:"PtgStr",f:z1},26:{n:"PtgSheet",f:mm},27:{n:"PtgEndSheet",f:xm},28:{n:"PtgErr",f:$1},29:{n:"PtgBool",f:W1},30:{n:"PtgInt",f:U1},31:{n:"PtgNum",f:V1},32:{n:"PtgArray",f:_1},33:{n:"PtgFunc",f:P1},34:{n:"PtgFuncVar",f:j1},35:{n:"PtgName",f:X1},36:{n:"PtgRef",f:F1},37:{n:"PtgArea",f:y1},38:{n:"PtgMemArea",f:J1},39:{n:"PtgMemErr",f:tm},40:{n:"PtgMemNoMem",f:rm},41:{n:"PtgMemFunc",f:Z1},42:{n:"PtgRefErr",f:Q1},43:{n:"PtgAreaErr",f:T1},44:{n:"PtgRefN",f:N1},45:{n:"PtgAreaN",f:E1},46:{n:"PtgMemAreaN",f:vm},47:{n:"PtgMemNoMemN",f:ym},57:{n:"PtgNameX",f:K1},58:{n:"PtgRef3d",f:R1},59:{n:"PtgArea3d",f:w1},60:{n:"PtgRefErr3d",f:em},61:{n:"PtgAreaErr3d",f:S1},255:{}},Tm={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},Sm={1:{n:"PtgElfLel",f:vu},2:{n:"PtgElfRw",f:fm},3:{n:"PtgElfCol",f:im},6:{n:"PtgElfRwV",f:dm},7:{n:"PtgElfColV",f:om},10:{n:"PtgElfRadical",f:lm},11:{n:"PtgElfRadicalS",f:um},13:{n:"PtgElfColS",f:sm},15:{n:"PtgElfColSV",f:am},16:{n:"PtgElfRadicalLel",f:cm},25:{n:"PtgList",f:pm},29:{n:"PtgSxName",f:gm},255:{}},Em={0:{n:"PtgAttrNoop",f:wm},1:{n:"PtgAttrSemi",f:D1},2:{n:"PtgAttrIf",f:A1},4:{n:"PtgAttrChoose",f:b1},8:{n:"PtgAttrGoto",f:C1},16:{n:"PtgAttrSum",f:L1},32:{n:"PtgAttrBaxcel",f:Dl},33:{n:"PtgAttrBaxcel",f:Dl},64:{n:"PtgAttrSpace",f:k1},65:{n:"PtgAttrSpaceSemi",f:I1},128:{n:"PtgAttrIfError",f:O1},255:{}};function _m(e,t,r,n){if(n.biff<8)return Wr(e,t);for(var i=e.l+t,s=[],a=0;a!==r.length;++a)switch(r[a][0]){case"PtgArray":r[a][1]=Y1(e,0,n),s.push(r[a][1]);break;case"PtgMemArea":r[a][2]=G1(e,r[a][1],n),s.push(r[a][2]);break;case"PtgExp":n&&n.biff==12&&(r[a][1][1]=e.read_shift(4),s.push(r[a][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[a][0]}return t=i-e.l,t!==0&&s.push(Wr(e,t)),s}function bm(e,t,r){for(var n=e.l+t,i,s,a=[];n!=e.l;)t=n-e.l,s=e[e.l],i=kl[s]||kl[Tm[s]],(s===24||s===25)&&(i=(s===24?Sm:Em)[e[e.l+1]]),!i||!i.f?Wr(e,t):a.push([i.n,i.f(e,t,r)]);return a}function Cm(e){for(var t=[],r=0;r<e.length;++r){for(var n=e[r],i=[],s=0;s<n.length;++s){var a=n[s];if(a)switch(a[0]){case 2:i.push('"'+a[1].replace(/"/g,'""')+'"');break;default:i.push(a[1])}else i.push("")}t.push(i.join(","))}return t.join(";")}var Am={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function Om(e,t){if(!e&&!(t&&t.biff<=5&&t.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(e)?"'"+e+"'":e}function yu(e,t,r){if(!e)return"SH33TJSERR0";if(r.biff>8&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var n=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),t==0?"":e.XTI[t-1];if(!n)return"SH33TJSERR1";var i="";if(r.biff>8)switch(e[n[0]][0]){case 357:return i=n[1]==-1?"#REF":e.SheetNames[n[1]],n[1]==n[2]?i:i+":"+e.SheetNames[n[2]];case 358:return r.SID!=null?e.SheetNames[r.SID]:"SH33TJSSAME"+e[n[0]][0];case 355:default:return"SH33TJSSRC"+e[n[0]][0]}switch(e[n[0]][0][0]){case 1025:return i=n[1]==-1?"#REF":e.SheetNames[n[1]]||"SH33TJSERR3",n[1]==n[2]?i:i+":"+e.SheetNames[n[2]];case 14849:return e[n[0]].slice(1).map(function(s){return s.Name}).join(";;");default:return e[n[0]][0][3]?(i=n[1]==-1?"#REF":e[n[0]][0][3][n[1]]||"SH33TJSERR4",n[1]==n[2]?i:i+":"+e[n[0]][0][3][n[2]]):"SH33TJSERR2"}}function Il(e,t,r){var n=yu(e,t,r);return n=="#REF"?n:Om(n,r)}function qn(e,t,r,n,i){var s=i&&i.biff||8,a={s:{c:0,r:0}},o=[],f,u,d,h=0,m=0,l,v="";if(!e[0]||!e[0][0])return"";for(var g=-1,x="",T=0,b=e[0].length;T<b;++T){var _=e[0][T];switch(_[0]){case"PtgUminus":o.push("-"+o.pop());break;case"PtgUplus":o.push("+"+o.pop());break;case"PtgPercent":o.push(o.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(f=o.pop(),u=o.pop(),g>=0){switch(e[0][g][1][0]){case 0:x=Ot(" ",e[0][g][1][1]);break;case 1:x=Ot("\r",e[0][g][1][1]);break;default:if(x="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][g][1][0])}u=u+x,g=-1}o.push(u+Am[_[0]]+f);break;case"PtgIsect":f=o.pop(),u=o.pop(),o.push(u+" "+f);break;case"PtgUnion":f=o.pop(),u=o.pop(),o.push(u+","+f);break;case"PtgRange":f=o.pop(),u=o.pop(),o.push(u+":"+f);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":d=hi(_[1][1],a,i),o.push(pi(d,s));break;case"PtgRefN":d=r?hi(_[1][1],r,i):_[1][1],o.push(pi(d,s));break;case"PtgRef3d":h=_[1][1],d=hi(_[1][2],a,i),v=Il(n,h,i),o.push(v+"!"+pi(d,s));break;case"PtgFunc":case"PtgFuncVar":var k=_[1][0],F=_[1][1];k||(k=0),k&=127;var z=k==0?[]:o.slice(-k);o.length-=k,F==="User"&&(F=z.shift()),o.push(F+"("+z.join(",")+")");break;case"PtgBool":o.push(_[1]?"TRUE":"FALSE");break;case"PtgInt":o.push(_[1]);break;case"PtgNum":o.push(String(_[1]));break;case"PtgStr":o.push('"'+_[1].replace(/"/g,'""')+'"');break;case"PtgErr":o.push(_[1]);break;case"PtgAreaN":l=gl(_[1][1],r?{s:r}:a,i),o.push(ra(l,i));break;case"PtgArea":l=gl(_[1][1],a,i),o.push(ra(l,i));break;case"PtgArea3d":h=_[1][1],l=_[1][2],v=Il(n,h,i),o.push(v+"!"+ra(l,i));break;case"PtgAttrSum":o.push("SUM("+o.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":m=_[1][2];var N=(n.names||[])[m-1]||(n[0]||[])[m],B=N?N.Name:"SH33TJSNAME"+String(m);B&&B.slice(0,6)=="_xlfn."&&!i.xlfn&&(B=B.slice(6)),o.push(B);break;case"PtgNameX":var M=_[1][1];m=_[1][2];var L;if(i.biff<=5)M<0&&(M=-M),n[M]&&(L=n[M][m]);else{var W="";if(((n[M]||[])[0]||[])[0]==14849||(((n[M]||[])[0]||[])[0]==1025?n[M][m]&&n[M][m].itab>0&&(W=n.SheetNames[n[M][m].itab-1]+"!"):W=n.SheetNames[m-1]+"!"),n[M]&&n[M][m])W+=n[M][m].Name;else if(n[0]&&n[0][m])W+=n[0][m].Name;else{var y=(yu(n,M,i)||"").split(";;");y[m-1]?W=y[m-1]:W+="SH33TJSERRX"}o.push(W);break}L||(L={Name:"SH33TJSERRY"}),o.push(L.Name);break;case"PtgParen":var H="(",Q=")";if(g>=0){switch(x="",e[0][g][1][0]){case 2:H=Ot(" ",e[0][g][1][1])+H;break;case 3:H=Ot("\r",e[0][g][1][1])+H;break;case 4:Q=Ot(" ",e[0][g][1][1])+Q;break;case 5:Q=Ot("\r",e[0][g][1][1])+Q;break;default:if(i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][g][1][0])}g=-1}o.push(H+o.pop()+Q);break;case"PtgRefErr":o.push("#REF!");break;case"PtgRefErr3d":o.push("#REF!");break;case"PtgExp":d={c:_[1][1],r:_[1][0]};var J={c:r.c,r:r.r};if(n.sharedf[ct(d)]){var ee=n.sharedf[ct(d)];o.push(qn(ee,a,J,n,i))}else{var _e=!1;for(f=0;f!=n.arrayf.length;++f)if(u=n.arrayf[f],!(d.c<u[0].s.c||d.c>u[0].e.c)&&!(d.r<u[0].s.r||d.r>u[0].e.r)){o.push(qn(u[1],a,J,n,i)),_e=!0;break}_e||o.push(_[1])}break;case"PtgArray":o.push("{"+Cm(_[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":g=T;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":o.push("");break;case"PtgAreaErr":o.push("#REF!");break;case"PtgAreaErr3d":o.push("#REF!");break;case"PtgList":o.push("Table"+_[1].idx+"[#"+_[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(_));default:throw new Error("Unrecognized Formula Token: "+String(_))}var Ae=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(i.biff!=3&&g>=0&&Ae.indexOf(e[0][T][0])==-1){_=e[0][g];var De=!0;switch(_[1][0]){case 4:De=!1;case 0:x=Ot(" ",_[1][1]);break;case 5:De=!1;case 1:x=Ot("\r",_[1][1]);break;default:if(x="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+_[1][0])}o.push((De?x:"")+o.pop()+(De?"":x)),g=-1}}if(o.length>1&&i.WTF)throw new Error("bad formula stack");return o[0]}function Dm(e){if(e==null){var t=re(8);return t.write_shift(1,3),t.write_shift(1,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,65535),t}else if(typeof e=="number")return wn(e);return wn(0)}function km(e,t,r,n,i){var s=Tn(t,r,i),a=Dm(e.v),o=re(6),f=33;o.write_shift(2,f),o.write_shift(4,0);for(var u=re(e.bf.length),d=0;d<e.bf.length;++d)u[d]=e.bf[d];var h=Jt([s,a,o,u]);return h}function Os(e,t,r){var n=e.read_shift(4),i=bm(e,n,r),s=e.read_shift(4),a=s>0?_m(e,s,i,r):null;return[i,a]}var Im=Os,Ds=Os,Fm=Os,Nm=Os,Rm={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},wu={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},Pm={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function jm(e){var t="of:="+e.replace(oo,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return t.replace(/;/g,"|").replace(/,/g,";")}function Mm(e){return e.replace(/\./,"!")}var gi=typeof Map<"u";function uo(e,t,r){var n=0,i=e.length;if(r){if(gi?r.has(t):Object.prototype.hasOwnProperty.call(r,t)){for(var s=gi?r.get(t):r[t];n<s.length;++n)if(e[s[n]].t===t)return e.Count++,s[n]}}else for(;n<i;++n)if(e[n].t===t)return e.Count++,n;return e[i]={t},e.Count++,e.Unique++,r&&(gi?(r.has(t)||r.set(t,[]),r.get(t).push(i)):(Object.prototype.hasOwnProperty.call(r,t)||(r[t]=[]),r[t].push(i))),i}function ks(e,t){var r={min:e+1,max:e+1},n=-1;return t.MDW&&(Xr=t.MDW),t.width!=null?r.customWidth=1:t.wpx!=null?n=gs(t.wpx):t.wch!=null&&(n=t.wch),n>-1?(r.width=Da(n),r.customWidth=1):t.width!=null&&(r.width=t.width),t.hidden&&(r.hidden=!0),t.level!=null&&(r.outlineLevel=r.level=t.level),r}function Tu(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];e.left==null&&(e.left=r[0]),e.right==null&&(e.right=r[1]),e.top==null&&(e.top=r[2]),e.bottom==null&&(e.bottom=r[3]),e.header==null&&(e.header=r[4]),e.footer==null&&(e.footer=r[5])}}function un(e,t,r){var n=r.revssf[t.z!=null?t.z:"General"],i=60,s=e.length;if(n==null&&r.ssf){for(;i<392;++i)if(r.ssf[i]==null){m0(t.z,i),r.ssf[i]=t.z,r.revssf[t.z]=n=i;break}}for(i=0;i!=s;++i)if(e[i].numFmtId===n)return i;return e[s]={numFmtId:n,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},s}function Lm(e,t,r){if(e&&e["!ref"]){var n=wt(e["!ref"]);if(n.e.c<n.s.c||n.e.r<n.s.r)throw new Error("Bad range ("+r+"): "+e["!ref"])}}function Bm(e){if(e.length===0)return"";for(var t='<mergeCells count="'+e.length+'">',r=0;r!=e.length;++r)t+='<mergeCell ref="'+jt(e[r])+'"/>';return t+"</mergeCells>"}function $m(e,t,r,n,i){var s=!1,a={},o=null;if(n.bookType!=="xlsx"&&t.vbaraw){var f=t.SheetNames[r];try{t.Workbook&&(f=t.Workbook.Sheets[r].CodeName||f)}catch{}s=!0,a.codeName=Ti(lt(f))}if(e&&e["!outline"]){var u={summaryBelow:1,summaryRight:1};e["!outline"].above&&(u.summaryBelow=0),e["!outline"].left&&(u.summaryRight=0),o=(o||"")+xe("outlinePr",null,u)}!s&&!o||(i[i.length]=xe("sheetPr",o,a))}var Um=["objects","scenarios","selectLockedCells","selectUnlockedCells"],Wm=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function Vm(e){var t={sheet:1};return Um.forEach(function(r){e[r]!=null&&e[r]&&(t[r]="1")}),Wm.forEach(function(r){e[r]!=null&&!e[r]&&(t[r]="0")}),e.password&&(t.password=iu(e.password).toString(16).toUpperCase()),xe("sheetProtection",null,t)}function zm(e){return Tu(e),xe("pageMargins",null,e)}function Hm(e,t){for(var r=["<cols>"],n,i=0;i!=t.length;++i)(n=t[i])&&(r[r.length]=xe("col",null,ks(i,n)));return r[r.length]="</cols>",r.join("")}function Gm(e,t,r,n){var i=typeof e.ref=="string"?e.ref:jt(e.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var s=r.Workbook.Names,a=Sr(i);a.s.r==a.e.r&&(a.e.r=Sr(t["!ref"]).e.r,i=jt(a));for(var o=0;o<s.length;++o){var f=s[o];if(f.Name=="_xlnm._FilterDatabase"&&f.Sheet==n){f.Ref="'"+r.SheetNames[n]+"'!"+i;break}}return o==s.length&&s.push({Name:"_xlnm._FilterDatabase",Sheet:n,Ref:"'"+r.SheetNames[n]+"'!"+i}),xe("autoFilter",null,{ref:i})}function Ym(e,t,r,n){var i={workbookViewId:"0"};return(((n||{}).Workbook||{}).Views||[])[0]&&(i.rightToLeft=n.Workbook.Views[0].RTL?"1":"0"),xe("sheetViews",xe("sheetView",null,i),{})}function Xm(e,t,r,n){if(e.c&&r["!comments"].push([t,e.c]),e.v===void 0&&typeof e.f!="string"||e.t==="z"&&!e.f)return"";var i="",s=e.t,a=e.v;if(e.t!=="z")switch(e.t){case"b":i=e.v?"1":"0";break;case"n":i=""+e.v;break;case"e":i=Ii[e.v];break;case"d":n&&n.cellDates?i=lr(e.v,-1).toISOString():(e=hr(e),e.t="n",i=""+(e.v=dr(lr(e.v)))),typeof e.z>"u"&&(e.z=Dt[14]);break;default:i=e.v;break}var o=Zt("v",lt(i)),f={r:t},u=un(n.cellXfs,e,n);switch(u!==0&&(f.s=u),e.t){case"n":break;case"d":f.t="d";break;case"b":f.t="b";break;case"e":f.t="e";break;case"z":break;default:if(e.v==null){delete e.t;break}if(e.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(n&&n.bookSST){o=Zt("v",""+uo(n.Strings,e.v,n.revStrings)),f.t="s";break}f.t="str";break}if(e.t!=s&&(e.t=s,e.v=a),typeof e.f=="string"&&e.f){var d=e.F&&e.F.slice(0,t.length)==t?{t:"array",ref:e.F}:null;o=xe("f",lt(e.f),d)+(e.v!=null?o:"")}return e.l&&r["!links"].push([t,e.l]),e.D&&(f.cm=1),xe("c",o,f)}function Km(e,t,r,n){var i=[],s=[],a=wt(e["!ref"]),o="",f,u="",d=[],h=0,m=0,l=e["!rows"],v=Array.isArray(e),g={r:u},x,T=-1;for(m=a.s.c;m<=a.e.c;++m)d[m]=rr(m);for(h=a.s.r;h<=a.e.r;++h){for(s=[],u=Qt(h),m=a.s.c;m<=a.e.c;++m){f=d[m]+u;var b=v?(e[h]||[])[m]:e[f];b!==void 0&&(o=Xm(b,f,e,t))!=null&&s.push(o)}(s.length>0||l&&l[h])&&(g={r:u},l&&l[h]&&(x=l[h],x.hidden&&(g.hidden=1),T=-1,x.hpx?T=ms(x.hpx):x.hpt&&(T=x.hpt),T>-1&&(g.ht=T,g.customHeight=1),x.level&&(g.outlineLevel=x.level)),i[i.length]=xe("row",s.join(""),g))}if(l)for(;h<l.length;++h)l&&l[h]&&(g={r:h+1},x=l[h],x.hidden&&(g.hidden=1),T=-1,x.hpx?T=ms(x.hpx):x.hpt&&(T=x.hpt),T>-1&&(g.ht=T,g.customHeight=1),x.level&&(g.outlineLevel=x.level),i[i.length]=xe("row","",g));return i.join("")}function Su(e,t,r,n){var i=[Mt,xe("worksheet",null,{xmlns:Jn[0],"xmlns:r":Wt.r})],s=r.SheetNames[e],a=0,o="",f=r.Sheets[s];f==null&&(f={});var u=f["!ref"]||"A1",d=wt(u);if(d.e.c>16383||d.e.r>1048575){if(t.WTF)throw new Error("Range "+u+" exceeds format limit A1:XFD1048576");d.e.c=Math.min(d.e.c,16383),d.e.r=Math.min(d.e.c,1048575),u=jt(d)}n||(n={}),f["!comments"]=[];var h=[];$m(f,r,e,t,i),i[i.length]=xe("dimension",null,{ref:u}),i[i.length]=Ym(f,t,e,r),t.sheetFormat&&(i[i.length]=xe("sheetFormatPr",null,{defaultRowHeight:t.sheetFormat.defaultRowHeight||"16",baseColWidth:t.sheetFormat.baseColWidth||"10",outlineLevelRow:t.sheetFormat.outlineLevelRow||"7"})),f["!cols"]!=null&&f["!cols"].length>0&&(i[i.length]=Hm(f,f["!cols"])),i[a=i.length]="<sheetData/>",f["!links"]=[],f["!ref"]!=null&&(o=Km(f,t),o.length>0&&(i[i.length]=o)),i.length>a+1&&(i[i.length]="</sheetData>",i[a]=i[a].replace("/>",">")),f["!protect"]&&(i[i.length]=Vm(f["!protect"])),f["!autofilter"]!=null&&(i[i.length]=Gm(f["!autofilter"],f,r,e)),f["!merges"]!=null&&f["!merges"].length>0&&(i[i.length]=Bm(f["!merges"]));var m=-1,l,v=-1;return f["!links"].length>0&&(i[i.length]="<hyperlinks>",f["!links"].forEach(function(g){g[1].Target&&(l={ref:g[0]},g[1].Target.charAt(0)!="#"&&(v=ot(n,-1,lt(g[1].Target).replace(/#.*$/,""),Ke.HLINK),l["r:id"]="rId"+v),(m=g[1].Target.indexOf("#"))>-1&&(l.location=lt(g[1].Target.slice(m+1))),g[1].Tooltip&&(l.tooltip=lt(g[1].Tooltip)),i[i.length]=xe("hyperlink",null,l))}),i[i.length]="</hyperlinks>"),delete f["!links"],f["!margins"]!=null&&(i[i.length]=zm(f["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&(i[i.length]=Zt("ignoredErrors",xe("ignoredError",null,{numberStoredAsText:1,sqref:u}))),h.length>0&&(v=ot(n,-1,"../drawings/drawing"+(e+1)+".xml",Ke.DRAW),i[i.length]=xe("drawing",null,{"r:id":"rId"+v}),f["!drawing"]=h),f["!comments"].length>0&&(v=ot(n,-1,"../drawings/vmlDrawing"+(e+1)+".vml",Ke.VML),i[i.length]=xe("legacyDrawing",null,{"r:id":"rId"+v}),f["!legacy"]=v),i.length>1&&(i[i.length]="</worksheet>",i[1]=i[1].replace("/>",">")),i.join("")}function qm(e,t){var r={},n=e.l+t;r.r=e.read_shift(4),e.l+=4;var i=e.read_shift(2);e.l+=1;var s=e.read_shift(1);return e.l=n,s&7&&(r.level=s&7),s&16&&(r.hidden=!0),s&32&&(r.hpt=i/20),r}function Jm(e,t,r){var n=re(145),i=(r["!rows"]||[])[e]||{};n.write_shift(4,e),n.write_shift(4,0);var s=320;i.hpx?s=ms(i.hpx)*20:i.hpt&&(s=i.hpt*20),n.write_shift(2,s),n.write_shift(1,0);var a=0;i.level&&(a|=i.level),i.hidden&&(a|=16),(i.hpx||i.hpt)&&(a|=32),n.write_shift(1,a),n.write_shift(1,0);var o=0,f=n.l;n.l+=4;for(var u={r:e,c:0},d=0;d<16;++d)if(!(t.s.c>d+1<<10||t.e.c<d<<10)){for(var h=-1,m=-1,l=d<<10;l<d+1<<10;++l){u.c=l;var v=Array.isArray(r)?(r[u.r]||[])[u.c]:r[ct(u)];v&&(h<0&&(h=l),m=l)}h<0||(++o,n.write_shift(4,h),n.write_shift(4,m))}var g=n.l;return n.l=f,n.write_shift(4,o),n.l=g,n.length>n.l?n.slice(0,n.l):n}function Zm(e,t,r,n){var i=Jm(n,r,t);(i.length>17||(t["!rows"]||[])[n])&&de(e,0,i)}var Qm=Dn,ex=Qn;function tx(){}function rx(e,t){var r={},n=e[e.l];return++e.l,r.above=!(n&64),r.left=!(n&128),e.l+=18,r.name=dp(e),r}function nx(e,t,r){r==null&&(r=re(84+4*e.length));var n=192;t&&(t.above&&(n&=-65),t.left&&(n&=-129)),r.write_shift(1,n);for(var i=1;i<3;++i)r.write_shift(1,0);return ds({auto:1},r),r.write_shift(-4,-1),r.write_shift(-4,-1),M0(e,r),r.slice(0,r.l)}function ix(e){var t=Or(e);return[t]}function sx(e,t,r){return r==null&&(r=re(8)),Cn(t,r)}function ax(e){var t=An(e);return[t]}function ox(e,t,r){return r==null&&(r=re(4)),On(t,r)}function lx(e){var t=Or(e),r=e.read_shift(1);return[t,r,"b"]}function cx(e,t,r){return r==null&&(r=re(9)),Cn(t,r),r.write_shift(1,e.v?1:0),r}function ux(e){var t=An(e),r=e.read_shift(1);return[t,r,"b"]}function fx(e,t,r){return r==null&&(r=re(5)),On(t,r),r.write_shift(1,e.v?1:0),r}function dx(e){var t=Or(e),r=e.read_shift(1);return[t,r,"e"]}function hx(e,t,r){return r==null&&(r=re(9)),Cn(t,r),r.write_shift(1,e.v),r}function px(e){var t=An(e),r=e.read_shift(1);return[t,r,"e"]}function gx(e,t,r){return r==null&&(r=re(8)),On(t,r),r.write_shift(1,e.v),r.write_shift(2,0),r.write_shift(1,0),r}function mx(e){var t=Or(e),r=e.read_shift(4);return[t,r,"s"]}function xx(e,t,r){return r==null&&(r=re(12)),Cn(t,r),r.write_shift(4,t.v),r}function vx(e){var t=An(e),r=e.read_shift(4);return[t,r,"s"]}function yx(e,t,r){return r==null&&(r=re(8)),On(t,r),r.write_shift(4,t.v),r}function wx(e){var t=Or(e),r=ei(e);return[t,r,"n"]}function Tx(e,t,r){return r==null&&(r=re(16)),Cn(t,r),wn(e.v,r),r}function Sx(e){var t=An(e),r=ei(e);return[t,r,"n"]}function Ex(e,t,r){return r==null&&(r=re(12)),On(t,r),wn(e.v,r),r}function _x(e){var t=Or(e),r=L0(e);return[t,r,"n"]}function bx(e,t,r){return r==null&&(r=re(12)),Cn(t,r),B0(e.v,r),r}function Cx(e){var t=An(e),r=L0(e);return[t,r,"n"]}function Ax(e,t,r){return r==null&&(r=re(8)),On(t,r),B0(e.v,r),r}function Ox(e){var t=Or(e),r=ro(e);return[t,r,"is"]}function Dx(e){var t=Or(e),r=nr(e);return[t,r,"str"]}function kx(e,t,r){return r==null&&(r=re(12+4*e.v.length)),Cn(t,r),zt(e.v,r),r.length>r.l?r.slice(0,r.l):r}function Ix(e){var t=An(e),r=nr(e);return[t,r,"str"]}function Fx(e,t,r){return r==null&&(r=re(8+4*e.v.length)),On(t,r),zt(e.v,r),r.length>r.l?r.slice(0,r.l):r}function Nx(e,t,r){var n=e.l+t,i=Or(e);i.r=r["!row"];var s=e.read_shift(1),a=[i,s,"b"];if(r.cellFormula){e.l+=2;var o=Ds(e,n-e.l,r);a[3]=qn(o,null,i,r.supbooks,r)}else e.l=n;return a}function Rx(e,t,r){var n=e.l+t,i=Or(e);i.r=r["!row"];var s=e.read_shift(1),a=[i,s,"e"];if(r.cellFormula){e.l+=2;var o=Ds(e,n-e.l,r);a[3]=qn(o,null,i,r.supbooks,r)}else e.l=n;return a}function Px(e,t,r){var n=e.l+t,i=Or(e);i.r=r["!row"];var s=ei(e),a=[i,s,"n"];if(r.cellFormula){e.l+=2;var o=Ds(e,n-e.l,r);a[3]=qn(o,null,i,r.supbooks,r)}else e.l=n;return a}function jx(e,t,r){var n=e.l+t,i=Or(e);i.r=r["!row"];var s=nr(e),a=[i,s,"str"];if(r.cellFormula){e.l+=2;var o=Ds(e,n-e.l,r);a[3]=qn(o,null,i,r.supbooks,r)}else e.l=n;return a}var Mx=Dn,Lx=Qn;function Bx(e,t){return t==null&&(t=re(4)),t.write_shift(4,e),t}function $x(e,t){var r=e.l+t,n=Dn(e),i=no(e),s=nr(e),a=nr(e),o=nr(e);e.l=r;var f={rfx:n,relId:i,loc:s,display:o};return a&&(f.Tooltip=a),f}function Ux(e,t){var r=re(50+4*(e[1].Target.length+(e[1].Tooltip||"").length));Qn({s:Vt(e[0]),e:Vt(e[0])},r),io("rId"+t,r);var n=e[1].Target.indexOf("#"),i=n==-1?"":e[1].Target.slice(n+1);return zt(i||"",r),zt(e[1].Tooltip||"",r),zt("",r),r.slice(0,r.l)}function Wx(){}function Vx(e,t,r){var n=e.l+t,i=$0(e),s=e.read_shift(1),a=[i];if(a[2]=s,r.cellFormula){var o=Im(e,n-e.l,r);a[1]=o}else e.l=n;return a}function zx(e,t,r){var n=e.l+t,i=Dn(e),s=[i];if(r.cellFormula){var a=Nm(e,n-e.l,r);s[1]=a,e.l=n}else e.l=n;return s}function Hx(e,t,r){r==null&&(r=re(18));var n=ks(e,t);r.write_shift(-4,e),r.write_shift(-4,e),r.write_shift(4,(n.width||10)*256),r.write_shift(4,0);var i=0;return t.hidden&&(i|=1),typeof n.width=="number"&&(i|=2),t.level&&(i|=t.level<<8),r.write_shift(2,i),r}var Eu=["left","right","top","bottom","header","footer"];function Gx(e){var t={};return Eu.forEach(function(r){t[r]=ei(e)}),t}function Yx(e,t){return t==null&&(t=re(48)),Tu(e),Eu.forEach(function(r){wn(e[r],t)}),t}function Xx(e){var t=e.read_shift(2);return e.l+=28,{RTL:t&32}}function Kx(e,t,r){r==null&&(r=re(30));var n=924;return(((t||{}).Views||[])[0]||{}).RTL&&(n|=32),r.write_shift(2,n),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(2,0),r.write_shift(2,100),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(4,0),r}function qx(e){var t=re(24);return t.write_shift(4,4),t.write_shift(4,1),Qn(e,t),t}function Jx(e,t){return t==null&&(t=re(66)),t.write_shift(2,e.password?iu(e.password):0),t.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach(function(r){r[1]?t.write_shift(4,e[r[0]]!=null&&!e[r[0]]?1:0):t.write_shift(4,e[r[0]]!=null&&e[r[0]]?0:1)}),t}function Zx(){}function Qx(){}function ev(e,t,r,n,i,s,a){if(t.v===void 0)return!1;var o="";switch(t.t){case"b":o=t.v?"1":"0";break;case"d":t=hr(t),t.z=t.z||Dt[14],t.v=dr(lr(t.v)),t.t="n";break;case"n":case"e":o=""+t.v;break;default:o=t.v;break}var f={r,c:n};switch(f.s=un(i.cellXfs,t,i),t.l&&s["!links"].push([ct(f),t.l]),t.c&&s["!comments"].push([ct(f),t.c]),t.t){case"s":case"str":return i.bookSST?(o=uo(i.Strings,t.v,i.revStrings),f.t="s",f.v=o,a?de(e,18,yx(t,f)):de(e,7,xx(t,f))):(f.t="str",a?de(e,17,Fx(t,f)):de(e,6,kx(t,f))),!0;case"n":return t.v==(t.v|0)&&t.v>-1e3&&t.v<1e3?a?de(e,13,Ax(t,f)):de(e,2,bx(t,f)):a?de(e,16,Ex(t,f)):de(e,5,Tx(t,f)),!0;case"b":return f.t="b",a?de(e,15,fx(t,f)):de(e,4,cx(t,f)),!0;case"e":return f.t="e",a?de(e,14,gx(t,f)):de(e,3,hx(t,f)),!0}return a?de(e,12,ox(t,f)):de(e,1,sx(t,f)),!0}function tv(e,t,r,n){var i=wt(t["!ref"]||"A1"),s,a="",o=[];de(e,145);var f=Array.isArray(t),u=i.e.r;t["!rows"]&&(u=Math.max(i.e.r,t["!rows"].length-1));for(var d=i.s.r;d<=u;++d){a=Qt(d),Zm(e,t,i,d);var h=!1;if(d<=i.e.r)for(var m=i.s.c;m<=i.e.c;++m){d===i.s.r&&(o[m]=rr(m)),s=o[m]+a;var l=f?(t[d]||[])[m]:t[s];if(!l){h=!1;continue}h=ev(e,l,d,m,n,t,h)}}de(e,146)}function rv(e,t){!t||!t["!merges"]||(de(e,177,Bx(t["!merges"].length)),t["!merges"].forEach(function(r){de(e,176,Lx(r))}),de(e,178))}function nv(e,t){!t||!t["!cols"]||(de(e,390),t["!cols"].forEach(function(r,n){r&&de(e,60,Hx(n,r))}),de(e,391))}function iv(e,t){!t||!t["!ref"]||(de(e,648),de(e,649,qx(wt(t["!ref"]))),de(e,650))}function sv(e,t,r){t["!links"].forEach(function(n){if(n[1].Target){var i=ot(r,-1,n[1].Target.replace(/#.*$/,""),Ke.HLINK);de(e,494,Ux(n,i))}}),delete t["!links"]}function av(e,t,r,n){if(t["!comments"].length>0){var i=ot(n,-1,"../drawings/vmlDrawing"+(r+1)+".vml",Ke.VML);de(e,551,io("rId"+i)),t["!legacy"]=i}}function ov(e,t,r,n){if(t["!autofilter"]){var i=t["!autofilter"],s=typeof i.ref=="string"?i.ref:jt(i.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var a=r.Workbook.Names,o=Sr(s);o.s.r==o.e.r&&(o.e.r=Sr(t["!ref"]).e.r,s=jt(o));for(var f=0;f<a.length;++f){var u=a[f];if(u.Name=="_xlnm._FilterDatabase"&&u.Sheet==n){u.Ref="'"+r.SheetNames[n]+"'!"+s;break}}f==a.length&&a.push({Name:"_xlnm._FilterDatabase",Sheet:n,Ref:"'"+r.SheetNames[n]+"'!"+s}),de(e,161,Qn(wt(s))),de(e,162)}}function lv(e,t,r){de(e,133),de(e,137,Kx(t,r)),de(e,138),de(e,134)}function cv(e,t){t["!protect"]&&de(e,535,Jx(t["!protect"]))}function uv(e,t,r,n){var i=fr(),s=r.SheetNames[e],a=r.Sheets[s]||{},o=s;try{r&&r.Workbook&&(o=r.Workbook.Sheets[e].CodeName||o)}catch{}var f=wt(a["!ref"]||"A1");if(f.e.c>16383||f.e.r>1048575){if(t.WTF)throw new Error("Range "+(a["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");f.e.c=Math.min(f.e.c,16383),f.e.r=Math.min(f.e.c,1048575)}return a["!links"]=[],a["!comments"]=[],de(i,129),(r.vbaraw||a["!outline"])&&de(i,147,nx(o,a["!outline"])),de(i,148,ex(f)),lv(i,a,r.Workbook),nv(i,a),tv(i,a,e,t),cv(i,a),ov(i,a,r,e),rv(i,a),sv(i,a,n),a["!margins"]&&de(i,476,Yx(a["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&iv(i,a),av(i,a,e,n),de(i,130),i.end()}function fv(e,t){e.l+=10;var r=nr(e);return{name:r}}var dv=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]];function hv(e){return!e.Workbook||!e.Workbook.WBProps?"false":zh(e.Workbook.WBProps.date1904)?"true":"false"}var pv="][*?/\\".split("");function _u(e,t){if(e.length>31)throw new Error("Sheet names cannot exceed 31 chars");var r=!0;return pv.forEach(function(n){if(e.indexOf(n)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),r}function gv(e,t,r){e.forEach(function(n,i){_u(n);for(var s=0;s<i;++s)if(n==e[s])throw new Error("Duplicate Sheet Name: "+n);if(r){var a=t&&t[i]&&t[i].CodeName||n;if(a.charCodeAt(0)==95&&a.length>22)throw new Error("Bad Code Name: Worksheet"+a)}})}function mv(e){if(!e||!e.SheetNames||!e.Sheets)throw new Error("Invalid Workbook");if(!e.SheetNames.length)throw new Error("Workbook is empty");var t=e.Workbook&&e.Workbook.Sheets||[];gv(e.SheetNames,t,!!e.vbaraw);for(var r=0;r<e.SheetNames.length;++r)Lm(e.Sheets[e.SheetNames[r]],e.SheetNames[r],r)}function bu(e){var t=[Mt];t[t.length]=xe("workbook",null,{xmlns:Jn[0],"xmlns:r":Wt.r});var r=e.Workbook&&(e.Workbook.Names||[]).length>0,n={codeName:"ThisWorkbook"};e.Workbook&&e.Workbook.WBProps&&(dv.forEach(function(o){e.Workbook.WBProps[o[0]]!=null&&e.Workbook.WBProps[o[0]]!=o[1]&&(n[o[0]]=e.Workbook.WBProps[o[0]])}),e.Workbook.WBProps.CodeName&&(n.codeName=e.Workbook.WBProps.CodeName,delete n.CodeName)),t[t.length]=xe("workbookPr",null,n);var i=e.Workbook&&e.Workbook.Sheets||[],s=0;if(i&&i[0]&&i[0].Hidden){for(t[t.length]="<bookViews>",s=0;s!=e.SheetNames.length&&!(!i[s]||!i[s].Hidden);++s);s==e.SheetNames.length&&(s=0),t[t.length]='<workbookView firstSheet="'+s+'" activeTab="'+s+'"/>',t[t.length]="</bookViews>"}for(t[t.length]="<sheets>",s=0;s!=e.SheetNames.length;++s){var a={name:lt(e.SheetNames[s].slice(0,31))};if(a.sheetId=""+(s+1),a["r:id"]="rId"+(s+1),i[s])switch(i[s].Hidden){case 1:a.state="hidden";break;case 2:a.state="veryHidden";break}t[t.length]=xe("sheet",null,a)}return t[t.length]="</sheets>",r&&(t[t.length]="<definedNames>",e.Workbook&&e.Workbook.Names&&e.Workbook.Names.forEach(function(o){var f={name:o.Name};o.Comment&&(f.comment=o.Comment),o.Sheet!=null&&(f.localSheetId=""+o.Sheet),o.Hidden&&(f.hidden="1"),o.Ref&&(t[t.length]=xe("definedName",lt(o.Ref),f))}),t[t.length]="</definedNames>"),t.length>2&&(t[t.length]="</workbook>",t[1]=t[1].replace("/>",">")),t.join("")}function xv(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=Oa(e),r.name=nr(e),r}function vv(e,t){return t||(t=re(127)),t.write_shift(4,e.Hidden),t.write_shift(4,e.iTabID),io(e.strRelID,t),zt(e.name.slice(0,31),t),t.length>t.l?t.slice(0,t.l):t}function yv(e,t){var r={},n=e.read_shift(4);r.defaultThemeVersion=e.read_shift(4);var i=t>8?nr(e):"";return i.length>0&&(r.CodeName=i),r.autoCompressPictures=!!(n&65536),r.backupFile=!!(n&64),r.checkCompatibility=!!(n&4096),r.date1904=!!(n&1),r.filterPrivacy=!!(n&8),r.hidePivotFieldList=!!(n&1024),r.promptedSolutions=!!(n&16),r.publishItems=!!(n&2048),r.refreshAllConnections=!!(n&262144),r.saveExternalLinkValues=!!(n&128),r.showBorderUnselectedTables=!!(n&4),r.showInkAnnotation=!!(n&32),r.showObjects=["all","placeholders","none"][n>>13&3],r.showPivotChartFilter=!!(n&32768),r.updateLinks=["userSet","never","always"][n>>8&3],r}function wv(e,t){t||(t=re(72));var r=0;return e&&e.filterPrivacy&&(r|=8),t.write_shift(4,r),t.write_shift(4,0),M0(e&&e.CodeName||"ThisWorkbook",t),t.slice(0,t.l)}function Tv(e,t,r){var n=e.l+t;e.l+=4,e.l+=1;var i=e.read_shift(4),s=hp(e),a=Fm(e,0,r),o=no(e);e.l=n;var f={Name:s,Ptg:a};return i<268435455&&(f.Sheet=i),o&&(f.Comment=o),f}function Sv(e,t){de(e,143);for(var r=0;r!=t.SheetNames.length;++r){var n=t.Workbook&&t.Workbook.Sheets&&t.Workbook.Sheets[r]&&t.Workbook.Sheets[r].Hidden||0,i={Hidden:n,iTabID:r+1,strRelID:"rId"+(r+1),name:t.SheetNames[r]};de(e,156,vv(i))}de(e,144)}function Ev(e,t){t||(t=re(127));for(var r=0;r!=4;++r)t.write_shift(4,0);return zt("SheetJS",t),zt(is.version,t),zt(is.version,t),zt("7262",t),t.length>t.l?t.slice(0,t.l):t}function _v(e,t){t||(t=re(29)),t.write_shift(-4,0),t.write_shift(-4,460),t.write_shift(4,28800),t.write_shift(4,17600),t.write_shift(4,500),t.write_shift(4,e),t.write_shift(4,e);var r=120;return t.write_shift(1,r),t.length>t.l?t.slice(0,t.l):t}function bv(e,t){if(!(!t.Workbook||!t.Workbook.Sheets)){for(var r=t.Workbook.Sheets,n=0,i=-1,s=-1;n<r.length;++n)!r[n]||!r[n].Hidden&&i==-1?i=n:r[n].Hidden==1&&s==-1&&(s=n);s>i||(de(e,135),de(e,158,_v(i)),de(e,136))}}function Cv(e,t){var r=fr();return de(r,131),de(r,128,Ev()),de(r,153,wv(e.Workbook&&e.Workbook.WBProps||null)),bv(r,e),Sv(r,e),de(r,132),r.end()}function Av(e,t,r){return(t.slice(-4)===".bin"?Cv:bu)(e)}function Ov(e,t,r,n,i){return(t.slice(-4)===".bin"?uv:Su)(e,r,n,i)}function Dv(e,t,r){return(t.slice(-4)===".bin"?Yg:ou)(e,r)}function kv(e,t,r){return(t.slice(-4)===".bin"?wg:nu)(e,r)}function Iv(e,t,r){return(t.slice(-4)===".bin"?c1:du)(e)}function Fv(e){return(e.slice(-4)===".bin"?t1:uu)()}function Nv(e,t){var r=[];return e.Props&&r.push(Dp(e.Props,t)),e.Custprops&&r.push(kp(e.Props,e.Custprops)),r.join("")}function Rv(){return""}function Pv(e,t){var r=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return t.cellXfs.forEach(function(n,i){var s=[];s.push(xe("NumberFormat",null,{"ss:Format":lt(Dt[n.numFmtId])}));var a={"ss:ID":"s"+(21+i)};r.push(xe("Style",s.join(""),a))}),xe("Styles",r.join(""))}function Cu(e){return xe("NamedRange",null,{"ss:Name":e.Name,"ss:RefersTo":"="+lo(e.Ref,{r:0,c:0})})}function jv(e){if(!((e||{}).Workbook||{}).Names)return"";for(var t=e.Workbook.Names,r=[],n=0;n<t.length;++n){var i=t[n];i.Sheet==null&&(i.Name.match(/^_xlfn\./)||r.push(Cu(i)))}return xe("Names",r.join(""))}function Mv(e,t,r,n){if(!e||!((n||{}).Workbook||{}).Names)return"";for(var i=n.Workbook.Names,s=[],a=0;a<i.length;++a){var o=i[a];o.Sheet==r&&(o.Name.match(/^_xlfn\./)||s.push(Cu(o)))}return s.join("")}function Lv(e,t,r,n){if(!e)return"";var i=[];if(e["!margins"]&&(i.push("<PageSetup>"),e["!margins"].header&&i.push(xe("Header",null,{"x:Margin":e["!margins"].header})),e["!margins"].footer&&i.push(xe("Footer",null,{"x:Margin":e["!margins"].footer})),i.push(xe("PageMargins",null,{"x:Bottom":e["!margins"].bottom||"0.75","x:Left":e["!margins"].left||"0.7","x:Right":e["!margins"].right||"0.7","x:Top":e["!margins"].top||"0.75"})),i.push("</PageSetup>")),n&&n.Workbook&&n.Workbook.Sheets&&n.Workbook.Sheets[r])if(n.Workbook.Sheets[r].Hidden)i.push(xe("Visible",n.Workbook.Sheets[r].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var s=0;s<r&&!(n.Workbook.Sheets[s]&&!n.Workbook.Sheets[s].Hidden);++s);s==r&&i.push("<Selected/>")}return((((n||{}).Workbook||{}).Views||[])[0]||{}).RTL&&i.push("<DisplayRightToLeft/>"),e["!protect"]&&(i.push(Zt("ProtectContents","True")),e["!protect"].objects&&i.push(Zt("ProtectObjects","True")),e["!protect"].scenarios&&i.push(Zt("ProtectScenarios","True")),e["!protect"].selectLockedCells!=null&&!e["!protect"].selectLockedCells?i.push(Zt("EnableSelection","NoSelection")):e["!protect"].selectUnlockedCells!=null&&!e["!protect"].selectUnlockedCells&&i.push(Zt("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(a){e["!protect"][a[0]]&&i.push("<"+a[1]+"/>")})),i.length==0?"":xe("WorksheetOptions",i.join(""),{xmlns:vr.x})}function Bv(e){return e.map(function(t){var r=Vh(t.t||""),n=xe("ss:Data",r,{xmlns:"http://www.w3.org/TR/REC-html40"});return xe("Comment",n,{"ss:Author":t.a})}).join("")}function $v(e,t,r,n,i,s,a){if(!e||e.v==null&&e.f==null)return"";var o={};if(e.f&&(o["ss:Formula"]="="+lt(lo(e.f,a))),e.F&&e.F.slice(0,t.length)==t){var f=Vt(e.F.slice(t.length+1));o["ss:ArrayRange"]="RC:R"+(f.r==a.r?"":"["+(f.r-a.r)+"]")+"C"+(f.c==a.c?"":"["+(f.c-a.c)+"]")}if(e.l&&e.l.Target&&(o["ss:HRef"]=lt(e.l.Target),e.l.Tooltip&&(o["x:HRefScreenTip"]=lt(e.l.Tooltip))),r["!merges"])for(var u=r["!merges"],d=0;d!=u.length;++d)u[d].s.c!=a.c||u[d].s.r!=a.r||(u[d].e.c>u[d].s.c&&(o["ss:MergeAcross"]=u[d].e.c-u[d].s.c),u[d].e.r>u[d].s.r&&(o["ss:MergeDown"]=u[d].e.r-u[d].s.r));var h="",m="";switch(e.t){case"z":if(!n.sheetStubs)return"";break;case"n":h="Number",m=String(e.v);break;case"b":h="Boolean",m=e.v?"1":"0";break;case"e":h="Error",m=Ii[e.v];break;case"d":h="DateTime",m=new Date(e.v).toISOString(),e.z==null&&(e.z=e.z||Dt[14]);break;case"s":h="String",m=Wh(e.v||"");break}var l=un(n.cellXfs,e,n);o["ss:StyleID"]="s"+(21+l),o["ss:Index"]=a.c+1;var v=e.v!=null?m:"",g=e.t=="z"?"":'<Data ss:Type="'+h+'">'+v+"</Data>";return(e.c||[]).length>0&&(g+=Bv(e.c)),xe("Cell",g,o)}function Uv(e,t){var r='<Row ss:Index="'+(e+1)+'"';return t&&(t.hpt&&!t.hpx&&(t.hpx=au(t.hpt)),t.hpx&&(r+=' ss:AutoFitHeight="0" ss:Height="'+t.hpx+'"'),t.hidden&&(r+=' ss:Hidden="1"')),r+">"}function Wv(e,t,r,n){if(!e["!ref"])return"";var i=wt(e["!ref"]),s=e["!merges"]||[],a=0,o=[];e["!cols"]&&e["!cols"].forEach(function(x,T){ao(x);var b=!!x.width,_=ks(T,x),k={"ss:Index":T+1};b&&(k["ss:Width"]=ps(_.width)),x.hidden&&(k["ss:Hidden"]="1"),o.push(xe("Column",null,k))});for(var f=Array.isArray(e),u=i.s.r;u<=i.e.r;++u){for(var d=[Uv(u,(e["!rows"]||[])[u])],h=i.s.c;h<=i.e.c;++h){var m=!1;for(a=0;a!=s.length;++a)if(!(s[a].s.c>h)&&!(s[a].s.r>u)&&!(s[a].e.c<h)&&!(s[a].e.r<u)){(s[a].s.c!=h||s[a].s.r!=u)&&(m=!0);break}if(!m){var l={r:u,c:h},v=ct(l),g=f?(e[u]||[])[h]:e[v];d.push($v(g,v,e,t,r,n,l))}}d.push("</Row>"),d.length>2&&o.push(d.join(""))}return o.join("")}function Vv(e,t,r){var n=[],i=r.SheetNames[e],s=r.Sheets[i],a=s?Mv(s,t,e,r):"";return a.length>0&&n.push("<Names>"+a+"</Names>"),a=s?Wv(s,t,e,r):"",a.length>0&&n.push("<Table>"+a+"</Table>"),n.push(Lv(s,t,e,r)),n.join("")}function zv(e,t){t||(t={}),e.SSF||(e.SSF=hr(Dt)),e.SSF&&(bs(),_s(e.SSF),t.revssf=Cs(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF,t.cellXfs=[],un(t.cellXfs,{},{revssf:{General:0}}));var r=[];r.push(Nv(e,t)),r.push(Rv()),r.push(""),r.push("");for(var n=0;n<e.SheetNames.length;++n)r.push(xe("Worksheet",Vv(n,t,e),{"ss:Name":lt(e.SheetNames[n])}));return r[2]=Pv(e,t),r[3]=jv(e),Mt+xe("Workbook",r.join(""),{xmlns:vr.ss,"xmlns:o":vr.o,"xmlns:x":vr.x,"xmlns:ss":vr.ss,"xmlns:dt":vr.dt,"xmlns:html":vr.html})}var sa={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function Hv(e,t){var r=[],n=[],i=[],s=0,a,o=il(xl,"n"),f=il(vl,"n");if(e.Props)for(a=er(e.Props),s=0;s<a.length;++s)(Object.prototype.hasOwnProperty.call(o,a[s])?r:Object.prototype.hasOwnProperty.call(f,a[s])?n:i).push([a[s],e.Props[a[s]]]);if(e.Custprops)for(a=er(e.Custprops),s=0;s<a.length;++s)Object.prototype.hasOwnProperty.call(e.Props||{},a[s])||(Object.prototype.hasOwnProperty.call(o,a[s])?r:Object.prototype.hasOwnProperty.call(f,a[s])?n:i).push([a[s],e.Custprops[a[s]]]);var u=[];for(s=0;s<i.length;++s)q0.indexOf(i[s][0])>-1||Y0.indexOf(i[s][0])>-1||i[s][1]!=null&&u.push(i[s]);n.length&&ht.utils.cfb_add(t,"/SummaryInformation",El(n,sa.SI,f,vl)),(r.length||u.length)&&ht.utils.cfb_add(t,"/DocumentSummaryInformation",El(r,sa.DSI,o,xl,u.length?u:null,sa.UDI))}function Gv(e,t){var r=t||{},n=ht.utils.cfb_new({root:"R"}),i="/Workbook";switch(r.bookType||"xls"){case"xls":r.bookType="biff8";case"xla":r.bookType||(r.bookType="xla");case"biff8":i="/Workbook",r.biff=8;break;case"biff5":i="/Book",r.biff=5;break;default:throw new Error("invalid type "+r.bookType+" for XLS CFB")}return ht.utils.cfb_add(n,i,Au(e,r)),r.biff==8&&(e.Props||e.Custprops)&&Hv(e,n),r.biff==8&&e.vbaraw&&u1(n,ht.read(e.vbaraw,{type:typeof e.vbaraw=="string"?"binary":"buffer"})),n}var Yv={0:{f:qm},1:{f:ix},2:{f:_x},3:{f:dx},4:{f:lx},5:{f:wx},6:{f:Dx},7:{f:mx},8:{f:jx},9:{f:Px},10:{f:Nx},11:{f:Rx},12:{f:ax},13:{f:Cx},14:{f:px},15:{f:ux},16:{f:Sx},17:{f:Ix},18:{f:vx},19:{f:ro},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:Tv},40:{},42:{},43:{f:Dg},44:{f:Ag},45:{f:Fg},46:{f:Rg},47:{f:Ng},48:{},49:{f:ap},50:{},51:{f:qg},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:og},62:{f:Ox},63:{f:r1},64:{f:Zx},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:Wr,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:Xx},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:rx},148:{f:Qm,p:16},151:{f:Wx},152:{},153:{f:yv},154:{},155:{},156:{f:xv},157:{},158:{},159:{T:1,f:xg},160:{T:-1},161:{T:1,f:Dn},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:Mx},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:Xg},336:{T:-1},337:{f:Qg,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:Oa},357:{},358:{},359:{},360:{T:1},361:{},362:{f:tg},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:Vx},427:{f:zx},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:Gx},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:tx},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:$x},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:Oa},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:o1},633:{T:1},634:{T:-1},635:{T:1,f:s1},636:{T:-1},637:{f:up},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:fv},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:Qx},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}};function ve(e,t,r,n){var i=t;if(!isNaN(i)){var s=n||(r||[]).length||0,a=e.next(4);a.write_shift(2,i),a.write_shift(2,s),s>0&&Qa(r)&&e.push(r)}}function Xv(e,t,r,n){var i=(r||[]).length||0;if(i<=8224)return ve(e,t,r,i);var s=t;if(!isNaN(s)){for(var a=r.parts||[],o=0,f=0,u=0;u+(a[o]||8224)<=8224;)u+=a[o]||8224,o++;var d=e.next(4);for(d.write_shift(2,s),d.write_shift(2,u),e.push(r.slice(f,f+u)),f+=u;f<i;){for(d=e.next(4),d.write_shift(2,60),u=0;u+(a[o]||8224)<=8224;)u+=a[o]||8224,o++;d.write_shift(2,u),e.push(r.slice(f,f+u)),f+=u}}}function Ni(e,t,r){return e||(e=re(7)),e.write_shift(2,t),e.write_shift(2,r),e.write_shift(2,0),e.write_shift(1,0),e}function Kv(e,t,r,n){var i=re(9);return Ni(i,e,t),Z0(r,n||"b",i),i}function qv(e,t,r){var n=re(8+2*r.length);return Ni(n,e,t),n.write_shift(1,r.length),n.write_shift(r.length,r,"sbcs"),n.l<n.length?n.slice(0,n.l):n}function Jv(e,t,r,n){if(t.v!=null)switch(t.t){case"d":case"n":var i=t.t=="d"?dr(lr(t.v)):t.v;i==(i|0)&&i>=0&&i<65536?ve(e,2,fg(r,n,i)):ve(e,3,ug(r,n,i));return;case"b":case"e":ve(e,5,Kv(r,n,t.v,t.t));return;case"s":case"str":ve(e,4,qv(r,n,(t.v||"").slice(0,255)));return}ve(e,1,Ni(null,r,n))}function Zv(e,t,r,n){var i=Array.isArray(t),s=wt(t["!ref"]||"A1"),a,o="",f=[];if(s.e.c>255||s.e.r>16383){if(n.WTF)throw new Error("Range "+(t["!ref"]||"A1")+" exceeds format limit A1:IV16384");s.e.c=Math.min(s.e.c,255),s.e.r=Math.min(s.e.c,16383),a=jt(s)}for(var u=s.s.r;u<=s.e.r;++u){o=Qt(u);for(var d=s.s.c;d<=s.e.c;++d){u===s.s.r&&(f[d]=rr(d)),a=f[d]+o;var h=i?(t[u]||[])[d]:t[a];h&&Jv(e,h,u,d)}}}function Qv(e,t){for(var r=t||{},n=fr(),i=0,s=0;s<e.SheetNames.length;++s)e.SheetNames[s]==r.sheet&&(i=s);if(i==0&&r.sheet&&e.SheetNames[0]!=r.sheet)throw new Error("Sheet not found: "+r.sheet);return ve(n,r.biff==4?1033:r.biff==3?521:9,so(e,16,r)),Zv(n,e.Sheets[e.SheetNames[i]],i,r),ve(n,10),n.end()}function ey(e,t,r){ve(e,49,Yp({sz:12,name:"Arial"},r))}function ty(e,t,r){t&&[[5,8],[23,26],[41,44],[50,392]].forEach(function(n){for(var i=n[0];i<=n[1];++i)t[i]!=null&&ve(e,1054,qp(i,t[i],r))})}function ry(e,t){var r=re(19);r.write_shift(4,2151),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,1),r.write_shift(4,0),ve(e,2151,r),r=re(39),r.write_shift(4,2152),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,0),r.write_shift(4,0),r.write_shift(2,1),r.write_shift(4,4),r.write_shift(2,0),tu(wt(t["!ref"]||"A1"),r),r.write_shift(4,4),ve(e,2152,r)}function ny(e,t){for(var r=0;r<16;++r)ve(e,224,bl({numFmtId:0,style:!0},0,t));t.cellXfs.forEach(function(n){ve(e,224,bl(n,0,t))})}function iy(e,t){for(var r=0;r<t["!links"].length;++r){var n=t["!links"][r];ve(e,440,ig(n)),n[1].Tooltip&&ve(e,2048,sg(n))}delete t["!links"]}function sy(e,t){if(t){var r=0;t.forEach(function(n,i){++r<=256&&n&&ve(e,125,lg(ks(i,n),i))})}}function ay(e,t,r,n,i){var s=16+un(i.cellXfs,t,i);if(t.v==null&&!t.bf){ve(e,513,Tn(r,n,s));return}if(t.bf)ve(e,6,km(t,r,n,i,s));else switch(t.t){case"d":case"n":var a=t.t=="d"?dr(lr(t.v)):t.v;ve(e,515,eg(r,n,a,s));break;case"b":case"e":ve(e,517,Qp(r,n,t.v,s,i,t.t));break;case"s":case"str":if(i.bookSST){var o=uo(i.Strings,t.v,i.revStrings);ve(e,253,Xp(r,n,o,s))}else ve(e,516,Kp(r,n,(t.v||"").slice(0,255),s,i));break;default:ve(e,513,Tn(r,n,s))}}function oy(e,t,r){var n=fr(),i=r.SheetNames[e],s=r.Sheets[i]||{},a=(r||{}).Workbook||{},o=(a.Sheets||[])[e]||{},f=Array.isArray(s),u=t.biff==8,d,h="",m=[],l=wt(s["!ref"]||"A1"),v=u?65536:16384;if(l.e.c>255||l.e.r>=v){if(t.WTF)throw new Error("Range "+(s["!ref"]||"A1")+" exceeds format limit A1:IV16384");l.e.c=Math.min(l.e.c,255),l.e.r=Math.min(l.e.c,v-1)}ve(n,2057,so(r,16,t)),ve(n,13,br(1)),ve(n,12,br(100)),ve(n,15,or(!0)),ve(n,17,or(!1)),ve(n,16,wn(.001)),ve(n,95,or(!0)),ve(n,42,or(!1)),ve(n,43,or(!1)),ve(n,130,br(1)),ve(n,128,Zp()),ve(n,131,or(!1)),ve(n,132,or(!1)),u&&sy(n,s["!cols"]),ve(n,512,Jp(l,t)),u&&(s["!links"]=[]);for(var g=l.s.r;g<=l.e.r;++g){h=Qt(g);for(var x=l.s.c;x<=l.e.c;++x){g===l.s.r&&(m[x]=rr(x)),d=m[x]+h;var T=f?(s[g]||[])[x]:s[d];T&&(ay(n,T,g,x,t),u&&T.l&&s["!links"].push([d,T.l]))}}var b=o.CodeName||o.name||i;return u&&ve(n,574,Gp((a.Views||[])[0])),u&&(s["!merges"]||[]).length&&ve(n,229,ng(s["!merges"])),u&&iy(n,s),ve(n,442,eu(b)),u&&ry(n,s),ve(n,10),n.end()}function ly(e,t,r){var n=fr(),i=(e||{}).Workbook||{},s=i.Sheets||[],a=i.WBProps||{},o=r.biff==8,f=r.biff==5;if(ve(n,2057,so(e,5,r)),r.bookType=="xla"&&ve(n,135),ve(n,225,o?br(1200):null),ve(n,193,Np(2)),f&&ve(n,191),f&&ve(n,192),ve(n,226),ve(n,92,Wp("SheetJS",r)),ve(n,66,br(o?1200:1252)),o&&ve(n,353,br(0)),o&&ve(n,448),ve(n,317,cg(e.SheetNames.length)),o&&e.vbaraw&&ve(n,211),o&&e.vbaraw){var u=a.CodeName||"ThisWorkbook";ve(n,442,eu(u))}ve(n,156,br(17)),ve(n,25,or(!1)),ve(n,18,or(!1)),ve(n,19,br(0)),o&&ve(n,431,or(!1)),o&&ve(n,444,br(0)),ve(n,61,Hp()),ve(n,64,or(!1)),ve(n,141,br(0)),ve(n,34,or(hv(e)=="true")),ve(n,14,or(!0)),o&&ve(n,439,or(!1)),ve(n,218,br(0)),ey(n,e,r),ty(n,e.SSF,r),ny(n,r),o&&ve(n,352,or(!1));var d=n.end(),h=fr();o&&ve(h,140,ag()),o&&r.Strings&&Xv(h,252,zp(r.Strings)),ve(h,10);var m=h.end(),l=fr(),v=0,g=0;for(g=0;g<e.SheetNames.length;++g)v+=(o?12:11)+(o?2:1)*e.SheetNames[g].length;var x=d.length+v+m.length;for(g=0;g<e.SheetNames.length;++g){var T=s[g]||{};ve(l,133,Vp({pos:x,hs:T.Hidden||0,dt:0,name:e.SheetNames[g]},r)),x+=t[g].length}var b=l.end();if(v!=b.length)throw new Error("BS8 "+v+" != "+b.length);var _=[];return d.length&&_.push(d),b.length&&_.push(b),m.length&&_.push(m),Jt(_)}function cy(e,t){var r=t||{},n=[];e&&!e.SSF&&(e.SSF=hr(Dt)),e&&e.SSF&&(bs(),_s(e.SSF),r.revssf=Cs(e.SSF),r.revssf[e.SSF[65535]]=0,r.ssf=e.SSF),r.Strings=[],r.Strings.Count=0,r.Strings.Unique=0,fo(r),r.cellXfs=[],un(r.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={});for(var i=0;i<e.SheetNames.length;++i)n[n.length]=oy(i,r,e);return n.unshift(ly(e,n,r)),Jt(n)}function Au(e,t){for(var r=0;r<=e.SheetNames.length;++r){var n=e.Sheets[e.SheetNames[r]];if(!(!n||!n["!ref"])){var i=Sr(n["!ref"]);i.e.c>255&&typeof console<"u"&&console.error&&console.error("Worksheet '"+e.SheetNames[r]+"' extends beyond column IV (255). Data may be lost.")}}var s=t||{};switch(s.biff||2){case 8:case 5:return cy(e,t);case 4:case 3:case 2:return Qv(e,t)}throw new Error("invalid type "+s.bookType+" for BIFF")}function uy(e,t,r,n){for(var i=e["!merges"]||[],s=[],a=t.s.c;a<=t.e.c;++a){for(var o=0,f=0,u=0;u<i.length;++u)if(!(i[u].s.r>r||i[u].s.c>a)&&!(i[u].e.r<r||i[u].e.c<a)){if(i[u].s.r<r||i[u].s.c<a){o=-1;break}o=i[u].e.r-i[u].s.r+1,f=i[u].e.c-i[u].s.c+1;break}if(!(o<0)){var d=ct({r,c:a}),h=n.dense?(e[r]||[])[a]:e[d],m=h&&h.v!=null&&(h.h||Uh(h.w||(qr(h),h.w)||""))||"",l={};o>1&&(l.rowspan=o),f>1&&(l.colspan=f),n.editable?m='<span contenteditable="true">'+m+"</span>":h&&(l["data-t"]=h&&h.t||"z",h.v!=null&&(l["data-v"]=h.v),h.z!=null&&(l["data-z"]=h.z),h.l&&(h.l.Target||"#").charAt(0)!="#"&&(m='<a href="'+h.l.Target+'">'+m+"</a>")),l.id=(n.id||"sjs")+"-"+d,s.push(xe("td",m,l))}}var v="<tr>";return v+s.join("")+"</tr>"}var fy='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',dy="</body></html>";function hy(e,t,r){var n=[];return n.join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function Ou(e,t){var r=t||{},n=r.header!=null?r.header:fy,i=r.footer!=null?r.footer:dy,s=[n],a=Sr(e["!ref"]);r.dense=Array.isArray(e),s.push(hy(e,a,r));for(var o=a.s.r;o<=a.e.r;++o)s.push(uy(e,a,o,r));return s.push("</table>"+i),s.join("")}function Du(e,t,r){var n=r||{},i=0,s=0;if(n.origin!=null)if(typeof n.origin=="number")i=n.origin;else{var a=typeof n.origin=="string"?Vt(n.origin):n.origin;i=a.r,s=a.c}var o=t.getElementsByTagName("tr"),f=Math.min(n.sheetRows||1e7,o.length),u={s:{r:0,c:0},e:{r:i,c:s}};if(e["!ref"]){var d=Sr(e["!ref"]);u.s.r=Math.min(u.s.r,d.s.r),u.s.c=Math.min(u.s.c,d.s.c),u.e.r=Math.max(u.e.r,d.e.r),u.e.c=Math.max(u.e.c,d.e.c),i==-1&&(u.e.r=i=d.e.r+1)}var h=[],m=0,l=e["!rows"]||(e["!rows"]=[]),v=0,g=0,x=0,T=0,b=0,_=0;for(e["!cols"]||(e["!cols"]=[]);v<o.length&&g<f;++v){var k=o[v];if(Fl(k)){if(n.display)continue;l[g]={hidden:!0}}var F=k.children;for(x=T=0;x<F.length;++x){var z=F[x];if(!(n.display&&Fl(z))){var N=z.hasAttribute("data-v")?z.getAttribute("data-v"):z.hasAttribute("v")?z.getAttribute("v"):Hh(z.innerHTML),B=z.getAttribute("data-z")||z.getAttribute("z");for(m=0;m<h.length;++m){var M=h[m];M.s.c==T+s&&M.s.r<g+i&&g+i<=M.e.r&&(T=M.e.c+1-s,m=-1)}_=+z.getAttribute("colspan")||1,((b=+z.getAttribute("rowspan")||1)>1||_>1)&&h.push({s:{r:g+i,c:T+s},e:{r:g+i+(b||1)-1,c:T+s+(_||1)-1}});var L={t:"s",v:N},W=z.getAttribute("data-t")||z.getAttribute("t")||"";N!=null&&(N.length==0?L.t=W||"z":n.raw||N.trim().length==0||W=="s"||(N==="TRUE"?L={t:"b",v:!0}:N==="FALSE"?L={t:"b",v:!1}:isNaN(Yr(N))?isNaN(wi(N).getDate())||(L={t:"d",v:lr(N)},n.cellDates||(L={t:"n",v:dr(L.v)}),L.z=n.dateNF||Dt[14]):L={t:"n",v:Yr(N)})),L.z===void 0&&B!=null&&(L.z=B);var y="",H=z.getElementsByTagName("A");if(H&&H.length)for(var Q=0;Q<H.length&&!(H[Q].hasAttribute("href")&&(y=H[Q].getAttribute("href"),y.charAt(0)!="#"));++Q);y&&y.charAt(0)!="#"&&(L.l={Target:y}),n.dense?(e[g+i]||(e[g+i]=[]),e[g+i][T+s]=L):e[ct({c:T+s,r:g+i})]=L,u.e.c<T+s&&(u.e.c=T+s),T+=_}}++g}return h.length&&(e["!merges"]=(e["!merges"]||[]).concat(h)),u.e.r=Math.max(u.e.r,g-1+i),e["!ref"]=jt(u),g>=f&&(e["!fullref"]=jt((u.e.r=o.length-v+g-1+i,u))),e}function ku(e,t){var r=t||{},n=r.dense?[]:{};return Du(n,e,t)}function py(e,t){return bn(ku(e,t),t)}function Fl(e){var t="",r=gy(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),t==="none"}function gy(e){return e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle=="function"?e.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}var my=(function(){var e=["<office:master-styles>",'<style:master-page style:name="mp1" style:page-layout-name="mp1">',"<style:header/>",'<style:header-left style:display="false"/>',"<style:footer/>",'<style:footer-left style:display="false"/>',"</style:master-page>","</office:master-styles>"].join(""),t="<office:document-styles "+Si({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","office:version":"1.2"})+">"+e+"</office:document-styles>";return function(){return Mt+t}})(),Nl=(function(){var e=function(s){return lt(s).replace(/ +/g,function(a){return'<text:s text:c="'+a.length+'"/>'}).replace(/\t/g,"<text:tab/>").replace(/\n/g,"</text:p><text:p>").replace(/^ /,"<text:s/>").replace(/ $/,"<text:s/>")},t=` <table:table-cell />
|
|
57
|
+
`,c=1;c<s.length;++c)a+=`Reply:
|
|
58
|
+
`+s[c]+`
|
|
59
|
+
`;t.push(kt("t",Ze(a)))}t.push("</text></comment>")}),t.push("</commentList>"),t.length>2&&(t[t.length]="</comments>",t[1]=t[1].replace("/>",">")),t.join("")}function id(e,t,r){var n=[xt,ce("ThreadedComments",null,{xmlns:_t.TCMNT}).replace(/[\/]>/,">")];return e.forEach(function(i){var s="";(i[1]||[]).forEach(function(a,c){if(!a.T){delete a.ID;return}a.a&&t.indexOf(a.a)==-1&&t.push(a.a);var u={ref:i[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+r.tcid++).slice(-12)+"}"};c==0?s=u.id:u.parentId=s,a.ID=u.id,a.a&&(u.personId="{54EE7950-7262-4200-6969-"+("000000000000"+t.indexOf(a.a)).slice(-12)+"}"),n.push(ce("threadedComment",kt("text",a.t||""),u))})}),n.push("</ThreadedComments>"),n.join("")}function sd(e){var t=[xt,ce("personList",null,{xmlns:_t.TCMNT,"xmlns:x":vn[0]}).replace(/[\/]>/,">")];return e.forEach(function(r,n){t.push(ce("person",null,{displayName:r,id:"{54EE7950-7262-4200-6969-"+("000000000000"+n).slice(-12)+"}",userId:r,providerId:"None"}))}),t.push("</personList>"),t.join("")}function ad(e){var t={};t.iauthor=e.read_shift(4);var r=tn(e);return t.rfx=r.s,t.ref=Qe(r.s),e.l+=16,t}function od(e,t){return t==null&&(t=q(36)),t.write_shift(4,e[1].iauthor),wn(e[0],t),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t}var ld=Mt;function cd(e){return St(e.slice(0,54))}function fd(e){var t=Yt(),r=[];return te(t,628),te(t,630),e.forEach(function(n){n[1].forEach(function(i){r.indexOf(i.a)>-1||(r.push(i.a.slice(0,54)),te(t,632,cd(i.a)))})}),te(t,631),te(t,633),e.forEach(function(n){n[1].forEach(function(i){i.iauthor=r.indexOf(i.a);var s={s:Et(n[0]),e:Et(n[0])};te(t,635,od([s,i])),i.t&&i.t.length>0&&te(t,637,hu(i)),te(t,636),delete i.iauthor})}),te(t,634),te(t,629),t.end()}function ud(e,t){t.FullPaths.forEach(function(r,n){if(n!=0){var i=r.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");i.slice(-1)!=="/"&&et.utils.cfb_add(e,i,t.FileIndex[n].content)}})}var $l=["xlsb","xlsm","xlam","biff8","xla"],hd=(function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,t={r:0,c:0};function r(n,i,s,a){var c=!1,u=!1;s.length==0?u=!0:s.charAt(0)=="["&&(u=!0,s=s.slice(1,-1)),a.length==0?c=!0:a.charAt(0)=="["&&(c=!0,a=a.slice(1,-1));var f=s.length>0?parseInt(s,10)|0:0,d=a.length>0?parseInt(a,10)|0:0;return c?d+=t.c:--d,u?f+=t.r:--f,i+(c?"":"$")+jt(d)+(u?"":"$")+Ft(f)}return function(i,s){return t=s,i.replace(e,r)}})(),Rs=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,Ps=(function(){return function(t,r){return t.replace(Rs,function(n,i,s,a,c,u){var f=As(a)-(s?0:r.c),d=Ds(u)-(c?0:r.r),p=d==0?"":c?d+1:"["+d+"]",x=f==0?"":s?f+1:"["+f+"]";return i+"R"+p+"C"+x})}})();function dd(e,t){return e.replace(Rs,function(r,n,i,s,a,c){return n+(i=="$"?i+s:jt(As(s)+t.c))+(a=="$"?a+c:Ft(Ds(c)+t.r))})}function pd(e){return e.length!=1}function dt(e){e.l+=1}function Lr(e,t){var r=e.read_shift(2);return[r&16383,r>>14&1,r>>15&1]}function Gl(e,t,r){var n=2;if(r){if(r.biff>=2&&r.biff<=5)return Xl(e);r.biff==12&&(n=4)}var i=e.read_shift(n),s=e.read_shift(n),a=Lr(e),c=Lr(e);return{s:{r:i,c:a[0],cRel:a[1],rRel:a[2]},e:{r:s,c:c[0],cRel:c[1],rRel:c[2]}}}function Xl(e){var t=Lr(e),r=Lr(e),n=e.read_shift(1),i=e.read_shift(1);return{s:{r:t[0],c:n,cRel:t[1],rRel:t[2]},e:{r:r[0],c:i,cRel:r[1],rRel:r[2]}}}function xd(e,t,r){if(r.biff<8)return Xl(e);var n=e.read_shift(r.biff==12?4:2),i=e.read_shift(r.biff==12?4:2),s=Lr(e),a=Lr(e);return{s:{r:n,c:s[0],cRel:s[1],rRel:s[2]},e:{r:i,c:a[0],cRel:a[1],rRel:a[2]}}}function Yl(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return gd(e);var n=e.read_shift(r&&r.biff==12?4:2),i=Lr(e);return{r:n,c:i[0],cRel:i[1],rRel:i[2]}}function gd(e){var t=Lr(e),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function md(e){var t=e.read_shift(2),r=e.read_shift(2);return{r:t,c:r&255,fQuoted:!!(r&16384),cRel:r>>15,rRel:r>>15}}function vd(e,t,r){var n=r&&r.biff?r.biff:8;if(n>=2&&n<=5)return yd(e);var i=e.read_shift(n>=12?4:2),s=e.read_shift(2),a=(s&16384)>>14,c=(s&32768)>>15;if(s&=16383,c==1)for(;i>524287;)i-=1048576;if(a==1)for(;s>8191;)s=s-16384;return{r:i,c:s,cRel:a,rRel:c}}function yd(e){var t=e.read_shift(2),r=e.read_shift(1),n=(t&32768)>>15,i=(t&16384)>>14;return t&=16383,n==1&&t>=8192&&(t=t-16384),i==1&&r>=128&&(r=r-256),{r:t,c:r,cRel:i,rRel:n}}function wd(e,t,r){var n=(e[e.l++]&96)>>5,i=Gl(e,r.biff>=2&&r.biff<=5?6:8,r);return[n,i]}function Td(e,t,r){var n=(e[e.l++]&96)>>5,i=e.read_shift(2,"i"),s=8;if(r)switch(r.biff){case 5:e.l+=12,s=6;break;case 12:s=12;break}var a=Gl(e,s,r);return[n,i,a]}function _d(e,t,r){var n=(e[e.l++]&96)>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[n]}function Ed(e,t,r){var n=(e[e.l++]&96)>>5,i=e.read_shift(2),s=8;if(r)switch(r.biff){case 5:e.l+=12,s=6;break;case 12:s=12;break}return e.l+=s,[n,i]}function Sd(e,t,r){var n=(e[e.l++]&96)>>5,i=xd(e,t-1,r);return[n,i]}function Cd(e,t,r){var n=(e[e.l++]&96)>>5;return e.l+=r.biff==2?6:r.biff==12?14:7,[n]}function Va(e){var t=e[e.l+1]&1,r=1;return e.l+=4,[t,r]}function bd(e,t,r){e.l+=2;for(var n=e.read_shift(r&&r.biff==2?1:2),i=[],s=0;s<=n;++s)i.push(e.read_shift(r&&r.biff==2?1:2));return i}function Dd(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=2,[n,e.read_shift(r&&r.biff==2?1:2)]}function Ad(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=2,[n,e.read_shift(r&&r.biff==2?1:2)]}function Od(e){var t=e[e.l+1]&255?1:0;return e.l+=2,[t,e.read_shift(2)]}function kd(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=r&&r.biff==2?3:4,[n]}function Kl(e){var t=e.read_shift(1),r=e.read_shift(1);return[t,r]}function Fd(e){return e.read_shift(2),Kl(e)}function Id(e){return e.read_shift(2),Kl(e)}function Nd(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=Yl(e,0,r);return[n,i]}function Rd(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=vd(e,0,r);return[n,i]}function Pd(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=e.read_shift(2);r&&r.biff==5&&(e.l+=12);var s=Yl(e,0,r);return[n,i,s]}function jd(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=e.read_shift(r&&r.biff<=3?1:2);return[j1[i],Zl[i],n]}function Md(e,t,r){var n=e[e.l++],i=e.read_shift(1),s=r&&r.biff<=3?[n==88?-1:0,e.read_shift(1)]:Ld(e);return[i,(s[0]===0?Zl:P1)[s[1]]]}function Ld(e){return[e[e.l+1]>>7,e.read_shift(2)&32767]}function Bd(e,t,r){e.l+=r&&r.biff==2?3:4}function Ud(e,t,r){if(e.l++,r&&r.biff==12)return[e.read_shift(4,"i"),0];var n=e.read_shift(2),i=e.read_shift(r&&r.biff==2?1:2);return[n,i]}function Wd(e){return e.l++,Gn[e.read_shift(1)]}function Vd(e){return e.l++,e.read_shift(2)}function zd(e){return e.l++,e.read_shift(1)!==0}function Hd(e){return e.l++,Tn(e)}function $d(e,t,r){return e.l++,Fl(e,t-1,r)}function Gd(e,t){var r=[e.read_shift(1)];if(t==12)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2;break}switch(r[0]){case 4:r[1]=Pu(e,1)?"TRUE":"FALSE",t!=12&&(e.l+=7);break;case 37:case 16:r[1]=Gn[e[e.l]],e.l+=t==12?4:8;break;case 0:e.l+=8;break;case 1:r[1]=Tn(e);break;case 2:r[1]=Bu(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function Xd(e,t,r){for(var n=e.read_shift(r.biff==12?4:2),i=[],s=0;s!=n;++s)i.push((r.biff==12?tn:Vu)(e));return i}function Yd(e,t,r){var n=0,i=0;r.biff==12?(n=e.read_shift(4),i=e.read_shift(4)):(i=1+e.read_shift(1),n=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--n,--i==0&&(i=256));for(var s=0,a=[];s!=n&&(a[s]=[]);++s)for(var c=0;c!=i;++c)a[s][c]=Gd(e,r.biff);return a}function Kd(e,t,r){var n=e.read_shift(1)>>>5&3,i=!r||r.biff>=8?4:2,s=e.read_shift(i);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12;break}return[n,0,s]}function qd(e,t,r){if(r.biff==5)return Jd(e);var n=e.read_shift(1)>>>5&3,i=e.read_shift(2),s=e.read_shift(4);return[n,i,s]}function Jd(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var n=e.read_shift(2);return e.l+=12,[t,r,n]}function Zd(e,t,r){var n=e.read_shift(1)>>>5&3;e.l+=r&&r.biff==2?3:4;var i=e.read_shift(r&&r.biff==2?1:2);return[n,i]}function Qd(e,t,r){var n=e.read_shift(1)>>>5&3,i=e.read_shift(r&&r.biff==2?1:2);return[n,i]}function e1(e,t,r){var n=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,r.biff==12&&(e.l+=2),[n]}function t1(e,t,r){var n=(e[e.l++]&96)>>5,i=e.read_shift(2),s=4;if(r)switch(r.biff){case 5:s=15;break;case 12:s=6;break}return e.l+=s,[n,i]}var r1=Er,n1=Er,i1=Er;function Xn(e,t,r){return e.l+=2,[md(e)]}function js(e){return e.l+=6,[]}var s1=Xn,a1=js,o1=js,l1=Xn;function ql(e){return e.l+=2,[Ol(e),e.read_shift(2)&1]}var c1=Xn,f1=ql,u1=js,h1=Xn,d1=Xn,p1=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function x1(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),i=e.read_shift(2),s=e.read_shift(2),a=p1[r>>2&31];return{ixti:t,coltype:r&3,rt:a,idx:n,c:i,C:s}}function g1(e){return e.l+=2,[e.read_shift(4)]}function m1(e,t,r){return e.l+=5,e.l+=2,e.l+=r.biff==2?1:4,["PTGSHEET"]}function v1(e,t,r){return e.l+=r.biff==2?4:5,["PTGENDSHEET"]}function y1(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function w1(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function T1(e){return e.l+=4,[0,0]}var za={1:{n:"PtgExp",f:Ud},2:{n:"PtgTbl",f:i1},3:{n:"PtgAdd",f:dt},4:{n:"PtgSub",f:dt},5:{n:"PtgMul",f:dt},6:{n:"PtgDiv",f:dt},7:{n:"PtgPower",f:dt},8:{n:"PtgConcat",f:dt},9:{n:"PtgLt",f:dt},10:{n:"PtgLe",f:dt},11:{n:"PtgEq",f:dt},12:{n:"PtgGe",f:dt},13:{n:"PtgGt",f:dt},14:{n:"PtgNe",f:dt},15:{n:"PtgIsect",f:dt},16:{n:"PtgUnion",f:dt},17:{n:"PtgRange",f:dt},18:{n:"PtgUplus",f:dt},19:{n:"PtgUminus",f:dt},20:{n:"PtgPercent",f:dt},21:{n:"PtgParen",f:dt},22:{n:"PtgMissArg",f:dt},23:{n:"PtgStr",f:$d},26:{n:"PtgSheet",f:m1},27:{n:"PtgEndSheet",f:v1},28:{n:"PtgErr",f:Wd},29:{n:"PtgBool",f:zd},30:{n:"PtgInt",f:Vd},31:{n:"PtgNum",f:Hd},32:{n:"PtgArray",f:Cd},33:{n:"PtgFunc",f:jd},34:{n:"PtgFuncVar",f:Md},35:{n:"PtgName",f:Kd},36:{n:"PtgRef",f:Nd},37:{n:"PtgArea",f:wd},38:{n:"PtgMemArea",f:Zd},39:{n:"PtgMemErr",f:r1},40:{n:"PtgMemNoMem",f:n1},41:{n:"PtgMemFunc",f:Qd},42:{n:"PtgRefErr",f:e1},43:{n:"PtgAreaErr",f:_d},44:{n:"PtgRefN",f:Rd},45:{n:"PtgAreaN",f:Sd},46:{n:"PtgMemAreaN",f:y1},47:{n:"PtgMemNoMemN",f:w1},57:{n:"PtgNameX",f:qd},58:{n:"PtgRef3d",f:Pd},59:{n:"PtgArea3d",f:Td},60:{n:"PtgRefErr3d",f:t1},61:{n:"PtgAreaErr3d",f:Ed},255:{}},_1={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},E1={1:{n:"PtgElfLel",f:ql},2:{n:"PtgElfRw",f:h1},3:{n:"PtgElfCol",f:s1},6:{n:"PtgElfRwV",f:d1},7:{n:"PtgElfColV",f:l1},10:{n:"PtgElfRadical",f:c1},11:{n:"PtgElfRadicalS",f:u1},13:{n:"PtgElfColS",f:a1},15:{n:"PtgElfColSV",f:o1},16:{n:"PtgElfRadicalLel",f:f1},25:{n:"PtgList",f:x1},29:{n:"PtgSxName",f:g1},255:{}},S1={0:{n:"PtgAttrNoop",f:T1},1:{n:"PtgAttrSemi",f:kd},2:{n:"PtgAttrIf",f:Ad},4:{n:"PtgAttrChoose",f:bd},8:{n:"PtgAttrGoto",f:Dd},16:{n:"PtgAttrSum",f:Bd},32:{n:"PtgAttrBaxcel",f:Va},33:{n:"PtgAttrBaxcel",f:Va},64:{n:"PtgAttrSpace",f:Fd},65:{n:"PtgAttrSpaceSemi",f:Id},128:{n:"PtgAttrIfError",f:Od},255:{}};function C1(e,t,r,n){if(n.biff<8)return Er(e,t);for(var i=e.l+t,s=[],a=0;a!==r.length;++a)switch(r[a][0]){case"PtgArray":r[a][1]=Yd(e,0,n),s.push(r[a][1]);break;case"PtgMemArea":r[a][2]=Xd(e,r[a][1],n),s.push(r[a][2]);break;case"PtgExp":n&&n.biff==12&&(r[a][1][1]=e.read_shift(4),s.push(r[a][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[a][0]}return t=i-e.l,t!==0&&s.push(Er(e,t)),s}function b1(e,t,r){for(var n=e.l+t,i,s,a=[];n!=e.l;)t=n-e.l,s=e[e.l],i=za[s]||za[_1[s]],(s===24||s===25)&&(i=(s===24?E1:S1)[e[e.l+1]]),!i||!i.f?Er(e,t):a.push([i.n,i.f(e,t,r)]);return a}function D1(e){for(var t=[],r=0;r<e.length;++r){for(var n=e[r],i=[],s=0;s<n.length;++s){var a=n[s];if(a)switch(a[0]){case 2:i.push('"'+a[1].replace(/"/g,'""')+'"');break;default:i.push(a[1])}else i.push("")}t.push(i.join(","))}return t.join(";")}var A1={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function O1(e,t){if(!e&&!(t&&t.biff<=5&&t.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(e)?"'"+e+"'":e}function Jl(e,t,r){if(!e)return"SH33TJSERR0";if(r.biff>8&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var n=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),t==0?"":e.XTI[t-1];if(!n)return"SH33TJSERR1";var i="";if(r.biff>8)switch(e[n[0]][0]){case 357:return i=n[1]==-1?"#REF":e.SheetNames[n[1]],n[1]==n[2]?i:i+":"+e.SheetNames[n[2]];case 358:return r.SID!=null?e.SheetNames[r.SID]:"SH33TJSSAME"+e[n[0]][0];case 355:default:return"SH33TJSSRC"+e[n[0]][0]}switch(e[n[0]][0][0]){case 1025:return i=n[1]==-1?"#REF":e.SheetNames[n[1]]||"SH33TJSERR3",n[1]==n[2]?i:i+":"+e.SheetNames[n[2]];case 14849:return e[n[0]].slice(1).map(function(s){return s.Name}).join(";;");default:return e[n[0]][0][3]?(i=n[1]==-1?"#REF":e[n[0]][0][3][n[1]]||"SH33TJSERR4",n[1]==n[2]?i:i+":"+e[n[0]][0][3][n[2]]):"SH33TJSERR2"}}function Ha(e,t,r){var n=Jl(e,t,r);return n=="#REF"?n:O1(n,r)}function mn(e,t,r,n,i){var s=i&&i.biff||8,a={s:{c:0,r:0}},c=[],u,f,d,p=0,x=0,l,y="";if(!e[0]||!e[0][0])return"";for(var g=-1,m="",E=0,D=e[0].length;E<D;++E){var C=e[0][E];switch(C[0]){case"PtgUminus":c.push("-"+c.pop());break;case"PtgUplus":c.push("+"+c.pop());break;case"PtgPercent":c.push(c.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(u=c.pop(),f=c.pop(),g>=0){switch(e[0][g][1][0]){case 0:m=ft(" ",e[0][g][1][1]);break;case 1:m=ft("\r",e[0][g][1][1]);break;default:if(m="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][g][1][0])}f=f+m,g=-1}c.push(f+A1[C[0]]+u);break;case"PtgIsect":u=c.pop(),f=c.pop(),c.push(f+" "+u);break;case"PtgUnion":u=c.pop(),f=c.pop(),c.push(f+","+u);break;case"PtgRange":u=c.pop(),f=c.pop(),c.push(f+":"+u);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":d=Fn(C[1][1],a,i),c.push(In(d,s));break;case"PtgRefN":d=r?Fn(C[1][1],r,i):C[1][1],c.push(In(d,s));break;case"PtgRef3d":p=C[1][1],d=Fn(C[1][2],a,i),y=Ha(n,p,i),c.push(y+"!"+In(d,s));break;case"PtgFunc":case"PtgFuncVar":var N=C[1][0],L=C[1][1];N||(N=0),N&=127;var Q=N==0?[]:c.slice(-N);c.length-=N,L==="User"&&(L=Q.shift()),c.push(L+"("+Q.join(",")+")");break;case"PtgBool":c.push(C[1]?"TRUE":"FALSE");break;case"PtgInt":c.push(C[1]);break;case"PtgNum":c.push(String(C[1]));break;case"PtgStr":c.push('"'+C[1].replace(/"/g,'""')+'"');break;case"PtgErr":c.push(C[1]);break;case"PtgAreaN":l=Aa(C[1][1],r?{s:r}:a,i),c.push(Gi(l,i));break;case"PtgArea":l=Aa(C[1][1],a,i),c.push(Gi(l,i));break;case"PtgArea3d":p=C[1][1],l=C[1][2],y=Ha(n,p,i),c.push(y+"!"+Gi(l,i));break;case"PtgAttrSum":c.push("SUM("+c.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":x=C[1][2];var k=(n.names||[])[x-1]||(n[0]||[])[x],V=k?k.Name:"SH33TJSNAME"+String(x);V&&V.slice(0,6)=="_xlfn."&&!i.xlfn&&(V=V.slice(6)),c.push(V);break;case"PtgNameX":var j=C[1][1];x=C[1][2];var B;if(i.biff<=5)j<0&&(j=-j),n[j]&&(B=n[j][x]);else{var X="";if(((n[j]||[])[0]||[])[0]==14849||(((n[j]||[])[0]||[])[0]==1025?n[j][x]&&n[j][x].itab>0&&(X=n.SheetNames[n[j][x].itab-1]+"!"):X=n.SheetNames[x-1]+"!"),n[j]&&n[j][x])X+=n[j][x].Name;else if(n[0]&&n[0][x])X+=n[0][x].Name;else{var M=(Jl(n,j,i)||"").split(";;");M[x-1]?X=M[x-1]:X+="SH33TJSERRX"}c.push(X);break}B||(B={Name:"SH33TJSERRY"}),c.push(B.Name);break;case"PtgParen":var ee="(",Te=")";if(g>=0){switch(m="",e[0][g][1][0]){case 2:ee=ft(" ",e[0][g][1][1])+ee;break;case 3:ee=ft("\r",e[0][g][1][1])+ee;break;case 4:Te=ft(" ",e[0][g][1][1])+Te;break;case 5:Te=ft("\r",e[0][g][1][1])+Te;break;default:if(i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][g][1][0])}g=-1}c.push(ee+c.pop()+Te);break;case"PtgRefErr":c.push("#REF!");break;case"PtgRefErr3d":c.push("#REF!");break;case"PtgExp":d={c:C[1][1],r:C[1][0]};var ne={c:r.c,r:r.r};if(n.sharedf[Qe(d)]){var ae=n.sharedf[Qe(d)];c.push(mn(ae,a,ne,n,i))}else{var Se=!1;for(u=0;u!=n.arrayf.length;++u)if(f=n.arrayf[u],!(d.c<f[0].s.c||d.c>f[0].e.c)&&!(d.r<f[0].s.r||d.r>f[0].e.r)){c.push(mn(f[1],a,ne,n,i)),Se=!0;break}Se||c.push(C[1])}break;case"PtgArray":c.push("{"+D1(C[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":g=E;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":c.push("");break;case"PtgAreaErr":c.push("#REF!");break;case"PtgAreaErr3d":c.push("#REF!");break;case"PtgList":c.push("Table"+C[1].idx+"[#"+C[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(C));default:throw new Error("Unrecognized Formula Token: "+String(C))}var Ne=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(i.biff!=3&&g>=0&&Ne.indexOf(e[0][E][0])==-1){C=e[0][g];var be=!0;switch(C[1][0]){case 4:be=!1;case 0:m=ft(" ",C[1][1]);break;case 5:be=!1;case 1:m=ft("\r",C[1][1]);break;default:if(m="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+C[1][0])}c.push((be?m:"")+c.pop()+(be?"":m)),g=-1}}if(c.length>1&&i.WTF)throw new Error("bad formula stack");return c[0]}function k1(e){if(e==null){var t=q(8);return t.write_shift(1,3),t.write_shift(1,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,65535),t}else if(typeof e=="number")return Xr(e);return Xr(0)}function F1(e,t,r,n,i){var s=Yr(t,r,i),a=k1(e.v),c=q(6),u=33;c.write_shift(2,u),c.write_shift(4,0);for(var f=q(e.bf.length),d=0;d<e.bf.length;++d)f[d]=e.bf[d];var p=Ot([s,a,c,f]);return p}function Fi(e,t,r){var n=e.read_shift(4),i=b1(e,n,r),s=e.read_shift(4),a=s>0?C1(e,s,i,r):null;return[i,a]}var I1=Fi,Ii=Fi,N1=Fi,R1=Fi,P1={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},Zl={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},j1={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function M1(e){var t="of:="+e.replace(Rs,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return t.replace(/;/g,"|").replace(/,/g,";")}function L1(e){return e.replace(/\./,"!")}var Nn=typeof Map<"u";function Ms(e,t,r){var n=0,i=e.length;if(r){if(Nn?r.has(t):Object.prototype.hasOwnProperty.call(r,t)){for(var s=Nn?r.get(t):r[t];n<s.length;++n)if(e[s[n]].t===t)return e.Count++,s[n]}}else for(;n<i;++n)if(e[n].t===t)return e.Count++,n;return e[i]={t},e.Count++,e.Unique++,r&&(Nn?(r.has(t)||r.set(t,[]),r.get(t).push(i)):(Object.prototype.hasOwnProperty.call(r,t)||(r[t]=[]),r[t].push(i))),i}function Ni(e,t){var r={min:e+1,max:e+1},n=-1;return t.MDW&&(Or=t.MDW),t.width!=null?r.customWidth=1:t.wpx!=null?n=Ti(t.wpx):t.wch!=null&&(n=t.wch),n>-1?(r.width=ls(n),r.customWidth=1):t.width!=null&&(r.width=t.width),t.hidden&&(r.hidden=!0),t.level!=null&&(r.outlineLevel=r.level=t.level),r}function Ql(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];e.left==null&&(e.left=r[0]),e.right==null&&(e.right=r[1]),e.top==null&&(e.top=r[2]),e.bottom==null&&(e.bottom=r[3]),e.header==null&&(e.header=r[4]),e.footer==null&&(e.footer=r[5])}}function Ur(e,t,r){var n=r.revssf[t.z!=null?t.z:"General"],i=60,s=e.length;if(n==null&&r.ssf){for(;i<392;++i)if(r.ssf[i]==null){Yo(t.z,i),r.ssf[i]=t.z,r.revssf[t.z]=n=i;break}}for(i=0;i!=s;++i)if(e[i].numFmtId===n)return i;return e[s]={numFmtId:n,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},s}function B1(e,t,r){if(e&&e["!ref"]){var n=it(e["!ref"]);if(n.e.c<n.s.c||n.e.r<n.s.r)throw new Error("Bad range ("+r+"): "+e["!ref"])}}function U1(e){if(e.length===0)return"";for(var t='<mergeCells count="'+e.length+'">',r=0;r!=e.length;++r)t+='<mergeCell ref="'+pt(e[r])+'"/>';return t+"</mergeCells>"}function W1(e,t,r,n,i){var s=!1,a={},c=null;if(n.bookType!=="xlsx"&&t.vbaraw){var u=t.SheetNames[r];try{t.Workbook&&(u=t.Workbook.Sheets[r].CodeName||u)}catch{}s=!0,a.codeName=Ln(Ze(u))}if(e&&e["!outline"]){var f={summaryBelow:1,summaryRight:1};e["!outline"].above&&(f.summaryBelow=0),e["!outline"].left&&(f.summaryRight=0),c=(c||"")+ce("outlinePr",null,f)}!s&&!c||(i[i.length]=ce("sheetPr",c,a))}var V1=["objects","scenarios","selectLockedCells","selectUnlockedCells"],z1=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function H1(e){var t={sheet:1};return V1.forEach(function(r){e[r]!=null&&e[r]&&(t[r]="1")}),z1.forEach(function(r){e[r]!=null&&!e[r]&&(t[r]="0")}),e.password&&(t.password=jl(e.password).toString(16).toUpperCase()),ce("sheetProtection",null,t)}function $1(e){return Ql(e),ce("pageMargins",null,e)}function G1(e,t){for(var r=["<cols>"],n,i=0;i!=t.length;++i)(n=t[i])&&(r[r.length]=ce("col",null,Ni(i,n)));return r[r.length]="</cols>",r.join("")}function X1(e,t,r,n){var i=typeof e.ref=="string"?e.ref:pt(e.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var s=r.Workbook.Names,a=nr(i);a.s.r==a.e.r&&(a.e.r=nr(t["!ref"]).e.r,i=pt(a));for(var c=0;c<s.length;++c){var u=s[c];if(u.Name=="_xlnm._FilterDatabase"&&u.Sheet==n){u.Ref="'"+r.SheetNames[n]+"'!"+i;break}}return c==s.length&&s.push({Name:"_xlnm._FilterDatabase",Sheet:n,Ref:"'"+r.SheetNames[n]+"'!"+i}),ce("autoFilter",null,{ref:i})}function Y1(e,t,r,n){var i={workbookViewId:"0"};return(((n||{}).Workbook||{}).Views||[])[0]&&(i.rightToLeft=n.Workbook.Views[0].RTL?"1":"0"),ce("sheetViews",ce("sheetView",null,i),{})}function K1(e,t,r,n){if(e.c&&r["!comments"].push([t,e.c]),e.v===void 0&&typeof e.f!="string"||e.t==="z"&&!e.f)return"";var i="",s=e.t,a=e.v;if(e.t!=="z")switch(e.t){case"b":i=e.v?"1":"0";break;case"n":i=""+e.v;break;case"e":i=Gn[e.v];break;case"d":n&&n.cellDates?i=zt(e.v,-1).toISOString():(e=qt(e),e.t="n",i=""+(e.v=Kt(zt(e.v)))),typeof e.z>"u"&&(e.z=ut[14]);break;default:i=e.v;break}var c=kt("v",Ze(i)),u={r:t},f=Ur(n.cellXfs,e,n);switch(f!==0&&(u.s=f),e.t){case"n":break;case"d":u.t="d";break;case"b":u.t="b";break;case"e":u.t="e";break;case"z":break;default:if(e.v==null){delete e.t;break}if(e.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(n&&n.bookSST){c=kt("v",""+Ms(n.Strings,e.v,n.revStrings)),u.t="s";break}u.t="str";break}if(e.t!=s&&(e.t=s,e.v=a),typeof e.f=="string"&&e.f){var d=e.F&&e.F.slice(0,t.length)==t?{t:"array",ref:e.F}:null;c=ce("f",Ze(e.f),d)+(e.v!=null?c:"")}return e.l&&r["!links"].push([t,e.l]),e.D&&(u.cm=1),ce("c",c,u)}function q1(e,t,r,n){var i=[],s=[],a=it(e["!ref"]),c="",u,f="",d=[],p=0,x=0,l=e["!rows"],y=Array.isArray(e),g={r:f},m,E=-1;for(x=a.s.c;x<=a.e.c;++x)d[x]=jt(x);for(p=a.s.r;p<=a.e.r;++p){for(s=[],f=Ft(p),x=a.s.c;x<=a.e.c;++x){u=d[x]+f;var D=y?(e[p]||[])[x]:e[u];D!==void 0&&(c=K1(D,u,e,t))!=null&&s.push(c)}(s.length>0||l&&l[p])&&(g={r:f},l&&l[p]&&(m=l[p],m.hidden&&(g.hidden=1),E=-1,m.hpx?E=_i(m.hpx):m.hpt&&(E=m.hpt),E>-1&&(g.ht=E,g.customHeight=1),m.level&&(g.outlineLevel=m.level)),i[i.length]=ce("row",s.join(""),g))}if(l)for(;p<l.length;++p)l&&l[p]&&(g={r:p+1},m=l[p],m.hidden&&(g.hidden=1),E=-1,m.hpx?E=_i(m.hpx):m.hpt&&(E=m.hpt),E>-1&&(g.ht=E,g.customHeight=1),m.level&&(g.outlineLevel=m.level),i[i.length]=ce("row","",g));return i.join("")}function ec(e,t,r,n){var i=[xt,ce("worksheet",null,{xmlns:vn[0],"xmlns:r":_t.r})],s=r.SheetNames[e],a=0,c="",u=r.Sheets[s];u==null&&(u={});var f=u["!ref"]||"A1",d=it(f);if(d.e.c>16383||d.e.r>1048575){if(t.WTF)throw new Error("Range "+f+" exceeds format limit A1:XFD1048576");d.e.c=Math.min(d.e.c,16383),d.e.r=Math.min(d.e.c,1048575),f=pt(d)}n||(n={}),u["!comments"]=[];var p=[];W1(u,r,e,t,i),i[i.length]=ce("dimension",null,{ref:f}),i[i.length]=Y1(u,t,e,r),t.sheetFormat&&(i[i.length]=ce("sheetFormatPr",null,{defaultRowHeight:t.sheetFormat.defaultRowHeight||"16",baseColWidth:t.sheetFormat.baseColWidth||"10",outlineLevelRow:t.sheetFormat.outlineLevelRow||"7"})),u["!cols"]!=null&&u["!cols"].length>0&&(i[i.length]=G1(u,u["!cols"])),i[a=i.length]="<sheetData/>",u["!links"]=[],u["!ref"]!=null&&(c=q1(u,t),c.length>0&&(i[i.length]=c)),i.length>a+1&&(i[i.length]="</sheetData>",i[a]=i[a].replace("/>",">")),u["!protect"]&&(i[i.length]=H1(u["!protect"])),u["!autofilter"]!=null&&(i[i.length]=X1(u["!autofilter"],u,r,e)),u["!merges"]!=null&&u["!merges"].length>0&&(i[i.length]=U1(u["!merges"]));var x=-1,l,y=-1;return u["!links"].length>0&&(i[i.length]="<hyperlinks>",u["!links"].forEach(function(g){g[1].Target&&(l={ref:g[0]},g[1].Target.charAt(0)!="#"&&(y=Je(n,-1,Ze(g[1].Target).replace(/#.*$/,""),Ve.HLINK),l["r:id"]="rId"+y),(x=g[1].Target.indexOf("#"))>-1&&(l.location=Ze(g[1].Target.slice(x+1))),g[1].Tooltip&&(l.tooltip=Ze(g[1].Tooltip)),i[i.length]=ce("hyperlink",null,l))}),i[i.length]="</hyperlinks>"),delete u["!links"],u["!margins"]!=null&&(i[i.length]=$1(u["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&(i[i.length]=kt("ignoredErrors",ce("ignoredError",null,{numberStoredAsText:1,sqref:f}))),p.length>0&&(y=Je(n,-1,"../drawings/drawing"+(e+1)+".xml",Ve.DRAW),i[i.length]=ce("drawing",null,{"r:id":"rId"+y}),u["!drawing"]=p),u["!comments"].length>0&&(y=Je(n,-1,"../drawings/vmlDrawing"+(e+1)+".vml",Ve.VML),i[i.length]=ce("legacyDrawing",null,{"r:id":"rId"+y}),u["!legacy"]=y),i.length>1&&(i[i.length]="</worksheet>",i[1]=i[1].replace("/>",">")),i.join("")}function J1(e,t){var r={},n=e.l+t;r.r=e.read_shift(4),e.l+=4;var i=e.read_shift(2);e.l+=1;var s=e.read_shift(1);return e.l=n,s&7&&(r.level=s&7),s&16&&(r.hidden=!0),s&32&&(r.hpt=i/20),r}function Z1(e,t,r){var n=q(145),i=(r["!rows"]||[])[e]||{};n.write_shift(4,e),n.write_shift(4,0);var s=320;i.hpx?s=_i(i.hpx)*20:i.hpt&&(s=i.hpt*20),n.write_shift(2,s),n.write_shift(1,0);var a=0;i.level&&(a|=i.level),i.hidden&&(a|=16),(i.hpx||i.hpt)&&(a|=32),n.write_shift(1,a),n.write_shift(1,0);var c=0,u=n.l;n.l+=4;for(var f={r:e,c:0},d=0;d<16;++d)if(!(t.s.c>d+1<<10||t.e.c<d<<10)){for(var p=-1,x=-1,l=d<<10;l<d+1<<10;++l){f.c=l;var y=Array.isArray(r)?(r[f.r]||[])[f.c]:r[Qe(f)];y&&(p<0&&(p=l),x=l)}p<0||(++c,n.write_shift(4,p),n.write_shift(4,x))}var g=n.l;return n.l=u,n.write_shift(4,c),n.l=g,n.length>n.l?n.slice(0,n.l):n}function Q1(e,t,r,n){var i=Z1(n,r,t);(i.length>17||(t["!rows"]||[])[n])&&te(e,0,i)}var ep=tn,tp=wn;function rp(){}function np(e,t){var r={},n=e[e.l];return++e.l,r.above=!(n&64),r.left=!(n&128),e.l+=18,r.name=du(e),r}function ip(e,t,r){r==null&&(r=q(84+4*e.length));var n=192;t&&(t.above&&(n&=-65),t.left&&(n&=-129)),r.write_shift(1,n);for(var i=1;i<3;++i)r.write_shift(1,0);return vi({auto:1},r),r.write_shift(-4,-1),r.write_shift(-4,-1),xl(e,r),r.slice(0,r.l)}function sp(e){var t=cr(e);return[t]}function ap(e,t,r){return r==null&&(r=q(8)),Zr(t,r)}function op(e){var t=Qr(e);return[t]}function lp(e,t,r){return r==null&&(r=q(4)),en(t,r)}function cp(e){var t=cr(e),r=e.read_shift(1);return[t,r,"b"]}function fp(e,t,r){return r==null&&(r=q(9)),Zr(t,r),r.write_shift(1,e.v?1:0),r}function up(e){var t=Qr(e),r=e.read_shift(1);return[t,r,"b"]}function hp(e,t,r){return r==null&&(r=q(5)),en(t,r),r.write_shift(1,e.v?1:0),r}function dp(e){var t=cr(e),r=e.read_shift(1);return[t,r,"e"]}function pp(e,t,r){return r==null&&(r=q(9)),Zr(t,r),r.write_shift(1,e.v),r}function xp(e){var t=Qr(e),r=e.read_shift(1);return[t,r,"e"]}function gp(e,t,r){return r==null&&(r=q(8)),en(t,r),r.write_shift(1,e.v),r.write_shift(2,0),r.write_shift(1,0),r}function mp(e){var t=cr(e),r=e.read_shift(4);return[t,r,"s"]}function vp(e,t,r){return r==null&&(r=q(12)),Zr(t,r),r.write_shift(4,t.v),r}function yp(e){var t=Qr(e),r=e.read_shift(4);return[t,r,"s"]}function wp(e,t,r){return r==null&&(r=q(8)),en(t,r),r.write_shift(4,t.v),r}function Tp(e){var t=cr(e),r=Tn(e);return[t,r,"n"]}function _p(e,t,r){return r==null&&(r=q(16)),Zr(t,r),Xr(e.v,r),r}function Ep(e){var t=Qr(e),r=Tn(e);return[t,r,"n"]}function Sp(e,t,r){return r==null&&(r=q(12)),en(t,r),Xr(e.v,r),r}function Cp(e){var t=cr(e),r=gl(e);return[t,r,"n"]}function bp(e,t,r){return r==null&&(r=q(12)),Zr(t,r),ml(e.v,r),r}function Dp(e){var t=Qr(e),r=gl(e);return[t,r,"n"]}function Ap(e,t,r){return r==null&&(r=q(8)),en(t,r),ml(e.v,r),r}function Op(e){var t=cr(e),r=Os(e);return[t,r,"is"]}function kp(e){var t=cr(e),r=Mt(e);return[t,r,"str"]}function Fp(e,t,r){return r==null&&(r=q(12+4*e.v.length)),Zr(t,r),St(e.v,r),r.length>r.l?r.slice(0,r.l):r}function Ip(e){var t=Qr(e),r=Mt(e);return[t,r,"str"]}function Np(e,t,r){return r==null&&(r=q(8+4*e.v.length)),en(t,r),St(e.v,r),r.length>r.l?r.slice(0,r.l):r}function Rp(e,t,r){var n=e.l+t,i=cr(e);i.r=r["!row"];var s=e.read_shift(1),a=[i,s,"b"];if(r.cellFormula){e.l+=2;var c=Ii(e,n-e.l,r);a[3]=mn(c,null,i,r.supbooks,r)}else e.l=n;return a}function Pp(e,t,r){var n=e.l+t,i=cr(e);i.r=r["!row"];var s=e.read_shift(1),a=[i,s,"e"];if(r.cellFormula){e.l+=2;var c=Ii(e,n-e.l,r);a[3]=mn(c,null,i,r.supbooks,r)}else e.l=n;return a}function jp(e,t,r){var n=e.l+t,i=cr(e);i.r=r["!row"];var s=Tn(e),a=[i,s,"n"];if(r.cellFormula){e.l+=2;var c=Ii(e,n-e.l,r);a[3]=mn(c,null,i,r.supbooks,r)}else e.l=n;return a}function Mp(e,t,r){var n=e.l+t,i=cr(e);i.r=r["!row"];var s=Mt(e),a=[i,s,"str"];if(r.cellFormula){e.l+=2;var c=Ii(e,n-e.l,r);a[3]=mn(c,null,i,r.supbooks,r)}else e.l=n;return a}var Lp=tn,Bp=wn;function Up(e,t){return t==null&&(t=q(4)),t.write_shift(4,e),t}function Wp(e,t){var r=e.l+t,n=tn(e),i=ks(e),s=Mt(e),a=Mt(e),c=Mt(e);e.l=r;var u={rfx:n,relId:i,loc:s,display:c};return a&&(u.Tooltip=a),u}function Vp(e,t){var r=q(50+4*(e[1].Target.length+(e[1].Tooltip||"").length));wn({s:Et(e[0]),e:Et(e[0])},r),Fs("rId"+t,r);var n=e[1].Target.indexOf("#"),i=n==-1?"":e[1].Target.slice(n+1);return St(i||"",r),St(e[1].Tooltip||"",r),St("",r),r.slice(0,r.l)}function zp(){}function Hp(e,t,r){var n=e.l+t,i=vl(e),s=e.read_shift(1),a=[i];if(a[2]=s,r.cellFormula){var c=I1(e,n-e.l,r);a[1]=c}else e.l=n;return a}function $p(e,t,r){var n=e.l+t,i=tn(e),s=[i];if(r.cellFormula){var a=R1(e,n-e.l,r);s[1]=a,e.l=n}else e.l=n;return s}function Gp(e,t,r){r==null&&(r=q(18));var n=Ni(e,t);r.write_shift(-4,e),r.write_shift(-4,e),r.write_shift(4,(n.width||10)*256),r.write_shift(4,0);var i=0;return t.hidden&&(i|=1),typeof n.width=="number"&&(i|=2),t.level&&(i|=t.level<<8),r.write_shift(2,i),r}var tc=["left","right","top","bottom","header","footer"];function Xp(e){var t={};return tc.forEach(function(r){t[r]=Tn(e)}),t}function Yp(e,t){return t==null&&(t=q(48)),Ql(e),tc.forEach(function(r){Xr(e[r],t)}),t}function Kp(e){var t=e.read_shift(2);return e.l+=28,{RTL:t&32}}function qp(e,t,r){r==null&&(r=q(30));var n=924;return(((t||{}).Views||[])[0]||{}).RTL&&(n|=32),r.write_shift(2,n),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(2,0),r.write_shift(2,100),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(4,0),r}function Jp(e){var t=q(24);return t.write_shift(4,4),t.write_shift(4,1),wn(e,t),t}function Zp(e,t){return t==null&&(t=q(66)),t.write_shift(2,e.password?jl(e.password):0),t.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach(function(r){r[1]?t.write_shift(4,e[r[0]]!=null&&!e[r[0]]?1:0):t.write_shift(4,e[r[0]]!=null&&e[r[0]]?0:1)}),t}function Qp(){}function ex(){}function tx(e,t,r,n,i,s,a){if(t.v===void 0)return!1;var c="";switch(t.t){case"b":c=t.v?"1":"0";break;case"d":t=qt(t),t.z=t.z||ut[14],t.v=Kt(zt(t.v)),t.t="n";break;case"n":case"e":c=""+t.v;break;default:c=t.v;break}var u={r,c:n};switch(u.s=Ur(i.cellXfs,t,i),t.l&&s["!links"].push([Qe(u),t.l]),t.c&&s["!comments"].push([Qe(u),t.c]),t.t){case"s":case"str":return i.bookSST?(c=Ms(i.Strings,t.v,i.revStrings),u.t="s",u.v=c,a?te(e,18,wp(t,u)):te(e,7,vp(t,u))):(u.t="str",a?te(e,17,Np(t,u)):te(e,6,Fp(t,u))),!0;case"n":return t.v==(t.v|0)&&t.v>-1e3&&t.v<1e3?a?te(e,13,Ap(t,u)):te(e,2,bp(t,u)):a?te(e,16,Sp(t,u)):te(e,5,_p(t,u)),!0;case"b":return u.t="b",a?te(e,15,hp(t,u)):te(e,4,fp(t,u)),!0;case"e":return u.t="e",a?te(e,14,gp(t,u)):te(e,3,pp(t,u)),!0}return a?te(e,12,lp(t,u)):te(e,1,ap(t,u)),!0}function rx(e,t,r,n){var i=it(t["!ref"]||"A1"),s,a="",c=[];te(e,145);var u=Array.isArray(t),f=i.e.r;t["!rows"]&&(f=Math.max(i.e.r,t["!rows"].length-1));for(var d=i.s.r;d<=f;++d){a=Ft(d),Q1(e,t,i,d);var p=!1;if(d<=i.e.r)for(var x=i.s.c;x<=i.e.c;++x){d===i.s.r&&(c[x]=jt(x)),s=c[x]+a;var l=u?(t[d]||[])[x]:t[s];if(!l){p=!1;continue}p=tx(e,l,d,x,n,t,p)}}te(e,146)}function nx(e,t){!t||!t["!merges"]||(te(e,177,Up(t["!merges"].length)),t["!merges"].forEach(function(r){te(e,176,Bp(r))}),te(e,178))}function ix(e,t){!t||!t["!cols"]||(te(e,390),t["!cols"].forEach(function(r,n){r&&te(e,60,Gp(n,r))}),te(e,391))}function sx(e,t){!t||!t["!ref"]||(te(e,648),te(e,649,Jp(it(t["!ref"]))),te(e,650))}function ax(e,t,r){t["!links"].forEach(function(n){if(n[1].Target){var i=Je(r,-1,n[1].Target.replace(/#.*$/,""),Ve.HLINK);te(e,494,Vp(n,i))}}),delete t["!links"]}function ox(e,t,r,n){if(t["!comments"].length>0){var i=Je(n,-1,"../drawings/vmlDrawing"+(r+1)+".vml",Ve.VML);te(e,551,Fs("rId"+i)),t["!legacy"]=i}}function lx(e,t,r,n){if(t["!autofilter"]){var i=t["!autofilter"],s=typeof i.ref=="string"?i.ref:pt(i.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var a=r.Workbook.Names,c=nr(s);c.s.r==c.e.r&&(c.e.r=nr(t["!ref"]).e.r,s=pt(c));for(var u=0;u<a.length;++u){var f=a[u];if(f.Name=="_xlnm._FilterDatabase"&&f.Sheet==n){f.Ref="'"+r.SheetNames[n]+"'!"+s;break}}u==a.length&&a.push({Name:"_xlnm._FilterDatabase",Sheet:n,Ref:"'"+r.SheetNames[n]+"'!"+s}),te(e,161,wn(it(s))),te(e,162)}}function cx(e,t,r){te(e,133),te(e,137,qp(t,r)),te(e,138),te(e,134)}function fx(e,t){t["!protect"]&&te(e,535,Zp(t["!protect"]))}function ux(e,t,r,n){var i=Yt(),s=r.SheetNames[e],a=r.Sheets[s]||{},c=s;try{r&&r.Workbook&&(c=r.Workbook.Sheets[e].CodeName||c)}catch{}var u=it(a["!ref"]||"A1");if(u.e.c>16383||u.e.r>1048575){if(t.WTF)throw new Error("Range "+(a["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");u.e.c=Math.min(u.e.c,16383),u.e.r=Math.min(u.e.c,1048575)}return a["!links"]=[],a["!comments"]=[],te(i,129),(r.vbaraw||a["!outline"])&&te(i,147,ip(c,a["!outline"])),te(i,148,tp(u)),cx(i,a,r.Workbook),ix(i,a),rx(i,a,e,t),fx(i,a),lx(i,a,r,e),nx(i,a),ax(i,a,n),a["!margins"]&&te(i,476,Yp(a["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&sx(i,a),ox(i,a,e,n),te(i,130),i.end()}function hx(e,t){e.l+=10;var r=Mt(e);return{name:r}}var dx=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]];function px(e){return!e.Workbook||!e.Workbook.WBProps?"false":$f(e.Workbook.WBProps.date1904)?"true":"false"}var xx="][*?/\\".split("");function rc(e,t){if(e.length>31)throw new Error("Sheet names cannot exceed 31 chars");var r=!0;return xx.forEach(function(n){if(e.indexOf(n)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),r}function gx(e,t,r){e.forEach(function(n,i){rc(n);for(var s=0;s<i;++s)if(n==e[s])throw new Error("Duplicate Sheet Name: "+n);if(r){var a=t&&t[i]&&t[i].CodeName||n;if(a.charCodeAt(0)==95&&a.length>22)throw new Error("Bad Code Name: Worksheet"+a)}})}function mx(e){if(!e||!e.SheetNames||!e.Sheets)throw new Error("Invalid Workbook");if(!e.SheetNames.length)throw new Error("Workbook is empty");var t=e.Workbook&&e.Workbook.Sheets||[];gx(e.SheetNames,t,!!e.vbaraw);for(var r=0;r<e.SheetNames.length;++r)B1(e.Sheets[e.SheetNames[r]],e.SheetNames[r],r)}function nc(e){var t=[xt];t[t.length]=ce("workbook",null,{xmlns:vn[0],"xmlns:r":_t.r});var r=e.Workbook&&(e.Workbook.Names||[]).length>0,n={codeName:"ThisWorkbook"};e.Workbook&&e.Workbook.WBProps&&(dx.forEach(function(c){e.Workbook.WBProps[c[0]]!=null&&e.Workbook.WBProps[c[0]]!=c[1]&&(n[c[0]]=e.Workbook.WBProps[c[0]])}),e.Workbook.WBProps.CodeName&&(n.codeName=e.Workbook.WBProps.CodeName,delete n.CodeName)),t[t.length]=ce("workbookPr",null,n);var i=e.Workbook&&e.Workbook.Sheets||[],s=0;if(i&&i[0]&&i[0].Hidden){for(t[t.length]="<bookViews>",s=0;s!=e.SheetNames.length&&!(!i[s]||!i[s].Hidden);++s);s==e.SheetNames.length&&(s=0),t[t.length]='<workbookView firstSheet="'+s+'" activeTab="'+s+'"/>',t[t.length]="</bookViews>"}for(t[t.length]="<sheets>",s=0;s!=e.SheetNames.length;++s){var a={name:Ze(e.SheetNames[s].slice(0,31))};if(a.sheetId=""+(s+1),a["r:id"]="rId"+(s+1),i[s])switch(i[s].Hidden){case 1:a.state="hidden";break;case 2:a.state="veryHidden";break}t[t.length]=ce("sheet",null,a)}return t[t.length]="</sheets>",r&&(t[t.length]="<definedNames>",e.Workbook&&e.Workbook.Names&&e.Workbook.Names.forEach(function(c){var u={name:c.Name};c.Comment&&(u.comment=c.Comment),c.Sheet!=null&&(u.localSheetId=""+c.Sheet),c.Hidden&&(u.hidden="1"),c.Ref&&(t[t.length]=ce("definedName",Ze(c.Ref),u))}),t[t.length]="</definedNames>"),t.length>2&&(t[t.length]="</workbook>",t[1]=t[1].replace("/>",">")),t.join("")}function vx(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=os(e),r.name=Mt(e),r}function yx(e,t){return t||(t=q(127)),t.write_shift(4,e.Hidden),t.write_shift(4,e.iTabID),Fs(e.strRelID,t),St(e.name.slice(0,31),t),t.length>t.l?t.slice(0,t.l):t}function wx(e,t){var r={},n=e.read_shift(4);r.defaultThemeVersion=e.read_shift(4);var i=t>8?Mt(e):"";return i.length>0&&(r.CodeName=i),r.autoCompressPictures=!!(n&65536),r.backupFile=!!(n&64),r.checkCompatibility=!!(n&4096),r.date1904=!!(n&1),r.filterPrivacy=!!(n&8),r.hidePivotFieldList=!!(n&1024),r.promptedSolutions=!!(n&16),r.publishItems=!!(n&2048),r.refreshAllConnections=!!(n&262144),r.saveExternalLinkValues=!!(n&128),r.showBorderUnselectedTables=!!(n&4),r.showInkAnnotation=!!(n&32),r.showObjects=["all","placeholders","none"][n>>13&3],r.showPivotChartFilter=!!(n&32768),r.updateLinks=["userSet","never","always"][n>>8&3],r}function Tx(e,t){t||(t=q(72));var r=0;return e&&e.filterPrivacy&&(r|=8),t.write_shift(4,r),t.write_shift(4,0),xl(e&&e.CodeName||"ThisWorkbook",t),t.slice(0,t.l)}function _x(e,t,r){var n=e.l+t;e.l+=4,e.l+=1;var i=e.read_shift(4),s=pu(e),a=N1(e,0,r),c=ks(e);e.l=n;var u={Name:s,Ptg:a};return i<268435455&&(u.Sheet=i),c&&(u.Comment=c),u}function Ex(e,t){te(e,143);for(var r=0;r!=t.SheetNames.length;++r){var n=t.Workbook&&t.Workbook.Sheets&&t.Workbook.Sheets[r]&&t.Workbook.Sheets[r].Hidden||0,i={Hidden:n,iTabID:r+1,strRelID:"rId"+(r+1),name:t.SheetNames[r]};te(e,156,yx(i))}te(e,144)}function Sx(e,t){t||(t=q(127));for(var r=0;r!=4;++r)t.write_shift(4,0);return St("SheetJS",t),St(fi.version,t),St(fi.version,t),St("7262",t),t.length>t.l?t.slice(0,t.l):t}function Cx(e,t){t||(t=q(29)),t.write_shift(-4,0),t.write_shift(-4,460),t.write_shift(4,28800),t.write_shift(4,17600),t.write_shift(4,500),t.write_shift(4,e),t.write_shift(4,e);var r=120;return t.write_shift(1,r),t.length>t.l?t.slice(0,t.l):t}function bx(e,t){if(!(!t.Workbook||!t.Workbook.Sheets)){for(var r=t.Workbook.Sheets,n=0,i=-1,s=-1;n<r.length;++n)!r[n]||!r[n].Hidden&&i==-1?i=n:r[n].Hidden==1&&s==-1&&(s=n);s>i||(te(e,135),te(e,158,Cx(i)),te(e,136))}}function Dx(e,t){var r=Yt();return te(r,131),te(r,128,Sx()),te(r,153,Tx(e.Workbook&&e.Workbook.WBProps||null)),bx(r,e),Ex(r,e),te(r,132),r.end()}function Ax(e,t,r){return(t.slice(-4)===".bin"?Dx:nc)(e)}function Ox(e,t,r,n,i){return(t.slice(-4)===".bin"?ux:ec)(e,r,n,i)}function kx(e,t,r){return(t.slice(-4)===".bin"?Yh:Bl)(e,r)}function Fx(e,t,r){return(t.slice(-4)===".bin"?Th:Pl)(e,r)}function Ix(e,t,r){return(t.slice(-4)===".bin"?fd:Hl)(e)}function Nx(e){return(e.slice(-4)===".bin"?rd:Vl)()}function Rx(e,t){var r=[];return e.Props&&r.push(ku(e.Props,t)),e.Custprops&&r.push(Fu(e.Props,e.Custprops)),r.join("")}function Px(){return""}function jx(e,t){var r=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return t.cellXfs.forEach(function(n,i){var s=[];s.push(ce("NumberFormat",null,{"ss:Format":Ze(ut[n.numFmtId])}));var a={"ss:ID":"s"+(21+i)};r.push(ce("Style",s.join(""),a))}),ce("Styles",r.join(""))}function ic(e){return ce("NamedRange",null,{"ss:Name":e.Name,"ss:RefersTo":"="+Ps(e.Ref,{r:0,c:0})})}function Mx(e){if(!((e||{}).Workbook||{}).Names)return"";for(var t=e.Workbook.Names,r=[],n=0;n<t.length;++n){var i=t[n];i.Sheet==null&&(i.Name.match(/^_xlfn\./)||r.push(ic(i)))}return ce("Names",r.join(""))}function Lx(e,t,r,n){if(!e||!((n||{}).Workbook||{}).Names)return"";for(var i=n.Workbook.Names,s=[],a=0;a<i.length;++a){var c=i[a];c.Sheet==r&&(c.Name.match(/^_xlfn\./)||s.push(ic(c)))}return s.join("")}function Bx(e,t,r,n){if(!e)return"";var i=[];if(e["!margins"]&&(i.push("<PageSetup>"),e["!margins"].header&&i.push(ce("Header",null,{"x:Margin":e["!margins"].header})),e["!margins"].footer&&i.push(ce("Footer",null,{"x:Margin":e["!margins"].footer})),i.push(ce("PageMargins",null,{"x:Bottom":e["!margins"].bottom||"0.75","x:Left":e["!margins"].left||"0.7","x:Right":e["!margins"].right||"0.7","x:Top":e["!margins"].top||"0.75"})),i.push("</PageSetup>")),n&&n.Workbook&&n.Workbook.Sheets&&n.Workbook.Sheets[r])if(n.Workbook.Sheets[r].Hidden)i.push(ce("Visible",n.Workbook.Sheets[r].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var s=0;s<r&&!(n.Workbook.Sheets[s]&&!n.Workbook.Sheets[s].Hidden);++s);s==r&&i.push("<Selected/>")}return((((n||{}).Workbook||{}).Views||[])[0]||{}).RTL&&i.push("<DisplayRightToLeft/>"),e["!protect"]&&(i.push(kt("ProtectContents","True")),e["!protect"].objects&&i.push(kt("ProtectObjects","True")),e["!protect"].scenarios&&i.push(kt("ProtectScenarios","True")),e["!protect"].selectLockedCells!=null&&!e["!protect"].selectLockedCells?i.push(kt("EnableSelection","NoSelection")):e["!protect"].selectUnlockedCells!=null&&!e["!protect"].selectUnlockedCells&&i.push(kt("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(a){e["!protect"][a[0]]&&i.push("<"+a[1]+"/>")})),i.length==0?"":ce("WorksheetOptions",i.join(""),{xmlns:tr.x})}function Ux(e){return e.map(function(t){var r=Hf(t.t||""),n=ce("ss:Data",r,{xmlns:"http://www.w3.org/TR/REC-html40"});return ce("Comment",n,{"ss:Author":t.a})}).join("")}function Wx(e,t,r,n,i,s,a){if(!e||e.v==null&&e.f==null)return"";var c={};if(e.f&&(c["ss:Formula"]="="+Ze(Ps(e.f,a))),e.F&&e.F.slice(0,t.length)==t){var u=Et(e.F.slice(t.length+1));c["ss:ArrayRange"]="RC:R"+(u.r==a.r?"":"["+(u.r-a.r)+"]")+"C"+(u.c==a.c?"":"["+(u.c-a.c)+"]")}if(e.l&&e.l.Target&&(c["ss:HRef"]=Ze(e.l.Target),e.l.Tooltip&&(c["x:HRefScreenTip"]=Ze(e.l.Tooltip))),r["!merges"])for(var f=r["!merges"],d=0;d!=f.length;++d)f[d].s.c!=a.c||f[d].s.r!=a.r||(f[d].e.c>f[d].s.c&&(c["ss:MergeAcross"]=f[d].e.c-f[d].s.c),f[d].e.r>f[d].s.r&&(c["ss:MergeDown"]=f[d].e.r-f[d].s.r));var p="",x="";switch(e.t){case"z":if(!n.sheetStubs)return"";break;case"n":p="Number",x=String(e.v);break;case"b":p="Boolean",x=e.v?"1":"0";break;case"e":p="Error",x=Gn[e.v];break;case"d":p="DateTime",x=new Date(e.v).toISOString(),e.z==null&&(e.z=e.z||ut[14]);break;case"s":p="String",x=zf(e.v||"");break}var l=Ur(n.cellXfs,e,n);c["ss:StyleID"]="s"+(21+l),c["ss:Index"]=a.c+1;var y=e.v!=null?x:"",g=e.t=="z"?"":'<Data ss:Type="'+p+'">'+y+"</Data>";return(e.c||[]).length>0&&(g+=Ux(e.c)),ce("Cell",g,c)}function Vx(e,t){var r='<Row ss:Index="'+(e+1)+'"';return t&&(t.hpt&&!t.hpx&&(t.hpx=Ll(t.hpt)),t.hpx&&(r+=' ss:AutoFitHeight="0" ss:Height="'+t.hpx+'"'),t.hidden&&(r+=' ss:Hidden="1"')),r+">"}function zx(e,t,r,n){if(!e["!ref"])return"";var i=it(e["!ref"]),s=e["!merges"]||[],a=0,c=[];e["!cols"]&&e["!cols"].forEach(function(m,E){Ns(m);var D=!!m.width,C=Ni(E,m),N={"ss:Index":E+1};D&&(N["ss:Width"]=wi(C.width)),m.hidden&&(N["ss:Hidden"]="1"),c.push(ce("Column",null,N))});for(var u=Array.isArray(e),f=i.s.r;f<=i.e.r;++f){for(var d=[Vx(f,(e["!rows"]||[])[f])],p=i.s.c;p<=i.e.c;++p){var x=!1;for(a=0;a!=s.length;++a)if(!(s[a].s.c>p)&&!(s[a].s.r>f)&&!(s[a].e.c<p)&&!(s[a].e.r<f)){(s[a].s.c!=p||s[a].s.r!=f)&&(x=!0);break}if(!x){var l={r:f,c:p},y=Qe(l),g=u?(e[f]||[])[p]:e[y];d.push(Wx(g,y,e,t,r,n,l))}}d.push("</Row>"),d.length>2&&c.push(d.join(""))}return c.join("")}function Hx(e,t,r){var n=[],i=r.SheetNames[e],s=r.Sheets[i],a=s?Lx(s,t,e,r):"";return a.length>0&&n.push("<Names>"+a+"</Names>"),a=s?zx(s,t,e,r):"",a.length>0&&n.push("<Table>"+a+"</Table>"),n.push(Bx(s,t,e,r)),n.join("")}function $x(e,t){t||(t={}),e.SSF||(e.SSF=qt(ut)),e.SSF&&(Ai(),Di(e.SSF),t.revssf=Oi(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF,t.cellXfs=[],Ur(t.cellXfs,{},{revssf:{General:0}}));var r=[];r.push(Rx(e,t)),r.push(Px()),r.push(""),r.push("");for(var n=0;n<e.SheetNames.length;++n)r.push(ce("Worksheet",Hx(n,t,e),{"ss:Name":Ze(e.SheetNames[n])}));return r[2]=jx(e,t),r[3]=Mx(e),xt+ce("Workbook",r.join(""),{xmlns:tr.ss,"xmlns:o":tr.o,"xmlns:x":tr.x,"xmlns:ss":tr.ss,"xmlns:dt":tr.dt,"xmlns:html":tr.html})}var Ki={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function Gx(e,t){var r=[],n=[],i=[],s=0,a,c=ma(ka,"n"),u=ma(Fa,"n");if(e.Props)for(a=It(e.Props),s=0;s<a.length;++s)(Object.prototype.hasOwnProperty.call(c,a[s])?r:Object.prototype.hasOwnProperty.call(u,a[s])?n:i).push([a[s],e.Props[a[s]]]);if(e.Custprops)for(a=It(e.Custprops),s=0;s<a.length;++s)Object.prototype.hasOwnProperty.call(e.Props||{},a[s])||(Object.prototype.hasOwnProperty.call(c,a[s])?r:Object.prototype.hasOwnProperty.call(u,a[s])?n:i).push([a[s],e.Custprops[a[s]]]);var f=[];for(s=0;s<i.length;++s)Al.indexOf(i[s][0])>-1||Cl.indexOf(i[s][0])>-1||i[s][1]!=null&&f.push(i[s]);n.length&&et.utils.cfb_add(t,"/SummaryInformation",ja(n,Ki.SI,u,Fa)),(r.length||f.length)&&et.utils.cfb_add(t,"/DocumentSummaryInformation",ja(r,Ki.DSI,c,ka,f.length?f:null,Ki.UDI))}function Xx(e,t){var r=t||{},n=et.utils.cfb_new({root:"R"}),i="/Workbook";switch(r.bookType||"xls"){case"xls":r.bookType="biff8";case"xla":r.bookType||(r.bookType="xla");case"biff8":i="/Workbook",r.biff=8;break;case"biff5":i="/Book",r.biff=5;break;default:throw new Error("invalid type "+r.bookType+" for XLS CFB")}return et.utils.cfb_add(n,i,sc(e,r)),r.biff==8&&(e.Props||e.Custprops)&&Gx(e,n),r.biff==8&&e.vbaraw&&ud(n,et.read(e.vbaraw,{type:typeof e.vbaraw=="string"?"binary":"buffer"})),n}var Yx={0:{f:J1},1:{f:sp},2:{f:Cp},3:{f:dp},4:{f:cp},5:{f:Tp},6:{f:kp},7:{f:mp},8:{f:Mp},9:{f:jp},10:{f:Rp},11:{f:Pp},12:{f:op},13:{f:Dp},14:{f:xp},15:{f:up},16:{f:Ep},17:{f:Ip},18:{f:yp},19:{f:Os},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:_x},40:{},42:{},43:{f:kh},44:{f:Ah},45:{f:Nh},46:{f:Ph},47:{f:Rh},48:{},49:{f:ou},50:{},51:{f:Jh},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:lh},62:{f:Op},63:{f:nd},64:{f:Qp},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:Er,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:Kp},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:np},148:{f:ep,p:16},151:{f:zp},152:{},153:{f:wx},154:{},155:{},156:{f:vx},157:{},158:{},159:{T:1,f:vh},160:{T:-1},161:{T:1,f:tn},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:Lp},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:Kh},336:{T:-1},337:{f:ed,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:os},357:{},358:{},359:{},360:{T:1},361:{},362:{f:rh},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:Hp},427:{f:$p},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:Xp},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:rp},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:Wp},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:os},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:ld},633:{T:1},634:{T:-1},635:{T:1,f:ad},636:{T:-1},637:{f:uu},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:hx},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:ex},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}};function fe(e,t,r,n){var i=t;if(!isNaN(i)){var s=n||(r||[]).length||0,a=e.next(4);a.write_shift(2,i),a.write_shift(2,s),s>0&&bs(r)&&e.push(r)}}function Kx(e,t,r,n){var i=(r||[]).length||0;if(i<=8224)return fe(e,t,r,i);var s=t;if(!isNaN(s)){for(var a=r.parts||[],c=0,u=0,f=0;f+(a[c]||8224)<=8224;)f+=a[c]||8224,c++;var d=e.next(4);for(d.write_shift(2,s),d.write_shift(2,f),e.push(r.slice(u,u+f)),u+=f;u<i;){for(d=e.next(4),d.write_shift(2,60),f=0;f+(a[c]||8224)<=8224;)f+=a[c]||8224,c++;d.write_shift(2,f),e.push(r.slice(u,u+f)),u+=f}}}function Yn(e,t,r){return e||(e=q(7)),e.write_shift(2,t),e.write_shift(2,r),e.write_shift(2,0),e.write_shift(1,0),e}function qx(e,t,r,n){var i=q(9);return Yn(i,e,t),kl(r,n||"b",i),i}function Jx(e,t,r){var n=q(8+2*r.length);return Yn(n,e,t),n.write_shift(1,r.length),n.write_shift(r.length,r,"sbcs"),n.l<n.length?n.slice(0,n.l):n}function Zx(e,t,r,n){if(t.v!=null)switch(t.t){case"d":case"n":var i=t.t=="d"?Kt(zt(t.v)):t.v;i==(i|0)&&i>=0&&i<65536?fe(e,2,hh(r,n,i)):fe(e,3,uh(r,n,i));return;case"b":case"e":fe(e,5,qx(r,n,t.v,t.t));return;case"s":case"str":fe(e,4,Jx(r,n,(t.v||"").slice(0,255)));return}fe(e,1,Yn(null,r,n))}function Qx(e,t,r,n){var i=Array.isArray(t),s=it(t["!ref"]||"A1"),a,c="",u=[];if(s.e.c>255||s.e.r>16383){if(n.WTF)throw new Error("Range "+(t["!ref"]||"A1")+" exceeds format limit A1:IV16384");s.e.c=Math.min(s.e.c,255),s.e.r=Math.min(s.e.c,16383),a=pt(s)}for(var f=s.s.r;f<=s.e.r;++f){c=Ft(f);for(var d=s.s.c;d<=s.e.c;++d){f===s.s.r&&(u[d]=jt(d)),a=u[d]+c;var p=i?(t[f]||[])[d]:t[a];p&&Zx(e,p,f,d)}}}function eg(e,t){for(var r=t||{},n=Yt(),i=0,s=0;s<e.SheetNames.length;++s)e.SheetNames[s]==r.sheet&&(i=s);if(i==0&&r.sheet&&e.SheetNames[0]!=r.sheet)throw new Error("Sheet not found: "+r.sheet);return fe(n,r.biff==4?1033:r.biff==3?521:9,Is(e,16,r)),Qx(n,e.Sheets[e.SheetNames[i]],i,r),fe(n,10),n.end()}function tg(e,t,r){fe(e,49,Yu({sz:12,name:"Arial"},r))}function rg(e,t,r){t&&[[5,8],[23,26],[41,44],[50,392]].forEach(function(n){for(var i=n[0];i<=n[1];++i)t[i]!=null&&fe(e,1054,Ju(i,t[i],r))})}function ng(e,t){var r=q(19);r.write_shift(4,2151),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,1),r.write_shift(4,0),fe(e,2151,r),r=q(39),r.write_shift(4,2152),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,0),r.write_shift(4,0),r.write_shift(2,1),r.write_shift(4,4),r.write_shift(2,0),Nl(it(t["!ref"]||"A1"),r),r.write_shift(4,4),fe(e,2152,r)}function ig(e,t){for(var r=0;r<16;++r)fe(e,224,La({numFmtId:0,style:!0},0,t));t.cellXfs.forEach(function(n){fe(e,224,La(n,0,t))})}function sg(e,t){for(var r=0;r<t["!links"].length;++r){var n=t["!links"][r];fe(e,440,sh(n)),n[1].Tooltip&&fe(e,2048,ah(n))}delete t["!links"]}function ag(e,t){if(t){var r=0;t.forEach(function(n,i){++r<=256&&n&&fe(e,125,ch(Ni(i,n),i))})}}function og(e,t,r,n,i){var s=16+Ur(i.cellXfs,t,i);if(t.v==null&&!t.bf){fe(e,513,Yr(r,n,s));return}if(t.bf)fe(e,6,F1(t,r,n,i,s));else switch(t.t){case"d":case"n":var a=t.t=="d"?Kt(zt(t.v)):t.v;fe(e,515,th(r,n,a,s));break;case"b":case"e":fe(e,517,eh(r,n,t.v,s,i,t.t));break;case"s":case"str":if(i.bookSST){var c=Ms(i.Strings,t.v,i.revStrings);fe(e,253,Ku(r,n,c,s))}else fe(e,516,qu(r,n,(t.v||"").slice(0,255),s,i));break;default:fe(e,513,Yr(r,n,s))}}function lg(e,t,r){var n=Yt(),i=r.SheetNames[e],s=r.Sheets[i]||{},a=(r||{}).Workbook||{},c=(a.Sheets||[])[e]||{},u=Array.isArray(s),f=t.biff==8,d,p="",x=[],l=it(s["!ref"]||"A1"),y=f?65536:16384;if(l.e.c>255||l.e.r>=y){if(t.WTF)throw new Error("Range "+(s["!ref"]||"A1")+" exceeds format limit A1:IV16384");l.e.c=Math.min(l.e.c,255),l.e.r=Math.min(l.e.c,y-1)}fe(n,2057,Is(r,16,t)),fe(n,13,or(1)),fe(n,12,or(100)),fe(n,15,Vt(!0)),fe(n,17,Vt(!1)),fe(n,16,Xr(.001)),fe(n,95,Vt(!0)),fe(n,42,Vt(!1)),fe(n,43,Vt(!1)),fe(n,130,or(1)),fe(n,128,Qu()),fe(n,131,Vt(!1)),fe(n,132,Vt(!1)),f&&ag(n,s["!cols"]),fe(n,512,Zu(l,t)),f&&(s["!links"]=[]);for(var g=l.s.r;g<=l.e.r;++g){p=Ft(g);for(var m=l.s.c;m<=l.e.c;++m){g===l.s.r&&(x[m]=jt(m)),d=x[m]+p;var E=u?(s[g]||[])[m]:s[d];E&&(og(n,E,g,m,t),f&&E.l&&s["!links"].push([d,E.l]))}}var D=c.CodeName||c.name||i;return f&&fe(n,574,Xu((a.Views||[])[0])),f&&(s["!merges"]||[]).length&&fe(n,229,ih(s["!merges"])),f&&sg(n,s),fe(n,442,Il(D)),f&&ng(n,s),fe(n,10),n.end()}function cg(e,t,r){var n=Yt(),i=(e||{}).Workbook||{},s=i.Sheets||[],a=i.WBProps||{},c=r.biff==8,u=r.biff==5;if(fe(n,2057,Is(e,5,r)),r.bookType=="xla"&&fe(n,135),fe(n,225,c?or(1200):null),fe(n,193,Ru(2)),u&&fe(n,191),u&&fe(n,192),fe(n,226),fe(n,92,zu("SheetJS",r)),fe(n,66,or(c?1200:1252)),c&&fe(n,353,or(0)),c&&fe(n,448),fe(n,317,fh(e.SheetNames.length)),c&&e.vbaraw&&fe(n,211),c&&e.vbaraw){var f=a.CodeName||"ThisWorkbook";fe(n,442,Il(f))}fe(n,156,or(17)),fe(n,25,Vt(!1)),fe(n,18,Vt(!1)),fe(n,19,or(0)),c&&fe(n,431,Vt(!1)),c&&fe(n,444,or(0)),fe(n,61,Gu()),fe(n,64,Vt(!1)),fe(n,141,or(0)),fe(n,34,Vt(px(e)=="true")),fe(n,14,Vt(!0)),c&&fe(n,439,Vt(!1)),fe(n,218,or(0)),tg(n,e,r),rg(n,e.SSF,r),ig(n,r),c&&fe(n,352,Vt(!1));var d=n.end(),p=Yt();c&&fe(p,140,oh()),c&&r.Strings&&Kx(p,252,$u(r.Strings)),fe(p,10);var x=p.end(),l=Yt(),y=0,g=0;for(g=0;g<e.SheetNames.length;++g)y+=(c?12:11)+(c?2:1)*e.SheetNames[g].length;var m=d.length+y+x.length;for(g=0;g<e.SheetNames.length;++g){var E=s[g]||{};fe(l,133,Hu({pos:m,hs:E.Hidden||0,dt:0,name:e.SheetNames[g]},r)),m+=t[g].length}var D=l.end();if(y!=D.length)throw new Error("BS8 "+y+" != "+D.length);var C=[];return d.length&&C.push(d),D.length&&C.push(D),x.length&&C.push(x),Ot(C)}function fg(e,t){var r=t||{},n=[];e&&!e.SSF&&(e.SSF=qt(ut)),e&&e.SSF&&(Ai(),Di(e.SSF),r.revssf=Oi(e.SSF),r.revssf[e.SSF[65535]]=0,r.ssf=e.SSF),r.Strings=[],r.Strings.Count=0,r.Strings.Unique=0,Ls(r),r.cellXfs=[],Ur(r.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={});for(var i=0;i<e.SheetNames.length;++i)n[n.length]=lg(i,r,e);return n.unshift(cg(e,n,r)),Ot(n)}function sc(e,t){for(var r=0;r<=e.SheetNames.length;++r){var n=e.Sheets[e.SheetNames[r]];if(!(!n||!n["!ref"])){var i=nr(n["!ref"]);i.e.c>255&&typeof console<"u"&&console.error&&console.error("Worksheet '"+e.SheetNames[r]+"' extends beyond column IV (255). Data may be lost.")}}var s=t||{};switch(s.biff||2){case 8:case 5:return fg(e,t);case 4:case 3:case 2:return eg(e,t)}throw new Error("invalid type "+s.bookType+" for BIFF")}function ug(e,t,r,n){for(var i=e["!merges"]||[],s=[],a=t.s.c;a<=t.e.c;++a){for(var c=0,u=0,f=0;f<i.length;++f)if(!(i[f].s.r>r||i[f].s.c>a)&&!(i[f].e.r<r||i[f].e.c<a)){if(i[f].s.r<r||i[f].s.c<a){c=-1;break}c=i[f].e.r-i[f].s.r+1,u=i[f].e.c-i[f].s.c+1;break}if(!(c<0)){var d=Qe({r,c:a}),p=n.dense?(e[r]||[])[a]:e[d],x=p&&p.v!=null&&(p.h||Vf(p.w||(Fr(p),p.w)||""))||"",l={};c>1&&(l.rowspan=c),u>1&&(l.colspan=u),n.editable?x='<span contenteditable="true">'+x+"</span>":p&&(l["data-t"]=p&&p.t||"z",p.v!=null&&(l["data-v"]=p.v),p.z!=null&&(l["data-z"]=p.z),p.l&&(p.l.Target||"#").charAt(0)!="#"&&(x='<a href="'+p.l.Target+'">'+x+"</a>")),l.id=(n.id||"sjs")+"-"+d,s.push(ce("td",x,l))}}var y="<tr>";return y+s.join("")+"</tr>"}var hg='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',dg="</body></html>";function pg(e,t,r){var n=[];return n.join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function ac(e,t){var r=t||{},n=r.header!=null?r.header:hg,i=r.footer!=null?r.footer:dg,s=[n],a=nr(e["!ref"]);r.dense=Array.isArray(e),s.push(pg(e,a,r));for(var c=a.s.r;c<=a.e.r;++c)s.push(ug(e,a,c,r));return s.push("</table>"+i),s.join("")}function oc(e,t,r){var n=r||{},i=0,s=0;if(n.origin!=null)if(typeof n.origin=="number")i=n.origin;else{var a=typeof n.origin=="string"?Et(n.origin):n.origin;i=a.r,s=a.c}var c=t.getElementsByTagName("tr"),u=Math.min(n.sheetRows||1e7,c.length),f={s:{r:0,c:0},e:{r:i,c:s}};if(e["!ref"]){var d=nr(e["!ref"]);f.s.r=Math.min(f.s.r,d.s.r),f.s.c=Math.min(f.s.c,d.s.c),f.e.r=Math.max(f.e.r,d.e.r),f.e.c=Math.max(f.e.c,d.e.c),i==-1&&(f.e.r=i=d.e.r+1)}var p=[],x=0,l=e["!rows"]||(e["!rows"]=[]),y=0,g=0,m=0,E=0,D=0,C=0;for(e["!cols"]||(e["!cols"]=[]);y<c.length&&g<u;++y){var N=c[y];if($a(N)){if(n.display)continue;l[g]={hidden:!0}}var L=N.children;for(m=E=0;m<L.length;++m){var Q=L[m];if(!(n.display&&$a(Q))){var k=Q.hasAttribute("data-v")?Q.getAttribute("data-v"):Q.hasAttribute("v")?Q.getAttribute("v"):Gf(Q.innerHTML),V=Q.getAttribute("data-z")||Q.getAttribute("z");for(x=0;x<p.length;++x){var j=p[x];j.s.c==E+s&&j.s.r<g+i&&g+i<=j.e.r&&(E=j.e.c+1-s,x=-1)}C=+Q.getAttribute("colspan")||1,((D=+Q.getAttribute("rowspan")||1)>1||C>1)&&p.push({s:{r:g+i,c:E+s},e:{r:g+i+(D||1)-1,c:E+s+(C||1)-1}});var B={t:"s",v:k},X=Q.getAttribute("data-t")||Q.getAttribute("t")||"";k!=null&&(k.length==0?B.t=X||"z":n.raw||k.trim().length==0||X=="s"||(k==="TRUE"?B={t:"b",v:!0}:k==="FALSE"?B={t:"b",v:!1}:isNaN(Ar(k))?isNaN(Mn(k).getDate())||(B={t:"d",v:zt(k)},n.cellDates||(B={t:"n",v:Kt(B.v)}),B.z=n.dateNF||ut[14]):B={t:"n",v:Ar(k)})),B.z===void 0&&V!=null&&(B.z=V);var M="",ee=Q.getElementsByTagName("A");if(ee&&ee.length)for(var Te=0;Te<ee.length&&!(ee[Te].hasAttribute("href")&&(M=ee[Te].getAttribute("href"),M.charAt(0)!="#"));++Te);M&&M.charAt(0)!="#"&&(B.l={Target:M}),n.dense?(e[g+i]||(e[g+i]=[]),e[g+i][E+s]=B):e[Qe({c:E+s,r:g+i})]=B,f.e.c<E+s&&(f.e.c=E+s),E+=C}}++g}return p.length&&(e["!merges"]=(e["!merges"]||[]).concat(p)),f.e.r=Math.max(f.e.r,g-1+i),e["!ref"]=pt(f),g>=u&&(e["!fullref"]=pt((f.e.r=c.length-y+g-1+i,f))),e}function lc(e,t){var r=t||{},n=r.dense?[]:{};return oc(n,e,t)}function xg(e,t){return Jr(lc(e,t),t)}function $a(e){var t="",r=gg(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),t==="none"}function gg(e){return e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle=="function"?e.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}var mg=(function(){var e=["<office:master-styles>",'<style:master-page style:name="mp1" style:page-layout-name="mp1">',"<style:header/>",'<style:header-left style:display="false"/>',"<style:footer/>",'<style:footer-left style:display="false"/>',"</style:master-page>","</office:master-styles>"].join(""),t="<office:document-styles "+Bn({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","office:version":"1.2"})+">"+e+"</office:document-styles>";return function(){return xt+t}})(),Ga=(function(){var e=function(s){return Ze(s).replace(/ +/g,function(a){return'<text:s text:c="'+a.length+'"/>'}).replace(/\t/g,"<text:tab/>").replace(/\n/g,"</text:p><text:p>").replace(/^ /,"<text:s/>").replace(/ $/,"<text:s/>")},t=` <table:table-cell />
|
|
60
60
|
`,r=` <table:covered-table-cell/>
|
|
61
|
-
`,n=function(s,a,
|
|
62
|
-
`);var
|
|
63
|
-
`);var g="",
|
|
64
|
-
`);for(;
|
|
65
|
-
`),d=0;d<
|
|
66
|
-
`)}
|
|
67
|
-
`)}return
|
|
68
|
-
`),
|
|
61
|
+
`,n=function(s,a,c){var u=[];u.push(' <table:table table:name="'+Ze(a.SheetNames[c])+`" table:style-name="ta1">
|
|
62
|
+
`);var f=0,d=0,p=nr(s["!ref"]||"A1"),x=s["!merges"]||[],l=0,y=Array.isArray(s);if(s["!cols"])for(d=0;d<=p.e.c;++d)u.push(" <table:table-column"+(s["!cols"][d]?' table:style-name="co'+s["!cols"][d].ods+'"':"")+`></table:table-column>
|
|
63
|
+
`);var g="",m=s["!rows"]||[];for(f=0;f<p.s.r;++f)g=m[f]?' table:style-name="ro'+m[f].ods+'"':"",u.push(" <table:table-row"+g+`></table:table-row>
|
|
64
|
+
`);for(;f<=p.e.r;++f){for(g=m[f]?' table:style-name="ro'+m[f].ods+'"':"",u.push(" <table:table-row"+g+`>
|
|
65
|
+
`),d=0;d<p.s.c;++d)u.push(t);for(;d<=p.e.c;++d){var E=!1,D={},C="";for(l=0;l!=x.length;++l)if(!(x[l].s.c>d)&&!(x[l].s.r>f)&&!(x[l].e.c<d)&&!(x[l].e.r<f)){(x[l].s.c!=d||x[l].s.r!=f)&&(E=!0),D["table:number-columns-spanned"]=x[l].e.c-x[l].s.c+1,D["table:number-rows-spanned"]=x[l].e.r-x[l].s.r+1;break}if(E){u.push(r);continue}var N=Qe({r:f,c:d}),L=y?(s[f]||[])[d]:s[N];if(L&&L.f&&(D["table:formula"]=Ze(M1(L.f)),L.F&&L.F.slice(0,N.length)==N)){var Q=nr(L.F);D["table:number-matrix-columns-spanned"]=Q.e.c-Q.s.c+1,D["table:number-matrix-rows-spanned"]=Q.e.r-Q.s.r+1}if(!L){u.push(t);continue}switch(L.t){case"b":C=L.v?"TRUE":"FALSE",D["office:value-type"]="boolean",D["office:boolean-value"]=L.v?"true":"false";break;case"n":C=L.w||String(L.v||0),D["office:value-type"]="float",D["office:value"]=L.v||0;break;case"s":case"str":C=L.v==null?"":L.v,D["office:value-type"]="string";break;case"d":C=L.w||zt(L.v).toISOString(),D["office:value-type"]="date",D["office:date-value"]=zt(L.v).toISOString(),D["table:style-name"]="ce1";break;default:u.push(t);continue}var k=e(C);if(L.l&&L.l.Target){var V=L.l.Target;V=V.charAt(0)=="#"?"#"+L1(V.slice(1)):V,V.charAt(0)!="#"&&!V.match(/^\w+:/)&&(V="../"+V),k=ce("text:a",k,{"xlink:href":V.replace(/&/g,"&")})}u.push(" "+ce("table:table-cell",ce("text:p",k,{}),D)+`
|
|
66
|
+
`)}u.push(` </table:table-row>
|
|
67
|
+
`)}return u.push(` </table:table>
|
|
68
|
+
`),u.join("")},i=function(s,a){s.push(` <office:automatic-styles>
|
|
69
69
|
`),s.push(` <number:date-style style:name="N37" number:automatic-order="true">
|
|
70
70
|
`),s.push(` <number:month number:style="long"/>
|
|
71
71
|
`),s.push(` <number:text>/</number:text>
|
|
@@ -73,377 +73,273 @@
|
|
|
73
73
|
`),s.push(` <number:text>/</number:text>
|
|
74
74
|
`),s.push(` <number:year/>
|
|
75
75
|
`),s.push(` </number:date-style>
|
|
76
|
-
`);var
|
|
77
|
-
`),s.push(' <style:table-column-properties fo:break-before="auto" style:column-width="'+
|
|
76
|
+
`);var c=0;a.SheetNames.map(function(f){return a.Sheets[f]}).forEach(function(f){if(f&&f["!cols"]){for(var d=0;d<f["!cols"].length;++d)if(f["!cols"][d]){var p=f["!cols"][d];if(p.width==null&&p.wpx==null&&p.wch==null)continue;Ns(p),p.ods=c;var x=f["!cols"][d].wpx+"px";s.push(' <style:style style:name="co'+c+`" style:family="table-column">
|
|
77
|
+
`),s.push(' <style:table-column-properties fo:break-before="auto" style:column-width="'+x+`"/>
|
|
78
78
|
`),s.push(` </style:style>
|
|
79
|
-
`),++
|
|
80
|
-
`),s.push(' <style:table-row-properties fo:break-before="auto" style:row-height="'+
|
|
79
|
+
`),++c}}});var u=0;a.SheetNames.map(function(f){return a.Sheets[f]}).forEach(function(f){if(f&&f["!rows"]){for(var d=0;d<f["!rows"].length;++d)if(f["!rows"][d]){f["!rows"][d].ods=u;var p=f["!rows"][d].hpx+"px";s.push(' <style:style style:name="ro'+u+`" style:family="table-row">
|
|
80
|
+
`),s.push(' <style:table-row-properties fo:break-before="auto" style:row-height="'+p+`"/>
|
|
81
81
|
`),s.push(` </style:style>
|
|
82
|
-
`),++
|
|
82
|
+
`),++u}}}),s.push(` <style:style style:name="ta1" style:family="table" style:master-page-name="mp1">
|
|
83
83
|
`),s.push(` <style:table-properties table:display="true" style:writing-mode="lr-tb"/>
|
|
84
84
|
`),s.push(` </style:style>
|
|
85
85
|
`),s.push(` <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>
|
|
86
86
|
`),s.push(` </office:automatic-styles>
|
|
87
|
-
`)};return function(a,
|
|
88
|
-
`),
|
|
89
|
-
`),i(
|
|
90
|
-
`),
|
|
91
|
-
`);for(var
|
|
92
|
-
`),
|
|
93
|
-
`),o.bookType=="fods"?f.push("</office:document>"):f.push("</office:document-content>"),f.join("")}})();function Iu(e,t){if(t.bookType=="fods")return Nl(e,t);var r=Ka(),n="",i=[],s=[];return n="mimetype",Ue(r,n,"application/vnd.oasis.opendocument.spreadsheet"),n="content.xml",Ue(r,n,Nl(e,t)),i.push([n,"text/xml"]),s.push([n,"ContentFile"]),n="styles.xml",Ue(r,n,my(e,t)),i.push([n,"text/xml"]),s.push([n,"StylesFile"]),n="meta.xml",Ue(r,n,Mt+H0()),i.push([n,"text/xml"]),s.push([n,"MetadataFile"]),n="manifest.rdf",Ue(r,n,Op(s)),i.push([n,"application/rdf+xml"]),n="META-INF/manifest.xml",Ue(r,n,Cp(i)),r}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function xs(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function xy(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Nr(Ti(e))}function vy(e,t){e:for(var r=0;r<=e.length-t.length;++r){for(var n=0;n<t.length;++n)if(e[r+n]!=t[n])continue e;return!0}return!1}function ln(e){var t=e.reduce(function(i,s){return i+s.length},0),r=new Uint8Array(t),n=0;return e.forEach(function(i){r.set(i,n),n+=i.length}),r}function yy(e,t,r){var n=Math.floor(r==0?0:Math.LOG10E*Math.log(Math.abs(r)))+6176-20,i=r/Math.pow(10,n-6176);e[t+15]|=n>>7,e[t+14]|=(n&127)<<1;for(var s=0;i>=1;++s,i/=256)e[t+s]=i&255;e[t+15]|=r>=0?0:128}function Ei(e,t){var r=t?t[0]:0,n=e[r]&127;e:if(e[r++]>=128&&(n|=(e[r]&127)<<7,e[r++]<128||(n|=(e[r]&127)<<14,e[r++]<128)||(n|=(e[r]&127)<<21,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t&&(t[0]=r),n}function at(e){var t=new Uint8Array(7);t[0]=e&127;var r=1;e:if(e>127){if(t[r-1]|=128,t[r]=e>>7&127,++r,e<=16383||(t[r-1]|=128,t[r]=e>>14&127,++r,e<=2097151)||(t[r-1]|=128,t[r]=e>>21&127,++r,e<=268435455)||(t[r-1]|=128,t[r]=e/256>>>21&127,++r,e<=34359738367)||(t[r-1]|=128,t[r]=e/65536>>>21&127,++r,e<=4398046511103))break e;t[r-1]|=128,t[r]=e/16777216>>>21&127,++r}return t.slice(0,r)}function Xn(e){var t=0,r=e[t]&127;e:if(e[t++]>=128){if(r|=(e[t]&127)<<7,e[t++]<128||(r|=(e[t]&127)<<14,e[t++]<128)||(r|=(e[t]&127)<<21,e[t++]<128))break e;r|=(e[t]&127)<<28}return r}function $t(e){for(var t=[],r=[0];r[0]<e.length;){var n=r[0],i=Ei(e,r),s=i&7;i=Math.floor(i/8);var a=0,o;if(i==0)break;switch(s){case 0:{for(var f=r[0];e[r[0]++]>=128;);o=e.slice(f,r[0])}break;case 5:a=4,o=e.slice(r[0],r[0]+a),r[0]+=a;break;case 1:a=8,o=e.slice(r[0],r[0]+a),r[0]+=a;break;case 2:a=Ei(e,r),o=e.slice(r[0],r[0]+a),r[0]+=a;break;case 3:case 4:default:throw new Error("PB Type ".concat(s," for Field ").concat(i," at offset ").concat(n))}var u={data:o,type:s};t[i]==null?t[i]=[u]:t[i].push(u)}return t}function Kt(e){var t=[];return e.forEach(function(r,n){r.forEach(function(i){i.data&&(t.push(at(n*8+i.type)),i.type==2&&t.push(at(i.data.length)),t.push(i.data))})}),ln(t)}function Ir(e){for(var t,r=[],n=[0];n[0]<e.length;){var i=Ei(e,n),s=$t(e.slice(n[0],n[0]+i));n[0]+=i;var a={id:Xn(s[1][0].data),messages:[]};s[2].forEach(function(o){var f=$t(o.data),u=Xn(f[3][0].data);a.messages.push({meta:f,data:e.slice(n[0],n[0]+u)}),n[0]+=u}),(t=s[3])!=null&&t[0]&&(a.merge=Xn(s[3][0].data)>>>0>0),r.push(a)}return r}function Nn(e){var t=[];return e.forEach(function(r){var n=[];n[1]=[{data:at(r.id),type:0}],n[2]=[],r.merge!=null&&(n[3]=[{data:at(+!!r.merge),type:0}]);var i=[];r.messages.forEach(function(a){i.push(a.data),a.meta[3]=[{type:0,data:at(a.data.length)}],n[2].push({data:Kt(a.meta),type:2})});var s=Kt(n);t.push(at(s.length)),t.push(s),i.forEach(function(a){return t.push(a)})}),ln(t)}function wy(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],n=Ei(t,r),i=[];r[0]<t.length;){var s=t[r[0]]&3;if(s==0){var a=t[r[0]++]>>2;if(a<60)++a;else{var o=a-59;a=t[r[0]],o>1&&(a|=t[r[0]+1]<<8),o>2&&(a|=t[r[0]+2]<<16),o>3&&(a|=t[r[0]+3]<<24),a>>>=0,a++,r[0]+=o}i.push(t.slice(r[0],r[0]+a)),r[0]+=a;continue}else{var f=0,u=0;if(s==1?(u=(t[r[0]]>>2&7)+4,f=(t[r[0]++]&224)<<3,f|=t[r[0]++]):(u=(t[r[0]++]>>2)+1,s==2?(f=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(f=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),i=[ln(i)],f==0)throw new Error("Invalid offset 0");if(f>i[0].length)throw new Error("Invalid offset beyond length");if(u>=f)for(i.push(i[0].slice(-f)),u-=f;u>=i[i.length-1].length;)i.push(i[i.length-1]),u-=i[i.length-1].length;i.push(i[0].slice(-f,-f+u))}}var d=ln(i);if(d.length!=n)throw new Error("Unexpected length: ".concat(d.length," != ").concat(n));return d}function Fr(e){for(var t=[],r=0;r<e.length;){var n=e[r++],i=e[r]|e[r+1]<<8|e[r+2]<<16;r+=3,t.push(wy(n,e.slice(r,r+i))),r+=i}if(r!==e.length)throw new Error("data is not a valid framed stream!");return ln(t)}function Rn(e){for(var t=[],r=0;r<e.length;){var n=Math.min(e.length-r,268435455),i=new Uint8Array(4);t.push(i);var s=at(n),a=s.length;t.push(s),n<=60?(a++,t.push(new Uint8Array([n-1<<2]))):n<=256?(a+=2,t.push(new Uint8Array([240,n-1&255]))):n<=65536?(a+=3,t.push(new Uint8Array([244,n-1&255,n-1>>8&255]))):n<=16777216?(a+=4,t.push(new Uint8Array([248,n-1&255,n-1>>8&255,n-1>>16&255]))):n<=4294967296&&(a+=5,t.push(new Uint8Array([252,n-1&255,n-1>>8&255,n-1>>16&255,n-1>>>24&255]))),t.push(e.slice(r,r+n)),a+=n,i[0]=0,i[1]=a&255,i[2]=a>>8&255,i[3]=a>>16&255,r+=n}return ln(t)}function aa(e,t){var r=new Uint8Array(32),n=xs(r),i=12,s=0;switch(r[0]=5,e.t){case"n":r[1]=2,yy(r,i,e.v),s|=1,i+=16;break;case"b":r[1]=6,n.setFloat64(i,e.v?1:0,!0),s|=2,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[1]=3,n.setUint32(i,t.indexOf(e.v),!0),s|=8,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(8,s,!0),r.slice(0,i)}function oa(e,t){var r=new Uint8Array(32),n=xs(r),i=12,s=0;switch(r[0]=3,e.t){case"n":r[2]=2,n.setFloat64(i,e.v,!0),s|=32,i+=8;break;case"b":r[2]=6,n.setFloat64(i,e.v?1:0,!0),s|=32,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[2]=3,n.setUint32(i,t.indexOf(e.v),!0),s|=16,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(4,s,!0),r.slice(0,i)}function Qr(e){var t=$t(e);return Ei(t[1][0].data)}function Ty(e,t,r){var n,i,s,a;if(!((n=e[6])!=null&&n[0])||!((i=e[7])!=null&&i[0]))throw"Mutation only works on post-BNC storages!";var o=((a=(s=e[8])==null?void 0:s[0])==null?void 0:a.data)&&Xn(e[8][0].data)>0||!1;if(o)throw"Math only works with normal offsets";for(var f=0,u=xs(e[7][0].data),d=0,h=[],m=xs(e[4][0].data),l=0,v=[],g=0;g<t.length;++g){if(t[g]==null){u.setUint16(g*2,65535,!0),m.setUint16(g*2,65535);continue}u.setUint16(g*2,d,!0),m.setUint16(g*2,l,!0);var x,T;switch(typeof t[g]){case"string":x=aa({t:"s",v:t[g]},r),T=oa({t:"s",v:t[g]},r);break;case"number":x=aa({t:"n",v:t[g]},r),T=oa({t:"n",v:t[g]},r);break;case"boolean":x=aa({t:"b",v:t[g]},r),T=oa({t:"b",v:t[g]},r);break;default:throw new Error("Unsupported value "+t[g])}h.push(x),d+=x.length,v.push(T),l+=T.length,++f}for(e[2][0].data=at(f);g<e[7][0].data.length/2;++g)u.setUint16(g*2,65535,!0),m.setUint16(g*2,65535,!0);return e[6][0].data=ln(h),e[3][0].data=ln(v),f}function Sy(e,t){if(!t||!t.numbers)throw new Error("Must pass a `numbers` option -- check the README");var r=e.Sheets[e.SheetNames[0]];e.SheetNames.length>1&&console.error("The Numbers writer currently writes only the first table");var n=Sr(r["!ref"]);n.s.r=n.s.c=0;var i=!1;n.e.c>9&&(i=!0,n.e.c=9),n.e.r>49&&(i=!0,n.e.r=49),i&&console.error("The Numbers writer is currently limited to ".concat(jt(n)));var s=vs(r,{range:n,header:1}),a=["~Sh33tJ5~"];s.forEach(function(j){return j.forEach(function(R){typeof R=="string"&&a.push(R)})});var o={},f=[],u=ht.read(t.numbers,{type:"base64"});u.FileIndex.map(function(j,R){return[j,u.FullPaths[R]]}).forEach(function(j){var R=j[0],P=j[1];if(R.type==2&&R.name.match(/\.iwa/)){var V=R.content,le=Fr(V),fe=Ir(le);fe.forEach(function(ue){f.push(ue.id),o[ue.id]={deps:[],location:P,type:Xn(ue.messages[0].meta[1][0].data)}})}}),f.sort(function(j,R){return j-R});var d=f.filter(function(j){return j>1}).map(function(j){return[j,at(j)]});u.FileIndex.map(function(j,R){return[j,u.FullPaths[R]]}).forEach(function(j){var R=j[0];if(j[1],!!R.name.match(/\.iwa/)){var P=Ir(Fr(R.content));P.forEach(function(V){V.messages.forEach(function(le){d.forEach(function(fe){V.messages.some(function(ue){return Xn(ue.meta[1][0].data)!=11006&&vy(ue.data,fe[1])})&&o[fe[0]].deps.push(V.id)})})})}});for(var h=ht.find(u,o[1].location),m=Ir(Fr(h.content)),l,v=0;v<m.length;++v){var g=m[v];g.id==1&&(l=g)}var x=Qr($t(l.messages[0].data)[1][0].data);for(h=ht.find(u,o[x].location),m=Ir(Fr(h.content)),v=0;v<m.length;++v)g=m[v],g.id==x&&(l=g);for(x=Qr($t(l.messages[0].data)[2][0].data),h=ht.find(u,o[x].location),m=Ir(Fr(h.content)),v=0;v<m.length;++v)g=m[v],g.id==x&&(l=g);for(x=Qr($t(l.messages[0].data)[2][0].data),h=ht.find(u,o[x].location),m=Ir(Fr(h.content)),v=0;v<m.length;++v)g=m[v],g.id==x&&(l=g);var T=$t(l.messages[0].data);{T[6][0].data=at(n.e.r+1),T[7][0].data=at(n.e.c+1);var b=Qr(T[46][0].data),_=ht.find(u,o[b].location),k=Ir(Fr(_.content));{for(var F=0;F<k.length&&k[F].id!=b;++F);if(k[F].id!=b)throw"Bad ColumnRowUIDMapArchive";var z=$t(k[F].messages[0].data);z[1]=[],z[2]=[],z[3]=[];for(var N=0;N<=n.e.c;++N){var B=[];B[1]=B[2]=[{type:0,data:at(N+420690)}],z[1].push({type:2,data:Kt(B)}),z[2].push({type:0,data:at(N)}),z[3].push({type:0,data:at(N)})}z[4]=[],z[5]=[],z[6]=[];for(var M=0;M<=n.e.r;++M)B=[],B[1]=B[2]=[{type:0,data:at(M+726270)}],z[4].push({type:2,data:Kt(B)}),z[5].push({type:0,data:at(M)}),z[6].push({type:0,data:at(M)});k[F].messages[0].data=Kt(z)}_.content=Rn(Nn(k)),_.size=_.content.length,delete T[46];var L=$t(T[4][0].data);{L[7][0].data=at(n.e.r+1);var W=$t(L[1][0].data),y=Qr(W[2][0].data);_=ht.find(u,o[y].location),k=Ir(Fr(_.content));{if(k[0].id!=y)throw"Bad HeaderStorageBucket";var H=$t(k[0].messages[0].data);for(M=0;M<s.length;++M){var Q=$t(H[2][0].data);Q[1][0].data=at(M),Q[4][0].data=at(s[M].length),H[2][M]={type:H[2][0].type,data:Kt(Q)}}k[0].messages[0].data=Kt(H)}_.content=Rn(Nn(k)),_.size=_.content.length;var J=Qr(L[2][0].data);_=ht.find(u,o[J].location),k=Ir(Fr(_.content));{if(k[0].id!=J)throw"Bad HeaderStorageBucket";for(H=$t(k[0].messages[0].data),N=0;N<=n.e.c;++N)Q=$t(H[2][0].data),Q[1][0].data=at(N),Q[4][0].data=at(n.e.r+1),H[2][N]={type:H[2][0].type,data:Kt(Q)};k[0].messages[0].data=Kt(H)}_.content=Rn(Nn(k)),_.size=_.content.length;var ee=Qr(L[4][0].data);(function(){for(var j=ht.find(u,o[ee].location),R=Ir(Fr(j.content)),P,V=0;V<R.length;++V){var le=R[V];le.id==ee&&(P=le)}var fe=$t(P.messages[0].data);{fe[3]=[];var ue=[];a.forEach(function(ae,Pe){ue[1]=[{type:0,data:at(Pe)}],ue[2]=[{type:0,data:at(1)}],ue[3]=[{type:2,data:xy(ae)}],fe[3].push({type:2,data:Kt(ue)})})}P.messages[0].data=Kt(fe);var te=Nn(R),Ie=Rn(te);j.content=Ie,j.size=j.content.length})();var _e=$t(L[3][0].data);{var Ae=_e[1][0];delete _e[2];var De=$t(Ae.data);{var oe=Qr(De[2][0].data);(function(){for(var j=ht.find(u,o[oe].location),R=Ir(Fr(j.content)),P,V=0;V<R.length;++V){var le=R[V];le.id==oe&&(P=le)}var fe=$t(P.messages[0].data);{delete fe[6],delete _e[7];var ue=new Uint8Array(fe[5][0].data);fe[5]=[];for(var te=0,Ie=0;Ie<=n.e.r;++Ie){var ae=$t(ue);te+=Ty(ae,s[Ie],a),ae[1][0].data=at(Ie),fe[5].push({data:Kt(ae),type:2})}fe[1]=[{type:0,data:at(n.e.c+1)}],fe[2]=[{type:0,data:at(n.e.r+1)}],fe[3]=[{type:0,data:at(te)}],fe[4]=[{type:0,data:at(n.e.r+1)}]}P.messages[0].data=Kt(fe);var Pe=Nn(R),ke=Rn(Pe);j.content=ke,j.size=j.content.length})()}Ae.data=Kt(De)}L[3][0].data=Kt(_e)}T[4][0].data=Kt(L)}l.messages[0].data=Kt(T);var ce=Nn(m),C=Rn(ce);return h.content=C,h.size=h.content.length,u}function Ey(e){return function(r){for(var n=0;n!=e.length;++n){var i=e[n];r[i[0]]===void 0&&(r[i[0]]=i[1]),i[2]==="n"&&(r[i[0]]=Number(r[i[0]]))}}}function fo(e){Ey([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(e)}function _y(e,t){return t.bookType=="ods"?Iu(e,t):t.bookType=="numbers"?Sy(e,t):t.bookType=="xlsb"?by(e,t):Cy(e,t)}function by(e,t){zn=1024,e&&!e.SSF&&(e.SSF=hr(Dt)),e&&e.SSF&&(bs(),_s(e.SSF),t.revssf=Cs(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,gi?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r=t.bookType=="xlsb"?"bin":"xml",n=hu.indexOf(t.bookType)>-1,i=W0();fo(t=t||{});var s=Ka(),a="",o=0;if(t.cellXfs=[],un(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",Ue(s,a,G0(e.Props,t)),i.coreprops.push(a),ot(t.rels,2,a,Ke.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var f=[],u=0;u<e.SheetNames.length;++u)(e.Workbook.Sheets[u]||{}).Hidden!=2&&f.push(e.SheetNames[u]);e.Props.SheetNames=f}for(e.Props.Worksheets=e.Props.SheetNames.length,Ue(s,a,X0(e.Props)),i.extprops.push(a),ot(t.rels,3,a,Ke.EXT_PROPS),e.Custprops!==e.Props&&er(e.Custprops||{}).length>0&&(a="docProps/custom.xml",Ue(s,a,K0(e.Custprops)),i.custprops.push(a),ot(t.rels,4,a,Ke.CUST_PROPS)),o=1;o<=e.SheetNames.length;++o){var d={"!id":{}},h=e.Sheets[e.SheetNames[o-1]],m=(h||{})["!type"]||"sheet";switch(m){case"chart":default:a="xl/worksheets/sheet"+o+"."+r,Ue(s,a,Ov(o-1,a,t,e,d)),i.sheets.push(a),ot(t.wbrels,-1,"worksheets/sheet"+o+"."+r,Ke.WS[0])}if(h){var l=h["!comments"],v=!1,g="";l&&l.length>0&&(g="xl/comments"+o+"."+r,Ue(s,g,Iv(l,g)),i.comments.push(g),ot(d,-1,"../comments"+o+"."+r,Ke.CMNT),v=!0),h["!legacy"]&&v&&Ue(s,"xl/drawings/vmlDrawing"+o+".vml",fu(o,h["!comments"])),delete h["!comments"],delete h["!legacy"]}d["!id"].rId1&&Ue(s,z0(a),Gn(d))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,Ue(s,a,kv(t.Strings,a,t)),i.strs.push(a),ot(t.wbrels,-1,"sharedStrings."+r,Ke.SST)),a="xl/workbook."+r,Ue(s,a,Av(e,a)),i.workbooks.push(a),ot(t.rels,1,a,Ke.WB),a="xl/theme/theme1.xml",Ue(s,a,cu(e.Themes,t)),i.themes.push(a),ot(t.wbrels,-1,"theme/theme1.xml",Ke.THEME),a="xl/styles."+r,Ue(s,a,Dv(e,a,t)),i.styles.push(a),ot(t.wbrels,-1,"styles."+r,Ke.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",Ue(s,a,e.vbaraw),i.vba.push(a),ot(t.wbrels,-1,"vbaProject.bin",Ke.VBA)),a="xl/metadata."+r,Ue(s,a,Fv(a)),i.metadata.push(a),ot(t.wbrels,-1,"metadata."+r,Ke.XLMETA),Ue(s,"[Content_Types].xml",V0(i,t)),Ue(s,"_rels/.rels",Gn(t.rels)),Ue(s,"xl/_rels/workbook."+r+".rels",Gn(t.wbrels)),delete t.revssf,delete t.ssf,s}function Cy(e,t){zn=1024,e&&!e.SSF&&(e.SSF=hr(Dt)),e&&e.SSF&&(bs(),_s(e.SSF),t.revssf=Cs(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,gi?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xml",n=hu.indexOf(t.bookType)>-1,i=W0();fo(t=t||{});var s=Ka(),a="",o=0;if(t.cellXfs=[],un(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",Ue(s,a,G0(e.Props,t)),i.coreprops.push(a),ot(t.rels,2,a,Ke.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var f=[],u=0;u<e.SheetNames.length;++u)(e.Workbook.Sheets[u]||{}).Hidden!=2&&f.push(e.SheetNames[u]);e.Props.SheetNames=f}e.Props.Worksheets=e.Props.SheetNames.length,Ue(s,a,X0(e.Props)),i.extprops.push(a),ot(t.rels,3,a,Ke.EXT_PROPS),e.Custprops!==e.Props&&er(e.Custprops||{}).length>0&&(a="docProps/custom.xml",Ue(s,a,K0(e.Custprops)),i.custprops.push(a),ot(t.rels,4,a,Ke.CUST_PROPS));var d=["SheetJ5"];for(t.tcid=0,o=1;o<=e.SheetNames.length;++o){var h={"!id":{}},m=e.Sheets[e.SheetNames[o-1]],l=(m||{})["!type"]||"sheet";switch(l){case"chart":default:a="xl/worksheets/sheet"+o+"."+r,Ue(s,a,Su(o-1,t,e,h)),i.sheets.push(a),ot(t.wbrels,-1,"worksheets/sheet"+o+"."+r,Ke.WS[0])}if(m){var v=m["!comments"],g=!1,x="";if(v&&v.length>0){var T=!1;v.forEach(function(b){b[1].forEach(function(_){_.T==!0&&(T=!0)})}),T&&(x="xl/threadedComments/threadedComment"+o+"."+r,Ue(s,x,n1(v,d,t)),i.threadedcomments.push(x),ot(h,-1,"../threadedComments/threadedComment"+o+"."+r,Ke.TCMNT)),x="xl/comments"+o+"."+r,Ue(s,x,du(v)),i.comments.push(x),ot(h,-1,"../comments"+o+"."+r,Ke.CMNT),g=!0}m["!legacy"]&&g&&Ue(s,"xl/drawings/vmlDrawing"+o+".vml",fu(o,m["!comments"])),delete m["!comments"],delete m["!legacy"]}h["!id"].rId1&&Ue(s,z0(a),Gn(h))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,Ue(s,a,nu(t.Strings,t)),i.strs.push(a),ot(t.wbrels,-1,"sharedStrings."+r,Ke.SST)),a="xl/workbook."+r,Ue(s,a,bu(e)),i.workbooks.push(a),ot(t.rels,1,a,Ke.WB),a="xl/theme/theme1.xml",Ue(s,a,cu(e.Themes,t)),i.themes.push(a),ot(t.wbrels,-1,"theme/theme1.xml",Ke.THEME),a="xl/styles."+r,Ue(s,a,ou(e,t)),i.styles.push(a),ot(t.wbrels,-1,"styles."+r,Ke.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",Ue(s,a,e.vbaraw),i.vba.push(a),ot(t.wbrels,-1,"vbaProject.bin",Ke.VBA)),a="xl/metadata."+r,Ue(s,a,uu()),i.metadata.push(a),ot(t.wbrels,-1,"metadata."+r,Ke.XLMETA),d.length>1&&(a="xl/persons/person.xml",Ue(s,a,i1(d)),i.people.push(a),ot(t.wbrels,-1,"persons/person.xml",Ke.PEOPLE)),Ue(s,"[Content_Types].xml",V0(i,t)),Ue(s,"_rels/.rels",Gn(t.rels)),Ue(s,"xl/_rels/workbook."+r+".rels",Gn(t.wbrels)),delete t.revssf,delete t.ssf,s}function Ay(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=Kr(e.slice(0,12));break;case"binary":r=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function Fu(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return Di(t.file,ht.write(e,{type:Ze?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type)}return ht.write(e,t)}function Oy(e,t){var r=hr(t||{}),n=_y(e,r);return Dy(n,r)}function Dy(e,t){var r={},n=Ze?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(t.compression&&(r.compression="DEFLATE"),t.password)r.type=n;else switch(t.type){case"base64":r.type="base64";break;case"binary":r.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":case"file":r.type=n;break;default:throw new Error("Unrecognized type "+t.type)}var i=e.FullPaths?ht.write(e,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[r.type]||r.type,compression:!!t.compression}):e.generate(r);if(typeof Deno<"u"&&typeof i=="string"){if(t.type=="binary"||t.type=="base64")return i;i=new Uint8Array(Es(i))}return t.password&&typeof encrypt_agile<"u"?Fu(encrypt_agile(i,t.password),t):t.type==="file"?Di(t.file,i):t.type=="string"?fi(i):i}function ky(e,t){var r=t||{},n=Gv(e,r);return Fu(n,r)}function Ur(e,t,r){r||(r="");var n=r+e;switch(t.type){case"base64":return yi(Ti(n));case"binary":return Ti(n);case"string":return e;case"file":return Di(t.file,n,"utf8");case"buffer":return Ze?Zr(n,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(n):Ur(n,{type:"binary"}).split("").map(function(i){return i.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function Iy(e,t){switch(t.type){case"base64":return yi(e);case"binary":return e;case"string":return e;case"file":return Di(t.file,e,"binary");case"buffer":return Ze?Zr(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function Gi(e,t){switch(t.type){case"string":case"base64":case"binary":for(var r="",n=0;n<e.length;++n)r+=String.fromCharCode(e[n]);return t.type=="base64"?yi(r):t.type=="string"?fi(r):r;case"file":return Di(t.file,e);case"buffer":return e;default:throw new Error("Unrecognized type "+t.type)}}function Nu(e,t){sh(),mv(e);var r=hr(t||{});if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),r.type=="array"){r.type="binary";var n=Nu(e,r);return r.type="array",Es(n)}var i=0;if(r.sheet&&(typeof r.sheet=="number"?i=r.sheet:i=e.SheetNames.indexOf(r.sheet),!e.SheetNames[i]))throw new Error("Sheet not found: "+r.sheet+" : "+typeof r.sheet);switch(r.bookType||"xlsb"){case"xml":case"xlml":return Ur(zv(e,r),r);case"slk":case"sylk":return Ur(hg.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"htm":case"html":return Ur(Ou(e.Sheets[e.SheetNames[i]],r),r);case"txt":return Iy(Ru(e.Sheets[e.SheetNames[i]],r),r);case"csv":return Ur(ho(e.Sheets[e.SheetNames[i]],r),r,"\uFEFF");case"dif":return Ur(pg.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"dbf":return Gi(dg.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"prn":return Ur(gg.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"rtf":return Ur(Sg.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"eth":return Ur(ru.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"fods":return Ur(Iu(e,r),r);case"wk1":return Gi(Cl.sheet_to_wk1(e.Sheets[e.SheetNames[i]],r),r);case"wk3":return Gi(Cl.book_to_wk3(e,r),r);case"biff2":r.biff||(r.biff=2);case"biff3":r.biff||(r.biff=3);case"biff4":return r.biff||(r.biff=4),Gi(Au(e,r),r);case"biff5":r.biff||(r.biff=5);case"biff8":case"xla":case"xls":return r.biff||(r.biff=8),ky(e,r);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return Oy(e,r);default:throw new Error("Unrecognized bookType |"+r.bookType+"|")}}function Fy(e){if(!e.bookType){var t={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"},r=e.file.slice(e.file.lastIndexOf(".")).toLowerCase();r.match(/^\.[a-z]+$/)&&(e.bookType=r.slice(1)),e.bookType=t[e.bookType]||e.bookType}}function Ny(e,t,r){var n={};return n.type="file",n.file=t,Fy(n),Nu(e,n)}function Ry(e,t,r,n,i,s,a,o){var f=Qt(r),u=o.defval,d=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),h=!0,m=i===1?[]:{};if(i!==1)if(Object.defineProperty)try{Object.defineProperty(m,"__rowNum__",{value:r,enumerable:!1})}catch{m.__rowNum__=r}else m.__rowNum__=r;if(!a||e[r])for(var l=t.s.c;l<=t.e.c;++l){var v=a?e[r][l]:e[n[l]+f];if(v===void 0||v.t===void 0){if(u===void 0)continue;s[l]!=null&&(m[s[l]]=u);continue}var g=v.v;switch(v.t){case"z":if(g==null)break;continue;case"e":g=g==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+v.t)}if(s[l]!=null){if(g==null)if(v.t=="e"&&g===null)m[s[l]]=null;else if(u!==void 0)m[s[l]]=u;else if(d&&g===null)m[s[l]]=null;else continue;else m[s[l]]=d&&(v.t!=="n"||v.t==="n"&&o.rawNumbers!==!1)?g:qr(v,g,o);g!=null&&(h=!1)}}return{row:m,isempty:h}}function vs(e,t){if(e==null||e["!ref"]==null)return[];var r={t:"n",v:0},n=0,i=1,s=[],a=0,o="",f={s:{r:0,c:0},e:{r:0,c:0}},u=t||{},d=u.range!=null?u.range:e["!ref"];switch(u.header===1?n=1:u.header==="A"?n=2:Array.isArray(u.header)?n=3:u.header==null&&(n=0),typeof d){case"string":f=wt(d);break;case"number":f=wt(e["!ref"]),f.s.r=d;break;default:f=d}n>0&&(i=0);var h=Qt(f.s.r),m=[],l=[],v=0,g=0,x=Array.isArray(e),T=f.s.r,b=0,_={};x&&!e[T]&&(e[T]=[]);var k=u.skipHidden&&e["!cols"]||[],F=u.skipHidden&&e["!rows"]||[];for(b=f.s.c;b<=f.e.c;++b)if(!(k[b]||{}).hidden)switch(m[b]=rr(b),r=x?e[T][b]:e[m[b]+h],n){case 1:s[b]=b-f.s.c;break;case 2:s[b]=m[b];break;case 3:s[b]=u.header[b-f.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),o=a=qr(r,null,u),g=_[a]||0,!g)_[a]=1;else{do o=a+"_"+g++;while(_[o]);_[a]=g,_[o]=1}s[b]=o}for(T=f.s.r+i;T<=f.e.r;++T)if(!(F[T]||{}).hidden){var z=Ry(e,f,T,m,n,s,x,u);(z.isempty===!1||(n===1?u.blankrows!==!1:u.blankrows))&&(l[v++]=z.row)}return l.length=v,l}var Rl=/"/g;function Py(e,t,r,n,i,s,a,o){for(var f=!0,u=[],d="",h=Qt(r),m=t.s.c;m<=t.e.c;++m)if(n[m]){var l=o.dense?(e[r]||[])[m]:e[n[m]+h];if(l==null)d="";else if(l.v!=null){f=!1,d=""+(o.rawNumbers&&l.t=="n"?l.v:qr(l,null,o));for(var v=0,g=0;v!==d.length;++v)if((g=d.charCodeAt(v))===i||g===s||g===34||o.forceQuotes){d='"'+d.replace(Rl,'""')+'"';break}d=="ID"&&(d='"ID"')}else l.f!=null&&!l.F?(f=!1,d="="+l.f,d.indexOf(",")>=0&&(d='"'+d.replace(Rl,'""')+'"')):d="";u.push(d)}return o.blankrows===!1&&f?null:u.join(a)}function ho(e,t){var r=[],n=t??{};if(e==null||e["!ref"]==null)return"";var i=wt(e["!ref"]),s=n.FS!==void 0?n.FS:",",a=s.charCodeAt(0),o=n.RS!==void 0?n.RS:`
|
|
94
|
-
`,
|
|
95
|
-
`;var r=
|
|
96
|
-
`)?`"${
|
|
97
|
-
`);Mu(d,go(t,"csv"),"text/csv;charset=utf-8;")}function Ml(e,t="export",r){const{data:n,columnOrder:i,grouping:s}=e,a=i.filter(h=>e.columnVisibility[h]);let o;if(s&&s.enabled){const h=Is(n);o=po(h)}else o=n;const f=[a,...o.map(h=>a.map(m=>h[m]??""))],u=la.aoa_to_sheet(f),d=la.book_new();la.book_append_sheet(d,u,"Data"),Ny(d,go(t,"xlsx"))}function Ll(e,t="export",r){const{data:n,appliedFilters:i,appliedSortStack:s,viewMeta:a,hiddenColumns:o,columnOrder:f,grouping:u}=e;let d;if(u&&u.enabled){const l=Is(n);d=po(l)}else d=n;const h={meta:{exportedAt:new Date().toISOString(),reportName:t,view:(a==null?void 0:a.name)||"Default View",filters:i.map(l=>({field:l.column,operator:l.operator,value:l.value})),sortStack:s.map(l=>({field:l.column,direction:l.direction,priority:l.priority})),grouping:u||{},hiddenColumns:o,columnOrder:f,exportConfig:r||{scope:"visible"}},data:d},m=JSON.stringify(h,null,2);Mu(m,go(t,"json"),"application/json;charset=utf-8;")}function Mu(e,t,r){const n=new Blob([e],{type:r}),i=URL.createObjectURL(n),s=document.createElement("a");s.href=i,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}const Bl=10;function Yy(e,t){const r=t.trim();if(!r)return e;const n=e.findIndex(s=>s.query.toLowerCase()===r.toLowerCase());let i;return n!==-1?i=[{...e[n],lastUsed:Date.now()},...e.slice(0,n),...e.slice(n+1)]:i=[{query:r,isFavourite:!1,lastUsed:Date.now()},...e],i.length>Bl&&(i=[...i].sort((a,o)=>a.isFavourite&&!o.isFavourite?-1:!a.isFavourite&&o.isFavourite?1:o.lastUsed-a.lastUsed).slice(0,Bl)),i}function Xy(e,t){return e.map(r=>r.query===t?{...r,isFavourite:!r.isFavourite}:r)}function Ky(e,t){return e.filter(r=>r.query!==t)}function qy(e){const t=e.filter(n=>n.isFavourite).sort((n,i)=>i.lastUsed-n.lastUsed),r=e.filter(n=>!n.isFavourite).sort((n,i)=>i.lastUsed-n.lastUsed);return[...t,...r]}const Jy={owner:["view_report","edit_columns","edit_filters","edit_sorting","edit_views","create_views","delete_views","delete_report","export_data"],editor:["view_report","edit_columns","edit_filters","edit_sorting","edit_views","create_views","delete_views","export_data"],viewer:["view_report","export_data"]};function Zy(e,t){return!e||e.owner===t?"owner":e.editors.includes(t)?"editor":(e.viewers.includes(t),"viewer")}function jr(e,t){return Jy[t].includes(e)}function Mr(e){return`You do not have permission to ${{view_report:"view this report",edit_columns:"modify columns",edit_filters:"modify filters",edit_sorting:"modify sorting",edit_views:"edit views",create_views:"create views",delete_views:"delete views",delete_report:"delete this report",export_data:"export data"}[e]||"perform this action"}.`}function Qy(e){return e==="viewer"}const $l=1e3;function e2(){return`EVT_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function Lu(e,t,r,n,i,s){return{id:e2(),user:t,reportId:e,feature:r,action:n,timestamp:new Date().toISOString(),previousState:i,newState:s}}function Bu(e,t){const r=[t,...e];return r.length>$l?r.slice(0,$l):r}function t2(e){return{filter_added:"Filter Added",filter_removed:"Filter Removed",filter_updated:"Filter Updated",filter_cleared:"All Filters Cleared",sort_level_added:"Sort Level Added",sort_level_removed:"Sort Level Removed",sort_reordered:"Sort Reordered",sort_cleared:"All Sorting Cleared",group_level_added:"Group Level Added",group_level_removed:"Group Level Removed",group_reordered:"Group Reordered",group_cleared:"All Grouping Cleared",column_hidden:"Column Hidden",column_shown:"Column Shown",column_reordered:"Columns Reordered",column_resized:"Column Resized",view_created:"View Created",view_updated:"View Updated",view_deleted:"View Deleted",view_set_default:"View Set as Default",view_switched:"View Switched",theme_changed:"Theme Changed",export_triggered:"Export Triggered",export_csv:"Exported as CSV",export_excel:"Exported as Excel",export_json:"Exported as JSON",preset_created:"Preset Created",preset_applied:"Preset Applied",preset_deleted:"Preset Deleted",preset_link_copied:"Preset Link Copied",error_occurred:"Error Occurred"}[e]||e}function r2(e){return{filters:"Filters",sorting:"Sorting",grouping:"Grouping",columns:"Columns",views:"Views",theme:"Theme",export:"Export",presets:"Presets",system:"System"}[e]||e}function n2(e){return{filters:"bg-blue-100 text-blue-800 border-blue-200",sorting:"bg-purple-100 text-purple-800 border-purple-200",grouping:"bg-green-100 text-green-800 border-green-200",columns:"bg-orange-100 text-orange-800 border-orange-200",views:"bg-pink-100 text-pink-800 border-pink-200",theme:"bg-gray-100 text-gray-800 border-gray-200",export:"bg-cyan-100 text-cyan-800 border-cyan-200",presets:"bg-indigo-100 text-indigo-800 border-indigo-200",system:"bg-red-100 text-red-800 border-red-200"}[e]||"bg-gray-100 text-gray-800 border-gray-200"}function i2(e){const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),s=Math.floor(n/36e5),a=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i} minute${i>1?"s":""} ago`:s<24?`${s} hour${s>1?"s":""} ago`:a<7?`${a} day${a>1?"s":""} ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Ul(e){return e==null?"None":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e,null,2)}const Wl=100;function s2(){return`preset_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function a2(e){var s;const t=(s=e.views)==null?void 0:s.find(a=>a.id===e.activeViewId),r=t==null?void 0:t.snapshot.columnOrder,n=e.columnOrder||[],i=t0(n,e.grouping||null,r);return{filters:e.filters?[...e.filters]:[],sortStack:e.sortStack?[...e.sortStack]:[],columnVisibility:e.columnVisibility?{...e.columnVisibility}:{},columnOrder:i,columnWidths:e.columnWidths?{...e.columnWidths}:{},grouping:e.grouping?{...e.grouping}:null,activeViewId:e.activeViewId}}function o2(e,t,r,n){return{id:s2(),name:e,description:t,createdBy:r,createdAt:Date.now(),config:n}}function l2(e,t){const r=e||[];if(r.length>=Wl)throw new Error(`Maximum of ${Wl} presets reached. Please delete old presets first.`);return[...r,t]}function c2(e,t){return(e||[]).filter(n=>n.id!==t)}function Vl(e,t){if(e)return e.find(r=>r.id===t)}function u2(e,t){return`${window.location.origin}/reports/${e}?preset=${t}`}function f2(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get("preset")}function d2(e){const t=e.columnOrder,r=Wn(t,e.grouping);return{filters:e.filters.length>0?[...e.filters]:void 0,sortStack:e.sortStack.length>0?[...e.sortStack]:void 0,columnVisibility:{...e.columnVisibility},columnOrder:r,columnWidths:{...e.columnWidths},grouping:e.grouping?{...e.grouping}:null,activeViewId:e.activeViewId}}async function h2(e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();const r=document.execCommand("copy");return t.remove(),r}}catch(t){return console.error("Failed to copy to clipboard:",t),!1}}function p2(e,t){return{totalRows:e.length,totalColumns:t.length}}const g2={MAX_CACHE_ENTRIES:3};function m2(e,t){let r=null;return function(...i){const s=()=>{r=null,e(...i)};r&&clearTimeout(r),r=setTimeout(s,t)}}class Yi{constructor(t=g2.MAX_CACHE_ENTRIES){this.cache=new Map,this.maxEntries=t}get(t){const r=this.cache.get(t);return r?r.value:null}set(t,r){var n;if(this.cache.size>=this.maxEntries&&!this.cache.has(t)){const i=(n=Array.from(this.cache.entries()).sort((s,a)=>s[1].timestamp-a[1].timestamp)[0])==null?void 0:n[0];i&&this.cache.delete(i)}this.cache.set(t,{key:t,value:r,timestamp:Date.now()})}has(t){return this.cache.has(t)}clear(){this.cache.clear()}size(){return this.cache.size}}class x2{constructor(){this.metrics=new Map}start(t){this.metrics.set(t,performance.now())}end(t){const r=this.metrics.get(t);if(!r)return 0;const n=performance.now()-r;return this.metrics.delete(t),n}measure(t,r){this.start(t);const n=r(),i=this.end(t);return{result:n,duration:i}}async measureAsync(t,r){this.start(t);const n=await r(),i=this.end(t);return{result:n,duration:i}}}function Hr(e,t,r,n){const i=r instanceof Error?r.message:r,s={type:e,context:t,message:i,details:n,timestamp:Date.now(),recoverable:v2(e,t)};return process.env.NODE_ENV==="development"&&console.error("[Report Error]",{type:e,context:t,message:i,details:n}),s}function v2(e,t){return e==="ui"||e==="processing"&&["filters","sorting","grouping","columns"].includes(t)?!0:e!=="system"}function y2(e){const r={filters:"There was an issue applying filters",sorting:"Sorting could not be applied",grouping:"Grouping configuration failed",columns:"Column configuration could not be updated",views:"View operation failed",presets:"Preset could not be applied",export:"Export failed",upload:"File upload failed",search:"Search operation failed"}[e.context]||"An error occurred";return e.recoverable?`${r}. Your previous state has been restored.`:`${r}. Please refresh the page.`}function w2(e){return{filters:e.filters?[...e.filters]:void 0,sortStack:e.sortStack?[...e.sortStack]:void 0,grouping:e.grouping?{...e.grouping}:void 0,columnVisibility:e.columnVisibility?{...e.columnVisibility}:void 0,columnOrder:e.columnOrder?[...e.columnOrder]:void 0,columnWidths:e.columnWidths?{...e.columnWidths}:void 0,activeViewId:e.activeViewId}}function T2(e,t,r){r(e.id,{filters:t.filters,sortStack:t.sortStack,grouping:t.grouping,columnVisibility:t.columnVisibility,columnOrder:t.columnOrder,columnWidths:t.columnWidths,activeViewId:t.activeViewId})}function S2(e,t,r){return["equals","contains","starts_with","ends_with","gt","gte","lt","lte"].includes(t)&&(r==null||r==="")?{isValid:!1,errorMessage:"Value is required for this operator"}:e==="number"&&["gt","gte","lt","lte","equals"].includes(t)&&isNaN(Number(r))?{isValid:!1,errorMessage:"Value must be a valid number"}:e==="date"&&r&&isNaN(Date.parse(r))?{isValid:!1,errorMessage:"Value must be a valid date"}:{isValid:!0}}function $u(e,t){const r=[],n=[],i=new Set(t.map(s=>s.name));return e.forEach(s=>{i.has(s.column)?r.push(s):n.push(s.column)}),{validRules:r,invalidColumns:n}}function Uu(e,t){if(!e||!e.levels||e.levels.length===0)return{validGrouping:null,invalidColumns:[]};const r=new Set(t.map(s=>s.name)),n=[],i=[];return e.levels.forEach(s=>{r.has(s.column)?n.push(s):i.push(s.column)}),n.length===0?{validGrouping:null,invalidColumns:i}:{validGrouping:{...e,levels:n},invalidColumns:i}}function E2(e,t){const r=[],n=new Set(t.map(s=>s.name)),i={...e};if(i.filters&&Array.isArray(i.filters)){const s=i.filters.filter(a=>{const o=n.has(a.column);return o||r.push(`Filter for column "${a.column}" ignored (column not found)`),o});i.filters=s.length>0?s:void 0}if(i.sortStack&&Array.isArray(i.sortStack)){const{validRules:s,invalidColumns:a}=$u(i.sortStack,t);a.length>0&&r.push(`Sort rules for columns ignored: ${a.join(", ")}`),i.sortStack=s.length>0?s:void 0}if(i.grouping){const{validGrouping:s,invalidColumns:a}=Uu(i.grouping,t);a.length>0&&r.push(`Grouping for columns ignored: ${a.join(", ")}`),i.grouping=s}if(i.columnVisibility){const s={};Object.entries(i.columnVisibility).forEach(([a,o])=>{n.has(a)?s[a]=o:r.push(`Column visibility for "${a}" ignored (column not found)`)}),i.columnVisibility=Object.keys(s).length>0?s:void 0}if(i.columnOrder&&Array.isArray(i.columnOrder)){const s=i.columnOrder.filter(a=>{const o=n.has(a);return o||r.push(`Column "${a}" in order ignored (column not found)`),o});i.columnOrder=s.length>0?s:void 0}if(i.columnWidths){const s={};Object.entries(i.columnWidths).forEach(([a,o])=>{n.has(a)?s[a]=o:r.push(`Column width for "${a}" ignored (column not found)`)}),i.columnWidths=Object.keys(s).length>0?s:void 0}return{sanitizedConfig:i,warnings:r}}function _2(e,t){return Hr("processing","export",e,{retryAvailable:!!(t!=null&&t.onRetry)})}function zl(e,t,r,n){const i=Lu(e,t,"system","error_occurred",null,{errorType:r.type,errorContext:r.context,errorMessage:r.message,recoverable:r.recoverable,timestamp:r.timestamp});return Bu(n||[],i)}function b2(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const C2=e=>{switch(e){case"success":return D2;case"info":return I2;case"warning":return k2;case"error":return F2;default:return null}},A2=Array(12).fill(0),O2=({visible:e,className:t})=>S.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},S.createElement("div",{className:"sonner-spinner"},A2.map((r,n)=>S.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),D2=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),k2=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),I2=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),F2=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),N2=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),S.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),R2=()=>{const[e,t]=S.useState(document.hidden);return S.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let ka=1;class P2{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:ka++,a=this.toasts.find(f=>f.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(f=>f.id===s?(this.publish({...f,...t,id:s,title:n}),{...f,...t,id:s,dismissible:o,title:n}):f):this.addToast({title:n,...i,dismissible:o,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let s=n!==void 0,a;const o=i.then(async u=>{if(a=["resolve",u],S.isValidElement(u))s=!1,this.create({id:n,type:"default",message:u});else if(M2(u)&&!u.ok){s=!1;const h=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,v=typeof h=="object"&&!S.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:m,...v})}else if(u instanceof Error){s=!1;const h=typeof r.error=="function"?await r.error(u):r.error,m=typeof r.description=="function"?await r.description(u):r.description,v=typeof h=="object"&&!S.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:m,...v})}else if(r.success!==void 0){s=!1;const h=typeof r.success=="function"?await r.success(u):r.success,m=typeof r.description=="function"?await r.description(u):r.description,v=typeof h=="object"&&!S.isValidElement(h)?h:{message:h};this.create({id:n,type:"success",description:m,...v})}}).catch(async u=>{if(a=["reject",u],r.error!==void 0){s=!1;const d=typeof r.error=="function"?await r.error(u):r.error,h=typeof r.description=="function"?await r.description(u):r.description,l=typeof d=="object"&&!S.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:h,...l})}}).finally(()=>{s&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),f=()=>new Promise((u,d)=>o.then(()=>a[0]==="reject"?d(a[1]):u(a[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:f}:Object.assign(n,{unwrap:f})},this.custom=(t,r)=>{const n=(r==null?void 0:r.id)||ka++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ur=new P2,j2=(e,t)=>{const r=(t==null?void 0:t.id)||ka++;return ur.addToast({title:e,...t,id:r}),r},M2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",L2=j2,B2=()=>ur.toasts,$2=()=>ur.getActiveToasts(),$e=Object.assign(L2,{success:ur.success,info:ur.info,warning:ur.warning,error:ur.error,custom:ur.custom,message:ur.message,promise:ur.promise,dismiss:ur.dismiss,loading:ur.loading},{getHistory:B2,getToasts:$2});b2("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Xi(e){return e.label!==void 0}const U2=3,W2="24px",V2="16px",Hl=4e3,z2=356,H2=14,G2=45,Y2=200;function Lr(...e){return e.filter(Boolean).join(" ")}function X2(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const K2=e=>{var t,r,n,i,s,a,o,f,u;const{invert:d,toast:h,unstyled:m,interacting:l,setHeights:v,visibleToasts:g,heights:x,index:T,toasts:b,expanded:_,removeToast:k,defaultRichColors:F,closeButton:z,style:N,cancelButtonStyle:B,actionButtonStyle:M,className:L="",descriptionClassName:W="",duration:y,position:H,gap:Q,expandByDefault:J,classNames:ee,icons:_e,closeButtonAriaLabel:Ae="Close toast"}=e,[De,oe]=S.useState(null),[ce,C]=S.useState(null),[j,R]=S.useState(!1),[P,V]=S.useState(!1),[le,fe]=S.useState(!1),[ue,te]=S.useState(!1),[Ie,ae]=S.useState(!1),[Pe,ke]=S.useState(0),[pt,He]=S.useState(0),we=S.useRef(h.duration||y||Hl),ut=S.useRef(null),je=S.useRef(null),Rt=T===0,vt=T+1<=g,rt=h.type,kt=h.dismissible!==!1,Xe=h.className||"",Ht=h.descriptionClassName||"",It=S.useMemo(()=>x.findIndex(Oe=>Oe.toastId===h.id)||0,[x,h.id]),Gt=S.useMemo(()=>{var Oe;return(Oe=h.closeButton)!=null?Oe:z},[h.closeButton,z]),Lt=S.useMemo(()=>h.duration||y||Hl,[h.duration,y]),Bt=S.useRef(0),qe=S.useRef(0),Je=S.useRef(0),gt=S.useRef(null),[Ft,bt]=H.split("-"),cr=S.useMemo(()=>x.reduce((Oe,nt,Ye)=>Ye>=It?Oe:Oe+nt.height,0),[x,It]),Yt=R2(),Qe=h.invert||d,pr=rt==="loading";qe.current=S.useMemo(()=>It*Q+cr,[It,cr]),S.useEffect(()=>{we.current=Lt},[Lt]),S.useEffect(()=>{R(!0)},[]),S.useEffect(()=>{const Oe=je.current;if(Oe){const nt=Oe.getBoundingClientRect().height;return He(nt),v(Ye=>[{toastId:h.id,height:nt,position:h.position},...Ye]),()=>v(Ye=>Ye.filter(Tt=>Tt.toastId!==h.id))}},[v,h.id]),S.useLayoutEffect(()=>{if(!j)return;const Oe=je.current,nt=Oe.style.height;Oe.style.height="auto";const Ye=Oe.getBoundingClientRect().height;Oe.style.height=nt,He(Ye),v(Tt=>Tt.find(yt=>yt.toastId===h.id)?Tt.map(yt=>yt.toastId===h.id?{...yt,height:Ye}:yt):[{toastId:h.id,height:Ye,position:h.position},...Tt])},[j,h.title,h.description,v,h.id]);const Xt=S.useCallback(()=>{V(!0),ke(qe.current),v(Oe=>Oe.filter(nt=>nt.toastId!==h.id)),setTimeout(()=>{k(h)},Y2)},[h,k,v,qe]);S.useEffect(()=>{if(h.promise&&rt==="loading"||h.duration===1/0||h.type==="loading")return;let Oe;return _||l||Yt?(()=>{if(Je.current<Bt.current){const Tt=new Date().getTime()-Bt.current;we.current=we.current-Tt}Je.current=new Date().getTime()})():(()=>{we.current!==1/0&&(Bt.current=new Date().getTime(),Oe=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Xt()},we.current))})(),()=>clearTimeout(Oe)},[_,l,h,rt,Yt,Xt]),S.useEffect(()=>{h.delete&&Xt()},[Xt,h.delete]);function ir(){var Oe;if(_e!=null&&_e.loading){var nt;return S.createElement("div",{className:Lr(ee==null?void 0:ee.loader,h==null||(nt=h.classNames)==null?void 0:nt.loader,"sonner-loader"),"data-visible":rt==="loading"},_e.loading)}return S.createElement(O2,{className:Lr(ee==null?void 0:ee.loader,h==null||(Oe=h.classNames)==null?void 0:Oe.loader),visible:rt==="loading"})}const pe=h.icon||(_e==null?void 0:_e[rt])||C2(rt);var tr,Ge;return S.createElement("li",{tabIndex:0,ref:je,className:Lr(L,Xe,ee==null?void 0:ee.toast,h==null||(t=h.classNames)==null?void 0:t.toast,ee==null?void 0:ee.default,ee==null?void 0:ee[rt],h==null||(r=h.classNames)==null?void 0:r[rt]),"data-sonner-toast":"","data-rich-colors":(tr=h.richColors)!=null?tr:F,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":j,"data-promise":!!h.promise,"data-swiped":Ie,"data-removed":P,"data-visible":vt,"data-y-position":Ft,"data-x-position":bt,"data-index":T,"data-front":Rt,"data-swiping":le,"data-dismissible":kt,"data-type":rt,"data-invert":Qe,"data-swipe-out":ue,"data-swipe-direction":ce,"data-expanded":!!(_||J&&j),style:{"--index":T,"--toasts-before":T,"--z-index":b.length-T,"--offset":`${P?Pe:qe.current}px`,"--initial-height":J?"auto":`${pt}px`,...N,...h.style},onDragEnd:()=>{fe(!1),oe(null),gt.current=null},onPointerDown:Oe=>{pr||!kt||(ut.current=new Date,ke(qe.current),Oe.target.setPointerCapture(Oe.pointerId),Oe.target.tagName!=="BUTTON"&&(fe(!0),gt.current={x:Oe.clientX,y:Oe.clientY}))},onPointerUp:()=>{var Oe,nt,Ye;if(ue||!kt)return;gt.current=null;const Tt=Number(((Oe=je.current)==null?void 0:Oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),sr=Number(((nt=je.current)==null?void 0:nt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yt=new Date().getTime()-((Ye=ut.current)==null?void 0:Ye.getTime()),xt=De==="x"?Tt:sr,mt=Math.abs(xt)/yt;if(Math.abs(xt)>=G2||mt>.11){ke(qe.current),h.onDismiss==null||h.onDismiss.call(h,h),C(De==="x"?Tt>0?"right":"left":sr>0?"down":"up"),Xt(),te(!0);return}else{var Te,he;(Te=je.current)==null||Te.style.setProperty("--swipe-amount-x","0px"),(he=je.current)==null||he.style.setProperty("--swipe-amount-y","0px")}ae(!1),fe(!1),oe(null)},onPointerMove:Oe=>{var nt,Ye,Tt;if(!gt.current||!kt||((nt=window.getSelection())==null?void 0:nt.toString().length)>0)return;const yt=Oe.clientY-gt.current.y,xt=Oe.clientX-gt.current.x;var mt;const Te=(mt=e.swipeDirections)!=null?mt:X2(H);!De&&(Math.abs(xt)>1||Math.abs(yt)>1)&&oe(Math.abs(xt)>Math.abs(yt)?"x":"y");let he={x:0,y:0};const be=We=>1/(1.5+Math.abs(We)/20);if(De==="y"){if(Te.includes("top")||Te.includes("bottom"))if(Te.includes("top")&&yt<0||Te.includes("bottom")&&yt>0)he.y=yt;else{const We=yt*be(yt);he.y=Math.abs(We)<Math.abs(yt)?We:yt}}else if(De==="x"&&(Te.includes("left")||Te.includes("right")))if(Te.includes("left")&&xt<0||Te.includes("right")&&xt>0)he.x=xt;else{const We=xt*be(xt);he.x=Math.abs(We)<Math.abs(xt)?We:xt}(Math.abs(he.x)>0||Math.abs(he.y)>0)&&ae(!0),(Ye=je.current)==null||Ye.style.setProperty("--swipe-amount-x",`${he.x}px`),(Tt=je.current)==null||Tt.style.setProperty("--swipe-amount-y",`${he.y}px`)}},Gt&&!h.jsx&&rt!=="loading"?S.createElement("button",{"aria-label":Ae,"data-disabled":pr,"data-close-button":!0,onClick:pr||!kt?()=>{}:()=>{Xt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Lr(ee==null?void 0:ee.closeButton,h==null||(n=h.classNames)==null?void 0:n.closeButton)},(Ge=_e==null?void 0:_e.close)!=null?Ge:N2):null,(rt||h.icon||h.promise)&&h.icon!==null&&((_e==null?void 0:_e[rt])!==null||h.icon)?S.createElement("div",{"data-icon":"",className:Lr(ee==null?void 0:ee.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||ir():null,h.type!=="loading"?pe:null):null,S.createElement("div",{"data-content":"",className:Lr(ee==null?void 0:ee.content,h==null||(s=h.classNames)==null?void 0:s.content)},S.createElement("div",{"data-title":"",className:Lr(ee==null?void 0:ee.title,h==null||(a=h.classNames)==null?void 0:a.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?S.createElement("div",{"data-description":"",className:Lr(W,Ht,ee==null?void 0:ee.description,h==null||(o=h.classNames)==null?void 0:o.description)},typeof h.description=="function"?h.description():h.description):null),S.isValidElement(h.cancel)?h.cancel:h.cancel&&Xi(h.cancel)?S.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||B,onClick:Oe=>{Xi(h.cancel)&&kt&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Oe),Xt())},className:Lr(ee==null?void 0:ee.cancelButton,h==null||(f=h.classNames)==null?void 0:f.cancelButton)},h.cancel.label):null,S.isValidElement(h.action)?h.action:h.action&&Xi(h.action)?S.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||M,onClick:Oe=>{Xi(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Oe),!Oe.defaultPrevented&&Xt())},className:Lr(ee==null?void 0:ee.actionButton,h==null||(u=h.classNames)==null?void 0:u.actionButton)},h.action.label):null)};function Gl(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function q2(e,t){const r={};return[e,t].forEach((n,i)=>{const s=i===1,a=s?"--mobile-offset":"--offset",o=s?V2:W2;function f(u){["top","right","bottom","left"].forEach(d=>{r[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?f(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${a}-${u}`]=o:r[`${a}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):f(o)}),r}const Wu=S.forwardRef(function(t,r){const{invert:n,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:a,closeButton:o,className:f,offset:u,mobileOffset:d,theme:h="light",richColors:m,duration:l,style:v,visibleToasts:g=U2,toastOptions:x,dir:T=Gl(),gap:b=H2,icons:_,containerAriaLabel:k="Notifications"}=t,[F,z]=S.useState([]),N=S.useMemo(()=>Array.from(new Set([i].concat(F.filter(ce=>ce.position).map(ce=>ce.position)))),[F,i]),[B,M]=S.useState([]),[L,W]=S.useState(!1),[y,H]=S.useState(!1),[Q,J]=S.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ee=S.useRef(null),_e=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),Ae=S.useRef(null),De=S.useRef(!1),oe=S.useCallback(ce=>{z(C=>{var j;return(j=C.find(R=>R.id===ce.id))!=null&&j.delete||ur.dismiss(ce.id),C.filter(({id:R})=>R!==ce.id)})},[]);return S.useEffect(()=>ur.subscribe(ce=>{if(ce.dismiss){requestAnimationFrame(()=>{z(C=>C.map(j=>j.id===ce.id?{...j,delete:!0}:j))});return}setTimeout(()=>{za.flushSync(()=>{z(C=>{const j=C.findIndex(R=>R.id===ce.id);return j!==-1?[...C.slice(0,j),{...C[j],...ce},...C.slice(j+1)]:[ce,...C]})})})}),[F]),S.useEffect(()=>{if(h!=="system"){J(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?J("dark"):J("light")),typeof window>"u")return;const ce=window.matchMedia("(prefers-color-scheme: dark)");try{ce.addEventListener("change",({matches:C})=>{J(C?"dark":"light")})}catch{ce.addListener(({matches:j})=>{try{J(j?"dark":"light")}catch(R){console.error(R)}})}},[h]),S.useEffect(()=>{F.length<=1&&W(!1)},[F]),S.useEffect(()=>{const ce=C=>{var j;if(s.every(V=>C[V]||C.code===V)){var P;W(!0),(P=ee.current)==null||P.focus()}C.code==="Escape"&&(document.activeElement===ee.current||(j=ee.current)!=null&&j.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",ce),()=>document.removeEventListener("keydown",ce)},[s]),S.useEffect(()=>{if(ee.current)return()=>{Ae.current&&(Ae.current.focus({preventScroll:!0}),Ae.current=null,De.current=!1)}},[ee.current]),S.createElement("section",{ref:r,"aria-label":`${k} ${_e}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((ce,C)=>{var j;const[R,P]=ce.split("-");return F.length?S.createElement("ol",{key:ce,dir:T==="auto"?Gl():T,tabIndex:-1,ref:ee,className:f,"data-sonner-toaster":!0,"data-sonner-theme":Q,"data-y-position":R,"data-lifted":L&&F.length>1&&!a,"data-x-position":P,style:{"--front-toast-height":`${((j=B[0])==null?void 0:j.height)||0}px`,"--width":`${z2}px`,"--gap":`${b}px`,...v,...q2(u,d)},onBlur:V=>{De.current&&!V.currentTarget.contains(V.relatedTarget)&&(De.current=!1,Ae.current&&(Ae.current.focus({preventScroll:!0}),Ae.current=null))},onFocus:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||De.current||(De.current=!0,Ae.current=V.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{y||W(!1)},onDragEnd:()=>W(!1),onPointerDown:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},F.filter(V=>!V.position&&C===0||V.position===ce).map((V,le)=>{var fe,ue;return S.createElement(K2,{key:V.id,icons:_,index:le,toast:V,defaultRichColors:m,duration:(fe=x==null?void 0:x.duration)!=null?fe:l,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:n,visibleToasts:g,closeButton:(ue=x==null?void 0:x.closeButton)!=null?ue:o,interacting:y,position:ce,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,closeButtonAriaLabel:x==null?void 0:x.closeButtonAriaLabel,removeToast:oe,toasts:F.filter(te=>te.position==V.position),heights:B.filter(te=>te.position==V.position),setHeights:M,expandByDefault:a,gap:b,expanded:L,swipeDirections:t.swipeDirections})})):null}))});function J2(e){return e==null}function Z2(e,t){const{operator:r,value:n}=t;if(r==="NULL")return e==null;if(r==="NOT_NULL")return e!=null;if(J2(e))return!1;switch(r){case"equals":return String(e)===String(n);case"contains":return String(e).toLowerCase().includes(String(n).toLowerCase());case"startsWith":return String(e).toLowerCase().startsWith(String(n).toLowerCase());case"endsWith":return String(e).toLowerCase().endsWith(String(n).toLowerCase());case"gt":return Number(e)>Number(n);case"lt":return Number(e)<Number(n);case"gte":return Number(e)>=Number(n);case"lte":return Number(e)<=Number(n);case"isTrue":return e===!0;case"isFalse":return e===!1;default:return!0}}function Q2(e,t){return!t||t.length===0?e:e.filter(r=>t.every(n=>Z2(r[n.column],n)))}function Yl(e){switch(e){case"string":return[{value:"equals",label:"Equals"},{value:"contains",label:"Contains"},{value:"startsWith",label:"Starts with"},{value:"endsWith",label:"Ends with"},{value:"NULL",label:"Is NULL"},{value:"NOT_NULL",label:"Is NOT NULL"}];case"number":return[{value:"equals",label:"="},{value:"gt",label:">"},{value:"lt",label:"<"},{value:"gte",label:"≥"},{value:"lte",label:"≤"}];case"boolean":return[{value:"isTrue",label:"Is true"},{value:"isFalse",label:"Is false"},{value:"NULL",label:"Is NULL"},{value:"NOT_NULL",label:"Is NOT NULL"}];case"mixed":case"null":case"array":case"object":default:return[]}}function Ki(e){return e!=="isTrue"&&e!=="isFalse"&&e!=="NULL"&&e!=="NOT_NULL"}function ew({data:e,filters:t}){return{filteredData:S.useMemo(()=>!t||t.length===0?e:Q2(e,t),[e,t])}}function Vu(e,t,r,n){if(!r||r.trim()==="")return e;const i=r.toLowerCase().trim(),s=t.filter(a=>n.includes(a.name));return e.filter(a=>s.some(o=>{const f=a[o.name];return f==null?!1:String(f).toLowerCase().includes(i)}))}function tw({data:e,searchQuery:t,schema:r,visibleColumns:n}){return{searchedData:S.useMemo(()=>!t||t.trim()===""?e:Vu(e,r,t,n),[e,t,r,n])}}function rw({data:e,sortStack:t,schema:r}){return{sortedData:S.useMemo(()=>!t||t.length===0?e:Wd(e,r,t),[e,t,r])}}function nw({data:e,grouping:t,schema:r}){const n=S.useMemo(()=>!t||!t.enabled||t.levels.length===0?e:Yd(e,r,t),[e,t,r]),i=(t==null?void 0:t.enabled)&&((t==null?void 0:t.levels.length)||0)>0;return{groupedData:n,isGrouped:i}}function iw({schema:e,columnVisibility:t,columnOrder:r}){const n=S.useMemo(()=>r.filter(o=>t[o]!==!1),[r,t]),i=S.useMemo(()=>Object.entries(t).filter(([o,f])=>!f).map(([o,f])=>o),[t]),s=S.useMemo(()=>r.map(o=>e.find(u=>u.name===o)||{name:o,type:"string"}),[r,e]),a=S.useMemo(()=>n.map(o=>e.find(u=>u.name===o)||{name:o,type:"string"}),[n,e]);return{visibleColumns:n,hiddenColumns:i,allColumns:s,visibleColumnSchemas:a,hiddenCount:i.length}}function sw({views:e,activeViewId:t,currentState:r}){const n=S.useMemo(()=>e.find(u=>u.id===t),[e,t]),i=S.useMemo(()=>n?Zd(r,n.snapshot):!1,[n,r]),s=S.useMemo(()=>e.find(u=>u.isDefault),[e]),a=S.useMemo(()=>e.filter(u=>!u.isDefault&&!u.isDeleted),[e]),o=S.useMemo(()=>e.filter(u=>u.isFavorite&&!u.isDeleted),[e]),f=S.useMemo(()=>e.filter(u=>u.isDeleted),[e]);return{activeView:n,isDirty:i,defaultView:s,customViews:a,favoriteViews:o,deletedViews:f,isDefaultView:(n==null?void 0:n.isDefault)||!1}}function aw({data:e,enabled:t=!1,pageSize:r=100,initialPage:n=1}){const[i,s]=S.useState(n),a=e.length,o=Math.ceil(a/r),f=S.useMemo(()=>{if(!t)return e;const l=(i-1)*r,v=l+r;return e.slice(l,v)},[e,t,i,r]),u=S.useCallback(l=>{const v=Math.max(1,Math.min(l,o));s(v)},[o]),d=S.useCallback(()=>{i<o&&s(i+1)},[i,o]),h=S.useCallback(()=>{i>1&&s(i-1)},[i]),m=S.useCallback(()=>{s(1)},[]);return{paginatedData:f,currentPage:i,totalPages:o,pageSize:r,totalRows:a,goToPage:u,nextPage:d,prevPage:h,resetPage:m,hasNextPage:i<o,hasPrevPage:i>1}}function ow(e){const{rawData:t,schema:r,filters:n,sortStack:i,grouping:s,searchQuery:a,columnVisibility:o,columnOrder:f,columnWidths:u,views:d,activeViewId:h,pagination:m}=e,l=S.useMemo(()=>({filters:n,sortStack:i,grouping:s,columnVisibility:o,columnOrder:f,columnWidths:u}),[n,i,s,o,f,u]),v=sw({views:d,activeViewId:h,currentState:l}),g=iw({schema:r,columnVisibility:o,columnOrder:f}),{filteredData:x}=ew({data:t,filters:n}),{sortedData:T}=rw({data:x,sortStack:i,schema:r}),{groupedData:b,isGrouped:_}=nw({data:T,grouping:s,schema:r}),{searchedData:k}=tw({data:b,searchQuery:a,schema:r,visibleColumns:g.visibleColumns}),F=aw({data:k,enabled:(m==null?void 0:m.enabled)||!1,pageSize:(m==null?void 0:m.pageSize)||100,initialPage:(m==null?void 0:m.currentPage)||1}),z=m!=null&&m.enabled?F.paginatedData:k,N=S.useMemo(()=>({totalRows:t.length,filteredRows:x.length,sortedRows:T.length,groupedRows:_?b.length:T.length,searchedRows:k.length,visibleRows:z.length,hiddenColumns:g.hiddenCount,activeFilters:n.length,activeSorts:i.length,isGrouped:_}),[t.length,x.length,T.length,b.length,k.length,z.length,g.hiddenCount,n.length,i.length,_]);return{data:z,filteredData:x,sortedData:T,groupedData:b,searchedData:k,viewEngine:v,columnEngine:g,paginationEngine:F,metrics:N,isGrouped:_,isPaginated:(m==null?void 0:m.enabled)||!1}}const en="user-demo-001";function lw(e={}){var Uo,Wo,Vo,zo,Ho;const{mode:t="builder",autoLoad:r=!0,initialData:n,config:i={}}=e,[s,a]=S.useState([]),[o,f]=S.useState(""),[u,d]=S.useState(!1),[h,m]=S.useState(!1),l=s.find(U=>U.id===o),[v,g]=S.useState("idle"),[x,T]=S.useState(!1),[b,_]=S.useState(!1),[k,F]=S.useState(!1),[z,N]=S.useState(!1),[B,M]=S.useState(!1),[L,W]=S.useState(!1),[y,H]=S.useState(void 0),[Q,J]=S.useState(null),[ee,_e]=S.useState(null),[Ae,De]=S.useState(!1),[oe,ce]=S.useState(!1),[C,j]=S.useState(null),[R,P]=S.useState(!1),[V,le]=S.useState(!1),[fe,ue]=S.useState({enabled:!1,levels:[],collapsedGroups:[]}),[te,Ie]=S.useState(""),[ae,Pe]=S.useState(new Set),[ke,pt]=S.useState(1),[He,we]=S.useState(10),[ut,je]=S.useState(!1),[Rt,vt]=S.useState(!1),[rt,kt]=S.useState(!1),[Xe,Ht]=S.useState(null),[It,Gt]=S.useState(null),[Lt,Bt]=S.useState(!1),[qe,Je]=S.useState(null),[gt,Ft]=S.useState(null);S.useRef(new x2),S.useRef(new Yi),S.useRef(new Yi),S.useRef(new Yi),S.useRef(new Yi);const[bt,cr]=S.useState(null),Yt=S.useRef(null),Qe=S.useMemo(()=>l?Zy(l.permissions,en):"owner",[l]),pr=Qy(Qe),Xt=S.useMemo(()=>!(l!=null&&l.uploadedData)||!(l!=null&&l.schema)?{totalRows:0,totalColumns:0}:p2(l.uploadedData,l.schema),[l==null?void 0:l.uploadedData,l==null?void 0:l.schema]),ir=S.useCallback(()=>{l&&(Yt.current=w2(l))},[l]),pe=S.useCallback((U,q)=>{a(Z=>Z.map(ie=>ie.id===U?{...ie,...q}:ie))},[]),tr=S.useCallback(U=>{if(!l)return;cr(U);const q=zl(l.id,en,U,l.auditHistory||[]);pe(l.id,{auditHistory:q}),$e.error(U.message),U.recoverable&&Yt.current&&setTimeout(()=>{T2(l,Yt.current,pe),$e.info("Previous state restored")},100)},[l,pe]),Ge=S.useCallback((U,q,Z,ie)=>{if(!l)return;const Fe=Lu(l.id,en,U,q,Z,ie),Me=l.auditHistory||[],_t=Bu(Me,Fe);setTimeout(()=>{pe(l.id,{auditHistory:_t})},0)},[l,pe]);S.useEffect(()=>{if(l!=null&&l.schemaLocked&&l.schema&&(!l.views||l.views.length===0)){const U=Xo(l.schema),q=U.snapshot.columnOrder,Z=Wn(q,U.snapshot.grouping);pe(l.id,{views:[U],activeViewId:U.id,filters:U.snapshot.filters.length>0?U.snapshot.filters:void 0,sortStack:U.snapshot.sortStack.length>0?U.snapshot.sortStack:void 0,columnVisibility:U.snapshot.columnVisibility,columnOrder:Z,columnWidths:U.snapshot.columnWidths,grouping:U.snapshot.grouping})}},[l==null?void 0:l.schemaLocked,l==null?void 0:l.schema,l==null?void 0:l.id,pe]),S.useEffect(()=>{if(n&&r&&!h&&s.length===0){const U={id:`auto-report-${Date.now()}`,name:t==="viewer"?"Data View":"Imported Data",description:"Auto-generated from external data",schemaLocked:!0,uploadedData:n,schema:Go(n),permissions:{owner:en,editors:[],viewers:[]}};a([U]),f(U.id),m(!0),g("confirmed")}},[n,r,h,s.length,t]);const Oe=(Uo=l==null?void 0:l.views)==null?void 0:Uo.find(U=>U.id===l.activeViewId),nt=ow({rawData:(l==null?void 0:l.uploadedData)||[],schema:(l==null?void 0:l.schema)||[],filters:(l==null?void 0:l.filters)||[],sortStack:(l==null?void 0:l.sortStack)||[],grouping:(l==null?void 0:l.grouping)||null,searchQuery:te||"",columnVisibility:(l==null?void 0:l.columnVisibility)||(Oe==null?void 0:Oe.snapshot.columnVisibility)||{},columnOrder:(l==null?void 0:l.columnOrder)||(Oe==null?void 0:Oe.snapshot.columnOrder)||[],columnWidths:(l==null?void 0:l.columnWidths)||(Oe==null?void 0:Oe.snapshot.columnWidths)||{},views:(l==null?void 0:l.views)||[],activeViewId:(l==null?void 0:l.activeViewId)||"",pagination:{enabled:!0,pageSize:He,currentPage:ke}}),{data:Ye=[],searchedData:Tt=[],groupedData:sr=[],metrics:yt={totalRows:0,searchedRows:0,isGrouped:!1},isGrouped:xt=!1,paginationEngine:mt}=nt||{},Te=((Wo=nt.viewEngine)==null?void 0:Wo.activeView)||Oe,he=((Vo=nt.viewEngine)==null?void 0:Vo.isDirty)||!1;S.useEffect(()=>{if(!(!Te||!l)&&!l.columnOrder){const U=Te.snapshot.columnOrder,q=Wn(U,Te.snapshot.grouping);pe(l.id,{columnOrder:q})}},[l==null?void 0:l.activeViewId]);const be=S.useMemo(()=>!(l!=null&&l.schema)||!Te?null:Jd(l.filters||[],l.sortStack||[],l.schema,l.columnVisibility,l.columnOrder,l.columnWidths,l.grouping,Te.snapshot.columnOrder),[l==null?void 0:l.filters,l==null?void 0:l.sortStack,l==null?void 0:l.schema,l==null?void 0:l.columnVisibility,l==null?void 0:l.columnOrder,l==null?void 0:l.columnWidths,l==null?void 0:l.grouping,Te]),We=S.useMemo(()=>!Te||!be||!he?[]:eh(be,Te.snapshot),[Te,be,he]),w=S.useCallback((U,q)=>{const Z={id:`report-${Date.now()}`,name:U,description:q,schemaLocked:!1,permissions:{owner:en,editors:[],viewers:[]}};a(ie=>[...ie,Z]),f(Z.id),d(!1)},[]),O=S.useCallback(U=>{l&&(g("uploading"),setTimeout(()=>{const q=Go(U);pe(l.id,{uploadedData:U,schema:q,uploadError:void 0}),g("preview")},500))},[l,pe]),E=S.useCallback(U=>{l&&(pe(l.id,{uploadError:U}),g("idle"))},[l,pe]),A=S.useCallback(()=>{l&&(pe(l.id,{uploadError:void 0,uploadedData:void 0,schema:void 0}),g("idle"))},[l,pe]),D=S.useCallback(()=>{l&&(pe(l.id,{schemaLocked:!0}),g("confirmed"))},[l,pe]),I=S.useCallback(U=>{if(!l)return;if(!jr("edit_sorting",Qe)){$e.error(Mr("edit_sorting"));return}const q=l.sortStack??[],Z=q.find(ie=>ie.column===U);if(Z){const ie=Vd(Z.direction);if(ie===null){const Fe=q.filter(Me=>Me.column!==U).map((Me,_t)=>({...Me,priority:_t+1}));pe(l.id,{sortStack:Fe.length>0?Fe:void 0})}else{const Fe=q.map(Me=>Me.column===U?{...Me,direction:ie}:Me);pe(l.id,{sortStack:Fe})}}else{if(q.length>=3)return;const ie={column:U,direction:"asc",priority:q.length+1};pe(l.id,{sortStack:[...q,ie]})}},[l,Qe,pe]),Y=S.useCallback(U=>{if(l)if(l.schema){const{validRules:q,invalidColumns:Z}=$u(U,l.schema);Z.length>0&&$e.warning(`Removed invalid sort columns: ${Z.join(", ")}`),ir();try{pe(l.id,{sortStack:q.length>0?q:void 0})}catch(ie){const Fe=Hr("processing","sorting",ie);tr(Fe)}}else pe(l.id,{sortStack:U.length>0?U:void 0})},[l,pe,ir,tr]),ne=S.useCallback(U=>{if(!l)return;const q=l.sortStack??[],Z=q.find(ie=>ie.column===U);if(!(Z&&Z.direction==="asc"))if(Z){const ie=q.map(Fe=>Fe.column===U?{...Fe,direction:"asc"}:Fe);pe(l.id,{sortStack:ie})}else{if(q.length>=3)return;const ie={column:U,direction:"asc",priority:q.length+1};pe(l.id,{sortStack:[...q,ie]})}},[l,pe]),G=S.useCallback(U=>{if(!l)return;const q=l.sortStack??[],Z=q.find(ie=>ie.column===U);if(!(Z&&Z.direction==="desc"))if(Z){const ie=q.map(Fe=>Fe.column===U?{...Fe,direction:"desc"}:Fe);pe(l.id,{sortStack:ie})}else{if(q.length>=3)return;const ie={column:U,direction:"desc",priority:q.length+1};pe(l.id,{sortStack:[...q,ie]})}},[l,pe]),X=S.useCallback(U=>{var Z;if(!l)return;if(!jr("edit_filters",Qe)){$e.error(Mr("edit_filters"));return}const q=(Z=l.schema)==null?void 0:Z.find(ie=>ie.name===U.column);if(q&&U.value!==void 0){const ie=S2(q.type,U.operator,U.value);if(!ie.isValid){$e.error(ie.errorMessage||"Invalid filter value");return}}ir();try{const ie=l.filters??[];Ge("filters","filter_added",ie,[...ie,U]),pe(l.id,{filters:[...ie,U]})}catch(ie){const Fe=Hr("processing","filters",ie);tr(Fe)}},[l,Qe,pe,ir,tr,Ge]),K=S.useCallback((U,q)=>{if(!l)return;if(!jr("edit_filters",Qe)){$e.error(Mr("edit_filters"));return}const Z=l.filters??[],ie=[...Z];Ge("filters","filter_updated",Z[U],q),ie[U]=q,pe(l.id,{filters:ie})},[l,Qe,pe,Ge]),ge=S.useCallback(U=>{if(!l)return;if(!jr("edit_filters",Qe)){$e.error(Mr("edit_filters"));return}const q=l.filters??[],Z=q.filter((ie,Fe)=>Fe!==U);Ge("filters","filter_removed",q[U],null),pe(l.id,{filters:Z.length>0?Z:void 0})},[l,Qe,pe,Ge]),ye=S.useCallback(()=>{if(!l)return;if(!jr("edit_filters",Qe)){$e.error(Mr("edit_filters"));return}const U=l.filters??[];Ge("filters","filter_cleared",U,null),pe(l.id,{filters:void 0})},[l,Qe,pe,Ge]),Ee=S.useCallback(U=>{var Fe;if(!l)return;const q=(Fe=l.views)==null?void 0:Fe.find(Me=>Me.id===U);if(!q)return;const Z=q.snapshot.columnOrder,ie=Wn(Z,q.snapshot.grouping);pe(l.id,{filters:q.snapshot.filters.length>0?[...q.snapshot.filters]:void 0,sortStack:q.snapshot.sortStack.length>0?[...q.snapshot.sortStack]:void 0,columnVisibility:{...q.snapshot.columnVisibility},columnOrder:ie,columnWidths:{...q.snapshot.columnWidths},grouping:q.snapshot.grouping,activeViewId:U}),Pe(new Set),F(!1)},[l,pe]),me=S.useCallback((U,q,Z)=>{if(!(l!=null&&l.schema)||!be)return;const ie={id:`view-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,name:U,description:q||void 0,isDefault:Z,isFavorite:!1,isDeleted:!1,createdAt:Date.now(),updatedAt:Date.now(),snapshot:{...be}},Fe=l.views??[],Me=Z?Fe.map(_t=>({..._t,isDefault:!1})):Fe;pe(l.id,{views:[...Me,ie],activeViewId:ie.id}),$e.success(`"${U}" view created`)},[l,be,pe]),Se=S.useCallback(()=>{var q;if(!Te||!be||Te.isDefault||!l)return;const U=(q=l.views)==null?void 0:q.map(Z=>Z.id===Te.id?{...Z,snapshot:{...be}}:Z);pe(l.id,{views:U}),$e.success(`"${Te.name}" view updated`)},[Te,be,l,pe]),Ne=S.useCallback(()=>{N(!0)},[]),Ve=S.useCallback(()=>{if(!Te||!l)return;const U=Te.snapshot.columnOrder,q=Wn(U,Te.snapshot.grouping);pe(l.id,{filters:Te.snapshot.filters.length>0?[...Te.snapshot.filters]:void 0,sortStack:Te.snapshot.sortStack.length>0?[...Te.snapshot.sortStack]:void 0,columnVisibility:{...Te.snapshot.columnVisibility},columnOrder:q,columnWidths:{...Te.snapshot.columnWidths},grouping:Te.snapshot.grouping}),$e.info("Changes reverted to last saved state")},[Te,l,pe]),ze=S.useCallback(U=>{if(!(l!=null&&l.views))return;const q=l.views.map(ie=>({...ie,isDefault:ie.id===U}));pe(l.id,{views:q});const Z=l.views.find(ie=>ie.id===U);Z&&$e.success(`"${Z.name}" set as default view`)},[l,pe]),Ut=S.useCallback(U=>{if(!(l!=null&&l.views))return;const q=l.views.map(ie=>ie.id===U?{...ie,isFavorite:!ie.isFavorite,updatedAt:Date.now()}:ie);pe(l.id,{views:q});const Z=l.views.find(ie=>ie.id===U);Z&&!Z.isFavorite?$e.success(`"${Z.name}" added to favorites`):Z&&$e.info(`"${Z.name}" removed from favorites`)},[l,pe]),dn=S.useCallback(U=>{if(!(l!=null&&l.views))return;const q=l.views.map(Me=>Me.id===U?{...Me,isDeleted:!0,updatedAt:Date.now()}:Me),Z=l.activeViewId===U,ie=q.find(Me=>Me.isDefault&&!Me.isDeleted);pe(l.id,{views:q,activeViewId:Z&&ie?ie.id:l.activeViewId,filters:Z&&ie?ie.snapshot.filters.length>0?ie.snapshot.filters:void 0:l.filters,sortStack:Z&&ie?ie.snapshot.sortStack.length>0?ie.snapshot.sortStack:void 0:l.sortStack});const Fe=l.views.find(Me=>Me.id===U);Fe&&$e.info(`"${Fe.name}" moved to Recently Deleted`)},[l,pe]),hn=S.useCallback(U=>{if(!(l!=null&&l.views))return;const q=l.views.map(ie=>ie.id===U?{...ie,isDeleted:!1,updatedAt:Date.now()}:ie);pe(l.id,{views:q});const Z=l.views.find(ie=>ie.id===U);Z&&$e.success(`"${Z.name}" restored`)},[l,pe]),pn=S.useCallback(U=>{if(!(l!=null&&l.views))return;const q=l.views.find(gr=>gr.id===U),Z=l.views.filter(gr=>!gr.isDeleted||gr.id===U);if((q==null?void 0:q.isDefault)&&Z.filter(gr=>gr.isDefault).length===1){$e.error("Cannot delete the last default view");return}const Fe=l.views.filter(gr=>gr.id!==U),Me=l.activeViewId===U,_t=Fe.find(gr=>gr.isDefault&&!gr.isDeleted);pe(l.id,{views:Fe,activeViewId:Me&&_t?_t.id:l.activeViewId,filters:Me&&_t?_t.snapshot.filters.length>0?_t.snapshot.filters:void 0:l.filters,sortStack:Me&&_t?_t.snapshot.sortStack.length>0?_t.snapshot.sortStack:void 0:l.sortStack}),q&&$e.success(`"${q.name}" permanently deleted`)},[l,pe]),Vr=S.useCallback(U=>{J(U),M(!0),F(!1)},[]),ni=S.useCallback((U,q)=>{if(!Q||!(l!=null&&l.views))return;const Z=l.views.map(ie=>ie.id===Q?{...ie,name:U,description:q||void 0}:ie);pe(l.id,{views:Z}),J(null)},[Q,l,pe]),kr=S.useCallback(U=>{_e(U),W(!0),F(!1)},[]),nd=S.useCallback(()=>{if(!ee||!(l!=null&&l.views))return;const U=l.views.filter(ie=>ie.id!==ee),q=l.activeViewId===ee,Z=U.find(ie=>ie.isDefault);pe(l.id,{views:U,activeViewId:q&&Z?Z.id:l.activeViewId,filters:q&&Z?Z.snapshot.filters.length>0?Z.snapshot.filters:void 0:l.filters,sortStack:q&&Z?Z.snapshot.sortStack.length>0?Z.snapshot.sortStack:void 0:l.sortStack}),_e(null),W(!1)},[ee,l,pe]);S.useEffect(()=>{mt!=null&&mt.resetPage?mt.resetPage():pt(1)},[l==null?void 0:l.filters,te,l==null?void 0:l.activeViewId]),S.useEffect(()=>{mt&&mt.currentPage!==ke&&pt(mt.currentPage)},[mt==null?void 0:mt.currentPage]);const id=S.useCallback(U=>{mt!=null&&mt.goToPage&&mt.goToPage(U),pt(U)},[mt]),sd=S.useCallback(U=>{const q=(ke-1)*He,Z=Math.floor(q/U)+1;we(U),pt(Z)},[ke,He]),ad=S.useCallback((U,q)=>{if(!l)return;if(!jr("edit_columns",Qe)){$e.error(Mr("edit_columns"));return}const ie={...l.columnVisibility||(Te==null?void 0:Te.snapshot.columnVisibility)||{},[U]:q};pe(l.id,{columnVisibility:ie})},[l,Te,Qe,pe]),od=S.useCallback(U=>{if(l){if(!jr("edit_columns",Qe)){$e.error(Mr("edit_columns"));return}pe(l.id,{columnOrder:U})}},[l,Qe,pe]),ld=S.useCallback((U,q)=>{if(!l)return;if(!jr("edit_columns",Qe)){$e.error(Mr("edit_columns"));return}const ie={...l.columnWidths||(Te==null?void 0:Te.snapshot.columnWidths)||{},[U]:q};pe(l.id,{columnWidths:ie})},[l,Te,Qe,pe]),cd=S.useCallback(U=>{if(!l)return;const Z=(l.filters??[]).filter(ie=>ie.column!==U);pe(l.id,{filters:Z.length>0?Z:void 0})},[l,pe]),ud=S.useCallback(()=>{if(!Te||!(l!=null&&l.schema))return;const U={},q=[],Z={};l.schema.forEach(ie=>{U[ie.name]=!0,q.push(ie.name),Z[ie.name]=150}),pe(l.id,{columnVisibility:U,columnOrder:q,columnWidths:Z,filters:void 0,sortStack:void 0}),$e.success("Reset to default layout - all filters and sorts cleared")},[Te,l,pe]),$o=S.useCallback(m2(U=>{Ie(U)},300),[]),fd=S.useCallback(U=>{$o(U)},[$o]),dd=S.useCallback(U=>{if(!U.trim()||!l)return;const q=l.searchHistory||[],Z=Yy(q,U);pe(l.id,{searchHistory:Z})},[l,pe]),hd=S.useCallback(U=>{if(!l)return;const q=l.searchHistory||[],Z=Xy(q,U);pe(l.id,{searchHistory:Z})},[l,pe]),pd=S.useCallback(U=>{if(!l)return;const q=l.searchHistory||[],Z=Ky(q,U);pe(l.id,{searchHistory:Z})},[l,pe]),gd=S.useCallback(U=>{Pe(q=>{const Z=new Set(q);return Z.has(U)?Z.delete(U):Z.add(U),Z})},[]),md=S.useCallback((U,q)=>{if(U){const Z=new Set;for(let ie=0;ie<q;ie++)Z.add(ie);Pe(Z)}else Pe(new Set)},[]),xd=S.useCallback((U,q)=>{Pe(Z=>{const ie=new Set(Z),Fe=Math.min(U,q),Me=Math.max(U,q);for(let _t=Fe;_t<=Me;_t++)ie.add(_t);return ie})},[]),vd=S.useCallback(()=>{Pe(new Set)},[]),yd=S.useCallback(U=>{if(l){if(!jr("edit_columns",Qe)){$e.error(Mr("edit_columns"));return}if(U&&l.schema){const{validGrouping:q,invalidColumns:Z}=Uu(U,l.schema);Z.length>0&&$e.warning(`Removed invalid grouping columns: ${Z.join(", ")}`),ir();try{const ie=l.grouping;q===null?Ge("grouping","group_cleared",ie,null):ie?Ge("grouping","group_reordered",ie,q):Ge("grouping","group_level_added",null,q);const Fe=(Te==null?void 0:Te.snapshot.columnOrder)||l.columnOrder||[],Me=Wn(Fe,q);pe(l.id,{grouping:q,columnOrder:Me}),JSON.stringify(Me)!==JSON.stringify(l.columnOrder)&&Ge("columns","column_reordered",l.columnOrder,Me),le(!1)}catch(ie){const Fe=Hr("processing","grouping",ie);tr(Fe)}}else{const q=l.grouping;Ge("grouping","group_cleared",q,null);const Z=(Te==null?void 0:Te.snapshot.columnOrder)||l.columnOrder||[];pe(l.id,{grouping:U,columnOrder:[...Z]}),JSON.stringify(Z)!==JSON.stringify(l.columnOrder)&&Ge("columns","column_reordered",l.columnOrder,Z),le(!1)}}},[l,Te,Qe,pe,ir,tr,Ge]),wd=S.useCallback(U=>{if(!l)return;const q=l.grouping;if(!q)return;const Z=Xd(q,U);pe(l.id,{grouping:Z})},[l,pe]),Td=S.useCallback(()=>{Bt(!0)},[]),In=S.useCallback(U=>{l!=null&&l.schema&&(De(!0),setTimeout(()=>{try{let q;U.scope==="visible"?q=Tt:q=l.uploadedData||[];let Z;U.columnScope==="all"?(Z={},l.schema.forEach(gr=>{Z[gr.name]=!0})):Z=l.columnVisibility||(Te==null?void 0:Te.snapshot.columnVisibility)||{};const ie=l.columnOrder||(Te==null?void 0:Te.snapshot.columnOrder),Fe=Pl(q,l.schema,l.filters??[],l.sortStack??[],Te,Z,ie),Me=l.name;let _t;switch(U.format){case"csv":jl(Fe,Me,U),_t="export_csv";break;case"excel":Ml(Fe,Me,U),_t="export_excel";break;case"json":Ll(Fe,Me,U),_t="export_json";break}Ge("export",_t,null,{format:U.format,scope:U.scope,columnScope:U.columnScope,rowCount:q.length,viewName:(Te==null?void 0:Te.name)||"Default View"}),$e.success(`Export completed successfully (${U.format.toUpperCase()})`)}catch(q){const Z=_2(q,{onRetry:()=>In(U)});$e.error(`Export failed: ${Z.message}`,{action:{label:"Retry",onClick:()=>In(U)}});const ie=zl(l.id,en,Z,l.auditHistory||[]);pe(l.id,{auditHistory:ie}),console.error("Export error:",q)}finally{De(!1)}},500))},[l,Te,Tt,pe,Ge]),Sd=S.useCallback(U=>{if(l!=null&&l.schema){if(he&&Te&&!Te.isDefault){j(U.format),ce(!0),Bt(!1);return}In(U),Bt(!1)}},[l,Te,he,In]),Li=S.useCallback(U=>{In({format:U,scope:"visible",columnScope:"visible"})},[In]),Ed=S.useCallback(()=>{C&&Li(C),ce(!1),j(null)},[C,Li]),_d=S.useCallback(()=>{Se(),C&&Li(C),ce(!1),j(null)},[Se,C,Li]),bd=S.useCallback(()=>{ce(!1),j(null)},[]),Cd=S.useCallback(U=>{!(l!=null&&l.schema)||ae.size===0||(De(!0),setTimeout(()=>{try{const q=Array.from(ae).sort((Fe,Me)=>Fe-Me).map(Fe=>sr[Fe]).filter(Fe=>Fe!==void 0),Z=Pl(q,l.schema,l.filters??[],l.sortStack??[],Te),ie=`${l.name.toLowerCase().replace(/\s+/g,"_")}_selected_export`;switch(U){case"csv":jl(Z,ie);break;case"excel":Ml(Z,ie);break;case"json":Ll(Z,ie);break}$e.success(`Exported ${q.length} selected rows`)}catch(q){$e.error("Export failed. Please try again."),console.error("Export error:",q)}finally{De(!1)}},500))},[l,Te,ae,sr]),Ad=S.useCallback(()=>{if(!jr("edit_filters",Qe)){$e.error(Mr("edit_filters"));return}vt(!0)},[Qe]),Od=S.useCallback((U,q)=>{if(l)try{const Z=a2(l),ie=o2(U,q,en,Z),Fe=l2(l.presets,ie);pe(l.id,{presets:Fe});const Me=u2(l.id,ie.id);Ge("presets","preset_created",null,{presetId:ie.id,name:ie.name}),Ht({preset:ie,url:Me}),vt(!1),kt(!0),$e.success(`Preset "${U}" created successfully`)}catch(Z){$e.error(Z instanceof Error?Z.message:"Failed to create preset")}},[l,pe,Ge]),Dd=S.useCallback(async()=>{if(!Xe)return;await h2(Xe.url)?(Ge("presets","preset_link_copied",null,{presetId:Xe.preset.id}),$e.success("Link copied to clipboard")):$e.error("Failed to copy link")},[Xe,Ge]),kd=S.useCallback(()=>{Xe&&(window.location.href=Xe.url)},[Xe]),Id=S.useCallback(()=>{if(!Xe||!l)return;const U=Xe.preset.id,q=Xe.preset.name,Z=c2(l.presets,U);pe(l.id,{presets:Z}),Ge("presets","preset_deleted",{presetId:U,name:q},null),It===U&&Gt(null),kt(!1),Ht(null),$e.success(`Preset "${q}" deleted`)},[Xe,l,It,pe,Ge]),Fd=S.useCallback(()=>{Gt(null),$e.info("Exited preset view")},[]);S.useEffect(()=>{if(!l)return;const U=f2();if(U&&l.presets&&l.schemaLocked&&l.schema){const q=Vl(l.presets,U);if(q){const{sanitizedConfig:Z,warnings:ie}=E2(q.config,l.schema);ie.length>0&&ie.forEach(Me=>$e.warning(Me));const Fe=d2(Z);pe(l.id,Fe),Gt(U),Ge("presets","preset_applied",null,{presetId:q.id,name:q.name}),$e.success(`Loaded preset: ${q.name}`)}else $e.error("Preset not found")}},[l==null?void 0:l.schemaLocked]);const Nd=It?Vl(l==null?void 0:l.presets,It):void 0;S.useEffect(()=>{l!=null&&l.views&&l.views.length>0&&l.activeViewId&&th(l.id,{views:l.views,activeViewId:l.activeViewId})},[l==null?void 0:l.views,l==null?void 0:l.activeViewId,l==null?void 0:l.id]),S.useEffect(()=>{if(l!=null&&l.schemaLocked&&l.schema&&(!l.views||l.views.length===0)){const U=rh(l.id);if(U&&U.views.length>0){const q=U.views.find(Z=>Z.id===U.activeViewId);if(q)pe(l.id,{views:U.views,activeViewId:U.activeViewId,filters:q.snapshot.filters.length>0?q.snapshot.filters:void 0,sortStack:q.snapshot.sortStack.length>0?q.snapshot.sortStack:void 0});else{const Z=U.views.find(ie=>ie.isDefault)||Xo(l.schema);pe(l.id,{views:U.views,activeViewId:Z.id,filters:Z.snapshot.filters.length>0?Z.snapshot.filters:void 0,sortStack:Z.snapshot.sortStack.length>0?Z.snapshot.sortStack:void 0})}}}},[l==null?void 0:l.schemaLocked,l==null?void 0:l.schema,l==null?void 0:l.id]);const Rd=S.useCallback(U=>{H(U),T(!0)},[]),Pd=S.useCallback(()=>{T(!1),H(void 0)},[]),jd=(zo=l==null?void 0:l.views)==null?void 0:zo.find(U=>U.id===Q),Md=(Ho=l==null?void 0:l.views)==null?void 0:Ho.find(U=>U.id===ee);return{reports:s,activeReport:l,activeReportId:o,setActiveReportId:f,isModalOpen:u,setIsModalOpen:d,createReport:w,updateReport:pe,uploadState:v,handleFileUpload:O,handleUploadError:E,handleRetry:A,handleConfirm:D,paginatedData:Ye,processedData:Tt,displayData:sr,tableMetrics:yt,isGrouped:xt,tableEngine:nt,activeView:Te,isDirty:he,currentTableState:be,viewChanges:We,filters:l==null?void 0:l.filters,showFilterPanel:x,setShowFilterPanel:T,filterFocusColumn:y,handleAddFilter:X,handleUpdateFilter:K,handleRemoveFilter:ge,handleClearAllFilters:ye,handleOpenFilterForColumn:Rd,handleCloseFilterPanel:Pd,handleClearFiltersForColumn:cd,sortStack:l==null?void 0:l.sortStack,showSortPanel:b,setShowSortPanel:_,handleSort:I,handleUpdateSortStack:Y,handleSortAscending:ne,handleSortDescending:G,views:l==null?void 0:l.views,showManageViews:k,setShowManageViews:F,showCreateViewModal:z,setShowCreateViewModal:N,showEditViewModal:B,setShowEditViewModal:M,showDeleteConfirmation:L,setShowDeleteConfirmation:W,editingView:jd,deletingView:Md,editingViewId:Q,deletingViewId:ee,handleSelectView:Ee,handleCreateView:me,handleUpdateCurrentView:Se,handleSaveAsNewView:Ne,handleRevertChanges:Ve,handleToggleDefault:ze,handleToggleFavorite:Ut,handleSoftDelete:dn,handleRestoreView:hn,handlePermanentDelete:pn,handleEditView:Vr,handleSaveEditView:ni,handleDeleteView:kr,handleConfirmDelete:nd,showManageColumns:R,setShowManageColumns:P,columnVisibility:l==null?void 0:l.columnVisibility,columnOrder:l==null?void 0:l.columnOrder,columnWidths:l==null?void 0:l.columnWidths,handleUpdateColumnVisibility:ad,handleUpdateColumnOrder:od,handleUpdateColumnWidth:ld,handleResetColumnLayout:ud,showGroupPanel:V,setShowGroupPanel:le,grouping:l==null?void 0:l.grouping,groupingState:fe,handleGroup:yd,handleToggleGroupCollapse:wd,searchQuery:te,searchHistory:qy((l==null?void 0:l.searchHistory)||[]),handleSearchChange:fd,handleAddToSearchHistory:dd,handleToggleSearchFavourite:hd,handleDeleteSearchHistory:pd,selectedRowIds:ae,handleToggleRowSelection:gd,handleToggleAllRows:md,handleRangeSelection:xd,handleClearSelection:vd,currentPage:ke,pageSize:He,paginationEngine:mt,handlePageChange:id,handlePageSizeChange:sd,isExporting:Ae,showExportModal:Lt,setShowExportModal:Bt,showDirtyExportWarning:oe,handleExport:Td,handleExportWithConfig:Sd,handleExportSelected:Cd,handleExportAnyway:Ed,handleSaveAndExport:_d,handleCancelExport:bd,showAuditHistory:ut,setShowAuditHistory:je,auditHistory:l==null?void 0:l.auditHistory,showCreatePreset:Rt,setShowCreatePreset:vt,showShareLink:rt,setShowShareLink:kt,generatedPreset:Xe,activePreset:Nd,activePresetId:It,handleOpenSharePreset:Ad,handleCreatePreset:Od,handleCopyPresetLink:Dd,handleOpenPreset:kd,handleDeletePreset:Id,handleClearActivePreset:Fd,userRole:Qe,isViewerRole:pr,currentUserId:en,featureLimitWarning:gt,setFeatureLimitWarning:Ft,datasetMeta:Xt,reportError:bt,setReportError:cr,handleError:tr,schema:l==null?void 0:l.schema,hasSchemaConflicts:l!=null&&l.schema?$d(l.schema):!1}}function Sn(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Minified MUI error #${e}; visit ${r} for the full message.`}const vn="$$material";function cw(e){for(var t=0,r,n=0,i=e.length;i>=4;++n,i-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var uw={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function fw(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var dw=/[A-Z]|^ms/g,hw=/_EMO_([^_]+?)_([^]*?)_EMO_/g,zu=function(t){return t.charCodeAt(1)===45},Xl=function(t){return t!=null&&typeof t!="boolean"},ca=fw(function(e){return zu(e)?e:e.replace(dw,"-$&").toLowerCase()}),Kl=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(hw,function(n,i,s){return sn={name:i,styles:s,next:sn},i})}return uw[t]!==1&&!zu(t)&&typeof r=="number"&&r!==0?r+"px":r};function ys(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var i=r;if(i.anim===1)return sn={name:i.name,styles:i.styles,next:sn},i.name;var s=r;if(s.styles!==void 0){var a=s.next;if(a!==void 0)for(;a!==void 0;)sn={name:a.name,styles:a.styles,next:sn},a=a.next;var o=s.styles+";";return o}return pw(e,t,r)}}var f=r;return f}function pw(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=ys(e,t,r[i])+";";else for(var s in r){var a=r[s];if(typeof a!="object"){var o=a;Xl(o)&&(n+=ca(s)+":"+Kl(s,o)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&t==null)for(var f=0;f<a.length;f++)Xl(a[f])&&(n+=ca(s)+":"+Kl(s,a[f])+";");else{var u=ys(e,t,a);switch(s){case"animation":case"animationName":{n+=ca(s)+":"+u+";";break}default:n+=s+"{"+u+"}"}}}return n}var ql=/label:\s*([^\s;{]+)\s*(;|$)/g,sn;function gw(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,i="";sn=void 0;var s=e[0];if(s==null||s.raw===void 0)n=!1,i+=ys(r,t,s);else{var a=s;i+=a[0]}for(var o=1;o<e.length;o++)if(i+=ys(r,t,e[o]),n){var f=s;i+=f[o]}ql.lastIndex=0;for(var u="",d;(d=ql.exec(i))!==null;)u+="-"+d[1];var h=cw(i)+u;return{name:h,styles:i,next:sn}}function Hu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qi={exports:{}},Ji={exports:{}},et={};/** @license React v16.13.1
|
|
98
|
-
* react-is.production.min.js
|
|
99
|
-
*
|
|
100
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the MIT license found in the
|
|
103
|
-
* LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/var Jl;function mw(){if(Jl)return et;Jl=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,l=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function _(F){if(typeof F=="object"&&F!==null){var z=F.$$typeof;switch(z){case t:switch(F=F.type,F){case f:case u:case n:case s:case i:case h:return F;default:switch(F=F&&F.$$typeof,F){case o:case d:case v:case l:case a:return F;default:return z}}case r:return z}}}function k(F){return _(F)===u}return et.AsyncMode=f,et.ConcurrentMode=u,et.ContextConsumer=o,et.ContextProvider=a,et.Element=t,et.ForwardRef=d,et.Fragment=n,et.Lazy=v,et.Memo=l,et.Portal=r,et.Profiler=s,et.StrictMode=i,et.Suspense=h,et.isAsyncMode=function(F){return k(F)||_(F)===f},et.isConcurrentMode=k,et.isContextConsumer=function(F){return _(F)===o},et.isContextProvider=function(F){return _(F)===a},et.isElement=function(F){return typeof F=="object"&&F!==null&&F.$$typeof===t},et.isForwardRef=function(F){return _(F)===d},et.isFragment=function(F){return _(F)===n},et.isLazy=function(F){return _(F)===v},et.isMemo=function(F){return _(F)===l},et.isPortal=function(F){return _(F)===r},et.isProfiler=function(F){return _(F)===s},et.isStrictMode=function(F){return _(F)===i},et.isSuspense=function(F){return _(F)===h},et.isValidElementType=function(F){return typeof F=="string"||typeof F=="function"||F===n||F===u||F===s||F===i||F===h||F===m||typeof F=="object"&&F!==null&&(F.$$typeof===v||F.$$typeof===l||F.$$typeof===a||F.$$typeof===o||F.$$typeof===d||F.$$typeof===x||F.$$typeof===T||F.$$typeof===b||F.$$typeof===g)},et.typeOf=_,et}var tt={};/** @license React v16.13.1
|
|
105
|
-
* react-is.development.js
|
|
106
|
-
*
|
|
107
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the MIT license found in the
|
|
110
|
-
* LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/var Zl;function xw(){return Zl||(Zl=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,l=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function _(ae){return typeof ae=="string"||typeof ae=="function"||ae===n||ae===u||ae===s||ae===i||ae===h||ae===m||typeof ae=="object"&&ae!==null&&(ae.$$typeof===v||ae.$$typeof===l||ae.$$typeof===a||ae.$$typeof===o||ae.$$typeof===d||ae.$$typeof===x||ae.$$typeof===T||ae.$$typeof===b||ae.$$typeof===g)}function k(ae){if(typeof ae=="object"&&ae!==null){var Pe=ae.$$typeof;switch(Pe){case t:var ke=ae.type;switch(ke){case f:case u:case n:case s:case i:case h:return ke;default:var pt=ke&&ke.$$typeof;switch(pt){case o:case d:case v:case l:case a:return pt;default:return Pe}}case r:return Pe}}}var F=f,z=u,N=o,B=a,M=t,L=d,W=n,y=v,H=l,Q=r,J=s,ee=i,_e=h,Ae=!1;function De(ae){return Ae||(Ae=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),oe(ae)||k(ae)===f}function oe(ae){return k(ae)===u}function ce(ae){return k(ae)===o}function C(ae){return k(ae)===a}function j(ae){return typeof ae=="object"&&ae!==null&&ae.$$typeof===t}function R(ae){return k(ae)===d}function P(ae){return k(ae)===n}function V(ae){return k(ae)===v}function le(ae){return k(ae)===l}function fe(ae){return k(ae)===r}function ue(ae){return k(ae)===s}function te(ae){return k(ae)===i}function Ie(ae){return k(ae)===h}tt.AsyncMode=F,tt.ConcurrentMode=z,tt.ContextConsumer=N,tt.ContextProvider=B,tt.Element=M,tt.ForwardRef=L,tt.Fragment=W,tt.Lazy=y,tt.Memo=H,tt.Portal=Q,tt.Profiler=J,tt.StrictMode=ee,tt.Suspense=_e,tt.isAsyncMode=De,tt.isConcurrentMode=oe,tt.isContextConsumer=ce,tt.isContextProvider=C,tt.isElement=j,tt.isForwardRef=R,tt.isFragment=P,tt.isLazy=V,tt.isMemo=le,tt.isPortal=fe,tt.isProfiler=ue,tt.isStrictMode=te,tt.isSuspense=Ie,tt.isValidElementType=_,tt.typeOf=k})()),tt}var Ql;function Gu(){return Ql||(Ql=1,process.env.NODE_ENV==="production"?Ji.exports=mw():Ji.exports=xw()),Ji.exports}/*
|
|
112
|
-
object-assign
|
|
113
|
-
(c) Sindre Sorhus
|
|
114
|
-
@license MIT
|
|
115
|
-
*/var ua,ec;function vw(){if(ec)return ua;ec=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var a={},o=0;o<10;o++)a["_"+String.fromCharCode(o)]=o;var f=Object.getOwnPropertyNames(a).map(function(d){return a[d]});if(f.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ua=i()?Object.assign:function(s,a){for(var o,f=n(s),u,d=1;d<arguments.length;d++){o=Object(arguments[d]);for(var h in o)t.call(o,h)&&(f[h]=o[h]);if(e){u=e(o);for(var m=0;m<u.length;m++)r.call(o,u[m])&&(f[u[m]]=o[u[m]])}}return f},ua}var fa,tc;function mo(){if(tc)return fa;tc=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return fa=e,fa}var da,rc;function Yu(){return rc||(rc=1,da=Function.call.bind(Object.prototype.hasOwnProperty)),da}var ha,nc;function yw(){if(nc)return ha;nc=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=mo(),r={},n=Yu();e=function(s){var a="Warning: "+s;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(s,a,o,f,u){if(process.env.NODE_ENV!=="production"){for(var d in s)if(n(s,d)){var h;try{if(typeof s[d]!="function"){var m=Error((f||"React class")+": "+o+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}h=s[d](a,d,f,o,null,t)}catch(v){h=v}if(h&&!(h instanceof Error)&&e((f||"React class")+": type specification of "+o+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in r)){r[h.message]=!0;var l=u?u():"";e("Failed "+o+" type: "+h.message+(l??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},ha=i,ha}var pa,ic;function ww(){if(ic)return pa;ic=1;var e=Gu(),t=vw(),r=mo(),n=Yu(),i=yw(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(o){var f="Warning: "+o;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}});function a(){return null}return pa=function(o,f){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function h(oe){var ce=oe&&(u&&oe[u]||oe[d]);if(typeof ce=="function")return ce}var m="<<anonymous>>",l={array:T("array"),bigint:T("bigint"),bool:T("boolean"),func:T("function"),number:T("number"),object:T("object"),string:T("string"),symbol:T("symbol"),any:b(),arrayOf:_,element:k(),elementType:F(),instanceOf:z,node:L(),objectOf:B,oneOf:N,oneOfType:M,shape:y,exact:H};function v(oe,ce){return oe===ce?oe!==0||1/oe===1/ce:oe!==oe&&ce!==ce}function g(oe,ce){this.message=oe,this.data=ce&&typeof ce=="object"?ce:{},this.stack=""}g.prototype=Error.prototype;function x(oe){if(process.env.NODE_ENV!=="production")var ce={},C=0;function j(P,V,le,fe,ue,te,Ie){if(fe=fe||m,te=te||le,Ie!==r){if(f){var ae=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw ae.name="Invariant Violation",ae}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Pe=fe+":"+le;!ce[Pe]&&C<3&&(s("You are manually calling a React.PropTypes validation function for the `"+te+"` prop on `"+fe+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),ce[Pe]=!0,C++)}}return V[le]==null?P?V[le]===null?new g("The "+ue+" `"+te+"` is marked as required "+("in `"+fe+"`, but its value is `null`.")):new g("The "+ue+" `"+te+"` is marked as required in "+("`"+fe+"`, but its value is `undefined`.")):null:oe(V,le,fe,ue,te)}var R=j.bind(null,!1);return R.isRequired=j.bind(null,!0),R}function T(oe){function ce(C,j,R,P,V,le){var fe=C[j],ue=ee(fe);if(ue!==oe){var te=_e(fe);return new g("Invalid "+P+" `"+V+"` of type "+("`"+te+"` supplied to `"+R+"`, expected ")+("`"+oe+"`."),{expectedType:oe})}return null}return x(ce)}function b(){return x(a)}function _(oe){function ce(C,j,R,P,V){if(typeof oe!="function")return new g("Property `"+V+"` of component `"+R+"` has invalid PropType notation inside arrayOf.");var le=C[j];if(!Array.isArray(le)){var fe=ee(le);return new g("Invalid "+P+" `"+V+"` of type "+("`"+fe+"` supplied to `"+R+"`, expected an array."))}for(var ue=0;ue<le.length;ue++){var te=oe(le,ue,R,P,V+"["+ue+"]",r);if(te instanceof Error)return te}return null}return x(ce)}function k(){function oe(ce,C,j,R,P){var V=ce[C];if(!o(V)){var le=ee(V);return new g("Invalid "+R+" `"+P+"` of type "+("`"+le+"` supplied to `"+j+"`, expected a single ReactElement."))}return null}return x(oe)}function F(){function oe(ce,C,j,R,P){var V=ce[C];if(!e.isValidElementType(V)){var le=ee(V);return new g("Invalid "+R+" `"+P+"` of type "+("`"+le+"` supplied to `"+j+"`, expected a single ReactElement type."))}return null}return x(oe)}function z(oe){function ce(C,j,R,P,V){if(!(C[j]instanceof oe)){var le=oe.name||m,fe=De(C[j]);return new g("Invalid "+P+" `"+V+"` of type "+("`"+fe+"` supplied to `"+R+"`, expected ")+("instance of `"+le+"`."))}return null}return x(ce)}function N(oe){if(!Array.isArray(oe))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),a;function ce(C,j,R,P,V){for(var le=C[j],fe=0;fe<oe.length;fe++)if(v(le,oe[fe]))return null;var ue=JSON.stringify(oe,function(Ie,ae){var Pe=_e(ae);return Pe==="symbol"?String(ae):ae});return new g("Invalid "+P+" `"+V+"` of value `"+String(le)+"` "+("supplied to `"+R+"`, expected one of "+ue+"."))}return x(ce)}function B(oe){function ce(C,j,R,P,V){if(typeof oe!="function")return new g("Property `"+V+"` of component `"+R+"` has invalid PropType notation inside objectOf.");var le=C[j],fe=ee(le);if(fe!=="object")return new g("Invalid "+P+" `"+V+"` of type "+("`"+fe+"` supplied to `"+R+"`, expected an object."));for(var ue in le)if(n(le,ue)){var te=oe(le,ue,R,P,V+"."+ue,r);if(te instanceof Error)return te}return null}return x(ce)}function M(oe){if(!Array.isArray(oe))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var ce=0;ce<oe.length;ce++){var C=oe[ce];if(typeof C!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Ae(C)+" at index "+ce+"."),a}function j(R,P,V,le,fe){for(var ue=[],te=0;te<oe.length;te++){var Ie=oe[te],ae=Ie(R,P,V,le,fe,r);if(ae==null)return null;ae.data&&n(ae.data,"expectedType")&&ue.push(ae.data.expectedType)}var Pe=ue.length>0?", expected one of type ["+ue.join(", ")+"]":"";return new g("Invalid "+le+" `"+fe+"` supplied to "+("`"+V+"`"+Pe+"."))}return x(j)}function L(){function oe(ce,C,j,R,P){return Q(ce[C])?null:new g("Invalid "+R+" `"+P+"` supplied to "+("`"+j+"`, expected a ReactNode."))}return x(oe)}function W(oe,ce,C,j,R){return new g((oe||"React class")+": "+ce+" type `"+C+"."+j+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+R+"`.")}function y(oe){function ce(C,j,R,P,V){var le=C[j],fe=ee(le);if(fe!=="object")return new g("Invalid "+P+" `"+V+"` of type `"+fe+"` "+("supplied to `"+R+"`, expected `object`."));for(var ue in oe){var te=oe[ue];if(typeof te!="function")return W(R,P,V,ue,_e(te));var Ie=te(le,ue,R,P,V+"."+ue,r);if(Ie)return Ie}return null}return x(ce)}function H(oe){function ce(C,j,R,P,V){var le=C[j],fe=ee(le);if(fe!=="object")return new g("Invalid "+P+" `"+V+"` of type `"+fe+"` "+("supplied to `"+R+"`, expected `object`."));var ue=t({},C[j],oe);for(var te in ue){var Ie=oe[te];if(n(oe,te)&&typeof Ie!="function")return W(R,P,V,te,_e(Ie));if(!Ie)return new g("Invalid "+P+" `"+V+"` key `"+te+"` supplied to `"+R+"`.\nBad object: "+JSON.stringify(C[j],null," ")+`
|
|
116
|
-
Valid keys: `+JSON.stringify(Object.keys(oe),null," "));var ae=Ie(le,te,R,P,V+"."+te,r);if(ae)return ae}return null}return x(ce)}function Q(oe){switch(typeof oe){case"number":case"string":case"undefined":return!0;case"boolean":return!oe;case"object":if(Array.isArray(oe))return oe.every(Q);if(oe===null||o(oe))return!0;var ce=h(oe);if(ce){var C=ce.call(oe),j;if(ce!==oe.entries){for(;!(j=C.next()).done;)if(!Q(j.value))return!1}else for(;!(j=C.next()).done;){var R=j.value;if(R&&!Q(R[1]))return!1}}else return!1;return!0;default:return!1}}function J(oe,ce){return oe==="symbol"?!0:ce?ce["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&ce instanceof Symbol:!1}function ee(oe){var ce=typeof oe;return Array.isArray(oe)?"array":oe instanceof RegExp?"object":J(ce,oe)?"symbol":ce}function _e(oe){if(typeof oe>"u"||oe===null)return""+oe;var ce=ee(oe);if(ce==="object"){if(oe instanceof Date)return"date";if(oe instanceof RegExp)return"regexp"}return ce}function Ae(oe){var ce=_e(oe);switch(ce){case"array":case"object":return"an "+ce;case"boolean":case"date":case"regexp":return"a "+ce;default:return ce}}function De(oe){return!oe.constructor||!oe.constructor.name?m:oe.constructor.name}return l.checkPropTypes=i,l.resetWarningCache=i.resetWarningCache,l.PropTypes=l,l},pa}var ga,sc;function Tw(){if(sc)return ga;sc=1;var e=mo();function t(){}function r(){}return r.resetWarningCache=t,ga=function(){function n(a,o,f,u,d,h){if(h!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}n.isRequired=n;function i(){return n}var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return s.PropTypes=s,s},ga}var ac;function Sw(){if(ac)return qi.exports;if(ac=1,process.env.NODE_ENV!=="production"){var e=Gu(),t=!0;qi.exports=ww()(e.isElement,t)}else qi.exports=Tw()();return qi.exports}var Ew=Sw();const Ce=Hu(Ew);function _w(e){return e==null||Object.keys(e).length===0}function xo(e){const{styles:t,defaultTheme:r={}}=e,n=typeof t=="function"?i=>t(_w(i)?r:i):t;return c.jsx(Ha.Global,{styles:n})}process.env.NODE_ENV!=="production"&&(xo.propTypes={defaultTheme:Ce.object,styles:Ce.oneOfType([Ce.array,Ce.string,Ce.object,Ce.func])});/**
|
|
117
|
-
* @mui/styled-engine v7.3.9
|
|
118
|
-
*
|
|
119
|
-
* @license MIT
|
|
120
|
-
* This source code is licensed under the MIT license found in the
|
|
121
|
-
* LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const oc=[];function bw(e){return oc[0]=e,gw(oc)}var Zi={exports:{}},ft={};/**
|
|
123
|
-
* @license React
|
|
124
|
-
* react-is.production.js
|
|
125
|
-
*
|
|
126
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the MIT license found in the
|
|
129
|
-
* LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/var lc;function Cw(){if(lc)return ft;lc=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.view_transition"),l=Symbol.for("react.client.reference");function v(g){if(typeof g=="object"&&g!==null){var x=g.$$typeof;switch(x){case e:switch(g=g.type,g){case r:case i:case n:case f:case u:case m:return g;default:switch(g=g&&g.$$typeof,g){case a:case o:case h:case d:return g;case s:return g;default:return x}}case t:return x}}}return ft.ContextConsumer=s,ft.ContextProvider=a,ft.Element=e,ft.ForwardRef=o,ft.Fragment=r,ft.Lazy=h,ft.Memo=d,ft.Portal=t,ft.Profiler=i,ft.StrictMode=n,ft.Suspense=f,ft.SuspenseList=u,ft.isContextConsumer=function(g){return v(g)===s},ft.isContextProvider=function(g){return v(g)===a},ft.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===e},ft.isForwardRef=function(g){return v(g)===o},ft.isFragment=function(g){return v(g)===r},ft.isLazy=function(g){return v(g)===h},ft.isMemo=function(g){return v(g)===d},ft.isPortal=function(g){return v(g)===t},ft.isProfiler=function(g){return v(g)===i},ft.isStrictMode=function(g){return v(g)===n},ft.isSuspense=function(g){return v(g)===f},ft.isSuspenseList=function(g){return v(g)===u},ft.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===i||g===n||g===f||g===u||typeof g=="object"&&g!==null&&(g.$$typeof===h||g.$$typeof===d||g.$$typeof===a||g.$$typeof===s||g.$$typeof===o||g.$$typeof===l||g.getModuleId!==void 0)},ft.typeOf=v,ft}var dt={};/**
|
|
131
|
-
* @license React
|
|
132
|
-
* react-is.development.js
|
|
133
|
-
*
|
|
134
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
135
|
-
*
|
|
136
|
-
* This source code is licensed under the MIT license found in the
|
|
137
|
-
* LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/var cc;function Aw(){return cc||(cc=1,process.env.NODE_ENV!=="production"&&(function(){function e(g){if(typeof g=="object"&&g!==null){var x=g.$$typeof;switch(x){case t:switch(g=g.type,g){case n:case s:case i:case u:case d:case l:return g;default:switch(g=g&&g.$$typeof,g){case o:case f:case m:case h:return g;case a:return g;default:return x}}case r:return x}}}var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),l=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");dt.ContextConsumer=a,dt.ContextProvider=o,dt.Element=t,dt.ForwardRef=f,dt.Fragment=n,dt.Lazy=m,dt.Memo=h,dt.Portal=r,dt.Profiler=s,dt.StrictMode=i,dt.Suspense=u,dt.SuspenseList=d,dt.isContextConsumer=function(g){return e(g)===a},dt.isContextProvider=function(g){return e(g)===o},dt.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},dt.isForwardRef=function(g){return e(g)===f},dt.isFragment=function(g){return e(g)===n},dt.isLazy=function(g){return e(g)===m},dt.isMemo=function(g){return e(g)===h},dt.isPortal=function(g){return e(g)===r},dt.isProfiler=function(g){return e(g)===s},dt.isStrictMode=function(g){return e(g)===i},dt.isSuspense=function(g){return e(g)===u},dt.isSuspenseList=function(g){return e(g)===d},dt.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===n||g===s||g===i||g===u||g===d||typeof g=="object"&&g!==null&&(g.$$typeof===m||g.$$typeof===h||g.$$typeof===o||g.$$typeof===a||g.$$typeof===f||g.$$typeof===v||g.getModuleId!==void 0)},dt.typeOf=e})()),dt}var uc;function Ow(){return uc||(uc=1,process.env.NODE_ENV==="production"?Zi.exports=Cw():Zi.exports=Aw()),Zi.exports}var Xu=Ow();function tn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ku(e){if(Be.isValidElement(e)||Xu.isValidElementType(e)||!tn(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=Ku(e[r])}),t}function Tr(e,t,r={clone:!0}){const n=r.clone?{...e}:e;return tn(e)&&tn(t)&&Object.keys(t).forEach(i=>{Be.isValidElement(t[i])||Xu.isValidElementType(t[i])?n[i]=t[i]:tn(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&tn(e[i])?n[i]=Tr(e[i],t[i],r):r.clone?n[i]=tn(t[i])?Ku(t[i]):t[i]:n[i]=t[i]}),n}const Dw=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>({...r,[n.key]:n.val}),{})};function kw(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...i}=e,s=Dw(t),a=Object.keys(s);function o(m){return`@media (min-width:${typeof t[m]=="number"?t[m]:m}${r})`}function f(m){return`@media (max-width:${(typeof t[m]=="number"?t[m]:m)-n/100}${r})`}function u(m,l){const v=a.indexOf(l);return`@media (min-width:${typeof t[m]=="number"?t[m]:m}${r}) and (max-width:${(v!==-1&&typeof t[a[v]]=="number"?t[a[v]]:l)-n/100}${r})`}function d(m){return a.indexOf(m)+1<a.length?u(m,a[a.indexOf(m)+1]):o(m)}function h(m){const l=a.indexOf(m);return l===0?o(a[1]):l===a.length-1?f(a[l]):u(m,a[a.indexOf(m)+1]).replace("@media","@media not all and")}return{keys:a,values:s,up:o,down:f,between:u,only:d,not:h,unit:r,...i}}function fc(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(n=>n.startsWith("@container")).sort((n,i)=>{var a,o;const s=/min-width:\s*([0-9.]+)/;return+(((a=n.match(s))==null?void 0:a[1])||0)-+(((o=i.match(s))==null?void 0:o[1])||0)});return r.length?r.reduce((n,i)=>{const s=t[i];return delete n[i],n[i]=s,n},{...t}):t}function Iw(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function Fw(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r){if(process.env.NODE_ENV!=="production")throw new Error(`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
|
|
139
|
-
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`);return null}const[,n,i]=r,s=Number.isNaN(+n)?n||0:+n;return e.containerQueries(i).up(s)}function Nw(e){const t=(s,a)=>s.replace("@media",a?`@container ${a}`:"@container");function r(s,a){s.up=(...o)=>t(e.breakpoints.up(...o),a),s.down=(...o)=>t(e.breakpoints.down(...o),a),s.between=(...o)=>t(e.breakpoints.between(...o),a),s.only=(...o)=>t(e.breakpoints.only(...o),a),s.not=(...o)=>{const f=t(e.breakpoints.not(...o),a);return f.includes("not all and")?f.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):f}}const n={},i=s=>(r(n,s),n);return r(i),{...e,containerQueries:i}}const Rw={borderRadius:4},fn=process.env.NODE_ENV!=="production"?Ce.oneOfType([Ce.number,Ce.string,Ce.object,Ce.array]):{};function mi(e,t){return t?Tr(e,t,{clone:!1}):e}const Fs={xs:0,sm:600,md:900,lg:1200,xl:1536},dc={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Fs[e]}px)`},Pw={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:Fs[t]||t;return typeof r=="number"&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function Jr(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const s=n.breakpoints||dc;return t.reduce((a,o,f)=>(a[s.up(s.keys[f])]=r(t[f]),a),{})}if(typeof t=="object"){const s=n.breakpoints||dc;return Object.keys(t).reduce((a,o)=>{if(Iw(s.keys,o)){const f=Fw(n.containerQueries?n:Pw,o);f&&(a[f]=r(t[o],o))}else if(Object.keys(s.values||Fs).includes(o)){const f=s.up(o);a[f]=r(t[o],o)}else{const f=o;a[f]=t[f]}return a},{})}return r(t)}function jw(e={}){var r;return((r=e.keys)==null?void 0:r.reduce((n,i)=>{const s=e.up(i);return n[s]={},n},{}))||{}}function hc(e,t){return e.reduce((r,n)=>{const i=r[n];return(!i||Object.keys(i).length===0)&&delete r[n],r},t)}function qu(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Sn(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Ns(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((i,s)=>i&&i[s]?i[s]:null,e);if(n!=null)return n}return t.split(".").reduce((n,i)=>n&&n[i]!=null?n[i]:null,e)}function ws(e,t,r,n=r){let i;return typeof e=="function"?i=e(r):Array.isArray(e)?i=e[r]||n:i=Ns(e,r)||n,t&&(i=t(i,n,e)),i}function Nt(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:i}=e,s=a=>{if(a[t]==null)return null;const o=a[t],f=a.theme,u=Ns(f,n)||{};return Jr(a,o,h=>{let m=ws(u,i,h);return h===m&&typeof h=="string"&&(m=ws(u,i,`${t}${h==="default"?"":qu(h)}`,h)),r===!1?m:{[r]:m}})};return s.propTypes=process.env.NODE_ENV!=="production"?{[t]:fn}:{},s.filterProps=[t],s}function Mw(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const Lw={m:"margin",p:"padding"},Bw={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},pc={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},$w=Mw(e=>{if(e.length>2)if(pc[e])e=pc[e];else return[e];const[t,r]=e.split(""),n=Lw[t],i=Bw[r]||"";return Array.isArray(i)?i.map(s=>n+s):[n+i]}),Rs=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ps=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Uw=[...Rs,...Ps];function Ri(e,t,r,n){const i=Ns(e,t,!0)??r;return typeof i=="number"||typeof i=="string"?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&typeof s!="number"&&console.error(`MUI: Expected ${n} argument to be a number or a string, got ${s}.`),typeof i=="string"?i.startsWith("var(")&&s===0?0:i.startsWith("var(")&&s===1?i:`calc(${s} * ${i})`:i*s):Array.isArray(i)?s=>{if(typeof s=="string")return s;const a=Math.abs(s);process.env.NODE_ENV!=="production"&&(Number.isInteger(a)?a>i.length-1&&console.error([`MUI: The value provided (${a}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${a} > ${i.length-1}, you need to add the missing values.`].join(`
|
|
140
|
-
`)):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
|
|
141
|
-
`)));const o=i[a];return s>=0?o:typeof o=="number"?-o:typeof o=="string"&&o.startsWith("var(")?`calc(-1 * ${o})`:`-${o}`}:typeof i=="function"?i:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join(`
|
|
142
|
-
`)),()=>{})}function vo(e){return Ri(e,"spacing",8,"spacing")}function Pi(e,t){return typeof t=="string"||t==null?t:e(t)}function Ww(e,t){return r=>e.reduce((n,i)=>(n[i]=Pi(t,r),n),{})}function Vw(e,t,r,n){if(!t.includes(r))return null;const i=$w(r),s=Ww(i,n),a=e[r];return Jr(e,a,s)}function Ju(e,t){const r=vo(e.theme);return Object.keys(e).map(n=>Vw(e,t,n,r)).reduce(mi,{})}function Ct(e){return Ju(e,Rs)}Ct.propTypes=process.env.NODE_ENV!=="production"?Rs.reduce((e,t)=>(e[t]=fn,e),{}):{};Ct.filterProps=Rs;function At(e){return Ju(e,Ps)}At.propTypes=process.env.NODE_ENV!=="production"?Ps.reduce((e,t)=>(e[t]=fn,e),{}):{};At.filterProps=Ps;process.env.NODE_ENV!=="production"&&Uw.reduce((e,t)=>(e[t]=fn,e),{});function Zu(e=8,t=vo({spacing:e})){if(e.mui)return e;const r=(...n)=>(process.env.NODE_ENV!=="production"&&(n.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${n.length}`)),(n.length===0?[1]:n).map(s=>{const a=t(s);return typeof a=="number"?`${a}px`:a}).join(" "));return r.mui=!0,r}function js(...e){const t=e.reduce((n,i)=>(i.filterProps.forEach(s=>{n[s]=i}),n),{}),r=n=>Object.keys(n).reduce((i,s)=>t[s]?mi(i,t[s](n)):i,{});return r.propTypes=process.env.NODE_ENV!=="production"?e.reduce((n,i)=>Object.assign(n,i.propTypes),{}):{},r.filterProps=e.reduce((n,i)=>n.concat(i.filterProps),[]),r}function Cr(e){return typeof e!="number"?e:`${e}px solid`}function Dr(e,t){return Nt({prop:e,themeKey:"borders",transform:t})}const zw=Dr("border",Cr),Hw=Dr("borderTop",Cr),Gw=Dr("borderRight",Cr),Yw=Dr("borderBottom",Cr),Xw=Dr("borderLeft",Cr),Kw=Dr("borderColor"),qw=Dr("borderTopColor"),Jw=Dr("borderRightColor"),Zw=Dr("borderBottomColor"),Qw=Dr("borderLeftColor"),eT=Dr("outline",Cr),tT=Dr("outlineColor"),Ms=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Ri(e.theme,"shape.borderRadius",4,"borderRadius"),r=n=>({borderRadius:Pi(t,n)});return Jr(e,e.borderRadius,r)}return null};Ms.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:fn}:{};Ms.filterProps=["borderRadius"];js(zw,Hw,Gw,Yw,Xw,Kw,qw,Jw,Zw,Qw,Ms,eT,tT);const Ls=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Ri(e.theme,"spacing",8,"gap"),r=n=>({gap:Pi(t,n)});return Jr(e,e.gap,r)}return null};Ls.propTypes=process.env.NODE_ENV!=="production"?{gap:fn}:{};Ls.filterProps=["gap"];const Bs=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Ri(e.theme,"spacing",8,"columnGap"),r=n=>({columnGap:Pi(t,n)});return Jr(e,e.columnGap,r)}return null};Bs.propTypes=process.env.NODE_ENV!=="production"?{columnGap:fn}:{};Bs.filterProps=["columnGap"];const $s=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Ri(e.theme,"spacing",8,"rowGap"),r=n=>({rowGap:Pi(t,n)});return Jr(e,e.rowGap,r)}return null};$s.propTypes=process.env.NODE_ENV!=="production"?{rowGap:fn}:{};$s.filterProps=["rowGap"];const rT=Nt({prop:"gridColumn"}),nT=Nt({prop:"gridRow"}),iT=Nt({prop:"gridAutoFlow"}),sT=Nt({prop:"gridAutoColumns"}),aT=Nt({prop:"gridAutoRows"}),oT=Nt({prop:"gridTemplateColumns"}),lT=Nt({prop:"gridTemplateRows"}),cT=Nt({prop:"gridTemplateAreas"}),uT=Nt({prop:"gridArea"});js(Ls,Bs,$s,rT,nT,iT,sT,aT,oT,lT,cT,uT);function Kn(e,t){return t==="grey"?t:e}const fT=Nt({prop:"color",themeKey:"palette",transform:Kn}),dT=Nt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Kn}),hT=Nt({prop:"backgroundColor",themeKey:"palette",transform:Kn});js(fT,dT,hT);function wr(e){return e<=1&&e!==0?`${e*100}%`:e}const pT=Nt({prop:"width",transform:wr}),yo=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var i,s,a,o,f;const n=((a=(s=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:s.values)==null?void 0:a[r])||Fs[r];return n?((f=(o=e.theme)==null?void 0:o.breakpoints)==null?void 0:f.unit)!=="px"?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:wr(r)}};return Jr(e,e.maxWidth,t)}return null};yo.filterProps=["maxWidth"];const gT=Nt({prop:"minWidth",transform:wr}),mT=Nt({prop:"height",transform:wr}),xT=Nt({prop:"maxHeight",transform:wr}),vT=Nt({prop:"minHeight",transform:wr});Nt({prop:"size",cssProperty:"width",transform:wr});Nt({prop:"size",cssProperty:"height",transform:wr});const yT=Nt({prop:"boxSizing"});js(pT,yo,gT,mT,xT,vT,yT);const Us={border:{themeKey:"borders",transform:Cr},borderTop:{themeKey:"borders",transform:Cr},borderRight:{themeKey:"borders",transform:Cr},borderBottom:{themeKey:"borders",transform:Cr},borderLeft:{themeKey:"borders",transform:Cr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Cr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ms},color:{themeKey:"palette",transform:Kn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Kn},backgroundColor:{themeKey:"palette",transform:Kn},p:{style:At},pt:{style:At},pr:{style:At},pb:{style:At},pl:{style:At},px:{style:At},py:{style:At},padding:{style:At},paddingTop:{style:At},paddingRight:{style:At},paddingBottom:{style:At},paddingLeft:{style:At},paddingX:{style:At},paddingY:{style:At},paddingInline:{style:At},paddingInlineStart:{style:At},paddingInlineEnd:{style:At},paddingBlock:{style:At},paddingBlockStart:{style:At},paddingBlockEnd:{style:At},m:{style:Ct},mt:{style:Ct},mr:{style:Ct},mb:{style:Ct},ml:{style:Ct},mx:{style:Ct},my:{style:Ct},margin:{style:Ct},marginTop:{style:Ct},marginRight:{style:Ct},marginBottom:{style:Ct},marginLeft:{style:Ct},marginX:{style:Ct},marginY:{style:Ct},marginInline:{style:Ct},marginInlineStart:{style:Ct},marginInlineEnd:{style:Ct},marginBlock:{style:Ct},marginBlockStart:{style:Ct},marginBlockEnd:{style:Ct},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Ls},rowGap:{style:$s},columnGap:{style:Bs},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:wr},maxWidth:{style:yo},minWidth:{transform:wr},height:{transform:wr},maxHeight:{transform:wr},minHeight:{transform:wr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function wT(...e){const t=e.reduce((n,i)=>n.concat(Object.keys(i)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function TT(e,t){return typeof e=="function"?e(t):e}function ST(){function e(r,n,i,s){const a={[r]:n,theme:i},o=s[r];if(!o)return{[r]:n};const{cssProperty:f=r,themeKey:u,transform:d,style:h}=o;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};const m=Ns(i,u)||{};return h?h(a):Jr(a,n,v=>{let g=ws(m,d,v);return v===g&&typeof v=="string"&&(g=ws(m,d,`${r}${v==="default"?"":qu(v)}`,v)),f===!1?g:{[f]:g}})}function t(r){const{sx:n,theme:i={},nested:s}=r||{};if(!n)return null;const a=i.unstable_sxConfig??Us;function o(f){let u=f;if(typeof f=="function")u=f(i);else if(typeof f!="object")return f;if(!u)return null;const d=jw(i.breakpoints),h=Object.keys(d);let m=d;return Object.keys(u).forEach(l=>{const v=TT(u[l],i);if(v!=null)if(typeof v=="object")if(a[l])m=mi(m,e(l,v,i,a));else{const g=Jr({theme:i},v,x=>({[l]:x}));wT(g,v)?m[l]=t({sx:v,theme:i,nested:!0}):m=mi(m,g)}else m=mi(m,e(l,v,i,a))}),!s&&i.modularCssLayers?{"@layer sx":fc(i,hc(h,m))}:fc(i,hc(h,m))}return Array.isArray(n)?n.map(o):o(n)}return t}const ji=ST();ji.filterProps=["sx"];function ET(e,t){var n;const r=this;if(r.vars){if(!((n=r.colorSchemes)!=null&&n[e])||typeof r.getColorSchemeSelector!="function")return{};let i=r.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return r.palette.mode===e?t:{}}function Qu(e={},...t){const{breakpoints:r={},palette:n={},spacing:i,shape:s={},...a}=e,o=kw(r),f=Zu(i);let u=Tr({breakpoints:o,direction:"ltr",components:{},palette:{mode:"light",...n},spacing:f,shape:{...Rw,...s}},a);return u=Nw(u),u.applyStyles=ET,u=t.reduce((d,h)=>Tr(d,h),u),u.unstable_sxConfig={...Us,...a==null?void 0:a.unstable_sxConfig},u.unstable_sx=function(h){return ji({sx:h,theme:this})},u}function _T(e){return Object.keys(e).length===0}function wo(e=null){const t=Be.useContext(Ha.ThemeContext);return!t||_T(t)?e:t}const bT=Qu();function CT(e=bT){return wo(e)}function ma(e){const t=bw(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function To({styles:e,themeId:t,defaultTheme:r={}}){const n=CT(r),i=t&&n[t]||n;let s=typeof e=="function"?e(i):e;return i.modularCssLayers&&(Array.isArray(s)?s=s.map(a=>ma(typeof a=="function"?a(i):a)):s=ma(s)),c.jsx(xo,{styles:s})}process.env.NODE_ENV!=="production"&&(To.propTypes={defaultTheme:Ce.object,styles:Ce.oneOfType([Ce.array,Ce.func,Ce.number,Ce.object,Ce.string,Ce.bool]),themeId:Ce.string});const gc=e=>e,AT=()=>{let e=gc;return{configure(t){e=t},generate(t){return e(t)},reset(){e=gc}}},OT=AT();function ef(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=ef(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function DT(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=ef(e))&&(n&&(n+=" "),n+=t);return n}const kT={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function IT(e,t,r="Mui"){const n=kT[t];return n?`${r}-${n}`:`${OT.generate(e)}-${t}`}function Ia(e,t,r=!1){const n={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const s=i;if(s==="components"||s==="slots")n[s]={...e[s],...n[s]};else if(s==="componentsProps"||s==="slotProps"){const a=e[s],o=t[s];if(!o)n[s]=a||{};else if(!a)n[s]=o;else{n[s]={...o};for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const u=f;n[s][u]=Ia(a[u],o[u],r)}}}else s==="className"&&r&&t.className?n.className=DT(e==null?void 0:e.className,t==null?void 0:t.className):s==="style"&&r&&t.style?n.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:n[s]===void 0&&(n[s]=e[s])}return n}const tf=typeof window<"u"?Be.useLayoutEffect:Be.useEffect;function FT(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function So(e,t=0,r=1){return process.env.NODE_ENV!=="production"&&(e<t||e>r)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${r}].`),FT(e,t,r)}function NT(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),r?`rgb${r.length===4?"a":""}(${r.map((n,i)=>i<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function cn(e){if(e.type)return e;if(e.charAt(0)==="#")return cn(NT(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
|
|
143
|
-
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:Sn(9,e));let n=e.substring(t+1,e.length-1),i;if(r==="color"){if(n=n.split(" "),i=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${i}\` color space.
|
|
144
|
-
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:Sn(10,i))}else n=n.split(",");return n=n.map(s=>parseFloat(s)),{type:r,values:n,colorSpace:i}}const RT=e=>{const t=cn(e);return t.values.slice(0,3).map((r,n)=>t.type.includes("hsl")&&n!==0?`${r}%`:r).join(" ")},li=(e,t)=>{try{return RT(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Ws(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.includes("rgb")?n=n.map((i,s)=>s<3?parseInt(i,10):i):t.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.includes("color")?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function rf(e){e=cn(e);const{values:t}=e,r=t[0],n=t[1]/100,i=t[2]/100,s=n*Math.min(i,1-i),a=(u,d=(u+r/30)%12)=>i-s*Math.max(Math.min(d-3,9-d,1),-1);let o="rgb";const f=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return e.type==="hsla"&&(o+="a",f.push(t[3])),Ws({type:o,values:f})}function Fa(e){e=cn(e);let t=e.type==="hsl"||e.type==="hsla"?cn(rf(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function mc(e,t){const r=Fa(e),n=Fa(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function nf(e,t){return e=cn(e),t=So(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Ws(e)}function gn(e,t,r){try{return nf(e,t)}catch{return r&&process.env.NODE_ENV!=="production"&&console.warn(r),e}}function Vs(e,t){if(e=cn(e),t=So(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Ws(e)}function it(e,t,r){try{return Vs(e,t)}catch{return r&&process.env.NODE_ENV!=="production"&&console.warn(r),e}}function zs(e,t){if(e=cn(e),t=So(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Ws(e)}function st(e,t,r){try{return zs(e,t)}catch{return r&&process.env.NODE_ENV!=="production"&&console.warn(r),e}}function PT(e,t=.15){return Fa(e)>.5?Vs(e,t):zs(e,t)}function Qi(e,t,r){try{return PT(e,t)}catch{return e}}const jT="exact-prop: ";function sf(e){return process.env.NODE_ENV==="production"?e:{...e,[jT]:t=>{const r=Object.keys(t).filter(n=>!e.hasOwnProperty(n));return r.length>0?new Error(`The following props are not supported: ${r.map(n=>`\`${n}\``).join(", ")}. Please remove them.`):null}}}const Eo=Be.createContext(null);process.env.NODE_ENV!=="production"&&(Eo.displayName="ThemeContext");function _o(){const e=Be.useContext(Eo);return process.env.NODE_ENV!=="production"&&Be.useDebugValue(e),e}const MT=typeof Symbol=="function"&&Symbol.for,LT=MT?Symbol.for("mui.nested"):"__THEME_NESTED__";function BT(e,t){if(typeof t=="function"){const r=t(e);return process.env.NODE_ENV!=="production"&&(r||console.error(["MUI: You should return an object from your theme function, i.e.","<ThemeProvider theme={() => ({})} />"].join(`
|
|
145
|
-
`))),r}return{...e,...t}}function Ts(e){const{children:t,theme:r}=e,n=_o();process.env.NODE_ENV!=="production"&&n===null&&typeof r=="function"&&console.error(["MUI: You are providing a theme function prop to the ThemeProvider component:","<ThemeProvider theme={outerTheme => outerTheme} />","","However, no outer theme is present.","Make sure a theme is already injected higher in the React tree or provide a theme object."].join(`
|
|
146
|
-
`));const i=Be.useMemo(()=>{const s=n===null?{...r}:BT(n,r);return s!=null&&(s[LT]=n!==null),s},[r,n]);return c.jsx(Eo.Provider,{value:i,children:t})}process.env.NODE_ENV!=="production"&&(Ts.propTypes={children:Ce.node,theme:Ce.oneOfType([Ce.object,Ce.func]).isRequired});process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&(Ts.propTypes=sf(Ts.propTypes));const $T=Be.createContext();function af({value:e,...t}){return c.jsx($T.Provider,{value:e??!0,...t})}process.env.NODE_ENV!=="production"&&(af.propTypes={children:Ce.node,value:Ce.bool});const of=Be.createContext(void 0);function lf({value:e,children:t}){return c.jsx(of.Provider,{value:e,children:t})}process.env.NODE_ENV!=="production"&&(lf.propTypes={children:Ce.node,value:Ce.object});function UT(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const i=t.components[r];return i.defaultProps?Ia(i.defaultProps,n,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?Ia(i,n,t.components.mergeClassNameAndStyle):n}function WT({props:e,name:t}){const r=Be.useContext(of);return UT({props:e,name:t,theme:{components:r}})}let xc=0;function VT(e){const[t,r]=Be.useState(e),n=e||t;return Be.useEffect(()=>{t==null&&(xc+=1,r(`mui-${xc}`))},[t]),n}const zT={...Be},vc=zT.useId;function HT(e){return vc!==void 0?vc():VT(e)}function GT(e){const t=wo(),r=HT()||"",{modularCssLayers:n}=e;let i="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!n||t!==null?i="":typeof n=="string"?i=n.replace(/mui(?!\.)/g,i):i=`@layer ${i};`,tf(()=>{var o,f;const s=document.querySelector("head");if(!s)return;const a=s.firstChild;if(i){if(a&&((o=a.hasAttribute)!=null&&o.call(a,"data-mui-layer-order"))&&a.getAttribute("data-mui-layer-order")===r)return;const u=document.createElement("style");u.setAttribute("data-mui-layer-order",r),u.textContent=i,s.prepend(u)}else(f=s.querySelector(`style[data-mui-layer-order="${r}"]`))==null||f.remove()},[i,r]),i?c.jsx(To,{styles:i}):null}const yc={};function wc(e,t,r,n=!1){return Be.useMemo(()=>{const i=e&&t[e]||t;if(typeof r=="function"){const s=r(i),a=e?{...t,[e]:s}:s;return n?()=>a:a}return e?{...t,[e]:r}:{...t,...r}},[e,t,r,n])}function bi(e){const{children:t,theme:r,themeId:n}=e,i=wo(yc),s=_o()||yc;process.env.NODE_ENV!=="production"&&(i===null&&typeof r=="function"||n&&i&&!i[n]&&typeof r=="function")&&console.error(["MUI: You are providing a theme function prop to the ThemeProvider component:","<ThemeProvider theme={outerTheme => outerTheme} />","","However, no outer theme is present.","Make sure a theme is already injected higher in the React tree or provide a theme object."].join(`
|
|
147
|
-
`));const a=wc(n,i,r),o=wc(n,s,r,!0),f=(n?a[n]:a).direction==="rtl",u=GT(a);return c.jsx(Ts,{theme:o,children:c.jsx(Ha.ThemeContext.Provider,{value:a,children:c.jsx(af,{value:f,children:c.jsxs(lf,{value:n?a[n].components:a.components,children:[u,t]})})})})}process.env.NODE_ENV!=="production"&&(bi.propTypes={children:Ce.node,theme:Ce.oneOfType([Ce.func,Ce.object]).isRequired,themeId:Ce.string});process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&(bi.propTypes=sf(bi.propTypes));const bo="mode",Co="color-scheme",YT="data-color-scheme";function XT(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:n="dark",modeStorageKey:i=bo,colorSchemeStorageKey:s=Co,attribute:a=YT,colorSchemeNode:o="document.documentElement",nonce:f}=e||{};let u="",d=a;if(a==="class"&&(d=".%s"),a==="data"&&(d="[data-%s]"),d.startsWith(".")){const m=d.substring(1);u+=`${o}.classList.remove('${m}'.replace('%s', light), '${m}'.replace('%s', dark));
|
|
148
|
-
${o}.classList.add('${m}'.replace('%s', colorScheme));`}const h=d.match(/\[([^[\]]+)\]/);if(h){const[m,l]=h[1].split("=");l||(u+=`${o}.removeAttribute('${m}'.replace('%s', light));
|
|
149
|
-
${o}.removeAttribute('${m}'.replace('%s', dark));`),u+=`
|
|
150
|
-
${o}.setAttribute('${m}'.replace('%s', colorScheme), ${l?`${l}.replace('%s', colorScheme)`:'""'});`}else d!==".%s"&&(u+=`${o}.setAttribute('${d}', colorScheme);`);return c.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
|
|
151
|
-
try {
|
|
152
|
-
let colorScheme = '';
|
|
153
|
-
const mode = localStorage.getItem('${i}') || '${t}';
|
|
154
|
-
const dark = localStorage.getItem('${s}-dark') || '${n}';
|
|
155
|
-
const light = localStorage.getItem('${s}-light') || '${r}';
|
|
156
|
-
if (mode === 'system') {
|
|
157
|
-
// handle system mode
|
|
158
|
-
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
159
|
-
if (mql.matches) {
|
|
160
|
-
colorScheme = dark
|
|
161
|
-
} else {
|
|
162
|
-
colorScheme = light
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (mode === 'light') {
|
|
166
|
-
colorScheme = light;
|
|
167
|
-
}
|
|
168
|
-
if (mode === 'dark') {
|
|
169
|
-
colorScheme = dark;
|
|
170
|
-
}
|
|
171
|
-
if (colorScheme) {
|
|
172
|
-
${u}
|
|
173
|
-
}
|
|
174
|
-
} catch(e){}})();`}},"mui-color-scheme-init")}function KT(){}const qT=({key:e,storageWindow:t})=>(!t&&typeof window<"u"&&(t=window),{get(r){if(typeof window>"u")return;if(!t)return r;let n;try{n=t.localStorage.getItem(e)}catch{}return n||r},set:r=>{if(t)try{t.localStorage.setItem(e,r)}catch{}},subscribe:r=>{if(!t)return KT;const n=i=>{const s=i.newValue;i.key===e&&r(s)};return t.addEventListener("storage",n),()=>{t.removeEventListener("storage",n)}}});function xa(){}function Tc(e){if(typeof window<"u"&&typeof window.matchMedia=="function"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function cf(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function JT(e){return cf(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function ZT(e){const{defaultMode:t="light",defaultLightColorScheme:r,defaultDarkColorScheme:n,supportedColorSchemes:i=[],modeStorageKey:s=bo,colorSchemeStorageKey:a=Co,storageWindow:o=typeof window>"u"?void 0:window,storageManager:f=qT,noSsr:u=!1}=e,d=i.join(","),h=i.length>1,m=Be.useMemo(()=>f==null?void 0:f({key:s,storageWindow:o}),[f,s,o]),l=Be.useMemo(()=>f==null?void 0:f({key:`${a}-light`,storageWindow:o}),[f,a,o]),v=Be.useMemo(()=>f==null?void 0:f({key:`${a}-dark`,storageWindow:o}),[f,a,o]),[g,x]=Be.useState(()=>{const B=(m==null?void 0:m.get(t))||t,M=(l==null?void 0:l.get(r))||r,L=(v==null?void 0:v.get(n))||n;return{mode:B,systemMode:Tc(B),lightColorScheme:M,darkColorScheme:L}}),[T,b]=Be.useState(u||!h);Be.useEffect(()=>{b(!0)},[]);const _=JT(g),k=Be.useCallback(B=>{x(M=>{if(B===M.mode)return M;const L=B??t;return m==null||m.set(L),{...M,mode:L,systemMode:Tc(L)}})},[m,t]),F=Be.useCallback(B=>{B?typeof B=="string"?B&&!d.includes(B)?console.error(`\`${B}\` does not exist in \`theme.colorSchemes\`.`):x(M=>{const L={...M};return cf(M,W=>{W==="light"&&(l==null||l.set(B),L.lightColorScheme=B),W==="dark"&&(v==null||v.set(B),L.darkColorScheme=B)}),L}):x(M=>{const L={...M},W=B.light===null?r:B.light,y=B.dark===null?n:B.dark;return W&&(d.includes(W)?(L.lightColorScheme=W,l==null||l.set(W)):console.error(`\`${W}\` does not exist in \`theme.colorSchemes\`.`)),y&&(d.includes(y)?(L.darkColorScheme=y,v==null||v.set(y)):console.error(`\`${y}\` does not exist in \`theme.colorSchemes\`.`)),L}):x(M=>(l==null||l.set(r),v==null||v.set(n),{...M,lightColorScheme:r,darkColorScheme:n}))},[d,l,v,r,n]),z=Be.useCallback(B=>{g.mode==="system"&&x(M=>{const L=B!=null&&B.matches?"dark":"light";return M.systemMode===L?M:{...M,systemMode:L}})},[g.mode]),N=Be.useRef(z);return N.current=z,Be.useEffect(()=>{if(typeof window.matchMedia!="function"||!h)return;const B=(...L)=>N.current(...L),M=window.matchMedia("(prefers-color-scheme: dark)");return M.addListener(B),B(M),()=>{M.removeListener(B)}},[h]),Be.useEffect(()=>{if(h){const B=(m==null?void 0:m.subscribe(W=>{(!W||["light","dark","system"].includes(W))&&k(W||t)}))||xa,M=(l==null?void 0:l.subscribe(W=>{(!W||d.match(W))&&F({light:W})}))||xa,L=(v==null?void 0:v.subscribe(W=>{(!W||d.match(W))&&F({dark:W})}))||xa;return()=>{B(),M(),L()}}},[F,k,d,t,o,h,m,l,v]),{...g,mode:T?g.mode:void 0,systemMode:T?g.systemMode:void 0,colorScheme:T?_:void 0,setMode:k,setColorScheme:F}}const QT="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function eS(e){const{themeId:t,theme:r={},modeStorageKey:n=bo,colorSchemeStorageKey:i=Co,disableTransitionOnChange:s=!1,defaultColorScheme:a,resolveTheme:o}=e,f={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},u=Be.createContext(void 0);process.env.NODE_ENV!=="production"&&(u.displayName="ColorSchemeContext");const d=()=>Be.useContext(u)||f,h={},m={};function l(T){var It,Gt,Lt,Bt;const{children:b,theme:_,modeStorageKey:k=n,colorSchemeStorageKey:F=i,disableTransitionOnChange:z=s,storageManager:N,storageWindow:B=typeof window>"u"?void 0:window,documentNode:M=typeof document>"u"?void 0:document,colorSchemeNode:L=typeof document>"u"?void 0:document.documentElement,disableNestedContext:W=!1,disableStyleSheetGeneration:y=!1,defaultMode:H="system",forceThemeRerender:Q=!1,noSsr:J}=T,ee=Be.useRef(!1),_e=_o(),Ae=Be.useContext(u),De=!!Ae&&!W,oe=Be.useMemo(()=>_||(typeof r=="function"?r():r),[_]),ce=oe[t],C=ce||oe,{colorSchemes:j=h,components:R=m,cssVarPrefix:P}=C,V=Object.keys(j).filter(qe=>!!j[qe]).join(","),le=Be.useMemo(()=>V.split(","),[V]),fe=typeof a=="string"?a:a.light,ue=typeof a=="string"?a:a.dark,te=j[fe]&&j[ue]?H:((Gt=(It=j[C.defaultColorScheme])==null?void 0:It.palette)==null?void 0:Gt.mode)||((Lt=C.palette)==null?void 0:Lt.mode),{mode:Ie,setMode:ae,systemMode:Pe,lightColorScheme:ke,darkColorScheme:pt,colorScheme:He,setColorScheme:we}=ZT({supportedColorSchemes:le,defaultLightColorScheme:fe,defaultDarkColorScheme:ue,modeStorageKey:k,colorSchemeStorageKey:F,defaultMode:te,storageManager:N,storageWindow:B,noSsr:J});let ut=Ie,je=He;De&&(ut=Ae.mode,je=Ae.colorScheme),process.env.NODE_ENV!=="production"&&Q&&!C.vars&&console.warn(["MUI: The `forceThemeRerender` prop should only be used with CSS theme variables.","Note that it will slow down the app when changing between modes, so only do this when you cannot find a better solution."].join(`
|
|
175
|
-
`));let Rt=je||C.defaultColorScheme;C.vars&&!Q&&(Rt=C.defaultColorScheme);const vt=Be.useMemo(()=>{var gt;const qe=((gt=C.generateThemeVars)==null?void 0:gt.call(C))||C.vars,Je={...C,components:R,colorSchemes:j,cssVarPrefix:P,vars:qe};if(typeof Je.generateSpacing=="function"&&(Je.spacing=Je.generateSpacing()),Rt){const Ft=j[Rt];Ft&&typeof Ft=="object"&&Object.keys(Ft).forEach(bt=>{Ft[bt]&&typeof Ft[bt]=="object"?Je[bt]={...Je[bt],...Ft[bt]}:Je[bt]=Ft[bt]})}return o?o(Je):Je},[C,Rt,R,j,P]),rt=C.colorSchemeSelector;tf(()=>{if(je&&L&&rt&&rt!=="media"){const qe=rt;let Je=rt;if(qe==="class"&&(Je=".%s"),qe==="data"&&(Je="[data-%s]"),qe!=null&&qe.startsWith("data-")&&!qe.includes("%s")&&(Je=`[${qe}="%s"]`),Je.startsWith("."))L.classList.remove(...le.map(gt=>Je.substring(1).replace("%s",gt))),L.classList.add(Je.substring(1).replace("%s",je));else{const gt=Je.replace("%s",je).match(/\[([^\]]+)\]/);if(gt){const[Ft,bt]=gt[1].split("=");bt||le.forEach(cr=>{L.removeAttribute(Ft.replace(je,cr))}),L.setAttribute(Ft,bt?bt.replace(/"|'/g,""):"")}else L.setAttribute(Je,je)}}},[je,rt,L,le]),Be.useEffect(()=>{let qe;if(z&&ee.current&&M){const Je=M.createElement("style");Je.appendChild(M.createTextNode(QT)),M.head.appendChild(Je),window.getComputedStyle(M.body),qe=setTimeout(()=>{M.head.removeChild(Je)},1)}return()=>{clearTimeout(qe)}},[je,z,M]),Be.useEffect(()=>(ee.current=!0,()=>{ee.current=!1}),[]);const kt=Be.useMemo(()=>({allColorSchemes:le,colorScheme:je,darkColorScheme:pt,lightColorScheme:ke,mode:ut,setColorScheme:we,setMode:process.env.NODE_ENV==="production"?ae:qe=>{vt.colorSchemeSelector==="media"&&console.error(["MUI: The `setMode` function has no effect if `colorSchemeSelector` is `media` (`media` is the default value).","To toggle the mode manually, please configure `colorSchemeSelector` to use a class or data attribute.","To learn more, visit https://mui.com/material-ui/customization/css-theme-variables/configuration/#toggling-dark-mode-manually"].join(`
|
|
176
|
-
`)),ae(qe)},systemMode:Pe}),[le,je,pt,ke,ut,we,ae,Pe,vt.colorSchemeSelector]);let Xe=!0;(y||C.cssVariables===!1||De&&(_e==null?void 0:_e.cssVarPrefix)===P)&&(Xe=!1);const Ht=c.jsxs(Be.Fragment,{children:[c.jsx(bi,{themeId:ce?t:void 0,theme:vt,children:b}),Xe&&c.jsx(xo,{styles:((Bt=vt.generateStyleSheets)==null?void 0:Bt.call(vt))||[]})]});return De?Ht:c.jsx(u.Provider,{value:kt,children:Ht})}process.env.NODE_ENV!=="production"&&(l.propTypes={children:Ce.node,colorSchemeNode:Ce.any,colorSchemeStorageKey:Ce.string,defaultMode:Ce.string,disableNestedContext:Ce.bool,disableStyleSheetGeneration:Ce.bool,disableTransitionOnChange:Ce.bool,documentNode:Ce.any,forceThemeRerender:Ce.bool,modeStorageKey:Ce.string,noSsr:Ce.bool,storageManager:Ce.func,storageWindow:Ce.any,theme:Ce.object});const v=typeof a=="string"?a:a.light,g=typeof a=="string"?a:a.dark;return{CssVarsProvider:l,useColorScheme:d,getInitColorSchemeScript:T=>XT({colorSchemeStorageKey:i,defaultLightColorScheme:v,defaultDarkColorScheme:g,modeStorageKey:n,...T})}}function tS(e=""){function t(...n){if(!n.length)return"";const i=n[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...n.slice(1))})`:`, ${i}`}return(n,...i)=>`var(--${e?`${e}-`:""}${n}${t(...i)})`}const Sc=(e,t,r,n=[])=>{let i=e;t.forEach((s,a)=>{a===t.length-1?Array.isArray(i)?i[Number(s)]=r:i&&typeof i=="object"&&(i[s]=r):i&&typeof i=="object"&&(i[s]||(i[s]=n.includes(s)?[]:{}),i=i[s])})},rS=(e,t,r)=>{function n(i,s=[],a=[]){Object.entries(i).forEach(([o,f])=>{(!r||r&&!r([...s,o]))&&f!=null&&(typeof f=="object"&&Object.keys(f).length>0?n(f,[...s,o],Array.isArray(f)?[...a,o]:a):t([...s,o],f,a))})}n(e)},nS=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(n=>e.includes(n))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function va(e,t){const{prefix:r,shouldSkipGeneratingVar:n}=t||{},i={},s={},a={};return rS(e,(o,f,u)=>{if((typeof f=="string"||typeof f=="number")&&(!n||!n(o,f))){const d=`--${r?`${r}-`:""}${o.join("-")}`,h=nS(o,f);Object.assign(i,{[d]:h}),Sc(s,o,`var(${d})`,u),Sc(a,o,`var(${d}, ${h})`,u)}},o=>o[0]==="vars"),{css:i,vars:s,varsWithDefaults:a}}function iS(e,t={}){const{getSelector:r=T,disableCssColorScheme:n,colorSchemeSelector:i,enableContrastVars:s}=t,{colorSchemes:a={},components:o,defaultColorScheme:f="light",...u}=e,{vars:d,css:h,varsWithDefaults:m}=va(u,t);let l=m;const v={},{[f]:g,...x}=a;if(Object.entries(x||{}).forEach(([k,F])=>{const{vars:z,css:N,varsWithDefaults:B}=va(F,t);l=Tr(l,B),v[k]={css:N,vars:z}}),g){const{css:k,vars:F,varsWithDefaults:z}=va(g,t);l=Tr(l,z),v[f]={css:k,vars:F}}function T(k,F){var N,B;let z=i;if(i==="class"&&(z=".%s"),i==="data"&&(z="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(z=`[${i}="%s"]`),k){if(z==="media")return e.defaultColorScheme===k?":root":{[`@media (prefers-color-scheme: ${((B=(N=a[k])==null?void 0:N.palette)==null?void 0:B.mode)||k})`]:{":root":F}};if(z)return e.defaultColorScheme===k?`:root, ${z.replace("%s",String(k))}`:z.replace("%s",String(k))}return":root"}return{vars:l,generateThemeVars:()=>{let k={...d};return Object.entries(v).forEach(([,{vars:F}])=>{k=Tr(k,F)}),k},generateStyleSheets:()=>{var M,L;const k=[],F=e.defaultColorScheme||"light";function z(W,y){Object.keys(y).length&&k.push(typeof W=="string"?{[W]:{...y}}:W)}z(r(void 0,{...h}),h);const{[F]:N,...B}=v;if(N){const{css:W}=N,y=(L=(M=a[F])==null?void 0:M.palette)==null?void 0:L.mode,H=!n&&y?{colorScheme:y,...W}:{...W};z(r(F,{...H}),H)}return Object.entries(B).forEach(([W,{css:y}])=>{var J,ee;const H=(ee=(J=a[W])==null?void 0:J.palette)==null?void 0:ee.mode,Q=!n&&H?{colorScheme:H,...y}:{...y};z(r(W,{...Q}),Q)}),s&&k.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),k}}}function sS(e){return function(r){return e==="media"?(process.env.NODE_ENV!=="production"&&r!=="light"&&r!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${r}'.`),`@media (prefers-color-scheme: ${r})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${r}"] &`:e==="class"?`.${r} &`:e==="data"?`[data-${r}] &`:`${e.replace("%s",r)} &`:"&"}}const Ci={black:"#000",white:"#fff"},aS={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Pn={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},jn={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},si={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Mn={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Ln={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Bn={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function uf(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Ci.white,default:Ci.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const ff=uf();function df(){return{text:{primary:Ci.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Ci.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Na=df();function Ec(e,t,r,n){const i=n.light||n,s=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=zs(e.main,i):t==="dark"&&(e.dark=Vs(e.main,s)))}function _c(e,t,r,n,i){const s=i.light||i,a=i.dark||i*1.5;t[r]||(t.hasOwnProperty(n)?t[r]=t[n]:r==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(s*100).toFixed(0)}%)`:r==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(a*100).toFixed(0)}%)`))}function oS(e="light"){return e==="dark"?{main:Mn[200],light:Mn[50],dark:Mn[400]}:{main:Mn[700],light:Mn[400],dark:Mn[800]}}function lS(e="light"){return e==="dark"?{main:Pn[200],light:Pn[50],dark:Pn[400]}:{main:Pn[500],light:Pn[300],dark:Pn[700]}}function cS(e="light"){return e==="dark"?{main:jn[500],light:jn[300],dark:jn[700]}:{main:jn[700],light:jn[400],dark:jn[800]}}function uS(e="light"){return e==="dark"?{main:Ln[400],light:Ln[300],dark:Ln[700]}:{main:Ln[700],light:Ln[500],dark:Ln[900]}}function fS(e="light"){return e==="dark"?{main:Bn[400],light:Bn[300],dark:Bn[700]}:{main:Bn[800],light:Bn[500],dark:Bn[900]}}function dS(e="light"){return e==="dark"?{main:si[400],light:si[300],dark:si[700]}:{main:"#ed6c02",light:si[500],dark:si[900]}}function hS(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Ao(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2,colorSpace:i,...s}=e,a=e.primary||oS(t),o=e.secondary||lS(t),f=e.error||cS(t),u=e.info||uS(t),d=e.success||fS(t),h=e.warning||dS(t);function m(x){if(i)return hS(x);const T=mc(x,Na.text.primary)>=r?Na.text.primary:ff.text.primary;if(process.env.NODE_ENV!=="production"){const b=mc(x,T);b<3&&console.error([`MUI: The contrast ratio of ${b}:1 for ${T} on ${x}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
|
|
177
|
-
`))}return T}const l=({color:x,name:T,mainShade:b=500,lightShade:_=300,darkShade:k=700})=>{if(x={...x},!x.main&&x[b]&&(x.main=x[b]),!x.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${T?` (${T})`:""} provided to augmentColor(color) is invalid.
|
|
178
|
-
The color object needs to have a \`main\` property or a \`${b}\` property.`:Sn(11,T?` (${T})`:"",b));if(typeof x.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${T?` (${T})`:""} provided to augmentColor(color) is invalid.
|
|
179
|
-
\`color.main\` should be a string, but \`${JSON.stringify(x.main)}\` was provided instead.
|
|
180
|
-
|
|
181
|
-
Did you intend to use one of the following approaches?
|
|
182
|
-
|
|
183
|
-
import { green } from "@mui/material/colors";
|
|
184
|
-
|
|
185
|
-
const theme1 = createTheme({ palette: {
|
|
186
|
-
primary: green,
|
|
187
|
-
} });
|
|
188
|
-
|
|
189
|
-
const theme2 = createTheme({ palette: {
|
|
190
|
-
primary: { main: green[500] },
|
|
191
|
-
} });`:Sn(12,T?` (${T})`:"",JSON.stringify(x.main)));return i?(_c(i,x,"light",_,n),_c(i,x,"dark",k,n)):(Ec(x,"light",_,n),Ec(x,"dark",k,n)),x.contrastText||(x.contrastText=m(x.main)),x};let v;return t==="light"?v=uf():t==="dark"&&(v=df()),process.env.NODE_ENV!=="production"&&(v||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Tr({common:{...Ci},mode:t,primary:l({color:a,name:"primary"}),secondary:l({color:o,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:l({color:f,name:"error"}),warning:l({color:h,name:"warning"}),info:l({color:u,name:"info"}),success:l({color:d,name:"success"}),grey:aS,contrastThreshold:r,getContrastText:m,augmentColor:l,tonalOffset:n,...v},s)}function pS(e){const t={};return Object.entries(e).forEach(n=>{const[i,s]=n;typeof s=="object"&&(t[i]=`${s.fontStyle?`${s.fontStyle} `:""}${s.fontVariant?`${s.fontVariant} `:""}${s.fontWeight?`${s.fontWeight} `:""}${s.fontStretch?`${s.fontStretch} `:""}${s.fontSize||""}${s.lineHeight?`/${s.lineHeight} `:""}${s.fontFamily||""}`)}),t}function gS(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function mS(e){return Math.round(e*1e5)/1e5}const bc={textTransform:"uppercase"},Cc='"Roboto", "Helvetica", "Arial", sans-serif';function hf(e,t){const{fontFamily:r=Cc,fontSize:n=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:o=700,htmlFontSize:f=16,allVariants:u,pxToRem:d,...h}=typeof t=="function"?t(e):t;process.env.NODE_ENV!=="production"&&(typeof n!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof f!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const m=n/14,l=d||(x=>`${x/f*m}rem`),v=(x,T,b,_,k)=>({fontFamily:r,fontWeight:x,fontSize:l(T),lineHeight:b,...r===Cc?{letterSpacing:`${mS(_/T)}em`}:{},...k,...u}),g={h1:v(i,96,1.167,-1.5),h2:v(i,60,1.2,-.5),h3:v(s,48,1.167,0),h4:v(s,34,1.235,.25),h5:v(s,24,1.334,0),h6:v(a,20,1.6,.15),subtitle1:v(s,16,1.75,.15),subtitle2:v(a,14,1.57,.1),body1:v(s,16,1.5,.15),body2:v(s,14,1.43,.15),button:v(a,14,1.75,.4,bc),caption:v(s,12,1.66,.4),overline:v(s,12,2.66,1,bc),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Tr({htmlFontSize:f,pxToRem:l,fontFamily:r,fontSize:n,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:o,...g},h,{clone:!1})}const xS=.2,vS=.14,yS=.12;function St(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${xS})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${vS})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${yS})`].join(",")}const wS=["none",St(0,2,1,-1,0,1,1,0,0,1,3,0),St(0,3,1,-2,0,2,2,0,0,1,5,0),St(0,3,3,-2,0,3,4,0,0,1,8,0),St(0,2,4,-1,0,4,5,0,0,1,10,0),St(0,3,5,-1,0,5,8,0,0,1,14,0),St(0,3,5,-1,0,6,10,0,0,1,18,0),St(0,4,5,-2,0,7,10,1,0,2,16,1),St(0,5,5,-3,0,8,10,1,0,3,14,2),St(0,5,6,-3,0,9,12,1,0,3,16,2),St(0,6,6,-3,0,10,14,1,0,4,18,3),St(0,6,7,-4,0,11,15,1,0,4,20,3),St(0,7,8,-4,0,12,17,2,0,5,22,4),St(0,7,8,-4,0,13,19,2,0,5,24,4),St(0,7,9,-4,0,14,21,2,0,5,26,4),St(0,8,9,-5,0,15,22,2,0,6,28,5),St(0,8,10,-5,0,16,24,2,0,6,30,5),St(0,8,11,-5,0,17,26,2,0,6,32,5),St(0,9,11,-5,0,18,28,2,0,7,34,6),St(0,9,12,-6,0,19,29,2,0,7,36,6),St(0,10,13,-6,0,20,31,3,0,8,38,7),St(0,10,13,-6,0,21,33,3,0,8,40,7),St(0,10,14,-6,0,22,35,3,0,8,42,7),St(0,11,14,-7,0,23,36,3,0,9,44,8),St(0,11,15,-7,0,24,38,3,0,9,46,8)],TS={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},SS={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Ac(e){return`${Math.round(e)}ms`}function ES(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function _S(e){const t={...TS,...e.easing},r={...SS,...e.duration};return{getAutoHeightDuration:ES,create:(i=["all"],s={})=>{const{duration:a=r.standard,easing:o=t.easeInOut,delay:f=0,...u}=s;if(process.env.NODE_ENV!=="production"){const d=m=>typeof m=="string",h=m=>!Number.isNaN(parseFloat(m));!d(i)&&!Array.isArray(i)&&console.error('MUI: Argument "props" must be a string or Array.'),!h(a)&&!d(a)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${a}.`),d(o)||console.error('MUI: Argument "easing" must be a string.'),!h(f)&&!d(f)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof s!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
|
|
192
|
-
`)),Object.keys(u).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(u).join(",")}].`)}return(Array.isArray(i)?i:[i]).map(d=>`${d} ${typeof a=="string"?a:Ac(a)} ${o} ${typeof f=="string"?f:Ac(f)}`).join(",")},...e,easing:t,duration:r}}const bS={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function CS(e){return tn(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function pf(e={}){const t={...e};function r(n){const i=Object.entries(n);for(let s=0;s<i.length;s++){const[a,o]=i[s];!CS(o)||a.startsWith("unstable_")?delete n[a]:tn(o)&&(n[a]={...o},r(n[a]))}}return r(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
193
|
-
|
|
194
|
-
const theme = ${JSON.stringify(t,null,2)};
|
|
195
|
-
|
|
196
|
-
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
197
|
-
theme.transitions = createTransitions(theme.transitions || {});
|
|
198
|
-
|
|
199
|
-
export default theme;`}function Oc(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const AS=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let r=0;for(let n=0;n<t.length;n+=1)r+=+t[n];return r};function OS(e){Object.assign(e,{alpha(t,r){const n=this||e;return n.colorSpace?`oklch(from ${t} l c h / ${typeof r=="string"?`calc(${r})`:r})`:n.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof r=="string"?`calc(${r})`:r})`:nf(t,AS(r))},lighten(t,r){const n=this||e;return n.colorSpace?`color-mix(in ${n.colorSpace}, ${t}, #fff ${Oc(r)})`:zs(t,r)},darken(t,r){const n=this||e;return n.colorSpace?`color-mix(in ${n.colorSpace}, ${t}, #000 ${Oc(r)})`:Vs(t,r)}})}function Ra(e={},...t){const{breakpoints:r,mixins:n={},spacing:i,palette:s={},transitions:a={},typography:o={},shape:f,colorSpace:u,...d}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Sn(20));const h=Ao({...s,colorSpace:u}),m=Qu(e);let l=Tr(m,{mixins:gS(m.breakpoints,n),palette:h,shadows:wS.slice(),typography:hf(h,o),transitions:_S(a),zIndex:{...bS}});if(l=Tr(l,d),l=t.reduce((v,g)=>Tr(v,g),l),process.env.NODE_ENV!=="production"){const v=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],g=(x,T)=>{let b;for(b in x){const _=x[b];if(v.includes(b)&&Object.keys(_).length>0){if(process.env.NODE_ENV!=="production"){const k=IT("",b);console.error([`MUI: The \`${T}\` component increases the CSS specificity of the \`${b}\` internal state.`,"You can not override it like this: ",JSON.stringify(x,null,2),"",`Instead, you need to use the '&.${k}' syntax:`,JSON.stringify({root:{[`&.${k}`]:_}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
200
|
-
`))}x[b]={}}}};Object.keys(l.components).forEach(x=>{const T=l.components[x].styleOverrides;T&&x.startsWith("Mui")&&g(T,x)})}return l.unstable_sxConfig={...Us,...d==null?void 0:d.unstable_sxConfig},l.unstable_sx=function(g){return ji({sx:g,theme:this})},l.toRuntimeSource=pf,OS(l),l}function DS(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const kS=[...Array(25)].map((e,t)=>{if(t===0)return"none";const r=DS(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function gf(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function mf(e){return e==="dark"?kS:[]}function IS(e){const{palette:t={mode:"light"},opacity:r,overlays:n,colorSpace:i,...s}=e,a=Ao({...t,colorSpace:i});return{palette:a,opacity:{...gf(a.mode),...r},overlays:n||mf(a.mode),...s}}function FS(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const NS=e=>[...[...Array(25)].map((t,r)=>`--${e?`${e}-`:""}overlays-${r}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],RS=e=>(t,r)=>{const n=e.rootSelector||":root",i=e.colorSchemeSelector;let s=i;if(i==="class"&&(s=".%s"),i==="data"&&(s="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(s=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const a={};return NS(e.cssVarPrefix).forEach(o=>{a[o]=r[o],delete r[o]}),s==="media"?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:a}}:s?{[s.replace("%s",t)]:a,[`${n}, ${s.replace("%s",t)}`]:r}:{[n]:{...r,...a}}}if(s&&s!=="media")return`${n}, ${s.replace("%s",String(t))}`}else if(t){if(s==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[n]:r}};if(s)return s.replace("%s",String(t))}return n};function PS(e,t){t.forEach(r=>{e[r]||(e[r]={})})}function se(e,t,r){!e[t]&&r&&(e[t]=r)}function ci(e){return typeof e!="string"||!e.startsWith("hsl")?e:rf(e)}function zr(e,t){`${t}Channel`in e||(e[`${t}Channel`]=li(ci(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
|
201
|
-
To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function jS(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Br=e=>{try{return e()}catch{}},MS=(e="mui")=>tS(e);function ya(e,t,r,n,i){if(!r)return;r=r===!0?{}:r;const s=i==="dark"?"dark":"light";if(!n){t[i]=IS({...r,palette:{mode:s,...r==null?void 0:r.palette},colorSpace:e});return}const{palette:a,...o}=Ra({...n,palette:{mode:s,...r==null?void 0:r.palette},colorSpace:e});return t[i]={...r,palette:a,opacity:{...gf(s),...r==null?void 0:r.opacity},overlays:(r==null?void 0:r.overlays)||mf(s)},o}function LS(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:n,disableCssColorScheme:i=!1,cssVarPrefix:s="mui",nativeColor:a=!1,shouldSkipGeneratingVar:o=FS,colorSchemeSelector:f=r.light&&r.dark?"media":void 0,rootSelector:u=":root",...d}=e,h=Object.keys(r)[0],m=n||(r.light&&h!=="light"?"light":h),l=MS(s),{[m]:v,light:g,dark:x,...T}=r,b={...T};let _=v;if((m==="dark"&&!("dark"in r)||m==="light"&&!("light"in r))&&(_=!0),!_)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${m}\` option is either missing or invalid.`:Sn(21,m));let k;a&&(k="oklch");const F=ya(k,b,_,d,m);g&&!b.light&&ya(k,b,g,void 0,"light"),x&&!b.dark&&ya(k,b,x,void 0,"dark");let z={defaultColorScheme:m,...F,cssVarPrefix:s,colorSchemeSelector:f,rootSelector:u,getCssVar:l,colorSchemes:b,font:{...pS(F.typography),...F.font},spacing:jS(d.spacing)};Object.keys(z.colorSchemes).forEach(W=>{const y=z.colorSchemes[W].palette,H=J=>{const ee=J.split("-"),_e=ee[1],Ae=ee[2];return l(J,y[_e][Ae])};y.mode==="light"&&(se(y.common,"background","#fff"),se(y.common,"onBackground","#000")),y.mode==="dark"&&(se(y.common,"background","#000"),se(y.common,"onBackground","#fff"));function Q(J,ee,_e){if(k){let Ae;return J===gn&&(Ae=`transparent ${((1-_e)*100).toFixed(0)}%`),J===it&&(Ae=`#000 ${(_e*100).toFixed(0)}%`),J===st&&(Ae=`#fff ${(_e*100).toFixed(0)}%`),`color-mix(in ${k}, ${ee}, ${Ae})`}return J(ee,_e)}if(PS(y,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),y.mode==="light"){se(y.Alert,"errorColor",Q(it,y.error.light,.6)),se(y.Alert,"infoColor",Q(it,y.info.light,.6)),se(y.Alert,"successColor",Q(it,y.success.light,.6)),se(y.Alert,"warningColor",Q(it,y.warning.light,.6)),se(y.Alert,"errorFilledBg",H("palette-error-main")),se(y.Alert,"infoFilledBg",H("palette-info-main")),se(y.Alert,"successFilledBg",H("palette-success-main")),se(y.Alert,"warningFilledBg",H("palette-warning-main")),se(y.Alert,"errorFilledColor",Br(()=>y.getContrastText(y.error.main))),se(y.Alert,"infoFilledColor",Br(()=>y.getContrastText(y.info.main))),se(y.Alert,"successFilledColor",Br(()=>y.getContrastText(y.success.main))),se(y.Alert,"warningFilledColor",Br(()=>y.getContrastText(y.warning.main))),se(y.Alert,"errorStandardBg",Q(st,y.error.light,.9)),se(y.Alert,"infoStandardBg",Q(st,y.info.light,.9)),se(y.Alert,"successStandardBg",Q(st,y.success.light,.9)),se(y.Alert,"warningStandardBg",Q(st,y.warning.light,.9)),se(y.Alert,"errorIconColor",H("palette-error-main")),se(y.Alert,"infoIconColor",H("palette-info-main")),se(y.Alert,"successIconColor",H("palette-success-main")),se(y.Alert,"warningIconColor",H("palette-warning-main")),se(y.AppBar,"defaultBg",H("palette-grey-100")),se(y.Avatar,"defaultBg",H("palette-grey-400")),se(y.Button,"inheritContainedBg",H("palette-grey-300")),se(y.Button,"inheritContainedHoverBg",H("palette-grey-A100")),se(y.Chip,"defaultBorder",H("palette-grey-400")),se(y.Chip,"defaultAvatarColor",H("palette-grey-700")),se(y.Chip,"defaultIconColor",H("palette-grey-700")),se(y.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),se(y.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),se(y.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),se(y.LinearProgress,"primaryBg",Q(st,y.primary.main,.62)),se(y.LinearProgress,"secondaryBg",Q(st,y.secondary.main,.62)),se(y.LinearProgress,"errorBg",Q(st,y.error.main,.62)),se(y.LinearProgress,"infoBg",Q(st,y.info.main,.62)),se(y.LinearProgress,"successBg",Q(st,y.success.main,.62)),se(y.LinearProgress,"warningBg",Q(st,y.warning.main,.62)),se(y.Skeleton,"bg",k?Q(gn,y.text.primary,.11):`rgba(${H("palette-text-primaryChannel")} / 0.11)`),se(y.Slider,"primaryTrack",Q(st,y.primary.main,.62)),se(y.Slider,"secondaryTrack",Q(st,y.secondary.main,.62)),se(y.Slider,"errorTrack",Q(st,y.error.main,.62)),se(y.Slider,"infoTrack",Q(st,y.info.main,.62)),se(y.Slider,"successTrack",Q(st,y.success.main,.62)),se(y.Slider,"warningTrack",Q(st,y.warning.main,.62));const J=k?Q(it,y.background.default,.6825):Qi(y.background.default,.8);se(y.SnackbarContent,"bg",J),se(y.SnackbarContent,"color",Br(()=>k?Na.text.primary:y.getContrastText(J))),se(y.SpeedDialAction,"fabHoverBg",Qi(y.background.paper,.15)),se(y.StepConnector,"border",H("palette-grey-400")),se(y.StepContent,"border",H("palette-grey-400")),se(y.Switch,"defaultColor",H("palette-common-white")),se(y.Switch,"defaultDisabledColor",H("palette-grey-100")),se(y.Switch,"primaryDisabledColor",Q(st,y.primary.main,.62)),se(y.Switch,"secondaryDisabledColor",Q(st,y.secondary.main,.62)),se(y.Switch,"errorDisabledColor",Q(st,y.error.main,.62)),se(y.Switch,"infoDisabledColor",Q(st,y.info.main,.62)),se(y.Switch,"successDisabledColor",Q(st,y.success.main,.62)),se(y.Switch,"warningDisabledColor",Q(st,y.warning.main,.62)),se(y.TableCell,"border",Q(st,Q(gn,y.divider,1),.88)),se(y.Tooltip,"bg",Q(gn,y.grey[700],.92))}if(y.mode==="dark"){se(y.Alert,"errorColor",Q(st,y.error.light,.6)),se(y.Alert,"infoColor",Q(st,y.info.light,.6)),se(y.Alert,"successColor",Q(st,y.success.light,.6)),se(y.Alert,"warningColor",Q(st,y.warning.light,.6)),se(y.Alert,"errorFilledBg",H("palette-error-dark")),se(y.Alert,"infoFilledBg",H("palette-info-dark")),se(y.Alert,"successFilledBg",H("palette-success-dark")),se(y.Alert,"warningFilledBg",H("palette-warning-dark")),se(y.Alert,"errorFilledColor",Br(()=>y.getContrastText(y.error.dark))),se(y.Alert,"infoFilledColor",Br(()=>y.getContrastText(y.info.dark))),se(y.Alert,"successFilledColor",Br(()=>y.getContrastText(y.success.dark))),se(y.Alert,"warningFilledColor",Br(()=>y.getContrastText(y.warning.dark))),se(y.Alert,"errorStandardBg",Q(it,y.error.light,.9)),se(y.Alert,"infoStandardBg",Q(it,y.info.light,.9)),se(y.Alert,"successStandardBg",Q(it,y.success.light,.9)),se(y.Alert,"warningStandardBg",Q(it,y.warning.light,.9)),se(y.Alert,"errorIconColor",H("palette-error-main")),se(y.Alert,"infoIconColor",H("palette-info-main")),se(y.Alert,"successIconColor",H("palette-success-main")),se(y.Alert,"warningIconColor",H("palette-warning-main")),se(y.AppBar,"defaultBg",H("palette-grey-900")),se(y.AppBar,"darkBg",H("palette-background-paper")),se(y.AppBar,"darkColor",H("palette-text-primary")),se(y.Avatar,"defaultBg",H("palette-grey-600")),se(y.Button,"inheritContainedBg",H("palette-grey-800")),se(y.Button,"inheritContainedHoverBg",H("palette-grey-700")),se(y.Chip,"defaultBorder",H("palette-grey-700")),se(y.Chip,"defaultAvatarColor",H("palette-grey-300")),se(y.Chip,"defaultIconColor",H("palette-grey-300")),se(y.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),se(y.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),se(y.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),se(y.LinearProgress,"primaryBg",Q(it,y.primary.main,.5)),se(y.LinearProgress,"secondaryBg",Q(it,y.secondary.main,.5)),se(y.LinearProgress,"errorBg",Q(it,y.error.main,.5)),se(y.LinearProgress,"infoBg",Q(it,y.info.main,.5)),se(y.LinearProgress,"successBg",Q(it,y.success.main,.5)),se(y.LinearProgress,"warningBg",Q(it,y.warning.main,.5)),se(y.Skeleton,"bg",k?Q(gn,y.text.primary,.13):`rgba(${H("palette-text-primaryChannel")} / 0.13)`),se(y.Slider,"primaryTrack",Q(it,y.primary.main,.5)),se(y.Slider,"secondaryTrack",Q(it,y.secondary.main,.5)),se(y.Slider,"errorTrack",Q(it,y.error.main,.5)),se(y.Slider,"infoTrack",Q(it,y.info.main,.5)),se(y.Slider,"successTrack",Q(it,y.success.main,.5)),se(y.Slider,"warningTrack",Q(it,y.warning.main,.5));const J=k?Q(st,y.background.default,.985):Qi(y.background.default,.98);se(y.SnackbarContent,"bg",J),se(y.SnackbarContent,"color",Br(()=>k?ff.text.primary:y.getContrastText(J))),se(y.SpeedDialAction,"fabHoverBg",Qi(y.background.paper,.15)),se(y.StepConnector,"border",H("palette-grey-600")),se(y.StepContent,"border",H("palette-grey-600")),se(y.Switch,"defaultColor",H("palette-grey-300")),se(y.Switch,"defaultDisabledColor",H("palette-grey-600")),se(y.Switch,"primaryDisabledColor",Q(it,y.primary.main,.55)),se(y.Switch,"secondaryDisabledColor",Q(it,y.secondary.main,.55)),se(y.Switch,"errorDisabledColor",Q(it,y.error.main,.55)),se(y.Switch,"infoDisabledColor",Q(it,y.info.main,.55)),se(y.Switch,"successDisabledColor",Q(it,y.success.main,.55)),se(y.Switch,"warningDisabledColor",Q(it,y.warning.main,.55)),se(y.TableCell,"border",Q(it,Q(gn,y.divider,1),.68)),se(y.Tooltip,"bg",Q(gn,y.grey[700],.92))}zr(y.background,"default"),zr(y.background,"paper"),zr(y.common,"background"),zr(y.common,"onBackground"),zr(y,"divider"),Object.keys(y).forEach(J=>{const ee=y[J];J!=="tonalOffset"&&ee&&typeof ee=="object"&&(ee.main&&se(y[J],"mainChannel",li(ci(ee.main))),ee.light&&se(y[J],"lightChannel",li(ci(ee.light))),ee.dark&&se(y[J],"darkChannel",li(ci(ee.dark))),ee.contrastText&&se(y[J],"contrastTextChannel",li(ci(ee.contrastText))),J==="text"&&(zr(y[J],"primary"),zr(y[J],"secondary")),J==="action"&&(ee.active&&zr(y[J],"active"),ee.selected&&zr(y[J],"selected")))})}),z=t.reduce((W,y)=>Tr(W,y),z);const N={prefix:s,disableCssColorScheme:i,shouldSkipGeneratingVar:o,getSelector:RS(z),enableContrastVars:a},{vars:B,generateThemeVars:M,generateStyleSheets:L}=iS(z,N);return z.vars=B,Object.entries(z.colorSchemes[z.defaultColorScheme]).forEach(([W,y])=>{z[W]=y}),z.generateThemeVars=M,z.generateStyleSheets=L,z.generateSpacing=function(){return Zu(d.spacing,vo(this))},z.getColorSchemeSelector=sS(f),z.spacing=z.generateSpacing(),z.shouldSkipGeneratingVar=o,z.unstable_sxConfig={...Us,...d==null?void 0:d.unstable_sxConfig},z.unstable_sx=function(y){return ji({sx:y,theme:this})},z.toRuntimeSource=pf,z}function Dc(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:Ao({...r===!0?{}:r.palette,mode:t})})}function Oo(e={},...t){const{palette:r,cssVariables:n=!1,colorSchemes:i=r?void 0:{light:!0},defaultColorScheme:s=r==null?void 0:r.mode,...a}=e,o=s||"light",f=i==null?void 0:i[o],u={...i,...r?{[o]:{...typeof f!="boolean"&&f,palette:r}}:void 0};if(n===!1){if(!("colorSchemes"in e))return Ra(e,...t);let d=r;"palette"in e||u[o]&&(u[o]!==!0?d=u[o].palette:o==="dark"&&(d={mode:"dark"}));const h=Ra({...e,palette:d},...t);return h.defaultColorScheme=o,h.colorSchemes=u,h.palette.mode==="light"&&(h.colorSchemes.light={...u.light!==!0&&u.light,palette:h.palette},Dc(h,"dark",u.dark)),h.palette.mode==="dark"&&(h.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:h.palette},Dc(h,"light",u.light)),h}return!r&&!("light"in u)&&o==="light"&&(u.light=!0),LS({...a,colorSchemes:u,defaultColorScheme:o,...typeof n!="boolean"&&n},...t)}const BS=Oo();function $S({theme:e,...t}){const r=vn in e?e[vn]:void 0;return c.jsx(bi,{...t,themeId:r?vn:void 0,theme:r||e})}const es={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"};process.env.NODE_ENV!=="production"&&(Ce.string,Ce.string,Ce.string,Ce.string,Ce.string,Ce.oneOf(["dark","light","system"]),Ce.string,Ce.string);const{CssVarsProvider:US}=eS({themeId:vn,theme:()=>Oo({cssVariables:!0}),colorSchemeStorageKey:es.colorSchemeStorageKey,modeStorageKey:es.modeStorageKey,defaultColorScheme:{light:es.defaultLightColorScheme,dark:es.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:hf(e.palette,e.typography)};return t.unstable_sx=function(n){return ji({sx:n,theme:this})},t}}),WS=US;function VS({theme:e,...t}){const r=Be.useMemo(()=>{if(typeof e=="function")return e;const n=vn in e?e[vn]:e;return"colorSchemes"in n?null:"vars"in n?e:{...e,vars:null}},[e]);return r?c.jsx($S,{theme:r,...t}):c.jsx(WS,{theme:e,...t})}function xf(e){return c.jsx(To,{...e,defaultTheme:BS,themeId:vn})}process.env.NODE_ENV!=="production"&&(xf.propTypes={styles:Ce.oneOfType([Ce.array,Ce.func,Ce.number,Ce.object,Ce.string,Ce.bool])});function vf(e){return function(r){return c.jsx(xf,{styles:typeof e=="function"?n=>e({theme:n,...r}):e})}}process.env.NODE_ENV!=="production"&&(Ce.node,Ce.object.isRequired);function zS(e){return WT(e)}const Pa=typeof vf({})=="function",HS=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&!e.vars&&{colorScheme:e.palette.mode}}),GS=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),yf=(e,t=!1)=>{var s,a;const r={};t&&e.colorSchemes&&typeof e.getColorSchemeSelector=="function"&&Object.entries(e.colorSchemes).forEach(([o,f])=>{var d,h;const u=e.getColorSchemeSelector(o);u.startsWith("@")?r[u]={":root":{colorScheme:(d=f.palette)==null?void 0:d.mode}}:r[u.replace(/\s*&/,"")]={colorScheme:(h=f.palette)==null?void 0:h.mode}});let n={html:HS(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...GS(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...r};const i=(a=(s=e.components)==null?void 0:s.MuiCssBaseline)==null?void 0:a.styleOverrides;return i&&(n=[n,i]),n},rs="mui-ecs",YS=e=>{const t=yf(e,!1),r=Array.isArray(t)?t[0]:t;return!e.vars&&r&&(r.html[`:root:has(${rs})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([n,i])=>{var a,o;const s=e.getColorSchemeSelector(n);s.startsWith("@")?r[s]={[`:root:not(:has(.${rs}))`]:{colorScheme:(a=i.palette)==null?void 0:a.mode}}:r[s.replace(/\s*&/,"")]={[`&:not(:has(.${rs}))`]:{colorScheme:(o=i.palette)==null?void 0:o.mode}}}),t},XS=vf(Pa?({theme:e,enableColorScheme:t})=>yf(e,t):({theme:e})=>YS(e));function wf(e){const t=zS({props:e,name:"MuiCssBaseline"}),{children:r,enableColorScheme:n=!1}=t;return c.jsxs(Be.Fragment,{children:[Pa&&c.jsx(XS,{enableColorScheme:n}),!Pa&&!n&&c.jsx("span",{className:rs,style:{display:"none"}}),r]})}process.env.NODE_ENV!=="production"&&(wf.propTypes={children:Ce.node,enableColorScheme:Ce.bool});const Tf=S.createContext(void 0),KS=Oo({palette:{mode:"light",primary:{main:"#1976d2",lighter:"#e3f2fd"},secondary:{main:"#9c27b0",lighter:"#f3e5f5"},success:{main:"#2e7d32",lighter:"#e8f5e9"},warning:{main:"#ed6c02",lighter:"#fff3e0"},error:{main:"#d32f2f",lighter:"#ffebee"},info:{main:"#0288d1",lighter:"#e1f5fe"}}});function Do({children:e,initialData:t,data:r,mode:n="builder",autoLoad:i=!0,config:s}){const o=lw({mode:n,autoLoad:i,initialData:r||t,config:s});return c.jsxs(VS,{theme:KS,children:[c.jsx(wf,{}),c.jsx(Tf.Provider,{value:o,children:e})]})}function Sf(){const e=S.useContext(Tf);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider. Wrap your component tree with <ReportProvider>...</ReportProvider>");return e}/**
|
|
87
|
+
`)};return function(a,c){var u=[xt],f=Bn({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),d=Bn({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});c.bookType=="fods"?(u.push("<office:document"+f+d+`>
|
|
88
|
+
`),u.push(El().replace(/office:document-meta/g,"office:meta"))):u.push("<office:document-content"+f+`>
|
|
89
|
+
`),i(u,a),u.push(` <office:body>
|
|
90
|
+
`),u.push(` <office:spreadsheet>
|
|
91
|
+
`);for(var p=0;p!=a.SheetNames.length;++p)u.push(n(a.Sheets[a.SheetNames[p]],a,p));return u.push(` </office:spreadsheet>
|
|
92
|
+
`),u.push(` </office:body>
|
|
93
|
+
`),c.bookType=="fods"?u.push("</office:document>"):u.push("</office:document-content>"),u.join("")}})();function cc(e,t){if(t.bookType=="fods")return Ga(e,t);var r=_s(),n="",i=[],s=[];return n="mimetype",Pe(r,n,"application/vnd.oasis.opendocument.spreadsheet"),n="content.xml",Pe(r,n,Ga(e,t)),i.push([n,"text/xml"]),s.push([n,"ContentFile"]),n="styles.xml",Pe(r,n,mg(e,t)),i.push([n,"text/xml"]),s.push([n,"StylesFile"]),n="meta.xml",Pe(r,n,xt+El()),i.push([n,"text/xml"]),s.push([n,"MetadataFile"]),n="manifest.rdf",Pe(r,n,Ou(s)),i.push([n,"application/rdf+xml"]),n="META-INF/manifest.xml",Pe(r,n,Du(i)),r}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function Ei(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function vg(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):dr(Ln(e))}function yg(e,t){e:for(var r=0;r<=e.length-t.length;++r){for(var n=0;n<t.length;++n)if(e[r+n]!=t[n])continue e;return!0}return!1}function Br(e){var t=e.reduce(function(i,s){return i+s.length},0),r=new Uint8Array(t),n=0;return e.forEach(function(i){r.set(i,n),n+=i.length}),r}function wg(e,t,r){var n=Math.floor(r==0?0:Math.LOG10E*Math.log(Math.abs(r)))+6176-20,i=r/Math.pow(10,n-6176);e[t+15]|=n>>7,e[t+14]|=(n&127)<<1;for(var s=0;i>=1;++s,i/=256)e[t+s]=i&255;e[t+15]|=r>=0?0:128}function Un(e,t){var r=t?t[0]:0,n=e[r]&127;e:if(e[r++]>=128&&(n|=(e[r]&127)<<7,e[r++]<128||(n|=(e[r]&127)<<14,e[r++]<128)||(n|=(e[r]&127)<<21,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t&&(t[0]=r),n}function qe(e){var t=new Uint8Array(7);t[0]=e&127;var r=1;e:if(e>127){if(t[r-1]|=128,t[r]=e>>7&127,++r,e<=16383||(t[r-1]|=128,t[r]=e>>14&127,++r,e<=2097151)||(t[r-1]|=128,t[r]=e>>21&127,++r,e<=268435455)||(t[r-1]|=128,t[r]=e/256>>>21&127,++r,e<=34359738367)||(t[r-1]|=128,t[r]=e/65536>>>21&127,++r,e<=4398046511103))break e;t[r-1]|=128,t[r]=e/16777216>>>21&127,++r}return t.slice(0,r)}function gn(e){var t=0,r=e[t]&127;e:if(e[t++]>=128){if(r|=(e[t]&127)<<7,e[t++]<128||(r|=(e[t]&127)<<14,e[t++]<128)||(r|=(e[t]&127)<<21,e[t++]<128))break e;r|=(e[t]&127)<<28}return r}function vt(e){for(var t=[],r=[0];r[0]<e.length;){var n=r[0],i=Un(e,r),s=i&7;i=Math.floor(i/8);var a=0,c;if(i==0)break;switch(s){case 0:{for(var u=r[0];e[r[0]++]>=128;);c=e.slice(u,r[0])}break;case 5:a=4,c=e.slice(r[0],r[0]+a),r[0]+=a;break;case 1:a=8,c=e.slice(r[0],r[0]+a),r[0]+=a;break;case 2:a=Un(e,r),c=e.slice(r[0],r[0]+a),r[0]+=a;break;case 3:case 4:default:throw new Error("PB Type ".concat(s," for Field ").concat(i," at offset ").concat(n))}var f={data:c,type:s};t[i]==null?t[i]=[f]:t[i].push(f)}return t}function Dt(e){var t=[];return e.forEach(function(r,n){r.forEach(function(i){i.data&&(t.push(qe(n*8+i.type)),i.type==2&&t.push(qe(i.data.length)),t.push(i.data))})}),Br(t)}function ur(e){for(var t,r=[],n=[0];n[0]<e.length;){var i=Un(e,n),s=vt(e.slice(n[0],n[0]+i));n[0]+=i;var a={id:gn(s[1][0].data),messages:[]};s[2].forEach(function(c){var u=vt(c.data),f=gn(u[3][0].data);a.messages.push({meta:u,data:e.slice(n[0],n[0]+f)}),n[0]+=f}),(t=s[3])!=null&&t[0]&&(a.merge=gn(s[3][0].data)>>>0>0),r.push(a)}return r}function an(e){var t=[];return e.forEach(function(r){var n=[];n[1]=[{data:qe(r.id),type:0}],n[2]=[],r.merge!=null&&(n[3]=[{data:qe(+!!r.merge),type:0}]);var i=[];r.messages.forEach(function(a){i.push(a.data),a.meta[3]=[{type:0,data:qe(a.data.length)}],n[2].push({data:Dt(a.meta),type:2})});var s=Dt(n);t.push(qe(s.length)),t.push(s),i.forEach(function(a){return t.push(a)})}),Br(t)}function Tg(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],n=Un(t,r),i=[];r[0]<t.length;){var s=t[r[0]]&3;if(s==0){var a=t[r[0]++]>>2;if(a<60)++a;else{var c=a-59;a=t[r[0]],c>1&&(a|=t[r[0]+1]<<8),c>2&&(a|=t[r[0]+2]<<16),c>3&&(a|=t[r[0]+3]<<24),a>>>=0,a++,r[0]+=c}i.push(t.slice(r[0],r[0]+a)),r[0]+=a;continue}else{var u=0,f=0;if(s==1?(f=(t[r[0]]>>2&7)+4,u=(t[r[0]++]&224)<<3,u|=t[r[0]++]):(f=(t[r[0]++]>>2)+1,s==2?(u=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(u=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),i=[Br(i)],u==0)throw new Error("Invalid offset 0");if(u>i[0].length)throw new Error("Invalid offset beyond length");if(f>=u)for(i.push(i[0].slice(-u)),f-=u;f>=i[i.length-1].length;)i.push(i[i.length-1]),f-=i[i.length-1].length;i.push(i[0].slice(-u,-u+f))}}var d=Br(i);if(d.length!=n)throw new Error("Unexpected length: ".concat(d.length," != ").concat(n));return d}function hr(e){for(var t=[],r=0;r<e.length;){var n=e[r++],i=e[r]|e[r+1]<<8|e[r+2]<<16;r+=3,t.push(Tg(n,e.slice(r,r+i))),r+=i}if(r!==e.length)throw new Error("data is not a valid framed stream!");return Br(t)}function on(e){for(var t=[],r=0;r<e.length;){var n=Math.min(e.length-r,268435455),i=new Uint8Array(4);t.push(i);var s=qe(n),a=s.length;t.push(s),n<=60?(a++,t.push(new Uint8Array([n-1<<2]))):n<=256?(a+=2,t.push(new Uint8Array([240,n-1&255]))):n<=65536?(a+=3,t.push(new Uint8Array([244,n-1&255,n-1>>8&255]))):n<=16777216?(a+=4,t.push(new Uint8Array([248,n-1&255,n-1>>8&255,n-1>>16&255]))):n<=4294967296&&(a+=5,t.push(new Uint8Array([252,n-1&255,n-1>>8&255,n-1>>16&255,n-1>>>24&255]))),t.push(e.slice(r,r+n)),a+=n,i[0]=0,i[1]=a&255,i[2]=a>>8&255,i[3]=a>>16&255,r+=n}return Br(t)}function qi(e,t){var r=new Uint8Array(32),n=Ei(r),i=12,s=0;switch(r[0]=5,e.t){case"n":r[1]=2,wg(r,i,e.v),s|=1,i+=16;break;case"b":r[1]=6,n.setFloat64(i,e.v?1:0,!0),s|=2,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[1]=3,n.setUint32(i,t.indexOf(e.v),!0),s|=8,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(8,s,!0),r.slice(0,i)}function Ji(e,t){var r=new Uint8Array(32),n=Ei(r),i=12,s=0;switch(r[0]=3,e.t){case"n":r[2]=2,n.setFloat64(i,e.v,!0),s|=32,i+=8;break;case"b":r[2]=6,n.setFloat64(i,e.v?1:0,!0),s|=32,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[2]=3,n.setUint32(i,t.indexOf(e.v),!0),s|=16,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(4,s,!0),r.slice(0,i)}function Nr(e){var t=vt(e);return Un(t[1][0].data)}function _g(e,t,r){var n,i,s,a;if(!((n=e[6])!=null&&n[0])||!((i=e[7])!=null&&i[0]))throw"Mutation only works on post-BNC storages!";var c=((a=(s=e[8])==null?void 0:s[0])==null?void 0:a.data)&&gn(e[8][0].data)>0||!1;if(c)throw"Math only works with normal offsets";for(var u=0,f=Ei(e[7][0].data),d=0,p=[],x=Ei(e[4][0].data),l=0,y=[],g=0;g<t.length;++g){if(t[g]==null){f.setUint16(g*2,65535,!0),x.setUint16(g*2,65535);continue}f.setUint16(g*2,d,!0),x.setUint16(g*2,l,!0);var m,E;switch(typeof t[g]){case"string":m=qi({t:"s",v:t[g]},r),E=Ji({t:"s",v:t[g]},r);break;case"number":m=qi({t:"n",v:t[g]},r),E=Ji({t:"n",v:t[g]},r);break;case"boolean":m=qi({t:"b",v:t[g]},r),E=Ji({t:"b",v:t[g]},r);break;default:throw new Error("Unsupported value "+t[g])}p.push(m),d+=m.length,y.push(E),l+=E.length,++u}for(e[2][0].data=qe(u);g<e[7][0].data.length/2;++g)f.setUint16(g*2,65535,!0),x.setUint16(g*2,65535,!0);return e[6][0].data=Br(p),e[3][0].data=Br(y),u}function Eg(e,t){if(!t||!t.numbers)throw new Error("Must pass a `numbers` option -- check the README");var r=e.Sheets[e.SheetNames[0]];e.SheetNames.length>1&&console.error("The Numbers writer currently writes only the first table");var n=nr(r["!ref"]);n.s.r=n.s.c=0;var i=!1;n.e.c>9&&(i=!0,n.e.c=9),n.e.r>49&&(i=!0,n.e.r=49),i&&console.error("The Numbers writer is currently limited to ".concat(pt(n)));var s=Si(r,{range:n,header:1}),a=["~Sh33tJ5~"];s.forEach(function(P){return P.forEach(function(I){typeof I=="string"&&a.push(I)})});var c={},u=[],f=et.read(t.numbers,{type:"base64"});f.FileIndex.map(function(P,I){return[P,f.FullPaths[I]]}).forEach(function(P){var I=P[0],R=P[1];if(I.type==2&&I.name.match(/\.iwa/)){var Y=I.content,xe=hr(Y),ve=ur(xe);ve.forEach(function(ge){u.push(ge.id),c[ge.id]={deps:[],location:R,type:gn(ge.messages[0].meta[1][0].data)}})}}),u.sort(function(P,I){return P-I});var d=u.filter(function(P){return P>1}).map(function(P){return[P,qe(P)]});f.FileIndex.map(function(P,I){return[P,f.FullPaths[I]]}).forEach(function(P){var I=P[0];if(P[1],!!I.name.match(/\.iwa/)){var R=ur(hr(I.content));R.forEach(function(Y){Y.messages.forEach(function(xe){d.forEach(function(ve){Y.messages.some(function(ge){return gn(ge.meta[1][0].data)!=11006&&yg(ge.data,ve[1])})&&c[ve[0]].deps.push(Y.id)})})})}});for(var p=et.find(f,c[1].location),x=ur(hr(p.content)),l,y=0;y<x.length;++y){var g=x[y];g.id==1&&(l=g)}var m=Nr(vt(l.messages[0].data)[1][0].data);for(p=et.find(f,c[m].location),x=ur(hr(p.content)),y=0;y<x.length;++y)g=x[y],g.id==m&&(l=g);for(m=Nr(vt(l.messages[0].data)[2][0].data),p=et.find(f,c[m].location),x=ur(hr(p.content)),y=0;y<x.length;++y)g=x[y],g.id==m&&(l=g);for(m=Nr(vt(l.messages[0].data)[2][0].data),p=et.find(f,c[m].location),x=ur(hr(p.content)),y=0;y<x.length;++y)g=x[y],g.id==m&&(l=g);var E=vt(l.messages[0].data);{E[6][0].data=qe(n.e.r+1),E[7][0].data=qe(n.e.c+1);var D=Nr(E[46][0].data),C=et.find(f,c[D].location),N=ur(hr(C.content));{for(var L=0;L<N.length&&N[L].id!=D;++L);if(N[L].id!=D)throw"Bad ColumnRowUIDMapArchive";var Q=vt(N[L].messages[0].data);Q[1]=[],Q[2]=[],Q[3]=[];for(var k=0;k<=n.e.c;++k){var V=[];V[1]=V[2]=[{type:0,data:qe(k+420690)}],Q[1].push({type:2,data:Dt(V)}),Q[2].push({type:0,data:qe(k)}),Q[3].push({type:0,data:qe(k)})}Q[4]=[],Q[5]=[],Q[6]=[];for(var j=0;j<=n.e.r;++j)V=[],V[1]=V[2]=[{type:0,data:qe(j+726270)}],Q[4].push({type:2,data:Dt(V)}),Q[5].push({type:0,data:qe(j)}),Q[6].push({type:0,data:qe(j)});N[L].messages[0].data=Dt(Q)}C.content=on(an(N)),C.size=C.content.length,delete E[46];var B=vt(E[4][0].data);{B[7][0].data=qe(n.e.r+1);var X=vt(B[1][0].data),M=Nr(X[2][0].data);C=et.find(f,c[M].location),N=ur(hr(C.content));{if(N[0].id!=M)throw"Bad HeaderStorageBucket";var ee=vt(N[0].messages[0].data);for(j=0;j<s.length;++j){var Te=vt(ee[2][0].data);Te[1][0].data=qe(j),Te[4][0].data=qe(s[j].length),ee[2][j]={type:ee[2][0].type,data:Dt(Te)}}N[0].messages[0].data=Dt(ee)}C.content=on(an(N)),C.size=C.content.length;var ne=Nr(B[2][0].data);C=et.find(f,c[ne].location),N=ur(hr(C.content));{if(N[0].id!=ne)throw"Bad HeaderStorageBucket";for(ee=vt(N[0].messages[0].data),k=0;k<=n.e.c;++k)Te=vt(ee[2][0].data),Te[1][0].data=qe(k),Te[4][0].data=qe(n.e.r+1),ee[2][k]={type:ee[2][0].type,data:Dt(Te)};N[0].messages[0].data=Dt(ee)}C.content=on(an(N)),C.size=C.content.length;var ae=Nr(B[4][0].data);(function(){for(var P=et.find(f,c[ae].location),I=ur(hr(P.content)),R,Y=0;Y<I.length;++Y){var xe=I[Y];xe.id==ae&&(R=xe)}var ve=vt(R.messages[0].data);{ve[3]=[];var ge=[];a.forEach(function(Ce,Xe){ge[1]=[{type:0,data:qe(Xe)}],ge[2]=[{type:0,data:qe(1)}],ge[3]=[{type:2,data:vg(Ce)}],ve[3].push({type:2,data:Dt(ge)})})}R.messages[0].data=Dt(ve);var oe=an(I),Le=on(oe);P.content=Le,P.size=P.content.length})();var Se=vt(B[3][0].data);{var Ne=Se[1][0];delete Se[2];var be=vt(Ne.data);{var ze=Nr(be[2][0].data);(function(){for(var P=et.find(f,c[ze].location),I=ur(hr(P.content)),R,Y=0;Y<I.length;++Y){var xe=I[Y];xe.id==ze&&(R=xe)}var ve=vt(R.messages[0].data);{delete ve[6],delete Se[7];var ge=new Uint8Array(ve[5][0].data);ve[5]=[];for(var oe=0,Le=0;Le<=n.e.r;++Le){var Ce=vt(ge);oe+=_g(Ce,s[Le],a),Ce[1][0].data=qe(Le),ve[5].push({data:Dt(Ce),type:2})}ve[1]=[{type:0,data:qe(n.e.c+1)}],ve[2]=[{type:0,data:qe(n.e.r+1)}],ve[3]=[{type:0,data:qe(oe)}],ve[4]=[{type:0,data:qe(n.e.r+1)}]}R.messages[0].data=Dt(ve);var Xe=an(I),Ae=on(Xe);P.content=Ae,P.size=P.content.length})()}Ne.data=Dt(be)}B[3][0].data=Dt(Se)}E[4][0].data=Dt(B)}l.messages[0].data=Dt(E);var _e=an(x),O=on(_e);return p.content=O,p.size=p.content.length,f}function Sg(e){return function(r){for(var n=0;n!=e.length;++n){var i=e[n];r[i[0]]===void 0&&(r[i[0]]=i[1]),i[2]==="n"&&(r[i[0]]=Number(r[i[0]]))}}}function Ls(e){Sg([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(e)}function Cg(e,t){return t.bookType=="ods"?cc(e,t):t.bookType=="numbers"?Eg(e,t):t.bookType=="xlsb"?bg(e,t):Dg(e,t)}function bg(e,t){hn=1024,e&&!e.SSF&&(e.SSF=qt(ut)),e&&e.SSF&&(Ai(),Di(e.SSF),t.revssf=Oi(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,Nn?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r=t.bookType=="xlsb"?"bin":"xml",n=$l.indexOf(t.bookType)>-1,i=wl();Ls(t=t||{});var s=_s(),a="",c=0;if(t.cellXfs=[],Ur(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",Pe(s,a,Sl(e.Props,t)),i.coreprops.push(a),Je(t.rels,2,a,Ve.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var u=[],f=0;f<e.SheetNames.length;++f)(e.Workbook.Sheets[f]||{}).Hidden!=2&&u.push(e.SheetNames[f]);e.Props.SheetNames=u}for(e.Props.Worksheets=e.Props.SheetNames.length,Pe(s,a,bl(e.Props)),i.extprops.push(a),Je(t.rels,3,a,Ve.EXT_PROPS),e.Custprops!==e.Props&&It(e.Custprops||{}).length>0&&(a="docProps/custom.xml",Pe(s,a,Dl(e.Custprops)),i.custprops.push(a),Je(t.rels,4,a,Ve.CUST_PROPS)),c=1;c<=e.SheetNames.length;++c){var d={"!id":{}},p=e.Sheets[e.SheetNames[c-1]],x=(p||{})["!type"]||"sheet";switch(x){case"chart":default:a="xl/worksheets/sheet"+c+"."+r,Pe(s,a,Ox(c-1,a,t,e,d)),i.sheets.push(a),Je(t.wbrels,-1,"worksheets/sheet"+c+"."+r,Ve.WS[0])}if(p){var l=p["!comments"],y=!1,g="";l&&l.length>0&&(g="xl/comments"+c+"."+r,Pe(s,g,Ix(l,g)),i.comments.push(g),Je(d,-1,"../comments"+c+"."+r,Ve.CMNT),y=!0),p["!legacy"]&&y&&Pe(s,"xl/drawings/vmlDrawing"+c+".vml",zl(c,p["!comments"])),delete p["!comments"],delete p["!legacy"]}d["!id"].rId1&&Pe(s,_l(a),pn(d))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,Pe(s,a,Fx(t.Strings,a,t)),i.strs.push(a),Je(t.wbrels,-1,"sharedStrings."+r,Ve.SST)),a="xl/workbook."+r,Pe(s,a,Ax(e,a)),i.workbooks.push(a),Je(t.rels,1,a,Ve.WB),a="xl/theme/theme1.xml",Pe(s,a,Wl(e.Themes,t)),i.themes.push(a),Je(t.wbrels,-1,"theme/theme1.xml",Ve.THEME),a="xl/styles."+r,Pe(s,a,kx(e,a,t)),i.styles.push(a),Je(t.wbrels,-1,"styles."+r,Ve.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",Pe(s,a,e.vbaraw),i.vba.push(a),Je(t.wbrels,-1,"vbaProject.bin",Ve.VBA)),a="xl/metadata."+r,Pe(s,a,Nx(a)),i.metadata.push(a),Je(t.wbrels,-1,"metadata."+r,Ve.XLMETA),Pe(s,"[Content_Types].xml",Tl(i,t)),Pe(s,"_rels/.rels",pn(t.rels)),Pe(s,"xl/_rels/workbook."+r+".rels",pn(t.wbrels)),delete t.revssf,delete t.ssf,s}function Dg(e,t){hn=1024,e&&!e.SSF&&(e.SSF=qt(ut)),e&&e.SSF&&(Ai(),Di(e.SSF),t.revssf=Oi(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,Nn?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xml",n=$l.indexOf(t.bookType)>-1,i=wl();Ls(t=t||{});var s=_s(),a="",c=0;if(t.cellXfs=[],Ur(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",Pe(s,a,Sl(e.Props,t)),i.coreprops.push(a),Je(t.rels,2,a,Ve.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var u=[],f=0;f<e.SheetNames.length;++f)(e.Workbook.Sheets[f]||{}).Hidden!=2&&u.push(e.SheetNames[f]);e.Props.SheetNames=u}e.Props.Worksheets=e.Props.SheetNames.length,Pe(s,a,bl(e.Props)),i.extprops.push(a),Je(t.rels,3,a,Ve.EXT_PROPS),e.Custprops!==e.Props&&It(e.Custprops||{}).length>0&&(a="docProps/custom.xml",Pe(s,a,Dl(e.Custprops)),i.custprops.push(a),Je(t.rels,4,a,Ve.CUST_PROPS));var d=["SheetJ5"];for(t.tcid=0,c=1;c<=e.SheetNames.length;++c){var p={"!id":{}},x=e.Sheets[e.SheetNames[c-1]],l=(x||{})["!type"]||"sheet";switch(l){case"chart":default:a="xl/worksheets/sheet"+c+"."+r,Pe(s,a,ec(c-1,t,e,p)),i.sheets.push(a),Je(t.wbrels,-1,"worksheets/sheet"+c+"."+r,Ve.WS[0])}if(x){var y=x["!comments"],g=!1,m="";if(y&&y.length>0){var E=!1;y.forEach(function(D){D[1].forEach(function(C){C.T==!0&&(E=!0)})}),E&&(m="xl/threadedComments/threadedComment"+c+"."+r,Pe(s,m,id(y,d,t)),i.threadedcomments.push(m),Je(p,-1,"../threadedComments/threadedComment"+c+"."+r,Ve.TCMNT)),m="xl/comments"+c+"."+r,Pe(s,m,Hl(y)),i.comments.push(m),Je(p,-1,"../comments"+c+"."+r,Ve.CMNT),g=!0}x["!legacy"]&&g&&Pe(s,"xl/drawings/vmlDrawing"+c+".vml",zl(c,x["!comments"])),delete x["!comments"],delete x["!legacy"]}p["!id"].rId1&&Pe(s,_l(a),pn(p))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,Pe(s,a,Pl(t.Strings,t)),i.strs.push(a),Je(t.wbrels,-1,"sharedStrings."+r,Ve.SST)),a="xl/workbook."+r,Pe(s,a,nc(e)),i.workbooks.push(a),Je(t.rels,1,a,Ve.WB),a="xl/theme/theme1.xml",Pe(s,a,Wl(e.Themes,t)),i.themes.push(a),Je(t.wbrels,-1,"theme/theme1.xml",Ve.THEME),a="xl/styles."+r,Pe(s,a,Bl(e,t)),i.styles.push(a),Je(t.wbrels,-1,"styles."+r,Ve.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",Pe(s,a,e.vbaraw),i.vba.push(a),Je(t.wbrels,-1,"vbaProject.bin",Ve.VBA)),a="xl/metadata."+r,Pe(s,a,Vl()),i.metadata.push(a),Je(t.wbrels,-1,"metadata."+r,Ve.XLMETA),d.length>1&&(a="xl/persons/person.xml",Pe(s,a,sd(d)),i.people.push(a),Je(t.wbrels,-1,"persons/person.xml",Ve.PEOPLE)),Pe(s,"[Content_Types].xml",Tl(i,t)),Pe(s,"_rels/.rels",pn(t.rels)),Pe(s,"xl/_rels/workbook."+r+".rels",pn(t.wbrels)),delete t.revssf,delete t.ssf,s}function Ag(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=kr(e.slice(0,12));break;case"binary":r=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function fc(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return Hn(t.file,et.write(e,{type:$e?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type)}return et.write(e,t)}function Og(e,t){var r=qt(t||{}),n=Cg(e,r);return kg(n,r)}function kg(e,t){var r={},n=$e?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(t.compression&&(r.compression="DEFLATE"),t.password)r.type=n;else switch(t.type){case"base64":r.type="base64";break;case"binary":r.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":case"file":r.type=n;break;default:throw new Error("Unrecognized type "+t.type)}var i=e.FullPaths?et.write(e,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[r.type]||r.type,compression:!!t.compression}):e.generate(r);if(typeof Deno<"u"&&typeof i=="string"){if(t.type=="binary"||t.type=="base64")return i;i=new Uint8Array(bi(i))}return t.password&&typeof encrypt_agile<"u"?fc(encrypt_agile(i,t.password),t):t.type==="file"?Hn(t.file,i):t.type=="string"?On(i):i}function Fg(e,t){var r=t||{},n=Xx(e,r);return fc(n,r)}function _r(e,t,r){r||(r="");var n=r+e;switch(t.type){case"base64":return jn(Ln(n));case"binary":return Ln(n);case"string":return e;case"file":return Hn(t.file,n,"utf8");case"buffer":return $e?Ir(n,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(n):_r(n,{type:"binary"}).split("").map(function(i){return i.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function Ig(e,t){switch(t.type){case"base64":return jn(e);case"binary":return e;case"string":return e;case"file":return Hn(t.file,e,"binary");case"buffer":return $e?Ir(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function ii(e,t){switch(t.type){case"string":case"base64":case"binary":for(var r="",n=0;n<e.length;++n)r+=String.fromCharCode(e[n]);return t.type=="base64"?jn(r):t.type=="string"?On(r):r;case"file":return Hn(t.file,e);case"buffer":return e;default:throw new Error("Unrecognized type "+t.type)}}function uc(e,t){af(),mx(e);var r=qt(t||{});if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),r.type=="array"){r.type="binary";var n=uc(e,r);return r.type="array",bi(n)}var i=0;if(r.sheet&&(typeof r.sheet=="number"?i=r.sheet:i=e.SheetNames.indexOf(r.sheet),!e.SheetNames[i]))throw new Error("Sheet not found: "+r.sheet+" : "+typeof r.sheet);switch(r.bookType||"xlsb"){case"xml":case"xlml":return _r($x(e,r),r);case"slk":case"sylk":return _r(ph.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"htm":case"html":return _r(ac(e.Sheets[e.SheetNames[i]],r),r);case"txt":return Ig(hc(e.Sheets[e.SheetNames[i]],r),r);case"csv":return _r(Bs(e.Sheets[e.SheetNames[i]],r),r,"\uFEFF");case"dif":return _r(xh.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"dbf":return ii(dh.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"prn":return _r(gh.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"rtf":return _r(Eh.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"eth":return _r(Rl.from_sheet(e.Sheets[e.SheetNames[i]],r),r);case"fods":return _r(cc(e,r),r);case"wk1":return ii(Ba.sheet_to_wk1(e.Sheets[e.SheetNames[i]],r),r);case"wk3":return ii(Ba.book_to_wk3(e,r),r);case"biff2":r.biff||(r.biff=2);case"biff3":r.biff||(r.biff=3);case"biff4":return r.biff||(r.biff=4),ii(sc(e,r),r);case"biff5":r.biff||(r.biff=5);case"biff8":case"xla":case"xls":return r.biff||(r.biff=8),Fg(e,r);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return Og(e,r);default:throw new Error("Unrecognized bookType |"+r.bookType+"|")}}function Ng(e){if(!e.bookType){var t={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"},r=e.file.slice(e.file.lastIndexOf(".")).toLowerCase();r.match(/^\.[a-z]+$/)&&(e.bookType=r.slice(1)),e.bookType=t[e.bookType]||e.bookType}}function Rg(e,t,r){var n={};return n.type="file",n.file=t,Ng(n),uc(e,n)}function Pg(e,t,r,n,i,s,a,c){var u=Ft(r),f=c.defval,d=c.raw||!Object.prototype.hasOwnProperty.call(c,"raw"),p=!0,x=i===1?[]:{};if(i!==1)if(Object.defineProperty)try{Object.defineProperty(x,"__rowNum__",{value:r,enumerable:!1})}catch{x.__rowNum__=r}else x.__rowNum__=r;if(!a||e[r])for(var l=t.s.c;l<=t.e.c;++l){var y=a?e[r][l]:e[n[l]+u];if(y===void 0||y.t===void 0){if(f===void 0)continue;s[l]!=null&&(x[s[l]]=f);continue}var g=y.v;switch(y.t){case"z":if(g==null)break;continue;case"e":g=g==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+y.t)}if(s[l]!=null){if(g==null)if(y.t=="e"&&g===null)x[s[l]]=null;else if(f!==void 0)x[s[l]]=f;else if(d&&g===null)x[s[l]]=null;else continue;else x[s[l]]=d&&(y.t!=="n"||y.t==="n"&&c.rawNumbers!==!1)?g:Fr(y,g,c);g!=null&&(p=!1)}}return{row:x,isempty:p}}function Si(e,t){if(e==null||e["!ref"]==null)return[];var r={t:"n",v:0},n=0,i=1,s=[],a=0,c="",u={s:{r:0,c:0},e:{r:0,c:0}},f=t||{},d=f.range!=null?f.range:e["!ref"];switch(f.header===1?n=1:f.header==="A"?n=2:Array.isArray(f.header)?n=3:f.header==null&&(n=0),typeof d){case"string":u=it(d);break;case"number":u=it(e["!ref"]),u.s.r=d;break;default:u=d}n>0&&(i=0);var p=Ft(u.s.r),x=[],l=[],y=0,g=0,m=Array.isArray(e),E=u.s.r,D=0,C={};m&&!e[E]&&(e[E]=[]);var N=f.skipHidden&&e["!cols"]||[],L=f.skipHidden&&e["!rows"]||[];for(D=u.s.c;D<=u.e.c;++D)if(!(N[D]||{}).hidden)switch(x[D]=jt(D),r=m?e[E][D]:e[x[D]+p],n){case 1:s[D]=D-u.s.c;break;case 2:s[D]=x[D];break;case 3:s[D]=f.header[D-u.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),c=a=Fr(r,null,f),g=C[a]||0,!g)C[a]=1;else{do c=a+"_"+g++;while(C[c]);C[a]=g,C[c]=1}s[D]=c}for(E=u.s.r+i;E<=u.e.r;++E)if(!(L[E]||{}).hidden){var Q=Pg(e,u,E,x,n,s,m,f);(Q.isempty===!1||(n===1?f.blankrows!==!1:f.blankrows))&&(l[y++]=Q.row)}return l.length=y,l}var Xa=/"/g;function jg(e,t,r,n,i,s,a,c){for(var u=!0,f=[],d="",p=Ft(r),x=t.s.c;x<=t.e.c;++x)if(n[x]){var l=c.dense?(e[r]||[])[x]:e[n[x]+p];if(l==null)d="";else if(l.v!=null){u=!1,d=""+(c.rawNumbers&&l.t=="n"?l.v:Fr(l,null,c));for(var y=0,g=0;y!==d.length;++y)if((g=d.charCodeAt(y))===i||g===s||g===34||c.forceQuotes){d='"'+d.replace(Xa,'""')+'"';break}d=="ID"&&(d='"ID"')}else l.f!=null&&!l.F?(u=!1,d="="+l.f,d.indexOf(",")>=0&&(d='"'+d.replace(Xa,'""')+'"')):d="";f.push(d)}return c.blankrows===!1&&u?null:f.join(a)}function Bs(e,t){var r=[],n=t??{};if(e==null||e["!ref"]==null)return"";var i=it(e["!ref"]),s=n.FS!==void 0?n.FS:",",a=s.charCodeAt(0),c=n.RS!==void 0?n.RS:`
|
|
94
|
+
`,u=c.charCodeAt(0),f=new RegExp((s=="|"?"\\|":s)+"+$"),d="",p=[];n.dense=Array.isArray(e);for(var x=n.skipHidden&&e["!cols"]||[],l=n.skipHidden&&e["!rows"]||[],y=i.s.c;y<=i.e.c;++y)(x[y]||{}).hidden||(p[y]=jt(y));for(var g=0,m=i.s.r;m<=i.e.r;++m)(l[m]||{}).hidden||(d=jg(e,i,m,p,a,u,s,n),d!=null&&(n.strip&&(d=d.replace(f,"")),(d||n.blankrows!==!1)&&r.push((g++?c:"")+d)));return delete n.dense,r.join("")}function hc(e,t){t||(t={}),t.FS=" ",t.RS=`
|
|
95
|
+
`;var r=Bs(e,t);return r}function Mg(e){var t="",r,n="";if(e==null||e["!ref"]==null)return[];var i=it(e["!ref"]),s="",a=[],c,u=[],f=Array.isArray(e);for(c=i.s.c;c<=i.e.c;++c)a[c]=jt(c);for(var d=i.s.r;d<=i.e.r;++d)for(s=Ft(d),c=i.s.c;c<=i.e.c;++c)if(t=a[c]+s,r=f?(e[d]||[])[c]:e[t],n="",r!==void 0){if(r.F!=null){if(t=r.F,!r.f)continue;n=r.f,t.indexOf(":")==-1&&(t=t+":"+t)}if(r.f!=null)n=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)n=""+r.v;else if(r.t=="b")n=r.v?"TRUE":"FALSE";else if(r.w!==void 0)n="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?n="'"+r.v:n=""+r.v}}u[u.length]=t+"="+n}return u}function dc(e,t,r){var n=r||{},i=+!n.skipHeader,s=e||{},a=0,c=0;if(s&&n.origin!=null)if(typeof n.origin=="number")a=n.origin;else{var u=typeof n.origin=="string"?Et(n.origin):n.origin;a=u.r,c=u.c}var f,d={s:{c:0,r:0},e:{c,r:a+t.length-1+i}};if(s["!ref"]){var p=it(s["!ref"]);d.e.c=Math.max(d.e.c,p.e.c),d.e.r=Math.max(d.e.r,p.e.r),a==-1&&(a=p.e.r+1,d.e.r=a+t.length-1+i)}else a==-1&&(a=0,d.e.r=t.length-1+i);var x=n.header||[],l=0;t.forEach(function(g,m){It(g).forEach(function(E){(l=x.indexOf(E))==-1&&(x[l=x.length]=E);var D=g[E],C="z",N="",L=Qe({c:c+l,r:a+m+i});f=Wn(s,L),D&&typeof D=="object"&&!(D instanceof Date)?s[L]=D:(typeof D=="number"?C="n":typeof D=="boolean"?C="b":typeof D=="string"?C="s":D instanceof Date?(C="d",n.cellDates||(C="n",D=Kt(D)),N=n.dateNF||ut[14]):D===null&&n.nullError&&(C="e",D=0),f?(f.t=C,f.v=D,delete f.w,delete f.R,N&&(f.z=N)):s[L]=f={t:C,v:D},N&&(f.z=N))})}),d.e.c=Math.max(d.e.c,c+x.length-1);var y=Ft(a);if(i)for(l=0;l<x.length;++l)s[jt(l+c)+y]={t:"s",v:x[l]};return s["!ref"]=pt(d),s}function Lg(e,t){return dc(null,e,t)}function Wn(e,t,r){if(typeof t=="string"){if(Array.isArray(e)){var n=Et(t);return e[n.r]||(e[n.r]=[]),e[n.r][n.c]||(e[n.r][n.c]={t:"z"})}return e[t]||(e[t]={t:"z"})}return typeof t!="number"?Wn(e,Qe(t)):Wn(e,Qe({r:t,c:r||0}))}function Bg(e,t){if(typeof t=="number"){if(t>=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}else if(typeof t=="string"){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}else throw new Error("Cannot find sheet |"+t+"|")}function Ug(){return{SheetNames:[],Sheets:{}}}function Wg(e,t,r,n){var i=1;if(!r)for(;i<=65535&&e.SheetNames.indexOf(r="Sheet"+i)!=-1;++i,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&e.SheetNames.indexOf(r)>=0){var s=r.match(/(^.*?)(\d+)$/);i=s&&+s[2]||0;var a=s&&s[1]||r;for(++i;i<=65535&&e.SheetNames.indexOf(r=a+i)!=-1;++i);}if(rc(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}function Vg(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var n=Bg(e,t);switch(e.Workbook.Sheets[n]||(e.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[n].Hidden=r}function zg(e,t){return e.z=t,e}function pc(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function Hg(e,t,r){return pc(e,"#"+t,r)}function $g(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})}function Gg(e,t,r,n){for(var i=typeof t!="string"?t:it(t),s=typeof t=="string"?t:pt(t),a=i.s.r;a<=i.e.r;++a)for(var c=i.s.c;c<=i.e.c;++c){var u=Wn(e,a,c);u.t="n",u.F=s,delete u.v,a==i.s.r&&c==i.s.c&&(u.f=r,n&&(u.D=!0))}return e}var Zi={encode_col:jt,encode_row:Ft,encode_cell:Qe,encode_range:pt,decode_col:As,decode_row:Ds,split_cell:au,decode_cell:Et,decode_range:nr,format_cell:Fr,sheet_add_aoa:pl,sheet_add_json:dc,sheet_add_dom:oc,aoa_to_sheet:yn,json_to_sheet:Lg,table_to_sheet:lc,table_to_book:xg,sheet_to_csv:Bs,sheet_to_txt:hc,sheet_to_json:Si,sheet_to_html:ac,sheet_to_formulae:Mg,sheet_to_row_object_array:Si,sheet_get_cell:Wn,book_new:Ug,book_append_sheet:Wg,book_set_sheet_visibility:Vg,cell_set_number_format:zg,cell_set_hyperlink:pc,cell_set_internal_link:Hg,cell_add_comment:$g,sheet_set_array_formula:Gg,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};function Ri(e,t,r=0){const n=[];for(const i of e){const s=t.includes(i.key);if(n.push({type:"group",key:i.key,level:r,column:i.column,value:i.value,rowCount:i.rowCount,aggregates:i.aggregates,collapsed:s}),!s&&i.children&&i.children.length>0){const a=i.children[0];if(Xg(a)){const c=i.children,u=Ri(c,t,r+1);n.push(...u)}else{const c=i.children;for(const u of c)n.push({type:"row",parentGroupKey:i.key,level:r+1,data:u})}}}return n}function Xg(e){return e&&typeof e=="object"&&"key"in e&&"level"in e&&"column"in e&&"value"in e&&"rowCount"in e&&"aggregates"in e&&"children"in e}function Us(e){return e.filter(t=>t.type==="row").map(t=>t.type==="row"?t.data:null).filter(t=>t!==null)}function Ws(e,t){const r=new Date,n=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),s=String(r.getDate()).padStart(2,"0"),a=`${n}-${i}-${s}`;return`${e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}_${a}.${t}`}function Ya(e,t,r,n,i,s,a){let c,u;s?(c={...s},u=a||t.map(d=>d.name)):i?(c={...i.snapshot.columnVisibility},u=a||[...i.snapshot.columnOrder]):(c={},u=[],t.forEach(d=>{c[d.name]=!0,u.push(d.name)}));const f=Object.entries(c).filter(([d,p])=>!p).map(([d,p])=>d);return{data:e,schema:t,appliedFilters:r,appliedSortStack:n,columnVisibility:c,columnOrder:u,grouping:(i==null?void 0:i.snapshot.grouping)??null,hiddenColumns:f,viewMeta:i?{id:i.id,name:i.name,isDefault:i.isDefault}:void 0}}function Ka(e,t="export",r){const{data:n,columnOrder:i,grouping:s}=e,a=i.filter(p=>e.columnVisibility[p]);let c;if(s&&s.enabled){const p=Ri(n);c=Us(p)}else c=n;const u=a.join(","),f=c.map(p=>a.map(x=>{const l=p[x];if(l==null)return"";const y=String(l);return y.includes(",")||y.includes('"')||y.includes(`
|
|
96
|
+
`)?`"${y.replace(/"/g,'""')}"`:y}).join(",")),d=[u,...f].join(`
|
|
97
|
+
`);xc(d,Ws(t,"csv"),"text/csv;charset=utf-8;")}function qa(e,t="export",r){const{data:n,columnOrder:i,grouping:s}=e,a=i.filter(p=>e.columnVisibility[p]);let c;if(s&&s.enabled){const p=Ri(n);c=Us(p)}else c=n;const u=[a,...c.map(p=>a.map(x=>p[x]??""))],f=Zi.aoa_to_sheet(u),d=Zi.book_new();Zi.book_append_sheet(d,f,"Data"),Rg(d,Ws(t,"xlsx"))}function Ja(e,t="export",r){const{data:n,appliedFilters:i,appliedSortStack:s,viewMeta:a,hiddenColumns:c,columnOrder:u,grouping:f}=e;let d;if(f&&f.enabled){const l=Ri(n);d=Us(l)}else d=n;const p={meta:{exportedAt:new Date().toISOString(),reportName:t,view:(a==null?void 0:a.name)||"Default View",filters:i.map(l=>({field:l.column,operator:l.operator,value:l.value})),sortStack:s.map(l=>({field:l.column,direction:l.direction,priority:l.priority})),grouping:f||{},hiddenColumns:c,columnOrder:u,exportConfig:r||{scope:"visible"}},data:d},x=JSON.stringify(p,null,2);xc(x,Ws(t,"json"),"application/json;charset=utf-8;")}function xc(e,t,r){const n=new Blob([e],{type:r}),i=URL.createObjectURL(n),s=document.createElement("a");s.href=i,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}const Za=10;function Yg(e,t){const r=t.trim();if(!r)return e;const n=e.findIndex(s=>s.query.toLowerCase()===r.toLowerCase());let i;return n!==-1?i=[{...e[n],lastUsed:Date.now()},...e.slice(0,n),...e.slice(n+1)]:i=[{query:r,isFavourite:!1,lastUsed:Date.now()},...e],i.length>Za&&(i=[...i].sort((a,c)=>a.isFavourite&&!c.isFavourite?-1:!a.isFavourite&&c.isFavourite?1:c.lastUsed-a.lastUsed).slice(0,Za)),i}function Kg(e,t){return e.map(r=>r.query===t?{...r,isFavourite:!r.isFavourite}:r)}function qg(e,t){return e.filter(r=>r.query!==t)}function Jg(e){const t=e.filter(n=>n.isFavourite).sort((n,i)=>i.lastUsed-n.lastUsed),r=e.filter(n=>!n.isFavourite).sort((n,i)=>i.lastUsed-n.lastUsed);return[...t,...r]}const Zg={owner:["view_report","edit_columns","edit_filters","edit_sorting","edit_views","create_views","delete_views","delete_report","export_data"],editor:["view_report","edit_columns","edit_filters","edit_sorting","edit_views","create_views","delete_views","export_data"],viewer:["view_report","export_data"]};function Qg(e,t){return!e||e.owner===t?"owner":e.editors.includes(t)?"editor":(e.viewers.includes(t),"viewer")}function vr(e,t){return Zg[t].includes(e)}function yr(e){return`You do not have permission to ${{view_report:"view this report",edit_columns:"modify columns",edit_filters:"modify filters",edit_sorting:"modify sorting",edit_views:"edit views",create_views:"create views",delete_views:"delete views",delete_report:"delete this report",export_data:"export data"}[e]||"perform this action"}.`}function em(e){return e==="viewer"}const Qa=1e3;function tm(){return`EVT_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function gc(e,t,r,n,i,s){return{id:tm(),user:t,reportId:e,feature:r,action:n,timestamp:new Date().toISOString(),previousState:i,newState:s}}function mc(e,t){const r=[t,...e];return r.length>Qa?r.slice(0,Qa):r}function rm(e){return{filter_added:"Filter Added",filter_removed:"Filter Removed",filter_updated:"Filter Updated",filter_cleared:"All Filters Cleared",sort_level_added:"Sort Level Added",sort_level_removed:"Sort Level Removed",sort_reordered:"Sort Reordered",sort_cleared:"All Sorting Cleared",group_level_added:"Group Level Added",group_level_removed:"Group Level Removed",group_reordered:"Group Reordered",group_cleared:"All Grouping Cleared",column_hidden:"Column Hidden",column_shown:"Column Shown",column_reordered:"Columns Reordered",column_resized:"Column Resized",view_created:"View Created",view_updated:"View Updated",view_deleted:"View Deleted",view_set_default:"View Set as Default",view_switched:"View Switched",theme_changed:"Theme Changed",export_triggered:"Export Triggered",export_csv:"Exported as CSV",export_excel:"Exported as Excel",export_json:"Exported as JSON",preset_created:"Preset Created",preset_applied:"Preset Applied",preset_deleted:"Preset Deleted",preset_link_copied:"Preset Link Copied",error_occurred:"Error Occurred"}[e]||e}function nm(e){return{filters:"Filters",sorting:"Sorting",grouping:"Grouping",columns:"Columns",views:"Views",theme:"Theme",export:"Export",presets:"Presets",system:"System"}[e]||e}function im(e){return{filters:"bg-blue-100 text-blue-800 border-blue-200",sorting:"bg-purple-100 text-purple-800 border-purple-200",grouping:"bg-green-100 text-green-800 border-green-200",columns:"bg-orange-100 text-orange-800 border-orange-200",views:"bg-pink-100 text-pink-800 border-pink-200",theme:"bg-gray-100 text-gray-800 border-gray-200",export:"bg-cyan-100 text-cyan-800 border-cyan-200",presets:"bg-indigo-100 text-indigo-800 border-indigo-200",system:"bg-red-100 text-red-800 border-red-200"}[e]||"bg-gray-100 text-gray-800 border-gray-200"}function sm(e){const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),s=Math.floor(n/36e5),a=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i} minute${i>1?"s":""} ago`:s<24?`${s} hour${s>1?"s":""} ago`:a<7?`${a} day${a>1?"s":""} ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function eo(e){return e==null?"None":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e,null,2)}const to=100;function am(){return`preset_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function om(e){var s;const t=(s=e.views)==null?void 0:s.find(a=>a.id===e.activeViewId),r=t==null?void 0:t.snapshot.columnOrder,n=e.columnOrder||[],i=No(n,e.grouping||null,r);return{filters:e.filters?[...e.filters]:[],sortStack:e.sortStack?[...e.sortStack]:[],columnVisibility:e.columnVisibility?{...e.columnVisibility}:{},columnOrder:i,columnWidths:e.columnWidths?{...e.columnWidths}:{},grouping:e.grouping?{...e.grouping}:null,activeViewId:e.activeViewId}}function lm(e,t,r,n){return{id:am(),name:e,description:t,createdBy:r,createdAt:Date.now(),config:n}}function cm(e,t){const r=e||[];if(r.length>=to)throw new Error(`Maximum of ${to} presets reached. Please delete old presets first.`);return[...r,t]}function fm(e,t){return(e||[]).filter(n=>n.id!==t)}function ro(e,t){if(e)return e.find(r=>r.id===t)}function um(e,t){return`${window.location.origin}/reports/${e}?preset=${t}`}function hm(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get("preset")}function dm(e){const t=e.columnOrder,r=fn(t,e.grouping);return{filters:e.filters.length>0?[...e.filters]:void 0,sortStack:e.sortStack.length>0?[...e.sortStack]:void 0,columnVisibility:{...e.columnVisibility},columnOrder:r,columnWidths:{...e.columnWidths},grouping:e.grouping?{...e.grouping}:null,activeViewId:e.activeViewId}}async function pm(e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();const r=document.execCommand("copy");return t.remove(),r}}catch(t){return console.error("Failed to copy to clipboard:",t),!1}}function xm(e,t){return{totalRows:e.length,totalColumns:t.length}}const gm={MAX_CACHE_ENTRIES:3};function mm(e,t){let r=null;return function(...i){const s=()=>{r=null,e(...i)};r&&clearTimeout(r),r=setTimeout(s,t)}}class si{constructor(t=gm.MAX_CACHE_ENTRIES){this.cache=new Map,this.maxEntries=t}get(t){const r=this.cache.get(t);return r?r.value:null}set(t,r){var n;if(this.cache.size>=this.maxEntries&&!this.cache.has(t)){const i=(n=Array.from(this.cache.entries()).sort((s,a)=>s[1].timestamp-a[1].timestamp)[0])==null?void 0:n[0];i&&this.cache.delete(i)}this.cache.set(t,{key:t,value:r,timestamp:Date.now()})}has(t){return this.cache.has(t)}clear(){this.cache.clear()}size(){return this.cache.size}}class vm{constructor(){this.metrics=new Map}start(t){this.metrics.set(t,performance.now())}end(t){const r=this.metrics.get(t);if(!r)return 0;const n=performance.now()-r;return this.metrics.delete(t),n}measure(t,r){this.start(t);const n=r(),i=this.end(t);return{result:n,duration:i}}async measureAsync(t,r){this.start(t);const n=await r(),i=this.end(t);return{result:n,duration:i}}}function br(e,t,r,n){const i=r instanceof Error?r.message:r,s={type:e,context:t,message:i,details:n,timestamp:Date.now(),recoverable:ym(e,t)};return process.env.NODE_ENV==="development"&&console.error("[Report Error]",{type:e,context:t,message:i,details:n}),s}function ym(e,t){return e==="ui"||e==="processing"&&["filters","sorting","grouping","columns"].includes(t)?!0:e!=="system"}function wm(e){const r={filters:"There was an issue applying filters",sorting:"Sorting could not be applied",grouping:"Grouping configuration failed",columns:"Column configuration could not be updated",views:"View operation failed",presets:"Preset could not be applied",export:"Export failed",upload:"File upload failed",search:"Search operation failed"}[e.context]||"An error occurred";return e.recoverable?`${r}. Your previous state has been restored.`:`${r}. Please refresh the page.`}function Tm(e){return{filters:e.filters?[...e.filters]:void 0,sortStack:e.sortStack?[...e.sortStack]:void 0,grouping:e.grouping?{...e.grouping}:void 0,columnVisibility:e.columnVisibility?{...e.columnVisibility}:void 0,columnOrder:e.columnOrder?[...e.columnOrder]:void 0,columnWidths:e.columnWidths?{...e.columnWidths}:void 0,activeViewId:e.activeViewId}}function _m(e,t,r){r(e.id,{filters:t.filters,sortStack:t.sortStack,grouping:t.grouping,columnVisibility:t.columnVisibility,columnOrder:t.columnOrder,columnWidths:t.columnWidths,activeViewId:t.activeViewId})}function Em(e,t,r){return["equals","contains","starts_with","ends_with","gt","gte","lt","lte"].includes(t)&&(r==null||r==="")?{isValid:!1,errorMessage:"Value is required for this operator"}:e==="number"&&["gt","gte","lt","lte","equals"].includes(t)&&isNaN(Number(r))?{isValid:!1,errorMessage:"Value must be a valid number"}:e==="date"&&r&&isNaN(Date.parse(r))?{isValid:!1,errorMessage:"Value must be a valid date"}:{isValid:!0}}function vc(e,t){const r=[],n=[],i=new Set(t.map(s=>s.name));return e.forEach(s=>{i.has(s.column)?r.push(s):n.push(s.column)}),{validRules:r,invalidColumns:n}}function yc(e,t){if(!e||!e.levels||e.levels.length===0)return{validGrouping:null,invalidColumns:[]};const r=new Set(t.map(s=>s.name)),n=[],i=[];return e.levels.forEach(s=>{r.has(s.column)?n.push(s):i.push(s.column)}),n.length===0?{validGrouping:null,invalidColumns:i}:{validGrouping:{...e,levels:n},invalidColumns:i}}function Sm(e,t){const r=[],n=new Set(t.map(s=>s.name)),i={...e};if(i.filters&&Array.isArray(i.filters)){const s=i.filters.filter(a=>{const c=n.has(a.column);return c||r.push(`Filter for column "${a.column}" ignored (column not found)`),c});i.filters=s.length>0?s:void 0}if(i.sortStack&&Array.isArray(i.sortStack)){const{validRules:s,invalidColumns:a}=vc(i.sortStack,t);a.length>0&&r.push(`Sort rules for columns ignored: ${a.join(", ")}`),i.sortStack=s.length>0?s:void 0}if(i.grouping){const{validGrouping:s,invalidColumns:a}=yc(i.grouping,t);a.length>0&&r.push(`Grouping for columns ignored: ${a.join(", ")}`),i.grouping=s}if(i.columnVisibility){const s={};Object.entries(i.columnVisibility).forEach(([a,c])=>{n.has(a)?s[a]=c:r.push(`Column visibility for "${a}" ignored (column not found)`)}),i.columnVisibility=Object.keys(s).length>0?s:void 0}if(i.columnOrder&&Array.isArray(i.columnOrder)){const s=i.columnOrder.filter(a=>{const c=n.has(a);return c||r.push(`Column "${a}" in order ignored (column not found)`),c});i.columnOrder=s.length>0?s:void 0}if(i.columnWidths){const s={};Object.entries(i.columnWidths).forEach(([a,c])=>{n.has(a)?s[a]=c:r.push(`Column width for "${a}" ignored (column not found)`)}),i.columnWidths=Object.keys(s).length>0?s:void 0}return{sanitizedConfig:i,warnings:r}}function Cm(e,t){return br("processing","export",e,{retryAvailable:!!(t!=null&&t.onRetry)})}function no(e,t,r,n){const i=gc(e,t,"system","error_occurred",null,{errorType:r.type,errorContext:r.context,errorMessage:r.message,recoverable:r.recoverable,timestamp:r.timestamp});return mc(n||[],i)}function bm(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const Dm=e=>{switch(e){case"success":return km;case"info":return Im;case"warning":return Fm;case"error":return Nm;default:return null}},Am=Array(12).fill(0),Om=({visible:e,className:t})=>w.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},w.createElement("div",{className:"sonner-spinner"},Am.map((r,n)=>w.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),km=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Fm=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Im=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Nm=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Rm=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},w.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),w.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Pm=()=>{const[e,t]=w.useState(document.hidden);return w.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let cs=1;class jm{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:cs++,a=this.toasts.find(u=>u.id===s),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...t,id:s,title:n}),{...u,...t,id:s,dismissible:c,title:n}):u):this.addToast({title:n,...i,dismissible:c,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let s=n!==void 0,a;const c=i.then(async f=>{if(a=["resolve",f],w.isValidElement(f))s=!1,this.create({id:n,type:"default",message:f});else if(Lm(f)&&!f.ok){s=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${f.status}`):r.error,x=typeof r.description=="function"?await r.description(`HTTP error! status: ${f.status}`):r.description,y=typeof p=="object"&&!w.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:x,...y})}else if(f instanceof Error){s=!1;const p=typeof r.error=="function"?await r.error(f):r.error,x=typeof r.description=="function"?await r.description(f):r.description,y=typeof p=="object"&&!w.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:x,...y})}else if(r.success!==void 0){s=!1;const p=typeof r.success=="function"?await r.success(f):r.success,x=typeof r.description=="function"?await r.description(f):r.description,y=typeof p=="object"&&!w.isValidElement(p)?p:{message:p};this.create({id:n,type:"success",description:x,...y})}}).catch(async f=>{if(a=["reject",f],r.error!==void 0){s=!1;const d=typeof r.error=="function"?await r.error(f):r.error,p=typeof r.description=="function"?await r.description(f):r.description,l=typeof d=="object"&&!w.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:p,...l})}}).finally(()=>{s&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),u=()=>new Promise((f,d)=>c.then(()=>a[0]==="reject"?d(a[1]):f(a[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(t,r)=>{const n=(r==null?void 0:r.id)||cs++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Xt=new jm,Mm=(e,t)=>{const r=(t==null?void 0:t.id)||cs++;return Xt.addToast({title:e,...t,id:r}),r},Lm=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Bm=Mm,Um=()=>Xt.toasts,Wm=()=>Xt.getActiveToasts(),Re=Object.assign(Bm,{success:Xt.success,info:Xt.info,warning:Xt.warning,error:Xt.error,custom:Xt.custom,message:Xt.message,promise:Xt.promise,dismiss:Xt.dismiss,loading:Xt.loading},{getHistory:Um,getToasts:Wm});bm("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ai(e){return e.label!==void 0}const Vm=3,zm="24px",Hm="16px",io=4e3,$m=356,Gm=14,Xm=45,Ym=200;function wr(...e){return e.filter(Boolean).join(" ")}function Km(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const qm=e=>{var t,r,n,i,s,a,c,u,f;const{invert:d,toast:p,unstyled:x,interacting:l,setHeights:y,visibleToasts:g,heights:m,index:E,toasts:D,expanded:C,removeToast:N,defaultRichColors:L,closeButton:Q,style:k,cancelButtonStyle:V,actionButtonStyle:j,className:B="",descriptionClassName:X="",duration:M,position:ee,gap:Te,expandByDefault:ne,classNames:ae,icons:Se,closeButtonAriaLabel:Ne="Close toast"}=e,[be,ze]=w.useState(null),[_e,O]=w.useState(null),[P,I]=w.useState(!1),[R,Y]=w.useState(!1),[xe,ve]=w.useState(!1),[ge,oe]=w.useState(!1),[Le,Ce]=w.useState(!1),[Xe,Ae]=w.useState(0),[ht,Ue]=w.useState(0),de=w.useRef(p.duration||M||io),st=w.useRef(null),He=w.useRef(null),Lt=E===0,yt=E+1<=g,lt=p.type,gt=p.dismissible!==!1,Ye=p.className||"",Ht=p.descriptionClassName||"",wt=w.useMemo(()=>m.findIndex(we=>we.toastId===p.id)||0,[m,p.id]),$t=w.useMemo(()=>{var we;return(we=p.closeButton)!=null?we:Q},[p.closeButton,Q]),Nt=w.useMemo(()=>p.duration||M||io,[p.duration,M]),Rt=w.useRef(0),Gt=w.useRef(0),Sr=w.useRef(0),mt=w.useRef(null),[gr,mr]=ee.split("-"),ir=w.useMemo(()=>m.reduce((we,Ke,We)=>We>=wt?we:we+Ke.height,0),[m,wt]),Ct=Pm(),Ge=p.invert||d,Jt=lt==="loading";Gt.current=w.useMemo(()=>wt*Te+ir,[wt,ir]),w.useEffect(()=>{de.current=Nt},[Nt]),w.useEffect(()=>{I(!0)},[]),w.useEffect(()=>{const we=He.current;if(we){const Ke=we.getBoundingClientRect().height;return Ue(Ke),y(We=>[{toastId:p.id,height:Ke,position:p.position},...We]),()=>y(We=>We.filter(at=>at.toastId!==p.id))}},[y,p.id]),w.useLayoutEffect(()=>{if(!P)return;const we=He.current,Ke=we.style.height;we.style.height="auto";const We=we.getBoundingClientRect().height;we.style.height=Ke,Ue(We),y(at=>at.find(nt=>nt.toastId===p.id)?at.map(nt=>nt.toastId===p.id?{...nt,height:We}:nt):[{toastId:p.id,height:We,position:p.position},...at])},[P,p.title,p.description,y,p.id]);const bt=w.useCallback(()=>{Y(!0),Ae(Gt.current),y(we=>we.filter(Ke=>Ke.toastId!==p.id)),setTimeout(()=>{N(p)},Ym)},[p,N,y,Gt]);w.useEffect(()=>{if(p.promise&<==="loading"||p.duration===1/0||p.type==="loading")return;let we;return C||l||Ct?(()=>{if(Sr.current<Rt.current){const at=new Date().getTime()-Rt.current;de.current=de.current-at}Sr.current=new Date().getTime()})():(()=>{de.current!==1/0&&(Rt.current=new Date().getTime(),we=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),bt()},de.current))})(),()=>clearTimeout(we)},[C,l,p,lt,Ct,bt]),w.useEffect(()=>{p.delete&&bt()},[bt,p.delete]);function Bt(){var we;if(Se!=null&&Se.loading){var Ke;return w.createElement("div",{className:wr(ae==null?void 0:ae.loader,p==null||(Ke=p.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":lt==="loading"},Se.loading)}return w.createElement(Om,{className:wr(ae==null?void 0:ae.loader,p==null||(we=p.classNames)==null?void 0:we.loader),visible:lt==="loading"})}const ie=p.icon||(Se==null?void 0:Se[lt])||Dm(lt);var Pt,Be;return w.createElement("li",{tabIndex:0,ref:He,className:wr(B,Ye,ae==null?void 0:ae.toast,p==null||(t=p.classNames)==null?void 0:t.toast,ae==null?void 0:ae.default,ae==null?void 0:ae[lt],p==null||(r=p.classNames)==null?void 0:r[lt]),"data-sonner-toast":"","data-rich-colors":(Pt=p.richColors)!=null?Pt:L,"data-styled":!(p.jsx||p.unstyled||x),"data-mounted":P,"data-promise":!!p.promise,"data-swiped":Le,"data-removed":R,"data-visible":yt,"data-y-position":gr,"data-x-position":mr,"data-index":E,"data-front":Lt,"data-swiping":xe,"data-dismissible":gt,"data-type":lt,"data-invert":Ge,"data-swipe-out":ge,"data-swipe-direction":_e,"data-expanded":!!(C||ne&&P),style:{"--index":E,"--toasts-before":E,"--z-index":D.length-E,"--offset":`${R?Xe:Gt.current}px`,"--initial-height":ne?"auto":`${ht}px`,...k,...p.style},onDragEnd:()=>{ve(!1),ze(null),mt.current=null},onPointerDown:we=>{Jt||!gt||(st.current=new Date,Ae(Gt.current),we.target.setPointerCapture(we.pointerId),we.target.tagName!=="BUTTON"&&(ve(!0),mt.current={x:we.clientX,y:we.clientY}))},onPointerUp:()=>{var we,Ke,We;if(ge||!gt)return;mt.current=null;const at=Number(((we=He.current)==null?void 0:we.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ut=Number(((Ke=He.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nt=new Date().getTime()-((We=st.current)==null?void 0:We.getTime()),rt=be==="x"?at:Ut,tt=Math.abs(rt)/nt;if(Math.abs(rt)>=Xm||tt>.11){Ae(Gt.current),p.onDismiss==null||p.onDismiss.call(p,p),O(be==="x"?at>0?"right":"left":Ut>0?"down":"up"),bt(),oe(!0);return}else{var he,re;(he=He.current)==null||he.style.setProperty("--swipe-amount-x","0px"),(re=He.current)==null||re.style.setProperty("--swipe-amount-y","0px")}Ce(!1),ve(!1),ze(null)},onPointerMove:we=>{var Ke,We,at;if(!mt.current||!gt||((Ke=window.getSelection())==null?void 0:Ke.toString().length)>0)return;const nt=we.clientY-mt.current.y,rt=we.clientX-mt.current.x;var tt;const he=(tt=e.swipeDirections)!=null?tt:Km(ee);!be&&(Math.abs(rt)>1||Math.abs(nt)>1)&&ze(Math.abs(rt)>Math.abs(nt)?"x":"y");let re={x:0,y:0};const ye=je=>1/(1.5+Math.abs(je)/20);if(be==="y"){if(he.includes("top")||he.includes("bottom"))if(he.includes("top")&&nt<0||he.includes("bottom")&&nt>0)re.y=nt;else{const je=nt*ye(nt);re.y=Math.abs(je)<Math.abs(nt)?je:nt}}else if(be==="x"&&(he.includes("left")||he.includes("right")))if(he.includes("left")&&rt<0||he.includes("right")&&rt>0)re.x=rt;else{const je=rt*ye(rt);re.x=Math.abs(je)<Math.abs(rt)?je:rt}(Math.abs(re.x)>0||Math.abs(re.y)>0)&&Ce(!0),(We=He.current)==null||We.style.setProperty("--swipe-amount-x",`${re.x}px`),(at=He.current)==null||at.style.setProperty("--swipe-amount-y",`${re.y}px`)}},$t&&!p.jsx&<!=="loading"?w.createElement("button",{"aria-label":Ne,"data-disabled":Jt,"data-close-button":!0,onClick:Jt||!gt?()=>{}:()=>{bt(),p.onDismiss==null||p.onDismiss.call(p,p)},className:wr(ae==null?void 0:ae.closeButton,p==null||(n=p.classNames)==null?void 0:n.closeButton)},(Be=Se==null?void 0:Se.close)!=null?Be:Rm):null,(lt||p.icon||p.promise)&&p.icon!==null&&((Se==null?void 0:Se[lt])!==null||p.icon)?w.createElement("div",{"data-icon":"",className:wr(ae==null?void 0:ae.icon,p==null||(i=p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Bt():null,p.type!=="loading"?ie:null):null,w.createElement("div",{"data-content":"",className:wr(ae==null?void 0:ae.content,p==null||(s=p.classNames)==null?void 0:s.content)},w.createElement("div",{"data-title":"",className:wr(ae==null?void 0:ae.title,p==null||(a=p.classNames)==null?void 0:a.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?w.createElement("div",{"data-description":"",className:wr(X,Ht,ae==null?void 0:ae.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),w.isValidElement(p.cancel)?p.cancel:p.cancel&&ai(p.cancel)?w.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||V,onClick:we=>{ai(p.cancel)&>&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,we),bt())},className:wr(ae==null?void 0:ae.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,w.isValidElement(p.action)?p.action:p.action&&ai(p.action)?w.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||j,onClick:we=>{ai(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,we),!we.defaultPrevented&&bt())},className:wr(ae==null?void 0:ae.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function so(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Jm(e,t){const r={};return[e,t].forEach((n,i)=>{const s=i===1,a=s?"--mobile-offset":"--offset",c=s?Hm:zm;function u(f){["top","right","bottom","left"].forEach(d=>{r[`${a}-${d}`]=typeof f=="number"?`${f}px`:f})}typeof n=="number"||typeof n=="string"?u(n):typeof n=="object"?["top","right","bottom","left"].forEach(f=>{n[f]===void 0?r[`${a}-${f}`]=c:r[`${a}-${f}`]=typeof n[f]=="number"?`${n[f]}px`:n[f]}):u(c)}),r}const wc=w.forwardRef(function(t,r){const{invert:n,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:a,closeButton:c,className:u,offset:f,mobileOffset:d,theme:p="light",richColors:x,duration:l,style:y,visibleToasts:g=Vm,toastOptions:m,dir:E=so(),gap:D=Gm,icons:C,containerAriaLabel:N="Notifications"}=t,[L,Q]=w.useState([]),k=w.useMemo(()=>Array.from(new Set([i].concat(L.filter(_e=>_e.position).map(_e=>_e.position)))),[L,i]),[V,j]=w.useState([]),[B,X]=w.useState(!1),[M,ee]=w.useState(!1),[Te,ne]=w.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ae=w.useRef(null),Se=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),Ne=w.useRef(null),be=w.useRef(!1),ze=w.useCallback(_e=>{Q(O=>{var P;return(P=O.find(I=>I.id===_e.id))!=null&&P.delete||Xt.dismiss(_e.id),O.filter(({id:I})=>I!==_e.id)})},[]);return w.useEffect(()=>Xt.subscribe(_e=>{if(_e.dismiss){requestAnimationFrame(()=>{Q(O=>O.map(P=>P.id===_e.id?{...P,delete:!0}:P))});return}setTimeout(()=>{vs.flushSync(()=>{Q(O=>{const P=O.findIndex(I=>I.id===_e.id);return P!==-1?[...O.slice(0,P),{...O[P],..._e},...O.slice(P+1)]:[_e,...O]})})})}),[L]),w.useEffect(()=>{if(p!=="system"){ne(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ne("dark"):ne("light")),typeof window>"u")return;const _e=window.matchMedia("(prefers-color-scheme: dark)");try{_e.addEventListener("change",({matches:O})=>{ne(O?"dark":"light")})}catch{_e.addListener(({matches:P})=>{try{ne(P?"dark":"light")}catch(I){console.error(I)}})}},[p]),w.useEffect(()=>{L.length<=1&&X(!1)},[L]),w.useEffect(()=>{const _e=O=>{var P;if(s.every(Y=>O[Y]||O.code===Y)){var R;X(!0),(R=ae.current)==null||R.focus()}O.code==="Escape"&&(document.activeElement===ae.current||(P=ae.current)!=null&&P.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",_e),()=>document.removeEventListener("keydown",_e)},[s]),w.useEffect(()=>{if(ae.current)return()=>{Ne.current&&(Ne.current.focus({preventScroll:!0}),Ne.current=null,be.current=!1)}},[ae.current]),w.createElement("section",{ref:r,"aria-label":`${N} ${Se}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((_e,O)=>{var P;const[I,R]=_e.split("-");return L.length?w.createElement("ol",{key:_e,dir:E==="auto"?so():E,tabIndex:-1,ref:ae,className:u,"data-sonner-toaster":!0,"data-sonner-theme":Te,"data-y-position":I,"data-lifted":B&&L.length>1&&!a,"data-x-position":R,style:{"--front-toast-height":`${((P=V[0])==null?void 0:P.height)||0}px`,"--width":`${$m}px`,"--gap":`${D}px`,...y,...Jm(f,d)},onBlur:Y=>{be.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(be.current=!1,Ne.current&&(Ne.current.focus({preventScroll:!0}),Ne.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||be.current||(be.current=!0,Ne.current=Y.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{M||X(!1)},onDragEnd:()=>X(!1),onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||ee(!0)},onPointerUp:()=>ee(!1)},L.filter(Y=>!Y.position&&O===0||Y.position===_e).map((Y,xe)=>{var ve,ge;return w.createElement(qm,{key:Y.id,icons:C,index:xe,toast:Y,defaultRichColors:x,duration:(ve=m==null?void 0:m.duration)!=null?ve:l,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:n,visibleToasts:g,closeButton:(ge=m==null?void 0:m.closeButton)!=null?ge:c,interacting:M,position:_e,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,closeButtonAriaLabel:m==null?void 0:m.closeButtonAriaLabel,removeToast:ze,toasts:L.filter(oe=>oe.position==Y.position),heights:V.filter(oe=>oe.position==Y.position),setHeights:j,expandByDefault:a,gap:D,expanded:B,swipeDirections:t.swipeDirections})})):null}))});function Zm(e){return e==null}function Qm(e,t){const{operator:r,value:n}=t;if(r==="NULL")return e==null;if(r==="NOT_NULL")return e!=null;if(Zm(e))return!1;switch(r){case"equals":return String(e)===String(n);case"contains":return String(e).toLowerCase().includes(String(n).toLowerCase());case"startsWith":return String(e).toLowerCase().startsWith(String(n).toLowerCase());case"endsWith":return String(e).toLowerCase().endsWith(String(n).toLowerCase());case"gt":return Number(e)>Number(n);case"lt":return Number(e)<Number(n);case"gte":return Number(e)>=Number(n);case"lte":return Number(e)<=Number(n);case"isTrue":return e===!0;case"isFalse":return e===!1;default:return!0}}function ev(e,t){return!t||t.length===0?e:e.filter(r=>t.every(n=>Qm(r[n.column],n)))}function ao(e){switch(e){case"string":return[{value:"equals",label:"Equals"},{value:"contains",label:"Contains"},{value:"startsWith",label:"Starts with"},{value:"endsWith",label:"Ends with"},{value:"NULL",label:"Is NULL"},{value:"NOT_NULL",label:"Is NOT NULL"}];case"number":return[{value:"equals",label:"="},{value:"gt",label:">"},{value:"lt",label:"<"},{value:"gte",label:"≥"},{value:"lte",label:"≤"}];case"boolean":return[{value:"isTrue",label:"Is true"},{value:"isFalse",label:"Is false"},{value:"NULL",label:"Is NULL"},{value:"NOT_NULL",label:"Is NOT NULL"}];case"mixed":case"null":case"array":case"object":default:return[]}}function oi(e){return e!=="isTrue"&&e!=="isFalse"&&e!=="NULL"&&e!=="NOT_NULL"}function tv({data:e,filters:t}){return{filteredData:w.useMemo(()=>!t||t.length===0?e:ev(e,t),[e,t])}}function Tc(e,t,r,n){if(!r||r.trim()==="")return e;const i=r.toLowerCase().trim(),s=t.filter(a=>n.includes(a.name));return e.filter(a=>s.some(c=>{const u=a[c.name];return u==null?!1:String(u).toLowerCase().includes(i)}))}function rv({data:e,searchQuery:t,schema:r,visibleColumns:n}){return{searchedData:w.useMemo(()=>!t||t.trim()===""?e:Tc(e,r,t,n),[e,t,r,n])}}function nv({data:e,sortStack:t,schema:r}){return{sortedData:w.useMemo(()=>!t||t.length===0?e:V0(e,r,t),[e,t,r])}}function iv({data:e,grouping:t,schema:r}){const n=w.useMemo(()=>!t||!t.enabled||t.levels.length===0?e:X0(e,r,t),[e,t,r]),i=(t==null?void 0:t.enabled)&&((t==null?void 0:t.levels.length)||0)>0;return{groupedData:n,isGrouped:i}}function sv({schema:e,columnVisibility:t,columnOrder:r}){const n=w.useMemo(()=>r.filter(c=>t[c]!==!1),[r,t]),i=w.useMemo(()=>Object.entries(t).filter(([c,u])=>!u).map(([c,u])=>c),[t]),s=w.useMemo(()=>r.map(c=>e.find(f=>f.name===c)||{name:c,type:"string"}),[r,e]),a=w.useMemo(()=>n.map(c=>e.find(f=>f.name===c)||{name:c,type:"string"}),[n,e]);return{visibleColumns:n,hiddenColumns:i,allColumns:s,visibleColumnSchemas:a,hiddenCount:i.length}}function av({views:e,activeViewId:t,currentState:r}){const n=w.useMemo(()=>e.find(f=>f.id===t),[e,t]),i=w.useMemo(()=>n?Z0(r,n.snapshot):!1,[n,r]),s=w.useMemo(()=>e.find(f=>f.isDefault),[e]),a=w.useMemo(()=>e.filter(f=>!f.isDefault&&!f.isDeleted),[e]),c=w.useMemo(()=>e.filter(f=>f.isFavorite&&!f.isDeleted),[e]),u=w.useMemo(()=>e.filter(f=>f.isDeleted),[e]);return{activeView:n,isDirty:i,defaultView:s,customViews:a,favoriteViews:c,deletedViews:u,isDefaultView:(n==null?void 0:n.isDefault)||!1}}function ov({data:e,enabled:t=!1,pageSize:r=100,initialPage:n=1}){const[i,s]=w.useState(n),a=e.length,c=Math.ceil(a/r),u=w.useMemo(()=>{if(!t)return e;const l=(i-1)*r,y=l+r;return e.slice(l,y)},[e,t,i,r]),f=w.useCallback(l=>{const y=Math.max(1,Math.min(l,c));s(y)},[c]),d=w.useCallback(()=>{i<c&&s(i+1)},[i,c]),p=w.useCallback(()=>{i>1&&s(i-1)},[i]),x=w.useCallback(()=>{s(1)},[]);return{paginatedData:u,currentPage:i,totalPages:c,pageSize:r,totalRows:a,goToPage:f,nextPage:d,prevPage:p,resetPage:x,hasNextPage:i<c,hasPrevPage:i>1}}function lv(e){const{rawData:t,schema:r,filters:n,sortStack:i,grouping:s,searchQuery:a,columnVisibility:c,columnOrder:u,columnWidths:f,views:d,activeViewId:p,pagination:x}=e,l=w.useMemo(()=>({filters:n,sortStack:i,grouping:s,columnVisibility:c,columnOrder:u,columnWidths:f}),[n,i,s,c,u,f]),y=av({views:d,activeViewId:p,currentState:l}),g=sv({schema:r,columnVisibility:c,columnOrder:u}),{filteredData:m}=tv({data:t,filters:n}),{sortedData:E}=nv({data:m,sortStack:i,schema:r}),{groupedData:D,isGrouped:C}=iv({data:E,grouping:s,schema:r}),{searchedData:N}=rv({data:D,searchQuery:a,schema:r,visibleColumns:g.visibleColumns}),L=ov({data:N,enabled:(x==null?void 0:x.enabled)||!1,pageSize:(x==null?void 0:x.pageSize)||100,initialPage:(x==null?void 0:x.currentPage)||1}),Q=x!=null&&x.enabled?L.paginatedData:N,k=w.useMemo(()=>({totalRows:t.length,filteredRows:m.length,sortedRows:E.length,groupedRows:C?D.length:E.length,searchedRows:N.length,visibleRows:Q.length,hiddenColumns:g.hiddenCount,activeFilters:n.length,activeSorts:i.length,isGrouped:C}),[t.length,m.length,E.length,D.length,N.length,Q.length,g.hiddenCount,n.length,i.length,C]);return{data:Q,filteredData:m,sortedData:E,groupedData:D,searchedData:N,viewEngine:y,columnEngine:g,paginationEngine:L,metrics:k,isGrouped:C,isPaginated:(x==null?void 0:x.enabled)||!1}}const Rr="user-demo-001";function cv(e={}){var ea,ta,ra,na,ia;const{mode:t="builder",autoLoad:r=!0,initialData:n,config:i={}}=e,[s,a]=w.useState([]),[c,u]=w.useState(""),[f,d]=w.useState(!1),[p,x]=w.useState(!1),l=s.find(F=>F.id===c),[y,g]=w.useState("idle"),[m,E]=w.useState(!1),[D,C]=w.useState(!1),[N,L]=w.useState(!1),[Q,k]=w.useState(!1),[V,j]=w.useState(!1),[B,X]=w.useState(!1),[M,ee]=w.useState(void 0),[Te,ne]=w.useState(null),[ae,Se]=w.useState(null),[Ne,be]=w.useState(!1),[ze,_e]=w.useState(!1),[O,P]=w.useState(null),[I,R]=w.useState(!1),[Y,xe]=w.useState(!1),[ve,ge]=w.useState({enabled:!1,levels:[],collapsedGroups:[]}),[oe,Le]=w.useState(""),[Ce,Xe]=w.useState(new Set),[Ae,ht]=w.useState(1),[Ue,de]=w.useState(10),[st,He]=w.useState(!1),[Lt,yt]=w.useState(!1),[lt,gt]=w.useState(!1),[Ye,Ht]=w.useState(null),[wt,$t]=w.useState(null),[Nt,Rt]=w.useState(!1),[Gt,Sr]=w.useState(null),[mt,gr]=w.useState(null);w.useRef(new vm),w.useRef(new si),w.useRef(new si),w.useRef(new si),w.useRef(new si);const[mr,ir]=w.useState(null),Ct=w.useRef(null),Ge=w.useMemo(()=>l?Qg(l.permissions,Rr):"owner",[l]),Jt=em(Ge),bt=w.useMemo(()=>!(l!=null&&l.uploadedData)||!(l!=null&&l.schema)?{totalRows:0,totalColumns:0}:xm(l.uploadedData,l.schema),[l==null?void 0:l.uploadedData,l==null?void 0:l.schema]),Bt=w.useCallback(()=>{l&&(Ct.current=Tm(l))},[l]),ie=w.useCallback((F,G)=>{a(K=>K.map(Z=>Z.id===F?{...Z,...G}:Z))},[]),Pt=w.useCallback(F=>{if(!l)return;ir(F);const G=no(l.id,Rr,F,l.auditHistory||[]);ie(l.id,{auditHistory:G}),Re.error(F.message),F.recoverable&&Ct.current&&setTimeout(()=>{_m(l,Ct.current,ie),Re.info("Previous state restored")},100)},[l,ie]),Be=w.useCallback((F,G,K,Z)=>{if(!l)return;const Ee=gc(l.id,Rr,F,G,K,Z),Fe=l.auditHistory||[],ct=mc(Fe,Ee);setTimeout(()=>{ie(l.id,{auditHistory:ct})},0)},[l,ie]);w.useEffect(()=>{if(l!=null&&l.schemaLocked&&l.schema&&(!l.views||l.views.length===0)){const F=oa(l.schema),G=F.snapshot.columnOrder,K=fn(G,F.snapshot.grouping);ie(l.id,{views:[F],activeViewId:F.id,filters:F.snapshot.filters.length>0?F.snapshot.filters:void 0,sortStack:F.snapshot.sortStack.length>0?F.snapshot.sortStack:void 0,columnVisibility:F.snapshot.columnVisibility,columnOrder:K,columnWidths:F.snapshot.columnWidths,grouping:F.snapshot.grouping})}},[l==null?void 0:l.schemaLocked,l==null?void 0:l.schema,l==null?void 0:l.id,ie]),w.useEffect(()=>{if(n&&r&&!p&&s.length===0){const F={id:`auto-report-${Date.now()}`,name:t==="viewer"?"Data View":"Imported Data",description:"Auto-generated from external data",schemaLocked:!0,uploadedData:n,schema:sa(n),permissions:{owner:Rr,editors:[],viewers:[]}};a([F]),u(F.id),x(!0),g("confirmed")}},[n,r,p,s.length,t]);const we=(ea=l==null?void 0:l.views)==null?void 0:ea.find(F=>F.id===l.activeViewId),Ke=lv({rawData:(l==null?void 0:l.uploadedData)||[],schema:(l==null?void 0:l.schema)||[],filters:(l==null?void 0:l.filters)||[],sortStack:(l==null?void 0:l.sortStack)||[],grouping:(l==null?void 0:l.grouping)||null,searchQuery:oe||"",columnVisibility:(l==null?void 0:l.columnVisibility)||(we==null?void 0:we.snapshot.columnVisibility)||{},columnOrder:(l==null?void 0:l.columnOrder)||(we==null?void 0:we.snapshot.columnOrder)||[],columnWidths:(l==null?void 0:l.columnWidths)||(we==null?void 0:we.snapshot.columnWidths)||{},views:(l==null?void 0:l.views)||[],activeViewId:(l==null?void 0:l.activeViewId)||"",pagination:{enabled:!0,pageSize:Ue,currentPage:Ae}}),{data:We=[],searchedData:at=[],groupedData:Ut=[],metrics:nt={totalRows:0,searchedRows:0,isGrouped:!1},isGrouped:rt=!1,paginationEngine:tt}=Ke||{},he=((ta=Ke.viewEngine)==null?void 0:ta.activeView)||we,re=((ra=Ke.viewEngine)==null?void 0:ra.isDirty)||!1;w.useEffect(()=>{if(!(!he||!l)&&!l.columnOrder){const F=he.snapshot.columnOrder,G=fn(F,he.snapshot.grouping);ie(l.id,{columnOrder:G})}},[l==null?void 0:l.activeViewId]);const ye=w.useMemo(()=>!(l!=null&&l.schema)||!he?null:J0(l.filters||[],l.sortStack||[],l.schema,l.columnVisibility,l.columnOrder,l.columnWidths,l.grouping,he.snapshot.columnOrder),[l==null?void 0:l.filters,l==null?void 0:l.sortStack,l==null?void 0:l.schema,l==null?void 0:l.columnVisibility,l==null?void 0:l.columnOrder,l==null?void 0:l.columnWidths,l==null?void 0:l.grouping,he]),je=w.useMemo(()=>!he||!ye||!re?[]:ef(ye,he.snapshot),[he,ye,re]),v=w.useCallback((F,G)=>{const K={id:`report-${Date.now()}`,name:F,description:G,schemaLocked:!1,permissions:{owner:Rr,editors:[],viewers:[]}};a(Z=>[...Z,K]),u(K.id),d(!1)},[]),S=w.useCallback(F=>{l&&(g("uploading"),setTimeout(()=>{const G=sa(F);ie(l.id,{uploadedData:F,schema:G,uploadError:void 0}),g("preview")},500))},[l,ie]),T=w.useCallback(F=>{l&&(ie(l.id,{uploadError:F}),g("idle"))},[l,ie]),_=w.useCallback(()=>{l&&(ie(l.id,{uploadError:void 0,uploadedData:void 0,schema:void 0}),g("idle"))},[l,ie]),b=w.useCallback(()=>{l&&(ie(l.id,{schemaLocked:!0}),g("confirmed"))},[l,ie]),A=w.useCallback(F=>{if(!l)return;if(!vr("edit_sorting",Ge)){Re.error(yr("edit_sorting"));return}const G=l.sortStack??[],K=G.find(Z=>Z.column===F);if(K){const Z=z0(K.direction);if(Z===null){const Ee=G.filter(Fe=>Fe.column!==F).map((Fe,ct)=>({...Fe,priority:ct+1}));ie(l.id,{sortStack:Ee.length>0?Ee:void 0})}else{const Ee=G.map(Fe=>Fe.column===F?{...Fe,direction:Z}:Fe);ie(l.id,{sortStack:Ee})}}else{if(G.length>=3)return;const Z={column:F,direction:"asc",priority:G.length+1};ie(l.id,{sortStack:[...G,Z]})}},[l,Ge,ie]),W=w.useCallback(F=>{if(l)if(l.schema){const{validRules:G,invalidColumns:K}=vc(F,l.schema);K.length>0&&Re.warning(`Removed invalid sort columns: ${K.join(", ")}`),Bt();try{ie(l.id,{sortStack:G.length>0?G:void 0})}catch(Z){const Ee=br("processing","sorting",Z);Pt(Ee)}}else ie(l.id,{sortStack:F.length>0?F:void 0})},[l,ie,Bt,Pt]),J=w.useCallback(F=>{if(!l)return;const G=l.sortStack??[],K=G.find(Z=>Z.column===F);if(!(K&&K.direction==="asc"))if(K){const Z=G.map(Ee=>Ee.column===F?{...Ee,direction:"asc"}:Ee);ie(l.id,{sortStack:Z})}else{if(G.length>=3)return;const Z={column:F,direction:"asc",priority:G.length+1};ie(l.id,{sortStack:[...G,Z]})}},[l,ie]),U=w.useCallback(F=>{if(!l)return;const G=l.sortStack??[],K=G.find(Z=>Z.column===F);if(!(K&&K.direction==="desc"))if(K){const Z=G.map(Ee=>Ee.column===F?{...Ee,direction:"desc"}:Ee);ie(l.id,{sortStack:Z})}else{if(G.length>=3)return;const Z={column:F,direction:"desc",priority:G.length+1};ie(l.id,{sortStack:[...G,Z]})}},[l,ie]),z=w.useCallback(F=>{var K;if(!l)return;if(!vr("edit_filters",Ge)){Re.error(yr("edit_filters"));return}const G=(K=l.schema)==null?void 0:K.find(Z=>Z.name===F.column);if(G&&F.value!==void 0){const Z=Em(G.type,F.operator,F.value);if(!Z.isValid){Re.error(Z.errorMessage||"Invalid filter value");return}}Bt();try{const Z=l.filters??[];Be("filters","filter_added",Z,[...Z,F]),ie(l.id,{filters:[...Z,F]})}catch(Z){const Ee=br("processing","filters",Z);Pt(Ee)}},[l,Ge,ie,Bt,Pt,Be]),H=w.useCallback((F,G)=>{if(!l)return;if(!vr("edit_filters",Ge)){Re.error(yr("edit_filters"));return}const K=l.filters??[],Z=[...K];Be("filters","filter_updated",K[F],G),Z[F]=G,ie(l.id,{filters:Z})},[l,Ge,ie,Be]),se=w.useCallback(F=>{if(!l)return;if(!vr("edit_filters",Ge)){Re.error(yr("edit_filters"));return}const G=l.filters??[],K=G.filter((Z,Ee)=>Ee!==F);Be("filters","filter_removed",G[F],null),ie(l.id,{filters:K.length>0?K:void 0})},[l,Ge,ie,Be]),ue=w.useCallback(()=>{if(!l)return;if(!vr("edit_filters",Ge)){Re.error(yr("edit_filters"));return}const F=l.filters??[];Be("filters","filter_cleared",F,null),ie(l.id,{filters:void 0})},[l,Ge,ie,Be]),me=w.useCallback(F=>{var Ee;if(!l)return;const G=(Ee=l.views)==null?void 0:Ee.find(Fe=>Fe.id===F);if(!G)return;const K=G.snapshot.columnOrder,Z=fn(K,G.snapshot.grouping);ie(l.id,{filters:G.snapshot.filters.length>0?[...G.snapshot.filters]:void 0,sortStack:G.snapshot.sortStack.length>0?[...G.snapshot.sortStack]:void 0,columnVisibility:{...G.snapshot.columnVisibility},columnOrder:Z,columnWidths:{...G.snapshot.columnWidths},grouping:G.snapshot.grouping,activeViewId:F}),Xe(new Set),L(!1)},[l,ie]),le=w.useCallback((F,G,K)=>{if(!(l!=null&&l.schema)||!ye)return;const Z={id:`view-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,name:F,description:G||void 0,isDefault:K,isFavorite:!1,isDeleted:!1,createdAt:Date.now(),updatedAt:Date.now(),snapshot:{...ye}},Ee=l.views??[],Fe=K?Ee.map(ct=>({...ct,isDefault:!1})):Ee;ie(l.id,{views:[...Fe,Z],activeViewId:Z.id}),Re.success(`"${F}" view created`)},[l,ye,ie]),pe=w.useCallback(()=>{var G;if(!he||!ye||he.isDefault||!l)return;const F=(G=l.views)==null?void 0:G.map(K=>K.id===he.id?{...K,snapshot:{...ye}}:K);ie(l.id,{views:F}),Re.success(`"${he.name}" view updated`)},[he,ye,l,ie]),De=w.useCallback(()=>{k(!0)},[]),ke=w.useCallback(()=>{if(!he||!l)return;const F=he.snapshot.columnOrder,G=fn(F,he.snapshot.grouping);ie(l.id,{filters:he.snapshot.filters.length>0?[...he.snapshot.filters]:void 0,sortStack:he.snapshot.sortStack.length>0?[...he.snapshot.sortStack]:void 0,columnVisibility:{...he.snapshot.columnVisibility},columnOrder:G,columnWidths:{...he.snapshot.columnWidths},grouping:he.snapshot.grouping}),Re.info("Changes reverted to last saved state")},[he,l,ie]),Me=w.useCallback(F=>{if(!(l!=null&&l.views))return;const G=l.views.map(Z=>({...Z,isDefault:Z.id===F}));ie(l.id,{views:G});const K=l.views.find(Z=>Z.id===F);K&&Re.success(`"${K.name}" set as default view`)},[l,ie]),Tt=w.useCallback(F=>{if(!(l!=null&&l.views))return;const G=l.views.map(Z=>Z.id===F?{...Z,isFavorite:!Z.isFavorite,updatedAt:Date.now()}:Z);ie(l.id,{views:G});const K=l.views.find(Z=>Z.id===F);K&&!K.isFavorite?Re.success(`"${K.name}" added to favorites`):K&&Re.info(`"${K.name}" removed from favorites`)},[l,ie]),Wr=w.useCallback(F=>{if(!(l!=null&&l.views))return;const G=l.views.map(Fe=>Fe.id===F?{...Fe,isDeleted:!0,updatedAt:Date.now()}:Fe),K=l.activeViewId===F,Z=G.find(Fe=>Fe.isDefault&&!Fe.isDeleted);ie(l.id,{views:G,activeViewId:K&&Z?Z.id:l.activeViewId,filters:K&&Z?Z.snapshot.filters.length>0?Z.snapshot.filters:void 0:l.filters,sortStack:K&&Z?Z.snapshot.sortStack.length>0?Z.snapshot.sortStack:void 0:l.sortStack});const Ee=l.views.find(Fe=>Fe.id===F);Ee&&Re.info(`"${Ee.name}" moved to Recently Deleted`)},[l,ie]),Vr=w.useCallback(F=>{if(!(l!=null&&l.views))return;const G=l.views.map(Z=>Z.id===F?{...Z,isDeleted:!1,updatedAt:Date.now()}:Z);ie(l.id,{views:G});const K=l.views.find(Z=>Z.id===F);K&&Re.success(`"${K.name}" restored`)},[l,ie]),zr=w.useCallback(F=>{if(!(l!=null&&l.views))return;const G=l.views.find(Zt=>Zt.id===F),K=l.views.filter(Zt=>!Zt.isDeleted||Zt.id===F);if((G==null?void 0:G.isDefault)&&K.filter(Zt=>Zt.isDefault).length===1){Re.error("Cannot delete the last default view");return}const Ee=l.views.filter(Zt=>Zt.id!==F),Fe=l.activeViewId===F,ct=Ee.find(Zt=>Zt.isDefault&&!Zt.isDeleted);ie(l.id,{views:Ee,activeViewId:Fe&&ct?ct.id:l.activeViewId,filters:Fe&&ct?ct.snapshot.filters.length>0?ct.snapshot.filters:void 0:l.filters,sortStack:Fe&&ct?ct.snapshot.sortStack.length>0?ct.snapshot.sortStack:void 0:l.sortStack}),G&&Re.success(`"${G.name}" permanently deleted`)},[l,ie]),Cr=w.useCallback(F=>{ne(F),j(!0),L(!1)},[]),Sn=w.useCallback((F,G)=>{if(!Te||!(l!=null&&l.views))return;const K=l.views.map(Z=>Z.id===Te?{...Z,name:F,description:G||void 0}:Z);ie(l.id,{views:K}),ne(null)},[Te,l,ie]),fr=w.useCallback(F=>{Se(F),X(!0),L(!1)},[]),i0=w.useCallback(()=>{if(!ae||!(l!=null&&l.views))return;const F=l.views.filter(Z=>Z.id!==ae),G=l.activeViewId===ae,K=F.find(Z=>Z.isDefault);ie(l.id,{views:F,activeViewId:G&&K?K.id:l.activeViewId,filters:G&&K?K.snapshot.filters.length>0?K.snapshot.filters:void 0:l.filters,sortStack:G&&K?K.snapshot.sortStack.length>0?K.snapshot.sortStack:void 0:l.sortStack}),Se(null),X(!1)},[ae,l,ie]);w.useEffect(()=>{tt!=null&&tt.resetPage?tt.resetPage():ht(1)},[l==null?void 0:l.filters,oe,l==null?void 0:l.activeViewId]),w.useEffect(()=>{tt&&tt.currentPage!==Ae&&ht(tt.currentPage)},[tt==null?void 0:tt.currentPage]);const s0=w.useCallback(F=>{tt!=null&&tt.goToPage&&tt.goToPage(F),ht(F)},[tt]),a0=w.useCallback(F=>{const G=(Ae-1)*Ue,K=Math.floor(G/F)+1;de(F),ht(K)},[Ae,Ue]),o0=w.useCallback((F,G)=>{if(!l)return;if(!vr("edit_columns",Ge)){Re.error(yr("edit_columns"));return}const Z={...l.columnVisibility||(he==null?void 0:he.snapshot.columnVisibility)||{},[F]:G};ie(l.id,{columnVisibility:Z})},[l,he,Ge,ie]),l0=w.useCallback(F=>{if(l){if(!vr("edit_columns",Ge)){Re.error(yr("edit_columns"));return}ie(l.id,{columnOrder:F})}},[l,Ge,ie]),c0=w.useCallback((F,G)=>{if(!l)return;if(!vr("edit_columns",Ge)){Re.error(yr("edit_columns"));return}const Z={...l.columnWidths||(he==null?void 0:he.snapshot.columnWidths)||{},[F]:G};ie(l.id,{columnWidths:Z})},[l,he,Ge,ie]),f0=w.useCallback(F=>{if(!l)return;const K=(l.filters??[]).filter(Z=>Z.column!==F);ie(l.id,{filters:K.length>0?K:void 0})},[l,ie]),u0=w.useCallback(()=>{if(!he||!(l!=null&&l.schema))return;const F={},G=[],K={};l.schema.forEach(Z=>{F[Z.name]=!0,G.push(Z.name),K[Z.name]=150}),ie(l.id,{columnVisibility:F,columnOrder:G,columnWidths:K,filters:void 0,sortStack:void 0}),Re.success("Reset to default layout - all filters and sorts cleared")},[he,l,ie]),Qs=w.useCallback(mm(F=>{Le(F)},300),[]),h0=w.useCallback(F=>{Qs(F)},[Qs]),d0=w.useCallback(F=>{if(!F.trim()||!l)return;const G=l.searchHistory||[],K=Yg(G,F);ie(l.id,{searchHistory:K})},[l,ie]),p0=w.useCallback(F=>{if(!l)return;const G=l.searchHistory||[],K=Kg(G,F);ie(l.id,{searchHistory:K})},[l,ie]),x0=w.useCallback(F=>{if(!l)return;const G=l.searchHistory||[],K=qg(G,F);ie(l.id,{searchHistory:K})},[l,ie]),g0=w.useCallback(F=>{Xe(G=>{const K=new Set(G);return K.has(F)?K.delete(F):K.add(F),K})},[]),m0=w.useCallback((F,G)=>{if(F){const K=new Set;for(let Z=0;Z<G;Z++)K.add(Z);Xe(K)}else Xe(new Set)},[]),v0=w.useCallback((F,G)=>{Xe(K=>{const Z=new Set(K),Ee=Math.min(F,G),Fe=Math.max(F,G);for(let ct=Ee;ct<=Fe;ct++)Z.add(ct);return Z})},[]),y0=w.useCallback(()=>{Xe(new Set)},[]),w0=w.useCallback(F=>{if(l){if(!vr("edit_columns",Ge)){Re.error(yr("edit_columns"));return}if(F&&l.schema){const{validGrouping:G,invalidColumns:K}=yc(F,l.schema);K.length>0&&Re.warning(`Removed invalid grouping columns: ${K.join(", ")}`),Bt();try{const Z=l.grouping;G===null?Be("grouping","group_cleared",Z,null):Z?Be("grouping","group_reordered",Z,G):Be("grouping","group_level_added",null,G);const Ee=(he==null?void 0:he.snapshot.columnOrder)||l.columnOrder||[],Fe=fn(Ee,G);ie(l.id,{grouping:G,columnOrder:Fe}),JSON.stringify(Fe)!==JSON.stringify(l.columnOrder)&&Be("columns","column_reordered",l.columnOrder,Fe),xe(!1)}catch(Z){const Ee=br("processing","grouping",Z);Pt(Ee)}}else{const G=l.grouping;Be("grouping","group_cleared",G,null);const K=(he==null?void 0:he.snapshot.columnOrder)||l.columnOrder||[];ie(l.id,{grouping:F,columnOrder:[...K]}),JSON.stringify(K)!==JSON.stringify(l.columnOrder)&&Be("columns","column_reordered",l.columnOrder,K),xe(!1)}}},[l,he,Ge,ie,Bt,Pt,Be]),T0=w.useCallback(F=>{if(!l)return;const G=l.grouping;if(!G)return;const K=Y0(G,F);ie(l.id,{grouping:K})},[l,ie]),_0=w.useCallback(()=>{Rt(!0)},[]),nn=w.useCallback(F=>{l!=null&&l.schema&&(be(!0),setTimeout(()=>{try{let G;F.scope==="visible"?G=at:G=l.uploadedData||[];let K;F.columnScope==="all"?(K={},l.schema.forEach(Zt=>{K[Zt.name]=!0})):K=l.columnVisibility||(he==null?void 0:he.snapshot.columnVisibility)||{};const Z=l.columnOrder||(he==null?void 0:he.snapshot.columnOrder),Ee=Ya(G,l.schema,l.filters??[],l.sortStack??[],he,K,Z),Fe=l.name;let ct;switch(F.format){case"csv":Ka(Ee,Fe,F),ct="export_csv";break;case"excel":qa(Ee,Fe,F),ct="export_excel";break;case"json":Ja(Ee,Fe,F),ct="export_json";break}Be("export",ct,null,{format:F.format,scope:F.scope,columnScope:F.columnScope,rowCount:G.length,viewName:(he==null?void 0:he.name)||"Default View"}),Re.success(`Export completed successfully (${F.format.toUpperCase()})`)}catch(G){const K=Cm(G,{onRetry:()=>nn(F)});Re.error(`Export failed: ${K.message}`,{action:{label:"Retry",onClick:()=>nn(F)}});const Z=no(l.id,Rr,K,l.auditHistory||[]);ie(l.id,{auditHistory:Z}),console.error("Export error:",G)}finally{be(!1)}},500))},[l,he,at,ie,Be]),E0=w.useCallback(F=>{if(l!=null&&l.schema){if(re&&he&&!he.isDefault){P(F.format),_e(!0),Rt(!1);return}nn(F),Rt(!1)}},[l,he,re,nn]),qn=w.useCallback(F=>{nn({format:F,scope:"visible",columnScope:"visible"})},[nn]),S0=w.useCallback(()=>{O&&qn(O),_e(!1),P(null)},[O,qn]),C0=w.useCallback(()=>{pe(),O&&qn(O),_e(!1),P(null)},[pe,O,qn]),b0=w.useCallback(()=>{_e(!1),P(null)},[]),D0=w.useCallback(F=>{!(l!=null&&l.schema)||Ce.size===0||(be(!0),setTimeout(()=>{try{const G=Array.from(Ce).sort((Ee,Fe)=>Ee-Fe).map(Ee=>Ut[Ee]).filter(Ee=>Ee!==void 0),K=Ya(G,l.schema,l.filters??[],l.sortStack??[],he),Z=`${l.name.toLowerCase().replace(/\s+/g,"_")}_selected_export`;switch(F){case"csv":Ka(K,Z);break;case"excel":qa(K,Z);break;case"json":Ja(K,Z);break}Re.success(`Exported ${G.length} selected rows`)}catch(G){Re.error("Export failed. Please try again."),console.error("Export error:",G)}finally{be(!1)}},500))},[l,he,Ce,Ut]),A0=w.useCallback(()=>{if(!vr("edit_filters",Ge)){Re.error(yr("edit_filters"));return}yt(!0)},[Ge]),O0=w.useCallback((F,G)=>{if(l)try{const K=om(l),Z=lm(F,G,Rr,K),Ee=cm(l.presets,Z);ie(l.id,{presets:Ee});const Fe=um(l.id,Z.id);Be("presets","preset_created",null,{presetId:Z.id,name:Z.name}),Ht({preset:Z,url:Fe}),yt(!1),gt(!0),Re.success(`Preset "${F}" created successfully`)}catch(K){Re.error(K instanceof Error?K.message:"Failed to create preset")}},[l,ie,Be]),k0=w.useCallback(async()=>{if(!Ye)return;await pm(Ye.url)?(Be("presets","preset_link_copied",null,{presetId:Ye.preset.id}),Re.success("Link copied to clipboard")):Re.error("Failed to copy link")},[Ye,Be]),F0=w.useCallback(()=>{Ye&&(window.location.href=Ye.url)},[Ye]),I0=w.useCallback(()=>{if(!Ye||!l)return;const F=Ye.preset.id,G=Ye.preset.name,K=fm(l.presets,F);ie(l.id,{presets:K}),Be("presets","preset_deleted",{presetId:F,name:G},null),wt===F&&$t(null),gt(!1),Ht(null),Re.success(`Preset "${G}" deleted`)},[Ye,l,wt,ie,Be]),N0=w.useCallback(()=>{$t(null),Re.info("Exited preset view")},[]);w.useEffect(()=>{if(!l)return;const F=hm();if(F&&l.presets&&l.schemaLocked&&l.schema){const G=ro(l.presets,F);if(G){const{sanitizedConfig:K,warnings:Z}=Sm(G.config,l.schema);Z.length>0&&Z.forEach(Fe=>Re.warning(Fe));const Ee=dm(K);ie(l.id,Ee),$t(F),Be("presets","preset_applied",null,{presetId:G.id,name:G.name}),Re.success(`Loaded preset: ${G.name}`)}else Re.error("Preset not found")}},[l==null?void 0:l.schemaLocked]);const R0=wt?ro(l==null?void 0:l.presets,wt):void 0;w.useEffect(()=>{l!=null&&l.views&&l.views.length>0&&l.activeViewId&&tf(l.id,{views:l.views,activeViewId:l.activeViewId})},[l==null?void 0:l.views,l==null?void 0:l.activeViewId,l==null?void 0:l.id]),w.useEffect(()=>{if(l!=null&&l.schemaLocked&&l.schema&&(!l.views||l.views.length===0)){const F=rf(l.id);if(F&&F.views.length>0){const G=F.views.find(K=>K.id===F.activeViewId);if(G)ie(l.id,{views:F.views,activeViewId:F.activeViewId,filters:G.snapshot.filters.length>0?G.snapshot.filters:void 0,sortStack:G.snapshot.sortStack.length>0?G.snapshot.sortStack:void 0});else{const K=F.views.find(Z=>Z.isDefault)||oa(l.schema);ie(l.id,{views:F.views,activeViewId:K.id,filters:K.snapshot.filters.length>0?K.snapshot.filters:void 0,sortStack:K.snapshot.sortStack.length>0?K.snapshot.sortStack:void 0})}}}},[l==null?void 0:l.schemaLocked,l==null?void 0:l.schema,l==null?void 0:l.id]);const P0=w.useCallback(F=>{ee(F),E(!0)},[]),j0=w.useCallback(()=>{E(!1),ee(void 0)},[]),M0=(na=l==null?void 0:l.views)==null?void 0:na.find(F=>F.id===Te),L0=(ia=l==null?void 0:l.views)==null?void 0:ia.find(F=>F.id===ae);return{reports:s,activeReport:l,activeReportId:c,setActiveReportId:u,isModalOpen:f,setIsModalOpen:d,createReport:v,updateReport:ie,uploadState:y,handleFileUpload:S,handleUploadError:T,handleRetry:_,handleConfirm:b,paginatedData:We,processedData:at,displayData:Ut,tableMetrics:nt,isGrouped:rt,tableEngine:Ke,activeView:he,isDirty:re,currentTableState:ye,viewChanges:je,filters:l==null?void 0:l.filters,showFilterPanel:m,setShowFilterPanel:E,filterFocusColumn:M,handleAddFilter:z,handleUpdateFilter:H,handleRemoveFilter:se,handleClearAllFilters:ue,handleOpenFilterForColumn:P0,handleCloseFilterPanel:j0,handleClearFiltersForColumn:f0,sortStack:l==null?void 0:l.sortStack,showSortPanel:D,setShowSortPanel:C,handleSort:A,handleUpdateSortStack:W,handleSortAscending:J,handleSortDescending:U,views:l==null?void 0:l.views,showManageViews:N,setShowManageViews:L,showCreateViewModal:Q,setShowCreateViewModal:k,showEditViewModal:V,setShowEditViewModal:j,showDeleteConfirmation:B,setShowDeleteConfirmation:X,editingView:M0,deletingView:L0,editingViewId:Te,deletingViewId:ae,handleSelectView:me,handleCreateView:le,handleUpdateCurrentView:pe,handleSaveAsNewView:De,handleRevertChanges:ke,handleToggleDefault:Me,handleToggleFavorite:Tt,handleSoftDelete:Wr,handleRestoreView:Vr,handlePermanentDelete:zr,handleEditView:Cr,handleSaveEditView:Sn,handleDeleteView:fr,handleConfirmDelete:i0,showManageColumns:I,setShowManageColumns:R,columnVisibility:l==null?void 0:l.columnVisibility,columnOrder:l==null?void 0:l.columnOrder,columnWidths:l==null?void 0:l.columnWidths,handleUpdateColumnVisibility:o0,handleUpdateColumnOrder:l0,handleUpdateColumnWidth:c0,handleResetColumnLayout:u0,showGroupPanel:Y,setShowGroupPanel:xe,grouping:l==null?void 0:l.grouping,groupingState:ve,handleGroup:w0,handleToggleGroupCollapse:T0,searchQuery:oe,searchHistory:Jg((l==null?void 0:l.searchHistory)||[]),handleSearchChange:h0,handleAddToSearchHistory:d0,handleToggleSearchFavourite:p0,handleDeleteSearchHistory:x0,selectedRowIds:Ce,handleToggleRowSelection:g0,handleToggleAllRows:m0,handleRangeSelection:v0,handleClearSelection:y0,currentPage:Ae,pageSize:Ue,paginationEngine:tt,handlePageChange:s0,handlePageSizeChange:a0,isExporting:Ne,showExportModal:Nt,setShowExportModal:Rt,showDirtyExportWarning:ze,handleExport:_0,handleExportWithConfig:E0,handleExportSelected:D0,handleExportAnyway:S0,handleSaveAndExport:C0,handleCancelExport:b0,showAuditHistory:st,setShowAuditHistory:He,auditHistory:l==null?void 0:l.auditHistory,showCreatePreset:Lt,setShowCreatePreset:yt,showShareLink:lt,setShowShareLink:gt,generatedPreset:Ye,activePreset:R0,activePresetId:wt,handleOpenSharePreset:A0,handleCreatePreset:O0,handleCopyPresetLink:k0,handleOpenPreset:F0,handleDeletePreset:I0,handleClearActivePreset:N0,userRole:Ge,isViewerRole:Jt,currentUserId:Rr,featureLimitWarning:mt,setFeatureLimitWarning:gr,datasetMeta:bt,reportError:mr,setReportError:ir,handleError:Pt,schema:l==null?void 0:l.schema,hasSchemaConflicts:l!=null&&l.schema?U0(l.schema):!1}}const _c=w.createContext(void 0);function Vs({children:e,initialData:t,data:r,mode:n="builder",autoLoad:i=!0,config:s}){const c=cv({mode:n,autoLoad:i,initialData:r||t,config:s});return o.jsx(_c.Provider,{value:c,children:e})}function Ec(){const e=w.useContext(_c);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider. Wrap your component tree with <ReportProvider>...</ReportProvider>");return e}/**
|
|
202
98
|
* @license lucide-react v0.487.0 - ISC
|
|
203
99
|
*
|
|
204
100
|
* This source code is licensed under the ISC license.
|
|
205
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const
|
|
102
|
+
*/const fv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),uv=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),oo=e=>{const t=uv(e);return t.charAt(0).toUpperCase()+t.slice(1)},Sc=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
|
207
103
|
* @license lucide-react v0.487.0 - ISC
|
|
208
104
|
*
|
|
209
105
|
* This source code is licensed under the ISC license.
|
|
210
106
|
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/var
|
|
107
|
+
*/var hv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
212
108
|
* @license lucide-react v0.487.0 - ISC
|
|
213
109
|
*
|
|
214
110
|
* This source code is licensed under the ISC license.
|
|
215
111
|
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const
|
|
112
|
+
*/const dv=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:a,...c},u)=>w.createElement("svg",{ref:u,...hv,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Sc("lucide",i),...c},[...a.map(([f,d])=>w.createElement(f,d)),...Array.isArray(s)?s:[s]]));/**
|
|
217
113
|
* @license lucide-react v0.487.0 - ISC
|
|
218
114
|
*
|
|
219
115
|
* This source code is licensed under the ISC license.
|
|
220
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const
|
|
117
|
+
*/const Oe=(e,t)=>{const r=w.forwardRef(({className:n,...i},s)=>w.createElement(dv,{ref:s,iconNode:t,className:Sc(`lucide-${fv(oo(e))}`,`lucide-${e}`,n),...i}));return r.displayName=oo(e),r};/**
|
|
222
118
|
* @license lucide-react v0.487.0 - ISC
|
|
223
119
|
*
|
|
224
120
|
* This source code is licensed under the ISC license.
|
|
225
121
|
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const
|
|
122
|
+
*/const pv=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Cc=Oe("arrow-down",pv);/**
|
|
227
123
|
* @license lucide-react v0.487.0 - ISC
|
|
228
124
|
*
|
|
229
125
|
* This source code is licensed under the ISC license.
|
|
230
126
|
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const
|
|
127
|
+
*/const xv=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],zs=Oe("arrow-up-down",xv);/**
|
|
232
128
|
* @license lucide-react v0.487.0 - ISC
|
|
233
129
|
*
|
|
234
130
|
* This source code is licensed under the ISC license.
|
|
235
131
|
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const
|
|
132
|
+
*/const gv=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],bc=Oe("arrow-up",gv);/**
|
|
237
133
|
* @license lucide-react v0.487.0 - ISC
|
|
238
134
|
*
|
|
239
135
|
* This source code is licensed under the ISC license.
|
|
240
136
|
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const
|
|
137
|
+
*/const mv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fs=Oe("check",mv);/**
|
|
242
138
|
* @license lucide-react v0.487.0 - ISC
|
|
243
139
|
*
|
|
244
140
|
* This source code is licensed under the ISC license.
|
|
245
141
|
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const
|
|
142
|
+
*/const vv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Kn=Oe("chevron-down",vv);/**
|
|
247
143
|
* @license lucide-react v0.487.0 - ISC
|
|
248
144
|
*
|
|
249
145
|
* This source code is licensed under the ISC license.
|
|
250
146
|
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const
|
|
147
|
+
*/const yv=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],wv=Oe("chevron-left",yv);/**
|
|
252
148
|
* @license lucide-react v0.487.0 - ISC
|
|
253
149
|
*
|
|
254
150
|
* This source code is licensed under the ISC license.
|
|
255
151
|
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const
|
|
152
|
+
*/const Tv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Pi=Oe("chevron-right",Tv);/**
|
|
257
153
|
* @license lucide-react v0.487.0 - ISC
|
|
258
154
|
*
|
|
259
155
|
* This source code is licensed under the ISC license.
|
|
260
156
|
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const
|
|
157
|
+
*/const _v=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ev=Oe("chevron-up",_v);/**
|
|
262
158
|
* @license lucide-react v0.487.0 - ISC
|
|
263
159
|
*
|
|
264
160
|
* This source code is licensed under the ISC license.
|
|
265
161
|
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const
|
|
162
|
+
*/const Sv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Cv=Oe("circle-alert",Sv);/**
|
|
267
163
|
* @license lucide-react v0.487.0 - ISC
|
|
268
164
|
*
|
|
269
165
|
* This source code is licensed under the ISC license.
|
|
270
166
|
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const
|
|
167
|
+
*/const bv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Dv=Oe("circle-help",bv);/**
|
|
272
168
|
* @license lucide-react v0.487.0 - ISC
|
|
273
169
|
*
|
|
274
170
|
* This source code is licensed under the ISC license.
|
|
275
171
|
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const
|
|
172
|
+
*/const Av=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ov=Oe("circle-x",Av);/**
|
|
277
173
|
* @license lucide-react v0.487.0 - ISC
|
|
278
174
|
*
|
|
279
175
|
* This source code is licensed under the ISC license.
|
|
280
176
|
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const
|
|
177
|
+
*/const kv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Fv=Oe("circle",kv);/**
|
|
282
178
|
* @license lucide-react v0.487.0 - ISC
|
|
283
179
|
*
|
|
284
180
|
* This source code is licensed under the ISC license.
|
|
285
181
|
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const
|
|
182
|
+
*/const Iv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],lo=Oe("clock",Iv);/**
|
|
287
183
|
* @license lucide-react v0.487.0 - ISC
|
|
288
184
|
*
|
|
289
185
|
* This source code is licensed under the ISC license.
|
|
290
186
|
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const
|
|
187
|
+
*/const Nv=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Dc=Oe("columns-2",Nv);/**
|
|
292
188
|
* @license lucide-react v0.487.0 - ISC
|
|
293
189
|
*
|
|
294
190
|
* This source code is licensed under the ISC license.
|
|
295
191
|
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const
|
|
192
|
+
*/const Rv=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Pv=Oe("copy",Rv);/**
|
|
297
193
|
* @license lucide-react v0.487.0 - ISC
|
|
298
194
|
*
|
|
299
195
|
* This source code is licensed under the ISC license.
|
|
300
196
|
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const
|
|
197
|
+
*/const jv=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Hs=Oe("download",jv);/**
|
|
302
198
|
* @license lucide-react v0.487.0 - ISC
|
|
303
199
|
*
|
|
304
200
|
* This source code is licensed under the ISC license.
|
|
305
201
|
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const
|
|
202
|
+
*/const Mv=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Lv=Oe("external-link",Mv);/**
|
|
307
203
|
* @license lucide-react v0.487.0 - ISC
|
|
308
204
|
*
|
|
309
205
|
* This source code is licensed under the ISC license.
|
|
310
206
|
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const
|
|
207
|
+
*/const Bv=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ac=Oe("eye-off",Bv);/**
|
|
312
208
|
* @license lucide-react v0.487.0 - ISC
|
|
313
209
|
*
|
|
314
210
|
* This source code is licensed under the ISC license.
|
|
315
211
|
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const
|
|
212
|
+
*/const Uv=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$s=Oe("eye",Uv);/**
|
|
317
213
|
* @license lucide-react v0.487.0 - ISC
|
|
318
214
|
*
|
|
319
215
|
* This source code is licensed under the ISC license.
|
|
320
216
|
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const
|
|
217
|
+
*/const Wv=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],Vv=Oe("file-plus",Wv);/**
|
|
322
218
|
* @license lucide-react v0.487.0 - ISC
|
|
323
219
|
*
|
|
324
220
|
* This source code is licensed under the ISC license.
|
|
325
221
|
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const
|
|
222
|
+
*/const zv=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Oc=Oe("file-text",zv);/**
|
|
327
223
|
* @license lucide-react v0.487.0 - ISC
|
|
328
224
|
*
|
|
329
225
|
* This source code is licensed under the ISC license.
|
|
330
226
|
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const
|
|
227
|
+
*/const Hv=[["path",{d:"M12.531 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14v6a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341l.427-.473",key:"ol2ft2"}],["path",{d:"m16.5 3.5 5 5",key:"15e6fa"}],["path",{d:"m21.5 3.5-5 5",key:"m0lwru"}]],kc=Oe("funnel-x",Hv);/**
|
|
332
228
|
* @license lucide-react v0.487.0 - ISC
|
|
333
229
|
*
|
|
334
230
|
* This source code is licensed under the ISC license.
|
|
335
231
|
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/const
|
|
232
|
+
*/const $v=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],ji=Oe("funnel",$v);/**
|
|
337
233
|
* @license lucide-react v0.487.0 - ISC
|
|
338
234
|
*
|
|
339
235
|
* This source code is licensed under the ISC license.
|
|
340
236
|
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/const
|
|
237
|
+
*/const Gv=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],us=Oe("grip-vertical",Gv);/**
|
|
342
238
|
* @license lucide-react v0.487.0 - ISC
|
|
343
239
|
*
|
|
344
240
|
* This source code is licensed under the ISC license.
|
|
345
241
|
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const
|
|
242
|
+
*/const Xv=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Yv=Oe("history",Xv);/**
|
|
347
243
|
* @license lucide-react v0.487.0 - ISC
|
|
348
244
|
*
|
|
349
245
|
* This source code is licensed under the ISC license.
|
|
350
246
|
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/const
|
|
247
|
+
*/const Kv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Vn=Oe("info",Kv);/**
|
|
352
248
|
* @license lucide-react v0.487.0 - ISC
|
|
353
249
|
*
|
|
354
250
|
* This source code is licensed under the ISC license.
|
|
355
251
|
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const
|
|
252
|
+
*/const qv=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Fc=Oe("layers",qv);/**
|
|
357
253
|
* @license lucide-react v0.487.0 - ISC
|
|
358
254
|
*
|
|
359
255
|
* This source code is licensed under the ISC license.
|
|
360
256
|
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const
|
|
257
|
+
*/const Jv=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Zv=Oe("layout-grid",Jv);/**
|
|
362
258
|
* @license lucide-react v0.487.0 - ISC
|
|
363
259
|
*
|
|
364
260
|
* This source code is licensed under the ISC license.
|
|
365
261
|
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const
|
|
262
|
+
*/const Qv=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],e2=Oe("link-2",Qv);/**
|
|
367
263
|
* @license lucide-react v0.487.0 - ISC
|
|
368
264
|
*
|
|
369
265
|
* This source code is licensed under the ISC license.
|
|
370
266
|
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const
|
|
267
|
+
*/const t2=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],r2=Oe("lock",t2);/**
|
|
372
268
|
* @license lucide-react v0.487.0 - ISC
|
|
373
269
|
*
|
|
374
270
|
* This source code is licensed under the ISC license.
|
|
375
271
|
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const
|
|
272
|
+
*/const n2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Ci=Oe("pen",n2);/**
|
|
377
273
|
* @license lucide-react v0.487.0 - ISC
|
|
378
274
|
*
|
|
379
275
|
* This source code is licensed under the ISC license.
|
|
380
276
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const
|
|
277
|
+
*/const i2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],_n=Oe("plus",i2);/**
|
|
382
278
|
* @license lucide-react v0.487.0 - ISC
|
|
383
279
|
*
|
|
384
280
|
* This source code is licensed under the ISC license.
|
|
385
281
|
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/const
|
|
282
|
+
*/const s2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],a2=Oe("refresh-cw",s2);/**
|
|
387
283
|
* @license lucide-react v0.487.0 - ISC
|
|
388
284
|
*
|
|
389
285
|
* This source code is licensed under the ISC license.
|
|
390
286
|
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/const
|
|
287
|
+
*/const o2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Mi=Oe("rotate-ccw",o2);/**
|
|
392
288
|
* @license lucide-react v0.487.0 - ISC
|
|
393
289
|
*
|
|
394
290
|
* This source code is licensed under the ISC license.
|
|
395
291
|
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
-
*/const
|
|
292
|
+
*/const l2=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],c2=Oe("ruler",l2);/**
|
|
397
293
|
* @license lucide-react v0.487.0 - ISC
|
|
398
294
|
*
|
|
399
295
|
* This source code is licensed under the ISC license.
|
|
400
296
|
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
-
*/const
|
|
297
|
+
*/const f2=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Li=Oe("save",f2);/**
|
|
402
298
|
* @license lucide-react v0.487.0 - ISC
|
|
403
299
|
*
|
|
404
300
|
* This source code is licensed under the ISC license.
|
|
405
301
|
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
-
*/const
|
|
302
|
+
*/const u2=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],h2=Oe("search",u2);/**
|
|
407
303
|
* @license lucide-react v0.487.0 - ISC
|
|
408
304
|
*
|
|
409
305
|
* This source code is licensed under the ISC license.
|
|
410
306
|
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
-
*/const
|
|
307
|
+
*/const d2=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Gs=Oe("settings",d2);/**
|
|
412
308
|
* @license lucide-react v0.487.0 - ISC
|
|
413
309
|
*
|
|
414
310
|
* This source code is licensed under the ISC license.
|
|
415
311
|
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/const
|
|
312
|
+
*/const p2=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],x2=Oe("share-2",p2);/**
|
|
417
313
|
* @license lucide-react v0.487.0 - ISC
|
|
418
314
|
*
|
|
419
315
|
* This source code is licensed under the ISC license.
|
|
420
316
|
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/const
|
|
317
|
+
*/const g2=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],hs=Oe("star",g2);/**
|
|
422
318
|
* @license lucide-react v0.487.0 - ISC
|
|
423
319
|
*
|
|
424
320
|
* This source code is licensed under the ISC license.
|
|
425
321
|
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
-
*/const
|
|
322
|
+
*/const m2=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Kr=Oe("trash-2",m2);/**
|
|
427
323
|
* @license lucide-react v0.487.0 - ISC
|
|
428
324
|
*
|
|
429
325
|
* This source code is licensed under the ISC license.
|
|
430
326
|
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
-
*/const
|
|
327
|
+
*/const v2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],rn=Oe("triangle-alert",v2);/**
|
|
432
328
|
* @license lucide-react v0.487.0 - ISC
|
|
433
329
|
*
|
|
434
330
|
* This source code is licensed under the ISC license.
|
|
435
331
|
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
-
*/const
|
|
332
|
+
*/const y2=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],Ic=Oe("upload",y2);/**
|
|
437
333
|
* @license lucide-react v0.487.0 - ISC
|
|
438
334
|
*
|
|
439
335
|
* This source code is licensed under the ISC license.
|
|
440
336
|
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
-
*/const
|
|
337
|
+
*/const w2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],T2=Oe("user",w2);/**
|
|
442
338
|
* @license lucide-react v0.487.0 - ISC
|
|
443
339
|
*
|
|
444
340
|
* This source code is licensed under the ISC license.
|
|
445
341
|
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
-
*/const
|
|
342
|
+
*/const _2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ot=Oe("x",_2);function E2({onCreateReport:e}){return o.jsx(h.Box,{component:"header",sx:{position:"sticky",top:0,zIndex:50,borderBottom:1,borderColor:"divider",bgcolor:"background.paper"},children:o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:3,height:64},children:[o.jsx(h.Typography,{variant:"h6",component:"h1",sx:{fontWeight:600},children:"Reports"}),o.jsx(h.Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:o.jsx(h.Button,{variant:"contained",startIcon:o.jsx(_n,{size:16}),onClick:e,sx:{fontWeight:500},children:"New Report"})})]})})}function S2({reports:e,activeReportId:t,onTabClick:r}){if(e.length===0)return null;const n=e.findIndex(i=>i.id===t);return o.jsx(h.Paper,{sx:{position:"sticky",top:64,zIndex:40,borderBottom:1,borderColor:"divider",borderRadius:0},elevation:0,children:o.jsx(h.Box,{sx:{px:3},children:o.jsx(h.Tabs,{value:n>=0?n:0,onChange:(i,s)=>r(e[s].id),variant:"scrollable",scrollButtons:"auto",children:e.map(i=>o.jsx(h.Tab,{label:o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.75},children:[i.name,i.description&&o.jsx(h.Tooltip,{title:i.description,arrow:!0,placement:"bottom",children:o.jsx(h.Box,{component:"span",sx:{display:"inline-flex",opacity:.6},onClick:s=>s.stopPropagation(),children:o.jsx(Vn,{size:14})})})]}),sx:{textTransform:"none",fontWeight:500,fontSize:"0.875rem",minHeight:48}},i.id))})})})}function C2({isOpen:e,onClose:t,onCreate:r}){const[n,i]=w.useState(""),[s,a]=w.useState(""),c=()=>{n.trim()&&(r(n.trim(),s.trim()),i(""),a(""))},u=()=>{i(""),a(""),t()};return o.jsxs(h.Dialog,{open:e,onClose:u,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:2},children:[o.jsx(h.Box,{component:"span",sx:{fontSize:"1.25rem",fontWeight:600},children:"Create New Report"}),o.jsx(h.IconButton,{onClick:u,size:"small",sx:{color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsx(h.DialogContent,{children:o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[o.jsx(h.TextField,{label:"Report Name",required:!0,fullWidth:!0,value:n,onChange:f=>i(f.target.value),placeholder:"Enter report name",autoFocus:!0}),o.jsx(h.TextField,{label:"Description",fullWidth:!0,multiline:!0,rows:3,value:s,onChange:f=>a(f.target.value),placeholder:"Enter description (optional)"})]})}),o.jsxs(h.DialogActions,{sx:{px:3,py:2,bgcolor:"action.hover"},children:[o.jsx(h.Button,{onClick:u,variant:"outlined",color:"inherit",children:"Cancel"}),o.jsx(h.Button,{onClick:c,disabled:!n.trim(),variant:"contained",children:"Create Report"})]})]})}function b2({isOpen:e,onClose:t}){return e?o.jsxs(h.Dialog,{open:e,onClose:t,maxWidth:"md",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:["JSON Format Guide",o.jsx(h.IconButton,{onClick:t,size:"small",sx:{color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsx(h.DialogContent,{dividers:!0,children:o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:3,py:1},children:[o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Expected JSON Structure"}),o.jsxs(h.Typography,{variant:"body2",color:"text.secondary",children:["The uploaded JSON must be an ",o.jsx("strong",{children:"array of objects"}),". Each object represents a single row in your report, and the keys of each object become the column names."]})]}),o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Example JSON"}),o.jsx(h.Paper,{elevation:0,sx:{p:2,bgcolor:"action.hover",border:1,borderColor:"divider",borderRadius:1,overflowX:"auto"},children:o.jsx(h.Box,{component:"pre",sx:{fontSize:"0.75rem",fontFamily:"monospace",m:0},children:`[
|
|
447
343
|
{
|
|
448
344
|
"Active Sessions": 33,
|
|
449
345
|
"Active State": true,
|
|
@@ -453,5 +349,5 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
453
349
|
"Region": "Europe",
|
|
454
350
|
"Subscription Type": "Basic"
|
|
455
351
|
}
|
|
456
|
-
]`})})]}),c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Supported Column Types"}),c.jsx(p.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"The system automatically detects column types from your data:"}),c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500,minWidth:80},children:"Number:"}),c.jsxs(p.Typography,{variant:"body2",color:"text.secondary",children:["Numeric values (e.g., ",c.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:"33"}),", ",c.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:"42.5"}),")"]})]}),c.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500,minWidth:80},children:"Boolean:"}),c.jsxs(p.Typography,{variant:"body2",color:"text.secondary",children:["True/false values (e.g., ",c.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:"true"}),", ",c.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:"false"}),")"]})]}),c.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500,minWidth:80},children:"String:"}),c.jsxs(p.Typography,{variant:"body2",color:"text.secondary",children:["Text values (e.g., ",c.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:'"Europe"'}),", ",c.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:'"Analytics Pro"'}),")"]})]}),c.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500,minWidth:80},children:"Date:"}),c.jsxs(p.Typography,{variant:"body2",color:"text.secondary",children:["ISO date strings (e.g., ",c.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:'"2024-08-22"'}),")"]})]})]})]}),c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Notes"}),c.jsxs(p.Box,{component:"ul",sx:{m:0,pl:2.5,"& li":{fontSize:"0.875rem",color:"text.secondary",mb:.5}},children:[c.jsx("li",{children:"Each object in the array represents one row in the report."}),c.jsx("li",{children:"The keys of the JSON objects become report columns."}),c.jsx("li",{children:"All objects should have consistent keys for proper column detection."}),c.jsx("li",{children:"Column names are case-sensitive and preserve spacing."})]})]})]})}),c.jsx(p.DialogActions,{sx:{px:3,pb:2,bgcolor:"action.hover"},children:c.jsx(p.Button,{onClick:t,variant:"contained",children:"Got it"})})]}):null}function h_({onFileUpload:e,onError:t,isUploading:r}){const[n,i]=S.useState(!1),[s,a]=S.useState(""),[o,f]=S.useState(!1),u=S.useRef(null),d=async T=>{if(!T.name.endsWith(".json")){t("Please upload a valid JSON file");return}a(T.name);try{const b=await T.text(),_=JSON.parse(b);if(!Array.isArray(_)){t("JSON must be an array of objects");return}if(_.length===0){t("JSON array is empty");return}e(_)}catch{t("Invalid JSON format. Please check your file and try again.")}finally{a("")}},h=T=>{T.preventDefault(),i(!0)},m=T=>{T.preventDefault(),i(!1)},l=T=>{T.preventDefault(),i(!1);const b=T.dataTransfer.files[0];b&&d(b)},v=()=>{var T;(T=u.current)==null||T.click()},g=T=>{var _;const b=(_=T.target.files)==null?void 0:_[0];b&&d(b)},x=T=>{T.stopPropagation(),f(!0)};return c.jsxs(c.Fragment,{children:[c.jsxs(p.Box,{onDragOver:h,onDragLeave:m,onDrop:l,onClick:v,sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,border:2,borderStyle:"dashed",borderColor:n?"primary.main":"divider",bgcolor:n?"primary.lighter":"transparent",borderRadius:1,px:2,py:6,cursor:"pointer",transition:"all 0.2s",opacity:r?.5:1,pointerEvents:r?"none":"auto","&:hover":{borderColor:n?"primary.main":"text.secondary"}},children:[c.jsx("input",{ref:u,type:"file",accept:".json",onChange:g,style:{display:"none"}}),r?c.jsxs(c.Fragment,{children:[c.jsx(p.CircularProgress,{size:32,sx:{mb:2}}),c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500,mb:.5},children:"Uploading..."}),s&&c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:s})]}):c.jsxs(c.Fragment,{children:[c.jsx(p.Box,{sx:{width:64,height:64,borderRadius:"50%",bgcolor:"primary.lighter",display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:c.jsx(If,{size:32,color:"primary"})}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[c.jsx(p.Button,{variant:"contained",sx:{fontWeight:500},children:"Upload Data (JSON)"}),c.jsx(p.IconButton,{onClick:x,size:"small",sx:{border:1,borderColor:"divider","&:hover":{borderColor:"text.secondary",bgcolor:"action.hover"}},title:"View JSON format guide",children:c.jsx(Ai,{size:16})})]}),c.jsx(p.Typography,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",maxWidth:500},children:"Upload structured JSON data to generate your report."}),c.jsx(p.Typography,{variant:"caption",color:"text.secondary",sx:{mt:1},children:"Click to browse or drag and drop a JSON file here"})]})]}),c.jsx(d_,{isOpen:o,onClose:()=>f(!1)})]})}function p_({schema:e,onConfirm:t,hasConflicts:r}){return c.jsxs(p.Paper,{sx:{border:2,borderColor:"divider",p:3},children:[c.jsxs(p.Box,{sx:{mb:2},children:[c.jsx(p.Typography,{variant:"h6",sx:{fontWeight:600,mb:.5},children:"Schema Preview"}),c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"Review the detected schema before generating your table"})]}),r&&c.jsxs(p.Alert,{severity:"warning",sx:{mb:2},children:[c.jsx(p.AlertTitle,{sx:{fontWeight:600},children:"Schema Conflict Detected"}),"Some columns have inconsistent data types across rows. Please resolve these conflicts before proceeding."]}),c.jsx(p.TableContainer,{sx:{mb:3},children:c.jsxs(p.Table,{children:[c.jsx(p.TableHead,{children:c.jsxs(p.TableRow,{sx:{bgcolor:"action.hover"},children:[c.jsx(p.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Column Name"}),c.jsx(p.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Detected Type"}),c.jsx(p.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Status"})]})}),c.jsx(p.TableBody,{children:e.map(n=>c.jsxs(p.TableRow,{sx:{bgcolor:n.hasConflict?"warning.lighter":"transparent"},children:[c.jsxs(p.TableCell,{sx:{fontWeight:500},children:[n.name,n.hasConflict&&c.jsx(p.Box,{component:"span",sx:{ml:1,color:"warning.main"},children:"⚠"})]}),c.jsx(p.TableCell,{children:c.jsx(p.Chip,{label:n.type,size:"small",sx:{bgcolor:"action.hover"}})}),c.jsx(p.TableCell,{children:c.jsx(p.Chip,{label:n.required?"Required":"Optional",size:"small",color:n.required?"success":"default"})})]},n.name))})]})}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pt:2,borderTop:1,borderColor:"divider"},children:[c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.jsx(WE,{size:16}),c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"Schema will be locked for this report"})]}),c.jsx(p.Button,{variant:"contained",onClick:t,disabled:r,sx:{fontWeight:500},children:"Generate Table"})]})]})}function g_({error:e,onRetry:t}){return c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,border:2,borderColor:"error.light",bgcolor:"error.lighter",borderRadius:1,px:2,py:6},children:[c.jsx(p.Box,{sx:{width:64,height:64,borderRadius:"50%",bgcolor:"error.light",display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:c.jsx(fE,{size:32,color:"error"})}),c.jsx(p.Typography,{variant:"h6",color:"error.dark",sx:{fontWeight:600,mb:1},children:"Upload Failed"}),c.jsx(p.Typography,{variant:"body2",color:"error.dark",sx:{textAlign:"center",maxWidth:500,mb:3},children:e}),c.jsx(p.Button,{variant:"contained",color:"error",startIcon:c.jsx(If,{size:16}),onClick:t,sx:{fontWeight:500},children:"Try Again"})]})}function Ff({title:e,description:t,showIcon:r=!0}){return c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,px:2},children:[r&&c.jsx(p.Box,{sx:{width:64,height:64,borderRadius:"50%",bgcolor:"action.hover",display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:c.jsx(Of,{size:32,color:"currentColor",style:{opacity:.5}})}),c.jsx(p.Typography,{variant:"h6",sx:{fontWeight:600,mb:1},children:e}),c.jsx(p.Typography,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",maxWidth:500},children:t})]})}function m_({value:e,onChange:t,searchHistory:r,onAddToHistory:n,onToggleFavourite:i,onDeleteHistory:s}){const[a,o]=S.useState(!1),[f,u]=S.useState(!1),[d,h]=S.useState(-1),m=S.useRef(null),l=S.useRef(null);S.useEffect(()=>{function N(B){m.current&&!m.current.contains(B.target)&&(o(!1),u(!1))}return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]);const v=()=>{u(!0),h(-1),r.length>0&&o(!0)},g=N=>{t(N),h(-1)},x=N=>{var B;t(N),n(N),o(!1),(B=l.current)==null||B.blur()},T=N=>{var B;N.key==="Enter"?d>=0&&d<r.length?(N.preventDefault(),b(r[d].query)):e.trim()&&x(e.trim()):N.key==="Escape"?(o(!1),h(-1),(B=l.current)==null||B.blur()):N.key==="ArrowDown"?(N.preventDefault(),r.length>0&&(a||o(!0),h(M=>M<r.length-1?M+1:M))):N.key==="ArrowUp"&&(N.preventDefault(),h(M=>M>0?M-1:-1))},b=N=>{h(-1),x(N)},_=()=>{var N;t(""),(N=l.current)==null||N.focus()},k=r.filter(N=>N.isFavourite),F=r.filter(N=>!N.isFavourite),z=a&&r.length>0;return c.jsxs(p.Box,{sx:{position:"relative",width:256},ref:m,children:[c.jsx(p.TextField,{inputRef:l,size:"small",fullWidth:!0,value:e,onChange:N=>g(N.target.value),onFocus:v,onKeyDown:T,placeholder:"Search…",InputProps:{startAdornment:c.jsx(p.InputAdornment,{position:"start",children:c.jsx(ZE,{size:16})}),endAdornment:e?c.jsx(p.InputAdornment,{position:"end",children:c.jsx(p.IconButton,{size:"small",onClick:_,edge:"end",children:c.jsx(Et,{size:16})})}):null}}),z&&c.jsxs(p.Paper,{sx:{position:"absolute",zIndex:50,mt:.5,width:"100%",maxHeight:384,overflowY:"auto"},elevation:3,children:[k.length>0&&c.jsxs(p.Box,{sx:{py:1},children:[c.jsx(p.Typography,{variant:"caption",sx:{px:1.5,py:.75,display:"block",fontWeight:600,textTransform:"uppercase",color:"text.secondary",letterSpacing:"0.05em"},children:"Favourite Searches"}),k.map((N,B)=>c.jsx(Fc,{entry:N,isSelected:d===B,onClick:()=>b(N.query),onToggleFavourite:()=>i(N.query),onDelete:()=>s(N.query)},`fav-${N.query}`))]}),F.length>0&&c.jsxs(p.Box,{sx:{py:1},children:[k.length>0&&c.jsx(p.Divider,{}),c.jsx(p.Typography,{variant:"caption",sx:{px:1.5,py:.75,display:"block",fontWeight:600,textTransform:"uppercase",color:"text.secondary",letterSpacing:"0.05em"},children:"Recent Searches"}),F.map((N,B)=>{const M=k.length+B;return c.jsx(Fc,{entry:N,isSelected:d===M,onClick:()=>b(N.query),onToggleFavourite:()=>i(N.query),onDelete:()=>s(N.query)},`recent-${N.query}`)})]})]})]})}function Fc({entry:e,isSelected:t,onClick:r,onToggleFavourite:n,onDelete:i}){return c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1.5,py:1,cursor:"pointer",bgcolor:t?"primary.lighter":"transparent","&:hover":{bgcolor:t?"primary.lighter":"action.hover"}},children:[c.jsx(p.Box,{sx:{flex:1,minWidth:0},onClick:r,children:c.jsx(p.Typography,{variant:"body2",noWrap:!0,children:e.query})}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5,ml:1},children:[c.jsx(p.IconButton,{size:"small",onClick:s=>{s.stopPropagation(),n()},title:e.isFavourite?"Remove from favourites":"Add to favourites",sx:{p:.5},children:c.jsx(La,{size:14,fill:e.isFavourite?"#facc15":"none",color:e.isFavourite?"#facc15":"currentColor",style:{opacity:e.isFavourite?1:.5}})}),c.jsx(p.IconButton,{size:"small",onClick:s=>{s.stopPropagation(),i()},title:"Delete from history",sx:{p:.5,"&:hover":{color:"error.main"}},children:c.jsx(En,{size:14,style:{opacity:.5}})})]})]})}function x_({views:e,activeViewId:t,isDirty:r,onSelectView:n,onCreateView:i,onManageViews:s,onToggleDefault:a,onToggleFavorite:o,onRestoreView:f,onPermanentDelete:u,isReadOnly:d}){const[h,m]=S.useState(!1),[l,v]=S.useState(!1),[g,x]=S.useState({top:0,left:0}),T=S.useRef(null),b=S.useRef(null),_=e.find(y=>y.id===t),k=_==null?void 0:_.isDefault,F=e.filter(y=>y.isDefault&&!y.isDeleted),z=e.filter(y=>!y.isDefault&&!y.isDeleted).sort((y,H)=>(H.updatedAt||0)-(y.updatedAt||0)),N=e.filter(y=>y.isFavorite&&!y.isDeleted).sort((y,H)=>(H.updatedAt||0)-(y.updatedAt||0)),B=e.filter(y=>y.isDeleted);S.useEffect(()=>{if(h&&b.current){const y=b.current.getBoundingClientRect();x({top:y.bottom+window.scrollY+8,left:y.left+window.scrollX})}},[h]),S.useEffect(()=>{const y=H=>{T.current&&!T.current.contains(H.target)&&b.current&&!b.current.contains(H.target)&&m(!1)};return h&&document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[h]);const M=y=>{n(y),m(!1)},L=(y,H=!1)=>c.jsxs("div",{className:`flex items-center justify-between px-4 py-2 text-sm hover:bg-gray-50 transition-colors ${t===y.id?"bg-blue-50":""}`,children:[c.jsxs("button",{onClick:()=>M(y.id),className:"flex items-center gap-2 flex-1 text-left min-w-0",children:[t===y.id&&c.jsx(ja,{className:"w-4 h-4 text-blue-700 flex-shrink-0"}),t!==y.id&&c.jsx("div",{className:"w-4 flex-shrink-0"}),c.jsx("span",{className:`truncate ${t===y.id?"text-blue-700 font-medium":"text-gray-700"}`,children:y.name}),H&&c.jsx("span",{className:"text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded flex-shrink-0",children:"Default"})]}),c.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[o&&c.jsx("button",{onClick:Q=>{Q.stopPropagation(),o(y.id)},className:"p-1 hover:bg-gray-200 rounded transition-colors",title:y.isFavorite?"Remove from favorites":"Add to favorites",children:c.jsx(La,{className:`w-4 h-4 ${y.isFavorite?"fill-yellow-500 text-yellow-500":"text-gray-400"}`})}),a&&!y.isDefault&&c.jsx("button",{onClick:Q=>{Q.stopPropagation(),a(y.id)},className:"p-1 hover:bg-gray-200 rounded transition-colors",title:"Set as default",children:c.jsx(xE,{className:"w-4 h-4 text-gray-400"})})]})]},y.id),W=y=>c.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-sm bg-gray-50",children:[c.jsx("span",{className:"text-gray-500 truncate flex-1",children:y.name}),c.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[f&&c.jsx("button",{onClick:H=>{H.stopPropagation(),f(y.id)},className:"p-1 hover:bg-gray-200 rounded transition-colors",title:"Restore view",children:c.jsx(Ys,{className:"w-4 h-4 text-green-600"})}),u&&c.jsx("button",{onClick:H=>{H.stopPropagation(),u(y.id)},className:"p-1 hover:bg-gray-200 rounded transition-colors",title:"Delete permanently",children:c.jsx(En,{className:"w-4 h-4 text-red-600"})})]})]},y.id);return c.jsxs("div",{className:"relative",children:[c.jsxs("button",{ref:b,onClick:()=>m(!h),style:{display:"flex",alignItems:"center",gap:"8px",padding:"4px 12px",fontSize:"0.875rem",fontWeight:500,borderRadius:"4px",border:"none",background:"transparent",color:"inherit",cursor:"pointer",whiteSpace:"nowrap",transition:"background-color 0.2s"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="rgba(0, 0, 0, 0.04)"},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent"},children:[c.jsx("span",{style:{color:"rgba(0, 0, 0, 0.6)"},children:"View:"}),c.jsx("span",{style:{fontWeight:500},children:(_==null?void 0:_.name)||"Default View"}),!k&&!r&&c.jsx("span",{style:{marginLeft:"4px",padding:"2px 6px",fontSize:"0.75rem",fontWeight:600,backgroundColor:"#1976d2",color:"white",borderRadius:"8px"},children:"✓"}),r&&c.jsx("span",{style:{marginLeft:"4px",padding:"2px 6px",fontSize:"0.75rem",fontWeight:600,backgroundColor:"#ed6c02",color:"white",borderRadius:"8px"},children:"*"}),c.jsx(Mi,{size:16,style:{opacity:.54}})]}),h&&za.createPortal(c.jsxs("div",{ref:T,className:"fixed w-80 bg-white border border-gray-200 rounded-md shadow-lg z-50 max-h-[500px] overflow-y-auto",style:{top:`${g.top}px`,left:`${g.left}px`},children:[F.length>0&&c.jsxs("div",{className:"py-1",children:[c.jsx("div",{className:"px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Default Views"}),F.map(y=>L(y,!0))]}),N.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-t border-gray-200"}),c.jsxs("div",{className:"py-1",children:[c.jsxs("div",{className:"px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wide flex items-center gap-1",children:[c.jsx(La,{className:"w-3 h-3 fill-yellow-500 text-yellow-500"}),"Favorite Views"]}),N.map(y=>L(y))]})]}),z.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-t border-gray-200"}),c.jsxs("div",{className:"py-1",children:[c.jsx("div",{className:"px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Custom Views"}),z.map(y=>L(y))]})]}),B.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-t border-gray-200"}),c.jsxs("div",{className:"py-1",children:[c.jsxs("button",{onClick:()=>v(!l),className:"w-full px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wide flex items-center justify-between hover:bg-gray-50",children:[c.jsxs("span",{children:["Recently Deleted (",B.length,")"]}),c.jsx(Hs,{className:`w-4 h-4 transition-transform ${l?"rotate-90":""}`})]}),l&&c.jsx("div",{className:"bg-gray-50",children:B.map(y=>W(y))})]})]}),c.jsx("div",{className:"border-t border-gray-200"}),c.jsxs("button",{onClick:()=>{i(),m(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:[c.jsx(ti,{className:"w-4 h-4"}),"Create New Report View"]}),c.jsxs("button",{onClick:()=>{s(),m(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:[c.jsx(No,{className:"w-4 h-4"}),"View Setup"]})]}),document.body)]})}function v_({onClick:e,hiddenCount:t,hasCustomOrder:r}){const n=t>0||r;return c.jsxs(p.Button,{onClick:e,variant:"text",startIcon:c.jsx(Cf,{size:18}),title:t>0?`${t} column${t===1?"":"s"} hidden`:r?"Custom column order":"Manage columns",sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:["Columns",n&&c.jsx(p.Box,{component:"span",sx:{ml:.5,px:.75,py:.25,fontSize:"0.75rem",fontWeight:600,color:"primary.contrastText",bgcolor:"primary.main",borderRadius:2},children:t>0?t:"✓"})]})}const Nf=S.createContext({dragDropManager:void 0});function Er(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Nc=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Rc=function(){return Math.random().toString(36).substring(7).split("").join(".")},Pc={INIT:"@@redux/INIT"+Rc(),REPLACE:"@@redux/REPLACE"+Rc()};function y_(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function w_(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(E_(e))return"date";if(S_(e))return"error";var r=T_(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function T_(e){return typeof e.constructor=="function"?e.constructor.name:null}function S_(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function E_(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function $n(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=w_(e)),t}function Rf(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Er(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Er(1):"Expected the enhancer to be a function. Instead, received: '"+$n(r)+"'");return r(Rf)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Er(2):"Expected the root reducer to be a function. Instead, received: '"+$n(e)+"'");var i=e,s=t,a=[],o=a,f=!1;function u(){o===a&&(o=a.slice())}function d(){if(f)throw new Error(process.env.NODE_ENV==="production"?Er(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function h(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?Er(4):"Expected the listener to be a function. Instead, received: '"+$n(g)+"'");if(f)throw new Error(process.env.NODE_ENV==="production"?Er(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var x=!0;return u(),o.push(g),function(){if(x){if(f)throw new Error(process.env.NODE_ENV==="production"?Er(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");x=!1,u();var b=o.indexOf(g);o.splice(b,1),a=null}}}function m(g){if(!y_(g))throw new Error(process.env.NODE_ENV==="production"?Er(7):"Actions must be plain objects. Instead, the actual type was: '"+$n(g)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof g.type>"u")throw new Error(process.env.NODE_ENV==="production"?Er(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(f)throw new Error(process.env.NODE_ENV==="production"?Er(9):"Reducers may not dispatch actions.");try{f=!0,s=i(s,g)}finally{f=!1}for(var x=a=o,T=0;T<x.length;T++){var b=x[T];b()}return g}function l(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?Er(10):"Expected the nextReducer to be a function. Instead, received: '"+$n(g));i=g,m({type:Pc.REPLACE})}function v(){var g,x=h;return g={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?Er(11):"Expected the observer to be an object. Instead, received: '"+$n(b)+"'");function _(){b.next&&b.next(d())}_();var k=x(_);return{unsubscribe:k}}},g[Nc]=function(){return this},g}return m({type:Pc.INIT}),n={dispatch:m,subscribe:h,getState:d,replaceReducer:l},n[Nc]=v,n}function Le(e,t,...r){if(__()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;n=new Error(t.replace(/%s/g,function(){return r[i++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function __(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function b_(e,t,r){return t.split(".").reduce((n,i)=>n&&n[i]?n[i]:r||null,e)}function C_(e,t){return e.filter(r=>r!==t)}function Pf(e){return typeof e=="object"}function A_(e,t){const r=new Map,n=s=>{r.set(s,r.has(s)?r.get(s)+1:1)};e.forEach(n),t.forEach(n);const i=[];return r.forEach((s,a)=>{s===1&&i.push(a)}),i}function O_(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Ro="dnd-core/INIT_COORDS",Ks="dnd-core/BEGIN_DRAG",Po="dnd-core/PUBLISH_DRAG_SOURCE",qs="dnd-core/HOVER",Js="dnd-core/DROP",Zs="dnd-core/END_DRAG";function jc(e,t){return{type:Ro,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const D_={type:Ro,payload:{clientOffset:null,sourceClientOffset:null}};function k_(e){return function(r=[],n={publishSource:!0}){const{publishSource:i=!0,clientOffset:s,getSourceClientOffset:a}=n,o=e.getMonitor(),f=e.getRegistry();e.dispatch(jc(s)),I_(r,o,f);const u=R_(r,o);if(u==null){e.dispatch(D_);return}let d=null;if(s){if(!a)throw new Error("getSourceClientOffset must be defined");F_(a),d=a(u)}e.dispatch(jc(s,d));const m=f.getSource(u).beginDrag(o,u);if(m==null)return;N_(m),f.pinSource(u);const l=f.getSourceType(u);return{type:Ks,payload:{itemType:l,item:m,sourceId:u,clientOffset:s||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function I_(e,t,r){Le(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Le(r.getSource(n),"Expected sourceIds to be registered.")})}function F_(e){Le(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function N_(e){Le(Pf(e),"Item must be an object.")}function R_(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function P_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){P_(e,i,r[i])})}return e}function M_(e){return function(r={}){const n=e.getMonitor(),i=e.getRegistry();L_(n),U_(n).forEach((a,o)=>{const f=B_(a,o,i,n),u={type:Js,payload:{dropResult:j_({},r,f)}};e.dispatch(u)})}}function L_(e){Le(e.isDragging(),"Cannot call drop while not dragging."),Le(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function B_(e,t,r,n){const i=r.getTarget(e);let s=i?i.drop(n,e):void 0;return $_(s),typeof s>"u"&&(s=t===0?{}:n.getDropResult()),s}function $_(e){Le(typeof e>"u"||Pf(e),"Drop result must either be an object or undefined.")}function U_(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function W_(e){return function(){const r=e.getMonitor(),n=e.getRegistry();V_(r);const i=r.getSourceId();return i!=null&&(n.getSource(i,!0).endDrag(r,i),n.unpinSource()),{type:Zs}}}function V_(e){Le(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ba(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function z_(e){return function(r,{clientOffset:n}={}){H_(r);const i=r.slice(0),s=e.getMonitor(),a=e.getRegistry(),o=s.getItemType();return Y_(i,a,o),G_(i,s,a),X_(i,s,a),{type:qs,payload:{targetIds:i,clientOffset:n||null}}}}function H_(e){Le(Array.isArray(e),"Expected targetIds to be an array.")}function G_(e,t,r){Le(t.isDragging(),"Cannot call hover while not dragging."),Le(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const i=e[n];Le(e.lastIndexOf(i)===n,"Expected targetIds to be unique in the passed array.");const s=r.getTarget(i);Le(s,"Expected targetIds to be registered.")}}function Y_(e,t,r){for(let n=e.length-1;n>=0;n--){const i=e[n],s=t.getTargetType(i);Ba(s,r)||e.splice(n,1)}}function X_(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function K_(e){return function(){if(e.getMonitor().isDragging())return{type:Po}}}function q_(e){return{beginDrag:k_(e),publishDragSource:K_(e),hover:z_(e),drop:M_(e),endDrag:W_(e)}}class J_{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(s){return(...a)=>{const o=s.apply(t,a);typeof o<"u"&&r(o)}}const i=q_(this);return Object.keys(i).reduce((s,a)=>{const o=i[a];return s[a]=n(o),s},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function Z_(e,t){return{x:e.x+t.x,y:e.y+t.y}}function jf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Q_(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:jf(Z_(t,n),r)}function eb(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:jf(t,r)}const xi=[],jo=[];xi.__IS_NONE__=!0;jo.__IS_ALL__=!0;function tb(e,t){return e===xi?!1:e===jo||typeof t>"u"?!0:O_(t,e).length>0}class rb{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Le(typeof t=="function","listener must be a function."),Le(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const s=()=>{const a=this.store.getState(),o=a.stateId;try{o===i||o===i+1&&!tb(a.dirtyHandlerIds,n)||t()}finally{i=o}};return this.store.subscribe(s)}subscribeToOffsetChange(t){Le(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const i=this.store.getState().dragOffset;i!==r&&(r=i,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Le(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Le(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),i=this.getItemType();return Ba(n,i)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Le(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),i=this.getItemType();return n!==i?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),s=this.getItemType();if(s&&!Ba(i,s))return!1;const a=this.getTargetIds();if(!a.length)return!1;const o=a.indexOf(t);return n?o===a.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Q_(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return eb(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Mc=typeof global<"u"?global:self,Mf=Mc.MutationObserver||Mc.WebKitMutationObserver;function Lf(e){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),e()}}}function nb(e){let t=1;const r=new Mf(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const ib=typeof Mf=="function"?nb:Lf;class sb{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,i=t.length-this.index;n<i;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=ib(this.flush),this.requestErrorThrow=Lf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class ab{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class ob{create(t){const r=this.freeTasks,n=r.length?r.pop():new ab(this.onError,i=>r[r.length]=i);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Bf=new sb,lb=new ob(Bf.registerPendingError);function cb(e){Bf.enqueueTask(lb.create(e))}const Mo="dnd-core/ADD_SOURCE",Lo="dnd-core/ADD_TARGET",Bo="dnd-core/REMOVE_SOURCE",Qs="dnd-core/REMOVE_TARGET";function ub(e){return{type:Mo,payload:{sourceId:e}}}function fb(e){return{type:Lo,payload:{targetId:e}}}function db(e){return{type:Bo,payload:{sourceId:e}}}function hb(e){return{type:Qs,payload:{targetId:e}}}function pb(e){Le(typeof e.canDrag=="function","Expected canDrag to be a function."),Le(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Le(typeof e.endDrag=="function","Expected endDrag to be a function.")}function gb(e){Le(typeof e.canDrop=="function","Expected canDrop to be a function."),Le(typeof e.hover=="function","Expected hover to be a function."),Le(typeof e.drop=="function","Expected beginDrag to be a function.")}function $a(e,t){if(t&&Array.isArray(e)){e.forEach(r=>$a(r,!1));return}Le(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ar;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ar||(Ar={}));let mb=0;function xb(){return mb++}function vb(e){const t=xb().toString();switch(e){case Ar.SOURCE:return`S${t}`;case Ar.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Lc(e){switch(e[0]){case"S":return Ar.SOURCE;case"T":return Ar.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Bc(e,t){const r=e.entries();let n=!1;do{const{done:i,value:[,s]}=r.next();if(s===t)return!0;n=!!i}while(!n);return!1}class yb{addSource(t,r){$a(t),pb(r);const n=this.addHandler(Ar.SOURCE,t,r);return this.store.dispatch(ub(n)),n}addTarget(t,r){$a(t,!0),gb(r);const n=this.addHandler(Ar.TARGET,t,r);return this.store.dispatch(fb(n)),n}containsHandler(t){return Bc(this.dragSources,t)||Bc(this.dropTargets,t)}getSource(t,r=!1){return Le(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Le(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Le(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Le(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Lc(t)===Ar.SOURCE}isTargetId(t){return Lc(t)===Ar.TARGET}removeSource(t){Le(this.getSource(t),"Expected an existing source."),this.store.dispatch(db(t)),cb(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Le(this.getTarget(t),"Expected an existing target."),this.store.dispatch(hb(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Le(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Le(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const i=vb(t);return this.types.set(i,r),t===Ar.SOURCE?this.dragSources.set(i,n):t===Ar.TARGET&&this.dropTargets.set(i,n),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const wb=(e,t)=>e===t;function Tb(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Sb(e,t,r=wb){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Eb(e=xi,t){switch(t.type){case qs:break;case Mo:case Lo:case Qs:case Bo:return xi;case Ks:case Po:case Zs:case Js:default:return jo}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,i=A_(r,n);if(!(i.length>0||!Sb(r,n)))return xi;const a=n[n.length-1],o=r[r.length-1];return a!==o&&(a&&i.push(a),o&&i.push(o)),i}function _b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){_b(e,i,r[i])})}return e}const $c={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Cb(e=$c,t){const{payload:r}=t;switch(t.type){case Ro:case Ks:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case qs:return Tb(e.clientOffset,r.clientOffset)?e:bb({},e,{clientOffset:r.clientOffset});case Zs:case Js:return $c;default:return e}}function Ab(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Un(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Ab(e,i,r[i])})}return e}const Ob={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Db(e=Ob,t){const{payload:r}=t;switch(t.type){case Ks:return Un({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Po:return Un({},e,{isSourcePublic:!0});case qs:return Un({},e,{targetIds:r.targetIds});case Qs:return e.targetIds.indexOf(r.targetId)===-1?e:Un({},e,{targetIds:C_(e.targetIds,r.targetId)});case Js:return Un({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Zs:return Un({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function kb(e=0,t){switch(t.type){case Mo:case Lo:return e+1;case Bo:case Qs:return e-1;default:return e}}function Ib(e=0){return e+1}function Fb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Fb(e,i,r[i])})}return e}function Rb(e={},t){return{dirtyHandlerIds:Eb(e.dirtyHandlerIds,{type:t.type,payload:Nb({},t.payload,{prevTargetIds:b_(e,"dragOperation.targetIds",[])})}),dragOffset:Cb(e.dragOffset,t),refCount:kb(e.refCount,t),dragOperation:Db(e.dragOperation,t),stateId:Ib(e.stateId)}}function Pb(e,t=void 0,r={},n=!1){const i=jb(n),s=new rb(i,new yb(i)),a=new J_(i,s),o=e(a,t,r);return a.receiveBackend(o),a}function jb(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Rf(Rb,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Mb(e,t){if(e==null)return{};var r=Lb(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Lb(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}let Uc=0;const ns=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var $f=S.memo(function(t){var{children:r}=t,n=Mb(t,["children"]);const[i,s]=Bb(n);return S.useEffect(()=>{if(s){const a=Uf();return++Uc,()=>{--Uc===0&&(a[ns]=null)}}},[]),c.jsx(Nf.Provider,{value:i,children:r})});function Bb(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=$b(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function $b(e,t=Uf(),r,n){const i=t;return i[ns]||(i[ns]={dragDropManager:Pb(e,t,r,n)}),i[ns]}function Uf(){return typeof global<"u"?global:window}var wa,Wc;function Ub(){return Wc||(Wc=1,wa=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),wa}var Wb=Ub();const Vb=Hu(Wb),_n=typeof window<"u"?S.useLayoutEffect:S.useEffect;function zb(e,t,r){const[n,i]=S.useState(()=>t(e)),s=S.useCallback(()=>{const a=t(e);Vb(n,a)||(i(a),r&&r())},[n,e,r]);return _n(s),[n,s]}function Hb(e,t,r){const[n,i]=zb(e,t,r);return _n(function(){const a=e.getHandlerId();if(a!=null)return e.subscribeToStateChange(i,{handlerIds:[a]})},[e,i]),n}function Wf(e,t,r){return Hb(t,e||(()=>({})),()=>r.reconnect())}function Vf(e,t){const r=[];return typeof e!="function"&&r.push(e),S.useMemo(()=>typeof e=="function"?e():e,r)}function Gb(e){return S.useMemo(()=>e.hooks.dragSource(),[e])}function Yb(e){return S.useMemo(()=>e.hooks.dragPreview(),[e])}let Ta=!1,Sa=!1;class Xb{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Le(!Ta,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ta=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Ta=!1}}isDragging(){if(!this.sourceId)return!1;Le(!Sa,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Sa=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Sa=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Ea=!1;class Kb{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Le(!Ea,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Ea=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ea=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function qb(e,t,r){const n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function Jb(e,t,r){const n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}function Ua(e,t,r,n){let i;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;const o=Object.prototype.hasOwnProperty.bind(t);for(let f=0;f<s.length;f++){const u=s[f];if(!o(u))return!1;const d=e[u],h=t[u];if(i=void 0,i===!1||i===void 0&&d!==h)return!1}return!0}function Wa(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Zb(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Qb(e){return(t=null,r=null)=>{if(!S.isValidElement(t)){const s=t;return e(s,r),s}const n=t;return Zb(n),eC(n,r?s=>e(s,r):e)}}function zf(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const i=Qb(n);t[r]=()=>i}}),t}function Vc(e,t){typeof e=="function"?e(t):e.current=t}function eC(e,t){const r=e.ref;return Le(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?S.cloneElement(e,{ref:n=>{Vc(r,n),Vc(t,n)}}):S.cloneElement(e,{ref:t})}class tC{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,n=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Ua(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Ua(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=zf({dragSource:(r,n)=>{this.clearDragSource(),this.dragSourceOptions=n||null,Wa(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,n)=>{this.clearDragPreview(),this.dragPreviewOptions=n||null,Wa(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class rC{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Ua(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=zf({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,Wa(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function ri(){const{dragDropManager:e}=S.useContext(Nf);return Le(e!=null,"Expected drag drop context"),e}function nC(e,t){const r=ri(),n=S.useMemo(()=>new tC(r.getBackend()),[r]);return _n(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),_n(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function iC(){const e=ri();return S.useMemo(()=>new Xb(e),[e])}class sC{beginDrag(){const t=this.spec,r=this.monitor;let n=null;return typeof t.item=="object"?n=t.item:typeof t.item=="function"?n=t.item(r):n={},n??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const n=this.spec,i=this.monitor,{isDragging:s}=n;return s?s(i):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,n=this.connector,{end:i}=t;i&&i(r.getItem(),r),n.reconnect()}constructor(t,r,n){this.spec=t,this.monitor=r,this.connector=n}}function aC(e,t,r){const n=S.useMemo(()=>new sC(e,t,r),[t,r]);return S.useEffect(()=>{n.spec=e},[e]),n}function oC(e){return S.useMemo(()=>{const t=e.type;return Le(t!=null,"spec.type must be defined"),t},[e])}function lC(e,t,r){const n=ri(),i=aC(e,t,r),s=oC(e);_n(function(){if(s!=null){const[o,f]=Jb(s,i,n);return t.receiveHandlerId(o),r.receiveHandlerId(o),f}},[n,t,r,i,s])}function Hf(e,t){const r=Vf(e);Le(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const n=iC(),i=nC(r.options,r.previewOptions);return lC(r,n,i),[Wf(r.collect,n,i),Gb(i),Yb(i)]}function cC(e){return S.useMemo(()=>e.hooks.dropTarget(),[e])}function uC(e){const t=ri(),r=S.useMemo(()=>new rC(t.getBackend()),[t]);return _n(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function fC(){const e=ri();return S.useMemo(()=>new Kb(e),[e])}function dC(e){const{accept:t}=e;return S.useMemo(()=>(Le(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class hC{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function pC(e,t){const r=S.useMemo(()=>new hC(e,t),[t]);return S.useEffect(()=>{r.spec=e},[e]),r}function gC(e,t,r){const n=ri(),i=pC(e,t),s=dC(e);_n(function(){const[o,f]=qb(s,i,n);return t.receiveHandlerId(o),r.receiveHandlerId(o),f},[n,t,i,r,s.map(a=>a.toString()).join("|")])}function Gf(e,t){const r=Vf(e),n=fC(),i=uC(r.options);return gC(r,n,i),[Wf(r.collect,n,i),cC(i)]}function mC({columnName:e,columnType:t="string",currentSort:r,hasFilters:n,isInSortStack:i,position:s,onSort:a,onRemoveSort:o,onSortAscending:f,onSortDescending:u,onFilter:d,onClearFilter:h,onHideColumn:m,onManageColumns:l,onManageViews:v,onResetLayout:g,onClose:x}){const T=S.useRef(null);S.useEffect(()=>{const _=F=>{T.current&&!T.current.contains(F.target)&&x()},k=F=>{F.key==="Escape"&&x()};return document.addEventListener("mousedown",_),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("keydown",k)}},[x]);const b=()=>r?r.direction==="asc"?t==="number"?"(0→9)":t==="boolean"?"(False→True)":"(A→Z)":t==="number"?"(9→0)":t==="boolean"?"(True→False)":"(Z→A)":"";return za.createPortal(c.jsxs(p.Paper,{ref:T,sx:{position:"fixed",left:`${s.x}px`,top:`${s.y}px`,zIndex:100,minWidth:240},elevation:3,children:[c.jsxs(p.Box,{sx:{px:2,py:1},children:[c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:"Sorting"}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[c.jsx(p.IconButton,{size:"small",onClick:()=>{f?f(e):(r==null?void 0:r.direction)!=="asc"&&(a(e),(r==null?void 0:r.direction)==="desc"&&setTimeout(()=>a(e),0))},title:"Sort Ascending",sx:{p:.75},children:c.jsx(bf,{size:16,color:(r==null?void 0:r.direction)==="asc"?"primary":void 0,style:{opacity:(r==null?void 0:r.direction)==="asc"?1:.4}})}),c.jsx(p.IconButton,{size:"small",onClick:()=>{u?u(e):r?r.direction==="asc"&&a(e):(a(e),setTimeout(()=>a(e),0))},title:"Sort Descending",sx:{p:.75},children:c.jsx(_f,{size:16,color:(r==null?void 0:r.direction)==="desc"?"primary":void 0,style:{opacity:(r==null?void 0:r.direction)==="desc"?1:.4}})}),c.jsx(p.IconButton,{size:"small",onClick:()=>o(e),title:"Clear sorting",disabled:!r,sx:{p:.75,"&:hover":{color:"error.main"}},children:c.jsx(Et,{size:16,style:{opacity:r?1:.3}})})]})]}),r&&c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:b()}),c.jsx(p.Chip,{label:`Level ${r.priority}`,size:"small",color:"primary",sx:{height:20,fontSize:"0.75rem"}})]})]}),c.jsx(p.Divider,{}),c.jsxs(p.MenuList,{dense:!0,children:[c.jsxs(p.MenuItem,{onClick:()=>{d(e),x()},children:[c.jsx(Gs,{size:16,style:{marginRight:8}}),"Filter this column",n&&c.jsx(p.Chip,{label:"Active",size:"small",color:"primary",sx:{ml:"auto",height:20,fontSize:"0.75rem"}})]}),n&&c.jsxs(p.MenuItem,{onClick:()=>{h(e),x()},sx:{color:"warning.main"},children:[c.jsx(Df,{size:16,style:{marginRight:8}}),"Clear Filters"]})]}),c.jsx(p.Divider,{}),c.jsx(p.MenuList,{dense:!0,children:c.jsxs(p.MenuItem,{onClick:()=>{m(e),x()},children:[c.jsx(Af,{size:16,style:{marginRight:8}}),"Hide column"]})}),c.jsx(p.Divider,{}),c.jsxs(p.MenuList,{dense:!0,children:[c.jsxs(p.MenuItem,{onClick:()=>{l(),x()},children:[c.jsx(No,{size:16,style:{marginRight:8}}),"Column Settings"]}),c.jsxs(p.MenuItem,{onClick:()=>{v(),x()},children:[c.jsx(Of,{size:16,style:{marginRight:8}}),"View Setup"]}),c.jsxs(p.MenuItem,{onClick:()=>{g(),x()},children:[c.jsx(Ys,{size:16,style:{marginRight:8}}),"Reset to Default Layout"]})]})]}),document.body)}const zc="COLUMN_HEADER";function xC({column:e,index:t,sortRule:r,hasFilters:n,isInSortStack:i,width:s,onColumnClick:a,onMoveColumn:o,onResizeStart:f,onSort:u,onRemoveSort:d,onSortAscending:h,onSortDescending:m,onOpenFilterForColumn:l,onClearFiltersForColumn:v,onHideColumn:g,onManageColumns:x,onManageViews:T,onResetLayout:b}){const _=S.useRef(null),[k,F]=S.useState(!1),[z,N]=S.useState({x:0,y:0}),[{handlerId:B,isOver:M},L]=Gf({accept:zc,collect(ee){return{handlerId:ee.getHandlerId(),isOver:ee.isOver()}},hover(ee,_e){var R;if(!_.current)return;const Ae=ee.index,De=t;if(Ae===De)return;const oe=(R=_.current)==null?void 0:R.getBoundingClientRect(),ce=(oe.right-oe.left)/2,C=_e.getClientOffset(),j=((C==null?void 0:C.x)??0)-oe.left;Ae<De&&j<ce||Ae>De&&j>ce||(o(Ae,De),ee.index=De)}}),[{isDragging:W},y]=Hf({type:zc,item:()=>({index:t,columnName:e.name}),collect:ee=>({isDragging:ee.isDragging()})});y(L(_));const H=ee=>{ee.preventDefault(),ee.stopPropagation(),N({x:ee.clientX,y:ee.clientY}),F(!0)},Q=()=>r?c.jsxs("div",{className:"inline-flex items-center ml-1 gap-0.5",children:[r.direction==="asc"?c.jsx(bf,{className:"w-3.5 h-3.5"}):c.jsx(_f,{className:"w-3.5 h-3.5"}),c.jsx("span",{className:"flex items-center justify-center w-4 h-4 bg-blue-600 text-white text-[10px] font-bold rounded-full",children:r.priority})]}):null,J=()=>n?c.jsx("button",{onClick:ee=>{ee.stopPropagation(),l(e.name)},className:"inline-flex items-center ml-1 text-blue-600 hover:text-blue-800 transition-colors",title:"Active filters on this column",children:c.jsx(Gs,{className:"w-3.5 h-3.5 fill-current"})}):null;return c.jsxs(c.Fragment,{children:[c.jsxs(p.TableCell,{ref:_,"data-handler-id":B,onClick:()=>a(e.name),onContextMenu:H,sx:{position:"relative",textAlign:"left",fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",whiteSpace:"nowrap",cursor:"pointer",userSelect:"none",opacity:W?.3:1,bgcolor:M?"primary.lighter":"transparent","&:hover":{bgcolor:"action.selected"},width:s?`${s}px`:"150px"},children:[c.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center"},children:[e.name,Q(),J()]}),c.jsx(p.Box,{sx:{position:"absolute",right:0,top:0,height:"100%",width:8,cursor:"col-resize",zIndex:10,"&:hover":{bgcolor:"primary.light"}},onMouseDown:ee=>{ee.stopPropagation(),f(ee,e.name)},onClick:ee=>ee.stopPropagation()}),M&&c.jsx(p.Box,{sx:{position:"absolute",left:0,top:0,bottom:0,width:4,bgcolor:"primary.main"}})]}),k&&c.jsx(mC,{columnName:e.name,columnType:e.type,currentSort:r,hasFilters:n,isInSortStack:i,position:z,onSort:u,onRemoveSort:d,onSortAscending:h,onSortDescending:m,onFilter:l,onClearFilter:v,onHideColumn:g,onManageColumns:x,onManageViews:T,onResetLayout:b,onClose:()=>F(!1)})]})}function Yf(e){let t=null;return()=>(t==null&&(t=e()),t)}function vC(e,t){return e.filter(r=>r!==t)}function yC(e,t){const r=new Set,n=s=>r.add(s);e.forEach(n),t.forEach(n);const i=[];return r.forEach(s=>i.push(s)),i}class wC{enter(t){const r=this.entered.length,n=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=yC(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=vC(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class TC{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const i=this.config.exposeProperties[n];i!=null&&(r[n]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const Xf="__NATIVE_FILE__",Kf="__NATIVE_URL__",qf="__NATIVE_TEXT__",Jf="__NATIVE_HTML__",Hc=Object.freeze(Object.defineProperty({__proto__:null,FILE:Xf,HTML:Jf,TEXT:qf,URL:Kf},Symbol.toStringTag,{value:"Module"}));function _a(e,t,r){const n=t.reduce((i,s)=>i||e.getData(s),"");return n??r}const Va={[Xf]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Jf]:{exposeProperties:{html:(e,t)=>_a(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Kf]:{exposeProperties:{urls:(e,t)=>_a(e,t,"").split(`
|
|
457
|
-
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[qf]:{exposeProperties:{text:(e,t)=>_a(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function SC(e,t){const r=Va[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new TC(r);return n.loadDataTransfer(t),n}function ba(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Va).filter(r=>{const n=Va[r];return n!=null&&n.matchesTypes?n.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const EC=Yf(()=>/firefox/i.test(navigator.userAgent)),Zf=Yf(()=>!!window.safari);class Gc{interpolate(t){const{xs:r,ys:n,c1s:i,c2s:s,c3s:a}=this;let o=r.length-1;if(t===r[o])return n[o];let f=0,u=a.length-1,d;for(;f<=u;){d=Math.floor(.5*(f+u));const l=r[d];if(l<t)f=d+1;else if(l>t)u=d-1;else return n[d]}o=Math.max(0,u);const h=t-r[o],m=h*h;return n[o]+i[o]*h+s[o]*m+a[o]*h*m}constructor(t,r){const{length:n}=t,i=[];for(let l=0;l<n;l++)i.push(l);i.sort((l,v)=>t[l]<t[v]?-1:1);const s=[],a=[];let o,f;for(let l=0;l<n-1;l++)o=t[l+1]-t[l],f=r[l+1]-r[l],s.push(o),a.push(f/o);const u=[a[0]];for(let l=0;l<s.length-1;l++){const v=a[l],g=a[l+1];if(v*g<=0)u.push(0);else{o=s[l];const x=s[l+1],T=o+x;u.push(3*T/((T+x)/v+(T+o)/g))}}u.push(a[a.length-1]);const d=[],h=[];let m;for(let l=0;l<u.length-1;l++){m=a[l];const v=u[l],g=1/s[l],x=v+u[l+1]-m-m;d.push((m-v-x)*g),h.push(x*g*g)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=d,this.c3s=h}}const _C=1;function Qf(e){const t=e.nodeType===_C?e:e.parentElement;if(!t)return null;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function ts(e){return{x:e.clientX,y:e.clientY}}function bC(e){var t;return e.nodeName==="IMG"&&(EC()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function CC(e,t,r,n){let i=e?t.width:r,s=e?t.height:n;return Zf()&&e&&(s/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:s}}function AC(e,t,r,n,i){const s=bC(t),o=Qf(s?e:t),f={x:r.x-o.x,y:r.y-o.y},{offsetWidth:u,offsetHeight:d}=e,{anchorX:h,anchorY:m}=n,{dragPreviewWidth:l,dragPreviewHeight:v}=CC(s,t,u,d),g=()=>{let z=new Gc([0,.5,1],[f.y,f.y/d*v,f.y+v-d]).interpolate(m);return Zf()&&s&&(z+=(window.devicePixelRatio-1)*v),z},x=()=>new Gc([0,.5,1],[f.x,f.x/u*l,f.x+l-u]).interpolate(h),{offsetX:T,offsetY:b}=i,_=T===0||T,k=b===0||b;return{x:_?T:x(),y:k?b:g()}}class OC{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function DC(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){DC(e,i,r[i])})}return e}class kC{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,n){return this.sourcePreviewNodeOptions.set(t,n),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const i=a=>this.handleDragStart(a,t),s=a=>this.handleSelectStart(a);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",i),r.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",i),r.removeEventListener("selectstart",s),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=a=>this.handleDragEnter(a,t),i=a=>this.handleDragOver(a,t),s=a=>this.handleDrop(a,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",i),r.addEventListener("drop",s),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",i),r.removeEventListener("drop",s)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return Yc({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Yc({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Hc).some(r=>Hc[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=SC(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&Qf(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const a=ts(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:o}=i,f=ba(o);if(this.monitor.isDragging()){if(o&&typeof o.setDragImage=="function"){const d=this.monitor.getSourceId(),h=this.sourceNodes.get(d),m=this.sourcePreviewNodes.get(d)||h;if(m){const{anchorX:l,anchorY:v,offsetX:g,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),_=AC(h,m,a,{anchorX:l,anchorY:v},{offsetX:g,offsetY:x});o.setDragImage(m,_.x,_.y)}}try{o==null||o.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(f)this.beginDragNativeItem(f);else{if(o&&!o.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:o}=i,f=ba(o);f&&this.beginDragNativeItem(f,o)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,s.length>0&&this.actions.hover(s,{clientOffset:ts(i)}),s.some(o=>this.monitor.canDropOnTarget(o))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=ts(i),this.scheduleHover(s),(s||[]).some(o=>this.monitor.canDropOnTarget(o))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;i.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}else ba(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:ts(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const s=i.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(i.preventDefault(),s.dragDrop()))},this.options=new OC(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new wC(this.isNodeInDocument)}}const ed=function(t,r,n){return new kC(t,r,n)};function IC({selectedCount:e,onExportSelected:t,onClearSelection:r}){const[n,i]=S.useState(null);if(e===0)return null;const s=f=>{i(f.currentTarget)},a=f=>{t(f),i(null)},o=()=>{i(null)};return c.jsx(p.Box,{sx:{position:"fixed",bottom:24,left:"50%",transform:"translateX(-50%)",zIndex:50},children:c.jsxs(p.Box,{sx:{bgcolor:"primary.main",color:"primary.contrastText",boxShadow:3,borderRadius:2,px:3,py:1.5,display:"flex",alignItems:"center",gap:2},children:[c.jsxs(p.Typography,{variant:"body2",sx:{fontWeight:500},children:[e," ",e===1?"row":"rows"," selected"]}),c.jsx(p.Divider,{orientation:"vertical",flexItem:!0,sx:{bgcolor:"primary.light",opacity:.5}}),c.jsx(p.Button,{onClick:s,startIcon:c.jsx(Io,{size:16}),size:"small",sx:{bgcolor:"primary.dark",color:"primary.contrastText","&:hover":{bgcolor:"primary.light"},textTransform:"none"},children:"Export Selected"}),c.jsxs(p.Menu,{anchorEl:n,open:!!n,onClose:o,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:[c.jsx(p.MenuItem,{onClick:()=>a("csv"),children:"Export as CSV"}),c.jsx(p.MenuItem,{onClick:()=>a("excel"),children:"Export as Excel"}),c.jsx(p.MenuItem,{onClick:()=>a("json"),children:"Export as JSON"})]}),c.jsx(p.Divider,{orientation:"vertical",flexItem:!0,sx:{bgcolor:"primary.light",opacity:.5}}),c.jsx(p.Button,{onClick:r,startIcon:c.jsx(Et,{size:16}),size:"small",sx:{color:"primary.contrastText","&:hover":{bgcolor:"primary.dark"},textTransform:"none"},children:"Clear Selection"})]})})}const Xc=[10,25,50,100];function FC({currentPage:e,pageSize:t,totalRows:r,onPageChange:n,onPageSizeChange:i}){const s=Math.ceil(r/t);if(r<=Math.min(...Xc))return null;const a=()=>{e>1&&n(e-1)},o=()=>{e<s&&n(e+1)},f=(e-1)*t+1,u=Math.min(e*t,r);return c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:3,py:2,borderTop:1,borderColor:"divider",bgcolor:"background.paper"},children:[c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.jsx(p.Typography,{variant:"body2",color:"text.primary",children:"Rows per page:"}),c.jsx(p.Select,{value:t,onChange:d=>i(Number(d.target.value)),size:"small",sx:{minWidth:70},children:Xc.map(d=>c.jsx(p.MenuItem,{value:d,children:d},d))})]}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:2},children:[c.jsxs(p.Typography,{variant:"body2",color:"text.primary",children:[f,"–",u," of ",r]}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.jsx(p.IconButton,{onClick:a,disabled:e===1,size:"small",title:"Previous page",children:c.jsx(aE,{size:20})}),c.jsxs(p.Typography,{variant:"body2",color:"text.primary",children:["Page ",e," of ",s]}),c.jsx(p.IconButton,{onClick:o,disabled:e===s,size:"small",title:"Next page",children:c.jsx(Hs,{size:20})})]})]}),c.jsx(p.Box,{sx:{width:128}})]})}function NC(){return c.jsx(p.Chip,{icon:c.jsx(Fo,{size:14}),label:"View Only",size:"small",variant:"outlined",sx:{bgcolor:"action.hover",borderColor:"divider",fontSize:"0.75rem",fontWeight:500}})}function RC({schema:e,data:t,sortStack:r=[],filters:n=[],views:i=[],activeViewId:s="",isDirty:a=!1,isExporting:o=!1,columnVisibility:f={},columnOrder:u=[],columnWidths:d={},grouping:h=null,onSort:m,onSortAscending:l,onSortDescending:v,onOpenFilters:g,onOpenSort:x,onOpenFilterForColumn:T,onSelectView:b,onCreateView:_,onManageViews:k,onUpdateCurrentView:F,onSaveAsNewView:z,onToggleDefault:N,onToggleFavorite:B,onRestoreView:M,onPermanentDelete:L,onExport:W,onOpenColumns:y,onUpdateColumnWidth:H,onUpdateColumnOrder:Q,onUpdateColumnVisibility:J,onClearFiltersForColumn:ee,onResetLayout:_e,onOpenGroup:Ae,onToggleGroupCollapse:De,onOpenAuditHistory:oe,onOpenSharePreset:ce,searchQuery:C,searchHistory:j=[],onAddToSearchHistory:R,onToggleSearchFavourite:P,onDeleteSearchHistory:V,selectedRowIds:le=new Set,onSearchChange:fe,onToggleRowSelection:ue,onToggleAllRows:te,onRangeSelection:Ie,onClearSelection:ae,onExportSelected:Pe,currentPage:ke=1,pageSize:pt=10,totalRowsBeforePagination:He=t.length,onPageChange:we,onPageSizeChange:ut,isReadOnly:je=!1,userRole:Rt}){const[vt,rt]=S.useState(null),[kt,Xe]=S.useState(0),[Ht,It]=S.useState(0),[Gt,Lt]=S.useState(null),[Bt,qe]=S.useState(!1);S.useRef(null);const gt=(u.length>0?u.map(he=>e.find(be=>be.name===he)).filter(he=>he!==void 0):e).filter(he=>f[he.name]!==!1),Ft=e.filter(he=>f[he.name]===!1).length,bt=e.map(he=>he.name),cr=JSON.stringify(u)!==JSON.stringify(bt),Yt=(he,be)=>{he.preventDefault(),he.stopPropagation(),rt(be),Xe(he.clientX),It(d[be]||150)};S.useEffect(()=>{if(!vt)return;const he=We=>{const w=We.clientX-kt,O=Math.max(100,Ht+w);H==null||H(vt,O)},be=()=>{rt(null)};return document.addEventListener("mousemove",he),document.addEventListener("mouseup",be),()=>{document.removeEventListener("mousemove",he),document.removeEventListener("mouseup",be)}},[vt,kt,Ht,H]);const Qe=he=>he==null?"-":typeof he=="object"?JSON.stringify(he):typeof he=="boolean"?he?"true":"false":String(he),pr=he=>{m&&m(he)},Xt=(he,be)=>{if(!Q)return;const We=[...u.length>0?u:e.map(O=>O.name)],[w]=We.splice(he,1);We.splice(be,0,w),Q(We)},ir=he=>{if(!m)return;const be=r.find(We=>We.column===he);(!be||be.direction!=="asc")&&m(he)},pe=he=>{if(!m)return;const be=r.find(We=>We.column===he);be?be.direction==="asc"&&m(he):(m(he),setTimeout(()=>m(he),0))},tr=he=>{if(!m)return;const be=r.find(We=>We.column===he);be&&(be.direction==="asc"?(m(he),setTimeout(()=>m(he),0)):be.direction==="desc"&&m(he))},Ge=he=>{J&&J(he,!1)},Oe=(h==null?void 0:h.enabled)&&t.length>0&&t[0]&&"isGroupHeader"in t[0],nt=gt.map(he=>he.name),Ye=C&&C.trim()?Vu(t,e,C,nt):t;S.useEffect(()=>{const he=be=>{!te||!ae||be.target instanceof HTMLInputElement||be.target instanceof HTMLTextAreaElement||((be.ctrlKey||be.metaKey)&&be.key==="a"&&(be.preventDefault(),te(!0,Ye.length)),be.key==="Escape"&&(be.preventDefault(),ae()))};return document.addEventListener("keydown",he),()=>document.removeEventListener("keydown",he)},[te,ae,Ye.length]);const Tt=(he,be)=>{ue&&(be.shiftKey&&Gt!==null?(be.preventDefault(),Ie&&Ie(Gt,he)):(ue(he),Lt(he)))},sr=Ye.length>0&&le.size>0&&Ye.every((he,be)=>le.has(be)),yt=le.size>0&&!sr,xt=ue&&te,mt=he=>{var w;const be=he.groupLevel,We=be*24;return c.jsx(p.TableRow,{onClick:()=>De==null?void 0:De(he.groupKey),sx:{bgcolor:"action.hover","&:hover":{bgcolor:"action.selected"},cursor:"pointer",borderTop:2,borderColor:"divider"},children:c.jsx(p.TableCell,{colSpan:gt.length+(xt?1:0),sx:{pl:`${We+24}px`},children:c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[he.isCollapsed?c.jsx(Hs,{size:16}):c.jsx(Mi,{size:16}),c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:600},children:qd(be,((w=h==null?void 0:h.levels[be])==null?void 0:w.column)||"",he.groupValue)}),c.jsxs(p.Box,{sx:{px:1,py:.25,fontSize:"0.75rem",fontWeight:500,bgcolor:"primary.lighter",color:"primary.dark",borderRadius:2},children:[he.rowCount," ",he.rowCount===1?"row":"rows"]}),Object.keys(he.aggregates).length>0&&c.jsx(p.Typography,{variant:"caption",sx:{ml:1,color:"text.secondary"},children:Object.entries(he.aggregates).map(([O,E])=>Kd(E)).filter(Boolean).join(" • ")})]})})},he.groupKey)},Te=(he,be)=>{const We=le.has(be);return c.jsxs(p.TableRow,{onClick:w=>{xt&&w.target===w.currentTarget&&Tt(be,w)},sx:{bgcolor:We?"primary.lighter":"transparent","&:hover":{bgcolor:We?"primary.lighter":"action.hover"}},children:[xt&&c.jsx(p.TableCell,{sx:{width:48},children:c.jsx(p.Checkbox,{checked:We,onChange:w=>{w.stopPropagation(),Tt(be,w)},onClick:w=>w.stopPropagation(),size:"small"})}),gt.map(w=>c.jsx(p.TableCell,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:d[w.name]?`${d[w.name]}px`:"150px"},children:Qe(he[w.name])},w.name))]},be)};return c.jsx($f,{backend:ed,children:c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:2},children:[xt&&Pe&&ae&&c.jsx(IC,{selectedCount:le.size,onExportSelected:Pe,onClearSelection:ae}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[je&&c.jsx(NC,{}),fe&&R&&P&&V&&c.jsx(m_,{value:C||"",onChange:fe,searchHistory:j,onAddToHistory:R,onToggleFavourite:P,onDeleteHistory:V,disabled:je}),c.jsx(p.Button,{onClick:()=>qe(!Bt),variant:Bt?"contained":"outlined",size:"small",startIcon:c.jsx(No,{size:16}),sx:{textTransform:"none"},children:"Settings"}),Bt&&c.jsxs(p.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1,borderRadius:1,border:1,borderColor:"divider",bgcolor:"background.paper",overflowX:"auto",maxWidth:520,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-track":{bgcolor:"action.hover",borderRadius:1},"&::-webkit-scrollbar-thumb":{bgcolor:"action.disabled",borderRadius:1}},children:[!je&&x&&c.jsxs(p.Button,{onClick:x,variant:"text",startIcon:c.jsx(ko,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:["Sort",r.length>0&&c.jsx(p.Box,{component:"span",sx:{ml:.5,px:.75,py:.25,fontSize:"0.75rem",fontWeight:600,color:"primary.contrastText",bgcolor:"primary.main",borderRadius:2},children:r.length})]}),!je&&g&&c.jsxs(p.Button,{onClick:g,variant:"text",startIcon:c.jsx(Gs,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:["Filter",n.length>0&&c.jsx(p.Box,{component:"span",sx:{ml:.5,px:.75,py:.25,fontSize:"0.75rem",fontWeight:600,color:"primary.contrastText",bgcolor:"primary.main",borderRadius:2},children:n.length})]}),b&&_&&k&&F&&i.length>0&&c.jsx(x_,{views:i||[],activeViewId:s||"",isDirty:a,onSelectView:b,onCreateView:_,onManageViews:k,onToggleDefault:N,onToggleFavorite:B,onRestoreView:M,onPermanentDelete:L,isReadOnly:je}),!je&&y&&c.jsx(v_,{onClick:y,hiddenCount:Ft,hasCustomOrder:cr}),W&&c.jsx(p.Button,{onClick:W,disabled:o,variant:"text",startIcon:c.jsx(Io,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:o?"Exporting...":"Export"}),!je&&Ae&&c.jsx(p.Button,{onClick:Ae,variant:"text",startIcon:c.jsx(kf,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:"Group"}),oe&&c.jsx(p.Button,{onClick:oe,variant:"text",startIcon:c.jsx(RE,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:"Audit History"}),ce&&c.jsx(p.Button,{onClick:ce,variant:"text",startIcon:c.jsx(t_,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:"Share Report State"})]})]}),c.jsxs(p.Paper,{sx:{overflow:"hidden"},variant:"outlined",children:[c.jsx(p.Box,{sx:{overflowX:"auto"},children:c.jsxs(p.Table,{sx:{tableLayout:"fixed"},children:[c.jsx(p.TableHead,{children:c.jsxs(p.TableRow,{sx:{bgcolor:"action.hover"},children:[xt&&c.jsx(p.TableCell,{sx:{width:48},children:c.jsx(p.Checkbox,{checked:sr,indeterminate:yt,onChange:he=>{te==null||te(he.target.checked,Ye.length)},size:"small",title:"Select all visible rows"})}),gt.map((he,be)=>c.jsx(xC,{column:he,index:be,sortRule:r.find(We=>We.column===he.name),hasFilters:n.some(We=>We.column===he.name),isInSortStack:r.some(We=>We.column===he.name),width:d[he.name],onColumnClick:pr,onMoveColumn:Xt,onResizeStart:Yt,onSort:pr,onRemoveSort:tr,onSortAscending:ir,onSortDescending:pe,onOpenFilterForColumn:T||(()=>{}),onClearFiltersForColumn:ee||(()=>{}),onHideColumn:Ge,onManageColumns:y||(()=>{}),onManageViews:k||(()=>{}),onResetLayout:_e||(()=>{})},he.name))]})}),c.jsx(p.TableBody,{children:Ye.length===0?c.jsx(p.TableRow,{children:c.jsx(p.TableCell,{colSpan:gt.length+(xt?1:0),align:"center",sx:{py:4},children:c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"No data matches the current filters"})})}):Oe?Ye.map((he,be)=>he.isGroupHeader?mt(he):Te(he,be)):Ye.map((he,be)=>Te(he,be))})]})}),we&&ut&&c.jsx(FC,{currentPage:ke,pageSize:pt,totalRows:He,onPageChange:we,onPageSizeChange:ut}),!(we&&ut)&&c.jsx(p.Box,{sx:{px:3,py:1.5,bgcolor:"action.hover",borderTop:1,borderColor:"divider"},children:c.jsxs(p.Typography,{variant:"body2",color:"text.secondary",children:["Showing ",Ye.length," ",Ye.length===1?"row":"rows"]})})]})]})})}function PC({schema:e,filters:t,onAddFilter:r,onRemoveFilter:n,onUpdateFilter:i,onClearAll:s,onClose:a,focusColumn:o}){const[f,u]=S.useState(""),[d,h]=S.useState(""),[m,l]=S.useState(""),[v,g]=S.useState(null);S.useEffect(()=>{o&&u(o)},[o]);const x=()=>{u(""),h(""),l(""),g(null)},T=L=>{const W=t[L];u(W.column),h(W.operator),l(W.value!==void 0?String(W.value):""),g(L)},b=e.filter(L=>L.type!=="mixed"&&L.type!=="null"&&L.type!=="array"&&L.type!=="object"),_=e.find(L=>L.name===f),k=_?Yl(_.type):[],F=()=>!(!f||!d||Ki(d)&&!m.trim()),z=()=>{if(!F())return;const L={column:f,operator:d};if(Ki(d)){const W=_==null?void 0:_.type;L.value=W==="number"?Number(m):m}v!==null?i(v,L):r(L),x()},N=L=>{var Q;const W=e.find(J=>J.name===L.column);if(!W)return"";const H=((Q=Yl(W.type).find(J=>J.value===L.operator))==null?void 0:Q.label)||L.operator;return Ki(L.operator)?`${L.column} ${H} "${L.value}"`:`${L.column} ${H}`},B=v!==null,M=()=>{if(B&&v!==null){const L=t[v];if(L)return`Filter ${L.column} Data`}return o?`Filter ${o} Data`:"Filter Column Data"};return c.jsxs(p.Dialog,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{maxHeight:"80vh",display:"flex",flexDirection:"column"}},children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:2},children:[c.jsx(p.Typography,{variant:"h6",children:M()}),c.jsx(p.IconButton,{onClick:a,size:"small",children:c.jsx(Et,{size:20})})]}),c.jsxs(p.DialogContent,{dividers:!0,sx:{flex:1,overflow:"auto"},children:[c.jsxs(p.Box,{sx:{mb:4},children:[c.jsx(p.Typography,{variant:"subtitle2",sx:{mb:2,fontWeight:600},children:B?"Edit Filter":"Add Filter"}),c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:2},children:[c.jsxs(p.FormControl,{size:"small",fullWidth:!0,children:[c.jsx(p.InputLabel,{children:"Column"}),c.jsxs(p.Select,{value:f,onChange:L=>{u(L.target.value),h(""),l("")},label:"Column",children:[c.jsx(p.MenuItem,{value:"",children:"Select column..."}),b.map(L=>c.jsxs(p.MenuItem,{value:L.name,children:[L.name," (",L.type,")"]},L.name))]})]}),f&&c.jsxs(p.FormControl,{size:"small",fullWidth:!0,children:[c.jsx(p.InputLabel,{children:"Operator"}),c.jsxs(p.Select,{value:d,onChange:L=>{h(L.target.value),l("")},label:"Operator",children:[c.jsx(p.MenuItem,{value:"",children:"Select operator..."}),k.map(L=>c.jsx(p.MenuItem,{value:L.value,children:L.label},L.value))]})]}),d&&Ki(d)&&c.jsx(p.TextField,{size:"small",fullWidth:!0,type:(_==null?void 0:_.type)==="number"?"number":"text",value:m,onChange:L=>l(L.target.value),label:"Value",placeholder:"Enter value..."}),c.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[c.jsx(p.Button,{onClick:z,disabled:!F(),variant:"contained",fullWidth:!0,startIcon:B?c.jsx(Ss,{size:16}):c.jsx(ti,{size:16}),children:B?"Update Filter":"Add Filter"}),B&&c.jsx(p.Button,{onClick:x,variant:"outlined",sx:{minWidth:100},children:"Cancel"})]})]})]}),c.jsxs(p.Box,{children:[c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[c.jsxs(p.Typography,{variant:"subtitle2",sx:{fontWeight:600},children:["Active Filters (",t.length,")"]}),t.length>0&&c.jsx(p.Button,{onClick:s,size:"small",color:"error",startIcon:c.jsx(Df,{size:14}),sx:{textTransform:"none"},children:"Clear All"})]}),t.length===0?c.jsx(p.Box,{sx:{py:2,textAlign:"center",border:1,borderColor:"divider",borderRadius:1,bgcolor:"action.hover"},children:c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"No filters applied"})}):c.jsx(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:t.map((L,W)=>c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,bgcolor:"primary.lighter",border:1,borderColor:"primary.light",borderRadius:1},children:[c.jsx(p.Typography,{variant:"body2",children:N(L)}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[c.jsx(p.IconButton,{onClick:()=>T(W),size:"small",color:"primary",title:"Edit filter",children:c.jsx(Ss,{size:16})}),c.jsx(p.IconButton,{onClick:()=>n(W),size:"small",sx:{"&:hover":{color:"error.main"}},title:"Delete filter",children:c.jsx(Et,{size:16})})]})]},W))})]})]}),c.jsx(p.DialogActions,{sx:{px:3,py:2},children:c.jsx(p.Button,{onClick:a,variant:"outlined",fullWidth:!0,children:"Close"})})]})}function jC({schema:e,sortStack:t,onUpdateSortStack:r,onClose:n}){const[i,s]=S.useState(""),[a,o]=S.useState("asc"),f=()=>!(t.length>=3||!i||t.some(x=>x.column===i)),u=()=>{if(!f())return;const x=t.length+1,T={column:i,direction:a,priority:x};r([...t,T]),s(""),o("asc")},d=x=>{const b=t.filter((_,k)=>k!==x).map((_,k)=>({..._,priority:k+1}));r(b)},h=x=>{const T=[...t];T[x]={...T[x],direction:T[x].direction==="asc"?"desc":"asc"},r(T)},m=()=>{r([])},l=x=>{if(x===0)return;const T=[...t];[T[x-1],T[x]]=[T[x],T[x-1]];const b=T.map((_,k)=>({..._,priority:k+1}));r(b)},v=x=>{if(x===t.length-1)return;const T=[...t];[T[x],T[x+1]]=[T[x+1],T[x]];const b=T.map((_,k)=>({..._,priority:k+1}));r(b)},g=e.filter(x=>!t.some(T=>T.column===x.name));return c.jsxs(p.Dialog,{open:!0,onClose:n,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{maxHeight:"80vh",display:"flex",flexDirection:"column"}},children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:2},children:[c.jsx(p.Typography,{variant:"h6",children:"Multi-Level Sort"}),c.jsx(p.IconButton,{onClick:n,size:"small",children:c.jsx(Et,{size:20})})]}),c.jsxs(p.DialogContent,{dividers:!0,sx:{flex:1,overflow:"auto"},children:[c.jsxs(p.Box,{sx:{mb:4},children:[c.jsx(p.Typography,{variant:"subtitle2",sx:{mb:2,fontWeight:600},children:"Select column for sorting (Primary, Secondary, Tertiary)"}),c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:2},children:[c.jsxs(p.FormControl,{size:"small",fullWidth:!0,disabled:t.length>=3,children:[c.jsx(p.InputLabel,{children:"Column"}),c.jsxs(p.Select,{value:i,onChange:x=>s(x.target.value),label:"Column",children:[c.jsx(p.MenuItem,{value:"",children:"Select column..."}),g.map(x=>c.jsxs(p.MenuItem,{value:x.name,children:[x.name," (",x.type,")"]},x.name))]})]}),c.jsx(p.Button,{onClick:u,disabled:!f(),variant:"contained",fullWidth:!0,startIcon:c.jsx(ti,{size:16}),children:"Add Sort Column"})]})]}),c.jsxs(p.Box,{children:[c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[c.jsxs(p.Typography,{variant:"subtitle2",sx:{fontWeight:600},children:["Sorted Column Sequence (",t.length,"/3)"]}),t.length>0&&c.jsx(p.Button,{onClick:m,size:"small",color:"error",startIcon:c.jsx(En,{size:14}),sx:{textTransform:"none"},children:"Clear All"})]}),t.length===0?c.jsx(p.Box,{sx:{py:2,textAlign:"center",border:1,borderColor:"divider",borderRadius:1,bgcolor:"action.hover"},children:c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"No sorting applied"})}):c.jsx(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:t.map((x,T)=>c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:2,px:2,py:1.5,bgcolor:"primary.lighter",border:1,borderColor:"primary.light",borderRadius:1},children:[c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.jsx(p.Chip,{label:x.priority,size:"small",color:"primary",sx:{width:24,height:24,fontSize:"0.75rem",fontWeight:700}}),c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[c.jsx(p.IconButton,{onClick:()=>l(T),disabled:T===0,size:"small",sx:{p:0,width:16,height:16},children:c.jsx(Ma,{size:12})}),c.jsx(p.IconButton,{onClick:()=>v(T),disabled:T===t.length-1,size:"small",sx:{p:0,width:16,height:16,transform:"rotate(180deg)"},children:c.jsx(Ma,{size:12})})]})]}),c.jsxs(p.Box,{sx:{flex:1},children:[c.jsx(p.Typography,{variant:"body2",component:"span",sx:{fontWeight:500},children:x.column}),c.jsxs(p.Typography,{variant:"caption",component:"span",color:"text.secondary",sx:{ml:1},children:["(",x.direction==="asc"?"Ascending":"Descending",")"]})]}),c.jsx(p.IconButton,{onClick:()=>h(T),size:"small",color:"primary",title:"Toggle direction",children:c.jsx(ko,{size:16})}),c.jsx(p.IconButton,{onClick:()=>d(T),size:"small",sx:{"&:hover":{color:"error.main"}},children:c.jsx(Et,{size:16})})]},T))})]})]}),c.jsx(p.DialogActions,{sx:{px:3,py:2},children:c.jsx(p.Button,{onClick:n,variant:"outlined",fullWidth:!0,children:"Close"})})]})}function MC({views:e,activeViewId:t,onSelectView:r,onCreateView:n,onEditView:i,onDeleteView:s,onRestoreView:a,onPermanentDelete:o,onClose:f}){return c.jsxs(p.Dialog,{open:!0,onClose:f,maxWidth:"md",fullWidth:!0,children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:["Manage Views",c.jsx(p.IconButton,{onClick:f,size:"small",sx:{color:"text.secondary"},children:c.jsx(Et,{size:20})})]}),c.jsxs(p.DialogContent,{children:[c.jsx(p.Box,{sx:{mb:2},children:c.jsx(p.Button,{onClick:n,variant:"contained",startIcon:c.jsx(ti,{size:16}),size:"small",children:"Create New Report View"})}),c.jsx(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.map(u=>c.jsx(p.Paper,{sx:{p:2,border:1,borderColor:u.isDeleted?"error.light":t===u.id?"primary.main":"divider",bgcolor:u.isDeleted?"error.lighter":t===u.id?"primary.lighter":"background.paper",opacity:u.isDeleted?.75:1,cursor:u.isDeleted?"default":"pointer","&:hover":u.isDeleted?{}:{bgcolor:"action.hover"}},onClick:()=>!u.isDeleted&&r(u.id),elevation:0,children:c.jsxs(p.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsxs(p.Box,{sx:{flex:1},children:[c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500,textDecoration:u.isDeleted?"line-through":"none",color:u.isDeleted?"text.secondary":"text.primary"},children:u.name}),u.isDeleted&&c.jsx(p.Chip,{label:"Deleted",size:"small",color:"error",sx:{height:20}}),u.isDefault&&c.jsx(p.Chip,{label:"Default",size:"small",color:"primary",sx:{height:20}}),u.isFavorite&&c.jsx(p.Chip,{label:"★ Favorite",size:"small",sx:{height:20}})]}),u.description&&c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:u.description})]}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[!u.isDeleted&&c.jsxs(c.Fragment,{children:[c.jsx(p.IconButton,{size:"small",onClick:d=>{d.stopPropagation(),i(u.id)},title:"Edit view",children:c.jsx(Ss,{size:16})}),c.jsx(p.IconButton,{size:"small",onClick:d=>{d.stopPropagation(),s(u.id)},title:"Delete view",sx:{"&:hover":{color:"error.main"}},children:c.jsx(En,{size:16})})]}),u.isDeleted&&a&&c.jsx(p.IconButton,{size:"small",onClick:d=>{d.stopPropagation(),a(u.id)},title:"Restore view",sx:{color:"success.main"},children:c.jsx(Ys,{size:16})}),u.isDeleted&&o&&c.jsx(p.IconButton,{size:"small",onClick:d=>{d.stopPropagation(),o(u.id)},title:"Delete permanently",sx:{color:"error.main"},children:c.jsx(En,{size:16})})]})]})},u.id))})]}),c.jsx(p.DialogActions,{sx:{px:3,pb:2},children:c.jsx(p.Button,{onClick:f,variant:"outlined",children:"Close"})})]})}function Kc({currentSnapshot:e,onSave:t,onClose:r,isEditMode:n=!1,initialName:i="",initialDescription:s="",initialIsDefault:a=!1}){const[o,f]=S.useState(i),[u,d]=S.useState(s),[h,m]=S.useState(a),l=()=>{o.trim()&&(t(o.trim(),u.trim(),h),r())},v=x=>{x.key==="Enter"&&!x.shiftKey?l():x.key==="Escape"&&r()},g=()=>n&&i?`Update ${i} view`:"Create New Report View";return c.jsxs(p.Dialog,{open:!0,onClose:r,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:[g(),c.jsx(p.IconButton,{onClick:r,size:"small",sx:{color:"text.secondary"},children:c.jsx(Et,{size:20})})]}),c.jsx(p.DialogContent,{children:c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[c.jsx(p.TextField,{label:"View Name",required:!0,value:o,onChange:x=>f(x.target.value),onKeyDown:v,placeholder:"e.g., Active Users",autoFocus:!0,fullWidth:!0,size:"small"}),c.jsx(p.TextField,{label:"Description (optional)",value:u,onChange:x=>d(x.target.value),placeholder:"Brief description of this view",multiline:!0,rows:2,fullWidth:!0,size:"small"}),c.jsxs(p.Paper,{sx:{p:2,bgcolor:"action.hover"},variant:"outlined",children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500,mb:1},children:"This view will capture:"}),c.jsxs(p.Box,{component:"ul",sx:{m:0,pl:2,"& li":{fontSize:"0.875rem",color:"text.secondary"}},children:[c.jsxs("li",{children:[e.filters.length," filter",e.filters.length!==1?"s":""]}),c.jsxs("li",{children:["Sorting: ",Qd(e.sortStack)]}),c.jsx("li",{children:"Column order & visibility"})]})]}),!n&&c.jsx(p.FormControlLabel,{control:c.jsx(p.Checkbox,{checked:h,onChange:x=>m(x.target.checked),size:"small"}),label:c.jsx(p.Typography,{variant:"body2",children:"Set as default view"})})]})}),c.jsxs(p.DialogActions,{sx:{px:3,pb:2},children:[c.jsx(p.Button,{onClick:r,variant:"outlined",color:"inherit",children:"Cancel"}),c.jsx(p.Button,{onClick:l,disabled:!o.trim(),variant:"contained",startIcon:c.jsx(Xs,{size:16}),children:n?"Save Changes":"Create Report View"})]})]})}function LC({viewName:e,onConfirm:t,onCancel:r}){return c.jsxs(p.Dialog,{open:!0,onClose:r,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:["Delete View",c.jsx(p.IconButton,{onClick:r,size:"small",sx:{color:"text.secondary"},children:c.jsx(Et,{size:20})})]}),c.jsx(p.DialogContent,{children:c.jsxs(p.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5,mt:1},children:[c.jsx(kn,{size:20,color:"error",style:{flexShrink:0,marginTop:2}}),c.jsxs(p.Box,{children:[c.jsxs(p.Typography,{variant:"body2",sx:{mb:1},children:["Are you sure you want to delete the view ",c.jsxs("strong",{children:['"',e,'"']}),"?"]}),c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"This action cannot be undone."})]})]})}),c.jsxs(p.DialogActions,{sx:{px:3,pb:2},children:[c.jsx(p.Button,{onClick:r,variant:"outlined",color:"inherit",children:"Cancel"}),c.jsx(p.Button,{onClick:t,variant:"contained",color:"error",children:"Delete View"})]})]})}const qc=80,Jc=600,Zc="COLUMN";function BC({column:e,index:t,isVisible:r,width:n,onToggleVisibility:i,onWidthChange:s,moveColumn:a}){const o=S.useRef(null),[f,u]=S.useState(n.toString()),[{handlerId:d},h]=Gf({accept:Zc,collect(T){return{handlerId:T.getHandlerId()}},hover(T,b){var M;if(!o.current)return;const _=T.index,k=t;if(_===k)return;const F=(M=o.current)==null?void 0:M.getBoundingClientRect(),z=(F.bottom-F.top)/2,N=b.getClientOffset(),B=((N==null?void 0:N.y)??0)-F.top;_<k&&B<z||_>k&&B>z||(a(_,k),T.index=k)}}),[{isDragging:m},l]=Hf({type:Zc,item:()=>({index:t}),collect:T=>({isDragging:T.isDragging()})});l(h(o));const v=()=>{const T=parseInt(f);if(isNaN(T)){u(n.toString());return}const b=Math.max(qc,Math.min(Jc,T));u(b.toString()),s(e.name,b)},g=T=>{(T===""||/^\d+$/.test(T))&&u(T)},x=T=>({string:"primary",number:"success",boolean:"secondary",array:"warning",object:"error",null:"default",mixed:"default"})[T]||"default";return c.jsxs(p.TableRow,{ref:o,"data-handler-id":d,sx:{opacity:m?.5:1,"&:hover":{bgcolor:"action.hover"},cursor:"move"},children:[c.jsx(p.TableCell,{children:c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.jsx(p.Box,{sx:{color:"text.secondary",cursor:"grab","&:active":{cursor:"grabbing"}},children:c.jsx(Ma,{size:16})}),c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:e.name})]})}),c.jsx(p.TableCell,{children:c.jsx(p.Chip,{label:e.type.toUpperCase(),size:"small",color:x(e.type),sx:{height:20,fontSize:"0.7rem",fontWeight:600}})}),c.jsxs(p.TableCell,{children:[c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.jsx(p.TextField,{type:"text",value:f,onChange:T=>g(T.target.value),onBlur:v,placeholder:"150",size:"small",sx:{width:80},InputProps:{sx:{fontSize:"0.875rem"}}}),c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:"px"})]}),c.jsxs(p.Typography,{variant:"caption",color:"text.disabled",sx:{mt:.5,display:"block"},children:["min: ",qc,", max: ",Jc]})]}),c.jsx(p.TableCell,{children:c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.jsx(p.IconButton,{onClick:()=>i(e.name,!r),title:r?"Hide column":"Show column",size:"small",children:r?c.jsx(Fo,{size:16}):c.jsx(Af,{size:16,style:{opacity:.4}})}),c.jsx(p.Chip,{label:r?"Active":"Hidden",size:"small",color:r?"success":"default",sx:{height:20,fontSize:"0.7rem"}})]})})]})}function $C({schema:e,columnVisibility:t,columnOrder:r,columnWidths:n={},views:i=[],activeViewId:s="",onUpdateColumnVisibility:a,onUpdateColumnOrder:o,onUpdateColumnWidth:f,onResetLayout:u,onSaveToCurrentView:d,onSaveToAllViews:h,onSelectView:m,onClose:l}){const[v,g]=S.useState(!1),[x,T]=S.useState(r),[b,_]=S.useState("all"),[k,F]=S.useState(null),z=(J,ee)=>{const _e=[...x],[Ae]=_e.splice(J,1);_e.splice(ee,0,Ae),T(_e),o(_e)},N=()=>{u(),g(!1)},M=x.map(J=>e.find(ee=>ee.name===J)).filter(J=>J!==void 0).filter(J=>{const ee=t[J.name]??!0;return b==="active"?ee:b==="hidden"?!ee:!0}),L=Object.values(t).filter(J=>J).length,W=e.length,y=i.find(J=>J.id===s),H=i.filter(J=>!J.isDeleted),Q=S.useMemo(()=>{if(!y)return!1;const J=y.snapshot,ee=JSON.stringify(t)!==JSON.stringify(J.columnVisibility),_e=JSON.stringify(r)!==JSON.stringify(J.columnOrder),Ae=JSON.stringify(n)!==JSON.stringify(J.columnWidths);return ee||_e||Ae},[y,t,r,n]);return c.jsx($f,{backend:ed,children:c.jsxs(p.Dialog,{open:!0,onClose:l,maxWidth:"lg",fullWidth:!0,children:[c.jsxs(p.DialogTitle,{children:[c.jsxs(p.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[c.jsxs(p.Box,{sx:{flex:1},children:[c.jsx(p.Typography,{variant:"h6",children:"Manage Columns"}),c.jsxs(p.Typography,{variant:"body2",color:"text.secondary",children:[L," of ",W," columns visible • Drag to reorder"]})]}),H.length>0&&m&&c.jsxs(p.Box,{sx:{ml:2},children:[c.jsx(p.Typography,{variant:"caption",color:"text.secondary",sx:{mb:.5,display:"block"},children:"View:"}),c.jsx(p.Button,{onClick:J=>F(J.currentTarget),variant:"outlined",size:"small",endIcon:c.jsx(Mi,{size:16}),sx:{minWidth:180,justifyContent:"space-between"},children:c.jsx(p.Box,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:(y==null?void 0:y.name)||"Select View"})}),c.jsx(p.Menu,{anchorEl:k,open:!!k,onClose:()=>F(null),children:H.map(J=>c.jsx(p.MenuItem,{onClick:()=>{m(J.id),F(null)},selected:J.id===s,children:J.name},J.id))})]}),c.jsx(p.IconButton,{onClick:l,size:"small",sx:{ml:2,color:"text.secondary"},children:c.jsx(Et,{size:20})})]}),c.jsxs(p.Tabs,{value:b,onChange:(J,ee)=>_(ee),sx:{mt:2},children:[c.jsx(p.Tab,{label:"All",value:"all"}),c.jsx(p.Tab,{label:"Active",value:"active"}),c.jsx(p.Tab,{label:"Hidden",value:"hidden"})]})]}),c.jsx(p.DialogContent,{dividers:!0,sx:{p:0,overflow:"hidden"},children:c.jsx(p.Box,{sx:{overflow:"auto",maxHeight:"60vh"},children:c.jsxs(p.Table,{stickyHeader:!0,children:[c.jsx(p.TableHead,{children:c.jsxs(p.TableRow,{children:[c.jsx(p.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Column Name"}),c.jsx(p.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Type"}),c.jsx(p.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Width"}),c.jsx(p.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Visibility"})]})}),c.jsx(p.TableBody,{children:M.length===0?c.jsx(p.TableRow,{children:c.jsx(p.TableCell,{colSpan:4,align:"center",children:c.jsx(p.Typography,{variant:"body2",color:"text.secondary",sx:{py:4},children:"No columns in this category"})})}):M.map((J,ee)=>c.jsx(BC,{column:J,index:ee,isVisible:t[J.name]??!0,width:n[J.name]||150,onToggleVisibility:a,onWidthChange:f||(()=>{}),moveColumn:z},J.name))})]})})}),c.jsxs(p.DialogActions,{sx:{px:3,pb:2,justifyContent:"space-between",flexWrap:"wrap"},children:[c.jsx(p.Button,{onClick:()=>g(!0),disabled:!Q,variant:"outlined",color:"inherit",startIcon:c.jsx(Ys,{size:16}),size:"small",children:"Reset to Default Layout"}),c.jsxs(p.Stack,{direction:"row",spacing:1.5,children:[c.jsx(p.Button,{onClick:l,variant:"outlined",color:"inherit",size:"small",children:"Cancel"}),d&&c.jsx(p.Button,{onClick:()=>{d(),l()},disabled:!Q,variant:"contained",startIcon:c.jsx(Xs,{size:16}),size:"small",children:"Save to Current View"}),h&&c.jsx(p.Button,{onClick:()=>{h(),l()},disabled:!Q,variant:"contained",color:"success",startIcon:c.jsx(LE,{size:16}),size:"small",children:"Save to All Views"})]})]}),v&&c.jsxs(p.Dialog,{open:!0,onClose:()=>g(!1),maxWidth:"xs",children:[c.jsx(p.DialogTitle,{children:"Reset column layout?"}),c.jsx(p.DialogContent,{children:c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"This will restore default visibility, order, and widths for all columns."})}),c.jsxs(p.DialogActions,{children:[c.jsx(p.Button,{onClick:()=>g(!1),variant:"outlined",color:"inherit",children:"Cancel"}),c.jsx(p.Button,{onClick:N,variant:"contained",color:"error",children:"Reset Layout"})]})]})]})})}function td({content:e,type:t="tooltip",className:r=""}){const[n,i]=S.useState(null),s=!!n;return t==="popover"?c.jsxs(c.Fragment,{children:[c.jsx(p.IconButton,{onClick:a=>{a.preventDefault(),a.stopPropagation(),i(a.currentTarget)},size:"small","aria-label":"More information",sx:{width:16,height:16,color:"primary.main","&:hover":{bgcolor:"primary.lighter"}},className:r,children:c.jsx(Ai,{size:16})}),c.jsx(p.Popover,{open:s,anchorEl:n,onClose:()=>i(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{mt:1},children:c.jsx(p.Box,{sx:{p:2,maxWidth:288},children:c.jsx(p.Typography,{variant:"body2",sx:{lineHeight:1.6},children:e})})})]}):c.jsx(p.Tooltip,{title:e,placement:"top",arrow:!0,children:c.jsx(p.IconButton,{size:"small","aria-label":"More information",onClick:a=>{a.preventDefault(),a.stopPropagation()},sx:{width:16,height:16,color:"primary.main","&:hover":{bgcolor:"primary.lighter"}},className:r,children:c.jsx(Ai,{size:16})})})}function UC({schema:e,grouping:t,onApply:r,onClose:n}){var k;const[i,s]=S.useState(t||{enabled:!1,levels:[],collapsedGroups:[]}),[a,o]=S.useState(""),[f,u]=S.useState(null),d=Hd(e),h=d.filter(F=>!i.levels.some((z,N)=>z.column===F.name&&N!==f)),m=i.levels.length<3&&h.length>0,l=()=>{!m||!a||(s({...i,levels:[...i.levels,{column:a}],enabled:!0}),o(""))},v=F=>{const z=i.levels.filter((N,B)=>B!==F);if(z.length===0){r(null),n();return}s({...i,levels:z,enabled:z.length>0})},g=()=>{if(f===null||!a)return;const F=[...i.levels];F[f]={column:a},s({...i,levels:F}),u(null),o("")},x=()=>{u(null),o("")},T=(F,z)=>{const N=z==="up"?F-1:F+1;if(N<0||N>=i.levels.length)return;const B=[...i.levels],[M]=B.splice(F,1);B.splice(N,0,M),s({...i,levels:B})},b=()=>{r(null),n()},_=()=>{i.levels.length===0?r(null):r({...i,enabled:!0,collapsedGroups:(t==null?void 0:t.collapsedGroups)||[]}),n()};return c.jsxs(p.Dialog,{open:!0,onClose:n,maxWidth:"md",fullWidth:!0,children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",gap:1,pb:1},children:["Group Configuration",c.jsx(td,{content:"Group rows by column values. Maximum 3 group levels allowed. Only STRING and BOOLEAN columns can be used for grouping.",type:"popover"}),c.jsx(p.IconButton,{onClick:n,size:"small",sx:{ml:"auto",color:"text.secondary"},children:c.jsx(Et,{size:20})})]}),c.jsx(p.DialogContent,{dividers:!0,children:c.jsxs(p.Stack,{spacing:3,sx:{py:1},children:[f===null&&c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500,mb:1.5},children:"Add Group Level"}),c.jsx(p.FormControl,{fullWidth:!0,size:"small",sx:{mb:1.5},children:c.jsxs(p.Select,{value:a,onChange:F=>o(F.target.value),disabled:!m,displayEmpty:!0,children:[c.jsx(p.MenuItem,{value:"",children:"Select a column..."}),h.map(F=>c.jsxs(p.MenuItem,{value:F.name,children:[F.name," (",F.type.toUpperCase(),")"]},F.name))]})}),c.jsx(p.Button,{onClick:l,disabled:!m||!a,variant:"outlined",startIcon:c.jsx(ti,{size:16}),fullWidth:!0,children:"Add Group Level"}),i.levels.length===3&&c.jsx(p.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",textAlign:"center",mt:1},children:"Maximum group levels (3) reached"}),d.length===0&&c.jsx(p.Typography,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",py:2},children:"No groupable columns available. Only STRING and BOOLEAN columns can be grouped."})]}),f!==null&&c.jsxs(p.Alert,{severity:"warning",sx:{mb:2},children:[c.jsxs(p.Typography,{variant:"body2",sx:{fontWeight:500,mb:1},children:["Edit Group Level ",f+1]}),c.jsx(p.FormControl,{fullWidth:!0,size:"small",sx:{mb:1.5},children:c.jsxs(p.Select,{value:a,onChange:F=>o(F.target.value),children:[c.jsx(p.MenuItem,{value:"",children:"Select a column..."}),c.jsxs(p.MenuItem,{value:i.levels[f].column,children:[i.levels[f].column," (",(k=e.find(F=>F.name===i.levels[f].column))==null?void 0:k.type.toUpperCase(),")"]}),h.filter(F=>F.name!==i.levels[f].column).map(F=>c.jsxs(p.MenuItem,{value:F.name,children:[F.name," (",F.type.toUpperCase(),")"]},F.name))]})}),c.jsxs(p.Stack,{direction:"row",spacing:1,children:[c.jsx(p.Button,{onClick:g,disabled:!a,variant:"contained",color:"warning",fullWidth:!0,size:"small",children:"Save"}),c.jsx(p.Button,{onClick:x,variant:"outlined",color:"inherit",fullWidth:!0,size:"small",children:"Cancel"})]})]}),i.levels.length>0&&f===null&&c.jsxs(p.Box,{children:[c.jsxs(p.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1.5},children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:"Active Group Levels"}),c.jsx(p.Button,{onClick:b,size:"small",color:"error",sx:{fontSize:"0.75rem",textTransform:"none"},children:"Clear All"})]}),c.jsx(p.Stack,{spacing:1.5,children:i.levels.map((F,z)=>{const N=e.find(B=>B.name===F.column);return c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1.5,p:2,border:1,borderColor:"divider",borderRadius:1,bgcolor:"background.paper"},children:[c.jsx(p.Chip,{label:`L${z+1}`,size:"small",color:"primary",sx:{width:40,fontWeight:600}}),c.jsxs(p.Box,{sx:{flex:1},children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:F.column}),c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:N==null?void 0:N.type.toUpperCase()})]}),c.jsxs(p.Stack,{direction:"row",spacing:.5,children:[c.jsx(p.IconButton,{size:"small",onClick:()=>T(z,"up"),disabled:z===0,children:c.jsx(cE,{size:16})}),c.jsx(p.IconButton,{size:"small",onClick:()=>T(z,"down"),disabled:z===i.levels.length-1,children:c.jsx(Mi,{size:16})}),c.jsx(p.IconButton,{size:"small",onClick:()=>handleEditLevel(z),children:c.jsx(Ss,{size:16})}),c.jsx(p.IconButton,{size:"small",onClick:()=>v(z),sx:{color:"error.main"},children:c.jsx(En,{size:16})})]})]},z)})})]})]})}),c.jsxs(p.DialogActions,{sx:{px:3,pb:2},children:[c.jsx(p.Button,{onClick:n,variant:"outlined",color:"inherit",children:"Cancel"}),c.jsx(p.Button,{onClick:_,variant:"contained",children:"Apply Grouping"})]})]})}const WC={filters:Gs,sorting:ko,visibility:Fo,order:Cf,widths:KE,grouping:kf};function VC({changes:e,onClose:t}){const r=n=>({filters:"primary",sorting:"secondary",visibility:"success",order:"warning",widths:"info",grouping:"error"})[n]||"default";return c.jsxs(p.Dialog,{open:!0,onClose:t,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:["View Changes Summary",c.jsx(p.IconButton,{onClick:t,size:"small",sx:{color:"text.secondary"},children:c.jsx(Et,{size:20})})]}),c.jsx(p.DialogContent,{dividers:!0,children:e.length===0?c.jsx(p.Box,{sx:{textAlign:"center",py:4},children:c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"No changes detected"})}):c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"The following modifications have been made to this view:"}),c.jsx(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:e.map((n,i)=>{const s=WC[n.category];return c.jsxs(p.Paper,{elevation:0,sx:{display:"flex",gap:1.5,p:1.5,border:1,borderColor:"divider",borderRadius:1},children:[c.jsx(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:1,bgcolor:`${r(n.category)}.lighter`,color:`${r(n.category)}.main`,flexShrink:0},children:c.jsx(s,{size:16})}),c.jsxs(p.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:n.label}),c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:n.description})]})]},i)})})]})}),c.jsx(p.DialogActions,{sx:{px:3,pb:2,bgcolor:"action.hover"},children:c.jsx(p.Button,{onClick:t,variant:"outlined",color:"inherit",children:"Close"})})]})}function zC({viewName:e,isDefaultView:t,changes:r=[],onSaveToCurrentView:n,onSaveAsNewView:i,onCancel:s}){const[a,o]=S.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsx(p.Box,{sx:{position:"sticky",bottom:0,width:"100%",bgcolor:"background.paper",borderTop:1,borderColor:"divider",boxShadow:4,zIndex:10},children:c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:2},children:[c.jsxs(p.Typography,{variant:"body2",sx:{fontWeight:500},children:['Unsaved changes to "',e,'"']}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[!t&&n&&c.jsx(p.Button,{onClick:n,variant:"contained",startIcon:c.jsx(Xs,{size:16}),size:"small",children:"Save to Current View"}),c.jsx(p.Button,{onClick:i,variant:"contained",color:"success",startIcon:c.jsx(OE,{size:16}),size:"small",children:"Save as New View"}),c.jsx(p.IconButton,{onClick:s,title:"Revert changes",size:"small",children:c.jsx(Et,{size:20})}),r.length>0&&c.jsx(p.IconButton,{onClick:()=>o(!0),title:"View changes summary",size:"small",children:c.jsx(hE,{size:20})})]})]})}),a&&c.jsx(VC,{changes:r,onClose:()=>o(!1)})]})}function HC({onExportAnyway:e,onSaveAndExport:t,onCancel:r}){return c.jsx(p.Box,{sx:{mb:2},children:c.jsxs(p.Alert,{severity:"warning",icon:c.jsx(kn,{size:20}),action:c.jsx(p.IconButton,{size:"small",onClick:r,sx:{color:"warning.main"},children:c.jsx(Et,{size:20})}),sx:{alignItems:"flex-start"},children:[c.jsx(p.Typography,{variant:"subtitle2",sx:{fontWeight:600,mb:.5},children:"You are exporting with unsaved view changes"}),c.jsx(p.Typography,{variant:"body2",sx:{mb:1.5},children:"Your current view has unsaved changes. Choose how to proceed:"}),c.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[c.jsx(p.Button,{onClick:t,variant:"contained",color:"primary",startIcon:c.jsx(Xs,{size:14}),size:"small",children:"Save View & Export"}),c.jsx(p.Button,{onClick:e,variant:"contained",color:"warning",startIcon:c.jsx(Io,{size:14}),size:"small",children:"Export Anyway"})]})]})})}function GC({auditHistory:e,onClose:t}){const[r,n]=S.useState(new Set),i=a=>{n(o=>{const f=new Set(o);return f.has(a)?f.delete(a):f.add(a),f})},s=[...e].sort((a,o)=>new Date(o.timestamp).getTime()-new Date(a.timestamp).getTime());return c.jsxs(p.Dialog,{open:!0,onClose:t,maxWidth:"lg",fullWidth:!0,children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:[c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"h6",children:"Audit History"}),c.jsxs(p.Typography,{variant:"caption",color:"text.secondary",children:[s.length," event",s.length!==1?"s":""," recorded"]})]}),c.jsx(p.IconButton,{onClick:t,size:"small",sx:{color:"text.secondary"},children:c.jsx(Et,{size:20})})]}),c.jsx(p.DialogContent,{sx:{pt:2},children:s.length===0?c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",py:6,textAlign:"center"},children:[c.jsx(Ic,{size:48,style:{opacity:.3,marginBottom:12}}),c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"No audit events recorded yet"}),c.jsx(p.Typography,{variant:"caption",color:"text.disabled",sx:{mt:.5},children:"Changes to this report will appear here"})]}):c.jsx(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:s.map(a=>{const o=r.has(a.id);return n2(a.feature),c.jsxs(p.Paper,{variant:"outlined",children:[c.jsxs(p.Box,{onClick:()=>i(a.id),sx:{px:2,py:1.5,display:"flex",alignItems:"center",gap:1.5,cursor:"pointer","&:hover":{bgcolor:"action.hover"}},children:[c.jsx(p.Box,{sx:{flexShrink:0},children:o?c.jsx(Mi,{size:16,style:{opacity:.5}}):c.jsx(Hs,{size:16,style:{opacity:.5}})}),c.jsx(p.Chip,{label:r2(a.feature),size:"small",sx:{height:20,fontSize:"0.75rem"}}),c.jsx(p.Typography,{variant:"body2",sx:{flex:1,fontWeight:500},children:t2(a.action)}),c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexShrink:0},children:[c.jsx(Ic,{size:14,style:{opacity:.4}}),c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:i2(a.timestamp)})]}),a.user&&c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexShrink:0},children:[c.jsx(o_,{size:14,style:{opacity:.4}}),c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:a.user})]})]}),c.jsx(p.Collapse,{in:o,children:c.jsxs(p.Box,{sx:{px:2,pb:2,pt:1,borderTop:1,borderColor:"divider",bgcolor:"action.hover"},children:[a.previousState&&c.jsxs(p.Box,{sx:{mb:2},children:[c.jsx(p.Typography,{variant:"caption",sx:{fontWeight:600,color:"text.secondary",textTransform:"uppercase",mb:.5,display:"block"},children:"Previous State"}),c.jsx(p.Box,{component:"pre",sx:{fontSize:"0.75rem",bgcolor:"background.paper",border:1,borderColor:"divider",borderRadius:1,p:1,overflow:"auto",maxHeight:200},children:Ul(a.previousState)})]}),a.newState&&c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"caption",sx:{fontWeight:600,color:"text.secondary",textTransform:"uppercase",mb:.5,display:"block"},children:"New State"}),c.jsx(p.Box,{component:"pre",sx:{fontSize:"0.75rem",bgcolor:"background.paper",border:1,borderColor:"divider",borderRadius:1,p:1,overflow:"auto",maxHeight:200},children:Ul(a.newState)})]})]})})]},a.id)})})})]})}function YC({onSave:e,onClose:t}){const[r,n]=S.useState(""),[i,s]=S.useState(""),[a,o]=S.useState(""),f=()=>{if(!r.trim()){o("Preset name is required");return}e(r.trim(),i.trim())},u=d=>{n(d),a&&o("")};return c.jsxs(p.Dialog,{open:!0,onClose:t,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:[c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.jsx(p.Typography,{variant:"h6",children:"Create Shareable Report Preset"}),c.jsx(td,{content:"This preset will capture filters, sorting, grouping, column configuration, and the active view. The actual data is not saved or shared.",type:"popover"})]}),c.jsx(p.IconButton,{onClick:t,size:"small",sx:{color:"text.secondary"},children:c.jsx(Et,{size:20})})]}),c.jsx(p.DialogContent,{children:c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"Save the current report configuration and generate a shareable link that others can use to view the same filters, sorting, and column layout."}),c.jsx(p.TextField,{label:"Preset Name",required:!0,value:r,onChange:d=>u(d.target.value),placeholder:"e.g., Q4 Active Users Report",error:!!a,helperText:a,autoFocus:!0,fullWidth:!0,size:"small"}),c.jsx(p.TextField,{label:"Description (optional)",value:i,onChange:d=>s(d.target.value),placeholder:"Briefly describe what this preset shows...",multiline:!0,rows:3,fullWidth:!0,size:"small"})]})}),c.jsxs(p.DialogActions,{sx:{px:3,pb:2,bgcolor:"action.hover"},children:[c.jsx(p.Button,{onClick:t,variant:"outlined",color:"inherit",children:"Cancel"}),c.jsx(p.Button,{onClick:f,variant:"contained",children:"Create & Share"})]})]})}function XC({presetName:e,shareUrl:t,onCopyLink:r,onOpenPreset:n,onDeletePreset:i,onClose:s}){const[a,o]=S.useState(!1),f=()=>{r(),o(!0),setTimeout(()=>o(!1),2e3)};return c.jsxs(p.Dialog,{open:!0,onClose:s,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:[c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"h6",children:"Shareable Link Generated"}),c.jsxs(p.Typography,{variant:"caption",color:"text.secondary",children:["Preset: ",e]})]}),c.jsx(p.IconButton,{onClick:s,size:"small",sx:{color:"text.secondary"},children:c.jsx(Et,{size:20})})]}),c.jsx(p.DialogContent,{children:c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[c.jsxs(p.Alert,{severity:"success",icon:c.jsx(ja,{size:20}),children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:"Preset created successfully!"}),c.jsx(p.Typography,{variant:"body2",sx:{mt:.5},children:"Share the link below with anyone who needs access to this report configuration."})]}),c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500,mb:1},children:"Shareable URL"}),c.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[c.jsx(p.TextField,{value:t,size:"small",fullWidth:!0,InputProps:{readOnly:!0},onClick:u=>u.target.select(),sx:{"& .MuiInputBase-input":{bgcolor:"action.hover"}}}),c.jsx(p.Button,{onClick:f,variant:"contained",color:a?"success":"primary",startIcon:a?c.jsx(ja,{size:16}):c.jsx(TE,{size:16}),sx:{minWidth:100},children:a?"Copied!":"Copy"})]})]}),c.jsxs(p.Box,{sx:{display:"flex",gap:1.5},children:[c.jsx(p.Button,{onClick:n,variant:"outlined",startIcon:c.jsx(_E,{size:16}),fullWidth:!0,children:"Open Link"}),c.jsx(p.Button,{onClick:i,variant:"outlined",color:"error",startIcon:c.jsx(En,{size:16}),fullWidth:!0,children:"Delete Preset"})]})]})}),c.jsx(p.DialogActions,{sx:{px:3,pb:2},children:c.jsx(p.Button,{onClick:s,variant:"contained",children:"Done"})})]})}function KC({presetName:e,onClear:t}){return c.jsx(p.Chip,{icon:c.jsx($E,{size:14}),label:c.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:["Preset: ",c.jsx(p.Box,{component:"span",sx:{fontWeight:600},children:e})]}),onDelete:t,deleteIcon:c.jsx(p.IconButton,{size:"small",title:"Exit preset view",sx:{p:0},children:c.jsx(Et,{size:14})}),sx:{bgcolor:"primary.lighter",borderColor:"primary.light",border:1,fontSize:"0.875rem",fontWeight:500,"& .MuiChip-deleteIcon":{color:"primary.main","&:hover":{color:"primary.dark"}}}})}function qC({totalRows:e,visibleRows:t,hasGrouping:r,visibleColumnsCount:n,totalColumnsCount:i,onExport:s,onClose:a}){const[o,f]=S.useState("csv"),[u,d]=S.useState("visible"),[h,m]=S.useState("visible"),l=e>5e4,v=u==="visible"?t:e,g=h==="visible"?n:i,x=()=>{s({format:o,scope:u,columnScope:h}),a()},T={csv:"CSV",excel:"Excel (.xlsx)",json:"JSON"};return c.jsxs(p.Dialog,{open:!0,onClose:a,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(p.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:["Export Report",c.jsx(p.IconButton,{onClick:a,size:"small",sx:{color:"text.secondary"},children:c.jsx(Et,{size:20})})]}),c.jsx(p.DialogContent,{children:c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:3,pt:1},children:[l&&c.jsxs(p.Alert,{severity:"warning",icon:c.jsx(kn,{size:20}),children:[c.jsx(p.AlertTitle,{children:"Large Dataset Warning"}),"This export contains over 50,000 rows. Processing may take a few moments."]}),c.jsxs(p.FormControl,{component:"fieldset",children:[c.jsx(p.FormLabel,{component:"legend",sx:{mb:1},children:"Format"}),c.jsxs(p.RadioGroup,{value:o,onChange:b=>f(b.target.value),children:[c.jsx(p.FormControlLabel,{value:"csv",control:c.jsx(p.Radio,{size:"small"}),label:c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:"CSV"}),c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:"Comma-separated values, compatible with Excel"})]}),sx:{mb:1,alignItems:"flex-start"}}),c.jsx(p.FormControlLabel,{value:"excel",control:c.jsx(p.Radio,{size:"small"}),label:c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:"Excel (.xlsx)"}),c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:"Native Excel format with formatting support"})]}),sx:{mb:1,alignItems:"flex-start"}}),c.jsx(p.FormControlLabel,{value:"json",control:c.jsx(p.Radio,{size:"small"}),label:c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:"JSON"}),c.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:"Structured data with metadata and filters"})]}),sx:{alignItems:"flex-start"}})]})]}),c.jsxs(p.FormControl,{component:"fieldset",children:[c.jsx(p.FormLabel,{component:"legend",sx:{mb:1},children:"Rows"}),c.jsxs(p.RadioGroup,{value:u,onChange:b=>d(b.target.value),children:[c.jsx(p.FormControlLabel,{value:"visible",control:c.jsx(p.Radio,{size:"small"}),label:c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:"Visible Rows"}),c.jsxs(p.Typography,{variant:"caption",color:"text.secondary",children:["Export ",t.toLocaleString()," rows (filtered and searched)"]})]}),sx:{mb:1,alignItems:"flex-start"}}),c.jsx(p.FormControlLabel,{value:"all",control:c.jsx(p.Radio,{size:"small"}),label:c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:"All Rows"}),c.jsxs(p.Typography,{variant:"caption",color:"text.secondary",children:["Export ",e.toLocaleString()," rows (complete original dataset)"]})]}),sx:{alignItems:"flex-start"}})]})]}),c.jsxs(p.FormControl,{component:"fieldset",children:[c.jsx(p.FormLabel,{component:"legend",sx:{mb:1},children:"Columns"}),c.jsxs(p.RadioGroup,{value:h,onChange:b=>m(b.target.value),children:[c.jsx(p.FormControlLabel,{value:"visible",control:c.jsx(p.Radio,{size:"small"}),label:c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:"Visible Columns Only"}),c.jsxs(p.Typography,{variant:"caption",color:"text.secondary",children:["Export ",n," visible columns"]})]}),sx:{mb:1,alignItems:"flex-start"}}),c.jsx(p.FormControlLabel,{value:"all",control:c.jsx(p.Radio,{size:"small"}),label:c.jsxs(p.Box,{children:[c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:"All Columns"}),c.jsxs(p.Typography,{variant:"caption",color:"text.secondary",children:["Export all ",i," columns (including hidden)"]})]}),sx:{alignItems:"flex-start"}})]})]}),c.jsxs(p.Box,{sx:{pt:1},children:[c.jsx(p.Divider,{sx:{mb:2}}),c.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.jsxs(p.Box,{sx:{display:"flex",justifyContent:"space-between"},children:[c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"Format:"}),c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:T[o]})]}),c.jsxs(p.Box,{sx:{display:"flex",justifyContent:"space-between"},children:[c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"Rows to export:"}),c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:v.toLocaleString()})]}),c.jsxs(p.Box,{sx:{display:"flex",justifyContent:"space-between"},children:[c.jsx(p.Typography,{variant:"body2",color:"text.secondary",children:"Columns to export:"}),c.jsx(p.Typography,{variant:"body2",sx:{fontWeight:500},children:g})]})]})]})]})}),c.jsxs(p.DialogActions,{sx:{px:3,pb:2,bgcolor:"action.hover"},children:[c.jsx(p.Button,{onClick:a,variant:"outlined",color:"inherit",children:"Cancel"}),c.jsxs(p.Button,{onClick:x,variant:"contained",children:["Download ",T[o]]})]})]})}function JC({warning:e,onDismiss:t}){return c.jsx(p.Box,{sx:{position:"fixed",top:16,right:16,zIndex:50,maxWidth:448},children:c.jsxs(p.Alert,{severity:"warning",icon:c.jsx(kn,{size:20}),action:c.jsx(p.IconButton,{size:"small",onClick:t,sx:{color:"warning.main"},children:c.jsx(Et,{size:16})}),sx:{borderLeft:4,borderColor:"warning.main",boxShadow:3},children:[c.jsx(p.AlertTitle,{sx:{fontWeight:600},children:"Feature Limit Reached"}),c.jsx(p.Box,{sx:{fontSize:"0.875rem",mb:1},children:e.message}),c.jsxs(p.Box,{sx:{fontSize:"0.75rem",opacity:.9},children:["Please remove some ",e.type==="filter"?"filters":e.type==="sort"?"sort levels":"grouping levels"," before adding more."]})]})})}function ZC({error:e,onDismiss:t,autoDismiss:r=!0,autoDismissDelay:n=5e3}){S.useEffect(()=>{if(r){const o=setTimeout(()=>{t()},n);return()=>clearTimeout(o)}},[r,n,t]);const s=(()=>{switch(e.type){case"system":return{severity:"error",icon:c.jsx(gE,{size:20})};case"processing":return{severity:"warning",icon:c.jsx(kn,{size:20})};case"ui":default:return{severity:"info",icon:c.jsx(Ai,{size:20})}}})(),a=y2(e);return c.jsx(p.Box,{sx:{position:"fixed",top:16,right:16,zIndex:50,maxWidth:448},children:c.jsxs(p.Alert,{severity:s.severity,icon:s.icon,action:c.jsx(p.IconButton,{size:"small",onClick:t,sx:{color:`${s.severity}.main`},children:c.jsx(Et,{size:16})}),sx:{borderLeft:4,borderColor:`${s.severity}.main`,boxShadow:3},children:[c.jsxs(p.AlertTitle,{sx:{fontWeight:600},children:[e.context.charAt(0).toUpperCase()+e.context.slice(1)," Error"]}),c.jsx(p.Box,{sx:{fontSize:"0.875rem"},children:a}),e.details&&process.env.NODE_ENV==="development"&&c.jsx(p.Box,{component:"pre",sx:{fontSize:"0.75rem",mt:1,fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:JSON.stringify(e.details,null,2)})]})})}class QC extends S.Component{constructor(t){super(t),this.handleReset=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[ErrorBoundary] Caught error:",t,r),this.props.onError&&this.props.onError(t,r)}render(){var t,r;return this.state.hasError?this.props.fallback?this.props.fallback:c.jsx(p.Paper,{sx:{bgcolor:"error.lighter",border:1,borderColor:"error.light",borderRadius:2,p:3,m:2},children:c.jsxs(p.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(kn,{size:24,color:"error",style:{flexShrink:0,marginTop:4}}),c.jsxs(p.Box,{sx:{flex:1},children:[c.jsx(p.Typography,{variant:"h6",sx:{color:"error.dark",fontWeight:600},children:this.props.context?`${this.props.context} Error`:"Something went wrong"}),c.jsx(p.Typography,{variant:"body2",sx:{color:"error.main",mt:1},children:((t=this.state.error)==null?void 0:t.message)||"An unexpected error occurred"}),process.env.NODE_ENV==="development"&&c.jsx(p.Box,{component:"pre",sx:{mt:1.5,fontSize:"0.75rem",color:"error.dark",bgcolor:"error.lighter",p:1.5,borderRadius:1,overflow:"auto",maxHeight:160},children:(r=this.state.error)==null?void 0:r.stack}),c.jsx(p.Button,{onClick:this.handleReset,variant:"contained",color:"error",startIcon:c.jsx(GE,{size:16}),sx:{mt:2},children:"Try Again"})]})]})}):this.props.children}}function ai({children:e,feature:t,onError:r}){return c.jsx(QC,{context:t,onError:(n,i)=>{r&&r(n)},fallback:c.jsxs(p.Alert,{severity:"warning",sx:{m:1},icon:c.jsx(kn,{size:20}),children:[c.jsxs(p.AlertTitle,{children:[t," temporarily unavailable"]}),"Other features continue to work normally"]}),children:e})}function rd({reportEngine:e}){var Se,Ne;const{activeReport:t,paginatedData:r,processedData:n,tableMetrics:i,tableEngine:s,activeView:a,isDirty:o,currentTableState:f,viewChanges:u,showFilterPanel:d,setShowFilterPanel:h,filterFocusColumn:m,handleAddFilter:l,handleUpdateFilter:v,handleRemoveFilter:g,handleClearAllFilters:x,handleOpenFilterForColumn:T,handleCloseFilterPanel:b,handleClearFiltersForColumn:_,showSortPanel:k,setShowSortPanel:F,handleSort:z,handleUpdateSortStack:N,handleSortAscending:B,handleSortDescending:M,showManageViews:L,setShowManageViews:W,showCreateViewModal:y,setShowCreateViewModal:H,showEditViewModal:Q,setShowEditViewModal:J,showDeleteConfirmation:ee,setShowDeleteConfirmation:_e,editingView:Ae,deletingView:De,handleSelectView:oe,handleCreateView:ce,handleUpdateCurrentView:C,handleSaveAsNewView:j,handleRevertChanges:R,handleToggleDefault:P,handleToggleFavorite:V,handleSoftDelete:le,handleRestoreView:fe,handlePermanentDelete:ue,handleEditView:te,handleSaveEditView:Ie,handleConfirmDelete:ae,showManageColumns:Pe,setShowManageColumns:ke,handleUpdateColumnVisibility:pt,handleUpdateColumnOrder:He,handleUpdateColumnWidth:we,handleResetColumnLayout:ut,showGroupPanel:je,setShowGroupPanel:Rt,handleGroup:vt,handleToggleGroupCollapse:rt,searchQuery:kt,searchHistory:Xe,handleSearchChange:Ht,handleAddToSearchHistory:It,handleToggleSearchFavourite:Gt,handleDeleteSearchHistory:Lt,selectedRowIds:Bt,handleToggleRowSelection:qe,handleToggleAllRows:Je,handleRangeSelection:gt,handleClearSelection:Ft,currentPage:bt,pageSize:cr,paginationEngine:Yt,handlePageChange:Qe,handlePageSizeChange:pr,isExporting:Xt,showExportModal:ir,setShowExportModal:pe,showDirtyExportWarning:tr,handleExport:Ge,handleExportWithConfig:Oe,handleExportSelected:nt,handleExportAnyway:Ye,handleSaveAndExport:Tt,handleCancelExport:sr,showAuditHistory:yt,setShowAuditHistory:xt,showCreatePreset:mt,setShowCreatePreset:Te,showShareLink:he,setShowShareLink:be,generatedPreset:We,activePreset:w,handleOpenSharePreset:O,handleCreatePreset:E,handleCopyPresetLink:A,handleOpenPreset:D,handleDeletePreset:I,handleClearActivePreset:Y,isViewerRole:ne,userRole:G,featureLimitWarning:X,setFeatureLimitWarning:K,reportError:ge,setReportError:ye,handleError:Ee,updateReport:me}=e;return!t||!t.schemaLocked||!t.schema||!t.uploadedData||!t.views?null:c.jsxs(p.Box,{sx:{p:3},children:[X&&c.jsx(JC,{warning:X,onDismiss:()=>K(null)}),ge&&c.jsx(ZC,{error:ge,onDismiss:()=>ye(null)}),tr&&c.jsx(HC,{onExportAnyway:Ye,onSaveAndExport:Tt,onCancel:sr}),c.jsx(RC,{schema:t.schema,data:r,sortStack:t.sortStack,filters:t.filters,views:t.views,activeViewId:t.activeViewId,isDirty:o,isExporting:Xt,columnVisibility:t.columnVisibility||(a==null?void 0:a.snapshot.columnVisibility),columnOrder:t.columnOrder||(a==null?void 0:a.snapshot.columnOrder),columnWidths:t.columnWidths||(a==null?void 0:a.snapshot.columnWidths),grouping:t.grouping,onSort:z,onSortAscending:B,onSortDescending:M,onOpenFilters:()=>h(!0),onOpenSort:()=>F(!0),onOpenFilterForColumn:T,onSelectView:oe,onCreateView:()=>H(!0),onManageViews:()=>W(!0),onUpdateCurrentView:C,onSaveAsNewView:j,onToggleDefault:P,onToggleFavorite:V,onRestoreView:fe,onPermanentDelete:ue,onExport:Ge,onOpenColumns:()=>ke(!0),onUpdateColumnWidth:we,onUpdateColumnOrder:He,onUpdateColumnVisibility:pt,onClearFiltersForColumn:_,onResetLayout:ut,onOpenGroup:()=>Rt(!0),onToggleGroupCollapse:rt,onOpenAuditHistory:()=>xt(!0),onOpenSharePreset:O,searchQuery:kt,searchHistory:Xe,onAddToSearchHistory:It,onToggleSearchFavourite:Gt,onDeleteSearchHistory:Lt,selectedRowIds:Bt,onSearchChange:Ht,onToggleRowSelection:qe,onToggleAllRows:Je,onRangeSelection:gt,onClearSelection:Ft,onExportSelected:nt,currentPage:(Yt==null?void 0:Yt.currentPage)||bt,pageSize:(Yt==null?void 0:Yt.pageSize)||cr,onPageChange:Qe,onPageSizeChange:pr,totalRowsBeforePagination:(i==null?void 0:i.searchedRows)||n.length,isReadOnly:ne,userRole:G}),!ne&&o&&a&&c.jsx(zC,{viewName:a.name,isDefaultView:a.isDefault,changes:u,onSaveToCurrentView:a.isDefault?void 0:C,onSaveAsNewView:j,onCancel:R}),d&&c.jsx(ai,{feature:"Filters",onError:Ve=>{const ze=Hr("ui","filters",Ve);Ee(ze)},children:c.jsx(PC,{schema:t.schema,filters:t.filters??[],onAddFilter:l,onUpdateFilter:v,onRemoveFilter:g,onClearAll:x,onClose:b,focusColumn:m})}),k&&c.jsx(ai,{feature:"Sorting",onError:Ve=>{const ze=Hr("ui","sorting",Ve);Ee(ze)},children:c.jsx(jC,{schema:t.schema,sortStack:t.sortStack??[],onUpdateSortStack:N,onClose:()=>F(!1)})}),L&&c.jsx(ai,{feature:"Views",onError:Ve=>{const ze=Hr("ui","views",Ve);Ee(ze)},children:c.jsx(MC,{views:t.views,activeViewId:t.activeViewId??"",onSelectView:oe,onCreateView:()=>{W(!1),H(!0)},onEditView:te,onDeleteView:le,onRestoreView:fe,onPermanentDelete:ue,onClose:()=>W(!1)})}),y&&f&&c.jsx(Kc,{currentSnapshot:f,onSave:ce,onClose:()=>H(!1)}),Q&&Ae&&c.jsx(Kc,{currentSnapshot:Ae.snapshot,onSave:Ie,onClose:()=>{J(!1)},isEditMode:!0,initialName:Ae.name,initialDescription:Ae.description,initialIsDefault:Ae.isDefault}),ee&&De&&c.jsx(LC,{viewName:De.name,onConfirm:ae,onCancel:()=>{_e(!1)}}),Pe&&a&&c.jsx($C,{schema:t.schema,columnVisibility:t.columnVisibility||a.snapshot.columnVisibility,columnOrder:t.columnOrder||a.snapshot.columnOrder,columnWidths:t.columnWidths||a.snapshot.columnWidths,views:t.views,activeViewId:t.activeViewId,onUpdateColumnVisibility:pt,onUpdateColumnOrder:He,onUpdateColumnWidth:we,onResetLayout:ut,onSelectView:Ve=>{oe(Ve)},onSaveToCurrentView:()=>{ke(!1)},onSaveToAllViews:()=>{if(a){const Ve=t.views.map(ze=>({...ze,snapshot:{...ze.snapshot,columnVisibility:a.snapshot.columnVisibility,columnOrder:a.snapshot.columnOrder,columnWidths:a.snapshot.columnWidths}}));me(t.id,{views:Ve}),$e.success("Column configuration applied to all views")}ke(!1)},onClose:()=>ke(!1)}),je&&c.jsx(ai,{feature:"Grouping",onError:Ve=>{const ze=Hr("ui","grouping",Ve);Ee(ze)},children:c.jsx(UC,{schema:t.schema,grouping:t.grouping||null,onApply:vt,onClose:()=>Rt(!1)})}),yt&&c.jsx(GC,{auditHistory:t.auditHistory||[],onClose:()=>xt(!1)}),mt&&c.jsx(YC,{onSave:E,onClose:()=>Te(!1)}),he&&We&&c.jsx(XC,{presetName:We.preset.name,shareUrl:We.url,onCopyLink:A,onOpenPreset:D,onDeletePreset:I,onClose:()=>{be(!1)}}),w&&c.jsx(p.Box,{sx:{mt:2},children:c.jsx(KC,{presetName:w.name,onClear:Y})}),ir&&c.jsx(ai,{feature:"Export",onError:Ve=>{const ze=Hr("ui","export",Ve);Ee(ze)},children:c.jsx(qC,{totalRows:(i==null?void 0:i.totalRows)||((Se=t.uploadedData)==null?void 0:Se.length)||0,visibleRows:(i==null?void 0:i.searchedRows)||n.length,visibleColumnsCount:((Ne=s==null?void 0:s.columnEngine)==null?void 0:Ne.visibleColumns.length)||t.schema.length,totalColumnsCount:t.schema.length,hasGrouping:(i==null?void 0:i.isGrouped)||!1,onExport:Oe,onClose:()=>{pe(!1)}})})]})}function e4(){const e=Sf(),{reports:t,activeReportId:r,activeReport:n,uploadState:i,schema:s,hasSchemaConflicts:a,isModalOpen:o,setIsModalOpen:f,setActiveReportId:u,createReport:d,handleFileUpload:h,handleUploadError:m,handleRetry:l,handleConfirm:v}=e;return c.jsxs(p.Box,{sx:{minHeight:"100vh"},children:[c.jsx(c_,{onCreateReport:()=>f(!0)}),c.jsx(u_,{reports:t,activeReportId:r,onTabClick:u}),c.jsx(p.Box,{component:"main",children:t.length===0?c.jsx(Ff,{title:"No reports yet",description:"Create your first report to start analyzing your data."}):n?c.jsx(c.Fragment,{children:n.schemaLocked&&n.schema&&n.uploadedData&&n.views?c.jsx(rd,{reportEngine:e}):c.jsx(p.Box,{sx:{p:3},children:i==="preview"&&n.schema&&n.uploadedData?c.jsx(p_,{schema:n.schema,onConfirm:v,hasConflicts:a}):n.uploadError?c.jsx(g_,{error:n.uploadError,onRetry:l}):c.jsx(h_,{onFileUpload:h,onError:m,isUploading:i==="uploading"})})}):null}),c.jsx(f_,{isOpen:o,onClose:()=>f(!1),onCreate:d}),c.jsx(Wu,{position:"top-right"})]})}function t4(){return c.jsx(Do,{children:c.jsx(e4,{})})}function r4(){const e=Sf();return c.jsxs(p.Box,{sx:{minHeight:"100vh"},children:[c.jsx(p.Box,{component:"main",children:e.activeReport?c.jsx(rd,{reportEngine:e}):c.jsx(Ff,{title:"No report data",description:"This viewer requires report data to be loaded."})}),c.jsx(Wu,{position:"top-right"})]})}function n4({data:e,autoLoad:t=!0,config:r}){return c.jsx(Do,{data:e,mode:"viewer",autoLoad:t,config:r,children:c.jsx(r4,{})})}exports.URMBuilder=t4;exports.URMProvider=Do;exports.URMViewer=n4;
|
|
352
|
+
]`})})]}),o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Supported Column Types"}),o.jsx(h.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"The system automatically detects column types from your data:"}),o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[o.jsxs(h.Box,{sx:{display:"flex",gap:1},children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500,minWidth:80},children:"Number:"}),o.jsxs(h.Typography,{variant:"body2",color:"text.secondary",children:["Numeric values (e.g., ",o.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:"33"}),", ",o.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:"42.5"}),")"]})]}),o.jsxs(h.Box,{sx:{display:"flex",gap:1},children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500,minWidth:80},children:"Boolean:"}),o.jsxs(h.Typography,{variant:"body2",color:"text.secondary",children:["True/false values (e.g., ",o.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:"true"}),", ",o.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:"false"}),")"]})]}),o.jsxs(h.Box,{sx:{display:"flex",gap:1},children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500,minWidth:80},children:"String:"}),o.jsxs(h.Typography,{variant:"body2",color:"text.secondary",children:["Text values (e.g., ",o.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:'"Europe"'}),", ",o.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:'"Analytics Pro"'}),")"]})]}),o.jsxs(h.Box,{sx:{display:"flex",gap:1},children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500,minWidth:80},children:"Date:"}),o.jsxs(h.Typography,{variant:"body2",color:"text.secondary",children:["ISO date strings (e.g., ",o.jsx("code",{style:{backgroundColor:"rgba(0,0,0,0.05)",padding:"2px 4px",borderRadius:4},children:'"2024-08-22"'}),")"]})]})]})]}),o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Notes"}),o.jsxs(h.Box,{component:"ul",sx:{m:0,pl:2.5,"& li":{fontSize:"0.875rem",color:"text.secondary",mb:.5}},children:[o.jsx("li",{children:"Each object in the array represents one row in the report."}),o.jsx("li",{children:"The keys of the JSON objects become report columns."}),o.jsx("li",{children:"All objects should have consistent keys for proper column detection."}),o.jsx("li",{children:"Column names are case-sensitive and preserve spacing."})]})]})]})}),o.jsx(h.DialogActions,{sx:{px:3,pb:2,bgcolor:"action.hover"},children:o.jsx(h.Button,{onClick:t,variant:"contained",children:"Got it"})})]}):null}function D2({onFileUpload:e,onError:t,isUploading:r}){const[n,i]=w.useState(!1),[s,a]=w.useState(""),[c,u]=w.useState(!1),f=w.useRef(null),d=async E=>{if(!E.name.endsWith(".json")){t("Please upload a valid JSON file");return}a(E.name);try{const D=await E.text(),C=JSON.parse(D);if(!Array.isArray(C)){t("JSON must be an array of objects");return}if(C.length===0){t("JSON array is empty");return}e(C)}catch{t("Invalid JSON format. Please check your file and try again.")}finally{a("")}},p=E=>{E.preventDefault(),i(!0)},x=E=>{E.preventDefault(),i(!1)},l=E=>{E.preventDefault(),i(!1);const D=E.dataTransfer.files[0];D&&d(D)},y=()=>{var E;(E=f.current)==null||E.click()},g=E=>{var C;const D=(C=E.target.files)==null?void 0:C[0];D&&d(D)},m=E=>{E.stopPropagation(),u(!0)};return o.jsxs(o.Fragment,{children:[o.jsxs(h.Box,{onDragOver:p,onDragLeave:x,onDrop:l,onClick:y,sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,border:2,borderStyle:"dashed",borderColor:n?"primary.main":"divider",bgcolor:n?"primary.lighter":"transparent",borderRadius:1,px:2,py:6,cursor:"pointer",transition:"all 0.2s",opacity:r?.5:1,pointerEvents:r?"none":"auto","&:hover":{borderColor:n?"primary.main":"text.secondary"}},children:[o.jsx("input",{ref:f,type:"file",accept:".json",onChange:g,style:{display:"none"}}),r?o.jsxs(o.Fragment,{children:[o.jsx(h.CircularProgress,{size:32,sx:{mb:2}}),o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500,mb:.5},children:"Uploading..."}),s&&o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:s})]}):o.jsxs(o.Fragment,{children:[o.jsx(h.Box,{sx:{width:64,height:64,borderRadius:"50%",bgcolor:"primary.lighter",display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:o.jsx(Ic,{size:32,color:"primary"})}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[o.jsx(h.Button,{variant:"contained",sx:{fontWeight:500},children:"Upload Data (JSON)"}),o.jsx(h.IconButton,{onClick:m,size:"small",sx:{border:1,borderColor:"divider","&:hover":{borderColor:"text.secondary",bgcolor:"action.hover"}},title:"View JSON format guide",children:o.jsx(Vn,{size:16})})]}),o.jsx(h.Typography,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",maxWidth:500},children:"Upload structured JSON data to generate your report."}),o.jsx(h.Typography,{variant:"caption",color:"text.secondary",sx:{mt:1},children:"Click to browse or drag and drop a JSON file here"})]})]}),o.jsx(b2,{isOpen:c,onClose:()=>u(!1)})]})}function A2({schema:e,onConfirm:t,hasConflicts:r}){return o.jsxs(h.Paper,{sx:{border:2,borderColor:"divider",p:3},children:[o.jsxs(h.Box,{sx:{mb:2},children:[o.jsx(h.Typography,{variant:"h6",sx:{fontWeight:600,mb:.5},children:"Schema Preview"}),o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"Review the detected schema before generating your table"})]}),r&&o.jsxs(h.Alert,{severity:"warning",sx:{mb:2},children:[o.jsx(h.AlertTitle,{sx:{fontWeight:600},children:"Schema Conflict Detected"}),"Some columns have inconsistent data types across rows. Please resolve these conflicts before proceeding."]}),o.jsx(h.TableContainer,{sx:{mb:3},children:o.jsxs(h.Table,{children:[o.jsx(h.TableHead,{children:o.jsxs(h.TableRow,{sx:{bgcolor:"action.hover"},children:[o.jsx(h.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Column Name"}),o.jsx(h.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Detected Type"}),o.jsx(h.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Status"})]})}),o.jsx(h.TableBody,{children:e.map(n=>o.jsxs(h.TableRow,{sx:{bgcolor:n.hasConflict?"warning.lighter":"transparent"},children:[o.jsxs(h.TableCell,{sx:{fontWeight:500},children:[n.name,n.hasConflict&&o.jsx(h.Box,{component:"span",sx:{ml:1,color:"warning.main"},children:"⚠"})]}),o.jsx(h.TableCell,{children:o.jsx(h.Chip,{label:n.type,size:"small",sx:{bgcolor:"action.hover"}})}),o.jsx(h.TableCell,{children:o.jsx(h.Chip,{label:n.required?"Required":"Optional",size:"small",color:n.required?"success":"default"})})]},n.name))})]})}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pt:2,borderTop:1,borderColor:"divider"},children:[o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(r2,{size:16}),o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"Schema will be locked for this report"})]}),o.jsx(h.Button,{variant:"contained",onClick:t,disabled:r,sx:{fontWeight:500},children:"Generate Table"})]})]})}function O2({error:e,onRetry:t}){return o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,border:2,borderColor:"error.light",bgcolor:"error.lighter",borderRadius:1,px:2,py:6},children:[o.jsx(h.Box,{sx:{width:64,height:64,borderRadius:"50%",bgcolor:"error.light",display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:o.jsx(Cv,{size:32,color:"error"})}),o.jsx(h.Typography,{variant:"h6",color:"error.dark",sx:{fontWeight:600,mb:1},children:"Upload Failed"}),o.jsx(h.Typography,{variant:"body2",color:"error.dark",sx:{textAlign:"center",maxWidth:500,mb:3},children:e}),o.jsx(h.Button,{variant:"contained",color:"error",startIcon:o.jsx(Ic,{size:16}),onClick:t,sx:{fontWeight:500},children:"Try Again"})]})}function Nc({title:e,description:t,showIcon:r=!0}){return o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,px:2},children:[r&&o.jsx(h.Box,{sx:{width:64,height:64,borderRadius:"50%",bgcolor:"action.hover",display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:o.jsx(Oc,{size:32,color:"currentColor",style:{opacity:.5}})}),o.jsx(h.Typography,{variant:"h6",sx:{fontWeight:600,mb:1},children:e}),o.jsx(h.Typography,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",maxWidth:500},children:t})]})}function k2({value:e,onChange:t,searchHistory:r,onAddToHistory:n,onToggleFavourite:i,onDeleteHistory:s}){const[a,c]=w.useState(!1),[u,f]=w.useState(!1),[d,p]=w.useState(-1),x=w.useRef(null),l=w.useRef(null);w.useEffect(()=>{function k(V){x.current&&!x.current.contains(V.target)&&(c(!1),f(!1))}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]);const y=()=>{f(!0),p(-1),r.length>0&&c(!0)},g=k=>{t(k),p(-1)},m=k=>{var V;t(k),n(k),c(!1),(V=l.current)==null||V.blur()},E=k=>{var V;k.key==="Enter"?d>=0&&d<r.length?(k.preventDefault(),D(r[d].query)):e.trim()&&m(e.trim()):k.key==="Escape"?(c(!1),p(-1),(V=l.current)==null||V.blur()):k.key==="ArrowDown"?(k.preventDefault(),r.length>0&&(a||c(!0),p(j=>j<r.length-1?j+1:j))):k.key==="ArrowUp"&&(k.preventDefault(),p(j=>j>0?j-1:-1))},D=k=>{p(-1),m(k)},C=()=>{var k;t(""),(k=l.current)==null||k.focus()},N=r.filter(k=>k.isFavourite),L=r.filter(k=>!k.isFavourite),Q=a&&r.length>0;return o.jsxs(h.Box,{sx:{position:"relative",width:256},ref:x,children:[o.jsx(h.TextField,{inputRef:l,size:"small",fullWidth:!0,value:e,onChange:k=>g(k.target.value),onFocus:y,onKeyDown:E,placeholder:"Search…",InputProps:{startAdornment:o.jsx(h.InputAdornment,{position:"start",children:o.jsx(h2,{size:16})}),endAdornment:e?o.jsx(h.InputAdornment,{position:"end",children:o.jsx(h.IconButton,{size:"small",onClick:C,edge:"end",children:o.jsx(ot,{size:16})})}):null}}),Q&&o.jsxs(h.Paper,{sx:{position:"absolute",zIndex:50,mt:.5,width:"100%",maxHeight:384,overflowY:"auto"},elevation:3,children:[N.length>0&&o.jsxs(h.Box,{sx:{py:1},children:[o.jsx(h.Typography,{variant:"caption",sx:{px:1.5,py:.75,display:"block",fontWeight:600,textTransform:"uppercase",color:"text.secondary",letterSpacing:"0.05em"},children:"Favourite Searches"}),N.map((k,V)=>o.jsx(co,{entry:k,isSelected:d===V,onClick:()=>D(k.query),onToggleFavourite:()=>i(k.query),onDelete:()=>s(k.query)},`fav-${k.query}`))]}),L.length>0&&o.jsxs(h.Box,{sx:{py:1},children:[N.length>0&&o.jsx(h.Divider,{}),o.jsx(h.Typography,{variant:"caption",sx:{px:1.5,py:.75,display:"block",fontWeight:600,textTransform:"uppercase",color:"text.secondary",letterSpacing:"0.05em"},children:"Recent Searches"}),L.map((k,V)=>{const j=N.length+V;return o.jsx(co,{entry:k,isSelected:d===j,onClick:()=>D(k.query),onToggleFavourite:()=>i(k.query),onDelete:()=>s(k.query)},`recent-${k.query}`)})]})]})]})}function co({entry:e,isSelected:t,onClick:r,onToggleFavourite:n,onDelete:i}){return o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1.5,py:1,cursor:"pointer",bgcolor:t?"primary.lighter":"transparent","&:hover":{bgcolor:t?"primary.lighter":"action.hover"}},children:[o.jsx(h.Box,{sx:{flex:1,minWidth:0},onClick:r,children:o.jsx(h.Typography,{variant:"body2",noWrap:!0,children:e.query})}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5,ml:1},children:[o.jsx(h.IconButton,{size:"small",onClick:s=>{s.stopPropagation(),n()},title:e.isFavourite?"Remove from favourites":"Add to favourites",sx:{p:.5},children:o.jsx(hs,{size:14,fill:e.isFavourite?"#facc15":"none",color:e.isFavourite?"#facc15":"currentColor",style:{opacity:e.isFavourite?1:.5}})}),o.jsx(h.IconButton,{size:"small",onClick:s=>{s.stopPropagation(),i()},title:"Delete from history",sx:{p:.5,"&:hover":{color:"error.main"}},children:o.jsx(Kr,{size:14,style:{opacity:.5}})})]})]})}function F2({views:e,activeViewId:t,isDirty:r,onSelectView:n,onCreateView:i,onManageViews:s,onToggleDefault:a,onToggleFavorite:c,onRestoreView:u,onPermanentDelete:f,isReadOnly:d}){const[p,x]=w.useState(!1),[l,y]=w.useState(!1),[g,m]=w.useState({top:0,left:0}),E=w.useRef(null),D=w.useRef(null),C=e.find(M=>M.id===t),N=C==null?void 0:C.isDefault,L=e.filter(M=>M.isDefault&&!M.isDeleted),Q=e.filter(M=>!M.isDefault&&!M.isDeleted).sort((M,ee)=>(ee.updatedAt||0)-(M.updatedAt||0)),k=e.filter(M=>M.isFavorite&&!M.isDeleted).sort((M,ee)=>(ee.updatedAt||0)-(M.updatedAt||0)),V=e.filter(M=>M.isDeleted);w.useEffect(()=>{if(p&&D.current){const M=D.current.getBoundingClientRect();m({top:M.bottom+window.scrollY+8,left:M.left+window.scrollX})}},[p]),w.useEffect(()=>{const M=ee=>{E.current&&!E.current.contains(ee.target)&&D.current&&!D.current.contains(ee.target)&&x(!1)};return p&&document.addEventListener("mousedown",M),()=>{document.removeEventListener("mousedown",M)}},[p]);const j=M=>{n(M),x(!1)},B=(M,ee=!1)=>o.jsxs("div",{className:`flex items-center justify-between px-4 py-2 text-sm hover:bg-gray-50 transition-colors ${t===M.id?"bg-blue-50":""}`,children:[o.jsxs("button",{onClick:()=>j(M.id),className:"flex items-center gap-2 flex-1 text-left min-w-0",children:[t===M.id&&o.jsx(fs,{className:"w-4 h-4 text-blue-700 flex-shrink-0"}),t!==M.id&&o.jsx("div",{className:"w-4 flex-shrink-0"}),o.jsx("span",{className:`truncate ${t===M.id?"text-blue-700 font-medium":"text-gray-700"}`,children:M.name}),ee&&o.jsx("span",{className:"text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded flex-shrink-0",children:"Default"})]}),o.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[c&&o.jsx("button",{onClick:Te=>{Te.stopPropagation(),c(M.id)},className:"p-1 hover:bg-gray-200 rounded transition-colors",title:M.isFavorite?"Remove from favorites":"Add to favorites",children:o.jsx(hs,{className:`w-4 h-4 ${M.isFavorite?"fill-yellow-500 text-yellow-500":"text-gray-400"}`})}),a&&!M.isDefault&&o.jsx("button",{onClick:Te=>{Te.stopPropagation(),a(M.id)},className:"p-1 hover:bg-gray-200 rounded transition-colors",title:"Set as default",children:o.jsx(Fv,{className:"w-4 h-4 text-gray-400"})})]})]},M.id),X=M=>o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-sm bg-gray-50",children:[o.jsx("span",{className:"text-gray-500 truncate flex-1",children:M.name}),o.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[u&&o.jsx("button",{onClick:ee=>{ee.stopPropagation(),u(M.id)},className:"p-1 hover:bg-gray-200 rounded transition-colors",title:"Restore view",children:o.jsx(Mi,{className:"w-4 h-4 text-green-600"})}),f&&o.jsx("button",{onClick:ee=>{ee.stopPropagation(),f(M.id)},className:"p-1 hover:bg-gray-200 rounded transition-colors",title:"Delete permanently",children:o.jsx(Kr,{className:"w-4 h-4 text-red-600"})})]})]},M.id);return o.jsxs("div",{className:"relative",children:[o.jsxs("button",{ref:D,onClick:()=>x(!p),style:{display:"flex",alignItems:"center",gap:"8px",padding:"4px 12px",fontSize:"0.875rem",fontWeight:500,borderRadius:"4px",border:"none",background:"transparent",color:"inherit",cursor:"pointer",whiteSpace:"nowrap",transition:"background-color 0.2s"},onMouseEnter:M=>{M.currentTarget.style.backgroundColor="rgba(0, 0, 0, 0.04)"},onMouseLeave:M=>{M.currentTarget.style.backgroundColor="transparent"},children:[o.jsx("span",{style:{color:"rgba(0, 0, 0, 0.6)"},children:"View:"}),o.jsx("span",{style:{fontWeight:500},children:(C==null?void 0:C.name)||"Default View"}),!N&&!r&&o.jsx("span",{style:{marginLeft:"4px",padding:"2px 6px",fontSize:"0.75rem",fontWeight:600,backgroundColor:"#1976d2",color:"white",borderRadius:"8px"},children:"✓"}),r&&o.jsx("span",{style:{marginLeft:"4px",padding:"2px 6px",fontSize:"0.75rem",fontWeight:600,backgroundColor:"#ed6c02",color:"white",borderRadius:"8px"},children:"*"}),o.jsx(Kn,{size:16,style:{opacity:.54}})]}),p&&vs.createPortal(o.jsxs("div",{ref:E,className:"fixed w-80 bg-white border border-gray-200 rounded-md shadow-lg z-50 max-h-[500px] overflow-y-auto",style:{top:`${g.top}px`,left:`${g.left}px`},children:[L.length>0&&o.jsxs("div",{className:"py-1",children:[o.jsx("div",{className:"px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Default Views"}),L.map(M=>B(M,!0))]}),k.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t border-gray-200"}),o.jsxs("div",{className:"py-1",children:[o.jsxs("div",{className:"px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wide flex items-center gap-1",children:[o.jsx(hs,{className:"w-3 h-3 fill-yellow-500 text-yellow-500"}),"Favorite Views"]}),k.map(M=>B(M))]})]}),Q.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t border-gray-200"}),o.jsxs("div",{className:"py-1",children:[o.jsx("div",{className:"px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Custom Views"}),Q.map(M=>B(M))]})]}),V.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t border-gray-200"}),o.jsxs("div",{className:"py-1",children:[o.jsxs("button",{onClick:()=>y(!l),className:"w-full px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wide flex items-center justify-between hover:bg-gray-50",children:[o.jsxs("span",{children:["Recently Deleted (",V.length,")"]}),o.jsx(Pi,{className:`w-4 h-4 transition-transform ${l?"rotate-90":""}`})]}),l&&o.jsx("div",{className:"bg-gray-50",children:V.map(M=>X(M))})]})]}),o.jsx("div",{className:"border-t border-gray-200"}),o.jsxs("button",{onClick:()=>{i(),x(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:[o.jsx(_n,{className:"w-4 h-4"}),"Create New Report View"]}),o.jsxs("button",{onClick:()=>{s(),x(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:[o.jsx(Gs,{className:"w-4 h-4"}),"View Setup"]})]}),document.body)]})}function I2({onClick:e,hiddenCount:t,hasCustomOrder:r}){const n=t>0||r;return o.jsxs(h.Button,{onClick:e,variant:"text",startIcon:o.jsx(Dc,{size:18}),title:t>0?`${t} column${t===1?"":"s"} hidden`:r?"Custom column order":"Manage columns",sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:["Columns",n&&o.jsx(h.Box,{component:"span",sx:{ml:.5,px:.75,py:.25,fontSize:"0.75rem",fontWeight:600,color:"primary.contrastText",bgcolor:"primary.main",borderRadius:2},children:t>0?t:"✓"})]})}const Rc=w.createContext({dragDropManager:void 0});function sr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var fo=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),uo=function(){return Math.random().toString(36).substring(7).split("").join(".")},ho={INIT:"@@redux/INIT"+uo(),REPLACE:"@@redux/REPLACE"+uo()};function N2(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function R2(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(M2(e))return"date";if(j2(e))return"error";var r=P2(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function P2(e){return typeof e.constructor=="function"?e.constructor.name:null}function j2(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function M2(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function ln(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=R2(e)),t}function Pc(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?sr(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?sr(1):"Expected the enhancer to be a function. Instead, received: '"+ln(r)+"'");return r(Pc)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?sr(2):"Expected the root reducer to be a function. Instead, received: '"+ln(e)+"'");var i=e,s=t,a=[],c=a,u=!1;function f(){c===a&&(c=a.slice())}function d(){if(u)throw new Error(process.env.NODE_ENV==="production"?sr(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function p(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?sr(4):"Expected the listener to be a function. Instead, received: '"+ln(g)+"'");if(u)throw new Error(process.env.NODE_ENV==="production"?sr(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var m=!0;return f(),c.push(g),function(){if(m){if(u)throw new Error(process.env.NODE_ENV==="production"?sr(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");m=!1,f();var D=c.indexOf(g);c.splice(D,1),a=null}}}function x(g){if(!N2(g))throw new Error(process.env.NODE_ENV==="production"?sr(7):"Actions must be plain objects. Instead, the actual type was: '"+ln(g)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof g.type>"u")throw new Error(process.env.NODE_ENV==="production"?sr(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(u)throw new Error(process.env.NODE_ENV==="production"?sr(9):"Reducers may not dispatch actions.");try{u=!0,s=i(s,g)}finally{u=!1}for(var m=a=c,E=0;E<m.length;E++){var D=m[E];D()}return g}function l(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?sr(10):"Expected the nextReducer to be a function. Instead, received: '"+ln(g));i=g,x({type:ho.REPLACE})}function y(){var g,m=p;return g={subscribe:function(D){if(typeof D!="object"||D===null)throw new Error(process.env.NODE_ENV==="production"?sr(11):"Expected the observer to be an object. Instead, received: '"+ln(D)+"'");function C(){D.next&&D.next(d())}C();var N=m(C);return{unsubscribe:N}}},g[fo]=function(){return this},g}return x({type:ho.INIT}),n={dispatch:x,subscribe:p,getState:d,replaceReducer:l},n[fo]=y,n}function Ie(e,t,...r){if(L2()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;n=new Error(t.replace(/%s/g,function(){return r[i++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function L2(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function B2(e,t,r){return t.split(".").reduce((n,i)=>n&&n[i]?n[i]:r||null,e)}function U2(e,t){return e.filter(r=>r!==t)}function jc(e){return typeof e=="object"}function W2(e,t){const r=new Map,n=s=>{r.set(s,r.has(s)?r.get(s)+1:1)};e.forEach(n),t.forEach(n);const i=[];return r.forEach((s,a)=>{s===1&&i.push(a)}),i}function V2(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Xs="dnd-core/INIT_COORDS",Bi="dnd-core/BEGIN_DRAG",Ys="dnd-core/PUBLISH_DRAG_SOURCE",Ui="dnd-core/HOVER",Wi="dnd-core/DROP",Vi="dnd-core/END_DRAG";function po(e,t){return{type:Xs,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const z2={type:Xs,payload:{clientOffset:null,sourceClientOffset:null}};function H2(e){return function(r=[],n={publishSource:!0}){const{publishSource:i=!0,clientOffset:s,getSourceClientOffset:a}=n,c=e.getMonitor(),u=e.getRegistry();e.dispatch(po(s)),$2(r,c,u);const f=Y2(r,c);if(f==null){e.dispatch(z2);return}let d=null;if(s){if(!a)throw new Error("getSourceClientOffset must be defined");G2(a),d=a(f)}e.dispatch(po(s,d));const x=u.getSource(f).beginDrag(c,f);if(x==null)return;X2(x),u.pinSource(f);const l=u.getSourceType(f);return{type:Bi,payload:{itemType:l,item:x,sourceId:f,clientOffset:s||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function $2(e,t,r){Ie(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Ie(r.getSource(n),"Expected sourceIds to be registered.")})}function G2(e){Ie(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function X2(e){Ie(jc(e),"Item must be an object.")}function Y2(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function K2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){K2(e,i,r[i])})}return e}function J2(e){return function(r={}){const n=e.getMonitor(),i=e.getRegistry();Z2(n),ty(n).forEach((a,c)=>{const u=Q2(a,c,i,n),f={type:Wi,payload:{dropResult:q2({},r,u)}};e.dispatch(f)})}}function Z2(e){Ie(e.isDragging(),"Cannot call drop while not dragging."),Ie(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Q2(e,t,r,n){const i=r.getTarget(e);let s=i?i.drop(n,e):void 0;return ey(s),typeof s>"u"&&(s=t===0?{}:n.getDropResult()),s}function ey(e){Ie(typeof e>"u"||jc(e),"Drop result must either be an object or undefined.")}function ty(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function ry(e){return function(){const r=e.getMonitor(),n=e.getRegistry();ny(r);const i=r.getSourceId();return i!=null&&(n.getSource(i,!0).endDrag(r,i),n.unpinSource()),{type:Vi}}}function ny(e){Ie(e.isDragging(),"Cannot call endDrag while not dragging.")}function ds(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function iy(e){return function(r,{clientOffset:n}={}){sy(r);const i=r.slice(0),s=e.getMonitor(),a=e.getRegistry(),c=s.getItemType();return oy(i,a,c),ay(i,s,a),ly(i,s,a),{type:Ui,payload:{targetIds:i,clientOffset:n||null}}}}function sy(e){Ie(Array.isArray(e),"Expected targetIds to be an array.")}function ay(e,t,r){Ie(t.isDragging(),"Cannot call hover while not dragging."),Ie(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const i=e[n];Ie(e.lastIndexOf(i)===n,"Expected targetIds to be unique in the passed array.");const s=r.getTarget(i);Ie(s,"Expected targetIds to be registered.")}}function oy(e,t,r){for(let n=e.length-1;n>=0;n--){const i=e[n],s=t.getTargetType(i);ds(s,r)||e.splice(n,1)}}function ly(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function cy(e){return function(){if(e.getMonitor().isDragging())return{type:Ys}}}function fy(e){return{beginDrag:H2(e),publishDragSource:cy(e),hover:iy(e),drop:J2(e),endDrag:ry(e)}}class uy{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(s){return(...a)=>{const c=s.apply(t,a);typeof c<"u"&&r(c)}}const i=fy(this);return Object.keys(i).reduce((s,a)=>{const c=i[a];return s[a]=n(c),s},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function hy(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Mc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dy(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Mc(hy(t,n),r)}function py(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Mc(t,r)}const Rn=[],Ks=[];Rn.__IS_NONE__=!0;Ks.__IS_ALL__=!0;function xy(e,t){return e===Rn?!1:e===Ks||typeof t>"u"?!0:V2(t,e).length>0}class gy{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Ie(typeof t=="function","listener must be a function."),Ie(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const s=()=>{const a=this.store.getState(),c=a.stateId;try{c===i||c===i+1&&!xy(a.dirtyHandlerIds,n)||t()}finally{i=c}};return this.store.subscribe(s)}subscribeToOffsetChange(t){Ie(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const i=this.store.getState().dragOffset;i!==r&&(r=i,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Ie(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Ie(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),i=this.getItemType();return ds(n,i)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Ie(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),i=this.getItemType();return n!==i?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),s=this.getItemType();if(s&&!ds(i,s))return!1;const a=this.getTargetIds();if(!a.length)return!1;const c=a.indexOf(t);return n?c===a.length-1:c>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return dy(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return py(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const xo=typeof global<"u"?global:self,Lc=xo.MutationObserver||xo.WebKitMutationObserver;function Bc(e){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),e()}}}function my(e){let t=1;const r=new Lc(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const vy=typeof Lc=="function"?my:Bc;class yy{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,i=t.length-this.index;n<i;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=vy(this.flush),this.requestErrorThrow=Bc(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class wy{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class Ty{create(t){const r=this.freeTasks,n=r.length?r.pop():new wy(this.onError,i=>r[r.length]=i);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Uc=new yy,_y=new Ty(Uc.registerPendingError);function Ey(e){Uc.enqueueTask(_y.create(e))}const qs="dnd-core/ADD_SOURCE",Js="dnd-core/ADD_TARGET",Zs="dnd-core/REMOVE_SOURCE",zi="dnd-core/REMOVE_TARGET";function Sy(e){return{type:qs,payload:{sourceId:e}}}function Cy(e){return{type:Js,payload:{targetId:e}}}function by(e){return{type:Zs,payload:{sourceId:e}}}function Dy(e){return{type:zi,payload:{targetId:e}}}function Ay(e){Ie(typeof e.canDrag=="function","Expected canDrag to be a function."),Ie(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Ie(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Oy(e){Ie(typeof e.canDrop=="function","Expected canDrop to be a function."),Ie(typeof e.hover=="function","Expected hover to be a function."),Ie(typeof e.drop=="function","Expected beginDrag to be a function.")}function ps(e,t){if(t&&Array.isArray(e)){e.forEach(r=>ps(r,!1));return}Ie(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var lr;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(lr||(lr={}));let ky=0;function Fy(){return ky++}function Iy(e){const t=Fy().toString();switch(e){case lr.SOURCE:return`S${t}`;case lr.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function go(e){switch(e[0]){case"S":return lr.SOURCE;case"T":return lr.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function mo(e,t){const r=e.entries();let n=!1;do{const{done:i,value:[,s]}=r.next();if(s===t)return!0;n=!!i}while(!n);return!1}class Ny{addSource(t,r){ps(t),Ay(r);const n=this.addHandler(lr.SOURCE,t,r);return this.store.dispatch(Sy(n)),n}addTarget(t,r){ps(t,!0),Oy(r);const n=this.addHandler(lr.TARGET,t,r);return this.store.dispatch(Cy(n)),n}containsHandler(t){return mo(this.dragSources,t)||mo(this.dropTargets,t)}getSource(t,r=!1){return Ie(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Ie(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Ie(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Ie(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return go(t)===lr.SOURCE}isTargetId(t){return go(t)===lr.TARGET}removeSource(t){Ie(this.getSource(t),"Expected an existing source."),this.store.dispatch(by(t)),Ey(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Ie(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Dy(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Ie(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Ie(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const i=Iy(t);return this.types.set(i,r),t===lr.SOURCE?this.dragSources.set(i,n):t===lr.TARGET&&this.dropTargets.set(i,n),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Ry=(e,t)=>e===t;function Py(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function jy(e,t,r=Ry){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function My(e=Rn,t){switch(t.type){case Ui:break;case qs:case Js:case zi:case Zs:return Rn;case Bi:case Ys:case Vi:case Wi:default:return Ks}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,i=W2(r,n);if(!(i.length>0||!jy(r,n)))return Rn;const a=n[n.length-1],c=r[r.length-1];return a!==c&&(a&&i.push(a),c&&i.push(c)),i}function Ly(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function By(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Ly(e,i,r[i])})}return e}const vo={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Uy(e=vo,t){const{payload:r}=t;switch(t.type){case Xs:case Bi:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Ui:return Py(e.clientOffset,r.clientOffset)?e:By({},e,{clientOffset:r.clientOffset});case Vi:case Wi:return vo;default:return e}}function Wy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Wy(e,i,r[i])})}return e}const Vy={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function zy(e=Vy,t){const{payload:r}=t;switch(t.type){case Bi:return cn({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Ys:return cn({},e,{isSourcePublic:!0});case Ui:return cn({},e,{targetIds:r.targetIds});case zi:return e.targetIds.indexOf(r.targetId)===-1?e:cn({},e,{targetIds:U2(e.targetIds,r.targetId)});case Wi:return cn({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Vi:return cn({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Hy(e=0,t){switch(t.type){case qs:case Js:return e+1;case Zs:case zi:return e-1;default:return e}}function $y(e=0){return e+1}function Gy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Gy(e,i,r[i])})}return e}function Yy(e={},t){return{dirtyHandlerIds:My(e.dirtyHandlerIds,{type:t.type,payload:Xy({},t.payload,{prevTargetIds:B2(e,"dragOperation.targetIds",[])})}),dragOffset:Uy(e.dragOffset,t),refCount:Hy(e.refCount,t),dragOperation:zy(e.dragOperation,t),stateId:$y(e.stateId)}}function Ky(e,t=void 0,r={},n=!1){const i=qy(n),s=new gy(i,new Ny(i)),a=new uy(i,s),c=e(a,t,r);return a.receiveBackend(c),a}function qy(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Pc(Yy,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Jy(e,t){if(e==null)return{};var r=Zy(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zy(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}let yo=0;const ci=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Wc=w.memo(function(t){var{children:r}=t,n=Jy(t,["children"]);const[i,s]=Qy(n);return w.useEffect(()=>{if(s){const a=Vc();return++yo,()=>{--yo===0&&(a[ci]=null)}}},[]),o.jsx(Rc.Provider,{value:i,children:r})});function Qy(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=ew(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function ew(e,t=Vc(),r,n){const i=t;return i[ci]||(i[ci]={dragDropManager:Ky(e,t,r,n)}),i[ci]}function Vc(){return typeof global<"u"?global:window}function tw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qi,wo;function rw(){return wo||(wo=1,Qi=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),Qi}var nw=rw();const iw=tw(nw),qr=typeof window<"u"?w.useLayoutEffect:w.useEffect;function sw(e,t,r){const[n,i]=w.useState(()=>t(e)),s=w.useCallback(()=>{const a=t(e);iw(n,a)||(i(a),r&&r())},[n,e,r]);return qr(s),[n,s]}function aw(e,t,r){const[n,i]=sw(e,t,r);return qr(function(){const a=e.getHandlerId();if(a!=null)return e.subscribeToStateChange(i,{handlerIds:[a]})},[e,i]),n}function zc(e,t,r){return aw(t,e||(()=>({})),()=>r.reconnect())}function Hc(e,t){const r=[];return typeof e!="function"&&r.push(e),w.useMemo(()=>typeof e=="function"?e():e,r)}function ow(e){return w.useMemo(()=>e.hooks.dragSource(),[e])}function lw(e){return w.useMemo(()=>e.hooks.dragPreview(),[e])}let es=!1,ts=!1;class cw{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Ie(!es,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return es=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{es=!1}}isDragging(){if(!this.sourceId)return!1;Ie(!ts,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return ts=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{ts=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let rs=!1;class fw{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Ie(!rs,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return rs=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{rs=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function uw(e,t,r){const n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function hw(e,t,r){const n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}function xs(e,t,r,n){let i;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;const c=Object.prototype.hasOwnProperty.bind(t);for(let u=0;u<s.length;u++){const f=s[u];if(!c(f))return!1;const d=e[f],p=t[f];if(i=void 0,i===!1||i===void 0&&d!==p)return!1}return!0}function gs(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function dw(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function pw(e){return(t=null,r=null)=>{if(!w.isValidElement(t)){const s=t;return e(s,r),s}const n=t;return dw(n),xw(n,r?s=>e(s,r):e)}}function $c(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const i=pw(n);t[r]=()=>i}}),t}function To(e,t){typeof e=="function"?e(t):e.current=t}function xw(e,t){const r=e.ref;return Ie(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?w.cloneElement(e,{ref:n=>{To(r,n),To(t,n)}}):w.cloneElement(e,{ref:t})}class gw{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,n=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!xs(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!xs(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=$c({dragSource:(r,n)=>{this.clearDragSource(),this.dragSourceOptions=n||null,gs(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,n)=>{this.clearDragPreview(),this.dragPreviewOptions=n||null,gs(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class mw{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!xs(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=$c({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,gs(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function En(){const{dragDropManager:e}=w.useContext(Rc);return Ie(e!=null,"Expected drag drop context"),e}function vw(e,t){const r=En(),n=w.useMemo(()=>new gw(r.getBackend()),[r]);return qr(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),qr(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function yw(){const e=En();return w.useMemo(()=>new cw(e),[e])}class ww{beginDrag(){const t=this.spec,r=this.monitor;let n=null;return typeof t.item=="object"?n=t.item:typeof t.item=="function"?n=t.item(r):n={},n??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const n=this.spec,i=this.monitor,{isDragging:s}=n;return s?s(i):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,n=this.connector,{end:i}=t;i&&i(r.getItem(),r),n.reconnect()}constructor(t,r,n){this.spec=t,this.monitor=r,this.connector=n}}function Tw(e,t,r){const n=w.useMemo(()=>new ww(e,t,r),[t,r]);return w.useEffect(()=>{n.spec=e},[e]),n}function _w(e){return w.useMemo(()=>{const t=e.type;return Ie(t!=null,"spec.type must be defined"),t},[e])}function Ew(e,t,r){const n=En(),i=Tw(e,t,r),s=_w(e);qr(function(){if(s!=null){const[c,u]=hw(s,i,n);return t.receiveHandlerId(c),r.receiveHandlerId(c),u}},[n,t,r,i,s])}function Gc(e,t){const r=Hc(e);Ie(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const n=yw(),i=vw(r.options,r.previewOptions);return Ew(r,n,i),[zc(r.collect,n,i),ow(i),lw(i)]}function Sw(e){return w.useMemo(()=>e.hooks.dropTarget(),[e])}function Cw(e){const t=En(),r=w.useMemo(()=>new mw(t.getBackend()),[t]);return qr(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function bw(){const e=En();return w.useMemo(()=>new fw(e),[e])}function Dw(e){const{accept:t}=e;return w.useMemo(()=>(Ie(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Aw{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function Ow(e,t){const r=w.useMemo(()=>new Aw(e,t),[t]);return w.useEffect(()=>{r.spec=e},[e]),r}function kw(e,t,r){const n=En(),i=Ow(e,t),s=Dw(e);qr(function(){const[c,u]=uw(s,i,n);return t.receiveHandlerId(c),r.receiveHandlerId(c),u},[n,t,i,r,s.map(a=>a.toString()).join("|")])}function Xc(e,t){const r=Hc(e),n=bw(),i=Cw(r.options);return kw(r,n,i),[zc(r.collect,n,i),Sw(i)]}function Fw({columnName:e,columnType:t="string",currentSort:r,hasFilters:n,isInSortStack:i,position:s,onSort:a,onRemoveSort:c,onSortAscending:u,onSortDescending:f,onFilter:d,onClearFilter:p,onHideColumn:x,onManageColumns:l,onManageViews:y,onResetLayout:g,onClose:m}){const E=w.useRef(null);w.useEffect(()=>{const C=L=>{E.current&&!E.current.contains(L.target)&&m()},N=L=>{L.key==="Escape"&&m()};return document.addEventListener("mousedown",C),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",N)}},[m]);const D=()=>r?r.direction==="asc"?t==="number"?"(0→9)":t==="boolean"?"(False→True)":"(A→Z)":t==="number"?"(9→0)":t==="boolean"?"(True→False)":"(Z→A)":"";return vs.createPortal(o.jsxs(h.Paper,{ref:E,sx:{position:"fixed",left:`${s.x}px`,top:`${s.y}px`,zIndex:100,minWidth:240},elevation:3,children:[o.jsxs(h.Box,{sx:{px:2,py:1},children:[o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:"Sorting"}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[o.jsx(h.IconButton,{size:"small",onClick:()=>{u?u(e):(r==null?void 0:r.direction)!=="asc"&&(a(e),(r==null?void 0:r.direction)==="desc"&&setTimeout(()=>a(e),0))},title:"Sort Ascending",sx:{p:.75},children:o.jsx(bc,{size:16,color:(r==null?void 0:r.direction)==="asc"?"primary":void 0,style:{opacity:(r==null?void 0:r.direction)==="asc"?1:.4}})}),o.jsx(h.IconButton,{size:"small",onClick:()=>{f?f(e):r?r.direction==="asc"&&a(e):(a(e),setTimeout(()=>a(e),0))},title:"Sort Descending",sx:{p:.75},children:o.jsx(Cc,{size:16,color:(r==null?void 0:r.direction)==="desc"?"primary":void 0,style:{opacity:(r==null?void 0:r.direction)==="desc"?1:.4}})}),o.jsx(h.IconButton,{size:"small",onClick:()=>c(e),title:"Clear sorting",disabled:!r,sx:{p:.75,"&:hover":{color:"error.main"}},children:o.jsx(ot,{size:16,style:{opacity:r?1:.3}})})]})]}),r&&o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:D()}),o.jsx(h.Chip,{label:`Level ${r.priority}`,size:"small",color:"primary",sx:{height:20,fontSize:"0.75rem"}})]})]}),o.jsx(h.Divider,{}),o.jsxs(h.MenuList,{dense:!0,children:[o.jsxs(h.MenuItem,{onClick:()=>{d(e),m()},children:[o.jsx(ji,{size:16,style:{marginRight:8}}),"Filter this column",n&&o.jsx(h.Chip,{label:"Active",size:"small",color:"primary",sx:{ml:"auto",height:20,fontSize:"0.75rem"}})]}),n&&o.jsxs(h.MenuItem,{onClick:()=>{p(e),m()},sx:{color:"warning.main"},children:[o.jsx(kc,{size:16,style:{marginRight:8}}),"Clear Filters"]})]}),o.jsx(h.Divider,{}),o.jsx(h.MenuList,{dense:!0,children:o.jsxs(h.MenuItem,{onClick:()=>{x(e),m()},children:[o.jsx(Ac,{size:16,style:{marginRight:8}}),"Hide column"]})}),o.jsx(h.Divider,{}),o.jsxs(h.MenuList,{dense:!0,children:[o.jsxs(h.MenuItem,{onClick:()=>{l(),m()},children:[o.jsx(Gs,{size:16,style:{marginRight:8}}),"Column Settings"]}),o.jsxs(h.MenuItem,{onClick:()=>{y(),m()},children:[o.jsx(Oc,{size:16,style:{marginRight:8}}),"View Setup"]}),o.jsxs(h.MenuItem,{onClick:()=>{g(),m()},children:[o.jsx(Mi,{size:16,style:{marginRight:8}}),"Reset to Default Layout"]})]})]}),document.body)}const _o="COLUMN_HEADER";function Iw({column:e,index:t,sortRule:r,hasFilters:n,isInSortStack:i,width:s,onColumnClick:a,onMoveColumn:c,onResizeStart:u,onSort:f,onRemoveSort:d,onSortAscending:p,onSortDescending:x,onOpenFilterForColumn:l,onClearFiltersForColumn:y,onHideColumn:g,onManageColumns:m,onManageViews:E,onResetLayout:D}){const C=w.useRef(null),[N,L]=w.useState(!1),[Q,k]=w.useState({x:0,y:0}),[{handlerId:V,isOver:j},B]=Xc({accept:_o,collect(ae){return{handlerId:ae.getHandlerId(),isOver:ae.isOver()}},hover(ae,Se){var I;if(!C.current)return;const Ne=ae.index,be=t;if(Ne===be)return;const ze=(I=C.current)==null?void 0:I.getBoundingClientRect(),_e=(ze.right-ze.left)/2,O=Se.getClientOffset(),P=((O==null?void 0:O.x)??0)-ze.left;Ne<be&&P<_e||Ne>be&&P>_e||(c(Ne,be),ae.index=be)}}),[{isDragging:X},M]=Gc({type:_o,item:()=>({index:t,columnName:e.name}),collect:ae=>({isDragging:ae.isDragging()})});M(B(C));const ee=ae=>{ae.preventDefault(),ae.stopPropagation(),k({x:ae.clientX,y:ae.clientY}),L(!0)},Te=()=>r?o.jsxs("div",{className:"inline-flex items-center ml-1 gap-0.5",children:[r.direction==="asc"?o.jsx(bc,{className:"w-3.5 h-3.5"}):o.jsx(Cc,{className:"w-3.5 h-3.5"}),o.jsx("span",{className:"flex items-center justify-center w-4 h-4 bg-blue-600 text-white text-[10px] font-bold rounded-full",children:r.priority})]}):null,ne=()=>n?o.jsx("button",{onClick:ae=>{ae.stopPropagation(),l(e.name)},className:"inline-flex items-center ml-1 text-blue-600 hover:text-blue-800 transition-colors",title:"Active filters on this column",children:o.jsx(ji,{className:"w-3.5 h-3.5 fill-current"})}):null;return o.jsxs(o.Fragment,{children:[o.jsxs(h.TableCell,{ref:C,"data-handler-id":V,onClick:()=>a(e.name),onContextMenu:ee,sx:{position:"relative",textAlign:"left",fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",whiteSpace:"nowrap",cursor:"pointer",userSelect:"none",opacity:X?.3:1,bgcolor:j?"primary.lighter":"transparent","&:hover":{bgcolor:"action.selected"},width:s?`${s}px`:"150px"},children:[o.jsxs(h.Box,{sx:{display:"inline-flex",alignItems:"center"},children:[e.name,Te(),ne()]}),o.jsx(h.Box,{sx:{position:"absolute",right:0,top:0,height:"100%",width:8,cursor:"col-resize",zIndex:10,"&:hover":{bgcolor:"primary.light"}},onMouseDown:ae=>{ae.stopPropagation(),u(ae,e.name)},onClick:ae=>ae.stopPropagation()}),j&&o.jsx(h.Box,{sx:{position:"absolute",left:0,top:0,bottom:0,width:4,bgcolor:"primary.main"}})]}),N&&o.jsx(Fw,{columnName:e.name,columnType:e.type,currentSort:r,hasFilters:n,isInSortStack:i,position:Q,onSort:f,onRemoveSort:d,onSortAscending:p,onSortDescending:x,onFilter:l,onClearFilter:y,onHideColumn:g,onManageColumns:m,onManageViews:E,onResetLayout:D,onClose:()=>L(!1)})]})}function Yc(e){let t=null;return()=>(t==null&&(t=e()),t)}function Nw(e,t){return e.filter(r=>r!==t)}function Rw(e,t){const r=new Set,n=s=>r.add(s);e.forEach(n),t.forEach(n);const i=[];return r.forEach(s=>i.push(s)),i}class Pw{enter(t){const r=this.entered.length,n=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=Rw(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Nw(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class jw{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const i=this.config.exposeProperties[n];i!=null&&(r[n]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const Kc="__NATIVE_FILE__",qc="__NATIVE_URL__",Jc="__NATIVE_TEXT__",Zc="__NATIVE_HTML__",Eo=Object.freeze(Object.defineProperty({__proto__:null,FILE:Kc,HTML:Zc,TEXT:Jc,URL:qc},Symbol.toStringTag,{value:"Module"}));function ns(e,t,r){const n=t.reduce((i,s)=>i||e.getData(s),"");return n??r}const ms={[Kc]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Zc]:{exposeProperties:{html:(e,t)=>ns(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[qc]:{exposeProperties:{urls:(e,t)=>ns(e,t,"").split(`
|
|
353
|
+
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Jc]:{exposeProperties:{text:(e,t)=>ns(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Mw(e,t){const r=ms[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new jw(r);return n.loadDataTransfer(t),n}function is(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(ms).filter(r=>{const n=ms[r];return n!=null&&n.matchesTypes?n.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const Lw=Yc(()=>/firefox/i.test(navigator.userAgent)),Qc=Yc(()=>!!window.safari);class So{interpolate(t){const{xs:r,ys:n,c1s:i,c2s:s,c3s:a}=this;let c=r.length-1;if(t===r[c])return n[c];let u=0,f=a.length-1,d;for(;u<=f;){d=Math.floor(.5*(u+f));const l=r[d];if(l<t)u=d+1;else if(l>t)f=d-1;else return n[d]}c=Math.max(0,f);const p=t-r[c],x=p*p;return n[c]+i[c]*p+s[c]*x+a[c]*p*x}constructor(t,r){const{length:n}=t,i=[];for(let l=0;l<n;l++)i.push(l);i.sort((l,y)=>t[l]<t[y]?-1:1);const s=[],a=[];let c,u;for(let l=0;l<n-1;l++)c=t[l+1]-t[l],u=r[l+1]-r[l],s.push(c),a.push(u/c);const f=[a[0]];for(let l=0;l<s.length-1;l++){const y=a[l],g=a[l+1];if(y*g<=0)f.push(0);else{c=s[l];const m=s[l+1],E=c+m;f.push(3*E/((E+m)/y+(E+c)/g))}}f.push(a[a.length-1]);const d=[],p=[];let x;for(let l=0;l<f.length-1;l++){x=a[l];const y=f[l],g=1/s[l],m=y+f[l+1]-x-x;d.push((x-y-m)*g),p.push(m*g*g)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=d,this.c3s=p}}const Bw=1;function e0(e){const t=e.nodeType===Bw?e:e.parentElement;if(!t)return null;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function li(e){return{x:e.clientX,y:e.clientY}}function Uw(e){var t;return e.nodeName==="IMG"&&(Lw()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Ww(e,t,r,n){let i=e?t.width:r,s=e?t.height:n;return Qc()&&e&&(s/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:s}}function Vw(e,t,r,n,i){const s=Uw(t),c=e0(s?e:t),u={x:r.x-c.x,y:r.y-c.y},{offsetWidth:f,offsetHeight:d}=e,{anchorX:p,anchorY:x}=n,{dragPreviewWidth:l,dragPreviewHeight:y}=Ww(s,t,f,d),g=()=>{let Q=new So([0,.5,1],[u.y,u.y/d*y,u.y+y-d]).interpolate(x);return Qc()&&s&&(Q+=(window.devicePixelRatio-1)*y),Q},m=()=>new So([0,.5,1],[u.x,u.x/f*l,u.x+l-f]).interpolate(p),{offsetX:E,offsetY:D}=i,C=E===0||E,N=D===0||D;return{x:C?E:m(),y:N?D:g()}}class zw{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function Hw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Co(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Hw(e,i,r[i])})}return e}class $w{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,n){return this.sourcePreviewNodeOptions.set(t,n),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const i=a=>this.handleDragStart(a,t),s=a=>this.handleSelectStart(a);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",i),r.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",i),r.removeEventListener("selectstart",s),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=a=>this.handleDragEnter(a,t),i=a=>this.handleDragOver(a,t),s=a=>this.handleDrop(a,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",i),r.addEventListener("drop",s),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",i),r.removeEventListener("drop",s)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return Co({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Co({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Eo).some(r=>Eo[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Mw(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&e0(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const a=li(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:c}=i,u=is(c);if(this.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){const d=this.monitor.getSourceId(),p=this.sourceNodes.get(d),x=this.sourcePreviewNodes.get(d)||p;if(x){const{anchorX:l,anchorY:y,offsetX:g,offsetY:m}=this.getCurrentSourcePreviewNodeOptions(),C=Vw(p,x,a,{anchorX:l,anchorY:y},{offsetX:g,offsetY:m});c.setDragImage(x,C.x,C.y)}}try{c==null||c.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:f}=this.getCurrentSourcePreviewNodeOptions();f?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(u)this.beginDragNativeItem(u);else{if(c&&!c.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:c}=i,u=is(c);u&&this.beginDragNativeItem(u,c)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,s.length>0&&this.actions.hover(s,{clientOffset:li(i)}),s.some(c=>this.monitor.canDropOnTarget(c))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=li(i),this.scheduleHover(s),(s||[]).some(c=>this.monitor.canDropOnTarget(c))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;i.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}else is(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:li(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const s=i.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(i.preventDefault(),s.dragDrop()))},this.options=new zw(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Pw(this.isNodeInDocument)}}const t0=function(t,r,n){return new $w(t,r,n)};function Gw({selectedCount:e,onExportSelected:t,onClearSelection:r}){const[n,i]=w.useState(null);if(e===0)return null;const s=u=>{i(u.currentTarget)},a=u=>{t(u),i(null)},c=()=>{i(null)};return o.jsx(h.Box,{sx:{position:"fixed",bottom:24,left:"50%",transform:"translateX(-50%)",zIndex:50},children:o.jsxs(h.Box,{sx:{bgcolor:"primary.main",color:"primary.contrastText",boxShadow:3,borderRadius:2,px:3,py:1.5,display:"flex",alignItems:"center",gap:2},children:[o.jsxs(h.Typography,{variant:"body2",sx:{fontWeight:500},children:[e," ",e===1?"row":"rows"," selected"]}),o.jsx(h.Divider,{orientation:"vertical",flexItem:!0,sx:{bgcolor:"primary.light",opacity:.5}}),o.jsx(h.Button,{onClick:s,startIcon:o.jsx(Hs,{size:16}),size:"small",sx:{bgcolor:"primary.dark",color:"primary.contrastText","&:hover":{bgcolor:"primary.light"},textTransform:"none"},children:"Export Selected"}),o.jsxs(h.Menu,{anchorEl:n,open:!!n,onClose:c,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:[o.jsx(h.MenuItem,{onClick:()=>a("csv"),children:"Export as CSV"}),o.jsx(h.MenuItem,{onClick:()=>a("excel"),children:"Export as Excel"}),o.jsx(h.MenuItem,{onClick:()=>a("json"),children:"Export as JSON"})]}),o.jsx(h.Divider,{orientation:"vertical",flexItem:!0,sx:{bgcolor:"primary.light",opacity:.5}}),o.jsx(h.Button,{onClick:r,startIcon:o.jsx(ot,{size:16}),size:"small",sx:{color:"primary.contrastText","&:hover":{bgcolor:"primary.dark"},textTransform:"none"},children:"Clear Selection"})]})})}const bo=[10,25,50,100];function Xw({currentPage:e,pageSize:t,totalRows:r,onPageChange:n,onPageSizeChange:i}){const s=Math.ceil(r/t);if(r<=Math.min(...bo))return null;const a=()=>{e>1&&n(e-1)},c=()=>{e<s&&n(e+1)},u=(e-1)*t+1,f=Math.min(e*t,r);return o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:3,py:2,borderTop:1,borderColor:"divider",bgcolor:"background.paper"},children:[o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(h.Typography,{variant:"body2",color:"text.primary",children:"Rows per page:"}),o.jsx(h.Select,{value:t,onChange:d=>i(Number(d.target.value)),size:"small",sx:{minWidth:70},children:bo.map(d=>o.jsx(h.MenuItem,{value:d,children:d},d))})]}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:2},children:[o.jsxs(h.Typography,{variant:"body2",color:"text.primary",children:[u,"–",f," of ",r]}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(h.IconButton,{onClick:a,disabled:e===1,size:"small",title:"Previous page",children:o.jsx(wv,{size:20})}),o.jsxs(h.Typography,{variant:"body2",color:"text.primary",children:["Page ",e," of ",s]}),o.jsx(h.IconButton,{onClick:c,disabled:e===s,size:"small",title:"Next page",children:o.jsx(Pi,{size:20})})]})]}),o.jsx(h.Box,{sx:{width:128}})]})}function Yw(){return o.jsx(h.Chip,{icon:o.jsx($s,{size:14}),label:"View Only",size:"small",variant:"outlined",sx:{bgcolor:"action.hover",borderColor:"divider",fontSize:"0.75rem",fontWeight:500}})}function Kw({schema:e,data:t,sortStack:r=[],filters:n=[],views:i=[],activeViewId:s="",isDirty:a=!1,isExporting:c=!1,columnVisibility:u={},columnOrder:f=[],columnWidths:d={},grouping:p=null,onSort:x,onSortAscending:l,onSortDescending:y,onOpenFilters:g,onOpenSort:m,onOpenFilterForColumn:E,onSelectView:D,onCreateView:C,onManageViews:N,onUpdateCurrentView:L,onSaveAsNewView:Q,onToggleDefault:k,onToggleFavorite:V,onRestoreView:j,onPermanentDelete:B,onExport:X,onOpenColumns:M,onUpdateColumnWidth:ee,onUpdateColumnOrder:Te,onUpdateColumnVisibility:ne,onClearFiltersForColumn:ae,onResetLayout:Se,onOpenGroup:Ne,onToggleGroupCollapse:be,onOpenAuditHistory:ze,onOpenSharePreset:_e,searchQuery:O,searchHistory:P=[],onAddToSearchHistory:I,onToggleSearchFavourite:R,onDeleteSearchHistory:Y,selectedRowIds:xe=new Set,onSearchChange:ve,onToggleRowSelection:ge,onToggleAllRows:oe,onRangeSelection:Le,onClearSelection:Ce,onExportSelected:Xe,currentPage:Ae=1,pageSize:ht=10,totalRowsBeforePagination:Ue=t.length,onPageChange:de,onPageSizeChange:st,isReadOnly:He=!1,userRole:Lt}){const[yt,lt]=w.useState(null),[gt,Ye]=w.useState(0),[Ht,wt]=w.useState(0),[$t,Nt]=w.useState(null),[Rt,Gt]=w.useState(!1);w.useRef(null);const mt=(f.length>0?f.map(re=>e.find(ye=>ye.name===re)).filter(re=>re!==void 0):e).filter(re=>u[re.name]!==!1),gr=e.filter(re=>u[re.name]===!1).length,mr=e.map(re=>re.name),ir=JSON.stringify(f)!==JSON.stringify(mr),Ct=(re,ye)=>{re.preventDefault(),re.stopPropagation(),lt(ye),Ye(re.clientX),wt(d[ye]||150)};w.useEffect(()=>{if(!yt)return;const re=je=>{const v=je.clientX-gt,S=Math.max(100,Ht+v);ee==null||ee(yt,S)},ye=()=>{lt(null)};return document.addEventListener("mousemove",re),document.addEventListener("mouseup",ye),()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",ye)}},[yt,gt,Ht,ee]);const Ge=re=>re==null?"-":typeof re=="object"?JSON.stringify(re):typeof re=="boolean"?re?"true":"false":String(re),Jt=re=>{x&&x(re)},bt=(re,ye)=>{if(!Te)return;const je=[...f.length>0?f:e.map(S=>S.name)],[v]=je.splice(re,1);je.splice(ye,0,v),Te(je)},Bt=re=>{if(!x)return;const ye=r.find(je=>je.column===re);(!ye||ye.direction!=="asc")&&x(re)},ie=re=>{if(!x)return;const ye=r.find(je=>je.column===re);ye?ye.direction==="asc"&&x(re):(x(re),setTimeout(()=>x(re),0))},Pt=re=>{if(!x)return;const ye=r.find(je=>je.column===re);ye&&(ye.direction==="asc"?(x(re),setTimeout(()=>x(re),0)):ye.direction==="desc"&&x(re))},Be=re=>{ne&&ne(re,!1)},we=(p==null?void 0:p.enabled)&&t.length>0&&t[0]&&"isGroupHeader"in t[0],Ke=mt.map(re=>re.name),We=O&&O.trim()?Tc(t,e,O,Ke):t;w.useEffect(()=>{const re=ye=>{!oe||!Ce||ye.target instanceof HTMLInputElement||ye.target instanceof HTMLTextAreaElement||((ye.ctrlKey||ye.metaKey)&&ye.key==="a"&&(ye.preventDefault(),oe(!0,We.length)),ye.key==="Escape"&&(ye.preventDefault(),Ce()))};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[oe,Ce,We.length]);const at=(re,ye)=>{ge&&(ye.shiftKey&&$t!==null?(ye.preventDefault(),Le&&Le($t,re)):(ge(re),Nt(re)))},Ut=We.length>0&&xe.size>0&&We.every((re,ye)=>xe.has(ye)),nt=xe.size>0&&!Ut,rt=ge&&oe,tt=re=>{var v;const ye=re.groupLevel,je=ye*24;return o.jsx(h.TableRow,{onClick:()=>be==null?void 0:be(re.groupKey),sx:{bgcolor:"action.hover","&:hover":{bgcolor:"action.selected"},cursor:"pointer",borderTop:2,borderColor:"divider"},children:o.jsx(h.TableCell,{colSpan:mt.length+(rt?1:0),sx:{pl:`${je+24}px`},children:o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[re.isCollapsed?o.jsx(Pi,{size:16}):o.jsx(Kn,{size:16}),o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:600},children:q0(ye,((v=p==null?void 0:p.levels[ye])==null?void 0:v.column)||"",re.groupValue)}),o.jsxs(h.Box,{sx:{px:1,py:.25,fontSize:"0.75rem",fontWeight:500,bgcolor:"primary.lighter",color:"primary.dark",borderRadius:2},children:[re.rowCount," ",re.rowCount===1?"row":"rows"]}),Object.keys(re.aggregates).length>0&&o.jsx(h.Typography,{variant:"caption",sx:{ml:1,color:"text.secondary"},children:Object.entries(re.aggregates).map(([S,T])=>K0(T)).filter(Boolean).join(" • ")})]})})},re.groupKey)},he=(re,ye)=>{const je=xe.has(ye);return o.jsxs(h.TableRow,{onClick:v=>{rt&&v.target===v.currentTarget&&at(ye,v)},sx:{bgcolor:je?"primary.lighter":"transparent","&:hover":{bgcolor:je?"primary.lighter":"action.hover"}},children:[rt&&o.jsx(h.TableCell,{sx:{width:48},children:o.jsx(h.Checkbox,{checked:je,onChange:v=>{v.stopPropagation(),at(ye,v)},onClick:v=>v.stopPropagation(),size:"small"})}),mt.map(v=>o.jsx(h.TableCell,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:d[v.name]?`${d[v.name]}px`:"150px"},children:Ge(re[v.name])},v.name))]},ye)};return o.jsx(Wc,{backend:t0,children:o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:2},children:[rt&&Xe&&Ce&&o.jsx(Gw,{selectedCount:xe.size,onExportSelected:Xe,onClearSelection:Ce}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[He&&o.jsx(Yw,{}),ve&&I&&R&&Y&&o.jsx(k2,{value:O||"",onChange:ve,searchHistory:P,onAddToHistory:I,onToggleFavourite:R,onDeleteHistory:Y,disabled:He}),o.jsx(h.Button,{onClick:()=>Gt(!Rt),variant:Rt?"contained":"outlined",size:"small",startIcon:o.jsx(Gs,{size:16}),sx:{textTransform:"none"},children:"Settings"}),Rt&&o.jsxs(h.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1,borderRadius:1,border:1,borderColor:"divider",bgcolor:"background.paper",overflowX:"auto",maxWidth:520,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-track":{bgcolor:"action.hover",borderRadius:1},"&::-webkit-scrollbar-thumb":{bgcolor:"action.disabled",borderRadius:1}},children:[!He&&m&&o.jsxs(h.Button,{onClick:m,variant:"text",startIcon:o.jsx(zs,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:["Sort",r.length>0&&o.jsx(h.Box,{component:"span",sx:{ml:.5,px:.75,py:.25,fontSize:"0.75rem",fontWeight:600,color:"primary.contrastText",bgcolor:"primary.main",borderRadius:2},children:r.length})]}),!He&&g&&o.jsxs(h.Button,{onClick:g,variant:"text",startIcon:o.jsx(ji,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:["Filter",n.length>0&&o.jsx(h.Box,{component:"span",sx:{ml:.5,px:.75,py:.25,fontSize:"0.75rem",fontWeight:600,color:"primary.contrastText",bgcolor:"primary.main",borderRadius:2},children:n.length})]}),D&&C&&N&&L&&i.length>0&&o.jsx(F2,{views:i||[],activeViewId:s||"",isDirty:a,onSelectView:D,onCreateView:C,onManageViews:N,onToggleDefault:k,onToggleFavorite:V,onRestoreView:j,onPermanentDelete:B,isReadOnly:He}),!He&&M&&o.jsx(I2,{onClick:M,hiddenCount:gr,hasCustomOrder:ir}),X&&o.jsx(h.Button,{onClick:X,disabled:c,variant:"text",startIcon:o.jsx(Hs,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:c?"Exporting...":"Export"}),!He&&Ne&&o.jsx(h.Button,{onClick:Ne,variant:"text",startIcon:o.jsx(Fc,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:"Group"}),ze&&o.jsx(h.Button,{onClick:ze,variant:"text",startIcon:o.jsx(Yv,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:"Audit History"}),_e&&o.jsx(h.Button,{onClick:_e,variant:"text",startIcon:o.jsx(x2,{size:18}),sx:{color:"text.primary",textTransform:"none",fontWeight:500,px:1.5,py:.5,minWidth:"auto",borderRadius:1,whiteSpace:"nowrap","&:hover":{bgcolor:"action.hover"}},children:"Share Report State"})]})]}),o.jsxs(h.Paper,{sx:{overflow:"hidden"},variant:"outlined",children:[o.jsx(h.Box,{sx:{overflowX:"auto"},children:o.jsxs(h.Table,{sx:{tableLayout:"fixed"},children:[o.jsx(h.TableHead,{sx:{position:"sticky",top:0,zIndex:3,backgroundColor:"background.paper"},children:o.jsxs(h.TableRow,{sx:{bgcolor:"action.hover"},children:[rt&&o.jsx(h.TableCell,{sx:{width:48},children:o.jsx(h.Checkbox,{checked:Ut,indeterminate:nt,onChange:re=>{oe==null||oe(re.target.checked,We.length)},size:"small",title:"Select all visible rows"})}),mt.map((re,ye)=>o.jsx(Iw,{column:re,index:ye,sortRule:r.find(je=>je.column===re.name),hasFilters:n.some(je=>je.column===re.name),isInSortStack:r.some(je=>je.column===re.name),width:d[re.name],onColumnClick:Jt,onMoveColumn:bt,onResizeStart:Ct,onSort:Jt,onRemoveSort:Pt,onSortAscending:Bt,onSortDescending:ie,onOpenFilterForColumn:E||(()=>{}),onClearFiltersForColumn:ae||(()=>{}),onHideColumn:Be,onManageColumns:M||(()=>{}),onManageViews:N||(()=>{}),onResetLayout:Se||(()=>{})},re.name))]})}),o.jsx(h.TableBody,{children:We.length===0?o.jsx(h.TableRow,{children:o.jsx(h.TableCell,{colSpan:mt.length+(rt?1:0),align:"center",sx:{py:4},children:o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"No data matches the current filters"})})}):we?We.map((re,ye)=>re.isGroupHeader?tt(re):he(re,ye)):We.map((re,ye)=>he(re,ye))})]})}),de&&st&&o.jsx(Xw,{currentPage:Ae,pageSize:ht,totalRows:Ue,onPageChange:de,onPageSizeChange:st}),!(de&&st)&&o.jsx(h.Box,{sx:{px:3,py:1.5,bgcolor:"action.hover",borderTop:1,borderColor:"divider"},children:o.jsxs(h.Typography,{variant:"body2",color:"text.secondary",children:["Showing ",We.length," ",We.length===1?"row":"rows"]})})]})]})})}function qw({schema:e,filters:t,onAddFilter:r,onRemoveFilter:n,onUpdateFilter:i,onClearAll:s,onClose:a,focusColumn:c}){const[u,f]=w.useState(""),[d,p]=w.useState(""),[x,l]=w.useState(""),[y,g]=w.useState(null);w.useEffect(()=>{c&&f(c)},[c]);const m=()=>{f(""),p(""),l(""),g(null)},E=B=>{const X=t[B];f(X.column),p(X.operator),l(X.value!==void 0?String(X.value):""),g(B)},D=e.filter(B=>B.type!=="mixed"&&B.type!=="null"&&B.type!=="array"&&B.type!=="object"),C=e.find(B=>B.name===u),N=C?ao(C.type):[],L=()=>!(!u||!d||oi(d)&&!x.trim()),Q=()=>{if(!L())return;const B={column:u,operator:d};if(oi(d)){const X=C==null?void 0:C.type;B.value=X==="number"?Number(x):x}y!==null?i(y,B):r(B),m()},k=B=>{var Te;const X=e.find(ne=>ne.name===B.column);if(!X)return"";const ee=((Te=ao(X.type).find(ne=>ne.value===B.operator))==null?void 0:Te.label)||B.operator;return oi(B.operator)?`${B.column} ${ee} "${B.value}"`:`${B.column} ${ee}`},V=y!==null,j=()=>{if(V&&y!==null){const B=t[y];if(B)return`Filter ${B.column} Data`}return c?`Filter ${c} Data`:"Filter Column Data"};return o.jsxs(h.Dialog,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{maxHeight:"80vh",display:"flex",flexDirection:"column"}},children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:2},children:[o.jsx(h.Typography,{variant:"h6",children:j()}),o.jsx(h.IconButton,{onClick:a,size:"small",children:o.jsx(ot,{size:20})})]}),o.jsxs(h.DialogContent,{dividers:!0,sx:{flex:1,overflow:"auto"},children:[o.jsxs(h.Box,{sx:{mb:4},children:[o.jsx(h.Typography,{variant:"subtitle2",sx:{mb:2,fontWeight:600},children:V?"Edit Filter":"Add Filter"}),o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:2},children:[o.jsxs(h.FormControl,{size:"small",fullWidth:!0,children:[o.jsx(h.InputLabel,{children:"Column"}),o.jsxs(h.Select,{value:u,onChange:B=>{f(B.target.value),p(""),l("")},label:"Column",children:[o.jsx(h.MenuItem,{value:"",children:"Select column..."}),D.map(B=>o.jsxs(h.MenuItem,{value:B.name,children:[B.name," (",B.type,")"]},B.name))]})]}),u&&o.jsxs(h.FormControl,{size:"small",fullWidth:!0,children:[o.jsx(h.InputLabel,{children:"Operator"}),o.jsxs(h.Select,{value:d,onChange:B=>{p(B.target.value),l("")},label:"Operator",children:[o.jsx(h.MenuItem,{value:"",children:"Select operator..."}),N.map(B=>o.jsx(h.MenuItem,{value:B.value,children:B.label},B.value))]})]}),d&&oi(d)&&o.jsx(h.TextField,{size:"small",fullWidth:!0,type:(C==null?void 0:C.type)==="number"?"number":"text",value:x,onChange:B=>l(B.target.value),label:"Value",placeholder:"Enter value..."}),o.jsxs(h.Box,{sx:{display:"flex",gap:1},children:[o.jsx(h.Button,{onClick:Q,disabled:!L(),variant:"contained",fullWidth:!0,startIcon:V?o.jsx(Ci,{size:16}):o.jsx(_n,{size:16}),children:V?"Update Filter":"Add Filter"}),V&&o.jsx(h.Button,{onClick:m,variant:"outlined",sx:{minWidth:100},children:"Cancel"})]})]})]}),o.jsxs(h.Box,{children:[o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[o.jsxs(h.Typography,{variant:"subtitle2",sx:{fontWeight:600},children:["Active Filters (",t.length,")"]}),t.length>0&&o.jsx(h.Button,{onClick:s,size:"small",color:"error",startIcon:o.jsx(kc,{size:14}),sx:{textTransform:"none"},children:"Clear All"})]}),t.length===0?o.jsx(h.Box,{sx:{py:2,textAlign:"center",border:1,borderColor:"divider",borderRadius:1,bgcolor:"action.hover"},children:o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"No filters applied"})}):o.jsx(h.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:t.map((B,X)=>o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,bgcolor:"primary.lighter",border:1,borderColor:"primary.light",borderRadius:1},children:[o.jsx(h.Typography,{variant:"body2",children:k(B)}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[o.jsx(h.IconButton,{onClick:()=>E(X),size:"small",color:"primary",title:"Edit filter",children:o.jsx(Ci,{size:16})}),o.jsx(h.IconButton,{onClick:()=>n(X),size:"small",sx:{"&:hover":{color:"error.main"}},title:"Delete filter",children:o.jsx(ot,{size:16})})]})]},X))})]})]}),o.jsx(h.DialogActions,{sx:{px:3,py:2},children:o.jsx(h.Button,{onClick:a,variant:"outlined",fullWidth:!0,children:"Close"})})]})}function Jw({schema:e,sortStack:t,onUpdateSortStack:r,onClose:n}){const[i,s]=w.useState(""),[a,c]=w.useState("asc"),u=()=>!(t.length>=3||!i||t.some(m=>m.column===i)),f=()=>{if(!u())return;const m=t.length+1,E={column:i,direction:a,priority:m};r([...t,E]),s(""),c("asc")},d=m=>{const D=t.filter((C,N)=>N!==m).map((C,N)=>({...C,priority:N+1}));r(D)},p=m=>{const E=[...t];E[m]={...E[m],direction:E[m].direction==="asc"?"desc":"asc"},r(E)},x=()=>{r([])},l=m=>{if(m===0)return;const E=[...t];[E[m-1],E[m]]=[E[m],E[m-1]];const D=E.map((C,N)=>({...C,priority:N+1}));r(D)},y=m=>{if(m===t.length-1)return;const E=[...t];[E[m],E[m+1]]=[E[m+1],E[m]];const D=E.map((C,N)=>({...C,priority:N+1}));r(D)},g=e.filter(m=>!t.some(E=>E.column===m.name));return o.jsxs(h.Dialog,{open:!0,onClose:n,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{maxHeight:"80vh",display:"flex",flexDirection:"column"}},children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:2},children:[o.jsx(h.Typography,{variant:"h6",children:"Multi-Level Sort"}),o.jsx(h.IconButton,{onClick:n,size:"small",children:o.jsx(ot,{size:20})})]}),o.jsxs(h.DialogContent,{dividers:!0,sx:{flex:1,overflow:"auto"},children:[o.jsxs(h.Box,{sx:{mb:4},children:[o.jsx(h.Typography,{variant:"subtitle2",sx:{mb:2,fontWeight:600},children:"Select column for sorting (Primary, Secondary, Tertiary)"}),o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:2},children:[o.jsxs(h.FormControl,{size:"small",fullWidth:!0,disabled:t.length>=3,children:[o.jsx(h.InputLabel,{children:"Column"}),o.jsxs(h.Select,{value:i,onChange:m=>s(m.target.value),label:"Column",children:[o.jsx(h.MenuItem,{value:"",children:"Select column..."}),g.map(m=>o.jsxs(h.MenuItem,{value:m.name,children:[m.name," (",m.type,")"]},m.name))]})]}),o.jsx(h.Button,{onClick:f,disabled:!u(),variant:"contained",fullWidth:!0,startIcon:o.jsx(_n,{size:16}),children:"Add Sort Column"})]})]}),o.jsxs(h.Box,{children:[o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[o.jsxs(h.Typography,{variant:"subtitle2",sx:{fontWeight:600},children:["Sorted Column Sequence (",t.length,"/3)"]}),t.length>0&&o.jsx(h.Button,{onClick:x,size:"small",color:"error",startIcon:o.jsx(Kr,{size:14}),sx:{textTransform:"none"},children:"Clear All"})]}),t.length===0?o.jsx(h.Box,{sx:{py:2,textAlign:"center",border:1,borderColor:"divider",borderRadius:1,bgcolor:"action.hover"},children:o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"No sorting applied"})}):o.jsx(h.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:t.map((m,E)=>o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:2,px:2,py:1.5,bgcolor:"primary.lighter",border:1,borderColor:"primary.light",borderRadius:1},children:[o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(h.Chip,{label:m.priority,size:"small",color:"primary",sx:{width:24,height:24,fontSize:"0.75rem",fontWeight:700}}),o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[o.jsx(h.IconButton,{onClick:()=>l(E),disabled:E===0,size:"small",sx:{p:0,width:16,height:16},children:o.jsx(us,{size:12})}),o.jsx(h.IconButton,{onClick:()=>y(E),disabled:E===t.length-1,size:"small",sx:{p:0,width:16,height:16,transform:"rotate(180deg)"},children:o.jsx(us,{size:12})})]})]}),o.jsxs(h.Box,{sx:{flex:1},children:[o.jsx(h.Typography,{variant:"body2",component:"span",sx:{fontWeight:500},children:m.column}),o.jsxs(h.Typography,{variant:"caption",component:"span",color:"text.secondary",sx:{ml:1},children:["(",m.direction==="asc"?"Ascending":"Descending",")"]})]}),o.jsx(h.IconButton,{onClick:()=>p(E),size:"small",color:"primary",title:"Toggle direction",children:o.jsx(zs,{size:16})}),o.jsx(h.IconButton,{onClick:()=>d(E),size:"small",sx:{"&:hover":{color:"error.main"}},children:o.jsx(ot,{size:16})})]},E))})]})]}),o.jsx(h.DialogActions,{sx:{px:3,py:2},children:o.jsx(h.Button,{onClick:n,variant:"outlined",fullWidth:!0,children:"Close"})})]})}function Zw({views:e,activeViewId:t,onSelectView:r,onCreateView:n,onEditView:i,onDeleteView:s,onRestoreView:a,onPermanentDelete:c,onClose:u}){return o.jsxs(h.Dialog,{open:!0,onClose:u,maxWidth:"md",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:["Manage Views",o.jsx(h.IconButton,{onClick:u,size:"small",sx:{color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsxs(h.DialogContent,{children:[o.jsx(h.Box,{sx:{mb:2},children:o.jsx(h.Button,{onClick:n,variant:"contained",startIcon:o.jsx(_n,{size:16}),size:"small",children:"Create New Report View"})}),o.jsx(h.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.map(f=>o.jsx(h.Paper,{sx:{p:2,border:1,borderColor:f.isDeleted?"error.light":t===f.id?"primary.main":"divider",bgcolor:f.isDeleted?"error.lighter":t===f.id?"primary.lighter":"background.paper",opacity:f.isDeleted?.75:1,cursor:f.isDeleted?"default":"pointer","&:hover":f.isDeleted?{}:{bgcolor:"action.hover"}},onClick:()=>!f.isDeleted&&r(f.id),elevation:0,children:o.jsxs(h.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[o.jsxs(h.Box,{sx:{flex:1},children:[o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500,textDecoration:f.isDeleted?"line-through":"none",color:f.isDeleted?"text.secondary":"text.primary"},children:f.name}),f.isDeleted&&o.jsx(h.Chip,{label:"Deleted",size:"small",color:"error",sx:{height:20}}),f.isDefault&&o.jsx(h.Chip,{label:"Default",size:"small",color:"primary",sx:{height:20}}),f.isFavorite&&o.jsx(h.Chip,{label:"★ Favorite",size:"small",sx:{height:20}})]}),f.description&&o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:f.description})]}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[!f.isDeleted&&o.jsxs(o.Fragment,{children:[o.jsx(h.IconButton,{size:"small",onClick:d=>{d.stopPropagation(),i(f.id)},title:"Edit view",children:o.jsx(Ci,{size:16})}),o.jsx(h.IconButton,{size:"small",onClick:d=>{d.stopPropagation(),s(f.id)},title:"Delete view",sx:{"&:hover":{color:"error.main"}},children:o.jsx(Kr,{size:16})})]}),f.isDeleted&&a&&o.jsx(h.IconButton,{size:"small",onClick:d=>{d.stopPropagation(),a(f.id)},title:"Restore view",sx:{color:"success.main"},children:o.jsx(Mi,{size:16})}),f.isDeleted&&c&&o.jsx(h.IconButton,{size:"small",onClick:d=>{d.stopPropagation(),c(f.id)},title:"Delete permanently",sx:{color:"error.main"},children:o.jsx(Kr,{size:16})})]})]})},f.id))})]}),o.jsx(h.DialogActions,{sx:{px:3,pb:2},children:o.jsx(h.Button,{onClick:u,variant:"outlined",children:"Close"})})]})}function Do({currentSnapshot:e,onSave:t,onClose:r,isEditMode:n=!1,initialName:i="",initialDescription:s="",initialIsDefault:a=!1}){const[c,u]=w.useState(i),[f,d]=w.useState(s),[p,x]=w.useState(a),l=()=>{c.trim()&&(t(c.trim(),f.trim(),p),r())},y=m=>{m.key==="Enter"&&!m.shiftKey?l():m.key==="Escape"&&r()},g=()=>n&&i?`Update ${i} view`:"Create New Report View";return o.jsxs(h.Dialog,{open:!0,onClose:r,maxWidth:"sm",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:[g(),o.jsx(h.IconButton,{onClick:r,size:"small",sx:{color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsx(h.DialogContent,{children:o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[o.jsx(h.TextField,{label:"View Name",required:!0,value:c,onChange:m=>u(m.target.value),onKeyDown:y,placeholder:"e.g., Active Users",autoFocus:!0,fullWidth:!0,size:"small"}),o.jsx(h.TextField,{label:"Description (optional)",value:f,onChange:m=>d(m.target.value),placeholder:"Brief description of this view",multiline:!0,rows:2,fullWidth:!0,size:"small"}),o.jsxs(h.Paper,{sx:{p:2,bgcolor:"action.hover"},variant:"outlined",children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500,mb:1},children:"This view will capture:"}),o.jsxs(h.Box,{component:"ul",sx:{m:0,pl:2,"& li":{fontSize:"0.875rem",color:"text.secondary"}},children:[o.jsxs("li",{children:[e.filters.length," filter",e.filters.length!==1?"s":""]}),o.jsxs("li",{children:["Sorting: ",Q0(e.sortStack)]}),o.jsx("li",{children:"Column order & visibility"})]})]}),!n&&o.jsx(h.FormControlLabel,{control:o.jsx(h.Checkbox,{checked:p,onChange:m=>x(m.target.checked),size:"small"}),label:o.jsx(h.Typography,{variant:"body2",children:"Set as default view"})})]})}),o.jsxs(h.DialogActions,{sx:{px:3,pb:2},children:[o.jsx(h.Button,{onClick:r,variant:"outlined",color:"inherit",children:"Cancel"}),o.jsx(h.Button,{onClick:l,disabled:!c.trim(),variant:"contained",startIcon:o.jsx(Li,{size:16}),children:n?"Save Changes":"Create Report View"})]})]})}function Qw({viewName:e,onConfirm:t,onCancel:r}){return o.jsxs(h.Dialog,{open:!0,onClose:r,maxWidth:"sm",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:["Delete View",o.jsx(h.IconButton,{onClick:r,size:"small",sx:{color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsx(h.DialogContent,{children:o.jsxs(h.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5,mt:1},children:[o.jsx(rn,{size:20,color:"error",style:{flexShrink:0,marginTop:2}}),o.jsxs(h.Box,{children:[o.jsxs(h.Typography,{variant:"body2",sx:{mb:1},children:["Are you sure you want to delete the view ",o.jsxs("strong",{children:['"',e,'"']}),"?"]}),o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"This action cannot be undone."})]})]})}),o.jsxs(h.DialogActions,{sx:{px:3,pb:2},children:[o.jsx(h.Button,{onClick:r,variant:"outlined",color:"inherit",children:"Cancel"}),o.jsx(h.Button,{onClick:t,variant:"contained",color:"error",children:"Delete View"})]})]})}const Ao=80,Oo=600,ko="COLUMN";function eT({column:e,index:t,isVisible:r,width:n,onToggleVisibility:i,onWidthChange:s,moveColumn:a}){const c=w.useRef(null),[u,f]=w.useState(n.toString()),[{handlerId:d},p]=Xc({accept:ko,collect(E){return{handlerId:E.getHandlerId()}},hover(E,D){var j;if(!c.current)return;const C=E.index,N=t;if(C===N)return;const L=(j=c.current)==null?void 0:j.getBoundingClientRect(),Q=(L.bottom-L.top)/2,k=D.getClientOffset(),V=((k==null?void 0:k.y)??0)-L.top;C<N&&V<Q||C>N&&V>Q||(a(C,N),E.index=N)}}),[{isDragging:x},l]=Gc({type:ko,item:()=>({index:t}),collect:E=>({isDragging:E.isDragging()})});l(p(c));const y=()=>{const E=parseInt(u);if(isNaN(E)){f(n.toString());return}const D=Math.max(Ao,Math.min(Oo,E));f(D.toString()),s(e.name,D)},g=E=>{(E===""||/^\d+$/.test(E))&&f(E)},m=E=>({string:"primary",number:"success",boolean:"secondary",array:"warning",object:"error",null:"default",mixed:"default"})[E]||"default";return o.jsxs(h.TableRow,{ref:c,"data-handler-id":d,sx:{opacity:x?.5:1,"&:hover":{bgcolor:"action.hover"},cursor:"move"},children:[o.jsx(h.TableCell,{children:o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(h.Box,{sx:{color:"text.secondary",cursor:"grab","&:active":{cursor:"grabbing"}},children:o.jsx(us,{size:16})}),o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:e.name})]})}),o.jsx(h.TableCell,{children:o.jsx(h.Chip,{label:e.type.toUpperCase(),size:"small",color:m(e.type),sx:{height:20,fontSize:"0.7rem",fontWeight:600}})}),o.jsxs(h.TableCell,{children:[o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(h.TextField,{type:"text",value:u,onChange:E=>g(E.target.value),onBlur:y,placeholder:"150",size:"small",sx:{width:80},InputProps:{sx:{fontSize:"0.875rem"}}}),o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:"px"})]}),o.jsxs(h.Typography,{variant:"caption",color:"text.disabled",sx:{mt:.5,display:"block"},children:["min: ",Ao,", max: ",Oo]})]}),o.jsx(h.TableCell,{children:o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(h.IconButton,{onClick:()=>i(e.name,!r),title:r?"Hide column":"Show column",size:"small",children:r?o.jsx($s,{size:16}):o.jsx(Ac,{size:16,style:{opacity:.4}})}),o.jsx(h.Chip,{label:r?"Active":"Hidden",size:"small",color:r?"success":"default",sx:{height:20,fontSize:"0.7rem"}})]})})]})}function tT({schema:e,columnVisibility:t,columnOrder:r,columnWidths:n={},views:i=[],activeViewId:s="",onUpdateColumnVisibility:a,onUpdateColumnOrder:c,onUpdateColumnWidth:u,onResetLayout:f,onSaveToCurrentView:d,onSaveToAllViews:p,onSelectView:x,onClose:l}){const[y,g]=w.useState(!1),[m,E]=w.useState(r),[D,C]=w.useState("all"),[N,L]=w.useState(null),Q=(ne,ae)=>{const Se=[...m],[Ne]=Se.splice(ne,1);Se.splice(ae,0,Ne),E(Se),c(Se)},k=()=>{f(),g(!1)},j=m.map(ne=>e.find(ae=>ae.name===ne)).filter(ne=>ne!==void 0).filter(ne=>{const ae=t[ne.name]??!0;return D==="active"?ae:D==="hidden"?!ae:!0}),B=Object.values(t).filter(ne=>ne).length,X=e.length,M=i.find(ne=>ne.id===s),ee=i.filter(ne=>!ne.isDeleted),Te=w.useMemo(()=>{if(!M)return!1;const ne=M.snapshot,ae=JSON.stringify(t)!==JSON.stringify(ne.columnVisibility),Se=JSON.stringify(r)!==JSON.stringify(ne.columnOrder),Ne=JSON.stringify(n)!==JSON.stringify(ne.columnWidths);return ae||Se||Ne},[M,t,r,n]);return o.jsx(Wc,{backend:t0,children:o.jsxs(h.Dialog,{open:!0,onClose:l,maxWidth:"lg",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{children:[o.jsxs(h.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[o.jsxs(h.Box,{sx:{flex:1},children:[o.jsx(h.Typography,{variant:"h6",children:"Manage Columns"}),o.jsxs(h.Typography,{variant:"body2",color:"text.secondary",children:[B," of ",X," columns visible • Drag to reorder"]})]}),ee.length>0&&x&&o.jsxs(h.Box,{sx:{ml:2},children:[o.jsx(h.Typography,{variant:"caption",color:"text.secondary",sx:{mb:.5,display:"block"},children:"View:"}),o.jsx(h.Button,{onClick:ne=>L(ne.currentTarget),variant:"outlined",size:"small",endIcon:o.jsx(Kn,{size:16}),sx:{minWidth:180,justifyContent:"space-between"},children:o.jsx(h.Box,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:(M==null?void 0:M.name)||"Select View"})}),o.jsx(h.Menu,{anchorEl:N,open:!!N,onClose:()=>L(null),children:ee.map(ne=>o.jsx(h.MenuItem,{onClick:()=>{x(ne.id),L(null)},selected:ne.id===s,children:ne.name},ne.id))})]}),o.jsx(h.IconButton,{onClick:l,size:"small",sx:{ml:2,color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsxs(h.Tabs,{value:D,onChange:(ne,ae)=>C(ae),sx:{mt:2},children:[o.jsx(h.Tab,{label:"All",value:"all"}),o.jsx(h.Tab,{label:"Active",value:"active"}),o.jsx(h.Tab,{label:"Hidden",value:"hidden"})]})]}),o.jsx(h.DialogContent,{dividers:!0,sx:{p:0,overflow:"hidden"},children:o.jsx(h.Box,{sx:{overflow:"auto",maxHeight:"60vh"},children:o.jsxs(h.Table,{stickyHeader:!0,children:[o.jsx(h.TableHead,{children:o.jsxs(h.TableRow,{children:[o.jsx(h.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Column Name"}),o.jsx(h.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Type"}),o.jsx(h.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Width"}),o.jsx(h.TableCell,{sx:{fontWeight:600,textTransform:"uppercase",fontSize:"0.75rem"},children:"Visibility"})]})}),o.jsx(h.TableBody,{children:j.length===0?o.jsx(h.TableRow,{children:o.jsx(h.TableCell,{colSpan:4,align:"center",children:o.jsx(h.Typography,{variant:"body2",color:"text.secondary",sx:{py:4},children:"No columns in this category"})})}):j.map((ne,ae)=>o.jsx(eT,{column:ne,index:ae,isVisible:t[ne.name]??!0,width:n[ne.name]||150,onToggleVisibility:a,onWidthChange:u||(()=>{}),moveColumn:Q},ne.name))})]})})}),o.jsxs(h.DialogActions,{sx:{px:3,pb:2,justifyContent:"space-between",flexWrap:"wrap"},children:[o.jsx(h.Button,{onClick:()=>g(!0),disabled:!Te,variant:"outlined",color:"inherit",startIcon:o.jsx(Mi,{size:16}),size:"small",children:"Reset to Default Layout"}),o.jsxs(h.Stack,{direction:"row",spacing:1.5,children:[o.jsx(h.Button,{onClick:l,variant:"outlined",color:"inherit",size:"small",children:"Cancel"}),d&&o.jsx(h.Button,{onClick:()=>{d(),l()},disabled:!Te,variant:"contained",startIcon:o.jsx(Li,{size:16}),size:"small",children:"Save to Current View"}),p&&o.jsx(h.Button,{onClick:()=>{p(),l()},disabled:!Te,variant:"contained",color:"success",startIcon:o.jsx(Zv,{size:16}),size:"small",children:"Save to All Views"})]})]}),y&&o.jsxs(h.Dialog,{open:!0,onClose:()=>g(!1),maxWidth:"xs",children:[o.jsx(h.DialogTitle,{children:"Reset column layout?"}),o.jsx(h.DialogContent,{children:o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"This will restore default visibility, order, and widths for all columns."})}),o.jsxs(h.DialogActions,{children:[o.jsx(h.Button,{onClick:()=>g(!1),variant:"outlined",color:"inherit",children:"Cancel"}),o.jsx(h.Button,{onClick:k,variant:"contained",color:"error",children:"Reset Layout"})]})]})]})})}function r0({content:e,type:t="tooltip",className:r=""}){const[n,i]=w.useState(null),s=!!n;return t==="popover"?o.jsxs(o.Fragment,{children:[o.jsx(h.IconButton,{onClick:a=>{a.preventDefault(),a.stopPropagation(),i(a.currentTarget)},size:"small","aria-label":"More information",sx:{width:16,height:16,color:"primary.main","&:hover":{bgcolor:"primary.lighter"}},className:r,children:o.jsx(Vn,{size:16})}),o.jsx(h.Popover,{open:s,anchorEl:n,onClose:()=>i(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{mt:1},children:o.jsx(h.Box,{sx:{p:2,maxWidth:288},children:o.jsx(h.Typography,{variant:"body2",sx:{lineHeight:1.6},children:e})})})]}):o.jsx(h.Tooltip,{title:e,placement:"top",arrow:!0,children:o.jsx(h.IconButton,{size:"small","aria-label":"More information",onClick:a=>{a.preventDefault(),a.stopPropagation()},sx:{width:16,height:16,color:"primary.main","&:hover":{bgcolor:"primary.lighter"}},className:r,children:o.jsx(Vn,{size:16})})})}function rT({schema:e,grouping:t,onApply:r,onClose:n}){var N;const[i,s]=w.useState(t||{enabled:!1,levels:[],collapsedGroups:[]}),[a,c]=w.useState(""),[u,f]=w.useState(null),d=$0(e),p=d.filter(L=>!i.levels.some((Q,k)=>Q.column===L.name&&k!==u)),x=i.levels.length<3&&p.length>0,l=()=>{!x||!a||(s({...i,levels:[...i.levels,{column:a}],enabled:!0}),c(""))},y=L=>{const Q=i.levels.filter((k,V)=>V!==L);if(Q.length===0){r(null),n();return}s({...i,levels:Q,enabled:Q.length>0})},g=()=>{if(u===null||!a)return;const L=[...i.levels];L[u]={column:a},s({...i,levels:L}),f(null),c("")},m=()=>{f(null),c("")},E=(L,Q)=>{const k=Q==="up"?L-1:L+1;if(k<0||k>=i.levels.length)return;const V=[...i.levels],[j]=V.splice(L,1);V.splice(k,0,j),s({...i,levels:V})},D=()=>{r(null),n()},C=()=>{i.levels.length===0?r(null):r({...i,enabled:!0,collapsedGroups:(t==null?void 0:t.collapsedGroups)||[]}),n()};return o.jsxs(h.Dialog,{open:!0,onClose:n,maxWidth:"md",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",gap:1,pb:1},children:["Group Configuration",o.jsx(r0,{content:"Group rows by column values. Maximum 3 group levels allowed. Only STRING and BOOLEAN columns can be used for grouping.",type:"popover"}),o.jsx(h.IconButton,{onClick:n,size:"small",sx:{ml:"auto",color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsx(h.DialogContent,{dividers:!0,children:o.jsxs(h.Stack,{spacing:3,sx:{py:1},children:[u===null&&o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500,mb:1.5},children:"Add Group Level"}),o.jsx(h.FormControl,{fullWidth:!0,size:"small",sx:{mb:1.5},children:o.jsxs(h.Select,{value:a,onChange:L=>c(L.target.value),disabled:!x,displayEmpty:!0,children:[o.jsx(h.MenuItem,{value:"",children:"Select a column..."}),p.map(L=>o.jsxs(h.MenuItem,{value:L.name,children:[L.name," (",L.type.toUpperCase(),")"]},L.name))]})}),o.jsx(h.Button,{onClick:l,disabled:!x||!a,variant:"outlined",startIcon:o.jsx(_n,{size:16}),fullWidth:!0,children:"Add Group Level"}),i.levels.length===3&&o.jsx(h.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",textAlign:"center",mt:1},children:"Maximum group levels (3) reached"}),d.length===0&&o.jsx(h.Typography,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",py:2},children:"No groupable columns available. Only STRING and BOOLEAN columns can be grouped."})]}),u!==null&&o.jsxs(h.Alert,{severity:"warning",sx:{mb:2},children:[o.jsxs(h.Typography,{variant:"body2",sx:{fontWeight:500,mb:1},children:["Edit Group Level ",u+1]}),o.jsx(h.FormControl,{fullWidth:!0,size:"small",sx:{mb:1.5},children:o.jsxs(h.Select,{value:a,onChange:L=>c(L.target.value),children:[o.jsx(h.MenuItem,{value:"",children:"Select a column..."}),o.jsxs(h.MenuItem,{value:i.levels[u].column,children:[i.levels[u].column," (",(N=e.find(L=>L.name===i.levels[u].column))==null?void 0:N.type.toUpperCase(),")"]}),p.filter(L=>L.name!==i.levels[u].column).map(L=>o.jsxs(h.MenuItem,{value:L.name,children:[L.name," (",L.type.toUpperCase(),")"]},L.name))]})}),o.jsxs(h.Stack,{direction:"row",spacing:1,children:[o.jsx(h.Button,{onClick:g,disabled:!a,variant:"contained",color:"warning",fullWidth:!0,size:"small",children:"Save"}),o.jsx(h.Button,{onClick:m,variant:"outlined",color:"inherit",fullWidth:!0,size:"small",children:"Cancel"})]})]}),i.levels.length>0&&u===null&&o.jsxs(h.Box,{children:[o.jsxs(h.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1.5},children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:"Active Group Levels"}),o.jsx(h.Button,{onClick:D,size:"small",color:"error",sx:{fontSize:"0.75rem",textTransform:"none"},children:"Clear All"})]}),o.jsx(h.Stack,{spacing:1.5,children:i.levels.map((L,Q)=>{const k=e.find(V=>V.name===L.column);return o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1.5,p:2,border:1,borderColor:"divider",borderRadius:1,bgcolor:"background.paper"},children:[o.jsx(h.Chip,{label:`L${Q+1}`,size:"small",color:"primary",sx:{width:40,fontWeight:600}}),o.jsxs(h.Box,{sx:{flex:1},children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:L.column}),o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:k==null?void 0:k.type.toUpperCase()})]}),o.jsxs(h.Stack,{direction:"row",spacing:.5,children:[o.jsx(h.IconButton,{size:"small",onClick:()=>E(Q,"up"),disabled:Q===0,children:o.jsx(Ev,{size:16})}),o.jsx(h.IconButton,{size:"small",onClick:()=>E(Q,"down"),disabled:Q===i.levels.length-1,children:o.jsx(Kn,{size:16})}),o.jsx(h.IconButton,{size:"small",onClick:()=>handleEditLevel(Q),children:o.jsx(Ci,{size:16})}),o.jsx(h.IconButton,{size:"small",onClick:()=>y(Q),sx:{color:"error.main"},children:o.jsx(Kr,{size:16})})]})]},Q)})})]})]})}),o.jsxs(h.DialogActions,{sx:{px:3,pb:2},children:[o.jsx(h.Button,{onClick:n,variant:"outlined",color:"inherit",children:"Cancel"}),o.jsx(h.Button,{onClick:C,variant:"contained",children:"Apply Grouping"})]})]})}const nT={filters:ji,sorting:zs,visibility:$s,order:Dc,widths:c2,grouping:Fc};function iT({changes:e,onClose:t}){const r=n=>({filters:"primary",sorting:"secondary",visibility:"success",order:"warning",widths:"info",grouping:"error"})[n]||"default";return o.jsxs(h.Dialog,{open:!0,onClose:t,maxWidth:"sm",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:["View Changes Summary",o.jsx(h.IconButton,{onClick:t,size:"small",sx:{color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsx(h.DialogContent,{dividers:!0,children:e.length===0?o.jsx(h.Box,{sx:{textAlign:"center",py:4},children:o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"No changes detected"})}):o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"The following modifications have been made to this view:"}),o.jsx(h.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:e.map((n,i)=>{const s=nT[n.category];return o.jsxs(h.Paper,{elevation:0,sx:{display:"flex",gap:1.5,p:1.5,border:1,borderColor:"divider",borderRadius:1},children:[o.jsx(h.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:1,bgcolor:`${r(n.category)}.lighter`,color:`${r(n.category)}.main`,flexShrink:0},children:o.jsx(s,{size:16})}),o.jsxs(h.Box,{sx:{flex:1,minWidth:0},children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:n.label}),o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:n.description})]})]},i)})})]})}),o.jsx(h.DialogActions,{sx:{px:3,pb:2,bgcolor:"action.hover"},children:o.jsx(h.Button,{onClick:t,variant:"outlined",color:"inherit",children:"Close"})})]})}function sT({viewName:e,isDefaultView:t,changes:r=[],onSaveToCurrentView:n,onSaveAsNewView:i,onCancel:s}){const[a,c]=w.useState(!1);return o.jsxs(o.Fragment,{children:[o.jsx(h.Box,{sx:{position:"sticky",bottom:0,width:"100%",bgcolor:"background.paper",borderTop:1,borderColor:"divider",boxShadow:4,zIndex:10},children:o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:2},children:[o.jsxs(h.Typography,{variant:"body2",sx:{fontWeight:500},children:['Unsaved changes to "',e,'"']}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[!t&&n&&o.jsx(h.Button,{onClick:n,variant:"contained",startIcon:o.jsx(Li,{size:16}),size:"small",children:"Save to Current View"}),o.jsx(h.Button,{onClick:i,variant:"contained",color:"success",startIcon:o.jsx(Vv,{size:16}),size:"small",children:"Save as New View"}),o.jsx(h.IconButton,{onClick:s,title:"Revert changes",size:"small",children:o.jsx(ot,{size:20})}),r.length>0&&o.jsx(h.IconButton,{onClick:()=>c(!0),title:"View changes summary",size:"small",children:o.jsx(Dv,{size:20})})]})]})}),a&&o.jsx(iT,{changes:r,onClose:()=>c(!1)})]})}function aT({onExportAnyway:e,onSaveAndExport:t,onCancel:r}){return o.jsx(h.Box,{sx:{mb:2},children:o.jsxs(h.Alert,{severity:"warning",icon:o.jsx(rn,{size:20}),action:o.jsx(h.IconButton,{size:"small",onClick:r,sx:{color:"warning.main"},children:o.jsx(ot,{size:20})}),sx:{alignItems:"flex-start"},children:[o.jsx(h.Typography,{variant:"subtitle2",sx:{fontWeight:600,mb:.5},children:"You are exporting with unsaved view changes"}),o.jsx(h.Typography,{variant:"body2",sx:{mb:1.5},children:"Your current view has unsaved changes. Choose how to proceed:"}),o.jsxs(h.Box,{sx:{display:"flex",gap:1},children:[o.jsx(h.Button,{onClick:t,variant:"contained",color:"primary",startIcon:o.jsx(Li,{size:14}),size:"small",children:"Save View & Export"}),o.jsx(h.Button,{onClick:e,variant:"contained",color:"warning",startIcon:o.jsx(Hs,{size:14}),size:"small",children:"Export Anyway"})]})]})})}function oT({auditHistory:e,onClose:t}){const[r,n]=w.useState(new Set),i=a=>{n(c=>{const u=new Set(c);return u.has(a)?u.delete(a):u.add(a),u})},s=[...e].sort((a,c)=>new Date(c.timestamp).getTime()-new Date(a.timestamp).getTime());return o.jsxs(h.Dialog,{open:!0,onClose:t,maxWidth:"lg",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:[o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"h6",children:"Audit History"}),o.jsxs(h.Typography,{variant:"caption",color:"text.secondary",children:[s.length," event",s.length!==1?"s":""," recorded"]})]}),o.jsx(h.IconButton,{onClick:t,size:"small",sx:{color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsx(h.DialogContent,{sx:{pt:2},children:s.length===0?o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",py:6,textAlign:"center"},children:[o.jsx(lo,{size:48,style:{opacity:.3,marginBottom:12}}),o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"No audit events recorded yet"}),o.jsx(h.Typography,{variant:"caption",color:"text.disabled",sx:{mt:.5},children:"Changes to this report will appear here"})]}):o.jsx(h.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:s.map(a=>{const c=r.has(a.id);return im(a.feature),o.jsxs(h.Paper,{variant:"outlined",children:[o.jsxs(h.Box,{onClick:()=>i(a.id),sx:{px:2,py:1.5,display:"flex",alignItems:"center",gap:1.5,cursor:"pointer","&:hover":{bgcolor:"action.hover"}},children:[o.jsx(h.Box,{sx:{flexShrink:0},children:c?o.jsx(Kn,{size:16,style:{opacity:.5}}):o.jsx(Pi,{size:16,style:{opacity:.5}})}),o.jsx(h.Chip,{label:nm(a.feature),size:"small",sx:{height:20,fontSize:"0.75rem"}}),o.jsx(h.Typography,{variant:"body2",sx:{flex:1,fontWeight:500},children:rm(a.action)}),o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexShrink:0},children:[o.jsx(lo,{size:14,style:{opacity:.4}}),o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:sm(a.timestamp)})]}),a.user&&o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexShrink:0},children:[o.jsx(T2,{size:14,style:{opacity:.4}}),o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:a.user})]})]}),o.jsx(h.Collapse,{in:c,children:o.jsxs(h.Box,{sx:{px:2,pb:2,pt:1,borderTop:1,borderColor:"divider",bgcolor:"action.hover"},children:[a.previousState&&o.jsxs(h.Box,{sx:{mb:2},children:[o.jsx(h.Typography,{variant:"caption",sx:{fontWeight:600,color:"text.secondary",textTransform:"uppercase",mb:.5,display:"block"},children:"Previous State"}),o.jsx(h.Box,{component:"pre",sx:{fontSize:"0.75rem",bgcolor:"background.paper",border:1,borderColor:"divider",borderRadius:1,p:1,overflow:"auto",maxHeight:200},children:eo(a.previousState)})]}),a.newState&&o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"caption",sx:{fontWeight:600,color:"text.secondary",textTransform:"uppercase",mb:.5,display:"block"},children:"New State"}),o.jsx(h.Box,{component:"pre",sx:{fontSize:"0.75rem",bgcolor:"background.paper",border:1,borderColor:"divider",borderRadius:1,p:1,overflow:"auto",maxHeight:200},children:eo(a.newState)})]})]})})]},a.id)})})})]})}function lT({onSave:e,onClose:t}){const[r,n]=w.useState(""),[i,s]=w.useState(""),[a,c]=w.useState(""),u=()=>{if(!r.trim()){c("Preset name is required");return}e(r.trim(),i.trim())},f=d=>{n(d),a&&c("")};return o.jsxs(h.Dialog,{open:!0,onClose:t,maxWidth:"sm",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:[o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(h.Typography,{variant:"h6",children:"Create Shareable Report Preset"}),o.jsx(r0,{content:"This preset will capture filters, sorting, grouping, column configuration, and the active view. The actual data is not saved or shared.",type:"popover"})]}),o.jsx(h.IconButton,{onClick:t,size:"small",sx:{color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsx(h.DialogContent,{children:o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"Save the current report configuration and generate a shareable link that others can use to view the same filters, sorting, and column layout."}),o.jsx(h.TextField,{label:"Preset Name",required:!0,value:r,onChange:d=>f(d.target.value),placeholder:"e.g., Q4 Active Users Report",error:!!a,helperText:a,autoFocus:!0,fullWidth:!0,size:"small"}),o.jsx(h.TextField,{label:"Description (optional)",value:i,onChange:d=>s(d.target.value),placeholder:"Briefly describe what this preset shows...",multiline:!0,rows:3,fullWidth:!0,size:"small"})]})}),o.jsxs(h.DialogActions,{sx:{px:3,pb:2,bgcolor:"action.hover"},children:[o.jsx(h.Button,{onClick:t,variant:"outlined",color:"inherit",children:"Cancel"}),o.jsx(h.Button,{onClick:u,variant:"contained",children:"Create & Share"})]})]})}function cT({presetName:e,shareUrl:t,onCopyLink:r,onOpenPreset:n,onDeletePreset:i,onClose:s}){const[a,c]=w.useState(!1),u=()=>{r(),c(!0),setTimeout(()=>c(!1),2e3)};return o.jsxs(h.Dialog,{open:!0,onClose:s,maxWidth:"sm",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:[o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"h6",children:"Shareable Link Generated"}),o.jsxs(h.Typography,{variant:"caption",color:"text.secondary",children:["Preset: ",e]})]}),o.jsx(h.IconButton,{onClick:s,size:"small",sx:{color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsx(h.DialogContent,{children:o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[o.jsxs(h.Alert,{severity:"success",icon:o.jsx(fs,{size:20}),children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:"Preset created successfully!"}),o.jsx(h.Typography,{variant:"body2",sx:{mt:.5},children:"Share the link below with anyone who needs access to this report configuration."})]}),o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500,mb:1},children:"Shareable URL"}),o.jsxs(h.Box,{sx:{display:"flex",gap:1},children:[o.jsx(h.TextField,{value:t,size:"small",fullWidth:!0,InputProps:{readOnly:!0},onClick:f=>f.target.select(),sx:{"& .MuiInputBase-input":{bgcolor:"action.hover"}}}),o.jsx(h.Button,{onClick:u,variant:"contained",color:a?"success":"primary",startIcon:a?o.jsx(fs,{size:16}):o.jsx(Pv,{size:16}),sx:{minWidth:100},children:a?"Copied!":"Copy"})]})]}),o.jsxs(h.Box,{sx:{display:"flex",gap:1.5},children:[o.jsx(h.Button,{onClick:n,variant:"outlined",startIcon:o.jsx(Lv,{size:16}),fullWidth:!0,children:"Open Link"}),o.jsx(h.Button,{onClick:i,variant:"outlined",color:"error",startIcon:o.jsx(Kr,{size:16}),fullWidth:!0,children:"Delete Preset"})]})]})}),o.jsx(h.DialogActions,{sx:{px:3,pb:2},children:o.jsx(h.Button,{onClick:s,variant:"contained",children:"Done"})})]})}function fT({presetName:e,onClear:t}){return o.jsx(h.Chip,{icon:o.jsx(e2,{size:14}),label:o.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:["Preset: ",o.jsx(h.Box,{component:"span",sx:{fontWeight:600},children:e})]}),onDelete:t,deleteIcon:o.jsx(h.IconButton,{size:"small",title:"Exit preset view",sx:{p:0},children:o.jsx(ot,{size:14})}),sx:{bgcolor:"primary.lighter",borderColor:"primary.light",border:1,fontSize:"0.875rem",fontWeight:500,"& .MuiChip-deleteIcon":{color:"primary.main","&:hover":{color:"primary.dark"}}}})}function uT({totalRows:e,visibleRows:t,hasGrouping:r,visibleColumnsCount:n,totalColumnsCount:i,onExport:s,onClose:a}){const[c,u]=w.useState("csv"),[f,d]=w.useState("visible"),[p,x]=w.useState("visible"),l=e>5e4,y=f==="visible"?t:e,g=p==="visible"?n:i,m=()=>{s({format:c,scope:f,columnScope:p}),a()},E={csv:"CSV",excel:"Excel (.xlsx)",json:"JSON"};return o.jsxs(h.Dialog,{open:!0,onClose:a,maxWidth:"sm",fullWidth:!0,children:[o.jsxs(h.DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pb:1},children:["Export Report",o.jsx(h.IconButton,{onClick:a,size:"small",sx:{color:"text.secondary"},children:o.jsx(ot,{size:20})})]}),o.jsx(h.DialogContent,{children:o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:3,pt:1},children:[l&&o.jsxs(h.Alert,{severity:"warning",icon:o.jsx(rn,{size:20}),children:[o.jsx(h.AlertTitle,{children:"Large Dataset Warning"}),"This export contains over 50,000 rows. Processing may take a few moments."]}),o.jsxs(h.FormControl,{component:"fieldset",children:[o.jsx(h.FormLabel,{component:"legend",sx:{mb:1},children:"Format"}),o.jsxs(h.RadioGroup,{value:c,onChange:D=>u(D.target.value),children:[o.jsx(h.FormControlLabel,{value:"csv",control:o.jsx(h.Radio,{size:"small"}),label:o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:"CSV"}),o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:"Comma-separated values, compatible with Excel"})]}),sx:{mb:1,alignItems:"flex-start"}}),o.jsx(h.FormControlLabel,{value:"excel",control:o.jsx(h.Radio,{size:"small"}),label:o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:"Excel (.xlsx)"}),o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:"Native Excel format with formatting support"})]}),sx:{mb:1,alignItems:"flex-start"}}),o.jsx(h.FormControlLabel,{value:"json",control:o.jsx(h.Radio,{size:"small"}),label:o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:"JSON"}),o.jsx(h.Typography,{variant:"caption",color:"text.secondary",children:"Structured data with metadata and filters"})]}),sx:{alignItems:"flex-start"}})]})]}),o.jsxs(h.FormControl,{component:"fieldset",children:[o.jsx(h.FormLabel,{component:"legend",sx:{mb:1},children:"Rows"}),o.jsxs(h.RadioGroup,{value:f,onChange:D=>d(D.target.value),children:[o.jsx(h.FormControlLabel,{value:"visible",control:o.jsx(h.Radio,{size:"small"}),label:o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:"Visible Rows"}),o.jsxs(h.Typography,{variant:"caption",color:"text.secondary",children:["Export ",t.toLocaleString()," rows (filtered and searched)"]})]}),sx:{mb:1,alignItems:"flex-start"}}),o.jsx(h.FormControlLabel,{value:"all",control:o.jsx(h.Radio,{size:"small"}),label:o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:"All Rows"}),o.jsxs(h.Typography,{variant:"caption",color:"text.secondary",children:["Export ",e.toLocaleString()," rows (complete original dataset)"]})]}),sx:{alignItems:"flex-start"}})]})]}),o.jsxs(h.FormControl,{component:"fieldset",children:[o.jsx(h.FormLabel,{component:"legend",sx:{mb:1},children:"Columns"}),o.jsxs(h.RadioGroup,{value:p,onChange:D=>x(D.target.value),children:[o.jsx(h.FormControlLabel,{value:"visible",control:o.jsx(h.Radio,{size:"small"}),label:o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:"Visible Columns Only"}),o.jsxs(h.Typography,{variant:"caption",color:"text.secondary",children:["Export ",n," visible columns"]})]}),sx:{mb:1,alignItems:"flex-start"}}),o.jsx(h.FormControlLabel,{value:"all",control:o.jsx(h.Radio,{size:"small"}),label:o.jsxs(h.Box,{children:[o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:"All Columns"}),o.jsxs(h.Typography,{variant:"caption",color:"text.secondary",children:["Export all ",i," columns (including hidden)"]})]}),sx:{alignItems:"flex-start"}})]})]}),o.jsxs(h.Box,{sx:{pt:1},children:[o.jsx(h.Divider,{sx:{mb:2}}),o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[o.jsxs(h.Box,{sx:{display:"flex",justifyContent:"space-between"},children:[o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"Format:"}),o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:E[c]})]}),o.jsxs(h.Box,{sx:{display:"flex",justifyContent:"space-between"},children:[o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"Rows to export:"}),o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:y.toLocaleString()})]}),o.jsxs(h.Box,{sx:{display:"flex",justifyContent:"space-between"},children:[o.jsx(h.Typography,{variant:"body2",color:"text.secondary",children:"Columns to export:"}),o.jsx(h.Typography,{variant:"body2",sx:{fontWeight:500},children:g})]})]})]})]})}),o.jsxs(h.DialogActions,{sx:{px:3,pb:2,bgcolor:"action.hover"},children:[o.jsx(h.Button,{onClick:a,variant:"outlined",color:"inherit",children:"Cancel"}),o.jsxs(h.Button,{onClick:m,variant:"contained",children:["Download ",E[c]]})]})]})}function hT({warning:e,onDismiss:t}){return o.jsx(h.Box,{sx:{position:"fixed",top:16,right:16,zIndex:50,maxWidth:448},children:o.jsxs(h.Alert,{severity:"warning",icon:o.jsx(rn,{size:20}),action:o.jsx(h.IconButton,{size:"small",onClick:t,sx:{color:"warning.main"},children:o.jsx(ot,{size:16})}),sx:{borderLeft:4,borderColor:"warning.main",boxShadow:3},children:[o.jsx(h.AlertTitle,{sx:{fontWeight:600},children:"Feature Limit Reached"}),o.jsx(h.Box,{sx:{fontSize:"0.875rem",mb:1},children:e.message}),o.jsxs(h.Box,{sx:{fontSize:"0.75rem",opacity:.9},children:["Please remove some ",e.type==="filter"?"filters":e.type==="sort"?"sort levels":"grouping levels"," before adding more."]})]})})}function dT({error:e,onDismiss:t,autoDismiss:r=!0,autoDismissDelay:n=5e3}){w.useEffect(()=>{if(r){const c=setTimeout(()=>{t()},n);return()=>clearTimeout(c)}},[r,n,t]);const s=(()=>{switch(e.type){case"system":return{severity:"error",icon:o.jsx(Ov,{size:20})};case"processing":return{severity:"warning",icon:o.jsx(rn,{size:20})};case"ui":default:return{severity:"info",icon:o.jsx(Vn,{size:20})}}})(),a=wm(e);return o.jsx(h.Box,{sx:{position:"fixed",top:16,right:16,zIndex:50,maxWidth:448},children:o.jsxs(h.Alert,{severity:s.severity,icon:s.icon,action:o.jsx(h.IconButton,{size:"small",onClick:t,sx:{color:`${s.severity}.main`},children:o.jsx(ot,{size:16})}),sx:{borderLeft:4,borderColor:`${s.severity}.main`,boxShadow:3},children:[o.jsxs(h.AlertTitle,{sx:{fontWeight:600},children:[e.context.charAt(0).toUpperCase()+e.context.slice(1)," Error"]}),o.jsx(h.Box,{sx:{fontSize:"0.875rem"},children:a}),e.details&&process.env.NODE_ENV==="development"&&o.jsx(h.Box,{component:"pre",sx:{fontSize:"0.75rem",mt:1,fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:JSON.stringify(e.details,null,2)})]})})}class pT extends w.Component{constructor(t){super(t),this.handleReset=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[ErrorBoundary] Caught error:",t,r),this.props.onError&&this.props.onError(t,r)}render(){var t,r;return this.state.hasError?this.props.fallback?this.props.fallback:o.jsx(h.Paper,{sx:{bgcolor:"error.lighter",border:1,borderColor:"error.light",borderRadius:2,p:3,m:2},children:o.jsxs(h.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[o.jsx(rn,{size:24,color:"error",style:{flexShrink:0,marginTop:4}}),o.jsxs(h.Box,{sx:{flex:1},children:[o.jsx(h.Typography,{variant:"h6",sx:{color:"error.dark",fontWeight:600},children:this.props.context?`${this.props.context} Error`:"Something went wrong"}),o.jsx(h.Typography,{variant:"body2",sx:{color:"error.main",mt:1},children:((t=this.state.error)==null?void 0:t.message)||"An unexpected error occurred"}),process.env.NODE_ENV==="development"&&o.jsx(h.Box,{component:"pre",sx:{mt:1.5,fontSize:"0.75rem",color:"error.dark",bgcolor:"error.lighter",p:1.5,borderRadius:1,overflow:"auto",maxHeight:160},children:(r=this.state.error)==null?void 0:r.stack}),o.jsx(h.Button,{onClick:this.handleReset,variant:"contained",color:"error",startIcon:o.jsx(a2,{size:16}),sx:{mt:2},children:"Try Again"})]})]})}):this.props.children}}function bn({children:e,feature:t,onError:r}){return o.jsx(pT,{context:t,onError:(n,i)=>{r&&r(n)},fallback:o.jsxs(h.Alert,{severity:"warning",sx:{m:1},icon:o.jsx(rn,{size:20}),children:[o.jsxs(h.AlertTitle,{children:[t," temporarily unavailable"]}),"Other features continue to work normally"]}),children:e})}function n0({reportEngine:e}){var pe,De;const{activeReport:t,paginatedData:r,processedData:n,tableMetrics:i,tableEngine:s,activeView:a,isDirty:c,currentTableState:u,viewChanges:f,showFilterPanel:d,setShowFilterPanel:p,filterFocusColumn:x,handleAddFilter:l,handleUpdateFilter:y,handleRemoveFilter:g,handleClearAllFilters:m,handleOpenFilterForColumn:E,handleCloseFilterPanel:D,handleClearFiltersForColumn:C,showSortPanel:N,setShowSortPanel:L,handleSort:Q,handleUpdateSortStack:k,handleSortAscending:V,handleSortDescending:j,showManageViews:B,setShowManageViews:X,showCreateViewModal:M,setShowCreateViewModal:ee,showEditViewModal:Te,setShowEditViewModal:ne,showDeleteConfirmation:ae,setShowDeleteConfirmation:Se,editingView:Ne,deletingView:be,handleSelectView:ze,handleCreateView:_e,handleUpdateCurrentView:O,handleSaveAsNewView:P,handleRevertChanges:I,handleToggleDefault:R,handleToggleFavorite:Y,handleSoftDelete:xe,handleRestoreView:ve,handlePermanentDelete:ge,handleEditView:oe,handleSaveEditView:Le,handleConfirmDelete:Ce,showManageColumns:Xe,setShowManageColumns:Ae,handleUpdateColumnVisibility:ht,handleUpdateColumnOrder:Ue,handleUpdateColumnWidth:de,handleResetColumnLayout:st,showGroupPanel:He,setShowGroupPanel:Lt,handleGroup:yt,handleToggleGroupCollapse:lt,searchQuery:gt,searchHistory:Ye,handleSearchChange:Ht,handleAddToSearchHistory:wt,handleToggleSearchFavourite:$t,handleDeleteSearchHistory:Nt,selectedRowIds:Rt,handleToggleRowSelection:Gt,handleToggleAllRows:Sr,handleRangeSelection:mt,handleClearSelection:gr,currentPage:mr,pageSize:ir,paginationEngine:Ct,handlePageChange:Ge,handlePageSizeChange:Jt,isExporting:bt,showExportModal:Bt,setShowExportModal:ie,showDirtyExportWarning:Pt,handleExport:Be,handleExportWithConfig:we,handleExportSelected:Ke,handleExportAnyway:We,handleSaveAndExport:at,handleCancelExport:Ut,showAuditHistory:nt,setShowAuditHistory:rt,showCreatePreset:tt,setShowCreatePreset:he,showShareLink:re,setShowShareLink:ye,generatedPreset:je,activePreset:v,handleOpenSharePreset:S,handleCreatePreset:T,handleCopyPresetLink:_,handleOpenPreset:b,handleDeletePreset:A,handleClearActivePreset:W,isViewerRole:J,userRole:U,featureLimitWarning:z,setFeatureLimitWarning:H,reportError:se,setReportError:ue,handleError:me,updateReport:le}=e;return!t||!t.schemaLocked||!t.schema||!t.uploadedData||!t.views?null:o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"hidden"},children:[o.jsxs(h.Box,{sx:{flexShrink:0,display:"flex",flexDirection:"column",gap:1,p:2,borderBottom:ke=>`1px solid ${ke.palette.divider}`,backgroundColor:"background.paper",zIndex:2},children:[z&&o.jsx(hT,{warning:z,onDismiss:()=>H(null)}),se&&o.jsx(dT,{error:se,onDismiss:()=>ue(null)}),Pt&&o.jsx(aT,{onExportAnyway:We,onSaveAndExport:at,onCancel:Ut})]}),o.jsx(h.Box,{sx:{flex:1,minHeight:0,overflow:"auto"},children:o.jsx(Kw,{schema:t.schema,data:r,sortStack:t.sortStack,filters:t.filters,views:t.views,activeViewId:t.activeViewId,isDirty:c,isExporting:bt,columnVisibility:t.columnVisibility||(a==null?void 0:a.snapshot.columnVisibility),columnOrder:t.columnOrder||(a==null?void 0:a.snapshot.columnOrder),columnWidths:t.columnWidths||(a==null?void 0:a.snapshot.columnWidths),grouping:t.grouping,onSort:Q,onSortAscending:V,onSortDescending:j,onOpenFilters:()=>p(!0),onOpenSort:()=>L(!0),onOpenFilterForColumn:E,onSelectView:ze,onCreateView:()=>ee(!0),onManageViews:()=>X(!0),onUpdateCurrentView:O,onSaveAsNewView:P,onToggleDefault:R,onToggleFavorite:Y,onRestoreView:ve,onPermanentDelete:ge,onExport:Be,onOpenColumns:()=>Ae(!0),onUpdateColumnWidth:de,onUpdateColumnOrder:Ue,onUpdateColumnVisibility:ht,onClearFiltersForColumn:C,onResetLayout:st,onOpenGroup:()=>Lt(!0),onToggleGroupCollapse:lt,onOpenAuditHistory:()=>rt(!0),onOpenSharePreset:S,searchQuery:gt,searchHistory:Ye,onAddToSearchHistory:wt,onToggleSearchFavourite:$t,onDeleteSearchHistory:Nt,selectedRowIds:Rt,onSearchChange:Ht,onToggleRowSelection:Gt,onToggleAllRows:Sr,onRangeSelection:mt,onClearSelection:gr,onExportSelected:Ke,currentPage:(Ct==null?void 0:Ct.currentPage)||mr,pageSize:(Ct==null?void 0:Ct.pageSize)||ir,onPageChange:Ge,onPageSizeChange:Jt,totalRowsBeforePagination:(i==null?void 0:i.searchedRows)||n.length,isReadOnly:J,userRole:U})}),!J&&c&&a&&o.jsx(h.Box,{sx:{flexShrink:0,position:"sticky",bottom:0,backgroundColor:"background.paper",borderTop:ke=>`1px solid ${ke.palette.divider}`,boxShadow:3,zIndex:5},children:o.jsx(sT,{viewName:a.name,isDefaultView:a.isDefault,changes:f,onSaveToCurrentView:a.isDefault?void 0:O,onSaveAsNewView:P,onCancel:I})}),d&&o.jsx(bn,{feature:"Filters",onError:ke=>{const Me=br("ui","filters",ke);me(Me)},children:o.jsx(qw,{schema:t.schema,filters:t.filters??[],onAddFilter:l,onUpdateFilter:y,onRemoveFilter:g,onClearAll:m,onClose:D,focusColumn:x})}),N&&o.jsx(bn,{feature:"Sorting",onError:ke=>{const Me=br("ui","sorting",ke);me(Me)},children:o.jsx(Jw,{schema:t.schema,sortStack:t.sortStack??[],onUpdateSortStack:k,onClose:()=>L(!1)})}),B&&o.jsx(bn,{feature:"Views",onError:ke=>{const Me=br("ui","views",ke);me(Me)},children:o.jsx(Zw,{views:t.views,activeViewId:t.activeViewId??"",onSelectView:ze,onCreateView:()=>{X(!1),ee(!0)},onEditView:oe,onDeleteView:xe,onRestoreView:ve,onPermanentDelete:ge,onClose:()=>X(!1)})}),M&&u&&o.jsx(Do,{currentSnapshot:u,onSave:_e,onClose:()=>ee(!1)}),Te&&Ne&&o.jsx(Do,{currentSnapshot:Ne.snapshot,onSave:Le,onClose:()=>{ne(!1)},isEditMode:!0,initialName:Ne.name,initialDescription:Ne.description,initialIsDefault:Ne.isDefault}),ae&&be&&o.jsx(Qw,{viewName:be.name,onConfirm:Ce,onCancel:()=>{Se(!1)}}),Xe&&a&&o.jsx(tT,{schema:t.schema,columnVisibility:t.columnVisibility||a.snapshot.columnVisibility,columnOrder:t.columnOrder||a.snapshot.columnOrder,columnWidths:t.columnWidths||a.snapshot.columnWidths,views:t.views,activeViewId:t.activeViewId,onUpdateColumnVisibility:ht,onUpdateColumnOrder:Ue,onUpdateColumnWidth:de,onResetLayout:st,onSelectView:ke=>{ze(ke)},onSaveToCurrentView:()=>{Ae(!1)},onSaveToAllViews:()=>{if(a){const ke=t.views.map(Me=>({...Me,snapshot:{...Me.snapshot,columnVisibility:a.snapshot.columnVisibility,columnOrder:a.snapshot.columnOrder,columnWidths:a.snapshot.columnWidths}}));le(t.id,{views:ke}),Re.success("Column configuration applied to all views")}Ae(!1)},onClose:()=>Ae(!1)}),He&&o.jsx(bn,{feature:"Grouping",onError:ke=>{const Me=br("ui","grouping",ke);me(Me)},children:o.jsx(rT,{schema:t.schema,grouping:t.grouping||null,onApply:yt,onClose:()=>Lt(!1)})}),nt&&o.jsx(oT,{auditHistory:t.auditHistory||[],onClose:()=>rt(!1)}),tt&&o.jsx(lT,{onSave:T,onClose:()=>he(!1)}),re&&je&&o.jsx(cT,{presetName:je.preset.name,shareUrl:je.url,onCopyLink:_,onOpenPreset:b,onDeletePreset:A,onClose:()=>{ye(!1)}}),v&&o.jsx(h.Box,{sx:{px:2,py:1},children:o.jsx(fT,{presetName:v.name,onClear:W})}),Bt&&o.jsx(bn,{feature:"Export",onError:ke=>{const Me=br("ui","export",ke);me(Me)},children:o.jsx(uT,{totalRows:(i==null?void 0:i.totalRows)||((pe=t.uploadedData)==null?void 0:pe.length)||0,visibleRows:(i==null?void 0:i.searchedRows)||n.length,visibleColumnsCount:((De=s==null?void 0:s.columnEngine)==null?void 0:De.visibleColumns.length)||t.schema.length,totalColumnsCount:t.schema.length,hasGrouping:(i==null?void 0:i.isGrouped)||!1,onExport:we,onClose:()=>{ie(!1)}})})]})}function xT(){const e=Ec(),{reports:t,activeReportId:r,activeReport:n,uploadState:i,schema:s,hasSchemaConflicts:a,isModalOpen:c,setIsModalOpen:u,setActiveReportId:f,createReport:d,handleFileUpload:p,handleUploadError:x,handleRetry:l,handleConfirm:y}=e;return o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"hidden"},children:[o.jsxs(h.Box,{sx:{flexShrink:0,display:"flex",flexDirection:"column",borderBottom:g=>`1px solid ${g.palette.divider}`,backgroundColor:"background.paper",zIndex:2},children:[o.jsx(E2,{onCreateReport:()=>u(!0)}),o.jsx(S2,{reports:t,activeReportId:r,onTabClick:f})]}),o.jsx(h.Box,{component:"main",sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:t.length===0?o.jsx(Nc,{title:"No reports yet",description:"Create your first report to start analyzing your data."}):n?o.jsx(o.Fragment,{children:n.schemaLocked&&n.schema&&n.uploadedData&&n.views?o.jsx(h.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:o.jsx(n0,{reportEngine:e})}):o.jsx(h.Box,{sx:{p:3},children:i==="preview"&&n.schema&&n.uploadedData?o.jsx(A2,{schema:n.schema,onConfirm:y,hasConflicts:a}):n.uploadError?o.jsx(O2,{error:n.uploadError,onRetry:l}):o.jsx(D2,{onFileUpload:p,onError:x,isUploading:i==="uploading"})})}):null}),o.jsx(C2,{isOpen:c,onClose:()=>u(!1),onCreate:d}),o.jsx(wc,{position:"top-right"})]})}function gT(){return o.jsx(Vs,{children:o.jsx(xT,{})})}function mT(){const e=Ec();return o.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"hidden"},children:[o.jsx(h.Box,{component:"main",children:e.activeReport?o.jsx(h.Box,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:o.jsx(n0,{reportEngine:e})}):o.jsx(Nc,{title:"No report data",description:"This viewer requires report data to be loaded."})}),o.jsx(wc,{position:"top-right"})]})}function vT({data:e,autoLoad:t=!0,config:r}){return o.jsx(Vs,{data:e,mode:"viewer",autoLoad:t,config:r,children:o.jsx(mT,{})})}exports.URMBuilder=gT;exports.URMProvider=Vs;exports.URMViewer=vT;
|