df-script 1.9.0 → 2.0.0

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.
Files changed (59) hide show
  1. package/README.md +148 -235
  2. package/dist/api.d.ts +41 -36
  3. package/dist/columnExpressions/ColumnExpr.d.ts +5 -8
  4. package/dist/columnExpressions/functions/all.d.ts +13 -13
  5. package/dist/columnExpressions/functions/coalesce.d.ts +2 -2
  6. package/dist/columnExpressions/functions/duration.d.ts +16 -21
  7. package/dist/columnExpressions/functions/element.d.ts +10 -10
  8. package/dist/columnExpressions/functions/exclude.d.ts +14 -14
  9. package/dist/columnExpressions/functions/implode.d.ts +7 -7
  10. package/dist/columnExpressions/functions/lit.d.ts +9 -9
  11. package/dist/columnExpressions/functions/seqRange.d.ts +69 -0
  12. package/dist/columnExpressions/functions/struct.d.ts +6 -6
  13. package/dist/columnExpressions/functions/when.d.ts +25 -28
  14. package/dist/columnExpressions/index.d.ts +3 -7
  15. package/dist/columnExpressions/mixins/AggregationExpr.d.ts +550 -221
  16. package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +701 -327
  17. package/dist/columnExpressions/mixins/ArrayExpr.d.ts +508 -212
  18. package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +398 -201
  19. package/dist/columnExpressions/mixins/LogicalExpr.d.ts +59 -29
  20. package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +23 -9
  21. package/dist/columnExpressions/mixins/StandardExpr.d.ts +3234 -0
  22. package/dist/columnExpressions/mixins/StringExpr.d.ts +1163 -524
  23. package/dist/columnExpressions/mixins/StructExpr.d.ts +67 -25
  24. package/dist/columnExpressions/mixins/TemporalExpr.d.ts +518 -212
  25. package/dist/columnExpressions/mixins/WindowExpr.d.ts +270 -102
  26. package/dist/columnExpressions/typeInference.d.ts +3 -3
  27. package/dist/columnExpressions/types.d.ts +5 -0
  28. package/dist/columnExpressions/utils.d.ts +7 -0
  29. package/dist/constants.d.ts +11 -2
  30. package/dist/dataframe/dataframe.d.ts +755 -592
  31. package/dist/dataframe/grouped/grouped.d.ts +24 -6
  32. package/dist/dataframe/grouped.d.ts +70 -0
  33. package/dist/dataframe/index.d.ts +1 -1
  34. package/dist/dataframe/lazy.d.ts +37 -0
  35. package/dist/dataframe/types.d.ts +46 -22
  36. package/dist/dataframe/utils.d.ts +10 -4
  37. package/dist/datatypes/index.d.ts +11 -4
  38. package/dist/expressions.js +1 -0
  39. package/dist/expressions.mjs +1 -0
  40. package/dist/functions/concat.d.ts +68 -16
  41. package/dist/functions/index.d.ts +2 -2
  42. package/dist/functions/readCsv.d.ts +35 -0
  43. package/dist/functions/readJson.d.ts +33 -0
  44. package/dist/index.js +5 -6
  45. package/dist/index.mjs +5 -6
  46. package/dist/types.d.ts +42 -9
  47. package/dist/utils/array.d.ts +17 -14
  48. package/dist/utils/csv.d.ts +4 -1
  49. package/dist/utils/date.d.ts +3 -19
  50. package/dist/utils/duration.d.ts +7 -5
  51. package/dist/utils/json.d.ts +5 -3
  52. package/dist/utils/object.d.ts +0 -18
  53. package/dist/utils/string.d.ts +5 -0
  54. package/dist/utils.js +4 -0
  55. package/dist/utils.mjs +4 -0
  56. package/package.json +29 -8
  57. package/dist/assets/index-DBhGK6Tp.css +0 -1
  58. package/dist/assets/index-DEJEV_tU.js +0 -195
  59. package/dist/index.html +0 -17
@@ -0,0 +1 @@
1
+ var dn=Object.defineProperty;var rs=Object.getOwnPropertyDescriptor;var os=Object.getOwnPropertyNames;var is=Object.prototype.hasOwnProperty;var ss=(e,t,n)=>t in e?dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var O=(e,t)=>()=>(e&&(t=e(e=0)),t);var lr=(e,t)=>{for(var n in t)dn(e,n,{get:t[n],enumerable:!0})},as=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of os(t))!is.call(e,o)&&o!==n&&dn(e,o,{get:()=>t[o],enumerable:!(r=rs(t,o))||r.enumerable});return e};var ur=e=>as(dn({},"__esModule",{value:!0}),e);var x=(e,t,n)=>ss(e,typeof t!="symbol"?t+"":t,n);var Tt,cr,fr,Ut,pr,Xa,mr,gt=O(()=>{"use strict";Tt="*",cr="*literal*",fr="*coalesce*",Ut="*element*",pr="*struct*",Xa="*duration*",mr="*when*"});var dr=O(()=>{"use strict"});function C(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ft(e){if(!C(e))return!1;try{if(!Object.prototype.hasOwnProperty.call(e,Symbol.toStringTag)&&Object.prototype.toString.call(e)!==xs)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;if(Object.getPrototypeOf(t)!==null||!Object.prototype.hasOwnProperty.call(t,"isPrototypeOf"))return!1;let n=Object.getOwnPropertyDescriptor(t,"toString");if(!n||typeof n.value!="function")return!1;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r!="function"?!1:Function.prototype.toString.call(r)===Vs}catch{return!1}}function Tr(e){if(typeof e!="function")return!1;try{let t=Function.prototype.toString.call(e),n=t.replace(/^(?:\s+|\/\*[\s\S]*?\*\/|\/\/[^\r\n]*)+/,"");if(/^(?:@[\w$.]+(?:\([^)]*\))?\s+)*class\b/.test(n))return!0;let r=Object.getOwnPropertyDescriptor(e,"prototype");if(r&&!r.writable&&t.includes("[native code]")){let o=Er.length;for(let i=0;i<o;i++)try{return Reflect.construct(e,Er[i],Ls),!0}catch{}}}catch{return!1}return!1}function lt(e,t,n,r){if(!C(e))return!1;if(n)try{let o=n.call(e);return r!==void 0?o===r:!0}catch{return!1}try{return Object.prototype.hasOwnProperty.call(e,Symbol.toStringTag)?!1:Object.prototype.toString.call(e)===t}catch{return!1}}function M(e){if(!C(e))return!1;if(Ar)try{return!Number.isNaN(Ar.call(e))}catch{return!1}try{return Object.prototype.hasOwnProperty.call(e,Symbol.toStringTag)?!1:Object.prototype.toString.call(e)===ls&&!Number.isNaN(e.getTime())}catch{return!1}}function K(e){return lt(e,us,_s)}function yn(e){return lt(e,cs,Ds)}function gn(e){return lt(e,fs,Rs)}function Or(e){if(!C(e))return!1;if(wr)try{return wr.call(e,"key"),!0}catch{return!1}return lt(e,ms,void 0)}function _r(e){if(!C(e))return!1;try{if(e instanceof Error)return!0;let t=e;for(;t!==null;){if(!Object.prototype.hasOwnProperty.call(t,Symbol.toStringTag)&&Object.prototype.toString.call(t)===ps)return!0;t=Object.getPrototypeOf(t)}}catch{return!1}return!1}function hn(e){if(!C(e))return!1;try{let t=ArrayBuffer.isView(e)?e.buffer:e;return xn(t)||!bn(t)?!1:"detached"in t&&t.detached!==void 0?t.detached===!0:(Ns?.call(t,0,0),!1)}catch{return!0}}function bn(e){return lt(e,gs,Cs)}function xn(e){return lt(e,hs,Ms)}function Dr(e){return lt(e,bs,ks)}function re(e){return lt(e,ds,ht,"Uint8Array")}function Rr(e){return lt(e,ys,ht,"Uint8ClampedArray")}function L(e){if(!C(e))return e;let t=Ir.length;for(let n=0;n<t;n++){let r=Ir[n];if(r)try{return r.call(e)}catch{}}return e}var ls,us,cs,fs,ps,ms,ds,ys,gs,hs,bs,xs,As,yr,gr,hr,ws,Es,Is,Ss,Ts,Os,_s,Ds,Rs,ee,br,xr,ht,Cs,Ns,Ms,ks,Ar,wr,Us,Fs,Bs,js,Ps,Vs,Sr,Ls,vs,Er,Ir,ut=O(()=>{"use strict";ls="[object Date]",us="[object RegExp]",cs="[object Set]",fs="[object Map]",ps="[object Error]",ms="[object URLSearchParams]",ds="[object Uint8Array]",ys="[object Uint8ClampedArray]",gs="[object ArrayBuffer]",hs="[object SharedArrayBuffer]",bs="[object DataView]",xs="[object Object]",As=typeof Date=="function"?Date.prototype:void 0,yr=typeof RegExp=="function"?RegExp.prototype:void 0,gr=typeof Set=="function"?Set.prototype:void 0,hr=typeof Map=="function"?Map.prototype:void 0,ws=typeof URLSearchParams=="function"?URLSearchParams.prototype:void 0,Es=typeof String=="function"?String.prototype:void 0,Is=typeof Number=="function"?Number.prototype:void 0,Ss=typeof Boolean=="function"?Boolean.prototype:void 0,Ts=typeof BigInt=="function"?BigInt.prototype:void 0,Os=typeof Symbol=="function"?Symbol.prototype:void 0,_s=yr?Object.getOwnPropertyDescriptor(yr,"source")?.get:void 0,Ds=gr?Object.getOwnPropertyDescriptor(gr,"size")?.get:void 0,Rs=hr?Object.getOwnPropertyDescriptor(hr,"size")?.get:void 0,ee=typeof ArrayBuffer=="function"?ArrayBuffer.prototype:void 0,br=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,xr=typeof DataView=="function"?DataView.prototype:void 0,ht=typeof Uint8Array=="function"?Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag)?.get:void 0,Cs=ee?Object.getOwnPropertyDescriptor(ee,"byteLength")?.get:void 0,Ns=ee?.slice,Ms=br?Object.getOwnPropertyDescriptor(br,"byteLength")?.get:void 0,ks=xr?Object.getOwnPropertyDescriptor(xr,"byteLength")?.get:void 0,Ar=As?.valueOf,wr=ws?.has,Us=Es?.valueOf,Fs=Is?.valueOf,Bs=Ss?.valueOf,js=Ts?.valueOf,Ps=Os?.valueOf,Vs=Function.prototype.toString.call(Object);Sr=function(){},Ls=new Proxy(Sr,{construct(){return this}}),vs=typeof ArrayBuffer=="function"?new ArrayBuffer(0):void 0,Er=[[],[Sr],[vs],[{}]];Ir=[Fs,Us,Bs,js,Ps]});var Cr,bt,oe,ie,An,xt,nn,ot,tt,wn,Bt,En,en,rn,se,ae,Ka,on,sn,$s,Nr,Mr,kr,Ur,Fr,Br,jr,Pr,Vr,Lr,vr,$r,qr,Gr,Xr,Jr,Wr,Kr,le,zr,Yr,ue,ce,Zr,it=O(()=>{"use strict";Cr="\\r\\n|\\n|\\r",bt=new TextEncoder,oe=new TextDecoder("utf-8"),ie=new TextDecoder("utf-8",{fatal:!0}),An=6048e5,xt=864e5,nn=36e5,ot=6e4,tt=1e3,wn=1,Bt=.001,En=1e-6,en=1e3,rn=1e6,se=1000n,ae=1000000n,Ka=Object.freeze({sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6}),on="\0",sn="",$s=4294967295,Nr=-9223372036854775808n,Mr=9223372036854775807n,kr=0n,Ur=18446744073709551615n,Fr=-2147483648,Br=2147483647,jr=0,Pr=$s,Vr=-32768,Lr=32767,vr=0,$r=65535,qr=-128,Gr=127,Xr=0,Jr=255,Wr=31,Kr=127,le=55296,zr=56319,Yr=56320,ue=57343,ce=Object.freeze({9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r"}),Zr=Object.freeze({b:"\b",0:"\0",...Object.fromEntries(Object.entries(ce).map(([e,t])=>[t.slice(1),String.fromCharCode(Number(e))]))})});function _(e,t){return typeof e!="number"?!1:Number.isNaN(e)?t?.allowNaN??t?.allowNonFiniteNumbers??!1:Number.isFinite(e)?!0:t?.allowNonFiniteNumbers??!1}function Hr(e){for(let t=1;t<e.length;t++)if(e[t].length!==3)return!1;return!0}function ro(e,t){if(qs.test(e))return null;let n=e.trim();if(n==="")return null;n.startsWith("(")&&n.endsWith(")")&&(n="-"+n.slice(1,-1).trim());let r=n[n.length-1];(r==="-"||r==="+")&&n.length>1&&(n=r+n.slice(0,-1).trim()),t||(n=n.replace(Gs,""));let o=n.includes("."),i=n.includes(",");if(o&&i){let a=n.lastIndexOf("."),s=n.lastIndexOf(","),l=s>a,c=l?".":",",u=l?s:a,f=n.slice(0,u).split(c);return f.length>1&&!Hr(f)||f[0].replace(Qr,"").length>3?null:l?n.replace(to,"").replace(In,"."):n.replace(In,"")}if(i||o){let a=i?",":".",s=n.split(a);if(s.length>2||a===","&&s.length===2&&s[1].length===3){let l=s[0].replace(Qr,"").length;if(l===0){if(a===","||s.length>2)return null}else return l>3?null:Hr(s)?n.replace(i?In:to,""):null}if(i)return n.replace(In,".")}return n}function B(e,{allowNonFiniteNumbers:t=!1,strictNumericString:n=!1,floatScientific:r=!0}={}){if(e==null||typeof e=="symbol")return null;switch(e=L(e),typeof e){case"number":return _(e,{allowNonFiniteNumbers:t})?e:null;case"boolean":return e?1:0;case"bigint":{let o=Number(e);return _(o,{allowNonFiniteNumbers:t})?o:null}case"object":{if(M(e)){let o=e.getTime();return _(o,{allowNonFiniteNumbers:t})?o:null}return null}case"string":{let o=ro(e,n);if(o===null)return null;if(t){let s=o.toLowerCase();if(s==="nan"||s==="-nan"||s==="+nan")return NaN;if(s==="infinity"||s==="+infinity")return 1/0;if(s==="-infinity")return-1/0}if(eo.test(o)&&!r||!no.test(o))return null;let a=Number(o);return _(a,{allowNonFiniteNumbers:t})?a:null}default:return null}}function fe(e,{floatPrecision:t="Float64",allowNonFiniteNumbers:n=!0,floatScientific:r=!0,strictNumericString:o=!1}={}){let i=B(e,{allowNonFiniteNumbers:n,floatScientific:r,strictNumericString:o});return i===null||(t==="Float32"&&(i=Math.fround(i)),!_(i,{allowNonFiniteNumbers:n}))?null:i}function Sn(e,t,n){if(!e)return null;let r=typeof e=="string"?t[e]:e;return r&&typeof r.min===n&&typeof r.max===n?r:null}function nt(e,{range:t="Int32"}={}){if(!_(e)||!Number.isInteger(e))return!1;let n=Sn(t,oo,"number");return n!=null&&e>=n.min&&e<=n.max}function J(e,{range:t="Int32",coerce:n="truncate"}={}){let r=B(e);if(r===null)return null;switch(n){case"round":r=Math.round(r);break;case"floor":r=Math.floor(r);break;case"ceil":r=Math.ceil(r);break;case"truncate":r=Math.trunc(r);break}let o=Sn(t,oo,"number");return o!=null?st(r,{min:o.min,max:o.max}):null}function jt(e,{range:t="Int64"}={}){let n=L(e);if(typeof n!="bigint")return!1;let r=Sn(t,io,"bigint");return r!=null&&n>=r.min&&n<=r.max}function Pt(e,{range:t="Int64",truncate:n=!1}={}){if(e==null||typeof e=="symbol")return null;try{e=L(e)}catch{return null}let r=null;if(typeof e=="bigint")r=e;else if(typeof e=="string"){let i=ro(e,!1);if(i===null||!no.test(i))return null;if(eo.test(i)){let a=i.search(/[eE]/),s=i.slice(0,a),l=i.slice(a+1),c=parseInt(l,10);if(Number.isNaN(c)||c>1e5||c<-1e5)return null;let u=s.startsWith("-");(u||s.startsWith("+"))&&(s=s.slice(1));let f=s.indexOf("."),p=s,m=0;f!==-1&&(m=s.length-f-1,p=s.slice(0,f)+s.slice(f+1)),p=p.replace(/^0+/,"")||"0";try{let d=BigInt(p);u&&(d=-d);let y=c-m;if(y>=0)r=d*10n**BigInt(y);else{let b=10n**BigInt(-y),g=d%b;if(!n&&g!==0n)return null;r=d/b}}catch{return null}}else{let a=i.indexOf(".");if(a!==-1){if(!n&&/[^0]/.test(i.slice(a+1)))return null;i=i.slice(0,a)}try{r=BigInt(i)}catch{return null}}}else{let i=B(e);if(i===null||!n&&!Number.isInteger(i))return null;r=BigInt(Math.trunc(i))}let o=Sn(t,io,"bigint");return!o||r<o.min||r>o.max?null:r}function Xs(e,t){let n=e-t;if(n<0||t<0)return null;if(n>15)return Number.K;let r=st(t,{min:0,max:16}),o=Math.pow(10,n)-Math.pow(10,-r);return o>0?o:null}function pe(e,t){if(!Number.isFinite(e))return e;let n=e.toString();if(n.includes("e")){let r=Math.pow(10,t);return Math.round(e*r)/r}return+(Math.round(+(n+"e"+t))+"e"+-t)}function Tn(e,{precision:t,scale:n}={}){let r=B(e);if(r===null)return null;let o=r;if(n!==void 0&&(o=pe(o,n)),t!==void 0){let a=Xs(t,n??0);a!==null&&(o=st(o,{min:-a,max:a}))}return o}function st(e,t){if(!t)return e;let{min:n=null,max:r=null,safe:o=!0}=t;if(n!==null&&r!==null&&n>r)return n;let i=e;if(o&&typeof i=="number"){if(Number.isNaN(i))return n!==null?n:r!==null?r:e;if(i===1/0)return r!==null?r:e;if(i===-1/0)return n!==null?n:e}return n!==null&&i<n?n:r!==null&&i>r?r:i}function so(e){let t=e|0;return function(){let n=t=t+1831565813|0;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}var no,qs,Gs,eo,Qr,to,In,oo,io,Ot=O(()=>{"use strict";ut();it();no=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,qs=/0[xobXOB]/,Gs=/[\s_\u200B-\u200D\uFEFF]/g,eo=/[eE]/;Qr=/^[+-]/,to=/\./g,In=/,/g;oo={Int8:{min:qr,max:Gr},Int16:{min:Vr,max:Lr},Int32:{min:Fr,max:Br},UInt8:{min:Xr,max:Jr},UInt16:{min:vr,max:$r},UInt32:{min:jr,max:Pr}};io={Int64:{min:Nr,max:Mr},UInt64:{min:kr,max:Ur}}});function et(e){if(!ArrayBuffer.isView(e))return!1;if(ht)return ht.call(e)!==void 0;let t=Object.prototype.toString.call(e);return t!=="[object DataView]"&&t.endsWith("Array]")}function R(e){return Array.isArray(e)||et(e)}function _t(e){return e==null?[]:Array.isArray(e)?[...e]:et(e)?Array.from(e):[e]}function Vt(e,t,n){let r=e.length,o=t<-r||t>=r;if(o&&!n)throw new z(`Index ${t} is out of bounds for array of length ${r}`);return o?null:e.at(t)??null}function Js(e){if(typeof e=="function"){let t=Tr(e);return{check:t?n=>n instanceof e:n=>!!e(n),coerce:n=>{if(t)return n instanceof e?n:null;let r=e(n);return typeof r=="boolean"?r?n:null:r}}}switch(e){case"string":return{check:t=>typeof t=="string",coerce:t=>String(t)};case"number":return{check:_,coerce:t=>B(t)??NaN};case"boolean":return{check:t=>typeof t=="boolean",coerce:Boolean};case"bigint":return{check:jt,coerce:t=>Pt(t)};case"date":return{check:M,coerce:t=>P(t)};case"object":return{check:C,coerce:t=>C(t)?t:null};case"plainObject":return{check:Ft,coerce:t=>Ft(t)?t:null};case"null":return{check:t=>t===null,coerce:()=>null};case"undefined":return{check:t=>t===void 0,coerce:()=>{}};case"nullish":return{check:t=>t==null,coerce:()=>null};default:return{check:()=>!0,coerce:t=>t}}}function v(e,t,{mode:n="every",allowNulls:r=!1,allowEmpty:o=!0}={}){if(!R(e))return!1;let i=e,a=i.length;if(a===0)return o?n==="every":!1;let{check:s}=Js(t);if(n==="every"){for(let l=0;l<a;l++){let c=i[l];if(!(r&&c==null)&&!s(c))return!1}return!0}for(let l=0;l<a;l++){let c=i[l];if(r&&c==null||s(c))return!0}return!1}function Ws(e,t,{descending:n=!1,nullsLast:r=!0,customComp:o}={}){let a=!!(Array.isArray(n)?n[0]:n)?-1:1;if(typeof o=="function")return o(e,t)*a;if(Object.is(e,t)||e==null&&t==null)return 0;if(e==null||t==null)return(e==null?1:-1)*(r?1:-1);let s=M(e),l=M(t);if(s!==l)return s?-1:1;if(s&&l)return(e.getTime()<t.getTime()?-1:e.getTime()>t.getTime()?1:0)*a;let c=typeof e,u=typeof t,f=c==="number"||c==="bigint",p=u==="number"||u==="bigint",m=Number.isNaN(e),d=Number.isNaN(t);return m&&d?0:m||d?(m?1:-1)*(r?1:-1):f&&p?(e<t?-1:e>t?1:0)*a:c!==u?c<u?-1:1:c==="string"?e.localeCompare(t)*a:(e<t?-1:e>t?1:0)*a}function an(e,{descending:t=!1,nullsLast:n=!0,customComp:r}={}){if(!R(e))return[];let o=e,i=o.length;if(i<=1)return et(e)?Array.from(o):i===0?[]:[o[0]];let a=!!(Array.isArray(t)?t[0]:t),s=e instanceof Float32Array||e instanceof Float64Array;if(et(e)&&!r&&n&&(!s||!a)){let c=o.slice().sort();return a&&c.reverse(),Array.from(c)}let l=new Array(i);for(let c=0;c<i;c++)l[c]=o[c];return l.sort((c,u)=>Ws(c,u,{descending:t,nullsLast:n,customComp:r}))}function D(e){if(!R(e))return ao;let t=e.length;if(t===0)return ao;let n=null,r=null,o=null,i=null,a=0,s=0,l=0,c=0,u=0,f=1,p=0,m=0;for(let b=0;b<t;b++){let g=e[b];if(g==null){s++;continue}if(typeof g=="number"&&Number.isNaN(g)){l++,s++;continue}(n==null||g<n)&&(n=g,o=b),(r==null||g>r)&&(r=g,i=b);let w=B(g);if(w!==null){let A=c+w;Math.abs(c)>=Math.abs(w)?u+=c-A+w:u+=w-A+c,c=A,f*=w,a++;let T=w-p;p+=T/a;let I=w-p;m+=T*I}}let d=a>1?m/(a-1):0,y=l>0;return{sum:a>0?c+u:null,product:a>0?f:null,count:a,min:n,max:r,nanMin:y?NaN:n,nanMax:y?NaN:r,minIdx:o,maxIdx:i,mean:a>0?(c+u)/a:null,variance:d,std:Math.sqrt(d),nullCount:s,nanCount:l,len:t,hasNulls:s>0,isNumeric:a>0&&a===t-s}}function At(e,{strict:t=!1,keySelector:n}={}){let r=Array.from(e),o=new Map;if(t){let a=n??V,s=new Map,l=r.length;for(let u=0;u<l;u++){let f=r[u],p=a(f),m=s.get(p);m===void 0?s.set(p,{val:f,count:1}):m.count++}let c=[];for(let u of s.values())c.push(u.val);for(let u=0;u<l;u++){let f=r[u],p=a(f),m=s.get(p);o.set(f,m.count)}return{values:c,count:c.length,frequencies:o}}let i=r.length;for(let a=0;a<i;a++){let s=r[a];o.set(s,(o.get(s)??0)+1)}return{values:Array.from(o.keys()),count:o.size,frequencies:o}}function On(e,{step:t=1,offsetStart:n=0,offsetEnd:r,maxItemsGathered:o,nullOnOob:i=!0}={}){if(e==null)return null;if(o!==void 0&&o<=0)return[];if(t===0)throw new k("Step size step cannot be zero");let a=e.length;if(a===0?n!==0:n>=a||n<-a){if(!i)throw new z(`Start offset ${n} is out of bounds for array of length ${a}`);return null}let l=n<0?a+n:n,c=r!==void 0?r<0?a+r:r:t>0?a:-1,u=[];if(t>0)for(let f=l;f<c&&f<a&&!(f>=0&&(u.push(e[f]),o!==void 0&&u.length>=o));f+=t);else for(let f=l;f>c&&f>=0&&!(f<a&&(u.push(e[f]),o!==void 0&&u.length>=o));f+=t);return u}function _n(e,t=",",{ignoreNulls:n=!1,nullValue:r="",prefix:o="",suffix:i="",limit:a,truncationMarker:s="...",valueFormatter:l}={}){let c=e.length,u=[],f=st(a??c,{min:0}),p=!1;for(let m=0;m<c;m++){if(u.length>=f){p=!0;break}let d=e[m];d!=null?u.push(l?l(d,m):String(d)):n||u.push(r)}return o+u.join(t)+(p?s:"")+i}function uo(e,t,n={}){let r=e.length,{mode:o="cumulative",step:i=1,coerce:a=y=>y,condition:s,reverse:l=!1,startIndex:c=l?r-1:0,endIndex:u=l?-1:r}=n,f=l?-1:1,p=c,m=u,d=(y,b)=>{(!s||s(e[y],y,e))&&(e[y]=a(b))};if(o==="constant"){let y=a(t);for(let b=p;l?b>m:b<m;b+=f)d(b,y)}else if(o==="independent")if(typeof i=="function"){let y=0;for(let b=p;l?b>m:b<m;b+=f)d(b,i({index:y,initialValue:t,originalValue:e[b],absoluteIndex:b,targetArray:e})),y++}else for(let y=p;l?y>m:y<m;y+=f)d(y,t+y*i);else{let y=t,b=!0,g=0;for(let w=p;l?w>m:w<m;w+=f)b?(d(w,y),b=!1):(typeof i=="function"?y=i({prev:y,index:g,originalValue:e[w],absoluteIndex:w,targetArray:e}):y=y+i,d(w,y)),g++}}function Ks(e){let t=e.length,n=0,r=new Float64Array(t);for(let i=0;i<t;i++){let a=e[i],s=B(a,{allowNonFiniteNumbers:!0});s!==null&&_(s,{allowNonFiniteNumbers:!0,allowNaN:!1})&&(r[n++]=s)}if(n===0)return null;let o=r.subarray(0,n);return o.sort(),o}function Dt(e,t){if(t<0||t>1)return null;let n=Ks(e);if(!n)return null;let r=n.length,o=t*(r-1),i=Math.floor(o),a=Math.ceil(o);return i===a?n[i]:n[i]+(o-i)*(n[a]-n[i])}function Dn(e){if(!R(e)||e.length===0)return null;let t=new Map,n=e.length,r=0,o=[];for(let i=0;i<n;i++){let a=e[i];if(a==null||typeof a=="number"&&!_(a,{allowNonFiniteNumbers:!0,allowNaN:!1}))continue;let s=(t.get(a)??0)+1;t.set(a,s),s>r?(r=s,o=[a]):s===r&&o.push(a)}return o.length===0?null:an(o)}function co(e,t){let n=e.length;if(n===0)return[];let r=Math.trunc(t);if(isNaN(r)||r===0)return _t(e);let o=Math.abs(r);if(o>=n)return new Array(n).fill(null);let i=new Array(n);if(r>0){i.fill(null,0,r);for(let a=r;a<n;a++){let s=e[a-r];i[a]=s??null}}else{let a=n-o;for(let s=0;s<a;s++){let l=e[s+o];i[s]=l??null}i.fill(null,a,n)}return i}function fo(e){let t=e.length,n=new Float64Array(t),r=new Float64Array(t),o=0;for(let i=0;i<t;i++){let a=e[i];if(!a)continue;let s=B(a[0]),l=B(a[1]);s===null||l===null||(n[o]=s,r[o]=l,o++)}return{xArr:n,yArr:r,count:o}}function po(e,t,n){if(n<2)return null;let r=0,o=0,i=0,a=0,s=0;for(let f=0;f<n;f++){let p=e[f],m=t[f],d=p-r;r+=d/(f+1);let y=p-r,b=m-o;o+=b/(f+1);let g=m-o;s+=d*g,i+=d*y,a+=b*g}let l=s/(n-1);if(i===0||a===0)return{covariance:l,correlation:null};let c=Math.sqrt(i*a);if(c===0||Number.isNaN(c))return{covariance:l,correlation:null};let u=st(s/c,{min:-1,max:1});return{covariance:l,correlation:u}}function me(e){let{xArr:t,yArr:n,count:r}=fo(e);return r<2?{covariance:null,correlation:null}:po(t,n,r)??{covariance:null,correlation:null}}function lo(e){let t=e.length,n=new Int32Array(t);for(let i=0;i<t;i++)n[i]=i;n.sort((i,a)=>e[i]-e[a]);let r=new Float64Array(t),o=0;for(;o<t;){let i=o+1;for(;i<t&&e[n[i]]===e[n[o]];)i++;let a=(o+1+i)/2;for(let s=o;s<i;s++)r[n[s]]=a;o=i}return r}function zs(e,t,n){let r=po(e,t,n);return r?r.correlation:null}function mo(e){let{xArr:t,yArr:n,count:r}=fo(e);if(r<2)return null;let o=lo(t.subarray(0,r)),i=lo(n.subarray(0,r));return zs(o,i,r)}function yo(e){let t=e.length,n=0,r=0;for(let o=0;o<t;o++){let i=e[o];if(!i)continue;let a=B(i[0]),s=B(i[1]);a===null||s===null||(n+=a*s,r++)}return r>0?n:null}function go(e){let t=e.length,n=0,r=0,o=0;for(let i=0;i<t;i++){let a=e[i];if(!a)continue;let s=B(a[0]),l=B(a[1]);s===null||l===null||(n+=s*l,r+=l,o++)}return o===0||Math.abs(r)<1e-12?null:n/r}function ho(e){if(!R(e))return null;let{mean:t,count:n}=D(e);if(n<2||t===null)return null;let r=0,o=0,i=0,a=e.length;for(let s=0;s<a;s++){let l=B(e[s]);if(l===null)continue;let c=l-t,u=c*c;r+=u,o+=u*c,i+=u*u}return r<=0?null:{count:n,mean:t,m2Sum:r,m3Sum:o,m4Sum:i}}function bo(e,t={}){let n=ho(e);if(!n)return null;let{count:r,m2Sum:o,m3Sum:i}=n,a=o/r,l=i/r/Math.pow(a,1.5);if(t?.bias??!0)return _(l)?l:null;if(r<3)return null;let u=Math.sqrt(r*(r-1))/(r-2)*l;return _(u)?u:null}function xo(e,t={}){let n=ho(e);if(!n)return null;let{count:r,m2Sum:o,m4Sum:i}=n,a=o/r,l=i/r/(a*a),c=l-3,u=t?.fisher??!0;if(t?.bias??!0){let d=u?c:l;return _(d)?d:null}if(r<4)return null;let p=(r-1)/((r-2)*(r-3))*((r+1)*c+6),m=u?p:p+3;return _(m)?m:null}function Ao(e,t={}){if(!e||e.length===0)return null;let{base:n=Math.E,normalize:r=!0}=t;if(n<=0||n===1)return null;let o=e.length,i=Math.log(n);if(r){let a=new Map,s=0;for(let c=0;c<o;c++){let u=e[c];if(u==null||Number.isNaN(u))continue;let f=V(u);a.set(f,(a.get(f)||0)+1),s++}if(s===0)return null;let l=0;for(let c of a.values()){let u=c/s;u>0&&(l-=u*(Math.log(u)/i))}return _(l)?((l<0||Object.is(l,-0))&&(l=0),l):null}else{let a=[],s=0;for(let u=0;u<o;u++){let f=e[u];if(f==null||Number.isNaN(f))continue;let p=Number(f);if(!_(p)||p<0)return null;p>0&&(a.push(p),s+=p)}if(a.length===0||s<=0)return null;let l=0,c=a.length;for(let u=0;u<c;u++){let f=a[u]/s;f>0&&(l-=f*(Math.log(f)/i))}return _(l)?((l<0||Object.is(l,-0))&&(l=0),l):null}}function Rn(e,t){if(!e||e.length===0)return null;let n=null,r=e.length;for(let o=0;o<r;o++){let i=Pt(e[o],{range:"Int64"});i!==null&&(n=n===null?i:t(n,i))}return n===null?null:n>=Number.At&&n<=Number.K?Number(n):n}function de(e,t){if(!e||e.length===0)return null;let n=e.length,r=new Array(n),o=new Array(n);for(let a=0;a<n;a++){let s=e[a];r[a]=s?.[0],o[a]=s?.[1]}let i=D(o)[t];return i!==null?r[i]:null}function Cn(e,t,n={}){if(!e||e.length===0)return[];let r=e.length,{nullify:o=!1}=n,i=R(t);if(!i&&!t)return o?new Array(r).fill(null):[];let a=[];for(let s=0;s<r;s++)(i?t[s]:t)?a.push(e[s]):o&&a.push(null);return a}var ao,ln=O(()=>{"use strict";ut();Ot();ye();Lt();$();ao={sum:null,product:null,count:0,min:null,max:null,nanMin:null,nanMax:null,minIdx:null,maxIdx:null,mean:null,variance:0,std:0,nullCount:0,nanCount:0,len:0,hasNulls:!1,isNumeric:!1}});function Eo(e,t={}){let n=t?.trim?rt(e)??"":e,r=n.length;if(r<2)return!1;let o=n[0],i=n[r-1];return o==="{"&&i==="}"||o==="["&&i==="]"}function he(e,t={}){let n="fallback"in t?t.fallback:e;if(typeof e!="string")return n;let{format:r="json",allowPrimitives:o=!1,trimBeforeParse:i=!1,reviver:a,ndjson:s={},guard:l,onError:c}=t,u=i?e.trim():e;try{let f;if(r==="ndjson"){let{skipInvalidLines:p=!1,maxLines:m,skipLines:d=0}=s,y=[],b=new RegExp(Cr,"g"),g=0,w=0;for(;m===void 0||y.length<m;){let T=b.exec(u),I=(T?u.substring(g,T.index):u.substring(g)).trim();if(T&&(g=b.lastIndex),I===""){if(!T)break;continue}if(w++,w<=d){if(!T)break;continue}if(!o&&!Eo(I)){if(!p)throw new k("NDJSON line is not wrapped and primitives are disallowed");if(!T)break;continue}try{y.push(JSON.parse(I,a))}catch(F){if(!p)throw F}if(!T)break}let A=w>d;if(y.length===0&&A&&m!==0)throw new un("No valid NDJSON lines processed");f=y}else{if(!o&&!Eo(u,{trim:!i}))throw new k("JSON string is not wrapped and primitives are disallowed");f=JSON.parse(u,a)}if(l&&!l(f))throw new k("Parsed value failed guard validation");return f}catch(f){try{c?.(f)}catch{}return n}}function be(e={}){let t=e.bigintStrategy??"string",n=e.handleCircular?new WeakSet:null,r=Array.isArray(e.replacer)?e.replacer.map(String):null;return function(i,a){let s=a;if(typeof e.replacer=="function")s=e.replacer.call(this,i,a);else if(r&&i!==""&&!Array.isArray(this)&&!r.includes(i))return;if(s===void 0)return;let l=s===a&&this!=null?this[i]:s;if(typeof e.onCustom=="function"){let f=e.onCustom.call(this,i,l);if(f!==l||f===void 0&&l!==void 0)return f}let c=s!==null&&typeof s=="object"||typeof s=="bigint"?s:l,u=C(c)?L(c):c;if(u!==null&&typeof u!="object"&&typeof u!="bigint")return s;if(n&&(C(u)||Array.isArray(u))){if(i===""&&(n=new WeakSet),n.has(u))return e.onCircular?e.onCircular.call(this,i,u):"[Circular]";n.add(u)}return typeof u=="bigint"?e.voidBigIntReplacement?s:e.onBigInt?e.onBigInt(u):t==="number"&&jt(u,{range:{min:BigInt(Number.At),max:BigInt(Number.K)}})?Number(u):u.toString():et(u)?e.voidTypedArrayReplacement?s:e.onTypedArray?e.onTypedArray(u):Array.from(u):yn(u)?e.voidSetReplacement?s:e.onSet?e.onSet(u):Array.from(u):gn(u)?e.voidMapReplacement?s:e.onMap?e.onMap(u):Array.from(u.entries()):K(u)?e.voidRegExpReplacement?s:e.onRegExp?e.onRegExp(u):u.toString():M(u)?e.voidDateReplacement?s:e.onDate?e.onDate(u):e.formatDate?e.formatDate(u):u.toISOString():_r(u)?e.onError?e.onError(u):{name:u.name,message:u.message,stack:u.stack}:Or(u)?e.onURLSearchParams?e.onURLSearchParams(u):u.toString():s}}function Ys(e){let t=e.trim().replace(/^\$/,"");if(!t)return[];let n=[],r=/\.\.\[\s*(?:'((?:\\.|[^'])*)'|"((?:\\.|[^"])*)"|(\*))\s*\]|\.\.([^\.\[]+)|\.([\w$-]+|\*)|\[\s*(?:'((?:\\.|[^'])*)'|"((?:\\.|[^"])*)"|(\*)|(-?\d*(?::-?\d*){0,2}))\s*\]/g,o,i=0;for(;(o=r.exec(t))!==null;){if(o.index!==i)return null;i=r.lastIndex;let[,a,s,l,c,u,f,p,m,d]=o,y=a??s,b=f??p;if(y!==void 0)n.push({type:"rec",key:Io(y)});else if(l!==void 0)n.push({type:"rec",key:ge});else if(c!==void 0)n.push({type:"rec",key:c});else if(u!==void 0)n.push(u===ge?{type:"wildcard"}:{type:"prop",key:u});else if(b!==void 0)n.push({type:"prop",key:Io(b)});else if(m!==void 0)n.push({type:"wildcard"});else if(d!==void 0)if(d.includes(":")){let[g,w,A]=d.split(":");n.push({type:"slice",start:J(g)??void 0,end:J(w)??void 0,step:J(A)??1})}else{let g=J(d);if(g===null)return null;n.push({type:"idx",idx:g})}}return i===t.length?n:null}function To(e,t,n,r=new Set){if(e==null||!So(t.key)||typeof e!="object"||r.has(e))return;r.add(e);let o=Array.isArray(e);if(!o&&!C(e))return;t.key===ge?Oo(e,{type:"wildcard"},n):!o&&Object.prototype.hasOwnProperty.call(e,t.key)&&n.push(e[t.key]);let i=o?e:Object.values(e);for(let a=0;a<i.length;a++)To(i[a],t,n,r)}function Oo(e,t,n){if(e!=null)switch(t.type){case"prop":C(e)&&So(t.key)&&Object.prototype.hasOwnProperty.call(e,t.key)&&n.push(e[t.key]);break;case"idx":{if(!Array.isArray(e))break;let r=t.idx<0?e.length+t.idx:t.idx;r>=0&&r<e.length&&n.push(e[r]);break}case"slice":{if(!Array.isArray(e)||t.step===0)break;let r=t.step??1,o=t.start??(r>0?0:e.length-1),i=On(e,{step:r,offsetStart:o,offsetEnd:t.end,nullOnOob:!0});if(i)for(let a=0;a<i.length;a++)n.push(i[a]);break}case"wildcard":{let r=Array.isArray(e)?e:C(e)?Object.values(e):null;if(r)for(let o=0;o<r.length;o++)n.push(r[o]);break}case"rec":To(e,t,n);break}}function _o(e,t){if(e==null||Do(t))return null;let n=e;if(typeof e=="string"){let a=e.trim();if(a==="")return null;let s=he(a,{allowPrimitives:!0,fallback:wo});if(s===wo)throw new k(`Invalid JSON string encountered in jsonPathMatch: "${e}"`);n=s}let r=Ys(t);if(r===null)return null;let o=[n];for(let a=0;a<r.length;a++){if(o.length===0)return null;let s=[];for(let l=0;l<o.length;l++)Oo(o[l],r[a],s);o=s}if(o.length===0||o[0]==null)return null;let i=o[0];if(C(i)||Array.isArray(i))try{return JSON.stringify(i,be({handleCircular:!0}))}catch{return null}return String(i)}var wo,ge,Io,So,xe=O(()=>{"use strict";ln();ut();Ot();Lt();$();it();wo=Symbol("invalid");ge="*",Io=e=>e.replace(/\\(.)/g,(t,n)=>Zr[n]??n),So=e=>e!==void 0&&e!=="__proto__"&&e!=="constructor"&&e!=="prototype"});function Zs(e){return!C(e)||hn(e)?!1:ArrayBuffer.isView(e)?re(e)||Rr(e)||Dr(e):bn(e)||xn(e)}function Co(e,t){if(e==null)return!1;try{if(Zs(e))return!0;if(t?.strict)return!1;if(typeof e=="string")return!0;if(ArrayBuffer.isView(e))return!hn(e);if(Array.isArray(e))return v(e,Ro)}catch{return!1}return!1}function Nn(e,t){if(e==null)return null;try{if(re(e))return e;if(hn(e))return null;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(bn(e)||xn(e))return new Uint8Array(e);if(t?.strict)return null;if(typeof e=="string")return bt.encode(e);if(Array.isArray(e)&&v(e,Ro))return Uint8Array.from(e)}catch{return null}return null}var Hs,Ro,Ae=O(()=>{"use strict";ut();Ot();ln();it();Hs={range:"UInt8"},Ro=e=>nt(e,Hs)});function Do(e){let t=L(e);return typeof t=="string"?t.trim().length===0:!1}function No(e,t="both"){return t==="start"?e.trimStart():t==="end"?e.trimEnd():e.trim()}function rt(e,t=null,n={}){let{mode:r="both",returnStringOnNull:o=!1,maxScanStart:i=1,maxScanEnd:a=1,maxMatchesStart:s=1,maxMatchesEnd:l=1,trimFirst:c=!1,stringOptions:u}=n;if(e==null)return o?"":null;let f=X=>o||X.length>0?X:null;if(t==null)return f(No(e,r));let p=c?No(e,r):e,m=p.length;if(m===0)return o?"":null;let d=K(t);if(!d&&typeof t!="string"||typeof t=="string"&&t.length===0)return f(p);let{literal:y=!1,caseInsensitive:b=!1}=u??{},g=d?t:y?Y(t):`[${Y(t)}]+`,w=d&&t.ignoreCase||b,A=vo(p,g,0,{asciiCaseInsensitive:w},()=>null),T=A.length;if(T===0)return f(p);let I=new Uint8Array(m),F=!1,yt=(X,Yn,mn)=>{if(mn===0)return;let ar=0,Zn=X?0:m,Hn=0,ts=X?0:T-1,ns=X?T:-1,es=X?1:-1;for(let Qn=ts;Qn!==ns;Qn+=es){let kt=A[Qn],te=X?kt.start-Zn:Zn-kt.end;if(te>0&&(ar+=te,Yn!==null&&Yn>=0&&ar>=Yn)||((te>0||y||Hn===0)&&Hn++,mn!==null&&mn>=0&&Hn>mn))break;for(let ne=kt.start;ne<kt.end;ne++)I[ne]=1;F=!0,Zn=X?kt.end:kt.start}};if((r==="both"||r==="start")&&yt(!0,i,s),(r==="both"||r==="end")&&yt(!1,a,l),!F)return f(p);let sr="";for(let X=0;X<m;X++)I[X]===0&&(sr+=p[X]);return f(sr)}function V(e,{depth:t=0,maxDepth:n=50}={}){if(t>n)return"v:circular";if(e===null)return"v:null";if(e===void 0)return"v:undefined";if(e=L(e),M(e))return`d:${e.getTime()}`;if(et(e)){let o=e.toString();return`u:${e.constructor.name}:${o.length}:${o}`}if(Array.isArray(e)){let o=e.length,i=new Array(o),a={depth:t+1,maxDepth:n};for(let s=0;s<o;s++)i[s]=V(e[s],a);return`a:[${i.join(sn)}]`}if(yn(e)){let o=Array.from(e),i=o.length,a=new Array(i),s={depth:t+1,maxDepth:n};for(let l=0;l<i;l++)a[l]=V(o[l],s);return a.sort(),`set:[${a.join(sn)}]`}if(gn(e)){let o=Array.from(e.keys()),i=o.length,a=new Array(i),s={depth:t+1,maxDepth:n};for(let l=0;l<i;l++){let c=o[l],u;try{u=e.get(c)}catch{u="v:error"}a[l]=`${V(c,s)}${on}${V(u,s)}`}return a.sort(),`map:{${a.join(sn)}}`}if(typeof e=="object"&&typeof e.toJSON=="function")try{let o=e.toJSON();if(o!==e)return`j:${V(o,{depth:t+1,maxDepth:n})}`}catch{}if(K(e)){let o=e.toString();return`r:${o.length}:${o}`}if(Ft(e)){let o=Object.keys(e).sort(),i=o.length,a=new Array(i),s={depth:t+1,maxDepth:n};for(let l=0;l<i;l++){let c=o[l],u;try{u=e[c]}catch{u="v:error"}a[l]=`${V(c,s)}${on}${V(u,s)}`}return`o:{${a.join(sn)}}`}if(typeof e=="function"){let o=e.toString();return`f:${o.length}:${o}`}if(typeof e=="string")return`s:${e.length}:${e}`;if(typeof e=="symbol"){let o=e.toString();return`y:${o.length}:${o}`}if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return`${typeof e}:${e}`;let r=String(e);return`${typeof e}:${r.length}:${r}`}function ea(e){if(e==null)return[];let t=String(e);if(!t)return[];let r=t.normalize("NFC").replace(Qs,"$1").match(ta)||[],o=[];for(let i=0;i<r.length;i++){let a=r[i];na.has(a)||o.push(a)}return o}function we(e,t=0){let n=e.codePointAt(t);return n!=null&&n>65535?2:1}function $t(e,t){let n=ea(e),r=n.length;if(r===0)return"";let{format:o}=t??{};if(o==="camel"||o==="pascal"||o==="title"){let i=o==="title"?" ":"",a=new Array(r);for(let s=0;s<r;s++){let l=n[s];if(s===0&&o==="camel")a[s]=l.toLowerCase();else{let c=we(l,0);a[s]=l.slice(0,c).toUpperCase()+l.slice(c).toLowerCase()}}return a.join(i)}if(o==="kebab"||o==="snake"){let i=o==="kebab"?"-":"_",a=new Array(r);for(let s=0;s<r;s++)a[s]=n[s].toLowerCase();return a.join(i)}return n.join(" ")}function jo(e){return typeof e!="string"&&(e=String(e)),bt.encode(e)}function la(e){let t=Nn(e);if(!t)return"";if(Fo&&typeof Uint8Array.prototype.toBase64=="function")return t.toBase64();if(Mn)return cn.from(t).toString("base64");let n="",r=t.length;for(let o=0;o<r;o+=Mo){let i=t.subarray(o,o+Mo);n+=String.fromCharCode.apply(null,i)}return btoa(n)}function ua(e){if(typeof e!="string"&&(e=String(e)),Mn)return cn.from(e,"utf-8").toString("hex");let t=jo(e),n=t.length,r="";for(let o=0;o<n;o++)r+=Bo[t[o]];return r}function ca(e){typeof e!="string"&&(e=String(e));let t=jo(e);return la(t)}function Po(e,t){if(e==null)return null;let n=fa[t];if(!n)throw new Error(`Unsupported encoding: '${t}'. Supported encodings are 'hex' and 'base64'.`);return n(String(e))}function pa(e){typeof e!="string"&&(e=String(e));let t=e.replace(ia,r=>oa[r]),n=t.length%4;return n===0?t:t.padEnd(t.length+(4-n),"=")}function ma(e,t=!0){if(typeof e!="string"&&(e=String(e)),e!==""&&(e.length%4!==0||!sa.test(e)))throw new Error("Invalid base64 encoding format");if(Fo)return Uint8Array.fromBase64(e,{strict:t});if(Mn)return new Uint8Array(cn.from(e,"base64"));let n=atob(e),r=n.length,o=new Uint8Array(r);for(let i=0;i<r;i++)o[i]=n.charCodeAt(i);return o}function da(e){typeof e!="string"&&(e=String(e));let t=e.trim();if(t.length%2!==0||!aa.test(t))throw new Error("Invalid hex string format");if(ra)return Uint8Array.fromHex(t);if(Mn){let r=cn.from(t,"hex");if(r.length!==t.length/2)throw new Error("Invalid hex string format");return new Uint8Array(r)}let n=new Uint8Array(t.length/2);for(let r=0;r<n.length;r++){let o=parseInt(t.substring(r*2,r*2+2),16);if(Number.isNaN(o))throw new Error("Invalid hex string format");n[r]=o}return n}function ya(e,t=!0){if(e==null)return null;try{let n=da(e);return(t?ie:oe).decode(n)}catch(n){if(t)throw n;return null}}function ga(e,t=!0){if(e==null)return null;try{let n=typeof e=="string"?e.trim():String(e).trim(),r=pa(n),o=ma(r,t);return(t?ie:oe).decode(o)}catch(n){if(t)throw n;return null}}function Vo(e,t,n={}){if(e==null)return null;let r=ha[t];if(!r)throw new Error(`Unsupported encoding: '${t}'. Supported encodings are 'hex' and 'base64'.`);let o=typeof n=="boolean"?n:n.strict??!0;return r(String(e),o)}function wa(e,t={}){if(!nt(e,{range:"UInt16"}))return!1;let{type:n="all"}=t;switch(n){case"high":return e>=le&&e<=zr;case"low":return e>=Yr&&e<=ue;case"all":return e>=le&&e<=ue;default:return!1}}function ko(e){let t=e.codePointAt(0),n=t<=Wr||t===Kr,r=e.length===1&&wa(t);if(n||r){let o=ce[t];if(o)return o;let i=t.toString(16);return n?`\\x${i.padStart(2,"0")}`:`\\u${i.padStart(4,"0")}`}return"\\"+e}function Y(e,t){let n=L(e);if(n==null)return"";let r=K(n)?n.source:typeof n=="string"?n:String(n);return(t?.mode??"tc39")==="tc39"?typeof RegExp.escape=="function"&&!ba.test(r)?RegExp.escape(r):r.replace(xa,ko):r.replace(Aa,ko)}function Rt(e,t,n){if(e==null||t==null)return null;let r=typeof e=="string"?e:String(e),o=n?.global??!1;try{let i=K(t),a=i?t.source:typeof t=="string"?t:String(t),s=i?t.flags.replace(/y/g,""):"";if(o?s.includes("g")||(s+="g"):s=s.replace(/g/g,""),n?.asciiCaseInsensitive!==void 0&&(s=n.asciiCaseInsensitive?s.includes("i")?s:s+"i":s.replace(/i/g,"")),(a.includes("\\p{")||a.includes("\\P{"))&&!s.includes("u")&&!s.includes("v"))try{let c=new RegExp(a,s+"u");return c.lastIndex=0,{reg:c,input:r}}catch{try{let c=new RegExp(a,s+"v");return c.lastIndex=0,{reg:c,input:r}}catch{}}let l=new RegExp(a,s);return l.lastIndex=0,{reg:l,input:r}}catch{return null}}function Uo(e){let t=Object.create(null);e.index!==void 0&&Object.defineProperty(t,"_index",{value:String(e.index),writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"_length",{value:e.length,writable:!0,enumerable:!1,configurable:!0});for(let n=0;n<e.length;n++)t[String(n)]=e[n]!==void 0?e[n]:null;if(e.groups)for(let n in e.groups){let r=e.groups[n];t[n]=r!==void 0?r:null}return t}function Ee(e,t){if(typeof t=="string")return t in e?e[t]:null;let n=Number(t);if(Number.isNaN(n))return null;let r=Math.trunc(n);if(r>=0)return e[String(r)]??null;let i=(e.Dt??0)+r;return i>=1?e[String(i)]??null:null}function vo(e,t,n,r,o){let{literal:i=!1,mode:a,asciiCaseInsensitive:s=!1}=r??{},l=i?Y(t,{mode:a}):t,u=Rt(e,l,{global:!0,asciiCaseInsensitive:s})?.reg??null;if(!u)return[];let f=[];u.lastIndex=0;let p;for(;(p=u.exec(e))!==null;){let m=p.index,d=u.lastIndex,y=o(p,m,d);if(f.push({start:m,end:d,patternIndex:n,payload:y}),m===d){if(m===e.length)break;u.lastIndex=m+we(e,m)}}return f}function $o(e){if(e.length<=1)return e;e.sort((o,i)=>{if(o.start!==i.start)return o.start-i.start;let a=o.patternIndex??o.i??0,s=i.patternIndex??i.i??0;return a-s});let t=[],n=0,r=e.length;for(let o=0;o<r;o++){let i=e[o];i.start>=n&&(t.push(i),n=i.end)}return t}function qo(e,t,n,r,o){let{overlapping:i=!1,leftmost:a,...s}=n??{},l=a??!0;if(i&&a)throw new k("Cannot specify both 'overlapping' and 'leftmost' as true.");if(e==null||t==null)return null;let c=_t(t),u=c.length;if(u===0)return[];if(i){let m=new Array(u);for(let d=0;d<u;d++)m[d]=r(c[d]);return m}let f=[];for(let m=0;m<u;m++){let d=kn(e,c[m],{...s,global:!1});if(d&&d[0]&&d[0].St!=null){let y=Number(d[0].St),b=d[0][0]?.length??0;f.push({i:m,start:y,end:y+b,payload:o(d[0],y)})}}let p=new Array(u).fill(null);if(f.length===0)return p;if(l){let m=$o(f);for(let d=0;d<m.length;d++){let y=m[d];p[y.i]=y.payload}}else{let m=[];f.sort((b,g)=>b.i-g.i);let d=f.length;for(let b=0;b<d;b++){let g=f[b],w=!1,A=m.length;for(let T=0;T<A;T++){let I=m[T],F=!1;if(g.start===g.end&&I.start===I.end?F=g.start===I.start:I.start===I.end?F=I.start>=g.start&&I.start<g.end:g.start===g.end?F=g.start>=I.start&&g.start<I.end:F=g.start<I.end&&g.end>I.start,F){w=!0;break}}w||m.push(g)}let y=m.length;for(let b=0;b<y;b++){let g=m[b];p[g.i]=g.payload}}return p}function kn(e,t,n){let r=Rt(e,t,n);if(!r)return null;if(!n?.global){let a=r.input.match(r.reg);return a?[Uo(a)]:null}let o=Array.from(r.input.matchAll(r.reg));if(o.length===0)return null;let i=new Array(o.length);for(let a=0;a<o.length;a++)i[a]=Uo(o[a]);return i}function Ie(e,t,n){let r=kn(e,t,n);return r?Ee(r[0],n?.groupIndex??1):null}function Go(e,t,n){let r=kn(e,t,{...n,global:!0});if(!r)return null;let o=n?.groupIndex??0,i=new Array(r.length);for(let a=0;a<r.length;a++)i[a]=Ee(r[a],o);return i}function Xo(e,t,n){return kn(e,t,n)?.[0]??null}function Jo(e,t,n){let r=n?.groupIndex??0;return qo(e,t,n,o=>Ie(e,o,{...n,groupIndex:r}),o=>Ee(o,r))}function Se(e,t){return K(e)?new RegExp(Y(e,{mode:t}),e.flags):Y(e,{mode:t})}function vt(e,t,n){if(e==null||t==null)return null;let{literal:r=!1,mode:o,...i}=n??{},a=r?Se(t,o):t,s=Rt(e,a,{...i,global:!1});if(!s)return null;let l=s.input.match(s.reg);return!l||l.index==null?null:bt.encode(s.input.slice(0,l.index)).length}function Wo(e,t,n){if(n?.literal){if(e==null||t==null)return null;let r=_t(t),o=new Array(r.length);for(let i=0;i<r.length;i++)o[i]=vt(e,r[i],n);return o}return qo(e,t,n,r=>vt(e,r,n),(r,o)=>bt.encode(e.slice(0,o)).length)}function Ko(e,t,n){if(e==null||t==null)return null;let{literal:r=!0,inclusive:o=!1,limit:i,exact:a=!1,strict:s=!1,mode:l,...c}=n??{},u=r?Se(t,l):t,f=Rt(e,u,{...c,global:!0});if(!f)return null;let{reg:p}=f;p.lastIndex=0;let m=[],d=0,y=0,b=i!=null&&i>=0?i:1/0,g;for(;y<b&&(g=p.exec(e))!==null;){let A=g.index,T=p.lastIndex;if(A===T){if(A===e.length||A>0&&A>=d&&(m.push(e.slice(d,A)),y++,d=A,y>=b))break;p.lastIndex=A+we(e,A);continue}m.push(e.slice(d,o?T:A)),d=T,y++}if(m.push(e.slice(d)),i==null||i<0)return m;let w=i+1;if(s&&m.length<w)throw new k(`split exact error: expected string to split into at least ${w} parts, but got ${m.length}`);if(a)for(;m.length<w;)m.push(null);return m}function zo(e,t,n,r,o,i){return e.includes("$")?e.replace(/\$\$|\$([$'`&]|\d{1,2}|<[^>]+>)/g,(a,s)=>{if(a==="$$"||s==="$")return"$";if(!s)return a;if(s==="&")return t;if(s==="`")return r.slice(0,n);if(s==="'")return r.slice(n+t.length);if(s.startsWith("<"))return i?i[s.slice(1,-1)]??"":a;let l=Number(s);if(l>0&&l<=o.length)return o[l-1]??"";if(s.length===2){let c=Number(s[0]);if(c>0&&c<=o.length)return(o[c-1]??"")+s[1]}return a}):e}function Te(e,t,n,r){if(e==null||t==null||n==null)return null;let o=typeof e=="string"?e:String(e),{literal:i=!1,n:a,mode:s,...l}=r??{},c=a??(l?.global?1/0:1),u=_(c,{allowNonFiniteNumbers:!0,allowNaN:!1})?Math.trunc(c):1;if(u===0)return o;let f=i?Se(t,s):t,p=Rt(o,f,{...l,global:l?.global??u!==1});if(!p)return o;let{reg:m}=p,d=typeof n=="function";if(u===1||u<0||u===1/0){if(i&&!d){let g=String(n);return o.replace(m,()=>g)}return o.replace(m,n)}let y=0,b=d?"":String(n);return o.replace(m,(...g)=>{if(y++>=u)return g[0];if(d)return String(n(...g));if(i)return b;let w=g.length,A=typeof g[w-1]=="object"&&g[w-1]!==null,T=A?g[w-1]:void 0,I=A?g[w-3]:g[w-2],F=g.slice(1,A?w-3:w-2);return zo(b,g[0],I,o,F,T)})}function Yo(e,t,n,r){if(e==null||t==null)return null;let o=typeof e=="string"?e:String(e),i=Ft(t);if(!i&&!Array.isArray(t))return o;let a=i?Object.keys(t):t,s=a.length;if(s===0)return o;let l=null,c=null;if(i)l=Object.values(t);else if(Array.isArray(n))if(n.length===1&&s>1)c=n[0];else{if(n.length!==s)throw new k(`replaceMany length mismatch: expected ${s} replacement strings, got ${n.length}`);l=n}else if(n!=null)c=n;else return o;let u=[];for(let y=0;y<s;y++){let b=a[y],g=l?l[y]:c;if(b==null||g==null)continue;let w=vo(o,b,y,r,(A,T)=>{let I=Array.prototype.slice.call(A,1);if(typeof g=="function"){let yt=[A[0],...I,T,o];return A.groups!==void 0&&yt.push(A.groups),String(g(...yt))}let F=String(g);return r?.literal?F:zo(F,A[0],T,o,I,A.groups)});for(let A=0;A<w.length;A++)u.push(w[A])}if(u.length===0)return o;let f=$o(u),p="",m=0,d=f.length;for(let y=0;y<d;y++){let b=f[y];p+=o.slice(m,b.start)+b.payload,m=b.end}return p+=o.slice(m),p}var Qs,ta,na,cn,Mn,ra,Fo,Mo,Bo,oa,ia,sa,aa,Sl,fa,ha,ba,Lo,xa,Aa,Lt=O(()=>{"use strict";ut();ln();xe();Ae();Ot();it();$();Qs=/(\p{L})['’]+(?=\p{L})/gu,ta=new RegExp(["[\\p{Lu}\\p{M}]+s(?![\\p{Ll}\\p{M}])","[\\p{Lu}\\p{M}]+(?=[\\p{Lu}\\p{M}][\\p{Ll}\\p{M}])","[\\p{Lu}\\p{M}]+[\\p{Ll}\\p{M}]*","[\\p{Ll}\\p{M}]+","\\p{N}+","[\\p{L}\\p{M}]+"].join("|"),"gu"),na=new Set(["__proto__","proto","constructor","prototype"]);cn=typeof globalThis<"u"?globalThis.Buffer:void 0,Mn=typeof cn<"u",ra=typeof Uint8Array<"u"&&typeof Uint8Array.fromHex=="function",Fo=typeof Uint8Array<"u"&&typeof Uint8Array.fromBase64=="function",Mo=8192,Bo=new Array(256);for(let e=0;e<256;e++)Bo[e]=e.toString(16).padStart(2,"0");oa={"-":"+",_:"/"},ia=/[-_]/g,sa=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,aa=/^[0-9a-fA-F]*$/,Sl=be({handleCircular:!0});fa={hex:ua,base64:ca};ha={hex:ya,base64:ga};ba=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Lo="\\x00-\\x1F\\x7F\\u{D800}-\\u{DFFF}",xa=new RegExp(`[${Lo}\\\\^$*+?.()|[\\]{}/#,=<>&!%:;@~'"\`-]`,"gu"),Aa=new RegExp(`[${Lo}]|[\\x20-\\x2F\\x3A-\\x40\\x5B-\\x5E\\x5F\\x60\\x7B-\\x7E]`,"gu")});function Sa(e){let t=Zo.get(e);return t||(t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}),Zo.set(e,t)),t}function Ta(e,t){let n=`${e}_${t}`,r=Ho.get(n);return r||(r=new Intl.DateTimeFormat(e,{timeZoneName:"short",timeZone:t}),Ho.set(n,r)),r}function Oa(e){let t=Qo.get(e);if(t===void 0){try{Intl.DateTimeFormat(void 0,{timeZone:e}),t=!0}catch{t=!1}Qo.set(e,t)}return t}function Fn(e){let t=!e||e==="local"?Intl.DateTimeFormat().resolvedOptions().timeZone:e;return Oa(t)?t:"UTC"}function q(e,t=0,n=1,r=0,o=0,i=0,a=0){let s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(r,o,i,a),s}function Bn(e,t){let n=Fn(t);if(n.toUpperCase()==="UTC")return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),ms:e.getUTCMilliseconds(),dayOfWeek:e.getUTCDay(),timeZone:"UTC"};let o=Sa(n).formatToParts(e),i={year:"0",month:"0",day:"0",hour:"0",minute:"0",second:"0",fractionalSecond:"0"};for(let p=0,m=o.length;p<m;p++){let d=o[p];d.type in i&&(i[d.type]=d.value)}let a=parseInt(i.year,10),s=parseInt(i.month,10),l=parseInt(i.day,10),c=parseInt(i.hour,10);c===24&&(c=0);let u=Math.round(parseFloat("0."+i.fractionalSecond)*1e3)||0,f=q(a,s-1,l).getUTCDay();return{year:a,month:s,day:l,hour:c,minute:parseInt(i.minute,10),second:parseInt(i.second,10),ms:u,dayOfWeek:f,timeZone:n}}function fn(e,t){if(t.toUpperCase()==="UTC")return 0;let n=Bn(e,t),r=q(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.ms).getTime();return Math.round((r-e.getTime())/ot)}function P(e,t){let n=L(e);if(n==null)return null;let r=null;if(M(n))r=n;else if(typeof n=="number"||typeof n=="bigint")r=new Date(_a(n));else if(typeof n=="string"){let o=n.trim();if(o.length===0)return null;r=new Date(o)}return!r||!M(r)?null:t?.dateOnly?q(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()):r}function jn(e){let t=L(e);if(t==null)return null;let n=null;if(typeof t=="string"){let o=t.trim();if(Ea.test(o)){let i=Ia.test(o);n=P(`1970-01-01T${o}${i?"":"Z"}`)}}let r=n??P(t);return r?_e(r,{format:"%H:%M:%S.%ms"}):null}function ni(e,t="ms"){let n=e.getTime();switch(t){case"s":return Math.floor(n/tt);case"ms":return n;case"us":return BigInt(n)*se;case"ns":return BigInt(n)*ae}}function _a(e){if(typeof e=="bigint"){let n=e<0n?-e:e;return n<=30000000000n?Number(e)*tt:n<=100000000000000n?Number(e):n<=100000000000000000n?Number(e/se):Number(e/ae)}let t=Math.abs(e);return t<=3e10?e*tt:t<=1e14?e:t<=1e17?Math.floor(e/en):Math.floor(e/rn)}function ei(e){if(!M(e))return null;let t=q(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()).getTime(),n=q(e.getUTCFullYear(),0,1).getTime();return Math.floor((t-n)/xt)+1}function ti(e,t,n,r="week"){let o=q(e,t-1,n);if(o.setUTCDate(o.getUTCDate()+4-(o.getUTCDay()||7)),r==="year")return o.getUTCFullYear();let i=ei(o);return i!=null?Math.floor((i-1)/7)+1:null}function oi(e){return e.replace(/%[FTRDh]/g,t=>Ra[t]||t)}function _e(e,{format:t,locale:n,timeZone:r="UTC"}){if(!M(e)||typeof t!="string")return"";let o=Fn(r),i=n&&n.trim()||Intl.DateTimeFormat().resolvedOptions().locale||"en-US",a=oi(t),s=null,l=()=>s??(s=Bn(e,o));return a.replace(ri,(c,u)=>{if(u==="%")return"%";let f=Oe[u];return f?f.c(e,i,o,l()):c})}function Ca(e){let t=e.replace(":",""),n=t[0]==="+"?1:-1,r=parseInt(t.slice(1,3),10)||0,o=parseInt(t.slice(3,5),10)||0;return n*(r*60+o)}function ii(e,{format:t,strict:n=!0,defaultTimeZone:r="UTC"}){if(typeof e!="string"||typeof t!="string")return null;let o=oi(t),i=[],a=0,s="";o.replace(ri,(m,d,y)=>{if(s+=Y(o.slice(a,y)),a=y+m.length,d==="%")return s+="%",m;let b=Oe[d];return b?.g?(i.push(b),s+=`(${b.g})`):s+=Y(m),m}),s+=Y(o.slice(a));let l=e.match(new RegExp(`^\\s*${s}\\s*$`));if(!l)return n?null:P(e);let c={year:1970,month:1,day:1,hour:0,minute:0,second:0,ms:0,offset:null},u=null,f=!1;for(let m=0,d=i.length;m<d;m++){let y=l[m+1],b=i[m],g=b.I?b.I(y):parseInt(y,10);b.u==="j"&&(f=!0),b.x==="ampm"?u=g:b.x==="offset"?c.offset=g:b.x&&(c[b.x]=g)}if(u==="PM"&&c.hour<12&&(c.hour+=12),u==="AM"&&c.hour===12&&(c.hour=0),f){if(c.day<1)return null;let m=q(c.year,0,c.day);if(m.getUTCFullYear()!==c.year)return null;c.month=m.getUTCMonth()+1,c.day=m.getUTCDate()}let p=q(c.year,c.month-1,c.day,c.hour,c.minute,c.second,c.ms);if(!M(p)||p.getUTCFullYear()!==c.year||p.getUTCMonth()+1!==c.month||p.getUTCDate()!==c.day||p.getUTCHours()!==c.hour||p.getUTCMinutes()!==c.minute||p.getUTCSeconds()!==c.second||p.getUTCMilliseconds()!==c.ms)return null;if(c.offset)p=new Date(p.getTime()-Ca(c.offset)*ot);else if(r.toUpperCase()!=="UTC"){let m=Fn(r);p=new Date(p.getTime()-fn(p,m)*ot)}return M(p)?p:null}function si(e,t=[]){let n=new Set;if(!e)return n;let r=t.length>0;for(let o of e){let i=P(o,{dateOnly:!0});!i||r&&t.includes(i.getUTCDay())||n.add(i.getTime())}return n}function Un(e,t,n){return t.length>0&&t.includes(e.getUTCDay())||n.has(e.getTime())}function ai(e,t,{excludeWeekdays:n=[],holidays:r=[],roll:o}={}){if(!nt(t))throw new z(`The offset parameter 'n' must be a whole integer. Received: ${t}`);let i=si(r,n);if(n.length===0&&i.size===0&&!o)return t;if(7-n.length<=0)throw new z("All weekdays are excluded; cannot offset.");let a=q(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),s=new Date(a.getTime());if(o&&Un(s,n,i)){if(o==="raise")throw new z("Start date falls on an excluded day or holiday.");let l=o==="forward"?1:-1;for(;Un(s,n,i);)s.setUTCDate(s.getUTCDate()+l)}if(t!==0){let l=t>0?1:-1,c=Math.abs(t),u=0;for(;u<c;)s.setUTCDate(s.getUTCDate()+l),Un(s,n,i)||u++}return Math.round((s.getTime()-a.getTime())/xt)}function li(e,t={}){if(!M(e))return null;let n=t.excludeWeekdays??[0,6],r=si(t.holidays,n),o=q(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return!Un(o,n,r)}function De(e,t,n){let r=Fn(t),o=n?.type??"total",i;if(o==="total")i=fn(e,r);else{let p=Bn(e,r).year,m=fn(q(p,0,1),r),d=fn(q(p,6,1),r),y=Math.min(m,d);i=o==="daylightSavingTime"?fn(e,r)-y:y}let a=n?.format??"milliseconds";if(a==="minutes")return i;if(a==="hours")return i/60;if(a==="milliseconds")return i*ot;let s=i>=0?"+":"-",l=Math.abs(i),c=String(Math.floor(l/60)).padStart(2,"0"),u=String(l%60).padStart(2,"0");return a==="iso"?`${s}${c}:${u}`:`${s}${c}${u}`}function qt(e,t,n,r=!1){let o=e??t;return o<0?n+(r?1:0)+o:o}function ui(e,t={}){let n=Bn(e,t?.timeZone??void 0),r=t?.year??n.year,o=qt(t?.month,n.month,12,!0)-1,i=q(r,o+1,0).getUTCDate(),a=qt(t?.day,n.day,i,!0),s=qt(t?.hour,n.hour,24),l=qt(t?.minute,n.minute,60),c=qt(t?.second,n.second,60),u=qt(t?.ms,n.ms,1e3);return q(r,o,a,s,l,c,u)}var Ea,Ia,Zo,Ho,Qo,Oe,Da,ri,Ra,ye=O(()=>{"use strict";Lt();$();ut();Ot();it();Ea=/^\d{2}:\d{2}/,Ia=/(?:Z|[+-]\d{2}(?::?\d{2})?)$/i,Zo=new Map;Ho=new Map;Qo=new Map;Oe={Y:{u:"Y",c:(e,t,n,r)=>{let o=r.year;return o>=0?String(o).padStart(4,"0"):"-"+String(Math.abs(o)).padStart(4,"0")},g:"[+-]?\\d{4,}",x:"year"},y:{u:"y",c:(e,t,n,r)=>String(Math.abs(r.year)%100).padStart(2,"0"),g:"\\d{2}",x:"year",I:e=>{let t=parseInt(e,10);return t+(t>=69?1900:2e3)}},m:{u:"m",c:(e,t,n,r)=>String(r.month).padStart(2,"0"),g:"\\d{2}",x:"month"},d:{u:"d",c:(e,t,n,r)=>String(r.day).padStart(2,"0"),g:"\\d{2}",x:"day"},e:{u:"e",c:(e,t,n,r)=>String(r.day).padStart(2," "),g:"\\s?\\d{1,2}",x:"day"},H:{u:"H",c:(e,t,n,r)=>String(r.hour).padStart(2,"0"),g:"\\d{2}",x:"hour"},I:{u:"I",c:(e,t,n,r)=>String(r.hour%12||12).padStart(2,"0"),g:"\\d{2}",x:"hour"},p:{u:"p",c:(e,t,n,r)=>r.hour>=12?"PM":"AM",g:"AM|PM|am|pm",x:"ampm",I:e=>e.toUpperCase()},M:{u:"M",c:(e,t,n,r)=>String(r.minute).padStart(2,"0"),g:"\\d{2}",x:"minute"},S:{u:"S",c:(e,t,n,r)=>String(r.second).padStart(2,"0"),g:"\\d{2}",x:"second"},A:{u:"A",c:(e,t,n)=>e.toLocaleDateString(t,{weekday:"long",timeZone:n})},a:{u:"a",c:(e,t,n)=>e.toLocaleDateString(t,{weekday:"short",timeZone:n})},B:{u:"B",c:(e,t,n)=>e.toLocaleDateString(t,{month:"long",timeZone:n})},b:{u:"b",c:(e,t,n)=>e.toLocaleDateString(t,{month:"short",timeZone:n})},j:{u:"j",c:(e,t,n,r)=>String(ei(q(r.year,r.month-1,r.day))??1).padStart(3,"0"),g:"\\d{3}",x:"day",I:e=>parseInt(e,10)},u:{u:"u",c:(e,t,n,r)=>String(r.dayOfWeek||7)},w:{u:"w",c:(e,t,n,r)=>String(r.dayOfWeek)},V:{u:"V",c:(e,t,n,r)=>String(ti(r.year,r.month,r.day,"week")??1).padStart(2,"0"),g:"\\d{2}",I:e=>parseInt(e,10)},G:{u:"G",c:(e,t,n,r)=>String(ti(r.year,r.month,r.day,"year")??r.year).padStart(4,"0"),g:"[+-]?\\d{4,}",I:e=>parseInt(e,10)},Z:{u:"Z",c:(e,t,n)=>{if(n.toUpperCase()==="UTC")return"UTC";let r=Ta(t,n).formatToParts(e);for(let o=0,i=r.length;o<i;o++)if(r[o].type==="timeZoneName")return r[o].value;return"UTC"}},z:{u:"z",c:(e,t,n)=>De(e,n,{format:"basic"}),g:"[+-]\\d{2}(?::?\\d{2})?",x:"offset",I:e=>e.replace(":","")},ms:{u:"ms",c:(e,t,n,r)=>String(r.ms).padStart(3,"0"),g:"\\d{1,3}",x:"ms",I:e=>parseInt(e.padEnd(3,"0").slice(0,3),10)},f:{u:"f",c:(e,t,n,r)=>String(r.ms).padStart(3,"0").padEnd(6,"0"),g:"\\d{1,9}",x:"ms",I:e=>parseInt(e.padEnd(6,"0").slice(0,3),10)}},Da=Object.keys(Oe).concat("%").sort((e,t)=>t.length-e.length),ri=new RegExp("%("+Da.join("|")+")","g"),Ra={"%F":"%Y-%m-%d","%T":"%H:%M:%S","%R":"%H:%M","%D":"%m/%d/%y","%h":"%b"}});var j,wt,Gt,ct,ft,Ct,pt,Nt,Pn=O(()=>{"use strict";j=class e{matches(t){if(t==null)return!1;if(t instanceof e)return!!(this.equals(t)||this.name.startsWith("Decimal")&&t.name.startsWith("Decimal")&&t.precision===void 0&&t.scale===void 0);if(typeof t=="function"){if(t.prototype instanceof e)return this instanceof t;if(t.name==="Struct"||t.name==="StructType")return this.name==="Struct";if(t.name==="ArrayDataType"||t.name==="ArrayType"||t===Array)return this.name==="Array";try{let n=t();if(n instanceof e)return this.constructor===n.constructor}catch{}}return!1}get isNumeric(){return!1}get isInteger(){return!1}get isFloat(){return!1}get isSigned(){return!1}get isUnsigned(){return!1}get isTemporal(){return!1}get isNested(){return!1}get isBoolean(){return!1}get isString(){return!1}get isUtf8(){return!1}get isObject(){return!1}get isNull(){return!1}get isBinary(){return!1}},wt=class extends j{get isNumeric(){return!0}},Gt=class extends wt{get isInteger(){return!0}},ct=class extends Gt{get isSigned(){return!0}},ft=class extends Gt{get isUnsigned(){return!0}},Ct=class extends wt{get isFloat(){return!0}},pt=class extends j{get isTemporal(){return!0}},Nt=class extends j{get isNested(){return!0}}});var Re,ci,Ce,fi,Ne,G,Me,pi,ke,mi,Ue,di,Fe,yi,Be,gi,Xt,hi,Jt,bi,Et,je,Vn,Pe,xi,Ve,Ai,Le,wi,ve,Ei,$e,Ii,mt,Si,qe,Ti,Z,Oi,Wt,_i,pn,Di,Kt=O(()=>{"use strict";Pn();H();Re=class extends ct{constructor(){super(...arguments);x(this,"name","Int8")}coerce(n){return J(n,{range:"Int8"})}equals(n){return n.name==="Int8"}allocate(n){return new Int8Array(n)}},ci=new Re,Ce=class extends ct{constructor(){super(...arguments);x(this,"name","Int16")}coerce(n){return J(n,{range:"Int16"})}equals(n){return n.name==="Int16"}allocate(n){return new Int16Array(n)}},fi=new Ce,Ne=class extends ct{constructor(){super(...arguments);x(this,"name","Int32")}coerce(n){return J(n,{range:"Int32"})}equals(n){return n.name==="Int32"}allocate(n){return new Int32Array(n)}},G=new Ne,Me=class extends ct{constructor(){super(...arguments);x(this,"name","Int64")}coerce(n){return Pt(n,{truncate:!0})}equals(n){return n.name==="Int64"}allocate(n){return new BigInt64Array(n)}},pi=new Me,ke=class extends ft{constructor(){super(...arguments);x(this,"name","UInt8")}coerce(n){return J(n,{range:"UInt8"})}equals(n){return n.name==="UInt8"}allocate(n){return new Uint8Array(n)}},mi=new ke,Ue=class extends ft{constructor(){super(...arguments);x(this,"name","UInt16")}coerce(n){return J(n,{range:"UInt16"})}equals(n){return n.name==="UInt16"}allocate(n){return new Uint16Array(n)}},di=new Ue,Fe=class extends ft{constructor(){super(...arguments);x(this,"name","UInt32")}coerce(n){return J(n,{range:"UInt32"})}equals(n){return n.name==="UInt32"}allocate(n){return new Uint32Array(n)}},yi=new Fe,Be=class extends ft{constructor(){super(...arguments);x(this,"name","UInt64")}coerce(n){return Pt(n,{range:"UInt64"})}equals(n){return n.name==="UInt64"}allocate(n){return new BigUint64Array(n)}},gi=new Be,Xt=class extends Ct{constructor(){super(...arguments);x(this,"name","Float32")}coerce(n){return fe(n,{floatPrecision:"Float32"})}equals(n){return n.name==="Float32"}allocate(n){return new Float32Array(n)}},hi=new Xt,Jt=class extends Ct{constructor(){super(...arguments);x(this,"name","Float64")}coerce(n){return fe(n,{floatPrecision:"Float64"})}equals(n){return n.name==="Float64"}allocate(n){return new Float64Array(n)}},bi=new Jt,Et=class e extends wt{constructor(n,r){super();x(this,"precision",n);x(this,"scale",r);x(this,"name");this.name=n!==void 0&&r!==void 0?`Decimal(${n}, ${r})`:"Decimal"}coerce(n){return Tn(n,{precision:this.precision,scale:this.scale})}equals(n){return n instanceof e&&this.precision===n.precision&&this.scale===n.scale}allocate(n){return new Array(n).fill(null)}},je=class extends j{constructor(){super(...arguments);x(this,"name","Boolean")}get isBoolean(){return!0}coerce(n){return n==null?null:!!n}equals(n){return n.name==="Boolean"}allocate(n){return new Array(n).fill(null)}},Vn=new je,Pe=class extends j{constructor(){super(...arguments);x(this,"name","Utf8")}get isString(){return!0}get isUtf8(){return!0}coerce(n){return n==null?null:String(n)}equals(n){return n.name==="Utf8"}allocate(n){return new Array(n).fill(null)}},xi=new Pe,Ve=class extends j{constructor(){super(...arguments);x(this,"name","Binary")}get isBinary(){return!0}coerce(n){return Nn(n)}equals(n){return n.name==="Binary"}allocate(n){return new Array(n).fill(null)}},Ai=new Ve,Le=class extends j{constructor(){super(...arguments);x(this,"name","Null")}get isNull(){return!0}coerce(n){return null}equals(n){return n.name==="Null"}allocate(n){return new Array(n).fill(null)}},wi=new Le,ve=class extends j{constructor(){super(...arguments);x(this,"name","Object")}get isObject(){return!0}coerce(n){return n===void 0?null:n}equals(n){return n.name==="Object"}allocate(n){return new Array(n).fill(null)}},Ei=new ve,$e=class extends pt{constructor(){super(...arguments);x(this,"name","Date")}coerce(n){return P(n,{dateOnly:!0})}equals(n){return n.name==="Date"}allocate(n){return new Array(n).fill(null)}},Ii=new $e,mt=class e extends pt{constructor(n="ms",r=null){super();x(this,"name","Datetime");x(this,"timeUnit");x(this,"timeZone");this.timeUnit=n,this.timeZone=r}coerce(n){return P(n)}equals(n){return n instanceof e&&n.timeUnit===this.timeUnit&&n.timeZone===this.timeZone}allocate(n){return new Array(n).fill(null)}},Si=new mt,qe=class extends pt{constructor(){super(...arguments);x(this,"name","Time")}coerce(n){return jn(n)}equals(n){return n.name==="Time"}allocate(n){return new Array(n).fill(null)}},Ti=new qe,Z=class e extends pt{constructor(n="ms"){super();x(this,"name","Duration");x(this,"timeUnit");this.timeUnit=n}coerce(n){return B(n)}equals(n){return n instanceof e&&n.timeUnit===this.timeUnit}allocate(n){return new Array(n).fill(null)}},Oi=new Z,Wt=class e extends Nt{constructor(n){super();x(this,"innerType",n);x(this,"name","Array")}coerce(n){if(n==null)return null;let r=R(n)?Array.from(n):[n],o=r.length,i=new Array(o);for(let a=0;a<o;a++)i[a]=this.innerType.coerce(r[a]);return i}equals(n){return n instanceof e&&this.innerType.equals(n.innerType)}allocate(n){return new Array(n).fill(null)}},_i=e=>new Wt(e),pn=class e extends Nt{constructor(n){super();x(this,"fields",n);x(this,"name","Struct")}coerce(n){if(!C(n))return null;let r={},o=Object.keys(this.fields),i=o.length;for(let a=0;a<i;a++){let s=o[a],l=this.fields[s];r[s]=l.coerce(n[s])}return r}equals(n){if(!(n instanceof e))return!1;let r=Object.keys(this.fields),o=Object.keys(n.fields);if(r.length!==o.length)return!1;for(let i=0;i<r.length;i++){let a=r[i];if(!this.fields[a].equals(n.fields[a]))return!1}return!0}allocate(n){return new Array(n).fill(null)}},Di=e=>new pn(e)});var S,Ge=O(()=>{"use strict";Pn();Kt();Kt();Pn();S={Int8:ci,Int16:fi,Int32:G,Int64:pi,UInt8:mi,UInt16:di,UInt32:yi,UInt64:gi,Float32:hi,Float64:bi,Decimal:(e,t)=>new Et(e,t),Boolean:Vn,Utf8:xi,Binary:Ai,Date:Ii,Datetime:Si,Time:Ti,Duration:Oi,Object:Ei,Null:wi,Array:_i,Struct:Di,Numeric:wt,Integer:Gt,SignedInteger:ct,UnsignedInteger:ft,Float:Ct,Temporal:pt,Nested:Nt}});var Ri=O(()=>{"use strict"});function Ma(e){let t=rt(e);if(!t)throw new Error(`Invalid duration string: "${e}"`);let n=t.startsWith("-")||t.startsWith("+"),r=t.startsWith("-")?-1:1,o=n?rt(t.slice(1))??"":t;if(!o||vt(o,Na)!==null)throw new Error(`Cannot parse duration string: "${e}"`);Xe.lastIndex=0;let i,a=0,s=0,l=0,c=0,u=!1,f=!1,p=!1,m=0,d=!1,y=0;for(;(i=Xe.exec(o))!==null;){m++;let b=i[1],g=i[2];g||(d=!0);let w=parseFloat(b)*r,A=g!==void 0?g:"ms",T=A.toLowerCase();if(y=Xe.lastIndex,A==="i"){f=!0,c+=w;continue}let I=Ci[A]??Ci[T];if(I){u=!0,p=!0,I.kind==="month"?a+=w*I.factor:s+=w*I.factor;continue}let F=zt[A]??zt[T];if(F===void 0)throw new Error(`Unknown duration unit: "${g}" in "${e}"`);p=!0,l+=w*F}if(m===0||y!==o.length||d&&m>1)throw new Error(`Cannot parse duration string: "${e}"`);if(f&&p)throw new Error(`Cannot combine index unit 'i' with temporal duration units in "${e}"`);return{months:a,days:s,ms:l,indexUnits:c,isCalendar:u,isIndex:f}}function Ni(e,t={}){let n=t.to??"ms",r=zt[n]??zt[n.toLowerCase()];if(r===void 0)throw new Error(`Unknown target duration unit: "${n}"`);let o=Ma(e);if(o.isCalendar&&o.months!==0)throw new Error(`Cannot convert calendar duration containing months/years to a fixed duration without an anchor date: "${e}"`);if(o.isIndex){let s=o.indexUnits/r;return Object.is(s,-0)?0:s}let a=(o.ms+o.days*xt)/r;return Object.is(a,-0)?0:a}var Ci,zt,Xe,Na,Mi=O(()=>{"use strict";Lt();it();Ci=Object.freeze({M:{kind:"month",factor:1},mo:{kind:"month",factor:1},month:{kind:"month",factor:1},months:{kind:"month",factor:1},q:{kind:"month",factor:3},quarter:{kind:"month",factor:3},quarters:{kind:"month",factor:3},y:{kind:"month",factor:12},yr:{kind:"month",factor:12},year:{kind:"month",factor:12},years:{kind:"month",factor:12},d:{kind:"day",factor:1},day:{kind:"day",factor:1},days:{kind:"day",factor:1},w:{kind:"day",factor:7},week:{kind:"day",factor:7},weeks:{kind:"day",factor:7}}),zt=Object.freeze({ns:En,nanosecond:En,nanoseconds:En,us:Bt,\u00B5s:Bt,\u03BCs:Bt,microsecond:Bt,microseconds:Bt,ms:wn,millisecond:wn,milliseconds:wn,s:tt,sec:tt,second:tt,seconds:tt,m:ot,min:ot,minute:ot,minutes:ot,h:nn,hr:nn,hour:nn,hours:nn,d:xt,day:xt,days:xt,w:An,week:An,weeks:An,i:1}),Xe=/(?:^|\s*,\s*|\s+)((?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?)\s*([a-zA-Zµμ]+)?/gy,Na=/^,|,[\s]*,|,$|(?<![eE])[+-]|[a-zA-Zµμ]\./});var H=O(()=>{"use strict";ut();Ot();ye();ln();Lt();xe();Ri();Ae();Mi()});function ki(e,t,n,r=""){if(!(e in t))throw new Yt(e,`${n} "${e}" does not exist${r}`)}function Ln(e,t="Value cannot be null or undefined"){if(e==null)throw new k(t);return e}var Ui=O(()=>{"use strict";$()});var It,Je,Yt,vn,z,Mt,k,un,$=O(()=>{"use strict";Ui();It=class extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Je=class extends It{},Yt=class extends Je{constructor(t,n){super(n||`Column "${t}" does not exist in the DataFrame.`)}},vn=class extends It{},z=class extends It{},Mt=class extends It{},k=class extends It{},un=class extends It{}});function ka(e,t,n){let r=n.length,o={},i=new Array(r);for(let a=0;a<r;a++){let s=n[a];if(typeof s=="string")ki(s,e,"Partition key"," in the DataFrame."),o[s]=e[s],i[a]=s;else{let l=`__part_${a}`;o[l]=s.evaluate(e,t),i[a]=l}}return Ua(o,i,t)}function Fi(e,t,n){let r=new Array(n);if(n===0)return r;let o=e.D||[],i=ka(t,n,o),a=e.W(e.U,t,n);for(let s of i.values()){let l=s.length,c=new Array(l);for(let u=0;u<l;u++)c[u]=a[s[u]];if(e._){for(let u=0;u<l;u++)r[s[u]]=e._(c,s,u);continue}if(e.S){let u=e.S(c);for(let f=0;f<l;f++)r[s[f]]=u;continue}for(let u=0;u<l;u++)r[s[u]]=a[s[u]]}return e.tt(e.U,r,t)}function Ua(e,t,n){let r=new Map;for(let o=0;o<n;o++){let i=Fa(e,t,o),a=r.get(i);a===void 0&&r.set(i,a=[]),a.push(o)}return r}function Fa(e,t,n){let r=t.length;if(r===1)return V(e[t[0]][n]);let o=new Array(r);for(let i=0;i<r;i++)o[i]=V(e[t[i]][n]);return o.join(on)}var Bi=O(()=>{"use strict";it();H();$()});function Ba(e,t){if(e==null)return null;let n=M(e)?e.getTime():e;return t(n)}function ji(e,t,n){if(e==null||t==null)return null;let r=M(e)?e.getTime():e,o=M(t)?t.getTime():t;return n(r,o)}function at(e,t,n){return e.Ot?Fi(e,t,n):e.evaluate(t,n)}function Zt(e,t,n){return typeof e=="object"&&e!==null&&"_ops"in e?at(e,t||{},n):typeof e=="string"&&t!=null&&e in t?t[e]:e}function Ht(e,t,n,r){return!R(t)||t.length!==r?!1:typeof e=="object"&&e!==null&&"_ops"in e||typeof e=="string"&&n!=null&&e in n}function Pi(e){let t=new Set,n=R(e)?e:[e];for(let r=0;r<n.length;r++)t.add(V(n[r]));return t}function Vi(e,t,n){let r=e.length,o=n&&typeof n=="object"&&"evaluate"in n,i=o?n.evaluate(t,r):null,a=o?null:Pi(n),s=new Array(r);for(let l=0;l<r;l++){let c=e[l];if(c==null){s[l]=null;continue}let u=a??Pi(i[l]);s[l]=u.has(V(c))}return s}function Li(e,t){let n=e.length,r=R(t),o=new Array(n);for(let i=0;i<n;i++){let a=e[i],s=r?t[i]:t;a==null||s==null?o[i]=a==null&&s==null:o[i]=a===s}return o}function We(e,t,n={}){if(t==null)return null;let r=n.dense?"_denseRankCache":"_rankCache",o=e[r];if(!o){let i=e;if(n.ignoreNulls){i=[];let l=e.length;for(let c=0;c<l;c++)e[c]!=null&&i.push(e[c])}n.dense&&(i=Array.from(new Set(i)));let a=an(i);o=new Map;let s=a.length;for(let l=0;l<s;l++){let c=a[l];o.has(c)||o.set(c,l+1)}e[r]=o}return o.get(t)??null}var E,U,dt=O(()=>{"use strict";H();ut();Bi();E=e=>t=>{let n=t.length,r=new Array(n);for(let o=0;o<n;o++)r[o]=Ba(t[o],e);return r},U=(e,t,n)=>{let r=(o,i)=>{let a=o.length,s=e.P(t,i,a),l=new Array(a);if(R(s))for(let c=0;c<a;c++)l[c]=ji(o[c],s[c],n);else for(let c=0;c<a;c++)l[c]=ji(o[c],s,n);return l};return r.C={left:e,right:t},r}});var h,W,St=O(()=>{"use strict";$();dt();h=(e,t)=>{let n=e.constructor,r=e.z||e.f||"",o=new n(r);return Object.assign(o,e),o.p=t?[...e.p,t]:[...e.p],t&&t.C&&(o.C=t.C),o},W=class e{constructor(){x(this,"p",[]);x(this,"O","");x(this,"B");x(this,"V");x(this,"S",null);x(this,"N");x(this,"C");x(this,"R");x(this,"U");x(this,"D",null);x(this,"_");x(this,"F");x(this,"et");x(this,"rt")}tt(t,n,r){let o=this.p,i=t!==void 0?t:o.length,a=n;for(let s=i;s<o.length;s++)a=o[s](a,r);return a}W(t,n,r){let o=this.Tt(n,r),i=this.p,a=t!==void 0?t:i.length;for(let s=0;s<a;s++)o=i[s](o,n);return o}Tt(t,n){let r=this.f;if(r&&r!=="*"&&!r.startsWith("*")&&!(r in t))throw new Yt(r);return(r&&r!=="*"?t[r]:null)||new Array(n).fill(null)}P(t,n,r){return t instanceof e?t.B&&t.p.length===1?t.V:at(t,n,r):t}alias(t){let n=h(this);return n.O=t,n}cast(t){let n=h(this,E(r=>t.coerce(r)));return n.N=t,n}debug(t){return h(this,n=>n)}evaluate(t,n){return this.W(void 0,t,n)}}});var $n,Ke=O(()=>{"use strict";St();dt();$();H();$n=class extends W{L(t,n,r,o){return this.j(function(i,a,s){let l=n,c=!1,u=t?s:0,f=t?i.length-1:s;for(let p=u;p<=f;p++){let m=i[p];m!=null&&(l=r(l,m),c=!0)}return o?o(l,c):l})}o(t){let n=h(this);return n.S=t,n.R=this.p.length,n.U=this.p.length,n}k(t,n){let r=h(this,U(this,t,(o,i)=>[o,i])).o(n);return r.C=void 0,r}get Ot(){return this.D!==null||this._!==void 0||this.S!==null}j(t){let n=h(this);return n.U=this.p.length,n.R=this.p.length,n._=t,n}abs(){return h(this,E(Math.abs))}add(t){return h(this,U(this,t,(n,r)=>n+r))}all(){return this.o(t=>v(t,n=>!!n,{mode:"every"}))}allNull(){return this.o(t=>v(t,"nullish",{mode:"every"}))}and(t){return h(this,(n,r)=>{let o=n.length,i=this.P(t,r,o),a=R(i),s=new Array(o);for(let l=0;l<o;l++){let c=n[l],u=a?i[l]:i;c===!1||u===!1?s[l]=!1:c==null||u==null?s[l]=null:s[l]=!0}return s})}any(){return this.o(t=>v(t,n=>!!n,{mode:"some"}))}anyNull(){return this.o(t=>v(t,"nullish",{mode:"some"}))}arccos(){return h(this,E(t=>t<-1||t>1?null:Math.acos(t)))}arccosh(){return h(this,E(t=>t<1?null:Math.acosh(t)))}arcsin(){return h(this,E(t=>t<-1||t>1?null:Math.asin(t)))}arcsinh(){return h(this,E(Math.asinh))}arctan(){return h(this,E(Math.atan))}arctan2(t){return h(this,U(this,t,Math.atan2))}arctanh(){return h(this,E(t=>t<=-1||t>=1?null:Math.atanh(t)))}argMax(){return this.o(t=>D(t).maxIdx)}argMin(){return this.o(t=>D(t).minIdx)}avg(){return this.o(t=>D(t).mean)}between(t,n,r="both"){let o=r==="both"||r==="left"?this.ge(t):this.gt(t),i=r==="both"||r==="right"?this.le(n):this.lt(n);return o.and(i)}bitwiseAnd(){return this.o(t=>Rn(t,(n,r)=>n&r))}bitwiseOr(){return this.o(t=>Rn(t,(n,r)=>n|r))}bitwiseXor(){return this.o(t=>Rn(t,(n,r)=>n^r))}cbrt(){return h(this,E(Math.cbrt))}ceil(){return h(this,E(Math.ceil))}clip(t=null,n=null){return h(this,E(r=>st(r,{min:t,max:n})))}copysign(t){return h(this,U(this,t,(n,r)=>Math.abs(n)*(r>=0?1:-1)))}corr(t){return this.k(t,n=>me(n)?.correlation??null)}cos(){return h(this,E(Math.cos))}cosh(){return h(this,E(Math.cosh))}cot(){return h(this,E(t=>{if(Number.isNaN(t))return NaN;if(!_(t))return null;let n=Math.tan(t);return n===0?null:1/n}))}count(t={}){return t.includeNulls?this.o(n=>n.length):this.o(n=>D(n).count)}cov(t){return this.k(t,n=>me(n)?.covariance??null)}cumCount(t=!1){return this.L(t,0,n=>n+1)}cumMax(t=!1){return this.L(t,null,(n,r)=>n===null||r>n?r:n)}cumMin(t=!1){return this.L(t,null,(n,r)=>n===null||r<n?r:n)}cumProd(t=!1){return this.L(t,1,(n,r)=>n*r,(n,r)=>r?n:null)}cumSum(t=!1){return this.L(t,0,(n,r)=>n+r)}degrees(){return h(this,E(t=>t*(180/Math.PI)))}denseRank(){return this.rank({dense:!0})}div(t){return h(this,U(this,t,(n,r)=>r===0?null:n/r))}dot(t){return this.k(t,n=>yo(n))}entropy(t={base:Math.E,normalize:!0}){return this.o(n=>Ao(n,t))}eq(t){return h(this,U(this,t,(n,r)=>n===r))}eqMissing(t){return h(this,(n,r)=>{let o=this.P(t,r,n.length);return Li(n,o)})}exp(){return h(this,E(Math.exp))}expm1(){return h(this,E(Math.expm1))}fillNull({value:t=void 0,strategy:n=void 0,limit:r=void 0}={}){return n==="zero"?t=0:n==="one"&&(t=1),h(this,(o,i)=>{let a=o.length,s=Array.from(o);if(t!==void 0){let l=this.P(t,i,a),c=R(l);for(let u=0;u<a;u++)s[u]==null&&(s[u]=c?l[u]:l);return s}if(n==="min"||n==="max"||n==="mean"){let l=D(o)[n];for(let c=0;c<a;c++)s[c]==null&&(s[c]=l);return s}if(n==="forward"||n==="backward"){let l=n==="backward",c=null,u=0;for(let f=0;f<a;f++){let p=l?a-1-f:f,m=s[p];if(m!=null){c=m,u=0;continue}c!==null&&(r===void 0||u<r)&&(s[p]=c,u++)}return s}if(n!==void 0)throw new k(`Unsupported fillNull strategy: "${n}"`);return s})}filter(t){return h(this,(n,r)=>{let o=at(t,r,n.length);return Cn(n,o,{nullify:!0})})}first(){return this.o(t=>t[0]??null)}floor(){return h(this,E(Math.floor))}floordiv(t){return h(this,U(this,t,(n,r)=>r===0?null:Math.floor(n/r)))}ge(t){return h(this,U(this,t,(n,r)=>n>=r))}gt(t){return h(this,U(this,t,(n,r)=>n>r))}hasNulls(){return this.anyNull()}hypot(t){return h(this,U(this,t,Math.hypot))}implode(){return this.o(t=>t)}isClose(t,{absTol:n=1e-8,relTol:r=1e-8,nansEqual:o=!1}={}){return h(this,U(this,t,(i,a)=>{if(_(i)&&_(a)){let s=Math.abs(i-a),l=Math.max(r*Math.max(Math.abs(i),Math.abs(a)),n);return s<=l}return Number.isNaN(i)&&Number.isNaN(a)?o:i===a}))}isDuplicated(){return h(this,t=>{let{frequencies:n}=At(t,{strict:!0}),r=t.length,o=new Array(r);for(let i=0;i<r;i++)o[i]=(n.get(t[i])||0)>1;return o})}isFinite(){return h(this,E(Number.isFinite))}isIn(t){return h(this,(n,r)=>Vi(n,r,t))}isInfinite(){return h(this,E(t=>t===1/0||t===-1/0))}isNan(){return h(this,E(Number.isNaN))}isNDistinct(t,n=!0){return h(this,(r,o)=>{let{values:i}=At(r,{strict:!0}),a=Vt(i,t,n);return this.eq(a).evaluate(o,r.length)})}isNotNan(){return this.isNan().not()}isNotNull(){return this.isNull().not()}isNull(){return this.eqMissing(null)}isUnique(){return this.isDuplicated().not()}kurtosis(t={}){return this.o(n=>xo(n,t))}lag(t=1,n=null){return this.j(function(r,o,i){let a=n;return i-t>=0&&(a=r[i-t]),a})}last(){return this.o(t=>t[t.length-1]??null)}le(t){return h(this,U(this,t,(n,r)=>n<=r))}lead(t=1,n=null){return this.j(function(r,o,i){let a=n;return i+t<r.length&&(a=r[i+t]),a})}log(t=Math.E){return h(this,E(n=>n<=0?null:t===Math.E?Math.log(n):Math.log(n)/Math.log(t)))}log1p(){return h(this,E(t=>t<=-1?null:Math.log1p(t)))}lt(t){return h(this,U(this,t,(n,r)=>n<r))}max(){return this.o(t=>D(t).max)}maxBy(t){return this.k(t,n=>de(n,"maxIdx"))}mean(){return this.avg()}median(){return this.o(t=>Dt(t,.5))}min(){return this.o(t=>D(t).min)}minBy(t){return this.k(t,n=>de(n,"minIdx"))}mod(t){return h(this,U(this,t,(n,r)=>r===0?null:n%r))}mode(){return this.o(t=>Dn(t))}mul(t){return h(this,U(this,t,(n,r)=>n*r))}nanMax(){return this.o(t=>D(t).nanMax)}nanMin(){return this.o(t=>D(t).nanMin)}ne(t){return this.eq(t).not()}negate(){return h(this,E(t=>-t))}neMissing(t){return this.eqMissing(t).not()}not(){return h(this,E(t=>!t))}notIn(t){return this.isIn(t).not()}nullCount(){return this.o(t=>D(t).nullCount)}nUnique(t={}){return this.o(n=>At(n,t).count)}or(t){return h(this,(n,r)=>{let o=n.length,i=this.P(t,r,o),a=R(i),s=new Array(o);for(let l=0;l<o;l++){let c=n[l],u=a?i[l]:i;c===!0||u===!0?s[l]=!0:c==null||u==null?s[l]=null:s[l]=!1}return s})}over(t){let n=h(this),r=Array.isArray(t)?t:[t];return n.D=r,n}pow(t){return h(this,U(this,t,Math.pow))}product(){return this.o(t=>D(t).product)}quantile(t){if(t<0||t>1)throw new z("Quantile q must be between 0 and 1");return this.o(n=>Dt(n,t))}radians(){return h(this,E(t=>t*(Math.PI/180)))}rand(t,{min:n=0,max:r=1,integer:o=!1}={}){return h(this,i=>{let a=i.length,s=new Float64Array(a),l=t!==void 0?so(t):Math.random,c=r-n;for(let u=0;u<a;u++){let f=l();s[u]=o?Math.floor(f*(c+1))+n:f*c+n}return s})}rank(t={}){return this.j(function(n,r,o){return We(n,n[o],t)})}reverse(){return h(this,t=>t.slice().reverse())}rolling(t,n){let r=typeof t=="number"?t:t?.windowSize??NaN;if(!Number.isFinite(r)||r<1)throw new k("rolling: windowSize must be a positive number >= 1");if(!n||typeof n!="function"&&typeof n.evaluate!="function")throw new k("rolling: second argument must be a reducer function or ColumnExpression");let o=Math.floor(r),i=n.f||this.f||"val",a=typeof n=="function"?n:n.S??(s=>{let l=at(n,{[i]:s},s.length);return Array.isArray(l)?l[l.length-1]:l});return this.j(function(s,l,c){let u=Math.max(0,c-o+1),f=c+1;return a(s.slice(u,f))})}rollingMax(t){return this.rolling(t,n=>D(n).max)}rollingMean(t){return this.rolling(t,n=>D(n).mean)}rollingMedian(t){return this.rolling(t,n=>Dt(n,.5))}rollingMin(t){return this.rolling(t,n=>D(n).min)}rollingQuantile(t,n){return this.rolling(n,r=>Dt(r,t))}rollingRank(t){return this.rolling(t,n=>We(n,n[n.length-1],{ignoreNulls:!0}))}rollingStd(t){return this.rolling(t,n=>D(n).std)}rollingSum(t){return this.rolling(t,n=>D(n).sum)}round(t=0){return h(this,E(n=>pe(n,t)))}roundSigFigs(t){return h(this,E(n=>_(n)?Number(n.toPrecision(t)):n))}rowNumber(){let t=this.j(function(n,r,o){return o+1});return t.O="row_number",t}sign(){return h(this,E(Math.sign))}sin(){return h(this,E(Math.sin))}sinh(){return h(this,E(Math.sinh))}skew(t={}){return this.o(n=>bo(n,t))}spearmanCorr(t){return this.k(t,n=>mo(n))}sqrt(){return h(this,E(t=>t<0?null:Math.sqrt(t)))}std(){return this.o(t=>D(t).std)}sub(t){return h(this,U(this,t,(n,r)=>n-r))}sum(){return this.o(t=>D(t).sum)}tan(){return h(this,E(Math.tan))}tanh(){return h(this,E(Math.tanh))}trunc(){return h(this,E(Math.trunc))}variance(){return this.o(t=>D(t).variance)}wAvg(t){return this.k(t,n=>go(n))}xor(t){return h(this,U(this,t,(n,r)=>!!n!=!!r))}}});var ze,qn,Ye=O(()=>{"use strict";St();dt();H();gt();$();ze=class{constructor(t){x(this,"expr",t)}l(t){return h(this.expr,E(n=>R(n)?t(n):null))}ht(t,n){let r=h(this.expr,U(this.expr,t,(o,i)=>R(o)?n(o,i):null));return r.C=void 0,r}agg(t){return h(this.expr,(n,r)=>{let o=n.length,i=new Array(o),a=Object.create(r);for(let s=0;s<o;s++){let l=n[s];if(!R(l)){i[s]=null;continue}let c=l.length;a[Ut]=l;let u=at(t,a,c);i[s]=R(u)?u[0]??null:u}return i})}all(){return this.l(t=>v(t,n=>!!n,{mode:"every"}))}any(){return this.l(t=>v(t,n=>!!n,{mode:"some"}))}argMax(){return this.l(t=>D(t).maxIdx)}argMin(){return this.l(t=>D(t).minIdx)}contains(t){return this.ht(t,(n,r)=>Array.prototype.includes.call(n,r))}containsAll(t){return this.l(n=>v(t,r=>Array.prototype.includes.call(n,r),{mode:"every"}))}containsAny(t){return this.l(n=>v(t,r=>Array.prototype.includes.call(n,r),{mode:"some"}))}countMatches(t,n={}){return this.ht(t,(r,o)=>At(r,n).frequencies.get(o)??0)}filter(t){return h(this.expr,(n,r)=>{let o=n.length,i=new Array(o),a=Object.create(r);for(let s=0;s<o;s++){let l=n[s];if(!R(l)){i[s]=null;continue}let c=l.length;a[Ut]=l;let u=at(t,a,c);i[s]=Cn(l,u)}return i})}explode({emptyAsNull:t=!0,keepNulls:n=!0}={}){return h(this.expr,r=>{let o=r.length,i=0;for(let c=0;c<o;c++){let u=r[c];if(R(u)){i+=u.length||(t?1:0);continue}if(u!=null){i+=1;continue}n&&(i+=1)}let a=new Array(i),s=new Int32Array(i),l=0;for(let c=0;c<o;c++){let u=r[c];if(R(u)){let f=u.length;if(f>0){for(let p=0;p<f;p++)s[l]=c,a[l++]=u[p];continue}t&&(s[l]=c,a[l++]=null);continue}if(u!=null){s[l]=c,a[l++]=u;continue}n&&(s[l]=c,a[l++]=null)}return a.rowMap=s,a})}first(t=!0){return this.get(0,t)}gather(t,n=!0){return this.l(r=>{let o=typeof t=="number"?[t]:t,i=o.length,a=new Array(i);for(let s=0;s<i;s++)a[s]=Vt(r,o[s],n);return a})}gatherEvery(t={}){return this.l(n=>On(n,t))}get(t,n=!0){return this.l(r=>Vt(r,t,n))}join(t=",",n={}){return this.l(r=>_n(r,t,n))}last(t=!0){return this.get(-1,t)}len(){return this.lengths()}lengths(){return this.l(t=>t.length)}max(){return this.l(t=>D(t).max)}mean(){return this.l(t=>D(t).mean)}median(){return this.l(t=>Dt(t,.5))}min(){return this.l(t=>D(t).min)}mode(){return this.l(t=>Dn(t))}nUnique(t={}){return this.l(n=>At(n,t).count)}reverse(){return this.l(t=>t.slice().reverse())}shift(t=1){return this.l(n=>co(n,t))}slice(t,n){return this.l(r=>r.slice(t,n))}splice(t,n,...r){return this.l(o=>{let i=[...o];return i.splice(t,n??i.length,...r),i})}sort(t){return this.l(n=>an(n,t))}std(){return this.l(t=>D(t).std)}sum(){return this.l(t=>D(t).sum)}toStruct({upperBound:t,fields:n}={}){return h(this.expr,r=>{let o=r.length,i=new Array(o),a=0;if(Array.isArray(n))a=n.length;else if(typeof t=="number")a=t;else for(let l=0;l<o;l++){let c=r[l];R(c)&&c.length>a&&(a=c.length)}if(a===0)throw new z("toStruct cannot be evaluated: struct width is 0. Provide an upperBound, non-empty fields names, or non-empty lists.");let s=new Array(a);for(let l=0;l<a;l++)typeof n=="function"?s[l]=n(l):s[l]=(Array.isArray(n)?n[l]:null)??`field_${l}`;for(let l=0;l<o;l++){let c=r[l];if(!R(c)){i[l]=null;continue}let u={};for(let f=0;f<a;f++)u[s[f]]=Vt(c,f,!0);i[l]=u}return i})}unique(t={}){return this.l(n=>At(n,t).values)}variance(){return this.l(t=>D(t).variance)}eval(t){return h(this.expr,(n,r)=>{let o=n.length,i=new Array(o),a=Object.create(r);for(let s=0;s<o;s++){let l=n[s];if(!R(l)){i[s]=null;continue}let c=l.length;if(a[Ut]=l,t.S!=null&&(t.D==null||t.D.length===0)){let f=t.R!==void 0?t.R:t.p.length,p=t.W(f,a,c),m=t.S(Array.from(p));i[s]=t.tt(f,[m],a)}else i[s]=at(t,a,c)}return i})}},qn=class extends W{get arr(){return new ze(this)}}});var Ze,Gn,He=O(()=>{"use strict";St();dt();it();H();Ze=class{constructor(t){x(this,"expr",t)}e(t){return h(this.expr,E(n=>t(String(n))))}T(t,n){return t==null?h(this.expr,r=>new Array(r.length).fill(null)):n()}bt(t,n){return n==null?!1:K(n)?(n.lastIndex=0,n.test(t)):t.includes(n)}concat(t){return h(this.expr,U(this.expr,t,(n,r)=>String(n)+String(r)))}contains(t){return this.T(t,()=>this.e(n=>this.bt(n,t)))}containsAny(t){return this.T(t,()=>{let n=_t(t),r=n.length;return this.e(o=>{for(let i=0;i<r;i++)if(this.bt(o,n[i]))return!0;return!1})})}countMatches(t,n={}){let r=typeof n=="boolean"?n:n?.literal??!1;return this.T(t,()=>this.e(o=>{let i=r?Y(t):t,a=Rt(o,i,{global:!0});if(!a)return 0;let s=a.input.match(a.reg);return s?s.length:0}))}escapeRegex(t={}){return this.e(n=>Y(n,t))}decode(t){return this.e(n=>Vo(n,t.encoding,t))}encode(t){return this.e(n=>Po(n,t.encoding))}decodeUriComponent(){return this.e(t=>{try{return decodeURIComponent(t)}catch{return t}})}encodeUriComponent(){return this.e(t=>{try{return encodeURIComponent(t)}catch{return t}})}endsWith(t){return this.e(n=>n.endsWith(t))}explode(){return this.e(t=>t.split(""))}extract(t,n){return this.T(t,()=>this.e(r=>Ie(r,t,n)))}extractAll(t,n){return this.T(t,()=>this.e(r=>Go(r,t,n)??[]))}extractGroups(t,n={}){return this.T(t,()=>this.e(r=>Xo(r,t,n)))}extractMany(t,n={}){return this.T(t,()=>this.e(r=>Jo(r,t,n)))}find(t,n={}){return this.T(t,()=>this.e(r=>vt(r,t,n)))}findMany(t,n={}){return this.T(t,()=>this.e(r=>Wo(r,t,n)))}head(t=1){return this.slice(0,t)}join(t="",n={}){return h(this.expr,E(r=>{let o=_t(r);return o==null?null:_n(o,t,n)}))}jsonDecode(t={}){return this.e(n=>he(n,t))}jsonPathMatch(t){return this.e(n=>_o(n,t))}len(){return this.lenChars()}lenBytes(){return this.e(t=>bt.encode(t).length)}lenChars(){return this.e(t=>t.length)}lower(){return this.e(t=>t.toLowerCase())}lpad(t,n=" "){return this.e(r=>r.padStart(t,n))}normalize(t){return this.e(n=>n.normalize(t))}padEnd(t,n=" "){return this.rpad(t,n)}padStart(t,n=" "){return this.lpad(t,n)}replace(t,n,r){return this.T(t,()=>this.e(o=>Te(o,t,n,{n:1,...r})??o))}replaceAll(t,n,r){return this.T(t,()=>this.e(o=>Te(o,t,n,{...r,n:-1})??o))}replaceMany(t,n,r){return this.T(t,()=>this.e(o=>Yo(o,t,n,r)??o))}reverse(){return this.e(t=>t.split("").reverse().join(""))}rpad(t,n=" "){return this.e(r=>r.padEnd(t,n))}slice(t,n){return this.e(r=>{let o=t<0?r.length+t:t,i=n!==void 0?o+n:void 0;return r.slice(o,i)})}split(t,n){return this.e(r=>Ko(r,t,n))}startsWith(t){return this.e(n=>n.startsWith(t))}stripChars(t,n){return this.e(r=>rt(r,t,{mode:"both",...n}))}stripCharsEnd(t,n){return this.e(r=>rt(r,t,{mode:"end",...n}))}stripCharsStart(t,n){return this.e(r=>rt(r,t,{mode:"start",...n}))}stripPrefix(t){return this.e(n=>rt(n,t,{mode:"start",maxScanStart:1,maxMatchesStart:1,returnStringOnNull:!0,stringOptions:{literal:!0}}))}stripSuffix(t){return this.e(n=>rt(n,t,{mode:"end",maxScanEnd:1,maxMatchesEnd:1,returnStringOnNull:!0,stringOptions:{literal:!0}}))}tail(t=1){return this.slice(-t)}strptime(t){return this.e(n=>ii(n,t))}toCamelCase(){return this.e(t=>$t(t,{format:"camel"}))}toDate(){return this.e(t=>P(t,{dateOnly:!0}))}toDatetime(){return this.e(P)}toDecimal(t,n){return this.e(r=>Tn(r,{precision:t,scale:n}))}toInteger(){return this.e(t=>J(t))}toKebabCase(){return this.e(t=>$t(t,{format:"kebab"}))}toLowerCase(){return this.lower()}toPascalCase(){return this.e(t=>$t(t,{format:"pascal"}))}toSnakeCase(){return this.e(t=>$t(t,{format:"snake"}))}toTime(){return this.e(jn)}toTitleCase(){return this.e(t=>$t(t,{format:"title"}))}toUpperCase(){return this.upper()}trim(){return this.stripChars()}trimEnd(){return this.stripCharsEnd()}trimStart(){return this.stripCharsStart()}upper(){return this.e(t=>t.toUpperCase())}zfill(t){return this.e(n=>n.padStart(t,"0"))}},Gn=class extends W{get str(){return new Ze(this)}}});function vi(e){return Ln(e,"Column reference cannot be null or undefined."),Xn||(Xn=(Q(),ur($i)).ColumnExpr),Xn.isColExpr(e)?e:new Xn(e)}var Xn,Qe,Jn,tr=O(()=>{"use strict";St();$();Xn=null;Qe=class{constructor(t){x(this,"expr",t);return new Proxy(this,{get(n,r,o){return r in n?Reflect.get(n,r,o):typeof r=="string"?n.field(r):Reflect.get(n,r,o)}})}field(t){let n=h(this.expr,r=>{let o=r.length,i=new Array(o);for(let a=0;a<o;a++){let s=r[a];i[a]=s!=null&&typeof s=="object"?s[t]:null}return i});return n.F=this.expr,n.et=t,n.alias(t)}renameFields(t){return h(this.expr,n=>{let r=n.length,o=new Array(r),i=Object.keys(t),a=i.length;for(let s=0;s<r;s++){let l=n[s];if(l==null||typeof l!="object"){o[s]=null;continue}let c={},u=Object.keys(l),f=u.length;for(let p=0;p<f;p++){let m=u[p];c[m]=l[m]}for(let p=0;p<a;p++){let m=i[p];if(m in c){let d=t[m];c[d]=c[m],delete c[m]}}o[s]=c}return o})}withFields(t){return h(this.expr,(n,r)=>{let o=n.length,i=new Array(o),a=[];if(Array.isArray(t)){let c=t.length;for(let u=0;u<c;u++){let f=t[u],p=vi(f),m=p.O||p.f;if(!m)throw new k("Expressions passed to struct.withFields must have a name/alias.");a.push({name:m,expr:p})}}else if(t&&typeof t=="object"){let c=Object.keys(t),u=c.length;for(let f=0;f<u;f++){let p=c[f],m=vi(t[p]);a.push({name:p,expr:m})}}let s=a.length,l=new Array(s);for(let c=0;c<s;c++)l[c]=a[c].expr.evaluate(r,o);for(let c=0;c<o;c++){let u=n[c];if(u==null||typeof u!="object"){i[c]=null;continue}let f={},p=Object.keys(u),m=p.length;for(let d=0;d<m;d++){let y=p[d];f[y]=u[y]}for(let d=0;d<s;d++)f[a[d].name]=l[d][c];i[c]=f}return i})}unnest(){let t=h(this.expr);return t.rt=!0,t.F=this.expr,t}},Jn=class extends W{get struct(){return new Qe(this)}}});var $i={};lr($i,{ColumnExpr:()=>N,resolveColumnSelectors:()=>Va});function ja(e,t){for(let n of t)for(let r of Object.getOwnPropertyNames(n.prototype))r!=="constructor"&&Object.defineProperty(e.prototype,r,Object.getOwnPropertyDescriptor(n.prototype,r)||Object.create(null))}function Pa(e,t,n,r){if(e instanceof N&&e.z?.length)return e.z;if(!(e instanceof N)&&(!C(e)||!("evaluate"in e)||e.f))return null;let o;if(!(e instanceof N))o=()=>!0;else if(e.f==="*"){let s=new Set(e.xt);o=l=>!s.has(l)}else if(e.Y?.length){let s=e.Y,l=s.length;o=c=>{for(let u=0;u<l;u++)if(s[u].lastIndex=0,s[u].test(c))return!0;return!1}}else if(e.X?.length){if(!r)throw new vn("Cannot resolve DataType column selector without DataFrame schema.");let s=e.X,l=s.length;o=c=>{let u=r[c];if(!u)return!1;for(let f=0;f<l;f++)if(u.matches(s[f]))return!0;return!1}}else return null;let i=[],a=t.length;for(let s=0;s<a;s++){let l=t[s];!n.has(l)&&o(l)&&i.push(l)}return i}function Va(e,t,n,r,o){let i=[],a=n?new Set(n):new Set;for(let s=0;s<e.length;s++){let l=e[s];if(typeof l=="string"){i.push(new N(l));continue}if(C(l)&&l.rt&&l.F){let u=l.F,f=[],p=l.f;if(typeof p=="string"&&r&&r[p]&&r[p].name==="Struct"&&(f=Object.keys(r[p].fields)),f.length===0&&o){let y=Object.keys(o)[0],b=y?o[y].length:0,g=u.evaluate(o,b),w=g.length;for(let A=0;A<w;A++){let T=g[A];if(T!=null&&typeof T=="object"){f=Object.keys(T);break}}}let m=f.length;if(m>0){for(let d=0;d<m;d++){let y=f[d],b=u.struct.field(y);i.push(b)}continue}}let c=Pa(l,t,a,r);if(c!==null)for(let u=0;u<c.length;u++){let f=new N(c[u]);f.p=[...l.p||[]],f.S=l.S,f.U=l.U,f.R=l.R,f.D=l.D,l._&&(f._=l._),l.O&&l.O!=="*"&&(f.O=l.O),i.push(f)}else i.push(l)}return i}var N,Q=O(()=>{"use strict";St();Ke();He();nr();Ye();tr();H();Ge();$();N=class e extends W{constructor(n){super();x(this,"f","");x(this,"z");x(this,"xt",[]);x(this,"wt");x(this,"X");x(this,"Ct");x(this,"Y");if(K(n)){this.Y=[n];return}if(n instanceof j||typeof n=="function"){this.X=[n];return}if(!Array.isArray(n)){this.f=String(n),this.O=this.f;return}if(v(n,a=>a instanceof j||typeof a=="function",{mode:"some"})){this.X=n;return}let r=n.length,o=[],i;for(let a=0;a<r;a++){let s=n[a];K(s)?(i??(i=[])).push(s):o.push(String(s))}i&&(this.Y=i),o.length>0&&(this.z=o)}static isColExpr(n){if(!C(n))return!1;try{return"evaluate"in n&&typeof n.evaluate=="function"}catch{return!1}}static toColExpr(n){return Ln(n,"Column reference cannot be null or undefined."),e.isColExpr(n)?n:new e(n)}};ja(N,[$n,Gn,Wn,qn,Jn])});function qi(e,t={strict:!0}){let n=t,r=new N(cr);return r.V=e,n.name&&(r.O=n.name),r.p.push(o=>{let i=o.length,a=n.strict!==!1,s=(g,w)=>g===void 0?w:st(g<0?i+g:g,{min:0,max:i}),l=s(n.startIndex,0),c=s(n.endIndex,i),u=Math.max(0,c-l),f=n.n!==void 0?n.n:u;if(a){if(f!==i)throw new Mt(`Column height mismatch: seqRange length ${f} does not match DataFrame height ${i}`)}else{let g=n.pad??!1,w=n.truncate??!1;if(g&&!w&&f>u)throw new Mt(`Cannot pad seqRange output: specified length ${f} starting at index ${l} exceeds slice width ${u} (requires truncation).`);if(w&&!g&&f<u)throw new Mt(`Cannot truncate seqRange output: specified length ${f} starting at index ${l} is less than slice width ${u} (requires padding).`)}let p=n.mode||"cumulative",m=n.step!==void 0?n.step:1,d=n.dtype?g=>n.dtype.coerce(g):g=>g,y=d(!a&&n.padValue!==void 0?n.padValue:null),b=a&&n.dtype?.allocate?n.dtype.allocate(i):new Array(i).fill(y);return uo(b,e,{mode:p,step:m,coerce:d,startIndex:a?0:l,endIndex:a?i:Math.min(l+f,c)}),b}),r}var er=O(()=>{"use strict";Q();gt();$();H()});function Qt(e,t={}){let n=qi(e,{...t,mode:"constant"});return n.B=!0,n}var Kn=O(()=>{"use strict";er()});var Gi={};lr(Gi,{duration:()=>La});function La(e={}){if(typeof e=="string"){let a=Ni(e,{to:"ms"}),s=Qt(a).alias("duration");return s.N=new Z("ms"),s}let t=0,n=null,r=!1,o=e;for(let a in o){let s=zt[a];if(s===void 0)continue;let l=o[a];if(l==null)continue;if(r=!0,_(l)){t+=l*s;continue}let c=N.toColExpr(l).mul(s);n=n?n.add(c):c}if(!r)throw new k("At least one duration component must be specified for $df.duration().");let i=n?t!==0?n.add(Qt(t)):n:Qt(t);return i.N=new Z("ms"),i.alias("duration")}var rr=O(()=>{"use strict";Q();Kn();Kt();$();H()});var or,Wn,nr=O(()=>{"use strict";Kt();$();St();dt();H();it();or=class{constructor(t){x(this,"expr",t)}ot(){let t=this.expr.N;return t instanceof mt?t.timeZone:null}It(){let t=this.expr.N;return t instanceof mt?t.timeUnit:null}it(t){return h(this.expr,E(n=>{let r=P(n);return r?t(r):null}))}castTimeUnit(t){return this.expr.cast(new mt(t,this.ot()))}century(t){return this.year(t).sub(1).floordiv(100).add(1)}convertTimeZone(t){let n=this.ot();if(this.expr.N instanceof mt&&n===null)throw new k('convertTimeZone() requires a timezone-aware Datetime column. Use .dt.replace({ timeZone: "..." }) to assign a timezone first.');return this.expr.cast(new mt(this.It()??"ms",t))}date(){return this.replace({hour:0,minute:0,second:0,ms:0})}day(t){return this.strftime({format:"%d",timeZone:t}).cast(G)}daysInMonth(t){return this.monthEnd().dt.day(t)}epoch(t="ms"){return this.it(n=>ni(n,t))}hour(t){return this.strftime({format:"%H",timeZone:t}).cast(G)}isBusinessDay(t={}){return this.it(n=>li(n,t))}isLeapYear(t){let n=this.year(t);return n.mod(4).eq(0).and(n.mod(100).ne(0)).or(n.mod(400).eq(0)).cast(Vn)}isoWeek(t){return this.strftime({format:"%V",timeZone:t}).cast(G)}isoYear(t){return this.strftime({format:"%G",timeZone:t}).cast(G)}microsecond(t){return this.strftime({format:"%f",timeZone:t}).cast(G)}millennium(t){return this.year(t).sub(1).floordiv(1e3).add(1)}millisecond(t){return this.strftime({format:"%ms",timeZone:t}).cast(G)}minute(t){return this.strftime({format:"%M",timeZone:t}).cast(G)}month(t){return this.strftime({format:"%m",timeZone:t}).cast(G)}monthEnd(){return this.replace({day:-1,hour:0,minute:0,second:0,ms:0})}monthStart(){return this.replace({day:1,hour:0,minute:0,second:0,ms:0})}nanosecond(t){return this.microsecond(t).mul(1e3)}offsetDay(t,n={}){let o=n?.excludeWeekdays?.length||n?.holidays||n?.roll?h(this.expr,U(this.expr,t,(a,s)=>{let l=P(a);return l?ai(l,s,n):null})):t,{duration:i}=(rr(),ur(Gi));return this.expr.add(i({days:o}))}ordinalDay(t){return this.strftime({format:"%j",timeZone:t}).cast(G)}quarter(t){return this.month(t).div(3).ceil()}replace(t){return h(this.expr,E(n=>{let r=P(n);return r?ui(r,t):null}))}second(){return this.strftime({format:"%S",timeZone:"UTC"}).cast(G)}strftime(t){let n=this.ot(),r=n&&!t.timeZone?{...t,timeZone:n}:t;return this.it(o=>_e(o,r))}time(){return this.strftime({format:"%H:%M:%S.%ms",timeZone:"UTC"})}timestamp(t="ms"){return this.epoch(t)}totalDays(){return this.totalHours().div(24)}totalHours(){return this.totalMinutes().div(60)}totalMicroseconds(){return this.totalMilliseconds().mul(en)}totalMilliseconds(){return this.expr}totalMinutes(){return this.totalSeconds().div(60)}totalNanoseconds(){return this.totalMilliseconds().mul(rn)}totalSeconds(){return this.totalMilliseconds().div(tt)}utcOffset(t,n={}){return h(this.expr,E(r=>{let o=P(r);return o?De(o,t,n):null}))}week(t){return this.isoWeek(t)}weekday(t){return this.strftime({format:"%u",timeZone:t}).cast(G)}year(t){return this.strftime({format:"%Y",timeZone:t}).cast(G)}},Wn=class extends W{get dt(){return new or(this)}}});function Nc(){return new N("*")}var Xi=O(()=>{"use strict";Q()});function Uc(e){let t=new N("*");return t.xt=Array.isArray(e)?e:[e],t}var Ji=O(()=>{"use strict";Q()});function Vc(...e){let t=e.length===1&&Array.isArray(e[0])?e[0]:e,n=new N(fr);return n.p.push((r,o)=>{let i=r.length,a=t.length,s=new Array(a),l=new Array(a);for(let u=0;u<a;u++){let f=t[u],p=Zt(f,o,i);s[u]=p,l[u]=Ht(f,p,o,i)}let c=new Array(i);for(let u=0;u<i;u++){let f=null;for(let p=0;p<a;p++){let m=s[p],d=l[p]?m[u]:m;if(d!=null){f=d;break}}c[u]=f}return c}),n}var Wi=O(()=>{"use strict";Q();dt();gt()});function Gc(e){return new zn([e])}var zn,ir,Ki=O(()=>{"use strict";Q();dt();gt();zn=class{constructor(t,n=[]){x(this,"_predicates",t);x(this,"_values",n)}then(t){return new ir(this.st,[...this.$,t])}},ir=class e extends N{constructor(n=[],r=[],o=null){super(mr);x(this,"_predicates",n);x(this,"_values",r);x(this,"_otherwise",o);this.p=[(i,a)=>{let s=i.length,l=this.st,c=this.$,u=l.length,f=new Array(u),p=new Array(u),m=new Array(u),d=new Array(u);for(let A=0;A<u;A++){let T=l[A],I=c[A],F=Zt(T,a,s),yt=Zt(I,a,s);f[A]=F,p[A]=yt,m[A]=Ht(T,F,a,s),d[A]=Ht(I,yt,a,s)}let y=this.ut,b=Zt(y,a,s),g=Ht(y,b,a,s),w=new Array(s);for(let A=0;A<s;A++){let T=!1;for(let I=0;I<u;I++)if((m[I]?f[I][A]:f[I])===!0){w[A]=d[I]?p[I][A]:p[I],T=!0;break}T||(w[A]=g?b[A]:b)}return w}]}get Rt(){return this.ut}get ct(){return this.ut!=null?[...this.$,this.ut]:this.$}when(n){return new zn([...this.st,n],this.$)}otherwise(n){return new e(this.st,this.$,n)}}});function Kc(e){return N.toColExpr(e).implode()}var zi=O(()=>{"use strict";Q()});function Hc(){return new N(Ut)}var Yi=O(()=>{"use strict";Q();gt()});function rf(e,...t){let n;Array.isArray(e)||e&&typeof e=="object"&&!N.isColExpr(e)?n=e:n=[e,...t];let r=Qt({}).struct.withFields(n);return delete r.B,delete r.V,r.f=pr,r.alias("struct")}var Zi=O(()=>{"use strict";Q();Kn();gt()});function tn(e,t){if(e==null)return;if(e instanceof j)return e;if(typeof e=="object"&&("_ops"in e||"_literalValue"in e||"_targetType"in e))return $a(e,t);let n=L(e);if(typeof n=="string")return t[n]??S.Utf8;if(typeof n=="boolean")return S.Boolean;if(typeof n=="bigint")return jt(n,{range:"Int64"})?S.Int64:S.UInt64;if(_(n))return nt(n,{range:"Int32"})?S.Int32:Number.isInteger(n)?S.Int64:S.Float64;if(M(n))return S.Datetime;if(Co(n,{strict:!0}))return S.Binary;if(Array.isArray(n)){let r,o=n.length;for(let i=0;i<o;i++){let a=n[i];if(a!=null&&(r=tn(a,t)))break}return S.Array(r??S.Utf8)}if(et(n)){let r=ht?ht.call(n):n.constructor.name,o=va[r];return o?S.Array(o):S.Binary}if(C(n))return S.Object}function Hi(e,t,n){if(!e||!t)return;if(n&&n.length>0){let s=!1;for(let l=0;l<n.length;l++){let c=n[l];if(c!=null){if(typeof c!="boolean"){s=!1;break}s=!0}}if(s)return S.Boolean}let r=e instanceof Z,o=t instanceof Z,i=e.isTemporal&&!r,a=t.isTemporal&&!o;if(i||a){if(i&&a){let s=e.timeUnit||t.timeUnit||"ms";return new Z(s)}return i?e:t}if(r||o)return r?e:t;if(e.isUtf8||t.isUtf8)return S.Utf8;if(e.isNumeric&&t.isNumeric){let s=e instanceof Jt||t instanceof Jt,l=e instanceof Xt||t instanceof Xt,c=e instanceof Et||t instanceof Et;if(s||l&&c)return S.Float64;if(l)return S.Float32;if(c)return e instanceof Et?e:t;if(n!==void 0){let p={range:{min:-1/0,max:1/0}},m=n.length;for(let d=0;d<m;d++){let y=n[d];if(_(y)&&!nt(y,p))return S.Float64}}if(e===t)return e;let u=e.name,f=t.name;return u.endsWith("64")||f.endsWith("64")?S.Int64:u.endsWith("32")||f.endsWith("32")?u==="UInt32"&&f==="UInt32"?S.UInt32:S.Int32:u.endsWith("16")||f.endsWith("16")?u==="UInt16"&&f==="UInt16"?S.UInt16:S.Int16:u==="UInt8"&&f==="UInt8"?S.UInt8:S.Int8}}function $a(e,t,n){if(!e)return;if(e.N)return e.N;if(e.wt instanceof j)return e.wt;if(e.B&&e.V!==void 0)return tn(e.V,t);if(e.C)return Hi(tn(e.C.left,t),tn(e.C.right,t),n);if(e.ct){let a,s=e.ct.length;for(let l=0;l<s;l++){let c=tn(e.ct[l],t);c&&(a?a!==c&&a.isNumeric&&c.isNumeric&&(a=Hi(a,c,n)??a):a=c)}if(a)return a}if(e.F&&e.et){let a=tn(e.F,t);if(a instanceof pn)return a.fields?.[e.et]}let r=e.f?t[e.f]:void 0,o=n?.[0],i=(!e.p||e.p.length===0)&&!e.S&&!e._;if(r){if(r instanceof Wt&&(e.rt||n?.rowMap))return r.innerType;if(!(r instanceof Wt)&&Array.isArray(o))return S.Array(r);if(i||r.isTemporal&&e.S&&(M(o)||typeof o=="string")||r instanceof Z&&e.S&&_(o))return r}if(e.S&&_(o))return!Number.isInteger(o)||r?.isNumeric&&!(r instanceof Z)?S.Float64:S.Int32}var va,Qi=O(()=>{"use strict";Kt();Ge();H();va={Int8Array:S.Int8,Uint8Array:S.UInt8,Uint8ClampedArray:S.UInt8,Int16Array:S.Int16,Uint16Array:S.UInt16,Int32Array:S.Int32,Uint32Array:S.UInt32,BigInt64Array:S.Int64,BigUint64Array:S.UInt64,Float32Array:S.Float32,Float64Array:S.Float64}});var qa=O(()=>{gt();dr();St();Ke();Ye();He();nr();tr();Q();Kn();Xi();Ji();Wi();Ki();zi();er();Yi();Zi();rr();Qi();dt()});qa();export{Tt as ALL_COLUMNS_MARKER,qn as ArrayExpr,ze as ArrayExprNamespace,fr as COALESCE_MARKER,N as ColumnExpr,Xa as DURATION_MARKER,or as DateTimeExprNamespace,Ut as ELEMENT_MARKER,W as ExprBase,cr as LITERAL_MARKER,pr as STRUCT_MARKER,$n as StandardExpr,Gn as StringExpr,Ze as StringExprNamespace,Jn as StructExpr,Qe as StructExprNamespace,Wn as TemporalExpr,mr as WHEN_MARKER,zn as When,ir as WhenThen,zn as WhenThenChain,Nc as all,Pi as buildCanonicalSet,Vc as coalesce,Li as compareMissing,Vi as computeIsIn,We as computeRank,Hi as deduceBinaryType,h as derive,La as duration,Hc as element,ji as evalBinaryOp,Ba as evalUnaryOp,Zt as evaluateArg,at as evaluateExpression,Uc as exclude,Kc as implode,Ht as isEvaluatedColumn,U as kleeneBinary,E as kleeneUnary,Qt as lit,Va as resolveColumnSelectors,$a as resolveExprOutputType,tn as resolveOperandType,qi as seqRange,rf as struct,Gc as when};
@@ -13,9 +13,9 @@ import type { ConcatOptions, ConcatItem, RowRecord } from "../types";
13
13
  *
14
14
  * @example
15
15
  * // 1. Vertical Concatenation (default):
16
- * >>> const df1 = $df.data({ a: [1] })
17
- * >>> const df2 = $df.data({ a: [2] })
18
- * >>> $df.concat([df1, df2], { how: "vertical" })
16
+ * >>> const df1 = $df.data({ a: [1, 2] })
17
+ * >>> const df2 = $df.data({ b: [10, 20] })
18
+ * >>> df1
19
19
  * shape: (2, 1)
20
20
  * ┌───┐
21
21
  * │ a │
@@ -23,31 +23,83 @@ import type { ConcatOptions, ConcatItem, RowRecord } from "../types";
23
23
  * │ 1 │
24
24
  * │ 2 │
25
25
  * └───┘
26
+ * >>> df2
27
+ * shape: (2, 1)
28
+ * ┌────┐
29
+ * │ b │
30
+ * ├────┤
31
+ * │ 10 │
32
+ * │ 20 │
33
+ * └────┘
34
+ * >>> $df.concat([df1, df2], { how: "vertical" })
35
+ * shape: (4, 1)
36
+ * ┌──────┐
37
+ * │ a │
38
+ * ├──────┤
39
+ * │ 1 │
40
+ * │ 2 │
41
+ * │ null │
42
+ * │ null │
43
+ * └──────┘
26
44
  *
27
45
  * @example
28
46
  * // 2. Horizontal Concatenation:
29
- * >>> const df1 = $df.data({ a: [1] })
30
- * >>> const df2 = $df.data({ b: [2] })
47
+ * >>> const df1 = $df.data({ a: [1, 2] })
48
+ * >>> const df2 = $df.data({ b: [10, 20] })
49
+ * >>> df1
50
+ * shape: (2, 1)
51
+ * ┌───┐
52
+ * │ a │
53
+ * ├───┤
54
+ * │ 1 │
55
+ * │ 2 │
56
+ * └───┘
57
+ * >>> df2
58
+ * shape: (2, 1)
59
+ * ┌────┐
60
+ * │ b │
61
+ * ├────┤
62
+ * │ 10 │
63
+ * │ 20 │
64
+ * └────┘
31
65
  * >>> $df.concat([df1, df2], { how: "horizontal" })
32
- * shape: (1, 2)
33
- * ┌───┬───┐
34
- * │ a │ b
35
- * ├───┼───┤
36
- * │ 1 │ 2
37
- * └───┴───┘
66
+ * shape: (2, 2)
67
+ * ┌───┬────┐
68
+ * │ a │ b
69
+ * ├───┼────┤
70
+ * │ 1 │ 10
71
+ * │ 2 │ 20 │
72
+ * └───┴────┘
38
73
  *
39
74
  * @example
40
75
  * // 3. Diagonal Concatenation (mismatched columns):
41
- * >>> const df1 = $df.data({ a: [1] })
42
- * >>> const df2 = $df.data({ b: [2] })
76
+ * >>> const df1 = $df.data({ a: [1, 2] })
77
+ * >>> const df2 = $df.data({ b: [10, 20] })
78
+ * >>> df1
79
+ * shape: (2, 1)
80
+ * ┌───┐
81
+ * │ a │
82
+ * ├───┤
83
+ * │ 1 │
84
+ * │ 2 │
85
+ * └───┘
86
+ * >>> df2
87
+ * shape: (2, 1)
88
+ * ┌────┐
89
+ * │ b │
90
+ * ├────┤
91
+ * │ 10 │
92
+ * │ 20 │
93
+ * └────┘
43
94
  * >>> $df.concat([df1, df2], { how: "diagonal" })
44
- * shape: (2, 2)
95
+ * shape: (4, 2)
45
96
  * ┌──────┬──────┐
46
97
  * │ a │ b │
47
98
  * ├──────┼──────┤
48
99
  * │ 1 │ null │
49
- * │ null │ 2 │
100
+ * │ 2 │ null │
101
+ * │ null │ 10 │
102
+ * │ null │ 20 │
50
103
  * └──────┴──────┘
51
- *
52
104
  */
53
105
  export declare function concat<U extends RowRecord = any>(rawItems: ConcatItem | ConcatItem[], { how, horizontal }?: ConcatOptions): DataFrame<U>;
@@ -1,3 +1,3 @@
1
1
  export { concat } from "./concat";
2
- export { read_json } from "./read_json";
3
- export { read_csv } from "./read_csv";
2
+ export { readJson } from "./readJson";
3
+ export { readCsv } from "./readCsv";
@@ -0,0 +1,35 @@
1
+ import { DataFrame } from "../dataframe/dataframe";
2
+ import type { ReadCSVOptions } from "../dataframe/types";
3
+ import type { RowRecord } from "../types";
4
+ /**
5
+ * Reads a CSV string and constructs a DataFrame.
6
+ * Automatically infers column data types unless an explicit schema is provided.
7
+ * @namespace $df
8
+ * @category ColumnExpression
9
+ * @syntax $df.{symbol}(...)
10
+ * @param content The CSV content string.
11
+ * @param [options] Parse and configuration options.
12
+ * @param [options.hasHeader] Whether the first row is a header row (default `true`).
13
+ * @param [options.schema] Optional column schema to coerce types.
14
+ * @param [options.inferSchema] When `true` (default), automatically infers column types.
15
+ * @returns DataFrame
16
+ * @example
17
+ * >>> const df = $df.data({ a: [1, 2], b: ["x", "y"] })
18
+ * >>> df
19
+ * shape: (2, 2)
20
+ * ┌───┬───┐
21
+ * │ a │ b │
22
+ * ├───┼───┤
23
+ * │ 1 │ x │
24
+ * │ 2 │ y │
25
+ * └───┴───┘
26
+ * >>> $df.readCsv("a,b\n1,x\n2,y")
27
+ * shape: (2, 2)
28
+ * ┌───┬───┐
29
+ * │ a │ b │
30
+ * ├───┼───┤
31
+ * │ 1 │ x │
32
+ * │ 2 │ y │
33
+ * └───┴───┘
34
+ */
35
+ export declare function readCsv<T extends RowRecord = any>(content: string, options?: ReadCSVOptions): DataFrame<T>;
@@ -0,0 +1,33 @@
1
+ import { DataFrame } from "../dataframe/dataframe";
2
+ import type { ReadJSONOptions } from "../dataframe/types";
3
+ /**
4
+ * Parses JSON content (JSON or NDJSON) and loads it into a new DataFrame.
5
+ * @namespace $df
6
+ * @category ColumnExpression
7
+ * @syntax $df.{symbol}(...)
8
+ * @param content The JSON or NDJSON content string.
9
+ * @param [options] Parse and configuration options.
10
+ * @param [options.format] Input format (`"json"` or `"ndjson"`). Default `"json"`.
11
+ * @param [options.trimBeforeParse] When `true` (default), trims whitespace before parsing.
12
+ * @param [options.schema] Optional column schema to coerce types.
13
+ * @returns A new DataFrame instance populated with the parsed records.
14
+ * @example
15
+ * >>> const df = $df.data({ a: [1, 2], b: ["x", "y"] })
16
+ * >>> df
17
+ * shape: (2, 2)
18
+ * ┌───┬───┐
19
+ * │ a │ b │
20
+ * ├───┼───┤
21
+ * │ 1 │ x │
22
+ * │ 2 │ y │
23
+ * └───┴───┘
24
+ * >>> $df.readJson('[{"a":1,"b":"x"},{"a":2,"b":"y"}]')
25
+ * shape: (2, 2)
26
+ * ┌───┬───┐
27
+ * │ a │ b │
28
+ * ├───┼───┤
29
+ * │ 1 │ x │
30
+ * │ 2 │ y │
31
+ * └───┴───┘
32
+ */
33
+ export declare function readJson(content: string, { format, trimBeforeParse, schema, ...parseOpts }?: ReadJSONOptions): DataFrame<any>;