@cubejs-client/playground 1.8.12 → 1.8.14
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/build/assets/{index-IYuwPeVs.js → index-D28jAyK1.js} +1 -1
- package/build/index.html +1 -1
- package/build/vizard/download/react-typescript-antd-table.zip +0 -0
- package/build/vizard/download/react-typescript-chartjs-area+bar+doughnut+line+pie.zip +0 -0
- package/package.json +4 -4
- package/public/vizard/download/react-typescript-antd-table.zip +0 -0
- package/public/vizard/download/react-typescript-chartjs-area+bar+doughnut+line+pie.zip +0 -0
|
@@ -920,7 +920,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
|
920
920
|
${g=>g.theme.background}
|
|
921
921
|
);
|
|
922
922
|
}
|
|
923
|
-
`;function CodeSnippet({code:g,language:_,style:A,copyMessage:Fe,theme:st=`dark`}){return(0,import_jsx_runtime.jsx)(rt,{theme:{background:st===`dark`?`#F6F6F8`:`#FFFFFF`},children:(0,import_jsx_runtime.jsxs)(StyledCodeSnippet,{style:A,children:[(0,import_jsx_runtime.jsx)(PrismCode,{code:g,language:_,style:{flexGrow:1}}),(0,import_jsx_runtime.jsx)(ButtonWrapper$1,{children:(0,import_jsx_runtime.jsx)(button_default,{icon:(0,import_jsx_runtime.jsx)(RefIcon$26,{}),onClick:()=>copyToClipboard(g,Fe||`Copied`)})})]})})}function useAppContext(){return(0,import_react.useContext)(AppContext$1)}function usePlaygroundContext(){let{playgroundContext:g}=useAppContext();return g}function useToken(){let{token:g}=useAppContext();return g}var byteToHex=[];for(let g=0;g<256;++g)byteToHex.push((g+256).toString(16).slice(1));function unsafeStringify(g,_=0){return(byteToHex[g[_+0]]+byteToHex[g[_+1]]+byteToHex[g[_+2]]+byteToHex[g[_+3]]+`-`+byteToHex[g[_+4]]+byteToHex[g[_+5]]+`-`+byteToHex[g[_+6]]+byteToHex[g[_+7]]+`-`+byteToHex[g[_+8]]+byteToHex[g[_+9]]+`-`+byteToHex[g[_+10]]+byteToHex[g[_+11]]+byteToHex[g[_+12]]+byteToHex[g[_+13]]+byteToHex[g[_+14]]+byteToHex[g[_+15]]).toLowerCase()}var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}var randomUUID=typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native_default={randomUUID};function v4(g,_,A){if(native_default.randomUUID&&!_&&!g)return native_default.randomUUID();g=g||{};let Fe=g.random??g.rng?.()??rng();if(Fe.length<16)throw Error(`Random bytes length must be >= 16`);if(Fe[6]=Fe[6]&15|64,Fe[8]=Fe[8]&63|128,_){if(A=A||0,A<0||A+16>_.length)throw RangeError(`UUID byte range ${A}:${A+15} is out of buffer bounds`);for(let g=0;g<16;++g)_[A+g]=Fe[g];return _}return unsafeStringify(Fe)}var require_dayjs_min=__commonJSMin(((g,_)=>{(function(A,Fe){typeof g==`object`&&_!==void 0?_.exports=Fe():typeof define==`function`&&define.amd?define(Fe):(A=typeof globalThis<`u`?globalThis:A||self).dayjs=Fe()})(g,(function(){var g=1e3,_=6e4,A=36e5,Fe=`millisecond`,st=`second`,lt=`minute`,_t=`hour`,bt=`day`,xt=`week`,wt=`month`,Tt=`quarter`,Et=`year`,Dt=`date`,Ot=`Invalid Date`,kt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,At=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Mt={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`)},Nt=function(g,_,A){var Fe=String(g);return!Fe||Fe.length>=_?g:``+Array(_+1-Fe.length).join(A)+g},Pt={s:Nt,z:function(g){var _=-g.utcOffset(),A=Math.abs(_),Fe=Math.floor(A/60),st=A%60;return(_<=0?`+`:`-`)+Nt(Fe,2,`0`)+`:`+Nt(st,2,`0`)},m:function g(_,A){if(_.date()<A.date())return-g(A,_);var Fe=12*(A.year()-_.year())+(A.month()-_.month()),st=_.clone().add(Fe,wt),lt=A-st<0,_t=_.clone().add(Fe+(lt?-1:1),wt);return+(-(Fe+(A-st)/(lt?st-_t:_t-st))||0)},a:function(g){return g<0?Math.ceil(g)||0:Math.floor(g)},p:function(g){return{M:wt,y:Et,w:xt,d:bt,D:Dt,h:_t,m:lt,s:st,ms:Fe,Q:Tt}[g]||String(g||``).toLowerCase().replace(/s$/,``)},u:function(g){return g===void 0}},Ft=`en`,It={};It[Ft]=Mt;var Lt=function(g){return g instanceof Ht},zt=function(g,_,A){var Fe;if(!g)return Ft;if(typeof g==`string`)It[g]&&(Fe=g),_&&(It[g]=_,Fe=g);else{var st=g.name;It[st]=g,Fe=st}return!A&&Fe&&(Ft=Fe),Fe||!A&&Ft},Bt=function(g,_){if(Lt(g))return g.clone();var A=typeof _==`object`?_:{};return A.date=g,A.args=arguments,new Ht(A)},Vt=Pt;Vt.l=zt,Vt.i=Lt,Vt.w=function(g,_){return Bt(g,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var Ht=function(){function Mt(g){this.$L=zt(g.locale,null,!0),this.parse(g)}var Nt=Mt.prototype;return Nt.parse=function(g){this.$d=function(g){var _=g.date,A=g.utc;if(_===null)return new Date(NaN);if(Vt.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _==`string`&&!/Z$/i.test(_)){var Fe=_.match(kt);if(Fe){var st=Fe[2]-1||0,lt=(Fe[7]||`0`).substring(0,3);return A?new Date(Date.UTC(Fe[1],st,Fe[3]||1,Fe[4]||0,Fe[5]||0,Fe[6]||0,lt)):new Date(Fe[1],st,Fe[3]||1,Fe[4]||0,Fe[5]||0,Fe[6]||0,lt)}}return new Date(_)}(g),this.$x=g.x||{},this.init()},Nt.init=function(){var g=this.$d;this.$y=g.getFullYear(),this.$M=g.getMonth(),this.$D=g.getDate(),this.$W=g.getDay(),this.$H=g.getHours(),this.$m=g.getMinutes(),this.$s=g.getSeconds(),this.$ms=g.getMilliseconds()},Nt.$utils=function(){return Vt},Nt.isValid=function(){return this.$d.toString()!==Ot},Nt.isSame=function(g,_){var A=Bt(g);return this.startOf(_)<=A&&A<=this.endOf(_)},Nt.isAfter=function(g,_){return Bt(g)<this.startOf(_)},Nt.isBefore=function(g,_){return this.endOf(_)<Bt(g)},Nt.$g=function(g,_,A){return Vt.u(g)?this[_]:this.set(A,g)},Nt.unix=function(){return Math.floor(this.valueOf()/1e3)},Nt.valueOf=function(){return this.$d.getTime()},Nt.startOf=function(g,_){var A=this,Fe=!!Vt.u(_)||_,Tt=Vt.p(g),Ot=function(g,_){var st=Vt.w(A.$u?Date.UTC(A.$y,_,g):new Date(A.$y,_,g),A);return Fe?st:st.endOf(bt)},kt=function(g,_){return Vt.w(A.toDate()[g].apply(A.toDate(`s`),(Fe?[0,0,0,0]:[23,59,59,999]).slice(_)),A)},At=this.$W,Mt=this.$M,Nt=this.$D,Pt=`set`+(this.$u?`UTC`:``);switch(Tt){case Et:return Fe?Ot(1,0):Ot(31,11);case wt:return Fe?Ot(1,Mt):Ot(0,Mt+1);case xt:var Ft=this.$locale().weekStart||0,It=(At<Ft?At+7:At)-Ft;return Ot(Fe?Nt-It:Nt+(6-It),Mt);case bt:case Dt:return kt(Pt+`Hours`,0);case _t:return kt(Pt+`Minutes`,1);case lt:return kt(Pt+`Seconds`,2);case st:return kt(Pt+`Milliseconds`,3);default:return this.clone()}},Nt.endOf=function(g){return this.startOf(g,!1)},Nt.$set=function(g,_){var A,xt=Vt.p(g),Tt=`set`+(this.$u?`UTC`:``),Ot=(A={},A[bt]=Tt+`Date`,A[Dt]=Tt+`Date`,A[wt]=Tt+`Month`,A[Et]=Tt+`FullYear`,A[_t]=Tt+`Hours`,A[lt]=Tt+`Minutes`,A[st]=Tt+`Seconds`,A[Fe]=Tt+`Milliseconds`,A)[xt],kt=xt===bt?this.$D+(_-this.$W):_;if(xt===wt||xt===Et){var At=this.clone().set(Dt,1);At.$d[Ot](kt),At.init(),this.$d=At.set(Dt,Math.min(this.$D,At.daysInMonth())).$d}else Ot&&this.$d[Ot](kt);return this.init(),this},Nt.set=function(g,_){return this.clone().$set(g,_)},Nt.get=function(g){return this[Vt.p(g)]()},Nt.add=function(Fe,Tt){var Dt,Ot=this;Fe=Number(Fe);var kt=Vt.p(Tt),At=function(g){var _=Bt(Ot);return Vt.w(_.date(_.date()+Math.round(g*Fe)),Ot)};if(kt===wt)return this.set(wt,this.$M+Fe);if(kt===Et)return this.set(Et,this.$y+Fe);if(kt===bt)return At(1);if(kt===xt)return At(7);var Mt=(Dt={},Dt[lt]=_,Dt[_t]=A,Dt[st]=g,Dt)[kt]||1,Nt=this.$d.getTime()+Fe*Mt;return Vt.w(Nt,this)},Nt.subtract=function(g,_){return this.add(-1*g,_)},Nt.format=function(g){var _=this,A=this.$locale();if(!this.isValid())return A.invalidDate||Ot;var Fe=g||`YYYY-MM-DDTHH:mm:ssZ`,st=Vt.z(this),lt=this.$H,_t=this.$m,bt=this.$M,xt=A.weekdays,wt=A.months,Tt=function(g,A,st,lt){return g&&(g[A]||g(_,Fe))||st[A].substr(0,lt)},Et=function(g){return Vt.s(lt%12||12,g,`0`)},Dt=A.meridiem||function(g,_,A){var Fe=g<12?`AM`:`PM`;return A?Fe.toLowerCase():Fe},kt={YY:String(this.$y).slice(-2),YYYY:this.$y,M:bt+1,MM:Vt.s(bt+1,2,`0`),MMM:Tt(A.monthsShort,bt,wt,3),MMMM:Tt(wt,bt),D:this.$D,DD:Vt.s(this.$D,2,`0`),d:String(this.$W),dd:Tt(A.weekdaysMin,this.$W,xt,2),ddd:Tt(A.weekdaysShort,this.$W,xt,3),dddd:xt[this.$W],H:String(lt),HH:Vt.s(lt,2,`0`),h:Et(1),hh:Et(2),a:Dt(lt,_t,!0),A:Dt(lt,_t,!1),m:String(_t),mm:Vt.s(_t,2,`0`),s:String(this.$s),ss:Vt.s(this.$s,2,`0`),SSS:Vt.s(this.$ms,3,`0`),Z:st};return Fe.replace(At,(function(g,_){return _||kt[g]||st.replace(`:`,``)}))},Nt.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Nt.diff=function(Fe,Dt,Ot){var kt,At=Vt.p(Dt),Mt=Bt(Fe),Nt=(Mt.utcOffset()-this.utcOffset())*_,Pt=this-Mt,Ft=Vt.m(this,Mt);return Ft=(kt={},kt[Et]=Ft/12,kt[wt]=Ft,kt[Tt]=Ft/3,kt[xt]=(Pt-Nt)/6048e5,kt[bt]=(Pt-Nt)/864e5,kt[_t]=Pt/A,kt[lt]=Pt/_,kt[st]=Pt/g,kt)[At]||Pt,Ot?Ft:Vt.a(Ft)},Nt.daysInMonth=function(){return this.endOf(wt).$D},Nt.$locale=function(){return It[this.$L]},Nt.locale=function(g,_){if(!g)return this.$L;var A=this.clone(),Fe=zt(g,_,!0);return Fe&&(A.$L=Fe),A},Nt.clone=function(){return Vt.w(this.$d,this)},Nt.toDate=function(){return new Date(this.valueOf())},Nt.toJSON=function(){return this.isValid()?this.toISOString():null},Nt.toISOString=function(){return this.$d.toISOString()},Nt.toString=function(){return this.$d.toUTCString()},Mt}(),Ut=Ht.prototype;return Bt.prototype=Ut,[[`$ms`,Fe],[`$s`,st],[`$m`,lt],[`$H`,_t],[`$W`,bt],[`$M`,wt],[`$y`,Et],[`$D`,Dt]].forEach((function(g){Ut[g[1]]=function(_){return this.$g(_,g[0],g[1])}})),Bt.extend=function(g,_){return g.$i||(g(_,Ht,Bt),g.$i=!0),Bt},Bt.locale=zt,Bt.isDayjs=Lt,Bt.unix=function(g){return Bt(1e3*g)},Bt.en=It[Ft],Bt.Ls=It,Bt.p={},Bt}))}));function _isPlaceholder(g){return typeof g==`object`&&!!g&&g[`@@functional/placeholder`]===!0}function _curry1(g){return function _(A){return arguments.length===0||_isPlaceholder(A)?_:g.apply(this,arguments)}}function _curry2(g){return function _(A,Fe){switch(arguments.length){case 0:return _;case 1:return _isPlaceholder(A)?_:_curry1(function(_){return g(A,_)});default:return _isPlaceholder(A)&&_isPlaceholder(Fe)?_:_isPlaceholder(A)?_curry1(function(_){return g(_,Fe)}):_isPlaceholder(Fe)?_curry1(function(_){return g(A,_)}):g(A,Fe)}}}function _arity(g,_){switch(g){case 0:return function(){return _.apply(this,arguments)};case 1:return function(g){return _.apply(this,arguments)};case 2:return function(g,A){return _.apply(this,arguments)};case 3:return function(g,A,Fe){return _.apply(this,arguments)};case 4:return function(g,A,Fe,st){return _.apply(this,arguments)};case 5:return function(g,A,Fe,st,lt){return _.apply(this,arguments)};case 6:return function(g,A,Fe,st,lt,_t){return _.apply(this,arguments)};case 7:return function(g,A,Fe,st,lt,_t,bt){return _.apply(this,arguments)};case 8:return function(g,A,Fe,st,lt,_t,bt,xt){return _.apply(this,arguments)};case 9:return function(g,A,Fe,st,lt,_t,bt,xt,wt){return _.apply(this,arguments)};case 10:return function(g,A,Fe,st,lt,_t,bt,xt,wt,Tt){return _.apply(this,arguments)};default:throw Error(`First argument to _arity must be a non-negative integer no greater than ten`)}}function _curryN(g,_,A){return function(){for(var Fe=[],st=0,lt=g,_t=0,bt=!1;_t<_.length||st<arguments.length;){var xt;_t<_.length&&(!_isPlaceholder(_[_t])||st>=arguments.length)?xt=_[_t]:(xt=arguments[st],st+=1),Fe[_t]=xt,_isPlaceholder(xt)?bt=!0:--lt,_t+=1}return!bt&<<=0?A.apply(this,Fe):_arity(Math.max(0,lt),_curryN(g,Fe,A))}}var curryN$1=_curry2(function(g,_){return g===1?_curry1(_):_arity(g,_curryN(g,[],_))});function _curry3(g){return function _(A,Fe,st){switch(arguments.length){case 0:return _;case 1:return _isPlaceholder(A)?_:_curry2(function(_,Fe){return g(A,_,Fe)});case 2:return _isPlaceholder(A)&&_isPlaceholder(Fe)?_:_isPlaceholder(A)?_curry2(function(_,A){return g(_,Fe,A)}):_isPlaceholder(Fe)?_curry2(function(_,Fe){return g(A,_,Fe)}):_curry1(function(_){return g(A,Fe,_)});default:return _isPlaceholder(A)&&_isPlaceholder(Fe)&&_isPlaceholder(st)?_:_isPlaceholder(A)&&_isPlaceholder(Fe)?_curry2(function(_,A){return g(_,A,st)}):_isPlaceholder(A)&&_isPlaceholder(st)?_curry2(function(_,A){return g(_,Fe,A)}):_isPlaceholder(Fe)&&_isPlaceholder(st)?_curry2(function(_,Fe){return g(A,_,Fe)}):_isPlaceholder(A)?_curry1(function(_){return g(_,Fe,st)}):_isPlaceholder(Fe)?_curry1(function(_){return g(A,_,st)}):_isPlaceholder(st)?_curry1(function(_){return g(A,Fe,_)}):g(A,Fe,st)}}}var _isArray_default=Array.isArray||function(g){return g!=null&&g.length>=0&&Object.prototype.toString.call(g)===`[object Array]`};function _isTransformer(g){return g!=null&&typeof g[`@@transducer/step`]==`function`}function _dispatchable(g,_,A){return function(){if(arguments.length===0)return A();var Fe=arguments[arguments.length-1];if(!_isArray_default(Fe)){for(var st=0;st<g.length;){if(typeof Fe[g[st]]==`function`)return Fe[g[st]].apply(Fe,Array.prototype.slice.call(arguments,0,-1));st+=1}if(_isTransformer(Fe))return _.apply(null,Array.prototype.slice.call(arguments,0,-1))(Fe)}return A.apply(this,arguments)}}function _reduced(g){return g&&g[`@@transducer/reduced`]?g:{"@@transducer/value":g,"@@transducer/reduced":!0}}var _xfBase_default={init:function(){return this.xf[`@@transducer/init`]()},result:function(g){return this.xf[`@@transducer/result`](g)}};function _arrayFromIterator(g){for(var _=[],A;!(A=g.next()).done;)_.push(A.value);return _}function _includesWith(g,_,A){for(var Fe=0,st=A.length;Fe<st;){if(g(_,A[Fe]))return!0;Fe+=1}return!1}function _functionName(g){var _=String(g).match(/^function (\w*)/);return _==null?``:_[1]}function _has(g,_){return Object.prototype.hasOwnProperty.call(_,g)}function _objectIs(g,_){return g===_?g!==0||1/g==1/_:g!==g&&_!==_}var _objectIs_default=typeof Object.is==`function`?Object.is:_objectIs,toString$3=Object.prototype.toString,_isArguments=function(){return toString$3.call(arguments)===`[object Arguments]`?function(g){return toString$3.call(g)===`[object Arguments]`}:function(g){return _has(`callee`,g)}}(),hasEnumBug=!{toString:null}.propertyIsEnumerable(`toString`),nonEnumerableProps=[`constructor`,`valueOf`,`isPrototypeOf`,`toString`,`propertyIsEnumerable`,`hasOwnProperty`,`toLocaleString`],hasArgsEnumBug=function(){return arguments.propertyIsEnumerable(`length`)}(),contains$1=function(g,_){for(var A=0;A<g.length;){if(g[A]===_)return!0;A+=1}return!1},keys$1=_curry1(typeof Object.keys==`function`&&!hasArgsEnumBug?function(g){return Object(g)===g?Object.keys(g):[]}:function(g){if(Object(g)!==g)return[];var _,A,Fe=[],st=hasArgsEnumBug&&_isArguments(g);for(_ in g)_has(_,g)&&(!st||_!==`length`)&&(Fe[Fe.length]=_);if(hasEnumBug)for(A=nonEnumerableProps.length-1;A>=0;)_=nonEnumerableProps[A],_has(_,g)&&!contains$1(Fe,_)&&(Fe[Fe.length]=_),--A;return Fe}),type$1=_curry1(function(g){return g===null?`Null`:g===void 0?`Undefined`:Object.prototype.toString.call(g).slice(8,-1)});function _uniqContentEquals(g,_,A,Fe){var st=_arrayFromIterator(g),lt=_arrayFromIterator(_);function _t(g,_){return _equals(g,_,A.slice(),Fe.slice())}return!_includesWith(function(g,_){return!_includesWith(_t,_,g)},lt,st)}function _equals(g,_,A,Fe){if(_objectIs_default(g,_))return!0;var st=type$1(g);if(st!==type$1(_))return!1;if(typeof g[`fantasy-land/equals`]==`function`||typeof _[`fantasy-land/equals`]==`function`)return typeof g[`fantasy-land/equals`]==`function`&&g[`fantasy-land/equals`](_)&&typeof _[`fantasy-land/equals`]==`function`&&_[`fantasy-land/equals`](g);if(typeof g.equals==`function`||typeof _.equals==`function`)return typeof g.equals==`function`&&g.equals(_)&&typeof _.equals==`function`&&_.equals(g);switch(st){case`Arguments`:case`Array`:case`Object`:if(typeof g.constructor==`function`&&_functionName(g.constructor)===`Promise`)return g===_;break;case`Boolean`:case`Number`:case`String`:if(!(typeof g==typeof _&&_objectIs_default(g.valueOf(),_.valueOf())))return!1;break;case`Date`:if(!_objectIs_default(g.valueOf(),_.valueOf()))return!1;break;case`Error`:return g.name===_.name&&g.message===_.message;case`RegExp`:if(g.source!==_.source||g.global!==_.global||g.ignoreCase!==_.ignoreCase||g.multiline!==_.multiline||g.sticky!==_.sticky||g.unicode!==_.unicode)return!1}for(var lt=A.length-1;lt>=0;){if(A[lt]===g)return Fe[lt]===_;--lt}switch(st){case`Map`:return g.size===_.size&&_uniqContentEquals(g.entries(),_.entries(),A.concat([g]),Fe.concat([_]));case`Set`:return g.size===_.size&&_uniqContentEquals(g.values(),_.values(),A.concat([g]),Fe.concat([_]));case`Arguments`:case`Array`:case`Object`:case`Boolean`:case`Number`:case`String`:case`Date`:case`Error`:case`RegExp`:case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`ArrayBuffer`:break;default:return!1}var _t=keys$1(g);if(_t.length!==keys$1(_).length)return!1;var bt=A.concat([g]),xt=Fe.concat([_]);for(lt=_t.length-1;lt>=0;){var wt=_t[lt];if(!(_has(wt,_)&&_equals(_[wt],g[wt],bt,xt)))return!1;--lt}return!0}var equals$2=_curry2(function(g,_){return _equals(g,_,[],[])});function _indexOf(g,_,A){var Fe,st;if(typeof g.indexOf==`function`)switch(typeof _){case`number`:if(_===0){for(Fe=1/_;A<g.length;){if(st=g[A],st===0&&1/st===Fe)return A;A+=1}return-1}if(_!==_){for(;A<g.length;){if(st=g[A],typeof st==`number`&&st!==st)return A;A+=1}return-1}return g.indexOf(_,A);case`string`:case`boolean`:case`function`:case`undefined`:return g.indexOf(_,A);case`object`:if(_===null)return g.indexOf(_,A)}for(;A<g.length;){if(equals$2(g[A],_))return A;A+=1}return-1}function _includes(g,_){return _indexOf(_,g,0)>=0}function _map(g,_){for(var A=0,Fe=_.length,st=Array(Fe);A<Fe;)st[A]=g(_[A]),A+=1;return st}function _quote(g){return`"`+g.replace(/\\/g,`\\\\`).replace(/[\b]/g,`\\b`).replace(/\f/g,`\\f`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/\t/g,`\\t`).replace(/\v/g,`\\v`).replace(/\0/g,`\\0`).replace(/"/g,`\\"`)+`"`}var pad$1=function(g){return(g<10?`0`:``)+g},_toISOString=typeof Date.prototype.toISOString==`function`?function(g){return g.toISOString()}:function(g){return g.getUTCFullYear()+`-`+pad$1(g.getUTCMonth()+1)+`-`+pad$1(g.getUTCDate())+`T`+pad$1(g.getUTCHours())+`:`+pad$1(g.getUTCMinutes())+`:`+pad$1(g.getUTCSeconds())+`.`+(g.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+`Z`};function _complement(g){return function(){return!g.apply(this,arguments)}}function _arrayReduce(g,_,A){for(var Fe=0,st=A.length;Fe<st;)_=g(_,A[Fe]),Fe+=1;return _}function _filter(g,_){for(var A=0,Fe=_.length,st=[];A<Fe;)g(_[A])&&(st[st.length]=_[A]),A+=1;return st}function _filterMap(g,_){for(var A=new Map,Fe=_.entries(),st=Fe.next();!st.done;)g(st.value[1])&&A.set(st.value[0],st.value[1]),st=Fe.next();return A}function _isMap(g){return Object.prototype.toString.call(g)===`[object Map]`}function _isObject(g){return Object.prototype.toString.call(g)===`[object Object]`}var XFilter=function(){function g(g,_){this.xf=_,this.f=g}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=_xfBase_default.result,g.prototype[`@@transducer/step`]=function(g,_){return this.f(_)?this.xf[`@@transducer/step`](g,_):g},g}();function _xfilter(g){return function(_){return new XFilter(g,_)}}var filter=_curry2(_dispatchable([`fantasy-land/filter`,`filter`],_xfilter,function(g,_){return _isObject(_)?_arrayReduce(function(A,Fe){return g(_[Fe])&&(A[Fe]=_[Fe]),A},{},keys$1(_)):_isMap(_)?_filterMap(g,_):_filter(g,_)})),reject=_curry2(function(g,_){return filter(_complement(g),_)});function _toString(g,_){var A=function(A){var Fe=_.concat([g]);return _includes(A,Fe)?`<Circular>`:_toString(A,Fe)},Fe=function(g,_){return _map(function(_){return _quote(_)+`: `+A(g[_])},_.slice().sort())};switch(Object.prototype.toString.call(g)){case`[object Arguments]`:return`(function() { return arguments; }(`+_map(A,g).join(`, `)+`))`;case`[object Array]`:return`[`+_map(A,g).concat(Fe(g,reject(function(g){return/^\d+$/.test(g)},keys$1(g)))).join(`, `)+`]`;case`[object Boolean]`:return typeof g==`object`?`new Boolean(`+A(g.valueOf())+`)`:g.toString();case`[object Date]`:return`new Date(`+(isNaN(g.valueOf())?A(NaN):_quote(_toISOString(g)))+`)`;case`[object Map]`:return`new Map(`+A(Array.from(g))+`)`;case`[object Null]`:return`null`;case`[object Number]`:return typeof g==`object`?`new Number(`+A(g.valueOf())+`)`:1/g==-1/0?`-0`:g.toString(10);case`[object Set]`:return`new Set(`+A(Array.from(g).sort())+`)`;case`[object String]`:return typeof g==`object`?`new String(`+A(g.valueOf())+`)`:_quote(g);case`[object Undefined]`:return`undefined`;default:if(typeof g.toString==`function`){var st=g.toString();if(st!==`[object Object]`)return st}return`{`+Fe(g,keys$1(g)).join(`, `)+`}`}}var toString$2=_curry1(function(g){return _toString(g,[])}),max$3=_curry2(function(g,_){if(g===_)return _;function A(g,_){if(g>_!=_>g)return _>g?_:g}var Fe=A(g,_);if(Fe!==void 0)return Fe;var st=A(typeof g,typeof _);if(st!==void 0)return st===typeof g?g:_;var lt=toString$2(g),_t=A(lt,toString$2(_));return _t===void 0?_:_t===lt?g:_}),XMap=function(){function g(g,_){this.xf=_,this.f=g}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=_xfBase_default.result,g.prototype[`@@transducer/step`]=function(g,_){return this.xf[`@@transducer/step`](g,this.f(_))},g}(),_xmap=function(g){return function(_){return new XMap(g,_)}},map$3=_curry2(_dispatchable([`fantasy-land/map`,`map`],_xmap,function(g,_){switch(Object.prototype.toString.call(_)){case`[object Function]`:return curryN$1(_.length,function(){return g.call(this,_.apply(this,arguments))});case`[object Object]`:return _arrayReduce(function(A,Fe){return A[Fe]=g(_[Fe]),A},{},keys$1(_));default:return _map(g,_)}})),_isInteger_default=Number.isInteger||function(g){return g<<0===g};function _nth(g,_){return _[g<0?_.length+g:g]}function _prop(g,_){if(_!=null)return _isInteger_default(g)?_nth(g,_):_[g]}var prop=_curry2(_prop);function _isString(g){return Object.prototype.toString.call(g)===`[object String]`}var _isArrayLike=_curry1(function(g){return _isArray_default(g)?!0:!g||typeof g!=`object`||_isString(g)?!1:g.length===0||g.length>0&&g.hasOwnProperty(0)&&g.hasOwnProperty(g.length-1)}),symIterator=typeof Symbol<`u`?Symbol.iterator:`@@iterator`;function _createReduce(g,_,A){return function(Fe,st,lt){if(_isArrayLike(lt))return g(Fe,st,lt);if(lt==null)return st;if(typeof lt[`fantasy-land/reduce`]==`function`)return _(Fe,st,lt,`fantasy-land/reduce`);if(lt[symIterator]!=null)return A(Fe,st,lt[symIterator]());if(typeof lt.next==`function`)return A(Fe,st,lt);if(typeof lt.reduce==`function`)return _(Fe,st,lt,`reduce`);throw TypeError(`reduce: list must be array or iterable`)}}function _xArrayReduce(g,_,A){for(var Fe=0,st=A.length;Fe<st;){if(_=g[`@@transducer/step`](_,A[Fe]),_&&_[`@@transducer/reduced`]){_=_[`@@transducer/value`];break}Fe+=1}return g[`@@transducer/result`](_)}var bind$1=_curry2(function(g,_){return _arity(g.length,function(){return g.apply(_,arguments)})});function _xIterableReduce(g,_,A){for(var Fe=A.next();!Fe.done;){if(_=g[`@@transducer/step`](_,Fe.value),_&&_[`@@transducer/reduced`]){_=_[`@@transducer/value`];break}Fe=A.next()}return g[`@@transducer/result`](_)}function _xMethodReduce(g,_,A,Fe){return g[`@@transducer/result`](A[Fe](bind$1(g[`@@transducer/step`],g),_))}var _xReduce=_createReduce(_xArrayReduce,_xMethodReduce,_xIterableReduce),XWrap=function(){function g(g){this.f=g}return g.prototype[`@@transducer/init`]=function(){throw Error(`init not implemented on XWrap`)},g.prototype[`@@transducer/result`]=function(g){return g},g.prototype[`@@transducer/step`]=function(g,_){return this.f(g,_)},g}();function _xwrap(g){return new XWrap(g)}var reduce=_curry3(function(g,_,A){return _xReduce(typeof g==`function`?_xwrap(g):g,_,A)});function _makeFlat(g){return function _(A){for(var Fe,st,lt,_t=[],bt=0,xt=A.length;bt<xt;){if(_isArrayLike(A[bt]))for(Fe=g?_(A[bt]):A[bt],lt=0,st=Fe.length;lt<st;)_t[_t.length]=Fe[lt],lt+=1;else _t[_t.length]=A[bt];bt+=1}return _t}}function _forceReduced(g){return{"@@transducer/value":g,"@@transducer/reduced":!0}}var tInit=`@@transducer/init`,tStep=`@@transducer/step`,tResult=`@@transducer/result`,XPreservingReduced=function(){function g(g){this.xf=g}return g.prototype[tInit]=_xfBase_default.init,g.prototype[tResult]=_xfBase_default.result,g.prototype[tStep]=function(g,_){var A=this.xf[tStep](g,_);return A[`@@transducer/reduced`]?_forceReduced(A):A},g}(),XFlatCat=function(){function g(g){this.xf=new XPreservingReduced(g)}return g.prototype[tInit]=_xfBase_default.init,g.prototype[tResult]=_xfBase_default.result,g.prototype[tStep]=function(g,_){return _isArrayLike(_)?_xReduce(this.xf,g,_):_xArrayReduce(this.xf,g,[_])},g}(),_flatCat=function(g){return new XFlatCat(g)};function _xchain(g){return function(_){return _xmap(g)(_flatCat(_))}}var _chain_default=_dispatchable([`fantasy-land/chain`,`chain`],_xchain,function(g,_){return typeof _==`function`?function(A){return g(_(A))(A)}:_makeFlat(!1)(map$3(g,_))}),chain=_curry2(_chain_default);function _cloneRegExp(g){return new RegExp(g.source,g.flags?g.flags:(g.global?`g`:``)+(g.ignoreCase?`i`:``)+(g.multiline?`m`:``)+(g.sticky?`y`:``)+(g.unicode?`u`:``)+(g.dotAll?`s`:``))}function _clone(g,_,A){if(A||(A=new _ObjectMap),_isPrimitive(g))return g;var Fe=function(Fe){var st=A.get(g);if(st)return st;for(var lt in A.set(g,Fe),g)Object.prototype.hasOwnProperty.call(g,lt)&&(Fe[lt]=_?_clone(g[lt],!0,A):g[lt]);return Fe};switch(type$1(g)){case`Object`:return Fe(Object.create(Object.getPrototypeOf(g)));case`Array`:return Fe(Array(g.length));case`Date`:return new Date(g.valueOf());case`RegExp`:return _cloneRegExp(g);case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`BigInt64Array`:case`BigUint64Array`:return g.slice();default:return g}}function _isPrimitive(g){var _=typeof g;return g==null||_!=`object`&&_!=`function`}var _ObjectMap=function(){function g(){this.map={},this.length=0}return g.prototype.set=function(g,_){var A=this.hash(g),Fe=this.map[A];Fe||(this.map[A]=Fe=[]),Fe.push([g,_]),this.length+=1},g.prototype.hash=function(g){var _=[];for(var A in g)_.push(Object.prototype.toString.call(g[A]));return _.join()},g.prototype.get=function(g){if(this.length<=180){for(var _ in this.map)for(var A=this.map[_],Fe=0;Fe<A.length;Fe+=1){var st=A[Fe];if(st[0]===g)return st[1]}return}var lt=this.hash(g),A=this.map[lt];if(A)for(var Fe=0;Fe<A.length;Fe+=1){var st=A[Fe];if(st[0]===g)return st[1]}},g}(),clone=_curry1(function(g){return g!=null&&typeof g.clone==`function`?g.clone():_clone(g,!0)});function _pipe(g,_){return function(){return _.call(this,g.apply(this,arguments))}}function _checkForMethod(g,_){return function(){var A=arguments.length;if(A===0)return _();var Fe=arguments[A-1];return _isArray_default(Fe)||typeof Fe[g]!=`function`?_.apply(this,arguments):Fe[g].apply(Fe,Array.prototype.slice.call(arguments,0,A-1))}}var slice$3=_curry3(_checkForMethod(`slice`,function(g,_,A){return Array.prototype.slice.call(A,g,_)})),tail=_curry1(_checkForMethod(`tail`,slice$3(1,1/0)));function pipe(){if(arguments.length===0)throw Error(`pipe requires at least one argument`);return _arity(arguments[0].length,reduce(_pipe,arguments[0],tail(arguments)))}function _identity(g){return g}var identity$5=_curry1(_identity),XReduceBy=function(){function g(g,_,A,Fe){this.valueFn=g,this.valueAcc=_,this.keyFn=A,this.xf=Fe,this.inputs={}}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=function(g){for(var _ in this.inputs)if(_has(_,this.inputs)&&(g=this.xf[`@@transducer/step`](g,this.inputs[_]),g[`@@transducer/reduced`])){g=g[`@@transducer/value`];break}return this.inputs=null,this.xf[`@@transducer/result`](g)},g.prototype[`@@transducer/step`]=function(g,_){var A=this.keyFn(_);return this.inputs[A]=this.inputs[A]||[A,_clone(this.valueAcc,!1)],this.inputs[A][1]=this.valueFn(this.inputs[A][1],_),g},g}();function _xreduceBy(g,_,A){return function(Fe){return new XReduceBy(g,_,A,Fe)}}var reduceBy=_curryN(4,[],_dispatchable([],_xreduceBy,function(g,_,A,Fe){return _xReduce(_xwrap(function(Fe,st){var lt=A(st),_t=g(_has(lt,Fe)?Fe[lt]:_clone(_,!1),st);return _t&&_t[`@@transducer/reduced`]?_reduced(Fe):(Fe[lt]=_t,Fe)}),{},Fe)})),_Set=function(){function g(){this._nativeSet=typeof Set==`function`?new Set:null,this._items={}}return g.prototype.add=function(g){return!hasOrAdd(g,!0,this)},g.prototype.has=function(g){return hasOrAdd(g,!1,this)},g}();function hasOrAdd(g,_,A){var Fe=typeof g,st,lt;switch(Fe){case`string`:case`number`:return g===0&&1/g==-1/0?A._items[`-0`]?!0:(_&&(A._items[`-0`]=!0),!1):A._nativeSet===null?Fe in A._items?g in A._items[Fe]||(_&&(A._items[Fe][g]=!0),!1):(_&&(A._items[Fe]={},A._items[Fe][g]=!0),!1):_?(st=A._nativeSet.size,A._nativeSet.add(g),lt=A._nativeSet.size,lt===st):A._nativeSet.has(g);case`boolean`:if(Fe in A._items){var _t=+!!g;return A._items[Fe][_t]?!0:(_&&(A._items[Fe][_t]=!0),!1)}return _&&(A._items[Fe]=g?[!1,!0]:[!0,!1]),!1;case`function`:return A._nativeSet===null?Fe in A._items?_includes(g,A._items[Fe])?!0:(_&&A._items[Fe].push(g),!1):(_&&(A._items[Fe]=[g]),!1):_?(st=A._nativeSet.size,A._nativeSet.add(g),lt=A._nativeSet.size,lt===st):A._nativeSet.has(g);case`undefined`:return A._items[Fe]?!0:(_&&(A._items[Fe]=!0),!1);case`object`:if(g===null)return A._items.null?!0:(_&&(A._items.null=!0),!1);default:return Fe=Object.prototype.toString.call(g),Fe in A._items?_includes(g,A._items[Fe])?!0:(_&&A._items[Fe].push(g),!1):(_&&(A._items[Fe]=[g]),!1)}}var XTake=function(){function g(g,_){this.xf=_,this.n=g,this.i=0}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=_xfBase_default.result,g.prototype[`@@transducer/step`]=function(g,_){this.i+=1;var A=this.n===0?g:this.xf[`@@transducer/step`](g,_);return this.n>=0&&this.i>=this.n?_reduced(A):A},g}();function _xtake(g){return function(_){return new XTake(g,_)}}var take=_curry2(_dispatchable([`take`],_xtake,function(g,_){return slice$3(0,g<0?1/0:g,_)}));function dropLast$1(g,_){return take(g<_.length?_.length-g:0,_)}var XDropLast=function(){function g(g,_){if(g<=0)return _;this.xf=_,this.pos=0,this.full=!1,this.acc=Array(g)}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=function(g){return this.acc=null,this.xf[`@@transducer/result`](g)},g.prototype[`@@transducer/step`]=function(g,_){return this.full&&(g=this.xf[`@@transducer/step`](g,this.acc[this.pos])),this.store(_),g},g.prototype.store=function(g){this.acc[this.pos]=g,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},g}();function _xdropLast(g){return function(_){return new XDropLast(g,_)}}var dropLast=_curry2(_dispatchable([],_xdropLast,dropLast$1)),flatten$1=_curry1(_makeFlat(!0));function fromPairs$1(g){for(var _={},A=0;A<g.length;)_[g[A][0]]=g[A][1],A+=1;return _}var fromPairs=_curry1(fromPairs$1),groupBy=_curry2(_checkForMethod(`groupBy`,reduceBy(function(g,_){return g.push(_),g},[]))),indexBy=reduceBy(function(g,_){return _},null),XUniqBy=function(){function g(g,_){this.xf=_,this.f=g,this.set=new _Set}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=_xfBase_default.result,g.prototype[`@@transducer/step`]=function(g,_){return this.set.add(this.f(_))?this.xf[`@@transducer/step`](g,_):g},g}();function _xuniqBy(g){return function(_){return new XUniqBy(g,_)}}var uniqBy$1=_curry2(_dispatchable([],_xuniqBy,function(g,_){for(var A=new _Set,Fe=[],st=0,lt,_t;st<_.length;)_t=_[st],lt=g(_t),A.add(lt)&&Fe.push(_t),st+=1;return Fe})),uniq=uniqBy$1(identity$5);function _toPairs(g){var _=[];for(var A in g)_has(A,g)&&(_[_.length]=[A,g[A]]);return _}var maxBy$1=_curry3(function(g,_,A){var Fe=g(A);return max$3(g(_),Fe)===Fe?A:_}),mergeWithKey=_curry3(function(g,_,A){var Fe={},st;for(st in _=_||{},A=A||{},_)_has(st,_)&&(Fe[st]=_has(st,A)?g(st,_[st],A[st]):_[st]);for(st in A)_has(st,A)&&!_has(st,Fe)&&(Fe[st]=A[st]);return Fe}),mergeDeepWithKey=_curry3(function g(_,A,Fe){return mergeWithKey(function(A,Fe,st){return _isObject(Fe)&&_isObject(st)?g(_,Fe,st):_(A,Fe,st)},A,Fe)}),mergeDeepLeft=_curry2(function(g,_){return mergeDeepWithKey(function(g,_,A){return _},g,_)}),min$2=_curry2(function(g,_){if(g===_)return g;function A(g,_){if(g<_!=_<g)return _<g?_:g}var Fe=A(g,_);if(Fe!==void 0)return Fe;var st=A(typeof g,typeof _);if(st!==void 0)return st===typeof g?g:_;var lt=toString$2(g),_t=A(lt,toString$2(_));return _t===void 0||_t===lt?g:_}),minBy$1=_curry3(function(g,_,A){var Fe=g(A);return min$2(g(_),Fe)===Fe?A:_}),pick=_curry2(function(g,_){for(var A={},Fe=0;Fe<g.length;)g[Fe]in _&&(A[g[Fe]]=_[g[Fe]]),Fe+=1;return A}),toPairs=_curry1(_toPairs),unnest$1=chain(_identity),require_quarterOfYear=__commonJSMin(((g,_)=>{(function(A,Fe){typeof g==`object`&&_!==void 0?_.exports=Fe():typeof define==`function`&&define.amd?define(Fe):(A=typeof globalThis<`u`?globalThis:A||self).dayjs_plugin_quarterOfYear=Fe()})(g,(function(){var g=`month`,_=`quarter`;return function(A,Fe){var st=Fe.prototype;st.quarter=function(g){return this.$utils().u(g)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(g-1))};var lt=st.add;st.add=function(A,Fe){return A=Number(A),this.$utils().p(Fe)===_?this.add(3*A,g):lt.bind(this)(A,Fe)};var _t=st.startOf;st.startOf=function(A,Fe){var st=this.$utils(),lt=!!st.u(Fe)||Fe;if(st.p(A)===_){var bt=this.quarter()-1;return lt?this.month(3*bt).startOf(g).startOf(`day`):this.month(3*bt+2).endOf(g).endOf(`day`)}return _t.bind(this)(A,Fe)}}}))})),require_duration=__commonJSMin(((g,_)=>{(function(A,Fe){typeof g==`object`&&_!==void 0?_.exports=Fe():typeof define==`function`&&define.amd?define(Fe):(A=typeof globalThis<`u`?globalThis:A||self).dayjs_plugin_duration=Fe()})(g,(function(){var g,_,A=1e3,Fe=6e4,st=36e5,lt=864e5,_t=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,bt=31536e6,xt=2592e6,wt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,Tt={years:bt,months:xt,days:lt,hours:st,minutes:Fe,seconds:A,milliseconds:1,weeks:6048e5},Et=function(g){return g instanceof Pt},Dt=function(g,_,A){return new Pt(g,A,_.$l)},Ot=function(g){return _.p(g)+`s`},kt=function(g){return g<0},At=function(g){return kt(g)?Math.ceil(g):Math.floor(g)},Mt=function(g){return Math.abs(g)},Nt=function(g,_){return g?kt(g)?{negative:!0,format:``+Mt(g)+_}:{negative:!1,format:``+g+_}:{negative:!1,format:``}},Pt=function(){function kt(g,_,A){var Fe=this;if(this.$d={},this.$l=A,g===void 0&&(this.$ms=0,this.parseFromMilliseconds()),_)return Dt(g*Tt[Ot(_)],this);if(typeof g==`number`)return this.$ms=g,this.parseFromMilliseconds(),this;if(typeof g==`object`)return Object.keys(g).forEach((function(_){Fe.$d[Ot(_)]=g[_]})),this.calMilliseconds(),this;if(typeof g==`string`){var st=g.match(wt);if(st){var lt=st.slice(2).map((function(g){return g==null?0:Number(g)}));return this.$d.years=lt[0],this.$d.months=lt[1],this.$d.weeks=lt[2],this.$d.days=lt[3],this.$d.hours=lt[4],this.$d.minutes=lt[5],this.$d.seconds=lt[6],this.calMilliseconds(),this}}return this}var Mt=kt.prototype;return Mt.calMilliseconds=function(){var g=this;this.$ms=Object.keys(this.$d).reduce((function(_,A){return _+(g.$d[A]||0)*Tt[A]}),0)},Mt.parseFromMilliseconds=function(){var g=this.$ms;this.$d.years=At(g/bt),g%=bt,this.$d.months=At(g/xt),g%=xt,this.$d.days=At(g/lt),g%=lt,this.$d.hours=At(g/st),g%=st,this.$d.minutes=At(g/Fe),g%=Fe,this.$d.seconds=At(g/A),g%=A,this.$d.milliseconds=g},Mt.toISOString=function(){var g=Nt(this.$d.years,`Y`),_=Nt(this.$d.months,`M`),A=+this.$d.days||0;this.$d.weeks&&(A+=7*this.$d.weeks);var Fe=Nt(A,`D`),st=Nt(this.$d.hours,`H`),lt=Nt(this.$d.minutes,`M`),_t=this.$d.seconds||0;this.$d.milliseconds&&(_t+=this.$d.milliseconds/1e3);var bt=Nt(_t,`S`),xt=g.negative||_.negative||Fe.negative||st.negative||lt.negative||bt.negative,wt=st.format||lt.format||bt.format?`T`:``,Tt=(xt?`-`:``)+`P`+g.format+_.format+Fe.format+wt+st.format+lt.format+bt.format;return Tt===`P`||Tt===`-P`?`P0D`:Tt},Mt.toJSON=function(){return this.toISOString()},Mt.format=function(g){var A=g||`YYYY-MM-DDTHH:mm:ss`,Fe={Y:this.$d.years,YY:_.s(this.$d.years,2,`0`),YYYY:_.s(this.$d.years,4,`0`),M:this.$d.months,MM:_.s(this.$d.months,2,`0`),D:this.$d.days,DD:_.s(this.$d.days,2,`0`),H:this.$d.hours,HH:_.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:_.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:_.s(this.$d.seconds,2,`0`),SSS:_.s(this.$d.milliseconds,3,`0`)};return A.replace(_t,(function(g,_){return _||String(Fe[g])}))},Mt.as=function(g){return this.$ms/Tt[Ot(g)]},Mt.get=function(g){var _=this.$ms,A=Ot(g);return A===`milliseconds`?_%=1e3:_=A===`weeks`?At(_/Tt[A]):this.$d[A],_===0?0:_},Mt.add=function(g,_,A){var Fe=_?g*Tt[Ot(_)]:Et(g)?g.$ms:Dt(g,this).$ms;return Dt(this.$ms+Fe*(A?-1:1),this)},Mt.subtract=function(g,_){return this.add(g,_,!0)},Mt.locale=function(g){var _=this.clone();return _.$l=g,_},Mt.clone=function(){return Dt(this.$ms,this)},Mt.humanize=function(_){return g().add(this.$ms,`ms`).locale(this.$l).fromNow(!_)},Mt.milliseconds=function(){return this.get(`milliseconds`)},Mt.asMilliseconds=function(){return this.as(`milliseconds`)},Mt.seconds=function(){return this.get(`seconds`)},Mt.asSeconds=function(){return this.as(`seconds`)},Mt.minutes=function(){return this.get(`minutes`)},Mt.asMinutes=function(){return this.as(`minutes`)},Mt.hours=function(){return this.get(`hours`)},Mt.asHours=function(){return this.as(`hours`)},Mt.days=function(){return this.get(`days`)},Mt.asDays=function(){return this.as(`days`)},Mt.weeks=function(){return this.get(`weeks`)},Mt.asWeeks=function(){return this.as(`weeks`)},Mt.months=function(){return this.get(`months`)},Mt.asMonths=function(){return this.as(`months`)},Mt.years=function(){return this.get(`years`)},Mt.asYears=function(){return this.as(`years`)},kt}();return function(A,Fe,st){g=st,_=st().$utils(),st.duration=function(g,_){return Dt(g,{$l:st.locale()},_)},st.isDuration=Et;var lt=Fe.prototype.add,_t=Fe.prototype.subtract;Fe.prototype.add=function(g,_){return Et(g)&&(g=g.asMilliseconds()),lt.bind(this)(g,_)},Fe.prototype.subtract=function(g,_){return Et(g)&&(g=g.asMilliseconds()),_t.bind(this)(g,_)}}}))})),require_isoWeek=__commonJSMin(((g,_)=>{(function(A,Fe){typeof g==`object`&&_!==void 0?_.exports=Fe():typeof define==`function`&&define.amd?define(Fe):(A=typeof globalThis<`u`?globalThis:A||self).dayjs_plugin_isoWeek=Fe()})(g,(function(){var g=`day`;return function(g,_,A){var Fe=function(g){return g.add(4-g.isoWeekday(),`day`)},st=_.prototype;st.isoWeekYear=function(){return Fe(this).year()},st.isoWeek=function(g){if(!this.$utils().u(g))return this.add(7*(g-this.isoWeek()),`day`);var _,st,lt,_t,bt=Fe(this),xt=(_=this.isoWeekYear(),st=this.$u,lt=(st?A.utc:A)().year(_).startOf(`year`),_t=4-lt.isoWeekday(),lt.isoWeekday()>4&&(_t+=7),lt.add(_t,`day`));return bt.diff(xt,`week`)+1},st.isoWeekday=function(g){return this.$utils().u(g)?this.day()||7:this.day(this.day()%7?g:g-7)};var lt=st.startOf;st.startOf=function(g,_){var A=this.$utils(),Fe=!!A.u(_)||_;return A.p(g)===`isoweek`?Fe?this.date(this.date()-(this.isoWeekday()-1)).startOf(`day`):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf(`day`):lt.bind(this)(g,_)}}}))})),require_en=__commonJSMin(((g,_)=>{(function(A,Fe){typeof g==`object`&&_!==void 0?_.exports=Fe():typeof define==`function`&&define.amd?define(Fe):(A=typeof globalThis<`u`?globalThis:A||self).dayjs_locale_en=Fe()})(g,(function(){return{name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`)}}))})),import_dayjs_min=__toESM(require_dayjs_min(),1),import_quarterOfYear=__toESM(require_quarterOfYear(),1),import_duration=__toESM(require_duration(),1),import_isoWeek=__toESM(require_isoWeek(),1),import_en=__toESM(require_en(),1);import_dayjs_min.default.extend(import_quarterOfYear.default),import_dayjs_min.default.extend(import_duration.default),import_dayjs_min.default.extend(import_isoWeek.default);var cubeInternalLocale=`cube-internal-en`,customLocale={...import_en.default,name:cubeInternalLocale,weekStart:1};import_dayjs_min.default.Ls[cubeInternalLocale]=customLocale;var GRANULARITIES=[{name:void 0,title:`w/o grouping`},{name:`second`,title:`Second`},{name:`minute`,title:`Minute`},{name:`hour`,title:`Hour`},{name:`day`,title:`Day`},{name:`week`,title:`Week`},{name:`month`,title:`Month`},{name:`quarter`,title:`Quarter`},{name:`year`,title:`Year`}],internalDayjs=(...g)=>(0,import_dayjs_min.default)(...g).locale(cubeInternalLocale),TIME_SERIES={day:g=>g.by(`d`).map(g=>g.format(`YYYY-MM-DDT00:00:00.000`)),month:g=>g.snapTo(`month`).by(`M`).map(g=>g.format(`YYYY-MM-01T00:00:00.000`)),year:g=>g.snapTo(`year`).by(`y`).map(g=>g.format(`YYYY-01-01T00:00:00.000`)),hour:g=>g.by(`h`).map(g=>g.format(`YYYY-MM-DDTHH:00:00.000`)),minute:g=>g.by(`m`).map(g=>g.format(`YYYY-MM-DDTHH:mm:00.000`)),second:g=>g.by(`s`).map(g=>g.format(`YYYY-MM-DDTHH:mm:ss.000`)),week:g=>g.snapTo(`week`).by(`w`).map(g=>g.startOf(`week`).format(`YYYY-MM-DDT00:00:00.000`)),quarter:g=>g.snapTo(`quarter`).by(`quarter`).map(g=>g.startOf(`quarter`).format(`YYYY-MM-DDT00:00:00.000`))},isPredefinedGranularity=g=>!!TIME_SERIES[g],DateRegex=/^\d\d\d\d-\d\d-\d\d$/,LocalDateRegex=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z?$/;function parseSqlInterval(g){let _={},A=g.split(/\s+/);for(let g=0;g<A.length;g+=2){let Fe=parseInt(A[g],10),st=A[g+1],lt=st.endsWith(`s`)?st.slice(0,-1):st;_[lt]=Fe}return _}function addInterval(g,_){let A=g.clone();return Object.entries(_).forEach(([g,_])=>{A=A.add(_,g)}),A}function subtractInterval(g,_){let A=g.clone();return Object.entries(_).forEach(([g,_])=>{A=A.subtract(_,g)}),A}function alignToOrigin(g,_,A){let Fe=g.clone(),st,lt=!1,_t=addInterval(A,_);if(_t.isBefore(A)&&(lt=!0),_t=A.clone(),g.isBefore(A)){for(st=lt?addInterval:subtractInterval;_t.isAfter(g);)_t=st(_t,_);Fe=_t}else{for(st=lt?subtractInterval:addInterval;_t.isBefore(g);)Fe=_t.clone(),_t=st(_t,_);_t.isSame(g)&&(Fe=_t)}return Fe}var dayRange=(g,_,A)=>({by:A=>{let Fe=[],st=internalDayjs(g),lt=internalDayjs(_);for(;st.startOf(A).isBefore(lt)||st.isSame(lt);)Fe.push(st),st=st.add(1,A);return Fe},snapTo:Fe=>{if(!isPredefinedGranularity(Fe)&&A){let _;for(let g of Object.keys(A))if(g.endsWith(`.${Fe}`)&&A[g].granularity){_=A[g].granularity;break}if(_?.interval){let Fe=parseSqlInterval(_.interval),st=internalDayjs(g);if(_.origin||_.offset){let g;g=_.origin?internalDayjs(_.origin):addInterval(internalDayjs().startOf(`year`),parseSqlInterval(_.offset)),st=alignToOrigin(st,Fe,g)}let lt=addInterval(st,Fe).subtract(1,`millisecond`);return dayRange(st,lt,A)}}return dayRange(internalDayjs(g).startOf(Fe),internalDayjs(_).endOf(Fe),A)},start:internalDayjs(g),end:internalDayjs(_)}),timeSeriesFromCustomInterval=(g,_,A)=>{let Fe=parseSqlInterval(A.interval),st=internalDayjs(g),lt=internalDayjs(_),_t=A.origin?internalDayjs(A.origin):internalDayjs().startOf(`year`);A.offset&&(_t=addInterval(_t,parseSqlInterval(A.offset)));let bt=alignToOrigin(st,Fe,_t),xt=[];for(;bt.isBefore(lt)||bt.isSame(lt);)xt.push(bt.format(`YYYY-MM-DDTHH:mm:ss.000`)),bt=addInterval(bt,Fe);return xt},diffTimeUnitForInterval=g=>/second/i.test(g)?`second`:/minute/i.test(g)?`minute`:/hour/i.test(g)?`hour`:/day/i.test(g)||/week/i.test(g)?`day`:/month/i.test(g)||/quarter/i.test(g)?`month`:`year`,granularityOrder=[`year`,`quarter`,`month`,`week`,`day`,`hour`,`minute`,`second`],minGranularityForIntervals=(g,_)=>{let A=diffTimeUnitForInterval(g),Fe=diffTimeUnitForInterval(_);return granularityOrder.indexOf(A)>granularityOrder.indexOf(Fe)?A:Fe},granularityFor=g=>{let _=internalDayjs(g),A=_.month(),Fe=_.date(),st=_.hour(),lt=_.minute(),_t=_.second(),bt=_.millisecond(),xt=_.isoWeekday();return A===0&&Fe===1&&st===0&<===0&&_t===0&&bt===0?`year`:Fe===1&&st===0&<===0&&_t===0&&bt===0?`month`:xt===1&&st===0&<===0&&_t===0&&bt===0?`week`:st===0&<===0&&_t===0&&bt===0?`day`:lt===0&&_t===0&&bt===0?`hour`:_t===0&&bt===0?`minute`:`second`};function removeEmptyQueryFields(g){return fromPairs(Object.entries(g||{}).flatMap(([g,_])=>[`measures`,`dimensions`,`segments`,`timeDimensions`,`filters`].includes(g)&&Array.isArray(_)&&_.length===0||g===`order`&&_&&(Array.isArray(_)&&_.length===0||!Object.keys(_).length)?[]:[[g,_]]))}function validateQuery$1(g){let _=g||{};return removeEmptyQueryFields({..._,filters:(_.filters||[]).filter(g=>`operator`in g),timeDimensions:(_.timeDimensions||[]).filter(g=>!(!g.dateRange&&!g.granularity))})}function areQueriesEqual(g,_){return equals$2(Object.entries(g?.order||{}),Object.entries(_?.order||{}))&&equals$2(g,_)}function defaultOrder(g){let _=(g.timeDimensions||[]).find(g=>g.granularity);return _?{[_.dimension]:`asc`}:(g.measures||[]).length>0&&(g.dimensions||[]).length>0?{[g.measures[0]]:`desc`}:(g.dimensions||[]).length>0?{[g.dimensions[0]]:`asc`}:{}}function defaultHeuristics(g,_,A){let{query:Fe,...st}=clone(g),{meta:lt,sessionGranularity:_t}=A,bt=_t||`day`,xt={shouldApplyHeuristicOrder:!1,pivotConfig:null,query:Fe,...st},wt=null;if(areQueriesEqual(Fe,_)||(wt=Fe),Array.isArray(wt)||Array.isArray(_))return{shouldApplyHeuristicOrder:!1,pivotConfig:null,...g};if(wt){if((_.timeDimensions||[]).length===1&&(wt.timeDimensions||[]).length===1&&wt.timeDimensions[0].granularity&&_.timeDimensions[0].granularity!==wt.timeDimensions[0].granularity&&(xt={...xt,sessionGranularity:wt.timeDimensions[0].granularity}),(_.measures||[]).length===0&&(wt.measures||[]).length>0||(_.measures||[]).length===1&&(wt.measures||[]).length===1&&_.measures[0]!==wt.measures[0]){let[g]=wt.timeDimensions||[],_=lt.defaultTimeDimensionNameFor(wt.measures[0]);return wt={...wt,timeDimensions:_?[{dimension:_,granularity:g?.granularity||bt,dateRange:g?.dateRange}]:[]},{...xt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:wt,chartType:_?`line`:`number`}}return(_.dimensions||[]).length===0&&(wt.dimensions||[]).length>0?(wt={...wt,timeDimensions:(wt.timeDimensions||[]).map(g=>({...g,granularity:void 0}))},{...xt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:wt,chartType:`table`}):(_.dimensions||[]).length>0&&(wt.dimensions||[]).length===0?(wt={...wt,timeDimensions:(wt.timeDimensions||[]).map(g=>({...g,granularity:g.granularity||bt}))},{...xt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:wt,chartType:(wt.timeDimensions||[]).length?`line`:`number`}):((_.dimensions||[]).length>0||(_.measures||[]).length>0)&&(wt.dimensions||[]).length===0&&(wt.measures||[]).length===0?(wt={...wt,timeDimensions:[],filters:[]},{...xt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:wt,sessionGranularity:null}):xt}if(xt.chartType){let g=xt.chartType;if((g===`line`||g===`area`)&&(_.timeDimensions||[]).length===1&&!_.timeDimensions[0].granularity){let[g]=_.timeDimensions;return{...xt,pivotConfig:null,query:{..._,timeDimensions:[{...g,granularity:bt}]}}}if((g===`pie`||g===`table`||g===`number`)&&(_.timeDimensions||[]).length===1&&_.timeDimensions[0].granularity){let[g]=_.timeDimensions;return{...xt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:{..._,timeDimensions:[{...g,granularity:void 0}]}}}}return xt}function isQueryPresent(g){return g?(Array.isArray(g)?g:[g]).every(g=>g.measures?.length||g.dimensions?.length||g.timeDimensions?.length):!1}function movePivotItem$1(g,_,A,Fe,st){let lt={...g,x:[...g.x||[]],y:[...g.y||[]]},_t=g[Fe][_],bt=lt[st].length-1;return _t===`measures`?A=bt+1:Fe===st&&A>=bt&<[st][bt]===`measures`?A=bt-1:Fe!==st&&A>bt&<[st][bt]===`measures`&&(A=bt),lt[Fe].splice(_,1),lt[st].splice(A,0,_t),lt}function moveItemInArray(g,_,A){let Fe=[...g],[st]=Fe.splice(_,1);return Fe.splice(A,0,st),Fe}function flattenFilters(g=[]){return g.reduce((g,_)=>`or`in _?[...g,...flattenFilters(_.or)]:`and`in _?[...g,...flattenFilters(_.and)]:[...g,_],[])}function getQueryMembers(g={}){let _=[`measures`,`dimensions`,`segments`],A=new Set;return _.forEach(_=>(g[_]||[]).forEach(g=>A.add(g))),(g.timeDimensions||[]).forEach(g=>A.add(g.dimension)),flattenFilters(g.filters).forEach(g=>{let _=g.dimension||g.member;typeof _==`string`&&A.add(_)}),[...A]}function aliasSeries(g,_,A,Fe=new Set){let st=g.filter(g=>g!=null);return A?.aliasSeries?.[_]?[A.aliasSeries[_],...st]:Fe.has(st[0])?[_,...st]:st}var groupByToPairs=function(g){let _=new Map;return A=>(A.forEach(A=>{let Fe=g(A);_.has(Fe)||_.set(Fe,[]),_.get(Fe).push(A)}),Array.from(_.entries()))},unnest=g=>{let _=[];return g.forEach(g=>{g.forEach(g=>_.push(g))}),_},QUERY_TYPE={REGULAR_QUERY:`regularQuery`,COMPARE_DATE_RANGE_QUERY:`compareDateRangeQuery`,BLENDING_QUERY:`blendingQuery`},ResultSet=class g{static measureFromAxis(g){return g[g.length-1]}static timeDimensionMember(g){return`${g.dimension}.${g.granularity}`}static deserialize(_,A){return new g(_.loadResponse,A)}constructor(g,_={}){if(`queryType`in g&&g.queryType!=null?(this.loadResponse=g,this.queryType=g.queryType,this.loadResponses=g.results):(this.queryType=QUERY_TYPE.REGULAR_QUERY,this.loadResponse={...g,pivotQuery:{...g.query,queryType:this.queryType}},this.loadResponses=[g]),!Object.values(QUERY_TYPE).includes(this.queryType))throw Error(`Unknown query type`);this.parseDateMeasures=_.parseDateMeasures,this.options=_,this.backwardCompatibleData=[]}drillDown(g,_){if(this.queryType===QUERY_TYPE.COMPARE_DATE_RANGE_QUERY)throw Error(`compareDateRange drillDown query is not currently supported`);if(this.queryType===QUERY_TYPE.BLENDING_QUERY)throw Error(`Data blending drillDown query is not currently supported`);let{query:A}=this.loadResponses[0],Fe=g?.xValues??[],st=g?.yValues??[],lt=this.normalizePivotConfig(_),_t=[];lt?.x.forEach((g,_)=>_t.push([g,Fe[_]])),lt?.y.forEach((g,_)=>_t.push([g,st[_]]));let{filters:bt=[],segments:xt=[]}=this.query(),{measures:wt,timeDimensions:Tt}=this.loadResponses[0].annotation,[,Et]=_t.find(([g])=>g===`measures`)||[];if(Et===void 0&&([Et]=Object.keys(wt)),!(wt[Et]?.drillMembers?.length??0))return null;let Dt=[{member:Et,operator:`measureFilter`},...bt],Ot=[];return _t.filter(([g])=>g!==`measures`).forEach(([g,_])=>{let[Fe,st,lt]=g.split(`.`);if(lt!==void 0){let g=dayRange(_,_,Tt).snapTo(lt),_t=A.timeDimensions?.find(g=>g.dimension),bt=[g.start,g.end];if(_t?.dateRange){let[_,A]=_t.dateRange;bt=[(0,import_dayjs_min.default)(_)>g.start?(0,import_dayjs_min.default)(_):g.start,(0,import_dayjs_min.default)(A)<g.end?(0,import_dayjs_min.default)(A):g.end]}Ot.push({dimension:[Fe,st].join(`.`),dateRange:bt.map(g=>g.format(`YYYY-MM-DDTHH:mm:ss.SSS`))})}else _==null?Dt.push({member:g,operator:`notSet`}):Dt.push({member:g,operator:`equals`,values:[_.toString()]})}),Ot.length===0&&Array.isArray(A.timeDimensions)&&A.timeDimensions.length>0&&A.timeDimensions[0].granularity==null&&Ot.push(A.timeDimensions[0]),{...wt[Et].drillMembersGrouped,filters:Dt,...xt.length>0?{segments:xt}:{},timeDimensions:Ot,segments:xt,timezone:A.timezone}}series(g){return this.seriesNames(g).map(({title:_,shortTitle:A,key:Fe})=>({title:_,shortTitle:A,key:Fe,series:this.chartPivot(g).map(({x:g,..._})=>({value:_[Fe],x:g}))}))}axisValues(g,_=0){let{query:A}=this.loadResponses[_],Fe=g.filter(g=>g!==`measures`),st=g.includes(`measures`)&&A.measures||[];return g=>{let _=_=>{let A=Fe.map(_=>g[_]??null);return _&&A.push(_),A};return st.length>0?st.map(_):[_()]}}axisValuesString(g,_=`, `){return g.map(g=>g==null?`∅`:g===``?`[Empty string]`:g).join(_)}static getNormalizedPivotConfig(_,A){let Fe={x:[],y:[],fillMissingDates:!0,joinDateRange:!1},{measures:st=[],dimensions:lt=[]}=_||{},_t=(_?.timeDimensions||[]).filter(g=>!!g.granularity);A=A||(_t.length?{x:_t.map(_=>g.timeDimensionMember(_)),y:lt}:{x:lt,y:[]});let bt=mergeDeepLeft(A,Fe),xt=A=>A.map(A=>_t.find(g=>g.dimension===A)&&!lt.find(g=>g===A)?g.timeDimensionMember((_?.timeDimensions||[]).find(g=>g.dimension===A)):A);bt.x=xt(bt.x),bt.y=xt(bt.y);let wt=bt.x.concat(bt.y),Tt=_t.map(_=>g.timeDimensionMember(_)).concat(lt),Et=g=>Tt.includes(g)||g===`measures`;return bt.x=bt.x.concat(Tt.filter(g=>!wt.includes(g)&&g!==`compareDateRange`)).filter(Et),bt.y=bt.y.filter(Et),bt.x.concat(bt.y).find(g=>g===`measures`)||bt.y.push(`measures`),lt.includes(`compareDateRange`)&&!bt.y.concat(bt.x).includes(`compareDateRange`)&&bt.y.unshift(`compareDateRange`),st.length||(bt.x=bt.x.filter(g=>g!==`measures`),bt.y=bt.y.filter(g=>g!==`measures`)),bt}normalizePivotConfig(_){return g.getNormalizedPivotConfig(this.loadResponse.pivotQuery,_)}timeSeries(_,A,Fe){if(!_.granularity)return null;let st;if(st=_.dateRange,!st){let Fe=g.timeDimensionMember(_),lt=this.timeDimensionBackwardCompatibleData(A||0).map(g=>{let _=g[Fe];return _?internalDayjs(_):null}).filter(g=>!!g);st=lt.length&&[reduce(minBy$1(g=>g.toDate()),lt[0],lt).toString(),reduce(maxBy$1(g=>g.toDate()),lt[0],lt).toString()]||null}if(!st)return null;let lt=_.dateRange?_.dateRange.find(g=>g.match(DateRegex)):![`hour`,`minute`,`second`].includes(_.granularity),[_t,bt]=st,xt=dayRange(_t,bt,Fe);if(isPredefinedGranularity(_.granularity))return TIME_SERIES[_.granularity](lt?xt.snapTo(`d`):xt);if(!Fe?.[`${_.dimension}.${_.granularity}`])throw Error(`Granularity "${_.granularity}" not found in time dimension "${_.dimension}"`);return timeSeriesFromCustomInterval(_t,bt,Fe[`${_.dimension}.${_.granularity}`].granularity)}pivot(_){let A=this.normalizePivotConfig(_),{pivotQuery:Fe}=this.loadResponse,st=(_=0)=>{let st=groupByToPairs(({xValues:g})=>this.axisValuesString(g)),lt=(g,_)=>g[_]??A.fillWithValue??0;if(A.fillMissingDates&&A.x.length===1&&equals$2(A.x,(Fe.timeDimensions||[]).filter(g=>!!g.granularity).map(_=>g.timeDimensionMember(_)))){let g=this.loadResponses.map(g=>this.timeSeries(g.query.timeDimensions[0],_,g.annotation.timeDimensions));g[0]&&(st=A=>{let Fe=groupBy(({xValues:g})=>g[0],A);return g[_]?.map(g=>[g,Fe[g]||[{xValues:[g],row:{}}]])??[]})}let _t=this.axisValues(A.x,_),bt=this.axisValues(A.y,_),xt=pipe(map$3(g=>_t(g).map(_=>({xValues:_,row:g}))),unnest,st)(this.timeDimensionBackwardCompatibleData(_)),wt={};xt.forEach(([,g])=>{g.forEach(({row:g})=>{bt(g).forEach(_=>{Object.keys(g).length>0&&(wt[_.join()]=_)})})});let Tt=Object.values(wt),Et=A.x.includes(`measures`);return xt.map(([,_])=>{let{xValues:A}=_[0],Fe={};return _.forEach(({row:g})=>{bt(g).map(_=>({yValues:_,row:g})).forEach(g=>{Fe[this.axisValuesString(g.yValues)]=g})}),{xValues:A,yValuesArray:unnest(Tt.map(_=>{let st=Et?g.measureFromAxis(A):g.measureFromAxis(_);return[[_,lt((Fe[this.axisValuesString(_)]||{row:{}}).row,st)]]}))}})},lt=this.loadResponses.length>1?this.loadResponses.map((g,_)=>st(_)):[];return lt.length?this.mergePivots(lt,A.joinDateRange||!1):st()}mergePivots(g,_){let A=g.reduce((g,_)=>g!=null&&_.length>=g.length?g:_,null)||[];return A.map((Fe,st)=>({xValues:_?[g.map(g=>g[st]?.xValues||[]).join(`, `)]:A[st].xValues,yValuesArray:unnest(g.map(g=>g[st].yValuesArray))}))}chartPivot(g){let _=g=>this.parseDateMeasures&&LocalDateRegex.test(g)?new Date(g):Number.isNaN(Number.parseFloat(g))?g:Number.parseFloat(g),A=new Set;return this.queryType===QUERY_TYPE.BLENDING_QUERY&&flatten$1(this.loadResponses.map(({query:g})=>g.measures??[])).filter((g,_,A)=>A.indexOf(g)!==_).forEach(g=>A.add(g)),this.pivot(g).map(({xValues:Fe,yValuesArray:st})=>{let lt={};return st.forEach(([Fe,st],_t)=>{lt[this.axisValuesString(aliasSeries(Fe,_t,g,A),`,`)]=st&&_(st)}),{x:this.axisValuesString(Fe,`,`),xValues:Fe,...lt}})}tablePivot(g){let _=this.normalizePivotConfig(g||{}),A=_.x.concat(_.y).includes(`measures`);return this.pivot(_).map(({xValues:g,yValuesArray:Fe})=>fromPairs([..._.x.map((_,A)=>[_,g[A]]),...A?Fe.map(([g,_])=>[g.length?g.join():`value`,_]):[]]))}tableColumns(g){let _=this.normalizePivotConfig(g||{}),A=this.loadResponses.map(g=>g.annotation).reduce((g,_)=>mergeDeepLeft(g,_),{dimensions:{},measures:{},timeDimensions:{},segments:{}}),Fe=Object.values(A).reduce((g,_)=>({...g,..._}),{}),st={},lt=g=>{let{title:_,shortTitle:A,type:st,format:lt,meta:_t,currency:bt,granularity:xt}=Fe[g]||{};return{key:g,title:_,shortTitle:A,type:st,format:lt,meta:_t,currency:bt,granularity:xt?.name}},_t=this.pivot(_);(_t[0]?.yValuesArray||[]).forEach(([g])=>{if(g.length>0){let A=st;g.forEach((g,Fe)=>{A[`_${g}`]={key:g,memberId:_.y[Fe]===`measures`?g:_.y[Fe],children:A[`_${g}`]?.children||{}},A=A[`_${g}`].children})}});let bt=(g={},_=[])=>Object.keys(g).length===0?[]:Object.values(g).map(({key:g,...A})=>{let Fe=bt(A.children,[..._,g]),{title:st,shortTitle:_t,...xt}=lt(A.memberId),wt=g!==A.memberId||st==null?g:``;return Fe.length?{...xt,key:g,title:[st,wt].join(` `).trim(),shortTitle:wt||_t,children:Fe}:{...xt,key:g,dataIndex:[..._,g].join(),title:[st,wt].join(` `).trim(),shortTitle:wt||_t}}),xt=[];return!_t.length&&_.y.includes(`measures`)&&(xt=(this.loadResponses[0].query.measures||[]).map(g=>({...lt(g),dataIndex:g}))),!_.y.length&&_.x.includes(`measures`)&&xt.push({key:`value`,dataIndex:`value`,title:`Value`,shortTitle:`Value`,type:`string`}),_.x.map(g=>g===`measures`?{key:`measures`,dataIndex:`measures`,title:`Measures`,shortTitle:`Measures`,type:`string`}:{...lt(g),dataIndex:g}).concat(bt(st)).concat(xt)}totalRow(g){return this.chartPivot(g)[0]}categories(g){return this.chartPivot(g)}seriesNames(_){let A=this.normalizePivotConfig(_),Fe=this.loadResponses.map(g=>g.annotation.measures).reduce((g,_)=>({...g,..._}),{}),st=unnest(this.loadResponses.map((g,_)=>pipe(map$3(this.axisValues(A.y,_)),unnest,uniq)(this.timeDimensionBackwardCompatibleData(_)))),lt=new Set;return this.queryType===QUERY_TYPE.BLENDING_QUERY&&flatten$1(this.loadResponses.map(({query:g})=>g.measures??[])).filter((g,_,A)=>A.indexOf(g)!==_).forEach(g=>lt.add(g)),st.map((_,st)=>{let _t=aliasSeries(_,st,A,lt);return{title:this.axisValuesString(A.y.find(g=>g===`measures`)?dropLast(1,_t).concat(Fe[g.measureFromAxis(_)].title):_t,`, `),shortTitle:this.axisValuesString(A.y.find(g=>g===`measures`)?dropLast(1,_t).concat(Fe[g.measureFromAxis(_)].shortTitle):_t,`, `),key:this.axisValuesString(_t,`,`),yValues:_}})}query(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].query}pivotQuery(){return this.loadResponse.pivotQuery||null}totalRows(){return this.loadResponses[0].total}rawData(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].data}annotation(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].annotation}timeDimensionBackwardCompatibleData(_){if(_===void 0)throw Error(`resultIndex is required`);if(!this.backwardCompatibleData[_]){let{data:A,query:Fe}=this.loadResponses[_],st=(Fe.timeDimensions||[]).filter(g=>!!g.granularity);this.backwardCompatibleData[_]=A.map(_=>({..._,...fromPairs(Object.keys(_).filter(A=>{let Fe=st.find(g=>g.dimension===A);return Fe&&!_[g.timeDimensionMember(Fe)]}).map(A=>[g.timeDimensionMember(st.find(g=>g.dimension===A)),_[A]]))}))}return this.backwardCompatibleData[_]}decompose(){return this.loadResponses.map(_=>new g({queryType:QUERY_TYPE.REGULAR_QUERY,pivotQuery:{..._.query,queryType:QUERY_TYPE.REGULAR_QUERY},results:[_]},this.options))}serialize(){return{loadResponse:clone(this.loadResponse)}}},SqlQuery=class{constructor(g){this.sqlQuery=g}rawQuery(){return this.sqlQuery.sql}sql(){return this.rawQuery().sql[0]}},memberMap=g=>fromPairs(g.map(g=>[g.name,g])),operators$1={string:[{name:`contains`,title:`contains`},{name:`notContains`,title:`does not contain`},{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`set`,title:`is set`},{name:`notSet`,title:`is not set`},{name:`startsWith`,title:`starts with`},{name:`notStartsWith`,title:`does not start with`},{name:`endsWith`,title:`ends with`},{name:`notEndsWith`,title:`does not end with`}],number:[{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`set`,title:`is set`},{name:`notSet`,title:`is not set`},{name:`gt`,title:`>`},{name:`gte`,title:`>=`},{name:`lt`,title:`<`},{name:`lte`,title:`<=`}],time:[{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`inDateRange`,title:`in date range`},{name:`notInDateRange`,title:`not in date range`},{name:`afterDate`,title:`after date`},{name:`afterOrOnDate`,title:`after or on date`},{name:`beforeDate`,title:`before date`},{name:`beforeOrOnDate`,title:`before or on date`}]},Meta=class{constructor(g){this.meta=g;let{cubes:_}=this.meta;this.cubes=_,this.cubesMap=fromPairs(_.map(g=>[g.name,{measures:memberMap(g.measures),dimensions:memberMap(g.dimensions),segments:memberMap(g.segments)}]))}membersForQuery(g,_){return unnest$1(this.cubes.map(g=>g[_])).sort((g,_)=>g.title>_.title?1:-1)}membersGroupedByCube(){let g=[`measures`,`dimensions`,`segments`,`timeDimensions`];return this.cubes.reduce((_,A)=>(g.forEach(g=>{let Fe=[];switch(g){case`measures`:Fe=A.measures||[];break;case`dimensions`:Fe=A.dimensions||[];break;case`segments`:Fe=A.segments||[];break;case`timeDimensions`:Fe=A.dimensions.filter(g=>g.type===`time`)||[]}_[g].push({cubeName:A.name,cubeTitle:A.title,type:A.type,public:A.public,members:Fe})}),_),{measures:[],dimensions:[],segments:[],timeDimensions:[]})}resolveMember(g,_){let[A]=g.split(`.`);return this.cubesMap[A]?(Array.isArray(_)?_:[_]).map(_=>this.cubesMap[A][_]&&this.cubesMap[A][_][g]).find(g=>g)||{title:g,error:`Path not found '${g}'`}:{title:g,error:`Cube not found ${A} for path '${g}'`}}defaultTimeDimensionNameFor(g){let[_]=g.split(`.`);return this.cubesMap[_]?Object.keys(this.cubesMap[_].dimensions||{}).find(g=>this.cubesMap[_].dimensions[g].type===`time`):null}filterOperatorsForMember(g,_){let A=this.resolveMember(g,_);return`error`in A||!(`type`in A)||A.type===`boolean`?operators$1.string:operators$1[A.type]||operators$1.string}},ProgressResult=class{constructor(g){this.progressResponse=g}stage(){return this.progressResponse.stage}timeElapsed(){return this.progressResponse.timeElapsed}};(function(g){var _=g.URLSearchParams&&g.URLSearchParams.prototype.get?g.URLSearchParams:null,A=_&&new _({a:1}).toString()===`a=1`,Fe=_&&new _(`s=%2B`).get(`s`)===`+`,st=`__URLSearchParams__`,lt=!_||(function(){var g=new _;return g.append(`s`,` &`),g.toString()===`s=+%26`})(),_t=xt.prototype,bt=!!(g.Symbol&&g.Symbol.iterator);if(_&&A&&Fe&<)return;function xt(g){g=g||``,(g instanceof URLSearchParams||g instanceof xt)&&(g=g.toString()),this[st]=kt(g)}_t.append=function(g,_){At(this[st],g,_)},_t.delete=function(g){delete this[st][g]},_t.get=function(g){var _=this[st];return g in _?_[g][0]:null},_t.getAll=function(g){var _=this[st];return g in _?_[g].slice(0):[]},_t.has=function(g){return g in this[st]},_t.set=function(g,_){this[st][g]=[``+_]},_t.toString=function(){var g=this[st],_=[],A,Fe,lt,_t;for(Fe in g)for(lt=Et(Fe),A=0,_t=g[Fe];A<_t.length;A++)_.push(lt+`=`+Et(_t[A]));return _.join(`&`)};var wt=!!Fe&&_&&!A&&g.Proxy;Object.defineProperty(g,"URLSearchParams",{value:wt?new Proxy(_,{construct:function(g,_){return new g(new xt(_[0]).toString())}}):xt});var Tt=g.URLSearchParams.prototype;Tt.polyfill=!0,Tt.forEach=Tt.forEach||function(g,_){var A=kt(this.toString());Object.getOwnPropertyNames(A).forEach(function(Fe){A[Fe].forEach(function(A){g.call(_,A,Fe,this)},this)},this)},Tt.sort=Tt.sort||function(){var g=kt(this.toString()),_=[],A,Fe,st;for(A in g)_.push(A);for(_.sort(),Fe=0;Fe<_.length;Fe++)this.delete(_[Fe]);for(Fe=0;Fe<_.length;Fe++){var lt=_[Fe],_t=g[lt];for(st=0;st<_t.length;st++)this.append(lt,_t[st])}},Tt.keys=Tt.keys||function(){var g=[];return this.forEach(function(_,A){g.push(A)}),Ot(g)},Tt.values=Tt.values||function(){var g=[];return this.forEach(function(_){g.push(_)}),Ot(g)},Tt.entries=Tt.entries||function(){var g=[];return this.forEach(function(_,A){g.push([A,_])}),Ot(g)},bt&&(Tt[g.Symbol.iterator]=Tt[g.Symbol.iterator]||Tt.entries);function Et(g){var _={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(g).replace(/[!'\(\)~]|%20|%00/g,function(g){return _[g]})}function Dt(g){return g.replace(/[ +]/g,`%20`).replace(/(%[a-f0-9]{2})+/gi,function(g){return decodeURIComponent(g)})}function Ot(_){var A={next:function(){var g=_.shift();return{done:g===void 0,value:g}}};return bt&&(A[g.Symbol.iterator]=function(){return A}),A}function kt(g){var _={};if(typeof g==`object`){if(Mt(g))for(var A=0;A<g.length;A++){var Fe=g[A];if(Mt(Fe)&&Fe.length===2)At(_,Fe[0],Fe[1]);else throw TypeError(`Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements`)}else for(var st in g)g.hasOwnProperty(st)&&At(_,st,g[st])}else{g.indexOf(`?`)===0&&(g=g.slice(1));for(var lt=g.split(`&`),_t=0;_t<lt.length;_t++){var bt=lt[_t],xt=bt.indexOf(`=`);-1<xt?At(_,Dt(bt.slice(0,xt)),Dt(bt.slice(xt+1))):bt&&At(_,Dt(bt),``)}}return _}function At(g,_,A){var Fe=typeof A==`string`?A:A!=null&&typeof A.toString==`function`?A.toString():JSON.stringify(A);_ in g?g[_].push(Fe):g[_]=[Fe]}function Mt(g){return!!g&&Object.prototype.toString.call(g)===`[object Array]`}})(typeof global<`u`?global:typeof window<`u`?window:void 0);async function*responseChunks(g){if(!g.body)throw Error(`Unsupported response body type for streaming`);let _=g.body.getReader();try{for(;;){let{done:g,value:A}=await _.read();if(g)break;A&&(yield A)}}finally{_.releaseLock()}}var HttpTransport=class{constructor({authorization:g,apiUrl:_,method:A,headers:Fe={},credentials:st,fetchTimeout:lt,signal:_t}){this.authorization=g,this.apiUrl=_,this.method=A,this.headers=Fe,this.credentials=st,this.fetchTimeout=lt,this.signal=_t}request(g,{method:_,fetchTimeout:A,baseRequestId:Fe,signal:st,...lt}){let _t=1,bt=new URLSearchParams(lt&&Object.keys(lt).map(g=>({[g]:typeof lt[g]==`object`?JSON.stringify(lt[g]):lt[g]})).reduce((g,_)=>({...g,..._}),{})),xt=`${this.apiUrl}/${g}${bt.toString().length?`?${bt}`:``}`,wt=_??this.method??(xt.length<2e3?`GET`:`POST`);wt===`POST`&&(xt=`${this.apiUrl}/${g}`);let Tt=A??this.fetchTimeout,Et=st||this.signal||(Tt?AbortSignal.timeout(Tt):void 0),Dt=()=>fetch(xt,{method:wt,headers:{Authorization:this.authorization,"x-request-id":Fe&&`${Fe}-span-${_t++}`,...this.headers,...wt===`POST`?{"Content-Type":`application/json`}:{}},credentials:this.credentials,body:wt===`POST`?JSON.stringify(lt):null,signal:Et});return{async subscribe(g){try{return g(await Dt(),()=>this.subscribe(g))}catch(_){let A=`network Error`;return _.name===`AbortError`&&(A=Et?.reason===`TimeoutError`||Et?.reason?.name===`TimeoutError`?`timeout`:`aborted`),g({error:A},()=>this.subscribe(g))}}}}requestStream(g,{method:_,fetchTimeout:A,baseRequestId:Fe,signal:st,params:lt}){let _t={};lt&&Object.keys(lt).forEach(g=>{let _=lt[g];_!==void 0&&(_t[g]=typeof _==`object`?JSON.stringify(_):String(_))});let bt=new URLSearchParams(_t),xt=`${this.apiUrl}/${g}${bt.toString().length?`?${bt}`:``}`,wt=_??this.method??`POST`;wt===`POST`&&(xt=`${this.apiUrl}/${g}`);let Tt=A??this.fetchTimeout,Et,Dt=st||this.signal;return!Dt&&Tt&&(Et=new AbortController,Dt=Et.signal,setTimeout(()=>Et?.abort(),Tt)),{stream:async()=>{let g=await fetch(xt,{method:wt,headers:{Authorization:this.authorization,"x-request-id":Fe||`stream-request`,...this.headers,...wt===`POST`?{"Content-Type":`application/json`}:{}},credentials:this.credentials,body:wt===`POST`?JSON.stringify(lt||{}):null,signal:Dt});if(!g.ok)throw Error(`HTTP ${g.status}: ${g.statusText}`);if(!g.body)throw Error(`No response body available for streaming`);return responseChunks(g)},unsubscribe:async()=>{Et&&Et.abort()}}}},RequestError=class extends Error{constructor(g,_,A){super(g),this.response=_,this.status=A}};function pickCubeSqlResultMetadata(g){return{...g.lastRefreshTime?{lastRefreshTime:g.lastRefreshTime}:{},...g.external?{external:g.external}:{},...g.usedPreAggregations?{usedPreAggregations:g.usedPreAggregations}:{}}}var mutexCounter=0,MUTEX_ERROR=`Mutex has been changed`;function mutexPromise(g){return g.then(g=>g).catch(g=>{if(g!==MUTEX_ERROR)throw g;return null})}var CubeApi=class{constructor(g,_){if(g&&!Array.isArray(g)&&typeof g==`object`&&(_=g,g=void 0),!_||!_.transport&&!_.apiUrl)throw Error("The `apiUrl` option is required");this.apiToken=g,this.apiUrl=_.apiUrl,this.method=_.method,this.headers=_.headers||{},this.credentials=_.credentials,this.transport=_.transport||new HttpTransport({authorization:typeof g==`string`?g:void 0,apiUrl:this.apiUrl,method:this.method,headers:this.headers,credentials:this.credentials,fetchTimeout:_.fetchTimeout,signal:_.signal}),this.pollInterval=_.pollInterval||5,this.parseDateMeasures=_.parseDateMeasures,this.castNumerics=typeof _.castNumerics==`boolean`&&_.castNumerics,this.networkErrorRetries=_.networkErrorRetries||0,this.updateAuthorizationPromise=null}request(g,_){return this.transport.request(g,{..._,baseRequestId:_?.baseRequestId||v4()})}loadMethod(g,_,A,Fe){let st=++mutexCounter;typeof A==`function`&&!Fe&&(Fe=A,A=void 0),A=A||{};let lt=A.mutexKey||`default`;A.mutexObj&&(A.mutexObj[lt]=st);let _t=this.updateTransportAuthorization().then(()=>g()),bt=!0,xt=!1,wt=async()=>{let g=await _t;if(A&&A.mutexObj&&A.mutexObj[lt]!==st)throw xt=!0,g.unsubscribe&&await g.unsubscribe(),MUTEX_ERROR},Tt=this.networkErrorRetries,Et=async(g,st)=>{let lt=await _t,Et=async()=>A?.subscribe&&!xt?(lt.unsubscribe||await new Promise(g=>setTimeout(()=>g(),this.pollInterval*1e3)),st()):null,Dt=async(g=!1)=>xt?null:(g&&await new Promise(g=>setTimeout(()=>g(),this.pollInterval*1e3)),st());if(A?.subscribe&&!bt&&await this.updateTransportAuthorization(),bt=!1,`status`in g&&g.status===502||`error`in g&&g.error?.toLowerCase()===`network error`&&--Tt>=0)return await wt(),Dt(!0);g=g;let Ot={},kt=``;try{kt=await g.text(),Ot=JSON.parse(kt)}catch{Ot.error=kt}if(Ot.error?.includes(`Continue wait`))return await wt(),A?.progressCallback&&A.progressCallback(new ProgressResult(Ot)),Dt();if(g.status!==200){await wt(),!A?.subscribe&<.unsubscribe&&await lt.unsubscribe();let _=new RequestError(Ot.error||g.error||``,Ot,g.status);if(Fe)Fe(_);else throw _;return Et()}await wt(),!A?.subscribe&<.unsubscribe&&await lt.unsubscribe();let At=_(Ot);if(Fe)Fe(null,At);else return At;return Et()},Dt=_t.then(g=>mutexPromise(g.subscribe(Et)));return Fe?{unsubscribe:async()=>{let g=await _t;return xt=!0,g.unsubscribe?g.unsubscribe():null}}:Dt}async updateTransportAuthorization(){if(this.updateAuthorizationPromise){await this.updateAuthorizationPromise;return}let g=this.apiToken;if(typeof g==`function`){let _=(async()=>{try{let _=await g();this.transport.authorization!==_&&(this.transport.authorization=_)}finally{this.updateAuthorizationPromise=null}})();this.updateAuthorizationPromise=_,await _}}patchQueryInternal(g,_){return(_===`compact`||_===`columnar`)&&g.responseFormat!==_?{...g,responseFormat:_}:g}loadResponseInternal(g,_={}){return g.results.length&&(_?.castNumerics&&g.results.forEach(g=>{let _=Object.entries({...g.annotation.measures,...g.annotation.dimensions}).reduce((g,[_,A])=>(A.type===`number`&&g.push(_),g),[]);g.data=g.data.map(g=>(_.forEach(_=>{g[_]!=null&&(g[_]=Number(g[_]))}),g))}),g.results[0].query.responseFormat&&g.results[0].query.responseFormat===`compact`?g.results.forEach((_,A)=>{let Fe=[],{dataset:st,members:lt}=_.data;st.forEach(g=>{let _={};lt.forEach((A,Fe)=>{_[A]=g[Fe]}),Fe.push(_)}),g.results[A].data=Fe}):g.results[0].query.responseFormat&&g.results[0].query.responseFormat===`columnar`&&g.results.forEach((_,A)=>{let{columns:Fe,members:st}=_.data,lt=Fe[0]?.length??0,_t=[];for(let g=0;g<lt;g++){let _={};st.forEach((A,st)=>{_[A]=Fe[st][g]}),_t.push(_)}g.results[A].data=_t})),new ResultSet(g,{parseDateMeasures:this.parseDateMeasures})}load(g,_,A,Fe=`default`){[g,_]=this.prepareQueryOptions(g,_,Fe);let st={query:g,queryType:`multi`,signal:_?.signal,baseRequestId:_?.baseRequestId};return _?.cache&&(st.cache=_.cache),this.loadMethod(()=>this.request(`load`,st),g=>this.loadResponseInternal(g,_),_,A)}prepareQueryOptions(g,_,A=`default`){return _={castNumerics:this.castNumerics,..._},A===`compact`||A===`columnar`?Array.isArray(g)?[g.map(g=>this.patchQueryInternal(g,A)),_]:[this.patchQueryInternal(g,A),_]:[g,_]}subscribe(g,_,A,Fe=`default`){return[g,_]=this.prepareQueryOptions(g,_,Fe),this.loadMethod(()=>this.request(`subscribe`,{query:g,queryType:`multi`,signal:_?.signal,baseRequestId:_?.baseRequestId}),g=>this.loadResponseInternal(g,_),{..._,subscribe:!0},A)}sql(g,_,A){return this.loadMethod(()=>this.request(`sql`,{query:g,signal:_?.signal,baseRequestId:_?.baseRequestId}),g=>Array.isArray(g)?g.map(g=>new SqlQuery(g)):new SqlQuery(g),_,A)}meta(g,_){return this.loadMethod(()=>this.request(`meta`,{signal:g?.signal,baseRequestId:g?.baseRequestId,...g?.onlyViews?{onlyViews:!0}:{}}),g=>new Meta(g),g,_)}dryRun(g,_,A){return this.loadMethod(()=>this.request(`dry-run`,{query:g,signal:_?.signal,baseRequestId:_?.baseRequestId}),g=>g,_,A)}cubeSql(g,_,A){return this.loadMethod(()=>{let A={query:g,method:`POST`,signal:_?.signal,fetchTimeout:_?.timeout,baseRequestId:_?.baseRequestId,throwContinueWait:!0};return _?.cache&&(A.cache=_.cache),_?.timezone&&(A.timezone=_.timezone),this.request(`cubesql`,A)},g=>{if(!g||!g.error)throw Error(`Invalid response format`);if(g.error===`timeout`){let g=_?.timeout||3e5;throw Error(`CubeSQL query timed out after ${g}ms`)}if(g.error===`aborted`)throw Error(`CubeSQL query was aborted`);let[A,...Fe]=g.error.split(`
|
|
923
|
+
`;function CodeSnippet({code:g,language:_,style:A,copyMessage:Fe,theme:st=`dark`}){return(0,import_jsx_runtime.jsx)(rt,{theme:{background:st===`dark`?`#F6F6F8`:`#FFFFFF`},children:(0,import_jsx_runtime.jsxs)(StyledCodeSnippet,{style:A,children:[(0,import_jsx_runtime.jsx)(PrismCode,{code:g,language:_,style:{flexGrow:1}}),(0,import_jsx_runtime.jsx)(ButtonWrapper$1,{children:(0,import_jsx_runtime.jsx)(button_default,{icon:(0,import_jsx_runtime.jsx)(RefIcon$26,{}),onClick:()=>copyToClipboard(g,Fe||`Copied`)})})]})})}function useAppContext(){return(0,import_react.useContext)(AppContext$1)}function usePlaygroundContext(){let{playgroundContext:g}=useAppContext();return g}function useToken(){let{token:g}=useAppContext();return g}var byteToHex=[];for(let g=0;g<256;++g)byteToHex.push((g+256).toString(16).slice(1));function unsafeStringify(g,_=0){return(byteToHex[g[_+0]]+byteToHex[g[_+1]]+byteToHex[g[_+2]]+byteToHex[g[_+3]]+`-`+byteToHex[g[_+4]]+byteToHex[g[_+5]]+`-`+byteToHex[g[_+6]]+byteToHex[g[_+7]]+`-`+byteToHex[g[_+8]]+byteToHex[g[_+9]]+`-`+byteToHex[g[_+10]]+byteToHex[g[_+11]]+byteToHex[g[_+12]]+byteToHex[g[_+13]]+byteToHex[g[_+14]]+byteToHex[g[_+15]]).toLowerCase()}var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}var randomUUID=typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native_default={randomUUID};function v4(g,_,A){if(native_default.randomUUID&&!_&&!g)return native_default.randomUUID();g=g||{};let Fe=g.random??g.rng?.()??rng();if(Fe.length<16)throw Error(`Random bytes length must be >= 16`);if(Fe[6]=Fe[6]&15|64,Fe[8]=Fe[8]&63|128,_){if(A=A||0,A<0||A+16>_.length)throw RangeError(`UUID byte range ${A}:${A+15} is out of buffer bounds`);for(let g=0;g<16;++g)_[A+g]=Fe[g];return _}return unsafeStringify(Fe)}var require_dayjs_min=__commonJSMin(((g,_)=>{(function(A,Fe){typeof g==`object`&&_!==void 0?_.exports=Fe():typeof define==`function`&&define.amd?define(Fe):(A=typeof globalThis<`u`?globalThis:A||self).dayjs=Fe()})(g,(function(){var g=1e3,_=6e4,A=36e5,Fe=`millisecond`,st=`second`,lt=`minute`,_t=`hour`,bt=`day`,xt=`week`,wt=`month`,Tt=`quarter`,Et=`year`,Dt=`date`,Ot=`Invalid Date`,kt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,At=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Mt={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`)},Nt=function(g,_,A){var Fe=String(g);return!Fe||Fe.length>=_?g:``+Array(_+1-Fe.length).join(A)+g},Pt={s:Nt,z:function(g){var _=-g.utcOffset(),A=Math.abs(_),Fe=Math.floor(A/60),st=A%60;return(_<=0?`+`:`-`)+Nt(Fe,2,`0`)+`:`+Nt(st,2,`0`)},m:function g(_,A){if(_.date()<A.date())return-g(A,_);var Fe=12*(A.year()-_.year())+(A.month()-_.month()),st=_.clone().add(Fe,wt),lt=A-st<0,_t=_.clone().add(Fe+(lt?-1:1),wt);return+(-(Fe+(A-st)/(lt?st-_t:_t-st))||0)},a:function(g){return g<0?Math.ceil(g)||0:Math.floor(g)},p:function(g){return{M:wt,y:Et,w:xt,d:bt,D:Dt,h:_t,m:lt,s:st,ms:Fe,Q:Tt}[g]||String(g||``).toLowerCase().replace(/s$/,``)},u:function(g){return g===void 0}},Ft=`en`,It={};It[Ft]=Mt;var Lt=function(g){return g instanceof Ht},zt=function(g,_,A){var Fe;if(!g)return Ft;if(typeof g==`string`)It[g]&&(Fe=g),_&&(It[g]=_,Fe=g);else{var st=g.name;It[st]=g,Fe=st}return!A&&Fe&&(Ft=Fe),Fe||!A&&Ft},Bt=function(g,_){if(Lt(g))return g.clone();var A=typeof _==`object`?_:{};return A.date=g,A.args=arguments,new Ht(A)},Vt=Pt;Vt.l=zt,Vt.i=Lt,Vt.w=function(g,_){return Bt(g,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var Ht=function(){function Mt(g){this.$L=zt(g.locale,null,!0),this.parse(g)}var Nt=Mt.prototype;return Nt.parse=function(g){this.$d=function(g){var _=g.date,A=g.utc;if(_===null)return new Date(NaN);if(Vt.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _==`string`&&!/Z$/i.test(_)){var Fe=_.match(kt);if(Fe){var st=Fe[2]-1||0,lt=(Fe[7]||`0`).substring(0,3);return A?new Date(Date.UTC(Fe[1],st,Fe[3]||1,Fe[4]||0,Fe[5]||0,Fe[6]||0,lt)):new Date(Fe[1],st,Fe[3]||1,Fe[4]||0,Fe[5]||0,Fe[6]||0,lt)}}return new Date(_)}(g),this.$x=g.x||{},this.init()},Nt.init=function(){var g=this.$d;this.$y=g.getFullYear(),this.$M=g.getMonth(),this.$D=g.getDate(),this.$W=g.getDay(),this.$H=g.getHours(),this.$m=g.getMinutes(),this.$s=g.getSeconds(),this.$ms=g.getMilliseconds()},Nt.$utils=function(){return Vt},Nt.isValid=function(){return this.$d.toString()!==Ot},Nt.isSame=function(g,_){var A=Bt(g);return this.startOf(_)<=A&&A<=this.endOf(_)},Nt.isAfter=function(g,_){return Bt(g)<this.startOf(_)},Nt.isBefore=function(g,_){return this.endOf(_)<Bt(g)},Nt.$g=function(g,_,A){return Vt.u(g)?this[_]:this.set(A,g)},Nt.unix=function(){return Math.floor(this.valueOf()/1e3)},Nt.valueOf=function(){return this.$d.getTime()},Nt.startOf=function(g,_){var A=this,Fe=!!Vt.u(_)||_,Tt=Vt.p(g),Ot=function(g,_){var st=Vt.w(A.$u?Date.UTC(A.$y,_,g):new Date(A.$y,_,g),A);return Fe?st:st.endOf(bt)},kt=function(g,_){return Vt.w(A.toDate()[g].apply(A.toDate(`s`),(Fe?[0,0,0,0]:[23,59,59,999]).slice(_)),A)},At=this.$W,Mt=this.$M,Nt=this.$D,Pt=`set`+(this.$u?`UTC`:``);switch(Tt){case Et:return Fe?Ot(1,0):Ot(31,11);case wt:return Fe?Ot(1,Mt):Ot(0,Mt+1);case xt:var Ft=this.$locale().weekStart||0,It=(At<Ft?At+7:At)-Ft;return Ot(Fe?Nt-It:Nt+(6-It),Mt);case bt:case Dt:return kt(Pt+`Hours`,0);case _t:return kt(Pt+`Minutes`,1);case lt:return kt(Pt+`Seconds`,2);case st:return kt(Pt+`Milliseconds`,3);default:return this.clone()}},Nt.endOf=function(g){return this.startOf(g,!1)},Nt.$set=function(g,_){var A,xt=Vt.p(g),Tt=`set`+(this.$u?`UTC`:``),Ot=(A={},A[bt]=Tt+`Date`,A[Dt]=Tt+`Date`,A[wt]=Tt+`Month`,A[Et]=Tt+`FullYear`,A[_t]=Tt+`Hours`,A[lt]=Tt+`Minutes`,A[st]=Tt+`Seconds`,A[Fe]=Tt+`Milliseconds`,A)[xt],kt=xt===bt?this.$D+(_-this.$W):_;if(xt===wt||xt===Et){var At=this.clone().set(Dt,1);At.$d[Ot](kt),At.init(),this.$d=At.set(Dt,Math.min(this.$D,At.daysInMonth())).$d}else Ot&&this.$d[Ot](kt);return this.init(),this},Nt.set=function(g,_){return this.clone().$set(g,_)},Nt.get=function(g){return this[Vt.p(g)]()},Nt.add=function(Fe,Tt){var Dt,Ot=this;Fe=Number(Fe);var kt=Vt.p(Tt),At=function(g){var _=Bt(Ot);return Vt.w(_.date(_.date()+Math.round(g*Fe)),Ot)};if(kt===wt)return this.set(wt,this.$M+Fe);if(kt===Et)return this.set(Et,this.$y+Fe);if(kt===bt)return At(1);if(kt===xt)return At(7);var Mt=(Dt={},Dt[lt]=_,Dt[_t]=A,Dt[st]=g,Dt)[kt]||1,Nt=this.$d.getTime()+Fe*Mt;return Vt.w(Nt,this)},Nt.subtract=function(g,_){return this.add(-1*g,_)},Nt.format=function(g){var _=this,A=this.$locale();if(!this.isValid())return A.invalidDate||Ot;var Fe=g||`YYYY-MM-DDTHH:mm:ssZ`,st=Vt.z(this),lt=this.$H,_t=this.$m,bt=this.$M,xt=A.weekdays,wt=A.months,Tt=function(g,A,st,lt){return g&&(g[A]||g(_,Fe))||st[A].substr(0,lt)},Et=function(g){return Vt.s(lt%12||12,g,`0`)},Dt=A.meridiem||function(g,_,A){var Fe=g<12?`AM`:`PM`;return A?Fe.toLowerCase():Fe},kt={YY:String(this.$y).slice(-2),YYYY:this.$y,M:bt+1,MM:Vt.s(bt+1,2,`0`),MMM:Tt(A.monthsShort,bt,wt,3),MMMM:Tt(wt,bt),D:this.$D,DD:Vt.s(this.$D,2,`0`),d:String(this.$W),dd:Tt(A.weekdaysMin,this.$W,xt,2),ddd:Tt(A.weekdaysShort,this.$W,xt,3),dddd:xt[this.$W],H:String(lt),HH:Vt.s(lt,2,`0`),h:Et(1),hh:Et(2),a:Dt(lt,_t,!0),A:Dt(lt,_t,!1),m:String(_t),mm:Vt.s(_t,2,`0`),s:String(this.$s),ss:Vt.s(this.$s,2,`0`),SSS:Vt.s(this.$ms,3,`0`),Z:st};return Fe.replace(At,(function(g,_){return _||kt[g]||st.replace(`:`,``)}))},Nt.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Nt.diff=function(Fe,Dt,Ot){var kt,At=Vt.p(Dt),Mt=Bt(Fe),Nt=(Mt.utcOffset()-this.utcOffset())*_,Pt=this-Mt,Ft=Vt.m(this,Mt);return Ft=(kt={},kt[Et]=Ft/12,kt[wt]=Ft,kt[Tt]=Ft/3,kt[xt]=(Pt-Nt)/6048e5,kt[bt]=(Pt-Nt)/864e5,kt[_t]=Pt/A,kt[lt]=Pt/_,kt[st]=Pt/g,kt)[At]||Pt,Ot?Ft:Vt.a(Ft)},Nt.daysInMonth=function(){return this.endOf(wt).$D},Nt.$locale=function(){return It[this.$L]},Nt.locale=function(g,_){if(!g)return this.$L;var A=this.clone(),Fe=zt(g,_,!0);return Fe&&(A.$L=Fe),A},Nt.clone=function(){return Vt.w(this.$d,this)},Nt.toDate=function(){return new Date(this.valueOf())},Nt.toJSON=function(){return this.isValid()?this.toISOString():null},Nt.toISOString=function(){return this.$d.toISOString()},Nt.toString=function(){return this.$d.toUTCString()},Mt}(),Ut=Ht.prototype;return Bt.prototype=Ut,[[`$ms`,Fe],[`$s`,st],[`$m`,lt],[`$H`,_t],[`$W`,bt],[`$M`,wt],[`$y`,Et],[`$D`,Dt]].forEach((function(g){Ut[g[1]]=function(_){return this.$g(_,g[0],g[1])}})),Bt.extend=function(g,_){return g.$i||(g(_,Ht,Bt),g.$i=!0),Bt},Bt.locale=zt,Bt.isDayjs=Lt,Bt.unix=function(g){return Bt(1e3*g)},Bt.en=It[Ft],Bt.Ls=It,Bt.p={},Bt}))}));function _isPlaceholder(g){return typeof g==`object`&&!!g&&g[`@@functional/placeholder`]===!0}function _curry1(g){return function _(A){return arguments.length===0||_isPlaceholder(A)?_:g.apply(this,arguments)}}function _curry2(g){return function _(A,Fe){switch(arguments.length){case 0:return _;case 1:return _isPlaceholder(A)?_:_curry1(function(_){return g(A,_)});default:return _isPlaceholder(A)&&_isPlaceholder(Fe)?_:_isPlaceholder(A)?_curry1(function(_){return g(_,Fe)}):_isPlaceholder(Fe)?_curry1(function(_){return g(A,_)}):g(A,Fe)}}}function _arity(g,_){switch(g){case 0:return function(){return _.apply(this,arguments)};case 1:return function(g){return _.apply(this,arguments)};case 2:return function(g,A){return _.apply(this,arguments)};case 3:return function(g,A,Fe){return _.apply(this,arguments)};case 4:return function(g,A,Fe,st){return _.apply(this,arguments)};case 5:return function(g,A,Fe,st,lt){return _.apply(this,arguments)};case 6:return function(g,A,Fe,st,lt,_t){return _.apply(this,arguments)};case 7:return function(g,A,Fe,st,lt,_t,bt){return _.apply(this,arguments)};case 8:return function(g,A,Fe,st,lt,_t,bt,xt){return _.apply(this,arguments)};case 9:return function(g,A,Fe,st,lt,_t,bt,xt,wt){return _.apply(this,arguments)};case 10:return function(g,A,Fe,st,lt,_t,bt,xt,wt,Tt){return _.apply(this,arguments)};default:throw Error(`First argument to _arity must be a non-negative integer no greater than ten`)}}function _curryN(g,_,A){return function(){for(var Fe=[],st=0,lt=g,_t=0,bt=!1;_t<_.length||st<arguments.length;){var xt;_t<_.length&&(!_isPlaceholder(_[_t])||st>=arguments.length)?xt=_[_t]:(xt=arguments[st],st+=1),Fe[_t]=xt,_isPlaceholder(xt)?bt=!0:--lt,_t+=1}return!bt&<<=0?A.apply(this,Fe):_arity(Math.max(0,lt),_curryN(g,Fe,A))}}var curryN$1=_curry2(function(g,_){return g===1?_curry1(_):_arity(g,_curryN(g,[],_))});function _curry3(g){return function _(A,Fe,st){switch(arguments.length){case 0:return _;case 1:return _isPlaceholder(A)?_:_curry2(function(_,Fe){return g(A,_,Fe)});case 2:return _isPlaceholder(A)&&_isPlaceholder(Fe)?_:_isPlaceholder(A)?_curry2(function(_,A){return g(_,Fe,A)}):_isPlaceholder(Fe)?_curry2(function(_,Fe){return g(A,_,Fe)}):_curry1(function(_){return g(A,Fe,_)});default:return _isPlaceholder(A)&&_isPlaceholder(Fe)&&_isPlaceholder(st)?_:_isPlaceholder(A)&&_isPlaceholder(Fe)?_curry2(function(_,A){return g(_,A,st)}):_isPlaceholder(A)&&_isPlaceholder(st)?_curry2(function(_,A){return g(_,Fe,A)}):_isPlaceholder(Fe)&&_isPlaceholder(st)?_curry2(function(_,Fe){return g(A,_,Fe)}):_isPlaceholder(A)?_curry1(function(_){return g(_,Fe,st)}):_isPlaceholder(Fe)?_curry1(function(_){return g(A,_,st)}):_isPlaceholder(st)?_curry1(function(_){return g(A,Fe,_)}):g(A,Fe,st)}}}var _isArray_default=Array.isArray||function(g){return g!=null&&g.length>=0&&Object.prototype.toString.call(g)===`[object Array]`};function _isTransformer(g){return g!=null&&typeof g[`@@transducer/step`]==`function`}function _dispatchable(g,_,A){return function(){if(arguments.length===0)return A();var Fe=arguments[arguments.length-1];if(!_isArray_default(Fe)){for(var st=0;st<g.length;){if(typeof Fe[g[st]]==`function`)return Fe[g[st]].apply(Fe,Array.prototype.slice.call(arguments,0,-1));st+=1}if(_isTransformer(Fe))return _.apply(null,Array.prototype.slice.call(arguments,0,-1))(Fe)}return A.apply(this,arguments)}}function _reduced(g){return g&&g[`@@transducer/reduced`]?g:{"@@transducer/value":g,"@@transducer/reduced":!0}}var _xfBase_default={init:function(){return this.xf[`@@transducer/init`]()},result:function(g){return this.xf[`@@transducer/result`](g)}};function _arrayFromIterator(g){for(var _=[],A;!(A=g.next()).done;)_.push(A.value);return _}function _includesWith(g,_,A){for(var Fe=0,st=A.length;Fe<st;){if(g(_,A[Fe]))return!0;Fe+=1}return!1}function _functionName(g){var _=String(g).match(/^function (\w*)/);return _==null?``:_[1]}function _has(g,_){return Object.prototype.hasOwnProperty.call(_,g)}function _objectIs(g,_){return g===_?g!==0||1/g==1/_:g!==g&&_!==_}var _objectIs_default=typeof Object.is==`function`?Object.is:_objectIs,toString$3=Object.prototype.toString,_isArguments=function(){return toString$3.call(arguments)===`[object Arguments]`?function(g){return toString$3.call(g)===`[object Arguments]`}:function(g){return _has(`callee`,g)}}(),hasEnumBug=!{toString:null}.propertyIsEnumerable(`toString`),nonEnumerableProps=[`constructor`,`valueOf`,`isPrototypeOf`,`toString`,`propertyIsEnumerable`,`hasOwnProperty`,`toLocaleString`],hasArgsEnumBug=function(){return arguments.propertyIsEnumerable(`length`)}(),contains$1=function(g,_){for(var A=0;A<g.length;){if(g[A]===_)return!0;A+=1}return!1},keys$1=_curry1(typeof Object.keys==`function`&&!hasArgsEnumBug?function(g){return Object(g)===g?Object.keys(g):[]}:function(g){if(Object(g)!==g)return[];var _,A,Fe=[],st=hasArgsEnumBug&&_isArguments(g);for(_ in g)_has(_,g)&&(!st||_!==`length`)&&(Fe[Fe.length]=_);if(hasEnumBug)for(A=nonEnumerableProps.length-1;A>=0;)_=nonEnumerableProps[A],_has(_,g)&&!contains$1(Fe,_)&&(Fe[Fe.length]=_),--A;return Fe}),type$1=_curry1(function(g){return g===null?`Null`:g===void 0?`Undefined`:Object.prototype.toString.call(g).slice(8,-1)});function _uniqContentEquals(g,_,A,Fe){var st=_arrayFromIterator(g),lt=_arrayFromIterator(_);function _t(g,_){return _equals(g,_,A.slice(),Fe.slice())}return!_includesWith(function(g,_){return!_includesWith(_t,_,g)},lt,st)}function _equals(g,_,A,Fe){if(_objectIs_default(g,_))return!0;var st=type$1(g);if(st!==type$1(_))return!1;if(typeof g[`fantasy-land/equals`]==`function`||typeof _[`fantasy-land/equals`]==`function`)return typeof g[`fantasy-land/equals`]==`function`&&g[`fantasy-land/equals`](_)&&typeof _[`fantasy-land/equals`]==`function`&&_[`fantasy-land/equals`](g);if(typeof g.equals==`function`||typeof _.equals==`function`)return typeof g.equals==`function`&&g.equals(_)&&typeof _.equals==`function`&&_.equals(g);switch(st){case`Arguments`:case`Array`:case`Object`:if(typeof g.constructor==`function`&&_functionName(g.constructor)===`Promise`)return g===_;break;case`Boolean`:case`Number`:case`String`:if(!(typeof g==typeof _&&_objectIs_default(g.valueOf(),_.valueOf())))return!1;break;case`Date`:if(!_objectIs_default(g.valueOf(),_.valueOf()))return!1;break;case`Error`:return g.name===_.name&&g.message===_.message;case`RegExp`:if(g.source!==_.source||g.global!==_.global||g.ignoreCase!==_.ignoreCase||g.multiline!==_.multiline||g.sticky!==_.sticky||g.unicode!==_.unicode)return!1}for(var lt=A.length-1;lt>=0;){if(A[lt]===g)return Fe[lt]===_;--lt}switch(st){case`Map`:return g.size===_.size&&_uniqContentEquals(g.entries(),_.entries(),A.concat([g]),Fe.concat([_]));case`Set`:return g.size===_.size&&_uniqContentEquals(g.values(),_.values(),A.concat([g]),Fe.concat([_]));case`Arguments`:case`Array`:case`Object`:case`Boolean`:case`Number`:case`String`:case`Date`:case`Error`:case`RegExp`:case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`ArrayBuffer`:break;default:return!1}var _t=keys$1(g);if(_t.length!==keys$1(_).length)return!1;var bt=A.concat([g]),xt=Fe.concat([_]);for(lt=_t.length-1;lt>=0;){var wt=_t[lt];if(!(_has(wt,_)&&_equals(_[wt],g[wt],bt,xt)))return!1;--lt}return!0}var equals$2=_curry2(function(g,_){return _equals(g,_,[],[])});function _indexOf(g,_,A){var Fe,st;if(typeof g.indexOf==`function`)switch(typeof _){case`number`:if(_===0){for(Fe=1/_;A<g.length;){if(st=g[A],st===0&&1/st===Fe)return A;A+=1}return-1}if(_!==_){for(;A<g.length;){if(st=g[A],typeof st==`number`&&st!==st)return A;A+=1}return-1}return g.indexOf(_,A);case`string`:case`boolean`:case`function`:case`undefined`:return g.indexOf(_,A);case`object`:if(_===null)return g.indexOf(_,A)}for(;A<g.length;){if(equals$2(g[A],_))return A;A+=1}return-1}function _includes(g,_){return _indexOf(_,g,0)>=0}function _map(g,_){for(var A=0,Fe=_.length,st=Array(Fe);A<Fe;)st[A]=g(_[A]),A+=1;return st}function _quote(g){return`"`+g.replace(/\\/g,`\\\\`).replace(/[\b]/g,`\\b`).replace(/\f/g,`\\f`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/\t/g,`\\t`).replace(/\v/g,`\\v`).replace(/\0/g,`\\0`).replace(/"/g,`\\"`)+`"`}var pad$1=function(g){return(g<10?`0`:``)+g},_toISOString=typeof Date.prototype.toISOString==`function`?function(g){return g.toISOString()}:function(g){return g.getUTCFullYear()+`-`+pad$1(g.getUTCMonth()+1)+`-`+pad$1(g.getUTCDate())+`T`+pad$1(g.getUTCHours())+`:`+pad$1(g.getUTCMinutes())+`:`+pad$1(g.getUTCSeconds())+`.`+(g.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+`Z`};function _complement(g){return function(){return!g.apply(this,arguments)}}function _arrayReduce(g,_,A){for(var Fe=0,st=A.length;Fe<st;)_=g(_,A[Fe]),Fe+=1;return _}function _filter(g,_){for(var A=0,Fe=_.length,st=[];A<Fe;)g(_[A])&&(st[st.length]=_[A]),A+=1;return st}function _filterMap(g,_){for(var A=new Map,Fe=_.entries(),st=Fe.next();!st.done;)g(st.value[1])&&A.set(st.value[0],st.value[1]),st=Fe.next();return A}function _isMap(g){return Object.prototype.toString.call(g)===`[object Map]`}function _isObject(g){return Object.prototype.toString.call(g)===`[object Object]`}var XFilter=function(){function g(g,_){this.xf=_,this.f=g}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=_xfBase_default.result,g.prototype[`@@transducer/step`]=function(g,_){return this.f(_)?this.xf[`@@transducer/step`](g,_):g},g}();function _xfilter(g){return function(_){return new XFilter(g,_)}}var filter=_curry2(_dispatchable([`fantasy-land/filter`,`filter`],_xfilter,function(g,_){return _isObject(_)?_arrayReduce(function(A,Fe){return g(_[Fe])&&(A[Fe]=_[Fe]),A},{},keys$1(_)):_isMap(_)?_filterMap(g,_):_filter(g,_)})),reject=_curry2(function(g,_){return filter(_complement(g),_)});function _toString(g,_){var A=function(A){var Fe=_.concat([g]);return _includes(A,Fe)?`<Circular>`:_toString(A,Fe)},Fe=function(g,_){return _map(function(_){return _quote(_)+`: `+A(g[_])},_.slice().sort())};switch(Object.prototype.toString.call(g)){case`[object Arguments]`:return`(function() { return arguments; }(`+_map(A,g).join(`, `)+`))`;case`[object Array]`:return`[`+_map(A,g).concat(Fe(g,reject(function(g){return/^\d+$/.test(g)},keys$1(g)))).join(`, `)+`]`;case`[object Boolean]`:return typeof g==`object`?`new Boolean(`+A(g.valueOf())+`)`:g.toString();case`[object Date]`:return`new Date(`+(isNaN(g.valueOf())?A(NaN):_quote(_toISOString(g)))+`)`;case`[object Map]`:return`new Map(`+A(Array.from(g))+`)`;case`[object Null]`:return`null`;case`[object Number]`:return typeof g==`object`?`new Number(`+A(g.valueOf())+`)`:1/g==-1/0?`-0`:g.toString(10);case`[object Set]`:return`new Set(`+A(Array.from(g).sort())+`)`;case`[object String]`:return typeof g==`object`?`new String(`+A(g.valueOf())+`)`:_quote(g);case`[object Undefined]`:return`undefined`;default:if(typeof g.toString==`function`){var st=g.toString();if(st!==`[object Object]`)return st}return`{`+Fe(g,keys$1(g)).join(`, `)+`}`}}var toString$2=_curry1(function(g){return _toString(g,[])}),max$3=_curry2(function(g,_){if(g===_)return _;function A(g,_){if(g>_!=_>g)return _>g?_:g}var Fe=A(g,_);if(Fe!==void 0)return Fe;var st=A(typeof g,typeof _);if(st!==void 0)return st===typeof g?g:_;var lt=toString$2(g),_t=A(lt,toString$2(_));return _t===void 0?_:_t===lt?g:_}),XMap=function(){function g(g,_){this.xf=_,this.f=g}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=_xfBase_default.result,g.prototype[`@@transducer/step`]=function(g,_){return this.xf[`@@transducer/step`](g,this.f(_))},g}(),_xmap=function(g){return function(_){return new XMap(g,_)}},map$3=_curry2(_dispatchable([`fantasy-land/map`,`map`],_xmap,function(g,_){switch(Object.prototype.toString.call(_)){case`[object Function]`:return curryN$1(_.length,function(){return g.call(this,_.apply(this,arguments))});case`[object Object]`:return _arrayReduce(function(A,Fe){return A[Fe]=g(_[Fe]),A},{},keys$1(_));default:return _map(g,_)}})),_isInteger_default=Number.isInteger||function(g){return g<<0===g};function _nth(g,_){return _[g<0?_.length+g:g]}function _prop(g,_){if(_!=null)return _isInteger_default(g)?_nth(g,_):_[g]}var prop=_curry2(_prop);function _isString(g){return Object.prototype.toString.call(g)===`[object String]`}var _isArrayLike=_curry1(function(g){return _isArray_default(g)?!0:!g||typeof g!=`object`||_isString(g)?!1:g.length===0||g.length>0&&g.hasOwnProperty(0)&&g.hasOwnProperty(g.length-1)}),symIterator=typeof Symbol<`u`?Symbol.iterator:`@@iterator`;function _createReduce(g,_,A){return function(Fe,st,lt){if(_isArrayLike(lt))return g(Fe,st,lt);if(lt==null)return st;if(typeof lt[`fantasy-land/reduce`]==`function`)return _(Fe,st,lt,`fantasy-land/reduce`);if(lt[symIterator]!=null)return A(Fe,st,lt[symIterator]());if(typeof lt.next==`function`)return A(Fe,st,lt);if(typeof lt.reduce==`function`)return _(Fe,st,lt,`reduce`);throw TypeError(`reduce: list must be array or iterable`)}}function _xArrayReduce(g,_,A){for(var Fe=0,st=A.length;Fe<st;){if(_=g[`@@transducer/step`](_,A[Fe]),_&&_[`@@transducer/reduced`]){_=_[`@@transducer/value`];break}Fe+=1}return g[`@@transducer/result`](_)}var bind$1=_curry2(function(g,_){return _arity(g.length,function(){return g.apply(_,arguments)})});function _xIterableReduce(g,_,A){for(var Fe=A.next();!Fe.done;){if(_=g[`@@transducer/step`](_,Fe.value),_&&_[`@@transducer/reduced`]){_=_[`@@transducer/value`];break}Fe=A.next()}return g[`@@transducer/result`](_)}function _xMethodReduce(g,_,A,Fe){return g[`@@transducer/result`](A[Fe](bind$1(g[`@@transducer/step`],g),_))}var _xReduce=_createReduce(_xArrayReduce,_xMethodReduce,_xIterableReduce),XWrap=function(){function g(g){this.f=g}return g.prototype[`@@transducer/init`]=function(){throw Error(`init not implemented on XWrap`)},g.prototype[`@@transducer/result`]=function(g){return g},g.prototype[`@@transducer/step`]=function(g,_){return this.f(g,_)},g}();function _xwrap(g){return new XWrap(g)}var reduce=_curry3(function(g,_,A){return _xReduce(typeof g==`function`?_xwrap(g):g,_,A)});function _makeFlat(g){return function _(A){for(var Fe,st,lt,_t=[],bt=0,xt=A.length;bt<xt;){if(_isArrayLike(A[bt]))for(Fe=g?_(A[bt]):A[bt],lt=0,st=Fe.length;lt<st;)_t[_t.length]=Fe[lt],lt+=1;else _t[_t.length]=A[bt];bt+=1}return _t}}function _forceReduced(g){return{"@@transducer/value":g,"@@transducer/reduced":!0}}var tInit=`@@transducer/init`,tStep=`@@transducer/step`,tResult=`@@transducer/result`,XPreservingReduced=function(){function g(g){this.xf=g}return g.prototype[tInit]=_xfBase_default.init,g.prototype[tResult]=_xfBase_default.result,g.prototype[tStep]=function(g,_){var A=this.xf[tStep](g,_);return A[`@@transducer/reduced`]?_forceReduced(A):A},g}(),XFlatCat=function(){function g(g){this.xf=new XPreservingReduced(g)}return g.prototype[tInit]=_xfBase_default.init,g.prototype[tResult]=_xfBase_default.result,g.prototype[tStep]=function(g,_){return _isArrayLike(_)?_xReduce(this.xf,g,_):_xArrayReduce(this.xf,g,[_])},g}(),_flatCat=function(g){return new XFlatCat(g)};function _xchain(g){return function(_){return _xmap(g)(_flatCat(_))}}var _chain_default=_dispatchable([`fantasy-land/chain`,`chain`],_xchain,function(g,_){return typeof _==`function`?function(A){return g(_(A))(A)}:_makeFlat(!1)(map$3(g,_))}),chain=_curry2(_chain_default);function _cloneRegExp(g){return new RegExp(g.source,g.flags?g.flags:(g.global?`g`:``)+(g.ignoreCase?`i`:``)+(g.multiline?`m`:``)+(g.sticky?`y`:``)+(g.unicode?`u`:``)+(g.dotAll?`s`:``))}function _clone(g,_,A){if(A||(A=new _ObjectMap),_isPrimitive(g))return g;var Fe=function(Fe){var st=A.get(g);if(st)return st;for(var lt in A.set(g,Fe),g)Object.prototype.hasOwnProperty.call(g,lt)&&(Fe[lt]=_?_clone(g[lt],!0,A):g[lt]);return Fe};switch(type$1(g)){case`Object`:return Fe(Object.create(Object.getPrototypeOf(g)));case`Array`:return Fe(Array(g.length));case`Date`:return new Date(g.valueOf());case`RegExp`:return _cloneRegExp(g);case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`BigInt64Array`:case`BigUint64Array`:return g.slice();default:return g}}function _isPrimitive(g){var _=typeof g;return g==null||_!=`object`&&_!=`function`}var _ObjectMap=function(){function g(){this.map={},this.length=0}return g.prototype.set=function(g,_){var A=this.hash(g),Fe=this.map[A];Fe||(this.map[A]=Fe=[]),Fe.push([g,_]),this.length+=1},g.prototype.hash=function(g){var _=[];for(var A in g)_.push(Object.prototype.toString.call(g[A]));return _.join()},g.prototype.get=function(g){if(this.length<=180){for(var _ in this.map)for(var A=this.map[_],Fe=0;Fe<A.length;Fe+=1){var st=A[Fe];if(st[0]===g)return st[1]}return}var lt=this.hash(g),A=this.map[lt];if(A)for(var Fe=0;Fe<A.length;Fe+=1){var st=A[Fe];if(st[0]===g)return st[1]}},g}(),clone=_curry1(function(g){return g!=null&&typeof g.clone==`function`?g.clone():_clone(g,!0)});function _pipe(g,_){return function(){return _.call(this,g.apply(this,arguments))}}function _checkForMethod(g,_){return function(){var A=arguments.length;if(A===0)return _();var Fe=arguments[A-1];return _isArray_default(Fe)||typeof Fe[g]!=`function`?_.apply(this,arguments):Fe[g].apply(Fe,Array.prototype.slice.call(arguments,0,A-1))}}var slice$3=_curry3(_checkForMethod(`slice`,function(g,_,A){return Array.prototype.slice.call(A,g,_)})),tail=_curry1(_checkForMethod(`tail`,slice$3(1,1/0)));function pipe(){if(arguments.length===0)throw Error(`pipe requires at least one argument`);return _arity(arguments[0].length,reduce(_pipe,arguments[0],tail(arguments)))}function _identity(g){return g}var identity$5=_curry1(_identity),XReduceBy=function(){function g(g,_,A,Fe){this.valueFn=g,this.valueAcc=_,this.keyFn=A,this.xf=Fe,this.inputs={}}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=function(g){for(var _ in this.inputs)if(_has(_,this.inputs)&&(g=this.xf[`@@transducer/step`](g,this.inputs[_]),g[`@@transducer/reduced`])){g=g[`@@transducer/value`];break}return this.inputs=null,this.xf[`@@transducer/result`](g)},g.prototype[`@@transducer/step`]=function(g,_){var A=this.keyFn(_);return this.inputs[A]=this.inputs[A]||[A,_clone(this.valueAcc,!1)],this.inputs[A][1]=this.valueFn(this.inputs[A][1],_),g},g}();function _xreduceBy(g,_,A){return function(Fe){return new XReduceBy(g,_,A,Fe)}}var reduceBy=_curryN(4,[],_dispatchable([],_xreduceBy,function(g,_,A,Fe){return _xReduce(_xwrap(function(Fe,st){var lt=A(st),_t=g(_has(lt,Fe)?Fe[lt]:_clone(_,!1),st);return _t&&_t[`@@transducer/reduced`]?_reduced(Fe):(Fe[lt]=_t,Fe)}),{},Fe)})),_Set=function(){function g(){this._nativeSet=typeof Set==`function`?new Set:null,this._items={}}return g.prototype.add=function(g){return!hasOrAdd(g,!0,this)},g.prototype.has=function(g){return hasOrAdd(g,!1,this)},g}();function hasOrAdd(g,_,A){var Fe=typeof g,st,lt;switch(Fe){case`string`:case`number`:return g===0&&1/g==-1/0?A._items[`-0`]?!0:(_&&(A._items[`-0`]=!0),!1):A._nativeSet===null?Fe in A._items?g in A._items[Fe]||(_&&(A._items[Fe][g]=!0),!1):(_&&(A._items[Fe]={},A._items[Fe][g]=!0),!1):_?(st=A._nativeSet.size,A._nativeSet.add(g),lt=A._nativeSet.size,lt===st):A._nativeSet.has(g);case`boolean`:if(Fe in A._items){var _t=+!!g;return A._items[Fe][_t]?!0:(_&&(A._items[Fe][_t]=!0),!1)}return _&&(A._items[Fe]=g?[!1,!0]:[!0,!1]),!1;case`function`:return A._nativeSet===null?Fe in A._items?_includes(g,A._items[Fe])?!0:(_&&A._items[Fe].push(g),!1):(_&&(A._items[Fe]=[g]),!1):_?(st=A._nativeSet.size,A._nativeSet.add(g),lt=A._nativeSet.size,lt===st):A._nativeSet.has(g);case`undefined`:return A._items[Fe]?!0:(_&&(A._items[Fe]=!0),!1);case`object`:if(g===null)return A._items.null?!0:(_&&(A._items.null=!0),!1);default:return Fe=Object.prototype.toString.call(g),Fe in A._items?_includes(g,A._items[Fe])?!0:(_&&A._items[Fe].push(g),!1):(_&&(A._items[Fe]=[g]),!1)}}var XTake=function(){function g(g,_){this.xf=_,this.n=g,this.i=0}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=_xfBase_default.result,g.prototype[`@@transducer/step`]=function(g,_){this.i+=1;var A=this.n===0?g:this.xf[`@@transducer/step`](g,_);return this.n>=0&&this.i>=this.n?_reduced(A):A},g}();function _xtake(g){return function(_){return new XTake(g,_)}}var take=_curry2(_dispatchable([`take`],_xtake,function(g,_){return slice$3(0,g<0?1/0:g,_)}));function dropLast$1(g,_){return take(g<_.length?_.length-g:0,_)}var XDropLast=function(){function g(g,_){if(g<=0)return _;this.xf=_,this.pos=0,this.full=!1,this.acc=Array(g)}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=function(g){return this.acc=null,this.xf[`@@transducer/result`](g)},g.prototype[`@@transducer/step`]=function(g,_){return this.full&&(g=this.xf[`@@transducer/step`](g,this.acc[this.pos])),this.store(_),g},g.prototype.store=function(g){this.acc[this.pos]=g,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},g}();function _xdropLast(g){return function(_){return new XDropLast(g,_)}}var dropLast=_curry2(_dispatchable([],_xdropLast,dropLast$1)),flatten$1=_curry1(_makeFlat(!0));function fromPairs$1(g){for(var _={},A=0;A<g.length;)_[g[A][0]]=g[A][1],A+=1;return _}var fromPairs=_curry1(fromPairs$1),groupBy=_curry2(_checkForMethod(`groupBy`,reduceBy(function(g,_){return g.push(_),g},[]))),indexBy=reduceBy(function(g,_){return _},null),XUniqBy=function(){function g(g,_){this.xf=_,this.f=g,this.set=new _Set}return g.prototype[`@@transducer/init`]=_xfBase_default.init,g.prototype[`@@transducer/result`]=_xfBase_default.result,g.prototype[`@@transducer/step`]=function(g,_){return this.set.add(this.f(_))?this.xf[`@@transducer/step`](g,_):g},g}();function _xuniqBy(g){return function(_){return new XUniqBy(g,_)}}var uniqBy$1=_curry2(_dispatchable([],_xuniqBy,function(g,_){for(var A=new _Set,Fe=[],st=0,lt,_t;st<_.length;)_t=_[st],lt=g(_t),A.add(lt)&&Fe.push(_t),st+=1;return Fe})),uniq=uniqBy$1(identity$5);function _toPairs(g){var _=[];for(var A in g)_has(A,g)&&(_[_.length]=[A,g[A]]);return _}var maxBy$1=_curry3(function(g,_,A){var Fe=g(A);return max$3(g(_),Fe)===Fe?A:_}),mergeWithKey=_curry3(function(g,_,A){var Fe={},st;for(st in _=_||{},A=A||{},_)_has(st,_)&&(Fe[st]=_has(st,A)?g(st,_[st],A[st]):_[st]);for(st in A)_has(st,A)&&!_has(st,Fe)&&(Fe[st]=A[st]);return Fe}),mergeDeepWithKey=_curry3(function g(_,A,Fe){return mergeWithKey(function(A,Fe,st){return _isObject(Fe)&&_isObject(st)?g(_,Fe,st):_(A,Fe,st)},A,Fe)}),mergeDeepLeft=_curry2(function(g,_){return mergeDeepWithKey(function(g,_,A){return _},g,_)}),min$2=_curry2(function(g,_){if(g===_)return g;function A(g,_){if(g<_!=_<g)return _<g?_:g}var Fe=A(g,_);if(Fe!==void 0)return Fe;var st=A(typeof g,typeof _);if(st!==void 0)return st===typeof g?g:_;var lt=toString$2(g),_t=A(lt,toString$2(_));return _t===void 0||_t===lt?g:_}),minBy$1=_curry3(function(g,_,A){var Fe=g(A);return min$2(g(_),Fe)===Fe?A:_}),pick=_curry2(function(g,_){for(var A={},Fe=0;Fe<g.length;)g[Fe]in _&&(A[g[Fe]]=_[g[Fe]]),Fe+=1;return A}),toPairs=_curry1(_toPairs),unnest$1=chain(_identity),require_quarterOfYear=__commonJSMin(((g,_)=>{(function(A,Fe){typeof g==`object`&&_!==void 0?_.exports=Fe():typeof define==`function`&&define.amd?define(Fe):(A=typeof globalThis<`u`?globalThis:A||self).dayjs_plugin_quarterOfYear=Fe()})(g,(function(){var g=`month`,_=`quarter`;return function(A,Fe){var st=Fe.prototype;st.quarter=function(g){return this.$utils().u(g)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(g-1))};var lt=st.add;st.add=function(A,Fe){return A=Number(A),this.$utils().p(Fe)===_?this.add(3*A,g):lt.bind(this)(A,Fe)};var _t=st.startOf;st.startOf=function(A,Fe){var st=this.$utils(),lt=!!st.u(Fe)||Fe;if(st.p(A)===_){var bt=this.quarter()-1;return lt?this.month(3*bt).startOf(g).startOf(`day`):this.month(3*bt+2).endOf(g).endOf(`day`)}return _t.bind(this)(A,Fe)}}}))})),require_duration=__commonJSMin(((g,_)=>{(function(A,Fe){typeof g==`object`&&_!==void 0?_.exports=Fe():typeof define==`function`&&define.amd?define(Fe):(A=typeof globalThis<`u`?globalThis:A||self).dayjs_plugin_duration=Fe()})(g,(function(){var g,_,A=1e3,Fe=6e4,st=36e5,lt=864e5,_t=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,bt=31536e6,xt=2592e6,wt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,Tt={years:bt,months:xt,days:lt,hours:st,minutes:Fe,seconds:A,milliseconds:1,weeks:6048e5},Et=function(g){return g instanceof Pt},Dt=function(g,_,A){return new Pt(g,A,_.$l)},Ot=function(g){return _.p(g)+`s`},kt=function(g){return g<0},At=function(g){return kt(g)?Math.ceil(g):Math.floor(g)},Mt=function(g){return Math.abs(g)},Nt=function(g,_){return g?kt(g)?{negative:!0,format:``+Mt(g)+_}:{negative:!1,format:``+g+_}:{negative:!1,format:``}},Pt=function(){function kt(g,_,A){var Fe=this;if(this.$d={},this.$l=A,g===void 0&&(this.$ms=0,this.parseFromMilliseconds()),_)return Dt(g*Tt[Ot(_)],this);if(typeof g==`number`)return this.$ms=g,this.parseFromMilliseconds(),this;if(typeof g==`object`)return Object.keys(g).forEach((function(_){Fe.$d[Ot(_)]=g[_]})),this.calMilliseconds(),this;if(typeof g==`string`){var st=g.match(wt);if(st){var lt=st.slice(2).map((function(g){return g==null?0:Number(g)}));return this.$d.years=lt[0],this.$d.months=lt[1],this.$d.weeks=lt[2],this.$d.days=lt[3],this.$d.hours=lt[4],this.$d.minutes=lt[5],this.$d.seconds=lt[6],this.calMilliseconds(),this}}return this}var Mt=kt.prototype;return Mt.calMilliseconds=function(){var g=this;this.$ms=Object.keys(this.$d).reduce((function(_,A){return _+(g.$d[A]||0)*Tt[A]}),0)},Mt.parseFromMilliseconds=function(){var g=this.$ms;this.$d.years=At(g/bt),g%=bt,this.$d.months=At(g/xt),g%=xt,this.$d.days=At(g/lt),g%=lt,this.$d.hours=At(g/st),g%=st,this.$d.minutes=At(g/Fe),g%=Fe,this.$d.seconds=At(g/A),g%=A,this.$d.milliseconds=g},Mt.toISOString=function(){var g=Nt(this.$d.years,`Y`),_=Nt(this.$d.months,`M`),A=+this.$d.days||0;this.$d.weeks&&(A+=7*this.$d.weeks);var Fe=Nt(A,`D`),st=Nt(this.$d.hours,`H`),lt=Nt(this.$d.minutes,`M`),_t=this.$d.seconds||0;this.$d.milliseconds&&(_t+=this.$d.milliseconds/1e3);var bt=Nt(_t,`S`),xt=g.negative||_.negative||Fe.negative||st.negative||lt.negative||bt.negative,wt=st.format||lt.format||bt.format?`T`:``,Tt=(xt?`-`:``)+`P`+g.format+_.format+Fe.format+wt+st.format+lt.format+bt.format;return Tt===`P`||Tt===`-P`?`P0D`:Tt},Mt.toJSON=function(){return this.toISOString()},Mt.format=function(g){var A=g||`YYYY-MM-DDTHH:mm:ss`,Fe={Y:this.$d.years,YY:_.s(this.$d.years,2,`0`),YYYY:_.s(this.$d.years,4,`0`),M:this.$d.months,MM:_.s(this.$d.months,2,`0`),D:this.$d.days,DD:_.s(this.$d.days,2,`0`),H:this.$d.hours,HH:_.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:_.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:_.s(this.$d.seconds,2,`0`),SSS:_.s(this.$d.milliseconds,3,`0`)};return A.replace(_t,(function(g,_){return _||String(Fe[g])}))},Mt.as=function(g){return this.$ms/Tt[Ot(g)]},Mt.get=function(g){var _=this.$ms,A=Ot(g);return A===`milliseconds`?_%=1e3:_=A===`weeks`?At(_/Tt[A]):this.$d[A],_===0?0:_},Mt.add=function(g,_,A){var Fe=_?g*Tt[Ot(_)]:Et(g)?g.$ms:Dt(g,this).$ms;return Dt(this.$ms+Fe*(A?-1:1),this)},Mt.subtract=function(g,_){return this.add(g,_,!0)},Mt.locale=function(g){var _=this.clone();return _.$l=g,_},Mt.clone=function(){return Dt(this.$ms,this)},Mt.humanize=function(_){return g().add(this.$ms,`ms`).locale(this.$l).fromNow(!_)},Mt.milliseconds=function(){return this.get(`milliseconds`)},Mt.asMilliseconds=function(){return this.as(`milliseconds`)},Mt.seconds=function(){return this.get(`seconds`)},Mt.asSeconds=function(){return this.as(`seconds`)},Mt.minutes=function(){return this.get(`minutes`)},Mt.asMinutes=function(){return this.as(`minutes`)},Mt.hours=function(){return this.get(`hours`)},Mt.asHours=function(){return this.as(`hours`)},Mt.days=function(){return this.get(`days`)},Mt.asDays=function(){return this.as(`days`)},Mt.weeks=function(){return this.get(`weeks`)},Mt.asWeeks=function(){return this.as(`weeks`)},Mt.months=function(){return this.get(`months`)},Mt.asMonths=function(){return this.as(`months`)},Mt.years=function(){return this.get(`years`)},Mt.asYears=function(){return this.as(`years`)},kt}();return function(A,Fe,st){g=st,_=st().$utils(),st.duration=function(g,_){return Dt(g,{$l:st.locale()},_)},st.isDuration=Et;var lt=Fe.prototype.add,_t=Fe.prototype.subtract;Fe.prototype.add=function(g,_){return Et(g)&&(g=g.asMilliseconds()),lt.bind(this)(g,_)},Fe.prototype.subtract=function(g,_){return Et(g)&&(g=g.asMilliseconds()),_t.bind(this)(g,_)}}}))})),require_isoWeek=__commonJSMin(((g,_)=>{(function(A,Fe){typeof g==`object`&&_!==void 0?_.exports=Fe():typeof define==`function`&&define.amd?define(Fe):(A=typeof globalThis<`u`?globalThis:A||self).dayjs_plugin_isoWeek=Fe()})(g,(function(){var g=`day`;return function(g,_,A){var Fe=function(g){return g.add(4-g.isoWeekday(),`day`)},st=_.prototype;st.isoWeekYear=function(){return Fe(this).year()},st.isoWeek=function(g){if(!this.$utils().u(g))return this.add(7*(g-this.isoWeek()),`day`);var _,st,lt,_t,bt=Fe(this),xt=(_=this.isoWeekYear(),st=this.$u,lt=(st?A.utc:A)().year(_).startOf(`year`),_t=4-lt.isoWeekday(),lt.isoWeekday()>4&&(_t+=7),lt.add(_t,`day`));return bt.diff(xt,`week`)+1},st.isoWeekday=function(g){return this.$utils().u(g)?this.day()||7:this.day(this.day()%7?g:g-7)};var lt=st.startOf;st.startOf=function(g,_){var A=this.$utils(),Fe=!!A.u(_)||_;return A.p(g)===`isoweek`?Fe?this.date(this.date()-(this.isoWeekday()-1)).startOf(`day`):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf(`day`):lt.bind(this)(g,_)}}}))})),require_en=__commonJSMin(((g,_)=>{(function(A,Fe){typeof g==`object`&&_!==void 0?_.exports=Fe():typeof define==`function`&&define.amd?define(Fe):(A=typeof globalThis<`u`?globalThis:A||self).dayjs_locale_en=Fe()})(g,(function(){return{name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`)}}))})),import_dayjs_min=__toESM(require_dayjs_min(),1),import_quarterOfYear=__toESM(require_quarterOfYear(),1),import_duration=__toESM(require_duration(),1),import_isoWeek=__toESM(require_isoWeek(),1),import_en=__toESM(require_en(),1);import_dayjs_min.default.extend(import_quarterOfYear.default),import_dayjs_min.default.extend(import_duration.default),import_dayjs_min.default.extend(import_isoWeek.default);var cubeInternalLocale=`cube-internal-en`,customLocale={...import_en.default,name:cubeInternalLocale,weekStart:1};import_dayjs_min.default.Ls[cubeInternalLocale]=customLocale;var GRANULARITIES=[{name:void 0,title:`w/o grouping`},{name:`second`,title:`Second`},{name:`minute`,title:`Minute`},{name:`hour`,title:`Hour`},{name:`day`,title:`Day`},{name:`week`,title:`Week`},{name:`month`,title:`Month`},{name:`quarter`,title:`Quarter`},{name:`year`,title:`Year`}],internalDayjs=(...g)=>(0,import_dayjs_min.default)(...g).locale(cubeInternalLocale),TIME_SERIES={day:g=>g.by(`d`).map(g=>g.format(`YYYY-MM-DDT00:00:00.000`)),month:g=>g.snapTo(`month`).by(`M`).map(g=>g.format(`YYYY-MM-01T00:00:00.000`)),year:g=>g.snapTo(`year`).by(`y`).map(g=>g.format(`YYYY-01-01T00:00:00.000`)),hour:g=>g.by(`h`).map(g=>g.format(`YYYY-MM-DDTHH:00:00.000`)),minute:g=>g.by(`m`).map(g=>g.format(`YYYY-MM-DDTHH:mm:00.000`)),second:g=>g.by(`s`).map(g=>g.format(`YYYY-MM-DDTHH:mm:ss.000`)),week:g=>g.snapTo(`week`).by(`w`).map(g=>g.startOf(`week`).format(`YYYY-MM-DDT00:00:00.000`)),quarter:g=>g.snapTo(`quarter`).by(`quarter`).map(g=>g.startOf(`quarter`).format(`YYYY-MM-DDT00:00:00.000`))},isPredefinedGranularity=g=>!!TIME_SERIES[g],DateRegex=/^\d\d\d\d-\d\d-\d\d$/,LocalDateRegex=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z?$/;function parseSqlInterval(g){let _={},A=g.split(/\s+/);for(let g=0;g<A.length;g+=2){let Fe=parseInt(A[g],10),st=A[g+1],lt=st.endsWith(`s`)?st.slice(0,-1):st;_[lt]=Fe}return _}function addInterval(g,_){let A=g.clone();return Object.entries(_).forEach(([g,_])=>{A=A.add(_,g)}),A}function subtractInterval(g,_){let A=g.clone();return Object.entries(_).forEach(([g,_])=>{A=A.subtract(_,g)}),A}function alignToOrigin(g,_,A){let Fe=g.clone(),st,lt=!1,_t=addInterval(A,_);if(_t.isBefore(A)&&(lt=!0),_t=A.clone(),g.isBefore(A)){for(st=lt?addInterval:subtractInterval;_t.isAfter(g);)_t=st(_t,_);Fe=_t}else{for(st=lt?subtractInterval:addInterval;_t.isBefore(g);)Fe=_t.clone(),_t=st(_t,_);_t.isSame(g)&&(Fe=_t)}return Fe}var dayRange=(g,_,A)=>({by:A=>{let Fe=[],st=internalDayjs(g),lt=internalDayjs(_);for(;st.startOf(A).isBefore(lt)||st.isSame(lt);)Fe.push(st),st=st.add(1,A);return Fe},snapTo:Fe=>{if(!isPredefinedGranularity(Fe)&&A){let _;for(let g of Object.keys(A))if(g.endsWith(`.${Fe}`)&&A[g].granularity){_=A[g].granularity;break}if(_?.interval){let Fe=parseSqlInterval(_.interval),st=internalDayjs(g);if(_.origin||_.offset){let g;g=_.origin?internalDayjs(_.origin):addInterval(internalDayjs().startOf(`year`),parseSqlInterval(_.offset)),st=alignToOrigin(st,Fe,g)}let lt=addInterval(st,Fe).subtract(1,`millisecond`);return dayRange(st,lt,A)}}return dayRange(internalDayjs(g).startOf(Fe),internalDayjs(_).endOf(Fe),A)},start:internalDayjs(g),end:internalDayjs(_)}),timeSeriesFromCustomInterval=(g,_,A)=>{let Fe=parseSqlInterval(A.interval),st=internalDayjs(g),lt=internalDayjs(_),_t=A.origin?internalDayjs(A.origin):internalDayjs().startOf(`year`);A.offset&&(_t=addInterval(_t,parseSqlInterval(A.offset)));let bt=alignToOrigin(st,Fe,_t),xt=[];for(;bt.isBefore(lt)||bt.isSame(lt);)xt.push(bt.format(`YYYY-MM-DDTHH:mm:ss.000`)),bt=addInterval(bt,Fe);return xt},diffTimeUnitForInterval=g=>/second/i.test(g)?`second`:/minute/i.test(g)?`minute`:/hour/i.test(g)?`hour`:/day/i.test(g)||/week/i.test(g)?`day`:/month/i.test(g)||/quarter/i.test(g)?`month`:`year`,granularityOrder=[`year`,`quarter`,`month`,`week`,`day`,`hour`,`minute`,`second`],minGranularityForIntervals=(g,_)=>{let A=diffTimeUnitForInterval(g),Fe=diffTimeUnitForInterval(_);return granularityOrder.indexOf(A)>granularityOrder.indexOf(Fe)?A:Fe},granularityFor=g=>{let _=internalDayjs(g),A=_.month(),Fe=_.date(),st=_.hour(),lt=_.minute(),_t=_.second(),bt=_.millisecond(),xt=_.isoWeekday();return A===0&&Fe===1&&st===0&<===0&&_t===0&&bt===0?`year`:Fe===1&&st===0&<===0&&_t===0&&bt===0?`month`:xt===1&&st===0&<===0&&_t===0&&bt===0?`week`:st===0&<===0&&_t===0&&bt===0?`day`:lt===0&&_t===0&&bt===0?`hour`:_t===0&&bt===0?`minute`:`second`};function removeEmptyQueryFields(g){return fromPairs(Object.entries(g||{}).flatMap(([g,_])=>[`measures`,`dimensions`,`segments`,`timeDimensions`,`filters`].includes(g)&&Array.isArray(_)&&_.length===0||g===`order`&&_&&(Array.isArray(_)&&_.length===0||!Object.keys(_).length)?[]:[[g,_]]))}function validateQuery$1(g){let _=g||{};return removeEmptyQueryFields({..._,filters:(_.filters||[]).filter(g=>`operator`in g),timeDimensions:(_.timeDimensions||[]).filter(g=>!(!g.dateRange&&!g.granularity))})}function areQueriesEqual(g,_){return equals$2(Object.entries(g?.order||{}),Object.entries(_?.order||{}))&&equals$2(g,_)}function defaultOrder(g){let _=(g.timeDimensions||[]).find(g=>g.granularity);return _?{[_.dimension]:`asc`}:(g.measures||[]).length>0&&(g.dimensions||[]).length>0?{[g.measures[0]]:`desc`}:(g.dimensions||[]).length>0?{[g.dimensions[0]]:`asc`}:{}}function defaultHeuristics(g,_,A){let{query:Fe,...st}=clone(g),{meta:lt,sessionGranularity:_t}=A,bt=_t||`day`,xt={shouldApplyHeuristicOrder:!1,pivotConfig:null,query:Fe,...st},wt=null;if(areQueriesEqual(Fe,_)||(wt=Fe),Array.isArray(wt)||Array.isArray(_))return{shouldApplyHeuristicOrder:!1,pivotConfig:null,...g};if(wt){if((_.timeDimensions||[]).length===1&&(wt.timeDimensions||[]).length===1&&wt.timeDimensions[0].granularity&&_.timeDimensions[0].granularity!==wt.timeDimensions[0].granularity&&(xt={...xt,sessionGranularity:wt.timeDimensions[0].granularity}),(_.measures||[]).length===0&&(wt.measures||[]).length>0||(_.measures||[]).length===1&&(wt.measures||[]).length===1&&_.measures[0]!==wt.measures[0]){let[g]=wt.timeDimensions||[],_=lt.defaultTimeDimensionNameFor(wt.measures[0]);return wt={...wt,timeDimensions:_?[{dimension:_,granularity:g?.granularity||bt,dateRange:g?.dateRange}]:[]},{...xt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:wt,chartType:_?`line`:`number`}}return(_.dimensions||[]).length===0&&(wt.dimensions||[]).length>0?(wt={...wt,timeDimensions:(wt.timeDimensions||[]).map(g=>({...g,granularity:void 0}))},{...xt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:wt,chartType:`table`}):(_.dimensions||[]).length>0&&(wt.dimensions||[]).length===0?(wt={...wt,timeDimensions:(wt.timeDimensions||[]).map(g=>({...g,granularity:g.granularity||bt}))},{...xt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:wt,chartType:(wt.timeDimensions||[]).length?`line`:`number`}):((_.dimensions||[]).length>0||(_.measures||[]).length>0)&&(wt.dimensions||[]).length===0&&(wt.measures||[]).length===0?(wt={...wt,timeDimensions:[],filters:[]},{...xt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:wt,sessionGranularity:null}):xt}if(xt.chartType){let g=xt.chartType;if((g===`line`||g===`area`)&&(_.timeDimensions||[]).length===1&&!_.timeDimensions[0].granularity){let[g]=_.timeDimensions;return{...xt,pivotConfig:null,query:{..._,timeDimensions:[{...g,granularity:bt}]}}}if((g===`pie`||g===`table`||g===`number`)&&(_.timeDimensions||[]).length===1&&_.timeDimensions[0].granularity){let[g]=_.timeDimensions;return{...xt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:{..._,timeDimensions:[{...g,granularity:void 0}]}}}}return xt}function isQueryPresent(g){return g?(Array.isArray(g)?g:[g]).every(g=>g.measures?.length||g.dimensions?.length||g.timeDimensions?.length):!1}function movePivotItem$1(g,_,A,Fe,st){let lt={...g,x:[...g.x||[]],y:[...g.y||[]]},_t=g[Fe][_],bt=lt[st].length-1;return _t===`measures`?A=bt+1:Fe===st&&A>=bt&<[st][bt]===`measures`?A=bt-1:Fe!==st&&A>bt&<[st][bt]===`measures`&&(A=bt),lt[Fe].splice(_,1),lt[st].splice(A,0,_t),lt}function moveItemInArray(g,_,A){let Fe=[...g],[st]=Fe.splice(_,1);return Fe.splice(A,0,st),Fe}function flattenFilters(g=[]){return g.reduce((g,_)=>`or`in _?[...g,...flattenFilters(_.or)]:`and`in _?[...g,...flattenFilters(_.and)]:[...g,_],[])}function getQueryMembers(g={}){let _=[`measures`,`dimensions`,`segments`],A=new Set;return _.forEach(_=>(g[_]||[]).forEach(g=>A.add(g))),(g.timeDimensions||[]).forEach(g=>A.add(g.dimension)),flattenFilters(g.filters).forEach(g=>{let _=g.dimension||g.member;typeof _==`string`&&A.add(_)}),[...A]}function aliasSeries(g,_,A,Fe=new Set){let st=g.filter(g=>g!=null);return A?.aliasSeries?.[_]?[A.aliasSeries[_],...st]:Fe.has(st[0])?[_,...st]:st}var groupByToPairs=function(g){let _=new Map;return A=>(A.forEach(A=>{let Fe=g(A);_.has(Fe)||_.set(Fe,[]),_.get(Fe).push(A)}),Array.from(_.entries()))},unnest=g=>{let _=[];return g.forEach(g=>{g.forEach(g=>_.push(g))}),_},QUERY_TYPE={REGULAR_QUERY:`regularQuery`,COMPARE_DATE_RANGE_QUERY:`compareDateRangeQuery`,BLENDING_QUERY:`blendingQuery`},ResultSet=class g{static measureFromAxis(g){return g[g.length-1]}static timeDimensionMember(g){return`${g.dimension}.${g.granularity}`}static deserialize(_,A){return new g(_.loadResponse,A)}constructor(g,_={}){if(`queryType`in g&&g.queryType!=null?(this.loadResponse=g,this.queryType=g.queryType,this.loadResponses=g.results):(this.queryType=QUERY_TYPE.REGULAR_QUERY,this.loadResponse={...g,pivotQuery:{...g.query,queryType:this.queryType}},this.loadResponses=[g]),!Object.values(QUERY_TYPE).includes(this.queryType))throw Error(`Unknown query type`);this.parseDateMeasures=_.parseDateMeasures,this.options=_,this.backwardCompatibleData=[]}drillDown(g,_){if(this.queryType===QUERY_TYPE.COMPARE_DATE_RANGE_QUERY)throw Error(`compareDateRange drillDown query is not currently supported`);if(this.queryType===QUERY_TYPE.BLENDING_QUERY)throw Error(`Data blending drillDown query is not currently supported`);let{query:A}=this.loadResponses[0],Fe=g?.xValues??[],st=g?.yValues??[],lt=this.normalizePivotConfig(_),_t=[];lt?.x.forEach((g,_)=>_t.push([g,Fe[_]])),lt?.y.forEach((g,_)=>_t.push([g,st[_]]));let{filters:bt=[],segments:xt=[]}=this.query(),{measures:wt,timeDimensions:Tt}=this.loadResponses[0].annotation,[,Et]=_t.find(([g])=>g===`measures`)||[];if(Et===void 0&&([Et]=Object.keys(wt)),!(wt[Et]?.drillMembers?.length??0))return null;let Dt=[{member:Et,operator:`measureFilter`},...bt],Ot=[];return _t.filter(([g])=>g!==`measures`).forEach(([g,_])=>{let[Fe,st,lt]=g.split(`.`);if(lt!==void 0){let g=dayRange(_,_,Tt).snapTo(lt),_t=A.timeDimensions?.find(g=>g.dimension),bt=[g.start,g.end];if(_t?.dateRange){let[_,A]=_t.dateRange;bt=[(0,import_dayjs_min.default)(_)>g.start?(0,import_dayjs_min.default)(_):g.start,(0,import_dayjs_min.default)(A)<g.end?(0,import_dayjs_min.default)(A):g.end]}Ot.push({dimension:[Fe,st].join(`.`),dateRange:bt.map(g=>g.format(`YYYY-MM-DDTHH:mm:ss.SSS`))})}else _==null?Dt.push({member:g,operator:`notSet`}):Dt.push({member:g,operator:`equals`,values:[_.toString()]})}),Ot.length===0&&Array.isArray(A.timeDimensions)&&A.timeDimensions.length>0&&A.timeDimensions[0].granularity==null&&Ot.push(A.timeDimensions[0]),{...wt[Et].drillMembersGrouped,filters:Dt,...xt.length>0?{segments:xt}:{},timeDimensions:Ot,segments:xt,timezone:A.timezone}}series(g){return this.seriesNames(g).map(({title:_,shortTitle:A,key:Fe})=>({title:_,shortTitle:A,key:Fe,series:this.chartPivot(g).map(({x:g,..._})=>({value:_[Fe],x:g}))}))}axisValues(g,_=0){let{query:A}=this.loadResponses[_],Fe=g.filter(g=>g!==`measures`),st=g.includes(`measures`)&&A.measures||[];return g=>{let _=_=>{let A=Fe.map(_=>g[_]??null);return _&&A.push(_),A};return st.length>0?st.map(_):[_()]}}axisValuesString(g,_=`, `){return g.map(g=>g==null?`∅`:g===``?`[Empty string]`:g).join(_)}static getNormalizedPivotConfig(_,A){let Fe={x:[],y:[],fillMissingDates:!0,joinDateRange:!1},{measures:st=[],dimensions:lt=[]}=_||{},_t=(_?.timeDimensions||[]).filter(g=>!!g.granularity);A=A||(_t.length?{x:_t.map(_=>g.timeDimensionMember(_)),y:lt}:{x:lt,y:[]});let bt=mergeDeepLeft(A,Fe),xt=A=>A.map(A=>_t.find(g=>g.dimension===A)&&!lt.find(g=>g===A)?g.timeDimensionMember((_?.timeDimensions||[]).find(g=>g.dimension===A)):A);bt.x=xt(bt.x),bt.y=xt(bt.y);let wt=bt.x.concat(bt.y),Tt=_t.map(_=>g.timeDimensionMember(_)).concat(lt),Et=g=>Tt.includes(g)||g===`measures`;return bt.x=bt.x.concat(Tt.filter(g=>!wt.includes(g)&&g!==`compareDateRange`)).filter(Et),bt.y=bt.y.filter(Et),bt.x.concat(bt.y).find(g=>g===`measures`)||bt.y.push(`measures`),lt.includes(`compareDateRange`)&&!bt.y.concat(bt.x).includes(`compareDateRange`)&&bt.y.unshift(`compareDateRange`),st.length||(bt.x=bt.x.filter(g=>g!==`measures`),bt.y=bt.y.filter(g=>g!==`measures`)),bt}normalizePivotConfig(_){return g.getNormalizedPivotConfig(this.loadResponse.pivotQuery,_)}timeSeries(_,A,Fe){if(!_.granularity)return null;let st;if(st=_.dateRange,!st){let Fe=g.timeDimensionMember(_),lt=this.timeDimensionBackwardCompatibleData(A||0).map(g=>{let _=g[Fe];return _?internalDayjs(_):null}).filter(g=>!!g);st=lt.length&&[reduce(minBy$1(g=>g.toDate()),lt[0],lt).toString(),reduce(maxBy$1(g=>g.toDate()),lt[0],lt).toString()]||null}if(!st)return null;let lt=_.dateRange?_.dateRange.find(g=>g.match(DateRegex)):![`hour`,`minute`,`second`].includes(_.granularity),[_t,bt]=st,xt=dayRange(_t,bt,Fe);if(isPredefinedGranularity(_.granularity))return TIME_SERIES[_.granularity](lt?xt.snapTo(`d`):xt);if(!Fe?.[`${_.dimension}.${_.granularity}`])throw Error(`Granularity "${_.granularity}" not found in time dimension "${_.dimension}"`);return timeSeriesFromCustomInterval(_t,bt,Fe[`${_.dimension}.${_.granularity}`].granularity)}pivot(_){let A=this.normalizePivotConfig(_),{pivotQuery:Fe}=this.loadResponse,st=(_=0)=>{let st=groupByToPairs(({xValues:g})=>this.axisValuesString(g)),lt=(g,_)=>g[_]??A.fillWithValue??0;if(A.fillMissingDates&&A.x.length===1&&equals$2(A.x,(Fe.timeDimensions||[]).filter(g=>!!g.granularity).map(_=>g.timeDimensionMember(_)))){let g=this.loadResponses.map(g=>this.timeSeries(g.query.timeDimensions[0],_,g.annotation.timeDimensions));g[0]&&(st=A=>{let Fe=groupBy(({xValues:g})=>g[0],A);return g[_]?.map(g=>[g,Fe[g]||[{xValues:[g],row:{}}]])??[]})}let _t=this.axisValues(A.x,_),bt=this.axisValues(A.y,_),xt=pipe(map$3(g=>_t(g).map(_=>({xValues:_,row:g}))),unnest,st)(this.timeDimensionBackwardCompatibleData(_)),wt={};xt.forEach(([,g])=>{g.forEach(({row:g})=>{bt(g).forEach(_=>{Object.keys(g).length>0&&(wt[_.join()]=_)})})});let Tt=Object.values(wt),Et=A.x.includes(`measures`);return xt.map(([,_])=>{let{xValues:A}=_[0],Fe={};return _.forEach(({row:g})=>{bt(g).map(_=>({yValues:_,row:g})).forEach(g=>{Fe[this.axisValuesString(g.yValues)]=g})}),{xValues:A,yValuesArray:unnest(Tt.map(_=>{let st=Et?g.measureFromAxis(A):g.measureFromAxis(_);return[[_,lt((Fe[this.axisValuesString(_)]||{row:{}}).row,st)]]}))}})},lt=this.loadResponses.length>1?this.loadResponses.map((g,_)=>st(_)):[];return lt.length?this.mergePivots(lt,A.joinDateRange||!1):st()}mergePivots(g,_){let A=g.reduce((g,_)=>g!=null&&_.length>=g.length?g:_,null)||[];return A.map((Fe,st)=>({xValues:_?[g.map(g=>g[st]?.xValues||[]).join(`, `)]:A[st].xValues,yValuesArray:unnest(g.map(g=>g[st].yValuesArray))}))}chartPivot(g){let _=g=>this.parseDateMeasures&&LocalDateRegex.test(g)?new Date(g):Number.isNaN(Number.parseFloat(g))?g:Number.parseFloat(g),A=new Set;return this.queryType===QUERY_TYPE.BLENDING_QUERY&&flatten$1(this.loadResponses.map(({query:g})=>g.measures??[])).filter((g,_,A)=>A.indexOf(g)!==_).forEach(g=>A.add(g)),this.pivot(g).map(({xValues:Fe,yValuesArray:st})=>{let lt={};return st.forEach(([Fe,st],_t)=>{lt[this.axisValuesString(aliasSeries(Fe,_t,g,A),`,`)]=st&&_(st)}),{x:this.axisValuesString(Fe,`,`),xValues:Fe,...lt}})}tablePivot(g){let _=this.normalizePivotConfig(g||{}),A=_.x.concat(_.y).includes(`measures`);return this.pivot(_).map(({xValues:g,yValuesArray:Fe})=>fromPairs([..._.x.map((_,A)=>[_,g[A]]),...A?Fe.map(([g,_])=>[g.length?g.join():`value`,_]):[]]))}tableColumns(g){let _=this.normalizePivotConfig(g||{}),A=this.loadResponses.map(g=>g.annotation).reduce((g,_)=>mergeDeepLeft(g,_),{dimensions:{},measures:{},timeDimensions:{},segments:{}}),Fe=Object.values(A).reduce((g,_)=>({...g,..._}),{}),st={},lt=g=>{let{title:_,shortTitle:A,type:st,format:lt,meta:_t,currency:bt,granularity:xt}=Fe[g]||{};return{key:g,title:_,shortTitle:A,type:st,format:lt,meta:_t,currency:bt,granularity:xt?.name}},_t=this.pivot(_);(_t[0]?.yValuesArray||[]).forEach(([g])=>{if(g.length>0){let A=st;g.forEach((g,Fe)=>{A[`_${g}`]={key:g,memberId:_.y[Fe]===`measures`?g:_.y[Fe],children:A[`_${g}`]?.children||{}},A=A[`_${g}`].children})}});let bt=(g={},_=[])=>Object.keys(g).length===0?[]:Object.values(g).map(({key:g,...A})=>{let Fe=bt(A.children,[..._,g]),{title:st,shortTitle:_t,...xt}=lt(A.memberId),wt=g!==A.memberId||st==null?g:``;return Fe.length?{...xt,key:g,title:[st,wt].join(` `).trim(),shortTitle:wt||_t,children:Fe}:{...xt,key:g,dataIndex:[..._,g].join(),title:[st,wt].join(` `).trim(),shortTitle:wt||_t}}),xt=[];return!_t.length&&_.y.includes(`measures`)&&(xt=(this.loadResponses[0].query.measures||[]).map(g=>({...lt(g),dataIndex:g}))),!_.y.length&&_.x.includes(`measures`)&&xt.push({key:`value`,dataIndex:`value`,title:`Value`,shortTitle:`Value`,type:`string`}),_.x.map(g=>g===`measures`?{key:`measures`,dataIndex:`measures`,title:`Measures`,shortTitle:`Measures`,type:`string`}:{...lt(g),dataIndex:g}).concat(bt(st)).concat(xt)}totalRow(g){return this.chartPivot(g)[0]}categories(g){return this.chartPivot(g)}seriesNames(_){let A=this.normalizePivotConfig(_),Fe=this.loadResponses.map(g=>g.annotation.measures).reduce((g,_)=>({...g,..._}),{}),st=unnest(this.loadResponses.map((g,_)=>pipe(map$3(this.axisValues(A.y,_)),unnest,uniq)(this.timeDimensionBackwardCompatibleData(_)))),lt=new Set;return this.queryType===QUERY_TYPE.BLENDING_QUERY&&flatten$1(this.loadResponses.map(({query:g})=>g.measures??[])).filter((g,_,A)=>A.indexOf(g)!==_).forEach(g=>lt.add(g)),st.map((_,st)=>{let _t=aliasSeries(_,st,A,lt);return{title:this.axisValuesString(A.y.find(g=>g===`measures`)?dropLast(1,_t).concat(Fe[g.measureFromAxis(_)].title):_t,`, `),shortTitle:this.axisValuesString(A.y.find(g=>g===`measures`)?dropLast(1,_t).concat(Fe[g.measureFromAxis(_)].shortTitle):_t,`, `),key:this.axisValuesString(_t,`,`),yValues:_}})}query(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].query}pivotQuery(){return this.loadResponse.pivotQuery||null}totalRows(){return this.loadResponses[0].total}rawData(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].data}annotation(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].annotation}timeDimensionBackwardCompatibleData(_){if(_===void 0)throw Error(`resultIndex is required`);if(!this.backwardCompatibleData[_]){let{data:A,query:Fe}=this.loadResponses[_],st=(Fe.timeDimensions||[]).filter(g=>!!g.granularity);this.backwardCompatibleData[_]=A.map(_=>({..._,...fromPairs(Object.keys(_).filter(A=>{let Fe=st.find(g=>g.dimension===A);return Fe&&!_[g.timeDimensionMember(Fe)]}).map(A=>[g.timeDimensionMember(st.find(g=>g.dimension===A)),_[A]]))}))}return this.backwardCompatibleData[_]}decompose(){return this.loadResponses.map(_=>new g({queryType:QUERY_TYPE.REGULAR_QUERY,pivotQuery:{..._.query,queryType:QUERY_TYPE.REGULAR_QUERY},results:[_]},this.options))}serialize(){return{loadResponse:clone(this.loadResponse)}}},SqlQuery=class{constructor(g){this.sqlQuery=g}rawQuery(){return this.sqlQuery.sql}sql(){return this.rawQuery().sql[0]}},memberMap=g=>fromPairs(g.map(g=>[g.name,g])),operators$1={string:[{name:`contains`,title:`contains`},{name:`notContains`,title:`does not contain`},{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`set`,title:`is set`},{name:`notSet`,title:`is not set`},{name:`startsWith`,title:`starts with`},{name:`notStartsWith`,title:`does not start with`},{name:`endsWith`,title:`ends with`},{name:`notEndsWith`,title:`does not end with`}],number:[{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`set`,title:`is set`},{name:`notSet`,title:`is not set`},{name:`gt`,title:`>`},{name:`gte`,title:`>=`},{name:`lt`,title:`<`},{name:`lte`,title:`<=`}],time:[{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`inDateRange`,title:`in date range`},{name:`notInDateRange`,title:`not in date range`},{name:`afterDate`,title:`after date`},{name:`afterOrOnDate`,title:`after or on date`},{name:`beforeDate`,title:`before date`},{name:`beforeOrOnDate`,title:`before or on date`}]},Meta=class{constructor(g){this.meta=g;let{cubes:_}=this.meta;this.cubes=_,this.cubesMap=fromPairs(_.map(g=>[g.name,{measures:memberMap(g.measures),dimensions:memberMap(g.dimensions),segments:memberMap(g.segments)}]))}membersForQuery(g,_){return unnest$1(this.cubes.map(g=>g[_])).sort((g,_)=>g.title>_.title?1:-1)}membersGroupedByCube(){let g=[`measures`,`dimensions`,`segments`,`timeDimensions`];return this.cubes.reduce((_,A)=>(g.forEach(g=>{let Fe=[];switch(g){case`measures`:Fe=A.measures||[];break;case`dimensions`:Fe=A.dimensions||[];break;case`segments`:Fe=A.segments||[];break;case`timeDimensions`:Fe=A.dimensions.filter(g=>g.type===`time`)||[]}_[g].push({cubeName:A.name,cubeTitle:A.title,type:A.type,public:A.public,members:Fe})}),_),{measures:[],dimensions:[],segments:[],timeDimensions:[]})}resolveMember(g,_){let[A]=g.split(`.`);return this.cubesMap[A]?(Array.isArray(_)?_:[_]).map(_=>this.cubesMap[A][_]&&this.cubesMap[A][_][g]).find(g=>g)||{title:g,error:`Path not found '${g}'`}:{title:g,error:`Cube not found ${A} for path '${g}'`}}defaultTimeDimensionNameFor(g){let[_]=g.split(`.`);return this.cubesMap[_]?Object.keys(this.cubesMap[_].dimensions||{}).find(g=>this.cubesMap[_].dimensions[g].type===`time`):null}filterOperatorsForMember(g,_){let A=this.resolveMember(g,_);return`error`in A||!(`type`in A)||A.type===`boolean`?operators$1.string:operators$1[A.type]||operators$1.string}},ProgressResult=class{constructor(g){this.progressResponse=g}stage(){return this.progressResponse.stage}timeElapsed(){return this.progressResponse.timeElapsed}};(function(g){var _=g.URLSearchParams&&g.URLSearchParams.prototype.get?g.URLSearchParams:null,A=_&&new _({a:1}).toString()===`a=1`,Fe=_&&new _(`s=%2B`).get(`s`)===`+`,st=`__URLSearchParams__`,lt=!_||(function(){var g=new _;return g.append(`s`,` &`),g.toString()===`s=+%26`})(),_t=xt.prototype,bt=!!(g.Symbol&&g.Symbol.iterator);if(_&&A&&Fe&<)return;function xt(g){g=g||``,(g instanceof URLSearchParams||g instanceof xt)&&(g=g.toString()),this[st]=kt(g)}_t.append=function(g,_){At(this[st],g,_)},_t.delete=function(g){delete this[st][g]},_t.get=function(g){var _=this[st];return g in _?_[g][0]:null},_t.getAll=function(g){var _=this[st];return g in _?_[g].slice(0):[]},_t.has=function(g){return g in this[st]},_t.set=function(g,_){this[st][g]=[``+_]},_t.toString=function(){var g=this[st],_=[],A,Fe,lt,_t;for(Fe in g)for(lt=Et(Fe),A=0,_t=g[Fe];A<_t.length;A++)_.push(lt+`=`+Et(_t[A]));return _.join(`&`)};var wt=!!Fe&&_&&!A&&g.Proxy;Object.defineProperty(g,"URLSearchParams",{value:wt?new Proxy(_,{construct:function(g,_){return new g(new xt(_[0]).toString())}}):xt});var Tt=g.URLSearchParams.prototype;Tt.polyfill=!0,Tt.forEach=Tt.forEach||function(g,_){var A=kt(this.toString());Object.getOwnPropertyNames(A).forEach(function(Fe){A[Fe].forEach(function(A){g.call(_,A,Fe,this)},this)},this)},Tt.sort=Tt.sort||function(){var g=kt(this.toString()),_=[],A,Fe,st;for(A in g)_.push(A);for(_.sort(),Fe=0;Fe<_.length;Fe++)this.delete(_[Fe]);for(Fe=0;Fe<_.length;Fe++){var lt=_[Fe],_t=g[lt];for(st=0;st<_t.length;st++)this.append(lt,_t[st])}},Tt.keys=Tt.keys||function(){var g=[];return this.forEach(function(_,A){g.push(A)}),Ot(g)},Tt.values=Tt.values||function(){var g=[];return this.forEach(function(_){g.push(_)}),Ot(g)},Tt.entries=Tt.entries||function(){var g=[];return this.forEach(function(_,A){g.push([A,_])}),Ot(g)},bt&&(Tt[g.Symbol.iterator]=Tt[g.Symbol.iterator]||Tt.entries);function Et(g){var _={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(g).replace(/[!'\(\)~]|%20|%00/g,function(g){return _[g]})}function Dt(g){return g.replace(/[ +]/g,`%20`).replace(/(%[a-f0-9]{2})+/gi,function(g){return decodeURIComponent(g)})}function Ot(_){var A={next:function(){var g=_.shift();return{done:g===void 0,value:g}}};return bt&&(A[g.Symbol.iterator]=function(){return A}),A}function kt(g){var _={};if(typeof g==`object`){if(Mt(g))for(var A=0;A<g.length;A++){var Fe=g[A];if(Mt(Fe)&&Fe.length===2)At(_,Fe[0],Fe[1]);else throw TypeError(`Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements`)}else for(var st in g)g.hasOwnProperty(st)&&At(_,st,g[st])}else{g.indexOf(`?`)===0&&(g=g.slice(1));for(var lt=g.split(`&`),_t=0;_t<lt.length;_t++){var bt=lt[_t],xt=bt.indexOf(`=`);-1<xt?At(_,Dt(bt.slice(0,xt)),Dt(bt.slice(xt+1))):bt&&At(_,Dt(bt),``)}}return _}function At(g,_,A){var Fe=typeof A==`string`?A:A!=null&&typeof A.toString==`function`?A.toString():JSON.stringify(A);_ in g?g[_].push(Fe):g[_]=[Fe]}function Mt(g){return!!g&&Object.prototype.toString.call(g)===`[object Array]`}})(typeof global<`u`?global:typeof window<`u`?window:void 0);async function*responseChunks(g){if(!g.body)throw Error(`Unsupported response body type for streaming`);let _=g.body.getReader();try{for(;;){let{done:g,value:A}=await _.read();if(g)break;A&&(yield A)}}finally{_.releaseLock()}}var HttpTransport=class{constructor({authorization:g,apiUrl:_,method:A,headers:Fe={},credentials:st,fetchTimeout:lt,signal:_t}){this.authorization=g,this.apiUrl=_,this.method=A,this.headers=Fe,this.credentials=st,this.fetchTimeout=lt,this.signal=_t}request(g,{method:_,fetchTimeout:A,baseRequestId:Fe,signal:st,...lt}){let _t=1,bt=new URLSearchParams(lt&&Object.keys(lt).map(g=>({[g]:typeof lt[g]==`object`?JSON.stringify(lt[g]):lt[g]})).reduce((g,_)=>({...g,..._}),{})),xt=`${this.apiUrl}/${g}${bt.toString().length?`?${bt}`:``}`,wt=_??this.method??(xt.length<2e3?`GET`:`POST`);wt===`POST`&&(xt=`${this.apiUrl}/${g}`);let Tt=A??this.fetchTimeout,Et=st||this.signal||(Tt?AbortSignal.timeout(Tt):void 0),Dt=()=>fetch(xt,{method:wt,headers:{Authorization:this.authorization,"x-request-id":Fe&&`${Fe}-span-${_t++}`,...this.headers,...wt===`POST`?{"Content-Type":`application/json`}:{}},credentials:this.credentials,body:wt===`POST`?JSON.stringify(lt):null,signal:Et});return{async subscribe(g){try{return g(await Dt(),()=>this.subscribe(g))}catch(_){let A=`network Error`;return _.name===`AbortError`&&(A=Et?.reason===`TimeoutError`||Et?.reason?.name===`TimeoutError`?`timeout`:`aborted`),g({error:A},()=>this.subscribe(g))}}}}requestStream(g,{method:_,fetchTimeout:A,baseRequestId:Fe,signal:st,params:lt}){let _t={};lt&&Object.keys(lt).forEach(g=>{let _=lt[g];_!==void 0&&(_t[g]=typeof _==`object`?JSON.stringify(_):String(_))});let bt=new URLSearchParams(_t),xt=`${this.apiUrl}/${g}${bt.toString().length?`?${bt}`:``}`,wt=_??this.method??`POST`;wt===`POST`&&(xt=`${this.apiUrl}/${g}`);let Tt=A??this.fetchTimeout,Et,Dt=st||this.signal;return!Dt&&Tt&&(Et=new AbortController,Dt=Et.signal,setTimeout(()=>Et?.abort(),Tt)),{stream:async()=>{let g=await fetch(xt,{method:wt,headers:{Authorization:this.authorization,"x-request-id":Fe||`stream-request`,...this.headers,...wt===`POST`?{"Content-Type":`application/json`}:{}},credentials:this.credentials,body:wt===`POST`?JSON.stringify(lt||{}):null,signal:Dt});if(!g.ok)throw Error(`HTTP ${g.status}: ${g.statusText}`);if(!g.body)throw Error(`No response body available for streaming`);return responseChunks(g)},unsubscribe:async()=>{Et&&Et.abort()}}}},RequestError=class extends Error{constructor(g,_,A){super(g),this.response=_,this.status=A}};function pickCubeSqlResultMetadata(g){return{...g.lastRefreshTime?{lastRefreshTime:g.lastRefreshTime}:{},...g.external?{external:g.external}:{},...g.usedPreAggregations?{usedPreAggregations:g.usedPreAggregations}:{}}}var mutexCounter=0,MUTEX_ERROR=`Mutex has been changed`;function mutexPromise(g){return g.then(g=>g).catch(g=>{if(g!==MUTEX_ERROR)throw g;return null})}var CubeApi=class{constructor(g,_){if(g&&!Array.isArray(g)&&typeof g==`object`&&(_=g,g=void 0),!_||!_.transport&&!_.apiUrl)throw Error("The `apiUrl` option is required");this.apiToken=g,this.apiUrl=_.apiUrl,this.method=_.method,this.headers=_.headers||{},this.credentials=_.credentials,this.transport=_.transport||new HttpTransport({authorization:typeof g==`string`?g:void 0,apiUrl:this.apiUrl,method:this.method,headers:this.headers,credentials:this.credentials,fetchTimeout:_.fetchTimeout,signal:_.signal}),this.pollInterval=_.pollInterval||5,this.parseDateMeasures=_.parseDateMeasures,this.castNumerics=typeof _.castNumerics==`boolean`&&_.castNumerics,this.networkErrorRetries=_.networkErrorRetries||0,this.updateAuthorizationPromise=null}request(g,_){return this.transport.request(g,{..._,baseRequestId:_?.baseRequestId||v4()})}loadMethod(g,_,A,Fe){let st=++mutexCounter;typeof A==`function`&&!Fe&&(Fe=A,A=void 0),A=A||{};let lt=A.mutexKey||`default`;A.mutexObj&&(A.mutexObj[lt]=st);let _t=this.updateTransportAuthorization().then(()=>g()),bt=!0,xt=!1,wt=async()=>{let g=await _t;if(A&&A.mutexObj&&A.mutexObj[lt]!==st)throw xt=!0,g.unsubscribe&&await g.unsubscribe(),MUTEX_ERROR},Tt=this.networkErrorRetries,Et=async(g,st)=>{let lt=await _t,Et=async()=>A?.subscribe&&!xt?(lt.unsubscribe||await new Promise(g=>setTimeout(()=>g(),this.pollInterval*1e3)),st()):null,Dt=async(g=!1)=>xt?null:(g&&await new Promise(g=>setTimeout(()=>g(),this.pollInterval*1e3)),st());if(A?.subscribe&&!bt&&await this.updateTransportAuthorization(),bt=!1,`status`in g&&g.status===502||`error`in g&&g.error?.toLowerCase()===`network error`&&--Tt>=0)return await wt(),Dt(!0);g=g;let Ot={},kt=``;try{kt=await g.text(),Ot=JSON.parse(kt)}catch{Ot.error=kt}if(Ot.error?.includes(`Continue wait`))return await wt(),A?.progressCallback&&A.progressCallback(new ProgressResult(Ot)),Dt();await wt(),!A?.subscribe&<.unsubscribe&&await lt.unsubscribe();let At,Mt=null;if(g.status!==200)Mt=new RequestError(Ot.error||g.error||``,Ot,g.status);else try{At=_(Ot)}catch(g){if(!(g instanceof RequestError))throw g;Mt=g}if(Mt){if(Fe)Fe(Mt);else throw Mt}else if(Fe)Fe(null,At);else return At;return Et()},Dt=_t.then(g=>mutexPromise(g.subscribe(Et)));return Fe?{unsubscribe:async()=>{let g=await _t;return xt=!0,g.unsubscribe?g.unsubscribe():null}}:Dt}async updateTransportAuthorization(){if(this.updateAuthorizationPromise){await this.updateAuthorizationPromise;return}let g=this.apiToken;if(typeof g==`function`){let _=(async()=>{try{let _=await g();this.transport.authorization!==_&&(this.transport.authorization=_)}finally{this.updateAuthorizationPromise=null}})();this.updateAuthorizationPromise=_,await _}}patchQueryInternal(g,_){return(_===`compact`||_===`columnar`)&&g.responseFormat!==_?{...g,responseFormat:_}:g}loadResponseInternal(g,_={}){if(!Array.isArray(g?.results))throw new RequestError(g.error||`Invalid load response: ${JSON.stringify(g)}`,g,200);return g.results.length&&(_?.castNumerics&&g.results.forEach(g=>{let _=Object.entries({...g.annotation.measures,...g.annotation.dimensions}).reduce((g,[_,A])=>(A.type===`number`&&g.push(_),g),[]);g.data=g.data.map(g=>(_.forEach(_=>{g[_]!=null&&(g[_]=Number(g[_]))}),g))}),g.results[0].query.responseFormat&&g.results[0].query.responseFormat===`compact`?g.results.forEach((_,A)=>{let Fe=[],{dataset:st,members:lt}=_.data;st.forEach(g=>{let _={};lt.forEach((A,Fe)=>{_[A]=g[Fe]}),Fe.push(_)}),g.results[A].data=Fe}):g.results[0].query.responseFormat&&g.results[0].query.responseFormat===`columnar`&&g.results.forEach((_,A)=>{let{columns:Fe,members:st}=_.data,lt=Fe[0]?.length??0,_t=[];for(let g=0;g<lt;g++){let _={};st.forEach((A,st)=>{_[A]=Fe[st][g]}),_t.push(_)}g.results[A].data=_t})),new ResultSet(g,{parseDateMeasures:this.parseDateMeasures})}load(g,_,A,Fe=`default`){[g,_]=this.prepareQueryOptions(g,_,Fe);let st={query:g,queryType:`multi`,signal:_?.signal,baseRequestId:_?.baseRequestId};return _?.cache&&(st.cache=_.cache),this.loadMethod(()=>this.request(`load`,st),g=>this.loadResponseInternal(g,_),_,A)}prepareQueryOptions(g,_,A=`default`){return _={castNumerics:this.castNumerics,..._},A===`compact`||A===`columnar`?Array.isArray(g)?[g.map(g=>this.patchQueryInternal(g,A)),_]:[this.patchQueryInternal(g,A),_]:[g,_]}subscribe(g,_,A,Fe=`default`){return[g,_]=this.prepareQueryOptions(g,_,Fe),this.loadMethod(()=>this.request(`subscribe`,{query:g,queryType:`multi`,signal:_?.signal,baseRequestId:_?.baseRequestId}),g=>this.loadResponseInternal(g,_),{..._,subscribe:!0},A)}sql(g,_,A){return this.loadMethod(()=>this.request(`sql`,{query:g,signal:_?.signal,baseRequestId:_?.baseRequestId}),g=>Array.isArray(g)?g.map(g=>new SqlQuery(g)):new SqlQuery(g),_,A)}meta(g,_){return this.loadMethod(()=>this.request(`meta`,{signal:g?.signal,baseRequestId:g?.baseRequestId,...g?.onlyViews?{onlyViews:!0}:{}}),g=>new Meta(g),g,_)}dryRun(g,_,A){return this.loadMethod(()=>this.request(`dry-run`,{query:g,signal:_?.signal,baseRequestId:_?.baseRequestId}),g=>g,_,A)}cubeSql(g,_,A){return this.loadMethod(()=>{let A={query:g,method:`POST`,signal:_?.signal,fetchTimeout:_?.timeout,baseRequestId:_?.baseRequestId,throwContinueWait:!0};return _?.cache&&(A.cache=_.cache),_?.timezone&&(A.timezone=_.timezone),this.request(`cubesql`,A)},g=>{if(!g||!g.error)throw Error(`Invalid response format`);if(g.error===`timeout`){let g=_?.timeout||3e5;throw Error(`CubeSQL query timed out after ${g}ms`)}if(g.error===`aborted`)throw Error(`CubeSQL query was aborted`);let[A,...Fe]=g.error.split(`
|
|
924
924
|
`),st;try{st=JSON.parse(A)}catch{throw Error(g.error)}let lt=[];for(let _ of Fe)if(_.trim().length){let A;try{A=JSON.parse(_)}catch{throw Error(g.error)}if(A.error)throw Error(A.error);if(A.data)for(let g=0;g<A.data.length;g++)lt.push(A.data[g])}return{schema:st.schema,data:lt,...pickCubeSqlResultMetadata(st)}},_,A)}async*cubeSqlStream(g,_){if(!this.transport.requestStream)throw Error(`Transport does not support streaming`);let A=this.transport.requestStream(`cubesql`,{method:`POST`,signal:_?.signal,fetchTimeout:_?.timeout,baseRequestId:v4(),params:{query:g,cache:_?.cache,timezone:_?.timezone}}),Fe=new TextDecoder,st=``;try{let g=await A.stream();for await(let _ of g){st+=Fe.decode(_,{stream:!0});let g=st.split(`
|
|
925
925
|
`);st=g.pop()||``;for(let _ of g)if(_.trim())try{let g=JSON.parse(_);g.schema?yield{type:`schema`,schema:g.schema,...pickCubeSqlResultMetadata(g)}:g.data?yield{type:`data`,data:g.data}:g.error&&(yield{type:`error`,error:g.error})}catch{yield{type:`error`,error:`Failed to parse JSON line: ${_}`}}}if(st.trim())try{let g=JSON.parse(st);g.schema?yield{type:`schema`,schema:g.schema,...pickCubeSqlResultMetadata(g)}:g.data?yield{type:`data`,data:g.data}:g.error&&(yield{type:`error`,error:g.error})}catch{yield{type:`error`,error:`Failed to parse remaining JSON: ${st}`}}}catch(g){throw g.name===`AbortError`?Error(`aborted`):g}finally{A.unsubscribe&&await A.unsubscribe()}}},src_default=(g,_)=>new CubeApi(g,_);function useCubejsApi(g,_){return(0,import_react.useMemo)(()=>!_||!g||_===`undefined`?null:src_default(_,{apiUrl:g}),[g,_])}var require_es6=__commonJSMin(((g,_)=>{_.exports=function g(_,A){if(_===A)return!0;if(_&&A&&typeof _==`object`&&typeof A==`object`){if(_.constructor!==A.constructor)return!1;var Fe,st,lt;if(Array.isArray(_)){if(Fe=_.length,Fe!=A.length)return!1;for(st=Fe;st--!==0;)if(!g(_[st],A[st]))return!1;return!0}if(_ instanceof Map&&A instanceof Map){if(_.size!==A.size)return!1;for(st of _.entries())if(!A.has(st[0]))return!1;for(st of _.entries())if(!g(st[1],A.get(st[0])))return!1;return!0}if(_ instanceof Set&&A instanceof Set){if(_.size!==A.size)return!1;for(st of _.entries())if(!A.has(st[0]))return!1;return!0}if(ArrayBuffer.isView(_)&&ArrayBuffer.isView(A)){if(Fe=_.length,Fe!=A.length)return!1;for(st=Fe;st--!==0;)if(_[st]!==A[st])return!1;return!0}if(_.constructor===RegExp)return _.source===A.source&&_.flags===A.flags;if(_.valueOf!==Object.prototype.valueOf)return _.valueOf()===A.valueOf();if(_.toString!==Object.prototype.toString)return _.toString()===A.toString();if(lt=Object.keys(_),Fe=lt.length,Fe!==Object.keys(A).length)return!1;for(st=Fe;st--!==0;)if(!Object.prototype.hasOwnProperty.call(A,lt[st]))return!1;for(st=Fe;st--!==0;){var _t=lt[st];if(!g(_[_t],A[_t]))return!1}return!0}return _!==_&&A!==A}})),import_es6=__toESM(require_es6()),require_fast_deep_equal=__commonJSMin(((g,_)=>{_.exports=function g(_,A){if(_===A)return!0;if(_&&A&&typeof _==`object`&&typeof A==`object`){if(_.constructor!==A.constructor)return!1;var Fe,st,lt;if(Array.isArray(_)){if(Fe=_.length,Fe!=A.length)return!1;for(st=Fe;st--!==0;)if(!g(_[st],A[st]))return!1;return!0}if(_.constructor===RegExp)return _.source===A.source&&_.flags===A.flags;if(_.valueOf!==Object.prototype.valueOf)return _.valueOf()===A.valueOf();if(_.toString!==Object.prototype.toString)return _.toString()===A.toString();if(lt=Object.keys(_),Fe=lt.length,Fe!==Object.keys(A).length)return!1;for(st=Fe;st--!==0;)if(!Object.prototype.hasOwnProperty.call(A,lt[st]))return!1;for(st=Fe;st--!==0;){var _t=lt[st];if(!g(_[_t],A[_t]))return!1}return!0}return _!==_&&A!==A}})),import_fast_deep_equal=__toESM(require_fast_deep_equal());function useDeepDependencies$1(g){let _=(0,import_react.useRef)();return(0,import_fast_deep_equal.default)(_.current,g)||(_.current=g),_.current}function useDeepEffect(g,_){let A=useDeepDependencies$1(_);return(0,import_react.useEffect)(g,A)}function useDeepMemo$1(g,_){let A=useDeepDependencies$1(_);return(0,import_react.useMemo)(g,A??[])}function useIdentifier(){let{identifier:g}=useAppContext();return g||``}function useIsMounted(){let g=(0,import_react.useRef)(!1),_=(0,import_react.useCallback)(()=>g.current,[]);return(0,import_react.useEffect)(()=>(g.current=!0,()=>{g.current=!1}),[]),_}function playgroundFetch(g,_={}){let{retries:A=0,...Fe}=_;return fetch(g,Fe).then(async g=>{if(g.status===500){let _=await g.text();try{_=JSON.parse(_).error}catch{}throw _}return g}).catch(Fe=>{if(Fe.message===`Network request failed`&&A>0)return playgroundFetch(g,{options:_,retries:A-1});throw Fe})}function openWindow({url:g,title:_=``,width:A=640,height:Fe=720}){let st=window.screenLeft===void 0?window.screenX:window.screenLeft,lt=window.screenTop===void 0?window.screenY:window.screenTop,_t=window.innerWidth||document.documentElement.clientWidth||screen.width,bt=window.innerHeight||document.documentElement.clientHeight||screen.height,xt=_t/window.screen.availWidth,wt=(_t-A)/2/xt+st,Tt=(bt-Fe)/2/xt+lt,Et=window.open(g,_,`
|
|
926
926
|
scrollbars=yes,
|
package/build/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<link rel="manifest" href="./manifest.json" />
|
|
16
16
|
<style>#playground-root{height:100%}#playground-root .ant-menu-item:not(.ant-menu-item-selected) a{color:#a9a9b6}</style>
|
|
17
17
|
<title>Cube Playground</title>
|
|
18
|
-
<script type="module" crossorigin src="./assets/index-
|
|
18
|
+
<script type="module" crossorigin src="./assets/index-D28jAyK1.js"></script>
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
21
21
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cubejs-client/playground",
|
|
3
3
|
"author": "Cube Dev, Inc.",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.14",
|
|
5
5
|
"engines": {},
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@ant-design/icons": "^5.3.5",
|
|
69
69
|
"@cube-dev/ui-kit": "0.52.3",
|
|
70
|
-
"@cubejs-client/core": "1.8.
|
|
71
|
-
"@cubejs-client/react": "1.8.
|
|
70
|
+
"@cubejs-client/core": "1.8.14",
|
|
71
|
+
"@cubejs-client/react": "1.8.14",
|
|
72
72
|
"@types/flexsearch": "^0.7.3",
|
|
73
73
|
"@types/node": "^22",
|
|
74
74
|
"@types/react": "^18.3.4",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"react-dom": ">=18.0.0",
|
|
102
102
|
"styled-components": ">=6.5.3"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "773d4190bd71bb71165dedcadc171a8fcec187f9"
|
|
105
105
|
}
|
|
Binary file
|