@arcgis/charts-components 5.2.0-next.128 → 5.2.0-next.129

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 (106) hide show
  1. package/dist/cdn/{ARWJ6M4M.js → 2C2NIEZB.js} +1 -1
  2. package/dist/cdn/{5J5N5EH4.js → 2CTAKPZU.js} +1 -1
  3. package/dist/cdn/{IL2XQ7JA.js → 37C4Y4CW.js} +1 -1
  4. package/dist/cdn/{C7BCDEO7.js → 3CFBPRDY.js} +1 -1
  5. package/dist/cdn/{V5BQ7JEF.js → 3W6XIEW7.js} +1 -1
  6. package/dist/cdn/{E2M4D7OW.js → 4GWKHPLI.js} +1 -1
  7. package/dist/cdn/{VRAKXFLS.js → 4ORYN2NG.js} +1 -1
  8. package/dist/cdn/{UUIPQQJC.js → 4RXRWG7U.js} +1 -1
  9. package/dist/cdn/{KYQPEMTU.js → 4VX2VSI4.js} +1 -1
  10. package/dist/cdn/{5Z5C5L7O.js → 53LAOBAU.js} +1 -1
  11. package/dist/cdn/{VQV4WP3Q.js → 56DVRE3W.js} +1 -1
  12. package/dist/cdn/{LZXH65ES.js → 64KVYOEJ.js} +1 -1
  13. package/dist/cdn/{G65D4QU4.js → 6CVRU5ZK.js} +1 -1
  14. package/dist/cdn/{FCA7RGLN.js → 6DOG3OE5.js} +19 -19
  15. package/dist/cdn/{SCMJVUZF.js → 6RQV36B4.js} +1 -1
  16. package/dist/cdn/{RYPF3XVE.js → 74NRG7FN.js} +1 -1
  17. package/dist/cdn/{OOB4AL5B.js → 7CP2RRF7.js} +1 -1
  18. package/dist/cdn/{2ISUP2EC.js → 7PYJ5MOI.js} +1 -1
  19. package/dist/cdn/{JTLT34BE.js → AIVAKTGU.js} +1 -1
  20. package/dist/cdn/{TBWNZHUY.js → APNLM2LP.js} +1 -1
  21. package/dist/cdn/{LKYUP362.js → BDTP75VF.js} +1 -1
  22. package/dist/cdn/{GZBPHJ7H.js → BGQBOLMO.js} +1 -1
  23. package/dist/cdn/{AA7OBKIP.js → BRDZGUUB.js} +1 -1
  24. package/dist/cdn/{HTZY6BFK.js → BVO6LGOY.js} +1 -1
  25. package/dist/cdn/{YRQUJSIP.js → CGVEK7FD.js} +1 -1
  26. package/dist/cdn/{RLBQSLCM.js → CPZUNG53.js} +1 -1
  27. package/dist/cdn/{56CO5V5Y.js → DLZSIU4O.js} +1 -1
  28. package/dist/cdn/{TB7TL34T.js → DSFPESV4.js} +1 -1
  29. package/dist/cdn/{CHMEYQRU.js → EAXMUTBS.js} +1 -1
  30. package/dist/cdn/{UKGGXTFF.js → EUQ5JKF2.js} +1 -1
  31. package/dist/cdn/{ICZSZBA3.js → EXYTWDDX.js} +1 -1
  32. package/dist/cdn/{GQRUVGUK.js → F2VCL6GM.js} +1 -1
  33. package/dist/cdn/{V6QPNC6H.js → F6ZV2744.js} +1 -1
  34. package/dist/cdn/{CYEBSDUO.js → G5F53SQ4.js} +1 -1
  35. package/dist/cdn/{PE74EWN6.js → GBK7T4RN.js} +1 -1
  36. package/dist/cdn/{KVNHQH7O.js → GUI4UUH2.js} +1 -1
  37. package/dist/cdn/{VTEYNOVM.js → HBL6BFMC.js} +1 -1
  38. package/dist/cdn/{5A75STHJ.js → I7SVJZHV.js} +1 -1
  39. package/dist/cdn/{PUGPG7TG.js → IJPWCWVA.js} +1 -1
  40. package/dist/cdn/{CTV66EX6.js → IVTCYXXY.js} +1 -1
  41. package/dist/cdn/{G5YKCSBP.js → IWYQYPEZ.js} +1 -1
  42. package/dist/cdn/{6SLQ6E2L.js → JBPRHFVU.js} +1 -1
  43. package/dist/cdn/{E4HQCLE5.js → JCGOZHD3.js} +1 -1
  44. package/dist/cdn/{NLCAS2S3.js → KA45NQZM.js} +1 -1
  45. package/dist/cdn/{GOTXZDTB.js → KGZPMIDP.js} +1 -1
  46. package/dist/cdn/{QSQ4WWNZ.js → KJZYSZAN.js} +1 -1
  47. package/dist/cdn/{E346UZ4Y.js → KSCIUIM3.js} +1 -1
  48. package/dist/cdn/{JRLMTZJ6.js → KWLMVBIU.js} +1 -1
  49. package/dist/cdn/{6K25LYBM.js → KZSFOHYT.js} +1 -1
  50. package/dist/cdn/{Y343Z32K.js → LHWH7ADN.js} +1 -1
  51. package/dist/cdn/{CFDZTXBV.js → LRUJQA2B.js} +1 -1
  52. package/dist/cdn/{D37G7ULI.js → LVFZRGTZ.js} +1 -1
  53. package/dist/cdn/{RYFKSZCM.js → MVXCGGLI.js} +1 -1
  54. package/dist/cdn/{CDTABNYS.js → NDHFOHU4.js} +1 -1
  55. package/dist/cdn/{2ZAC3R6J.js → NFSUU5R7.js} +1 -1
  56. package/dist/cdn/{MLR6CWHN.js → OFMFOV2S.js} +1 -1
  57. package/dist/cdn/{XNTW3FJJ.js → ORPJZUA7.js} +1 -1
  58. package/dist/cdn/{NKSGWA4X.js → OSKPKDOG.js} +1 -1
  59. package/dist/cdn/{NFRZPT5W.js → P2CSMU4N.js} +1 -1
  60. package/dist/cdn/{Y5OM2HDA.js → P6NFEDDK.js} +1 -1
  61. package/dist/cdn/{Y6IIGQGN.js → QD7SXYTF.js} +1 -1
  62. package/dist/cdn/{W6ZTJ5F4.js → QWLTFW5X.js} +1 -1
  63. package/dist/cdn/{2BLR6LKU.js → QZB5UHQG.js} +1 -1
  64. package/dist/cdn/{KFTX2TQU.js → R632ACJ4.js} +1 -1
  65. package/dist/cdn/{EYH2BIAD.js → RKILC6DZ.js} +1 -1
  66. package/dist/cdn/{6AUVDB2X.js → RNQIVRB4.js} +1 -1
  67. package/dist/cdn/{H56BSQEW.js → RYM7NY47.js} +1 -1
  68. package/dist/cdn/{4KJXVTKT.js → SDTUNXAY.js} +1 -1
  69. package/dist/cdn/{WYKOFBBC.js → SQJG2TSD.js} +1 -1
  70. package/dist/cdn/{NUM2NK7X.js → SSDG5TFU.js} +1 -1
  71. package/dist/cdn/{W5RIMXON.js → SXJPPJQW.js} +1 -1
  72. package/dist/cdn/{TFEXNOQT.js → THM37AG2.js} +1 -1
  73. package/dist/cdn/{TGVSWL53.js → TW3IW3UH.js} +1 -1
  74. package/dist/cdn/{TCKL6CRO.js → U62ORVWT.js} +1 -1
  75. package/dist/cdn/{6WUMG4P2.js → U6NXKMHT.js} +1 -1
  76. package/dist/cdn/{A6IGTXFA.js → UB7NCK73.js} +1 -1
  77. package/dist/cdn/{MDNFAO3M.js → UVBVOGIP.js} +1 -1
  78. package/dist/cdn/{5DI4FWSJ.js → VAH75ZDV.js} +1 -1
  79. package/dist/cdn/{26WEYDNB.js → VELSUIBF.js} +1 -1
  80. package/dist/cdn/{334POAQ3.js → VUFK7UF7.js} +1 -1
  81. package/dist/cdn/{252LEJ7U.js → VXYVS5Z2.js} +1 -1
  82. package/dist/cdn/{NPSI5JGI.js → W234QWJ5.js} +1 -1
  83. package/dist/cdn/{YWEEKBTH.js → WFPJZFMV.js} +1 -1
  84. package/dist/cdn/{TVN5AANS.js → WOHPGX7G.js} +1 -1
  85. package/dist/cdn/WULMITJI.js +2 -0
  86. package/dist/cdn/{C4SI4UTD.js → WYIHJMCL.js} +1 -1
  87. package/dist/cdn/{HJE3XLSD.js → XBTMOPFH.js} +1 -1
  88. package/dist/cdn/{4NRY2KO2.js → XD4BTBDR.js} +1 -1
  89. package/dist/cdn/{HQ47ZXN2.js → XFVNNAUV.js} +1 -1
  90. package/dist/cdn/{2ISGHAUI.js → YRCMDFOY.js} +1 -1
  91. package/dist/cdn/{UXUJZXY6.js → YTJCLCDD.js} +1 -1
  92. package/dist/cdn/{DC4Z6SV3.js → ZD6FBRAV.js} +1 -1
  93. package/dist/cdn/{LHIWT7XJ.js → ZO46LBOO.js} +1 -1
  94. package/dist/cdn/assets/charts-config-scatter-plot-data/t9n/messages.en.json +1 -1
  95. package/dist/cdn/assets/common/t9n/messages.en.json +1 -1
  96. package/dist/cdn/index.js +1 -1
  97. package/dist/cdn/model/shared/setup-utils.js +1 -1
  98. package/dist/components/arcgis-chart/customElement.d.ts +21 -0
  99. package/dist/components/arcgis-chart/customElement.js +860 -873
  100. package/dist/components/arcgis-charts-action-bar/customElement.d.ts +14 -0
  101. package/dist/docs/api.json +1 -1
  102. package/dist/docs/docs.json +1 -1
  103. package/dist/docs/web-types.json +1 -1
  104. package/dist/utils/localization/interfaces.d.ts +14 -0
  105. package/package.json +4 -4
  106. package/dist/cdn/WHLIG2UP.js +0 -2
@@ -1,3 +1,3 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{A as Ei,c as F,d as S,g as Ii,h as Ai,j as Pr,k as kr,l as Mi,m as _e,n as Vr,q as Qn,r as le,s as $r,t as or,y as Jn}from"./4F6DKNCU.js";import{a as ot,b as Li,c as Kn,e as se,g as Xn,h as Vt,i as ea}from"./WOGALV3T.js";import{B as Bi,Ea as Hn,Fa as Gn,b as st,d as zn,e as Ke,f as W,g as Un,i as Ti,o as Dr,p as ar,q as _,r as Ni,t as Oi,xa as xt,ya as sr}from"./ZUN46CYQ.js";import{a as K,c as Ft,d as qr,e as ye,f as Ie}from"./KX7KGXKQ.js";import{a as Lr,b as vt,d as Ye,g as jn,h as Fi,l as Qe,q as Zn}from"./NGXRBJKL.js";import{c as Wn,d as at,f as Er,h as bt}from"./WHLIG2UP.js";import{I as kt}from"./UE4KTI5X.js";import{a as j,c as Yn}from"./QYRHZJH3.js";import{a as p,b as L,c as ae,e as _n,f as Be,h as Ce,i as xi,k as U,l as xe,n as we,o as oe,q as Ct,s as wi,v as Je}from"./PWJBGZPW.js";export default $arcgis.t(([nc,xr,ir,Ds,ac,Ps,{computeStatisticsHistograms:sc,computeRasterAttributeTable:oc,getCurrentRasterInfo:Lt,fetchPixelFeatureSet:lc},yi,uo,On,uc,ks,cc,dc,fc,mc,gc,co,hc,si,fo,yc,pc,Sc,bc,vc,{substitute:$e},{sqlLiteral:Cc}])=>{var et=class extends Error{},Zi=class extends et{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},_i=class extends et{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},zi=class extends et{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},ct=class extends et{},Hr=class extends et{constructor(e){super(`Invalid unit ${e}`)}},fe=class extends et{},ze=class extends et{constructor(){super("Zone is an abstract class")}},q="numeric",Ve="short",Oe="long",Gr={year:q,month:q,day:q},Ma={year:q,month:Ve,day:q},cl={year:q,month:Ve,day:q,weekday:Ve},Ea={year:q,month:Oe,day:q},La={year:q,month:Oe,day:q,weekday:Oe},qa={hour:q,minute:q},Da={hour:q,minute:q,second:q},Pa={hour:q,minute:q,second:q,timeZoneName:Ve},ka={hour:q,minute:q,second:q,timeZoneName:Oe},Va={hour:q,minute:q,hourCycle:"h23"},$a={hour:q,minute:q,second:q,hourCycle:"h23"},Ra={hour:q,minute:q,second:q,hourCycle:"h23",timeZoneName:Ve},Wa={hour:q,minute:q,second:q,hourCycle:"h23",timeZoneName:Oe},ja={year:q,month:q,day:q,hour:q,minute:q},Za={year:q,month:q,day:q,hour:q,minute:q,second:q},_a={year:q,month:Ve,day:q,hour:q,minute:q},za={year:q,month:Ve,day:q,hour:q,minute:q,second:q},dl={year:q,month:Ve,day:q,weekday:Ve,hour:q,minute:q},Ua={year:q,month:Oe,day:q,hour:q,minute:q,timeZoneName:Ve},Ha={year:q,month:Oe,day:q,hour:q,minute:q,second:q,timeZoneName:Ve},Ga={year:q,month:Oe,day:q,weekday:Oe,hour:q,minute:q,timeZoneName:Oe},Ya={year:q,month:Oe,day:q,weekday:Oe,hour:q,minute:q,second:q,timeZoneName:Oe},Ot=class{get type(){throw new ze}get name(){throw new ze}get ianaName(){return this.name}get isUniversal(){throw new ze}offsetName(e,r){throw new ze}formatOffset(e,r){throw new ze}offset(e){throw new ze}equals(e){throw new ze}get isValid(){throw new ze}},qi=null,Yr=class t extends Ot{static get instance(){return qi===null&&(qi=new t),qi}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:r,locale:i}){return ss(e,r,i)}formatOffset(e,r){return fr(this.offset(e),r)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},Ui=new Map;function fl(t){let e=Ui.get(t);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Ui.set(t,e)),e}var ml={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function gl(t,e){let r=t.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,n,a,s,o,l,u,c]=i;return[s,n,a,o,l,u,c]}function hl(t,e){let r=t.formatToParts(e),i=[];for(let n=0;n<r.length;n++){let{type:a,value:s}=r[n],o=ml[a];a==="era"?i[o]=s:Z(o)||(i[o]=parseInt(s,10))}return i}var Di=new Map,ft=class t extends Ot{static create(e){let r=Di.get(e);return r===void 0&&Di.set(e,r=new t(e)),r}static resetCache(){Di.clear(),Ui.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=t.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:r,locale:i}){return ss(e,r,i,this.name)}formatOffset(e,r){return fr(this.offset(e),r)}offset(e){if(!this.valid)return NaN;let r=new Date(e);if(isNaN(r))return NaN;let i=fl(this.name),[n,a,s,o,l,u,c]=i.formatToParts?hl(i,r):gl(i,r);o==="BC"&&(n=-Math.abs(n)+1);let f=ti({year:n,month:a,day:s,hour:l===24?0:l,minute:u,second:c,millisecond:0}),m=+r,g=m%1e3;return m-=g>=0?g:1e3+g,(f-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},ta={};function yl(t,e={}){let r=JSON.stringify([t,e]),i=ta[r];return i||(i=new Intl.ListFormat(t,e),ta[r]=i),i}var Hi=new Map;function Gi(t,e={}){let r=JSON.stringify([t,e]),i=Hi.get(r);return i===void 0&&(i=new Intl.DateTimeFormat(t,e),Hi.set(r,i)),i}var Yi=new Map;function pl(t,e={}){let r=JSON.stringify([t,e]),i=Yi.get(r);return i===void 0&&(i=new Intl.NumberFormat(t,e),Yi.set(r,i)),i}var Qi=new Map;function Sl(t,e={}){let{base:r,...i}=e,n=JSON.stringify([t,i]),a=Qi.get(n);return a===void 0&&(a=new Intl.RelativeTimeFormat(t,e),Qi.set(n,a)),a}var ur=null;function bl(){return ur||(ur=new Intl.DateTimeFormat().resolvedOptions().locale,ur)}var Ji=new Map;function Qa(t){let e=Ji.get(t);return e===void 0&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),Ji.set(t,e)),e}var Ki=new Map;function vl(t){let e=Ki.get(t);if(!e){let r=new Intl.Locale(t);e="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in e||(e={...Ja,...e}),Ki.set(t,e)}return e}function Cl(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let r=t.indexOf("-u-");if(r===-1)return[t];{let i,n;try{i=Gi(t).resolvedOptions(),n=t}catch{let l=t.substring(0,r);i=Gi(l).resolvedOptions(),n=l}let{numberingSystem:a,calendar:s}=i;return[n,a,s]}}function Fl(t,e,r){return(r||e)&&(t.includes("-u-")||(t+="-u"),r&&(t+=`-ca-${r}`),e&&(t+=`-nu-${e}`)),t}function xl(t){let e=[];for(let r=1;r<=12;r++){let i=Q.utc(2009,r,1);e.push(t(i))}return e}function wl(t){let e=[];for(let r=1;r<=7;r++){let i=Q.utc(2016,11,13+r);e.push(t(i))}return e}function Rr(t,e,r,i){let n=t.listingMode();return n==="error"?null:n==="en"?r(e):i(e)}function Tl(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||Qa(t.locale).numberingSystem==="latn"}var Xi=class{constructor(e,r,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;let{padTo:n,floor:a,...s}=i;if(!r||Object.keys(s).length>0){let o={useGrouping:!1,...i};i.padTo>0&&(o.minimumIntegerDigits=i.padTo),this.inf=pl(e,o)}}format(e){if(this.inf){let r=this.floor?Math.floor(e):e;return this.inf.format(r)}else{let r=this.floor?Math.floor(e):fn(e,3);return ue(r,this.padTo)}}},en=class{constructor(e,r,i){this.opts=i,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let s=-1*(e.offset/60),o=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;e.offset!==0&&ft.create(o).valid?(n=o,this.dt=e):(n="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let a={...this.opts};a.timeZone=a.timeZone||n,this.dtf=Gi(r,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(r=>{if(r.type==="timeZoneName"){let i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:i}}else return r}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},tn=class{constructor(e,r,i){this.opts={style:"long",...i},!r&&ns()&&(this.rtf=Sl(e,i))}format(e,r){return this.rtf?this.rtf.format(e,r):Ul(r,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,r){return this.rtf?this.rtf.formatToParts(e,r):[]}},Ja={firstDay:1,minimalDays:4,weekend:[6,7]},re=class t{static fromOpts(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,r,i,n,a=!1){let s=e||ne.defaultLocale,o=s||(a?"en-US":bl()),l=r||ne.defaultNumberingSystem,u=i||ne.defaultOutputCalendar,c=an(n)||ne.defaultWeekSettings;return new t(o,l,u,c,s)}static resetCache(){ur=null,Hi.clear(),Yi.clear(),Qi.clear(),Ji.clear(),Ki.clear()}static fromObject({locale:e,numberingSystem:r,outputCalendar:i,weekSettings:n}={}){return t.create(e,r,i,n)}constructor(e,r,i,n,a){let[s,o,l]=Cl(e);this.locale=s,this.numberingSystem=r||o||null,this.outputCalendar=i||l||null,this.weekSettings=n,this.intl=Fl(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Tl(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&r?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:t.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,an(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,r=!1){return Rr(this,e,us,()=>{let i=this.intl==="ja"||this.intl.startsWith("ja-");r&=!i;let n=r?{month:e,day:"numeric"}:{month:e},a=r?"format":"standalone";if(!this.monthsCache[a][e]){let s=i?o=>this.dtFormatter(o,n).format():o=>this.extract(o,n,"month");this.monthsCache[a][e]=xl(s)}return this.monthsCache[a][e]})}weekdays(e,r=!1){return Rr(this,e,fs,()=>{let i=r?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=r?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=wl(a=>this.extract(a,i,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return Rr(this,void 0,()=>ms,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Q.utc(2016,11,13,9),Q.utc(2016,11,13,19)].map(r=>this.extract(r,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Rr(this,e,gs,()=>{let r={era:e};return this.eraCache[e]||(this.eraCache[e]=[Q.utc(-40,1,1),Q.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[e]})}extract(e,r,i){let n=this.dtFormatter(e,r),a=n.formatToParts(),s=a.find(o=>o.type.toLowerCase()===i);return s?s.value:null}numberFormatter(e={}){return new Xi(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,r={}){return new en(e,this.intl,r)}relFormatter(e={}){return new tn(this.intl,this.isEnglish(),e)}listFormatter(e={}){return yl(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Qa(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:as()?vl(this.locale):Ja}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},Pi=null,Le=class t extends Ot{static get utcInstance(){return Pi===null&&(Pi=new t(0)),Pi}static instance(e){return e===0?t.utcInstance:new t(e)}static parseSpecifier(e){if(e){let r=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new t(ri(r[1],r[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${fr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${fr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,r){return fr(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},rn=class extends Ot{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function ut(t,e){if(Z(t)||t===null)return e;if(t instanceof Ot)return t;if(Ml(t)){let r=t.toLowerCase();return r==="default"?e:r==="local"||r==="system"?Yr.instance:r==="utc"||r==="gmt"?Le.utcInstance:Le.parseSpecifier(r)||ft.create(t)}else return dt(t)?Le.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new rn(t)}var ln={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},ra={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Nl=ln.hanidec.replace(/[\[|\]]/g,"").split("");function Ol(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);if(t[r].search(ln.hanidec)!==-1)e+=Nl.indexOf(t[r]);else for(let n in ra){let[a,s]=ra[n];i>=a&&i<=s&&(e+=i-a)}}return parseInt(e,10)}else return e}var nn=new Map;function Bl(){nn.clear()}function Pe({numberingSystem:t},e=""){let r=t||"latn",i=nn.get(r);i===void 0&&(i=new Map,nn.set(r,i));let n=i.get(e);return n===void 0&&(n=new RegExp(`${ln[r]}${e}`),i.set(e,n)),n}var ia=()=>Date.now(),na="system",aa=null,sa=null,oa=null,la=60,ua,ca=null,ne=class{static get now(){return ia}static set now(e){ia=e}static set defaultZone(e){na=e}static get defaultZone(){return ut(na,Yr.instance)}static get defaultLocale(){return aa}static set defaultLocale(e){aa=e}static get defaultNumberingSystem(){return sa}static set defaultNumberingSystem(e){sa=e}static get defaultOutputCalendar(){return oa}static set defaultOutputCalendar(e){oa=e}static get defaultWeekSettings(){return ca}static set defaultWeekSettings(e){ca=an(e)}static get twoDigitCutoffYear(){return la}static set twoDigitCutoffYear(e){la=e%100}static get throwOnInvalid(){return ua}static set throwOnInvalid(e){ua=e}static resetCaches(){re.resetCache(),ft.resetCache(),Q.resetCache(),Bl()}},Ne=class{constructor(e,r){this.reason=e,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},Ka=[0,31,59,90,120,151,181,212,243,273,304,334],Xa=[0,31,60,91,121,152,182,213,244,274,305,335];function Me(t,e){return new Ne("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function un(t,e,r){let i=new Date(Date.UTC(t,e-1,r));t<100&&t>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);let n=i.getUTCDay();return n===0?7:n}function es(t,e,r){return r+(gr(t)?Xa:Ka)[e-1]}function ts(t,e){let r=gr(t)?Xa:Ka,i=r.findIndex(a=>a<e),n=e-r[i];return{month:i+1,day:n}}function cn(t,e){return(t-e+7)%7+1}function Qr(t,e=4,r=1){let{year:i,month:n,day:a}=t,s=es(i,n,a),o=cn(un(i,n,a),r),l=Math.floor((s-o+14-e)/7),u;return l<1?(u=i-1,l=mr(u,e,r)):l>mr(i,e,r)?(u=i+1,l=1):u=i,{weekYear:u,weekNumber:l,weekday:o,...ii(t)}}function da(t,e=4,r=1){let{weekYear:i,weekNumber:n,weekday:a}=t,s=cn(un(i,1,e),r),o=Zt(i),l=n*7+a-s-7+e,u;l<1?(u=i-1,l+=Zt(u)):l>o?(u=i+1,l-=Zt(i)):u=i;let{month:c,day:d}=ts(u,l);return{year:u,month:c,day:d,...ii(t)}}function ki(t){let{year:e,month:r,day:i}=t,n=es(e,r,i);return{year:e,ordinal:n,...ii(t)}}function fa(t){let{year:e,ordinal:r}=t,{month:i,day:n}=ts(e,r);return{year:e,month:i,day:n,...ii(t)}}function ma(t,e){if(!Z(t.localWeekday)||!Z(t.localWeekNumber)||!Z(t.localWeekYear)){if(!Z(t.weekday)||!Z(t.weekNumber)||!Z(t.weekYear))throw new ct("Cannot mix locale-based week fields with ISO-based week fields");return Z(t.localWeekday)||(t.weekday=t.localWeekday),Z(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Z(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Il(t,e=4,r=1){let i=ei(t.weekYear),n=Ee(t.weekNumber,1,mr(t.weekYear,e,r)),a=Ee(t.weekday,1,7);return i?n?a?!1:Me("weekday",t.weekday):Me("week",t.weekNumber):Me("weekYear",t.weekYear)}function Al(t){let e=ei(t.year),r=Ee(t.ordinal,1,Zt(t.year));return e?r?!1:Me("ordinal",t.ordinal):Me("year",t.year)}function rs(t){let e=ei(t.year),r=Ee(t.month,1,12),i=Ee(t.day,1,Jr(t.year,t.month));return e?r?i?!1:Me("day",t.day):Me("month",t.month):Me("year",t.year)}function is(t){let{hour:e,minute:r,second:i,millisecond:n}=t,a=Ee(e,0,23)||e===24&&r===0&&i===0&&n===0,s=Ee(r,0,59),o=Ee(i,0,59),l=Ee(n,0,999);return a?s?o?l?!1:Me("millisecond",n):Me("second",i):Me("minute",r):Me("hour",e)}function Z(t){return typeof t>"u"}function dt(t){return typeof t=="number"}function ei(t){return typeof t=="number"&&t%1===0}function Ml(t){return typeof t=="string"}function El(t){return Object.prototype.toString.call(t)==="[object Date]"}function ns(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function as(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ll(t){return Array.isArray(t)?t:[t]}function ga(t,e,r){if(t.length!==0)return t.reduce((i,n)=>{let a=[e(n),n];return i&&r(i[0],a[0])===i[0]?i:a},null)[1]}function ql(t,e){return e.reduce((r,i)=>(r[i]=t[i],r),{})}function Ut(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function an(t){if(t==null)return null;if(typeof t!="object")throw new fe("Week settings must be an object");if(!Ee(t.firstDay,1,7)||!Ee(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!Ee(e,1,7)))throw new fe("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Ee(t,e,r){return ei(t)&&t>=e&&t<=r}function Dl(t,e){return t-e*Math.floor(t/e)}function ue(t,e=2){let r=t<0,i;return r?i="-"+(""+-t).padStart(e,"0"):i=(""+t).padStart(e,"0"),i}function lt(t){if(!(Z(t)||t===null||t===""))return parseInt(t,10)}function wt(t){if(!(Z(t)||t===null||t===""))return parseFloat(t)}function dn(t){if(!(Z(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function fn(t,e,r="round"){let i=10**e;switch(r){case"expand":return t>0?Math.ceil(t*i)/i:Math.floor(t*i)/i;case"trunc":return Math.trunc(t*i)/i;case"round":return Math.round(t*i)/i;case"floor":return Math.floor(t*i)/i;case"ceil":return Math.ceil(t*i)/i;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function gr(t){return t%4===0&&(t%100!==0||t%400===0)}function Zt(t){return gr(t)?366:365}function Jr(t,e){let r=Dl(e-1,12)+1,i=t+(e-r)/12;return r===2?gr(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function ti(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function ha(t,e,r){return-cn(un(t,1,e),r)+e-1}function mr(t,e=4,r=1){let i=ha(t,e,r),n=ha(t+1,e,r);return(Zt(t)-i+n)/7}function sn(t){return t>99?t:t>ne.twoDigitCutoffYear?1900+t:2e3+t}function ss(t,e,r,i=null){let n=new Date(t),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(a.timeZone=i);let s={timeZoneName:e,...a},o=new Intl.DateTimeFormat(r,s).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return o?o.value:null}function ri(t,e){let r=parseInt(t,10);Number.isNaN(r)&&(r=0);let i=parseInt(e,10)||0,n=r<0||Object.is(r,-0)?-i:i;return r*60+n}function os(t){let e=Number(t);if(typeof t=="boolean"||t===""||!Number.isFinite(e))throw new fe(`Invalid unit value ${t}`);return e}function Kr(t,e){let r={};for(let i in t)if(Ut(t,i)){let n=t[i];if(n==null)continue;r[e(i)]=os(n)}return r}function fr(t,e){let r=Math.trunc(Math.abs(t/60)),i=Math.trunc(Math.abs(t%60)),n=t>=0?"+":"-";switch(e){case"short":return`${n}${ue(r,2)}:${ue(i,2)}`;case"narrow":return`${n}${r}${i>0?`:${i}`:""}`;case"techie":return`${n}${ue(r,2)}${ue(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function ii(t){return ql(t,["hour","minute","second","millisecond"])}var Pl=["January","February","March","April","May","June","July","August","September","October","November","December"],ls=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],kl=["J","F","M","A","M","J","J","A","S","O","N","D"];function us(t){switch(t){case"narrow":return[...kl];case"short":return[...ls];case"long":return[...Pl];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var cs=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ds=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Vl=["M","T","W","T","F","S","S"];function fs(t){switch(t){case"narrow":return[...Vl];case"short":return[...ds];case"long":return[...cs];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var ms=["AM","PM"],$l=["Before Christ","Anno Domini"],Rl=["BC","AD"],Wl=["B","A"];function gs(t){switch(t){case"narrow":return[...Wl];case"short":return[...Rl];case"long":return[...$l];default:return null}}function jl(t){return ms[t.hour<12?0:1]}function Zl(t,e){return fs(e)[t.weekday-1]}function _l(t,e){return us(e)[t.month-1]}function zl(t,e){return gs(e)[t.year<0?0:1]}function Ul(t,e,r="always",i=!1){let n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(t)===-1;if(r==="auto"&&a){let d=t==="days";switch(e){case 1:return d?"tomorrow":`next ${n[t][0]}`;case-1:return d?"yesterday":`last ${n[t][0]}`;case 0:return d?"today":`this ${n[t][0]}`}}let s=Object.is(e,-0)||e<0,o=Math.abs(e),l=o===1,u=n[t],c=i?l?u[1]:u[2]||u[1]:l?n[t][0]:t;return s?`${o} ${c} ago`:`in ${o} ${c}`}function ya(t,e){let r="";for(let i of t)i.literal?r+=i.val:r+=e(i.val);return r}var Hl={D:Gr,DD:Ma,DDD:Ea,DDDD:La,t:qa,tt:Da,ttt:Pa,tttt:ka,T:Va,TT:$a,TTT:Ra,TTTT:Wa,f:ja,ff:_a,fff:Ua,ffff:Ga,F:Za,FF:za,FFF:Ha,FFFF:Ya},Te=class t{static create(e,r={}){return new t(e,r)}static parseFormat(e){let r=null,i="",n=!1,a=[];for(let s=0;s<e.length;s++){let o=e.charAt(s);o==="'"?((i.length>0||n)&&a.push({literal:n||/^\s+$/.test(i),val:i===""?"'":i}),r=null,i="",n=!n):n||o===r?i+=o:(i.length>0&&a.push({literal:/^\s+$/.test(i),val:i}),i=o,r=o)}return i.length>0&&a.push({literal:n||/^\s+$/.test(i),val:i}),a}static macroTokenToFormatOpts(e){return Hl[e]}constructor(e,r){this.opts=r,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...r}).format()}dtFormatter(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r})}formatDateTime(e,r){return this.dtFormatter(e,r).format()}formatDateTimeParts(e,r){return this.dtFormatter(e,r).formatToParts()}formatInterval(e,r){return this.dtFormatter(e.start,r).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,r){return this.dtFormatter(e,r).resolvedOptions()}num(e,r=0,i=void 0){if(this.opts.forceSimple)return ue(e,r);let n={...this.opts};return r>0&&(n.padTo=r),i&&(n.signDisplay=i),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,r){let i=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(m,g)=>this.loc.extract(e,m,g),s=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",o=()=>i?jl(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(m,g)=>i?_l(e,m):a(g?{month:m}:{month:m,day:"numeric"},"month"),u=(m,g)=>i?Zl(e,m):a(g?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),c=m=>{let g=t.macroTokenToFormatOpts(m);return g?this.formatWithSystemDefault(e,g):m},d=m=>i?zl(e,m):a({era:m},"era"),f=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return n?a({day:"numeric"},"day"):this.num(e.day);case"dd":return n?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return n?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return n?a({month:"numeric"},"month"):this.num(e.month);case"MM":return n?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return n?a({year:"numeric"},"year"):this.num(e.year);case"yy":return n?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(m)}};return ya(t.parseFormat(r),f)}formatDurationFromString(e,r){let i=this.opts.signMode==="negativeLargestOnly"?-1:1,n=c=>{switch(c[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},a=(c,d)=>f=>{let m=n(f);if(m){let g=d.isNegativeDuration&&m!==d.largestUnit?i:1,h;return this.opts.signMode==="negativeLargestOnly"&&m!==d.largestUnit?h="never":this.opts.signMode==="all"?h="always":h="auto",this.num(c.get(m)*g,f.length,h)}else return f},s=t.parseFormat(r),o=s.reduce((c,{literal:d,val:f})=>d?c:c.concat(f),[]),l=e.shiftTo(...o.map(n).filter(c=>c)),u={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return ya(s,a(l,u))}},hs=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ht(...t){let e=t.reduce((r,i)=>r+i.source,"");return RegExp(`^${e}$`)}function Gt(...t){return e=>t.reduce(([r,i,n],a)=>{let[s,o,l]=a(e,n);return[{...r,...s},o||i,l]},[{},null,1]).slice(0,2)}function Yt(t,...e){if(t==null)return[null,null];for(let[r,i]of e){let n=r.exec(t);if(n)return i(n)}return[null,null]}function ys(...t){return(e,r)=>{let i={},n;for(n=0;n<t.length;n++)i[t[n]]=lt(e[r+n]);return[i,null,r+n]}}var ps=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Gl=`(?:${ps.source}?(?:\\[(${hs.source})\\])?)?`,mn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Ss=RegExp(`${mn.source}${Gl}`),gn=RegExp(`(?:[Tt]${Ss.source})?`),Yl=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ql=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Jl=/(\d{4})-?(\d{3})/,Kl=ys("weekYear","weekNumber","weekDay"),Xl=ys("year","ordinal"),eu=/(\d{4})-(\d\d)-(\d\d)/,bs=RegExp(`${mn.source} ?(?:${ps.source}|(${hs.source}))?`),tu=RegExp(`(?: ${bs.source})?`);function _t(t,e,r){let i=t[e];return Z(i)?r:lt(i)}function ru(t,e){return[{year:_t(t,e),month:_t(t,e+1,1),day:_t(t,e+2,1)},null,e+3]}function Qt(t,e){return[{hours:_t(t,e,0),minutes:_t(t,e+1,0),seconds:_t(t,e+2,0),milliseconds:dn(t[e+3])},null,e+4]}function hr(t,e){let r=!t[e]&&!t[e+1],i=ri(t[e+1],t[e+2]),n=r?null:Le.instance(i);return[{},n,e+3]}function yr(t,e){let r=t[e]?ft.create(t[e]):null;return[{},r,e+1]}var iu=RegExp(`^T?${mn.source}$`),nu=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function au(t){let[e,r,i,n,a,s,o,l,u]=t,c=e[0]==="-",d=l&&l[0]==="-",f=(m,g=!1)=>m!==void 0&&(g||m&&c)?-m:m;return[{years:f(wt(r)),months:f(wt(i)),weeks:f(wt(n)),days:f(wt(a)),hours:f(wt(s)),minutes:f(wt(o)),seconds:f(wt(l),l==="-0"),milliseconds:f(dn(u),d)}]}var su={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function hn(t,e,r,i,n,a,s){let o={year:e.length===2?sn(lt(e)):lt(e),month:ls.indexOf(r)+1,day:lt(i),hour:lt(n),minute:lt(a)};return s&&(o.second=lt(s)),t&&(o.weekday=t.length>3?cs.indexOf(t)+1:ds.indexOf(t)+1),o}var ou=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function lu(t){let[,e,r,i,n,a,s,o,l,u,c,d]=t,f=hn(e,n,i,r,a,s,o),m;return l?m=su[l]:u?m=0:m=ri(c,d),[f,new Le(m)]}function uu(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var cu=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,du=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,fu=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function pa(t){let[,e,r,i,n,a,s,o]=t;return[hn(e,n,i,r,a,s,o),Le.utcInstance]}function mu(t){let[,e,r,i,n,a,s,o]=t;return[hn(e,o,r,i,n,a,s),Le.utcInstance]}var gu=Ht(Yl,gn),hu=Ht(Ql,gn),yu=Ht(Jl,gn),pu=Ht(Ss),vs=Gt(ru,Qt,hr,yr),Su=Gt(Kl,Qt,hr,yr),bu=Gt(Xl,Qt,hr,yr),vu=Gt(Qt,hr,yr);function Cu(t){return Yt(t,[gu,vs],[hu,Su],[yu,bu],[pu,vu])}function Fu(t){return Yt(uu(t),[ou,lu])}function xu(t){return Yt(t,[cu,pa],[du,pa],[fu,mu])}function wu(t){return Yt(t,[nu,au])}var Tu=Gt(Qt);function Nu(t){return Yt(t,[iu,Tu])}var Ou=Ht(eu,tu),Bu=Ht(bs),Iu=Gt(Qt,hr,yr);function Au(t){return Yt(t,[Ou,vs],[Bu,Iu])}var Sa="Invalid Duration",Cs={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Mu={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Cs},Ae=146097/400,$t=146097/4800,Eu={years:{quarters:4,months:12,weeks:Ae/7,days:Ae,hours:Ae*24,minutes:Ae*24*60,seconds:Ae*24*60*60,milliseconds:Ae*24*60*60*1e3},quarters:{months:3,weeks:Ae/28,days:Ae/4,hours:Ae*24/4,minutes:Ae*24*60/4,seconds:Ae*24*60*60/4,milliseconds:Ae*24*60*60*1e3/4},months:{weeks:$t/7,days:$t,hours:$t*24,minutes:$t*24*60,seconds:$t*24*60*60,milliseconds:$t*24*60*60*1e3},...Cs},Nt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Lu=Nt.slice(0).reverse();function Xe(t,e,r=!1){let i={values:r?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new me(i)}function Fs(t,e){let r=e.milliseconds??0;for(let i of Lu.slice(1))e[i]&&(r+=e[i]*t[i].milliseconds);return r}function ba(t,e){let r=Fs(t,e)<0?-1:1;Nt.reduceRight((i,n)=>{if(Z(e[n]))return i;if(i){let a=e[i]*r,s=t[n][i],o=Math.floor(a/s);e[n]+=o*r,e[i]-=o*s*r}return n},null),Nt.reduce((i,n)=>{if(Z(e[n]))return i;if(i){let a=e[i]%1;e[i]-=a,e[n]+=a*t[i][n]}return n},null)}function va(t){let e={};for(let[r,i]of Object.entries(t))i!==0&&(e[r]=i);return e}var me=class t{constructor(e){let r=e.conversionAccuracy==="longterm"||!1,i=r?Eu:Mu;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||re.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,r){return t.fromObject({milliseconds:e},r)}static fromObject(e,r={}){if(e==null||typeof e!="object")throw new fe(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new t({values:Kr(e,t.normalizeUnit),loc:re.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(e){if(dt(e))return t.fromMillis(e);if(t.isDuration(e))return e;if(typeof e=="object")return t.fromObject(e);throw new fe(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,r){let[i]=wu(e);return i?t.fromObject(i,r):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,r){let[i]=Nu(e);return i?t.fromObject(i,r):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,r=null){if(!e)throw new fe("need to specify a reason the Duration is invalid");let i=e instanceof Ne?e:new Ne(e,r);if(ne.throwOnInvalid)throw new zi(i);return new t({invalid:i})}static normalizeUnit(e){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!r)throw new Hr(e);return r}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,r={}){let i={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Te.create(this.loc,i).formatDurationFromString(this,e):Sa}toHuman(e={}){if(!this.isValid)return Sa;let r=e.showZeros!==!1,i=Nt.map(n=>{let a=this.values[n];return Z(a)||a===0&&!r?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(a)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(i)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=fn(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Q.fromMillis(r,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Fs(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let r=t.fromDurationLike(e),i={};for(let n of Nt)(Ut(r.values,n)||Ut(this.values,n))&&(i[n]=r.get(n)+this.get(n));return Xe(this,{values:i},!0)}minus(e){if(!this.isValid)return this;let r=t.fromDurationLike(e);return this.plus(r.negate())}mapUnits(e){if(!this.isValid)return this;let r={};for(let i of Object.keys(this.values))r[i]=os(e(this.values[i],i));return Xe(this,{values:r},!0)}get(e){return this[t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let r={...this.values,...Kr(e,t.normalizeUnit)};return Xe(this,{values:r})}reconfigure({locale:e,numberingSystem:r,conversionAccuracy:i,matrix:n}={}){let s={loc:this.loc.clone({locale:e,numberingSystem:r}),matrix:n,conversionAccuracy:i};return Xe(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return ba(this.matrix,e),Xe(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=va(this.normalize().shiftToAll().toObject());return Xe(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(s=>t.normalizeUnit(s));let r={},i={},n=this.toObject(),a;for(let s of Nt)if(e.indexOf(s)>=0){a=s;let o=0;for(let u in i)o+=this.matrix[u][s]*i[u],i[u]=0;dt(n[s])&&(o+=n[s]);let l=Math.trunc(o);r[s]=l,i[s]=(o*1e3-l*1e3)/1e3}else dt(n[s])&&(i[s]=n[s]);for(let s in i)i[s]!==0&&(r[a]+=s===a?i[s]:i[s]/this.matrix[a][s]);return ba(this.matrix,r),Xe(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let r of Object.keys(this.values))e[r]=this.values[r]===0?0:-this.values[r];return Xe(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=va(this.values);return Xe(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function r(i,n){return i===void 0||i===0?n===void 0||n===0:i===n}for(let i of Nt)if(!r(this.values[i],e.values[i]))return!1;return!0}},Rt="Invalid Interval";function qu(t,e){return!t||!t.isValid?zt.invalid("missing or invalid start"):!e||!e.isValid?zt.invalid("missing or invalid end"):e<t?zt.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}var zt=class t{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,r=null){if(!e)throw new fe("need to specify a reason the Interval is invalid");let i=e instanceof Ne?e:new Ne(e,r);if(ne.throwOnInvalid)throw new _i(i);return new t({invalid:i})}static fromDateTimes(e,r){let i=lr(e),n=lr(r),a=qu(i,n);return a??new t({start:i,end:n})}static after(e,r){let i=me.fromDurationLike(r),n=lr(e);return t.fromDateTimes(n,n.plus(i))}static before(e,r){let i=me.fromDurationLike(r),n=lr(e);return t.fromDateTimes(n.minus(i),n)}static fromISO(e,r){let[i,n]=(e||"").split("/",2);if(i&&n){let a,s;try{a=Q.fromISO(i,r),s=a.isValid}catch{s=!1}let o,l;try{o=Q.fromISO(n,r),l=o.isValid}catch{l=!1}if(s&&l)return t.fromDateTimes(a,o);if(s){let u=me.fromISO(n,r);if(u.isValid)return t.after(a,u)}else if(l){let u=me.fromISO(i,r);if(u.isValid)return t.before(o,u)}}return t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",r){if(!this.isValid)return NaN;let i=this.start.startOf(e,r),n;return r?.useLocaleWeeks?n=this.end.reconfigure({locale:i.locale}):n=this.end,n=n.startOf(e,r),Math.floor(n.diff(i,e).get(e))+(n.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:r}={}){return this.isValid?t.fromDateTimes(e||this.s,r||this.e):this}splitAt(...e){if(!this.isValid)return[];let r=e.map(lr).filter(s=>this.contains(s)).sort((s,o)=>s.toMillis()-o.toMillis()),i=[],{s:n}=this,a=0;for(;n<this.e;){let s=r[a]||this.e,o=+s>+this.e?this.e:s;i.push(t.fromDateTimes(n,o)),n=o,a+=1}return i}splitBy(e){let r=me.fromDurationLike(e);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:i}=this,n=1,a,s=[];for(;i<this.e;){let o=this.start.plus(r.mapUnits(l=>l*n));a=+o>+this.e?this.e:o,s.push(t.fromDateTimes(i,a)),i=a,n+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let r=this.s>e.s?this.s:e.s,i=this.e<e.e?this.e:e.e;return r>=i?null:t.fromDateTimes(r,i)}union(e){if(!this.isValid)return this;let r=this.s<e.s?this.s:e.s,i=this.e>e.e?this.e:e.e;return t.fromDateTimes(r,i)}static merge(e){let[r,i]=e.sort((n,a)=>n.s-a.s).reduce(([n,a],s)=>a?a.overlaps(s)||a.abutsStart(s)?[n,a.union(s)]:[n.concat([a]),s]:[n,s],[[],null]);return i&&r.push(i),r}static xor(e){let r=null,i=0,n=[],a=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...a),o=s.sort((l,u)=>l.time-u.time);for(let l of o)i+=l.type==="s"?1:-1,i===1?r=l.time:(r&&+r!=+l.time&&n.push(t.fromDateTimes(r,l.time)),r=null);return t.merge(n)}difference(...e){return t.xor([this].concat(e)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Rt}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Gr,r={}){return this.isValid?Te.create(this.s.loc.clone(r),e).formatInterval(this):Rt}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Rt}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Rt}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Rt}toFormat(e,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${r}${this.e.toFormat(e)}`:Rt}toDuration(e,r){return this.isValid?this.e.diff(this.s,e,r):me.invalid(this.invalidReason)}mapEndpoints(e){return t.fromDateTimes(e(this.s),e(this.e))}},jt=class{static hasDST(e=ne.defaultZone){let r=Q.now().setZone(e).set({month:12});return!e.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(e){return ft.isValidZone(e)}static normalizeZone(e){return ut(e,ne.defaultZone)}static getStartOfWeek({locale:e=null,locObj:r=null}={}){return(r||re.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:r=null}={}){return(r||re.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:r=null}={}){return(r||re.create(e)).getWeekendDays().slice()}static months(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||re.create(r,i,a)).months(e)}static monthsFormat(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||re.create(r,i,a)).months(e,!0)}static weekdays(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||re.create(r,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||re.create(r,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return re.create(e).meridiems()}static eras(e="short",{locale:r=null}={}){return re.create(r,null,"gregory").eras(e)}static features(){return{relative:ns(),localeWeek:as()}}};function Ca(t,e){let r=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=r(e)-r(t);return Math.floor(me.fromMillis(i).as("days"))}function Du(t,e,r){let i=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{let c=Ca(l,u);return(c-c%7)/7}],["days",Ca]],n={},a=t,s,o;for(let[l,u]of i)r.indexOf(l)>=0&&(s=l,n[l]=u(t,e),o=a.plus(n),o>e?(n[l]--,t=a.plus(n),t>e&&(o=t,n[l]--,t=a.plus(n))):t=o);return[t,n,o,s]}function Pu(t,e,r,i){let[n,a,s,o]=Du(t,e,r),l=e-n,u=r.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(s<e&&(s=n.plus({[o]:1})),s!==n&&(a[o]=(a[o]||0)+l/(s-n)));let c=me.fromObject(a,i);return u.length>0?me.fromMillis(l,i).shiftTo(...u).plus(c):c}var ku="missing Intl.DateTimeFormat.formatToParts support";function ee(t,e=r=>r){return{regex:t,deser:([r])=>e(Ol(r))}}var Vu="\xA0",xs=`[ ${Vu}]`,ws=new RegExp(xs,"g");function $u(t){return t.replace(/\./g,"\\.?").replace(ws,xs)}function Fa(t){return t.replace(/\./g,"").replace(ws," ").toLowerCase()}function ke(t,e){return t===null?null:{regex:RegExp(t.map($u).join("|")),deser:([r])=>t.findIndex(i=>Fa(r)===Fa(i))+e}}function xa(t,e){return{regex:t,deser:([,r,i])=>ri(r,i),groups:e}}function Wr(t){return{regex:t,deser:([e])=>e}}function Ru(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Wu(t,e){let r=Pe(e),i=Pe(e,"{2}"),n=Pe(e,"{3}"),a=Pe(e,"{4}"),s=Pe(e,"{6}"),o=Pe(e,"{1,2}"),l=Pe(e,"{1,3}"),u=Pe(e,"{1,6}"),c=Pe(e,"{1,9}"),d=Pe(e,"{2,4}"),f=Pe(e,"{4,6}"),m=y=>({regex:RegExp(Ru(y.val)),deser:([b])=>b,literal:!0}),h=(y=>{if(t.literal)return m(y);switch(y.val){case"G":return ke(e.eras("short"),0);case"GG":return ke(e.eras("long"),0);case"y":return ee(u);case"yy":return ee(d,sn);case"yyyy":return ee(a);case"yyyyy":return ee(f);case"yyyyyy":return ee(s);case"M":return ee(o);case"MM":return ee(i);case"MMM":return ke(e.months("short",!0),1);case"MMMM":return ke(e.months("long",!0),1);case"L":return ee(o);case"LL":return ee(i);case"LLL":return ke(e.months("short",!1),1);case"LLLL":return ke(e.months("long",!1),1);case"d":return ee(o);case"dd":return ee(i);case"o":return ee(l);case"ooo":return ee(n);case"HH":return ee(i);case"H":return ee(o);case"hh":return ee(i);case"h":return ee(o);case"mm":return ee(i);case"m":return ee(o);case"q":return ee(o);case"qq":return ee(i);case"s":return ee(o);case"ss":return ee(i);case"S":return ee(l);case"SSS":return ee(n);case"u":return Wr(c);case"uu":return Wr(o);case"uuu":return ee(r);case"a":return ke(e.meridiems(),0);case"kkkk":return ee(a);case"kk":return ee(d,sn);case"W":return ee(o);case"WW":return ee(i);case"E":case"c":return ee(r);case"EEE":return ke(e.weekdays("short",!1),1);case"EEEE":return ke(e.weekdays("long",!1),1);case"ccc":return ke(e.weekdays("short",!0),1);case"cccc":return ke(e.weekdays("long",!0),1);case"Z":case"ZZ":return xa(new RegExp(`([+-]${o.source})(?::(${i.source}))?`),2);case"ZZZ":return xa(new RegExp(`([+-]${o.source})(${i.source})?`),2);case"z":return Wr(/[a-z_+-/]{1,256}?/i);case" ":return Wr(/[^\S\n\r]/);default:return m(y)}})(t)||{invalidReason:ku};return h.token=t,h}var ju={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Zu(t,e,r){let{type:i,value:n}=t;if(i==="literal"){let l=/^\s+$/.test(n);return{literal:!l,val:l?" ":n}}let a=e[i],s=i;i==="hour"&&(e.hour12!=null?s=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?s="hour12":s="hour24":s=r.hour12?"hour12":"hour24");let o=ju[s];if(typeof o=="object"&&(o=o[a]),o)return{literal:!1,val:o}}function _u(t){return[`^${t.map(r=>r.regex).reduce((r,i)=>`${r}(${i.source})`,"")}$`,t]}function zu(t,e,r){let i=t.match(e);if(i){let n={},a=1;for(let s in r)if(Ut(r,s)){let o=r[s],l=o.groups?o.groups+1:1;!o.literal&&o.token&&(n[o.token.val[0]]=o.deser(i.slice(a,a+l))),a+=l}return[i,n]}else return[i,{}]}function Uu(t){let e=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,i;return Z(t.z)||(r=ft.create(t.z)),Z(t.Z)||(r||(r=new Le(t.Z)),i=t.Z),Z(t.q)||(t.M=(t.q-1)*3+1),Z(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Z(t.u)||(t.S=dn(t.u)),[Object.keys(t).reduce((a,s)=>{let o=e(s);return o&&(a[o]=t[s]),a},{}),r,i]}var Vi=null;function Hu(){return Vi||(Vi=Q.fromMillis(1555555555555)),Vi}function Gu(t,e){if(t.literal)return t;let r=Te.macroTokenToFormatOpts(t.val),i=Os(r,e);return i==null||i.includes(void 0)?t:i}function Ts(t,e){return Array.prototype.concat(...t.map(r=>Gu(r,e)))}var Xr=class{constructor(e,r){if(this.locale=e,this.format=r,this.tokens=Ts(Te.parseFormat(r),e),this.units=this.tokens.map(i=>Wu(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){let[i,n]=_u(this.units);this.regex=RegExp(i,"i"),this.handlers=n}}explainFromTokens(e){if(this.isValid){let[r,i]=zu(e,this.regex,this.handlers),[n,a,s]=i?Uu(i):[null,null,void 0];if(Ut(i,"a")&&Ut(i,"H"))throw new ct("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:r,matches:i,result:n,zone:a,specificOffset:s}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function Ns(t,e,r){return new Xr(t,r).explainFromTokens(e)}function Yu(t,e,r){let{result:i,zone:n,specificOffset:a,invalidReason:s}=Ns(t,e,r);return[i,n,a,s]}function Os(t,e){if(!t)return null;let i=Te.create(e,t).dtFormatter(Hu()),n=i.formatToParts(),a=i.resolvedOptions();return n.map(s=>Zu(s,t,a))}var $i="Invalid DateTime",wa=864e13;function cr(t){return new Ne("unsupported zone",`the zone "${t.name}" is not supported`)}function Ri(t){return t.weekData===null&&(t.weekData=Qr(t.c)),t.weekData}function Wi(t){return t.localWeekData===null&&(t.localWeekData=Qr(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Tt(t,e){let r={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Q({...r,...e,old:r})}function Bs(t,e,r){let i=t-e*60*1e3,n=r.offset(i);if(e===n)return[i,e];i-=(n-e)*60*1e3;let a=r.offset(i);return n===a?[i,n]:[t-Math.min(n,a)*60*1e3,Math.max(n,a)]}function jr(t,e){t+=e*60*1e3;let r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function _r(t,e,r){return Bs(ti(t),e,r)}function Ta(t,e){let r=t.o,i=t.c.year+Math.trunc(e.years),n=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,a={...t.c,year:i,month:n,day:Math.min(t.c.day,Jr(i,n))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},s=me.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=ti(a),[l,u]=Bs(o,r,t.zone);return s!==0&&(l+=s,u=t.zone.offset(l)),{ts:l,o:u}}function Wt(t,e,r,i,n,a){let{setZone:s,zone:o}=r;if(t&&Object.keys(t).length!==0||e){let l=e||o,u=Q.fromObject(t,{...r,zone:l,specificOffset:a});return s?u:u.setZone(o)}else return Q.invalid(new Ne("unparsable",`the input "${n}" can't be parsed as ${i}`))}function Zr(t,e,r=!0){return t.isValid?Te.create(re.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(t,e):null}function ji(t,e,r){let i=t.c.year>9999||t.c.year<0,n="";if(i&&t.c.year>=0&&(n+="+"),n+=ue(t.c.year,i?6:4),r==="year")return n;if(e){if(n+="-",n+=ue(t.c.month),r==="month")return n;n+="-"}else if(n+=ue(t.c.month),r==="month")return n;return n+=ue(t.c.day),n}function Na(t,e,r,i,n,a,s){let o=!r||t.c.millisecond!==0||t.c.second!==0,l="";switch(s){case"day":case"month":case"year":break;default:if(l+=ue(t.c.hour),s==="hour")break;if(e){if(l+=":",l+=ue(t.c.minute),s==="minute")break;o&&(l+=":",l+=ue(t.c.second))}else{if(l+=ue(t.c.minute),s==="minute")break;o&&(l+=ue(t.c.second))}if(s==="second")break;o&&(!i||t.c.millisecond!==0)&&(l+=".",l+=ue(t.c.millisecond,3))}return n&&(t.isOffsetFixed&&t.offset===0&&!a?l+="Z":t.o<0?(l+="-",l+=ue(Math.trunc(-t.o/60)),l+=":",l+=ue(Math.trunc(-t.o%60))):(l+="+",l+=ue(Math.trunc(t.o/60)),l+=":",l+=ue(Math.trunc(t.o%60)))),a&&(l+="["+t.zone.ianaName+"]"),l}var Is={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Qu={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ju={ordinal:1,hour:0,minute:0,second:0,millisecond:0},zr=["year","month","day","hour","minute","second","millisecond"],Ku=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Xu=["year","ordinal","hour","minute","second","millisecond"];function Ur(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Hr(t);return e}function Oa(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Ur(t)}}function ec(t){if(dr===void 0&&(dr=ne.now()),t.type!=="iana")return t.offset(dr);let e=t.name,r=on.get(e);return r===void 0&&(r=t.offset(dr),on.set(e,r)),r}function Ba(t,e){let r=ut(e.zone,ne.defaultZone);if(!r.isValid)return Q.invalid(cr(r));let i=re.fromObject(e),n,a;if(Z(t.year))n=ne.now();else{for(let l of zr)Z(t[l])&&(t[l]=Is[l]);let s=rs(t)||is(t);if(s)return Q.invalid(s);let o=ec(r);[n,a]=_r(t,o,r)}return new Q({ts:n,zone:r,loc:i,o:a})}function Ia(t,e,r){let i=Z(r.round)?!0:r.round,n=Z(r.rounding)?"trunc":r.rounding,a=(o,l)=>(o=fn(o,i||r.calendary?0:2,r.calendary?"round":n),e.loc.clone(r).relFormatter(r).format(o,l)),s=o=>r.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(r.unit)return a(s(r.unit),r.unit);for(let o of r.units){let l=s(o);if(Math.abs(l)>=1)return a(l,o)}return a(t>e?-0:0,r.units[r.units.length-1])}function Aa(t){let e={},r;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],r=Array.from(t).slice(0,t.length-1)):r=Array.from(t),[e,r]}var dr,on=new Map,Q=class t{constructor(e){let r=e.zone||ne.defaultZone,i=e.invalid||(Number.isNaN(e.ts)?new Ne("invalid input"):null)||(r.isValid?null:cr(r));this.ts=Z(e.ts)?ne.now():e.ts;let n=null,a=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(r))[n,a]=[e.old.c,e.old.o];else{let o=dt(e.o)&&!e.old?e.o:r.offset(this.ts);n=jr(this.ts,o),i=Number.isNaN(n.year)?new Ne("invalid input"):null,n=i?null:n,a=i?null:o}this._zone=r,this.loc=e.loc||re.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=n,this.o=a,this.isLuxonDateTime=!0}static now(){return new t({})}static local(){let[e,r]=Aa(arguments),[i,n,a,s,o,l,u]=r;return Ba({year:i,month:n,day:a,hour:s,minute:o,second:l,millisecond:u},e)}static utc(){let[e,r]=Aa(arguments),[i,n,a,s,o,l,u]=r;return e.zone=Le.utcInstance,Ba({year:i,month:n,day:a,hour:s,minute:o,second:l,millisecond:u},e)}static fromJSDate(e,r={}){let i=El(e)?e.valueOf():NaN;if(Number.isNaN(i))return t.invalid("invalid input");let n=ut(r.zone,ne.defaultZone);return n.isValid?new t({ts:i,zone:n,loc:re.fromObject(r)}):t.invalid(cr(n))}static fromMillis(e,r={}){if(dt(e))return e<-wa||e>wa?t.invalid("Timestamp out of range"):new t({ts:e,zone:ut(r.zone,ne.defaultZone),loc:re.fromObject(r)});throw new fe(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,r={}){if(dt(e))return new t({ts:e*1e3,zone:ut(r.zone,ne.defaultZone),loc:re.fromObject(r)});throw new fe("fromSeconds requires a numerical input")}static fromObject(e,r={}){e=e||{};let i=ut(r.zone,ne.defaultZone);if(!i.isValid)return t.invalid(cr(i));let n=re.fromObject(r),a=Kr(e,Oa),{minDaysInFirstWeek:s,startOfWeek:o}=ma(a,n),l=ne.now(),u=Z(r.specificOffset)?i.offset(l):r.specificOffset,c=!Z(a.ordinal),d=!Z(a.year),f=!Z(a.month)||!Z(a.day),m=d||f,g=a.weekYear||a.weekNumber;if((m||c)&&g)throw new ct("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&c)throw new ct("Can't mix ordinal dates with month/day");let h=g||a.weekday&&!m,y,b,x=jr(l,u);h?(y=Ku,b=Qu,x=Qr(x,s,o)):c?(y=Xu,b=Ju,x=ki(x)):(y=zr,b=Is);let w=!1;for(let N of y){let A=a[N];Z(A)?w?a[N]=b[N]:a[N]=x[N]:w=!0}let C=h?Il(a,s,o):c?Al(a):rs(a),v=C||is(a);if(v)return t.invalid(v);let T=h?da(a,s,o):c?fa(a):a,[O,I]=_r(T,u,i),B=new t({ts:O,zone:i,o:I,loc:n});return a.weekday&&m&&e.weekday!==B.weekday?t.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${B.toISO()}`):B.isValid?B:t.invalid(B.invalid)}static fromISO(e,r={}){let[i,n]=Cu(e);return Wt(i,n,r,"ISO 8601",e)}static fromRFC2822(e,r={}){let[i,n]=Fu(e);return Wt(i,n,r,"RFC 2822",e)}static fromHTTP(e,r={}){let[i,n]=xu(e);return Wt(i,n,r,"HTTP",r)}static fromFormat(e,r,i={}){if(Z(e)||Z(r))throw new fe("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:a=null}=i,s=re.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0}),[o,l,u,c]=Yu(s,e,r);return c?t.invalid(c):Wt(o,l,i,`format ${r}`,e,u)}static fromString(e,r,i={}){return t.fromFormat(e,r,i)}static fromSQL(e,r={}){let[i,n]=Au(e);return Wt(i,n,r,"SQL",e)}static invalid(e,r=null){if(!e)throw new fe("need to specify a reason the DateTime is invalid");let i=e instanceof Ne?e:new Ne(e,r);if(ne.throwOnInvalid)throw new Zi(i);return new t({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,r={}){let i=Os(e,re.fromObject(r));return i?i.map(n=>n?n.val:null).join(""):null}static expandFormat(e,r={}){return Ts(Te.parseFormat(e),re.fromObject(r)).map(n=>n.val).join("")}static resetCache(){dr=void 0,on.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ri(this).weekYear:NaN}get weekNumber(){return this.isValid?Ri(this).weekNumber:NaN}get weekday(){return this.isValid?Ri(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Wi(this).weekday:NaN}get localWeekNumber(){return this.isValid?Wi(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Wi(this).weekYear:NaN}get ordinal(){return this.isValid?ki(this.c).ordinal:NaN}get monthShort(){return this.isValid?jt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?jt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?jt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?jt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,r=6e4,i=ti(this.c),n=this.zone.offset(i-e),a=this.zone.offset(i+e),s=this.zone.offset(i-n*r),o=this.zone.offset(i-a*r);if(s===o)return[this];let l=i-s*r,u=i-o*r,c=jr(l,s),d=jr(u,o);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[Tt(this,{ts:l}),Tt(this,{ts:u})]:[this]}get isInLeapYear(){return gr(this.year)}get daysInMonth(){return Jr(this.year,this.month)}get daysInYear(){return this.isValid?Zt(this.year):NaN}get weeksInWeekYear(){return this.isValid?mr(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?mr(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:r,numberingSystem:i,calendar:n}=Te.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:r,numberingSystem:i,outputCalendar:n}}toUTC(e=0,r={}){return this.setZone(Le.instance(e),r)}toLocal(){return this.setZone(ne.defaultZone)}setZone(e,{keepLocalTime:r=!1,keepCalendarTime:i=!1}={}){if(e=ut(e,ne.defaultZone),e.equals(this.zone))return this;if(e.isValid){let n=this.ts;if(r||i){let a=e.offset(this.ts),s=this.toObject();[n]=_r(s,a,e)}return Tt(this,{ts:n,zone:e})}else return t.invalid(cr(e))}reconfigure({locale:e,numberingSystem:r,outputCalendar:i}={}){let n=this.loc.clone({locale:e,numberingSystem:r,outputCalendar:i});return Tt(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let r=Kr(e,Oa),{minDaysInFirstWeek:i,startOfWeek:n}=ma(r,this.loc),a=!Z(r.weekYear)||!Z(r.weekNumber)||!Z(r.weekday),s=!Z(r.ordinal),o=!Z(r.year),l=!Z(r.month)||!Z(r.day),u=o||l,c=r.weekYear||r.weekNumber;if((u||s)&&c)throw new ct("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new ct("Can't mix ordinal dates with month/day");let d;a?d=da({...Qr(this.c,i,n),...r},i,n):Z(r.ordinal)?(d={...this.toObject(),...r},Z(r.day)&&(d.day=Math.min(Jr(d.year,d.month),d.day))):d=fa({...ki(this.c),...r});let[f,m]=_r(d,this.o,this.zone);return Tt(this,{ts:f,o:m})}plus(e){if(!this.isValid)return this;let r=me.fromDurationLike(e);return Tt(this,Ta(this,r))}minus(e){if(!this.isValid)return this;let r=me.fromDurationLike(e).negate();return Tt(this,Ta(this,r))}startOf(e,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;let i={},n=me.normalizeUnit(e);switch(n){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(n==="weeks")if(r){let a=this.loc.getStartOfWeek(),{weekday:s}=this;s<a&&(i.weekNumber=this.weekNumber-1),i.weekday=a}else i.weekday=1;if(n==="quarters"){let a=Math.ceil(this.month/3);i.month=(a-1)*3+1}return this.set(i)}endOf(e,r){return this.isValid?this.plus({[e]:1}).startOf(e,r).minus(1):this}toFormat(e,r={}){return this.isValid?Te.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,e):$i}toLocaleString(e=Gr,r={}){return this.isValid?Te.create(this.loc.clone(r),e).formatDateTime(this):$i}toLocaleParts(e={}){return this.isValid?Te.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:r=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:a=!1,precision:s="milliseconds"}={}){if(!this.isValid)return null;s=Ur(s);let o=e==="extended",l=ji(this,o,s);return zr.indexOf(s)>=3&&(l+="T"),l+=Na(this,o,r,i,n,a,s),l}toISODate({format:e="extended",precision:r="day"}={}){return this.isValid?ji(this,e==="extended",Ur(r)):null}toISOWeekDate(){return Zr(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:r=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:a=!1,format:s="extended",precision:o="milliseconds"}={}){return this.isValid?(o=Ur(o),(n&&zr.indexOf(o)>=3?"T":"")+Na(this,s==="extended",r,e,i,a,o)):null}toRFC2822(){return Zr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Zr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ji(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:r=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(r||e)&&(i&&(n+=" "),r?n+="z":e&&(n+="ZZ")),Zr(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():$i}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let r={...this.c};return e.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,r="milliseconds",i={}){if(!this.isValid||!e.isValid)return me.invalid("created by diffing an invalid DateTime");let n={locale:this.locale,numberingSystem:this.numberingSystem,...i},a=Ll(r).map(me.normalizeUnit),s=e.valueOf()>this.valueOf(),o=s?this:e,l=s?e:this,u=Pu(o,l,a,n);return s?u.negate():u}diffNow(e="milliseconds",r={}){return this.diff(t.now(),e,r)}until(e){return this.isValid?zt.fromDateTimes(this,e):this}hasSame(e,r,i){if(!this.isValid)return!1;let n=e.valueOf(),a=this.setZone(e.zone,{keepLocalTime:!0});return a.startOf(r,i)<=n&&n<=a.endOf(r,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let r=e.base||t.fromObject({},{zone:this.zone}),i=e.padding?this<r?-e.padding:e.padding:0,n=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(n=e.unit,a=void 0),Ia(r,this.plus(i),{...e,numeric:"always",units:n,unit:a})}toRelativeCalendar(e={}){return this.isValid?Ia(e.base||t.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(t.isDateTime))throw new fe("min requires all arguments be DateTimes");return ga(e,r=>r.valueOf(),Math.min)}static max(...e){if(!e.every(t.isDateTime))throw new fe("max requires all arguments be DateTimes");return ga(e,r=>r.valueOf(),Math.max)}static fromFormatExplain(e,r,i={}){let{locale:n=null,numberingSystem:a=null}=i,s=re.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0});return Ns(s,e,r)}static fromStringExplain(e,r,i={}){return t.fromFormatExplain(e,r,i)}static buildFormatParser(e,r={}){let{locale:i=null,numberingSystem:n=null}=r,a=re.fromOpts({locale:i,numberingSystem:n,defaultToEN:!0});return new Xr(a,e)}static fromFormatParser(e,r,i={}){if(Z(e)||Z(r))throw new fe("fromFormatParser requires an input string and a format parser");let{locale:n=null,numberingSystem:a=null}=i,s=re.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0});if(!s.equals(r.locale))throw new fe(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${r.locale}`);let{result:o,zone:l,specificOffset:u,invalidReason:c}=r.explainFromTokens(e);return c?t.invalid(c):Wt(o,l,i,`format ${r.format}`,e,u)}static get DATE_SHORT(){return Gr}static get DATE_MED(){return Ma}static get DATE_MED_WITH_WEEKDAY(){return cl}static get DATE_FULL(){return Ea}static get DATE_HUGE(){return La}static get TIME_SIMPLE(){return qa}static get TIME_WITH_SECONDS(){return Da}static get TIME_WITH_SHORT_OFFSET(){return Pa}static get TIME_WITH_LONG_OFFSET(){return ka}static get TIME_24_SIMPLE(){return Va}static get TIME_24_WITH_SECONDS(){return $a}static get TIME_24_WITH_SHORT_OFFSET(){return Ra}static get TIME_24_WITH_LONG_OFFSET(){return Wa}static get DATETIME_SHORT(){return ja}static get DATETIME_SHORT_WITH_SECONDS(){return Za}static get DATETIME_MED(){return _a}static get DATETIME_MED_WITH_SECONDS(){return za}static get DATETIME_MED_WITH_WEEKDAY(){return dl}static get DATETIME_FULL(){return Ua}static get DATETIME_FULL_WITH_SECONDS(){return Ha}static get DATETIME_HUGE(){return Ga}static get DATETIME_HUGE_WITH_SECONDS(){return Ya}};function lr(t){if(Q.isDateTime(t))return t;if(t&&t.valueOf&&dt(t.valueOf()))return Q.fromJSDate(t);if(t&&typeof t=="object")return Q.fromObject(t);throw new fe(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function As(t){var e,r,i=t.length;if(i===1)e=0,r=t[0][1];else{for(var n=0,a=0,s=0,o=0,l,u,c,d=0;d<i;d++)l=t[d],u=l[0],c=l[1],n+=u,a+=c,s+=u*u,o+=u*c;e=(i*o-n*a)/(i*s-n*n),r=a/i-e*n/i}return{m:e,b:r}}function Ms(t){return function(e){return t.b+t.m*e}}function Es(t,e){if(t.length<2)return 1;for(var r=0,i=0;i<t.length;i++)r+=t[i][1];for(var n=r/t.length,a=0,s=0;s<t.length;s++)a+=Math.pow(n-t[s][1],2);for(var o=0,l=0;l<t.length;l++)o+=Math.pow(t[l][1]-e(t[l][0]),2);return 1-o/a}var Ls=function(){this.totalCount=0,this.data={}};Ls.prototype.train=function(e,r){this.data[r]||(this.data[r]={});for(var i in e){var n=e[i];this.data[r][i]===void 0&&(this.data[r][i]={}),this.data[r][i][n]===void 0&&(this.data[r][i][n]=0),this.data[r][i][n]++}this.totalCount++};Ls.prototype.score=function(e){var r={},i;for(var n in e){var a=e[n];for(i in this.data)r[i]={},this.data[i][n]?r[i][n+"_"+a]=(this.data[i][n][a]||0)/this.totalCount:r[i][n+"_"+a]=0}var s={};for(i in r){s[i]=0;for(var o in r[i])s[i]+=r[i][o]}return s};var qs=function(){this.weights=[],this.bias=0};qs.prototype.predict=function(e){if(e.length!==this.weights.length)return null;for(var r=0,i=0;i<this.weights.length;i++)r+=this.weights[i]*e[i];return r+=this.bias,r>0?1:0};qs.prototype.train=function(e,r){if(r!==0&&r!==1)return null;e.length!==this.weights.length&&(this.weights=e,this.bias=1);var i=this.predict(e);if(typeof i=="number"&&i!==r){for(var n=r-i,a=0;a<this.weights.length;a++)this.weights[a]+=n*e[a];this.bias+=n}return this};var Mh=607/128,Eh=Math.log(Math.sqrt(2*Math.PI));var Lh=Math.sqrt(2*Math.PI);var tc=Math.sqrt(2*Math.PI);function rc(t){for(var e=t,r=t,i=1;i<15;i++)r*=t*t/(2*i+1),e+=r;return Math.round((.5+e/tc*Math.exp(-t*t/2))*1e4)/1e4}var ic=[];for(ni=0;ni<=3.09;ni+=.01)ic.push(rc(ni));var ni;function oi(t){return t?.type===p.NumberAxisFormat}function Sy(t){return oi(t)&&t.intlOptions?.style==="percent"}function We(t){return t.axes?.[0]?.valueFormat?.type}function by(t){return t.intlOptions}function li(t){return t?.type===p.CategoryAxisFormat}function mo(t){return t?.type===p.DateAxisFormat}function vy(t){let{oldConfig:e,newConfig:r,rotationChanged:i}=t;return i?[!0,!0]:[e.horizontalAxisLabelsBehavior!==r.horizontalAxisLabelsBehavior,e.verticalAxisLabelsBehavior!==r.verticalAxisLabelsBehavior]}function Fc(t){let{isXAxis:e,chartType:r,valueFormat:i,isAxisForHistogramOverlaySeries:n}=t;return r===p.HeatSeries||e&&(li(i)||r===p.HistogramSeries&&!n||r===p.BarSeries&&oi(i))}var pr={...F,titleAndSubtitlePaddingBottom:5,chartPadding:5,footerContainer:{...F.footerContainer,paddingTop:0,paddingBottom:0},headerContainer:{...F.headerContainer,paddingBottom:18},chartContainer:{...F.chartContainer},dataLabel:{...F.dataLabel,verticalCenter:"bottom"},scrollbarPadding:12,zIndexes:{defaultLayer30:30,customLayer10:10,customLayer5:5},verticalSurfaceGuideLabels:{wrap:!0},verticalLineGuideLabels:{wrap:!0,rotation:90},horizontalSurfaceGuideLabels:{wrap:!0},horizontalLineGuideLabels:{wrap:!0},overlayId:{scatterplotTrendLine:"arcgis_charts_scatter_plot_trendline",histogramMean:"arcgis_charts_histogram_mean",histogramMedian:"arcgis_charts_histogram_median",histogramStdDev:"arcgis_charts_histogram_std_dev",histogramNormalDistribution:"arcgis_charts_histogram_normal_distribution"},axisLabelSpacing:{verticalAxisLabelSidePadding:8,horizontalAxisLabelPaddingTop:6},legendPadding:20,heatChart:{gradientHeatRules:{minColor:[255,255,200,255],maxColor:[255,0,0,255],outsideRangeLowerColor:[250,250,250,255],outsideRangeUpperColor:[0,0,255,255]},legend:{position:_n.Bottom,chartPadding:40,legendPadding:20,width:70,bottomHeight:20,topHeight:50,titleHeight:10,titlePadding:10,minMaxLabelPadding:3},emptyCells:{symbol:{type:Ie.SFS,style:qr.Solid,color:F.grayColor},text:"null"},includeLeapDay:!1},heatChartLabelPadding:{paddingTop:2},pieChartDataLabel:{minWidth:30},focusableThreshold:500,lineJoin:"round"},P={Min:"min",FirstQuartile:"first_quartile",Median:"median",ThirdQuartile:"third_quartile",Max:"max",IQR:"iqr",Average:"avg",StandardDeviation:"stddev",Outlier:"outlier"},ge=class extends Error{constructor(e,r,i){super(r),this.name=e,this.details=i}},pe={Default:"defaultError",LayerLoadFailure:"layerLoadFailure",QueryFeaturesError:"queryFeaturesError",ChartDisposed:"ChartDisposeError",LayerFieldsNotFound:"layerFieldsNotFound",LayerNotSupported:"layerNotSupported"};function xc(t,e){let r=Q.now().offset/60,i=Q.now().setZone(t)??r,n=i.offset/60,a=e?i.setZone(e).offset/60:0;return n-a}function go(t){let{outTimeZone:e=Intl.DateTimeFormat().resolvedOptions().timeZone,dataTimeZone:r="UTC",runsOnClientQueryEngine:i}=t,n="",a=xc(e,r);if(a!==0)if(i)n=`${a>0?"+":"-"}1*INTERVAL '${Math.abs(a)}' HOUR `;else{let s=Math.abs(a%1),o=Math.round(s*60);a=Math.floor(a),n=a>0?`+INTERVAL '${Math.abs(a)}:${o!==0?o:"00"}:01' HOUR TO SECOND`:`-INTERVAL '${Math.abs(a)-(o!==0?0:1)}:${o!==0?String(o-1):"59"}:59' HOUR TO SECOND`}return n}function wc(t){let{dateFieldName:e,unit:r,runsOnClientQueryEngine:i,outTimeZone:n}=t,a=go({runsOnClientQueryEngine:i,outTimeZone:n}),s=`EXTRACT(YEAR FROM ${e} ${a})`,o=`EXTRACT(MONTH FROM ${e} ${a})`,l=`EXTRACT(DAY FROM ${e} ${a})`,u=`EXTRACT(HOUR FROM ${e} ${a})`,c=`EXTRACT(MINUTE FROM ${e} ${a})`,d=`EXTRACT(SECOND FROM ${e} ${a})`,f=[];switch(r){case U.Second:f=[s,o,l,u,c,d];break;case U.Minute:f=[s,o,l,u,c];break;case U.Hour:f=[s,o,l,u];break;case U.Day:case U.Week:case U.Month:case U.Year:f=[s,o,l];break}return f}function Cy(t){return t!==void 0&&(!("url"in t)||!t.url)}function gt(t){return t!==void 0&&"view"in t&&"layer"in t&&"queryFeatures"in t&&"queryFeatureCount"in t&&"queryObjectIds"in t}function Tc(t){return t!==void 0&&"type"in t&&t.type==="feature"}function Nc(t){return t!==void 0&&!se(t)&&"fields"in t&&"capabilities"in t&&"queryFeatures"in t&&typeof t.queryFeatures=="function"&&"queryFeatureCount"in t&&typeof t.queryFeatureCount=="function"}function Fy(t){return t!==void 0&&!se(t)&&"fields"in t&&"objectIdField"in t&&typeof t.objectIdField=="string"&&"createQuery"in t&&typeof t.createQuery=="function"&&"queryFeatures"in t&&typeof t.queryFeatures=="function"}function ho(t){return t!==void 0&&"type"in t&&t.type==="subtype-sublayer"}function Oc(t){return Nc(t)||ho(t)}function qe(t){return ho(t)?t.parent??void 0:t}function yo(t){return t?.capabilities?.query?.supportsDistance||qe(t)?.sourceJSON?.advancedQueryCapabilities?.supportsQueryWithDistance===!0}function Bc(t){return t?.capabilities?.queryAttributeBins?.supportsFixedInterval===!0&&t?.capabilities?.queryAttributeBins?.supportsStackBy}function xy(t){let{chartConfig:e,queryObject:r,options:i}=t,n=j(e?.series),a=de(e?.series[0]?.query?.where);return!(n===p.HeatSeries||e&&it({xAxisValueFormatType:We(e),setTimeBinningInfoWhenNotProvided:i?.setTimeBinningInfoWhenNotProvided,seriesConfig:e.series[0],queryObject:r})&&er(a,r))}function er(t,e){return e!==void 0&&(gt(e)||!se(e)&&"capabilities"in e&&e.capabilities?.queryAttributeBins?.supportsDate===!0&&(le(t)||(e.capabilities.queryAttributeBins.supportsStackBy??!1)))}function Ic(t){let e=!1,r=qe(J(t))?.sourceJSON;if(r){let i=r.queryBinsCapabilities?.supportsFixedIntervalBin,n=r.queryBinsCapabilities?.supportedStatisticTypes,a=[L.Maximum,L.Count].every(s=>n?.includes(s.toUpperCase())||n?.includes(s.toLowerCase()));e=i&&a}return e}function wy(t){let e;return gt(t)?e=t.layer:e=t,e}function J(t){let e;return gt(t)?e=t.layer:e=t,e}function Ac(t){let e=!1,r=qe(t)?.sourceJSON?.advancedQueryCapabilities?.supportedSpatialAggregationStatistics??[],i=t?.capabilities?.query.supportedSpatialAggregationStatistics??{};return e=r.includes("EnvelopeAggregate")||"envelope"in i&&i.envelope===!0,e}function Ty(t){let{chartConfig:e,queryObject:r}=t,i;if(r){let n=J(r);ot(n)?i={id:n.id,layerType:"ArcGISImageServiceLayer"}:Li(n)?i={id:n.id,layerType:"ArcGISTiledImageServiceLayer"}:i={id:n.id,layerType:"ArcGISFeatureLayer"},n.url&&(i.url=n.url)}return{...e,iLayer:i}}var It=new Map;function Mc(t){let e;switch(t){case"feet":e="esriSRUnit_Foot";break;case"miles":e="esriSRUnit_StatuteMile";break;case"nautical-miles":e="esriSRUnit_NauticalMile";break;case"us-nautical-miles":e="esriSRUnit_USNauticalMile";break;case"meters":e="esriSRUnit_Meter";break;case"kilometers":e="esriSRUnit_Kilometer";break}return e}async function Ec(t){let{queryObject:e,queryConfig:r,outputFormat:i,dataFormat:n,outAnalytics:a,errorStrings:s,abortSignal:o}=t,{where:l,geometry:u,distance:c,units:d,timeExtent:f}=r,m,g=J(e),h=qe(g);if(h){let y={where:te([l,h.definitionExpression])},b={query:y,signal:o},x=qt(u)?.extent?.toJSON();if(x!==void 0){let C=Mc(d),{xmin:v,ymin:T,xmax:O,ymax:I}=x;y.geometryType="esriGeometryEnvelope",y.geometry=`${v},${T},${O},${I}`,c!==void 0&&(y.distance=c.toString()),C!==void 0&&(y.units=C,u?.spatialReference?.wkid!=null&&(y.inSR=u.spatialReference.wkid.toString()))}f&&(y.time=`${f[0]},${f[1]}`);let w=`${h.url}/${h.layerId}/queryAnalytic?f=${i}&dataFormat=${n}&outAnalytics=${a}`;try{m=(await si(w,b)).data?.features?.[0]?.attributes}catch(C){let v=s??(await bt(at(document.documentElement).t9nLocale,kt("./assets/common/t9n"),"messages.")).errorStrings;throw new ge(pe.QueryFeaturesError,v.errors.queryError,C)}}return m}function po(t,e){return{lowerBoundaryAlias:`charts_lower_boundary_${t}`,upperBoundaryAlias:`charts_upper_boundary_${t}`,stackAlias:`charts_stack_alias_${e}`}}async function Lc(t){let{chartConfig:e,queryObject:r,queryConfig:i,view:n,syncViewTimeZone:a,returnStatisticsAggregatedIds:s,errorStrings:o,abortSignal:l}=t,u,c=J(r),d=Bc(c);if(d&&r&&"queryAttributeBins"in r&&r.queryAttributeBins){let{x:f,y:m,xTemporalBinning:g,yTemporalBinning:h}=e.series[0],{outTimeZone:y,firstDayOfWeek:b,includeLeapDay:x}=e,w=Gc({queryObject:r,queryConfig:i,x:f,y:m,xTemporalBinning:g,yTemporalBinning:h,configTimeZone:y,firstDayOfWeek:b,includeLeapDay:x,view:n,syncViewTimeZone:a,returnStatisticsAggregatedIds:s});try{u=await r.queryAttributeBins(w,{signal:l})}catch(C){throw new ge(pe.QueryFeaturesError,o.errors.queryError,C)}}if(!d)throw new ge(pe.QueryFeaturesError,o.errors.queryBinsNotSupported,o.errors.queryBinsNotSupported);return u}async function qc(t){let{chartConfig:e,queryObject:r,queryConfig:i,returnFeaturesExtent:n,returnStatisticsAggregatedIds:a,errorStrings:s,abortKey:o,abortSignal:l}=t,u=e.series[0],c,{x:d,y:f}=u;i.groupByFieldsForStatistics=[d],d!==f&&i.groupByFieldsForStatistics.push(f),i&&n===!0&&!i.outStatistics?.some(m=>m.statisticType===L.EnvelopeAggregate)&&i.outStatistics?.push({statisticType:L.EnvelopeAggregate,onStatisticField:"1"});try{c=await De({queryObject:r,queryConfig:i,errorStrings:s,returnStatisticsAggregatedIds:a,abortKey:o,abortSignal:l})}catch(m){throw new ge(pe.QueryFeaturesError,s.errors.queryError,m)}return c}async function Dc(t){let{queryObject:e,queryConfig:r,xStep:i,xMin:n,xMax:a,x:s,y:o,yStep:l,returnStatisticsAggregatedIds:u,errorStrings:c,abortSignal:d}=t,f;if(e&&"queryAttributeBins"in e&&e.queryAttributeBins&&Number.isFinite(i)&&Number.isFinite(l)&&Number.isFinite(n)&&Number.isFinite(a)&&i>0&&l>0){let m=Yc({queryObject:e,queryConfig:r,xStep:i,xMin:n,xMax:a,x:s,y:o,yStep:l,returnStatisticsAggregatedIds:u});try{f=await e.queryAttributeBins(m,{signal:d})}catch(g){throw new ge(pe.QueryFeaturesError,c.errors.queryError,g)}}return f}async function Pc(t){let{queryConfig:e,x:r,queryObject:i,chartSubType:n,isGaugeByFeature:a,abortSignal:s}=t,o,l=J(i),{idField:u,isTraditionalTypeOID:c}=He(l),d=In({queryObject:i,queryConfig:e,returnStatisticsAggregatedIds:!1});d.outFields=a||n===S.PieNoAggregation||n===S.BarAndLineNoAggregation||n===S.BarAndLineSplitByNoAggregation?[c?u:"*"]:[r],d.outFields?.[0]===r&&(d.returnDistinctValues=!0);try{o=await i.queryFeatureCount(d,{signal:s})}catch{o=Number.NaN}return o}async function wr(t){let{queryObject:e,queryConfig:r,abortKey:i,errorStrings:n,abortSignal:a}=t,{outStatistics:s}=r,o=new Map;if(s!==void 0&&s.length>0){let l=s.map(f=>{let{statisticType:m,onStatisticField:g,outStatisticFieldName:h}=f;return{statisticType:m,onStatisticField:g,outStatisticFieldName:h?.toUpperCase()}});r.outStatistics=l,delete r.num,delete r.orderByFields;let u=In({queryObject:e,queryConfig:r,returnStatisticsAggregatedIds:!1}),c;try{c=await e.queryFeatures(u,{signal:a??(i!==void 0?It.get(i)?.signal:void 0)})}catch(f){if(!yi.isAbortError(f)){let m=n??(await bt(at(document.documentElement).t9nLocale,kt("./assets/common/t9n"),"messages.")).errorStrings;throw new ge(pe.QueryFeaturesError,m.errors.queryError,f)}}let d=c?.features?.[0]?.attributes;d!==void 0&&s.forEach(f=>{let{outStatisticFieldName:m}=f;if(m!==void 0){let g=d[m.toLowerCase()]??d[m.toUpperCase()]??d[m];g!==void 0&&o.set(m,g)}})}return o}async function So(t){let{queryObject:e,queryConfig:r,returnUniqueIdsOnly:i,returnStatisticsAggregatedIds:n,abortKey:a,errorStrings:s,abortSignal:o}=t,l=[],u=J(e),c=o||(a!==void 0?It.get(a)?.signal:void 0),d=i===!0?void 0:Qc(u),f=In({queryObject:e,queryConfig:r,maxRecordCountFactor:d,returnStatisticsAggregatedIds:n});try{i===!0?l=await e.queryObjectIds(f,{signal:c}):l=(await e.queryFeatures(f,{signal:c})).features}catch(m){if(!yi.isAbortError(m)){let g=s??(await bt(at(document.documentElement).t9nLocale,kt("./assets/common/t9n"),"messages.")).errorStrings;throw new ge(pe.QueryFeaturesError,g.errors.queryError,m)}}return l}async function kc(t){let e=[],{featureCount:r,maxRecords:i,queryConfig:n,abortSignal:a}=t,s=[],o=0,l=n?.start??0;for(;o<W.maxParallelRequests&&l<r;){let u={...t};u.queryConfig={...n,start:l,num:Math.min(i,r-l)},e.push(So({...u,abortSignal:a})),l+=i,o+=1}return s=(await Promise.all(e)).flat(),s}async function De(t){let{queryObject:e,queryConfig:r,returnUniqueIdsOnly:i,featureCount:n,noBatch:a,returnStatisticsAggregatedIds:s,errorStrings:o,abortKey:l,abortSignal:u}=t,c=[],d=J(e),f=n??1,m=vo(d);if(a!==!0&&f>m&&d?.capabilities?.query.supportsPagination){let g=0,h=0,y=Math.ceil(f/m),b=Math.ceil(y/W.maxParallelRequests),x=[];for(;h<b;){g=h*W.maxParallelRequests*m;let w=kc({queryConfig:{...r,start:g},queryObject:e,maxRecords:m,featureCount:f,returnUniqueIdsOnly:i,returnStatisticsAggregatedIds:s,errorStrings:o,abortKey:l,abortSignal:u});x.push(w),h+=1}c=(await Promise.all(x)).flat()}else(Number.isNaN(f)||f>=0)&&(c=await So({queryObject:e,queryConfig:r,returnUniqueIdsOnly:i,returnStatisticsAggregatedIds:s,errorStrings:o,abortKey:l,abortSignal:u}));return c}async function Vc(t){let{queryObject:e,queryConfig:r,uniqueFeature:i,errorStrings:n,abortKey:a}=t,s={...r,returnDistinctValues:!0};return await De({queryObject:e,abortKey:a,queryConfig:s,returnUniqueIdsOnly:!0,returnStatisticsAggregatedIds:!1,featureCount:i===!0?1:void 0,errorStrings:n})}function $c(t){if(t!==void 0){let e=It.get(t);e!==void 0&&e.abort(),It.set(t,new AbortController)}}function bo(t){return{lowerBoundaryAlias:`charts_lower_boundary_${t}`,upperBoundaryAlias:`charts_upper_boundary_${t}`}}async function Rc(t){let{queryObject:e,dateField:r,splitByField:i,queryConfig:n,temporalBinning:a,axisTimeZone:s,errorStrings:o,view:l,syncViewTimeZone:u,returnStatisticsAggregatedIds:c,abortSignal:d}=t,f=[],m;if(a){let{unit:g}=a;try{if(g&&(m=er(i,e),m&&e&&"queryAttributeBins"in e&&e.queryAttributeBins)){let h=Uc({queryObject:e,queryConfig:n,temporalBinning:a,dateField:r,axisTimeZone:s,splitByField:i,view:l,syncViewTimeZone:u,returnStatisticsAggregatedIds:c});f=(await e.queryAttributeBins(h,{signal:d})).features}}catch(h){let y=o??(await bt(at(document.documentElement).t9nLocale,kt("./assets/common/t9n"),"messages.")).errorStrings;throw new ge(pe.QueryFeaturesError,y.errors.queryError,h)}}if(m===!1){let g=o??(await bt(at(document.documentElement).t9nLocale,kt("./assets/common/t9n"),"messages.")).errorStrings;throw new ge(pe.QueryFeaturesError,g.errors.queryBinsNotSupported,g.errors.queryBinsNotSupported)}return f}function Wc(t){let e=!t.geometry||t.geometry.type==="extent",r=(t.where??"").toUpperCase(),i=!r.includes("CURRENT_TIMESTAMP")&&!r.includes("CURRENT_DATE")&&!r.includes("CURRENT_TIME");return e&&i}function vo(t){let e=W.maxRecords;if(t&&"sourceJSON"in t&&t.sourceJSON?.maxRecordCount){let{sourceJSON:r}=t;e=r.maxRecordCount,r.advancedQueryCapabilities?.supportsMaxRecordCountFactor===!0&&(e*=W.maxRecordCountFactor)}return e}function te(t,e){let r,i=Array.from(new Set(t)).filter(n=>n&&!tt(n));return i.sort((n,a)=>a.length-n.length),i.length===1?[r]=i:i?.forEach(n=>{n!==void 0&&(le(r)?r=`(${n})`:r?.includes(`(${n})`)||(r=`${r} ${e??"AND"} (${n})`))}),r??"1=1"}function jc(t,e){let r=e;return t?.start!=null&&t?.end!=null&&(r=[t.start.valueOf(),t.end.valueOf()]),r}function Zc(t){let{queryObject:e,defaultGeometry:r,ignoreViewExtent:i}=t,n=r;if(!i&&gt(e)){let a=e.view.extent,{xmin:s,xmax:o,ymin:l,ymax:u,zmin:c,zmax:d}=a;n={xmin:s,ymin:l,zmin:c,xmax:o,ymax:u,zmax:d,spatialReference:a.spatialReference.toJSON()}}return n}function qt(t){let e;return t!==void 0&&(e=On.fromJSON(t)),e}function _c(t){return t===void 0?["*"]:Array.from(new Set(t))}function pi(t){let{queryType:e,queryObject:r,queryConfig:i,view:n,configTimeZone:a,dateField:s,useViewTimeZone:o,returnStatisticsAggregatedIds:l}=t,{where:u,outStatistics:c,geometry:d,distance:f,units:m,timeExtent:g,returnDistinctValues:h}=i??{},y=J(r),b=qe(y)?.createQuery()??new ks,x,w=vi(y).idFields;if(e==="AttributeBinsQuery"&&i?.objectIds?.[0]!==void 0&&w&&(x=`${w} IN (${i.objectIds.join(",")})`),e==="AttributeBinsQuery"&&(b=new uc(b.toJSON()),je(r).find(v=>v.name===s)?.type!==K.DateOnly)){let v=Intl.DateTimeFormat().resolvedOptions().timeZone,T=o&&n&&"timeZone"in n?n.timeZone:void 0,O=a??T??v;O==="unknown"?O="Etc/UTC":O==="system"&&(O=v),b.outTimeZone=O}if(b.where=te([b.where,u,x]),"returnDistinctValues"in b&&(b.returnDistinctValues=h??!1),c!==void 0){let v=Ac(y);b.outStatistics=c.filter(T=>T.statisticType!==L.EnvelopeAggregate||v).map(T=>cc.fromJSON(T))}let C=qt(d);return C!==void 0&&(b.geometry=C,i?.spatialRelationship&&(b.spatialRelationship=i.spatialRelationship),yo(y)&&(f!==void 0&&(b.distance=f),m!==void 0&&(b.units=m))),g&&(b.timeExtent=new dc({start:g?.[0],end:g?.[1]})),Wc(b)&&(b.cacheHint=!0),l&&(b instanceof ks?b.returnStatisticsAggregatedIds=!0:b.returnAggregateIds=!0),b}function zc(t){let e;switch(t){case oe.Start:e="first";break;case oe.End:e="last";break}return e}function Uc(t){let{queryObject:e,queryConfig:r,temporalBinning:i,dateField:n,splitByField:a,axisTimeZone:s,view:o,syncViewTimeZone:l,returnStatisticsAggregatedIds:u}=t,{unit:c,size:d,timeAggregationType:f,start:m,end:g,offset:h,outTimeZone:y}=i,b=J(e),x=pi({queryType:"AttributeBinsQuery",queryObject:e,queryConfig:r,configTimeZone:y??s,view:o,dateField:n,useViewTimeZone:l??!1,returnStatisticsAggregatedIds:u}),w=bo(n);if(x.lowerBoundaryAlias=w.lowerBoundaryAlias,x.upperBoundaryAlias=w.upperBoundaryAlias,x.binParameters={type:"date",field:n,interval:{unit:c,value:d},start:m,end:g,offset:h?{unit:h.unit,value:h.size}:null},x.binParameters.type==="date"&&(b?.capabilities?.queryAttributeBins?.supportsSnapToData&&(x.binParameters.snapToData=zc(f)),b?.capabilities?.queryAttributeBins?.supportsReturnFullIntervalBin&&(x.binParameters.returnFullIntervalBin=!0)),!le(a)){let C=qe(b)?.fields.find(v=>v.name===a)?.type;(!C||C==="string"||C==="integer"||C==="small-integer"||C==="big-integer"||C==="double")&&(x.binParameters.stackBy={type:"field",value:a,valueType:C==="string"?"string":"integer"})}return x}function Bn(t){let{field:e,fieldType:r,unit:i,outTimeZone:n,dataTimeZone:a,runsOnClientQueryEngine:s,addIntervalStatement:o,addLeapDayExpression:l}=t,u,c,d=1,f=1;switch(i){case xe.MinuteOfDay:r!==K.DateOnly&&(c="MINUTE",d=0,f=59);break;case xe.HourOfDay:r!==K.DateOnly&&(c="HOUR",d=0,f=23);break;case xe.DayOfWeek:c="DOW",f=7;break;case xe.DayOfMonth:c="DAY",f=31;break;case xe.DayOfYear:c="DOY",f=366;break;case xe.WeekOfYear:c="WEEK",f=53;break;case xe.MonthOfYear:c="MONTH",f=12;break;case xe.QuarterOfYear:c="QUARTER",f=4;break}if(c){let m=o?` ${go({dataTimeZone:a,runsOnClientQueryEngine:s,outTimeZone:n})}`:"";u=Hc({addLeapDayExpression:l,temporalKey:c,field:e,intervalStatement:m})}return{expression:u,start:d,end:f}}function Hc(t){let{addLeapDayExpression:e=!1,temporalKey:r,field:i,intervalStatement:n}=t,a;return e&&i.length&&r==="DAY"?a=`CASE WHEN (EXTRACT(MONTH FROM ${i})=2 AND EXTRACT(DAY FROM ${i})=29) THEN 0 ELSE EXTRACT (${r} FROM ${i}${n}) END`:a=`EXTRACT (${r} FROM ${i}${n})`,a}function Vs(t){let{temporalBinning:e,xOrY:r,xOrYFieldType:i,addIntervalStatement:n,outTimeZone:a,dataTimeZone:s,runsOnClientQueryEngine:o,includeLeapDay:l}=t,{unit:u}=e??{},c,d,f,m;return i===K.Date||i===K.DateOnly||i===K.TimestampOffset?{expression:d,start:f,end:m}=Bn({field:r,fieldType:i,unit:u,addIntervalStatement:n,outTimeZone:a,dataTimeZone:s,runsOnClientQueryEngine:o,addLeapDayExpression:!l}):c=r,{field:c,expression:d,start:f,end:m}}function Gc(t){let{queryObject:e,queryConfig:r,x:i,y:n,xTemporalBinning:a,yTemporalBinning:s,firstDayOfWeek:o,includeLeapDay:l,configTimeZone:u,view:c,syncViewTimeZone:d,returnStatisticsAggregatedIds:f}=t,m=je(e),g=m.find(O=>O.name===i)?.type,h=m.find(O=>O.name===n)?.type,y=pi({queryType:"AttributeBinsQuery",queryObject:e,queryConfig:r,configTimeZone:u,view:c,dateField:i,useViewTimeZone:d??!1,returnStatisticsAggregatedIds:f});y.binParameters={type:"fixed-interval",interval:1},y.lowerBoundaryAlias=W.heatChartLowerBoundaryAlias,y.upperBoundaryAlias=W.heatChartUpperBoundaryAlias,o!==void 0&&(y.binParameters.firstDayOfWeek=o);let b=Vs({temporalBinning:a,xOrY:i,xOrYFieldType:g,addIntervalStatement:!1,includeLeapDay:l}),{field:x,expression:w,start:C,end:v}=b;x?y.binParameters.field=x:w&&(y.binParameters.expression=w,y.binParameters.expressionValueType="integer",y.binParameters.type==="fixed-interval"&&(C!==void 0&&(y.binParameters.start=C),v!==void 0&&(y.binParameters.end=v)));let T=Vs({temporalBinning:s,xOrY:n,xOrYFieldType:h,addIntervalStatement:!1,includeLeapDay:l});return T.field?y.binParameters.stackBy={type:"field",value:T.field}:T.expression&&(y.binParameters.stackBy={type:"expression",value:T.expression,valueType:"integer",alias:n}),y}function Yc(t){let{queryObject:e,queryConfig:r,xStep:i,xMin:n,xMax:a,x:s,y:o,yStep:l,returnStatisticsAggregatedIds:u}=t,c=pi({queryType:"AttributeBinsQuery",queryObject:e,queryConfig:r,useViewTimeZone:!1,returnStatisticsAggregatedIds:u}),d=po(s,o);return c.lowerBoundaryAlias=d.lowerBoundaryAlias,c.upperBoundaryAlias=d.upperBoundaryAlias,c.binParameters={type:"fixed-interval",field:s,interval:i,start:n,end:a,stackBy:{value:`FLOOR(${o} / ${l})`,type:"expression",alias:d.stackAlias,valueType:"integer"}},c}function In(t){let{queryObject:e,queryConfig:r,maxRecordCountFactor:i,returnStatisticsAggregatedIds:n}=t,{groupByFieldsForStatistics:a,orderByFields:s,gdbVersion:o,start:l,num:u,outFields:c}=r??{},d=pi({queryType:"Query",queryObject:e,queryConfig:r,useViewTimeZone:!1,returnStatisticsAggregatedIds:n});d.returnGeometry=!1;let f=J(e);return d.outFields=_c(c),d.groupByFieldsForStatistics=a??d.groupByFieldsForStatistics,d.orderByFields=s??[],d.objectIds=r?.objectIds,i!==void 0&&(d.maxRecordCountFactor=i),o!==void 0&&o!==""&&(d.gdbVersion=o),u!==void 0&&(d.num=u),l!==void 0&&(d.start=l,d.num=d.num??vo(f)),d}function Qc(t){return t&&"sourceJSON"in t&&t.sourceJSON?.advancedQueryCapabilities?.supportsMaxRecordCountFactor===!0?W.maxRecordCountFactor:void 0}var Ny={NonNumericAggregation:"nonNumericAggregation",DuplicateSeriesID:"duplicateSeriesId"},Oy={Required:"required",MinLength:"minLength",MinItems:"minItems",MaxItems:"maxItems",Pattern:"pattern",AdditionalProperties:"additionalProperties",Enum:"enum",AnyOf:"anyOf"},z={BadData:"badData",EmptyDataSet:"emptyDataSet",NoValue:"noValue",InvalidConfig:"invalidConfig",HistogramEmptyField:"histogramEmptyField",BarElementExceedsLimit:"barElementExceedsLimit",LineChartExceedsLimit:"lineChartExceedsLimit",BoxPlotExceedsLimit:"boxPlotExceedsLimit",BoxPlotOutliersExceedsLimit:"boxPlotOutliersExceedsLimit",HeatChartExceedsLimit:"heatChartExceedsLimit",PieChartExceedsLimit:"pieChartExceedsLimit",GaugeExceedsLimit:"gaugeExceedsLimit",RadarChartExceedsLimit:"radarChartExceedsLimit",PieChartMixOfNegativePositiveSlices:"PieChartMixOfNegativePositiveSlices",NegativeValueInSqrtCalculation:"negativeValueInSqrtCalculation",NegativeValueInLogCalculation:"negativeValueInLogCalculation",NegativeValueInXAxisLogScale:"negativeValueInXAxisLogScale",NegativeValueInYAxisLogScale:"negativeValueInYAxisLogScale"},Jc=2048;function Kc(t){let e;switch(t){case ae.Log:e="log";break;case ae.Sqrt:e="sqrt";break;case ae.None:default:e=void 0;break}return e}async function Xc(t){let{chartConfig:e,queryConfig:r,queryObject:i,filterByViewExtent:n,view:a,abortKey:s,abortSignal:o}=t,l=o??(s!==void 0?It.get(s)?.signal:void 0),u=e.series[0],{x:c,dataTransformationType:d,binCount:f}=u,m=J(i);if(!se(m))throw new ge(pe.LayerNotSupported);let g=await Nr(m,l);if(!g)throw new Error("Raster info is not available for the layer.");let h=qt(r.geometry),y=mi(m,c);if(y<0)throw new Error("Band ID not found for `${x}`.");let b,x;if(!n&&(d===void 0||d===ae.None)&&!(ot(m)&&Cr(m))&&f&&Array.isArray(g.histograms)&&g.histograms.length>y&&g.histograms[y].size%f===0&&Array.isArray(g.statistics)&&g?.statistics?.length>y)b=g.histograms[y],x=g.statistics[y];else{let w,C,v;if(n&&a)w=a.resolution,C=a.resolution,v=a.spatialReference;else{let O=Jc,I=2,B=g.width,N=g.height;if(!n&&!h&&ot(m)&&Cr(m))try{let E=m.createQuery(),{extent:M}=await m.queryExtent(E,{signal:l});M&&(B=M.width,N=M.height,h=M)}catch{}let A=Math.max(0,Math.ceil(Math.log(Math.max(B,N)/O)/Math.log(I))),D=I**A;w=g.pixelSize.x*D,C=g.pixelSize.y*D,v=m.spatialReference}let T=new uo({x:w,y:C,spatialReference:v});try{let O=Kc(d),I=await sc(m,{bandIds:[y],geometry:h??g.extent,histogramSize:f??void 0,pixelSize:T,transformType:O,downsampleOnly:!0},{signal:l});x=I.statistics[0],b=I.histograms[0]}catch(O){if(!yi.isAbortError(O))throw new ge(pe.Default,"Failed to compute raster histogram.",O)}}return{histogram:b,statistics:x}}function ed(t,e){let r=[],i=(t.max-t.min)/t.size;for(let n=0;n<t.size;n++){let a=t.min+n*i;r.push({type:p.HistogramBin,minValue:a,maxValue:a+i,count:t.counts[n]})}if(e&&t.size!==e&&t.size%e===0){let n=t.size/e,a=[];for(let s=0;s<e;s++){let o=r[s*n].minValue,l=r[(s+1)*n-1].maxValue,u=0;for(let c=0;c<n;c++)u+=r[s*n+c].count;a.push({type:p.HistogramBin,minValue:o,maxValue:l,count:u})}return a}return r}async function td(t){let{chartConfig:e,queryConfig:r,queryObject:i,filterByViewExtent:n,abortKey:a,abortSignal:s,view:o}=t;if(i===void 0)throw new Error("QueryObject is undefined!");let l,{statistics:u,histogram:c}=await Xc({queryObject:i,chartConfig:e,queryConfig:r,filterByViewExtent:n,view:o,abortKey:a,abortSignal:s});if(u&&c){let d=e.series[0].binCount??void 0,f=ed(c,d);f.length>0?l={valid:!0,count:f.length,data:{bins:f,min:u.min,max:u.max,mean:u.avg,median:u.median,stddev:u.stddev,sum:u.sum??u.avg*u.count,count:u.count}}:l={valid:!1,invalidType:z.EmptyDataSet}}else l={valid:!1,invalidType:z.NoValue};return l}var rd=t=>t.series[0].x;function id(t){let{chartConfig:e,layer:r,selectionItems:i}=t,n=mi(r,rd(e)),a=i.map(l=>[l.minValue,l.maxValue]).reduce((l,u,c)=>{if(c===0)l.push([...u]);else{let d=l[l.length-1];d[1]===u[0]?d[1]=u[1]:l.push([...u])}return l},[]),s=e.series[0],{dataTransformationType:o}=s;switch(o){case ae.Log:a.forEach(l=>{l[0]=Math.exp(l[0]),l[1]=Math.exp(l[1])});break;case ae.Sqrt:a.forEach(l=>{l[0]=l[0]*l[0],l[1]=l[1]*l[1]});break;case ae.None:}return a.length>0?{bandId:n,pixelRanges:a}:void 0}function Sr(t,e){let r,i,n=e??(a=>a);for(let a of t){let s=n(a);s==null||Number.isNaN(s)||((r===void 0||s<r)&&(r=s),(i===void 0||s>i)&&(i=s))}return{min:r,max:i}}function nd(t,e){let r=0,i=0,n=e??(a=>a);for(let a of t){let s=n(a);s==null||Number.isNaN(s)||(r++,i+=s)}return r>0?i/r:void 0}function ad(t,e){let r=0,i=e??(n=>n);for(let n of t){let a=i(n);a==null||Number.isNaN(a)||(r+=a)}return r}function By(t,e,r=1){let i=Math.max(0,Math.ceil((e-t)/r)),n=new Array(i);for(let a=0;a<i;a++)n[a]=t+a*r;return n}var sd={dataFormat:"json",outputFormat:"json",typeKey:"analyticType",typeValue:"LinRegR2",fieldValue:"onAnalyticField",slopePropertyList:["Slope","SLOPE","slope"],interceptPropertyList:["Intercept","INTERCEPT","intercept"],r2PropertyList:["R2","r2"]};async function od(t){let{queryObject:e,abortSignal:r}=t,i=!1;if(!se(e)){let n=Oc(e),a=J(e),s=qe(a);if(n&&s?.url!==void 0&&s.url!==null){let o=`${s.url}/${s.layerId}?f=json`;try{let l=(await si(o,{signal:r})).data,u=l?.advancedQueryCapabilities?.supportsQueryAnalytic===!0,c=l?.sqlParserVersion===void 0||s.version!=null&&s.version>=10.91;i=u&&c}catch{}}}return i}function ld(t){let{x:e,y:r,trendlineXToY:i,data:n}=t,{min:a,max:s}=n?Sr(n,o=>o[e]):{min:Number.NaN,max:Number.NaN};return[{[e]:a??Number.NaN,[r]:i(a??Number.NaN)},{[e]:s??Number.NaN,[r]:i(s??Number.NaN)}]}function ud(t){let{data:e,x:r,y:i}=t,n=[];return e!==void 0&&(n=e.filter(a=>Number.isFinite(a[r])&&Number.isFinite(a[i])).map(a=>[a[r],a[i]])),n}async function cd(t){let{statsMap:e,queryObject:r,chartConfig:i,queryConfig:n,errorStrings:a,abortSignal:s}=t,o=i.series[0],{x:l,y:u}=o;Vt(r);let c=Number.NaN,d=[{[l]:Number.NaN,[u]:Number.NaN},{[l]:Number.NaN,[u]:Number.NaN}],{dataFormat:f,outputFormat:m,typeKey:g,typeValue:h,fieldValue:y,slopePropertyList:b,interceptPropertyList:x,r2PropertyList:w}=sd,C=`[{"${g}": "${h}", "${y}":"${l},${u}"}]`,v=await Ec({queryObject:r,queryConfig:n,outputFormat:m,dataFormat:f,outAnalytics:C,errorStrings:a,abortSignal:s});if(v!==void 0){let T=Number.NaN,O=Number.NaN,{expr:I}=$r(v,b),{expr:B}=$r(v,x),{expr:N}=$r(v,w);I!==void 0&&Number.isFinite(v[I])&&(T=v[I]),B!==void 0&&Number.isFinite(v[B])&&(O=v[B]),N!==void 0&&Number.isFinite(v[N])&&(c=v[N]);let{dataContextXMinField:A,dataContextXMaxField:D,dataContextYMinField:E,dataContextYMaxField:M}=F.scatterplotAggregationFields,V=e.get(A)??Number.NaN,$=e.get(D)??Number.NaN,G=e.get(E)??Number.NaN,k=e.get(M)??Number.NaN,Y=($-V)/100,R=V-Y,X=Number.NaN;for(;!(X>=G&&X<=k)&&R<=$;)R+=Y,X=T*R+O;let ie=$+Y,ve=Number.NaN;for(;!(ve>=G&&ve<=k)&&ie>=V;)ie-=Y,ve=T*ie+O;d=[{[l]:R,[u]:X},{[l]:ie,[u]:ve}]}return{r2:c,trendLinePoints:d}}function Co(t){let{data:e,chartConfig:r}=t,i=r.series[0],{x:n,y:a}=i,{r2:s,trendLinePoints:o}=F.scatterplotSeries,l=ud({data:e,x:n,y:a});if(l!==void 0){let u=As(l),c=Ms(u);s=u.m===0?0:Es(l,c),o=ld({x:n,y:a,trendlineXToY:c,data:e})}return{r2:s,trendLinePoints:o}}async function Fo(t){let e=await od(t),{chartConfig:r}=t,i=r.series[0],{x:n,y:a}=i,{r2:s}=F.scatterplotSeries,o=[{[n]:Number.NaN,[a]:Number.NaN},{[n]:Number.NaN,[a]:Number.NaN}],l={r2:s,trendLinePoints:o},u=!1;if(e)try{l=await cd(t)}catch{u=!0}return(!e||u)&&(l=Co(t)),l}var Fe="arcgis_charts_pie_from_fields_name",Ue="arcgis_charts_pie_from_fields_value",Iy="arcgis_charts_bar_line_from_fields_name",Ay="arcgis_charts_bar_line_from_fields_value";function dd(t){return t!==void 0&&t!==qr.Solid&&t!==qr.Null}function My(t,e){let r="",i=(e??0)/2,n=0-i,a=0+i,s=0-i,o=0+i;switch(t){case Ft.Circle:r=`M ${n},0 a ${i},${i} 0 1,0 ${i*2},0 a ${i},${i} 0 1,0 ${-i*2},0`;break;case Ft.Cross:r=`M ${n},0 L ${a},0 M 0,${s} L 0,${o} E`;break;case Ft.Diamond:r=`M ${n},0 L 0,${s} L ${a},0 L 0,${o} L ${n},0 Z`;break;case Ft.Square:r=`M ${n},${o} L ${n},${s} L ${a},${s} L ${a},${o} L ${n},${o} Z`;break;case Ft.Triangle:r=`M ${n},${o} L 0,${s} L ${a},${o} L ${n},${o} Z`;break;case Ft.X:r=`M ${n},${o} L ${a},${s} M ${n},${s} L ${a},${o} E`;break}return r}function Ey(t,e=0){return(t??e)%360}function xo(t){let{stringToTruncate:e,characterLimit:r,ellipsis:i=F.chartEllipsis}=t,n=e;return typeof r=="number"&&Number.isFinite(r)&&r>0&&r<e.length&&(n=e.slice(0,r),n=`${n}${i}`),n}function Ly(t){let{input:e,charsPerLine:r}=t,i=e;if(r>0&&e.length>r){let n=e.lastIndexOf(" ",r),a=e.lastIndexOf("-",r),s=Math.max(n,a),o=s===a&&a>0,l=s>0?s+(o?1:0):r,u=Math.min(r,l),c=e.slice(0,u).trimEnd(),d=e.slice(u).trimStart();d.length>r&&(d=xo({stringToTruncate:d,characterLimit:Math.max(1,r-1)})),i=`${c}
2
+ import{A as Ei,c as F,d as S,g as Ii,h as Ai,j as Pr,k as kr,l as Mi,m as _e,n as Vr,q as Qn,r as le,s as $r,t as or,y as Jn}from"./4F6DKNCU.js";import{a as ot,b as Li,c as Kn,e as se,g as Xn,h as Vt,i as ea}from"./WOGALV3T.js";import{B as Bi,Ea as Hn,Fa as Gn,b as st,d as zn,e as Ke,f as W,g as Un,i as Ti,o as Dr,p as ar,q as _,r as Ni,t as Oi,xa as xt,ya as sr}from"./ZUN46CYQ.js";import{a as K,c as Ft,d as qr,e as ye,f as Ie}from"./KX7KGXKQ.js";import{a as Lr,b as vt,d as Ye,g as jn,h as Fi,l as Qe,q as Zn}from"./NGXRBJKL.js";import{c as Wn,e as at,g as Er,i as bt}from"./WULMITJI.js";import{I as kt}from"./UE4KTI5X.js";import{a as j,c as Yn}from"./QYRHZJH3.js";import{a as p,b as L,c as ae,e as _n,f as Be,h as Ce,i as xi,k as U,l as xe,n as we,o as oe,q as Ct,s as wi,v as Je}from"./PWJBGZPW.js";export default $arcgis.t(([nc,xr,ir,Ds,ac,Ps,{computeStatisticsHistograms:sc,computeRasterAttributeTable:oc,getCurrentRasterInfo:Lt,fetchPixelFeatureSet:lc},yi,uo,On,uc,ks,cc,dc,fc,mc,gc,co,hc,si,fo,yc,pc,Sc,bc,vc,{substitute:$e},{sqlLiteral:Cc}])=>{var et=class extends Error{},Zi=class extends et{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},_i=class extends et{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},zi=class extends et{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},ct=class extends et{},Hr=class extends et{constructor(e){super(`Invalid unit ${e}`)}},fe=class extends et{},ze=class extends et{constructor(){super("Zone is an abstract class")}},q="numeric",Ve="short",Oe="long",Gr={year:q,month:q,day:q},Ma={year:q,month:Ve,day:q},cl={year:q,month:Ve,day:q,weekday:Ve},Ea={year:q,month:Oe,day:q},La={year:q,month:Oe,day:q,weekday:Oe},qa={hour:q,minute:q},Da={hour:q,minute:q,second:q},Pa={hour:q,minute:q,second:q,timeZoneName:Ve},ka={hour:q,minute:q,second:q,timeZoneName:Oe},Va={hour:q,minute:q,hourCycle:"h23"},$a={hour:q,minute:q,second:q,hourCycle:"h23"},Ra={hour:q,minute:q,second:q,hourCycle:"h23",timeZoneName:Ve},Wa={hour:q,minute:q,second:q,hourCycle:"h23",timeZoneName:Oe},ja={year:q,month:q,day:q,hour:q,minute:q},Za={year:q,month:q,day:q,hour:q,minute:q,second:q},_a={year:q,month:Ve,day:q,hour:q,minute:q},za={year:q,month:Ve,day:q,hour:q,minute:q,second:q},dl={year:q,month:Ve,day:q,weekday:Ve,hour:q,minute:q},Ua={year:q,month:Oe,day:q,hour:q,minute:q,timeZoneName:Ve},Ha={year:q,month:Oe,day:q,hour:q,minute:q,second:q,timeZoneName:Ve},Ga={year:q,month:Oe,day:q,weekday:Oe,hour:q,minute:q,timeZoneName:Oe},Ya={year:q,month:Oe,day:q,weekday:Oe,hour:q,minute:q,second:q,timeZoneName:Oe},Ot=class{get type(){throw new ze}get name(){throw new ze}get ianaName(){return this.name}get isUniversal(){throw new ze}offsetName(e,r){throw new ze}formatOffset(e,r){throw new ze}offset(e){throw new ze}equals(e){throw new ze}get isValid(){throw new ze}},qi=null,Yr=class t extends Ot{static get instance(){return qi===null&&(qi=new t),qi}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:r,locale:i}){return ss(e,r,i)}formatOffset(e,r){return fr(this.offset(e),r)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},Ui=new Map;function fl(t){let e=Ui.get(t);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Ui.set(t,e)),e}var ml={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function gl(t,e){let r=t.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,n,a,s,o,l,u,c]=i;return[s,n,a,o,l,u,c]}function hl(t,e){let r=t.formatToParts(e),i=[];for(let n=0;n<r.length;n++){let{type:a,value:s}=r[n],o=ml[a];a==="era"?i[o]=s:Z(o)||(i[o]=parseInt(s,10))}return i}var Di=new Map,ft=class t extends Ot{static create(e){let r=Di.get(e);return r===void 0&&Di.set(e,r=new t(e)),r}static resetCache(){Di.clear(),Ui.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=t.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:r,locale:i}){return ss(e,r,i,this.name)}formatOffset(e,r){return fr(this.offset(e),r)}offset(e){if(!this.valid)return NaN;let r=new Date(e);if(isNaN(r))return NaN;let i=fl(this.name),[n,a,s,o,l,u,c]=i.formatToParts?hl(i,r):gl(i,r);o==="BC"&&(n=-Math.abs(n)+1);let f=ti({year:n,month:a,day:s,hour:l===24?0:l,minute:u,second:c,millisecond:0}),m=+r,g=m%1e3;return m-=g>=0?g:1e3+g,(f-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},ta={};function yl(t,e={}){let r=JSON.stringify([t,e]),i=ta[r];return i||(i=new Intl.ListFormat(t,e),ta[r]=i),i}var Hi=new Map;function Gi(t,e={}){let r=JSON.stringify([t,e]),i=Hi.get(r);return i===void 0&&(i=new Intl.DateTimeFormat(t,e),Hi.set(r,i)),i}var Yi=new Map;function pl(t,e={}){let r=JSON.stringify([t,e]),i=Yi.get(r);return i===void 0&&(i=new Intl.NumberFormat(t,e),Yi.set(r,i)),i}var Qi=new Map;function Sl(t,e={}){let{base:r,...i}=e,n=JSON.stringify([t,i]),a=Qi.get(n);return a===void 0&&(a=new Intl.RelativeTimeFormat(t,e),Qi.set(n,a)),a}var ur=null;function bl(){return ur||(ur=new Intl.DateTimeFormat().resolvedOptions().locale,ur)}var Ji=new Map;function Qa(t){let e=Ji.get(t);return e===void 0&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),Ji.set(t,e)),e}var Ki=new Map;function vl(t){let e=Ki.get(t);if(!e){let r=new Intl.Locale(t);e="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in e||(e={...Ja,...e}),Ki.set(t,e)}return e}function Cl(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let r=t.indexOf("-u-");if(r===-1)return[t];{let i,n;try{i=Gi(t).resolvedOptions(),n=t}catch{let l=t.substring(0,r);i=Gi(l).resolvedOptions(),n=l}let{numberingSystem:a,calendar:s}=i;return[n,a,s]}}function Fl(t,e,r){return(r||e)&&(t.includes("-u-")||(t+="-u"),r&&(t+=`-ca-${r}`),e&&(t+=`-nu-${e}`)),t}function xl(t){let e=[];for(let r=1;r<=12;r++){let i=Q.utc(2009,r,1);e.push(t(i))}return e}function wl(t){let e=[];for(let r=1;r<=7;r++){let i=Q.utc(2016,11,13+r);e.push(t(i))}return e}function Rr(t,e,r,i){let n=t.listingMode();return n==="error"?null:n==="en"?r(e):i(e)}function Tl(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||Qa(t.locale).numberingSystem==="latn"}var Xi=class{constructor(e,r,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;let{padTo:n,floor:a,...s}=i;if(!r||Object.keys(s).length>0){let o={useGrouping:!1,...i};i.padTo>0&&(o.minimumIntegerDigits=i.padTo),this.inf=pl(e,o)}}format(e){if(this.inf){let r=this.floor?Math.floor(e):e;return this.inf.format(r)}else{let r=this.floor?Math.floor(e):fn(e,3);return ue(r,this.padTo)}}},en=class{constructor(e,r,i){this.opts=i,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let s=-1*(e.offset/60),o=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;e.offset!==0&&ft.create(o).valid?(n=o,this.dt=e):(n="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let a={...this.opts};a.timeZone=a.timeZone||n,this.dtf=Gi(r,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(r=>{if(r.type==="timeZoneName"){let i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:i}}else return r}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},tn=class{constructor(e,r,i){this.opts={style:"long",...i},!r&&ns()&&(this.rtf=Sl(e,i))}format(e,r){return this.rtf?this.rtf.format(e,r):Ul(r,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,r){return this.rtf?this.rtf.formatToParts(e,r):[]}},Ja={firstDay:1,minimalDays:4,weekend:[6,7]},re=class t{static fromOpts(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,r,i,n,a=!1){let s=e||ne.defaultLocale,o=s||(a?"en-US":bl()),l=r||ne.defaultNumberingSystem,u=i||ne.defaultOutputCalendar,c=an(n)||ne.defaultWeekSettings;return new t(o,l,u,c,s)}static resetCache(){ur=null,Hi.clear(),Yi.clear(),Qi.clear(),Ji.clear(),Ki.clear()}static fromObject({locale:e,numberingSystem:r,outputCalendar:i,weekSettings:n}={}){return t.create(e,r,i,n)}constructor(e,r,i,n,a){let[s,o,l]=Cl(e);this.locale=s,this.numberingSystem=r||o||null,this.outputCalendar=i||l||null,this.weekSettings=n,this.intl=Fl(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Tl(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&r?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:t.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,an(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,r=!1){return Rr(this,e,us,()=>{let i=this.intl==="ja"||this.intl.startsWith("ja-");r&=!i;let n=r?{month:e,day:"numeric"}:{month:e},a=r?"format":"standalone";if(!this.monthsCache[a][e]){let s=i?o=>this.dtFormatter(o,n).format():o=>this.extract(o,n,"month");this.monthsCache[a][e]=xl(s)}return this.monthsCache[a][e]})}weekdays(e,r=!1){return Rr(this,e,fs,()=>{let i=r?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=r?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=wl(a=>this.extract(a,i,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return Rr(this,void 0,()=>ms,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Q.utc(2016,11,13,9),Q.utc(2016,11,13,19)].map(r=>this.extract(r,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Rr(this,e,gs,()=>{let r={era:e};return this.eraCache[e]||(this.eraCache[e]=[Q.utc(-40,1,1),Q.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[e]})}extract(e,r,i){let n=this.dtFormatter(e,r),a=n.formatToParts(),s=a.find(o=>o.type.toLowerCase()===i);return s?s.value:null}numberFormatter(e={}){return new Xi(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,r={}){return new en(e,this.intl,r)}relFormatter(e={}){return new tn(this.intl,this.isEnglish(),e)}listFormatter(e={}){return yl(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Qa(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:as()?vl(this.locale):Ja}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},Pi=null,Le=class t extends Ot{static get utcInstance(){return Pi===null&&(Pi=new t(0)),Pi}static instance(e){return e===0?t.utcInstance:new t(e)}static parseSpecifier(e){if(e){let r=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new t(ri(r[1],r[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${fr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${fr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,r){return fr(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},rn=class extends Ot{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function ut(t,e){if(Z(t)||t===null)return e;if(t instanceof Ot)return t;if(Ml(t)){let r=t.toLowerCase();return r==="default"?e:r==="local"||r==="system"?Yr.instance:r==="utc"||r==="gmt"?Le.utcInstance:Le.parseSpecifier(r)||ft.create(t)}else return dt(t)?Le.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new rn(t)}var ln={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},ra={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Nl=ln.hanidec.replace(/[\[|\]]/g,"").split("");function Ol(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);if(t[r].search(ln.hanidec)!==-1)e+=Nl.indexOf(t[r]);else for(let n in ra){let[a,s]=ra[n];i>=a&&i<=s&&(e+=i-a)}}return parseInt(e,10)}else return e}var nn=new Map;function Bl(){nn.clear()}function Pe({numberingSystem:t},e=""){let r=t||"latn",i=nn.get(r);i===void 0&&(i=new Map,nn.set(r,i));let n=i.get(e);return n===void 0&&(n=new RegExp(`${ln[r]}${e}`),i.set(e,n)),n}var ia=()=>Date.now(),na="system",aa=null,sa=null,oa=null,la=60,ua,ca=null,ne=class{static get now(){return ia}static set now(e){ia=e}static set defaultZone(e){na=e}static get defaultZone(){return ut(na,Yr.instance)}static get defaultLocale(){return aa}static set defaultLocale(e){aa=e}static get defaultNumberingSystem(){return sa}static set defaultNumberingSystem(e){sa=e}static get defaultOutputCalendar(){return oa}static set defaultOutputCalendar(e){oa=e}static get defaultWeekSettings(){return ca}static set defaultWeekSettings(e){ca=an(e)}static get twoDigitCutoffYear(){return la}static set twoDigitCutoffYear(e){la=e%100}static get throwOnInvalid(){return ua}static set throwOnInvalid(e){ua=e}static resetCaches(){re.resetCache(),ft.resetCache(),Q.resetCache(),Bl()}},Ne=class{constructor(e,r){this.reason=e,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},Ka=[0,31,59,90,120,151,181,212,243,273,304,334],Xa=[0,31,60,91,121,152,182,213,244,274,305,335];function Me(t,e){return new Ne("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function un(t,e,r){let i=new Date(Date.UTC(t,e-1,r));t<100&&t>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);let n=i.getUTCDay();return n===0?7:n}function es(t,e,r){return r+(gr(t)?Xa:Ka)[e-1]}function ts(t,e){let r=gr(t)?Xa:Ka,i=r.findIndex(a=>a<e),n=e-r[i];return{month:i+1,day:n}}function cn(t,e){return(t-e+7)%7+1}function Qr(t,e=4,r=1){let{year:i,month:n,day:a}=t,s=es(i,n,a),o=cn(un(i,n,a),r),l=Math.floor((s-o+14-e)/7),u;return l<1?(u=i-1,l=mr(u,e,r)):l>mr(i,e,r)?(u=i+1,l=1):u=i,{weekYear:u,weekNumber:l,weekday:o,...ii(t)}}function da(t,e=4,r=1){let{weekYear:i,weekNumber:n,weekday:a}=t,s=cn(un(i,1,e),r),o=Zt(i),l=n*7+a-s-7+e,u;l<1?(u=i-1,l+=Zt(u)):l>o?(u=i+1,l-=Zt(i)):u=i;let{month:c,day:d}=ts(u,l);return{year:u,month:c,day:d,...ii(t)}}function ki(t){let{year:e,month:r,day:i}=t,n=es(e,r,i);return{year:e,ordinal:n,...ii(t)}}function fa(t){let{year:e,ordinal:r}=t,{month:i,day:n}=ts(e,r);return{year:e,month:i,day:n,...ii(t)}}function ma(t,e){if(!Z(t.localWeekday)||!Z(t.localWeekNumber)||!Z(t.localWeekYear)){if(!Z(t.weekday)||!Z(t.weekNumber)||!Z(t.weekYear))throw new ct("Cannot mix locale-based week fields with ISO-based week fields");return Z(t.localWeekday)||(t.weekday=t.localWeekday),Z(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Z(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Il(t,e=4,r=1){let i=ei(t.weekYear),n=Ee(t.weekNumber,1,mr(t.weekYear,e,r)),a=Ee(t.weekday,1,7);return i?n?a?!1:Me("weekday",t.weekday):Me("week",t.weekNumber):Me("weekYear",t.weekYear)}function Al(t){let e=ei(t.year),r=Ee(t.ordinal,1,Zt(t.year));return e?r?!1:Me("ordinal",t.ordinal):Me("year",t.year)}function rs(t){let e=ei(t.year),r=Ee(t.month,1,12),i=Ee(t.day,1,Jr(t.year,t.month));return e?r?i?!1:Me("day",t.day):Me("month",t.month):Me("year",t.year)}function is(t){let{hour:e,minute:r,second:i,millisecond:n}=t,a=Ee(e,0,23)||e===24&&r===0&&i===0&&n===0,s=Ee(r,0,59),o=Ee(i,0,59),l=Ee(n,0,999);return a?s?o?l?!1:Me("millisecond",n):Me("second",i):Me("minute",r):Me("hour",e)}function Z(t){return typeof t>"u"}function dt(t){return typeof t=="number"}function ei(t){return typeof t=="number"&&t%1===0}function Ml(t){return typeof t=="string"}function El(t){return Object.prototype.toString.call(t)==="[object Date]"}function ns(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function as(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ll(t){return Array.isArray(t)?t:[t]}function ga(t,e,r){if(t.length!==0)return t.reduce((i,n)=>{let a=[e(n),n];return i&&r(i[0],a[0])===i[0]?i:a},null)[1]}function ql(t,e){return e.reduce((r,i)=>(r[i]=t[i],r),{})}function Ut(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function an(t){if(t==null)return null;if(typeof t!="object")throw new fe("Week settings must be an object");if(!Ee(t.firstDay,1,7)||!Ee(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!Ee(e,1,7)))throw new fe("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Ee(t,e,r){return ei(t)&&t>=e&&t<=r}function Dl(t,e){return t-e*Math.floor(t/e)}function ue(t,e=2){let r=t<0,i;return r?i="-"+(""+-t).padStart(e,"0"):i=(""+t).padStart(e,"0"),i}function lt(t){if(!(Z(t)||t===null||t===""))return parseInt(t,10)}function wt(t){if(!(Z(t)||t===null||t===""))return parseFloat(t)}function dn(t){if(!(Z(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function fn(t,e,r="round"){let i=10**e;switch(r){case"expand":return t>0?Math.ceil(t*i)/i:Math.floor(t*i)/i;case"trunc":return Math.trunc(t*i)/i;case"round":return Math.round(t*i)/i;case"floor":return Math.floor(t*i)/i;case"ceil":return Math.ceil(t*i)/i;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function gr(t){return t%4===0&&(t%100!==0||t%400===0)}function Zt(t){return gr(t)?366:365}function Jr(t,e){let r=Dl(e-1,12)+1,i=t+(e-r)/12;return r===2?gr(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function ti(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function ha(t,e,r){return-cn(un(t,1,e),r)+e-1}function mr(t,e=4,r=1){let i=ha(t,e,r),n=ha(t+1,e,r);return(Zt(t)-i+n)/7}function sn(t){return t>99?t:t>ne.twoDigitCutoffYear?1900+t:2e3+t}function ss(t,e,r,i=null){let n=new Date(t),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(a.timeZone=i);let s={timeZoneName:e,...a},o=new Intl.DateTimeFormat(r,s).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return o?o.value:null}function ri(t,e){let r=parseInt(t,10);Number.isNaN(r)&&(r=0);let i=parseInt(e,10)||0,n=r<0||Object.is(r,-0)?-i:i;return r*60+n}function os(t){let e=Number(t);if(typeof t=="boolean"||t===""||!Number.isFinite(e))throw new fe(`Invalid unit value ${t}`);return e}function Kr(t,e){let r={};for(let i in t)if(Ut(t,i)){let n=t[i];if(n==null)continue;r[e(i)]=os(n)}return r}function fr(t,e){let r=Math.trunc(Math.abs(t/60)),i=Math.trunc(Math.abs(t%60)),n=t>=0?"+":"-";switch(e){case"short":return`${n}${ue(r,2)}:${ue(i,2)}`;case"narrow":return`${n}${r}${i>0?`:${i}`:""}`;case"techie":return`${n}${ue(r,2)}${ue(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function ii(t){return ql(t,["hour","minute","second","millisecond"])}var Pl=["January","February","March","April","May","June","July","August","September","October","November","December"],ls=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],kl=["J","F","M","A","M","J","J","A","S","O","N","D"];function us(t){switch(t){case"narrow":return[...kl];case"short":return[...ls];case"long":return[...Pl];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var cs=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ds=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Vl=["M","T","W","T","F","S","S"];function fs(t){switch(t){case"narrow":return[...Vl];case"short":return[...ds];case"long":return[...cs];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var ms=["AM","PM"],$l=["Before Christ","Anno Domini"],Rl=["BC","AD"],Wl=["B","A"];function gs(t){switch(t){case"narrow":return[...Wl];case"short":return[...Rl];case"long":return[...$l];default:return null}}function jl(t){return ms[t.hour<12?0:1]}function Zl(t,e){return fs(e)[t.weekday-1]}function _l(t,e){return us(e)[t.month-1]}function zl(t,e){return gs(e)[t.year<0?0:1]}function Ul(t,e,r="always",i=!1){let n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(t)===-1;if(r==="auto"&&a){let d=t==="days";switch(e){case 1:return d?"tomorrow":`next ${n[t][0]}`;case-1:return d?"yesterday":`last ${n[t][0]}`;case 0:return d?"today":`this ${n[t][0]}`}}let s=Object.is(e,-0)||e<0,o=Math.abs(e),l=o===1,u=n[t],c=i?l?u[1]:u[2]||u[1]:l?n[t][0]:t;return s?`${o} ${c} ago`:`in ${o} ${c}`}function ya(t,e){let r="";for(let i of t)i.literal?r+=i.val:r+=e(i.val);return r}var Hl={D:Gr,DD:Ma,DDD:Ea,DDDD:La,t:qa,tt:Da,ttt:Pa,tttt:ka,T:Va,TT:$a,TTT:Ra,TTTT:Wa,f:ja,ff:_a,fff:Ua,ffff:Ga,F:Za,FF:za,FFF:Ha,FFFF:Ya},Te=class t{static create(e,r={}){return new t(e,r)}static parseFormat(e){let r=null,i="",n=!1,a=[];for(let s=0;s<e.length;s++){let o=e.charAt(s);o==="'"?((i.length>0||n)&&a.push({literal:n||/^\s+$/.test(i),val:i===""?"'":i}),r=null,i="",n=!n):n||o===r?i+=o:(i.length>0&&a.push({literal:/^\s+$/.test(i),val:i}),i=o,r=o)}return i.length>0&&a.push({literal:n||/^\s+$/.test(i),val:i}),a}static macroTokenToFormatOpts(e){return Hl[e]}constructor(e,r){this.opts=r,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...r}).format()}dtFormatter(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r})}formatDateTime(e,r){return this.dtFormatter(e,r).format()}formatDateTimeParts(e,r){return this.dtFormatter(e,r).formatToParts()}formatInterval(e,r){return this.dtFormatter(e.start,r).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,r){return this.dtFormatter(e,r).resolvedOptions()}num(e,r=0,i=void 0){if(this.opts.forceSimple)return ue(e,r);let n={...this.opts};return r>0&&(n.padTo=r),i&&(n.signDisplay=i),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,r){let i=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(m,g)=>this.loc.extract(e,m,g),s=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",o=()=>i?jl(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(m,g)=>i?_l(e,m):a(g?{month:m}:{month:m,day:"numeric"},"month"),u=(m,g)=>i?Zl(e,m):a(g?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),c=m=>{let g=t.macroTokenToFormatOpts(m);return g?this.formatWithSystemDefault(e,g):m},d=m=>i?zl(e,m):a({era:m},"era"),f=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return n?a({day:"numeric"},"day"):this.num(e.day);case"dd":return n?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return n?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return n?a({month:"numeric"},"month"):this.num(e.month);case"MM":return n?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return n?a({year:"numeric"},"year"):this.num(e.year);case"yy":return n?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(m)}};return ya(t.parseFormat(r),f)}formatDurationFromString(e,r){let i=this.opts.signMode==="negativeLargestOnly"?-1:1,n=c=>{switch(c[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},a=(c,d)=>f=>{let m=n(f);if(m){let g=d.isNegativeDuration&&m!==d.largestUnit?i:1,h;return this.opts.signMode==="negativeLargestOnly"&&m!==d.largestUnit?h="never":this.opts.signMode==="all"?h="always":h="auto",this.num(c.get(m)*g,f.length,h)}else return f},s=t.parseFormat(r),o=s.reduce((c,{literal:d,val:f})=>d?c:c.concat(f),[]),l=e.shiftTo(...o.map(n).filter(c=>c)),u={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return ya(s,a(l,u))}},hs=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ht(...t){let e=t.reduce((r,i)=>r+i.source,"");return RegExp(`^${e}$`)}function Gt(...t){return e=>t.reduce(([r,i,n],a)=>{let[s,o,l]=a(e,n);return[{...r,...s},o||i,l]},[{},null,1]).slice(0,2)}function Yt(t,...e){if(t==null)return[null,null];for(let[r,i]of e){let n=r.exec(t);if(n)return i(n)}return[null,null]}function ys(...t){return(e,r)=>{let i={},n;for(n=0;n<t.length;n++)i[t[n]]=lt(e[r+n]);return[i,null,r+n]}}var ps=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Gl=`(?:${ps.source}?(?:\\[(${hs.source})\\])?)?`,mn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Ss=RegExp(`${mn.source}${Gl}`),gn=RegExp(`(?:[Tt]${Ss.source})?`),Yl=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ql=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Jl=/(\d{4})-?(\d{3})/,Kl=ys("weekYear","weekNumber","weekDay"),Xl=ys("year","ordinal"),eu=/(\d{4})-(\d\d)-(\d\d)/,bs=RegExp(`${mn.source} ?(?:${ps.source}|(${hs.source}))?`),tu=RegExp(`(?: ${bs.source})?`);function _t(t,e,r){let i=t[e];return Z(i)?r:lt(i)}function ru(t,e){return[{year:_t(t,e),month:_t(t,e+1,1),day:_t(t,e+2,1)},null,e+3]}function Qt(t,e){return[{hours:_t(t,e,0),minutes:_t(t,e+1,0),seconds:_t(t,e+2,0),milliseconds:dn(t[e+3])},null,e+4]}function hr(t,e){let r=!t[e]&&!t[e+1],i=ri(t[e+1],t[e+2]),n=r?null:Le.instance(i);return[{},n,e+3]}function yr(t,e){let r=t[e]?ft.create(t[e]):null;return[{},r,e+1]}var iu=RegExp(`^T?${mn.source}$`),nu=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function au(t){let[e,r,i,n,a,s,o,l,u]=t,c=e[0]==="-",d=l&&l[0]==="-",f=(m,g=!1)=>m!==void 0&&(g||m&&c)?-m:m;return[{years:f(wt(r)),months:f(wt(i)),weeks:f(wt(n)),days:f(wt(a)),hours:f(wt(s)),minutes:f(wt(o)),seconds:f(wt(l),l==="-0"),milliseconds:f(dn(u),d)}]}var su={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function hn(t,e,r,i,n,a,s){let o={year:e.length===2?sn(lt(e)):lt(e),month:ls.indexOf(r)+1,day:lt(i),hour:lt(n),minute:lt(a)};return s&&(o.second=lt(s)),t&&(o.weekday=t.length>3?cs.indexOf(t)+1:ds.indexOf(t)+1),o}var ou=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function lu(t){let[,e,r,i,n,a,s,o,l,u,c,d]=t,f=hn(e,n,i,r,a,s,o),m;return l?m=su[l]:u?m=0:m=ri(c,d),[f,new Le(m)]}function uu(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var cu=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,du=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,fu=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function pa(t){let[,e,r,i,n,a,s,o]=t;return[hn(e,n,i,r,a,s,o),Le.utcInstance]}function mu(t){let[,e,r,i,n,a,s,o]=t;return[hn(e,o,r,i,n,a,s),Le.utcInstance]}var gu=Ht(Yl,gn),hu=Ht(Ql,gn),yu=Ht(Jl,gn),pu=Ht(Ss),vs=Gt(ru,Qt,hr,yr),Su=Gt(Kl,Qt,hr,yr),bu=Gt(Xl,Qt,hr,yr),vu=Gt(Qt,hr,yr);function Cu(t){return Yt(t,[gu,vs],[hu,Su],[yu,bu],[pu,vu])}function Fu(t){return Yt(uu(t),[ou,lu])}function xu(t){return Yt(t,[cu,pa],[du,pa],[fu,mu])}function wu(t){return Yt(t,[nu,au])}var Tu=Gt(Qt);function Nu(t){return Yt(t,[iu,Tu])}var Ou=Ht(eu,tu),Bu=Ht(bs),Iu=Gt(Qt,hr,yr);function Au(t){return Yt(t,[Ou,vs],[Bu,Iu])}var Sa="Invalid Duration",Cs={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Mu={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Cs},Ae=146097/400,$t=146097/4800,Eu={years:{quarters:4,months:12,weeks:Ae/7,days:Ae,hours:Ae*24,minutes:Ae*24*60,seconds:Ae*24*60*60,milliseconds:Ae*24*60*60*1e3},quarters:{months:3,weeks:Ae/28,days:Ae/4,hours:Ae*24/4,minutes:Ae*24*60/4,seconds:Ae*24*60*60/4,milliseconds:Ae*24*60*60*1e3/4},months:{weeks:$t/7,days:$t,hours:$t*24,minutes:$t*24*60,seconds:$t*24*60*60,milliseconds:$t*24*60*60*1e3},...Cs},Nt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Lu=Nt.slice(0).reverse();function Xe(t,e,r=!1){let i={values:r?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new me(i)}function Fs(t,e){let r=e.milliseconds??0;for(let i of Lu.slice(1))e[i]&&(r+=e[i]*t[i].milliseconds);return r}function ba(t,e){let r=Fs(t,e)<0?-1:1;Nt.reduceRight((i,n)=>{if(Z(e[n]))return i;if(i){let a=e[i]*r,s=t[n][i],o=Math.floor(a/s);e[n]+=o*r,e[i]-=o*s*r}return n},null),Nt.reduce((i,n)=>{if(Z(e[n]))return i;if(i){let a=e[i]%1;e[i]-=a,e[n]+=a*t[i][n]}return n},null)}function va(t){let e={};for(let[r,i]of Object.entries(t))i!==0&&(e[r]=i);return e}var me=class t{constructor(e){let r=e.conversionAccuracy==="longterm"||!1,i=r?Eu:Mu;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||re.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,r){return t.fromObject({milliseconds:e},r)}static fromObject(e,r={}){if(e==null||typeof e!="object")throw new fe(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new t({values:Kr(e,t.normalizeUnit),loc:re.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(e){if(dt(e))return t.fromMillis(e);if(t.isDuration(e))return e;if(typeof e=="object")return t.fromObject(e);throw new fe(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,r){let[i]=wu(e);return i?t.fromObject(i,r):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,r){let[i]=Nu(e);return i?t.fromObject(i,r):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,r=null){if(!e)throw new fe("need to specify a reason the Duration is invalid");let i=e instanceof Ne?e:new Ne(e,r);if(ne.throwOnInvalid)throw new zi(i);return new t({invalid:i})}static normalizeUnit(e){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!r)throw new Hr(e);return r}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,r={}){let i={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Te.create(this.loc,i).formatDurationFromString(this,e):Sa}toHuman(e={}){if(!this.isValid)return Sa;let r=e.showZeros!==!1,i=Nt.map(n=>{let a=this.values[n];return Z(a)||a===0&&!r?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(a)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(i)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=fn(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Q.fromMillis(r,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Fs(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let r=t.fromDurationLike(e),i={};for(let n of Nt)(Ut(r.values,n)||Ut(this.values,n))&&(i[n]=r.get(n)+this.get(n));return Xe(this,{values:i},!0)}minus(e){if(!this.isValid)return this;let r=t.fromDurationLike(e);return this.plus(r.negate())}mapUnits(e){if(!this.isValid)return this;let r={};for(let i of Object.keys(this.values))r[i]=os(e(this.values[i],i));return Xe(this,{values:r},!0)}get(e){return this[t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let r={...this.values,...Kr(e,t.normalizeUnit)};return Xe(this,{values:r})}reconfigure({locale:e,numberingSystem:r,conversionAccuracy:i,matrix:n}={}){let s={loc:this.loc.clone({locale:e,numberingSystem:r}),matrix:n,conversionAccuracy:i};return Xe(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return ba(this.matrix,e),Xe(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=va(this.normalize().shiftToAll().toObject());return Xe(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(s=>t.normalizeUnit(s));let r={},i={},n=this.toObject(),a;for(let s of Nt)if(e.indexOf(s)>=0){a=s;let o=0;for(let u in i)o+=this.matrix[u][s]*i[u],i[u]=0;dt(n[s])&&(o+=n[s]);let l=Math.trunc(o);r[s]=l,i[s]=(o*1e3-l*1e3)/1e3}else dt(n[s])&&(i[s]=n[s]);for(let s in i)i[s]!==0&&(r[a]+=s===a?i[s]:i[s]/this.matrix[a][s]);return ba(this.matrix,r),Xe(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let r of Object.keys(this.values))e[r]=this.values[r]===0?0:-this.values[r];return Xe(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=va(this.values);return Xe(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function r(i,n){return i===void 0||i===0?n===void 0||n===0:i===n}for(let i of Nt)if(!r(this.values[i],e.values[i]))return!1;return!0}},Rt="Invalid Interval";function qu(t,e){return!t||!t.isValid?zt.invalid("missing or invalid start"):!e||!e.isValid?zt.invalid("missing or invalid end"):e<t?zt.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}var zt=class t{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,r=null){if(!e)throw new fe("need to specify a reason the Interval is invalid");let i=e instanceof Ne?e:new Ne(e,r);if(ne.throwOnInvalid)throw new _i(i);return new t({invalid:i})}static fromDateTimes(e,r){let i=lr(e),n=lr(r),a=qu(i,n);return a??new t({start:i,end:n})}static after(e,r){let i=me.fromDurationLike(r),n=lr(e);return t.fromDateTimes(n,n.plus(i))}static before(e,r){let i=me.fromDurationLike(r),n=lr(e);return t.fromDateTimes(n.minus(i),n)}static fromISO(e,r){let[i,n]=(e||"").split("/",2);if(i&&n){let a,s;try{a=Q.fromISO(i,r),s=a.isValid}catch{s=!1}let o,l;try{o=Q.fromISO(n,r),l=o.isValid}catch{l=!1}if(s&&l)return t.fromDateTimes(a,o);if(s){let u=me.fromISO(n,r);if(u.isValid)return t.after(a,u)}else if(l){let u=me.fromISO(i,r);if(u.isValid)return t.before(o,u)}}return t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",r){if(!this.isValid)return NaN;let i=this.start.startOf(e,r),n;return r?.useLocaleWeeks?n=this.end.reconfigure({locale:i.locale}):n=this.end,n=n.startOf(e,r),Math.floor(n.diff(i,e).get(e))+(n.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:r}={}){return this.isValid?t.fromDateTimes(e||this.s,r||this.e):this}splitAt(...e){if(!this.isValid)return[];let r=e.map(lr).filter(s=>this.contains(s)).sort((s,o)=>s.toMillis()-o.toMillis()),i=[],{s:n}=this,a=0;for(;n<this.e;){let s=r[a]||this.e,o=+s>+this.e?this.e:s;i.push(t.fromDateTimes(n,o)),n=o,a+=1}return i}splitBy(e){let r=me.fromDurationLike(e);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:i}=this,n=1,a,s=[];for(;i<this.e;){let o=this.start.plus(r.mapUnits(l=>l*n));a=+o>+this.e?this.e:o,s.push(t.fromDateTimes(i,a)),i=a,n+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let r=this.s>e.s?this.s:e.s,i=this.e<e.e?this.e:e.e;return r>=i?null:t.fromDateTimes(r,i)}union(e){if(!this.isValid)return this;let r=this.s<e.s?this.s:e.s,i=this.e>e.e?this.e:e.e;return t.fromDateTimes(r,i)}static merge(e){let[r,i]=e.sort((n,a)=>n.s-a.s).reduce(([n,a],s)=>a?a.overlaps(s)||a.abutsStart(s)?[n,a.union(s)]:[n.concat([a]),s]:[n,s],[[],null]);return i&&r.push(i),r}static xor(e){let r=null,i=0,n=[],a=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...a),o=s.sort((l,u)=>l.time-u.time);for(let l of o)i+=l.type==="s"?1:-1,i===1?r=l.time:(r&&+r!=+l.time&&n.push(t.fromDateTimes(r,l.time)),r=null);return t.merge(n)}difference(...e){return t.xor([this].concat(e)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Rt}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Gr,r={}){return this.isValid?Te.create(this.s.loc.clone(r),e).formatInterval(this):Rt}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Rt}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Rt}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Rt}toFormat(e,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${r}${this.e.toFormat(e)}`:Rt}toDuration(e,r){return this.isValid?this.e.diff(this.s,e,r):me.invalid(this.invalidReason)}mapEndpoints(e){return t.fromDateTimes(e(this.s),e(this.e))}},jt=class{static hasDST(e=ne.defaultZone){let r=Q.now().setZone(e).set({month:12});return!e.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(e){return ft.isValidZone(e)}static normalizeZone(e){return ut(e,ne.defaultZone)}static getStartOfWeek({locale:e=null,locObj:r=null}={}){return(r||re.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:r=null}={}){return(r||re.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:r=null}={}){return(r||re.create(e)).getWeekendDays().slice()}static months(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||re.create(r,i,a)).months(e)}static monthsFormat(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||re.create(r,i,a)).months(e,!0)}static weekdays(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||re.create(r,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||re.create(r,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return re.create(e).meridiems()}static eras(e="short",{locale:r=null}={}){return re.create(r,null,"gregory").eras(e)}static features(){return{relative:ns(),localeWeek:as()}}};function Ca(t,e){let r=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=r(e)-r(t);return Math.floor(me.fromMillis(i).as("days"))}function Du(t,e,r){let i=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{let c=Ca(l,u);return(c-c%7)/7}],["days",Ca]],n={},a=t,s,o;for(let[l,u]of i)r.indexOf(l)>=0&&(s=l,n[l]=u(t,e),o=a.plus(n),o>e?(n[l]--,t=a.plus(n),t>e&&(o=t,n[l]--,t=a.plus(n))):t=o);return[t,n,o,s]}function Pu(t,e,r,i){let[n,a,s,o]=Du(t,e,r),l=e-n,u=r.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(s<e&&(s=n.plus({[o]:1})),s!==n&&(a[o]=(a[o]||0)+l/(s-n)));let c=me.fromObject(a,i);return u.length>0?me.fromMillis(l,i).shiftTo(...u).plus(c):c}var ku="missing Intl.DateTimeFormat.formatToParts support";function ee(t,e=r=>r){return{regex:t,deser:([r])=>e(Ol(r))}}var Vu="\xA0",xs=`[ ${Vu}]`,ws=new RegExp(xs,"g");function $u(t){return t.replace(/\./g,"\\.?").replace(ws,xs)}function Fa(t){return t.replace(/\./g,"").replace(ws," ").toLowerCase()}function ke(t,e){return t===null?null:{regex:RegExp(t.map($u).join("|")),deser:([r])=>t.findIndex(i=>Fa(r)===Fa(i))+e}}function xa(t,e){return{regex:t,deser:([,r,i])=>ri(r,i),groups:e}}function Wr(t){return{regex:t,deser:([e])=>e}}function Ru(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Wu(t,e){let r=Pe(e),i=Pe(e,"{2}"),n=Pe(e,"{3}"),a=Pe(e,"{4}"),s=Pe(e,"{6}"),o=Pe(e,"{1,2}"),l=Pe(e,"{1,3}"),u=Pe(e,"{1,6}"),c=Pe(e,"{1,9}"),d=Pe(e,"{2,4}"),f=Pe(e,"{4,6}"),m=y=>({regex:RegExp(Ru(y.val)),deser:([b])=>b,literal:!0}),h=(y=>{if(t.literal)return m(y);switch(y.val){case"G":return ke(e.eras("short"),0);case"GG":return ke(e.eras("long"),0);case"y":return ee(u);case"yy":return ee(d,sn);case"yyyy":return ee(a);case"yyyyy":return ee(f);case"yyyyyy":return ee(s);case"M":return ee(o);case"MM":return ee(i);case"MMM":return ke(e.months("short",!0),1);case"MMMM":return ke(e.months("long",!0),1);case"L":return ee(o);case"LL":return ee(i);case"LLL":return ke(e.months("short",!1),1);case"LLLL":return ke(e.months("long",!1),1);case"d":return ee(o);case"dd":return ee(i);case"o":return ee(l);case"ooo":return ee(n);case"HH":return ee(i);case"H":return ee(o);case"hh":return ee(i);case"h":return ee(o);case"mm":return ee(i);case"m":return ee(o);case"q":return ee(o);case"qq":return ee(i);case"s":return ee(o);case"ss":return ee(i);case"S":return ee(l);case"SSS":return ee(n);case"u":return Wr(c);case"uu":return Wr(o);case"uuu":return ee(r);case"a":return ke(e.meridiems(),0);case"kkkk":return ee(a);case"kk":return ee(d,sn);case"W":return ee(o);case"WW":return ee(i);case"E":case"c":return ee(r);case"EEE":return ke(e.weekdays("short",!1),1);case"EEEE":return ke(e.weekdays("long",!1),1);case"ccc":return ke(e.weekdays("short",!0),1);case"cccc":return ke(e.weekdays("long",!0),1);case"Z":case"ZZ":return xa(new RegExp(`([+-]${o.source})(?::(${i.source}))?`),2);case"ZZZ":return xa(new RegExp(`([+-]${o.source})(${i.source})?`),2);case"z":return Wr(/[a-z_+-/]{1,256}?/i);case" ":return Wr(/[^\S\n\r]/);default:return m(y)}})(t)||{invalidReason:ku};return h.token=t,h}var ju={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Zu(t,e,r){let{type:i,value:n}=t;if(i==="literal"){let l=/^\s+$/.test(n);return{literal:!l,val:l?" ":n}}let a=e[i],s=i;i==="hour"&&(e.hour12!=null?s=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?s="hour12":s="hour24":s=r.hour12?"hour12":"hour24");let o=ju[s];if(typeof o=="object"&&(o=o[a]),o)return{literal:!1,val:o}}function _u(t){return[`^${t.map(r=>r.regex).reduce((r,i)=>`${r}(${i.source})`,"")}$`,t]}function zu(t,e,r){let i=t.match(e);if(i){let n={},a=1;for(let s in r)if(Ut(r,s)){let o=r[s],l=o.groups?o.groups+1:1;!o.literal&&o.token&&(n[o.token.val[0]]=o.deser(i.slice(a,a+l))),a+=l}return[i,n]}else return[i,{}]}function Uu(t){let e=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,i;return Z(t.z)||(r=ft.create(t.z)),Z(t.Z)||(r||(r=new Le(t.Z)),i=t.Z),Z(t.q)||(t.M=(t.q-1)*3+1),Z(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Z(t.u)||(t.S=dn(t.u)),[Object.keys(t).reduce((a,s)=>{let o=e(s);return o&&(a[o]=t[s]),a},{}),r,i]}var Vi=null;function Hu(){return Vi||(Vi=Q.fromMillis(1555555555555)),Vi}function Gu(t,e){if(t.literal)return t;let r=Te.macroTokenToFormatOpts(t.val),i=Os(r,e);return i==null||i.includes(void 0)?t:i}function Ts(t,e){return Array.prototype.concat(...t.map(r=>Gu(r,e)))}var Xr=class{constructor(e,r){if(this.locale=e,this.format=r,this.tokens=Ts(Te.parseFormat(r),e),this.units=this.tokens.map(i=>Wu(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){let[i,n]=_u(this.units);this.regex=RegExp(i,"i"),this.handlers=n}}explainFromTokens(e){if(this.isValid){let[r,i]=zu(e,this.regex,this.handlers),[n,a,s]=i?Uu(i):[null,null,void 0];if(Ut(i,"a")&&Ut(i,"H"))throw new ct("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:r,matches:i,result:n,zone:a,specificOffset:s}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function Ns(t,e,r){return new Xr(t,r).explainFromTokens(e)}function Yu(t,e,r){let{result:i,zone:n,specificOffset:a,invalidReason:s}=Ns(t,e,r);return[i,n,a,s]}function Os(t,e){if(!t)return null;let i=Te.create(e,t).dtFormatter(Hu()),n=i.formatToParts(),a=i.resolvedOptions();return n.map(s=>Zu(s,t,a))}var $i="Invalid DateTime",wa=864e13;function cr(t){return new Ne("unsupported zone",`the zone "${t.name}" is not supported`)}function Ri(t){return t.weekData===null&&(t.weekData=Qr(t.c)),t.weekData}function Wi(t){return t.localWeekData===null&&(t.localWeekData=Qr(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Tt(t,e){let r={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Q({...r,...e,old:r})}function Bs(t,e,r){let i=t-e*60*1e3,n=r.offset(i);if(e===n)return[i,e];i-=(n-e)*60*1e3;let a=r.offset(i);return n===a?[i,n]:[t-Math.min(n,a)*60*1e3,Math.max(n,a)]}function jr(t,e){t+=e*60*1e3;let r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function _r(t,e,r){return Bs(ti(t),e,r)}function Ta(t,e){let r=t.o,i=t.c.year+Math.trunc(e.years),n=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,a={...t.c,year:i,month:n,day:Math.min(t.c.day,Jr(i,n))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},s=me.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=ti(a),[l,u]=Bs(o,r,t.zone);return s!==0&&(l+=s,u=t.zone.offset(l)),{ts:l,o:u}}function Wt(t,e,r,i,n,a){let{setZone:s,zone:o}=r;if(t&&Object.keys(t).length!==0||e){let l=e||o,u=Q.fromObject(t,{...r,zone:l,specificOffset:a});return s?u:u.setZone(o)}else return Q.invalid(new Ne("unparsable",`the input "${n}" can't be parsed as ${i}`))}function Zr(t,e,r=!0){return t.isValid?Te.create(re.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(t,e):null}function ji(t,e,r){let i=t.c.year>9999||t.c.year<0,n="";if(i&&t.c.year>=0&&(n+="+"),n+=ue(t.c.year,i?6:4),r==="year")return n;if(e){if(n+="-",n+=ue(t.c.month),r==="month")return n;n+="-"}else if(n+=ue(t.c.month),r==="month")return n;return n+=ue(t.c.day),n}function Na(t,e,r,i,n,a,s){let o=!r||t.c.millisecond!==0||t.c.second!==0,l="";switch(s){case"day":case"month":case"year":break;default:if(l+=ue(t.c.hour),s==="hour")break;if(e){if(l+=":",l+=ue(t.c.minute),s==="minute")break;o&&(l+=":",l+=ue(t.c.second))}else{if(l+=ue(t.c.minute),s==="minute")break;o&&(l+=ue(t.c.second))}if(s==="second")break;o&&(!i||t.c.millisecond!==0)&&(l+=".",l+=ue(t.c.millisecond,3))}return n&&(t.isOffsetFixed&&t.offset===0&&!a?l+="Z":t.o<0?(l+="-",l+=ue(Math.trunc(-t.o/60)),l+=":",l+=ue(Math.trunc(-t.o%60))):(l+="+",l+=ue(Math.trunc(t.o/60)),l+=":",l+=ue(Math.trunc(t.o%60)))),a&&(l+="["+t.zone.ianaName+"]"),l}var Is={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Qu={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ju={ordinal:1,hour:0,minute:0,second:0,millisecond:0},zr=["year","month","day","hour","minute","second","millisecond"],Ku=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Xu=["year","ordinal","hour","minute","second","millisecond"];function Ur(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Hr(t);return e}function Oa(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Ur(t)}}function ec(t){if(dr===void 0&&(dr=ne.now()),t.type!=="iana")return t.offset(dr);let e=t.name,r=on.get(e);return r===void 0&&(r=t.offset(dr),on.set(e,r)),r}function Ba(t,e){let r=ut(e.zone,ne.defaultZone);if(!r.isValid)return Q.invalid(cr(r));let i=re.fromObject(e),n,a;if(Z(t.year))n=ne.now();else{for(let l of zr)Z(t[l])&&(t[l]=Is[l]);let s=rs(t)||is(t);if(s)return Q.invalid(s);let o=ec(r);[n,a]=_r(t,o,r)}return new Q({ts:n,zone:r,loc:i,o:a})}function Ia(t,e,r){let i=Z(r.round)?!0:r.round,n=Z(r.rounding)?"trunc":r.rounding,a=(o,l)=>(o=fn(o,i||r.calendary?0:2,r.calendary?"round":n),e.loc.clone(r).relFormatter(r).format(o,l)),s=o=>r.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(r.unit)return a(s(r.unit),r.unit);for(let o of r.units){let l=s(o);if(Math.abs(l)>=1)return a(l,o)}return a(t>e?-0:0,r.units[r.units.length-1])}function Aa(t){let e={},r;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],r=Array.from(t).slice(0,t.length-1)):r=Array.from(t),[e,r]}var dr,on=new Map,Q=class t{constructor(e){let r=e.zone||ne.defaultZone,i=e.invalid||(Number.isNaN(e.ts)?new Ne("invalid input"):null)||(r.isValid?null:cr(r));this.ts=Z(e.ts)?ne.now():e.ts;let n=null,a=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(r))[n,a]=[e.old.c,e.old.o];else{let o=dt(e.o)&&!e.old?e.o:r.offset(this.ts);n=jr(this.ts,o),i=Number.isNaN(n.year)?new Ne("invalid input"):null,n=i?null:n,a=i?null:o}this._zone=r,this.loc=e.loc||re.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=n,this.o=a,this.isLuxonDateTime=!0}static now(){return new t({})}static local(){let[e,r]=Aa(arguments),[i,n,a,s,o,l,u]=r;return Ba({year:i,month:n,day:a,hour:s,minute:o,second:l,millisecond:u},e)}static utc(){let[e,r]=Aa(arguments),[i,n,a,s,o,l,u]=r;return e.zone=Le.utcInstance,Ba({year:i,month:n,day:a,hour:s,minute:o,second:l,millisecond:u},e)}static fromJSDate(e,r={}){let i=El(e)?e.valueOf():NaN;if(Number.isNaN(i))return t.invalid("invalid input");let n=ut(r.zone,ne.defaultZone);return n.isValid?new t({ts:i,zone:n,loc:re.fromObject(r)}):t.invalid(cr(n))}static fromMillis(e,r={}){if(dt(e))return e<-wa||e>wa?t.invalid("Timestamp out of range"):new t({ts:e,zone:ut(r.zone,ne.defaultZone),loc:re.fromObject(r)});throw new fe(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,r={}){if(dt(e))return new t({ts:e*1e3,zone:ut(r.zone,ne.defaultZone),loc:re.fromObject(r)});throw new fe("fromSeconds requires a numerical input")}static fromObject(e,r={}){e=e||{};let i=ut(r.zone,ne.defaultZone);if(!i.isValid)return t.invalid(cr(i));let n=re.fromObject(r),a=Kr(e,Oa),{minDaysInFirstWeek:s,startOfWeek:o}=ma(a,n),l=ne.now(),u=Z(r.specificOffset)?i.offset(l):r.specificOffset,c=!Z(a.ordinal),d=!Z(a.year),f=!Z(a.month)||!Z(a.day),m=d||f,g=a.weekYear||a.weekNumber;if((m||c)&&g)throw new ct("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&c)throw new ct("Can't mix ordinal dates with month/day");let h=g||a.weekday&&!m,y,b,x=jr(l,u);h?(y=Ku,b=Qu,x=Qr(x,s,o)):c?(y=Xu,b=Ju,x=ki(x)):(y=zr,b=Is);let w=!1;for(let N of y){let A=a[N];Z(A)?w?a[N]=b[N]:a[N]=x[N]:w=!0}let C=h?Il(a,s,o):c?Al(a):rs(a),v=C||is(a);if(v)return t.invalid(v);let T=h?da(a,s,o):c?fa(a):a,[O,I]=_r(T,u,i),B=new t({ts:O,zone:i,o:I,loc:n});return a.weekday&&m&&e.weekday!==B.weekday?t.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${B.toISO()}`):B.isValid?B:t.invalid(B.invalid)}static fromISO(e,r={}){let[i,n]=Cu(e);return Wt(i,n,r,"ISO 8601",e)}static fromRFC2822(e,r={}){let[i,n]=Fu(e);return Wt(i,n,r,"RFC 2822",e)}static fromHTTP(e,r={}){let[i,n]=xu(e);return Wt(i,n,r,"HTTP",r)}static fromFormat(e,r,i={}){if(Z(e)||Z(r))throw new fe("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:a=null}=i,s=re.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0}),[o,l,u,c]=Yu(s,e,r);return c?t.invalid(c):Wt(o,l,i,`format ${r}`,e,u)}static fromString(e,r,i={}){return t.fromFormat(e,r,i)}static fromSQL(e,r={}){let[i,n]=Au(e);return Wt(i,n,r,"SQL",e)}static invalid(e,r=null){if(!e)throw new fe("need to specify a reason the DateTime is invalid");let i=e instanceof Ne?e:new Ne(e,r);if(ne.throwOnInvalid)throw new Zi(i);return new t({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,r={}){let i=Os(e,re.fromObject(r));return i?i.map(n=>n?n.val:null).join(""):null}static expandFormat(e,r={}){return Ts(Te.parseFormat(e),re.fromObject(r)).map(n=>n.val).join("")}static resetCache(){dr=void 0,on.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ri(this).weekYear:NaN}get weekNumber(){return this.isValid?Ri(this).weekNumber:NaN}get weekday(){return this.isValid?Ri(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Wi(this).weekday:NaN}get localWeekNumber(){return this.isValid?Wi(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Wi(this).weekYear:NaN}get ordinal(){return this.isValid?ki(this.c).ordinal:NaN}get monthShort(){return this.isValid?jt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?jt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?jt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?jt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,r=6e4,i=ti(this.c),n=this.zone.offset(i-e),a=this.zone.offset(i+e),s=this.zone.offset(i-n*r),o=this.zone.offset(i-a*r);if(s===o)return[this];let l=i-s*r,u=i-o*r,c=jr(l,s),d=jr(u,o);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[Tt(this,{ts:l}),Tt(this,{ts:u})]:[this]}get isInLeapYear(){return gr(this.year)}get daysInMonth(){return Jr(this.year,this.month)}get daysInYear(){return this.isValid?Zt(this.year):NaN}get weeksInWeekYear(){return this.isValid?mr(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?mr(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:r,numberingSystem:i,calendar:n}=Te.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:r,numberingSystem:i,outputCalendar:n}}toUTC(e=0,r={}){return this.setZone(Le.instance(e),r)}toLocal(){return this.setZone(ne.defaultZone)}setZone(e,{keepLocalTime:r=!1,keepCalendarTime:i=!1}={}){if(e=ut(e,ne.defaultZone),e.equals(this.zone))return this;if(e.isValid){let n=this.ts;if(r||i){let a=e.offset(this.ts),s=this.toObject();[n]=_r(s,a,e)}return Tt(this,{ts:n,zone:e})}else return t.invalid(cr(e))}reconfigure({locale:e,numberingSystem:r,outputCalendar:i}={}){let n=this.loc.clone({locale:e,numberingSystem:r,outputCalendar:i});return Tt(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let r=Kr(e,Oa),{minDaysInFirstWeek:i,startOfWeek:n}=ma(r,this.loc),a=!Z(r.weekYear)||!Z(r.weekNumber)||!Z(r.weekday),s=!Z(r.ordinal),o=!Z(r.year),l=!Z(r.month)||!Z(r.day),u=o||l,c=r.weekYear||r.weekNumber;if((u||s)&&c)throw new ct("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new ct("Can't mix ordinal dates with month/day");let d;a?d=da({...Qr(this.c,i,n),...r},i,n):Z(r.ordinal)?(d={...this.toObject(),...r},Z(r.day)&&(d.day=Math.min(Jr(d.year,d.month),d.day))):d=fa({...ki(this.c),...r});let[f,m]=_r(d,this.o,this.zone);return Tt(this,{ts:f,o:m})}plus(e){if(!this.isValid)return this;let r=me.fromDurationLike(e);return Tt(this,Ta(this,r))}minus(e){if(!this.isValid)return this;let r=me.fromDurationLike(e).negate();return Tt(this,Ta(this,r))}startOf(e,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;let i={},n=me.normalizeUnit(e);switch(n){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(n==="weeks")if(r){let a=this.loc.getStartOfWeek(),{weekday:s}=this;s<a&&(i.weekNumber=this.weekNumber-1),i.weekday=a}else i.weekday=1;if(n==="quarters"){let a=Math.ceil(this.month/3);i.month=(a-1)*3+1}return this.set(i)}endOf(e,r){return this.isValid?this.plus({[e]:1}).startOf(e,r).minus(1):this}toFormat(e,r={}){return this.isValid?Te.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,e):$i}toLocaleString(e=Gr,r={}){return this.isValid?Te.create(this.loc.clone(r),e).formatDateTime(this):$i}toLocaleParts(e={}){return this.isValid?Te.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:r=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:a=!1,precision:s="milliseconds"}={}){if(!this.isValid)return null;s=Ur(s);let o=e==="extended",l=ji(this,o,s);return zr.indexOf(s)>=3&&(l+="T"),l+=Na(this,o,r,i,n,a,s),l}toISODate({format:e="extended",precision:r="day"}={}){return this.isValid?ji(this,e==="extended",Ur(r)):null}toISOWeekDate(){return Zr(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:r=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:a=!1,format:s="extended",precision:o="milliseconds"}={}){return this.isValid?(o=Ur(o),(n&&zr.indexOf(o)>=3?"T":"")+Na(this,s==="extended",r,e,i,a,o)):null}toRFC2822(){return Zr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Zr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ji(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:r=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(r||e)&&(i&&(n+=" "),r?n+="z":e&&(n+="ZZ")),Zr(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():$i}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let r={...this.c};return e.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,r="milliseconds",i={}){if(!this.isValid||!e.isValid)return me.invalid("created by diffing an invalid DateTime");let n={locale:this.locale,numberingSystem:this.numberingSystem,...i},a=Ll(r).map(me.normalizeUnit),s=e.valueOf()>this.valueOf(),o=s?this:e,l=s?e:this,u=Pu(o,l,a,n);return s?u.negate():u}diffNow(e="milliseconds",r={}){return this.diff(t.now(),e,r)}until(e){return this.isValid?zt.fromDateTimes(this,e):this}hasSame(e,r,i){if(!this.isValid)return!1;let n=e.valueOf(),a=this.setZone(e.zone,{keepLocalTime:!0});return a.startOf(r,i)<=n&&n<=a.endOf(r,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let r=e.base||t.fromObject({},{zone:this.zone}),i=e.padding?this<r?-e.padding:e.padding:0,n=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(n=e.unit,a=void 0),Ia(r,this.plus(i),{...e,numeric:"always",units:n,unit:a})}toRelativeCalendar(e={}){return this.isValid?Ia(e.base||t.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(t.isDateTime))throw new fe("min requires all arguments be DateTimes");return ga(e,r=>r.valueOf(),Math.min)}static max(...e){if(!e.every(t.isDateTime))throw new fe("max requires all arguments be DateTimes");return ga(e,r=>r.valueOf(),Math.max)}static fromFormatExplain(e,r,i={}){let{locale:n=null,numberingSystem:a=null}=i,s=re.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0});return Ns(s,e,r)}static fromStringExplain(e,r,i={}){return t.fromFormatExplain(e,r,i)}static buildFormatParser(e,r={}){let{locale:i=null,numberingSystem:n=null}=r,a=re.fromOpts({locale:i,numberingSystem:n,defaultToEN:!0});return new Xr(a,e)}static fromFormatParser(e,r,i={}){if(Z(e)||Z(r))throw new fe("fromFormatParser requires an input string and a format parser");let{locale:n=null,numberingSystem:a=null}=i,s=re.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0});if(!s.equals(r.locale))throw new fe(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${r.locale}`);let{result:o,zone:l,specificOffset:u,invalidReason:c}=r.explainFromTokens(e);return c?t.invalid(c):Wt(o,l,i,`format ${r.format}`,e,u)}static get DATE_SHORT(){return Gr}static get DATE_MED(){return Ma}static get DATE_MED_WITH_WEEKDAY(){return cl}static get DATE_FULL(){return Ea}static get DATE_HUGE(){return La}static get TIME_SIMPLE(){return qa}static get TIME_WITH_SECONDS(){return Da}static get TIME_WITH_SHORT_OFFSET(){return Pa}static get TIME_WITH_LONG_OFFSET(){return ka}static get TIME_24_SIMPLE(){return Va}static get TIME_24_WITH_SECONDS(){return $a}static get TIME_24_WITH_SHORT_OFFSET(){return Ra}static get TIME_24_WITH_LONG_OFFSET(){return Wa}static get DATETIME_SHORT(){return ja}static get DATETIME_SHORT_WITH_SECONDS(){return Za}static get DATETIME_MED(){return _a}static get DATETIME_MED_WITH_SECONDS(){return za}static get DATETIME_MED_WITH_WEEKDAY(){return dl}static get DATETIME_FULL(){return Ua}static get DATETIME_FULL_WITH_SECONDS(){return Ha}static get DATETIME_HUGE(){return Ga}static get DATETIME_HUGE_WITH_SECONDS(){return Ya}};function lr(t){if(Q.isDateTime(t))return t;if(t&&t.valueOf&&dt(t.valueOf()))return Q.fromJSDate(t);if(t&&typeof t=="object")return Q.fromObject(t);throw new fe(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function As(t){var e,r,i=t.length;if(i===1)e=0,r=t[0][1];else{for(var n=0,a=0,s=0,o=0,l,u,c,d=0;d<i;d++)l=t[d],u=l[0],c=l[1],n+=u,a+=c,s+=u*u,o+=u*c;e=(i*o-n*a)/(i*s-n*n),r=a/i-e*n/i}return{m:e,b:r}}function Ms(t){return function(e){return t.b+t.m*e}}function Es(t,e){if(t.length<2)return 1;for(var r=0,i=0;i<t.length;i++)r+=t[i][1];for(var n=r/t.length,a=0,s=0;s<t.length;s++)a+=Math.pow(n-t[s][1],2);for(var o=0,l=0;l<t.length;l++)o+=Math.pow(t[l][1]-e(t[l][0]),2);return 1-o/a}var Ls=function(){this.totalCount=0,this.data={}};Ls.prototype.train=function(e,r){this.data[r]||(this.data[r]={});for(var i in e){var n=e[i];this.data[r][i]===void 0&&(this.data[r][i]={}),this.data[r][i][n]===void 0&&(this.data[r][i][n]=0),this.data[r][i][n]++}this.totalCount++};Ls.prototype.score=function(e){var r={},i;for(var n in e){var a=e[n];for(i in this.data)r[i]={},this.data[i][n]?r[i][n+"_"+a]=(this.data[i][n][a]||0)/this.totalCount:r[i][n+"_"+a]=0}var s={};for(i in r){s[i]=0;for(var o in r[i])s[i]+=r[i][o]}return s};var qs=function(){this.weights=[],this.bias=0};qs.prototype.predict=function(e){if(e.length!==this.weights.length)return null;for(var r=0,i=0;i<this.weights.length;i++)r+=this.weights[i]*e[i];return r+=this.bias,r>0?1:0};qs.prototype.train=function(e,r){if(r!==0&&r!==1)return null;e.length!==this.weights.length&&(this.weights=e,this.bias=1);var i=this.predict(e);if(typeof i=="number"&&i!==r){for(var n=r-i,a=0;a<this.weights.length;a++)this.weights[a]+=n*e[a];this.bias+=n}return this};var Mh=607/128,Eh=Math.log(Math.sqrt(2*Math.PI));var Lh=Math.sqrt(2*Math.PI);var tc=Math.sqrt(2*Math.PI);function rc(t){for(var e=t,r=t,i=1;i<15;i++)r*=t*t/(2*i+1),e+=r;return Math.round((.5+e/tc*Math.exp(-t*t/2))*1e4)/1e4}var ic=[];for(ni=0;ni<=3.09;ni+=.01)ic.push(rc(ni));var ni;function oi(t){return t?.type===p.NumberAxisFormat}function Sy(t){return oi(t)&&t.intlOptions?.style==="percent"}function We(t){return t.axes?.[0]?.valueFormat?.type}function by(t){return t.intlOptions}function li(t){return t?.type===p.CategoryAxisFormat}function mo(t){return t?.type===p.DateAxisFormat}function vy(t){let{oldConfig:e,newConfig:r,rotationChanged:i}=t;return i?[!0,!0]:[e.horizontalAxisLabelsBehavior!==r.horizontalAxisLabelsBehavior,e.verticalAxisLabelsBehavior!==r.verticalAxisLabelsBehavior]}function Fc(t){let{isXAxis:e,chartType:r,valueFormat:i,isAxisForHistogramOverlaySeries:n}=t;return r===p.HeatSeries||e&&(li(i)||r===p.HistogramSeries&&!n||r===p.BarSeries&&oi(i))}var pr={...F,titleAndSubtitlePaddingBottom:5,chartPadding:5,footerContainer:{...F.footerContainer,paddingTop:0,paddingBottom:0},headerContainer:{...F.headerContainer,paddingBottom:18},chartContainer:{...F.chartContainer},dataLabel:{...F.dataLabel,verticalCenter:"bottom"},scrollbarPadding:12,zIndexes:{defaultLayer30:30,customLayer10:10,customLayer5:5},verticalSurfaceGuideLabels:{wrap:!0},verticalLineGuideLabels:{wrap:!0,rotation:90},horizontalSurfaceGuideLabels:{wrap:!0},horizontalLineGuideLabels:{wrap:!0},overlayId:{scatterplotTrendLine:"arcgis_charts_scatter_plot_trendline",histogramMean:"arcgis_charts_histogram_mean",histogramMedian:"arcgis_charts_histogram_median",histogramStdDev:"arcgis_charts_histogram_std_dev",histogramNormalDistribution:"arcgis_charts_histogram_normal_distribution"},axisLabelSpacing:{verticalAxisLabelSidePadding:8,horizontalAxisLabelPaddingTop:6},legendPadding:20,heatChart:{gradientHeatRules:{minColor:[255,255,200,255],maxColor:[255,0,0,255],outsideRangeLowerColor:[250,250,250,255],outsideRangeUpperColor:[0,0,255,255]},legend:{position:_n.Bottom,chartPadding:40,legendPadding:20,width:70,bottomHeight:20,topHeight:50,titleHeight:10,titlePadding:10,minMaxLabelPadding:3},emptyCells:{symbol:{type:Ie.SFS,style:qr.Solid,color:F.grayColor},text:"null"},includeLeapDay:!1},heatChartLabelPadding:{paddingTop:2},pieChartDataLabel:{minWidth:30},focusableThreshold:500,lineJoin:"round"},P={Min:"min",FirstQuartile:"first_quartile",Median:"median",ThirdQuartile:"third_quartile",Max:"max",IQR:"iqr",Average:"avg",StandardDeviation:"stddev",Outlier:"outlier"},ge=class extends Error{constructor(e,r,i){super(r),this.name=e,this.details=i}},pe={Default:"defaultError",LayerLoadFailure:"layerLoadFailure",QueryFeaturesError:"queryFeaturesError",ChartDisposed:"ChartDisposeError",LayerFieldsNotFound:"layerFieldsNotFound",LayerNotSupported:"layerNotSupported"};function xc(t,e){let r=Q.now().offset/60,i=Q.now().setZone(t)??r,n=i.offset/60,a=e?i.setZone(e).offset/60:0;return n-a}function go(t){let{outTimeZone:e=Intl.DateTimeFormat().resolvedOptions().timeZone,dataTimeZone:r="UTC",runsOnClientQueryEngine:i}=t,n="",a=xc(e,r);if(a!==0)if(i)n=`${a>0?"+":"-"}1*INTERVAL '${Math.abs(a)}' HOUR `;else{let s=Math.abs(a%1),o=Math.round(s*60);a=Math.floor(a),n=a>0?`+INTERVAL '${Math.abs(a)}:${o!==0?o:"00"}:01' HOUR TO SECOND`:`-INTERVAL '${Math.abs(a)-(o!==0?0:1)}:${o!==0?String(o-1):"59"}:59' HOUR TO SECOND`}return n}function wc(t){let{dateFieldName:e,unit:r,runsOnClientQueryEngine:i,outTimeZone:n}=t,a=go({runsOnClientQueryEngine:i,outTimeZone:n}),s=`EXTRACT(YEAR FROM ${e} ${a})`,o=`EXTRACT(MONTH FROM ${e} ${a})`,l=`EXTRACT(DAY FROM ${e} ${a})`,u=`EXTRACT(HOUR FROM ${e} ${a})`,c=`EXTRACT(MINUTE FROM ${e} ${a})`,d=`EXTRACT(SECOND FROM ${e} ${a})`,f=[];switch(r){case U.Second:f=[s,o,l,u,c,d];break;case U.Minute:f=[s,o,l,u,c];break;case U.Hour:f=[s,o,l,u];break;case U.Day:case U.Week:case U.Month:case U.Year:f=[s,o,l];break}return f}function Cy(t){return t!==void 0&&(!("url"in t)||!t.url)}function gt(t){return t!==void 0&&"view"in t&&"layer"in t&&"queryFeatures"in t&&"queryFeatureCount"in t&&"queryObjectIds"in t}function Tc(t){return t!==void 0&&"type"in t&&t.type==="feature"}function Nc(t){return t!==void 0&&!se(t)&&"fields"in t&&"capabilities"in t&&"queryFeatures"in t&&typeof t.queryFeatures=="function"&&"queryFeatureCount"in t&&typeof t.queryFeatureCount=="function"}function Fy(t){return t!==void 0&&!se(t)&&"fields"in t&&"objectIdField"in t&&typeof t.objectIdField=="string"&&"createQuery"in t&&typeof t.createQuery=="function"&&"queryFeatures"in t&&typeof t.queryFeatures=="function"}function ho(t){return t!==void 0&&"type"in t&&t.type==="subtype-sublayer"}function Oc(t){return Nc(t)||ho(t)}function qe(t){return ho(t)?t.parent??void 0:t}function yo(t){return t?.capabilities?.query?.supportsDistance||qe(t)?.sourceJSON?.advancedQueryCapabilities?.supportsQueryWithDistance===!0}function Bc(t){return t?.capabilities?.queryAttributeBins?.supportsFixedInterval===!0&&t?.capabilities?.queryAttributeBins?.supportsStackBy}function xy(t){let{chartConfig:e,queryObject:r,options:i}=t,n=j(e?.series),a=de(e?.series[0]?.query?.where);return!(n===p.HeatSeries||e&&it({xAxisValueFormatType:We(e),setTimeBinningInfoWhenNotProvided:i?.setTimeBinningInfoWhenNotProvided,seriesConfig:e.series[0],queryObject:r})&&er(a,r))}function er(t,e){return e!==void 0&&(gt(e)||!se(e)&&"capabilities"in e&&e.capabilities?.queryAttributeBins?.supportsDate===!0&&(le(t)||(e.capabilities.queryAttributeBins.supportsStackBy??!1)))}function Ic(t){let e=!1,r=qe(J(t))?.sourceJSON;if(r){let i=r.queryBinsCapabilities?.supportsFixedIntervalBin,n=r.queryBinsCapabilities?.supportedStatisticTypes,a=[L.Maximum,L.Count].every(s=>n?.includes(s.toUpperCase())||n?.includes(s.toLowerCase()));e=i&&a}return e}function wy(t){let e;return gt(t)?e=t.layer:e=t,e}function J(t){let e;return gt(t)?e=t.layer:e=t,e}function Ac(t){let e=!1,r=qe(t)?.sourceJSON?.advancedQueryCapabilities?.supportedSpatialAggregationStatistics??[],i=t?.capabilities?.query.supportedSpatialAggregationStatistics??{};return e=r.includes("EnvelopeAggregate")||"envelope"in i&&i.envelope===!0,e}function Ty(t){let{chartConfig:e,queryObject:r}=t,i;if(r){let n=J(r);ot(n)?i={id:n.id,layerType:"ArcGISImageServiceLayer"}:Li(n)?i={id:n.id,layerType:"ArcGISTiledImageServiceLayer"}:i={id:n.id,layerType:"ArcGISFeatureLayer"},n.url&&(i.url=n.url)}return{...e,iLayer:i}}var It=new Map;function Mc(t){let e;switch(t){case"feet":e="esriSRUnit_Foot";break;case"miles":e="esriSRUnit_StatuteMile";break;case"nautical-miles":e="esriSRUnit_NauticalMile";break;case"us-nautical-miles":e="esriSRUnit_USNauticalMile";break;case"meters":e="esriSRUnit_Meter";break;case"kilometers":e="esriSRUnit_Kilometer";break}return e}async function Ec(t){let{queryObject:e,queryConfig:r,outputFormat:i,dataFormat:n,outAnalytics:a,errorStrings:s,abortSignal:o}=t,{where:l,geometry:u,distance:c,units:d,timeExtent:f}=r,m,g=J(e),h=qe(g);if(h){let y={where:te([l,h.definitionExpression])},b={query:y,signal:o},x=qt(u)?.extent?.toJSON();if(x!==void 0){let C=Mc(d),{xmin:v,ymin:T,xmax:O,ymax:I}=x;y.geometryType="esriGeometryEnvelope",y.geometry=`${v},${T},${O},${I}`,c!==void 0&&(y.distance=c.toString()),C!==void 0&&(y.units=C,u?.spatialReference?.wkid!=null&&(y.inSR=u.spatialReference.wkid.toString()))}f&&(y.time=`${f[0]},${f[1]}`);let w=`${h.url}/${h.layerId}/queryAnalytic?f=${i}&dataFormat=${n}&outAnalytics=${a}`;try{m=(await si(w,b)).data?.features?.[0]?.attributes}catch(C){let v=s??(await bt(at(document.documentElement).t9nLocale,kt("./assets/common/t9n"),"messages.")).errorStrings;throw new ge(pe.QueryFeaturesError,v.errors.queryError,C)}}return m}function po(t,e){return{lowerBoundaryAlias:`charts_lower_boundary_${t}`,upperBoundaryAlias:`charts_upper_boundary_${t}`,stackAlias:`charts_stack_alias_${e}`}}async function Lc(t){let{chartConfig:e,queryObject:r,queryConfig:i,view:n,syncViewTimeZone:a,returnStatisticsAggregatedIds:s,errorStrings:o,abortSignal:l}=t,u,c=J(r),d=Bc(c);if(d&&r&&"queryAttributeBins"in r&&r.queryAttributeBins){let{x:f,y:m,xTemporalBinning:g,yTemporalBinning:h}=e.series[0],{outTimeZone:y,firstDayOfWeek:b,includeLeapDay:x}=e,w=Gc({queryObject:r,queryConfig:i,x:f,y:m,xTemporalBinning:g,yTemporalBinning:h,configTimeZone:y,firstDayOfWeek:b,includeLeapDay:x,view:n,syncViewTimeZone:a,returnStatisticsAggregatedIds:s});try{u=await r.queryAttributeBins(w,{signal:l})}catch(C){throw new ge(pe.QueryFeaturesError,o.errors.queryError,C)}}if(!d)throw new ge(pe.QueryFeaturesError,o.errors.queryBinsNotSupported,o.errors.queryBinsNotSupported);return u}async function qc(t){let{chartConfig:e,queryObject:r,queryConfig:i,returnFeaturesExtent:n,returnStatisticsAggregatedIds:a,errorStrings:s,abortKey:o,abortSignal:l}=t,u=e.series[0],c,{x:d,y:f}=u;i.groupByFieldsForStatistics=[d],d!==f&&i.groupByFieldsForStatistics.push(f),i&&n===!0&&!i.outStatistics?.some(m=>m.statisticType===L.EnvelopeAggregate)&&i.outStatistics?.push({statisticType:L.EnvelopeAggregate,onStatisticField:"1"});try{c=await De({queryObject:r,queryConfig:i,errorStrings:s,returnStatisticsAggregatedIds:a,abortKey:o,abortSignal:l})}catch(m){throw new ge(pe.QueryFeaturesError,s.errors.queryError,m)}return c}async function Dc(t){let{queryObject:e,queryConfig:r,xStep:i,xMin:n,xMax:a,x:s,y:o,yStep:l,returnStatisticsAggregatedIds:u,errorStrings:c,abortSignal:d}=t,f;if(e&&"queryAttributeBins"in e&&e.queryAttributeBins&&Number.isFinite(i)&&Number.isFinite(l)&&Number.isFinite(n)&&Number.isFinite(a)&&i>0&&l>0){let m=Yc({queryObject:e,queryConfig:r,xStep:i,xMin:n,xMax:a,x:s,y:o,yStep:l,returnStatisticsAggregatedIds:u});try{f=await e.queryAttributeBins(m,{signal:d})}catch(g){throw new ge(pe.QueryFeaturesError,c.errors.queryError,g)}}return f}async function Pc(t){let{queryConfig:e,x:r,queryObject:i,chartSubType:n,isGaugeByFeature:a,abortSignal:s}=t,o,l=J(i),{idField:u,isTraditionalTypeOID:c}=He(l),d=In({queryObject:i,queryConfig:e,returnStatisticsAggregatedIds:!1});d.outFields=a||n===S.PieNoAggregation||n===S.BarAndLineNoAggregation||n===S.BarAndLineSplitByNoAggregation?[c?u:"*"]:[r],d.outFields?.[0]===r&&(d.returnDistinctValues=!0);try{o=await i.queryFeatureCount(d,{signal:s})}catch{o=Number.NaN}return o}async function wr(t){let{queryObject:e,queryConfig:r,abortKey:i,errorStrings:n,abortSignal:a}=t,{outStatistics:s}=r,o=new Map;if(s!==void 0&&s.length>0){let l=s.map(f=>{let{statisticType:m,onStatisticField:g,outStatisticFieldName:h}=f;return{statisticType:m,onStatisticField:g,outStatisticFieldName:h?.toUpperCase()}});r.outStatistics=l,delete r.num,delete r.orderByFields;let u=In({queryObject:e,queryConfig:r,returnStatisticsAggregatedIds:!1}),c;try{c=await e.queryFeatures(u,{signal:a??(i!==void 0?It.get(i)?.signal:void 0)})}catch(f){if(!yi.isAbortError(f)){let m=n??(await bt(at(document.documentElement).t9nLocale,kt("./assets/common/t9n"),"messages.")).errorStrings;throw new ge(pe.QueryFeaturesError,m.errors.queryError,f)}}let d=c?.features?.[0]?.attributes;d!==void 0&&s.forEach(f=>{let{outStatisticFieldName:m}=f;if(m!==void 0){let g=d[m.toLowerCase()]??d[m.toUpperCase()]??d[m];g!==void 0&&o.set(m,g)}})}return o}async function So(t){let{queryObject:e,queryConfig:r,returnUniqueIdsOnly:i,returnStatisticsAggregatedIds:n,abortKey:a,errorStrings:s,abortSignal:o}=t,l=[],u=J(e),c=o||(a!==void 0?It.get(a)?.signal:void 0),d=i===!0?void 0:Qc(u),f=In({queryObject:e,queryConfig:r,maxRecordCountFactor:d,returnStatisticsAggregatedIds:n});try{i===!0?l=await e.queryObjectIds(f,{signal:c}):l=(await e.queryFeatures(f,{signal:c})).features}catch(m){if(!yi.isAbortError(m)){let g=s??(await bt(at(document.documentElement).t9nLocale,kt("./assets/common/t9n"),"messages.")).errorStrings;throw new ge(pe.QueryFeaturesError,g.errors.queryError,m)}}return l}async function kc(t){let e=[],{featureCount:r,maxRecords:i,queryConfig:n,abortSignal:a}=t,s=[],o=0,l=n?.start??0;for(;o<W.maxParallelRequests&&l<r;){let u={...t};u.queryConfig={...n,start:l,num:Math.min(i,r-l)},e.push(So({...u,abortSignal:a})),l+=i,o+=1}return s=(await Promise.all(e)).flat(),s}async function De(t){let{queryObject:e,queryConfig:r,returnUniqueIdsOnly:i,featureCount:n,noBatch:a,returnStatisticsAggregatedIds:s,errorStrings:o,abortKey:l,abortSignal:u}=t,c=[],d=J(e),f=n??1,m=vo(d);if(a!==!0&&f>m&&d?.capabilities?.query.supportsPagination){let g=0,h=0,y=Math.ceil(f/m),b=Math.ceil(y/W.maxParallelRequests),x=[];for(;h<b;){g=h*W.maxParallelRequests*m;let w=kc({queryConfig:{...r,start:g},queryObject:e,maxRecords:m,featureCount:f,returnUniqueIdsOnly:i,returnStatisticsAggregatedIds:s,errorStrings:o,abortKey:l,abortSignal:u});x.push(w),h+=1}c=(await Promise.all(x)).flat()}else(Number.isNaN(f)||f>=0)&&(c=await So({queryObject:e,queryConfig:r,returnUniqueIdsOnly:i,returnStatisticsAggregatedIds:s,errorStrings:o,abortKey:l,abortSignal:u}));return c}async function Vc(t){let{queryObject:e,queryConfig:r,uniqueFeature:i,errorStrings:n,abortKey:a}=t,s={...r,returnDistinctValues:!0};return await De({queryObject:e,abortKey:a,queryConfig:s,returnUniqueIdsOnly:!0,returnStatisticsAggregatedIds:!1,featureCount:i===!0?1:void 0,errorStrings:n})}function $c(t){if(t!==void 0){let e=It.get(t);e!==void 0&&e.abort(),It.set(t,new AbortController)}}function bo(t){return{lowerBoundaryAlias:`charts_lower_boundary_${t}`,upperBoundaryAlias:`charts_upper_boundary_${t}`}}async function Rc(t){let{queryObject:e,dateField:r,splitByField:i,queryConfig:n,temporalBinning:a,axisTimeZone:s,errorStrings:o,view:l,syncViewTimeZone:u,returnStatisticsAggregatedIds:c,abortSignal:d}=t,f=[],m;if(a){let{unit:g}=a;try{if(g&&(m=er(i,e),m&&e&&"queryAttributeBins"in e&&e.queryAttributeBins)){let h=Uc({queryObject:e,queryConfig:n,temporalBinning:a,dateField:r,axisTimeZone:s,splitByField:i,view:l,syncViewTimeZone:u,returnStatisticsAggregatedIds:c});f=(await e.queryAttributeBins(h,{signal:d})).features}}catch(h){let y=o??(await bt(at(document.documentElement).t9nLocale,kt("./assets/common/t9n"),"messages.")).errorStrings;throw new ge(pe.QueryFeaturesError,y.errors.queryError,h)}}if(m===!1){let g=o??(await bt(at(document.documentElement).t9nLocale,kt("./assets/common/t9n"),"messages.")).errorStrings;throw new ge(pe.QueryFeaturesError,g.errors.queryBinsNotSupported,g.errors.queryBinsNotSupported)}return f}function Wc(t){let e=!t.geometry||t.geometry.type==="extent",r=(t.where??"").toUpperCase(),i=!r.includes("CURRENT_TIMESTAMP")&&!r.includes("CURRENT_DATE")&&!r.includes("CURRENT_TIME");return e&&i}function vo(t){let e=W.maxRecords;if(t&&"sourceJSON"in t&&t.sourceJSON?.maxRecordCount){let{sourceJSON:r}=t;e=r.maxRecordCount,r.advancedQueryCapabilities?.supportsMaxRecordCountFactor===!0&&(e*=W.maxRecordCountFactor)}return e}function te(t,e){let r,i=Array.from(new Set(t)).filter(n=>n&&!tt(n));return i.sort((n,a)=>a.length-n.length),i.length===1?[r]=i:i?.forEach(n=>{n!==void 0&&(le(r)?r=`(${n})`:r?.includes(`(${n})`)||(r=`${r} ${e??"AND"} (${n})`))}),r??"1=1"}function jc(t,e){let r=e;return t?.start!=null&&t?.end!=null&&(r=[t.start.valueOf(),t.end.valueOf()]),r}function Zc(t){let{queryObject:e,defaultGeometry:r,ignoreViewExtent:i}=t,n=r;if(!i&&gt(e)){let a=e.view.extent,{xmin:s,xmax:o,ymin:l,ymax:u,zmin:c,zmax:d}=a;n={xmin:s,ymin:l,zmin:c,xmax:o,ymax:u,zmax:d,spatialReference:a.spatialReference.toJSON()}}return n}function qt(t){let e;return t!==void 0&&(e=On.fromJSON(t)),e}function _c(t){return t===void 0?["*"]:Array.from(new Set(t))}function pi(t){let{queryType:e,queryObject:r,queryConfig:i,view:n,configTimeZone:a,dateField:s,useViewTimeZone:o,returnStatisticsAggregatedIds:l}=t,{where:u,outStatistics:c,geometry:d,distance:f,units:m,timeExtent:g,returnDistinctValues:h}=i??{},y=J(r),b=qe(y)?.createQuery()??new ks,x,w=vi(y).idFields;if(e==="AttributeBinsQuery"&&i?.objectIds?.[0]!==void 0&&w&&(x=`${w} IN (${i.objectIds.join(",")})`),e==="AttributeBinsQuery"&&(b=new uc(b.toJSON()),je(r).find(v=>v.name===s)?.type!==K.DateOnly)){let v=Intl.DateTimeFormat().resolvedOptions().timeZone,T=o&&n&&"timeZone"in n?n.timeZone:void 0,O=a??T??v;O==="unknown"?O="Etc/UTC":O==="system"&&(O=v),b.outTimeZone=O}if(b.where=te([b.where,u,x]),"returnDistinctValues"in b&&(b.returnDistinctValues=h??!1),c!==void 0){let v=Ac(y);b.outStatistics=c.filter(T=>T.statisticType!==L.EnvelopeAggregate||v).map(T=>cc.fromJSON(T))}let C=qt(d);return C!==void 0&&(b.geometry=C,i?.spatialRelationship&&(b.spatialRelationship=i.spatialRelationship),yo(y)&&(f!==void 0&&(b.distance=f),m!==void 0&&(b.units=m))),g&&(b.timeExtent=new dc({start:g?.[0],end:g?.[1]})),Wc(b)&&(b.cacheHint=!0),l&&(b instanceof ks?b.returnStatisticsAggregatedIds=!0:b.returnAggregateIds=!0),b}function zc(t){let e;switch(t){case oe.Start:e="first";break;case oe.End:e="last";break}return e}function Uc(t){let{queryObject:e,queryConfig:r,temporalBinning:i,dateField:n,splitByField:a,axisTimeZone:s,view:o,syncViewTimeZone:l,returnStatisticsAggregatedIds:u}=t,{unit:c,size:d,timeAggregationType:f,start:m,end:g,offset:h,outTimeZone:y}=i,b=J(e),x=pi({queryType:"AttributeBinsQuery",queryObject:e,queryConfig:r,configTimeZone:y??s,view:o,dateField:n,useViewTimeZone:l??!1,returnStatisticsAggregatedIds:u}),w=bo(n);if(x.lowerBoundaryAlias=w.lowerBoundaryAlias,x.upperBoundaryAlias=w.upperBoundaryAlias,x.binParameters={type:"date",field:n,interval:{unit:c,value:d},start:m,end:g,offset:h?{unit:h.unit,value:h.size}:null},x.binParameters.type==="date"&&(b?.capabilities?.queryAttributeBins?.supportsSnapToData&&(x.binParameters.snapToData=zc(f)),b?.capabilities?.queryAttributeBins?.supportsReturnFullIntervalBin&&(x.binParameters.returnFullIntervalBin=!0)),!le(a)){let C=qe(b)?.fields.find(v=>v.name===a)?.type;(!C||C==="string"||C==="integer"||C==="small-integer"||C==="big-integer"||C==="double")&&(x.binParameters.stackBy={type:"field",value:a,valueType:C==="string"?"string":"integer"})}return x}function Bn(t){let{field:e,fieldType:r,unit:i,outTimeZone:n,dataTimeZone:a,runsOnClientQueryEngine:s,addIntervalStatement:o,addLeapDayExpression:l}=t,u,c,d=1,f=1;switch(i){case xe.MinuteOfDay:r!==K.DateOnly&&(c="MINUTE",d=0,f=59);break;case xe.HourOfDay:r!==K.DateOnly&&(c="HOUR",d=0,f=23);break;case xe.DayOfWeek:c="DOW",f=7;break;case xe.DayOfMonth:c="DAY",f=31;break;case xe.DayOfYear:c="DOY",f=366;break;case xe.WeekOfYear:c="WEEK",f=53;break;case xe.MonthOfYear:c="MONTH",f=12;break;case xe.QuarterOfYear:c="QUARTER",f=4;break}if(c){let m=o?` ${go({dataTimeZone:a,runsOnClientQueryEngine:s,outTimeZone:n})}`:"";u=Hc({addLeapDayExpression:l,temporalKey:c,field:e,intervalStatement:m})}return{expression:u,start:d,end:f}}function Hc(t){let{addLeapDayExpression:e=!1,temporalKey:r,field:i,intervalStatement:n}=t,a;return e&&i.length&&r==="DAY"?a=`CASE WHEN (EXTRACT(MONTH FROM ${i})=2 AND EXTRACT(DAY FROM ${i})=29) THEN 0 ELSE EXTRACT (${r} FROM ${i}${n}) END`:a=`EXTRACT (${r} FROM ${i}${n})`,a}function Vs(t){let{temporalBinning:e,xOrY:r,xOrYFieldType:i,addIntervalStatement:n,outTimeZone:a,dataTimeZone:s,runsOnClientQueryEngine:o,includeLeapDay:l}=t,{unit:u}=e??{},c,d,f,m;return i===K.Date||i===K.DateOnly||i===K.TimestampOffset?{expression:d,start:f,end:m}=Bn({field:r,fieldType:i,unit:u,addIntervalStatement:n,outTimeZone:a,dataTimeZone:s,runsOnClientQueryEngine:o,addLeapDayExpression:!l}):c=r,{field:c,expression:d,start:f,end:m}}function Gc(t){let{queryObject:e,queryConfig:r,x:i,y:n,xTemporalBinning:a,yTemporalBinning:s,firstDayOfWeek:o,includeLeapDay:l,configTimeZone:u,view:c,syncViewTimeZone:d,returnStatisticsAggregatedIds:f}=t,m=je(e),g=m.find(O=>O.name===i)?.type,h=m.find(O=>O.name===n)?.type,y=pi({queryType:"AttributeBinsQuery",queryObject:e,queryConfig:r,configTimeZone:u,view:c,dateField:i,useViewTimeZone:d??!1,returnStatisticsAggregatedIds:f});y.binParameters={type:"fixed-interval",interval:1},y.lowerBoundaryAlias=W.heatChartLowerBoundaryAlias,y.upperBoundaryAlias=W.heatChartUpperBoundaryAlias,o!==void 0&&(y.binParameters.firstDayOfWeek=o);let b=Vs({temporalBinning:a,xOrY:i,xOrYFieldType:g,addIntervalStatement:!1,includeLeapDay:l}),{field:x,expression:w,start:C,end:v}=b;x?y.binParameters.field=x:w&&(y.binParameters.expression=w,y.binParameters.expressionValueType="integer",y.binParameters.type==="fixed-interval"&&(C!==void 0&&(y.binParameters.start=C),v!==void 0&&(y.binParameters.end=v)));let T=Vs({temporalBinning:s,xOrY:n,xOrYFieldType:h,addIntervalStatement:!1,includeLeapDay:l});return T.field?y.binParameters.stackBy={type:"field",value:T.field}:T.expression&&(y.binParameters.stackBy={type:"expression",value:T.expression,valueType:"integer",alias:n}),y}function Yc(t){let{queryObject:e,queryConfig:r,xStep:i,xMin:n,xMax:a,x:s,y:o,yStep:l,returnStatisticsAggregatedIds:u}=t,c=pi({queryType:"AttributeBinsQuery",queryObject:e,queryConfig:r,useViewTimeZone:!1,returnStatisticsAggregatedIds:u}),d=po(s,o);return c.lowerBoundaryAlias=d.lowerBoundaryAlias,c.upperBoundaryAlias=d.upperBoundaryAlias,c.binParameters={type:"fixed-interval",field:s,interval:i,start:n,end:a,stackBy:{value:`FLOOR(${o} / ${l})`,type:"expression",alias:d.stackAlias,valueType:"integer"}},c}function In(t){let{queryObject:e,queryConfig:r,maxRecordCountFactor:i,returnStatisticsAggregatedIds:n}=t,{groupByFieldsForStatistics:a,orderByFields:s,gdbVersion:o,start:l,num:u,outFields:c}=r??{},d=pi({queryType:"Query",queryObject:e,queryConfig:r,useViewTimeZone:!1,returnStatisticsAggregatedIds:n});d.returnGeometry=!1;let f=J(e);return d.outFields=_c(c),d.groupByFieldsForStatistics=a??d.groupByFieldsForStatistics,d.orderByFields=s??[],d.objectIds=r?.objectIds,i!==void 0&&(d.maxRecordCountFactor=i),o!==void 0&&o!==""&&(d.gdbVersion=o),u!==void 0&&(d.num=u),l!==void 0&&(d.start=l,d.num=d.num??vo(f)),d}function Qc(t){return t&&"sourceJSON"in t&&t.sourceJSON?.advancedQueryCapabilities?.supportsMaxRecordCountFactor===!0?W.maxRecordCountFactor:void 0}var Ny={NonNumericAggregation:"nonNumericAggregation",DuplicateSeriesID:"duplicateSeriesId"},Oy={Required:"required",MinLength:"minLength",MinItems:"minItems",MaxItems:"maxItems",Pattern:"pattern",AdditionalProperties:"additionalProperties",Enum:"enum",AnyOf:"anyOf"},z={BadData:"badData",EmptyDataSet:"emptyDataSet",NoValue:"noValue",InvalidConfig:"invalidConfig",HistogramEmptyField:"histogramEmptyField",BarElementExceedsLimit:"barElementExceedsLimit",LineChartExceedsLimit:"lineChartExceedsLimit",BoxPlotExceedsLimit:"boxPlotExceedsLimit",BoxPlotOutliersExceedsLimit:"boxPlotOutliersExceedsLimit",HeatChartExceedsLimit:"heatChartExceedsLimit",PieChartExceedsLimit:"pieChartExceedsLimit",GaugeExceedsLimit:"gaugeExceedsLimit",RadarChartExceedsLimit:"radarChartExceedsLimit",PieChartMixOfNegativePositiveSlices:"PieChartMixOfNegativePositiveSlices",NegativeValueInSqrtCalculation:"negativeValueInSqrtCalculation",NegativeValueInLogCalculation:"negativeValueInLogCalculation",NegativeValueInXAxisLogScale:"negativeValueInXAxisLogScale",NegativeValueInYAxisLogScale:"negativeValueInYAxisLogScale"},Jc=2048;function Kc(t){let e;switch(t){case ae.Log:e="log";break;case ae.Sqrt:e="sqrt";break;case ae.None:default:e=void 0;break}return e}async function Xc(t){let{chartConfig:e,queryConfig:r,queryObject:i,filterByViewExtent:n,view:a,abortKey:s,abortSignal:o}=t,l=o??(s!==void 0?It.get(s)?.signal:void 0),u=e.series[0],{x:c,dataTransformationType:d,binCount:f}=u,m=J(i);if(!se(m))throw new ge(pe.LayerNotSupported);let g=await Nr(m,l);if(!g)throw new Error("Raster info is not available for the layer.");let h=qt(r.geometry),y=mi(m,c);if(y<0)throw new Error("Band ID not found for `${x}`.");let b,x;if(!n&&(d===void 0||d===ae.None)&&!(ot(m)&&Cr(m))&&f&&Array.isArray(g.histograms)&&g.histograms.length>y&&g.histograms[y].size%f===0&&Array.isArray(g.statistics)&&g?.statistics?.length>y)b=g.histograms[y],x=g.statistics[y];else{let w,C,v;if(n&&a)w=a.resolution,C=a.resolution,v=a.spatialReference;else{let O=Jc,I=2,B=g.width,N=g.height;if(!n&&!h&&ot(m)&&Cr(m))try{let E=m.createQuery(),{extent:M}=await m.queryExtent(E,{signal:l});M&&(B=M.width,N=M.height,h=M)}catch{}let A=Math.max(0,Math.ceil(Math.log(Math.max(B,N)/O)/Math.log(I))),D=I**A;w=g.pixelSize.x*D,C=g.pixelSize.y*D,v=m.spatialReference}let T=new uo({x:w,y:C,spatialReference:v});try{let O=Kc(d),I=await sc(m,{bandIds:[y],geometry:h??g.extent,histogramSize:f??void 0,pixelSize:T,transformType:O,downsampleOnly:!0},{signal:l});x=I.statistics[0],b=I.histograms[0]}catch(O){if(!yi.isAbortError(O))throw new ge(pe.Default,"Failed to compute raster histogram.",O)}}return{histogram:b,statistics:x}}function ed(t,e){let r=[],i=(t.max-t.min)/t.size;for(let n=0;n<t.size;n++){let a=t.min+n*i;r.push({type:p.HistogramBin,minValue:a,maxValue:a+i,count:t.counts[n]})}if(e&&t.size!==e&&t.size%e===0){let n=t.size/e,a=[];for(let s=0;s<e;s++){let o=r[s*n].minValue,l=r[(s+1)*n-1].maxValue,u=0;for(let c=0;c<n;c++)u+=r[s*n+c].count;a.push({type:p.HistogramBin,minValue:o,maxValue:l,count:u})}return a}return r}async function td(t){let{chartConfig:e,queryConfig:r,queryObject:i,filterByViewExtent:n,abortKey:a,abortSignal:s,view:o}=t;if(i===void 0)throw new Error("QueryObject is undefined!");let l,{statistics:u,histogram:c}=await Xc({queryObject:i,chartConfig:e,queryConfig:r,filterByViewExtent:n,view:o,abortKey:a,abortSignal:s});if(u&&c){let d=e.series[0].binCount??void 0,f=ed(c,d);f.length>0?l={valid:!0,count:f.length,data:{bins:f,min:u.min,max:u.max,mean:u.avg,median:u.median,stddev:u.stddev,sum:u.sum??u.avg*u.count,count:u.count}}:l={valid:!1,invalidType:z.EmptyDataSet}}else l={valid:!1,invalidType:z.NoValue};return l}var rd=t=>t.series[0].x;function id(t){let{chartConfig:e,layer:r,selectionItems:i}=t,n=mi(r,rd(e)),a=i.map(l=>[l.minValue,l.maxValue]).reduce((l,u,c)=>{if(c===0)l.push([...u]);else{let d=l[l.length-1];d[1]===u[0]?d[1]=u[1]:l.push([...u])}return l},[]),s=e.series[0],{dataTransformationType:o}=s;switch(o){case ae.Log:a.forEach(l=>{l[0]=Math.exp(l[0]),l[1]=Math.exp(l[1])});break;case ae.Sqrt:a.forEach(l=>{l[0]=l[0]*l[0],l[1]=l[1]*l[1]});break;case ae.None:}return a.length>0?{bandId:n,pixelRanges:a}:void 0}function Sr(t,e){let r,i,n=e??(a=>a);for(let a of t){let s=n(a);s==null||Number.isNaN(s)||((r===void 0||s<r)&&(r=s),(i===void 0||s>i)&&(i=s))}return{min:r,max:i}}function nd(t,e){let r=0,i=0,n=e??(a=>a);for(let a of t){let s=n(a);s==null||Number.isNaN(s)||(r++,i+=s)}return r>0?i/r:void 0}function ad(t,e){let r=0,i=e??(n=>n);for(let n of t){let a=i(n);a==null||Number.isNaN(a)||(r+=a)}return r}function By(t,e,r=1){let i=Math.max(0,Math.ceil((e-t)/r)),n=new Array(i);for(let a=0;a<i;a++)n[a]=t+a*r;return n}var sd={dataFormat:"json",outputFormat:"json",typeKey:"analyticType",typeValue:"LinRegR2",fieldValue:"onAnalyticField",slopePropertyList:["Slope","SLOPE","slope"],interceptPropertyList:["Intercept","INTERCEPT","intercept"],r2PropertyList:["R2","r2"]};async function od(t){let{queryObject:e,abortSignal:r}=t,i=!1;if(!se(e)){let n=Oc(e),a=J(e),s=qe(a);if(n&&s?.url!==void 0&&s.url!==null){let o=`${s.url}/${s.layerId}?f=json`;try{let l=(await si(o,{signal:r})).data,u=l?.advancedQueryCapabilities?.supportsQueryAnalytic===!0,c=l?.sqlParserVersion===void 0||s.version!=null&&s.version>=10.91;i=u&&c}catch{}}}return i}function ld(t){let{x:e,y:r,trendlineXToY:i,data:n}=t,{min:a,max:s}=n?Sr(n,o=>o[e]):{min:Number.NaN,max:Number.NaN};return[{[e]:a??Number.NaN,[r]:i(a??Number.NaN)},{[e]:s??Number.NaN,[r]:i(s??Number.NaN)}]}function ud(t){let{data:e,x:r,y:i}=t,n=[];return e!==void 0&&(n=e.filter(a=>Number.isFinite(a[r])&&Number.isFinite(a[i])).map(a=>[a[r],a[i]])),n}async function cd(t){let{statsMap:e,queryObject:r,chartConfig:i,queryConfig:n,errorStrings:a,abortSignal:s}=t,o=i.series[0],{x:l,y:u}=o;Vt(r);let c=Number.NaN,d=[{[l]:Number.NaN,[u]:Number.NaN},{[l]:Number.NaN,[u]:Number.NaN}],{dataFormat:f,outputFormat:m,typeKey:g,typeValue:h,fieldValue:y,slopePropertyList:b,interceptPropertyList:x,r2PropertyList:w}=sd,C=`[{"${g}": "${h}", "${y}":"${l},${u}"}]`,v=await Ec({queryObject:r,queryConfig:n,outputFormat:m,dataFormat:f,outAnalytics:C,errorStrings:a,abortSignal:s});if(v!==void 0){let T=Number.NaN,O=Number.NaN,{expr:I}=$r(v,b),{expr:B}=$r(v,x),{expr:N}=$r(v,w);I!==void 0&&Number.isFinite(v[I])&&(T=v[I]),B!==void 0&&Number.isFinite(v[B])&&(O=v[B]),N!==void 0&&Number.isFinite(v[N])&&(c=v[N]);let{dataContextXMinField:A,dataContextXMaxField:D,dataContextYMinField:E,dataContextYMaxField:M}=F.scatterplotAggregationFields,V=e.get(A)??Number.NaN,$=e.get(D)??Number.NaN,G=e.get(E)??Number.NaN,k=e.get(M)??Number.NaN,Y=($-V)/100,R=V-Y,X=Number.NaN;for(;!(X>=G&&X<=k)&&R<=$;)R+=Y,X=T*R+O;let ie=$+Y,ve=Number.NaN;for(;!(ve>=G&&ve<=k)&&ie>=V;)ie-=Y,ve=T*ie+O;d=[{[l]:R,[u]:X},{[l]:ie,[u]:ve}]}return{r2:c,trendLinePoints:d}}function Co(t){let{data:e,chartConfig:r}=t,i=r.series[0],{x:n,y:a}=i,{r2:s,trendLinePoints:o}=F.scatterplotSeries,l=ud({data:e,x:n,y:a});if(l!==void 0){let u=As(l),c=Ms(u);s=u.m===0?0:Es(l,c),o=ld({x:n,y:a,trendlineXToY:c,data:e})}return{r2:s,trendLinePoints:o}}async function Fo(t){let e=await od(t),{chartConfig:r}=t,i=r.series[0],{x:n,y:a}=i,{r2:s}=F.scatterplotSeries,o=[{[n]:Number.NaN,[a]:Number.NaN},{[n]:Number.NaN,[a]:Number.NaN}],l={r2:s,trendLinePoints:o},u=!1;if(e)try{l=await cd(t)}catch{u=!0}return(!e||u)&&(l=Co(t)),l}var Fe="arcgis_charts_pie_from_fields_name",Ue="arcgis_charts_pie_from_fields_value",Iy="arcgis_charts_bar_line_from_fields_name",Ay="arcgis_charts_bar_line_from_fields_value";function dd(t){return t!==void 0&&t!==qr.Solid&&t!==qr.Null}function My(t,e){let r="",i=(e??0)/2,n=0-i,a=0+i,s=0-i,o=0+i;switch(t){case Ft.Circle:r=`M ${n},0 a ${i},${i} 0 1,0 ${i*2},0 a ${i},${i} 0 1,0 ${-i*2},0`;break;case Ft.Cross:r=`M ${n},0 L ${a},0 M 0,${s} L 0,${o} E`;break;case Ft.Diamond:r=`M ${n},0 L 0,${s} L ${a},0 L 0,${o} L ${n},0 Z`;break;case Ft.Square:r=`M ${n},${o} L ${n},${s} L ${a},${s} L ${a},${o} L ${n},${o} Z`;break;case Ft.Triangle:r=`M ${n},${o} L 0,${s} L ${a},${o} L ${n},${o} Z`;break;case Ft.X:r=`M ${n},${o} L ${a},${s} M ${n},${s} L ${a},${o} E`;break}return r}function Ey(t,e=0){return(t??e)%360}function xo(t){let{stringToTruncate:e,characterLimit:r,ellipsis:i=F.chartEllipsis}=t,n=e;return typeof r=="number"&&Number.isFinite(r)&&r>0&&r<e.length&&(n=e.slice(0,r),n=`${n}${i}`),n}function Ly(t){let{input:e,charsPerLine:r}=t,i=e;if(r>0&&e.length>r){let n=e.lastIndexOf(" ",r),a=e.lastIndexOf("-",r),s=Math.max(n,a),o=s===a&&a>0,l=s>0?s+(o?1:0):r,u=Math.min(r,l),c=e.slice(0,u).trimEnd(),d=e.slice(u).trimStart();d.length>r&&(d=xo({stringToTruncate:d,characterLimit:Math.max(1,r-1)})),i=`${c}
3
3
  ${d}`}return i}function qy(t,e=":"){return t?`\u200F${e}`:`\u200E${e}`}function Dy(t){return e=>{let r=typeof e!="string"?e?.toString()??"":e;return!le(r)&&r!==F.htmlEmptyContent&&(r=xo({stringToTruncate:r,characterLimit:t})),r}}function Py(t){let e=/[[]/gu,r=/[\]]/gu,i=/[{]/gu,n=/[}]/gu,a=/[']/gu;return t=t.replace(e,"[["),t=t.replace(r,"]]"),t=t.replace(i,"{{"),t=t.replace(n,"}}"),t=t.replace(a,"''"),t}function fd(t){return t?t.replace(/[A-Z]/gu,e=>`-${e.toLowerCase()}`):void 0}function At(t){return j(t?.series)===p.HeatSeries}function be(t){return j(t?.series)===p.BoxPlotSeries}function ky(t){return t!==void 0&&j(t.series)===p.GaugeSeries}function Si(t){return"subType"in t&&t.subType===wi.FeatureGauge}function md(t,e){return t[0].dataTransformationType!==e[0].dataTransformationType}function gd(t,e){return t[0].binCount!==e[0].binCount}function Vy(t,e){let r=!0,i=j(t?.series),n=j(e?.series);return i&&i!==n&&(r=i===p.ComboLineAndBarSeries&&(n===p.BarSeries||n===p.LineSeries)||n===p.ComboLineAndBarSeries&&(i===p.BarSeries||i===p.LineSeries)||i===p.BarSeries&&n===p.LineSeries||i===p.LineSeries&&n===p.BarSeries),r}function bn(t,e){return t!==void 0&&e!==void 0&&e>0}function $y(t){let{chartConfig:e,queryObject:r,chartData:i}=t,n=[],a=H(e.series),s=Ii(e),o=J(r),l=e.chartRenderer??o?.renderer?.toJSON();return n=e.series.map((u,c)=>{let d=j([u]),f;return(d===p.BarSeries||d===p.LineSeries||d===p.RadarSeries)&&(u.type===p.BarSeries?f=u.fillSymbol?.color:(u.type===p.RadarSeries||u.type===p.LineSeries)&&(f=u.lineSymbol?.color),s?f=ag({dataItem:i[0],seriesConfig:u,chartSubType:a,colorMatch:s,rendererType:l?.type})?.color:f===void 0&&(f=Bi({colorIndex:c}))),f}).filter(u=>u!==void 0),n}function vn(t){return t!==S.PieNoAggregation&&t!==S.BarAndLineNoAggregation&&t!==S.BarAndLineSplitByNoAggregation}function hd(t){let e=H(t.series);return e===S.BarAndLineFromFields||e===S.PieFromFields||e===S.BoxPlotC1MonoField||e===S.BoxPlotC2MultiFields||e===S.BoxPlotC5MonoFieldAndSplitBy||e===S.BoxPlotC6MultiFieldsAndSplitBy}function Mt(t){return be(t)?t?.showMean??!1:!1}function yd(t){return be(t)?t?.showOutliers:void 0}function wo(t){return t?.series?.[0]&&"temporalBinning"in t?.series?.[0]?t?.series[0].temporalBinning?.timeAggregationType:void 0}function Ry(){return`{name} {${F.originalXValue}} {dateY} {valueX} {dateX} {valueY}`}function Wy(){return"{category} {value} {valuePercentTotal.formatNumber('#.#')}%"}var jy=[p.BarSeries,p.BoxPlotSeries,p.LineSeries,p.PieSeries,p.HistogramSeries,p.ScatterSeries],Zy={PNG:"png"},Kt={ChartRenderer:1,LayerRenderer:2},To=[S.BarAndLineMonoField,S.BarAndLineMultiFields,S.PieNoAggregation,S.PieFromCategory,S.BoxPlotC3MonoFieldAndCategory,S.BoxPlotC4MultiFieldsAndCategory,S.BoxPlotC7MonoFieldAndCategoryAndSplitBy,S.BarAndLineNoAggregation,S.BarAndLineSplitByNoAggregation],$s=1e4,Tr=1e4;function pd(t=ae.None,e){return t===ae.None||t===ae.Log&&e>0||t===ae.Sqrt&&e>=0}function No(t,e){let r={valid:!1};return e===!0?r.invalidType=z.HistogramEmptyField:t===ae.Log?r.invalidType=z.NegativeValueInLogCalculation:t===ae.Sqrt&&(r.invalidType=z.NegativeValueInSqrtCalculation),r}function Sd(t,e){let r=t;switch(e){case ae.Log:r=Math.log(t);break;case ae.Sqrt:r=Math.sqrt(t);break}return r}function bd(t){let e=t;if(t){let r=t.toString().split(".");if(r[1]!==void 0){let i=10**-r[1].length;e=t-i}}return e}function Oo(t){let e="field";switch(t){case ae.Log:e="natural-log";break;case ae.Sqrt:e="square-root";break;case ae.None:}return e}async function vd(t){let{queryObject:e,fieldName:r,queryConfig:i,errorStrings:n,abortKey:a,abortSignal:s}=t,o=J(e),{idField:l,isTraditionalTypeOID:u}=He(o),c=u?l:"*",d=`${L.Count}_${l}`,f=`${L.Count}_${r}`,m=`${L.Minimum}_${r}`,g=`${L.Maximum}_${r}`,h={...i,outStatistics:[{statisticType:L.Count,onStatisticField:c,outStatisticFieldName:d},{statisticType:L.Count,onStatisticField:r,outStatisticFieldName:f},{statisticType:L.Minimum,onStatisticField:r,outStatisticFieldName:m},{statisticType:L.Maximum,onStatisticField:r,outStatisticFieldName:g}]},y=await wr({queryObject:e,queryConfig:h,errorStrings:n,abortKey:a,abortSignal:s}),b=y.get(d)??Number.NaN,x=y.get(f)??Number.NaN,w=y.get(m)??Number.NaN,C=y.get(g)??Number.NaN;return{countExcludingNulls:x,countIncludingNulls:b,min:w,max:C}}async function Cd(t){let{queryConfig:e,chartConfig:r,queryObject:i,errorStrings:n,abortKey:a,abortSignal:s}=t,o=r.series[0],{x:l,dataTransformationType:u}=o,c=[],{countIncludingNulls:d,countExcludingNulls:f,min:m,max:g}=await vd({queryObject:i,queryConfig:e,fieldName:l,errorStrings:n,abortKey:a,abortSignal:s}),h=pd(u,m),y=f<2||m===g,b={...e};return b.where=te([b.where,`${l} is not null`]),{rawData:c,dataCompatibleWithTransformation:h,dataCountIncompatible:y,countExcludingNulls:f,countIncludingNulls:d}}function Fd(t){let e={...t};return e.avg=e.avg??Number.NaN,e.count=e.count??Number.NaN,e.max=e.max??Number.NaN,e.min=e.min??Number.NaN,e.stddev=e.stddev??Number.NaN,e.sum=e.sum??Number.NaN,e.variance=e.variance??Number.NaN,e.median=e.median??Number.NaN,e}function xd(t){let{seriesConfig:e,layer:r,useFeaturesInView:i,view:n,featureFilter:a,queryConfig:s,abortSignal:o}=t,{x:l,dataTransformationType:u}=e,c={layer:r,view:n,field:l,sqlWhere:tt(s.where)?void 0:s.where,useFeaturesInView:i,signal:o};return u!==ae.None&&(c={...c,normalizationType:Oo(u)}),c.filter=a,c}function wd(t){let{seriesConfig:e,layer:r,useFeaturesInView:i,view:n,minValue:a,maxValue:s,featureFilter:o,queryConfig:l,abortSignal:u}=t,{x:c,binCount:d,dataTransformationType:f}=e,m={layer:r,view:n,field:c,minValue:a,maxValue:s,numBins:d??zn,classificationMethod:"equal-interval",sqlWhere:tt(l.where)?void 0:l.where,useFeaturesInView:i,signal:u};return f!==ae.None&&(m={...m,normalizationType:Oo(f)}),m.filter=o,"capabilities"in r&&"queryAttributeBins"in r&&r.capabilities?.queryAttributeBins?.supportsAutoInterval&&(m.returnAggregateIds=!0),m}function Td(t,e){let r=Number.NaN;return t!==void 0&&e!==void 0&&(r=t-e),r}function Nd(t){let{view:e,queryConfig:r,layer:i,ignoreViewExtent:n}=t,a,s=qt(r?.geometry)?.extent;if(!n&&e?.extent!==void 0&&(s=e?.extent),s!==void 0&&(a=new Ds({geometry:s}),e?.extent!==void 0&&yo(i))){let{distance:o,units:l}=r;o!==void 0&&(a.distance=o),l!==void 0&&(a.units=l)}if(r.timeExtent){let o={start:r.timeExtent[0],end:r.timeExtent[1]};a===void 0?a=new Ds({timeExtent:o}):a.timeExtent=o}return a}async function Od(t){let{chartConfig:e,queryConfig:r,queryObject:i,countExcludingNulls:n,countIncludingNulls:a,view:s,ignoreViewExtent:o,errorStrings:l,abortSignal:u}=t,c=e.series[0],{dataTransformationType:d}=c,f={valid:!0},m=J(i);if(!ea(m))return{valid:!1};let g=qt(r?.geometry)?.extent?.toJSON()!==void 0,h=Nd({view:s,queryConfig:r,layer:m,ignoreViewExtent:o}),y=xd({seriesConfig:c,layer:m,view:s,useFeaturesInView:g,featureFilter:h,queryConfig:r,abortSignal:u}),b;y.outStatisticTypes={exclude:["median"]};try{b=await Ps(y)}catch(B){throw new ge(pe.QueryFeaturesError,l.errors.queryError,B)}y.outStatisticTypes={include:["median"]};try{let B=await Ps(y);B?.median&&(b.median=B.median)}catch{}b=Fd(b);let{avg:x,count:w,stddev:C,min:v,max:T,sum:O,median:I}=b;if(w===0)f={...No(d)};else{let B=wd({seriesConfig:c,layer:m,view:s,useFeaturesInView:g,minValue:bd(v),maxValue:T,valueExpression:y.valueExpression,featureFilter:h,queryConfig:r,abortSignal:u}),N;try{N=await ac(B)}catch(E){throw new ge(pe.QueryFeaturesError,l.errors.queryError,E)}let A=N.bins?.map((E,M)=>{let V={...E,type:p.HistogramBin,isLastBin:M===N.bins.length-1};return"aggregateIds"in V&&(Array.isArray(V.aggregateIds)&&V.aggregateIds.length!==Tr&&(V.arcgisChartsUniqueIds=V.aggregateIds),delete V.aggregateIds),V}),D=Td(a,n);f.data={mean:x,stddev:C,min:v,max:T,median:Number(I),bins:A,count:n,nulls:D,sum:O??void 0}}return f}async function Bo(t){let{chartConfig:e,queryConfig:r,queryObject:i,abortKey:n,abortSignal:a,errorStrings:s,view:o,ignoreViewExtent:l}=t,{series:u}=e,c=u[0],d;if(se(i))d=await td(t);else{let{rawData:f,dataCompatibleWithTransformation:m,dataCountIncompatible:g,countIncludingNulls:h,countExcludingNulls:y}=await Cd({queryObject:i,chartConfig:e,queryConfig:r,errorStrings:s,abortKey:n,abortSignal:a});d={valid:!0},!m||g?d=No(c.dataTransformationType,g):d=await Od({chartConfig:e,queryObject:i,queryConfig:r,countIncludingNulls:h,countExcludingNulls:y,view:o,ignoreViewExtent:l,abortSignal:a,errorStrings:s})}return d}async function Bd(t){let{queryObject:e,queryConfig:r,chartConfig:i,x:n,errorStrings:a}=t,{series:s}=i,{dataTransformationType:o}=s[0],l={...r,orderByFields:[n],outFields:[n]};return{valid:!0,data:{dataItems:(await De({queryObject:e,queryConfig:l,returnStatisticsAggregatedIds:!1,errorStrings:a})).map(u=>({[n]:Sd(u.attributes[n],o)}))}}}var Rs={Count:"count",Start:"minValue",End:"maxValue"},Et={groupByCaseBegin:"CASE",groupByOutKeyword:"OUT",groupByCaseEnd:"ELSE 'OUT' END"};async function yn(t){let{queryObject:e,queryConfig:r,category:i,splitByField:n,chartLimits:a,errorStrings:s,abortKey:o,abortSignal:l}=t,u=n!==void 0,c=i!==ar?[i]:[];u&&c.push(n);let d=J(e),{idField:f,isTraditionalTypeOID:m}=He(d),g=m?f:"*",h={...r,groupByFieldsForStatistics:Array.from(new Set(c)),outStatistics:[{statisticType:L.Count,onStatisticField:g,outStatisticFieldName:`${L.Count}_OBJECTID`}],orderByFields:void 0,num:a?.maxBarThreePlusSeriesCountTotal??a?.serialChart?.elements},y=await De({queryObject:e,featureCount:1,queryConfig:h,returnStatisticsAggregatedIds:!1,errorStrings:s,abortKey:o,abortSignal:l});return Array.from(new Set(y.map(b=>b.attributes[u?n:i]))).sort((b,x)=>typeof b=="string"&&typeof x=="string"?b.localeCompare(x):Number(b)-Number(x))}function Id(t){let{input:e,x:r,splitByField:i}=t;return e.reduce((n,a)=>(i!==void 0&&i!==r&&!(F.technicalFieldSplitByField in a)&&delete a[i],Object.assign(n,a)),{})}function br(t){let{data:e,x:r,splitByField:i}=t,n=e;if(e!==void 0&&e.length>0){let a=new Map;for(let s of e){let o=s[r],l=a.get(o)??[];l.push(s),a.set(o,l)}a.size>0&&(n=Array.from(a.values(),s=>Id({input:s,x:r,splitByField:i})))}return n}function Ad(t,e,r){let i=0;if(Array.isArray(r)){let n=t?.toString()??"",a=e?.toString()??"",s=r.indexOf(n),o=r.indexOf(a);s===-1&&(s=r.length),o===-1&&(o=r.length),i=s-o}else r===Ce.Descending?typeof t=="string"&&typeof e=="string"?i=e.localeCompare(t,void 0,{numeric:!0}):i=(Number(e)||0)-(Number(t)||0):r===Ce.Ascending&&(typeof t=="string"&&typeof e=="string"?i=t.localeCompare(e,void 0,{numeric:!0}):i=(Number(t)||0)-(Number(e)||0));return i}function Ws(t){let{chartConfig:e,field:r,chartData:i}=t,n=vh({chartConfig:e,field:r}),a=Array.from(new Set(i.map(s=>r in s?s[r]:void 0)));return n&&a.length>1&&a.sort((s,o)=>Ad(s,o,n)),a.map(s=>({[r]:s}))}function Io(t){let{chartConfig:e,chartData:r}=t;return{xAxisData:Ws({chartConfig:e,field:_.xField,chartData:r}),yAxisData:Ws({chartConfig:e,field:_.yField,chartData:r})}}function Md(t){let e=["red","green","blue"].map(r=>Object.entries(t).find(([i])=>i.toLowerCase()===r)?.[1]);return e.every(r=>typeof r=="number")?[...e,255]:void 0}function Ed(t,e){let r=e!==void 0;if(e){for(let i of t.values())if(new Set(i.map(n=>n[e])).size!==1){r=!1;break}}return r}function Ld(t){let{layer:e,chartRenderer:r,categoryField:i,categoryValue:n}=t,a=r?xr.fromJSON(r):e.renderer,s;if(a?.type==="unique-value"&&a.field?.toLowerCase()===i.toLowerCase()){let o=a.uniqueValueInfos?.find(c=>{let d=String(c.value),f=String(n);return c.value===n||c.value!=null&&n!=null&&(d===f||!Number.isNaN(Number(d))&&!Number.isNaN(Number(f))&&Number(d)===Number(f))}),l=o?.symbol,u=l?.color?.toRgba();u&&o&&(u[3]<=1&&(u[3]*=255),s={type:l?.toJSON()?.type,color:u,label:o.label??void 0,uniqueValue:o.value!=null?String(o.value):void 0})}return s}function js(t){let{layer:e,chartRenderer:r,categoryField:i,categoryValue:n,categoryAttributes:a,hasColormap:s,canUseRasterAttributeTableColors:o}=t,l=r?xr.fromJSON(r):e.renderer,u=Ld({layer:e,chartRenderer:r,categoryField:i,categoryValue:n});if(!u&&!l&&!s&&o){let c=Md(a);c&&(u={type:"esriSFS",color:c})}return u}function qd(t,e){let r=!0;if(e?.trim()){let i={};Object.entries(t).forEach(([s,o])=>{i[s.toUpperCase()]=o});let n=e.trim(),a=n.match(/^(\w+)\s+IS\s+(NOT\s+)?NULL$/iu);if(a){let[s,o,l]=a,u=i[o.toUpperCase()],c=u==null;r=l?!c:c}else{let s=n.match(/^(\w+)\s*(=|!=|<>|>|<|>=|<=)\s*(.+)$/iu);if(s){let[o,l,u,c]=s,d=l.toUpperCase();if(!(d in i))r=!1;else{let f=i[d],m=c.trim().replace(/^['"]|['"]$/gu,"");switch(typeof f=="number"?m=Number(m):typeof f=="boolean"&&(m=m.toLowerCase()==="true"),u){case"=":r=f===m;break;case"!=":case"<>":r=f!==m;break;case">":r=f>m;break;case"<":r=f<m;break;case">=":r=f>=m;break;case"<=":r=f<=m;break;default:r=!0}}}}}return r}function Dd(t){let{features:e,aggregationType:r,onField:i}=t,n;if(!i)r==="count"&&(n=e.length);else switch(r){case"count":{i==="*"?n=e.length:n=e.filter(a=>a[i]!==null&&a[i]!==void 0).length;break}case"sum":{n=e.reduce((a,s)=>{let o=s[i];return a+(typeof o=="number"?o:0)},0);break}case"avg":{let a=0,s=0;e.forEach(o=>{let l=o[i];typeof l=="number"&&(a+=l,s++)}),n=s>0?a/s:0;break}case"min":{let a=e.map(s=>s[i]).filter(s=>typeof s=="number"&&s!==null&&s!==void 0);n=a.length>0?Math.min(...a):void 0;break}case"max":{let a=e.map(s=>s[i]).filter(s=>typeof s=="number"&&s!==null&&s!==void 0);n=a.length>0?Math.max(...a):void 0;break}case"percentile-continuous":{let a=[...e.map(o=>o[i]).filter(o=>typeof o=="number"&&o!==null&&o!==void 0)].sort((o,l)=>o-l),s=Math.floor(a.length/2);n=a.length%2!==0?a[s]:(a[s-1]+a[s])/2;break}}return n}function Zs(t,e){let r;return t==null&&e?r={groupKey:F.nullValue,display:F.nullValue,original:null}:r={groupKey:t,display:t,original:t},r}async function Pd(t){let{layer:e,geometry:r,filterByViewExtent:i,view:n,abortKey:a,abortSignal:s}=t,o=s??(a!==void 0?It.get(a)?.signal:void 0);e.loaded||await e.load({signal:o});let l=await Nr(e,s),u=qt(r),c=n?new uo({x:n.resolution,y:n.resolution,spatialReference:n.spatialReference}):void 0,d=l?.attributeTable,f=u;if(!i&&!f&&ot(e)&&Cr(e))try{let{extent:m}=await e.queryExtent(e.createQuery(),{signal:o});f=m??void 0}catch{}return(i||f)&&(d=await oc(e,{geometry:f??e.fullExtent,pixelSize:c,downsampleOnly:!0},{signal:o})),{attributeTable:d,hasColormap:l?.colormap!=null}}async function kd(t){let{chartConfig:e,queryConfig:r,queryObject:i,filterByViewExtent:n,view:a,abortKey:s,abortSignal:o}=t,l;if(i===void 0)throw new Error("QueryObject is undefined!");let u=J(i);if(!se(u))throw new ge(pe.LayerNotSupported);let{attributeTable:c,hasColormap:d}=await Pd({layer:u,geometry:r.geometry,filterByViewExtent:n,view:a,abortKey:s,abortSignal:o}),f=c?.features;if(!c||!f)l={valid:!1,invalidType:z.NoValue};else{let m=e.series;if(!m||m.length===0)l={valid:!1,invalidType:z.InvalidConfig};else if(f.length===0)l={valid:!1,invalidType:z.EmptyDataSet};else{let g=r.groupByFieldsForStatistics?.[0]??"",h=e.colorMatch===!0&&Jm({chartConfig:e,queryObject:i}),y=m.some(v=>v.query?.fetchNullValues),b=new Map;for(let v of f){let{groupKey:T}=Zs(v.attributes[g],y);T===F.nullValue&&!y||(b.has(T)||b.set(T,[]),b.get(T).push(v.attributes))}let x=c.fields.find(({name:v})=>v.toLowerCase()==="value")?.name,w=Ed(b,x),C=[];b.forEach(v=>{let T={},O=v[0][g],{display:I,original:B}=Zs(O,y);if(T[g]=I,T[F.xAxisField]=I,T[F.originalXValue]=B,h){let N=js({layer:u,chartRenderer:e.chartRenderer,categoryField:g,categoryValue:B,categoryAttributes:v[0],hasColormap:d,canUseRasterAttributeTableColors:w});N&&(T[F.rendererSymbolField]=N)}m.forEach(N=>{let A=de(N.query?.where),D=Se({where:N.query?.where,keepSurroundingQuotes:!1,escape:!1});if(h&&A&&D!==void 0&&"y"in N){let Y=A.toLowerCase()===x?.toLowerCase(),R=js({layer:u,chartRenderer:e.chartRenderer,categoryField:A,categoryValue:D,categoryAttributes:v[0],hasColormap:d,canUseRasterAttributeTableColors:Y});R&&typeof N.y=="string"&&(T[`${F.rendererSymbolField}_${N.y}`]=R)}let E=N.query?.outStatistics?.[0];if(!E){let Y="y"in N&&typeof N.y=="string"?N.y:N.name;if(typeof Y!="string")return;T[Y]=v[0][Y];return}let M=v,V=N.query?.where;V&&(M=v.filter(Y=>qd(Y,V)));let $=E.statisticType,G=E.onStatisticField,k=E.outStatisticFieldName;T[k]=Dd({features:M,aggregationType:$,onField:G})}),C.push(T)}),l={valid:!0,data:{dataItems:C}}}}return l}async function _y(t){let{layer:e,category:r,splitByField:i,fetchNullValues:n}=t,a=(await Nr(e))?.attributeTable?.features,s=i??r;return Array.from(new Set(a?.filter(o=>{let l=o.attributes[s];return!(!n&&l==null)}).map(o=>o.attributes[s]))).sort((o,l)=>typeof o=="string"&&typeof l=="string"?o.localeCompare(l):Number(o)-Number(l))}function Vd(t,e){let r=new Map;return e.forEach((i,n)=>{r.set(i,n)}),t.reduce((i,n)=>{let a=i[i.length-1];if(!a)return i.push([n,n]),i;if(n===a[1])return i;let s=r.get(n),o=r.get(a[1]);return s!==void 0&&o!==void 0&&s===o+1?(a[1]=n,i):(i.push([n,n]),i)},[])}function $d(t,e){return t?.map(({attributes:r})=>r[e]).filter(r=>r!=null).sort((r,i)=>r-i)}function Rd(t){let{chartConfig:e,layer:r,selectionItems:i}=t,n,a=r.serviceRasterInfo?.attributeTable??Lt(r)?.attributeTable,s=e.series?.[0]?.x,o=a?.features,l=a?.fields?.find(({name:u})=>u.toLowerCase()==="value")?.name;if(i.length>0&&s&&o&&o.length>0&&l){let u=new Set(i.map(c=>c[s]).filter(c=>c!==void 0));if(u.size>0){let c=new Set;o.forEach(f=>{let m=f.attributes,g=m[s];u.has(g)&&c.add(m[l])});let d=Array.from(c).sort((f,m)=>f-m);if(d.length>0){let f=$d(o,l);n={bandId:0,pixelRanges:Vd(d,f)}}}}return n}function zy(t){let e=[p.BarSeries,p.LineSeries,p.ComboLineAndBarSeries,p.BoxPlotSeries],r=j(t?.series);return r!==void 0?e.includes(r):!1}function Uy(t){let e=[p.BarSeries,p.LineSeries,p.ComboLineAndBarSeries,p.RadarSeries],r=j(t?.series);return r!==void 0?e.includes(r):!1}function Wd(t){return t?.type===Ie.SFS}function Hy(t){return t?.type===Ie.SLS}function Gy(t){return t?.type===Ie.SMS}function Yy(t){return t?.type===Ie.TS}function Qy(t){return t&&"iLayer"in t&&t.iLayer}function jd(t){return t?.type===p.BoxPlotSeries}function Jy(t){return t?.type===p.LineSeries}function Zd(t){return t?.type===p.RadarSeries}function _d(t){return t?.type===p.BarSeries}function Ky(t){return t?.type===p.HeatSeries}var Xy=t=>j(t)===p.LineSeries,e0=t=>j(t)===p.RadarSeries;function t0(t){return t.every(e=>e.type===p.PieSeries)}function r0(t){return t.every(jd)}function i0(t){return t?.type===p.NumberAxisFormat}function n0(t){return t===void 0||"bins"in t}function a0(t){return t===void 0||"dataItems"in t}function s0(t){return t===void 0||"dataItems"in t&&"r2"in t}function o0(t){return"value"in t}function l0(t){return j(t.series)!==p.BoxPlotSeries?F.xAxisField:t.series[0].x}function u0(t){let e=Pr(t);return e===Be.Stacked||e===Be.Stacked100}function c0(t,e){let r=[],i=new Map,n=new Map;return t.forEach((a,s)=>n.set(a.id,s)),e.forEach((a,s)=>{let o=n.get(a.id);if(o!==void 0){let l=new Set;for(;i.has(o)&&!l.has(o);)l.add(o),o=i.get(o)??o;o!==s&&(r.push([o,s]),i.set(s,o))}}),r}function d0(t,e){return t?.[0]===e?.[0]&&t?.[1]===e?.[1]&&t?.[2]===e?.[2]&&t?.[3]===e?.[3]}function zd(t){let e={...t};return t.showMean===!0&&(e.series=[e.series[0]],e.series[0].query?.where!==void 0&&delete e.series[0].query.where),e}function Ud(t){return At(t)&&li(t?.axes?.[0]?.valueFormat)&&li(t?.axes?.[1]?.valueFormat)}var Hd=[...Er,"ar-u-nu-latn","en-AU","en-GB","es-ES","es-MX","de-CH","de-DE","de-AT","fr-CA","it-CH","it-IT"];function f0(t){let{t9nLocale:e}=at(t??document.documentElement),r=Ao(t??document.documentElement),i=Wn(t??document.documentElement)==="rtl";return{locale:e,formatLocale:r,rtl:i}}function m0(t){let e;return t==="unknown"?e="UTC":t!==void 0&&t!=="system"&&(e=t),e}function g0(t,e){let r={year:"numeric",month:"2-digit",day:"2-digit",timeZone:e};return new Intl.DateTimeFormat("en-CA",r).format(t)}function h0(t,e){let r={hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:e};return new Intl.DateTimeFormat("en-US",r).format(t)}function y0(t,e){let[,r,,,,i]=1111.1.toLocaleString(e),n=t.replace(r,"").replace(i,".");return Number.parseFloat(n)}function Gd(t){let e=Array.from(Er);return Hd.includes(t)&&!e.includes(t)}function Ao(t){let{lang:e,t9nLocale:r}=at(t);return Gd(e)?e:r}function ui(t){let{dataInfo:e,chartType:r,subError:i}=t;switch(e.valid=!1,r){case p.BarSeries:case p.ComboLineAndBarSeries:e.invalidType=z.BarElementExceedsLimit;break;case p.LineSeries:e.invalidType=z.LineChartExceedsLimit;break;case p.RadarSeries:e.invalidType=z.RadarChartExceedsLimit;break;case p.PieSeries:e.invalidType=z.PieChartExceedsLimit;break;case p.GaugeSeries:e.invalidType=z.GaugeExceedsLimit;break;case p.BoxPlotSeries:i?.outlierLimit===!0?e.invalidType=z.BoxPlotOutliersExceedsLimit:e.invalidType=z.BoxPlotExceedsLimit;break;case p.HeatSeries:e.invalidType=z.HeatChartExceedsLimit;break}}function Yd(t,e){t.valid=!1,t.invalidType=e}function p0(t){let{invalidType:e,chartLimits:r,elementCount:i,seriesCount:n,queryObject:a,filterBySelection:s,formatLocale:o=Ao(document.documentElement),isTemporalChart:l,isByFeatureGauge:u,errorStrings:c}=t,d=se(a),f=c.errors.defaultInvalidChart,m,g=new Intl.NumberFormat(o),h=xt(r),{maxCategoryCount:y,serialChart:{categories:b}}=h,x=c.modalHeaders.invalidChart;switch(e){case z.BarElementExceedsLimit:{x=c.modalHeaders.tooManyFeatures;let w=Number.NaN,C=Number.NaN,v="";n!==void 0&&(n<=(h.maxBarChartSeriesCount??h.serialChart?.series)?n===1?(v=c.errors.uniqueSeriesBarCountCannotExceedLimit,w=h.maxBarUniqueSeriesCountTotal??h.serialChart?.elements):n===2?(v=c.errors.twoSeriesBarCountCannotExceedLimit,w=h.maxBarTwoSeriesCountTotal??h.serialChart?.elements,C=h.maxBarTwoSeriesCountPerSeries):n>2&&(v=c.errors.threePlusSeriesBarCountCannotExceedLimit,w=h.maxBarThreePlusSeriesCountTotal??h.serialChart?.elements,C=h.maxBarThreePlusSeriesCountPerSeries):(v=c.errors.barSeriesCountCannotExceedLimit,C=h.maxBarChartSeriesCount??h.serialChart?.series));let T=g.format(w),O=g.format(C),I=i!==void 0?g.format(i):"";f=$e(v,{totalLimit:T,seriesLimit:O,elementCount:I}),m={actualCount:i??Number.NaN,totalLimit:w,seriesLimit:C}}break;case z.LineChartExceedsLimit:{x=c.modalHeaders.tooManyFeatures;let w=Number.NaN,C=Number.NaN,v="";n!==void 0&&(n<=(h.maxLineChartSeriesCount??h.serialChart?.series)?n===1?(v=l?c.errors.uniqueTemporalSeriesLineCountCannotExceedLimit:c.errors.uniqueSeriesLineCountCannotExceedLimit,w=h.maxLineUniqueSeriesCountTotal??h.serialChart.elements):n===2?(v=l?c.errors.twoTemporalSeriesLineCountCannotExceedLimit:c.errors.twoSeriesLineCountCannotExceedLimit,w=h.maxLineTwoSeriesCountTotal??h.serialChart.elements,C=h.maxLineTwoSeriesCountPerSeries):n>2&&(v=l?c.errors.threePlusTemporalSeriesLineCountCannotExceedLimit:c.errors.threePlusSeriesLineCountCannotExceedLimit,w=h.maxLineThreePlusSeriesCountTotal??h.serialChart.elements,C=h.maxLineThreePlusSeriesCountPerSeries):(v=c.errors.lineSeriesCountCannotExceedLimit,C=h.maxLineChartSeriesCount??h.serialChart?.series));let T=g.format(w),O=g.format(C),I=i!==void 0?g.format(i):"";f=$e(v,{elementCount:I,seriesLimit:O,totalLimit:T}),m={actualCount:i??Number.NaN,totalLimit:w,seriesLimit:C}}break;case z.RadarChartExceedsLimit:{x=c.modalHeaders.tooManyFeatures;let w=Number.NaN,C=Number.NaN,v="";n!==void 0&&(n<=(h.maxRadarChartSeriesCount??h.serialChart?.series)?n===1?(v=c.errors.uniqueSeriesRadarCountCannotExceedLimit,w=h.maxRadarUniqueSeriesCountTotal??h.serialChart.elements):n===2?(v=c.errors.twoSeriesRadarCountCannotExceedLimit,w=h.maxRadarTwoSeriesCountTotal??h.serialChart.elements,C=h.maxRadarTwoSeriesCountPerSeries):n>2&&(v=c.errors.threePlusSeriesRadarCountCannotExceedLimit,w=h.maxRadarThreePlusSeriesCountTotal??h.serialChart.elements,C=h.maxRadarThreePlusSeriesCountPerSeries):(v=c.errors.radarSeriesCountCannotExceedLimit,C=h.maxRadarChartSeriesCount??h.serialChart?.series));let T=g.format(w),O=g.format(C),I=i!==void 0?g.format(i):"";f=$e(v,{elementCount:I,seriesLimit:O,totalLimit:T}),m={actualCount:i??Number.NaN,totalLimit:w,seriesLimit:C}}break;case z.BoxPlotExceedsLimit:{x=c.modalHeaders.tooManyFeatures;let w=Number.NaN,C=Number.NaN,v="";n!==void 0&&(n<=(h.maxBoxPlotSeriesCount??h.serialChart?.series)?n===1?(v=c.errors.uniqueSeriesBoxCountCannotExceedLimit,w=h.maxBoxUniqueSeriesCountTotal??h.serialChart.elements):n===2?(v=c.errors.twoSeriesBoxCountCannotExceedLimit,w=h.maxBoxTwoSeriesCountTotal??h.serialChart.elements,C=h.maxBoxTwoSeriesCountPerSeries):n>2&&(v=c.errors.threePlusBoxLineCountCannotExceedLimit,w=h.maxBoxThreePlusSeriesCountTotal??h.serialChart.elements,C=h.maxBoxThreePlusSeriesCountPerSeries):(v=c.errors.boxSeriesCountCannotExceedLimit,C=h.maxBoxPlotSeriesCount??h.serialChart.series));let T=g.format(w),O=g.format(C),I=i!==void 0?g.format(i):"";f=$e(v,{elementCount:I,seriesLimit:O,totalLimit:T}),m={actualCount:i??Number.NaN,totalLimit:w,seriesLimit:C}}break;case z.BoxPlotOutliersExceedsLimit:{x=c.modalHeaders.tooManyFeatures;let w=c.errors.boxSeriesOutlierCannotExceedLimit,C=h.maxBoxPlotOutlierLimit??h.boxPlot?.outliers,v=g.format(C);f=$e(w,{totalLimit:v}),m={actualCount:i??Number.NaN,totalLimit:C}}break;case z.HeatChartExceedsLimit:{x=c.modalHeaders.tooManyFeatures;let w=c.errors.heatChartCannotExceedLimit,C=h.maxHeatChartCellLimit??h.heatChart?.cells,v=g.format(C),T=i!==void 0?g.format(i):"";f=$e(w,{featureCount:T,totalLimit:v}),m={actualCount:i??Number.NaN,totalLimit:C}}break;case z.PieChartExceedsLimit:{x=c.modalHeaders.tooManyFeatures;let w=c.errors.pieChartSlicesCannotExceedLimit,C=h.maxPieChartSliceCountTotal??h.pieChart?.slices,v=g.format(C),T=i!==void 0?g.format(i):"";f=$e(w,{sliceCount:T,totalLimit:v}),m={actualCount:i??Number.NaN,totalLimit:C}}break;case z.GaugeExceedsLimit:{x=c.modalHeaders.tooManyFeatures;let w=c.errors.gaugeCannotExceedLimit,C=h.maxGaugeByFeaturesLimit??h.gauge?.features,v=g.format(C),T=i!==void 0?g.format(i):"";f=$e(w,{featureCount:T,totalLimit:v}),m={actualCount:i??Number.NaN,totalLimit:C}}break;case z.PieChartMixOfNegativePositiveSlices:x=c.modalHeaders.cannotCombineNegativeAndPositiveSlices,f=c.errors.pieChartCannotHaveMixtureOfPositiveAndNegativeSlices;break;case z.NegativeValueInSqrtCalculation:x=c.modalHeaders.invalidData,f=c.errors.negativeValueInDataForSqrtTransformation;break;case z.NegativeValueInLogCalculation:x=c.modalHeaders.invalidData,f=c.errors.negativeValueInDataForLogTransformation;break;case z.HistogramEmptyField:s===!0?(x=c.modalHeaders.noDataAvailable,f=c.errors.noDataFBSMessage):gt(a)?(x=c.modalHeaders.noDataAvailable,f=c.errors.noDataFBEMessage):(x=c.modalHeaders.invalidChart,f=c.errors.histogramEmptyField);break;case z.EmptyDataSet:x=c.modalHeaders.noDataAvailable,s===!0?f=c.errors.noDataFBSMessage:gt(a)?f=c.errors.noDataFBEMessage:f=c.errors.noDataMessage;break;case z.NoValue:u&&i?(x=void 0,f=c.errors.noValue):d&&(x=c.modalHeaders.noDataAvailable,f=c.errors.noDataMessage);break;case z.NegativeValueInXAxisLogScale:f=c.errors.logarithmicXAxisNotPossible;break;case z.NegativeValueInYAxisLogScale:f=c.errors.logarithmicYAxisNotPossible;break;case z.BadData:}if(f===c.errors.defaultInvalidChart&&(e===z.BarElementExceedsLimit||e===z.LineChartExceedsLimit||e===z.RadarChartExceedsLimit||e===z.HeatChartExceedsLimit||e===z.PieChartExceedsLimit||e===z.GaugeExceedsLimit||e===z.BoxPlotExceedsLimit)&&typeof i=="number"&&typeof n=="number"&&i/n>(y??b)){let w=i/n;f=$e(c.errors.categoryCountCannotExceedLimit,{categoryCount:g.format(w),maxCategoryCount:g.format(y??b)})}return{keyword:e??z.BadData,header:x,message:f,params:m}}function tr(t,e){return`${e}_${t}`}function Cn(t){let{value:e,mean:r,stdDev:i}=t;return(e-r)/i}function An(t){let{dataItem:e,chartSubType:r,y:i,splitByValue:n,meanPerField:a,stdDevPerField:s}=t,o=e,l={chartSubType:r,y:i,splitByValue:n},u=ce({...l,key:P.Average}),c=ce({...l,key:P.StandardDeviation}),d=a??Number(e[u]),f=s??Number(e[c]);return Number.isFinite(d)&&Number.isFinite(f)&&Object.values(P).forEach(m=>{let g=ce({key:m,y:i,chartSubType:r,splitByValue:n}),h=e[g];if(h!=null){let y=Number(h);if(Number.isFinite(y)){l={...l,key:m,showOutliers:!1,standardizeValues:!0};let b=ce(l);if(o[b]=Cn({mean:d,stdDev:f,value:y}),m===P.Min||m===P.Max){l={...l,key:m,showOutliers:!0,standardizeValues:!0},b=ce(l),l={...l,standardizeValues:!1,splitByValue:n};let x=ce(l);y=Number(e[x]),Number.isFinite(y)&&(o[b]=Cn({mean:d,stdDev:f,value:y}))}}}}),o}function Qd(t){let{data:e,yList:r,calculateZScore:i=!1}=t,n=e[0],a=new Map;return r.forEach(s=>{let o={};Object.keys(n).forEach(l=>{l.startsWith(s)?o[l.replace(`${s}_`,"")]=n[l]:l.includes(F.rendererSymbolField)&&(o[l]=n[l]),o[F.boxPlot.boxPlotCategory]=s,i&&(o=An({dataItem:o,chartSubType:S.BoxPlotC2MultiFields}))}),a.set(s,o)}),Array.from(a.values())}function Jd(t){let{data:e,splitByField:r,y:i}=t,n={[F.boxPlot.boxPlotCategory]:i};return e.forEach(a=>{let s=a[r];s!==void 0&&Object.keys(a).forEach(o=>{o===F.rendererSymbolField||o===W.uniqueIds?n[`${o}_${s?.toString()}`]=a[o]:o===F.boxPlot.boxPlotMeanLineMarkerId?n[o]=a[o]:n[`${s?.toString()}_${o}`]=a[o]})}),[n]}function Kd(t){let{splitByField:e,data:r,yList:i,calculateZScore:n=!1,meanAndStdDevPerField:a}=t,s=new Map;return r.forEach(o=>{let l=o[e];i.forEach(u=>{let c={[F.boxPlot.boxPlotCategory]:u};Object.entries(o).forEach(([d,f])=>{d.startsWith(`${u}_`)?c[`${l}_${d.replace(`${u}_`,"")}`]=f:d.includes(F.rendererSymbolField)||d===W.uniqueIds?c[`${d}_${l}`]=f:d===F.boxPlot.boxPlotMeanLineMarkerId&&(c[d]=o[d])}),n&&(c=An({dataItem:c,chartSubType:S.BoxPlotC6MultiFieldsAndSplitBy,splitByValue:l,meanPerField:a?.[tr(u,L.Average)],stdDevPerField:a?.[tr(u,L.StandardDeviation)]})),s.set(u,{...s.get(u)??{},...c})})}),Array.from(s.values())}function Xd(t){let{data:e,yList:r,calculateZScore:i=!1,meanAndStdDevPerField:n}=t,a=e;return i&&a.forEach(s=>{r.forEach(o=>{An({dataItem:s,chartSubType:S.BoxPlotC4MultiFieldsAndCategory,y:o,meanPerField:n?.[tr(o,L.Average)],stdDevPerField:n?.[tr(o,L.StandardDeviation)]})})}),a}function ef(t){let{splitByField:e,x:r,data:i}=t,n=new Map;return i.forEach(a=>{let s=a[r],o={[r]:s},l=a[e];Object.entries(a).forEach(([u,c])=>{if(u.includes(F.rendererSymbolField))o[`${F.rendererSymbolField}_${l?.toString()}`]=c;else if(u.includes(W.uniqueIds))o[`${W.uniqueIds}_${l?.toString()}`]=c;else if(u===F.boxPlot.boxPlotMeanLineMarkerId)o[u]=a[u];else if(u!==e&&u!==r){let d=u!==F.xAxisField&&u!==F.originalXValue?`${l?.toString()}_${u}`:u;o[d]=c}}),n.set(s,{...n.get(s)??{},...o})}),Array.from(n.values())}function tf(t,e){let{series:r}=t,i=r[0],{y:n}=i,a=H(t.series),s={y:a===S.BoxPlotC4MultiFieldsAndCategory?n:void 0,chartSubType:a},o=t.series.map(l=>{let u=Se({where:l.query?.where,normalize:!1,escape:!0});return u!==null&&`${u}`.startsWith("'")&&`${u}`.endsWith("'")&&(u=u.substring(1,u.length-1)),u});o.length===0&&o.push(" "),e.forEach(l=>{o.forEach(u=>{s.splitByValue=u;let c=ce({...s,key:P.Min,showOutliers:!0}),d=ce({...s,key:P.Min,showOutliers:!1}),f=ce({...s,key:P.Max,showOutliers:!0}),m=ce({...s,key:P.Max,showOutliers:!1});l[f]===void 0&&l[m]!==void 0&&(l[f]=l[m]),l[c]===void 0&&l[d]!==void 0&&(l[c]=l[d])})})}function rf(t,e){let r,i,n=t[e[P.IQR]],a=t[e[P.FirstQuartile]],s=t[e[P.ThirdQuartile]];return Number.isFinite(n)&&Number.isFinite(a)&&Number.isFinite(s)&&(r=a-n*1.5,i=s+n*1.5),{outlierMinThreshold:r,outlierMaxThreshold:i}}function _s(t){let{yField:e,xField:r,xValue:i,splitByField:n,splitByValue:a,outlierMaxThreshold:s,outlierMinThreshold:o,target:l}=t,u;if(r!==void 0&&i!==void 0)if(i===null)u=`${r} IS NULL`;else{let f=typeof i!="string"?i:kr(`'${i}'`);u=`${r}=${f.toString()}`}let c;if(n!==void 0&&a!==void 0)if(a===null)c=`${n} IS NULL`;else{let f=typeof a!="string"?a:kr(`'${a}'`);c=`${n}=${f.toString()}`}let d;return l==="outliers"&&o!==s?d=`(${e}<${o} OR ${e}>${s})`:l==="alternativeData"&&(o===s?d=`(${e}=${o})`:d=`(${e}>=${o} AND ${e}<=${s})`),[u,c,d].filter(f=>f!==void 0).join(" AND ")}function Mo(t){let{data:e,yField:r,x:i,chartSubType:n,splitByField:a}=t,s=n===S.BoxPlotC1MonoField||n===S.BoxPlotC3MonoFieldAndCategory||n===S.BoxPlotC5MonoFieldAndSplitBy||n===S.BoxPlotC7MonoFieldAndCategoryAndSplitBy?void 0:r,o=Xt(s),l=[],u=[],{maxOperandsPerWhereClause:c}=sr(),d=[],f=[],m=1;return e.forEach((g,h)=>{let{outlierMinThreshold:y,outlierMaxThreshold:b}=rf(g,o);if(typeof y=="number"&&typeof b=="number"){let x={yField:r,outlierMinThreshold:y,outlierMaxThreshold:b};if((n===S.BoxPlotC3MonoFieldAndCategory||n===S.BoxPlotC4MultiFieldsAndCategory||n===S.BoxPlotC7MonoFieldAndCategoryAndSplitBy)&&i!==void 0&&i in g&&(x.xField=i,x.xValue=Pn({value:g[i],dataContext:g})),(n===S.BoxPlotC5MonoFieldAndSplitBy||n===S.BoxPlotC6MultiFieldsAndSplitBy||n===S.BoxPlotC7MonoFieldAndCategoryAndSplitBy)&&a!==void 0&&a in g){let w=g[a];(typeof w=="string"||typeof w=="number"||w instanceof Date||w===null)&&(x.splitByField=a,x.splitByValue=w)}d.push(_s({...x,target:"outliers"})),f.push(_s({...x,target:"alternativeData"})),(m%c===0||h===e.length-1)&&(l.push(te(d,"OR")),u.push(te(f,"OR")),d=[],f=[])}m+=1}),{outliersFilterBatches:l,dataWithoutOutliersFilterBatches:u}}function nf(t){let{data:e,outlierDataItem:r,chartSubType:i,x:n,y:a,meanAndStdDevPerField:s,splitByField:o}=t,l=s?.[tr(a,L.Average)],u=s?.[tr(a,L.StandardDeviation)];if(l===void 0&&u===void 0)switch(i){case S.BoxPlotC2MultiFields:{let c=Xt(a),d=e[0];l=Number(d[c[P.Average]]),u=Number(d[c[P.StandardDeviation]]);break}case S.BoxPlotC4MultiFieldsAndCategory:{let c=e.find(d=>d[n]===r[n]);if(c!==void 0){let d=Xt(a);l=Number(c[d[P.Average]]),u=Number(c[d[P.StandardDeviation]])}break}case S.BoxPlotC6MultiFieldsAndSplitBy:{let c=e.find(d=>d[o]===r[o]);if(c!==void 0){let d=Xt(a);l=Number(c[d[P.Average]]),u=Number(c[d[P.StandardDeviation]])}break}}return{mean:l,stdDev:u}}async function af(t){let{seriesConfig:e,data:r,uniqueQuery:i,queryObject:n,meanAndStdDevPerField:a,errorStrings:s,abortKey:o,abortSignal:l}=t,u=H(e),c=e[0],{x:d}=c,f=de(c.query?.where),m=J(n),g=He(m).idField,h=he(e),y=[];for(let w=0;w<h.length;w+=1){let C=h[w],{outliersFilterBatches:v}=Mo({data:r,yField:C,x:d,chartSubType:u,splitByField:f});for(let T=0;T<v.length;T+=1){let O=v[T];if(O!==""){let I=[];d!==F.boxPlot.boxPlotCategory&&I.push(d),I.push(C),f!==""&&I.push(f),I.push(g);let B={...i,where:te([i.where,O]),groupByFieldsForStatistics:void 0,outStatistics:void 0,orderByFields:void 0,num:void 0,outFields:I};y.push(De({queryObject:n,queryConfig:B,featureCount:1,returnStatisticsAggregatedIds:!1,errorStrings:s,abortKey:o,abortSignal:l}))}}}let b=await Promise.all(y),x=new Map;for(let w=0;w<b.length;w+=1){let C=b[w],v=h[w];C.forEach(T=>{let O={...T.attributes};if(O[v]!==void 0){d===F.boxPlot.boxPlotCategory&&(O[F.boxPlot.boxPlotCategory]=v),d!==F.boxPlot.boxPlotCategory&&O[d]===null&&(O[F.originalXValue]=null,O[d]=F.nullValue);let I={key:P.Outlier,chartSubType:u};switch(u){case S.BoxPlotC5MonoFieldAndSplitBy:case S.BoxPlotC6MultiFieldsAndSplitBy:case S.BoxPlotC7MonoFieldAndCategoryAndSplitBy:I={...I,splitByValue:O[f]};break;case S.BoxPlotC4MultiFieldsAndCategory:I={...I,y:v};break}let B=ce(I),N=O[v];O[B]=N;let A=`${O[d]}-${O[f]}-${N}`,D=x.get(A);if(O[W.uniqueIds]=[...D?.[W.uniqueIds]??[],O[g]],delete O[g],Ho(u)){let E=ce({...I,standardizeValues:!0}),{mean:M,stdDev:V}=nf({data:r,outlierDataItem:O,chartSubType:u,x:d,y:v,splitByField:f,meanAndStdDevPerField:a});M!==void 0&&V!==void 0&&(O[E]=Cn({value:N,mean:M,stdDev:V}))}delete O[v],O[F.boxPlot.boxPlotY]=v,O[F.boxPlot.boxPlotOutlierId]=!0,x.set(A,O)}})}return Array.from(x.values())}async function sf(t){let{data:e,queryObject:r,uniqueQuery:i,elementCount:n,chartConfig:a,chartLimits:s,errorStrings:o,abortKey:l,abortSignal:u}=t,c=[],{series:d,showMean:f}=a,m=Dn({showMean:f,seriesConfig:d}),g=H(d),h=pt(a),{x:y}=h,b=de(h.query?.where),x=[];for(let C=0;C<m.length;C+=1){let v=m[C],{dataWithoutOutliersFilterBatches:T}=Mo({data:e,yField:v,x:y,chartSubType:g,splitByField:b});for(let O=0;O<T.length;O+=1){let I=T[O],B={...i,where:te([i.where,I])};B.outStatistics!==void 0&&(B.outStatistics=B.outStatistics?.filter(N=>(N.statisticType===L.Minimum||N.statisticType===L.Maximum)&&N.onStatisticField===v).map(N=>({...N,outStatisticFieldName:`${N.outStatisticFieldName}${F.boxPlot.boxPlotOutliersSuffix}`}))),x.push(bi({queryObject:r,uniqueQuery:B,chartConfig:a,elementCount:n,isTimeBinningSeries:!1,chartLimits:s,returnStatisticsAggregatedIds:!1,errorStrings:o,abortKey:l,abortSignal:u}))}}let w=await Promise.all(x);for(let C=0;C<w.length;C+=1)c.push(...w[C]);return g!==S.BoxPlotC7MonoFieldAndCategoryAndSplitBy&&g!==S.BoxPlotC1MonoField&&(c=br({data:c,x:b!==void 0&&b!==""?b:y})),c}async function of(t){let{queryObject:e,uniqueQuery:r,chartConfig:i,errorStrings:n,abortKey:a,abortSignal:s}=t,o,{series:l,showMean:u}=i,c=H(l);if(c===S.BoxPlotC4MultiFieldsAndCategory||c===S.BoxPlotC6MultiFieldsAndSplitBy){let d=Dn({showMean:u,seriesConfig:l}),f={...r};delete f.outStatistics,delete f.groupByFieldsForStatistics,delete f.orderByFields;let m=[];for(let h=0;h<d.length;h+=1){let y=d[h];m.push({statisticType:L.Average,onStatisticField:y,outStatisticFieldName:`${L.Average}_${y}`},{statisticType:L.StandardDeviation,onStatisticField:y,outStatisticFieldName:`${L.StandardDeviation}_${y}`})}f.outStatistics=m;let g=await De({queryObject:e,queryConfig:f,returnStatisticsAggregatedIds:!1,featureCount:1,errorStrings:n,abortKey:a,abortSignal:s});g.length>0&&(o=g[0].attributes)}return o}function lf(t){let{data:e,additionalData:r,chartConfig:i}=t,n=i.series[0],{x:a}=n,s=de(n.query?.where);return e.map(o=>{let l=o,u=r.find(c=>c[a]===o[a]&&(s===""?!0:c[s]===o[s]));return u!==void 0&&(l={...o,...u}),l})}function Eo(t){let{chartConfig:e,data:r,calculateZScore:i=!1,meanAndStdDevPerField:n}=t,{series:a,showMean:s}=e,o=pt(e),l=H(e.series),{x:u}=o,c=Dn({showMean:s,seriesConfig:a}),d=r;if(r?.[0]!==void 0){let f=de(o.query?.where);switch(l){case S.BoxPlotC1MonoField:d[0][F.boxPlot.boxPlotCategory]=c[0];break;case S.BoxPlotC2MultiFields:d=Qd({data:r,yList:c,calculateZScore:i});break;case S.BoxPlotC4MultiFieldsAndCategory:d=Xd({data:r,yList:c,meanAndStdDevPerField:n,calculateZScore:i});break;case S.BoxPlotC5MonoFieldAndSplitBy:d=Jd({data:r,splitByField:f,y:c[0]});break;case S.BoxPlotC6MultiFieldsAndSplitBy:d=Kd({splitByField:f,data:r,yList:c,meanAndStdDevPerField:n,calculateZScore:i});break;case S.BoxPlotC7MonoFieldAndCategoryAndSplitBy:d=ef({splitByField:f,x:u,data:r});break;case S.BoxPlotC3MonoFieldAndCategory:}}return tf(e,d),d}async function uf(t){let{data:e,queryObject:r,uniqueQuery:i,fetchFullBoxPlotData:n,chartConfig:a,elementCount:s,chartLimits:o,errorStrings:l,abortKey:u,abortSignal:c}=t,d=e,f=[];if(d!==void 0){let{series:m}=a,g=await of({queryObject:r,uniqueQuery:i,chartConfig:a,errorStrings:l,abortKey:u,abortSignal:c});if(n!==!1){f=await af({queryObject:r,uniqueQuery:i,seriesConfig:m,data:d,errorStrings:l,abortKey:u,abortSignal:c});let h=await sf({queryObject:r,uniqueQuery:i,elementCount:s,data:e,chartConfig:a,chartLimits:o,errorStrings:l,abortKey:u,abortSignal:c});d=lf({data:d,additionalData:h,chartConfig:a})}d=Eo({chartConfig:a,data:d,meanAndStdDevPerField:g,calculateZScore:!0})}return{dataItems:d,outliers:f}}function S0(t){let{chartConfig:e,data:r,seriesConfig:i,seriesType:n}=t,a=[],s=Se({where:i.query?.where}),o=de(i.query?.where),l=n==="outliers"&&e.series.length>1&&"y"in i&&(!Array.isArray(i.y)||i.y.length===1),u=n==="outliers"&&e.series.length>1&&!le(o);if(r)switch(n){case"outliers":a="outliers"in r?r.outliers:void 0;break;case"meanLines":a="meanLines"in r?r.meanLines:void 0;break;case"candleStick":case"stepLine":a="dataItems"in r?r.dataItems:void 0;break}return a?.filter(c=>{let d=!0;return(u||l)&&(l&&(d="y"in i&&c[F.boxPlot.boxPlotY]===(typeof i.y=="string"?i.y:i.y[0])),d&&u&&(d=c[o]===s)),d})??[]}function zs(t){let{orderBy:e,axisFormatOptions:r}=t;return e!==void 0&&r!==void 0&&(!Array.isArray(e)||r?.type===p.CategoryAxisFormat)}function Us(t,e,r){let i=0;if(Array.isArray(r)){let n=t?.toString()??"",a=e?.toString()??"",s=r.indexOf(n),o=r.indexOf(a);s===-1&&(s=r.length),o===-1&&(o=r.length),i=s-o}else r===Ce.Descending?typeof t=="string"&&typeof e=="string"?i=e.localeCompare(t,void 0,{numeric:!0}):i=(Number(e)||0)-(Number(t)||0):r===Ce.Ascending&&(typeof t=="string"&&typeof e=="string"?i=t.localeCompare(e,void 0,{numeric:!0}):i=(Number(t)||0)-(Number(e)||0));return i}function cf(t){let{arrayToSort:e,chartConfig:r,dataOrderParameters:i}=t,n=i??hi(r),a,s,o=!1,l=!1,u=!1;n&&e.length>1&&([a,s]=n,o=a&&a.sortingField.length>0&&zs({orderBy:a.orderBy,axisFormatOptions:r.axes?.[0]?.valueFormat}),l=s&&s.sortingField.length>0&&zs({orderBy:s.orderBy,axisFormatOptions:r.axes?.[1]?.valueFormat}),u=o||l),u&&e.sort((c,d)=>{let f=0;if(o&&a?.sortingField){let m=a.orderBy;f=Us(c[a.sortingField],d[a.sortingField],m)}if(f===0&&l&&s?.sortingField){let m=s.orderBy;f=Us(c[s.sortingField],d[s.sortingField],m)}return f})}function df(t){let{chartConfig:e,chartData:r}=t;r.heatChartAxesData=Io({chartConfig:e,chartData:r.dataItems})}function ci(t){let{arrayToSort:e,chartConfig:r,fieldList:i,isTimeBinningSeries:n}=t;if(n!==!0&&e[0]!==void 0){let{series:a}=r,s=H(a),o=j(a),l=We(r),u=hi(r);if(At(r)&&e!==void 0)cf({arrayToSort:e,chartConfig:r,dataOrderParameters:u});else if(u?.[0]!==void 0&&e!==void 0&&e.length>1){let{orderBy:c}=u[0],{sortingField:d}=u[0],f=r.orderOptions?.data?.orderType===Je.Category,m=u[0].preferLabel!==!1,g=s===S.BarAndLineFromFields||s===S.PieFromFields||s===S.BoxPlotC2MultiFields||s===S.BoxPlotC6MultiFieldsAndSplitBy,h=g||o===p.PieSeries,y=s===S.PieNoAggregation||s===S.BarAndLineNoAggregation||s===S.BarAndLineSplitByNoAggregation;if(f&&h&&(!m||(o===p.LineSeries||o===p.RadarSeries)&&l===p.NumberAxisFormat)&&(d=F.originalXValue),Array.isArray(c))cg({arrayToSort:e,orderBy:c,sortingField:d,fieldList:i,isByFieldsChart:g,preferLabel:m});else{let b=l===p.DateAxisFormat&&f;vr({arrayToSort:e,orderBy:c,sortingField:d,forceAscendingOrder:b,isNonAggregated:y,sortByCategory:f,preferLabel:m,isPieOrByFieldsChart:h})}}}}function b0(t){let{alteredConfig:e,dataInfo:r,fieldList:i,options:n,queryObject:a}=t,s=qn(r.data);if(s&&ci({arrayToSort:s,chartConfig:e,fieldList:i,isTimeBinningSeries:it({seriesConfig:pt(e),xAxisValueFormatType:We(e),setTimeBinningInfoWhenNotProvided:n?.setTimeBinningInfoWhenNotProvided,queryObject:a})}),be(e)){let o=r?.data&&"meanLines"in r.data?r.data.meanLines:void 0;o&&ci({arrayToSort:o,chartConfig:e})}At(e)&&r.data&&df({chartConfig:e,chartData:r.data})}function ff(t){return t?.type==="uniqueValue"&&(t.uniqueValueInfos=t.uniqueValueInfos.map(e=>{let r=e.value===null?F.nullValue:e.value;return{...e,value:r}})),t}async function v0(t){let{data:e,queryObject:r,chartConfig:i,allowColorMatch:n}=t,a=!1,s=[];if(n&&!se(r)){let{series:o,chartRenderer:l}=i,u=ff(l),c=u?Kt.ChartRenderer:Kt.LayerRenderer,d=r?J(r):void 0,f=u??d?.renderer,m;d&&c===Kt.LayerRenderer?s=await nl(d):c===Kt.ChartRenderer&&(s=og(f));let g=Km(u,d?.renderer),h=ig({chartRenderer:l,queryObject:r}),y=j(o),b=H(o),x=pt(i),w=de(x.query?.where);m=new Map;for(let C=0;C<(y===p.HistogramSeries&&e.length>0?1:e.length);C+=1){let v=e[C],T=await ng({seriesConfig:i.series,dataItem:v,renderer:f,rendererType:g,rendererOrigin:c,chartSubType:b,splitByField:w,graphicTemplate:h,mapAttributesToSymbol:m,rendererFieldNames:s});a=a||T.colorMatchApplied}}return{dataItems:e,colorMatchApplied:a,rendererFieldNames:s}}function mf(t){let{itemsA:e,itemsB:r,isPieFromFields:i,x:n,y:a,outStatisticFieldName:s}=t,o=Ye(e),l=Ye(r),u=!1;if(o===void 0&&l!==void 0||o!==void 0&&l===void 0)u=!0;else if(!i){let c=[F.originalXValue,F.originalYCategoryValue,F.xAxisField,F.technicalSortingFieldBySum,F.technicalSortingFieldByPercent,F.pieChart.technicalFieldSlicePercent,F.pieChart.technicalFieldGroupedSlices,F.pieChart.technicalFieldSliceId,F.originalServerBinningRange,F.firstTemporalBin,F.lastTemporalBin,F.technicalFieldSplitByField,_.valueField,...Un],d=(h,y)=>{let b=y[F.originalXValue];b!==void 0&&n&&(y[n]=b);let x=y[F.originalYCategoryValue];x!==void 0&&a&&(y[a]=x),n&&y[_.xField]!==void 0&&(y[n]=y[F.originalXValue]!==void 0?y[F.originalXValue]:y[_.xField],delete y[_.xField]),a&&y[_.yField]!==void 0&&(y[a]=y[F.originalYCategoryValue]!==void 0?y[F.originalYCategoryValue]:y[_.yField],delete y[_.yField]),s&&y[_.valueField]!==void 0&&(y[s]=y[_.valueField],delete y[_.valueField]);let w={};return Object.keys(y).forEach(C=>{!c.includes(C)&&!C.includes(F.rendererSymbolField)&&!C.includes(W.uniqueIds)&&(w[C]=y[C])}),h.push(w),h},f=(h,y)=>JSON.stringify(h).localeCompare(JSON.stringify(y)),m=o?.reduce(d,[])?.sort(f),g=l?.reduce(d,[])?.sort(f);m&&g&&n&&m.length!==g.length&&(m=br({data:m,x:n}),g=br({data:g,x:n})),u=m?.length!==g?.length||!vt(m,g)}return u}function gf(t){let{chartConfig:e,currentSelectionItems:r,selectionData:i}=t,n=[];if(e!==void 0){let a=e.series,s=H(a),{selectionItems:o}=i??{};if(o!==void 0&&mf({itemsA:o,itemsB:r,isPieFromFields:H(e.series)===S.PieFromFields,x:e.series[0].x,y:"y"in e.series[0]?e.series[0].y.toString():void 0,outStatisticFieldName:e.series[0].query?.outStatistics?.[0]?.outStatisticFieldName})?n=o:n=r??[],a.length>1&&s!==S.BarAndLineNoAggregation&&s!==S.BarAndLineSplitByNoAggregation){let l=de(a[0].query?.where);n=br({data:n,x:a[0].x,splitByField:l})}ci({arrayToSort:n,chartConfig:e})}return n??[]}async function hf(t){let{queryObject:e,queryConfig:r,chartConfig:i,errorStrings:n,abortKey:a,abortSignal:s}=t,o=i.series[0],{x:l,valueConversion:u}=o,c=Si(i),d=await De({queryObject:e,queryConfig:r,featureCount:r.num??1,returnStatisticsAggregatedIds:!1,errorStrings:n,abortKey:a,abortSignal:s}),f=[{[l]:null}];if(c)f=d.map(m=>{En(m.attributes,l);let g=ao(m.attributes[l],u);return{...m.attributes,[l]:g}});else if(d.length>0){let m=d[0].attributes[l]??d[0].attributes[l.toUpperCase()]??d[0].attributes[l.toLowerCase()];m=ao(m,u),f=[{[l]:m}]}return f}async function yf(t){let{queryObject:e,chartConfig:r,queryConfig:i,chartLimits:n,errorStrings:a,abortKey:s,abortSignal:o}=t,l={valid:!0},{behaviorAfterLimit:u,maxGaugeByFeaturesLimit:c,gauge:d}=n??{},f=c??d?.features,m=Si(r),g=!0,h;if(m&&(h=(await _o({chartConfig:r,queryObject:e,queryConfig:i,behaviorAfterLimit:u,numberMaxOfFeaturesToFetch:f,isGaugeByFeature:m,abortSignal:o})).elementCount,n?.behaviorAfterLimit!==st.RenderUpToTheLimit&&(g=_e({count:h??0,seriesCount:r.series.length,chartType:p.GaugeSeries,chartLimits:n})),n&&(Number.isFinite(f)||Number.isFinite(h)))){let y=Math.min(f??Number.NaN,h??Number.NaN),b=n;Number.isFinite(y)&&(b={...n,maxGaugeByFeaturesLimit:y,gauge:{features:y}}),sl({chartConfig:r,chartLimits:b,uniqueQuery:i})}if(Number.isNaN(g)||g){let y=await hf({queryObject:e,chartConfig:r,queryConfig:i,errorStrings:a,abortKey:s,abortSignal:o}),{calculatedAxisMinimum:b,calculatedAxisMaximum:x,gaugeValue:w}=await bf({chartConfig:r,queryConfig:i,chartData:y,featureIndex:r.series?.[0]?.featureIndex,queryObject:e,errorStrings:a});l.data={dataItems:y,calculatedAxisMinimum:b,calculatedAxisMaximum:x,gaugeValue:w},l.count=y.length,Number.isNaN(w)&&y.length>0&&(l.valid=!1,l.invalidType=z.NoValue)}else l.count=h,ui({dataInfo:l,chartType:p.GaugeSeries});return l}function pf(t){let{featureIndex:e,chartData:r,chartConfig:i}=t,{minimumFromField:n,maximumFromField:a}=i?.axes?.[0]??{},s,o;if(e>=0&&e<r.length){let l=r[e];typeof n=="string"&&!le(n)&&Number.isFinite(l[n])&&(s=l[n]),typeof a=="string"&&!le(a)&&Number.isFinite(l[a])&&(o=l[a])}return{minimumFromData:s,maximumFromData:o}}async function Sf(t){let{queryObject:e,chartConfig:r,queryConfig:i,errorStrings:n}=t,{minimumFromField:a,maximumFromField:s}=r.axes[0],o=[],l="",u="";a!==void 0&&(typeof a=="string"?(l=`${L.Minimum}_${a}`,o.push({statisticType:L.Minimum,onStatisticField:a,outStatisticFieldName:l})):(l=`${a.statisticType}_${a.onStatisticField}`,o.push({...a,outStatisticFieldName:l}))),s!==void 0&&(typeof s=="string"?(u=`${L.Maximum}_${s}`,o.push({statisticType:L.Maximum,onStatisticField:s,outStatisticFieldName:u})):(u=`${s.statisticType}_${s.onStatisticField}`,o.push({...s,outStatisticFieldName:u})));let c={...i,outStatistics:o,orderByFields:void 0,groupByFieldsForStatistics:void 0,returnDistinctValues:void 0,fetchNullValues:void 0,num:void 0};Vt(e);let d=await wr({queryObject:e,queryConfig:c,errorStrings:n}),f=d.get(l),m=d.get(u);return{minimumFromData:f,maximumFromData:m}}function Lo(t){let{featureIndex:e,chartData:r,x:i}=t,n=Number.NaN;if(e>=0&&e<r.length){let a=r[e];i!==void 0&&!le(i)&&Number.isFinite(a[i])&&(n=a[i])}return n}function qo(t){let{x:e,chartData:r}=t,i=Number.NaN;if(r!==void 0&&e!==void 0){let n=r.find(s=>e in s),a=Number.parseFloat(n[e]);Number.isFinite(a)&&(i=a)}return i}function C0(t){let{chartData:e,chartConfig:r}=t,{x:i}=r.series?.[0],n=Number.NaN;if(Si(r)){let a=r.series?.[0]?.featureIndex??0;n=Lo({chartData:e??[],featureIndex:a,x:i})}else n=qo({chartData:e,x:i});return n}async function bf(t){let{featureIndex:e=0,chartData:r,queryConfig:i,chartConfig:n,queryObject:a,errorStrings:s}=t,{x:o}=n.series?.[0],{axes:l}=n,{minimum:u,maximum:c}=l?.[0]??{},d=Si(n),f,m,g;d?({minimumFromData:f,maximumFromData:m}=pf({featureIndex:e,chartData:r,chartConfig:n}),g=Lo({chartData:r,featureIndex:e,x:n.series?.[0]?.x})):({minimumFromData:f,maximumFromData:m}=await Sf({chartConfig:n,queryObject:a,queryConfig:i??{},errorStrings:s}),g=qo({chartData:r,x:o}));let h=f??u??Oi.axisMinimum,y=m??c??Oi.axisMaximum;return{calculatedAxisMinimum:h,calculatedAxisMaximum:y,gaugeValue:g}}function ht(t,e){let r="";if(t.trim()!==""&&e!==void 0)if(e===null)r=`${t} IS NULL`;else{let i=typeof e!="number"?"'":"";r=`${t}=${i}${e.toString()}${i}`}return r}function vf(t){let{dataContext:e,xAxisField:r,yAxisField:i,options:n}=t,a="",{dataContextXMinField:s,dataContextXMaxField:o,dataContextYMinField:l,dataContextYMaxField:u}=F.scatterplotAggregationFields;if(ol({dataContext:e,chartLimits:n?.chartLimits})){let{[s]:c,[o]:d}=e,f=r!==i?e[l]:c,m=r!==i?e[u]:d;if(!Number.isNaN(c)&&!Number.isNaN(d)&&!Number.isNaN(f)&&!Number.isNaN(m)){let g=[];c===d?g.push(`${r}=${c?.toString()}`):(g.push(`${r}>=${c?.toString()}`),g.push(`${r}<=${d?.toString()}`)),f===m?g.push(`${i}=${f?.toString()}`):(g.push(`${i}>=${f?.toString()}`),g.push(`${i}<=${m?.toString()}`)),a=te(g)}}else a=te([rt({where:ht(r,e[r])}),i!==void 0?rt({where:ht(i,e[i])}):""]);return a}function Hs(t){let{fieldsIndex:e,fieldName:r,inputDate:i}=t,n=e.get(r),a=e.getTimeZone(r);return Cc(new Date(i),{type:"date"},{type:n,timeZone:a})}function Do(t){let{xAxisField:e,xAxisFieldType:r,timeAggregationType:i=oe.Start,dataContext:n,queryObject:a}=t,s="",o=n[F.originalServerBinningRange]??n[F.dateBinningRange];if(Lr(o)&&o.length===2){let[l,u]=o,c=!0,d=gt(a);if(d){let f=J(a),{fieldsIndex:m}=f;l=Hs({fieldsIndex:m,fieldName:e,inputDate:l}),u=Hs({fieldsIndex:m,fieldName:e,inputDate:u})}else typeof l=="number"&&typeof u=="number"?Number.isFinite(l)&&Number.isFinite(u)?(l=rr(l),u=rr(u)):c=!1:r!==K.TimeOnly&&typeof l=="string"&&typeof u=="string"&&(l=new Date(l).toISOString(),u=new Date(u).toISOString());if(c){let f=d?"":"'",m="",g="";i===oe.Start?(g=">=",m=n[F.lastTemporalBin]===!0?"<=":"<"):(g=n[F.firstTemporalBin]===!0?">=":">",m="<="),s=`${e}${g}${f}${l}${f} AND ${e}${m}${f}${u}${f}`}}return s}function Po(t,e){let r="";if(Number.isFinite(t)){let i=1/10**F.queryMaxFloatPrecision;r=`${e}>=${t-i} AND ${e}<=${t+i}`}return r}function ko(t){let{xAxisField:e,yAxisField:r,splitBy:i,dataContext:n,xAxisFieldType:a,chartConfig:s}=t,o="";if(e!==void 0&&e!==F.boxPlot.boxPlotCategory){let c=Pn({value:n[e],dataContext:n});a===K.Double?o=Po(c,e):(mo(s.axes?.[0].valueFormat)&&(c=rr(c)),o=rt({where:ht(e,c),normalize:!1,escape:!0}))}let l=rt({where:i??"",normalize:!1,escape:!0}),u="";if(yd(s)){let c=H(s.series)===S.BoxPlotC4MultiFieldsAndCategory?r:void 0,d=ce({key:P.Min,showOutliers:!0,splitBy:i,y:c}),f=ce({key:P.Max,showOutliers:!0,splitBy:i,y:c}),m=e===F.boxPlot.boxPlotCategory?n[e]:r;if(!le(m)){let g=n[d],h=n[f];Number.isFinite(g)&&Number.isFinite(h)&&(u=`${m?.toString()}>=${g?.toString()} AND ${m?.toString()}<=${h?.toString()}`)}}return te([o,l,u])}function Cf(t){let{xAxisField:e,splitBy:r,dataContext:i,xAxisFieldType:n,chartConfig:a,queryObject:s}=t,o="";if(F.dateBinningRange in i)o=Do({xAxisField:e,xAxisFieldType:n,timeAggregationType:wo(a),dataContext:i,queryObject:s});else if(H(a.series)!==S.BarAndLineFromFields){let u=Pn({value:i[e],dataContext:i});n===K.Double?o=Po(u,e):(mo(a.axes?.[0].valueFormat)&&n!==K.TimeOnly&&(u=rr(u)),o=rt({where:ht(e,u),normalize:!1,escape:!0}))}let l=rt({where:r??"",normalize:!1,escape:!0});return te([o,l])}function Ff(t){let{xAxisField:e,dataContext:r,chartConfig:i}=t,n=r[F.originalXValue];return n===void 0&&(n=r[e]),H(i.series)===S.PieFromFields?"":rt({where:ht(e,n),normalize:!1,escape:!0})}function Gs(t){let{field:e,fieldType:r,fieldValue:i,unit:n,outTimeZone:a,dataTimeZone:s,runsOnClientQueryEngine:o}=t,l,{expression:u}=Bn({field:e,fieldType:r,unit:n,addIntervalStatement:!0,outTimeZone:a,dataTimeZone:s,runsOnClientQueryEngine:o});return u&&(l=`${u}=${i}`),l}function xf(t){let{xAxisFieldType:e,yAxisFieldType:r,dataContext:i,chartConfig:n,outTimeZone:a,dataTimeZone:s,runsOnClientQueryEngine:o}=t,l=n.series[0],u="";if(l.type===p.HeatSeries){let c,d,f=i[_.xField],m=i[F.originalXValue],g=i[_.yField],h=i[F.originalYCategoryValue],y=n.axes?.[0]?.valueFormat?.type,b=n.axes?.[1]?.valueFormat?.type;y===p.CategoryAxisFormat?c=rt({where:ht(l.x,m??f),normalize:!1,escape:!0}):c=Gs({field:l.x,fieldType:e,fieldValue:f,unit:l.xTemporalBinning?.unit,outTimeZone:a,dataTimeZone:s,runsOnClientQueryEngine:o}),b===p.CategoryAxisFormat?d=rt({where:ht(l.y,h??g),normalize:!1,escape:!0}):d=Gs({field:l.y,fieldType:r,fieldValue:g,unit:l.yTemporalBinning?.unit,outTimeZone:a,dataTimeZone:s,runsOnClientQueryEngine:o}),c&&(u=c),d&&(u=te([u,d]))}return u}function wf(t){let{xAxisField:e,dataContext:r,chartConfig:i}=t,n="",a=i.series[0],{minValue:s,maxValue:o}=r;if(Number.isFinite(s)&&Number.isFinite(o)&&a.type===p.HistogramSeries){let l=dg(e,a.dataTransformationType),u=r.isLastBin?"<=":"<";n=te([`${l}>=${s?.toString()}`,`${l}${u}${o?.toString()}`])}return n}function F0(t){let{chartConfig:e}=t,r=j(e.series),i="";switch(r){case p.ScatterSeries:i=vf(t);break;case p.HeatSeries:i=xf(t);break;case p.RadarSeries:case p.BarSeries:case p.LineSeries:case p.ComboLineAndBarSeries:i=Cf(t);break;case p.BoxPlotSeries:i=ko(t);break;case p.HistogramSeries:i=wf(t);break;case p.PieSeries:i=Ff(t);break}return i}async function Tf(t){let{queryObject:e,queryConfig:r,chartConfig:i,currentSelectionItems:n,setTimeBinningInfoWhenNotProvided:a,returnFeaturesExtent:s,returnStatisticsAggregatedIds:o,chartLimits:l,popupTemplateFieldInfosEnabled:u,hideZeroCountCategories:c,replaceNoValueCategoryWithZero:d,view:f,errorStrings:m,abortKey:g,abortSignal:h}=t,y=H(i.series),b={valid:!0,data:{dataItems:[]}};if(n!==void 0&&n.length>0){let x=pt(i),{x:w}=x,C="y"in x?x.y:"",v=je(e).find(A=>A.name===w)?.type,T=[],O=n.reduce((A,D)=>{let E=[];if(W.uniqueIds in D)T.push(D[W.uniqueIds]);else{switch(y){case S.BoxPlotC5MonoFieldAndSplitBy:case S.BoxPlotC6MultiFieldsAndSplitBy:case S.BoxPlotC7MonoFieldAndCategoryAndSplitBy:{let $=de(x.query?.where??""),G=`_${P.Average}`;Object.keys(D).forEach(k=>{if(k.includes(G)){let Y=k.replace(G,"");Y.trim()!==""&&E.push(ht($,Y))}});break}}let M=[C].flat(),V=M.length===1?M[0]:"";if(y===S.BoxPlotC4MultiFieldsAndCategory){let $=`_${P.FirstQuartile}`,G=Object.keys(D).find(k=>k.includes($));G!==void 0&&(V=G.replace($,""))}E.length===0&&E.push(""),E.forEach($=>{let G=ko({chartConfig:i,xAxisField:w,yAxisField:V,splitBy:$,dataContext:D,xAxisFieldType:v});A.push(G)})}return A},[]),I=J(e);if(I!==void 0&&T.length>0){let A=He(I).idField;O.push(`${A} IN (${T.join(",")})`)}let B=O.join(" OR "),N={...r};N.where=te([N.where,B]),b=await Mn({queryObject:e,chartConfig:i,queryConfig:N,setTimeBinningInfoWhenNotProvided:a,returnFeaturesExtent:s,returnStatisticsAggregatedIds:o,chartLimits:l,popupTemplateFieldInfosEnabled:u,hideZeroCountCategories:c,replaceNoValueCategoryWithZero:d,view:f,errorStrings:m,abortKey:g,abortSignal:h})}return b}async function Nf(t){let{queryObject:e,queryConfig:r,chartConfig:i,currentSelectionItems:n,dataForFilterBySelectionChanged:a,selectionData:s,setTimeBinningInfoWhenNotProvided:o,returnFeaturesExtent:l,returnStatisticsAggregatedIds:u,chartLimits:c,popupTemplateFieldInfosEnabled:d,hideZeroCountCategories:f,replaceNoValueCategoryWithZero:m,view:g,errorStrings:h,abortKey:y,abortSignal:b}=t;Vt(e);let{series:x}=i,w=j(x),C=We(i),v={valid:!0},T=s?.selectionItems??[];a||(T=gf({chartConfig:i,currentSelectionItems:n,selectionData:s}));let O=!1;switch(w){case p.HeatSeries:v.data={dataItems:T};break;case p.PieSeries:if(H(i.series)===S.PieFromFields){let{x:I,y:B}=i.series[0],N=Ye(T);N.forEach(A=>{I in A&&(A[Fe]=A[I],delete A[I]),B in A&&(A[Ue]=A[B],delete A[B])}),v.data={dataItems:N}}else v.data={dataItems:T};v.count=T.length,O=!0;break;case p.BoxPlotSeries:be(i)&&(v=await Tf({queryObject:e,queryConfig:r,chartConfig:i,currentSelectionItems:n,setTimeBinningInfoWhenNotProvided:o,returnFeaturesExtent:l,returnStatisticsAggregatedIds:u,chartLimits:c,popupTemplateFieldInfosEnabled:d,hideZeroCountCategories:f,replaceNoValueCategoryWithZero:m,view:g,errorStrings:h,abortKey:y,abortSignal:b}));break;case p.BarSeries:case p.ComboLineAndBarSeries:case p.RadarSeries:case p.LineSeries:if(T.length===0||!it({xAxisValueFormatType:C,setTimeBinningInfoWhenNotProvided:o,seriesConfig:x[0],queryObject:e}))v.data={dataItems:T},v.count=T.length*x.length,O=!0;else{let I={...r};if(n!==void 0&&n.length>0){let B=wo(i),N=n.map(D=>Do({xAxisField:x[0].x,dataContext:D,timeAggregationType:B,queryObject:e})),A=te(N,"OR");I.where=te([I.where,A])}v=await Ln({queryObject:e,queryConfig:I,chartConfig:i,errorStrings:h,setTimeBinningInfoWhenNotProvided:o,returnFeaturesExtent:l,returnStatisticsAggregatedIds:u,chartLimits:c,popupTemplateFieldInfosEnabled:d,view:g,abortSignal:b})}break;case p.HistogramSeries:{if(T.length===0)v.data={mean:Number.NaN,median:Number.NaN,stddev:Number.NaN,max:Number.NaN,min:Number.NaN,bins:[]},v.count=0;else{let{x:I}=x[0],B=T.map((D,E)=>{let{minValue:M,maxValue:V}=D,$=E===T.length-1?"<=":"<";return`${I} >= ${M} AND ${I} ${$} ${V}`}),N=te(B,"OR"),A={...r};A.where=te([A.where,N]),v=await Bo({queryObject:e,chartConfig:i,queryConfig:A,view:g,errorStrings:h,abortKey:y,abortSignal:b})}break}case p.ScatterSeries:{if(T.length===0){let{r2:I,trendLinePoints:B}=F.scatterplotSeries;v.data={dataItems:[],r2:I,trendLinePoints:B,count:0},v.count=0}else{let{r2:I,trendLinePoints:B}=Co({data:T,chartConfig:i});v.data={dataItems:T,r2:I,trendLinePoints:B},v.count=T.length}break}}return O&&v.data!==void 0&&ci({arrayToSort:"dataItems"in v.data?v.data.dataItems:v.data,chartConfig:i}),v}async function Mn(t){let{queryObject:e,chartConfig:r,queryConfig:i,errorStrings:n,abortKey:a,abortSignal:s,setTimeBinningInfoWhenNotProvided:o,returnFeaturesExtent:l,returnStatisticsAggregatedIds:u,chartLimits:c,popupTemplateFieldInfosEnabled:d,hideZeroCountCategories:f,replaceNoValueCategoryWithZero:m,view:g}=t,h={valid:!0},y=Mt(r),b=await Fn({queryObject:e,queryConfig:i,fetchFullBoxPlotData:!y,chartConfig:r,errorStrings:n,abortKey:a,abortSignal:s,setTimeBinningInfoWhenNotProvided:o,returnFeaturesExtent:l,returnStatisticsAggregatedIds:u,chartLimits:c,popupTemplateFieldInfosEnabled:d,hideZeroCountCategories:f,replaceNoValueCategoryWithZero:m,view:g});if(!y)h=b;else{let x={dataItems:[]};x.meanLines=b.data.dataItems;let w=zd(r),C=(await Fn({queryObject:e,queryConfig:i,fetchFullBoxPlotData:!0,setTimeBinningInfoWhenNotProvided:o,returnFeaturesExtent:l,returnStatisticsAggregatedIds:u,chartLimits:c,popupTemplateFieldInfosEnabled:d,hideZeroCountCategories:f,replaceNoValueCategoryWithZero:m,view:g,errorStrings:n,chartConfig:w,abortKey:a,abortSignal:s})).data;x.dataItems=C.dataItems,x.outliers=C.outliers,h.data=x}return h}async function x0(t){let{queryObject:e,chartConfig:r,abortKey:i,abortSignal:n,currentSelectionItems:a,dataForFilterBySelectionChanged:s,filterByViewExtent:o,runtimeDataFilters:l,ignoreViewExtent:u,filterBySelection:c,selectionData:d,setTimeBinningInfoWhenNotProvided:f,returnFeaturesExtent:m,returnStatisticsAggregatedIds:g,chartLimits:h,popupTemplateFieldInfosEnabled:y,hideZeroCountCategories:b,replaceNoValueCategoryWithZero:x,view:w,syncViewTimeZone:C,errorStrings:v,fieldList:T,preFetchedQueryResponse:O}=t,{series:I}=r,B={valid:!0},N=j(I),A=al({queryObject:e,chartConfig:r,runtimeDataFilters:l,filterByViewExtent:o,ignoreViewExtent:u,view:w});if($c(i),c)B=await Nf({queryObject:e,queryConfig:A,chartConfig:r,currentSelectionItems:a,dataForFilterBySelectionChanged:s,selectionData:d,setTimeBinningInfoWhenNotProvided:f,returnFeaturesExtent:m,returnStatisticsAggregatedIds:g,chartLimits:h,popupTemplateFieldInfosEnabled:y,hideZeroCountCategories:b,replaceNoValueCategoryWithZero:x,view:w,errorStrings:v,abortKey:i,abortSignal:n});else switch(N){case p.HeatSeries:Vt(e),B=await zo({chartConfig:r,queryConfig:A,queryObject:e,errorStrings:v,returnFeaturesExtent:m,returnStatisticsAggregatedIds:g,chartLimits:h,popupTemplateFieldInfosEnabled:y,view:w,syncViewTimeZone:C,abortKey:i,abortSignal:n});break;case p.BoxPlotSeries:be(r)&&(B=await Mn({queryObject:e,chartConfig:r,queryConfig:A,setTimeBinningInfoWhenNotProvided:f,returnFeaturesExtent:m,returnStatisticsAggregatedIds:g,chartLimits:h,popupTemplateFieldInfosEnabled:y,hideZeroCountCategories:b,replaceNoValueCategoryWithZero:x,view:w,errorStrings:v,abortKey:i,abortSignal:n}));break;case p.BarSeries:case p.ComboLineAndBarSeries:case p.PieSeries:case p.RadarSeries:case p.LineSeries:{let D={queryObject:e,queryConfig:A,chartConfig:r,filterByViewExtent:o,errorStrings:v,setTimeBinningInfoWhenNotProvided:f,returnFeaturesExtent:m,returnStatisticsAggregatedIds:g,chartLimits:h,popupTemplateFieldInfosEnabled:y,hideZeroCountCategories:b,replaceNoValueCategoryWithZero:x,view:w,abortKey:i,abortSignal:n,fieldList:T,preFetchedQueryResponse:O};it({xAxisValueFormatType:We(r),setTimeBinningInfoWhenNotProvided:f,seriesConfig:I[0],queryObject:e})?B=await Ln(D):B=await Fn(D);break}case p.ScatterSeries:B.data=await Uo({queryObject:e,queryConfig:A,filterByViewExtent:o,setTimeBinningInfoWhenNotProvided:f,returnFeaturesExtent:m,returnStatisticsAggregatedIds:g,chartLimits:h,popupTemplateFieldInfosEnabled:y,hideZeroCountCategories:b,replaceNoValueCategoryWithZero:x,view:w,chartConfig:r,errorStrings:v,abortKey:i,abortSignal:n});break;case p.HistogramSeries:B=await Bo({queryObject:e,queryConfig:A,chartConfig:r,filterByViewExtent:o,ignoreViewExtent:u,view:w,abortKey:i,abortSignal:n,errorStrings:v});break;case p.GaugeSeries:Vt(e),B=await yf({queryObject:e,chartConfig:r,queryConfig:A,chartLimits:h,errorStrings:v,abortKey:i,abortSignal:n});break}return B.queryConfig=A,B}function Of(t,e,r){let i=new Map;for(let n=0;n<t.length;n+=1){let a={[r]:t[n]};F.xAxisField in a||(a[F.xAxisField]=t[n]),i.set(t[n],a)}for(let n=0;n<e.length;n+=1){let a=e[n][r];(typeof a=="string"||typeof a=="number")&&i.set(a,e[n])}return[...i.values()]}async function Bf(t){let{seriesData:e,chartConfig:r,queryConfig:i,queryObject:n,categoryOrDateCount:a,behaviorAfterLimit:s,errorStrings:o,abortKey:l,abortSignal:u}=t,{series:c}=r,d=e,f=H(c),m=We(r);if(s!==st.RenderUpToTheLimit&&a!==void 0&&a>e.length&&f!==S.BarAndLineFromFields&&f!==S.BarAndLineNoAggregation&&f!==S.PieNoAggregation&&m===p.CategoryAxisFormat){let{x:g}=c[0],h={...i,returnDistinctValues:!0,outFields:[g]};delete h.outStatistics,delete h.orderByFields,delete h.groupByFieldsForStatistics;let y=(await De({queryObject:n,queryConfig:h,featureCount:a,returnStatisticsAggregatedIds:!1,errorStrings:o,abortKey:l,abortSignal:u})).map(b=>b.attributes[g]).filter(b=>b!=null);y.length>e.length&&(d=Of(y,e,g))}return d}function If(t,e){let r=t,{series:i}=e;if(We(e)===p.CategoryAxisFormat&&i[0].query?.outStatistics?.[0].statisticType===L.Count){let n=i.reduce((a,s)=>{let o=s.query?.outStatistics?.[0].outStatisticFieldName??[s.y].flat()[0];return a[o]=0,a},{});for(let a=0;a<t.length;a+=1)t[a]={...n,...t[a]}}return r}var Ys=[{unit:U.Second,threshold:6e4,unitMs:1e3,preferredIntervalSize:[1,2,3,5,6,10,12,15,20,30,60]},{unit:U.Minute,threshold:36e5,unitMs:1e3*60,preferredIntervalSize:[1,2,3,5,6,10,12,15,20,30,60]},{unit:U.Hour,threshold:864e5,unitMs:1e3*60*60,preferredIntervalSize:[1,2,3,4,6,8,12,24]},{unit:U.Day,threshold:6048e5,unitMs:1e3*60*60*24,preferredIntervalSize:[1,2,3,4,5,6,7]},{unit:U.Week,threshold:24192e5,unitMs:1e3*60*60*24*7,preferredIntervalSize:[1,2,3,4]},{unit:U.Month,threshold:290304e5,unitMs:1e3*60*60*24*7*4,preferredIntervalSize:[1,2,3,4,6,12]},{unit:U.Year,threshold:Number.MAX_SAFE_INTEGER,unitMs:1e3*60*60*24*7*4*12,preferredIntervalSize:[1,2,4,5,10,25,50,100]}],Af="{ groupByFieldsForStatistics } WHEN { dateField }>='{ startDate }' AND { dateField }{ endDateOperand }'{ endDate }' THEN '{ y }|{ binIndex}'";function Vo(t,e){let r=t;return e===U.Week?r/=7:e===U.Month?r/=30:e===U.Year&&(r/=365),r=Math.ceil(r),r}function yt(t){let{date:e,unit:r,nextOrPrevious:i,size:n}=t;if(n!==void 0&&Number.isFinite(n)){let a=i==="next"?n:-n;switch(r){case U.Second:return Q.fromMillis(e).plus({seconds:a}).valueOf();case U.Minute:return Q.fromMillis(e).plus({minutes:a}).valueOf();case U.Hour:return Q.fromMillis(e).plus({hours:a}).valueOf();case U.Week:case U.Day:return Q.fromMillis(e).plus({days:a}).valueOf();case U.Month:return Q.fromMillis(e).plus({months:a}).valueOf();case U.Year:return Q.fromMillis(e).plus({years:a}).valueOf()}}return e}function Mf(t){let{binFirstOrLastIndex:e,data:r,x:i,timeIntervalInfo:n}=t,{unit:a,size:s}=n,o=a===U.Week?(s??1)*7:s,l=r[e][i],u=e,c=yt({date:l,unit:a,size:o,nextOrPrevious:"next"}),d=r[u][i];for(;u+1<r.length&&d<c;)u+=1,d=r[u]?.[i];let f=u+1>=r.length,m=u;f&&r[m]!==void 0&&(m+=1);let g=f?yt({date:l,unit:a,size:o,nextOrPrevious:"next"}):r[u][i];return{binStartDate:l,binEndDate:g,last:f,nextBinFirstOrLastIndex:u,sliceStartIndex:e,sliceEndIndex:m}}function Ef(t){let{binFirstOrLastIndex:e,data:r,x:i,timeIntervalInfo:n}=t,{unit:a,size:s}=n,o=a===U.Week?(s??1)*7:s,l=r[e][i],u=e,c=yt({date:l,unit:a,size:o,nextOrPrevious:"previous"}),d=r[u][i];for(;u-1>=0&&d>c;)u-=1,d=r[u]?.[i];let f=u-1<=0,m=e;return f&&r[m]!==void 0&&(m-=1),f&&(u=0),{binStartDate:f?yt({date:l,unit:a,size:o,nextOrPrevious:"previous"}):r[u][i],binEndDate:l,nextBinFirstOrLastIndex:u,sliceStartIndex:u,sliceEndIndex:m,last:f}}function Lf(t){let{binsToRegroup:e,statisticType:r,y:i,nullPolicy:n}=t,a;n!==we.Interpolate&&(a=n===we.Zero?0:null);let s=e.filter(o=>Number.isFinite(o[i]));if(s.length>0)switch(r){case L.Count:case L.Sum:a=ad(s,o=>o[i]);break;case L.Minimum:a=Sr(s,o=>o[i]).min;break;case L.Maximum:a=Sr(s,o=>o[i]).max;break;case L.Average:a=nd(s,o=>o[i]);break;case L.ContinuousPercentile:}return a}function qf(t){let{data:e,seriesConfig:r,timeIntervalInfo:i,dateMinTimestamp:n,dateMaxTimestamp:a}=t,s=[],{unit:o}=i,l=i.size??1,u=r[0],{x:c}=u,d,f;if(Re(u)&&(f=u.temporalBinning?.nullPolicy,d=u.temporalBinning?.timeAggregationType),l>1||o===U.Week||o===U.Month||o===U.Year){let{query:m}=r[0],g=he(r),{statisticType:h}=m?.outStatistics?.[0]??xi,y=!1,b=d===oe.End?e.length-1:0,x={binFirstOrLastIndex:b,data:e,x:c,timeIntervalInfo:i};for(;!y;){let w={},{binStartDate:C,binEndDate:v,last:T,nextBinFirstOrLastIndex:O,sliceStartIndex:I,sliceEndIndex:B}=d===oe.End?Ef(x):Mf(x);if(y=T,w=d===oe.End?w=e[B-1]:w=e[b],v>a&&C<a||C<n&&v>n||C>=n&&v<=a){let N=e.slice(I,B).filter(E=>!(F.dateBinModel in E));g.forEach(E=>{w[E]=Lf({binsToRegroup:N,statisticType:h,y:E,nullPolicy:f})});let A=N.map(E=>E[Ke]).filter(E=>E!==void 0),D=lg(A);D!==void 0&&(w[Ke]=D),w[c]=C,w[F.xAxisField]=C,w[F.dateBinningRange]=[C,v],delete w[F.dateBinModel],s.push(w)}else T&&d!==oe.End&&s.length>0&&(s[s.length-1][F.dateBinningRange][1]=s[s.length-1][F.dateBinningRange][1]+1);b=O,x.binFirstOrLastIndex=O}d===oe.End&&(s=s.reverse())}else l===1?s=e.map((m,g)=>{let h=m[c],y=e[g+1]?.[c];return y=typeof y=="number"?y-1:yt({date:h,unit:o,size:l,nextOrPrevious:"next"}),{...m,[F.dateBinningRange]:[h,y]}}):s=e;return s}function $o(t){let{dateMinTimestamp:e,dateMaxTimestamp:r,timeIntervalInfo:i}=t,{size:n,unit:a}=i,s=0,o=0;if(n!==void 0&&Number.isFinite(n)&&Number.isFinite(e)&&Number.isFinite(r)){let l=-1,u=Q.fromMillis(e),c=Q.fromMillis(r);switch(a){case U.Second:l=c.diff(u,"seconds").get("seconds");break;case U.Minute:l=c.diff(u,"minutes").get("minutes");break;case U.Hour:l=c.diff(u,"hours").get("hours");break;case U.Day:case U.Month:case U.Year:l=c.diff(u,"days").get("days");break;case U.Week:l=c.diff(u,"weeks").get("weeks");break}Number.isFinite(l)&&(o=Math.ceil(l)+1,s=n===1?o:Math.ceil(o/n))}return{numberOfFinalBinsWithinDataRange:s,numberOfSingleBinsWithinDataRange:o}}function Ro(t){let e=t[0].temporalBinning?.nullPolicy;return t.reduce((r,i)=>{r[F.dateBinModel]=void 0;let n=i.query?.outStatistics?.[0].outStatisticFieldName??[i.y].flat()[0];return e!==we.Interpolate&&(r[n]=e===we.Zero?0:null),r},{})}function Df(t){let{dateMaxTimestamp:e,numberOfFinalBinsWithinDataRange:r,numberOfSingleBinsWithinDataRange:i,data:n,seriesConfig:a,timeIntervalInfo:s}=t,{size:o,unit:l}=s,{x:u}=a[0],c=a[0].temporalBinning?.timeAggregationType,d=n[0][u],f=e;if(o!==void 0&&Number.isFinite(o)&&i/r!==o){let m=Math.ceil(i/r)*r-i;l===U.Week&&(m*=7);let g=Ro(a);if(c===oe.End){let h=n[0][u];for(let y=0;y<m;y+=1)h=yt({date:h,unit:l,size:1,nextOrPrevious:"previous"}),n.push({...g,[u]:h,[F.xAxisField]:h});m>0&&(d=n[n.length-1][u])}else{let h=n[n.length-1][u];for(let y=0;y<m;y+=1)h=yt({date:h,unit:l,size:1,nextOrPrevious:"next"}),n.push({...g,[u]:h,[F.xAxisField]:h});f=n[n.length-1][u]}}return{newDateMin:d,newDateMax:f}}function Pf(t){let{numberOfSingleBinsWithinDataRange:e,dataLength:r,unit:i}=t;return Vo(r,i)>=e}async function kf(t){let{queryObject:e,queryConfig:r,x:i,xFieldType:n,errorStrings:a,abortSignal:s}=t,o=`MIN_${i}`,l=`MAX_${i}`,u=`COUNT_${i}`,c={...r,outStatistics:[{statisticType:L.Minimum,onStatisticField:i,outStatisticFieldName:o},{statisticType:L.Maximum,onStatisticField:i,outStatisticFieldName:l},{statisticType:L.Count,onStatisticField:i,outStatisticFieldName:u}]};delete c.groupByFieldsForStatistics,delete c.orderByFields;let d=await wr({queryObject:e,queryConfig:c,errorStrings:a,abortSignal:s}),f=d.get(o),m=d.get(l),g=d.get(u);return typeof f=="string"&&(f=n===K.TimeOnly?di(f)??0:new Date(f).valueOf()),typeof m=="string"&&(m=n===K.TimeOnly?di(m)??0:new Date(m).valueOf()),{dateRange:{dateMinTimestamp:f,dateMaxTimestamp:m},numberOfFeatures:g}}function Vf(t){let{newDateMin:e,newDateMax:r,seriesConfig:i,data:n,numberOfSingleBinsWithinDataRange:a,initialNumberOfBins:s,timeIntervalInfo:o}=t,{unit:l}=o,u=n;if(!Pf({numberOfSingleBinsWithinDataRange:a,dataLength:s,unit:l})){let{x:c}=i[0],d=i[0].temporalBinning?.timeAggregationType,f=Ro(i),m=d===oe.End?r:e,g=d===oe.End?n.length-1:0;for(;g<n.length&&(d===oe.End&&m>e||d!==oe.End&&m<r);)m!==n[g][c]?u.push({...f,[c]:m,[F.xAxisField]:m}):g=d===oe.End?g-1:g+1,m=yt({date:m,unit:l===U.Month||l===U.Year?U.Day:l,size:1,nextOrPrevious:d===oe.End?"previous":"next"})}return u}function $f(t){let{data:e,seriesConfig:r,dateMinTimestamp:i,dateMaxTimestamp:n}=t,a=e;if(r[0].temporalBinning?.trimIncompleteTimeInterval!==!1){let{timeAggregationType:s}=r[0].temporalBinning??{},o=e[0]?.[F.dateBinningRange]?.[0],l=e[e.length-1]?.[F.dateBinningRange]?.[1];if(s===oe.End?o<i:l>n)if(s===oe.End){let u=o;for(;u<i&&e.length>0;)e.shift(),e.length>0&&(u=e[0][F.dateBinningRange]?.[0])}else{let u=l;for(;u>n&&e.length>0;)e.pop(),e.length>0&&(u=e[e.length-1][F.dateBinningRange]?.[1])}}return a}function Rf(t){let{groupByFieldsForStatistics:e,dateField:r,queryStartDate:i,queryEndDate:n,y:a,binIndex:s,lastBin:o}=t,l=e===""?Et.groupByCaseBegin:e;return l=$e(Af,{groupByFieldsForStatistics:l,dateField:r,startDate:`${i}`,endDate:`${n}`,y:[a].flat()[0],binIndex:`${s}`,endDateOperand:o?"<=":"<"}),l}function*Wf(t){let{queryObject:e,seriesConfig:r,queryConfig:i,completeData:n,errorStrings:a,abortSignal:s}=t;for(let o=0;o<r.length;o+=1){let l=r[o],{query:u,x:c,y:d}=l,f=[{onStatisticField:u?.outStatistics?.[0]?.onStatisticField??"",outStatisticFieldName:L.ContinuousPercentile,statisticType:L.ContinuousPercentile,statisticParameters:{value:.5}}],m=Et.groupByCaseBegin;for(let h=0;h<n.length;h+=1){let y=n[h],[b,x]=y[F.dateBinningRange],w=rr(b),C=rr(x);m=Rf({groupByFieldsForStatistics:m,queryStartDate:w,queryEndDate:C,dateField:c,y:[d].flat()[0],binIndex:h,lastBin:h===n.length-1})}m=`${m} ${Et.groupByCaseEnd}`;let g={...i,groupByFieldsForStatistics:[m],outStatistics:f,orderByFields:void 0};yield De({queryObject:e,queryConfig:g,noBatch:!0,returnStatisticsAggregatedIds:!1,errorStrings:a,abortSignal:s})}}async function jf(t){let{queryObject:e,data:r,seriesConfig:i,queryConfig:n,errorStrings:a,abortSignal:s}=t,o=r,{statisticType:l}=i[0].query?.outStatistics?.[0]??xi;if(l===L.ContinuousPercentile&&o.length>0){let u=Wf({queryObject:e,completeData:o,seriesConfig:i,queryConfig:n,errorStrings:a,abortSignal:s}),c=(await Promise.all(u)).flat();if(c.length>0){let{isInItem:d,expr:f}=or(c[0].attributes);d&&c.forEach(m=>{let g=m.attributes[`${f}`];if(g!==void 0){let[h,y]=g.split("|");if(y!==void 0){let b=m.attributes[L.ContinuousPercentile];o[y][`${h}`]=b}}})}}return o}function Qs(t){let{dataItem:e,nullPolicy:r,statField:i}=t;if(i&&e[i]==null)switch(!0){case r===we.Zero:e[i]=0;break;case r===we.Null:e[i]=null;break;case r===we.Interpolate:delete e[i];break}}function Js(t,e){let r=t;if(e===K.TimeOnly&&typeof t=="string")r=di(t);else if(e===K.DateOnly&&(typeof t=="string"&&t.length===10||typeof t=="number"))if(typeof t=="string"){let i=t.split("-");i.length===3&&(r=Q.local(Number(i[0]),Number(i[1]),Number(i[2])).valueOf())}else r=new Date(t),r=new Date(r.valueOf()+r.getTimezoneOffset()*6e4),r=Q.local(r.getFullYear(),r.getMonth()+1,r.getDate()).valueOf();else typeof t=="string"&&["+","-"].forEach(i=>{i&&t.lastIndexOf(i)===t.length-6&&(r=new Date(t.slice(0,t.lastIndexOf(i))).valueOf())});return r}function Zf(t){let{chartConfig:e,queryResults:r,mapToStatField:i,splitByField:n,x:a,y:s,nullPolicy:o,queryObject:l}=t,u=bo(a),c=je(l).find(y=>y.name===a)?.type,d=[],f=e.series[0],m="temporalBinning"in f?f.temporalBinning?.trimIncompleteTimeInterval:!1,g="temporalBinning"in f?f.temporalBinning?.timeAggregationType:!1,h=!1;return r.forEach((y,b)=>{if(m&&(b===0&&g===oe.End||b===r.length-1&&g===oe.Start))h=!0;else{let{attributes:x,stackedAttributes:w,statisticsAggregatedIds:C}=y,v=x[u.lowerBoundaryAlias],T=x[u.upperBoundaryAlias],O=v,I=T;if(v=Js(v,c),T=Js(T,c),typeof v=="number"&&typeof T=="number"){let B={...x};B[F.originalServerBinningRange]=[O,I],B[a]=v,B[F.xAxisField]=v,B[F.dateBinningRange]=[v,T],C&&C.length!==Tr&&(B[W.uniqueIds]=C),delete B[u.lowerBoundaryAlias],delete B[u.upperBoundaryAlias],w&&n&&!le(n)&&i?w.forEach(D=>{let E=D[n];if(E===null||typeof E=="string"||typeof E=="number"){let M=i?.get(E);M!==void 0&&(B[M]=D[W.outStatistics?.outStatisticFieldName??""],"aggregateIds"in D&&Array.isArray(D.aggregateIds)&&D.aggregateIds.length>0&&(B[`${W.uniqueIds}_${M}`]=D.aggregateIds),Qs({dataItem:B,statField:M,nullPolicy:o}))}}):typeof s=="string"&&Qs({dataItem:B,statField:s,nullPolicy:o});let{featureExtent:N,featureExtentKey:A}=Wo({feature:y,splitByField:n});N&&(B[A]=N),d.push(B)}}}),d&&d.length>0&&!h&&(d[0][F.firstTemporalBin]=!0,d[d.length-1][F.lastTemporalBin]=!0),{data:d,firstOrLastWasSkipped:h}}async function _f(t){let{queryObject:e,queryResults:r,x:i,queryConfig:n,seriesConfig:a,dateRange:s,timeIntervalInfo:o,errorStrings:l,abortSignal:u}=t,c=r,{dateMinTimestamp:d,dateMaxTimestamp:f}=s;if(d&&f){let m=r.length;if(vr({arrayToSort:c,sortingField:i}),m>1){let{numberOfFinalBinsWithinDataRange:g,numberOfSingleBinsWithinDataRange:h}=$o({dateMinTimestamp:d,dateMaxTimestamp:f,timeIntervalInfo:o}),{newDateMin:y,newDateMax:b}=Df({dateMaxTimestamp:f,data:c,numberOfFinalBinsWithinDataRange:g,numberOfSingleBinsWithinDataRange:h,seriesConfig:a,timeIntervalInfo:o});c=Vf({newDateMin:y,newDateMax:b,seriesConfig:a,data:c,initialNumberOfBins:m,numberOfSingleBinsWithinDataRange:h,timeIntervalInfo:o}),vr({arrayToSort:c,sortingField:i}),c=qf({data:c,seriesConfig:a,dateMinTimestamp:d,dateMaxTimestamp:f,timeIntervalInfo:o}),c=$f({data:c,seriesConfig:a,dateMinTimestamp:d,dateMaxTimestamp:f}),e&&(c=await jf({queryObject:e,data:c,seriesConfig:a,queryConfig:n,errorStrings:l,abortSignal:u}))}}return c}function zf(t){return Math.floor(Math.min(Math.max(8,Math.sqrt(t??8)),128)+.5)}function Uf(t){let{dateRange:e,numberOfFeatures:r}=t,i,n,{dateMinTimestamp:a,dateMaxTimestamp:s}=e;if(a&&s){typeof a=="string"&&(a=new Date(a).valueOf()),typeof s=="string"&&(s=new Date(s).valueOf());let o=zf(r),l=(s-a)/o,u=Ys.findIndex(b=>b.threshold>l),c=Ys[u],{unitMs:d,preferredIntervalSize:f}=c;({unit:i}=c);let m=l/d,g=f.findIndex(b=>b>=m),h=f[g],y=g===0?f[0]:f[g-1];n=h-m<m-y?h:y}return{size:n,unit:i}}function Hf(t){let{series:e,isTimeBinningSeries:r,setTimeBinningInfoWhenNotProvided:i}=t,n=!1;if(Re(e)&&r){let{unit:a,size:s}=e.temporalBinning??{};n=!bn(a,s)&&i===!0}return n}function Gf(t){let e=[];for(let r=1;r<=6;r+=1){let i=t[`EXPR_${r}`]??t[`Expr${r}`]??t[`expr${r}`]??t[`EXPR${r}`];i!==null&&e.push(i)}return Q.local(Number(e[0]??1969),Number(e[1]??1),Number(e[2]??1),Number(e[3]??0),Number(e[4]??0),Number(e[5]??0)).valueOf()}function di(t){let e,[r,i,n]=t.split(":");return Number.isFinite(Number(r))&&Number.isFinite(Number(i))&&Number.isFinite(Number(n))&&(e=new Date(2e3,0,1,Number(r),Number(i),Number(n)).valueOf()),e}function Wo(t){let{feature:e,splitByField:r,chartSubType:i}=t,n;if(e.aggregateGeometries&&"Extent"in e.aggregateGeometries)n=e.aggregateGeometries.Extent;else{let o=e.aggregateGeometries??e.geometry;o?.extent&&(n=o.extent)}let a=n?.toJSON(),s=Ke;return a!==void 0&&r!==void 0&&i===S.BarAndLineSplitBy&&(s=e.attributes[r]!==void 0?`${Ke}_${e.attributes[r]}`:Ke),{featureExtent:a,featureExtentKey:s}}function Yf(t,e){let r=t,i=j(e);if(i!==p.PieSeries&&i!==p.BoxPlotSeries){let n=he(e),a=e[0].y;t.forEach(s=>{let o=Qo(s,n);s[F.technicalSortingFieldBySum]=o;let l=s[a];if(typeof l=="number"){let u=Jo(l,o);u!==void 0&&(s[F.technicalSortingFieldByPercent]=u)}})}return r}function Qf(t,e){if(be(t)){let r=he(t.series),i=r.length===1;r.forEach(n=>{let a=Xt(i?void 0:n),s=e[a[P.FirstQuartile]],o=e[a[P.ThirdQuartile]];Number.isFinite(s)&&Number.isFinite(o)&&o>=s&&(e[a[P.IQR]]=o-s)})}}function Jf(t){let{x:e,attributes:r,fieldList:i}=t;typeof r[e]=="string"&&i?.find(n=>n.name===e)?.type===K.TimeOnly&&(r[e]=di(r[e]))}function Kf(t){let{chartType:e,x:r,attributes:i}=t;e===p.PieSeries&&typeof i[r]=="number"&&(i[r]=`${i[r]}`)}function Xf(t){let{attributes:e,x:r,categoryValueFormat:i,isTimeBinningSeries:n,isDateField:a}=t;i||(a&&typeof e[r]=="string"?e[r]=new Date(e[r]).valueOf():n&&(e[r]=Gf(e)))}function em(t){let{chartConfig:e,chartType:r,chartSubType:i,attributes:n,featureIndex:a,x:s}=t;(i===S.BarAndLineNoAggregation||i===S.BarAndLineSplitByNoAggregation)&&Fc({isXAxis:!0,chartType:r,valueFormat:e.axes?.[0]?.valueFormat})?(n[F.xAxisField]=`${n[s]}-${a}`,n[F.xAxisDisplayField]=n[s]):r===p.HeatSeries?n[F.xAxisField]=n[_.xField]:i!==S.BarAndLineFromFields&&i!==S.PieFromFields&&(n[F.xAxisField]=n[s])}function tm(t){let{feature:e,splitByField:r,chartSubType:i,attributes:n}=t,{featureExtent:a,featureExtentKey:s}=Wo({feature:e,splitByField:r,chartSubType:i});a&&(n[s]=a)}function rm(t){let{chartSubType:e,attributes:r,splitByField:i,mapToStatField:n}=t,{outStatisticFieldName:a}=W.outStatistics??{},s=jo(r,i);if(e===S.BarAndLineSplitBy&&a&&s!==void 0){let o=n?.get(s);o!==void 0&&(s===i&&(r[F.technicalFieldSplitByField]=r[o]),r[o]=r[a]),delete r[a]}}function im(t,e){let r=e.series[0];if(r.type===p.HeatSeries){let{x:i,y:n}=r;t[_.xField]=t[i]?.toString(),delete t[i],t[_.yField]=t[n]?.toString(),delete t[n];let a=r.query?.outStatistics?.[0]?.outStatisticFieldName;a&&(t[_.valueField]=t[a],delete t[a])}}function En(t,e){[e].flat().forEach(r=>{r&&(t[r]===void 0&&(t[r.toUpperCase()]!==void 0?(t[r]=t[r.toUpperCase()],delete t[r.toUpperCase()]):t[r.toLowerCase()]!==void 0&&(t[r]=t[r.toLowerCase()],delete t[r.toLowerCase()])),t[r]===void 0&&delete t[r])})}function nm(t,e){let r=[];W.outStatistics.outStatisticFieldName&&(Object.keys(t).includes(W.outStatistics.outStatisticFieldName)||Object.keys(t).includes(W.outStatistics.outStatisticFieldName.toUpperCase()))?r=[W.outStatistics.outStatisticFieldName]:r=Array.from(new Set(e.flatMap(i=>i.query?.outStatistics?.map(n=>n.outStatisticFieldName)))),En(t,r)}function am(t){let{chartSubType:e,dataItem:r,outStatistics:i}=t;(e===S.PieFromFields||e===S.BarAndLineFromFields)&&r!==void 0&&i[0]!==void 0&&Object.keys(r).forEach(n=>{let a=i.find(s=>s.outStatisticFieldName?.toLowerCase()===n.toLowerCase())?.onStatisticField;a!==void 0&&r[n]!==void 0&&a!==n&&(r[a]=r[n],delete r[n])})}function sm(t){let{dataItem:e,splitByField:r,y:i,chartSubType:n,queryObject:a}=t;if(typeof i=="string"&&n===S.BarAndLineSplitByNoAggregation){let s=J(a),{idField:o,isTraditionalTypeOID:l}=He(s),u=l?o:void 0;if(e!==void 0&&!le(r)&&!le(i)){let c=e[r],d=`${i}_${c?.toString()}`;e[d]=e[i],u!==void 0&&i!==u&&delete e[i]}}}function om(t){let{chartSubType:e,attributes:r,y:i}=t;i&&(e===S.BoxPlotC1MonoField||e===S.BoxPlotC3MonoFieldAndCategory||e===S.BoxPlotC5MonoFieldAndSplitBy||e===S.BoxPlotC7MonoFieldAndCategoryAndSplitBy)&&Object.keys(r).forEach(n=>{if(n.startsWith(`${i}_`)){let a=n.slice(i.length+1);r[a]=r[n],delete r[n]}})}function lm(t,e){let r=1;switch(t){case S.BarAndLineFromFields:case S.PieFromFields:r=e.series[0].query?.outStatistics?.length??1;break;case S.BoxPlotC2MultiFields:case S.BoxPlotC6MultiFieldsAndSplitBy:r=e.series[0].y.length;break;case S.BarAndLineNoAggregation:case S.BoxPlotC1MonoField:case S.BoxPlotC3MonoFieldAndCategory:case S.BoxPlotC4MultiFieldsAndCategory:case S.BoxPlotC5MonoFieldAndSplitBy:case S.BoxPlotC7MonoFieldAndCategoryAndSplitBy:case S.PieFromCategory:case S.BarAndLineSplitByNoAggregation:case S.PieNoAggregation:case S.BarAndLineSplitBy:case S.BarAndLineMonoField:case S.BarAndLineMultiFields:case S.NonSpecific:}return r}function um(t){let{attributes:e,showMean:r,chartSubType:i}=t;r&&(i===S.BoxPlotC5MonoFieldAndSplitBy||i===S.BoxPlotC6MultiFieldsAndSplitBy||i===S.BoxPlotC7MonoFieldAndCategoryAndSplitBy)&&(e[F.boxPlot.boxPlotMeanLineMarkerId]=!0)}function cm(t){let{queryResponse:e,chartConfig:r,maxCategoryCount:i}=t,n=H(r.series);return i&&Number.isFinite(i)&&i<e.length&&To.includes(n)?e.slice(0,i):e}function dm(t){let{attributes:e,uniqueCategoryList:r,maxCategoryCount:i,x:n,chartSubType:a}=t,s=!1;if(n&&i&&Number.isFinite(i)&&!To.includes(a))if((a===S.BarAndLineFromFields||a===S.PieFromFields)&&Object.keys(e).length>i)Object.keys(e).filter(o=>o!==L.EnvelopeAggregate).forEach((o,l)=>{l>=i&&delete e[o]});else{let o=e[n];o!==void 0&&(r.size===i&&!r.has(o)?s=!0:r.add(o))}return s}function fm(t){let{attributes:e,x:r,y:i,xFieldDomain:n,yFieldDomain:a,chartType:s,chartSubType:o,xAxisValueFormat:l,yAxisValueFormat:u}=t,c,d;if(o!==S.PieFromFields){let f=e[r],m=typeof i=="string"?i:i?.[0],g=typeof m=="string"?e[m]:void 0;n&&(typeof f=="string"||typeof f=="number")&&(c=Nn(f,n)),a&&s===p.HeatSeries&&(typeof g=="string"||typeof g=="number")&&(d=Nn(g,a)),c!==void 0&&c!==f&&(typeof c!="string"||!oi(l))&&(e[F.originalXValue]=f,e[r]=c,e[F.xAxisDisplayField]=c),typeof i=="string"&&!oi(u)&&d!==void 0&&d!==g&&(e[F.originalYCategoryValue]=e[i],e[i]=d)}}function mm(t){let{attributes:e,statisticsAggregatedIds:r,chartSubType:i,feature:n,splitByField:a,mapToStatField:s}=t,o;if(r)o=r;else if(i===S.PieNoAggregation||i===S.BarAndLineNoAggregation||i===S.BarAndLineSplitByNoAggregation){let l=n.getObjectId();l!=null&&(o=[l])}if(Array.isArray(o)&&o.length!==Tr){let l=jo(e,a),u=l?s?.get(l):void 0,c=u?`${W.uniqueIds}_${u}`:W.uniqueIds;e[c]=o}}function gm(t){let{attributes:e,x:r,chartType:i,firstSeriesY:n}=t;e[r]===null&&(e[F.originalXValue]=null,e[r]=i===p.HeatSeries?"null":F.nullValue),i===p.HeatSeries&&typeof n=="string"&&e[n]===null&&(e[F.originalYCategoryValue]=null,e[n]="null")}function hm(t){let{chartSubType:e,attributes:r,x:i}=t;e!==S.BarAndLineFromFields&&e!==S.PieFromFields&&(r[F.originalXValue]=r[i])}function jo(t,e){let r;if(e){let i=t[e];r=typeof i=="string"||typeof i=="number"?i:void 0}return r}function Zo(t){let{queryObject:e,queryResponse:r,chartConfig:i,mapToStatField:n,splitByField:a,isTimeBinningSeries:s,resultLimit:o,chartLimits:l,fieldList:u}=t,{series:c}=i,d=H(c),f=j(c),{x:m}=c[0],g="y"in c[0]?c[0].y:void 0,h=c[0].query?.outStatistics??[],y=li(i?.axes?.[0]?.valueFormat),b=Tn(e,m),x=typeof g=="string"?Tn(e,g):void 0,w=Dg(u??[]).includes(m),C=Mt(i),v=[],T=0,O=new Set,{maxCategoryCount:I,serialChart:{categories:B}}=xt(l),N=Number.isFinite(I)?I:B,A=cm({queryResponse:r,chartConfig:i,maxCategoryCount:N});for(let D=0;A[D]&&D<A.length&&!(o!==void 0&&T>=o);D+=1){T+=lm(d,i);let E=A[D],M={...E.attributes};dm({attributes:M,uniqueCategoryList:O,maxCategoryCount:N,x:m,chartSubType:d})||(hm({chartSubType:d,x:m,attributes:M}),nm(M,c),am({chartSubType:d,dataItem:M,outStatistics:h}),sm({dataItem:M,splitByField:a,y:g,queryObject:e,chartSubType:d}),om({chartSubType:d,attributes:M,y:typeof g=="string"?g:g?.[0]}),um({attributes:M,showMean:C,chartSubType:d}),Xf({attributes:M,x:m,categoryValueFormat:y,isDateField:w,isTimeBinningSeries:s}),Jf({x:m,fieldList:u,attributes:M}),rm({chartSubType:d,attributes:M,splitByField:a,mapToStatField:n}),Qf(i,M),Kf({chartType:f,x:m,attributes:M}),gm({attributes:M,x:m,chartType:f,firstSeriesY:g}),fm({attributes:M,x:m,y:g,xFieldDomain:b,yFieldDomain:x,chartType:f,chartSubType:d,xAxisValueFormat:i.axes?.[0].valueFormat,yAxisValueFormat:i.axes?.[1]?.valueFormat}),tm({feature:E,splitByField:a,chartSubType:d,attributes:M}),mm({attributes:M,statisticsAggregatedIds:E.statisticsAggregatedIds,chartSubType:d,feature:E,splitByField:a,mapToStatField:n}),im(M,i),em({chartConfig:i,chartType:f,chartSubType:d,attributes:M,featureIndex:D,x:m}),v.push(M))}return v}async function bi(t){let{queryObject:e,uniqueQuery:r,chartConfig:i,mapToStatField:n,elementCount:a,isTimeBinningSeries:s,chartLimits:o,popupTemplateFieldInfosEnabled:l,returnStatisticsAggregatedIds:u,preFetchedQueryResponse:c,errorStrings:d,abortKey:f,abortSignal:m}=t,{series:g}=i,h=H(g),y=[],b=h===S.BarAndLineSplitBy||h===S.BarAndLineSplitByNoAggregation?de(g[0].query?.where):"",x=c??await De({queryObject:e,queryConfig:r,featureCount:a,returnStatisticsAggregatedIds:u,abortKey:f,errorStrings:d,abortSignal:m}),w=je(e,l),{x:C}=g[0];return y=Zo({queryObject:e,queryResponse:x,chartConfig:i,mapToStatField:n,splitByField:b,isTimeBinningSeries:s,fieldList:w,resultLimit:r.num,chartLimits:o}),h!==S.BarAndLineSplitByNoAggregation&&h!==S.BarAndLineFromFields&&(b!==""&&(y=br({data:y,x:C,splitByField:b})),y=Yf(y,g)),y}async function _o(t){let{chartConfig:e,queryObject:r,queryConfig:i,numberMaxOfFeaturesToFetch:n,behaviorAfterLimit:a,isGaugeByFeature:s,abortSignal:o}=t,{series:l}=e,u=H(l),{x:c}=l[0],d=l.length,f,m,g=!1;if(u===S.BoxPlotC1MonoField||u===S.BoxPlotC5MonoFieldAndSplitBy?(m=d,f=m):u===S.BoxPlotC2MultiFields||u===S.BoxPlotC6MultiFieldsAndSplitBy?(m=e.series[0].y.length,f=m):u===S.PieFromFields||u===S.BarAndLineFromFields?(m=l[0].query?.outStatistics?.filter(h=>h.statisticType!==L.EnvelopeAggregate).length??0,f=m):f=await Pc({queryObject:r,x:c,chartSubType:u,queryConfig:i,isGaugeByFeature:s,abortSignal:o}),f!==void 0){let h=u===S.BoxPlotC1MonoField||u===S.BoxPlotC3MonoFieldAndCategory||u===S.BoxPlotC5MonoFieldAndSplitBy;m=vn(u)&&!h?f*d:f}return a===st.RenderUpToTheLimit&&m!==void 0&&n!==void 0&&n<m&&(m=n,f=Math.ceil(m/d),g=!0),{categoryOrDateCount:f,elementCount:m,chartLimitsReached:g}}async function Fn(t){let{chartConfig:e,queryConfig:r,fetchFullBoxPlotData:i,queryObject:n,abortKey:a,fieldList:s,preFetchedQueryResponse:o,errorStrings:l,abortSignal:u,setTimeBinningInfoWhenNotProvided:c,returnFeaturesExtent:d,returnStatisticsAggregatedIds:f,chartLimits:m,popupTemplateFieldInfosEnabled:g,hideZeroCountCategories:h}=t;Mt(e);let y=t.replaceNoValueCategoryWithZero??F.options.replaceNoValueCategoryWithZero,b=!(h??!y),{behaviorAfterLimit:x}=m??{},w,C={valid:!0},v,T=!1,O=e.series,I=O[0],B=H(e.series);if(se(n))w=j(O)===p.BarSeries?await kd(t):C;else{if(I!==void 0){let N=j(O),{uniqueQuery:A,mapToStatField:D}=Rn({chartConfig:e,queryObject:n,queryConfig:r,fetchFullBoxPlotData:i,setTimeBinningInfoWhenNotProvided:c,returnFeaturesExtent:d,chartLimits:m}),{categoryOrDateCount:E,elementCount:M,chartLimitsReached:V}=await _o({chartConfig:e,queryObject:n,queryConfig:r,behaviorAfterLimit:x,numberMaxOfFeaturesToFetch:A.num,abortSignal:u}),$=!Number.isFinite(M),G=$||_e({count:M??0,seriesCount:O.length,chartType:N,chartLimits:m});if(G){if(v=await bi({queryObject:n,uniqueQuery:A,chartConfig:e,preFetchedQueryResponse:o,mapToStatField:D,elementCount:M,isTimeBinningSeries:!1,chartLimits:m,popupTemplateFieldInfosEnabled:g,returnStatisticsAggregatedIds:f,errorStrings:l,abortKey:a,abortSignal:u}),be(e)&&v!==void 0){C.data=await uf({data:v,queryObject:n,fetchFullBoxPlotData:i,uniqueQuery:A,chartConfig:e,elementCount:M,chartLimits:m,errorStrings:l,abortKey:a,abortSignal:u});let k=m?.maxBoxPlotOutlierLimit??m?.boxPlot?.outliers;k!==void 0&&(G=(C.data.outliers??[]).length<=k,T=!G)}if($&&(E=v.length,M=vn(B)?E*O.length:E,G=_e({count:M,seriesCount:O.length,chartType:N,chartLimits:m})),G){if(N===p.PieSeries){B===S.PieFromFields&&(v=fi({dataToConvert:v[0],x:Fe,y:Ue,fieldList:s}));let k="";B===S.PieFromFields?k=Ue:"y"in I&&typeof I.y=="string"&&(k=I.y),fg(v,k)?C.data={dataItems:v}:Yd(C,z.PieChartMixOfNegativePositiveSlices)}else if((N===p.RadarSeries||N===p.BarSeries||N===p.LineSeries||N===p.ComboLineAndBarSeries)&&(B===S.BarAndLineFromFields&&"y"in I&&typeof I.y=="string"?v=fi({dataToConvert:v[0],x:I.x,y:I.y,fieldList:s}):v=await Bf({queryObject:n,seriesData:v,chartConfig:e,queryConfig:r,categoryOrDateCount:E,behaviorAfterLimit:x,errorStrings:l,abortKey:a,abortSignal:u}),M=vn(B)?v.length*O.length:v.length,G=_e({count:M,seriesCount:O.length,chartType:N,chartLimits:m}),G)){b&&(v=If(v,e));let k={};if(Re(I)){let{size:Y,unit:R}=I.temporalBinning??{};Y!==void 0&&R!==void 0&&(k={size:Y,unit:R})}C.data={dataItems:v,timeIntervalInfo:k,chartLimitsReached:V}}}}G||ui({dataInfo:C,chartType:N,subError:{outlierLimit:T}}),C.count=M}w=C}return w}function ym(t){let e,{start:r,end:i}=Bn({field:"",unit:t,addIntervalStatement:!1});return i&&(e=Array.from({length:i+(r===0?1:0)},(n,a)=>(a+(r??1)).toString())),e}function pm(t){return t.hideEmptyRowsAndColumns===!0&&(t.nullPolicy!==we.Zero||t.series[0].query?.outStatistics?.[0].statisticType===L.Count)}function Sm(t){let{dataItems:e,valueField:r,filterOutZero:i}=t,n=[null];i&&n.push(0);let a=new Set(e.filter(o=>!n.includes(o[r])).map(o=>o[_.xField])),s=new Set(e.filter(o=>!n.includes(o[r])).map(o=>o[_.yField]));return e.filter(o=>a.has(o[_.xField])&&s.has(o[_.yField]))}function Ks(t,e){let r=0;return t===e?r=0:typeof t=="number"&&typeof e=="number"?r=t<e?-1:1:typeof t=="string"&&typeof e=="string"?r=t.localeCompare(e,void 0,{numeric:!0}):r=String(t).localeCompare(String(e),void 0,{numeric:!0}),r}function bm(t){let{chartConfig:e,dataItems:r,chartLimits:i}=t,n=kn(e,i),a=r;if(n!==void 0&&r.length>n){let s=[...new Set(r.map(c=>c[_.xField]))].sort((c,d)=>Ks(c,d)),o=[...new Set(r.map(c=>c[_.yField]))].sort((c,d)=>Ks(c,d)),l=new Map;for(let c of r){let d=c[_.xField],f=c[_.yField];l.set(`${String(d)}\0${String(f)}`,c)}let u=[];for(let c of s)for(let d of o){let f=`${String(c)}\0${String(d)}`,m=l.get(f);m&&u.push(m)}a=u.slice(0,n)}return a}function vm(t){let{dataItems:e,xUniqueValues:r,yUniqueValues:i,valueField:n,emptyCellValue:a,x:s,y:o,queryObject:l}=t,u=[],c=new Set;for(let d of e){let f=d[F.originalXValue]!==void 0?d[F.originalXValue]:d[_.xField],m=d[F.originalYCategoryValue]!==void 0?d[F.originalYCategoryValue]:d[_.yField];c.add(`${f}|${m}`)}for(let d of r){let f=String(d);for(let m of i){let g=String(m);if(!c.has(`${f}|${g}`)){let h=l?oo({queryObject:l,fieldName:s,fieldValue:f})??d:d,y=l?oo({queryObject:l,fieldName:o,fieldValue:g})??m:m;u.push({[F.originalXValue]:d===null?null:d,[F.originalYCategoryValue]:m===null?null:m,[_.xField]:d===null?"null":h,[_.yField]:m===null?"null":y,[n]:a,[Ni]:!0})}}}return u}function Xs(t){let{day:e,month:r,includeLeapDay:i}=t;return r===2&&e>(i?29:28)||[4,6,9,11].includes(r)&&e>30}async function zo(t){let{chartConfig:e,queryConfig:r,queryObject:i,completeHeatChartDataset:n=!0,fetchMatrixUniqueCategories:a=!0,errorStrings:s,returnFeaturesExtent:o,returnStatisticsAggregatedIds:l,chartLimits:u,popupTemplateFieldInfosEnabled:c,view:d,syncViewTimeZone:f,abortKey:m,abortSignal:g}=t,h={valid:!0},y;if(At(e)){let{nullPolicy:b}=e,x=e.series[0],{x:w,y:C,query:v,xTemporalBinning:T,yTemporalBinning:O}=x,I=v?.outStatistics?.[0]?.outStatisticFieldName??"",B=v?.outStatistics?.[0]?.statisticType??L.Count,N=pm(e),A=_.valueField,D=b===we.Zero?0:null;if(Ud(e)){let E=a?await yn({queryObject:i,queryConfig:r,category:w,errorStrings:s,abortKey:m,abortSignal:g}):void 0,M=a?await yn({queryObject:i,queryConfig:r,category:C,errorStrings:s,abortKey:m,abortSignal:g}):void 0,V=(E?.length??0)*(M?.length??0);if(!_e({count:V,seriesCount:1,chartType:p.HeatSeries,chartLimits:u}))ui({dataInfo:h,chartType:p.HeatSeries});else{let $=await qc({chartConfig:e,queryObject:i,queryConfig:r,returnFeaturesExtent:o,returnStatisticsAggregatedIds:l,errorStrings:s,abortKey:m,abortSignal:g});if(typeof $?.[0]=="object"){let G=je(i,c);y=Zo({queryObject:i,queryResponse:$,chartConfig:e,splitByField:"",isTimeBinningSeries:!1,chartLimits:u,resultLimit:r.num,fieldList:G}),y.length!==V&&E&&M&&(y=[...y,...vm({dataItems:y,xUniqueValues:E,yUniqueValues:M,valueField:A,emptyCellValue:D,x:w,y:C,queryObject:i})],N&&(y=Sm({dataItems:y,valueField:A,filterOutZero:B===L.Count})))}}}else{let E=await Lc({chartConfig:e,queryObject:i,queryConfig:r,view:d,returnStatisticsAggregatedIds:l,syncViewTimeZone:f,errorStrings:s,abortSignal:g}),M=O?ym(O.unit):await yn({queryObject:i,queryConfig:r,category:C,errorStrings:s,abortKey:m,abortSignal:g}),V=0;y=E?.features.flatMap($=>{let G=[],{attributes:k,stackedAttributes:Y}=$,R=[];if(Y?.forEach(X=>{let ie=`${X[C]}`;R.push(ie);let ve={[_.xField]:`${k[W.heatChartLowerBoundaryAlias]}`,[_.yField]:ie,[A]:X[I]};Array.isArray(X.aggregateIds)&&X.aggregateIds.length!==Tr&&(ve[W.uniqueIds]=X.aggregateIds),G.push(ve)}),n&&M&&R.length!==M?.length){let X=M.filter(ie=>!R.includes(ie.toString()));N&&(X.length!==M.length||R.length===0)||X.forEach(ie=>{Number.isFinite(Number(k[W.heatChartLowerBoundaryAlias]))&&Number.isFinite(Number(ie))&&(T?.unit===xe.DayOfMonth&&O?.unit===xe.MonthOfYear&&Xs({day:Number(k[W.heatChartLowerBoundaryAlias]),month:Number(ie),includeLeapDay:e.includeLeapDay})||O?.unit===xe.DayOfMonth&&T?.unit===xe.MonthOfYear&&Xs({day:Number(ie),month:Number(k[W.heatChartLowerBoundaryAlias]),includeLeapDay:e.includeLeapDay}))||G.push({[_.xField]:`${k[W.heatChartLowerBoundaryAlias]}`,[_.yField]:ie,[A]:b===we.Zero?0:null,[Ni]:!0})})}return V+=G.length,G}),_e({count:V,seriesCount:1,chartType:p.HeatSeries,chartLimits:u})||ui({dataInfo:h,chartType:p.HeatSeries})}u?.behaviorAfterLimit===st.RenderUpToTheLimit&&y&&(y=bm({chartConfig:e,dataItems:y,chartLimits:u})),y&&(h.data={dataItems:y,heatChartAxesData:Io({chartConfig:e,chartData:y})})}return h}function Cm(t){let{chartConfig:e,data:r,chartLimits:i}=t,n=e.series,a=r,s=!1,o=kn(e,i);if(o!==void 0){let l=he(n);if(l.length===1)a=r.filter(u=>Number.isFinite(u[l[0]])).slice(0,o);else if(r.length*l.length>o){let u=[],c=0,d=0;for(;c<=o&&d<r.length;){let f=r[d];if(u.push(f),c+=l.filter(m=>Number.isFinite(f[m])).length,c>o){let m=c-o,g=l.length-1;for(;m!==0&&g>=0;){let h=l[g];Number.isFinite(f[h])&&(delete f[h],m-=1),g-=1}}d+=1}a=u}a.length===o&&(s=!0)}return{trimmedData:a,chartLimitsReached:s}}async function Ln(t){let{chartConfig:e,queryConfig:r,queryObject:i,abortKey:n,abortSignal:a,preFetchedQueryResponse:s,errorStrings:o,setTimeBinningInfoWhenNotProvided:l,returnFeaturesExtent:u,returnStatisticsAggregatedIds:c,chartLimits:d,popupTemplateFieldInfosEnabled:f,view:m,syncViewTimeZone:g}=t,{behaviorAfterLimit:h}=d??{},y=e.series,b=y[0],{x}=b,w=de(b.query?.where),C={valid:!0},v;if(Re(b)){let{temporalBinning:T}=b;if(i&&T){let{unit:O,size:I}=T,B=je(i).find(ie=>ie.name===x)?.type,N=1,A={unit:O,size:I},D=!1,E=!1,M=!1,V=Hf({series:b,isTimeBinningSeries:!0,setTimeBinningInfoWhenNotProvided:l}),$=!er(w,i)||V?await kf({queryObject:i,queryConfig:r,x,xFieldType:B,errorStrings:o,abortSignal:a}):void 0;V&&$&&$.numberOfFeatures>0&&$.dateRange.dateMaxTimestamp!==void 0&&$.dateRange.dateMinTimestamp!==void 0&&(A=Uf($),B===K.DateOnly&&A.unit!==void 0&&[U.Hour,U.Minute,U.Second].includes(A.unit)&&(A.unit=U.Day,A.size=1),T.size=A.size,T.unit=A.unit);let{uniqueQuery:G,mapToStatField:k}=Rn({chartConfig:e,queryConfig:r,queryObject:i,timeIntervalInfo:A,setTimeBinningInfoWhenNotProvided:l,returnFeaturesExtent:u,chartLimits:d}),Y=p.LineSeries,R=z.LineChartExceedsLimit;_d(b)?(Y=p.BarSeries,R=z.BarElementExceedsLimit):Zd(b)&&(Y=p.RadarSeries,R=z.RadarChartExceedsLimit);let X=_e({count:N??0,seriesCount:y.length,chartType:Y,chartLimits:d});if(X){if(er(w,i)){let ie=e.axes?.[0].valueFormat.type===p.DateAxisFormat?e.axes[0].valueFormat.intlOptions.timeZone:void 0,ve=s?.[0]instanceof vc?s:await Rc({queryObject:i,dateField:x,splitByField:w,queryConfig:G,axisTimeZone:ie,temporalBinning:T,errorStrings:o,view:m,syncViewTimeZone:g,returnStatisticsAggregatedIds:c,abortSignal:a}),St="y"in b&&typeof b.y=="string"?b.y:void 0;if({data:v,firstOrLastWasSkipped:M}=Zf({chartConfig:e,queryResults:ve,mapToStatField:k,splitByField:w,x,y:St,nullPolicy:T.nullPolicy,queryObject:i}),!_e({count:v.length,seriesCount:y.length,chartType:Y,chartLimits:d})){let nr=he(y),nt=v.filter(Ze=>nr.some(Ge=>Ge in Ze&&Number.isFinite(Ze[Ge]))).length;_e({count:nt,seriesCount:y.length,chartType:Y,chartLimits:d})||(X=!1)}}else if($?.dateRange.dateMinTimestamp&&$.dateRange.dateMaxTimestamp){let{numberOfFinalBinsWithinDataRange:ie}=$o({dateMinTimestamp:$.dateRange.dateMinTimestamp,dateMaxTimestamp:$.dateRange.dateMaxTimestamp,timeIntervalInfo:A});N=ie*y.length,N=Vo(N,A.unit),v=await bi({queryObject:i,uniqueQuery:G,chartConfig:e,mapToStatField:k,elementCount:N,chartLimits:d,isTimeBinningSeries:!0,popupTemplateFieldInfosEnabled:f,returnStatisticsAggregatedIds:c,errorStrings:o,abortKey:n,abortSignal:a}),v=await _f({queryObject:i,queryConfig:r,queryResults:v,x,seriesConfig:y,dateRange:$.dateRange,timeIntervalInfo:A,errorStrings:o,abortSignal:a})}Tc(i)&&v&&(v?.length+1===$s&&M||v.length===$s)&&(D=!0),h===st.RenderUpToTheLimit&&v&&({trimmedData:v,chartLimitsReached:E}=Cm({chartConfig:e,chartLimits:d,data:v}))}X||(C.valid=!1,C.invalidType=R),C.data={dataItems:v,timeIntervalInfo:A,serverLimitReached:D,chartLimitsReached:E},C.count=N}}return C}async function Fm(t){let{chartConfig:e,queryConfig:r,queryObject:i,abortKey:n,setTimeBinningInfoWhenNotProvided:a,returnFeaturesExtent:s,returnStatisticsAggregatedIds:o,chartLimits:l,popupTemplateFieldInfosEnabled:u,errorStrings:c}=t,d=Mt(e),f={valid:!0},m=e.series,g=it({seriesConfig:m[0],xAxisValueFormatType:We(e),setTimeBinningInfoWhenNotProvided:a,queryObject:i}),{uniqueQuery:h,mapToStatField:y}=Rn({chartConfig:e,queryObject:i,queryConfig:r,setTimeBinningInfoWhenNotProvided:a,fetchFullBoxPlotData:!d,returnFeaturesExtent:s,chartLimits:l}),b=await bi({queryObject:i,uniqueQuery:h,elementCount:1,chartConfig:e,mapToStatField:y,isTimeBinningSeries:g,chartLimits:l,popupTemplateFieldInfosEnabled:u,returnStatisticsAggregatedIds:o,errorStrings:c,abortKey:n});return be(e)&&(b=Eo({chartConfig:e,data:b,calculateZScore:!1})),f.data={dataItems:b},f}async function xm(t){let{chartConfig:e,queryConfig:r,queryObject:i,setTimeBinningInfoWhenNotProvided:n,returnFeaturesExtent:a,returnStatisticsAggregatedIds:s,chartLimits:o,popupTemplateFieldInfosEnabled:l,hideZeroCountCategories:u,replaceNoValueCategoryWithZero:c,view:d,abortKey:f,errorStrings:m}=t,g={valid:!0};if(be(e)){let h=be(e)?e.showMean:!1;g=await Mn({queryObject:i,chartConfig:e,queryConfig:r,setTimeBinningInfoWhenNotProvided:n,returnFeaturesExtent:a,returnStatisticsAggregatedIds:s,chartLimits:o,popupTemplateFieldInfosEnabled:l,hideZeroCountCategories:u,replaceNoValueCategoryWithZero:c,view:d,errorStrings:m,abortKey:f}),h&&g.data&&"dataItems"in g.data&&"meanLines"in g.data&&g.data.meanLines&&(g.data.dataItems=[...g.data.dataItems,...g.data.meanLines])}return g}var wm="{ groupByFieldsForStatistics } WHEN ({ y } { yMinOperand } { yValue } AND { y } { yMaxOperand } { yValuePlusStep } AND { x } { xMinOperand } { xValue } AND { x } { xMaxOperand } { xValuePlusStep }) THEN '{ xValue }|{ xValuePlusStep}|{ yValue }|{ yValuePlusStep }'";async function Tm(t){let{chartConfig:e,queryObject:r,queryConfig:i,errorStrings:n,abortKey:a,abortSignal:s}=t,o=e.series[0],{x:l,y:u}=o,{dataContextCountDistinctX:c,dataContextCountDistinctY:d}=F.scatterplotAggregationFields,f={...i,outStatistics:[{statisticType:L.Count,outStatisticFieldName:c,onStatisticField:l},{statisticType:L.Count,outStatisticFieldName:d,onStatisticField:u}],returnDistinctValues:!0};return await wr({queryObject:r,queryConfig:f,errorStrings:n,abortKey:a,abortSignal:s})}async function Nm(t){let{statsMap:e,chartConfig:r,queryObject:i,chartLimits:n,queryConfig:a,errorStrings:s,abortKey:o,abortSignal:l}=t,{dataContextXMinField:u,dataContextXMaxField:c,dataContextYMinField:d,dataContextYMaxField:f,dataContextCountDistinctX:m,dataContextCountDistinctY:g}=F.scatterplotAggregationFields,h,y,b,x,w,C=e.get(u),v=e.get(c),T=e.get(d),O=e.get(f);if(C!=null&&T!==void 0&&T!==null&&v!==void 0&&v!==null&&O!==void 0&&O!==null&&!Number.isNaN(C+v+T+O)){let{maxScatterPointsAfterAggregation:I,scatterplot:{markersAfterAggregation:B}}=xt(n),N=Math.floor(Math.sqrt(I??B)),A=await Tm({queryObject:i,chartConfig:r,queryConfig:a,errorStrings:s,abortKey:o,abortSignal:l});b=Math.min(A.get(g)??Number.NaN,N),x=Math.min(A.get(m)??Number.NaN,N),w=x*b,h=v===C?0:(v-C)/(x-1),y=O===T?0:(O-T)/(b-1),e.set(F.scatterplotAggregationFields.xStep,h),e.set(F.scatterplotAggregationFields.yStep,y),e.set(F.scatterplotAggregationFields.rowCount,b),e.set(F.scatterplotAggregationFields.columnCount,x),e.set(F.scatterplotAggregationFields.realGridSize,w)}}function Om(t){let{groupByFieldsForStatistics:e,x:r,y:i,xValue:n,yValue:a,xStep:s,yStep:o,endOfRow:l,endOfColumn:u}=t,c=e===""?Et.groupByCaseBegin:e;return c=$e(wm,{groupByFieldsForStatistics:c,x:r,y:i,xValue:`${n}`,yValue:`${a}`,xValuePlusStep:`${n+(u?0:s)}`,yValuePlusStep:`${a+(l?0:o)}`,xMinOperand:u?"=":">=",yMinOperand:l?"=":">=",xMaxOperand:u?"=":"<",yMaxOperand:l?"=":"<"}),c}async function Bm(t){let{chartConfig:e,queryConfig:r,queryObject:i,xMin:n,xMax:a,yMin:s,yMax:o,errorStrings:l,abortKey:u,abortSignal:c}=t,d=e.series[0],{x:f,y:m}=d,g={...r};return g.where=te([g.where,`${f}>=${n}`,`${f}<=${a}`]),f!==m&&(g.where=te([g.where,`${m}>=${s}`,`${m}<=${o}`])),await De({queryObject:i,queryConfig:g,noBatch:!0,featureCount:1,returnStatisticsAggregatedIds:!1,errorStrings:l,abortKey:u,abortSignal:c})}async function Im(t){let{statsMap:e,chartConfig:r,queryObject:i,queryConfig:n,useQueryAttributeBins:a,returnStatisticsAggregatedIds:s,errorStrings:o,abortKey:l,abortSignal:u}=t,c=r.series[0],{x:d,y:f}=c,{dataContextXMinField:m,dataContextXMaxField:g,dataContextYMinField:h,dataContextYMaxField:y,queryNumberOfFeatures:b,queryNumberOfAggregatedFeatures:x}=F.scatterplotAggregationFields,w,C=e?.get(m)??Number.NaN,v=e?.get(g)??Number.NaN,T=e?.get(b)??Number.NaN,O=e?.get(h)??C,I=e?.get(y)??v;if(C!=null&&O!==void 0&&O!==null&&v!==void 0&&v!==null&&I!==void 0&&I!==null&&!Number.isNaN(C+v+O+I)){let B=J(i),{idField:N,isTraditionalTypeOID:A}=He(B),D=A?N:"*",E=e?.get(F.scatterplotAggregationFields.xStep),M=e?.get(F.scatterplotAggregationFields.yStep),V=e?.get(F.scatterplotAggregationFields.realGridSize),$=e?.get(F.scatterplotAggregationFields.rowCount),G=e?.get(F.scatterplotAggregationFields.columnCount),k=new Map,Y=je(i);if(Y?.forEach(R=>{Fr(R)&&k.set(R.name,{onStatisticField:R.name,outStatisticFieldName:R.name,statisticType:L.Maximum})}),(Y.filter(R=>c?.additionalTooltipFields?.includes(R.name))??[])?.forEach(R=>{Fr(R)||k.set(R.name,{onStatisticField:R.name,outStatisticFieldName:R.name,statisticType:L.Maximum})}),(await nl(B)).forEach(R=>{k.set(R,{onStatisticField:R,outStatisticFieldName:R,statisticType:L.Maximum})}),N!==""&&k.set(N,{onStatisticField:D,outStatisticFieldName:x,statisticType:L.Count}),k.set(d,{onStatisticField:d,outStatisticFieldName:d,statisticType:L.Maximum}).set(f,{onStatisticField:f,outStatisticFieldName:f,statisticType:L.Maximum}),E!==void 0&&M!==void 0){if(a){let R={...n,outStatistics:[...k.values()]};w=await Dc({queryObject:i,queryConfig:R,xStep:E,xMin:C,xMax:v,x:d,y:f,yStep:M,returnStatisticsAggregatedIds:s,errorStrings:o,abortSignal:u})}else if($!==void 0&&G!==void 0){let R=0,{maxScatterCellsPerQuery:X,maxScatterCellsPerQueryForStandard:ie}=sr(),ve=await kg(B,u)?ie:X,St=[],nr=!0,nt=C,Ze=O,Ge="",Or=1,Ci=1,Br=Number.MAX_SAFE_INTEGER,Ir=Number.MIN_SAFE_INTEGER,Ar=Number.MAX_SAFE_INTEGER,Mr=Number.MIN_SAFE_INTEGER;for(;Ci<=G&&nr;){for(Ze=O,Or=1;Or<=$&&nr;){if(Ge=Om({groupByFieldsForStatistics:Ge,x:d,y:f,xValue:nt,yValue:Ze,xStep:E,yStep:M,endOfRow:Or===$,endOfColumn:Ci===G}),nt<Br&&(Br=nt),nt+E>Ir&&(Ir=nt+E),Ze<Ar&&(Ar=Ze),Ze+E>Mr&&(Mr=Ze+M),R+=1,R%ve===0||R===V||R===T){Ge=`${Ge} ${Et.groupByCaseEnd}`;let ul={...n,groupByFieldsForStatistics:[Ge],outStatistics:[...k.values()]};St.push(Bm({chartConfig:r,queryConfig:ul,queryObject:i,xMin:Br,xMax:Ir,yMin:Ar,yMax:Mr,errorStrings:o,abortKey:l,abortSignal:u})),Br=Number.MAX_SAFE_INTEGER,Ir=Number.MIN_SAFE_INTEGER,Ar=Number.MAX_SAFE_INTEGER,Mr=Number.MIN_SAFE_INTEGER,Ge="",R===V&&(nr=!1)}Ze+=M,Or+=1}nt+=E,Ci+=1}w=(await Promise.all(St)).flat()}}}return w}async function Am(t){let{chartConfig:e,queryConfig:r,queryObject:i,errorStrings:n,abortKey:a,abortSignal:s}=t,o=e.series[0],{x:l,y:u}=o,c=new Map,{dataContextXMinField:d,dataContextXMaxField:f,dataContextYMinField:m,dataContextYMaxField:g,queryNumberOfFeatures:h}=F.scatterplotAggregationFields,{idField:y,isTraditionalTypeOID:b}=He(J(i)),x=b?y:"*",w=[{statisticType:L.Count,onStatisticField:x,outStatisticFieldName:h},{statisticType:L.Minimum,outStatisticFieldName:d,onStatisticField:l},{statisticType:L.Maximum,outStatisticFieldName:f,onStatisticField:l}];l!==u&&w.push({statisticType:L.Minimum,outStatisticFieldName:m,onStatisticField:u},{statisticType:L.Maximum,outStatisticFieldName:g,onStatisticField:u});let C={...r};return C.outStatistics=w,c=await wr({queryObject:i,queryConfig:C,errorStrings:n,abortKey:a,abortSignal:s}),l===u&&(c.set(m,c.get(d)??Number.NaN),c.set(g,c.get(f)??Number.NaN)),c}function ai(t){let{value:e,valueMin:r,valueMax:i}=t;return e===r||e===i?e:Math.random()*(i-r)+r}function Mm(t){let{useQueryAttributeBins:e,graphic:r,x:i,y:n,yStep:a}=t,{groupByOutKeyword:s}=Et,{dataContextXMinField:o,dataContextXMaxField:l,dataContextYMinField:u,dataContextYMaxField:c}=F.scatterplotAggregationFields,d=[];if(e&&"stackedAttributes"in r&&r.stackedAttributes){let f=po(i,n),m=r.attributes[f.lowerBoundaryAlias],g=r.attributes[f.upperBoundaryAlias];r.stackedAttributes.forEach(h=>{let y=h[f.stackAlias],b;typeof y=="number"&&typeof a=="number"&&(y*=a),typeof y=="number"&&typeof a=="number"&&(b=y+a);let x=h[i],w=h[n];if(typeof y=="number"&&typeof b=="number"&&typeof x=="number"&&typeof w=="number"){let C={...h,[i]:ai({value:x,valueMin:m,valueMax:g}),[n]:ai({value:w,valueMin:y,valueMax:b}),[o]:Math.min(m,g),[l]:Math.max(m,g),[u]:y,[c]:b};Array.isArray(h.aggregateIds)&&h.aggregateIds.length!==Tr&&(C[W.uniqueIds]=h.aggregateIds),d.push(C)}})}else{let{expr:f,isInItem:m}=or(r.attributes);if(m&&f&&r.attributes[f]!==s){let[g,h,y,b]=r.attributes[f].split("|");g=Math.min(g,h),h=Math.max(g,h),y=Math.min(y,b),b=Math.max(y,b);let x={...r.attributes,[o]:g,[l]:h,[u]:y,[c]:b};x[i]=ai({value:x[i],valueMin:g,valueMax:h}),x[n]=ai({value:x[n],valueMin:y,valueMax:b}),d=[x]}}return d}function Em(t){let{chartConfig:e,rawData:r,isAggregationMode:i,yStep:n,useQueryAttributeBins:a}=t,s=e.series[0],{x:o,y:l}=s,u=(Array.isArray(r)?r:r?.features)?.flatMap(c=>{let d=[{...c.attributes}];return En(d[0],[o,l]),i?d=Mm({useQueryAttributeBins:a,graphic:c,x:o,y:l,yStep:n}):d[0][W.uniqueIds]=c.getObjectId(),d});return u=u?.filter(c=>{let{expr:d}=or(c);return Number.isFinite(c[o])&&Number.isFinite(c[l])&&(d===void 0||c[d]!==Et.groupByOutKeyword)}),u??[]}async function Lm(t){let{queryObject:e,queryConfig:r,chartConfig:i,featureCount:n,errorStrings:a,abortKey:s,abortSignal:o}=t,l=i.series[0],{x:u,y:c}=l,d=J(e),f=[],m=je(e),g=vi(d).idFields,h=(m?.filter(C=>Fr(C)&&C.name!==u&&C.name!==c)??[]).map(C=>C.name)??[],y=l?.additionalTooltipFields??[],b=Array.from(new Set([u,c,...g??[],...h,...y])),x=qe(d);if(x&&!x.isTable){let{rendererField:C,rendererNormalizationField:v}=Eg(d?.renderer??void 0);le(C)||b.push(C),le(v)||b.push(v)}let w={...r,orderByFields:[`${u} ${Ce.Ascending}`],outFields:b};return f=await De({queryObject:e,queryConfig:w,featureCount:n,returnStatisticsAggregatedIds:!1,errorStrings:a,abortKey:s,abortSignal:o}),f}async function qm(t){let e,{chartConfig:r,queryConfig:i,queryObject:n,statsMap:a,numberOfFeatures:s,returnStatisticsAggregatedIds:o,isAggregationMode:l,useQueryAttributeBins:u,errorStrings:c,abortKey:d,abortSignal:f}=t,m=r.series[0],{x:g,y:h}=m;if(!Number.isNaN(s)&&s>0){let y={...i};y.where=te([y.where,`${g} IS NOT NULL`,`${h} IS NOT NULL`]),l?e=await Im({chartConfig:r,queryObject:n,queryConfig:y,statsMap:a,returnStatisticsAggregatedIds:o,useQueryAttributeBins:u,errorStrings:c,abortKey:d,abortSignal:f}):e=await Lm({queryObject:n,chartConfig:r,queryConfig:y,featureCount:s,errorStrings:c,abortKey:d,abortSignal:f})}return e}async function Uo(t){let{chartConfig:e,queryConfig:r,queryObject:i,sortData:n,calculateTrendLine:a,chartLimits:s,errorStrings:o,abortKey:l,abortSignal:u}=t,c;if(se(i))c=await Sg(t);else{let d=await Am({chartConfig:e,queryConfig:r,queryObject:i,errorStrings:o,abortKey:l,abortSignal:u}),{queryNumberOfFeatures:f,yStep:m}=F.scatterplotAggregationFields,{maxScatterPointsBeforeAggregation:g,scatterplot:{aggregationThreshold:h}}=xt(s),y=d?.get(f)??Number.NaN,b=y>=(g??h),x=Ic(i);b&&await Nm({statsMap:d,chartConfig:e,queryObject:i,chartLimits:s,queryConfig:r,errorStrings:o,abortKey:l,abortSignal:u});let w=await qm({...t,queryObject:i,statsMap:d,numberOfFeatures:y,isAggregationMode:b,useQueryAttributeBins:x}),C=Em({chartConfig:e,rawData:w,isAggregationMode:b,yStep:d.get(m),useQueryAttributeBins:x});n!==!1&&vr({arrayToSort:C,sortingField:e.series[0].x,orderBy:Ce.Ascending});let{r2:v,trendLinePoints:T}=a!==!1?await Fo({data:C,statsMap:d,queryConfig:r,queryObject:i,chartConfig:e,errorStrings:o,abortSignal:u}):F.scatterplotSeries;c={dataItems:C,r2:v,trendLinePoints:T,aggregated:b}}return c}function xn(t){let{queryIndex:e,batchSize:r,filterList:i}=t,n=e*r,a=(e+1)*r;return i.slice(n,a)}function*Dm(t){let{filterList:e,queryObject:r,queryConfig:i,errorStrings:n}=t;for(let a=0;a<e.length;a+=1){let s={...i};s.where=te([s.where,e[a]]),yield Vc({queryObject:r,queryConfig:s,uniqueFeature:!0,errorStrings:n})}}async function w0(t){let{whereList:e,queryObject:r,queryFilter:i,queryConfig:n,errorStrings:a}=t,s=[];if(e.length>0){let o=sr().maxElementsPerSelectionQuery,l=[],u=Math.ceil(e.length/o);for(let d=0;d<u;d+=1){let f=xn({queryIndex:d,batchSize:o,filterList:e});l.push(te([i,te(f,"OR")]))}let c=Dm({filterList:l,queryObject:r,queryConfig:n,errorStrings:a});s=(await Promise.all(c)).flat(),s=Array.from(new Set(s))}return s}function Xt(t){let e=t===void 0||t==="";return{[P.Average]:`${e?"":`${t}_`}${P.Average}`,[P.Min]:`${e?"":`${t}_`}${P.Min}`,[P.Max]:`${e?"":`${t}_`}${P.Max}`,[P.FirstQuartile]:`${e?"":`${t}_`}${P.FirstQuartile}`,[P.Median]:`${e?"":`${t}_`}${P.Median}`,[P.ThirdQuartile]:`${e?"":`${t}_`}${P.ThirdQuartile}`,[P.IQR]:`${e?"":`${t}_`}${P.IQR}`,[P.Outlier]:`${e?"":`${t}_`}${P.Outlier}`,[P.StandardDeviation]:`${e?"":`${t}_`}${P.StandardDeviation}`}}function T0(t){return"subType"in t&&t.subType===wi.FeatureGauge}function qn(t){let e;return t!==void 0&&("bins"in t?e=t.bins:"dataItems"in t&&(e=t.dataItems)),e}function Ho(t){return t===S.BoxPlotC2MultiFields||t===S.BoxPlotC4MultiFieldsAndCategory||t===S.BoxPlotC6MultiFieldsAndSplitBy}function ce(t){let{key:e,y:r,chartSubType:i,splitBy:n,splitByValue:a,showOutliers:s,standardizeValues:o}=t,l=a,u=Xt(r)[e];return s===!0&&(e===P.Min||e===P.Max)&&(u=`${u}${Hn}`),o===!0&&(Ho(i)||e===P.Outlier)&&(u=`${u}${Gn}`),(a===void 0||`${a}`.trim()==="")&&(l=Se({where:n,normalize:!0,escape:!1})),l!==void 0&&`${l}`.trim()!==""&&(u=`${l}${u!==""?`_${u}`:""}`),u}function pn(t){let{dataItem:e,y:r,splitBy:i,showOutliers:n}=t,a=ce({key:P.FirstQuartile,y:r,splitBy:i,showOutliers:n}),s=ce({key:P.ThirdQuartile,y:r,splitBy:i,showOutliers:n});return Number.isFinite(e[a])||Number.isFinite(e[s])}function Pm(t){let{configSeries:e,boxPlotDataItem:r,yList:i,showOutliers:n}=t,a=H(e),s=!1;switch(a){case S.BoxPlotC1MonoField:case S.BoxPlotC2MultiFields:case S.BoxPlotC3MonoFieldAndCategory:s=pn({dataItem:r,showOutliers:n});break;case S.BoxPlotC4MultiFieldsAndCategory:s=i.some(o=>pn({dataItem:r,y:o,showOutliers:n}));break;case S.BoxPlotC5MonoFieldAndSplitBy:case S.BoxPlotC6MultiFieldsAndSplitBy:case S.BoxPlotC7MonoFieldAndCategoryAndSplitBy:s=e.some(o=>pn({dataItem:r,splitBy:o.query?.where,showOutliers:n}));break;default:s=!1;break}return s}function Go(t){return t.map(e=>e.id).filter(e=>e!==void 0)}function Yo(t,e){let r=[];return"y"in t&&t.y!==void 0&&(e===S.BarAndLineSplitByNoAggregation?r=[`${t.y.toString()}_${Se({where:t.query?.where,keepSurroundingQuotes:!1,escape:!1})}`]:r=[t.y].flat()),r}function he(t,e){let r=e??Go(t),i=H(t),n=t.filter(a=>r.includes(a.id)).flatMap(a=>Yo(a,i));return Array.from(new Set(n))}function Dn(t){let{seriesConfig:e,filteredSeriesIds:r,showMean:i}=t,n=[];if(i===!0){let a=e.find(s=>s.type===p.BoxPlotSeries);a!==void 0&&"y"in a&&(n=[a.y].flat())}else n=he(e,r);return n}function mt(t,e){return t===null&&e===!0||Number.isFinite(t)}function km(t){let{dataItem:e,x:r,y:i,nullAsValid:n=!1,zeroCountAsValid:a=!1,aggregationType:s}=t,o=e[r],l=e[i];return o!==void 0&&(typeof o!="number"||Number.isFinite(o))&&mt(l,n)&&(s!==L.Count||l!==0||a)}function N0(t){let{chartConfig:e,nullAsValid:r=!1,zeroCountAsValid:i=!1,dataSet:n}=t,a=!0;if(e!==void 0){let s=j(e.series);if(n===void 0||n.length===0)a=!0;else{let o=he(e.series);a=!n.some(l=>{let u=!1;switch(s){case p.HistogramSeries:{let c=l;u=mt(c.minValue,r)&&mt(c.maxValue,r)}break;case p.ScatterSeries:{let c=l,{x:d,y:f}=e.series[0];u=mt(c[d],r)&&mt(c[f],r)}break;case p.ComboLineAndBarSeries:case p.RadarSeries:case p.LineSeries:case p.BarSeries:{let c=l,{x:d}=e.series[0];u=o.some(f=>km({dataItem:c,x:d,y:f,nullAsValid:r,zeroCountAsValid:i,aggregationType:e.series[0].query?.outStatistics?.[0]?.statisticType}));break}case p.BoxPlotSeries:{if(be(e)){let c=e.series;u=Pm({configSeries:c,boxPlotDataItem:l,yList:o,showOutliers:e.showOutliers})}break}case p.PieSeries:{let c=l,{x:d,y:f}=e.series[0];H(e.series)===S.PieFromFields&&(d=Fe,f=Ue);let m=c[f];u=c[d]!==void 0&&c[d]!==null&&!jn(m)&&mt(Number(m),r)}break;case p.GaugeSeries:{let{x:c}=e.series[0];u=mt(l[c],r)}break;case p.HeatSeries:u=n.some(c=>mt(c[_.valueField],r));break}return u})}}return a}function Vm(t,e){let r=new Map,i=e??Go(t),n=H(t);return t.forEach(a=>{if(i.includes(a.id)){let s=Yo(a,n);if(s.length>0){let o=r.get(a.type)??[];o.push(...s),r.set(a.type,o)}}}),r}function Qo(t,e){let r=0;return e.forEach(i=>{let n=t[i];typeof n=="number"&&Number.isFinite(n)&&(r+=n)}),r}function Jo(t,e){let r;return Number.isFinite(t)&&Number.isFinite(e)&&e>0&&(r=t/e),r}function O0(t,e){let r;return e.forEach(i=>{t.forEach(n=>{let a=n[i];typeof a=="number"&&a>0&&(r===void 0||a<r)&&(r=a)})}),r}function $m(t){let{dataItems:e,seriesConfig:r,filteredSeriesIds:i}=t,n=he(r,i),a;return e.forEach(s=>{let o=Qo(s,n);o>0&&n.forEach(l=>{let u=s[l];if(typeof u=="number"&&u>0){let c=Jo(u,o);if(c!==void 0){let d=c*100;(a===void 0||d<a)&&(a=d)}}})}),a}function Rm(t){let{seriesConfig:e,filteredSeriesIds:r,filteredData:i,stackedType:n}=t,a=e.find(f=>f.type===p.LineSeries||f.type===p.RadarSeries)?.stackNegativeValuesToBaseline??!0,s=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,l=!1,u=i,c=Vm(e,r),d=r?j(e.filter(f=>r?.includes(f.id))):j(e);if(u.forEach(f=>{c.forEach((m,g)=>{let h=d!==p.ComboLineAndBarSeries||g===p.BarSeries;if(a){let y=0,b=0,x=!1,w=!1;for(let C=0;C<m.length;C+=1){let v=f[m[C]];Number.isFinite(v)&&(v<0?(b+=v,w=!0,h&&(l=!0)):(y+=v,x=!0))}s=x?Math.max(s,y):s,o=w?Math.min(o,b):o,x&&!w&&(o=Math.min(o,y)),!x&&w&&(s=Math.max(s,b)),h&&x&&y<=0&&(l=!0)}else{let y=0;for(let b=0;b<m.length;b+=1){let x=f[m[b]];y+=x,s=Math.max(s,y),o=Math.min(o,y)}h&&(s<=0||o<=0)&&(l=!0)}})}),n===Be.Stacked100&&!l){let f=$m({dataItems:u,seriesConfig:e,filteredSeriesIds:r});f!==void 0&&(o=f,s=100)}return{stackedMinY:o,stackedMaxY:s,dataHasNegativeValues:l}}function Wm(t){let{dataItem:e,...r}=t,i=ce({key:P.Min,...r}),n=ce({key:P.Max,...r}),a=e[i],s=e[n];return{min:a,max:s}}function eo(t){let e=Number.NaN,r=Number.NaN,i,n,{chartConfig:a,chartData:s,filteredSeriesIds:o}=t,{series:l}=a;if(l?.length>0){let{x:u}=l[0],c=j(a.series);if(c===p.HistogramSeries&&s.length>0){let d=s[0]?.[Rs.Start],f=s[s.length-1]?.[Rs.End];i=typeof d=="number"?d:i,n=typeof f=="number"?f:n}else{let d=s.filter(f=>f[u]!==null);if({min:i,max:n}=Sr(d,f=>f[u]),a.axes?.[0]?.valueFormat.type===p.DateAxisFormat&&i!==void 0&&n!==void 0&&([i,n]=[new Date(i).valueOf(),new Date(n).valueOf()]),c===p.BoxPlotSeries){e=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;let f=he(l,o),m=H(l),g="standardizeValues"in a?a.standardizeValues===!0:void 0,h=a.series.map(y=>y.visible!==!1?Se({where:y.query?.where}):"");h.length===0&&h.push(" "),d.forEach(y=>{f.forEach(b=>{let x=m===S.BoxPlotC4MultiFieldsAndCategory?b:void 0;h.forEach(w=>{let{min:C,max:v}=Wm({y:x,splitByValue:w,chartSubType:m,showOutliers:!1,standardizeValues:g,dataItem:y});C!=null&&C<e&&(e=C),v!=null&&v>r&&(r=v)})})})}else{let f=Pr(a);switch(f){case Be.Stacked100:case Be.Stacked:{let{stackedMinY:m,stackedMaxY:g}=Rm({seriesConfig:l,filteredData:d,filteredSeriesIds:o,stackedType:f});e=m,r=g;break}case Be.Side:default:{e=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,he(l,o).forEach(m=>{let{min:g,max:h}=Sr(d,y=>y[m]);g!==void 0&&g<e&&(e=g),h!==void 0&&h>r&&(r=h)});break}}}}}return{minY:e,maxY:r,minX:i,maxX:n}}function jm(t){let{chartConfig:e,isSecondaryYAxis:r,seriesIds:i}=t,n=i;return e.axes?.length===3&&(n=e.series.map(a=>{let s="";return(i===void 0||i.includes(a.id))&&(r===!0&&"assignToSecondValueAxis"in a&&a.assignToSecondValueAxis===!0||r!==!0&&(!("assignToSecondValueAxis"in a)||a.assignToSecondValueAxis!==!0))&&({id:s}=a),s}).filter(a=>a!=="")),n}function Zm(t){let e=!1;if(t){let r=t.axes?.[0],i=r?.isLogarithmic===!0,n=r?.valueFormat?.type;e=(n===p.NumberAxisFormat||n===p.DateAxisFormat)&&i}return e}function to(t,e){let r=!1;return Number.isFinite(t)&&t!==Number.MAX_SAFE_INTEGER&&Number.isFinite(e)&&e!==Number.MIN_SAFE_INTEGER&&(r=t<=0||e<=0),r}function _m(t){let{chartConfig:e,chartData:r,axisConfigIndex:i}=t,n=!1;if(i===0){if(Zm(e)){let{minX:a,maxX:s}=eo({chartConfig:e,chartData:r});n=to(a,s)}}else{let a=jm({chartConfig:e,isSecondaryYAxis:i===2}),{minY:s,maxY:o}=eo({chartConfig:e,chartData:r,filteredSeriesIds:a});n=to(s,o)}return n}function B0(t){let{chartConfig:e,axisConfigIndex:r,chartData:i}=t,n=!0,a=e?.axes?.[r];return e&&i&&a?.isLogarithmic===!0&&(n=!_m({chartConfig:e,chartData:i,axisConfigIndex:r})),n}function zm(t,e){let r=t;if(e?.[0]!==void 0&&H(e)===S.PieFromFields){let{x:i,y:n}=e[0];(Lr(t)?r:r.dataItems).forEach(a=>(Fe in a&&i!==Fe&&(a[i]=a[i]!==void 0?a[i]:a[Fe],delete a[Fe]),Ue in a&&n!==Ue&&(a[n]=a[n]!==void 0?a[n]:a[Ue],delete a[Ue]),a))}return r}function Um(t,e){let r=j(e),i=t,n=e?.[0];if((r===p.PieSeries||r===p.BoxPlotSeries||r===p.LineSeries||r===p.RadarSeries||r===p.BarSeries||r===p.HeatSeries||r===p.ComboLineAndBarSeries)&&n!==void 0){let a=Lr(t),s=a?t:t.dataItems;if(t!==void 0){let{originalXValue:o,originalYCategoryValue:l,xAxisField:u}=F,c=r===p.HeatSeries?_.xField:n.x,d=r===p.HeatSeries?_.yField:void 0;s=s.map(f=>{let m=f[c];f[o]!==void 0&&(m=f[o]);let g={...f,[c]:m};if(delete g[o],delete g[u],d){let h=f[d];f[l]!==void 0&&(h=f[l]),g={...g,[d]:h},delete g[l]}return g}),a?i=s:"dataItems"in i&&(i.dataItems=s)}}return i}function ro(t){let e={...t};delete e[F.technicalSortingFieldBySum],delete e[F.technicalSortingFieldByPercent],delete e[F.pieChart.technicalFieldSlicePercent],delete e[F.pieChart.technicalFieldGroupedSlices],delete e[F.firstTemporalBin],delete e[F.lastTemporalBin],delete e[F.originalServerBinningRange],delete e[F.technicalFieldSplitByField],delete e[W.uniqueIds],Object.keys(e).filter(i=>i.includes(F.rendererSymbolField)).forEach(i=>delete e[i]);let r=or(e);return r.isInItem&&delete e[r.expr??""],e}function Hm(t,e){let r=t,i=j(e),n=qn(r);if(n!==void 0)switch(i){case p.ComboLineAndBarSeries:case p.BarSeries:case p.LineSeries:case p.RadarSeries:case p.PieSeries:{n=n.map(ro),r={dataItems:n};let{timeIntervalInfo:a,serverLimitReached:s,chartLimitsReached:o}=t??{};Zn(a)||(r.timeIntervalInfo=a),s!==void 0&&(r.serverLimitReached=s),o!==void 0&&(r.chartLimitsReached=o)}break;case p.ScatterSeries:r={...r,dataItems:n.map(ro)};break}return r}var I0=(t,e)=>{let r=10**e;return Math.round(t*r)/r};function A0(t){let{data:e,seriesConfig:r}=t,i=Ye(e);return i!==void 0&&(i=Um(i,r),i=Hm(i,r),i=zm(i,r)),i}function Gm(t){let{dataFetchingResults:e,series:r}=t,i=j(r),n=H(r),a=[],s=new Map,o=e.length;for(let l=0;l<o;l+=1){let u=e[l];if(u!==void 0){let c;if(i===p.ScatterSeries)c=u.dataItems;else if("data"in u&&u.data){let d=u.data;"dataItems"in d&&(c=d.dataItems),"outliers"in d&&d.outliers&&a.push(...d.outliers),"meanLines"in d&&d.meanLines&&a.push(...d.meanLines)}if(c)if(r[0].type===p.HeatSeries)o>0&&c.forEach(d=>{s.set(`${d[_.xField]}-${d[_.yField]}`,d)});else if(r[0].type===p.ScatterSeries){let{x:d,y:f}=r[0];a.push(...c.map(m=>({[d]:m[d],[f]:m[f]})))}else u.valid&&(n===S.PieFromFields?a=fi({dataToConvert:c[0],x:Fe,y:Ue}):n===S.BarAndLineFromFields?a=fi({dataToConvert:c[0],x:r[0].x,y:r[0].y}):a.push(...c))}}return s.size>0&&(a=Array.from(s.values())),a}async function Ym(t){let{selectionOIDs:e,selectionFilters:r,chartConfig:i,queryConfig:n,errorStrings:a,queryObject:s,splitByField:o,replaceNoValueCategoryWithZero:l,hideZeroCountCategories:u,chartLimits:c,setTimeBinningInfoWhenNotProvided:d,returnFeaturesExtent:f,returnStatisticsAggregatedIds:m,popupTemplateFieldInfosEnabled:g,view:h}=t,{series:y}=i,b=j(y),x=[],{maxOIDsPerSelectionQuery:w,maxElementsPerSelectionQuery:C}=sr(),v=r&&r.length>0?Math.ceil(r.length/C):void 0,T=Math.ceil(e.length/w),O=v?v<=T:!1,I=(O?v:T)??1;for(let B=0;B<I;B+=1){let N={...n};if(O&&r){let A=xn({queryIndex:B,batchSize:C,filterList:r});N.where=te([N.where,te(A,"OR")])}else{let A=xn({queryIndex:B,batchSize:w,filterList:e});N.objectIds=A}switch(b){case p.HeatSeries:x.push(zo({completeHeatChartDataset:!1,fetchMatrixUniqueCategories:!1,chartConfig:i,queryConfig:N,queryObject:s,errorStrings:a,chartLimits:c,returnFeaturesExtent:f,returnStatisticsAggregatedIds:m,popupTemplateFieldInfosEnabled:g,view:h}));break;case p.PieSeries:case p.BarSeries:case p.LineSeries:case p.RadarSeries:case p.ComboLineAndBarSeries:if(it({xAxisValueFormatType:We(i),setTimeBinningInfoWhenNotProvided:d,seriesConfig:y[0],queryObject:s})){let A=Ye(i);"temporalBinning"in A.series[0]&&A.series[0].temporalBinning&&(A.series[0].temporalBinning.trimIncompleteTimeInterval=!1,er(o,s)&&(delete A.series[0].temporalBinning.start,delete A.series[0].temporalBinning.end)),x.push(Ln({chartConfig:A,queryConfig:N,queryObject:s,chartLimits:c,setTimeBinningInfoWhenNotProvided:d,returnFeaturesExtent:f,returnStatisticsAggregatedIds:m,popupTemplateFieldInfosEnabled:g,view:h,errorStrings:a}))}else x.push(Fm({queryObject:s,chartConfig:i,chartLimits:c,setTimeBinningInfoWhenNotProvided:d,returnFeaturesExtent:f,returnStatisticsAggregatedIds:m,popupTemplateFieldInfosEnabled:g,errorStrings:a,queryConfig:N}));break;case p.BoxPlotSeries:x.push(xm({queryObject:s,chartConfig:i,replaceNoValueCategoryWithZero:l,hideZeroCountCategories:u,chartLimits:c,setTimeBinningInfoWhenNotProvided:d,returnFeaturesExtent:f,returnStatisticsAggregatedIds:m,popupTemplateFieldInfosEnabled:g,view:h,errorStrings:a,queryConfig:N}));break;case p.ScatterSeries:x.push(Uo({queryObject:s,chartConfig:i,queryConfig:N,replaceNoValueCategoryWithZero:l,hideZeroCountCategories:u,chartLimits:c,setTimeBinningInfoWhenNotProvided:d,returnFeaturesExtent:f,returnStatisticsAggregatedIds:m,popupTemplateFieldInfosEnabled:g,view:h,errorStrings:a,sortData:!1,calculateTrendLine:!1}));break;case p.HistogramSeries:x.push(Bd({queryObject:s,queryConfig:N,chartConfig:i,x:y[0].x,errorStrings:a}));break}}return await Promise.all(x)}async function M0(t){let{chartConfig:e,chartData:r,dataWasUpdated:i,replaceNoValueCategoryWithZero:n,hideZeroCountCategories:a,queryObject:s,errorStrings:o,selectionIDsChanged:l,chartLimits:u,setTimeBinningInfoWhenNotProvided:c,returnFeaturesExtent:d,returnSelectionOIDs:f,popupTemplateFieldInfosEnabled:m,view:g,viewExtentUpdated:h,runtimeDataFilters:y,ignoreViewExtent:b,selectionData:x}=t,{series:w}=e,{selectionItems:C,selectionOIDs:v}=x??{},T,O=j(w),I=J(s),B=O!==p.HistogramSeries&&O!==p.HeatSeries&&C!==void 0&&C.length>0&&!(w[0].x in C[0])&&!(Fe in C[0])&&!(F.boxPlot.boxPlotCategory in C[0]);if(h!==!0&&f!==!1&&v!==void 0&&v.length>0&&(i===!0||B||l)){let N=qn(r),A=al({queryObject:s,chartConfig:e,runtimeDataFilters:y,ignoreViewExtent:b,view:g}),D=de(e.series[0]?.query?.where),E=he(e.series),M=tt(e.series[0].query?.where);if(N&&!Qm(N)&&N.some(V=>I.objectIdField in V))T=N.filter(V=>{let $=V[I.objectIdField];return(typeof $=="number"||typeof $=="string")&&v.includes($)});else if(N){let V=new Set(v),$=new Set;N?.some(k=>Object.keys(k).some(Y=>{let R=!1;if(Y.startsWith(W.uniqueIds)){let X=k[Y];R=Array.isArray(X)&&X.length>0}return R}))&&N&&(T=Ye(N).filter(k=>{let Y=!1,R=[];return Object.keys(k).forEach(X=>{if(X.startsWith(W.uniqueIds)){let ie=k[X],ve=!1;ie?.forEach(St=>{V.has(St)&&($.add(St),ve=!0)}),ve&&R.push(X.replace(`${W.uniqueIds}_`,""))}}),Y=R.length>0,M||E.forEach(X=>{R.includes(X)||(delete k[X],delete k[`${W.uniqueIds}_${X}`],delete k[`${F.rendererSymbolField}_${X}`])}),Y}));let G=v.filter(k=>!$.has(k));if(G?.[0]!==void 0&&A&&T?.length!==N.length){let k=await Ym({selectionOIDs:G,selectionFilters:x?.selectionFilters,queryConfig:A,queryObject:s,replaceNoValueCategoryWithZero:n,hideZeroCountCategories:a,chartLimits:u,setTimeBinningInfoWhenNotProvided:c,returnFeaturesExtent:d,returnStatisticsAggregatedIds:!1,popupTemplateFieldInfosEnabled:m,view:g,splitByField:D,errorStrings:o,chartConfig:e});T??=[],T.push(...Gm({dataFetchingResults:k,series:w}))}}}return T}function Qm(t){return t.length>0&&t[0].type===p.HistogramBin}function Jm(t){let{chartConfig:e,queryObject:r}=t,i=!1;if(e.chartRenderer)i=!0;else{let{series:n}=e,a=j(n),s=H(n),o=pt(e),l=it({seriesConfig:o,queryObject:r}),u=J(r),c=u?.renderer;switch(c?.type){case ye.Simple:i=a===p.HistogramSeries||a===p.ScatterSeries||s===S.BarAndLineMonoField||s===S.BoxPlotC1MonoField||s===S.BoxPlotC2MultiFields||s===S.BoxPlotC3MonoFieldAndCategory||s===S.BarAndLineNoAggregation&&n.length===1&&!l;break;case ye.UniqueValue:{let d=c?.field,f=de(o.query?.where),{x:m}=o;i=(s===S.BoxPlotC5MonoFieldAndSplitBy||s===S.BoxPlotC6MultiFieldsAndSplitBy||s===S.BoxPlotC7MonoFieldAndCategoryAndSplitBy||s===S.BarAndLineSplitByNoAggregation||s===S.BarAndLineSplitBy)&&d===f||(s===S.BoxPlotC3MonoFieldAndCategory||s===S.PieFromCategory||s===S.BarAndLineMonoField)&&d===m||s===S.BarAndLineNoAggregation||s===S.PieNoAggregation||a===p.ScatterSeries}break;case ye.PieChart:i=s===S.PieFromFields||s===S.BarAndLineFromFields||s===S.BarAndLineMultiFields||s===S.BarAndLineMonoField||s===S.BoxPlotC1MonoField||s===S.BoxPlotC2MultiFields||s===S.BoxPlotC3MonoFieldAndCategory||s===S.BoxPlotC4MultiFieldsAndCategory;break;case ye.ClassBreaks:i=a===p.HeatSeries||a===p.ScatterSeries||s===S.BarAndLineNoAggregation||s===S.PieNoAggregation;break;case ye.Dictionary:case ye.DotDensity:case ye.Heatmap:break;default:i=se(u)&&(s===S.BarAndLineMonoField||s===S.BarAndLineSplitBy||s===S.BarAndLineSplitByNoAggregation);break}}return i}function Km(t,e){return fd(t?.type)??e?.type}function Xm(t){let e=F.rendererSymbolField,r=e in t?e:void 0;if(!r){let i=t[F.originalXValue];r=Object.keys(t).find(n=>{let a=t[n];return n.includes(e)&&a?.label&&a?.uniqueValue===i}),r||(r=Object.keys(t).find(n=>n.includes(e))??"")}return t[r]?.label}function eg(t){return t?.type!==void 0&&(t.color!==void 0||t.label!==void 0||t.style!==void 0||t.outline!==void 0)}function Ko(t){let{symbolField:e,dataItem:r,rendererSymbol:i,rendererOrigin:n}=t,a=!1;if(!eg(i))delete r[e];else{let s={...i};s.color!==void 0&&n===Kt.LayerRenderer&&(s.color[3]=Ti*255),n===Kt.LayerRenderer&&(delete s.style,delete s.outline,delete s.label),r[e]=s,a=!0}return a}function tg(t){let{renderer:e,seriesConfig:r,chartSubType:i,dataItem:n,rendererOrigin:a}=t,s,o=!1,l=j(r),{outline:u,attributes:c}=e;return c.forEach(d=>{let{field:f}=d,{color:m,label:g}=d,h;Array.isArray(m)&&m?.length===4?h=m:m&&"toRgba"in m&&(h=m.toRgba());let y=!1,b=!0;switch(l){case p.BarSeries:case p.LineSeries:case p.ComboLineAndBarSeries:case p.RadarSeries:if(i!==S.BarAndLineFromFields){let x=r.find(w=>w.query?.outStatistics?.[0]?.onStatisticField===f);x!==void 0&&"y"in x?f=[x.y].flat()[0]:f=""}y=i!==S.BarAndLineFromFields||f===n[F.originalXValue];break;case p.PieSeries:y=i===S.PieFromFields&&f===n[F.originalXValue];break;case p.BoxPlotSeries:i===S.BoxPlotC1MonoField||i===S.BoxPlotC3MonoFieldAndCategory?y=f===r[0].y:f&&(i===S.BoxPlotC2MultiFields||i===S.BoxPlotC4MultiFieldsAndCategory)&&(y=r.map(x=>x.y).flat().includes(f)),b=!1;break}y&&h&&(s={type:Ie.SMS,color:h,label:b&&g?g:void 0},u!=null&&(s.outline=u),Ko({dataItem:n,symbolField:i===S.BarAndLineFromFields||i===S.PieFromFields?F.rendererSymbolField:`${F.rendererSymbolField}_${f}`,rendererSymbol:s,rendererOrigin:a})&&(o=!0))}),{rendererSymbol:s,colorMatchApplied:o}}function rg(t){let{seriesConfig:e,chartSubType:r,rendererType:i}=t,n=F.rendererSymbolField,a=i===void 0,s=n;if(i===ye.UniqueValue||a){if(Ei(r)){let o=Se({where:e.query?.where,keepSurroundingQuotes:!1,escape:!1});o===null?s=F.nullValue:r===S.BarAndLineSplitBy&&typeof e.y=="string"?s=e.y:r===S.BarAndLineSplitByNoAggregation&&typeof e.y=="string"?s=`${e.y}_${o}`:s=`${o}`}}else if(i===ye.PieChart)switch(r){case S.BoxPlotC2MultiFields:s=Array.isArray(e.y)?e.y.flat():e.y;break;case S.BarAndLineMonoField:case S.BarAndLineMultiFields:case S.BoxPlotC1MonoField:case S.BoxPlotC3MonoFieldAndCategory:case S.BoxPlotC4MultiFieldsAndCategory:s=e.y;break}return s}function Xo(t){let{seriesConfig:e,chartSubType:r,rendererType:i,dataItem:n}=t,a=rg({seriesConfig:e,chartSubType:r,rendererType:i});return a instanceof Array&&e.type===p.BoxPlotSeries&&i===ye.PieChart&&n!==void 0&&(a=a.find(s=>s===n[ar])??a[0]),a=a!==F.rendererSymbolField?`${F.rendererSymbolField}_${a.toString()}`:a,a}function ig(t){let{chartRenderer:e,queryObject:r}=t,i=e!==void 0?{...J(r),renderer:xr.fromJSON(e)}:J(r);return new nc({layer:i})}async function ng(t){let{seriesConfig:e,dataItem:r,renderer:i,rendererType:n,rendererOrigin:a,chartSubType:s,splitByField:o,graphicTemplate:l,rendererFieldNames:u,mapAttributesToSymbol:c}=t,d,f=!1;if(n===ye.PieChart){let m=tg({renderer:i,seriesConfig:e,chartSubType:s,dataItem:r,rendererOrigin:a});d=m.rendererSymbol,f=m.colorMatchApplied}else if(r?.[Dr.defaultGroupOfSlicesId]!==!0){let{x:m}=e[0],g=new Map;o&&o.trim()!==""?e.forEach(h=>{if(h.type===p.BarSeries||h.type===p.LineSeries||h.type===p.BoxPlotSeries||h.type===p.RadarSeries){let y=Xo({seriesConfig:h,chartSubType:s,rendererType:n,dataItem:r}),b=Se({where:h.query?.where,normalize:!0,keepSurroundingQuotes:!1,escape:!1});g.set(y,{...r,[o]:b})}}):e[0].type===p.HeatSeries&&n===ye.ClassBreaks?g.set(F.rendererSymbolField,{[_.valueField]:r[_.valueField]}):g.set(j(e)===p.HistogramSeries?F.rendererSymbolFieldForHistogram:F.rendererSymbolField,{...r,[m]:ug(r)});try{let h=Array.from(g.entries()),y=l.clone();y.layer=l.layer;let b=i?.uniqueValueInfos;for(let x=0;x<h.length;x+=1){let[w,C]=h[x];if(io({mode:"encode",x:m,splitByField:o,attributes:C}),u&&u.length>0&&Object.keys(C).forEach(v=>{u.includes(v)||delete C[v]}),y.attributes=C,c?.has(JSON.stringify(C)))d=c.get(JSON.stringify(C));else{if(d=(await ir.getDisplayedSymbol(y))?.toJSON(),d!=null){if(d.color===void 0){let T=(await ir.getDisplayedColor(y))?.toJSON();T&&(d.color=T.length===4?T:[...T,255])}let v=await ir.getLegendLabel(y);v!=null&&v!==""&&(d.label=v,d.uniqueValue=b?.find(T=>T.label===v)?.value??void 0)}c?.set(JSON.stringify(C),d)}io({mode:"revert",x:m,splitByField:o,attributes:C}),Ko({dataItem:r,symbolField:w,rendererSymbol:d,rendererOrigin:a})&&(f=!0)}}catch{}}return{rendererSymbol:d,colorMatchApplied:f}}function io(t){let{splitByField:e,attributes:r,x:i,mode:n}=t;[i,e??""].forEach(a=>{r[a]===(n==="encode"?null:F.nullValue)&&(r[a]=n==="encode"?F.nullValue:null)})}function ag(t){let{dataItem:e,seriesConfig:r,chartSubType:i,colorMatch:n,rendererType:a}=t,s;if(n&&e!==void 0){let o=Xo({seriesConfig:r,chartSubType:i,rendererType:a,dataItem:e});s=e[o]}return s}function E0(t){let{seriesSymbol:e,rendererSymbol:r,colorIndex:i}=t,n=r?.color??e.color;n=n??Bi({colorIndex:i,opacity:Ti});let a={...e,color:n},s=a.type===Ie.SFS&&dd(a.style);return r?.type===e.type&&r.style!==void 0&&!s&&(a.style=r.style),a.type!==Ie.SLS&&(a.outline={type:Ie.SLS,style:r?.outline?.style??a.outline?.style,width:r?.outline?.width??a.outline?.width,color:r?.outline?.color??a.outline?.color??r?.color}),a}function sg(t){let e=[];return t&&(e=t.series.flatMap(r=>r.query?.outStatistics?.map(i=>i.onStatisticField)).filter(r=>r!==void 0),e.length===0&&(e=he(t.series))),e}function L0(t,e){let r=!1;if(t&&e&&e.length>0&&Ii(t)){let i=hd(t),n=pt(t);i?r=sg(t).some(a=>e.includes(a)):r=e.includes(n.x)}return r}function og(t){let e=[];if(t&&"type"in t&&typeof t.type=="string")switch(t.type){case"uniqueValue":case"unique-value":"field1"in t&&typeof t.field1=="string"&&(e=[t.field1]);break;case"classBreaks":case"class-breaks":"field"in t&&typeof t.field=="string"&&(e=[t.field]);break;case"pieChart":case"pie-chart":"attributes"in t&&Array.isArray(t.attributes)&&(e=t.attributes.map(r=>r.field));break}return e}function lg(t){let e;return t?.[0]!==void 0&&(e=t.reduce((r,i)=>({...r,xmin:Math.min(r.xmin,i.xmin),xmax:Math.max(r.xmax,i.xmax),ymin:Math.min(r.ymin,i.ymin),ymax:Math.max(r.ymax,i.ymax)}),t[0])),e}function no(t){let{value:e,dataContext:r,specificField:i,keepNullValues:n=!1,useRendererLabel:a=!1,config:s}=t,o=e,{originalXValue:l}=F;if(r!==void 0){let u=a?Xm(r):void 0;i!==void 0&&r[i]!==void 0?o=r[i]:u!==void 0?o=u:r[F.xAxisDisplayField]!==void 0?o=r[F.xAxisDisplayField]:r[F.xAxisField]!==void 0?o=r[F.xAxisField]:r[F.boxPlot.boxPlotCategory]!==void 0?o=r[F.boxPlot.boxPlotCategory]:r[l]!==void 0?o=r[l]:r[Fe]!==void 0&&(o=r[Fe]),!n&&(o===null||o===F.nullValue)&&(o=xh(s)??F.nullCategory?.text??"null")}return o}function Pn(t){let{value:e,dataContext:r}=t,i=e,{originalXValue:n}=F;return r?.[n]!==void 0?i=r[n]:r?.[Fe]!==void 0&&(i=r[Fe]),i}function ug(t){return t?.[F.originalXValue]}function vr(t){let{arrayToSort:e,orderBy:r,sortingField:i,forceAscendingOrder:n,isNonAggregated:a,sortByCategory:s,preferLabel:o,isPieOrByFieldsChart:l}=t;if(e!==void 0&&e.length>1){let u=r===Ce.Descending&&n!==!0;e.sort((c,d)=>{let f=0,m=c[i];s===!0&&!l&&(m=no({value:`${c[i]?.toString()}`,dataContext:c,specificField:o?F.xAxisField:F.originalXValue}));let g=d[i];s===!0&&!l&&(g=no({value:`${d[i]?.toString()}`,dataContext:d,specificField:o?F.xAxisField:F.originalXValue})),a===!0&&u&&s===!0&&(m=Number.isNaN(Number.parseFloat(`${m?.toString()}`))?m:Number.parseFloat(m),g=Number.isNaN(Number.parseFloat(`${g?.toString()}`))?g:Number.parseFloat(g));let h=c[F.originalXValue]===null||c[Dr.defaultGroupOfSlicesId]===!0,y=d[F.originalXValue]===null||d[Dr.defaultGroupOfSlicesId]===!0;return h&&!y?f=1:!h&&y?f=-1:typeof m=="string"&&typeof g=="string"?(f=m.localeCompare(g,void 0,{numeric:!0}),u&&(f*=-1)):m===void 0?f=u?-1:1:g===void 0?f=u?1:-1:m!==null&&g!==null&&(m>g?f=u?-1:1:m<g&&(f=u?1:-1)),f})}}function cg(t){let{arrayToSort:e,orderBy:r,sortingField:i,fieldList:n,isByFieldsChart:a,preferLabel:s}=t;e!==void 0&&e.length>1&&!le(i)&&r!==void 0&&r.length>0&&e.sort((o,l)=>{let u=o[i];s&&a&&typeof u=="string"&&(u=Vr(n,u));let c=r.indexOf(u?.toString()??"");c===-1&&(c=r.length);let d=l[i];s&&a&&typeof d=="string"&&(d=Vr(n,d));let f=r.indexOf(d?.toString()??"");return f===-1&&(f=r.length),c-f})}function dg(t,e){let r=t;switch(e){case ae.Log:r=`log(${t})`;break;case ae.Sqrt:r=`power(CAST(${t} AS FLOAT),0.5)`;break}return r}function rr(t){let e=new Date(t).valueOf();return Number.isNaN(e)||(e=new Intl.DateTimeFormat("en-US",F.dateFormatUTC).format(t).replace(",","")),e}function fi(t){let{dataToConvert:e,x:r,y:i,fieldList:n}=t,a=[];if(e){let s=e[Ke];Object.entries(e).forEach(([o])=>{if(o!==""&&o!==Ke&&o in e){let l={[r]:Vr(n,o),[i]:e[o],[F.xAxisField]:o,[F.originalXValue]:o};s!==void 0&&(l[Ke]=s),e[`${F.rendererSymbolField}_${o}`]!==void 0&&(l[F.rendererSymbolField]=e[`${F.rendererSymbolField}_${o}`]),a.push(l)}})}return a}function fg(t,e){let r=!0;if(t!==void 0&&t.length>1&&!le(e)){let i=0,n=0,a=0;t.forEach(s=>{let o=s[e];!Jn(o)||o===0?a+=1:o>0?i+=1:n+=1}),r=a===t.length||i>=0&&n===0||i===0&&n>=0}return r}function Jt(t){let{countTotal:e,countPerSeries:r,numberOfSeries:i}=t,n,a=[];return typeof e=="number"&&Number.isFinite(e)&&a.push(e),typeof r=="number"&&Number.isFinite(r)&&a.push(r*i),a.length>0&&(n=Math.min(...a)),n}function kn(t,e){let r,{maxBarChartSeriesCount:i,maxBarUniqueSeriesCountTotal:n,maxBarTwoSeriesCountPerSeries:a,maxBarTwoSeriesCountTotal:s,maxBarThreePlusSeriesCountPerSeries:o,maxBarThreePlusSeriesCountTotal:l,maxLineChartSeriesCount:u,maxLineUniqueSeriesCountTotal:c,maxLineTwoSeriesCountPerSeries:d,maxLineTwoSeriesCountTotal:f,maxLineThreePlusSeriesCountPerSeries:m,maxLineThreePlusSeriesCountTotal:g,maxPieChartSliceCountTotal:h,maxGaugeByFeaturesLimit:y,maxRadarChartSeriesCount:b,maxRadarUniqueSeriesCountTotal:x,maxRadarTwoSeriesCountPerSeries:w,maxRadarTwoSeriesCountTotal:C,maxRadarThreePlusSeriesCountPerSeries:v,maxRadarThreePlusSeriesCountTotal:T,maxHeatChartCellLimit:O,serialChart:{series:I,elements:B},pieChart:{slices:N},gauge:{features:A},heatChart:{cells:D}}=xt(e),E=j(t.series),M=t.series.length===0?1:t.series.length,V=H(t.series);switch(E){case p.ComboLineAndBarSeries:case p.BarSeries:M<=(i??I)&&(M===1?r=n??B:M===2?r=Jt({countTotal:s??B,countPerSeries:a,numberOfSeries:M}):M>2&&(r=Jt({countTotal:l??B,countPerSeries:o,numberOfSeries:M})));break;case p.LineSeries:M<=(u??I)&&(M===1?r=c??B:M===2?r=Jt({countTotal:f??B,countPerSeries:d,numberOfSeries:M}):M>2&&(r=Jt({countTotal:g??B,countPerSeries:m,numberOfSeries:M})));break;case p.RadarSeries:M<=(b??I)&&(M===1?r=x??B:M===2?r=Jt({countTotal:C??B,countPerSeries:w,numberOfSeries:M}):M>2&&(r=Jt({countTotal:T??B,countPerSeries:v,numberOfSeries:M})));break;case p.PieSeries:r=h??N;break;case p.GaugeSeries:r=y??A;break;case p.HeatSeries:r=O??D;break;case p.ScatterSeries:case p.HistogramSeries:case p.BoxPlotSeries:}return(V===S.BarAndLineNoAggregation||V===S.BarAndLineMultiFields)&&r!==void 0&&(r=Math.ceil(r/M)),r}function ao(t,e){let r=t;if(Number.isFinite(t)){let{factor:i,offset:n}=e??{};Number.isFinite(i)&&(r*=i),Number.isFinite(n)&&(r+=n)}return r}function mg(t){let e=!1;if(t!==void 0){let r=t.replace(" ",""),i=/^%(0*100{1,1}\.?((?:\.)0*)?$)|(^%0*\d{0,2}\.?((?:\.)\d*)?)$/u,n=/^(0*100{1,1}\.?((?:\.)0*)?%$)|(^0*\d{0,2}\.?((?:\.)\d*)?%)$/u;e=i.test(r)||n.test(r)}return e}function q0(t){let e;if(mg(t)){let r=/%(\d{1,3}(.\d+)?)$/u,i=/(\d{1,3}(.\d+)?)%$/u,n=t.replace(" ",""),a=r.exec(n)?.[1]??i.exec(n)?.[1];a!==void 0&&(e=Number(a))}return e}var gg=50,hg=4194304;function yg(t){let{layer:e,chartConfig:r,rawData:i}=t,n,a=r.series[0],{x:s,y:o}=a,{idField:l}=He(e),u=Lt(e);if(u){let c=u.bandInfos,d=c.length===1,f=d?c?.[0].name:"";n=i.map(m=>({...d&&{[s]:m.attributes?.[f],[o]:m.attributes?.[f]},...m.attributes,[W.uniqueIds]:m.attributes?.[l]}))}return n??[]}async function pg(t){let{queryObject:e,queryConfig:r,filterByViewExtent:i,abortKey:n,abortSignal:a}=t,s=a??(n!==void 0?It.get(n)?.signal:void 0);if(!e||!se(e))throw new ge(pe.LayerNotSupported);let o=J(e),l=await Nr(o,s);if(!l)throw new Error("Raster info is not available for the layer.");let u=l.extent;if(!i&&!r.geometry&&ot(o)&&Cr(o))try{let c=o.createQuery(),{extent:d}=await o.queryExtent(c,{signal:s});d&&(u=d)}catch{}return await Ag({queryObject:e,queryConfig:r,imagerySkipFactor:gg,imageryMaxPixelCount:hg,defaultQueryGeometry:u,abortSignal:s})}async function Sg(t){let{chartConfig:e,queryConfig:r,queryObject:i,filterByViewExtent:n,sortData:a,calculateTrendLine:s,errorStrings:o,abortKey:l,abortSignal:u}=t;if(!i)throw new Error("QueryObject is undefined!");let c=await pg({queryObject:i,queryConfig:r,filterByViewExtent:n,abortKey:l,abortSignal:u}),d=yg({layer:i,chartConfig:e,rawData:c});a!==!1&&vr({arrayToSort:d,sortingField:e.series[0].x,orderBy:Ce.Ascending});let f=new Map,{r2:m,trendLinePoints:g}=s!==!1?await Fo({data:d,statsMap:f,queryConfig:r,queryObject:i,chartConfig:e,errorStrings:o,abortSignal:u}):F.scatterplotSeries;return{dataItems:d,r2:m,trendLinePoints:g}}var bg=t=>({x:t.series[0].x,y:t.series[0].y});function vg(t){let{chartConfig:e,layer:r,selectionItems:i}=t,n;if(i.length>0){let{x:a,y:s}=bg(e),o=mi(r,a),l=mi(r,s);if(o!==void 0&&l!==void 0&&o!==l){let u=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER,d=Number.MAX_SAFE_INTEGER,f=Number.MIN_SAFE_INTEGER;i.forEach(m=>{let g=m[a],h=m[s];typeof g=="number"&&(g<u&&(u=g),g>c&&(c=g)),typeof h=="number"&&(h<d&&(d=h),h>f&&(f=h))}),u!==Number.MAX_SAFE_INTEGER&&c!==Number.MIN_SAFE_INTEGER&&d!==Number.MAX_SAFE_INTEGER&&f!==Number.MIN_SAFE_INTEGER&&(n={xBandId:o,yBandId:l,pixelRanges:new bc({xmin:u,xmax:c,ymin:d,ymax:f})})}else if(o!==void 0&&o===l){let u=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER;i.forEach(d=>{let f=d[a];typeof f=="number"&&(f<u&&(u=f),f>c&&(c=f))}),u!==Number.MAX_SAFE_INTEGER&&c!==Number.MIN_SAFE_INTEGER&&(n={bandId:o,pixelRanges:[[u,c]]})}}return n}var wn="PixelID",Cg="Pixel ID",Fg=[p.BarSeries,p.HistogramSeries,p.ScatterSeries];async function D0(t){let e=!1,{config:r,layer:i,abortSignal:n}=t;if(Qn(Fg,r))switch(j(r?.series)){case p.BarSeries:i.loaded||await i.load({signal:n}),e=!!(await Nr(i,n))?.attributeTable;break;case p.HistogramSeries:case p.ScatterSeries:e=!0;break}return e}function xg(t){let{layer:e,iLayer:r}=t,i;return se(e)?i=e:r?.layerType==="ArcGISImageServiceLayer"?i=tl(r):r?.layerType==="ArcGISTiledImageServiceLayer"&&(i=rl(r)),i}function wg(t){let e;switch(t){case"f32":e=K.Single;break;case"f64":e=K.Double;break;default:e=K.Integer;break}return e}function el(t){if(!t.loaded)throw new Error("Raster layer must be loaded to get its ID field name");let e,r=Lt(t);if(r?.attributeTable){let i=r.attributeTable.fields,n=i.find(a=>a.type==="oid")?.name;n?e=n:e=i.find(a=>a.name.toLowerCase()==="value")?.name}else e=wn;return e??wn}function Tg(t){let{layer:e,chartType:r,rasterInfo:i,popupTemplateFieldInfosEnabled:n}=t;if(!e.loaded)throw new Error("Raster layer must be loaded to get its fields info");let a=i??Lt(e);if(!a)throw new Error("Raster info must be provided or generated beforehand to get raster layer fields info");let s=[];return r!==void 0?r!==p.BarSeries?s=so({layer:e,rasterInfo:a,popupTemplateFieldInfosEnabled:n}):a.attributeTable&&(s=a.attributeTable.fields.map(o=>o.toJSON())):a.attributeTable?s=a.attributeTable.fields.map(o=>o.toJSON()):s=so({layer:e,rasterInfo:a,popupTemplateFieldInfosEnabled:n}),s}function so(t){let{layer:e,rasterInfo:r,popupTemplateFieldInfosEnabled:i}=t;if(!e.loaded)throw new Error("Raster layer must be loaded to get its fields info");let n=r??Lt(e);if(!n)throw new Error("Raster info must be provided or generated beforehand to get raster layer fields info");let a;try{let s=wg(n.pixelType),o=n.bandInfos.map(l=>({name:l.name,alias:l.name,type:s}));i&&e?.popupTemplate?.fieldInfos!==void 0&&o.map(l=>{let u=e.popupTemplate?.fieldInfos?.find(c=>c.fieldName?.toLowerCase()===l.name.toLowerCase())?.label;return u&&u!==l.name&&(l.alias=u),l}),a=[{name:wn,alias:Cg,type:K.OID},...o]}catch{a=[]}return a}async function Nr(t,e){return t.loaded||await t.load({signal:e}),Kn(t)?Lt(t)??void 0:await t.generateRasterInfo(t.rasterFunction,{signal:e})}var tl=Qe(t=>{let e={},r=t.layerDefinition;return e.definitionExpression=r?.definitionExpression,e.id=t.id,t.url!==void 0&&(e.url=t.url),t.itemId!==void 0&&t.layerDefinition?.id!==void 0&&(e.portalItem={id:t.itemId}),new yc(e)},t=>JSON.stringify(t,Object.keys(t).sort())),Ng=Qe(async(t,e)=>{let r=tl(t);return await Vn(r,e),r},t=>JSON.stringify(t,Object.keys(t).sort())),rl=Qe(t=>{let e={};return e.id=t.id,t.url!==void 0&&(e.url=t.url),t.itemId!==void 0&&(e.portalItem={id:t.itemId}),new pc(e)},t=>JSON.stringify(t,Object.keys(t).sort())),Og=Qe(async(t,e)=>{let r=rl(t);return await Vn(r,e),r},t=>JSON.stringify(t,Object.keys(t).sort())),Bg=Qe(t=>{let e={};return e.id=t.id,t.url!==void 0&&(e.url=t.url),t.itemId!==void 0&&(e.portalItem={id:t.itemId}),new Sc(e)},t=>JSON.stringify(t,Object.keys(t).sort())),Ig=Qe(async(t,e)=>{let r=Bg(t);return await Vn(r,e),r},t=>JSON.stringify(t,Object.keys(t).sort())),mi=(t,e)=>{let r=-1;if(!t.loaded)throw new Error("Raster layer must be loaded to get its band ID by name");let i=Lt(t)?.bandInfos;if(i?.length===1)r=0;else if(e&&i?.length){let n=e.toLowerCase(),a=i.findIndex(s=>s.name.toLowerCase()===n);a>-1&&(r=a)}return r},P0=t=>{let{chartConfig:e,layer:r,selectionItems:i}=t,n=j(e.series),a;switch(n){case p.BarSeries:a=Rd({chartConfig:e,layer:r,selectionItems:i});break;case p.HistogramSeries:a=id({chartConfig:e,layer:r,selectionItems:i});break;case p.ScatterSeries:a=vg({chartConfig:e,layer:r,selectionItems:i});break;default:a=void 0;break}return a};function Cr(t){let{definitionExpression:e,mosaicRule:r}=t;return!!(e||r?.objectIds?.length||r?.method==="lock-raster"&&r?.lockRasterIds?.length||r?.where)}async function Ag(t){let{queryObject:e,queryConfig:r,imagerySkipFactor:i,imageryMaxPixelCount:n,defaultQueryGeometry:a,abortSignal:s}=t,o=[];if(e!==void 0)try{let l=J(e),u={geometry:qt(r.geometry)??a??l.fullExtent,autoResample:!0,maxPixelCount:n,skipFactor:i},c=await lc(l,u,{signal:s});o=fo.fromJSON(c.featureSet).features}catch{o=[]}return o}function Mg(t){let{queryObject:e,defaultGeometry:r,filterByViewExtent:i,viewExtent:n}=t,a=J(e),s=r;if(i&&n){let{xmin:o,xmax:l,ymin:u,ymax:c,zmin:d,zmax:f}=n;s={xmin:o,ymin:u,zmin:d,xmax:l,ymax:c,zmax:f,spatialReference:n.spatialReference.toJSON()}}else if(!s&&a.fullExtent)if(ot(a)&&Cr(a))s=void 0;else{let{xmin:o,xmax:l,ymin:u,ymax:c,zmin:d,zmax:f}=a.fullExtent;s={xmin:o,ymin:u,zmin:d,xmax:l,ymax:c,zmax:f,spatialReference:a.fullExtent.spatialReference.toJSON()}}return s}function Eg(t){let e,r,i;return t!==void 0&&(e=t.type,(e===ye.UniqueValue||e===ye.ClassBreaks)&&(r=t.field??void 0,e===ye.ClassBreaks&&(i=t.normalizationField??void 0))),{rendererType:e,rendererField:r,rendererNormalizationField:i}}var il=Qe(t=>{let e=t.featureCollection,r,i;if(e?.layers?.[0]!==void 0){let a=e.layers[0];r=a.featureSet,i=a.layerDefinition}else i=t.layerDefinition;let n={};if(r!==void 0){if(n.source=fo.fromJSON(r).features,i?.fields!==void 0&&(n.fields=i.fields.map(a=>gc.fromJSON(a))),i?.objectIdField!==void 0&&(n.objectIdField=i.objectIdField),i?.geometryType!==void 0){let a=On.fromJSON({geometryType:i.geometryType});a?.type!==void 0&&a?.type!=="extent"&&(n.geometryType=a.type)}i?.spatialReference!==void 0&&(n.spatialReference=i.spatialReference)}else n.id=t.id,i?.id!==void 0&&(n.layerId=i.id),t.url!==void 0&&(n.url=t.url),t.itemId!==void 0&&i?.id!==void 0&&(n.portalItem={id:t.itemId});if(i!==void 0){let a=i.drawingInfo;a?.renderer!==void 0&&(n.renderer=xr.fromJSON(a.renderer))}return new fc(n)},t=>JSON.stringify(t)),Lg=Qe(async(t,e)=>await il(t).load({signal:e}),t=>JSON.stringify(t));async function k0(t,e){let r;switch(t?.layerType??""){case"ArcGISFeatureLayer":r=await Lg(t,e);break;case"ArcGISImageServiceLayer":r=await Ng(t,e);break;case"ArcGISTiledImageServiceLayer":r=await Og(t,e);break;case"WCS":r=await Ig(t,e);break;default:throw new ge(pe.LayerNotSupported)}return r}function V0(t){let{layerOrLayerView:e,iLayer:r,view:i,layerItemId:n}=t,a=J(e),s=qe(a),o=se(s)||Xn(r),l;return o?l=xg({layer:e,iLayer:r}):s!==void 0?(s.isTable||(s.outFields=["*"]),l=e):r?.layerType==="ArcGISFeatureLayer"&&(l=il(r)),!l&&n&&(l=Wg({view:i,portalItemId:n})),l}function je(t,e){let r=J(t),i=[];if(r!==void 0){let n=e===!0&&r?.popupTemplate?.fieldInfos!==void 0;se(r)?i=Tg({layer:r,popupTemplateFieldInfosEnabled:e}):i=r.fields.map(a=>{let s=a.toJSON();if(n){let o=r.popupTemplate?.fieldInfos?.find(l=>l.fieldName?.toLowerCase()===a.name.toLowerCase())?.label;o!==void 0&&o!==a.name&&(s.alias=o)}return s})}return i}function $0(t,e=[]){return e.find(r=>r.name===t)}function vi(t){let e,r=!1;if(se(t))e=[el(t)];else{let i=qe(t);i&&("uniqueIdFields"in i&&i.uniqueIdFields&&i.uniqueIdFields.length>0?e=i.uniqueIdFields:(e=[i.objectIdField],r=!0))}return{idFields:e,isTraditionalTypeOID:r}}function He(t){let e="",r=!1;if(se(t))e=el(t);else if(t){let i=vi(t);r=i.isTraditionalTypeOID,i.idFields&&(e=i.idFields[0])}return{idField:e,isTraditionalTypeOID:r}}function Fr(t){let e=[K.Single,K.Double,K.SmallInteger,K.Integer,K.BigInteger];return t!==void 0&&e.includes(t.type)}function qg(t){return t?.type===K.Date||t?.type===K.DateOnly||t?.type===K.TimestampOffset}function R0(t){return t?.type===K.String}function W0(t){return t?.type===K.TimeOnly}function j0(t){let e=[K.SmallInteger,K.Integer,K.BigInteger];return t!==void 0&&e.includes(t.type)}function Dg(t){return t.filter(e=>qg(e)).map(e=>e.name)}function Z0(t){return t.filter(e=>Fr(e)).map(e=>e.name)}function Tn(t,e){let r;if(e){let i=J(t).getFieldDomain?.(e);i instanceof mc&&(r=i)}return r}function Nn(t,e){let r=e?.getName(t?.toString())??e?.getName(t)??e?.getName(Number(t));return r===null&&(r=void 0),r}function oo(t){let{queryObject:e,fieldName:r,fieldValue:i}=t;return se(e)?void 0:Nn(i,Tn(e,r))}async function nl(t){let e=[];return t&&!qe(t)?.isTable&&t.fieldsIndex&&(e=await co.getRendererFields(t.renderer,t.fieldsIndex)),e}function Pg(t){let e="/rest/services",r=t.toLowerCase(),i=r.indexOf(e);return r=i>-1?t.substring(0,i):t,`${r}/rest/info`}async function kg(t,e){let r=!0,i=".arcgis.com/",n=t?.url,a=n?.includes(i);if(n&&a&&qe(t)?.sourceJSON?.serviceItemId!==void 0){let s=Pg(n);try{let o=(await si(s,{query:{f:"json"},signal:e})).data;if(o.owningTenant!==void 0&&o.owningSystemUrl!==void 0){let l=`${o.owningSystemUrl}/sharing/rest/portals/${o.owningTenant}`,u=(await si(l,{authMode:"auto",query:{f:"json"},signal:e})).data,c=new hc({sourceJSON:u});await c.load({signal:e}),r=c?.sourceJSON?.subscriptionInfo?.dataStoreLevel===void 0}}catch{}}return r}function Vg(t){let{queryObject:e,fieldToMatch:r,returnUndefinedIfNotFound:i}=t,n=je(e),a=$g(n,r),s=i?"":r;return a?.name??s}function $g(t,e){let r=t.find(i=>e===i.name);return r||(r=t.find(i=>e.toUpperCase()===i.name.toUpperCase())),r}function _0(t){let{fieldsList:e,queryObject:r,returnUndefinedIfNotFound:i}=t,n=e;return n!==void 0&&(n=n.map(a=>Vg({queryObject:r,fieldToMatch:a,returnUndefinedIfNotFound:i}))),n}function al(t){let{queryObject:e,chartConfig:r,runtimeDataFilters:i,filterByViewExtent:n,ignoreViewExtent:a,view:s}=t,{series:o,dataFilters:l}=r,{where:u,gdbVersion:c,timeExtent:d,geometry:f,distance:m,units:g,objectIds:h,spatialRelationship:y}=l??{},{where:b,gdbVersion:x,timeExtent:w,geometry:C,distance:v,units:T,objectIds:O,spatialRelationship:I}=i??{},B=o[0],{query:N}=B,{where:A}=N??{},D=H(o),E={...N};return E.where=te([u,b]),D!==S.BarAndLineSplitBy&&D!==S.BoxPlotC5MonoFieldAndSplitBy&&D!==S.BoxPlotC7MonoFieldAndCategoryAndSplitBy&&D!==S.BoxPlotC6MultiFieldsAndSplitBy&&D!==S.BarAndLineSplitByNoAggregation&&(E.where=te([E.where,A])),r.orderOptions?.orderByFields!==void 0&&(E.orderByFields=r.orderOptions.orderByFields),E.gdbVersion=x??c,E.timeExtent=jc(s?.timeExtent,w??d),E.geometry=se(e)?Mg({queryObject:e,defaultGeometry:C??f,filterByViewExtent:n,viewExtent:s?.extent}):Zc({queryObject:e,defaultGeometry:C??f,ignoreViewExtent:a}),E.distance=v??m,E.units=T??g,E.objectIds=O??h,E.spatialRelationship=I??y,N?.outStatistics?.[0]?.statisticType===L.Count&&(E.returnDistinctValues=N?.returnDistinctValues??!1),E?.outStatistics?.forEach(M=>{$n(M)&&!("statisticParameters"in M)&&(M.statisticParameters={value:W.defaultStatParameterValue})}),E}var Rg=t=>{let e;if("portalItem"in t){let r=t.portalItem&&"id"in t.portalItem?t.portalItem.id:void 0;typeof r=="string"&&(e=r)}return e};function Wg(t){let{view:e,portalItemId:r}=t,i;if(e&&r){let n=Array.from(e.map?.allLayers??[]).find(a=>Rg(a)===r);n&&(i=n)}return i}async function Vn(t,e){await t?.load({signal:e}),t&&(ot(t)||Li(t))&&await t.generateRasterInfo(t.rasterFunction,{signal:e})}function jg(t){let{whereValue:e,outStatistics:r,y:i}=t,n=W.outStatistics.outStatisticFieldName??"";return r?.outStatisticFieldName!==void 0?n=r.outStatisticFieldName:r?.onStatisticField!==void 0&&r.statisticType!==void 0?n=`${r.statisticType}_${r.onStatisticField}_${e}`:i!==void 0&&(n=[i].flat()[0]),n}function Zg(t){let e=new Map;for(let r=0;r<t.length;r+=1){let i=t[r],n=i.query?.where;if(n!==void 0&&"y"in i){let a=Se({where:n,normalize:!0,escape:!1});if(a!==""){let s=jg({whereValue:a,outStatistics:i.query?.outStatistics?.[0],y:i.y});i.y=s,e.set(a,s)}}}return e}function _g(t){let{uniqueQuery:e,splitByField:r,x:i}=t,n=[...e.groupByFieldsForStatistics??[],i,r].filter(a=>a!==void 0&&a.trim()!==""&&a!==ar);e.groupByFieldsForStatistics=Array.from(new Set(n))}function $n(t){return t.statisticType===L.ContinuousPercentile||t.statisticType===L.DiscretePercentile}function zg(t){let{uniqueQuery:e,y:r,useGenericOutStatFieldName:i,queryObject:n,chartSubType:a,isTimeBinningSeries:s,returnFeaturesExtent:o,splitByField:l}=t,u=W.outStatistics;if(e.outStatistics?.[0]!==void 0){a!==S.PieFromFields&&a!==S.BarAndLineFromFields&&(e.outStatistics[0].outStatisticFieldName=i?u.outStatisticFieldName:[r].flat()[0]);let{outStatistics:c}=e;for(let d=0;d<c.length;d+=1){let f=c[d];f!==void 0&&$n(f)&&(s&&!er(l,n)?(c[d].statisticType=L.Count,delete c[d].statisticParameters):c[d]={...c[d],statisticParameters:c[d].statisticParameters??{value:W.defaultStatParameterValue}})}}else{let c=J(n),{idField:d,isTraditionalTypeOID:f}=He(c),m=f?d:"*";e.outStatistics=[{statisticType:u.statisticType,onStatisticField:m,outStatisticFieldName:i?u.outStatisticFieldName:[r].flat()[0]}]}o===!0&&(!s||le(l))&&e.outStatistics?.push({statisticType:L.EnvelopeAggregate,onStatisticField:"1"})}function Ug(t){let{chartConfig:e,fetchFullBoxPlotData:r}=t,{series:i}=e,n=Mt(e),a=[{statisticType:L.Average,suffix:P.Average}];r===!0&&(a=[...a,{statisticType:L.Minimum,suffix:P.Min},{statisticType:L.ContinuousPercentile,statisticParameters:{value:.25},suffix:P.FirstQuartile},{statisticType:L.ContinuousPercentile,statisticParameters:{value:.5},suffix:P.Median},{statisticType:L.ContinuousPercentile,statisticParameters:{value:.75},suffix:P.ThirdQuartile},{statisticType:L.Maximum,suffix:P.Max},{statisticType:L.StandardDeviation,suffix:P.StandardDeviation}]);let s=new Set;return n&&"y"in i[0]?[i[0].y].flat().forEach(o=>s.add(o)):i.forEach(o=>{"y"in o&&[o.y].flat().forEach(l=>s.add(l))}),[...s].flatMap(o=>a.map(l=>{let u={onStatisticField:o,statisticType:l.statisticType,outStatisticFieldName:`${o}_${l.suffix}`};return l.statisticType===L.ContinuousPercentile&&(u.statisticParameters=l.statisticParameters),u}))}function Hg(t,e){for(let r=1;r<e.length;r+=1){let i={...e[r].query?.outStatistics?.[0]};i!==void 0&&t.outStatistics!==void 0&&t.outStatistics.push(i)}}function Gg(t){let{uniqueQuery:e,x:r,splitByField:i,unit:n,chartSubType:a,objectIdFields:s,runsOnClientQueryEngine:o}=t;if(n!==void 0){let l=wc({dateFieldName:r,unit:n,runsOnClientQueryEngine:o});e.orderByFields=l,e.groupByFieldsForStatistics=l,a===S.BarAndLineSplitBy&&!le(i)?e.groupByFieldsForStatistics.push(i):a===S.BarAndLineNoAggregation&&(e.groupByFieldsForStatistics=s,e.outStatistics=[{onStatisticField:s.length>1?"*":s[0],outStatisticFieldName:`COUNT_${s[0]}`,statisticType:L.Count}])}}function sl(t){let{chartConfig:e,uniqueQuery:r,chartLimits:i}=t;if(i?.behaviorAfterLimit===st.RenderUpToTheLimit){let n=kn(e,i);if(n!==void 0){let a=H(e.series);if(a===S.PieFromFields||a===S.BarAndLineFromFields){if(r.outStatistics?.[0]!==void 0){let s=(u,c)=>u.statisticType===L.EnvelopeAggregate===c,o=r.outStatistics.filter(u=>s(u,!0)),l=r.outStatistics.filter(u=>s(u,!1));l.splice(n),r.outStatistics=[...l,...o]}}else r.num=n}}}function Rn(t){let{chartConfig:e,queryConfig:r,queryObject:i,timeIntervalInfo:n,setTimeBinningInfoWhenNotProvided:a,fetchFullBoxPlotData:s,returnFeaturesExtent:o,chartLimits:l}=t,u=e.series,c=H(u),d=pt(e),{query:f,x:m}=d,g="y"in d?d.y:void 0,h=it({xAxisValueFormatType:We(e),setTimeBinningInfoWhenNotProvided:a,seriesConfig:d,queryObject:i}),y=new Map,b=!1,x=!1,w=!1,C=!1,v=!1,T={};if(f!==void 0){T=Ye(f);let V=de(f.where),$="";switch(r.fetchNullValues!==!0&&(m!==F.boxPlot.boxPlotCategory&&($=`${m} IS NOT NULL`),V.trim()!==""&&V!==m&&!tt(f.where)&&($=te([$,`${V} IS NOT NULL`]))),c){case S.BarAndLineSplitBy:{y=Zg(u),C=!0,b=!0,x=!0;break}case S.BarAndLineMultiFields:Hg(T,u),x=!0;break;case S.PieFromFields:case S.BarAndLineFromFields:$="",w=!0,x=!0;break;case S.BarAndLineMonoField:case S.PieFromCategory:x=!0;break;case S.BoxPlotC1MonoField:case S.BoxPlotC2MultiFields:w=!0,v=!0;break;case S.BoxPlotC3MonoFieldAndCategory:case S.BoxPlotC4MultiFieldsAndCategory:case S.BoxPlotC5MonoFieldAndSplitBy:case S.BoxPlotC6MultiFieldsAndSplitBy:case S.BoxPlotC7MonoFieldAndCategoryAndSplitBy:{v=!0,C=!0,w=!0;break}case S.PieNoAggregation:case S.BarAndLineNoAggregation:case S.BarAndLineSplitByNoAggregation:}if(x&&zg({uniqueQuery:T,y:g,useGenericOutStatFieldName:b,queryObject:i,chartSubType:c,isTimeBinningSeries:h,returnFeaturesExtent:o,splitByField:V}),C&&_g({uniqueQuery:T,splitByField:V,x:m}),be(e)&&v&&(T.outStatistics=Ug({chartConfig:e,fetchFullBoxPlotData:s})),w?delete T.orderByFields:r.orderByFields!==void 0&&(T.orderByFields=r.orderByFields.filter(G=>{let k=G.split(" ");return!le(k[0])})),h&&Re(u[0])){let G=J(i),{idFields:k}=vi(G);je(i).find(Y=>Y.name===m)?.type!==K.DateOnly&&k&&Gg({uniqueQuery:T,x:m,splitByField:de(f.where),unit:n?.unit??u[0].temporalBinning?.unit,chartSubType:c,objectIdFields:k,runsOnClientQueryEngine:gt(i)})}T.where=$}sl({chartConfig:e,uniqueQuery:T,chartLimits:l});let{gdbVersion:O,geometry:I,distance:B,units:N,timeExtent:A,where:D,objectIds:E,spatialRelationship:M}=r;return O!==void 0&&(T.gdbVersion=O),I!==void 0&&(T.geometry=I),B!==void 0&&(T.distance=B),N!==void 0&&(T.units=N),A!==void 0&&(T.timeExtent=A),E!==void 0&&(T.objectIds=E),M!==void 0&&(T.spatialRelationship=M),D!==void 0&&(T.where=te([T.where,D])),{uniqueQuery:T,mapToStatField:y}}var Dt={LegendItemVisibilityChange:"arcgisChartsJSLegendItemVisibilityChange",RenderingComplete:"arcgisChartsJSRenderingComplete",SeriesColorsChange:"arcgisChartsJSSeriesColorChange",AxesMinMaxChange:"arcgisChartsJSAxesMinMaxChange",SelectionComplete:"arcgisChartsJSSelectionComplete",TooManySelectedElements:"arcgisChartsJSTooManySelectedElements",SeriesOrder:"arcgisChartsJSSeriesOrder"};function Pt(t){return{detail:t,composed:!0,cancelable:!0,bubbles:!0}}function z0(t,e){e&&e.dispatchEvent(new window.CustomEvent(Dt.LegendItemVisibilityChange,Pt(t)))}function U0(t){t&&t.dispatchEvent(new window.CustomEvent(Dt.RenderingComplete,Pt()))}function H0(t){let{data:e,htmlContainer:r}=t;r&&r.dispatchEvent(new window.CustomEvent(Dt.SelectionComplete,Pt(e)))}function G0(t){t&&t.dispatchEvent(new window.CustomEvent(Dt.TooManySelectedElements,Pt()))}function Y0(t){let{data:e,htmlContainer:r,chartId:i,colorMatchApplied:n}=t;r&&r.dispatchEvent(new window.CustomEvent(Dt.SeriesColorsChange,Pt({chartId:i,data:e,colorMatchApplied:n})))}function Q0(t,e){e&&e.dispatchEvent(new window.CustomEvent(Dt.AxesMinMaxChange,Pt(t)))}function Yg(t){let{data:e,htmlContainer:r}=t;r&&e&&r.dispatchEvent(new window.CustomEvent(Dt.SeriesOrder,Pt(e)))}var Bt=["1.0.0","1.0.1","2.0.0","3.0.0","3.1.0","3.2.0","3.3.0","3.4.0","3.5.0","3.6.0","3.7.0","3.8.0","3.9.0","3.9.1","3.9.2","3.10.0","3.11.0","4.0.0","4.0.1","5.0.0","6.0.0","6.1.0","6.2.0","6.2.1","6.3.0","6.4.0","7.0.0","7.1.0","7.1.1","7.2.0","7.2.1","7.3.1","7.4.0","7.4.1","7.5.0","7.5.1","7.6.0","8.0.0","8.0.1","9.0.0","9.1.0","9.2.0","9.3.0","9.4.0","9.5.0","9.6.0","9.6.1","9.7.0","10.0.0","11.0.0","12.0.0","13.0.0","14.0.0","14.0.1","15.0.0","16.0.0","16.1.0","16.1.1","17.0.0","17.1.0","17.2.0","17.2.1","18.0.0","18.1.0","18.1.1","18.1.2","18.1.3","19.0.0","20.0.0","20.1.0","20.2.0","21.0.0","21.1.0","22.0.0","23.0.0","23.1.0","23.2.0","23.3.0","24.0.0","24.1.0","24.2.0","24.3.0","24.4.0","24.5.0","24.6.0","24.7.0","24.8.0","25.0.0","25.1.0","25.2.0"],Qg="1.0.0",Jg="unrecognized.version",Kg=[p.LineSeries,p.BarSeries,p.ComboLineAndBarSeries,p.RadarSeries];function Sn(t,e){let r=0;if(t!==e){let i=t.split("."),n=e.split(".");for(let a=0;a<i.length;a+=1){let s=Number.parseInt(i[a],10),o=Number.parseInt(n[a],10);if(s>o||Number.isNaN(o)){r=1;break}if(s<o){r=-1;break}}}return r}function Xg(t){return t!==void 0?/^([1-9]\d*|0)(\.(([1-9]\d*)|0)){2}$/u.test(t):!1}function J0(t){let e=Ct.Same,r=[];if(Xg(t)&&t!==void 0){Bt.sort(Sn);let i=Sn(t,Bt[Bt.length-1]);if(i===1?e=Ct.Newer:i===-1&&(e=Ct.Older),e===Ct.Newer||e===Ct.Same)r.push(t);else{for(let n=Bt.length-2;n>=0;n-=1)if(Sn(t,Bt[n])>=0){r=Bt.slice(n,Bt.length);break}r.length===0&&r.push(Qg)}}else e=Ct.Unrecognized,r.push(Jg);return{versionStatus:e,versions:r}}function pt(t){let{series:e}=t,r=("showMean"in t?t.showMean:!1)===!0?e.find(i=>i.type===p.LineSeries):e[0];return r??=e[0],r}function K0(t,e){let r=t!==null?t.toString():null,i=e!=null?e.toString():null;return i!==null&&i!==r?Ie.SFS:Ie.SLS}function de(t,e){let r="";return t?.includes("=")&&(r=e!==!1?Mi({value:t.split("=")[0],escape:!1}):t.split("=")[0].trim()),r}function Se(t){let{where:e,normalize:r,keepSurroundingQuotes:i,escape:n=!1}=t,a="";return e?.includes("=")&&(a=e.split("=").slice(1).join("=").trim(),a==="null"?a=null:a.trim()!==""&&!Number.isNaN(Number(a))?a=Number(a):r===!1?n&&(a=kr(a)):a=Mi({value:a,keepSurroundingQuotes:i,escape:n})),a}function tt(t){let e=!1;if(t===void 0||t==="")e=!0;else if(typeof t=="string"&&t.includes("=")){let r=de(t,!1),i=Se({where:t,normalize:!1});e=r===`${i}`}return e}function rt(t){let{where:e,normalize:r,escape:i}=t,n=r===void 0?!0:r,a=de(e),s=Se({where:e,normalize:n,keepSurroundingQuotes:!0,escape:i}),o=e;return a!==""&&s!==""&&(s===null?o=`${a} IS NULL`:o=`${a}=${s}`),o}function eh(t){let e=S.PieFromCategory;return t[0].query?.outStatistics===void 0?e=S.PieNoAggregation:t[0].query?.groupByFieldsForStatistics===void 0&&(e=S.PieFromFields),e}function th(t){let e=S.BarAndLineMonoField,r=t[0].query?.where;return t[0].query?.groupByFieldsForStatistics===void 0&&(t[0].query?.outStatistics??[]).length>0?e=S.BarAndLineFromFields:r===void 0&&t[0].query?.outStatistics===void 0?e=S.BarAndLineNoAggregation:tt(r)?t.length>1&&(e=S.BarAndLineMultiFields):e=t[0].query?.outStatistics===void 0?S.BarAndLineSplitByNoAggregation:S.BarAndLineSplitBy,e}function rh(t){let e=S.BoxPlotC1MonoField,r=t.length===1,i=t.find(o=>o.type===p.LineSeries)??t[0],{x:n}=i,a="y"in i?i.y:"",s=i.query?.where;return n===ar?typeof a=="object"&&a.length>1?tt(s)?r&&(e=S.BoxPlotC2MultiFields):e=S.BoxPlotC6MultiFieldsAndSplitBy:r?e=S.BoxPlotC1MonoField:tt(s)||(e=S.BoxPlotC5MonoFieldAndSplitBy):r?e=S.BoxPlotC3MonoFieldAndCategory:tt(s)?e=S.BoxPlotC4MultiFieldsAndCategory:e=S.BoxPlotC7MonoFieldAndCategoryAndSplitBy,e}function H(t){let e=S.NonSpecific;if(t?.[0]!==void 0)switch(j(t)){case p.PieSeries:e=eh(t);break;case p.RadarSeries:case p.BarSeries:case p.LineSeries:case p.ComboLineAndBarSeries:e=th(t);break;case p.BoxPlotSeries:e=rh(t);break}return e}function ih(t){return H(t.series)!==S.PieNoAggregation}function nh(t){let e=!0,r=j(t.series);if(r===p.BarSeries||r===p.LineSeries||r===p.ComboLineAndBarSeries){let i=H(t.series);e=i!==S.BarAndLineNoAggregation&&i!==S.BarAndLineSplitByNoAggregation}return e}function ol(t){let{statsMap:e,dataContext:r,chartLimits:i}=t,n=!1;if(e!==void 0){let{maxScatterPointsBeforeAggregation:a,scatterplot:{aggregationThreshold:s}}=xt(i),{queryNumberOfFeatures:o}=F.scatterplotAggregationFields;n=(e.get(o)??Number.NaN)>=(a??s)}else r!==void 0&&(n=F.scatterplotAggregationFields.dataContextXMinField in r);return n}function X0(t){let{dataContext:e,chartConfig:r,chartLimits:i}=t,n=!0;if(r!==void 0)switch(j(r.series)){case p.BarSeries:case p.LineSeries:case p.ComboLineAndBarSeries:n=nh(r);break;case p.ScatterSeries:n=ol({dataContext:e,chartLimits:i});break;case p.PieSeries:n=ih(r);break}return n}function it(t){let{seriesConfig:e,xAxisValueFormatType:r,setTimeBinningInfoWhenNotProvided:i,queryObject:n}=t,a=!1;if(!se(n)&&Re(e)&&e.binTemporalData!==!1&&r===p.DateAxisFormat){let s=H([e]);if(e.temporalBinning&&s!==S.BarAndLineNoAggregation&&s!==S.BarAndLineSplitByNoAggregation){let{unit:o,size:l}=e.temporalBinning;a=i===!0||l!==void 0&&l>0&&o!==void 0}}return a}function Re(t){return Kg.includes(t?.type)}function ah(t){let{previousConfig:e,newConfig:r,behaviorAfterLimit:i}=t,n=e.series,a=r.series,s=!1,o=!1;(i===st.RenderUpToTheLimit||e.orderOptions?.data===void 0||r.orderOptions?.data===void 0)&&(o=!vt(e.orderOptions?.orderByFields,r.orderOptions?.orderByFields));let l=f=>{let m=f.query;return m?.outStatistics?.forEach(g=>{$n(g)&&!("statisticParameters"in g)&&(g.statisticParameters={value:W.defaultStatParameterValue})}),m},u=["where","outStatistics[0].outStatisticFieldName","outStatistics[0].onStatisticField"],c=Fi(n.map(l),u),d=Fi(a.map(l),u);return s=!vt(c,d),s||o}function sh(t,e){return JSON.stringify(t.dataFilters)!==JSON.stringify(e.dataFilters)}function oh(t,e){let r=!1;if(e.length&&t.length)if(e[0].x!==t[0].x)r=!0;else{let i=j(t);if(i!==p.HistogramSeries&&i!==p.GaugeSeries){let n=he(t).sort(),a=he(e).sort();r=JSON.stringify(n)!==JSON.stringify(a)}}return r}function lh(t,e){return(t??!1)!==(e??!1)}function uh(t,e){return Re(t.series[0])&&Re(e.series[0])&&(t.series[0].binTemporalData??F.binTemporalData)!==(e.series[0].binTemporalData??F.binTemporalData)}function ch(t,e){let r=t.axes?.[0].valueFormat.type,i=e.axes?.[0].valueFormat.type,n=H(e.series),a=n===S.BarAndLineNoAggregation||n===S.BarAndLineSplitByNoAggregation,s=r===p.DateAxisFormat&&i===p.NumberAxisFormat,o=r===p.NumberAxisFormat&&i===p.DateAxisFormat;return r!==i&&(a||s||o)}function dh(t){let{previousSeries:e,newConfig:r,setTimeBinningInfoWhenNotProvided:i,queryObject:n}=t,a=r.series?.[0],s=!1,o=!1;if(a&&Re(a)&&it({seriesConfig:a,xAxisValueFormatType:We(r),setTimeBinningInfoWhenNotProvided:i,queryObject:n})){let l=e[0];s=JSON.stringify(l.temporalBinning)!==JSON.stringify(a.temporalBinning),o=i===!0&&(a.temporalBinning?.size??0)<=0}return{timeBinningChanged:s,newTimeBinningWillBeCalculated:o}}function lo(t,e){return e.length!==t.length}function fh(t,e){return Mt(t)!==Mt(e)}function mh(t,e){return JSON.stringify(t.series[0]?.valueConversion)!==JSON.stringify(e.series[0]?.valueConversion)}function gh(t,e){let r=t.axes?.[0],i=e.axes?.[0];return JSON.stringify(r?.minimumFromField)!==JSON.stringify(i?.minimumFromField)||JSON.stringify(r?.maximumFromField)!==JSON.stringify(i?.maximumFromField)}function hh(t,e){return JSON.stringify(t.series[0]?.xTemporalBinning)!==JSON.stringify(e.series[0]?.xTemporalBinning)||JSON.stringify(t.series[0]?.yTemporalBinning)!==JSON.stringify(e.series[0]?.yTemporalBinning)||(t.firstDayOfWeek??7)!==(e.firstDayOfWeek??7)||t.outTimeZone!==e.outTimeZone||(t.nullPolicy??we.Null)!==(e.nullPolicy??we.Null)}function yh(t,e){return(t.hideEmptyRowsAndColumns??!1)!==(e.hideEmptyRowsAndColumns??!1)}function ph(t,e){return(t.includeLeapDay??pr.heatChart.includeLeapDay)!==(e.includeLeapDay??pr.heatChart.includeLeapDay)}function Sh(t){let{previousConfig:e,newConfig:r,fieldList:i}=t,n=e.series[0],a=r.series[0],s=!1;if(n.type===p.ScatterSeries&&a.type===p.ScatterSeries&&i&&i.length>0){let o=new Set(n.additionalTooltipFields||[]),l=new Set(a.additionalTooltipFields||[]);if(!vt(o,l)){let u=Array.from(l).filter(c=>!o.has(c));u.length>0&&(s=i?.some(c=>u.includes(c.name)&&!Fr(c)))}}return s}function ep(t,e){return(t?.colorMatch??!1)!==(e.colorMatch??!1)}function tp(t,e){return(t.stackedType??Be.Side)!==(e.stackedType??Be.Side)}function gi(t){let e={...t};return e.position===void 0&&(e.position=pr.heatChart.legend.position),e}function rp(t,e){let r=t.legend??{type:p.Legend},i=e.legend??{type:p.Legend},n=gi(r),a=gi(i);return!vt(n,a)}function ip(t,e){let r=t.legend??{type:p.Legend},i=e.legend??{type:p.Legend},n=gi(r),a=gi(i);return n.position!==a.position}function np(t,e){return JSON.stringify(t.series[0]?.gradientRules)!==JSON.stringify(e.series[0]?.gradientRules)}function ap(t,e){return t.series[0].heatRulesType!==e.series[0].heatRulesType}function sp(t){let{oldConfig:e,newConfig:r}=t,i=!1,n=e?.series[0],a=r.series[0],s=j(e?.series),o=j(r.series);if(s===p.PieSeries&&o===p.PieSeries){let{slices:l,sliceGrouping:u}=n,{slices:c,sliceGrouping:d}=a,f=l?.map(y=>({sliceId:y.sliceId,label:y.label})),m=c?.map(y=>({sliceId:y.sliceId,label:y.label})),g=u?.label,h=d?.label;i=JSON.stringify(f)!==JSON.stringify(m)||JSON.stringify(g)!==JSON.stringify(h)}return i}function bh(t){let{previousSelectionOIDs:e,selectionData:r,filterBySelection:i}=t,n=!1;return i===!0&&(n=e?.length!==r?.selectionOIDs?.length||!vt(e,r?.selectionOIDs)),n}function op(t,e){return t?.length!==e?.length||t?.some((r,i)=>{let n=Se({where:r?.query?.where}),a=Se({where:e?.[i]?.query?.where});return n!==a})}function lp(t,e){let r=he(t),i=he(e);return JSON.stringify(r)!==JSON.stringify(i)}function up(t,e){let r,i,n,a;return Re(t.series[0])&&(r=t.series[0].temporalBinning?.unit,n=t.series[0].temporalBinning?.size),Re(e.series[0])&&(i=e.series[0].temporalBinning?.unit,a=e.series[0].temporalBinning?.size),bn(r,n)&&!bn(i,a)}function cp(t,e){return t.axes?.length===3&&e.axes?.length===2||t.axes?.length===2&&e.axes?.length===3}function dp(t,e){return JSON.stringify(t.series.map(r=>r.assignToSecondValueAxis??!1))!==JSON.stringify(e.series.map(r=>r.assignToSecondValueAxis??!1))}function fp(t,e){let r=t.axes?.map(n=>n?.guides?.map(a=>a?.above===!0)),i=e.axes?.map(n=>n?.guides?.map(a=>a?.above===!0));return JSON.stringify(r)!==JSON.stringify(i)}function mp(t,e){return Ai(t)!==Ai(e)}function gp(t){return t?.series?.some(e=>e.dataLabels&&e.dataLabels.visible!==!1)??!1}function hp(t,e){return(t.showOutliers??F.boxPlot.boxPlotOutliersVisibility)!==(e.showOutliers??F.boxPlot.boxPlotOutliersVisibility)}function yp(t,e){return(t.standardizeValues??F.boxPlot.boxPlotStandardizeValuesVisibility)!==(e.standardizeValues??F.boxPlot.boxPlotStandardizeValuesVisibility)}function pp(t,e){return JSON.stringify(t?.chartRenderer)!==JSON.stringify(e?.chartRenderer)}function Sp(t,e){let r=t.axes?.[0].valueFormat.type===p.DateAxisFormat?t.axes[0].valueFormat.intlOptions.timeZone:void 0,i=e.axes?.[0].valueFormat.type===p.DateAxisFormat?e.axes[0].valueFormat.intlOptions.timeZone:void 0;return r!==i}function bp(t,e){let r=!1,i=t.series[0],n=e.series[0];if(i.type===p.ScatterSeries&&n.type===p.ScatterSeries){let{sizePolicy:a}=i,{sizePolicy:s}=n;r=JSON.stringify(a)!==JSON.stringify(s)}return r}function vp(t,e){let r=!1,i=t.series[0],n=e.series[0];if(i.type===p.ScatterSeries&&n.type===p.ScatterSeries){let{sizePolicy:a}=i,{sizePolicy:s}=n;r=a===void 0&&s!==void 0||a!==void 0&&s===void 0||a?.field!==s?.field}return r}function Cp(t){let{previousConfig:e,newConfig:r,previousFilterBySelection:i,previousSelectionOIDs:n,fieldList:a,queryObject:s,filterBySelection:o,selectionData:l,setTimeBinningInfoWhenNotProvided:u,chartLimits:c}=t,{series:d}=r,{series:f}=e,m=j(d),g=!1,h=!1,y=!1,b={common:{layerChanged:!1,queryChanged:!1,xOrYChanged:!1,numberOfSeriesChanged:!1,configFiltersChanged:!1,filterBySelectionChanged:!1,dataForFilterBySelectionChanged:!1,binTemporalDataChanged:!1,timeBinningChanged:!1,newTimeBinningWillBeCalculated:!1,valueFormatChangeRequiresNewData:!1},histogram:{dataPropsChanged:!1},gauge:{valueConversionChanged:!1,minMaxFromFieldsChanged:!1},boxPlot:{showMeanChanged:!1},heatChart:{binningChanged:!1,hideEmptyRowsAndColumnsChanged:!1,includeLeapDay:!1},scatterPlot:{tooltipFieldsChanged:!1}};switch(b.common.queryChanged=ah({previousConfig:e,newConfig:r,behaviorAfterLimit:c?.behaviorAfterLimit}),b.common.configFiltersChanged=sh(e,r),b.common.xOrYChanged=oh(f,d),b.common.filterBySelectionChanged=lh(i,o),b.common.dataForFilterBySelectionChanged=bh({previousSelectionOIDs:n,selectionData:l,filterBySelection:o}),b.common.binTemporalDataChanged=uh(e,r),b.common.valueFormatChangeRequiresNewData=ch(e,r),b.common={...b.common,...dh({previousSeries:f,newConfig:r,setTimeBinningInfoWhenNotProvided:u,queryObject:s})},m){case p.HistogramSeries:b.histogram.dataPropsChanged=gd(f,d)||md(f,d);break;case p.LineSeries:case p.BarSeries:case p.ComboLineAndBarSeries:b.common.numberOfSeriesChanged=lo(f,d);break;case p.BoxPlotSeries:be(e)&&be(r)&&(b.common.numberOfSeriesChanged=lo(f,d),b.boxPlot.showMeanChanged=fh(e,r));break;case p.GaugeSeries:b.gauge.valueConversionChanged=mh(e,r),b.gauge.minMaxFromFieldsChanged=gh(e,r);break;case p.HeatSeries:At(e)&&At(r)&&(b.heatChart.binningChanged=hh(e,r),b.heatChart.hideEmptyRowsAndColumnsChanged=yh(e,r),b.heatChart.includeLeapDay=ph(e,r));break;case p.ScatterSeries:b.scatterPlot.tooltipFieldsChanged=Sh({previousConfig:e,newConfig:r,fieldList:a});break}return h=Object.values(b.common).some(x=>x),(b.gauge.valueConversionChanged||b.gauge.minMaxFromFieldsChanged||b.histogram.dataPropsChanged||b.boxPlot.showMeanChanged||b.heatChart.binningChanged||b.heatChart.hideEmptyRowsAndColumnsChanged||b.heatChart.includeLeapDay||b.scatterPlot.tooltipFieldsChanged)&&(y=!0),g=h||y,{dataUpdateNeeded:g,dataUpdateDetails:b}}function Fp(t,e){let r=Ye(t);if(r&&r.series.length>1){let{preferLabel:i,orderBy:n}=r.orderOptions?.series??{};if(n!==void 0){let a;if(i===!1){let s=H(r.series);a=Ei(s)?"splitByValue":"name"}else a="name";r.series.sort((s,o)=>{let l,u;a==="splitByValue"?(l=Se({where:s.query?.where})??"",u=Se({where:o.query?.where})??""):(l=s.name,u=o.name);let[c,d]=n.toUpperCase()===Ce.Descending?[u,l]:[l,u];return typeof c=="string"&&typeof d=="string"?c.localeCompare(d):Number(c)-Number(d)})}}return Yg({data:r?.series.map(i=>i.id),htmlContainer:e}),r}function ll(t){let e,r=t?.orderOptions?.data;return t.series?.length>0&&r?.orderType===Je.MultiAxes&&(e=[],e.push({sortingField:_.xField,orderBy:r.orderByX??Ce.Ascending}),e.push({sortingField:r.orderByY!==void 0?_.yField:"",orderBy:r.orderByY})),e}function vh(t){let{chartConfig:e,field:r}=t,i,n=ll(e);return n?.length===2&&(i=r===_.xField?n[0]?.orderBy:n[1]?.orderBy),i}function Ch(t){let e=H(t.series),r;if(t.orderOptions?.data!==void 0){let i=t.orderOptions?.data?.orderType??Je.Category,n=t.orderOptions?.data&&"orderBy"in t.orderOptions.data?t.orderOptions.data.orderBy:void 0;if(i===Je.Category)i=t.series[0].x;else{i===Je.Mean?i=P.Average:i===Je.Median&&(i=P.Median);let a=e===S.BoxPlotC4MultiFieldsAndCategory&&typeof t.series[0].y=="string"?t.series[0].y:void 0,s=de(t.series[0].query?.where),o=Se({where:t.series[0].query?.where});i=ce({key:i,y:a,chartSubType:e,splitBy:s,splitByValue:o}),Array.isArray(n)&&(n=Ce.Ascending)}r={sortingField:i,orderBy:n??Ce.Ascending,preferLabel:t.orderOptions.data&&"preferLabel"in t.orderOptions.data?t.orderOptions.data.preferLabel??!0:!0}}return r}function Fh(t){let e=t.series[0],{x:r,y:i}=e,n=H(t.series)===S.PieFromFields,a=H(t.series)===S.BarAndLineFromFields,s,o="",l;if(t.orderOptions?.data!==void 0){let u=t.orderOptions.data&&"preferLabel"in t.orderOptions.data?t.orderOptions.data.preferLabel:!0;if(o=t.orderOptions?.data?.orderType??Je.Category,l=t.orderOptions?.data&&"orderBy"in t.orderOptions.data?t.orderOptions.data.orderBy:void 0,o===Je.Category?n?o=Fe:o=u?r:pr.originalXValue:o=n?Ue:[i].flat()[0],o!==void 0&&o!==""){let c=Pr(t);if(j(t.series)!==p.PieSeries&&o!==r&&t.series?.length>1)switch(c){case Be.Stacked:o=F.technicalSortingFieldBySum;break;case Be.Stacked100:o=F.technicalSortingFieldByPercent;break;case Be.Side:typeof i=="string"&&(o=i);break}s={sortingField:o,orderBy:l??Ce.Ascending,preferLabel:u}}}else(a||n)&&t.series[0].query?.outStatistics&&(l=t.series[0].query.outStatistics.map(u=>u.onStatisticField),l?.length>1&&(s={sortingField:pr.originalXValue,orderBy:l,preferLabel:!1}));return s}function hi(t){let e,r=j(t?.series);if(t?.series&&t.series.length>0){let i;switch(r){case p.HeatSeries:At(t)&&(e=ll(t));break;case p.BoxPlotSeries:be(t)&&(i=Ch(t));break;case p.LineSeries:case p.BarSeries:case p.ComboLineAndBarSeries:case p.RadarSeries:case p.PieSeries:i=Fh(t);break}!e&&i&&(e=[],e.push(i))}return e}function xp(t){let{oldConfig:e,newConfig:r,dataWasUpdated:i}=t,n=j(r.series),a=H(r.series),s=!1,o=!1;if(a!==S.BoxPlotC1MonoField&&a!==S.BoxPlotC5MonoFieldAndSplitBy&&r.orderOptions?.data!==void 0){let l=hi(e),u=hi(r);if(n===p.HeatSeries){let c=l?l[0]:void 0,d=u?u[0]:void 0,f=l?l[1]:void 0,m=u?u[1]:void 0;o=e?.orderOptions?.data?.orderType!==r.orderOptions?.data?.orderType||c?.sortingField!==d?.sortingField||c?.orderBy!==d?.orderBy||f?.sortingField!==m?.sortingField||f?.orderBy!==m?.orderBy,s=o||i}else{let c=l?l[0]:void 0,d=u?u[0]:void 0;o=e?.orderOptions?.data?.orderType!==r.orderOptions?.data?.orderType||c?.sortingField!==d?.sortingField||c?.orderBy!==d?.orderBy||(c?.preferLabel??!0)!==(d?.preferLabel??!0),s=o||i}}return s}function wp(t){return t?.fillSymbol??(Wd(t?.symbol)?t?.symbol:void 0)}function xh(t){let e,r=t?.series?.find(i=>Yn(i)&&"nullCategory"in i&&i.nullCategory?.text!==void 0);return r&&"nullCategory"in r&&(e=r.nullCategory?.text),e}return{a:Q,b:oi,c:Sy,d:We,e:by,f:li,g:mo,h:vy,i:Fc,j:pr,k:P,l:ge,m:pe,n:Cy,o:gt,p:Fy,q:Oc,r:qe,s:xy,t:er,u:wy,v:J,w:Ty,x:It,y:De,z:$c,A:Rc,B:te,C:Ny,D:Oy,E:z,F:By,G:Fe,H:Ue,I:Iy,J:Ay,K:dd,L:My,M:Ey,N:xo,O:Ly,P:qy,Q:Dy,R:Py,S:At,T:be,U:ky,V:Vy,W:$y,X:vn,Y:Mt,Z:yd,_:wo,$:Ry,aa:Wy,ba:jy,ca:Zy,da:Rs,ea:yn,fa:br,ga:_y,ha:zy,ia:Uy,ja:Wd,ka:Hy,la:Gy,ma:Yy,na:Qy,oa:jd,pa:Jy,qa:Zd,ra:_d,sa:Ky,ta:Xy,ua:e0,va:t0,wa:r0,xa:i0,ya:n0,za:a0,Aa:s0,Ba:o0,Ca:l0,Da:u0,Ea:c0,Fa:d0,Ga:zd,Ha:Ud,Ia:f0,Ja:m0,Ka:g0,La:h0,Ma:y0,Na:Ao,Oa:ui,Pa:p0,Qa:S0,Ra:ci,Sa:b0,Ta:v0,Ua:mf,Va:Lo,Wa:C0,Xa:F0,Ya:x0,Za:_o,_a:w0,$a:T0,ab:qn,bb:Ho,cb:ce,db:pn,eb:he,fb:Dn,gb:km,hb:N0,ib:O0,jb:$m,kb:Rm,lb:eo,mb:jm,nb:B0,ob:zm,pb:Um,qb:ro,rb:I0,sb:A0,tb:M0,ub:Qm,vb:Jm,wb:Km,xb:Xm,yb:ag,zb:E0,Ab:L0,Bb:og,Cb:no,Db:ug,Eb:ao,Fb:q0,Gb:Fg,Hb:D0,Ib:el,Jb:Tg,Kb:Nr,Lb:P0,Mb:Lg,Nb:k0,Ob:V0,Pb:je,Qb:$0,Rb:He,Sb:Fr,Tb:qg,Ub:R0,Vb:W0,Wb:j0,Xb:Dg,Yb:Z0,Zb:oo,_b:nl,$b:Vg,ac:$g,bc:_0,cc:al,dc:Vn,ec:Rn,fc:z0,gc:U0,hc:H0,ic:G0,jc:Y0,kc:Q0,lc:Qg,mc:Jg,nc:J0,oc:pt,pc:K0,qc:de,rc:Se,sc:tt,tc:H,uc:ol,vc:X0,wc:it,xc:Re,yc:sh,zc:oh,Ac:lo,Bc:yh,Cc:ep,Dc:tp,Ec:rp,Fc:ip,Gc:np,Hc:ap,Ic:sp,Jc:op,Kc:lp,Lc:up,Mc:cp,Nc:dp,Oc:fp,Pc:mp,Qc:gp,Rc:hp,Sc:yp,Tc:pp,Uc:Sp,Vc:bp,Wc:vp,Xc:Cp,Yc:Fp,Zc:xp,_c:wp}},"Graphic","renderers/support/jsonUtils","symbols/support/symbolUtils","layers/support/FeatureFilter","smartMapping/statistics/histogram","smartMapping/statistics/summaryStatistics","applications/Components/imageryUtils","core/promiseUtils","geometry/Point","geometry/support/jsonUtils","rest/support/AttributeBinsQuery","rest/support/Query","rest/support/StatisticDefinition","time/TimeExtent","layers/FeatureLayer","layers/support/CodedValueDomain","layers/support/Field","layers/support/fieldUtils","portal/Portal","request","rest/support/FeatureSet","layers/ImageryLayer","layers/ImageryTileLayer","layers/WCSLayer","geometry/Extent","AttributeBinsGraphic","intl","core/sql")