12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943 |
- import {
- p as p2,
- s
- } from "./chunk-3ZFH4KQV.js";
- import {
- y
- } from "./chunk-BJHM4JNS.js";
- import {
- f,
- m,
- m2,
- v2 as v
- } from "./chunk-OWVBLVP3.js";
- import {
- l
- } from "./chunk-XH7RUGVZ.js";
- import {
- M2 as M,
- j2 as j,
- p
- } from "./chunk-ECW2QABR.js";
- import {
- t
- } from "./chunk-GZT4BVFP.js";
- // node_modules/@arcgis/core/arcade/ImmutableArray.js
- var t2 = class {
- constructor(t5 = []) {
- this._elements = t5;
- }
- length() {
- return this._elements.length;
- }
- get(t5) {
- return this._elements[t5];
- }
- toArray() {
- const t5 = [];
- for (let e = 0; e < this.length(); e++)
- t5.push(this.get(e));
- return t5;
- }
- };
- // node_modules/@arcgis/core/arcade/FunctionWrapper.js
- var t3 = class {
- constructor(t5, i3) {
- this.definition = null, this.context = null, this.definition = t5, this.context = i3;
- }
- };
- // node_modules/@arcgis/core/arcade/ImmutablePointArray.js
- var i = class extends t2 {
- constructor(t5, s3, i3, e, h2, a) {
- super(t5), this._lazyPt = [], this._hasZ = false, this._hasM = false, this._spRef = s3, this._hasZ = i3, this._hasM = e, this._cacheId = h2, this._partId = a;
- }
- get(t5) {
- if (this._lazyPt[t5] === void 0) {
- const i3 = this._elements[t5];
- if (i3 === void 0)
- return;
- const e = this._hasZ, h2 = this._hasM;
- let a = null;
- a = e && !h2 ? new j(i3[0], i3[1], i3[2], void 0, this._spRef) : h2 && !e ? new j(i3[0], i3[1], void 0, i3[2], this._spRef) : e && h2 ? new j(i3[0], i3[1], i3[2], i3[3], this._spRef) : new j(i3[0], i3[1], this._spRef), a.cache._arcadeCacheId = this._cacheId.toString() + "-" + this._partId.toString() + "-" + t5.toString(), this._lazyPt[t5] = a;
- }
- return this._lazyPt[t5];
- }
- equalityTest(t5) {
- return t5 === this || t5 !== null && (t5 instanceof i != false && t5.getUniqueHash() === this.getUniqueHash());
- }
- getUniqueHash() {
- return this._cacheId.toString() + "-" + this._partId.toString();
- }
- };
- // node_modules/@arcgis/core/arcade/ImmutablePathArray.js
- var h = class extends t2 {
- constructor(t5, s3, h2, i3, e) {
- super(t5), this._lazyPath = [], this._hasZ = false, this._hasM = false, this._hasZ = h2, this._hasM = i3, this._spRef = s3, this._cacheId = e;
- }
- get(t5) {
- if (this._lazyPath[t5] === void 0) {
- const h2 = this._elements[t5];
- if (h2 === void 0)
- return;
- this._lazyPath[t5] = new i(h2, this._spRef, this._hasZ, this._hasM, this._cacheId, t5);
- }
- return this._lazyPath[t5];
- }
- equalityTest(t5) {
- return t5 === this || t5 !== null && (t5 instanceof h != false && t5.getUniqueHash() === this.getUniqueHash());
- }
- getUniqueHash() {
- return this._cacheId.toString();
- }
- };
- // node_modules/@arcgis/core/arcade/featureset/support/shared.js
- var t4;
- var i2;
- function n(e) {
- return y.fromJSON(e.toJSON());
- }
- function o(e) {
- return e.toJSON ? e.toJSON() : e;
- }
- function l2(e) {
- return typeof e == "string" || e instanceof String;
- }
- function y2(e) {
- return typeof e == "number";
- }
- function p3(e) {
- return e instanceof Date;
- }
- function c(e, r) {
- return e === r || !(!p3(e) || !p3(r)) && e.getTime() === r.getTime();
- }
- function m3(e) {
- if (e === void 0)
- return null;
- if (typeof e == "number")
- return e;
- switch (e.toLowerCase()) {
- case "meters":
- case "meter":
- return 109404;
- case "miles":
- case "mile":
- return 109413;
- case "kilometers":
- case "kilometer":
- case "km":
- return 109414;
- }
- return null;
- }
- function d(r) {
- if (r === null)
- return null;
- switch (r.type) {
- case "polygon":
- case "multipoint":
- case "polyline":
- return r.extent;
- case "point":
- return new M({ xmin: r.x, ymin: r.y, xmax: r.x, ymax: r.y, spatialReference: r.spatialReference });
- case "extent":
- return r;
- }
- return null;
- }
- function f2(e) {
- if (e === void 0)
- return null;
- if (typeof e == "number")
- return e;
- if (typeof e == "number")
- return e;
- switch (e.toLowerCase()) {
- case "meters":
- case "meter":
- return 9001;
- case "miles":
- case "mile":
- return 9035;
- case "kilometers":
- case "kilometer":
- case "km":
- return 9036;
- }
- return null;
- }
- !function(e) {
- e[e.Standardised = 0] = "Standardised", e[e.StandardisedNoInterval = 1] = "StandardisedNoInterval", e[e.SqlServer = 2] = "SqlServer", e[e.Oracle = 3] = "Oracle", e[e.Postgres = 4] = "Postgres", e[e.PGDB = 5] = "PGDB", e[e.FILEGDB = 6] = "FILEGDB", e[e.NotEvaluated = 7] = "NotEvaluated";
- }(t4 || (t4 = {})), function(e) {
- e[e.InFeatureSet = 0] = "InFeatureSet", e[e.NotInFeatureSet = 1] = "NotInFeatureSet", e[e.Unknown = 2] = "Unknown";
- }(i2 || (i2 = {}));
- var F = 1e3;
- var S = { point: "point", polygon: "polygon", polyline: "polyline", multipoint: "multipoint", extent: "extent", esriGeometryPoint: "point", esriGeometryPolygon: "polygon", esriGeometryPolyline: "polyline", esriGeometryMultipoint: "multipoint", esriGeometryEnvelope: "extent", envelope: "extent" };
- var v2 = { point: "esriGeometryPoint", polygon: "esriGeometryPolygon", polyline: "esriGeometryPolyline", multipoint: "esriGeometryMultipoint", extent: "esriGeometryEnvelope", esriGeometryPoint: "esriGeometryPoint", esriGeometryPolygon: "esriGeometryPolygon", esriGeometryPolyline: "esriGeometryPolyline", esriGeometryMultipoint: "esriGeometryMultipoint", esriGeometryEnvelope: "esriGeometryEnvelope", envelope: "esriGeometryEnvelope" };
- var P = { "small-integer": "esriFieldTypeSmallInteger", integer: "esriFieldTypeInteger", long: "esriFieldTypeLong", single: "esriFieldTypeSingle", double: "esriFieldTypeDouble", string: "esriFieldTypeString", date: "esriFieldTypeDate", oid: "esriFieldTypeOID", geometry: "esriFieldTypeGeometry", blob: "esriFieldTypeBlob", raster: "esriFieldTypeRaster", guid: "esriFieldTypeGUID", "global-id": "esriFieldTypeGlobalID", xml: "eesriFieldTypeXML", esriFieldTypeSmallInteger: "esriFieldTypeSmallInteger", esriFieldTypeInteger: "esriFieldTypeInteger", esriFieldTypeLong: "esriFieldTypeLong", esriFieldTypeSingle: "esriFieldTypeSingle", esriFieldTypeDouble: "esriFieldTypeDouble", esriFieldTypeString: "esriFieldTypeString", esriFieldTypeDate: "esriFieldTypeDate", esriFieldTypeOID: "esriFieldTypeOID", esriFieldTypeGeometry: "esriFieldTypeGeometry", esriFieldTypeBlob: "esriFieldTypeBlob", esriFieldTypeRaster: "esriFieldTypeRaster", esriFieldTypeGUID: "esriFieldTypeGUID", esriFieldTypeGlobalID: "esriFieldTypeGlobalID", esriFieldTypeXML: "eesriFieldTypeXML" };
- function b(e) {
- return e === void 0 ? "" : e = (e = (e = e.replace(/\/featureserver\/[0-9]*/i, "/FeatureServer")).replace(/\/mapserver\/[0-9]*/i, "/MapServer")).split("?")[0];
- }
- function D(e, r) {
- r || (r = {}), typeof r == "function" && (r = { cmp: r });
- const t5 = typeof r.cycles == "boolean" && r.cycles, i3 = r.cmp && (n3 = r.cmp, function(e2) {
- return function(r2, t6) {
- const i4 = { key: r2, value: e2[r2] }, o3 = { key: t6, value: e2[t6] };
- return n3(i4, o3);
- };
- });
- var n3;
- const o2 = [];
- return function e2(r2) {
- if (r2 && r2.toJSON && typeof r2.toJSON == "function" && (r2 = r2.toJSON()), r2 === void 0)
- return;
- if (typeof r2 == "number")
- return isFinite(r2) ? "" + r2 : "null";
- if (typeof r2 != "object")
- return JSON.stringify(r2);
- let n4, l4;
- if (Array.isArray(r2)) {
- for (l4 = "[", n4 = 0; n4 < r2.length; n4++)
- n4 && (l4 += ","), l4 += e2(r2[n4]) || "null";
- return l4 + "]";
- }
- if (r2 === null)
- return "null";
- if (o2.includes(r2)) {
- if (t5)
- return JSON.stringify("__cycle__");
- throw new TypeError("Converting circular structure to JSON");
- }
- const s3 = o2.push(r2) - 1, y3 = Object.keys(r2).sort(i3 && i3(r2));
- for (l4 = "", n4 = 0; n4 < y3.length; n4++) {
- const t6 = y3[n4], i4 = e2(r2[t6]);
- i4 && (l4 && (l4 += ","), l4 += JSON.stringify(t6) + ":" + i4);
- }
- return o2.splice(s3, 1), "{" + l4 + "}";
- }(e);
- }
- // node_modules/luxon/src/errors.js
- var LuxonError = class extends Error {
- };
- var InvalidDateTimeError = class extends LuxonError {
- constructor(reason) {
- super(`Invalid DateTime: ${reason.toMessage()}`);
- }
- };
- var InvalidIntervalError = class extends LuxonError {
- constructor(reason) {
- super(`Invalid Interval: ${reason.toMessage()}`);
- }
- };
- var InvalidDurationError = class extends LuxonError {
- constructor(reason) {
- super(`Invalid Duration: ${reason.toMessage()}`);
- }
- };
- var ConflictingSpecificationError = class extends LuxonError {
- };
- var InvalidUnitError = class extends LuxonError {
- constructor(unit) {
- super(`Invalid unit ${unit}`);
- }
- };
- var InvalidArgumentError = class extends LuxonError {
- };
- var ZoneIsAbstractError = class extends LuxonError {
- constructor() {
- super("Zone is an abstract class");
- }
- };
- // node_modules/luxon/src/impl/formats.js
- var n2 = "numeric";
- var s2 = "short";
- var l3 = "long";
- var DATE_SHORT = {
- year: n2,
- month: n2,
- day: n2
- };
- var DATE_MED = {
- year: n2,
- month: s2,
- day: n2
- };
- var DATE_MED_WITH_WEEKDAY = {
- year: n2,
- month: s2,
- day: n2,
- weekday: s2
- };
- var DATE_FULL = {
- year: n2,
- month: l3,
- day: n2
- };
- var DATE_HUGE = {
- year: n2,
- month: l3,
- day: n2,
- weekday: l3
- };
- var TIME_SIMPLE = {
- hour: n2,
- minute: n2
- };
- var TIME_WITH_SECONDS = {
- hour: n2,
- minute: n2,
- second: n2
- };
- var TIME_WITH_SHORT_OFFSET = {
- hour: n2,
- minute: n2,
- second: n2,
- timeZoneName: s2
- };
- var TIME_WITH_LONG_OFFSET = {
- hour: n2,
- minute: n2,
- second: n2,
- timeZoneName: l3
- };
- var TIME_24_SIMPLE = {
- hour: n2,
- minute: n2,
- hourCycle: "h23"
- };
- var TIME_24_WITH_SECONDS = {
- hour: n2,
- minute: n2,
- second: n2,
- hourCycle: "h23"
- };
- var TIME_24_WITH_SHORT_OFFSET = {
- hour: n2,
- minute: n2,
- second: n2,
- hourCycle: "h23",
- timeZoneName: s2
- };
- var TIME_24_WITH_LONG_OFFSET = {
- hour: n2,
- minute: n2,
- second: n2,
- hourCycle: "h23",
- timeZoneName: l3
- };
- var DATETIME_SHORT = {
- year: n2,
- month: n2,
- day: n2,
- hour: n2,
- minute: n2
- };
- var DATETIME_SHORT_WITH_SECONDS = {
- year: n2,
- month: n2,
- day: n2,
- hour: n2,
- minute: n2,
- second: n2
- };
- var DATETIME_MED = {
- year: n2,
- month: s2,
- day: n2,
- hour: n2,
- minute: n2
- };
- var DATETIME_MED_WITH_SECONDS = {
- year: n2,
- month: s2,
- day: n2,
- hour: n2,
- minute: n2,
- second: n2
- };
- var DATETIME_MED_WITH_WEEKDAY = {
- year: n2,
- month: s2,
- day: n2,
- weekday: s2,
- hour: n2,
- minute: n2
- };
- var DATETIME_FULL = {
- year: n2,
- month: l3,
- day: n2,
- hour: n2,
- minute: n2,
- timeZoneName: s2
- };
- var DATETIME_FULL_WITH_SECONDS = {
- year: n2,
- month: l3,
- day: n2,
- hour: n2,
- minute: n2,
- second: n2,
- timeZoneName: s2
- };
- var DATETIME_HUGE = {
- year: n2,
- month: l3,
- day: n2,
- weekday: l3,
- hour: n2,
- minute: n2,
- timeZoneName: l3
- };
- var DATETIME_HUGE_WITH_SECONDS = {
- year: n2,
- month: l3,
- day: n2,
- weekday: l3,
- hour: n2,
- minute: n2,
- second: n2,
- timeZoneName: l3
- };
- // node_modules/luxon/src/impl/util.js
- function isUndefined(o2) {
- return typeof o2 === "undefined";
- }
- function isNumber(o2) {
- return typeof o2 === "number";
- }
- function isInteger(o2) {
- return typeof o2 === "number" && o2 % 1 === 0;
- }
- function isString(o2) {
- return typeof o2 === "string";
- }
- function isDate(o2) {
- return Object.prototype.toString.call(o2) === "[object Date]";
- }
- function hasRelative() {
- try {
- return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat;
- } catch (e) {
- return false;
- }
- }
- function maybeArray(thing) {
- return Array.isArray(thing) ? thing : [thing];
- }
- function bestBy(arr, by, compare) {
- if (arr.length === 0) {
- return void 0;
- }
- return arr.reduce((best, next) => {
- const pair = [by(next), next];
- if (!best) {
- return pair;
- } else if (compare(best[0], pair[0]) === best[0]) {
- return best;
- } else {
- return pair;
- }
- }, null)[1];
- }
- function pick(obj, keys) {
- return keys.reduce((a, k2) => {
- a[k2] = obj[k2];
- return a;
- }, {});
- }
- function hasOwnProperty(obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
- }
- function integerBetween(thing, bottom, top) {
- return isInteger(thing) && thing >= bottom && thing <= top;
- }
- function floorMod(x2, n3) {
- return x2 - n3 * Math.floor(x2 / n3);
- }
- function padStart(input, n3 = 2) {
- const isNeg = input < 0;
- let padded;
- if (isNeg) {
- padded = "-" + ("" + -input).padStart(n3, "0");
- } else {
- padded = ("" + input).padStart(n3, "0");
- }
- return padded;
- }
- function parseInteger(string) {
- if (isUndefined(string) || string === null || string === "") {
- return void 0;
- } else {
- return parseInt(string, 10);
- }
- }
- function parseFloating(string) {
- if (isUndefined(string) || string === null || string === "") {
- return void 0;
- } else {
- return parseFloat(string);
- }
- }
- function parseMillis(fraction) {
- if (isUndefined(fraction) || fraction === null || fraction === "") {
- return void 0;
- } else {
- const f3 = parseFloat("0." + fraction) * 1e3;
- return Math.floor(f3);
- }
- }
- function roundTo(number, digits, towardZero = false) {
- const factor = 10 ** digits, rounder = towardZero ? Math.trunc : Math.round;
- return rounder(number * factor) / factor;
- }
- function isLeapYear(year) {
- return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
- }
- function daysInYear(year) {
- return isLeapYear(year) ? 366 : 365;
- }
- function daysInMonth(year, month) {
- const modMonth = floorMod(month - 1, 12) + 1, modYear = year + (month - modMonth) / 12;
- if (modMonth === 2) {
- return isLeapYear(modYear) ? 29 : 28;
- } else {
- return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];
- }
- }
- function objToLocalTS(obj) {
- let d2 = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond);
- if (obj.year < 100 && obj.year >= 0) {
- d2 = new Date(d2);
- d2.setUTCFullYear(d2.getUTCFullYear() - 1900);
- }
- return +d2;
- }
- function weeksInWeekYear(weekYear) {
- const p1 = (weekYear + Math.floor(weekYear / 4) - Math.floor(weekYear / 100) + Math.floor(weekYear / 400)) % 7, last = weekYear - 1, p22 = (last + Math.floor(last / 4) - Math.floor(last / 100) + Math.floor(last / 400)) % 7;
- return p1 === 4 || p22 === 3 ? 53 : 52;
- }
- function untruncateYear(year) {
- if (year > 99) {
- return year;
- } else
- return year > 60 ? 1900 + year : 2e3 + year;
- }
- function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {
- const date = new Date(ts), intlOpts = {
- hourCycle: "h23",
- year: "numeric",
- month: "2-digit",
- day: "2-digit",
- hour: "2-digit",
- minute: "2-digit"
- };
- if (timeZone) {
- intlOpts.timeZone = timeZone;
- }
- const modified = { timeZoneName: offsetFormat, ...intlOpts };
- const parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find((m4) => m4.type.toLowerCase() === "timezonename");
- return parsed ? parsed.value : null;
- }
- function signedOffset(offHourStr, offMinuteStr) {
- let offHour = parseInt(offHourStr, 10);
- if (Number.isNaN(offHour)) {
- offHour = 0;
- }
- const offMin = parseInt(offMinuteStr, 10) || 0, offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;
- return offHour * 60 + offMinSigned;
- }
- function asNumber(value) {
- const numericValue = Number(value);
- if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue))
- throw new InvalidArgumentError(`Invalid unit value ${value}`);
- return numericValue;
- }
- function normalizeObject(obj, normalizer) {
- const normalized = {};
- for (const u in obj) {
- if (hasOwnProperty(obj, u)) {
- const v4 = obj[u];
- if (v4 === void 0 || v4 === null)
- continue;
- normalized[normalizer(u)] = asNumber(v4);
- }
- }
- return normalized;
- }
- function formatOffset(offset2, format) {
- const hours = Math.trunc(Math.abs(offset2 / 60)), minutes = Math.trunc(Math.abs(offset2 % 60)), sign = offset2 >= 0 ? "+" : "-";
- switch (format) {
- case "short":
- return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;
- case "narrow":
- return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`;
- case "techie":
- return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;
- default:
- throw new RangeError(`Value format ${format} is out of range for property format`);
- }
- }
- function timeObject(obj) {
- return pick(obj, ["hour", "minute", "second", "millisecond"]);
- }
- var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
- // node_modules/luxon/src/impl/english.js
- var monthsLong = [
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December"
- ];
- var monthsShort = [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec"
- ];
- var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
- function months(length) {
- switch (length) {
- case "narrow":
- return [...monthsNarrow];
- case "short":
- return [...monthsShort];
- case "long":
- return [...monthsLong];
- 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 weekdaysLong = [
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday",
- "Sunday"
- ];
- var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
- var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"];
- function weekdays(length) {
- switch (length) {
- case "narrow":
- return [...weekdaysNarrow];
- case "short":
- return [...weekdaysShort];
- case "long":
- return [...weekdaysLong];
- case "numeric":
- return ["1", "2", "3", "4", "5", "6", "7"];
- default:
- return null;
- }
- }
- var meridiems = ["AM", "PM"];
- var erasLong = ["Before Christ", "Anno Domini"];
- var erasShort = ["BC", "AD"];
- var erasNarrow = ["B", "A"];
- function eras(length) {
- switch (length) {
- case "narrow":
- return [...erasNarrow];
- case "short":
- return [...erasShort];
- case "long":
- return [...erasLong];
- default:
- return null;
- }
- }
- function meridiemForDateTime(dt) {
- return meridiems[dt.hour < 12 ? 0 : 1];
- }
- function weekdayForDateTime(dt, length) {
- return weekdays(length)[dt.weekday - 1];
- }
- function monthForDateTime(dt, length) {
- return months(length)[dt.month - 1];
- }
- function eraForDateTime(dt, length) {
- return eras(length)[dt.year < 0 ? 0 : 1];
- }
- function formatRelativeTime(unit, count, numeric = "always", narrow = false) {
- const units = {
- 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."]
- };
- const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1;
- if (numeric === "auto" && lastable) {
- const isDay = unit === "days";
- switch (count) {
- case 1:
- return isDay ? "tomorrow" : `next ${units[unit][0]}`;
- case -1:
- return isDay ? "yesterday" : `last ${units[unit][0]}`;
- case 0:
- return isDay ? "today" : `this ${units[unit][0]}`;
- default:
- }
- }
- const isInPast = Object.is(count, -0) || count < 0, fmtValue = Math.abs(count), singular = fmtValue === 1, lilUnits = units[unit], fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit;
- return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;
- }
- // node_modules/luxon/src/impl/formatter.js
- function stringifyTokens(splits, tokenToString) {
- let s3 = "";
- for (const token of splits) {
- if (token.literal) {
- s3 += token.val;
- } else {
- s3 += tokenToString(token.val);
- }
- }
- return s3;
- }
- var macroTokenToFormatOpts = {
- D: DATE_SHORT,
- DD: DATE_MED,
- DDD: DATE_FULL,
- DDDD: DATE_HUGE,
- t: TIME_SIMPLE,
- tt: TIME_WITH_SECONDS,
- ttt: TIME_WITH_SHORT_OFFSET,
- tttt: TIME_WITH_LONG_OFFSET,
- T: TIME_24_SIMPLE,
- TT: TIME_24_WITH_SECONDS,
- TTT: TIME_24_WITH_SHORT_OFFSET,
- TTTT: TIME_24_WITH_LONG_OFFSET,
- f: DATETIME_SHORT,
- ff: DATETIME_MED,
- fff: DATETIME_FULL,
- ffff: DATETIME_HUGE,
- F: DATETIME_SHORT_WITH_SECONDS,
- FF: DATETIME_MED_WITH_SECONDS,
- FFF: DATETIME_FULL_WITH_SECONDS,
- FFFF: DATETIME_HUGE_WITH_SECONDS
- };
- var Formatter = class {
- static create(locale, opts = {}) {
- return new Formatter(locale, opts);
- }
- static parseFormat(fmt) {
- let current = null, currentFull = "", bracketed = false;
- const splits = [];
- for (let i3 = 0; i3 < fmt.length; i3++) {
- const c2 = fmt.charAt(i3);
- if (c2 === "'") {
- if (currentFull.length > 0) {
- splits.push({ literal: bracketed, val: currentFull });
- }
- current = null;
- currentFull = "";
- bracketed = !bracketed;
- } else if (bracketed) {
- currentFull += c2;
- } else if (c2 === current) {
- currentFull += c2;
- } else {
- if (currentFull.length > 0) {
- splits.push({ literal: false, val: currentFull });
- }
- currentFull = c2;
- current = c2;
- }
- }
- if (currentFull.length > 0) {
- splits.push({ literal: bracketed, val: currentFull });
- }
- return splits;
- }
- static macroTokenToFormatOpts(token) {
- return macroTokenToFormatOpts[token];
- }
- constructor(locale, formatOpts) {
- this.opts = formatOpts;
- this.loc = locale;
- this.systemLoc = null;
- }
- formatWithSystemDefault(dt, opts) {
- if (this.systemLoc === null) {
- this.systemLoc = this.loc.redefaultToSystem();
- }
- const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });
- return df.format();
- }
- formatDateTime(dt, opts = {}) {
- const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });
- return df.format();
- }
- formatDateTimeParts(dt, opts = {}) {
- const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });
- return df.formatToParts();
- }
- resolvedOptions(dt, opts = {}) {
- const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });
- return df.resolvedOptions();
- }
- num(n3, p4 = 0) {
- if (this.opts.forceSimple) {
- return padStart(n3, p4);
- }
- const opts = { ...this.opts };
- if (p4 > 0) {
- opts.padTo = p4;
- }
- return this.loc.numberFormatter(opts).format(n3);
- }
- formatDateTimeFromString(dt, fmt) {
- const knownEnglish = this.loc.listingMode() === "en", useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", string = (opts, extract) => this.loc.extract(dt, opts, extract), formatOffset2 = (opts) => {
- if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {
- return "Z";
- }
- return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : "";
- }, meridiem = () => knownEnglish ? meridiemForDateTime(dt) : string({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), month = (length, standalone) => knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { month: length } : { month: length, day: "numeric" }, "month"), weekday = (length, standalone) => knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { weekday: length } : { weekday: length, month: "long", day: "numeric" }, "weekday"), maybeMacro = (token) => {
- const formatOpts = Formatter.macroTokenToFormatOpts(token);
- if (formatOpts) {
- return this.formatWithSystemDefault(dt, formatOpts);
- } else {
- return token;
- }
- }, era = (length) => knownEnglish ? eraForDateTime(dt, length) : string({ era: length }, "era"), tokenToString = (token) => {
- switch (token) {
- case "S":
- return this.num(dt.millisecond);
- case "u":
- case "SSS":
- return this.num(dt.millisecond, 3);
- case "s":
- return this.num(dt.second);
- case "ss":
- return this.num(dt.second, 2);
- case "uu":
- return this.num(Math.floor(dt.millisecond / 10), 2);
- case "uuu":
- return this.num(Math.floor(dt.millisecond / 100));
- case "m":
- return this.num(dt.minute);
- case "mm":
- return this.num(dt.minute, 2);
- case "h":
- return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);
- case "hh":
- return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);
- case "H":
- return this.num(dt.hour);
- case "HH":
- return this.num(dt.hour, 2);
- case "Z":
- return formatOffset2({ format: "narrow", allowZ: this.opts.allowZ });
- case "ZZ":
- return formatOffset2({ format: "short", allowZ: this.opts.allowZ });
- case "ZZZ":
- return formatOffset2({ format: "techie", allowZ: this.opts.allowZ });
- case "ZZZZ":
- return dt.zone.offsetName(dt.ts, { format: "short", locale: this.loc.locale });
- case "ZZZZZ":
- return dt.zone.offsetName(dt.ts, { format: "long", locale: this.loc.locale });
- case "z":
- return dt.zoneName;
- case "a":
- return meridiem();
- case "d":
- return useDateTimeFormatter ? string({ day: "numeric" }, "day") : this.num(dt.day);
- case "dd":
- return useDateTimeFormatter ? string({ day: "2-digit" }, "day") : this.num(dt.day, 2);
- case "c":
- return this.num(dt.weekday);
- case "ccc":
- return weekday("short", true);
- case "cccc":
- return weekday("long", true);
- case "ccccc":
- return weekday("narrow", true);
- case "E":
- return this.num(dt.weekday);
- case "EEE":
- return weekday("short", false);
- case "EEEE":
- return weekday("long", false);
- case "EEEEE":
- return weekday("narrow", false);
- case "L":
- return useDateTimeFormatter ? string({ month: "numeric", day: "numeric" }, "month") : this.num(dt.month);
- case "LL":
- return useDateTimeFormatter ? string({ month: "2-digit", day: "numeric" }, "month") : this.num(dt.month, 2);
- case "LLL":
- return month("short", true);
- case "LLLL":
- return month("long", true);
- case "LLLLL":
- return month("narrow", true);
- case "M":
- return useDateTimeFormatter ? string({ month: "numeric" }, "month") : this.num(dt.month);
- case "MM":
- return useDateTimeFormatter ? string({ month: "2-digit" }, "month") : this.num(dt.month, 2);
- case "MMM":
- return month("short", false);
- case "MMMM":
- return month("long", false);
- case "MMMMM":
- return month("narrow", false);
- case "y":
- return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year);
- case "yy":
- return useDateTimeFormatter ? string({ year: "2-digit" }, "year") : this.num(dt.year.toString().slice(-2), 2);
- case "yyyy":
- return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 4);
- case "yyyyyy":
- return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 6);
- case "G":
- return era("short");
- case "GG":
- return era("long");
- case "GGGGG":
- return era("narrow");
- case "kk":
- return this.num(dt.weekYear.toString().slice(-2), 2);
- case "kkkk":
- return this.num(dt.weekYear, 4);
- case "W":
- return this.num(dt.weekNumber);
- case "WW":
- return this.num(dt.weekNumber, 2);
- case "o":
- return this.num(dt.ordinal);
- case "ooo":
- return this.num(dt.ordinal, 3);
- case "q":
- return this.num(dt.quarter);
- case "qq":
- return this.num(dt.quarter, 2);
- case "X":
- return this.num(Math.floor(dt.ts / 1e3));
- case "x":
- return this.num(dt.ts);
- default:
- return maybeMacro(token);
- }
- };
- return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);
- }
- formatDurationFromString(dur, fmt) {
- const tokenToField = (token) => {
- switch (token[0]) {
- case "S":
- return "millisecond";
- case "s":
- return "second";
- case "m":
- return "minute";
- case "h":
- return "hour";
- case "d":
- return "day";
- case "w":
- return "week";
- case "M":
- return "month";
- case "y":
- return "year";
- default:
- return null;
- }
- }, tokenToString = (lildur) => (token) => {
- const mapped = tokenToField(token);
- if (mapped) {
- return this.num(lildur.get(mapped), token.length);
- } else {
- return token;
- }
- }, tokens = Formatter.parseFormat(fmt), realTokens = tokens.reduce((found, { literal, val }) => literal ? found : found.concat(val), []), collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t5) => t5));
- return stringifyTokens(tokens, tokenToString(collapsed));
- }
- };
- // node_modules/luxon/src/impl/invalid.js
- var Invalid = class {
- constructor(reason, explanation) {
- this.reason = reason;
- this.explanation = explanation;
- }
- toMessage() {
- if (this.explanation) {
- return `${this.reason}: ${this.explanation}`;
- } else {
- return this.reason;
- }
- }
- };
- // node_modules/luxon/src/zone.js
- var Zone = class {
- get type() {
- throw new ZoneIsAbstractError();
- }
- get name() {
- throw new ZoneIsAbstractError();
- }
- get ianaName() {
- return this.name;
- }
- get isUniversal() {
- throw new ZoneIsAbstractError();
- }
- offsetName(ts, opts) {
- throw new ZoneIsAbstractError();
- }
- formatOffset(ts, format) {
- throw new ZoneIsAbstractError();
- }
- offset(ts) {
- throw new ZoneIsAbstractError();
- }
- equals(otherZone) {
- throw new ZoneIsAbstractError();
- }
- get isValid() {
- throw new ZoneIsAbstractError();
- }
- };
- // node_modules/luxon/src/zones/systemZone.js
- var singleton = null;
- var SystemZone = class extends Zone {
- static get instance() {
- if (singleton === null) {
- singleton = new SystemZone();
- }
- return singleton;
- }
- get type() {
- return "system";
- }
- get name() {
- return new Intl.DateTimeFormat().resolvedOptions().timeZone;
- }
- get isUniversal() {
- return false;
- }
- offsetName(ts, { format, locale }) {
- return parseZoneInfo(ts, format, locale);
- }
- formatOffset(ts, format) {
- return formatOffset(this.offset(ts), format);
- }
- offset(ts) {
- return -new Date(ts).getTimezoneOffset();
- }
- equals(otherZone) {
- return otherZone.type === "system";
- }
- get isValid() {
- return true;
- }
- };
- // node_modules/luxon/src/zones/IANAZone.js
- var dtfCache = {};
- function makeDTF(zone) {
- if (!dtfCache[zone]) {
- dtfCache[zone] = new Intl.DateTimeFormat("en-US", {
- hour12: false,
- timeZone: zone,
- year: "numeric",
- month: "2-digit",
- day: "2-digit",
- hour: "2-digit",
- minute: "2-digit",
- second: "2-digit",
- era: "short"
- });
- }
- return dtfCache[zone];
- }
- var typeToPos = {
- year: 0,
- month: 1,
- day: 2,
- era: 3,
- hour: 4,
- minute: 5,
- second: 6
- };
- function hackyOffset(dtf, date) {
- const formatted = dtf.format(date).replace(/\u200E/g, ""), parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;
- return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];
- }
- function partsOffset(dtf, date) {
- const formatted = dtf.formatToParts(date);
- const filled = [];
- for (let i3 = 0; i3 < formatted.length; i3++) {
- const { type, value } = formatted[i3];
- const pos = typeToPos[type];
- if (type === "era") {
- filled[pos] = value;
- } else if (!isUndefined(pos)) {
- filled[pos] = parseInt(value, 10);
- }
- }
- return filled;
- }
- var ianaZoneCache = {};
- var IANAZone = class extends Zone {
- static create(name) {
- if (!ianaZoneCache[name]) {
- ianaZoneCache[name] = new IANAZone(name);
- }
- return ianaZoneCache[name];
- }
- static resetCache() {
- ianaZoneCache = {};
- dtfCache = {};
- }
- static isValidSpecifier(s3) {
- return this.isValidZone(s3);
- }
- static isValidZone(zone) {
- if (!zone) {
- return false;
- }
- try {
- new Intl.DateTimeFormat("en-US", { timeZone: zone }).format();
- return true;
- } catch (e) {
- return false;
- }
- }
- constructor(name) {
- super();
- this.zoneName = name;
- this.valid = IANAZone.isValidZone(name);
- }
- get type() {
- return "iana";
- }
- get name() {
- return this.zoneName;
- }
- get isUniversal() {
- return false;
- }
- offsetName(ts, { format, locale }) {
- return parseZoneInfo(ts, format, locale, this.name);
- }
- formatOffset(ts, format) {
- return formatOffset(this.offset(ts), format);
- }
- offset(ts) {
- const date = new Date(ts);
- if (isNaN(date))
- return NaN;
- const dtf = makeDTF(this.name);
- let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);
- if (adOrBc === "BC") {
- year = -Math.abs(year) + 1;
- }
- const adjustedHour = hour === 24 ? 0 : hour;
- const asUTC = objToLocalTS({
- year,
- month,
- day,
- hour: adjustedHour,
- minute,
- second,
- millisecond: 0
- });
- let asTS = +date;
- const over = asTS % 1e3;
- asTS -= over >= 0 ? over : 1e3 + over;
- return (asUTC - asTS) / (60 * 1e3);
- }
- equals(otherZone) {
- return otherZone.type === "iana" && otherZone.name === this.name;
- }
- get isValid() {
- return this.valid;
- }
- };
- // node_modules/luxon/src/zones/fixedOffsetZone.js
- var singleton2 = null;
- var FixedOffsetZone = class extends Zone {
- static get utcInstance() {
- if (singleton2 === null) {
- singleton2 = new FixedOffsetZone(0);
- }
- return singleton2;
- }
- static instance(offset2) {
- return offset2 === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset2);
- }
- static parseSpecifier(s3) {
- if (s3) {
- const r = s3.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
- if (r) {
- return new FixedOffsetZone(signedOffset(r[1], r[2]));
- }
- }
- return null;
- }
- constructor(offset2) {
- super();
- this.fixed = offset2;
- }
- get type() {
- return "fixed";
- }
- get name() {
- return this.fixed === 0 ? "UTC" : `UTC${formatOffset(this.fixed, "narrow")}`;
- }
- get ianaName() {
- if (this.fixed === 0) {
- return "Etc/UTC";
- } else {
- return `Etc/GMT${formatOffset(-this.fixed, "narrow")}`;
- }
- }
- offsetName() {
- return this.name;
- }
- formatOffset(ts, format) {
- return formatOffset(this.fixed, format);
- }
- get isUniversal() {
- return true;
- }
- offset() {
- return this.fixed;
- }
- equals(otherZone) {
- return otherZone.type === "fixed" && otherZone.fixed === this.fixed;
- }
- get isValid() {
- return true;
- }
- };
- // node_modules/luxon/src/zones/invalidZone.js
- var InvalidZone = class extends Zone {
- constructor(zoneName) {
- super();
- this.zoneName = zoneName;
- }
- get type() {
- return "invalid";
- }
- get name() {
- return this.zoneName;
- }
- get isUniversal() {
- return false;
- }
- offsetName() {
- return null;
- }
- formatOffset() {
- return "";
- }
- offset() {
- return NaN;
- }
- equals() {
- return false;
- }
- get isValid() {
- return false;
- }
- };
- // node_modules/luxon/src/impl/zoneUtil.js
- function normalizeZone(input, defaultZone2) {
- let offset2;
- if (isUndefined(input) || input === null) {
- return defaultZone2;
- } else if (input instanceof Zone) {
- return input;
- } else if (isString(input)) {
- const lowered = input.toLowerCase();
- if (lowered === "local" || lowered === "system")
- return defaultZone2;
- else if (lowered === "utc" || lowered === "gmt")
- return FixedOffsetZone.utcInstance;
- else
- return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);
- } else if (isNumber(input)) {
- return FixedOffsetZone.instance(input);
- } else if (typeof input === "object" && input.offset && typeof input.offset === "number") {
- return input;
- } else {
- return new InvalidZone(input);
- }
- }
- // node_modules/luxon/src/settings.js
- var now = () => Date.now();
- var defaultZone = "system";
- var defaultLocale = null;
- var defaultNumberingSystem = null;
- var defaultOutputCalendar = null;
- var throwOnInvalid;
- var Settings = class {
- static get now() {
- return now;
- }
- static set now(n3) {
- now = n3;
- }
- static set defaultZone(zone) {
- defaultZone = zone;
- }
- static get defaultZone() {
- return normalizeZone(defaultZone, SystemZone.instance);
- }
- static get defaultLocale() {
- return defaultLocale;
- }
- static set defaultLocale(locale) {
- defaultLocale = locale;
- }
- static get defaultNumberingSystem() {
- return defaultNumberingSystem;
- }
- static set defaultNumberingSystem(numberingSystem) {
- defaultNumberingSystem = numberingSystem;
- }
- static get defaultOutputCalendar() {
- return defaultOutputCalendar;
- }
- static set defaultOutputCalendar(outputCalendar) {
- defaultOutputCalendar = outputCalendar;
- }
- static get throwOnInvalid() {
- return throwOnInvalid;
- }
- static set throwOnInvalid(t5) {
- throwOnInvalid = t5;
- }
- static resetCaches() {
- Locale.resetCache();
- IANAZone.resetCache();
- }
- };
- // node_modules/luxon/src/impl/locale.js
- var intlLFCache = {};
- function getCachedLF(locString, opts = {}) {
- const key = JSON.stringify([locString, opts]);
- let dtf = intlLFCache[key];
- if (!dtf) {
- dtf = new Intl.ListFormat(locString, opts);
- intlLFCache[key] = dtf;
- }
- return dtf;
- }
- var intlDTCache = {};
- function getCachedDTF(locString, opts = {}) {
- const key = JSON.stringify([locString, opts]);
- let dtf = intlDTCache[key];
- if (!dtf) {
- dtf = new Intl.DateTimeFormat(locString, opts);
- intlDTCache[key] = dtf;
- }
- return dtf;
- }
- var intlNumCache = {};
- function getCachedINF(locString, opts = {}) {
- const key = JSON.stringify([locString, opts]);
- let inf = intlNumCache[key];
- if (!inf) {
- inf = new Intl.NumberFormat(locString, opts);
- intlNumCache[key] = inf;
- }
- return inf;
- }
- var intlRelCache = {};
- function getCachedRTF(locString, opts = {}) {
- const { base, ...cacheKeyOpts } = opts;
- const key = JSON.stringify([locString, cacheKeyOpts]);
- let inf = intlRelCache[key];
- if (!inf) {
- inf = new Intl.RelativeTimeFormat(locString, opts);
- intlRelCache[key] = inf;
- }
- return inf;
- }
- var sysLocaleCache = null;
- function systemLocale() {
- if (sysLocaleCache) {
- return sysLocaleCache;
- } else {
- sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;
- return sysLocaleCache;
- }
- }
- function parseLocaleString(localeStr) {
- const uIndex = localeStr.indexOf("-u-");
- if (uIndex === -1) {
- return [localeStr];
- } else {
- let options;
- const smaller = localeStr.substring(0, uIndex);
- try {
- options = getCachedDTF(localeStr).resolvedOptions();
- } catch (e) {
- options = getCachedDTF(smaller).resolvedOptions();
- }
- const { numberingSystem, calendar } = options;
- return [smaller, numberingSystem, calendar];
- }
- }
- function intlConfigString(localeStr, numberingSystem, outputCalendar) {
- if (outputCalendar || numberingSystem) {
- localeStr += "-u";
- if (outputCalendar) {
- localeStr += `-ca-${outputCalendar}`;
- }
- if (numberingSystem) {
- localeStr += `-nu-${numberingSystem}`;
- }
- return localeStr;
- } else {
- return localeStr;
- }
- }
- function mapMonths(f3) {
- const ms = [];
- for (let i3 = 1; i3 <= 12; i3++) {
- const dt = DateTime.utc(2016, i3, 1);
- ms.push(f3(dt));
- }
- return ms;
- }
- function mapWeekdays(f3) {
- const ms = [];
- for (let i3 = 1; i3 <= 7; i3++) {
- const dt = DateTime.utc(2016, 11, 13 + i3);
- ms.push(f3(dt));
- }
- return ms;
- }
- function listStuff(loc, length, defaultOK, englishFn, intlFn) {
- const mode = loc.listingMode(defaultOK);
- if (mode === "error") {
- return null;
- } else if (mode === "en") {
- return englishFn(length);
- } else {
- return intlFn(length);
- }
- }
- function supportsFastNumbers(loc) {
- if (loc.numberingSystem && loc.numberingSystem !== "latn") {
- return false;
- } else {
- return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn";
- }
- }
- var PolyNumberFormatter = class {
- constructor(intl, forceSimple, opts) {
- this.padTo = opts.padTo || 0;
- this.floor = opts.floor || false;
- const { padTo, floor, ...otherOpts } = opts;
- if (!forceSimple || Object.keys(otherOpts).length > 0) {
- const intlOpts = { useGrouping: false, ...opts };
- if (opts.padTo > 0)
- intlOpts.minimumIntegerDigits = opts.padTo;
- this.inf = getCachedINF(intl, intlOpts);
- }
- }
- format(i3) {
- if (this.inf) {
- const fixed = this.floor ? Math.floor(i3) : i3;
- return this.inf.format(fixed);
- } else {
- const fixed = this.floor ? Math.floor(i3) : roundTo(i3, 3);
- return padStart(fixed, this.padTo);
- }
- }
- };
- var PolyDateFormatter = class {
- constructor(dt, intl, opts) {
- this.opts = opts;
- let z2;
- if (dt.zone.isUniversal) {
- const gmtOffset = -1 * (dt.offset / 60);
- const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;
- if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {
- z2 = offsetZ;
- this.dt = dt;
- } else {
- z2 = "UTC";
- if (opts.timeZoneName) {
- this.dt = dt;
- } else {
- this.dt = dt.offset === 0 ? dt : DateTime.fromMillis(dt.ts + dt.offset * 60 * 1e3);
- }
- }
- } else if (dt.zone.type === "system") {
- this.dt = dt;
- } else {
- this.dt = dt;
- z2 = dt.zone.name;
- }
- const intlOpts = { ...this.opts };
- if (z2) {
- intlOpts.timeZone = z2;
- }
- this.dtf = getCachedDTF(intl, intlOpts);
- }
- format() {
- return this.dtf.format(this.dt.toJSDate());
- }
- formatToParts() {
- return this.dtf.formatToParts(this.dt.toJSDate());
- }
- resolvedOptions() {
- return this.dtf.resolvedOptions();
- }
- };
- var PolyRelFormatter = class {
- constructor(intl, isEnglish, opts) {
- this.opts = { style: "long", ...opts };
- if (!isEnglish && hasRelative()) {
- this.rtf = getCachedRTF(intl, opts);
- }
- }
- format(count, unit) {
- if (this.rtf) {
- return this.rtf.format(count, unit);
- } else {
- return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long");
- }
- }
- formatToParts(count, unit) {
- if (this.rtf) {
- return this.rtf.formatToParts(count, unit);
- } else {
- return [];
- }
- }
- };
- var Locale = class {
- static fromOpts(opts) {
- return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.defaultToEN);
- }
- static create(locale, numberingSystem, outputCalendar, defaultToEN = false) {
- const specifiedLocale = locale || Settings.defaultLocale;
- const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale());
- const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;
- const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;
- return new Locale(localeR, numberingSystemR, outputCalendarR, specifiedLocale);
- }
- static resetCache() {
- sysLocaleCache = null;
- intlDTCache = {};
- intlNumCache = {};
- intlRelCache = {};
- }
- static fromObject({ locale, numberingSystem, outputCalendar } = {}) {
- return Locale.create(locale, numberingSystem, outputCalendar);
- }
- constructor(locale, numbering, outputCalendar, specifiedLocale) {
- const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);
- this.locale = parsedLocale;
- this.numberingSystem = numbering || parsedNumberingSystem || null;
- this.outputCalendar = outputCalendar || parsedOutputCalendar || null;
- this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);
- this.weekdaysCache = { format: {}, standalone: {} };
- this.monthsCache = { format: {}, standalone: {} };
- this.meridiemCache = null;
- this.eraCache = {};
- this.specifiedLocale = specifiedLocale;
- this.fastNumbersCached = null;
- }
- get fastNumbers() {
- if (this.fastNumbersCached == null) {
- this.fastNumbersCached = supportsFastNumbers(this);
- }
- return this.fastNumbersCached;
- }
- listingMode() {
- const isActuallyEn = this.isEnglish();
- const hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
- return isActuallyEn && hasNoWeirdness ? "en" : "intl";
- }
- clone(alts) {
- if (!alts || Object.getOwnPropertyNames(alts).length === 0) {
- return this;
- } else {
- return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, alts.defaultToEN || false);
- }
- }
- redefaultToEN(alts = {}) {
- return this.clone({ ...alts, defaultToEN: true });
- }
- redefaultToSystem(alts = {}) {
- return this.clone({ ...alts, defaultToEN: false });
- }
- months(length, format = false, defaultOK = true) {
- return listStuff(this, length, defaultOK, months, () => {
- const intl = format ? { month: length, day: "numeric" } : { month: length }, formatStr = format ? "format" : "standalone";
- if (!this.monthsCache[formatStr][length]) {
- this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, "month"));
- }
- return this.monthsCache[formatStr][length];
- });
- }
- weekdays(length, format = false, defaultOK = true) {
- return listStuff(this, length, defaultOK, weekdays, () => {
- const intl = format ? { weekday: length, year: "numeric", month: "long", day: "numeric" } : { weekday: length }, formatStr = format ? "format" : "standalone";
- if (!this.weekdaysCache[formatStr][length]) {
- this.weekdaysCache[formatStr][length] = mapWeekdays((dt) => this.extract(dt, intl, "weekday"));
- }
- return this.weekdaysCache[formatStr][length];
- });
- }
- meridiems(defaultOK = true) {
- return listStuff(this, void 0, defaultOK, () => meridiems, () => {
- if (!this.meridiemCache) {
- const intl = { hour: "numeric", hourCycle: "h12" };
- this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map((dt) => this.extract(dt, intl, "dayperiod"));
- }
- return this.meridiemCache;
- });
- }
- eras(length, defaultOK = true) {
- return listStuff(this, length, defaultOK, eras, () => {
- const intl = { era: length };
- if (!this.eraCache[length]) {
- this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) => this.extract(dt, intl, "era"));
- }
- return this.eraCache[length];
- });
- }
- extract(dt, intlOpts, field) {
- const df = this.dtFormatter(dt, intlOpts), results = df.formatToParts(), matching = results.find((m4) => m4.type.toLowerCase() === field);
- return matching ? matching.value : null;
- }
- numberFormatter(opts = {}) {
- return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);
- }
- dtFormatter(dt, intlOpts = {}) {
- return new PolyDateFormatter(dt, this.intl, intlOpts);
- }
- relFormatter(opts = {}) {
- return new PolyRelFormatter(this.intl, this.isEnglish(), opts);
- }
- listFormatter(opts = {}) {
- return getCachedLF(this.intl, opts);
- }
- isEnglish() {
- return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us");
- }
- equals(other) {
- return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar;
- }
- };
- // node_modules/luxon/src/impl/regexParser.js
- function combineRegexes(...regexes) {
- const full = regexes.reduce((f3, r) => f3 + r.source, "");
- return RegExp(`^${full}$`);
- }
- function combineExtractors(...extractors) {
- return (m4) => extractors.reduce(([mergedVals, mergedZone, cursor], ex) => {
- const [val, zone, next] = ex(m4, cursor);
- return [{ ...mergedVals, ...val }, zone || mergedZone, next];
- }, [{}, null, 1]).slice(0, 2);
- }
- function parse(s3, ...patterns) {
- if (s3 == null) {
- return [null, null];
- }
- for (const [regex, extractor] of patterns) {
- const m4 = regex.exec(s3);
- if (m4) {
- return extractor(m4);
- }
- }
- return [null, null];
- }
- function simpleParse(...keys) {
- return (match2, cursor) => {
- const ret = {};
- let i3;
- for (i3 = 0; i3 < keys.length; i3++) {
- ret[keys[i3]] = parseInteger(match2[cursor + i3]);
- }
- return [ret, null, cursor + i3];
- };
- }
- var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/;
- var isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`;
- var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/;
- var isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);
- var isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);
- var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/;
- var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/;
- var isoOrdinalRegex = /(\d{4})-?(\d{3})/;
- var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay");
- var extractISOOrdinalData = simpleParse("year", "ordinal");
- var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/;
- var sqlTimeRegex = RegExp(`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`);
- var sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);
- function int(match2, pos, fallback) {
- const m4 = match2[pos];
- return isUndefined(m4) ? fallback : parseInteger(m4);
- }
- function extractISOYmd(match2, cursor) {
- const item = {
- year: int(match2, cursor),
- month: int(match2, cursor + 1, 1),
- day: int(match2, cursor + 2, 1)
- };
- return [item, null, cursor + 3];
- }
- function extractISOTime(match2, cursor) {
- const item = {
- hours: int(match2, cursor, 0),
- minutes: int(match2, cursor + 1, 0),
- seconds: int(match2, cursor + 2, 0),
- milliseconds: parseMillis(match2[cursor + 3])
- };
- return [item, null, cursor + 4];
- }
- function extractISOOffset(match2, cursor) {
- const local = !match2[cursor] && !match2[cursor + 1], fullOffset = signedOffset(match2[cursor + 1], match2[cursor + 2]), zone = local ? null : FixedOffsetZone.instance(fullOffset);
- return [{}, zone, cursor + 3];
- }
- function extractIANAZone(match2, cursor) {
- const zone = match2[cursor] ? IANAZone.create(match2[cursor]) : null;
- return [{}, zone, cursor + 1];
- }
- var isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);
- var isoDuration = /^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
- function extractISODuration(match2) {
- const [s3, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match2;
- const hasNegativePrefix = s3[0] === "-";
- const negativeSeconds = secondStr && secondStr[0] === "-";
- const maybeNegate = (num, force = false) => num !== void 0 && (force || num && hasNegativePrefix) ? -num : num;
- return [
- {
- years: maybeNegate(parseFloating(yearStr)),
- months: maybeNegate(parseFloating(monthStr)),
- weeks: maybeNegate(parseFloating(weekStr)),
- days: maybeNegate(parseFloating(dayStr)),
- hours: maybeNegate(parseFloating(hourStr)),
- minutes: maybeNegate(parseFloating(minuteStr)),
- seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"),
- milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds)
- }
- ];
- }
- var obsOffsets = {
- GMT: 0,
- EDT: -4 * 60,
- EST: -5 * 60,
- CDT: -5 * 60,
- CST: -6 * 60,
- MDT: -6 * 60,
- MST: -7 * 60,
- PDT: -7 * 60,
- PST: -8 * 60
- };
- function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
- const result = {
- year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),
- month: monthsShort.indexOf(monthStr) + 1,
- day: parseInteger(dayStr),
- hour: parseInteger(hourStr),
- minute: parseInteger(minuteStr)
- };
- if (secondStr)
- result.second = parseInteger(secondStr);
- if (weekdayStr) {
- result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1;
- }
- return result;
- }
- var rfc2822 = /^(?:(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 extractRFC2822(match2) {
- const [
- ,
- weekdayStr,
- dayStr,
- monthStr,
- yearStr,
- hourStr,
- minuteStr,
- secondStr,
- obsOffset,
- milOffset,
- offHourStr,
- offMinuteStr
- ] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
- let offset2;
- if (obsOffset) {
- offset2 = obsOffsets[obsOffset];
- } else if (milOffset) {
- offset2 = 0;
- } else {
- offset2 = signedOffset(offHourStr, offMinuteStr);
- }
- return [result, new FixedOffsetZone(offset2)];
- }
- function preprocessRFC2822(s3) {
- return s3.replace(/\([^)]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
- }
- var rfc1123 = /^(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$/;
- var rfc850 = /^(Monday|Tuesday|Wedsday|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$/;
- var ascii = /^(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 extractRFC1123Or850(match2) {
- const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
- return [result, FixedOffsetZone.utcInstance];
- }
- function extractASCII(match2) {
- const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
- return [result, FixedOffsetZone.utcInstance];
- }
- var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);
- var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);
- var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);
- var isoTimeCombinedRegex = combineRegexes(isoTimeRegex);
- var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone);
- var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone);
- var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone);
- var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone);
- function parseISODate(s3) {
- return parse(s3, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]);
- }
- function parseRFC2822Date(s3) {
- return parse(preprocessRFC2822(s3), [rfc2822, extractRFC2822]);
- }
- function parseHTTPDate(s3) {
- return parse(s3, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]);
- }
- function parseISODuration(s3) {
- return parse(s3, [isoDuration, extractISODuration]);
- }
- var extractISOTimeOnly = combineExtractors(extractISOTime);
- function parseISOTimeOnly(s3) {
- return parse(s3, [isoTimeOnly, extractISOTimeOnly]);
- }
- var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);
- var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);
- var extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone);
- function parseSQL(s3) {
- return parse(s3, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]);
- }
- // node_modules/luxon/src/duration.js
- var INVALID = "Invalid Duration";
- var lowOrderMatrix = {
- weeks: {
- days: 7,
- hours: 7 * 24,
- minutes: 7 * 24 * 60,
- seconds: 7 * 24 * 60 * 60,
- milliseconds: 7 * 24 * 60 * 60 * 1e3
- },
- days: {
- hours: 24,
- minutes: 24 * 60,
- seconds: 24 * 60 * 60,
- milliseconds: 24 * 60 * 60 * 1e3
- },
- hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1e3 },
- minutes: { seconds: 60, milliseconds: 60 * 1e3 },
- seconds: { milliseconds: 1e3 }
- };
- var casualMatrix = {
- 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: 91 * 24,
- minutes: 91 * 24 * 60,
- seconds: 91 * 24 * 60 * 60,
- milliseconds: 91 * 24 * 60 * 60 * 1e3
- },
- months: {
- weeks: 4,
- days: 30,
- hours: 30 * 24,
- minutes: 30 * 24 * 60,
- seconds: 30 * 24 * 60 * 60,
- milliseconds: 30 * 24 * 60 * 60 * 1e3
- },
- ...lowOrderMatrix
- };
- var daysInYearAccurate = 146097 / 400;
- var daysInMonthAccurate = 146097 / 4800;
- var accurateMatrix = {
- years: {
- quarters: 4,
- months: 12,
- weeks: daysInYearAccurate / 7,
- days: daysInYearAccurate,
- hours: daysInYearAccurate * 24,
- minutes: daysInYearAccurate * 24 * 60,
- seconds: daysInYearAccurate * 24 * 60 * 60,
- milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3
- },
- quarters: {
- months: 3,
- weeks: daysInYearAccurate / 28,
- days: daysInYearAccurate / 4,
- hours: daysInYearAccurate * 24 / 4,
- minutes: daysInYearAccurate * 24 * 60 / 4,
- seconds: daysInYearAccurate * 24 * 60 * 60 / 4,
- milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3 / 4
- },
- months: {
- weeks: daysInMonthAccurate / 7,
- days: daysInMonthAccurate,
- hours: daysInMonthAccurate * 24,
- minutes: daysInMonthAccurate * 24 * 60,
- seconds: daysInMonthAccurate * 24 * 60 * 60,
- milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1e3
- },
- ...lowOrderMatrix
- };
- var orderedUnits = [
- "years",
- "quarters",
- "months",
- "weeks",
- "days",
- "hours",
- "minutes",
- "seconds",
- "milliseconds"
- ];
- var reverseUnits = orderedUnits.slice(0).reverse();
- function clone(dur, alts, clear = false) {
- const conf = {
- values: clear ? alts.values : { ...dur.values, ...alts.values || {} },
- loc: dur.loc.clone(alts.loc),
- conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy
- };
- return new Duration(conf);
- }
- function antiTrunc(n3) {
- return n3 < 0 ? Math.floor(n3) : Math.ceil(n3);
- }
- function convert(matrix, fromMap, fromUnit, toMap, toUnit) {
- const conv = matrix[toUnit][fromUnit], raw = fromMap[fromUnit] / conv, sameSign = Math.sign(raw) === Math.sign(toMap[toUnit]), added = !sameSign && toMap[toUnit] !== 0 && Math.abs(raw) <= 1 ? antiTrunc(raw) : Math.trunc(raw);
- toMap[toUnit] += added;
- fromMap[fromUnit] -= added * conv;
- }
- function normalizeValues(matrix, vals) {
- reverseUnits.reduce((previous, current) => {
- if (!isUndefined(vals[current])) {
- if (previous) {
- convert(matrix, vals, previous, vals, current);
- }
- return current;
- } else {
- return previous;
- }
- }, null);
- }
- var Duration = class {
- constructor(config) {
- const accurate = config.conversionAccuracy === "longterm" || false;
- this.values = config.values;
- this.loc = config.loc || Locale.create();
- this.conversionAccuracy = accurate ? "longterm" : "casual";
- this.invalid = config.invalid || null;
- this.matrix = accurate ? accurateMatrix : casualMatrix;
- this.isLuxonDuration = true;
- }
- static fromMillis(count, opts) {
- return Duration.fromObject({ milliseconds: count }, opts);
- }
- static fromObject(obj, opts = {}) {
- if (obj == null || typeof obj !== "object") {
- throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${obj === null ? "null" : typeof obj}`);
- }
- return new Duration({
- values: normalizeObject(obj, Duration.normalizeUnit),
- loc: Locale.fromObject(opts),
- conversionAccuracy: opts.conversionAccuracy
- });
- }
- static fromDurationLike(durationLike) {
- if (isNumber(durationLike)) {
- return Duration.fromMillis(durationLike);
- } else if (Duration.isDuration(durationLike)) {
- return durationLike;
- } else if (typeof durationLike === "object") {
- return Duration.fromObject(durationLike);
- } else {
- throw new InvalidArgumentError(`Unknown duration argument ${durationLike} of type ${typeof durationLike}`);
- }
- }
- static fromISO(text, opts) {
- const [parsed] = parseISODuration(text);
- if (parsed) {
- return Duration.fromObject(parsed, opts);
- } else {
- return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
- }
- }
- static fromISOTime(text, opts) {
- const [parsed] = parseISOTimeOnly(text);
- if (parsed) {
- return Duration.fromObject(parsed, opts);
- } else {
- return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
- }
- }
- static invalid(reason, explanation = null) {
- if (!reason) {
- throw new InvalidArgumentError("need to specify a reason the Duration is invalid");
- }
- const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
- if (Settings.throwOnInvalid) {
- throw new InvalidDurationError(invalid);
- } else {
- return new Duration({ invalid });
- }
- }
- static normalizeUnit(unit) {
- const normalized = {
- 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"
- }[unit ? unit.toLowerCase() : unit];
- if (!normalized)
- throw new InvalidUnitError(unit);
- return normalized;
- }
- static isDuration(o2) {
- return o2 && o2.isLuxonDuration || false;
- }
- get locale() {
- return this.isValid ? this.loc.locale : null;
- }
- get numberingSystem() {
- return this.isValid ? this.loc.numberingSystem : null;
- }
- toFormat(fmt, opts = {}) {
- const fmtOpts = {
- ...opts,
- floor: opts.round !== false && opts.floor !== false
- };
- return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID;
- }
- toHuman(opts = {}) {
- const l4 = orderedUnits.map((unit) => {
- const val = this.values[unit];
- if (isUndefined(val)) {
- return null;
- }
- return this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...opts, unit: unit.slice(0, -1) }).format(val);
- }).filter((n3) => n3);
- return this.loc.listFormatter({ type: "conjunction", style: opts.listStyle || "narrow", ...opts }).format(l4);
- }
- toObject() {
- if (!this.isValid)
- return {};
- return { ...this.values };
- }
- toISO() {
- if (!this.isValid)
- return null;
- let s3 = "P";
- if (this.years !== 0)
- s3 += this.years + "Y";
- if (this.months !== 0 || this.quarters !== 0)
- s3 += this.months + this.quarters * 3 + "M";
- if (this.weeks !== 0)
- s3 += this.weeks + "W";
- if (this.days !== 0)
- s3 += this.days + "D";
- if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)
- s3 += "T";
- if (this.hours !== 0)
- s3 += this.hours + "H";
- if (this.minutes !== 0)
- s3 += this.minutes + "M";
- if (this.seconds !== 0 || this.milliseconds !== 0)
- s3 += roundTo(this.seconds + this.milliseconds / 1e3, 3) + "S";
- if (s3 === "P")
- s3 += "T0S";
- return s3;
- }
- toISOTime(opts = {}) {
- if (!this.isValid)
- return null;
- const millis = this.toMillis();
- if (millis < 0 || millis >= 864e5)
- return null;
- opts = {
- suppressMilliseconds: false,
- suppressSeconds: false,
- includePrefix: false,
- format: "extended",
- ...opts
- };
- const value = this.shiftTo("hours", "minutes", "seconds", "milliseconds");
- let fmt = opts.format === "basic" ? "hhmm" : "hh:mm";
- if (!opts.suppressSeconds || value.seconds !== 0 || value.milliseconds !== 0) {
- fmt += opts.format === "basic" ? "ss" : ":ss";
- if (!opts.suppressMilliseconds || value.milliseconds !== 0) {
- fmt += ".SSS";
- }
- }
- let str = value.toFormat(fmt);
- if (opts.includePrefix) {
- str = "T" + str;
- }
- return str;
- }
- toJSON() {
- return this.toISO();
- }
- toString() {
- return this.toISO();
- }
- toMillis() {
- return this.as("milliseconds");
- }
- valueOf() {
- return this.toMillis();
- }
- plus(duration) {
- if (!this.isValid)
- return this;
- const dur = Duration.fromDurationLike(duration), result = {};
- for (const k2 of orderedUnits) {
- if (hasOwnProperty(dur.values, k2) || hasOwnProperty(this.values, k2)) {
- result[k2] = dur.get(k2) + this.get(k2);
- }
- }
- return clone(this, { values: result }, true);
- }
- minus(duration) {
- if (!this.isValid)
- return this;
- const dur = Duration.fromDurationLike(duration);
- return this.plus(dur.negate());
- }
- mapUnits(fn) {
- if (!this.isValid)
- return this;
- const result = {};
- for (const k2 of Object.keys(this.values)) {
- result[k2] = asNumber(fn(this.values[k2], k2));
- }
- return clone(this, { values: result }, true);
- }
- get(unit) {
- return this[Duration.normalizeUnit(unit)];
- }
- set(values) {
- if (!this.isValid)
- return this;
- const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };
- return clone(this, { values: mixed });
- }
- reconfigure({ locale, numberingSystem, conversionAccuracy } = {}) {
- const loc = this.loc.clone({ locale, numberingSystem }), opts = { loc };
- if (conversionAccuracy) {
- opts.conversionAccuracy = conversionAccuracy;
- }
- return clone(this, opts);
- }
- as(unit) {
- return this.isValid ? this.shiftTo(unit).get(unit) : NaN;
- }
- normalize() {
- if (!this.isValid)
- return this;
- const vals = this.toObject();
- normalizeValues(this.matrix, vals);
- return clone(this, { values: vals }, true);
- }
- shiftTo(...units) {
- if (!this.isValid)
- return this;
- if (units.length === 0) {
- return this;
- }
- units = units.map((u) => Duration.normalizeUnit(u));
- const built = {}, accumulated = {}, vals = this.toObject();
- let lastUnit;
- for (const k2 of orderedUnits) {
- if (units.indexOf(k2) >= 0) {
- lastUnit = k2;
- let own = 0;
- for (const ak in accumulated) {
- own += this.matrix[ak][k2] * accumulated[ak];
- accumulated[ak] = 0;
- }
- if (isNumber(vals[k2])) {
- own += vals[k2];
- }
- const i3 = Math.trunc(own);
- built[k2] = i3;
- accumulated[k2] = (own * 1e3 - i3 * 1e3) / 1e3;
- for (const down in vals) {
- if (orderedUnits.indexOf(down) > orderedUnits.indexOf(k2)) {
- convert(this.matrix, vals, down, built, k2);
- }
- }
- } else if (isNumber(vals[k2])) {
- accumulated[k2] = vals[k2];
- }
- }
- for (const key in accumulated) {
- if (accumulated[key] !== 0) {
- built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];
- }
- }
- return clone(this, { values: built }, true).normalize();
- }
- negate() {
- if (!this.isValid)
- return this;
- const negated = {};
- for (const k2 of Object.keys(this.values)) {
- negated[k2] = this.values[k2] === 0 ? 0 : -this.values[k2];
- }
- return clone(this, { values: negated }, true);
- }
- 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(other) {
- if (!this.isValid || !other.isValid) {
- return false;
- }
- if (!this.loc.equals(other.loc)) {
- return false;
- }
- function eq(v1, v22) {
- if (v1 === void 0 || v1 === 0)
- return v22 === void 0 || v22 === 0;
- return v1 === v22;
- }
- for (const u of orderedUnits) {
- if (!eq(this.values[u], other.values[u])) {
- return false;
- }
- }
- return true;
- }
- };
- // node_modules/luxon/src/interval.js
- var INVALID2 = "Invalid Interval";
- function validateStartEnd(start, end) {
- if (!start || !start.isValid) {
- return Interval.invalid("missing or invalid start");
- } else if (!end || !end.isValid) {
- return Interval.invalid("missing or invalid end");
- } else if (end < start) {
- return Interval.invalid("end before start", `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`);
- } else {
- return null;
- }
- }
- var Interval = class {
- constructor(config) {
- this.s = config.start;
- this.e = config.end;
- this.invalid = config.invalid || null;
- this.isLuxonInterval = true;
- }
- static invalid(reason, explanation = null) {
- if (!reason) {
- throw new InvalidArgumentError("need to specify a reason the Interval is invalid");
- }
- const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
- if (Settings.throwOnInvalid) {
- throw new InvalidIntervalError(invalid);
- } else {
- return new Interval({ invalid });
- }
- }
- static fromDateTimes(start, end) {
- const builtStart = friendlyDateTime(start), builtEnd = friendlyDateTime(end);
- const validateError = validateStartEnd(builtStart, builtEnd);
- if (validateError == null) {
- return new Interval({
- start: builtStart,
- end: builtEnd
- });
- } else {
- return validateError;
- }
- }
- static after(start, duration) {
- const dur = Duration.fromDurationLike(duration), dt = friendlyDateTime(start);
- return Interval.fromDateTimes(dt, dt.plus(dur));
- }
- static before(end, duration) {
- const dur = Duration.fromDurationLike(duration), dt = friendlyDateTime(end);
- return Interval.fromDateTimes(dt.minus(dur), dt);
- }
- static fromISO(text, opts) {
- const [s3, e] = (text || "").split("/", 2);
- if (s3 && e) {
- let start, startIsValid;
- try {
- start = DateTime.fromISO(s3, opts);
- startIsValid = start.isValid;
- } catch (e2) {
- startIsValid = false;
- }
- let end, endIsValid;
- try {
- end = DateTime.fromISO(e, opts);
- endIsValid = end.isValid;
- } catch (e2) {
- endIsValid = false;
- }
- if (startIsValid && endIsValid) {
- return Interval.fromDateTimes(start, end);
- }
- if (startIsValid) {
- const dur = Duration.fromISO(e, opts);
- if (dur.isValid) {
- return Interval.after(start, dur);
- }
- } else if (endIsValid) {
- const dur = Duration.fromISO(s3, opts);
- if (dur.isValid) {
- return Interval.before(end, dur);
- }
- }
- }
- return Interval.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
- }
- static isInterval(o2) {
- return o2 && o2.isLuxonInterval || false;
- }
- get start() {
- return this.isValid ? this.s : null;
- }
- get end() {
- return this.isValid ? this.e : 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(unit = "milliseconds") {
- return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;
- }
- count(unit = "milliseconds") {
- if (!this.isValid)
- return NaN;
- const start = this.start.startOf(unit), end = this.end.startOf(unit);
- return Math.floor(end.diff(start, unit).get(unit)) + 1;
- }
- hasSame(unit) {
- return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;
- }
- isEmpty() {
- return this.s.valueOf() === this.e.valueOf();
- }
- isAfter(dateTime) {
- if (!this.isValid)
- return false;
- return this.s > dateTime;
- }
- isBefore(dateTime) {
- if (!this.isValid)
- return false;
- return this.e <= dateTime;
- }
- contains(dateTime) {
- if (!this.isValid)
- return false;
- return this.s <= dateTime && this.e > dateTime;
- }
- set({ start, end } = {}) {
- if (!this.isValid)
- return this;
- return Interval.fromDateTimes(start || this.s, end || this.e);
- }
- splitAt(...dateTimes) {
- if (!this.isValid)
- return [];
- const sorted = dateTimes.map(friendlyDateTime).filter((d2) => this.contains(d2)).sort(), results = [];
- let { s: s3 } = this, i3 = 0;
- while (s3 < this.e) {
- const added = sorted[i3] || this.e, next = +added > +this.e ? this.e : added;
- results.push(Interval.fromDateTimes(s3, next));
- s3 = next;
- i3 += 1;
- }
- return results;
- }
- splitBy(duration) {
- const dur = Duration.fromDurationLike(duration);
- if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) {
- return [];
- }
- let { s: s3 } = this, idx = 1, next;
- const results = [];
- while (s3 < this.e) {
- const added = this.start.plus(dur.mapUnits((x2) => x2 * idx));
- next = +added > +this.e ? this.e : added;
- results.push(Interval.fromDateTimes(s3, next));
- s3 = next;
- idx += 1;
- }
- return results;
- }
- divideEqually(numberOfParts) {
- if (!this.isValid)
- return [];
- return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);
- }
- overlaps(other) {
- return this.e > other.s && this.s < other.e;
- }
- abutsStart(other) {
- if (!this.isValid)
- return false;
- return +this.e === +other.s;
- }
- abutsEnd(other) {
- if (!this.isValid)
- return false;
- return +other.e === +this.s;
- }
- engulfs(other) {
- if (!this.isValid)
- return false;
- return this.s <= other.s && this.e >= other.e;
- }
- equals(other) {
- if (!this.isValid || !other.isValid) {
- return false;
- }
- return this.s.equals(other.s) && this.e.equals(other.e);
- }
- intersection(other) {
- if (!this.isValid)
- return this;
- const s3 = this.s > other.s ? this.s : other.s, e = this.e < other.e ? this.e : other.e;
- if (s3 >= e) {
- return null;
- } else {
- return Interval.fromDateTimes(s3, e);
- }
- }
- union(other) {
- if (!this.isValid)
- return this;
- const s3 = this.s < other.s ? this.s : other.s, e = this.e > other.e ? this.e : other.e;
- return Interval.fromDateTimes(s3, e);
- }
- static merge(intervals) {
- const [found, final] = intervals.sort((a, b3) => a.s - b3.s).reduce(([sofar, current], item) => {
- if (!current) {
- return [sofar, item];
- } else if (current.overlaps(item) || current.abutsStart(item)) {
- return [sofar, current.union(item)];
- } else {
- return [sofar.concat([current]), item];
- }
- }, [[], null]);
- if (final) {
- found.push(final);
- }
- return found;
- }
- static xor(intervals) {
- let start = null, currentCount = 0;
- const results = [], ends = intervals.map((i3) => [
- { time: i3.s, type: "s" },
- { time: i3.e, type: "e" }
- ]), flattened = Array.prototype.concat(...ends), arr = flattened.sort((a, b3) => a.time - b3.time);
- for (const i3 of arr) {
- currentCount += i3.type === "s" ? 1 : -1;
- if (currentCount === 1) {
- start = i3.time;
- } else {
- if (start && +start !== +i3.time) {
- results.push(Interval.fromDateTimes(start, i3.time));
- }
- start = null;
- }
- }
- return Interval.merge(results);
- }
- difference(...intervals) {
- return Interval.xor([this].concat(intervals)).map((i3) => this.intersection(i3)).filter((i3) => i3 && !i3.isEmpty());
- }
- toString() {
- if (!this.isValid)
- return INVALID2;
- return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`;
- }
- toISO(opts) {
- if (!this.isValid)
- return INVALID2;
- return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;
- }
- toISODate() {
- if (!this.isValid)
- return INVALID2;
- return `${this.s.toISODate()}/${this.e.toISODate()}`;
- }
- toISOTime(opts) {
- if (!this.isValid)
- return INVALID2;
- return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;
- }
- toFormat(dateFormat, { separator = " \u2013 " } = {}) {
- if (!this.isValid)
- return INVALID2;
- return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;
- }
- toDuration(unit, opts) {
- if (!this.isValid) {
- return Duration.invalid(this.invalidReason);
- }
- return this.e.diff(this.s, unit, opts);
- }
- mapEndpoints(mapFn) {
- return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));
- }
- };
- // node_modules/luxon/src/info.js
- var Info = class {
- static hasDST(zone = Settings.defaultZone) {
- const proto = DateTime.now().setZone(zone).set({ month: 12 });
- return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;
- }
- static isValidIANAZone(zone) {
- return IANAZone.isValidZone(zone);
- }
- static normalizeZone(input) {
- return normalizeZone(input, Settings.defaultZone);
- }
- static months(length = "long", { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) {
- return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);
- }
- static monthsFormat(length = "long", { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) {
- return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);
- }
- static weekdays(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) {
- return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);
- }
- static weekdaysFormat(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) {
- return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);
- }
- static meridiems({ locale = null } = {}) {
- return Locale.create(locale).meridiems();
- }
- static eras(length = "short", { locale = null } = {}) {
- return Locale.create(locale, null, "gregory").eras(length);
- }
- static features() {
- return { relative: hasRelative() };
- }
- };
- // node_modules/luxon/src/impl/diff.js
- function dayDiff(earlier, later) {
- const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf("day").valueOf(), ms = utcDayStart(later) - utcDayStart(earlier);
- return Math.floor(Duration.fromMillis(ms).as("days"));
- }
- function highOrderDiffs(cursor, later, units) {
- const differs = [
- ["years", (a, b3) => b3.year - a.year],
- ["quarters", (a, b3) => b3.quarter - a.quarter],
- ["months", (a, b3) => b3.month - a.month + (b3.year - a.year) * 12],
- [
- "weeks",
- (a, b3) => {
- const days = dayDiff(a, b3);
- return (days - days % 7) / 7;
- }
- ],
- ["days", dayDiff]
- ];
- const results = {};
- let lowestOrder, highWater;
- for (const [unit, differ] of differs) {
- if (units.indexOf(unit) >= 0) {
- lowestOrder = unit;
- let delta = differ(cursor, later);
- highWater = cursor.plus({ [unit]: delta });
- if (highWater > later) {
- cursor = cursor.plus({ [unit]: delta - 1 });
- delta -= 1;
- } else {
- cursor = highWater;
- }
- results[unit] = delta;
- }
- }
- return [cursor, results, highWater, lowestOrder];
- }
- function diff_default(earlier, later, units, opts) {
- let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);
- const remainingMillis = later - cursor;
- const lowerOrderUnits = units.filter((u) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0);
- if (lowerOrderUnits.length === 0) {
- if (highWater < later) {
- highWater = cursor.plus({ [lowestOrder]: 1 });
- }
- if (highWater !== cursor) {
- results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);
- }
- }
- const duration = Duration.fromObject(results, opts);
- if (lowerOrderUnits.length > 0) {
- return Duration.fromMillis(remainingMillis, opts).shiftTo(...lowerOrderUnits).plus(duration);
- } else {
- return duration;
- }
- }
- // node_modules/luxon/src/impl/digits.js
- var numberingSystems = {
- 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"
- };
- var numberingSystemsUTF16 = {
- 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]
- };
- var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split("");
- function parseDigits(str) {
- let value = parseInt(str, 10);
- if (isNaN(value)) {
- value = "";
- for (let i3 = 0; i3 < str.length; i3++) {
- const code = str.charCodeAt(i3);
- if (str[i3].search(numberingSystems.hanidec) !== -1) {
- value += hanidecChars.indexOf(str[i3]);
- } else {
- for (const key in numberingSystemsUTF16) {
- const [min, max] = numberingSystemsUTF16[key];
- if (code >= min && code <= max) {
- value += code - min;
- }
- }
- }
- }
- return parseInt(value, 10);
- } else {
- return value;
- }
- }
- function digitRegex({ numberingSystem }, append = "") {
- return new RegExp(`${numberingSystems[numberingSystem || "latn"]}${append}`);
- }
- // node_modules/luxon/src/impl/tokenParser.js
- var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support";
- function intUnit(regex, post = (i3) => i3) {
- return { regex, deser: ([s3]) => post(parseDigits(s3)) };
- }
- var NBSP = String.fromCharCode(160);
- var spaceOrNBSP = `[ ${NBSP}]`;
- var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
- function fixListRegex(s3) {
- return s3.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
- }
- function stripInsensitivities(s3) {
- return s3.replace(/\./g, "").replace(spaceOrNBSPRegExp, " ").toLowerCase();
- }
- function oneOf(strings, startIndex) {
- if (strings === null) {
- return null;
- } else {
- return {
- regex: RegExp(strings.map(fixListRegex).join("|")),
- deser: ([s3]) => strings.findIndex((i3) => stripInsensitivities(s3) === stripInsensitivities(i3)) + startIndex
- };
- }
- }
- function offset(regex, groups) {
- return { regex, deser: ([, h2, m4]) => signedOffset(h2, m4), groups };
- }
- function simple(regex) {
- return { regex, deser: ([s3]) => s3 };
- }
- function escapeToken(value) {
- return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
- }
- function unitForToken(token, loc) {
- const one = digitRegex(loc), two = digitRegex(loc, "{2}"), three = digitRegex(loc, "{3}"), four = digitRegex(loc, "{4}"), six = digitRegex(loc, "{6}"), oneOrTwo = digitRegex(loc, "{1,2}"), oneToThree = digitRegex(loc, "{1,3}"), oneToSix = digitRegex(loc, "{1,6}"), oneToNine = digitRegex(loc, "{1,9}"), twoToFour = digitRegex(loc, "{2,4}"), fourToSix = digitRegex(loc, "{4,6}"), literal = (t5) => ({ regex: RegExp(escapeToken(t5.val)), deser: ([s3]) => s3, literal: true }), unitate = (t5) => {
- if (token.literal) {
- return literal(t5);
- }
- switch (t5.val) {
- case "G":
- return oneOf(loc.eras("short", false), 0);
- case "GG":
- return oneOf(loc.eras("long", false), 0);
- case "y":
- return intUnit(oneToSix);
- case "yy":
- return intUnit(twoToFour, untruncateYear);
- case "yyyy":
- return intUnit(four);
- case "yyyyy":
- return intUnit(fourToSix);
- case "yyyyyy":
- return intUnit(six);
- case "M":
- return intUnit(oneOrTwo);
- case "MM":
- return intUnit(two);
- case "MMM":
- return oneOf(loc.months("short", true, false), 1);
- case "MMMM":
- return oneOf(loc.months("long", true, false), 1);
- case "L":
- return intUnit(oneOrTwo);
- case "LL":
- return intUnit(two);
- case "LLL":
- return oneOf(loc.months("short", false, false), 1);
- case "LLLL":
- return oneOf(loc.months("long", false, false), 1);
- case "d":
- return intUnit(oneOrTwo);
- case "dd":
- return intUnit(two);
- case "o":
- return intUnit(oneToThree);
- case "ooo":
- return intUnit(three);
- case "HH":
- return intUnit(two);
- case "H":
- return intUnit(oneOrTwo);
- case "hh":
- return intUnit(two);
- case "h":
- return intUnit(oneOrTwo);
- case "mm":
- return intUnit(two);
- case "m":
- return intUnit(oneOrTwo);
- case "q":
- return intUnit(oneOrTwo);
- case "qq":
- return intUnit(two);
- case "s":
- return intUnit(oneOrTwo);
- case "ss":
- return intUnit(two);
- case "S":
- return intUnit(oneToThree);
- case "SSS":
- return intUnit(three);
- case "u":
- return simple(oneToNine);
- case "uu":
- return simple(oneOrTwo);
- case "uuu":
- return intUnit(one);
- case "a":
- return oneOf(loc.meridiems(), 0);
- case "kkkk":
- return intUnit(four);
- case "kk":
- return intUnit(twoToFour, untruncateYear);
- case "W":
- return intUnit(oneOrTwo);
- case "WW":
- return intUnit(two);
- case "E":
- case "c":
- return intUnit(one);
- case "EEE":
- return oneOf(loc.weekdays("short", false, false), 1);
- case "EEEE":
- return oneOf(loc.weekdays("long", false, false), 1);
- case "ccc":
- return oneOf(loc.weekdays("short", true, false), 1);
- case "cccc":
- return oneOf(loc.weekdays("long", true, false), 1);
- case "Z":
- case "ZZ":
- return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);
- case "ZZZ":
- return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);
- case "z":
- return simple(/[a-z_+-/]{1,256}?/i);
- default:
- return literal(t5);
- }
- };
- const unit = unitate(token) || {
- invalidReason: MISSING_FTP
- };
- unit.token = token;
- return unit;
- }
- var partTypeStyleToTokenVal = {
- 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",
- hour: {
- numeric: "h",
- "2-digit": "hh"
- },
- minute: {
- numeric: "m",
- "2-digit": "mm"
- },
- second: {
- numeric: "s",
- "2-digit": "ss"
- }
- };
- function tokenForPart(part, locale, formatOpts) {
- const { type, value } = part;
- if (type === "literal") {
- return {
- literal: true,
- val: value
- };
- }
- const style = formatOpts[type];
- let val = partTypeStyleToTokenVal[type];
- if (typeof val === "object") {
- val = val[style];
- }
- if (val) {
- return {
- literal: false,
- val
- };
- }
- return void 0;
- }
- function buildRegex(units) {
- const re2 = units.map((u) => u.regex).reduce((f3, r) => `${f3}(${r.source})`, "");
- return [`^${re2}$`, units];
- }
- function match(input, regex, handlers) {
- const matches = input.match(regex);
- if (matches) {
- const all = {};
- let matchIndex = 1;
- for (const i3 in handlers) {
- if (hasOwnProperty(handlers, i3)) {
- const h2 = handlers[i3], groups = h2.groups ? h2.groups + 1 : 1;
- if (!h2.literal && h2.token) {
- all[h2.token.val[0]] = h2.deser(matches.slice(matchIndex, matchIndex + groups));
- }
- matchIndex += groups;
- }
- }
- return [matches, all];
- } else {
- return [matches, {}];
- }
- }
- function dateTimeFromMatches(matches) {
- const toField = (token) => {
- switch (token) {
- 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;
- }
- };
- let zone = null;
- let specificOffset;
- if (!isUndefined(matches.z)) {
- zone = IANAZone.create(matches.z);
- }
- if (!isUndefined(matches.Z)) {
- if (!zone) {
- zone = new FixedOffsetZone(matches.Z);
- }
- specificOffset = matches.Z;
- }
- if (!isUndefined(matches.q)) {
- matches.M = (matches.q - 1) * 3 + 1;
- }
- if (!isUndefined(matches.h)) {
- if (matches.h < 12 && matches.a === 1) {
- matches.h += 12;
- } else if (matches.h === 12 && matches.a === 0) {
- matches.h = 0;
- }
- }
- if (matches.G === 0 && matches.y) {
- matches.y = -matches.y;
- }
- if (!isUndefined(matches.u)) {
- matches.S = parseMillis(matches.u);
- }
- const vals = Object.keys(matches).reduce((r, k2) => {
- const f3 = toField(k2);
- if (f3) {
- r[f3] = matches[k2];
- }
- return r;
- }, {});
- return [vals, zone, specificOffset];
- }
- var dummyDateTimeCache = null;
- function getDummyDateTime() {
- if (!dummyDateTimeCache) {
- dummyDateTimeCache = DateTime.fromMillis(1555555555555);
- }
- return dummyDateTimeCache;
- }
- function maybeExpandMacroToken(token, locale) {
- if (token.literal) {
- return token;
- }
- const formatOpts = Formatter.macroTokenToFormatOpts(token.val);
- if (!formatOpts) {
- return token;
- }
- const formatter = Formatter.create(locale, formatOpts);
- const parts = formatter.formatDateTimeParts(getDummyDateTime());
- const tokens = parts.map((p4) => tokenForPart(p4, locale, formatOpts));
- if (tokens.includes(void 0)) {
- return token;
- }
- return tokens;
- }
- function expandMacroTokens(tokens, locale) {
- return Array.prototype.concat(...tokens.map((t5) => maybeExpandMacroToken(t5, locale)));
- }
- function explainFromTokens(locale, input, format) {
- const tokens = expandMacroTokens(Formatter.parseFormat(format), locale), units = tokens.map((t5) => unitForToken(t5, locale)), disqualifyingUnit = units.find((t5) => t5.invalidReason);
- if (disqualifyingUnit) {
- return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };
- } else {
- const [regexString, handlers] = buildRegex(units), regex = RegExp(regexString, "i"), [rawMatches, matches] = match(input, regex, handlers), [result, zone, specificOffset] = matches ? dateTimeFromMatches(matches) : [null, null, void 0];
- if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) {
- throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format");
- }
- return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };
- }
- }
- function parseFromTokens(locale, input, format) {
- const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);
- return [result, zone, specificOffset, invalidReason];
- }
- // node_modules/luxon/src/impl/conversions.js
- var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
- var leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
- function unitOutOfRange(unit, value) {
- return new Invalid("unit out of range", `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`);
- }
- function dayOfWeek(year, month, day) {
- const d2 = new Date(Date.UTC(year, month - 1, day));
- if (year < 100 && year >= 0) {
- d2.setUTCFullYear(d2.getUTCFullYear() - 1900);
- }
- const js = d2.getUTCDay();
- return js === 0 ? 7 : js;
- }
- function computeOrdinal(year, month, day) {
- return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];
- }
- function uncomputeOrdinal(year, ordinal) {
- const table = isLeapYear(year) ? leapLadder : nonLeapLadder, month0 = table.findIndex((i3) => i3 < ordinal), day = ordinal - table[month0];
- return { month: month0 + 1, day };
- }
- function gregorianToWeek(gregObj) {
- const { year, month, day } = gregObj, ordinal = computeOrdinal(year, month, day), weekday = dayOfWeek(year, month, day);
- let weekNumber = Math.floor((ordinal - weekday + 10) / 7), weekYear;
- if (weekNumber < 1) {
- weekYear = year - 1;
- weekNumber = weeksInWeekYear(weekYear);
- } else if (weekNumber > weeksInWeekYear(year)) {
- weekYear = year + 1;
- weekNumber = 1;
- } else {
- weekYear = year;
- }
- return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };
- }
- function weekToGregorian(weekData) {
- const { weekYear, weekNumber, weekday } = weekData, weekdayOfJan4 = dayOfWeek(weekYear, 1, 4), yearInDays = daysInYear(weekYear);
- let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 3, year;
- if (ordinal < 1) {
- year = weekYear - 1;
- ordinal += daysInYear(year);
- } else if (ordinal > yearInDays) {
- year = weekYear + 1;
- ordinal -= daysInYear(weekYear);
- } else {
- year = weekYear;
- }
- const { month, day } = uncomputeOrdinal(year, ordinal);
- return { year, month, day, ...timeObject(weekData) };
- }
- function gregorianToOrdinal(gregData) {
- const { year, month, day } = gregData;
- const ordinal = computeOrdinal(year, month, day);
- return { year, ordinal, ...timeObject(gregData) };
- }
- function ordinalToGregorian(ordinalData) {
- const { year, ordinal } = ordinalData;
- const { month, day } = uncomputeOrdinal(year, ordinal);
- return { year, month, day, ...timeObject(ordinalData) };
- }
- function hasInvalidWeekData(obj) {
- const validYear = isInteger(obj.weekYear), validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear)), validWeekday = integerBetween(obj.weekday, 1, 7);
- if (!validYear) {
- return unitOutOfRange("weekYear", obj.weekYear);
- } else if (!validWeek) {
- return unitOutOfRange("week", obj.week);
- } else if (!validWeekday) {
- return unitOutOfRange("weekday", obj.weekday);
- } else
- return false;
- }
- function hasInvalidOrdinalData(obj) {
- const validYear = isInteger(obj.year), validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));
- if (!validYear) {
- return unitOutOfRange("year", obj.year);
- } else if (!validOrdinal) {
- return unitOutOfRange("ordinal", obj.ordinal);
- } else
- return false;
- }
- function hasInvalidGregorianData(obj) {
- const validYear = isInteger(obj.year), validMonth = integerBetween(obj.month, 1, 12), validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));
- if (!validYear) {
- return unitOutOfRange("year", obj.year);
- } else if (!validMonth) {
- return unitOutOfRange("month", obj.month);
- } else if (!validDay) {
- return unitOutOfRange("day", obj.day);
- } else
- return false;
- }
- function hasInvalidTimeData(obj) {
- const { hour, minute, second, millisecond } = obj;
- const validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, validMinute = integerBetween(minute, 0, 59), validSecond = integerBetween(second, 0, 59), validMillisecond = integerBetween(millisecond, 0, 999);
- if (!validHour) {
- return unitOutOfRange("hour", hour);
- } else if (!validMinute) {
- return unitOutOfRange("minute", minute);
- } else if (!validSecond) {
- return unitOutOfRange("second", second);
- } else if (!validMillisecond) {
- return unitOutOfRange("millisecond", millisecond);
- } else
- return false;
- }
- // node_modules/luxon/src/datetime.js
- var INVALID3 = "Invalid DateTime";
- var MAX_DATE = 864e13;
- function unsupportedZone(zone) {
- return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`);
- }
- function possiblyCachedWeekData(dt) {
- if (dt.weekData === null) {
- dt.weekData = gregorianToWeek(dt.c);
- }
- return dt.weekData;
- }
- function clone2(inst, alts) {
- const current = {
- ts: inst.ts,
- zone: inst.zone,
- c: inst.c,
- o: inst.o,
- loc: inst.loc,
- invalid: inst.invalid
- };
- return new DateTime({ ...current, ...alts, old: current });
- }
- function fixOffset(localTS, o2, tz) {
- let utcGuess = localTS - o2 * 60 * 1e3;
- const o22 = tz.offset(utcGuess);
- if (o2 === o22) {
- return [utcGuess, o2];
- }
- utcGuess -= (o22 - o2) * 60 * 1e3;
- const o3 = tz.offset(utcGuess);
- if (o22 === o3) {
- return [utcGuess, o22];
- }
- return [localTS - Math.min(o22, o3) * 60 * 1e3, Math.max(o22, o3)];
- }
- function tsToObj(ts, offset2) {
- ts += offset2 * 60 * 1e3;
- const d2 = new Date(ts);
- return {
- year: d2.getUTCFullYear(),
- month: d2.getUTCMonth() + 1,
- day: d2.getUTCDate(),
- hour: d2.getUTCHours(),
- minute: d2.getUTCMinutes(),
- second: d2.getUTCSeconds(),
- millisecond: d2.getUTCMilliseconds()
- };
- }
- function objToTS(obj, offset2, zone) {
- return fixOffset(objToLocalTS(obj), offset2, zone);
- }
- function adjustTime(inst, dur) {
- const oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c2 = {
- ...inst.c,
- year,
- month,
- day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
- }, millisToAdd = Duration.fromObject({
- years: dur.years - Math.trunc(dur.years),
- quarters: dur.quarters - Math.trunc(dur.quarters),
- months: dur.months - Math.trunc(dur.months),
- weeks: dur.weeks - Math.trunc(dur.weeks),
- days: dur.days - Math.trunc(dur.days),
- hours: dur.hours,
- minutes: dur.minutes,
- seconds: dur.seconds,
- milliseconds: dur.milliseconds
- }).as("milliseconds"), localTS = objToLocalTS(c2);
- let [ts, o2] = fixOffset(localTS, oPre, inst.zone);
- if (millisToAdd !== 0) {
- ts += millisToAdd;
- o2 = inst.zone.offset(ts);
- }
- return { ts, o: o2 };
- }
- function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {
- const { setZone, zone } = opts;
- if (parsed && Object.keys(parsed).length !== 0) {
- const interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, {
- ...opts,
- zone: interpretationZone,
- specificOffset
- });
- return setZone ? inst : inst.setZone(zone);
- } else {
- return DateTime.invalid(new Invalid("unparsable", `the input "${text}" can't be parsed as ${format}`));
- }
- }
- function toTechFormat(dt, format, allowZ = true) {
- return dt.isValid ? Formatter.create(Locale.create("en-US"), {
- allowZ,
- forceSimple: true
- }).formatDateTimeFromString(dt, format) : null;
- }
- function toISODate(o2, extended) {
- const longFormat = o2.c.year > 9999 || o2.c.year < 0;
- let c2 = "";
- if (longFormat && o2.c.year >= 0)
- c2 += "+";
- c2 += padStart(o2.c.year, longFormat ? 6 : 4);
- if (extended) {
- c2 += "-";
- c2 += padStart(o2.c.month);
- c2 += "-";
- c2 += padStart(o2.c.day);
- } else {
- c2 += padStart(o2.c.month);
- c2 += padStart(o2.c.day);
- }
- return c2;
- }
- function toISOTime(o2, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) {
- let c2 = padStart(o2.c.hour);
- if (extended) {
- c2 += ":";
- c2 += padStart(o2.c.minute);
- if (o2.c.second !== 0 || !suppressSeconds) {
- c2 += ":";
- }
- } else {
- c2 += padStart(o2.c.minute);
- }
- if (o2.c.second !== 0 || !suppressSeconds) {
- c2 += padStart(o2.c.second);
- if (o2.c.millisecond !== 0 || !suppressMilliseconds) {
- c2 += ".";
- c2 += padStart(o2.c.millisecond, 3);
- }
- }
- if (includeOffset) {
- if (o2.isOffsetFixed && o2.offset === 0 && !extendedZone) {
- c2 += "Z";
- } else if (o2.o < 0) {
- c2 += "-";
- c2 += padStart(Math.trunc(-o2.o / 60));
- c2 += ":";
- c2 += padStart(Math.trunc(-o2.o % 60));
- } else {
- c2 += "+";
- c2 += padStart(Math.trunc(o2.o / 60));
- c2 += ":";
- c2 += padStart(Math.trunc(o2.o % 60));
- }
- }
- if (extendedZone) {
- c2 += "[" + o2.zone.ianaName + "]";
- }
- return c2;
- }
- var defaultUnitValues = {
- month: 1,
- day: 1,
- hour: 0,
- minute: 0,
- second: 0,
- millisecond: 0
- };
- var defaultWeekUnitValues = {
- weekNumber: 1,
- weekday: 1,
- hour: 0,
- minute: 0,
- second: 0,
- millisecond: 0
- };
- var defaultOrdinalUnitValues = {
- ordinal: 1,
- hour: 0,
- minute: 0,
- second: 0,
- millisecond: 0
- };
- var orderedUnits2 = ["year", "month", "day", "hour", "minute", "second", "millisecond"];
- var orderedWeekUnits = [
- "weekYear",
- "weekNumber",
- "weekday",
- "hour",
- "minute",
- "second",
- "millisecond"
- ];
- var orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
- function normalizeUnit(unit) {
- const normalized = {
- 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"
- }[unit.toLowerCase()];
- if (!normalized)
- throw new InvalidUnitError(unit);
- return normalized;
- }
- function quickDT(obj, opts) {
- const zone = normalizeZone(opts.zone, Settings.defaultZone), loc = Locale.fromObject(opts), tsNow = Settings.now();
- let ts, o2;
- if (!isUndefined(obj.year)) {
- for (const u of orderedUnits2) {
- if (isUndefined(obj[u])) {
- obj[u] = defaultUnitValues[u];
- }
- }
- const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);
- if (invalid) {
- return DateTime.invalid(invalid);
- }
- const offsetProvis = zone.offset(tsNow);
- [ts, o2] = objToTS(obj, offsetProvis, zone);
- } else {
- ts = tsNow;
- }
- return new DateTime({ ts, zone, loc, o: o2 });
- }
- function diffRelative(start, end, opts) {
- const round = isUndefined(opts.round) ? true : opts.round, format = (c2, unit) => {
- c2 = roundTo(c2, round || opts.calendary ? 0 : 2, true);
- const formatter = end.loc.clone(opts).relFormatter(opts);
- return formatter.format(c2, unit);
- }, differ = (unit) => {
- if (opts.calendary) {
- if (!end.hasSame(start, unit)) {
- return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);
- } else
- return 0;
- } else {
- return end.diff(start, unit).get(unit);
- }
- };
- if (opts.unit) {
- return format(differ(opts.unit), opts.unit);
- }
- for (const unit of opts.units) {
- const count = differ(unit);
- if (Math.abs(count) >= 1) {
- return format(count, unit);
- }
- }
- return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);
- }
- function lastOpts(argList) {
- let opts = {}, args;
- if (argList.length > 0 && typeof argList[argList.length - 1] === "object") {
- opts = argList[argList.length - 1];
- args = Array.from(argList).slice(0, argList.length - 1);
- } else {
- args = Array.from(argList);
- }
- return [opts, args];
- }
- var DateTime = class {
- constructor(config) {
- const zone = config.zone || Settings.defaultZone;
- let invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null);
- this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;
- let c2 = null, o2 = null;
- if (!invalid) {
- const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);
- if (unchanged) {
- [c2, o2] = [config.old.c, config.old.o];
- } else {
- const ot = zone.offset(this.ts);
- c2 = tsToObj(this.ts, ot);
- invalid = Number.isNaN(c2.year) ? new Invalid("invalid input") : null;
- c2 = invalid ? null : c2;
- o2 = invalid ? null : ot;
- }
- }
- this._zone = zone;
- this.loc = config.loc || Locale.create();
- this.invalid = invalid;
- this.weekData = null;
- this.c = c2;
- this.o = o2;
- this.isLuxonDateTime = true;
- }
- static now() {
- return new DateTime({});
- }
- static local() {
- const [opts, args] = lastOpts(arguments), [year, month, day, hour, minute, second, millisecond] = args;
- return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);
- }
- static utc() {
- const [opts, args] = lastOpts(arguments), [year, month, day, hour, minute, second, millisecond] = args;
- opts.zone = FixedOffsetZone.utcInstance;
- return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);
- }
- static fromJSDate(date, options = {}) {
- const ts = isDate(date) ? date.valueOf() : NaN;
- if (Number.isNaN(ts)) {
- return DateTime.invalid("invalid input");
- }
- const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);
- if (!zoneToUse.isValid) {
- return DateTime.invalid(unsupportedZone(zoneToUse));
- }
- return new DateTime({
- ts,
- zone: zoneToUse,
- loc: Locale.fromObject(options)
- });
- }
- static fromMillis(milliseconds, options = {}) {
- if (!isNumber(milliseconds)) {
- throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`);
- } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {
- return DateTime.invalid("Timestamp out of range");
- } else {
- return new DateTime({
- ts: milliseconds,
- zone: normalizeZone(options.zone, Settings.defaultZone),
- loc: Locale.fromObject(options)
- });
- }
- }
- static fromSeconds(seconds, options = {}) {
- if (!isNumber(seconds)) {
- throw new InvalidArgumentError("fromSeconds requires a numerical input");
- } else {
- return new DateTime({
- ts: seconds * 1e3,
- zone: normalizeZone(options.zone, Settings.defaultZone),
- loc: Locale.fromObject(options)
- });
- }
- }
- static fromObject(obj, opts = {}) {
- obj = obj || {};
- const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);
- if (!zoneToUse.isValid) {
- return DateTime.invalid(unsupportedZone(zoneToUse));
- }
- const tsNow = Settings.now(), offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), normalized = normalizeObject(obj, normalizeUnit), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber, loc = Locale.fromObject(opts);
- if ((containsGregor || containsOrdinal) && definiteWeekDef) {
- throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");
- }
- if (containsGregorMD && containsOrdinal) {
- throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");
- }
- const useWeekData = definiteWeekDef || normalized.weekday && !containsGregor;
- let units, defaultValues, objNow = tsToObj(tsNow, offsetProvis);
- if (useWeekData) {
- units = orderedWeekUnits;
- defaultValues = defaultWeekUnitValues;
- objNow = gregorianToWeek(objNow);
- } else if (containsOrdinal) {
- units = orderedOrdinalUnits;
- defaultValues = defaultOrdinalUnitValues;
- objNow = gregorianToOrdinal(objNow);
- } else {
- units = orderedUnits2;
- defaultValues = defaultUnitValues;
- }
- let foundFirst = false;
- for (const u of units) {
- const v4 = normalized[u];
- if (!isUndefined(v4)) {
- foundFirst = true;
- } else if (foundFirst) {
- normalized[u] = defaultValues[u];
- } else {
- normalized[u] = objNow[u];
- }
- }
- const higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), invalid = higherOrderInvalid || hasInvalidTimeData(normalized);
- if (invalid) {
- return DateTime.invalid(invalid);
- }
- const gregorian = useWeekData ? weekToGregorian(normalized) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse), inst = new DateTime({
- ts: tsFinal,
- zone: zoneToUse,
- o: offsetFinal,
- loc
- });
- if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {
- return DateTime.invalid("mismatched weekday", `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`);
- }
- return inst;
- }
- static fromISO(text, opts = {}) {
- const [vals, parsedZone] = parseISODate(text);
- return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text);
- }
- static fromRFC2822(text, opts = {}) {
- const [vals, parsedZone] = parseRFC2822Date(text);
- return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text);
- }
- static fromHTTP(text, opts = {}) {
- const [vals, parsedZone] = parseHTTPDate(text);
- return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts);
- }
- static fromFormat(text, fmt, opts = {}) {
- if (isUndefined(text) || isUndefined(fmt)) {
- throw new InvalidArgumentError("fromFormat requires an input string and a format");
- }
- const { locale = null, numberingSystem = null } = opts, localeToUse = Locale.fromOpts({
- locale,
- numberingSystem,
- defaultToEN: true
- }), [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);
- if (invalid) {
- return DateTime.invalid(invalid);
- } else {
- return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);
- }
- }
- static fromString(text, fmt, opts = {}) {
- return DateTime.fromFormat(text, fmt, opts);
- }
- static fromSQL(text, opts = {}) {
- const [vals, parsedZone] = parseSQL(text);
- return parseDataToDateTime(vals, parsedZone, opts, "SQL", text);
- }
- static invalid(reason, explanation = null) {
- if (!reason) {
- throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");
- }
- const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
- if (Settings.throwOnInvalid) {
- throw new InvalidDateTimeError(invalid);
- } else {
- return new DateTime({ invalid });
- }
- }
- static isDateTime(o2) {
- return o2 && o2.isLuxonDateTime || false;
- }
- get(unit) {
- return this[unit];
- }
- 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 ? possiblyCachedWeekData(this).weekYear : NaN;
- }
- get weekNumber() {
- return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;
- }
- get weekday() {
- return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;
- }
- get ordinal() {
- return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;
- }
- get monthShort() {
- return this.isValid ? Info.months("short", { locObj: this.loc })[this.month - 1] : null;
- }
- get monthLong() {
- return this.isValid ? Info.months("long", { locObj: this.loc })[this.month - 1] : null;
- }
- get weekdayShort() {
- return this.isValid ? Info.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null;
- }
- get weekdayLong() {
- return this.isValid ? Info.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null;
- }
- get offset() {
- return this.isValid ? +this.o : NaN;
- }
- get offsetNameShort() {
- if (this.isValid) {
- return this.zone.offsetName(this.ts, {
- format: "short",
- locale: this.locale
- });
- } else {
- return null;
- }
- }
- get offsetNameLong() {
- if (this.isValid) {
- return this.zone.offsetName(this.ts, {
- format: "long",
- locale: this.locale
- });
- } else {
- return null;
- }
- }
- get isOffsetFixed() {
- return this.isValid ? this.zone.isUniversal : null;
- }
- get isInDST() {
- if (this.isOffsetFixed) {
- return false;
- } else {
- return this.offset > this.set({ month: 1, day: 1 }).offset || this.offset > this.set({ month: 5 }).offset;
- }
- }
- get isInLeapYear() {
- return isLeapYear(this.year);
- }
- get daysInMonth() {
- return daysInMonth(this.year, this.month);
- }
- get daysInYear() {
- return this.isValid ? daysInYear(this.year) : NaN;
- }
- get weeksInWeekYear() {
- return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;
- }
- resolvedLocaleOptions(opts = {}) {
- const { locale, numberingSystem, calendar } = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this);
- return { locale, numberingSystem, outputCalendar: calendar };
- }
- toUTC(offset2 = 0, opts = {}) {
- return this.setZone(FixedOffsetZone.instance(offset2), opts);
- }
- toLocal() {
- return this.setZone(Settings.defaultZone);
- }
- setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {
- zone = normalizeZone(zone, Settings.defaultZone);
- if (zone.equals(this.zone)) {
- return this;
- } else if (!zone.isValid) {
- return DateTime.invalid(unsupportedZone(zone));
- } else {
- let newTS = this.ts;
- if (keepLocalTime || keepCalendarTime) {
- const offsetGuess = zone.offset(this.ts);
- const asObj = this.toObject();
- [newTS] = objToTS(asObj, offsetGuess, zone);
- }
- return clone2(this, { ts: newTS, zone });
- }
- }
- reconfigure({ locale, numberingSystem, outputCalendar } = {}) {
- const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });
- return clone2(this, { loc });
- }
- setLocale(locale) {
- return this.reconfigure({ locale });
- }
- set(values) {
- if (!this.isValid)
- return this;
- const normalized = normalizeObject(values, normalizeUnit), settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber;
- if ((containsGregor || containsOrdinal) && definiteWeekDef) {
- throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");
- }
- if (containsGregorMD && containsOrdinal) {
- throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");
- }
- let mixed;
- if (settingWeekStuff) {
- mixed = weekToGregorian({ ...gregorianToWeek(this.c), ...normalized });
- } else if (!isUndefined(normalized.ordinal)) {
- mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });
- } else {
- mixed = { ...this.toObject(), ...normalized };
- if (isUndefined(normalized.day)) {
- mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);
- }
- }
- const [ts, o2] = objToTS(mixed, this.o, this.zone);
- return clone2(this, { ts, o: o2 });
- }
- plus(duration) {
- if (!this.isValid)
- return this;
- const dur = Duration.fromDurationLike(duration);
- return clone2(this, adjustTime(this, dur));
- }
- minus(duration) {
- if (!this.isValid)
- return this;
- const dur = Duration.fromDurationLike(duration).negate();
- return clone2(this, adjustTime(this, dur));
- }
- startOf(unit) {
- if (!this.isValid)
- return this;
- const o2 = {}, normalizedUnit = Duration.normalizeUnit(unit);
- switch (normalizedUnit) {
- case "years":
- o2.month = 1;
- case "quarters":
- case "months":
- o2.day = 1;
- case "weeks":
- case "days":
- o2.hour = 0;
- case "hours":
- o2.minute = 0;
- case "minutes":
- o2.second = 0;
- case "seconds":
- o2.millisecond = 0;
- break;
- case "milliseconds":
- break;
- }
- if (normalizedUnit === "weeks") {
- o2.weekday = 1;
- }
- if (normalizedUnit === "quarters") {
- const q2 = Math.ceil(this.month / 3);
- o2.month = (q2 - 1) * 3 + 1;
- }
- return this.set(o2);
- }
- endOf(unit) {
- return this.isValid ? this.plus({ [unit]: 1 }).startOf(unit).minus(1) : this;
- }
- toFormat(fmt, opts = {}) {
- return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID3;
- }
- toLocaleString(formatOpts = DATE_SHORT, opts = {}) {
- return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID3;
- }
- toLocaleParts(opts = {}) {
- return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : [];
- }
- toISO({
- format = "extended",
- suppressSeconds = false,
- suppressMilliseconds = false,
- includeOffset = true,
- extendedZone = false
- } = {}) {
- if (!this.isValid) {
- return null;
- }
- const ext = format === "extended";
- let c2 = toISODate(this, ext);
- c2 += "T";
- c2 += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);
- return c2;
- }
- toISODate({ format = "extended" } = {}) {
- if (!this.isValid) {
- return null;
- }
- return toISODate(this, format === "extended");
- }
- toISOWeekDate() {
- return toTechFormat(this, "kkkk-'W'WW-c");
- }
- toISOTime({
- suppressMilliseconds = false,
- suppressSeconds = false,
- includeOffset = true,
- includePrefix = false,
- extendedZone = false,
- format = "extended"
- } = {}) {
- if (!this.isValid) {
- return null;
- }
- let c2 = includePrefix ? "T" : "";
- return c2 + toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);
- }
- toRFC2822() {
- return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false);
- }
- toHTTP() {
- return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'");
- }
- toSQLDate() {
- if (!this.isValid) {
- return null;
- }
- return toISODate(this, true);
- }
- toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {
- let fmt = "HH:mm:ss.SSS";
- if (includeZone || includeOffset) {
- if (includeOffsetSpace) {
- fmt += " ";
- }
- if (includeZone) {
- fmt += "z";
- } else if (includeOffset) {
- fmt += "ZZ";
- }
- }
- return toTechFormat(this, fmt, true);
- }
- toSQL(opts = {}) {
- if (!this.isValid) {
- return null;
- }
- return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;
- }
- toString() {
- return this.isValid ? this.toISO() : INVALID3;
- }
- 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(opts = {}) {
- if (!this.isValid)
- return {};
- const base = { ...this.c };
- if (opts.includeConfig) {
- base.outputCalendar = this.outputCalendar;
- base.numberingSystem = this.loc.numberingSystem;
- base.locale = this.loc.locale;
- }
- return base;
- }
- toJSDate() {
- return new Date(this.isValid ? this.ts : NaN);
- }
- diff(otherDateTime, unit = "milliseconds", opts = {}) {
- if (!this.isValid || !otherDateTime.isValid) {
- return Duration.invalid("created by diffing an invalid DateTime");
- }
- const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };
- const units = maybeArray(unit).map(Duration.normalizeUnit), otherIsLater = otherDateTime.valueOf() > this.valueOf(), earlier = otherIsLater ? this : otherDateTime, later = otherIsLater ? otherDateTime : this, diffed = diff_default(earlier, later, units, durOpts);
- return otherIsLater ? diffed.negate() : diffed;
- }
- diffNow(unit = "milliseconds", opts = {}) {
- return this.diff(DateTime.now(), unit, opts);
- }
- until(otherDateTime) {
- return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;
- }
- hasSame(otherDateTime, unit) {
- if (!this.isValid)
- return false;
- const inputMs = otherDateTime.valueOf();
- const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });
- return adjustedToZone.startOf(unit) <= inputMs && inputMs <= adjustedToZone.endOf(unit);
- }
- equals(other) {
- return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc);
- }
- toRelative(options = {}) {
- if (!this.isValid)
- return null;
- const base = options.base || DateTime.fromObject({}, { zone: this.zone }), padding = options.padding ? this < base ? -options.padding : options.padding : 0;
- let units = ["years", "months", "days", "hours", "minutes", "seconds"];
- let unit = options.unit;
- if (Array.isArray(options.unit)) {
- units = options.unit;
- unit = void 0;
- }
- return diffRelative(base, this.plus(padding), {
- ...options,
- numeric: "always",
- units,
- unit
- });
- }
- toRelativeCalendar(options = {}) {
- if (!this.isValid)
- return null;
- return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {
- ...options,
- numeric: "auto",
- units: ["years", "months", "days"],
- calendary: true
- });
- }
- static min(...dateTimes) {
- if (!dateTimes.every(DateTime.isDateTime)) {
- throw new InvalidArgumentError("min requires all arguments be DateTimes");
- }
- return bestBy(dateTimes, (i3) => i3.valueOf(), Math.min);
- }
- static max(...dateTimes) {
- if (!dateTimes.every(DateTime.isDateTime)) {
- throw new InvalidArgumentError("max requires all arguments be DateTimes");
- }
- return bestBy(dateTimes, (i3) => i3.valueOf(), Math.max);
- }
- static fromFormatExplain(text, fmt, options = {}) {
- const { locale = null, numberingSystem = null } = options, localeToUse = Locale.fromOpts({
- locale,
- numberingSystem,
- defaultToEN: true
- });
- return explainFromTokens(localeToUse, text, fmt);
- }
- static fromStringExplain(text, fmt, options = {}) {
- return DateTime.fromFormatExplain(text, fmt, options);
- }
- static get DATE_SHORT() {
- return DATE_SHORT;
- }
- static get DATE_MED() {
- return DATE_MED;
- }
- static get DATE_MED_WITH_WEEKDAY() {
- return DATE_MED_WITH_WEEKDAY;
- }
- static get DATE_FULL() {
- return DATE_FULL;
- }
- static get DATE_HUGE() {
- return DATE_HUGE;
- }
- static get TIME_SIMPLE() {
- return TIME_SIMPLE;
- }
- static get TIME_WITH_SECONDS() {
- return TIME_WITH_SECONDS;
- }
- static get TIME_WITH_SHORT_OFFSET() {
- return TIME_WITH_SHORT_OFFSET;
- }
- static get TIME_WITH_LONG_OFFSET() {
- return TIME_WITH_LONG_OFFSET;
- }
- static get TIME_24_SIMPLE() {
- return TIME_24_SIMPLE;
- }
- static get TIME_24_WITH_SECONDS() {
- return TIME_24_WITH_SECONDS;
- }
- static get TIME_24_WITH_SHORT_OFFSET() {
- return TIME_24_WITH_SHORT_OFFSET;
- }
- static get TIME_24_WITH_LONG_OFFSET() {
- return TIME_24_WITH_LONG_OFFSET;
- }
- static get DATETIME_SHORT() {
- return DATETIME_SHORT;
- }
- static get DATETIME_SHORT_WITH_SECONDS() {
- return DATETIME_SHORT_WITH_SECONDS;
- }
- static get DATETIME_MED() {
- return DATETIME_MED;
- }
- static get DATETIME_MED_WITH_SECONDS() {
- return DATETIME_MED_WITH_SECONDS;
- }
- static get DATETIME_MED_WITH_WEEKDAY() {
- return DATETIME_MED_WITH_WEEKDAY;
- }
- static get DATETIME_FULL() {
- return DATETIME_FULL;
- }
- static get DATETIME_FULL_WITH_SECONDS() {
- return DATETIME_FULL_WITH_SECONDS;
- }
- static get DATETIME_HUGE() {
- return DATETIME_HUGE;
- }
- static get DATETIME_HUGE_WITH_SECONDS() {
- return DATETIME_HUGE_WITH_SECONDS;
- }
- };
- function friendlyDateTime(dateTimeish) {
- if (DateTime.isDateTime(dateTimeish)) {
- return dateTimeish;
- } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {
- return DateTime.fromJSDate(dateTimeish);
- } else if (dateTimeish && typeof dateTimeish === "object") {
- return DateTime.fromObject(dateTimeish);
- } else {
- throw new InvalidArgumentError(`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`);
- }
- }
- // node_modules/@arcgis/core/chunks/languageUtils.js
- var S2 = class {
- constructor(e) {
- this.value = e;
- }
- };
- var x = class {
- constructor(e) {
- this.value = e;
- }
- };
- var b2 = class {
- constructor(e) {
- this.fn = e;
- }
- };
- var T = class {
- constructor(e, t5) {
- this.paramCount = t5, this.fn = e;
- }
- };
- var N = b2;
- var k = x;
- var D2 = S2;
- var M2 = T;
- var j2 = { type: "VOID" };
- var A = { type: "BREAK" };
- var R = { type: "CONTINUE" };
- function F2(e, t5, n3) {
- return t5 === "" || t5 == null || t5 === n3 || t5 === n3 ? e : e = e.split(t5).join(n3);
- }
- function v3(t5) {
- return t5 instanceof b2 || t5 instanceof t3 || t5 instanceof T;
- }
- function C(e) {
- return !!w(e) || (!!O(e) || (!!z(e) || (!!_(e) || (e === null || (e === j2 || typeof e == "number")))));
- }
- function I(e, t5) {
- return e === void 0 ? t5 : e;
- }
- function w(e) {
- return typeof e == "string" || e instanceof String;
- }
- function _(e) {
- return typeof e == "boolean";
- }
- function O(e) {
- return typeof e == "number";
- }
- function Z(e) {
- return typeof e == "number" && isFinite(e) && Math.floor(e) === e;
- }
- function L(e) {
- return e instanceof Array;
- }
- function Y(e) {
- return e?.arcadeDeclaredClass === "esri.arcade.Feature";
- }
- function J(e) {
- return (e && e.declaredRootClass && e.declaredRootClass === "esri.arcade.featureset.support.FeatureSet") === true;
- }
- function P2(e) {
- return (e && e.declaredRootClass && e.declaredRootClass === "esri.arcade.featureSetCollection") === true;
- }
- function E(e) {
- return e instanceof t2;
- }
- function z(e) {
- return e instanceof Date;
- }
- function G(e, t5, n3) {
- if (e.length < t5 || e.length > n3)
- throw new Error("Function called with wrong number of Parameters");
- }
- function V(e) {
- return e < 0 ? -Math.round(-e) : Math.round(e);
- }
- function H() {
- let e = Date.now();
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t5) {
- const n3 = (e + 16 * Math.random()) % 16 | 0;
- return e = Math.floor(e / 16), (t5 === "x" ? n3 : 3 & n3 | 8).toString(16);
- });
- }
- function U(e, t5) {
- return isNaN(e) === false ? t5 == null || t5 === "" ? e.toString() : (t5 = F2(t5, "\u2030", ""), t5 = F2(t5, "\xA4", ""), s(e, { pattern: t5 })) : e.toString();
- }
- function q(e, t5) {
- const n3 = DateTime.fromJSDate(e);
- return t5 == null || t5 === "" ? n3.toISO({ suppressMilliseconds: true }) : n3.toFormat($(t5), { locale: l(), numberingSystem: "latn" });
- }
- function $(e) {
- e = e.replace(/LTS|LT|LL?L?L?|l{1,4}/g, "[$&]");
- let t5 = "";
- const n3 = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
- for (const r of e.match(n3))
- switch (r) {
- case "D":
- t5 += "d";
- break;
- case "DD":
- t5 += "dd";
- break;
- case "DDD":
- t5 += "o";
- break;
- case "d":
- t5 += "c";
- break;
- case "ddd":
- t5 += "ccc";
- break;
- case "dddd":
- t5 += "cccc";
- break;
- case "M":
- t5 += "L";
- break;
- case "MM":
- t5 += "LL";
- break;
- case "MMM":
- t5 += "LLL";
- break;
- case "MMMM":
- t5 += "LLLL";
- break;
- case "YY":
- t5 += "yy";
- break;
- case "Y":
- case "YYYY":
- t5 += "yyyy";
- break;
- case "Q":
- t5 += "q";
- break;
- case "Z":
- t5 += "ZZ";
- break;
- case "ZZ":
- t5 += "ZZZ";
- break;
- case "S":
- t5 += "'S'";
- break;
- case "SS":
- t5 += "'SS'";
- break;
- case "SSS":
- t5 += "u";
- break;
- case "A":
- case "a":
- t5 += "a";
- break;
- case "m":
- case "mm":
- case "h":
- case "hh":
- case "H":
- case "HH":
- case "s":
- case "ss":
- case "X":
- case "x":
- t5 += r;
- break;
- default:
- r.length >= 2 && r.slice(0, 1) === "[" && r.slice(-1) === "]" ? t5 += `'${r.slice(1, -1)}'` : t5 += `'${r}'`;
- }
- return t5;
- }
- function B(e, t5, n3) {
- switch (n3) {
- case ">":
- return e > t5;
- case "<":
- return e < t5;
- case ">=":
- return e >= t5;
- case "<=":
- return e <= t5;
- }
- return false;
- }
- function W(e, t5, n3) {
- if (e === null) {
- if (t5 === null || t5 === j2)
- return B(null, null, n3);
- if (O(t5))
- return B(0, t5, n3);
- if (w(t5))
- return B(0, ne(t5), n3);
- if (_(t5))
- return B(0, ne(t5), n3);
- if (z(t5))
- return B(0, t5.getTime(), n3);
- }
- if (e === j2) {
- if (t5 === null || t5 === j2)
- return B(null, null, n3);
- if (O(t5))
- return B(0, t5, n3);
- if (w(t5))
- return B(0, ne(t5), n3);
- if (_(t5))
- return B(0, ne(t5), n3);
- if (z(t5))
- return B(0, t5.getTime(), n3);
- } else if (O(e)) {
- if (O(t5))
- return B(e, t5, n3);
- if (_(t5))
- return B(e, ne(t5), n3);
- if (t5 === null || t5 === j2)
- return B(e, 0, n3);
- if (w(t5))
- return B(e, ne(t5), n3);
- if (z(t5))
- return B(e, t5.getTime(), n3);
- } else if (w(e)) {
- if (w(t5))
- return B(X(e), X(t5), n3);
- if (z(t5))
- return B(ne(e), t5.getTime(), n3);
- if (O(t5))
- return B(ne(e), t5, n3);
- if (t5 === null || t5 === j2)
- return B(ne(e), 0, n3);
- if (_(t5))
- return B(ne(e), ne(t5), n3);
- } else if (z(e)) {
- if (z(t5))
- return B(e, t5, n3);
- if (t5 === null || t5 === j2)
- return B(e.getTime(), 0, n3);
- if (O(t5))
- return B(e.getTime(), t5, n3);
- if (_(t5))
- return B(e.getTime(), ne(t5), n3);
- if (w(t5))
- return B(e.getTime(), ne(t5), n3);
- } else if (_(e)) {
- if (_(t5))
- return B(e, t5, n3);
- if (O(t5))
- return B(ne(e), ne(t5), n3);
- if (z(t5))
- return B(ne(e), t5.getTime(), n3);
- if (t5 === null || t5 === j2)
- return B(ne(e), 0, n3);
- if (w(t5))
- return B(ne(e), ne(t5), n3);
- }
- return !!Q(e, t5) && (n3 === "<=" || n3 === ">=");
- }
- function Q(e, t5) {
- if (e === t5)
- return true;
- if (e === null && t5 === j2 || t5 === null && e === j2)
- return true;
- if (z(e) && z(t5))
- return e.getTime() === t5.getTime();
- if (e instanceof h)
- return e.equalityTest(t5);
- if (e instanceof i)
- return e.equalityTest(t5);
- if (e instanceof j && t5 instanceof j) {
- const n3 = e.cache._arcadeCacheId, r = t5.cache._arcadeCacheId;
- if (n3 != null)
- return n3 === r;
- }
- if (e !== void 0 && t5 !== void 0 && e !== null && t5 !== null && typeof e == "object" && typeof t5 == "object") {
- if (e._arcadeCacheId === t5._arcadeCacheId && e._arcadeCacheId !== void 0 && e._arcadeCacheId !== null)
- return true;
- if (e._underlyingGraphic === t5._underlyingGraphic && e._underlyingGraphic !== void 0 && e._underlyingGraphic !== null)
- return true;
- }
- return false;
- }
- function X(e, n3) {
- if (w(e))
- return e;
- if (e === null)
- return "";
- if (O(e))
- return U(e, n3);
- if (_(e))
- return e.toString();
- if (z(e))
- return q(e, n3);
- if (e instanceof p)
- return JSON.stringify(e.toJSON());
- if (L(e)) {
- const t5 = [];
- for (let n4 = 0; n4 < e.length; n4++)
- t5[n4] = te(e[n4]);
- return "[" + t5.join(",") + "]";
- }
- if (e instanceof t2) {
- const t5 = [];
- for (let n4 = 0; n4 < e.length(); n4++)
- t5[n4] = te(e.get(n4));
- return "[" + t5.join(",") + "]";
- }
- return e !== null && typeof e == "object" && e.castToText !== void 0 ? e.castToText() : v3(e) ? "object, Function" : "";
- }
- function K(e) {
- const n3 = [];
- if (L(e) === false)
- return null;
- if (e instanceof t2) {
- for (let t5 = 0; t5 < e.length(); t5++)
- n3[t5] = ne(e.get(t5));
- return n3;
- }
- for (let t5 = 0; t5 < e.length; t5++)
- n3[t5] = ne(e[t5]);
- return n3;
- }
- function ee(e, n3) {
- if (w(e))
- return e;
- if (e === null)
- return "";
- if (O(e))
- return U(e, n3);
- if (_(e))
- return e.toString();
- if (z(e))
- return q(e, n3);
- if (e instanceof p)
- return e instanceof M ? '{"xmin":' + e.xmin.toString() + ',"ymin":' + e.ymin.toString() + "," + (e.hasZ ? '"zmin":' + e.zmin.toString() + "," : "") + (e.hasM ? '"mmin":' + e.mmin.toString() + "," : "") + '"xmax":' + e.xmax.toString() + ',"ymax":' + e.ymax.toString() + "," + (e.hasZ ? '"zmax":' + e.zmax.toString() + "," : "") + (e.hasM ? '"mmax":' + e.mmax.toString() + "," : "") + '"spatialReference":' + de(e.spatialReference) + "}" : de(e.toJSON(), (e2, t5) => e2.key === t5.key ? 0 : e2.key === "spatialReference" ? 1 : t5.key === "spatialReference" || e2.key < t5.key ? -1 : e2.key > t5.key ? 1 : 0);
- if (L(e)) {
- const t5 = [];
- for (let n4 = 0; n4 < e.length; n4++)
- t5[n4] = te(e[n4]);
- return "[" + t5.join(",") + "]";
- }
- if (e instanceof t2) {
- const t5 = [];
- for (let n4 = 0; n4 < e.length(); n4++)
- t5[n4] = te(e.get(n4));
- return "[" + t5.join(",") + "]";
- }
- return e !== null && typeof e == "object" && e.castToText !== void 0 ? e.castToText() : v3(e) ? "object, Function" : "";
- }
- function te(e) {
- if (e === null)
- return "null";
- if (_(e) || O(e) || w(e))
- return JSON.stringify(e);
- if (e instanceof p)
- return ee(e);
- if (e instanceof t2)
- return ee(e);
- if (e instanceof Array)
- return ee(e);
- if (e instanceof Date)
- return JSON.stringify(q(e, ""));
- if (e !== null && typeof e == "object") {
- if (e.castToText !== void 0)
- return e.castToText();
- } else if (e === j2)
- return "null";
- return "null";
- }
- function ne(e, t5) {
- return O(e) ? e : e === null || e === "" ? 0 : z(e) ? NaN : _(e) ? e ? 1 : 0 : L(e) || e === "" || e === void 0 ? NaN : t5 !== void 0 && w(e) ? (t5 = F2(t5, "\u2030", ""), t5 = F2(t5, "\xA4", ""), p2(e, { pattern: t5 })) : e === j2 ? 0 : Number(e);
- }
- function re(e) {
- if (z(e))
- return e;
- if (w(e)) {
- const t5 = ae(e);
- if (t5)
- return t5.toJSDate();
- }
- return null;
- }
- function ie(e) {
- return z(e) ? DateTime.fromJSDate(e) : w(e) ? ae(e) : null;
- }
- function ae(e) {
- const t5 = / (\d\d)/;
- let n3 = DateTime.fromISO(e);
- return n3.isValid || t5.test(e) && (e = e.replace(t5, "T$1"), n3 = DateTime.fromISO(e), n3.isValid) ? n3 : null;
- }
- function oe(e) {
- return _(e) ? e : w(e) ? (e = e.toLowerCase()) === "true" : !!O(e) && (e !== 0 && !isNaN(e));
- }
- function se(e, t5) {
- return t(e) ? null : (e.spatialReference !== null && e.spatialReference !== void 0 || (e.spatialReference = t5), e);
- }
- function ue(e) {
- if (e === null)
- return null;
- if (e instanceof j)
- return e.x === "NaN" || e.x === null || isNaN(e.x) ? null : e;
- if (e instanceof v) {
- if (e.rings.length === 0)
- return null;
- for (const t5 of e.rings)
- if (t5.length > 0)
- return e;
- return null;
- }
- if (e instanceof m2) {
- if (e.paths.length === 0)
- return null;
- for (const t5 of e.paths)
- if (t5.length > 0)
- return e;
- return null;
- }
- return e instanceof m ? e.points.length === 0 ? null : e : e instanceof M ? e.xmin === "NaN" || e.xmin === null || isNaN(e.xmin) ? null : e : null;
- }
- function le(e, t5) {
- if (!e)
- return t5;
- if (!e.domain)
- return t5;
- let n3 = null;
- if (e.field.type === "string" || e.field.type === "esriFieldTypeString")
- t5 = X(t5);
- else {
- if (t5 == null)
- return null;
- if (t5 === "")
- return t5;
- t5 = ne(t5);
- }
- for (let r = 0; r < e.domain.codedValues.length; r++) {
- const i3 = e.domain.codedValues[r];
- i3.code === t5 && (n3 = i3);
- }
- return n3 === null ? t5 : n3.name;
- }
- function fe(e, t5) {
- if (!e)
- return t5;
- if (!e.domain)
- return t5;
- let n3 = null;
- t5 = X(t5);
- for (let r = 0; r < e.domain.codedValues.length; r++) {
- const i3 = e.domain.codedValues[r];
- i3.name === t5 && (n3 = i3);
- }
- return n3 === null ? t5 : n3.code;
- }
- function ce(e, t5, n3 = null, r = null) {
- if (!t5)
- return null;
- if (!t5.fields)
- return null;
- let i3, a, o2 = null;
- for (let s3 = 0; s3 < t5.fields.length; s3++) {
- const n4 = t5.fields[s3];
- n4.name.toLowerCase() === e.toString().toLowerCase() && (o2 = n4);
- }
- if (o2 === null)
- throw new Error("Field not found");
- return r === null && n3 && t5.typeIdField && (r = n3.hasField(t5.typeIdField) ? n3.field(t5.typeIdField) : null), r != null && t5.types.some(function(e2) {
- return e2.id === r && (i3 = e2.domains && e2.domains[o2.name], i3 && i3.type === "inherited" && (i3 = me(o2.name, t5), a = true), true);
- }), a || i3 || (i3 = me(e, t5)), { field: o2, domain: i3 };
- }
- function me(e, t5) {
- let n3;
- return t5.fields.some(function(t6) {
- return t6.name.toLowerCase() === e.toLowerCase() && (n3 = t6.domain), !!n3;
- }), n3;
- }
- function de(e, t5) {
- t5 || (t5 = {}), typeof t5 == "function" && (t5 = { cmp: t5 });
- const n3 = typeof t5.cycles == "boolean" && t5.cycles, r = t5.cmp && (i3 = t5.cmp, function(e2) {
- return function(t6, n4) {
- const r2 = { key: t6, value: e2[t6] }, a2 = { key: n4, value: e2[n4] };
- return i3(r2, a2);
- };
- });
- var i3;
- const a = [];
- return function e2(t6) {
- if (t6 && t6.toJSON && typeof t6.toJSON == "function" && (t6 = t6.toJSON()), t6 === void 0)
- return;
- if (typeof t6 == "number")
- return isFinite(t6) ? "" + t6 : "null";
- if (typeof t6 != "object")
- return JSON.stringify(t6);
- let i4, o2;
- if (Array.isArray(t6)) {
- for (o2 = "[", i4 = 0; i4 < t6.length; i4++)
- i4 && (o2 += ","), o2 += e2(t6[i4]) || "null";
- return o2 + "]";
- }
- if (t6 === null)
- return "null";
- if (a.includes(t6)) {
- if (n3)
- return JSON.stringify("__cycle__");
- throw new TypeError("Converting circular structure to JSON");
- }
- const s3 = a.push(t6) - 1, u = Object.keys(t6).sort(r && r(t6));
- for (o2 = "", i4 = 0; i4 < u.length; i4++) {
- const n4 = u[i4], r2 = e2(t6[n4]);
- r2 && (o2 && (o2 += ","), o2 += JSON.stringify(n4) + ":" + r2);
- }
- return a.splice(s3, 1), "{" + o2 + "}";
- }(e);
- }
- function ye(e) {
- if (e === null)
- return null;
- const t5 = [];
- for (const n3 of e)
- n3 && n3.arcadeDeclaredClass && n3.arcadeDeclaredClass === "esri.arcade.Feature" ? t5.push(n3.geometry()) : t5.push(n3);
- return t5;
- }
- function pe(e, t5) {
- if (!(t5 instanceof j))
- throw new Error("Invalid Argument");
- e.push(t5.hasZ ? t5.hasM ? [t5.x, t5.y, t5.z, t5.m] : [t5.x, t5.y, t5.z] : [t5.x, t5.y]);
- }
- function ge(e, t5) {
- if (L(e) || E(e)) {
- let n3 = false, i3 = false, a = [], o2 = t5;
- if (L(e)) {
- for (const t6 of e)
- pe(a, t6);
- a.length > 0 && (o2 = e[0].spatialReference, n3 = e[0].hasZ, i3 = e[0].hasM);
- } else if (e instanceof i)
- a = e._elements, a.length > 0 && (n3 = e._hasZ, i3 = e._hasM, o2 = e.get(0).spatialReference);
- else {
- if (!E(e))
- throw new Error("Invalid Argument");
- for (const t6 of e.toArray())
- pe(a, t6);
- a.length > 0 && (o2 = e.get(0).spatialReference, n3 = e.get(0).hasZ === true, i3 = e.get(0).hasM === true);
- }
- if (a.length === 0)
- return null;
- return f(a, i3, n3) === false && (a = a.slice(0).reverse()), new v({ rings: [a], spatialReference: o2, hasZ: n3, hasM: i3 });
- }
- return e;
- }
- function he(e, t5) {
- if (L(e) || E(e)) {
- let n3 = false, i3 = false, a = [], o2 = t5;
- if (L(e)) {
- for (const t6 of e)
- pe(a, t6);
- a.length > 0 && (o2 = e[0].spatialReference, n3 = e[0].hasZ === true, i3 = e[0].hasM === true);
- } else if (e instanceof i)
- a = e._elements, a.length > 0 && (n3 = e._hasZ, i3 = e._hasM, o2 = e.get(0).spatialReference);
- else if (E(e)) {
- for (const t6 of e.toArray())
- pe(a, t6);
- a.length > 0 && (o2 = e.get(0).spatialReference, n3 = e.get(0).hasZ === true, i3 = e.get(0).hasM === true);
- }
- return a.length === 0 ? null : new m2({ paths: [a], spatialReference: o2, hasZ: n3, hasM: i3 });
- }
- return e;
- }
- function Se(e, t5) {
- if (L(e) || E(e)) {
- let n3 = false, i3 = false, a = [], s3 = t5;
- if (L(e)) {
- for (const t6 of e)
- pe(a, t6);
- a.length > 0 && (s3 = e[0].spatialReference, n3 = e[0].hasZ === true, i3 = e[0].hasM === true);
- } else if (e instanceof i)
- a = e._elements, a.length > 0 && (n3 = e._hasZ, i3 = e._hasM, s3 = e.get(0).spatialReference);
- else if (E(e)) {
- for (const t6 of e.toArray())
- pe(a, t6);
- a.length > 0 && (s3 = e.get(0).spatialReference, n3 = e.get(0).hasZ === true, i3 = e.get(0).hasM === true);
- }
- return a.length === 0 ? null : new m({ points: a, spatialReference: s3, hasZ: n3, hasM: i3 });
- }
- return e;
- }
- function xe(e, n3 = false) {
- const r = [];
- if (e === null)
- return r;
- if (L(e) === true) {
- for (let t5 = 0; t5 < e.length; t5++) {
- const i3 = X(e[t5]);
- i3 === "" && n3 !== true || r.push(i3);
- }
- return r;
- }
- if (e instanceof t2) {
- for (let t5 = 0; t5 < e.length(); t5++) {
- const i3 = X(e.get(t5));
- i3 === "" && n3 !== true || r.push(i3);
- }
- return r;
- }
- if (C(e)) {
- const t5 = X(e);
- return t5 === "" && n3 !== true || r.push(t5), r;
- }
- return [];
- }
- var be = 0;
- function Te(e) {
- return be++, be % 100 == 0 ? (be = 0, new Promise((t5) => {
- setTimeout(() => {
- t5(e);
- }, 0);
- })) : e;
- }
- function Ne(e, t5, n3) {
- switch (n3) {
- case "&":
- return e & t5;
- case "|":
- return e | t5;
- case "^":
- return e ^ t5;
- case "<<":
- return e << t5;
- case ">>":
- return e >> t5;
- case ">>>":
- return e >>> t5;
- }
- }
- function ke(e, n3 = null) {
- return e == null ? null : _(e) || O(e) || w(e) ? e : e instanceof p ? n3?.keepGeometryType === true ? e : e.toJSON() : e instanceof t2 ? e.toArray().map((e2) => ke(e2, n3)) : e instanceof Array ? e.map((e2) => ke(e2, n3)) : e instanceof Date ? e : e !== null && typeof e == "object" && e.castAsJson !== void 0 ? e.castAsJson(n3) : null;
- }
- async function De(e, t5, n3, r, i3) {
- const a = await Me(e, t5, n3);
- i3[r] = a;
- }
- async function Me(e, n3 = null, r = null) {
- if (e instanceof t2 && (e = e.toArray()), e == null)
- return null;
- if (C(e) || e instanceof p || e instanceof Date)
- return ke(e, r);
- if (e instanceof Array) {
- const t5 = [], i3 = [];
- for (const o2 of e)
- o2 === null || C(o2) || o2 instanceof p || o2 instanceof Date ? i3.push(ke(o2, r)) : (i3.push(null), t5.push(De(o2, n3, r, i3.length - 1, i3)));
- return t5.length > 0 && await Promise.all(t5), i3;
- }
- return e !== null && typeof e == "object" && e.castAsJsonAsync !== void 0 ? e.castAsJsonAsync(n3, r) : null;
- }
- function je(e, t5, n3) {
- const r = e.fullSchema();
- if (r === null)
- return null;
- if (!r.fields)
- return null;
- return ce(t5, r, e, n3);
- }
- function Ae(e) {
- const t5 = e.fullSchema();
- return t5 === null ? null : t5.fields && t5.typeIdField ? { subtypeField: t5.typeIdField, subtypes: t5.types ? t5.types.map((e2) => ({ name: e2.name, code: e2.id })) : [] } : null;
- }
- function Re(e, t5, n3, r) {
- const i3 = e.fullSchema();
- if (i3 === null)
- return null;
- if (!i3.fields)
- return null;
- const a = ce(t5, i3, e, r);
- if (n3 === void 0)
- try {
- n3 = e.field(t5);
- } catch (o2) {
- return null;
- }
- return le(a, n3);
- }
- function Fe(e, t5, n3, r) {
- const i3 = e.fullSchema();
- if (i3 === null)
- return null;
- if (!i3.fields)
- return null;
- if (n3 === void 0) {
- try {
- n3 = e.field(t5);
- } catch (a) {
- return null;
- }
- return n3;
- }
- return fe(ce(t5, i3, e, r), n3);
- }
- function ve(e) {
- const t5 = e.fullSchema();
- if (t5 === null)
- return null;
- if (!t5.fields)
- return null;
- const n3 = [];
- for (const r of t5.fields)
- n3.push(o(r));
- return { objectIdField: t5.objectIdField, globalIdField: t5.globalIdField, geometryType: v2[t5.geometryType] === void 0 ? "" : v2[t5.geometryType], fields: n3 };
- }
- var Ce = Object.freeze(Object.defineProperty({ __proto__: null, ReturnResultE: S2, ImplicitResultE: x, NativeFunctionE: b2, SizzleFunctionE: T, NativeFunction: N, ImplicitResult: k, ReturnResult: D2, SizzleFunction: M2, voidOperation: j2, breakResult: A, continueResult: R, multiReplace: F2, isFunctionParameter: v3, isSimpleType: C, defaultUndefined: I, isString: w, isBoolean: _, isNumber: O, isInteger: Z, isArray: L, isFeature: Y, isFeatureSet: J, isFeatureSetCollection: P2, isImmutableArray: E, isDate: z, pcCheck: G, absRound: V, generateUUID: H, formatNumber: U, formatDate: q, standardiseDateFormat: $, greaterThanLessThan: W, equalityTest: Q, toString: X, toNumberArray: K, toStringExplicit: ee, toNumber: ne, toDate: re, toDateTime: ie, toBoolean: oe, fixSpatialReference: se, fixNullGeometry: ue, getDomainValue: le, getDomainCode: fe, getDomain: ce, stableStringify: de, autoCastFeatureToGeometry: ye, autoCastArrayOfPointsToPolygon: ge, autoCastArrayOfPointsToPolyline: he, autoCastArrayOfPointsToMultiPoint: Se, toStringArray: xe, tick: Te, binaryOperator: Ne, castAsJson: ke, castAsJsonAsync: Me, featureFullDomain: je, featureSubtypes: Ae, featureDomainValueLookup: Re, featureDomainCodeLookup: Fe, featureSchema: ve }, Symbol.toStringTag, { value: "Module" }));
- export {
- t2 as t,
- t3 as t2,
- i,
- h,
- DateTime,
- t4 as t3,
- i2,
- n,
- o,
- l2 as l,
- y2 as y,
- c,
- m3 as m,
- d,
- f2 as f,
- F,
- S,
- v2 as v,
- P,
- b,
- D,
- N,
- k,
- D2,
- M2 as M,
- j2 as j,
- A,
- R,
- F2,
- v3 as v2,
- C,
- I,
- w,
- _,
- O,
- Z,
- L,
- Y,
- J,
- P2,
- E,
- z,
- G,
- V,
- H,
- $,
- W,
- Q,
- X,
- K,
- ee,
- ne,
- re,
- ie,
- oe,
- se,
- ue,
- le,
- fe,
- ce,
- ye,
- ge,
- he,
- Se,
- xe,
- Te,
- Ne,
- ke,
- Me,
- je,
- Ae,
- Re,
- Fe,
- ve,
- Ce
- };
- //# sourceMappingURL=chunk-25BNEBXZ.js.map
|