chunk-FT2BCPUP.js 157 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188
  1. import {
  2. p as p2,
  3. s
  4. } from "./chunk-5JZ72JAQ.js";
  5. import {
  6. y
  7. } from "./chunk-JGBXYDGB.js";
  8. import {
  9. l
  10. } from "./chunk-5UVJ64RB.js";
  11. import {
  12. h,
  13. m2 as m,
  14. u,
  15. v2 as v
  16. } from "./chunk-VCH45Q2I.js";
  17. import {
  18. p,
  19. w,
  20. w2
  21. } from "./chunk-6T6G6LCQ.js";
  22. import {
  23. C
  24. } from "./chunk-V6P2MAQQ.js";
  25. import {
  26. t
  27. } from "./chunk-YXWMMD76.js";
  28. // node_modules/@arcgis/core/arcade/executionError.js
  29. var e;
  30. !function(e3) {
  31. e3.AsyncNotEnabled = "AsyncNotEnabled", e3.ModulesNotSupported = "ModulesNotSupported", e3.CircularModules = "CircularModules", e3.NeverReach = "NeverReach", e3.UnsupportedHashType = "UnsupportedHashType", e3.InvalidParameter = "InvalidParameter", e3.UnexpectedToken = "UnexpectedToken", e3.Unrecognised = "Unrecognised", e3.UnrecognisedType = "UnrecognisedType", e3.MaximumCallDepth = "MaximumCallDepth", e3.BooleanConditionRequired = "BooleanConditionRequired", e3.TypeNotAllowedInFeature = "TypeNotAllowedInFeature", e3.KeyMustBeString = "KeyMustBeString", e3.WrongNumberOfParameters = "WrongNumberOfParameters", e3.CallNonFunction = "CallNonFunction", e3.NoFunctionInTemplateLiteral = "NoFunctionInTemplateLiteral", e3.NoFunctionInDictionary = "NoFunctionInDictionary", e3.NoFunctionInArray = "NoFunctionInArray", e3.AssignModuleFunction = "AssignModuleFunction", e3.LogicExpressionOrAnd = "LogicExpressionOrAnd", e3.LogicalExpressionOnlyBoolean = "LogicalExpressionOnlyBoolean", e3.FuncionNotFound = "FunctionNotFound", e3.InvalidMemberAccessKey = "InvalidMemberAccessKey", e3.UnsupportedUnaryOperator = "UnsupportUnaryOperator", e3.InvalidIdentifier = "InvalidIdentifier", e3.MemberOfNull = "MemberOfNull", e3.UnsupportedOperator = "UnsupportedOperator", e3.Cancelled = "Cancelled", e3.ModuleAccessorMustBeString = "ModuleAccessorMustBeString", e3.ModuleExportNotFound = "ModuleExportNotFound", e3.Immutable = "Immutable", e3.OutOfBounds = "OutOfBounds", e3.IllegalResult = "IllegalResult", e3.FieldNotFound = "FieldNotFound", e3.PortalRequired = "PortalRequired", e3.LogicError = "LogicError", e3.ArrayAccessorMustBeNumber = "ArrayAccessMustBeNumber", e3.KeyAccessorMustBeString = "KeyAccessorMustBeString", e3.WrongSpatialReference = "WrongSpatialReference";
  32. }(e || (e = {}));
  33. var r = { [e.TypeNotAllowedInFeature]: "Feature attributes only support dates, numbers, strings, guids.", [e.LogicError]: "Logic error - {reason}", [e.NeverReach]: "Encountered unreachable logic", [e.AsyncNotEnabled]: "Async Arcade must be enabled for this script", [e.ModuleAccessorMustBeString]: "Module accessor must be a string", [e.ModuleExportNotFound]: "Module has no export with provided identifier", [e.ModulesNotSupported]: "Current profile does not support modules", [e.ArrayAccessorMustBeNumber]: "Array accessor must be a number", [e.FuncionNotFound]: "Function not found", [e.FieldNotFound]: "Key not found - {key}", [e.CircularModules]: "Circular module dependencies are not allowed", [e.Cancelled]: "Execution cancelled", [e.UnsupportedHashType]: "Type not supported in hash function", [e.IllegalResult]: "Value is not a supported return type", [e.PortalRequired]: "Portal is required", [e.InvalidParameter]: "Invalid parameter", [e.WrongNumberOfParameters]: "Call with wrong number of parameters", [e.Unrecognised]: "Unrecognised code structure", [e.UnrecognisedType]: "Unrecognised type", [e.WrongSpatialReference]: "Cannot work with geometry in this spatial reference. It is different to the execution spatial reference", [e.BooleanConditionRequired]: "Conditions must use booleans", [e.NoFunctionInDictionary]: "Dictionaries cannot contain functions.", [e.NoFunctionInArray]: "Arrays cannot contain functions.", [e.NoFunctionInTemplateLiteral]: "Template Literals do not expect functions by value.", [e.KeyAccessorMustBeString]: "Accessor must be a string", [e.KeyMustBeString]: "Object keys must be a string", [e.Immutable]: "Object is immutable", [e.InvalidParameter]: "Invalid parameter", [e.UnexpectedToken]: "Unexpected token", [e.MemberOfNull]: "Cannot access property of null object", [e.MaximumCallDepth]: "Exceeded maximum function depth", [e.OutOfBounds]: "Out of bounds", [e.InvalidIdentifier]: "Identifier not recognised", [e.FuncionNotFound]: "Function not found", [e.CallNonFunction]: "Expression is not a function", [e.InvalidMemberAccessKey]: "Cannot access value using a key of this type", [e.AssignModuleFunction]: "Cannot assign function to module variable", [e.UnsupportedUnaryOperator]: "Unsupported unary operator", [e.UnsupportedOperator]: "Unsupported operator", [e.LogicalExpressionOnlyBoolean]: "Logical expressions must be boolean", [e.LogicExpressionOrAnd]: "Logical expression can only be combined with || or &&" };
  34. var o = class extends Error {
  35. constructor(...e3) {
  36. super(...e3);
  37. }
  38. };
  39. var n = class extends o {
  40. constructor(e3, r3) {
  41. super(a(r3) + e3.message, { cause: e3 }), this.loc = null, Error.captureStackTrace && Error.captureStackTrace(this, n), r3 && r3.loc && (this.loc = r3.loc);
  42. }
  43. };
  44. var t2 = class extends Error {
  45. constructor(e3, o3, n5, s6) {
  46. super("Execution error - " + a(n5) + i(r[o3], s6)), this.loc = null, this.declaredRootClass = "esri.arcade.arcadeexecutionerror", Error.captureStackTrace && Error.captureStackTrace(this, t2), n5 && n5.loc && (this.loc = n5.loc);
  47. }
  48. };
  49. function a(e3) {
  50. var _a, _b;
  51. return e3 && e3.loc ? `Line : ${(_a = e3.loc.start) == null ? void 0 : _a.line}, ${(_b = e3.loc.start) == null ? void 0 : _b.column}: ` : "";
  52. }
  53. var s2 = class extends Error {
  54. constructor(e3, o3, n5, t5) {
  55. super("Compilation error - " + a(n5) + i(r[o3], t5)), this.loc = null, this.declaredRootClass = "esri.arcade.arcadecompilationerror", Error.captureStackTrace && Error.captureStackTrace(this, s2), n5 && n5.loc && (this.loc = n5.loc);
  56. }
  57. };
  58. var c = class extends Error {
  59. constructor() {
  60. super("Uncompilable code structures"), this.declaredRootClass = "esri.arcade.arcadeuncompilableerror", Error.captureStackTrace && Error.captureStackTrace(this, c);
  61. }
  62. };
  63. function i(e3, r3) {
  64. try {
  65. if (!r3)
  66. return e3;
  67. for (const o3 in r3) {
  68. let n5 = r3[o3];
  69. n5 || (n5 = ""), e3 = e3.replace("{" + o3 + "}", r3[o3]);
  70. }
  71. } catch (o3) {
  72. }
  73. return e3;
  74. }
  75. function u2(e3, r3, o3) {
  76. return "esri.arcade.arcadeexecutionerror" === o3.declaredRootClass || "esri.arcade.arcadecompilationerror" === o3.declaredRootClass ? null === o3.loc && r3 && r3.loc ? new n(o3, { cause: o3 }) : o3 : ("esri.arcade.featureset.support.featureseterror" === o3.declaredRootClass || o3.declaredRootClass, r3 && r3.loc ? new n(o3, { cause: o3 }) : o3);
  77. }
  78. var l2;
  79. !function(e3) {
  80. e3.UnrecognisedUri = "UnrecognisedUri", e3.UnsupportedUriProtocol = "UnsupportedUriProtocol";
  81. }(l2 || (l2 = {}));
  82. var d = { [l2.UnrecognisedUri]: "Unrecognised uri - {uri}", [l2.UnsupportedUriProtocol]: "Unrecognised uri protocol" };
  83. var p3 = class extends Error {
  84. constructor(e3, r3) {
  85. super(i(d[e3], r3)), this.declaredRootClass = "esri.arcade.arcademoduleerror", Error.captureStackTrace && Error.captureStackTrace(this, p3);
  86. }
  87. };
  88. // node_modules/@arcgis/core/arcade/ImmutableArray.js
  89. var t3 = class {
  90. constructor(t5 = []) {
  91. this._elements = t5;
  92. }
  93. length() {
  94. return this._elements.length;
  95. }
  96. get(t5) {
  97. return this._elements[t5];
  98. }
  99. toArray() {
  100. const t5 = [];
  101. for (let e3 = 0; e3 < this.length(); e3++)
  102. t5.push(this.get(e3));
  103. return t5;
  104. }
  105. };
  106. // node_modules/@arcgis/core/arcade/FunctionWrapper.js
  107. var r2 = class {
  108. constructor() {
  109. }
  110. };
  111. function n2(t5, n5, e3) {
  112. if (t5 instanceof r2 && !(t5 instanceof s3)) {
  113. const r3 = new s3();
  114. return r3.fn = t5, r3.parameterEvaluator = e3, r3.context = n5, r3;
  115. }
  116. return t5;
  117. }
  118. var e2 = class extends r2 {
  119. constructor(t5) {
  120. super(), this.fn = t5;
  121. }
  122. createFunction(t5) {
  123. return (...r3) => this.fn(t5, { preparsed: true, arguments: r3 });
  124. }
  125. call(t5, r3) {
  126. return this.fn(t5, r3);
  127. }
  128. marshalledCall(e3, a2, l5, c3) {
  129. return c3(e3, a2, (a3, o3, i4) => {
  130. i4 = i4.map((t5) => t5 instanceof r2 && !(t5 instanceof s3) ? n2(t5, e3, c3) : t5);
  131. const u3 = this.call(l5, { args: i4 });
  132. return C(u3) ? u3.then((t5) => n2(t5, l5, c3)) : u3;
  133. });
  134. }
  135. };
  136. var s3 = class extends r2 {
  137. constructor() {
  138. super(...arguments), this.fn = null, this.context = null;
  139. }
  140. createFunction(t5) {
  141. return this.fn.createFunction(this.context);
  142. }
  143. call(t5, r3) {
  144. return this.fn.marshalledCall(t5, r3, this.context, this.parameterEvaluator);
  145. }
  146. marshalledCall(t5, r3, n5) {
  147. return this.fn.marshalledCall(t5, r3, this.context, this.parameterEvaluator);
  148. }
  149. };
  150. // node_modules/@arcgis/core/arcade/featureset/support/shared.js
  151. var t4;
  152. var i2;
  153. function n3(e3) {
  154. return y.fromJSON(e3.toJSON());
  155. }
  156. function o2(e3) {
  157. return e3.toJSON ? e3.toJSON() : e3;
  158. }
  159. function l3(e3) {
  160. return "string" == typeof e3 || e3 instanceof String;
  161. }
  162. function y2(e3) {
  163. return "number" == typeof e3;
  164. }
  165. function p4(e3) {
  166. return e3 instanceof Date;
  167. }
  168. function c2(e3, r3) {
  169. return e3 === r3 || !(!p4(e3) || !p4(r3)) && e3.getTime() === r3.getTime();
  170. }
  171. function m2(e3) {
  172. if (null == e3)
  173. return null;
  174. if ("number" == typeof e3)
  175. return e3;
  176. switch (e3.toLowerCase()) {
  177. case "meters":
  178. case "meter":
  179. return 109404;
  180. case "miles":
  181. case "mile":
  182. return 109439;
  183. case "kilometers":
  184. case "kilometer":
  185. case "km":
  186. return 109414;
  187. }
  188. return null;
  189. }
  190. function f(r3) {
  191. if (null == r3)
  192. return null;
  193. switch (r3.type) {
  194. case "polygon":
  195. case "multipoint":
  196. case "polyline":
  197. return r3.extent;
  198. case "point":
  199. return new w2({ xmin: r3.x, ymin: r3.y, xmax: r3.x, ymax: r3.y, spatialReference: r3.spatialReference });
  200. case "extent":
  201. return r3;
  202. }
  203. return null;
  204. }
  205. function d2(e3) {
  206. if (null == e3)
  207. return null;
  208. if ("number" == typeof e3)
  209. return e3;
  210. if ("number" == typeof e3)
  211. return e3;
  212. switch (e3.toLowerCase()) {
  213. case "meters":
  214. case "meter":
  215. return 9001;
  216. case "miles":
  217. case "mile":
  218. return 9093;
  219. case "kilometers":
  220. case "kilometer":
  221. case "km":
  222. return 9036;
  223. }
  224. return null;
  225. }
  226. !function(e3) {
  227. e3[e3.Standardised = 0] = "Standardised", e3[e3.StandardisedNoInterval = 1] = "StandardisedNoInterval", e3[e3.SqlServer = 2] = "SqlServer", e3[e3.Oracle = 3] = "Oracle", e3[e3.Postgres = 4] = "Postgres", e3[e3.PGDB = 5] = "PGDB", e3[e3.FILEGDB = 6] = "FILEGDB", e3[e3.NotEvaluated = 7] = "NotEvaluated";
  228. }(t4 || (t4 = {})), function(e3) {
  229. e3[e3.InFeatureSet = 0] = "InFeatureSet", e3[e3.NotInFeatureSet = 1] = "NotInFeatureSet", e3[e3.Unknown = 2] = "Unknown";
  230. }(i2 || (i2 = {}));
  231. var F = 1e3;
  232. var S = { point: "point", polygon: "polygon", polyline: "polyline", multipoint: "multipoint", extent: "extent", esriGeometryPoint: "point", esriGeometryPolygon: "polygon", esriGeometryPolyline: "polyline", esriGeometryMultipoint: "multipoint", esriGeometryEnvelope: "extent", envelope: "extent" };
  233. var v2 = { point: "esriGeometryPoint", polygon: "esriGeometryPolygon", polyline: "esriGeometryPolyline", multipoint: "esriGeometryMultipoint", extent: "esriGeometryEnvelope", esriGeometryPoint: "esriGeometryPoint", esriGeometryPolygon: "esriGeometryPolygon", esriGeometryPolyline: "esriGeometryPolyline", esriGeometryMultipoint: "esriGeometryMultipoint", esriGeometryEnvelope: "esriGeometryEnvelope", envelope: "esriGeometryEnvelope" };
  234. 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" };
  235. function b(e3) {
  236. return void 0 === e3 ? "" : e3 = (e3 = (e3 = e3.replace(/\/featureserver\/[0-9]*/i, "/FeatureServer")).replace(/\/mapserver\/[0-9]*/i, "/MapServer")).split("?")[0];
  237. }
  238. function D(e3, r3) {
  239. r3 || (r3 = {}), "function" == typeof r3 && (r3 = { cmp: r3 });
  240. const t5 = "boolean" == typeof r3.cycles && r3.cycles, i4 = r3.cmp && (n5 = r3.cmp, function(e4) {
  241. return function(r4, t6) {
  242. const i5 = { key: r4, value: e4[r4] }, o4 = { key: t6, value: e4[t6] };
  243. return n5(i5, o4);
  244. };
  245. });
  246. var n5;
  247. const o3 = [];
  248. return function e4(r4) {
  249. if (r4 && r4.toJSON && "function" == typeof r4.toJSON && (r4 = r4.toJSON()), void 0 === r4)
  250. return;
  251. if ("number" == typeof r4)
  252. return isFinite(r4) ? "" + r4 : "null";
  253. if ("object" != typeof r4)
  254. return JSON.stringify(r4);
  255. let n6, l5;
  256. if (Array.isArray(r4)) {
  257. for (l5 = "[", n6 = 0; n6 < r4.length; n6++)
  258. n6 && (l5 += ","), l5 += e4(r4[n6]) || "null";
  259. return l5 + "]";
  260. }
  261. if (null === r4)
  262. return "null";
  263. if (o3.includes(r4)) {
  264. if (t5)
  265. return JSON.stringify("__cycle__");
  266. throw new TypeError("Converting circular structure to JSON");
  267. }
  268. const s6 = o3.push(r4) - 1, y3 = Object.keys(r4).sort(i4 && i4(r4));
  269. for (l5 = "", n6 = 0; n6 < y3.length; n6++) {
  270. const t6 = y3[n6], i5 = e4(r4[t6]);
  271. i5 && (l5 && (l5 += ","), l5 += JSON.stringify(t6) + ":" + i5);
  272. }
  273. return o3.splice(s6, 1), "{" + l5 + "}";
  274. }(e3);
  275. }
  276. // node_modules/@arcgis/core/arcade/ArcadeModule.js
  277. var s4 = class {
  278. constructor(s6) {
  279. this.source = s6;
  280. }
  281. };
  282. // node_modules/@arcgis/core/arcade/ImmutablePointArray.js
  283. var i3 = class extends t3 {
  284. constructor(t5, s6, i4, e3, h3, a2) {
  285. super(t5), this._lazyPt = [], this._hasZ = false, this._hasM = false, this._spRef = s6, this._hasZ = i4, this._hasM = e3, this._cacheId = h3, this._partId = a2;
  286. }
  287. get(t5) {
  288. if (void 0 === this._lazyPt[t5]) {
  289. const i4 = this._elements[t5];
  290. if (void 0 === i4)
  291. return;
  292. const e3 = this._hasZ, h3 = this._hasM;
  293. let a2 = null;
  294. a2 = e3 && !h3 ? new w(i4[0], i4[1], i4[2], void 0, this._spRef) : h3 && !e3 ? new w(i4[0], i4[1], void 0, i4[2], this._spRef) : e3 && h3 ? new w(i4[0], i4[1], i4[2], i4[3], this._spRef) : new w(i4[0], i4[1], this._spRef), a2.cache._arcadeCacheId = this._cacheId.toString() + "-" + this._partId.toString() + "-" + t5.toString(), this._lazyPt[t5] = a2;
  295. }
  296. return this._lazyPt[t5];
  297. }
  298. equalityTest(t5) {
  299. return t5 === this || null !== t5 && (t5 instanceof i3 != false && t5.getUniqueHash() === this.getUniqueHash());
  300. }
  301. getUniqueHash() {
  302. return this._cacheId.toString() + "-" + this._partId.toString();
  303. }
  304. };
  305. // node_modules/@arcgis/core/arcade/ImmutablePathArray.js
  306. var h2 = class extends t3 {
  307. constructor(t5, s6, h3, i4, e3) {
  308. super(t5), this._lazyPath = [], this._hasZ = false, this._hasM = false, this._hasZ = h3, this._hasM = i4, this._spRef = s6, this._cacheId = e3;
  309. }
  310. get(t5) {
  311. if (void 0 === this._lazyPath[t5]) {
  312. const h3 = this._elements[t5];
  313. if (void 0 === h3)
  314. return;
  315. this._lazyPath[t5] = new i3(h3, this._spRef, this._hasZ, this._hasM, this._cacheId, t5);
  316. }
  317. return this._lazyPath[t5];
  318. }
  319. equalityTest(t5) {
  320. return t5 === this || null !== t5 && (t5 instanceof h2 != false && t5.getUniqueHash() === this.getUniqueHash());
  321. }
  322. getUniqueHash() {
  323. return this._cacheId.toString();
  324. }
  325. };
  326. // node_modules/luxon/src/errors.js
  327. var LuxonError = class extends Error {
  328. };
  329. var InvalidDateTimeError = class extends LuxonError {
  330. constructor(reason) {
  331. super(`Invalid DateTime: ${reason.toMessage()}`);
  332. }
  333. };
  334. var InvalidIntervalError = class extends LuxonError {
  335. constructor(reason) {
  336. super(`Invalid Interval: ${reason.toMessage()}`);
  337. }
  338. };
  339. var InvalidDurationError = class extends LuxonError {
  340. constructor(reason) {
  341. super(`Invalid Duration: ${reason.toMessage()}`);
  342. }
  343. };
  344. var ConflictingSpecificationError = class extends LuxonError {
  345. };
  346. var InvalidUnitError = class extends LuxonError {
  347. constructor(unit) {
  348. super(`Invalid unit ${unit}`);
  349. }
  350. };
  351. var InvalidArgumentError = class extends LuxonError {
  352. };
  353. var ZoneIsAbstractError = class extends LuxonError {
  354. constructor() {
  355. super("Zone is an abstract class");
  356. }
  357. };
  358. // node_modules/luxon/src/impl/formats.js
  359. var n4 = "numeric";
  360. var s5 = "short";
  361. var l4 = "long";
  362. var DATE_SHORT = {
  363. year: n4,
  364. month: n4,
  365. day: n4
  366. };
  367. var DATE_MED = {
  368. year: n4,
  369. month: s5,
  370. day: n4
  371. };
  372. var DATE_MED_WITH_WEEKDAY = {
  373. year: n4,
  374. month: s5,
  375. day: n4,
  376. weekday: s5
  377. };
  378. var DATE_FULL = {
  379. year: n4,
  380. month: l4,
  381. day: n4
  382. };
  383. var DATE_HUGE = {
  384. year: n4,
  385. month: l4,
  386. day: n4,
  387. weekday: l4
  388. };
  389. var TIME_SIMPLE = {
  390. hour: n4,
  391. minute: n4
  392. };
  393. var TIME_WITH_SECONDS = {
  394. hour: n4,
  395. minute: n4,
  396. second: n4
  397. };
  398. var TIME_WITH_SHORT_OFFSET = {
  399. hour: n4,
  400. minute: n4,
  401. second: n4,
  402. timeZoneName: s5
  403. };
  404. var TIME_WITH_LONG_OFFSET = {
  405. hour: n4,
  406. minute: n4,
  407. second: n4,
  408. timeZoneName: l4
  409. };
  410. var TIME_24_SIMPLE = {
  411. hour: n4,
  412. minute: n4,
  413. hourCycle: "h23"
  414. };
  415. var TIME_24_WITH_SECONDS = {
  416. hour: n4,
  417. minute: n4,
  418. second: n4,
  419. hourCycle: "h23"
  420. };
  421. var TIME_24_WITH_SHORT_OFFSET = {
  422. hour: n4,
  423. minute: n4,
  424. second: n4,
  425. hourCycle: "h23",
  426. timeZoneName: s5
  427. };
  428. var TIME_24_WITH_LONG_OFFSET = {
  429. hour: n4,
  430. minute: n4,
  431. second: n4,
  432. hourCycle: "h23",
  433. timeZoneName: l4
  434. };
  435. var DATETIME_SHORT = {
  436. year: n4,
  437. month: n4,
  438. day: n4,
  439. hour: n4,
  440. minute: n4
  441. };
  442. var DATETIME_SHORT_WITH_SECONDS = {
  443. year: n4,
  444. month: n4,
  445. day: n4,
  446. hour: n4,
  447. minute: n4,
  448. second: n4
  449. };
  450. var DATETIME_MED = {
  451. year: n4,
  452. month: s5,
  453. day: n4,
  454. hour: n4,
  455. minute: n4
  456. };
  457. var DATETIME_MED_WITH_SECONDS = {
  458. year: n4,
  459. month: s5,
  460. day: n4,
  461. hour: n4,
  462. minute: n4,
  463. second: n4
  464. };
  465. var DATETIME_MED_WITH_WEEKDAY = {
  466. year: n4,
  467. month: s5,
  468. day: n4,
  469. weekday: s5,
  470. hour: n4,
  471. minute: n4
  472. };
  473. var DATETIME_FULL = {
  474. year: n4,
  475. month: l4,
  476. day: n4,
  477. hour: n4,
  478. minute: n4,
  479. timeZoneName: s5
  480. };
  481. var DATETIME_FULL_WITH_SECONDS = {
  482. year: n4,
  483. month: l4,
  484. day: n4,
  485. hour: n4,
  486. minute: n4,
  487. second: n4,
  488. timeZoneName: s5
  489. };
  490. var DATETIME_HUGE = {
  491. year: n4,
  492. month: l4,
  493. day: n4,
  494. weekday: l4,
  495. hour: n4,
  496. minute: n4,
  497. timeZoneName: l4
  498. };
  499. var DATETIME_HUGE_WITH_SECONDS = {
  500. year: n4,
  501. month: l4,
  502. day: n4,
  503. weekday: l4,
  504. hour: n4,
  505. minute: n4,
  506. second: n4,
  507. timeZoneName: l4
  508. };
  509. // node_modules/luxon/src/impl/util.js
  510. function isUndefined(o3) {
  511. return typeof o3 === "undefined";
  512. }
  513. function isNumber(o3) {
  514. return typeof o3 === "number";
  515. }
  516. function isInteger(o3) {
  517. return typeof o3 === "number" && o3 % 1 === 0;
  518. }
  519. function isString(o3) {
  520. return typeof o3 === "string";
  521. }
  522. function isDate(o3) {
  523. return Object.prototype.toString.call(o3) === "[object Date]";
  524. }
  525. function hasRelative() {
  526. try {
  527. return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat;
  528. } catch (e3) {
  529. return false;
  530. }
  531. }
  532. function maybeArray(thing) {
  533. return Array.isArray(thing) ? thing : [thing];
  534. }
  535. function bestBy(arr, by, compare) {
  536. if (arr.length === 0) {
  537. return void 0;
  538. }
  539. return arr.reduce((best, next) => {
  540. const pair = [by(next), next];
  541. if (!best) {
  542. return pair;
  543. } else if (compare(best[0], pair[0]) === best[0]) {
  544. return best;
  545. } else {
  546. return pair;
  547. }
  548. }, null)[1];
  549. }
  550. function pick(obj, keys) {
  551. return keys.reduce((a2, k2) => {
  552. a2[k2] = obj[k2];
  553. return a2;
  554. }, {});
  555. }
  556. function hasOwnProperty(obj, prop) {
  557. return Object.prototype.hasOwnProperty.call(obj, prop);
  558. }
  559. function integerBetween(thing, bottom, top) {
  560. return isInteger(thing) && thing >= bottom && thing <= top;
  561. }
  562. function floorMod(x, n5) {
  563. return x - n5 * Math.floor(x / n5);
  564. }
  565. function padStart(input, n5 = 2) {
  566. const isNeg = input < 0;
  567. let padded;
  568. if (isNeg) {
  569. padded = "-" + ("" + -input).padStart(n5, "0");
  570. } else {
  571. padded = ("" + input).padStart(n5, "0");
  572. }
  573. return padded;
  574. }
  575. function parseInteger(string) {
  576. if (isUndefined(string) || string === null || string === "") {
  577. return void 0;
  578. } else {
  579. return parseInt(string, 10);
  580. }
  581. }
  582. function parseFloating(string) {
  583. if (isUndefined(string) || string === null || string === "") {
  584. return void 0;
  585. } else {
  586. return parseFloat(string);
  587. }
  588. }
  589. function parseMillis(fraction) {
  590. if (isUndefined(fraction) || fraction === null || fraction === "") {
  591. return void 0;
  592. } else {
  593. const f2 = parseFloat("0." + fraction) * 1e3;
  594. return Math.floor(f2);
  595. }
  596. }
  597. function roundTo(number, digits, towardZero = false) {
  598. const factor = 10 ** digits, rounder = towardZero ? Math.trunc : Math.round;
  599. return rounder(number * factor) / factor;
  600. }
  601. function isLeapYear(year) {
  602. return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
  603. }
  604. function daysInYear(year) {
  605. return isLeapYear(year) ? 366 : 365;
  606. }
  607. function daysInMonth(year, month) {
  608. const modMonth = floorMod(month - 1, 12) + 1, modYear = year + (month - modMonth) / 12;
  609. if (modMonth === 2) {
  610. return isLeapYear(modYear) ? 29 : 28;
  611. } else {
  612. return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];
  613. }
  614. }
  615. function objToLocalTS(obj) {
  616. let d3 = Date.UTC(
  617. obj.year,
  618. obj.month - 1,
  619. obj.day,
  620. obj.hour,
  621. obj.minute,
  622. obj.second,
  623. obj.millisecond
  624. );
  625. if (obj.year < 100 && obj.year >= 0) {
  626. d3 = new Date(d3);
  627. d3.setUTCFullYear(d3.getUTCFullYear() - 1900);
  628. }
  629. return +d3;
  630. }
  631. function weeksInWeekYear(weekYear) {
  632. 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;
  633. return p1 === 4 || p22 === 3 ? 53 : 52;
  634. }
  635. function untruncateYear(year) {
  636. if (year > 99) {
  637. return year;
  638. } else
  639. return year > 60 ? 1900 + year : 2e3 + year;
  640. }
  641. function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {
  642. const date = new Date(ts), intlOpts = {
  643. hourCycle: "h23",
  644. year: "numeric",
  645. month: "2-digit",
  646. day: "2-digit",
  647. hour: "2-digit",
  648. minute: "2-digit"
  649. };
  650. if (timeZone) {
  651. intlOpts.timeZone = timeZone;
  652. }
  653. const modified = { timeZoneName: offsetFormat, ...intlOpts };
  654. const parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find((m3) => m3.type.toLowerCase() === "timezonename");
  655. return parsed ? parsed.value : null;
  656. }
  657. function signedOffset(offHourStr, offMinuteStr) {
  658. let offHour = parseInt(offHourStr, 10);
  659. if (Number.isNaN(offHour)) {
  660. offHour = 0;
  661. }
  662. const offMin = parseInt(offMinuteStr, 10) || 0, offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;
  663. return offHour * 60 + offMinSigned;
  664. }
  665. function asNumber(value) {
  666. const numericValue = Number(value);
  667. if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue))
  668. throw new InvalidArgumentError(`Invalid unit value ${value}`);
  669. return numericValue;
  670. }
  671. function normalizeObject(obj, normalizer) {
  672. const normalized = {};
  673. for (const u3 in obj) {
  674. if (hasOwnProperty(obj, u3)) {
  675. const v4 = obj[u3];
  676. if (v4 === void 0 || v4 === null)
  677. continue;
  678. normalized[normalizer(u3)] = asNumber(v4);
  679. }
  680. }
  681. return normalized;
  682. }
  683. function formatOffset(offset2, format) {
  684. const hours = Math.trunc(Math.abs(offset2 / 60)), minutes = Math.trunc(Math.abs(offset2 % 60)), sign = offset2 >= 0 ? "+" : "-";
  685. switch (format) {
  686. case "short":
  687. return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;
  688. case "narrow":
  689. return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`;
  690. case "techie":
  691. return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;
  692. default:
  693. throw new RangeError(`Value format ${format} is out of range for property format`);
  694. }
  695. }
  696. function timeObject(obj) {
  697. return pick(obj, ["hour", "minute", "second", "millisecond"]);
  698. }
  699. var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
  700. // node_modules/luxon/src/impl/english.js
  701. var monthsLong = [
  702. "January",
  703. "February",
  704. "March",
  705. "April",
  706. "May",
  707. "June",
  708. "July",
  709. "August",
  710. "September",
  711. "October",
  712. "November",
  713. "December"
  714. ];
  715. var monthsShort = [
  716. "Jan",
  717. "Feb",
  718. "Mar",
  719. "Apr",
  720. "May",
  721. "Jun",
  722. "Jul",
  723. "Aug",
  724. "Sep",
  725. "Oct",
  726. "Nov",
  727. "Dec"
  728. ];
  729. var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
  730. function months(length) {
  731. switch (length) {
  732. case "narrow":
  733. return [...monthsNarrow];
  734. case "short":
  735. return [...monthsShort];
  736. case "long":
  737. return [...monthsLong];
  738. case "numeric":
  739. return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
  740. case "2-digit":
  741. return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
  742. default:
  743. return null;
  744. }
  745. }
  746. var weekdaysLong = [
  747. "Monday",
  748. "Tuesday",
  749. "Wednesday",
  750. "Thursday",
  751. "Friday",
  752. "Saturday",
  753. "Sunday"
  754. ];
  755. var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
  756. var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"];
  757. function weekdays(length) {
  758. switch (length) {
  759. case "narrow":
  760. return [...weekdaysNarrow];
  761. case "short":
  762. return [...weekdaysShort];
  763. case "long":
  764. return [...weekdaysLong];
  765. case "numeric":
  766. return ["1", "2", "3", "4", "5", "6", "7"];
  767. default:
  768. return null;
  769. }
  770. }
  771. var meridiems = ["AM", "PM"];
  772. var erasLong = ["Before Christ", "Anno Domini"];
  773. var erasShort = ["BC", "AD"];
  774. var erasNarrow = ["B", "A"];
  775. function eras(length) {
  776. switch (length) {
  777. case "narrow":
  778. return [...erasNarrow];
  779. case "short":
  780. return [...erasShort];
  781. case "long":
  782. return [...erasLong];
  783. default:
  784. return null;
  785. }
  786. }
  787. function meridiemForDateTime(dt) {
  788. return meridiems[dt.hour < 12 ? 0 : 1];
  789. }
  790. function weekdayForDateTime(dt, length) {
  791. return weekdays(length)[dt.weekday - 1];
  792. }
  793. function monthForDateTime(dt, length) {
  794. return months(length)[dt.month - 1];
  795. }
  796. function eraForDateTime(dt, length) {
  797. return eras(length)[dt.year < 0 ? 0 : 1];
  798. }
  799. function formatRelativeTime(unit, count, numeric = "always", narrow = false) {
  800. const units = {
  801. years: ["year", "yr."],
  802. quarters: ["quarter", "qtr."],
  803. months: ["month", "mo."],
  804. weeks: ["week", "wk."],
  805. days: ["day", "day", "days"],
  806. hours: ["hour", "hr."],
  807. minutes: ["minute", "min."],
  808. seconds: ["second", "sec."]
  809. };
  810. const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1;
  811. if (numeric === "auto" && lastable) {
  812. const isDay = unit === "days";
  813. switch (count) {
  814. case 1:
  815. return isDay ? "tomorrow" : `next ${units[unit][0]}`;
  816. case -1:
  817. return isDay ? "yesterday" : `last ${units[unit][0]}`;
  818. case 0:
  819. return isDay ? "today" : `this ${units[unit][0]}`;
  820. default:
  821. }
  822. }
  823. 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;
  824. return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;
  825. }
  826. // node_modules/luxon/src/impl/formatter.js
  827. function stringifyTokens(splits, tokenToString) {
  828. let s6 = "";
  829. for (const token of splits) {
  830. if (token.literal) {
  831. s6 += token.val;
  832. } else {
  833. s6 += tokenToString(token.val);
  834. }
  835. }
  836. return s6;
  837. }
  838. var macroTokenToFormatOpts = {
  839. D: DATE_SHORT,
  840. DD: DATE_MED,
  841. DDD: DATE_FULL,
  842. DDDD: DATE_HUGE,
  843. t: TIME_SIMPLE,
  844. tt: TIME_WITH_SECONDS,
  845. ttt: TIME_WITH_SHORT_OFFSET,
  846. tttt: TIME_WITH_LONG_OFFSET,
  847. T: TIME_24_SIMPLE,
  848. TT: TIME_24_WITH_SECONDS,
  849. TTT: TIME_24_WITH_SHORT_OFFSET,
  850. TTTT: TIME_24_WITH_LONG_OFFSET,
  851. f: DATETIME_SHORT,
  852. ff: DATETIME_MED,
  853. fff: DATETIME_FULL,
  854. ffff: DATETIME_HUGE,
  855. F: DATETIME_SHORT_WITH_SECONDS,
  856. FF: DATETIME_MED_WITH_SECONDS,
  857. FFF: DATETIME_FULL_WITH_SECONDS,
  858. FFFF: DATETIME_HUGE_WITH_SECONDS
  859. };
  860. var Formatter = class {
  861. static create(locale, opts = {}) {
  862. return new Formatter(locale, opts);
  863. }
  864. static parseFormat(fmt) {
  865. let current = null, currentFull = "", bracketed = false;
  866. const splits = [];
  867. for (let i4 = 0; i4 < fmt.length; i4++) {
  868. const c3 = fmt.charAt(i4);
  869. if (c3 === "'") {
  870. if (currentFull.length > 0) {
  871. splits.push({ literal: bracketed, val: currentFull });
  872. }
  873. current = null;
  874. currentFull = "";
  875. bracketed = !bracketed;
  876. } else if (bracketed) {
  877. currentFull += c3;
  878. } else if (c3 === current) {
  879. currentFull += c3;
  880. } else {
  881. if (currentFull.length > 0) {
  882. splits.push({ literal: false, val: currentFull });
  883. }
  884. currentFull = c3;
  885. current = c3;
  886. }
  887. }
  888. if (currentFull.length > 0) {
  889. splits.push({ literal: bracketed, val: currentFull });
  890. }
  891. return splits;
  892. }
  893. static macroTokenToFormatOpts(token) {
  894. return macroTokenToFormatOpts[token];
  895. }
  896. constructor(locale, formatOpts) {
  897. this.opts = formatOpts;
  898. this.loc = locale;
  899. this.systemLoc = null;
  900. }
  901. formatWithSystemDefault(dt, opts) {
  902. if (this.systemLoc === null) {
  903. this.systemLoc = this.loc.redefaultToSystem();
  904. }
  905. const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });
  906. return df.format();
  907. }
  908. formatDateTime(dt, opts = {}) {
  909. const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });
  910. return df.format();
  911. }
  912. formatDateTimeParts(dt, opts = {}) {
  913. const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });
  914. return df.formatToParts();
  915. }
  916. resolvedOptions(dt, opts = {}) {
  917. const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });
  918. return df.resolvedOptions();
  919. }
  920. num(n5, p5 = 0) {
  921. if (this.opts.forceSimple) {
  922. return padStart(n5, p5);
  923. }
  924. const opts = { ...this.opts };
  925. if (p5 > 0) {
  926. opts.padTo = p5;
  927. }
  928. return this.loc.numberFormatter(opts).format(n5);
  929. }
  930. formatDateTimeFromString(dt, fmt) {
  931. 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) => {
  932. if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {
  933. return "Z";
  934. }
  935. return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : "";
  936. }, 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(
  937. standalone ? { weekday: length } : { weekday: length, month: "long", day: "numeric" },
  938. "weekday"
  939. ), maybeMacro = (token) => {
  940. const formatOpts = Formatter.macroTokenToFormatOpts(token);
  941. if (formatOpts) {
  942. return this.formatWithSystemDefault(dt, formatOpts);
  943. } else {
  944. return token;
  945. }
  946. }, era = (length) => knownEnglish ? eraForDateTime(dt, length) : string({ era: length }, "era"), tokenToString = (token) => {
  947. switch (token) {
  948. case "S":
  949. return this.num(dt.millisecond);
  950. case "u":
  951. case "SSS":
  952. return this.num(dt.millisecond, 3);
  953. case "s":
  954. return this.num(dt.second);
  955. case "ss":
  956. return this.num(dt.second, 2);
  957. case "uu":
  958. return this.num(Math.floor(dt.millisecond / 10), 2);
  959. case "uuu":
  960. return this.num(Math.floor(dt.millisecond / 100));
  961. case "m":
  962. return this.num(dt.minute);
  963. case "mm":
  964. return this.num(dt.minute, 2);
  965. case "h":
  966. return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);
  967. case "hh":
  968. return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);
  969. case "H":
  970. return this.num(dt.hour);
  971. case "HH":
  972. return this.num(dt.hour, 2);
  973. case "Z":
  974. return formatOffset2({ format: "narrow", allowZ: this.opts.allowZ });
  975. case "ZZ":
  976. return formatOffset2({ format: "short", allowZ: this.opts.allowZ });
  977. case "ZZZ":
  978. return formatOffset2({ format: "techie", allowZ: this.opts.allowZ });
  979. case "ZZZZ":
  980. return dt.zone.offsetName(dt.ts, { format: "short", locale: this.loc.locale });
  981. case "ZZZZZ":
  982. return dt.zone.offsetName(dt.ts, { format: "long", locale: this.loc.locale });
  983. case "z":
  984. return dt.zoneName;
  985. case "a":
  986. return meridiem();
  987. case "d":
  988. return useDateTimeFormatter ? string({ day: "numeric" }, "day") : this.num(dt.day);
  989. case "dd":
  990. return useDateTimeFormatter ? string({ day: "2-digit" }, "day") : this.num(dt.day, 2);
  991. case "c":
  992. return this.num(dt.weekday);
  993. case "ccc":
  994. return weekday("short", true);
  995. case "cccc":
  996. return weekday("long", true);
  997. case "ccccc":
  998. return weekday("narrow", true);
  999. case "E":
  1000. return this.num(dt.weekday);
  1001. case "EEE":
  1002. return weekday("short", false);
  1003. case "EEEE":
  1004. return weekday("long", false);
  1005. case "EEEEE":
  1006. return weekday("narrow", false);
  1007. case "L":
  1008. return useDateTimeFormatter ? string({ month: "numeric", day: "numeric" }, "month") : this.num(dt.month);
  1009. case "LL":
  1010. return useDateTimeFormatter ? string({ month: "2-digit", day: "numeric" }, "month") : this.num(dt.month, 2);
  1011. case "LLL":
  1012. return month("short", true);
  1013. case "LLLL":
  1014. return month("long", true);
  1015. case "LLLLL":
  1016. return month("narrow", true);
  1017. case "M":
  1018. return useDateTimeFormatter ? string({ month: "numeric" }, "month") : this.num(dt.month);
  1019. case "MM":
  1020. return useDateTimeFormatter ? string({ month: "2-digit" }, "month") : this.num(dt.month, 2);
  1021. case "MMM":
  1022. return month("short", false);
  1023. case "MMMM":
  1024. return month("long", false);
  1025. case "MMMMM":
  1026. return month("narrow", false);
  1027. case "y":
  1028. return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year);
  1029. case "yy":
  1030. return useDateTimeFormatter ? string({ year: "2-digit" }, "year") : this.num(dt.year.toString().slice(-2), 2);
  1031. case "yyyy":
  1032. return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 4);
  1033. case "yyyyyy":
  1034. return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 6);
  1035. case "G":
  1036. return era("short");
  1037. case "GG":
  1038. return era("long");
  1039. case "GGGGG":
  1040. return era("narrow");
  1041. case "kk":
  1042. return this.num(dt.weekYear.toString().slice(-2), 2);
  1043. case "kkkk":
  1044. return this.num(dt.weekYear, 4);
  1045. case "W":
  1046. return this.num(dt.weekNumber);
  1047. case "WW":
  1048. return this.num(dt.weekNumber, 2);
  1049. case "o":
  1050. return this.num(dt.ordinal);
  1051. case "ooo":
  1052. return this.num(dt.ordinal, 3);
  1053. case "q":
  1054. return this.num(dt.quarter);
  1055. case "qq":
  1056. return this.num(dt.quarter, 2);
  1057. case "X":
  1058. return this.num(Math.floor(dt.ts / 1e3));
  1059. case "x":
  1060. return this.num(dt.ts);
  1061. default:
  1062. return maybeMacro(token);
  1063. }
  1064. };
  1065. return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);
  1066. }
  1067. formatDurationFromString(dur, fmt) {
  1068. const tokenToField = (token) => {
  1069. switch (token[0]) {
  1070. case "S":
  1071. return "millisecond";
  1072. case "s":
  1073. return "second";
  1074. case "m":
  1075. return "minute";
  1076. case "h":
  1077. return "hour";
  1078. case "d":
  1079. return "day";
  1080. case "w":
  1081. return "week";
  1082. case "M":
  1083. return "month";
  1084. case "y":
  1085. return "year";
  1086. default:
  1087. return null;
  1088. }
  1089. }, tokenToString = (lildur) => (token) => {
  1090. const mapped = tokenToField(token);
  1091. if (mapped) {
  1092. return this.num(lildur.get(mapped), token.length);
  1093. } else {
  1094. return token;
  1095. }
  1096. }, tokens = Formatter.parseFormat(fmt), realTokens = tokens.reduce(
  1097. (found, { literal, val }) => literal ? found : found.concat(val),
  1098. []
  1099. ), collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t5) => t5));
  1100. return stringifyTokens(tokens, tokenToString(collapsed));
  1101. }
  1102. };
  1103. // node_modules/luxon/src/impl/invalid.js
  1104. var Invalid = class {
  1105. constructor(reason, explanation) {
  1106. this.reason = reason;
  1107. this.explanation = explanation;
  1108. }
  1109. toMessage() {
  1110. if (this.explanation) {
  1111. return `${this.reason}: ${this.explanation}`;
  1112. } else {
  1113. return this.reason;
  1114. }
  1115. }
  1116. };
  1117. // node_modules/luxon/src/zone.js
  1118. var Zone = class {
  1119. get type() {
  1120. throw new ZoneIsAbstractError();
  1121. }
  1122. get name() {
  1123. throw new ZoneIsAbstractError();
  1124. }
  1125. get ianaName() {
  1126. return this.name;
  1127. }
  1128. get isUniversal() {
  1129. throw new ZoneIsAbstractError();
  1130. }
  1131. offsetName(ts, opts) {
  1132. throw new ZoneIsAbstractError();
  1133. }
  1134. formatOffset(ts, format) {
  1135. throw new ZoneIsAbstractError();
  1136. }
  1137. offset(ts) {
  1138. throw new ZoneIsAbstractError();
  1139. }
  1140. equals(otherZone) {
  1141. throw new ZoneIsAbstractError();
  1142. }
  1143. get isValid() {
  1144. throw new ZoneIsAbstractError();
  1145. }
  1146. };
  1147. // node_modules/luxon/src/zones/systemZone.js
  1148. var singleton = null;
  1149. var SystemZone = class extends Zone {
  1150. static get instance() {
  1151. if (singleton === null) {
  1152. singleton = new SystemZone();
  1153. }
  1154. return singleton;
  1155. }
  1156. get type() {
  1157. return "system";
  1158. }
  1159. get name() {
  1160. return new Intl.DateTimeFormat().resolvedOptions().timeZone;
  1161. }
  1162. get isUniversal() {
  1163. return false;
  1164. }
  1165. offsetName(ts, { format, locale }) {
  1166. return parseZoneInfo(ts, format, locale);
  1167. }
  1168. formatOffset(ts, format) {
  1169. return formatOffset(this.offset(ts), format);
  1170. }
  1171. offset(ts) {
  1172. return -new Date(ts).getTimezoneOffset();
  1173. }
  1174. equals(otherZone) {
  1175. return otherZone.type === "system";
  1176. }
  1177. get isValid() {
  1178. return true;
  1179. }
  1180. };
  1181. // node_modules/luxon/src/zones/IANAZone.js
  1182. var dtfCache = {};
  1183. function makeDTF(zone) {
  1184. if (!dtfCache[zone]) {
  1185. dtfCache[zone] = new Intl.DateTimeFormat("en-US", {
  1186. hour12: false,
  1187. timeZone: zone,
  1188. year: "numeric",
  1189. month: "2-digit",
  1190. day: "2-digit",
  1191. hour: "2-digit",
  1192. minute: "2-digit",
  1193. second: "2-digit",
  1194. era: "short"
  1195. });
  1196. }
  1197. return dtfCache[zone];
  1198. }
  1199. var typeToPos = {
  1200. year: 0,
  1201. month: 1,
  1202. day: 2,
  1203. era: 3,
  1204. hour: 4,
  1205. minute: 5,
  1206. second: 6
  1207. };
  1208. function hackyOffset(dtf, date) {
  1209. 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;
  1210. return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];
  1211. }
  1212. function partsOffset(dtf, date) {
  1213. const formatted = dtf.formatToParts(date);
  1214. const filled = [];
  1215. for (let i4 = 0; i4 < formatted.length; i4++) {
  1216. const { type, value } = formatted[i4];
  1217. const pos = typeToPos[type];
  1218. if (type === "era") {
  1219. filled[pos] = value;
  1220. } else if (!isUndefined(pos)) {
  1221. filled[pos] = parseInt(value, 10);
  1222. }
  1223. }
  1224. return filled;
  1225. }
  1226. var ianaZoneCache = {};
  1227. var IANAZone = class extends Zone {
  1228. static create(name) {
  1229. if (!ianaZoneCache[name]) {
  1230. ianaZoneCache[name] = new IANAZone(name);
  1231. }
  1232. return ianaZoneCache[name];
  1233. }
  1234. static resetCache() {
  1235. ianaZoneCache = {};
  1236. dtfCache = {};
  1237. }
  1238. static isValidSpecifier(s6) {
  1239. return this.isValidZone(s6);
  1240. }
  1241. static isValidZone(zone) {
  1242. if (!zone) {
  1243. return false;
  1244. }
  1245. try {
  1246. new Intl.DateTimeFormat("en-US", { timeZone: zone }).format();
  1247. return true;
  1248. } catch (e3) {
  1249. return false;
  1250. }
  1251. }
  1252. constructor(name) {
  1253. super();
  1254. this.zoneName = name;
  1255. this.valid = IANAZone.isValidZone(name);
  1256. }
  1257. get type() {
  1258. return "iana";
  1259. }
  1260. get name() {
  1261. return this.zoneName;
  1262. }
  1263. get isUniversal() {
  1264. return false;
  1265. }
  1266. offsetName(ts, { format, locale }) {
  1267. return parseZoneInfo(ts, format, locale, this.name);
  1268. }
  1269. formatOffset(ts, format) {
  1270. return formatOffset(this.offset(ts), format);
  1271. }
  1272. offset(ts) {
  1273. const date = new Date(ts);
  1274. if (isNaN(date))
  1275. return NaN;
  1276. const dtf = makeDTF(this.name);
  1277. let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);
  1278. if (adOrBc === "BC") {
  1279. year = -Math.abs(year) + 1;
  1280. }
  1281. const adjustedHour = hour === 24 ? 0 : hour;
  1282. const asUTC = objToLocalTS({
  1283. year,
  1284. month,
  1285. day,
  1286. hour: adjustedHour,
  1287. minute,
  1288. second,
  1289. millisecond: 0
  1290. });
  1291. let asTS = +date;
  1292. const over = asTS % 1e3;
  1293. asTS -= over >= 0 ? over : 1e3 + over;
  1294. return (asUTC - asTS) / (60 * 1e3);
  1295. }
  1296. equals(otherZone) {
  1297. return otherZone.type === "iana" && otherZone.name === this.name;
  1298. }
  1299. get isValid() {
  1300. return this.valid;
  1301. }
  1302. };
  1303. // node_modules/luxon/src/zones/fixedOffsetZone.js
  1304. var singleton2 = null;
  1305. var FixedOffsetZone = class extends Zone {
  1306. static get utcInstance() {
  1307. if (singleton2 === null) {
  1308. singleton2 = new FixedOffsetZone(0);
  1309. }
  1310. return singleton2;
  1311. }
  1312. static instance(offset2) {
  1313. return offset2 === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset2);
  1314. }
  1315. static parseSpecifier(s6) {
  1316. if (s6) {
  1317. const r3 = s6.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
  1318. if (r3) {
  1319. return new FixedOffsetZone(signedOffset(r3[1], r3[2]));
  1320. }
  1321. }
  1322. return null;
  1323. }
  1324. constructor(offset2) {
  1325. super();
  1326. this.fixed = offset2;
  1327. }
  1328. get type() {
  1329. return "fixed";
  1330. }
  1331. get name() {
  1332. return this.fixed === 0 ? "UTC" : `UTC${formatOffset(this.fixed, "narrow")}`;
  1333. }
  1334. get ianaName() {
  1335. if (this.fixed === 0) {
  1336. return "Etc/UTC";
  1337. } else {
  1338. return `Etc/GMT${formatOffset(-this.fixed, "narrow")}`;
  1339. }
  1340. }
  1341. offsetName() {
  1342. return this.name;
  1343. }
  1344. formatOffset(ts, format) {
  1345. return formatOffset(this.fixed, format);
  1346. }
  1347. get isUniversal() {
  1348. return true;
  1349. }
  1350. offset() {
  1351. return this.fixed;
  1352. }
  1353. equals(otherZone) {
  1354. return otherZone.type === "fixed" && otherZone.fixed === this.fixed;
  1355. }
  1356. get isValid() {
  1357. return true;
  1358. }
  1359. };
  1360. // node_modules/luxon/src/zones/invalidZone.js
  1361. var InvalidZone = class extends Zone {
  1362. constructor(zoneName) {
  1363. super();
  1364. this.zoneName = zoneName;
  1365. }
  1366. get type() {
  1367. return "invalid";
  1368. }
  1369. get name() {
  1370. return this.zoneName;
  1371. }
  1372. get isUniversal() {
  1373. return false;
  1374. }
  1375. offsetName() {
  1376. return null;
  1377. }
  1378. formatOffset() {
  1379. return "";
  1380. }
  1381. offset() {
  1382. return NaN;
  1383. }
  1384. equals() {
  1385. return false;
  1386. }
  1387. get isValid() {
  1388. return false;
  1389. }
  1390. };
  1391. // node_modules/luxon/src/impl/zoneUtil.js
  1392. function normalizeZone(input, defaultZone2) {
  1393. let offset2;
  1394. if (isUndefined(input) || input === null) {
  1395. return defaultZone2;
  1396. } else if (input instanceof Zone) {
  1397. return input;
  1398. } else if (isString(input)) {
  1399. const lowered = input.toLowerCase();
  1400. if (lowered === "default")
  1401. return defaultZone2;
  1402. else if (lowered === "local" || lowered === "system")
  1403. return SystemZone.instance;
  1404. else if (lowered === "utc" || lowered === "gmt")
  1405. return FixedOffsetZone.utcInstance;
  1406. else
  1407. return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);
  1408. } else if (isNumber(input)) {
  1409. return FixedOffsetZone.instance(input);
  1410. } else if (typeof input === "object" && input.offset && typeof input.offset === "number") {
  1411. return input;
  1412. } else {
  1413. return new InvalidZone(input);
  1414. }
  1415. }
  1416. // node_modules/luxon/src/settings.js
  1417. var now = () => Date.now();
  1418. var defaultZone = "system";
  1419. var defaultLocale = null;
  1420. var defaultNumberingSystem = null;
  1421. var defaultOutputCalendar = null;
  1422. var throwOnInvalid;
  1423. var Settings = class {
  1424. static get now() {
  1425. return now;
  1426. }
  1427. static set now(n5) {
  1428. now = n5;
  1429. }
  1430. static set defaultZone(zone) {
  1431. defaultZone = zone;
  1432. }
  1433. static get defaultZone() {
  1434. return normalizeZone(defaultZone, SystemZone.instance);
  1435. }
  1436. static get defaultLocale() {
  1437. return defaultLocale;
  1438. }
  1439. static set defaultLocale(locale) {
  1440. defaultLocale = locale;
  1441. }
  1442. static get defaultNumberingSystem() {
  1443. return defaultNumberingSystem;
  1444. }
  1445. static set defaultNumberingSystem(numberingSystem) {
  1446. defaultNumberingSystem = numberingSystem;
  1447. }
  1448. static get defaultOutputCalendar() {
  1449. return defaultOutputCalendar;
  1450. }
  1451. static set defaultOutputCalendar(outputCalendar) {
  1452. defaultOutputCalendar = outputCalendar;
  1453. }
  1454. static get throwOnInvalid() {
  1455. return throwOnInvalid;
  1456. }
  1457. static set throwOnInvalid(t5) {
  1458. throwOnInvalid = t5;
  1459. }
  1460. static resetCaches() {
  1461. Locale.resetCache();
  1462. IANAZone.resetCache();
  1463. }
  1464. };
  1465. // node_modules/luxon/src/impl/locale.js
  1466. var intlLFCache = {};
  1467. function getCachedLF(locString, opts = {}) {
  1468. const key = JSON.stringify([locString, opts]);
  1469. let dtf = intlLFCache[key];
  1470. if (!dtf) {
  1471. dtf = new Intl.ListFormat(locString, opts);
  1472. intlLFCache[key] = dtf;
  1473. }
  1474. return dtf;
  1475. }
  1476. var intlDTCache = {};
  1477. function getCachedDTF(locString, opts = {}) {
  1478. const key = JSON.stringify([locString, opts]);
  1479. let dtf = intlDTCache[key];
  1480. if (!dtf) {
  1481. dtf = new Intl.DateTimeFormat(locString, opts);
  1482. intlDTCache[key] = dtf;
  1483. }
  1484. return dtf;
  1485. }
  1486. var intlNumCache = {};
  1487. function getCachedINF(locString, opts = {}) {
  1488. const key = JSON.stringify([locString, opts]);
  1489. let inf = intlNumCache[key];
  1490. if (!inf) {
  1491. inf = new Intl.NumberFormat(locString, opts);
  1492. intlNumCache[key] = inf;
  1493. }
  1494. return inf;
  1495. }
  1496. var intlRelCache = {};
  1497. function getCachedRTF(locString, opts = {}) {
  1498. const { base, ...cacheKeyOpts } = opts;
  1499. const key = JSON.stringify([locString, cacheKeyOpts]);
  1500. let inf = intlRelCache[key];
  1501. if (!inf) {
  1502. inf = new Intl.RelativeTimeFormat(locString, opts);
  1503. intlRelCache[key] = inf;
  1504. }
  1505. return inf;
  1506. }
  1507. var sysLocaleCache = null;
  1508. function systemLocale() {
  1509. if (sysLocaleCache) {
  1510. return sysLocaleCache;
  1511. } else {
  1512. sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;
  1513. return sysLocaleCache;
  1514. }
  1515. }
  1516. function parseLocaleString(localeStr) {
  1517. const uIndex = localeStr.indexOf("-u-");
  1518. if (uIndex === -1) {
  1519. return [localeStr];
  1520. } else {
  1521. let options;
  1522. const smaller = localeStr.substring(0, uIndex);
  1523. try {
  1524. options = getCachedDTF(localeStr).resolvedOptions();
  1525. } catch (e3) {
  1526. options = getCachedDTF(smaller).resolvedOptions();
  1527. }
  1528. const { numberingSystem, calendar } = options;
  1529. return [smaller, numberingSystem, calendar];
  1530. }
  1531. }
  1532. function intlConfigString(localeStr, numberingSystem, outputCalendar) {
  1533. if (outputCalendar || numberingSystem) {
  1534. localeStr += "-u";
  1535. if (outputCalendar) {
  1536. localeStr += `-ca-${outputCalendar}`;
  1537. }
  1538. if (numberingSystem) {
  1539. localeStr += `-nu-${numberingSystem}`;
  1540. }
  1541. return localeStr;
  1542. } else {
  1543. return localeStr;
  1544. }
  1545. }
  1546. function mapMonths(f2) {
  1547. const ms = [];
  1548. for (let i4 = 1; i4 <= 12; i4++) {
  1549. const dt = DateTime.utc(2016, i4, 1);
  1550. ms.push(f2(dt));
  1551. }
  1552. return ms;
  1553. }
  1554. function mapWeekdays(f2) {
  1555. const ms = [];
  1556. for (let i4 = 1; i4 <= 7; i4++) {
  1557. const dt = DateTime.utc(2016, 11, 13 + i4);
  1558. ms.push(f2(dt));
  1559. }
  1560. return ms;
  1561. }
  1562. function listStuff(loc, length, defaultOK, englishFn, intlFn) {
  1563. const mode = loc.listingMode(defaultOK);
  1564. if (mode === "error") {
  1565. return null;
  1566. } else if (mode === "en") {
  1567. return englishFn(length);
  1568. } else {
  1569. return intlFn(length);
  1570. }
  1571. }
  1572. function supportsFastNumbers(loc) {
  1573. if (loc.numberingSystem && loc.numberingSystem !== "latn") {
  1574. return false;
  1575. } else {
  1576. return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn";
  1577. }
  1578. }
  1579. var PolyNumberFormatter = class {
  1580. constructor(intl, forceSimple, opts) {
  1581. this.padTo = opts.padTo || 0;
  1582. this.floor = opts.floor || false;
  1583. const { padTo, floor, ...otherOpts } = opts;
  1584. if (!forceSimple || Object.keys(otherOpts).length > 0) {
  1585. const intlOpts = { useGrouping: false, ...opts };
  1586. if (opts.padTo > 0)
  1587. intlOpts.minimumIntegerDigits = opts.padTo;
  1588. this.inf = getCachedINF(intl, intlOpts);
  1589. }
  1590. }
  1591. format(i4) {
  1592. if (this.inf) {
  1593. const fixed = this.floor ? Math.floor(i4) : i4;
  1594. return this.inf.format(fixed);
  1595. } else {
  1596. const fixed = this.floor ? Math.floor(i4) : roundTo(i4, 3);
  1597. return padStart(fixed, this.padTo);
  1598. }
  1599. }
  1600. };
  1601. var PolyDateFormatter = class {
  1602. constructor(dt, intl, opts) {
  1603. this.opts = opts;
  1604. let z2;
  1605. if (dt.zone.isUniversal) {
  1606. const gmtOffset = -1 * (dt.offset / 60);
  1607. const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;
  1608. if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {
  1609. z2 = offsetZ;
  1610. this.dt = dt;
  1611. } else {
  1612. z2 = "UTC";
  1613. if (opts.timeZoneName) {
  1614. this.dt = dt;
  1615. } else {
  1616. this.dt = dt.offset === 0 ? dt : DateTime.fromMillis(dt.ts + dt.offset * 60 * 1e3);
  1617. }
  1618. }
  1619. } else if (dt.zone.type === "system") {
  1620. this.dt = dt;
  1621. } else {
  1622. this.dt = dt;
  1623. z2 = dt.zone.name;
  1624. }
  1625. const intlOpts = { ...this.opts };
  1626. if (z2) {
  1627. intlOpts.timeZone = z2;
  1628. }
  1629. this.dtf = getCachedDTF(intl, intlOpts);
  1630. }
  1631. format() {
  1632. return this.dtf.format(this.dt.toJSDate());
  1633. }
  1634. formatToParts() {
  1635. return this.dtf.formatToParts(this.dt.toJSDate());
  1636. }
  1637. resolvedOptions() {
  1638. return this.dtf.resolvedOptions();
  1639. }
  1640. };
  1641. var PolyRelFormatter = class {
  1642. constructor(intl, isEnglish, opts) {
  1643. this.opts = { style: "long", ...opts };
  1644. if (!isEnglish && hasRelative()) {
  1645. this.rtf = getCachedRTF(intl, opts);
  1646. }
  1647. }
  1648. format(count, unit) {
  1649. if (this.rtf) {
  1650. return this.rtf.format(count, unit);
  1651. } else {
  1652. return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long");
  1653. }
  1654. }
  1655. formatToParts(count, unit) {
  1656. if (this.rtf) {
  1657. return this.rtf.formatToParts(count, unit);
  1658. } else {
  1659. return [];
  1660. }
  1661. }
  1662. };
  1663. var Locale = class {
  1664. static fromOpts(opts) {
  1665. return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.defaultToEN);
  1666. }
  1667. static create(locale, numberingSystem, outputCalendar, defaultToEN = false) {
  1668. const specifiedLocale = locale || Settings.defaultLocale;
  1669. const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale());
  1670. const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;
  1671. const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;
  1672. return new Locale(localeR, numberingSystemR, outputCalendarR, specifiedLocale);
  1673. }
  1674. static resetCache() {
  1675. sysLocaleCache = null;
  1676. intlDTCache = {};
  1677. intlNumCache = {};
  1678. intlRelCache = {};
  1679. }
  1680. static fromObject({ locale, numberingSystem, outputCalendar } = {}) {
  1681. return Locale.create(locale, numberingSystem, outputCalendar);
  1682. }
  1683. constructor(locale, numbering, outputCalendar, specifiedLocale) {
  1684. const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);
  1685. this.locale = parsedLocale;
  1686. this.numberingSystem = numbering || parsedNumberingSystem || null;
  1687. this.outputCalendar = outputCalendar || parsedOutputCalendar || null;
  1688. this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);
  1689. this.weekdaysCache = { format: {}, standalone: {} };
  1690. this.monthsCache = { format: {}, standalone: {} };
  1691. this.meridiemCache = null;
  1692. this.eraCache = {};
  1693. this.specifiedLocale = specifiedLocale;
  1694. this.fastNumbersCached = null;
  1695. }
  1696. get fastNumbers() {
  1697. if (this.fastNumbersCached == null) {
  1698. this.fastNumbersCached = supportsFastNumbers(this);
  1699. }
  1700. return this.fastNumbersCached;
  1701. }
  1702. listingMode() {
  1703. const isActuallyEn = this.isEnglish();
  1704. const hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
  1705. return isActuallyEn && hasNoWeirdness ? "en" : "intl";
  1706. }
  1707. clone(alts) {
  1708. if (!alts || Object.getOwnPropertyNames(alts).length === 0) {
  1709. return this;
  1710. } else {
  1711. return Locale.create(
  1712. alts.locale || this.specifiedLocale,
  1713. alts.numberingSystem || this.numberingSystem,
  1714. alts.outputCalendar || this.outputCalendar,
  1715. alts.defaultToEN || false
  1716. );
  1717. }
  1718. }
  1719. redefaultToEN(alts = {}) {
  1720. return this.clone({ ...alts, defaultToEN: true });
  1721. }
  1722. redefaultToSystem(alts = {}) {
  1723. return this.clone({ ...alts, defaultToEN: false });
  1724. }
  1725. months(length, format = false, defaultOK = true) {
  1726. return listStuff(this, length, defaultOK, months, () => {
  1727. const intl = format ? { month: length, day: "numeric" } : { month: length }, formatStr = format ? "format" : "standalone";
  1728. if (!this.monthsCache[formatStr][length]) {
  1729. this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, "month"));
  1730. }
  1731. return this.monthsCache[formatStr][length];
  1732. });
  1733. }
  1734. weekdays(length, format = false, defaultOK = true) {
  1735. return listStuff(this, length, defaultOK, weekdays, () => {
  1736. const intl = format ? { weekday: length, year: "numeric", month: "long", day: "numeric" } : { weekday: length }, formatStr = format ? "format" : "standalone";
  1737. if (!this.weekdaysCache[formatStr][length]) {
  1738. this.weekdaysCache[formatStr][length] = mapWeekdays(
  1739. (dt) => this.extract(dt, intl, "weekday")
  1740. );
  1741. }
  1742. return this.weekdaysCache[formatStr][length];
  1743. });
  1744. }
  1745. meridiems(defaultOK = true) {
  1746. return listStuff(
  1747. this,
  1748. void 0,
  1749. defaultOK,
  1750. () => meridiems,
  1751. () => {
  1752. if (!this.meridiemCache) {
  1753. const intl = { hour: "numeric", hourCycle: "h12" };
  1754. this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(
  1755. (dt) => this.extract(dt, intl, "dayperiod")
  1756. );
  1757. }
  1758. return this.meridiemCache;
  1759. }
  1760. );
  1761. }
  1762. eras(length, defaultOK = true) {
  1763. return listStuff(this, length, defaultOK, eras, () => {
  1764. const intl = { era: length };
  1765. if (!this.eraCache[length]) {
  1766. this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(
  1767. (dt) => this.extract(dt, intl, "era")
  1768. );
  1769. }
  1770. return this.eraCache[length];
  1771. });
  1772. }
  1773. extract(dt, intlOpts, field) {
  1774. const df = this.dtFormatter(dt, intlOpts), results = df.formatToParts(), matching = results.find((m3) => m3.type.toLowerCase() === field);
  1775. return matching ? matching.value : null;
  1776. }
  1777. numberFormatter(opts = {}) {
  1778. return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);
  1779. }
  1780. dtFormatter(dt, intlOpts = {}) {
  1781. return new PolyDateFormatter(dt, this.intl, intlOpts);
  1782. }
  1783. relFormatter(opts = {}) {
  1784. return new PolyRelFormatter(this.intl, this.isEnglish(), opts);
  1785. }
  1786. listFormatter(opts = {}) {
  1787. return getCachedLF(this.intl, opts);
  1788. }
  1789. isEnglish() {
  1790. return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us");
  1791. }
  1792. equals(other) {
  1793. return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar;
  1794. }
  1795. };
  1796. // node_modules/luxon/src/impl/regexParser.js
  1797. function combineRegexes(...regexes) {
  1798. const full = regexes.reduce((f2, r3) => f2 + r3.source, "");
  1799. return RegExp(`^${full}$`);
  1800. }
  1801. function combineExtractors(...extractors) {
  1802. return (m3) => extractors.reduce(
  1803. ([mergedVals, mergedZone, cursor], ex) => {
  1804. const [val, zone, next] = ex(m3, cursor);
  1805. return [{ ...mergedVals, ...val }, zone || mergedZone, next];
  1806. },
  1807. [{}, null, 1]
  1808. ).slice(0, 2);
  1809. }
  1810. function parse(s6, ...patterns) {
  1811. if (s6 == null) {
  1812. return [null, null];
  1813. }
  1814. for (const [regex, extractor] of patterns) {
  1815. const m3 = regex.exec(s6);
  1816. if (m3) {
  1817. return extractor(m3);
  1818. }
  1819. }
  1820. return [null, null];
  1821. }
  1822. function simpleParse(...keys) {
  1823. return (match2, cursor) => {
  1824. const ret = {};
  1825. let i4;
  1826. for (i4 = 0; i4 < keys.length; i4++) {
  1827. ret[keys[i4]] = parseInteger(match2[cursor + i4]);
  1828. }
  1829. return [ret, null, cursor + i4];
  1830. };
  1831. }
  1832. var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/;
  1833. var isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`;
  1834. var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/;
  1835. var isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);
  1836. var isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);
  1837. var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/;
  1838. var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/;
  1839. var isoOrdinalRegex = /(\d{4})-?(\d{3})/;
  1840. var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay");
  1841. var extractISOOrdinalData = simpleParse("year", "ordinal");
  1842. var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/;
  1843. var sqlTimeRegex = RegExp(
  1844. `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`
  1845. );
  1846. var sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);
  1847. function int(match2, pos, fallback) {
  1848. const m3 = match2[pos];
  1849. return isUndefined(m3) ? fallback : parseInteger(m3);
  1850. }
  1851. function extractISOYmd(match2, cursor) {
  1852. const item = {
  1853. year: int(match2, cursor),
  1854. month: int(match2, cursor + 1, 1),
  1855. day: int(match2, cursor + 2, 1)
  1856. };
  1857. return [item, null, cursor + 3];
  1858. }
  1859. function extractISOTime(match2, cursor) {
  1860. const item = {
  1861. hours: int(match2, cursor, 0),
  1862. minutes: int(match2, cursor + 1, 0),
  1863. seconds: int(match2, cursor + 2, 0),
  1864. milliseconds: parseMillis(match2[cursor + 3])
  1865. };
  1866. return [item, null, cursor + 4];
  1867. }
  1868. function extractISOOffset(match2, cursor) {
  1869. const local = !match2[cursor] && !match2[cursor + 1], fullOffset = signedOffset(match2[cursor + 1], match2[cursor + 2]), zone = local ? null : FixedOffsetZone.instance(fullOffset);
  1870. return [{}, zone, cursor + 3];
  1871. }
  1872. function extractIANAZone(match2, cursor) {
  1873. const zone = match2[cursor] ? IANAZone.create(match2[cursor]) : null;
  1874. return [{}, zone, cursor + 1];
  1875. }
  1876. var isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);
  1877. var isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
  1878. function extractISODuration(match2) {
  1879. const [s6, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match2;
  1880. const hasNegativePrefix = s6[0] === "-";
  1881. const negativeSeconds = secondStr && secondStr[0] === "-";
  1882. const maybeNegate = (num, force = false) => num !== void 0 && (force || num && hasNegativePrefix) ? -num : num;
  1883. return [
  1884. {
  1885. years: maybeNegate(parseFloating(yearStr)),
  1886. months: maybeNegate(parseFloating(monthStr)),
  1887. weeks: maybeNegate(parseFloating(weekStr)),
  1888. days: maybeNegate(parseFloating(dayStr)),
  1889. hours: maybeNegate(parseFloating(hourStr)),
  1890. minutes: maybeNegate(parseFloating(minuteStr)),
  1891. seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"),
  1892. milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds)
  1893. }
  1894. ];
  1895. }
  1896. var obsOffsets = {
  1897. GMT: 0,
  1898. EDT: -4 * 60,
  1899. EST: -5 * 60,
  1900. CDT: -5 * 60,
  1901. CST: -6 * 60,
  1902. MDT: -6 * 60,
  1903. MST: -7 * 60,
  1904. PDT: -7 * 60,
  1905. PST: -8 * 60
  1906. };
  1907. function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
  1908. const result = {
  1909. year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),
  1910. month: monthsShort.indexOf(monthStr) + 1,
  1911. day: parseInteger(dayStr),
  1912. hour: parseInteger(hourStr),
  1913. minute: parseInteger(minuteStr)
  1914. };
  1915. if (secondStr)
  1916. result.second = parseInteger(secondStr);
  1917. if (weekdayStr) {
  1918. result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1;
  1919. }
  1920. return result;
  1921. }
  1922. 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)))$/;
  1923. function extractRFC2822(match2) {
  1924. const [
  1925. ,
  1926. weekdayStr,
  1927. dayStr,
  1928. monthStr,
  1929. yearStr,
  1930. hourStr,
  1931. minuteStr,
  1932. secondStr,
  1933. obsOffset,
  1934. milOffset,
  1935. offHourStr,
  1936. offMinuteStr
  1937. ] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
  1938. let offset2;
  1939. if (obsOffset) {
  1940. offset2 = obsOffsets[obsOffset];
  1941. } else if (milOffset) {
  1942. offset2 = 0;
  1943. } else {
  1944. offset2 = signedOffset(offHourStr, offMinuteStr);
  1945. }
  1946. return [result, new FixedOffsetZone(offset2)];
  1947. }
  1948. function preprocessRFC2822(s6) {
  1949. return s6.replace(/\([^)]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
  1950. }
  1951. 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$/;
  1952. var rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/;
  1953. 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})$/;
  1954. function extractRFC1123Or850(match2) {
  1955. const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
  1956. return [result, FixedOffsetZone.utcInstance];
  1957. }
  1958. function extractASCII(match2) {
  1959. const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
  1960. return [result, FixedOffsetZone.utcInstance];
  1961. }
  1962. var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);
  1963. var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);
  1964. var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);
  1965. var isoTimeCombinedRegex = combineRegexes(isoTimeRegex);
  1966. var extractISOYmdTimeAndOffset = combineExtractors(
  1967. extractISOYmd,
  1968. extractISOTime,
  1969. extractISOOffset,
  1970. extractIANAZone
  1971. );
  1972. var extractISOWeekTimeAndOffset = combineExtractors(
  1973. extractISOWeekData,
  1974. extractISOTime,
  1975. extractISOOffset,
  1976. extractIANAZone
  1977. );
  1978. var extractISOOrdinalDateAndTime = combineExtractors(
  1979. extractISOOrdinalData,
  1980. extractISOTime,
  1981. extractISOOffset,
  1982. extractIANAZone
  1983. );
  1984. var extractISOTimeAndOffset = combineExtractors(
  1985. extractISOTime,
  1986. extractISOOffset,
  1987. extractIANAZone
  1988. );
  1989. function parseISODate(s6) {
  1990. return parse(
  1991. s6,
  1992. [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],
  1993. [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],
  1994. [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],
  1995. [isoTimeCombinedRegex, extractISOTimeAndOffset]
  1996. );
  1997. }
  1998. function parseRFC2822Date(s6) {
  1999. return parse(preprocessRFC2822(s6), [rfc2822, extractRFC2822]);
  2000. }
  2001. function parseHTTPDate(s6) {
  2002. return parse(
  2003. s6,
  2004. [rfc1123, extractRFC1123Or850],
  2005. [rfc850, extractRFC1123Or850],
  2006. [ascii, extractASCII]
  2007. );
  2008. }
  2009. function parseISODuration(s6) {
  2010. return parse(s6, [isoDuration, extractISODuration]);
  2011. }
  2012. var extractISOTimeOnly = combineExtractors(extractISOTime);
  2013. function parseISOTimeOnly(s6) {
  2014. return parse(s6, [isoTimeOnly, extractISOTimeOnly]);
  2015. }
  2016. var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);
  2017. var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);
  2018. var extractISOTimeOffsetAndIANAZone = combineExtractors(
  2019. extractISOTime,
  2020. extractISOOffset,
  2021. extractIANAZone
  2022. );
  2023. function parseSQL(s6) {
  2024. return parse(
  2025. s6,
  2026. [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],
  2027. [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]
  2028. );
  2029. }
  2030. // node_modules/luxon/src/duration.js
  2031. var INVALID = "Invalid Duration";
  2032. var lowOrderMatrix = {
  2033. weeks: {
  2034. days: 7,
  2035. hours: 7 * 24,
  2036. minutes: 7 * 24 * 60,
  2037. seconds: 7 * 24 * 60 * 60,
  2038. milliseconds: 7 * 24 * 60 * 60 * 1e3
  2039. },
  2040. days: {
  2041. hours: 24,
  2042. minutes: 24 * 60,
  2043. seconds: 24 * 60 * 60,
  2044. milliseconds: 24 * 60 * 60 * 1e3
  2045. },
  2046. hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1e3 },
  2047. minutes: { seconds: 60, milliseconds: 60 * 1e3 },
  2048. seconds: { milliseconds: 1e3 }
  2049. };
  2050. var casualMatrix = {
  2051. years: {
  2052. quarters: 4,
  2053. months: 12,
  2054. weeks: 52,
  2055. days: 365,
  2056. hours: 365 * 24,
  2057. minutes: 365 * 24 * 60,
  2058. seconds: 365 * 24 * 60 * 60,
  2059. milliseconds: 365 * 24 * 60 * 60 * 1e3
  2060. },
  2061. quarters: {
  2062. months: 3,
  2063. weeks: 13,
  2064. days: 91,
  2065. hours: 91 * 24,
  2066. minutes: 91 * 24 * 60,
  2067. seconds: 91 * 24 * 60 * 60,
  2068. milliseconds: 91 * 24 * 60 * 60 * 1e3
  2069. },
  2070. months: {
  2071. weeks: 4,
  2072. days: 30,
  2073. hours: 30 * 24,
  2074. minutes: 30 * 24 * 60,
  2075. seconds: 30 * 24 * 60 * 60,
  2076. milliseconds: 30 * 24 * 60 * 60 * 1e3
  2077. },
  2078. ...lowOrderMatrix
  2079. };
  2080. var daysInYearAccurate = 146097 / 400;
  2081. var daysInMonthAccurate = 146097 / 4800;
  2082. var accurateMatrix = {
  2083. years: {
  2084. quarters: 4,
  2085. months: 12,
  2086. weeks: daysInYearAccurate / 7,
  2087. days: daysInYearAccurate,
  2088. hours: daysInYearAccurate * 24,
  2089. minutes: daysInYearAccurate * 24 * 60,
  2090. seconds: daysInYearAccurate * 24 * 60 * 60,
  2091. milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3
  2092. },
  2093. quarters: {
  2094. months: 3,
  2095. weeks: daysInYearAccurate / 28,
  2096. days: daysInYearAccurate / 4,
  2097. hours: daysInYearAccurate * 24 / 4,
  2098. minutes: daysInYearAccurate * 24 * 60 / 4,
  2099. seconds: daysInYearAccurate * 24 * 60 * 60 / 4,
  2100. milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3 / 4
  2101. },
  2102. months: {
  2103. weeks: daysInMonthAccurate / 7,
  2104. days: daysInMonthAccurate,
  2105. hours: daysInMonthAccurate * 24,
  2106. minutes: daysInMonthAccurate * 24 * 60,
  2107. seconds: daysInMonthAccurate * 24 * 60 * 60,
  2108. milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1e3
  2109. },
  2110. ...lowOrderMatrix
  2111. };
  2112. var orderedUnits = [
  2113. "years",
  2114. "quarters",
  2115. "months",
  2116. "weeks",
  2117. "days",
  2118. "hours",
  2119. "minutes",
  2120. "seconds",
  2121. "milliseconds"
  2122. ];
  2123. var reverseUnits = orderedUnits.slice(0).reverse();
  2124. function clone(dur, alts, clear = false) {
  2125. const conf = {
  2126. values: clear ? alts.values : { ...dur.values, ...alts.values || {} },
  2127. loc: dur.loc.clone(alts.loc),
  2128. conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,
  2129. matrix: alts.matrix || dur.matrix
  2130. };
  2131. return new Duration(conf);
  2132. }
  2133. function antiTrunc(n5) {
  2134. return n5 < 0 ? Math.floor(n5) : Math.ceil(n5);
  2135. }
  2136. function convert(matrix, fromMap, fromUnit, toMap, toUnit) {
  2137. 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);
  2138. toMap[toUnit] += added;
  2139. fromMap[fromUnit] -= added * conv;
  2140. }
  2141. function normalizeValues(matrix, vals) {
  2142. reverseUnits.reduce((previous, current) => {
  2143. if (!isUndefined(vals[current])) {
  2144. if (previous) {
  2145. convert(matrix, vals, previous, vals, current);
  2146. }
  2147. return current;
  2148. } else {
  2149. return previous;
  2150. }
  2151. }, null);
  2152. }
  2153. var Duration = class {
  2154. constructor(config) {
  2155. const accurate = config.conversionAccuracy === "longterm" || false;
  2156. let matrix = accurate ? accurateMatrix : casualMatrix;
  2157. if (config.matrix) {
  2158. matrix = config.matrix;
  2159. }
  2160. this.values = config.values;
  2161. this.loc = config.loc || Locale.create();
  2162. this.conversionAccuracy = accurate ? "longterm" : "casual";
  2163. this.invalid = config.invalid || null;
  2164. this.matrix = matrix;
  2165. this.isLuxonDuration = true;
  2166. }
  2167. static fromMillis(count, opts) {
  2168. return Duration.fromObject({ milliseconds: count }, opts);
  2169. }
  2170. static fromObject(obj, opts = {}) {
  2171. if (obj == null || typeof obj !== "object") {
  2172. throw new InvalidArgumentError(
  2173. `Duration.fromObject: argument expected to be an object, got ${obj === null ? "null" : typeof obj}`
  2174. );
  2175. }
  2176. return new Duration({
  2177. values: normalizeObject(obj, Duration.normalizeUnit),
  2178. loc: Locale.fromObject(opts),
  2179. conversionAccuracy: opts.conversionAccuracy,
  2180. matrix: opts.matrix
  2181. });
  2182. }
  2183. static fromDurationLike(durationLike) {
  2184. if (isNumber(durationLike)) {
  2185. return Duration.fromMillis(durationLike);
  2186. } else if (Duration.isDuration(durationLike)) {
  2187. return durationLike;
  2188. } else if (typeof durationLike === "object") {
  2189. return Duration.fromObject(durationLike);
  2190. } else {
  2191. throw new InvalidArgumentError(
  2192. `Unknown duration argument ${durationLike} of type ${typeof durationLike}`
  2193. );
  2194. }
  2195. }
  2196. static fromISO(text, opts) {
  2197. const [parsed] = parseISODuration(text);
  2198. if (parsed) {
  2199. return Duration.fromObject(parsed, opts);
  2200. } else {
  2201. return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
  2202. }
  2203. }
  2204. static fromISOTime(text, opts) {
  2205. const [parsed] = parseISOTimeOnly(text);
  2206. if (parsed) {
  2207. return Duration.fromObject(parsed, opts);
  2208. } else {
  2209. return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
  2210. }
  2211. }
  2212. static invalid(reason, explanation = null) {
  2213. if (!reason) {
  2214. throw new InvalidArgumentError("need to specify a reason the Duration is invalid");
  2215. }
  2216. const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
  2217. if (Settings.throwOnInvalid) {
  2218. throw new InvalidDurationError(invalid);
  2219. } else {
  2220. return new Duration({ invalid });
  2221. }
  2222. }
  2223. static normalizeUnit(unit) {
  2224. const normalized = {
  2225. year: "years",
  2226. years: "years",
  2227. quarter: "quarters",
  2228. quarters: "quarters",
  2229. month: "months",
  2230. months: "months",
  2231. week: "weeks",
  2232. weeks: "weeks",
  2233. day: "days",
  2234. days: "days",
  2235. hour: "hours",
  2236. hours: "hours",
  2237. minute: "minutes",
  2238. minutes: "minutes",
  2239. second: "seconds",
  2240. seconds: "seconds",
  2241. millisecond: "milliseconds",
  2242. milliseconds: "milliseconds"
  2243. }[unit ? unit.toLowerCase() : unit];
  2244. if (!normalized)
  2245. throw new InvalidUnitError(unit);
  2246. return normalized;
  2247. }
  2248. static isDuration(o3) {
  2249. return o3 && o3.isLuxonDuration || false;
  2250. }
  2251. get locale() {
  2252. return this.isValid ? this.loc.locale : null;
  2253. }
  2254. get numberingSystem() {
  2255. return this.isValid ? this.loc.numberingSystem : null;
  2256. }
  2257. toFormat(fmt, opts = {}) {
  2258. const fmtOpts = {
  2259. ...opts,
  2260. floor: opts.round !== false && opts.floor !== false
  2261. };
  2262. return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID;
  2263. }
  2264. toHuman(opts = {}) {
  2265. const l5 = orderedUnits.map((unit) => {
  2266. const val = this.values[unit];
  2267. if (isUndefined(val)) {
  2268. return null;
  2269. }
  2270. return this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...opts, unit: unit.slice(0, -1) }).format(val);
  2271. }).filter((n5) => n5);
  2272. return this.loc.listFormatter({ type: "conjunction", style: opts.listStyle || "narrow", ...opts }).format(l5);
  2273. }
  2274. toObject() {
  2275. if (!this.isValid)
  2276. return {};
  2277. return { ...this.values };
  2278. }
  2279. toISO() {
  2280. if (!this.isValid)
  2281. return null;
  2282. let s6 = "P";
  2283. if (this.years !== 0)
  2284. s6 += this.years + "Y";
  2285. if (this.months !== 0 || this.quarters !== 0)
  2286. s6 += this.months + this.quarters * 3 + "M";
  2287. if (this.weeks !== 0)
  2288. s6 += this.weeks + "W";
  2289. if (this.days !== 0)
  2290. s6 += this.days + "D";
  2291. if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)
  2292. s6 += "T";
  2293. if (this.hours !== 0)
  2294. s6 += this.hours + "H";
  2295. if (this.minutes !== 0)
  2296. s6 += this.minutes + "M";
  2297. if (this.seconds !== 0 || this.milliseconds !== 0)
  2298. s6 += roundTo(this.seconds + this.milliseconds / 1e3, 3) + "S";
  2299. if (s6 === "P")
  2300. s6 += "T0S";
  2301. return s6;
  2302. }
  2303. toISOTime(opts = {}) {
  2304. if (!this.isValid)
  2305. return null;
  2306. const millis = this.toMillis();
  2307. if (millis < 0 || millis >= 864e5)
  2308. return null;
  2309. opts = {
  2310. suppressMilliseconds: false,
  2311. suppressSeconds: false,
  2312. includePrefix: false,
  2313. format: "extended",
  2314. ...opts
  2315. };
  2316. const value = this.shiftTo("hours", "minutes", "seconds", "milliseconds");
  2317. let fmt = opts.format === "basic" ? "hhmm" : "hh:mm";
  2318. if (!opts.suppressSeconds || value.seconds !== 0 || value.milliseconds !== 0) {
  2319. fmt += opts.format === "basic" ? "ss" : ":ss";
  2320. if (!opts.suppressMilliseconds || value.milliseconds !== 0) {
  2321. fmt += ".SSS";
  2322. }
  2323. }
  2324. let str = value.toFormat(fmt);
  2325. if (opts.includePrefix) {
  2326. str = "T" + str;
  2327. }
  2328. return str;
  2329. }
  2330. toJSON() {
  2331. return this.toISO();
  2332. }
  2333. toString() {
  2334. return this.toISO();
  2335. }
  2336. toMillis() {
  2337. return this.as("milliseconds");
  2338. }
  2339. valueOf() {
  2340. return this.toMillis();
  2341. }
  2342. plus(duration) {
  2343. if (!this.isValid)
  2344. return this;
  2345. const dur = Duration.fromDurationLike(duration), result = {};
  2346. for (const k2 of orderedUnits) {
  2347. if (hasOwnProperty(dur.values, k2) || hasOwnProperty(this.values, k2)) {
  2348. result[k2] = dur.get(k2) + this.get(k2);
  2349. }
  2350. }
  2351. return clone(this, { values: result }, true);
  2352. }
  2353. minus(duration) {
  2354. if (!this.isValid)
  2355. return this;
  2356. const dur = Duration.fromDurationLike(duration);
  2357. return this.plus(dur.negate());
  2358. }
  2359. mapUnits(fn) {
  2360. if (!this.isValid)
  2361. return this;
  2362. const result = {};
  2363. for (const k2 of Object.keys(this.values)) {
  2364. result[k2] = asNumber(fn(this.values[k2], k2));
  2365. }
  2366. return clone(this, { values: result }, true);
  2367. }
  2368. get(unit) {
  2369. return this[Duration.normalizeUnit(unit)];
  2370. }
  2371. set(values) {
  2372. if (!this.isValid)
  2373. return this;
  2374. const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };
  2375. return clone(this, { values: mixed });
  2376. }
  2377. reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {
  2378. const loc = this.loc.clone({ locale, numberingSystem });
  2379. const opts = { loc, matrix, conversionAccuracy };
  2380. return clone(this, opts);
  2381. }
  2382. as(unit) {
  2383. return this.isValid ? this.shiftTo(unit).get(unit) : NaN;
  2384. }
  2385. normalize() {
  2386. if (!this.isValid)
  2387. return this;
  2388. const vals = this.toObject();
  2389. normalizeValues(this.matrix, vals);
  2390. return clone(this, { values: vals }, true);
  2391. }
  2392. shiftTo(...units) {
  2393. if (!this.isValid)
  2394. return this;
  2395. if (units.length === 0) {
  2396. return this;
  2397. }
  2398. units = units.map((u3) => Duration.normalizeUnit(u3));
  2399. const built = {}, accumulated = {}, vals = this.toObject();
  2400. let lastUnit;
  2401. for (const k2 of orderedUnits) {
  2402. if (units.indexOf(k2) >= 0) {
  2403. lastUnit = k2;
  2404. let own = 0;
  2405. for (const ak in accumulated) {
  2406. own += this.matrix[ak][k2] * accumulated[ak];
  2407. accumulated[ak] = 0;
  2408. }
  2409. if (isNumber(vals[k2])) {
  2410. own += vals[k2];
  2411. }
  2412. const i4 = Math.trunc(own);
  2413. built[k2] = i4;
  2414. accumulated[k2] = (own * 1e3 - i4 * 1e3) / 1e3;
  2415. for (const down in vals) {
  2416. if (orderedUnits.indexOf(down) > orderedUnits.indexOf(k2)) {
  2417. convert(this.matrix, vals, down, built, k2);
  2418. }
  2419. }
  2420. } else if (isNumber(vals[k2])) {
  2421. accumulated[k2] = vals[k2];
  2422. }
  2423. }
  2424. for (const key in accumulated) {
  2425. if (accumulated[key] !== 0) {
  2426. built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];
  2427. }
  2428. }
  2429. return clone(this, { values: built }, true).normalize();
  2430. }
  2431. negate() {
  2432. if (!this.isValid)
  2433. return this;
  2434. const negated = {};
  2435. for (const k2 of Object.keys(this.values)) {
  2436. negated[k2] = this.values[k2] === 0 ? 0 : -this.values[k2];
  2437. }
  2438. return clone(this, { values: negated }, true);
  2439. }
  2440. get years() {
  2441. return this.isValid ? this.values.years || 0 : NaN;
  2442. }
  2443. get quarters() {
  2444. return this.isValid ? this.values.quarters || 0 : NaN;
  2445. }
  2446. get months() {
  2447. return this.isValid ? this.values.months || 0 : NaN;
  2448. }
  2449. get weeks() {
  2450. return this.isValid ? this.values.weeks || 0 : NaN;
  2451. }
  2452. get days() {
  2453. return this.isValid ? this.values.days || 0 : NaN;
  2454. }
  2455. get hours() {
  2456. return this.isValid ? this.values.hours || 0 : NaN;
  2457. }
  2458. get minutes() {
  2459. return this.isValid ? this.values.minutes || 0 : NaN;
  2460. }
  2461. get seconds() {
  2462. return this.isValid ? this.values.seconds || 0 : NaN;
  2463. }
  2464. get milliseconds() {
  2465. return this.isValid ? this.values.milliseconds || 0 : NaN;
  2466. }
  2467. get isValid() {
  2468. return this.invalid === null;
  2469. }
  2470. get invalidReason() {
  2471. return this.invalid ? this.invalid.reason : null;
  2472. }
  2473. get invalidExplanation() {
  2474. return this.invalid ? this.invalid.explanation : null;
  2475. }
  2476. equals(other) {
  2477. if (!this.isValid || !other.isValid) {
  2478. return false;
  2479. }
  2480. if (!this.loc.equals(other.loc)) {
  2481. return false;
  2482. }
  2483. function eq(v1, v22) {
  2484. if (v1 === void 0 || v1 === 0)
  2485. return v22 === void 0 || v22 === 0;
  2486. return v1 === v22;
  2487. }
  2488. for (const u3 of orderedUnits) {
  2489. if (!eq(this.values[u3], other.values[u3])) {
  2490. return false;
  2491. }
  2492. }
  2493. return true;
  2494. }
  2495. };
  2496. // node_modules/luxon/src/interval.js
  2497. var INVALID2 = "Invalid Interval";
  2498. function validateStartEnd(start, end) {
  2499. if (!start || !start.isValid) {
  2500. return Interval.invalid("missing or invalid start");
  2501. } else if (!end || !end.isValid) {
  2502. return Interval.invalid("missing or invalid end");
  2503. } else if (end < start) {
  2504. return Interval.invalid(
  2505. "end before start",
  2506. `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`
  2507. );
  2508. } else {
  2509. return null;
  2510. }
  2511. }
  2512. var Interval = class {
  2513. constructor(config) {
  2514. this.s = config.start;
  2515. this.e = config.end;
  2516. this.invalid = config.invalid || null;
  2517. this.isLuxonInterval = true;
  2518. }
  2519. static invalid(reason, explanation = null) {
  2520. if (!reason) {
  2521. throw new InvalidArgumentError("need to specify a reason the Interval is invalid");
  2522. }
  2523. const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
  2524. if (Settings.throwOnInvalid) {
  2525. throw new InvalidIntervalError(invalid);
  2526. } else {
  2527. return new Interval({ invalid });
  2528. }
  2529. }
  2530. static fromDateTimes(start, end) {
  2531. const builtStart = friendlyDateTime(start), builtEnd = friendlyDateTime(end);
  2532. const validateError = validateStartEnd(builtStart, builtEnd);
  2533. if (validateError == null) {
  2534. return new Interval({
  2535. start: builtStart,
  2536. end: builtEnd
  2537. });
  2538. } else {
  2539. return validateError;
  2540. }
  2541. }
  2542. static after(start, duration) {
  2543. const dur = Duration.fromDurationLike(duration), dt = friendlyDateTime(start);
  2544. return Interval.fromDateTimes(dt, dt.plus(dur));
  2545. }
  2546. static before(end, duration) {
  2547. const dur = Duration.fromDurationLike(duration), dt = friendlyDateTime(end);
  2548. return Interval.fromDateTimes(dt.minus(dur), dt);
  2549. }
  2550. static fromISO(text, opts) {
  2551. const [s6, e3] = (text || "").split("/", 2);
  2552. if (s6 && e3) {
  2553. let start, startIsValid;
  2554. try {
  2555. start = DateTime.fromISO(s6, opts);
  2556. startIsValid = start.isValid;
  2557. } catch (e4) {
  2558. startIsValid = false;
  2559. }
  2560. let end, endIsValid;
  2561. try {
  2562. end = DateTime.fromISO(e3, opts);
  2563. endIsValid = end.isValid;
  2564. } catch (e4) {
  2565. endIsValid = false;
  2566. }
  2567. if (startIsValid && endIsValid) {
  2568. return Interval.fromDateTimes(start, end);
  2569. }
  2570. if (startIsValid) {
  2571. const dur = Duration.fromISO(e3, opts);
  2572. if (dur.isValid) {
  2573. return Interval.after(start, dur);
  2574. }
  2575. } else if (endIsValid) {
  2576. const dur = Duration.fromISO(s6, opts);
  2577. if (dur.isValid) {
  2578. return Interval.before(end, dur);
  2579. }
  2580. }
  2581. }
  2582. return Interval.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
  2583. }
  2584. static isInterval(o3) {
  2585. return o3 && o3.isLuxonInterval || false;
  2586. }
  2587. get start() {
  2588. return this.isValid ? this.s : null;
  2589. }
  2590. get end() {
  2591. return this.isValid ? this.e : null;
  2592. }
  2593. get isValid() {
  2594. return this.invalidReason === null;
  2595. }
  2596. get invalidReason() {
  2597. return this.invalid ? this.invalid.reason : null;
  2598. }
  2599. get invalidExplanation() {
  2600. return this.invalid ? this.invalid.explanation : null;
  2601. }
  2602. length(unit = "milliseconds") {
  2603. return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;
  2604. }
  2605. count(unit = "milliseconds") {
  2606. if (!this.isValid)
  2607. return NaN;
  2608. const start = this.start.startOf(unit), end = this.end.startOf(unit);
  2609. return Math.floor(end.diff(start, unit).get(unit)) + 1;
  2610. }
  2611. hasSame(unit) {
  2612. return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;
  2613. }
  2614. isEmpty() {
  2615. return this.s.valueOf() === this.e.valueOf();
  2616. }
  2617. isAfter(dateTime) {
  2618. if (!this.isValid)
  2619. return false;
  2620. return this.s > dateTime;
  2621. }
  2622. isBefore(dateTime) {
  2623. if (!this.isValid)
  2624. return false;
  2625. return this.e <= dateTime;
  2626. }
  2627. contains(dateTime) {
  2628. if (!this.isValid)
  2629. return false;
  2630. return this.s <= dateTime && this.e > dateTime;
  2631. }
  2632. set({ start, end } = {}) {
  2633. if (!this.isValid)
  2634. return this;
  2635. return Interval.fromDateTimes(start || this.s, end || this.e);
  2636. }
  2637. splitAt(...dateTimes) {
  2638. if (!this.isValid)
  2639. return [];
  2640. const sorted = dateTimes.map(friendlyDateTime).filter((d3) => this.contains(d3)).sort(), results = [];
  2641. let { s: s6 } = this, i4 = 0;
  2642. while (s6 < this.e) {
  2643. const added = sorted[i4] || this.e, next = +added > +this.e ? this.e : added;
  2644. results.push(Interval.fromDateTimes(s6, next));
  2645. s6 = next;
  2646. i4 += 1;
  2647. }
  2648. return results;
  2649. }
  2650. splitBy(duration) {
  2651. const dur = Duration.fromDurationLike(duration);
  2652. if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) {
  2653. return [];
  2654. }
  2655. let { s: s6 } = this, idx = 1, next;
  2656. const results = [];
  2657. while (s6 < this.e) {
  2658. const added = this.start.plus(dur.mapUnits((x) => x * idx));
  2659. next = +added > +this.e ? this.e : added;
  2660. results.push(Interval.fromDateTimes(s6, next));
  2661. s6 = next;
  2662. idx += 1;
  2663. }
  2664. return results;
  2665. }
  2666. divideEqually(numberOfParts) {
  2667. if (!this.isValid)
  2668. return [];
  2669. return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);
  2670. }
  2671. overlaps(other) {
  2672. return this.e > other.s && this.s < other.e;
  2673. }
  2674. abutsStart(other) {
  2675. if (!this.isValid)
  2676. return false;
  2677. return +this.e === +other.s;
  2678. }
  2679. abutsEnd(other) {
  2680. if (!this.isValid)
  2681. return false;
  2682. return +other.e === +this.s;
  2683. }
  2684. engulfs(other) {
  2685. if (!this.isValid)
  2686. return false;
  2687. return this.s <= other.s && this.e >= other.e;
  2688. }
  2689. equals(other) {
  2690. if (!this.isValid || !other.isValid) {
  2691. return false;
  2692. }
  2693. return this.s.equals(other.s) && this.e.equals(other.e);
  2694. }
  2695. intersection(other) {
  2696. if (!this.isValid)
  2697. return this;
  2698. const s6 = this.s > other.s ? this.s : other.s, e3 = this.e < other.e ? this.e : other.e;
  2699. if (s6 >= e3) {
  2700. return null;
  2701. } else {
  2702. return Interval.fromDateTimes(s6, e3);
  2703. }
  2704. }
  2705. union(other) {
  2706. if (!this.isValid)
  2707. return this;
  2708. const s6 = this.s < other.s ? this.s : other.s, e3 = this.e > other.e ? this.e : other.e;
  2709. return Interval.fromDateTimes(s6, e3);
  2710. }
  2711. static merge(intervals) {
  2712. const [found, final] = intervals.sort((a2, b2) => a2.s - b2.s).reduce(
  2713. ([sofar, current], item) => {
  2714. if (!current) {
  2715. return [sofar, item];
  2716. } else if (current.overlaps(item) || current.abutsStart(item)) {
  2717. return [sofar, current.union(item)];
  2718. } else {
  2719. return [sofar.concat([current]), item];
  2720. }
  2721. },
  2722. [[], null]
  2723. );
  2724. if (final) {
  2725. found.push(final);
  2726. }
  2727. return found;
  2728. }
  2729. static xor(intervals) {
  2730. let start = null, currentCount = 0;
  2731. const results = [], ends = intervals.map((i4) => [
  2732. { time: i4.s, type: "s" },
  2733. { time: i4.e, type: "e" }
  2734. ]), flattened = Array.prototype.concat(...ends), arr = flattened.sort((a2, b2) => a2.time - b2.time);
  2735. for (const i4 of arr) {
  2736. currentCount += i4.type === "s" ? 1 : -1;
  2737. if (currentCount === 1) {
  2738. start = i4.time;
  2739. } else {
  2740. if (start && +start !== +i4.time) {
  2741. results.push(Interval.fromDateTimes(start, i4.time));
  2742. }
  2743. start = null;
  2744. }
  2745. }
  2746. return Interval.merge(results);
  2747. }
  2748. difference(...intervals) {
  2749. return Interval.xor([this].concat(intervals)).map((i4) => this.intersection(i4)).filter((i4) => i4 && !i4.isEmpty());
  2750. }
  2751. toString() {
  2752. if (!this.isValid)
  2753. return INVALID2;
  2754. return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`;
  2755. }
  2756. toISO(opts) {
  2757. if (!this.isValid)
  2758. return INVALID2;
  2759. return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;
  2760. }
  2761. toISODate() {
  2762. if (!this.isValid)
  2763. return INVALID2;
  2764. return `${this.s.toISODate()}/${this.e.toISODate()}`;
  2765. }
  2766. toISOTime(opts) {
  2767. if (!this.isValid)
  2768. return INVALID2;
  2769. return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;
  2770. }
  2771. toFormat(dateFormat, { separator = " \u2013 " } = {}) {
  2772. if (!this.isValid)
  2773. return INVALID2;
  2774. return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;
  2775. }
  2776. toDuration(unit, opts) {
  2777. if (!this.isValid) {
  2778. return Duration.invalid(this.invalidReason);
  2779. }
  2780. return this.e.diff(this.s, unit, opts);
  2781. }
  2782. mapEndpoints(mapFn) {
  2783. return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));
  2784. }
  2785. };
  2786. // node_modules/luxon/src/info.js
  2787. var Info = class {
  2788. static hasDST(zone = Settings.defaultZone) {
  2789. const proto = DateTime.now().setZone(zone).set({ month: 12 });
  2790. return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;
  2791. }
  2792. static isValidIANAZone(zone) {
  2793. return IANAZone.isValidZone(zone);
  2794. }
  2795. static normalizeZone(input) {
  2796. return normalizeZone(input, Settings.defaultZone);
  2797. }
  2798. static months(length = "long", { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) {
  2799. return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);
  2800. }
  2801. static monthsFormat(length = "long", { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) {
  2802. return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);
  2803. }
  2804. static weekdays(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) {
  2805. return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);
  2806. }
  2807. static weekdaysFormat(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) {
  2808. return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);
  2809. }
  2810. static meridiems({ locale = null } = {}) {
  2811. return Locale.create(locale).meridiems();
  2812. }
  2813. static eras(length = "short", { locale = null } = {}) {
  2814. return Locale.create(locale, null, "gregory").eras(length);
  2815. }
  2816. static features() {
  2817. return { relative: hasRelative() };
  2818. }
  2819. };
  2820. // node_modules/luxon/src/impl/diff.js
  2821. function dayDiff(earlier, later) {
  2822. const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf("day").valueOf(), ms = utcDayStart(later) - utcDayStart(earlier);
  2823. return Math.floor(Duration.fromMillis(ms).as("days"));
  2824. }
  2825. function highOrderDiffs(cursor, later, units) {
  2826. const differs = [
  2827. ["years", (a2, b2) => b2.year - a2.year],
  2828. ["quarters", (a2, b2) => b2.quarter - a2.quarter + (b2.year - a2.year) * 4],
  2829. ["months", (a2, b2) => b2.month - a2.month + (b2.year - a2.year) * 12],
  2830. [
  2831. "weeks",
  2832. (a2, b2) => {
  2833. const days = dayDiff(a2, b2);
  2834. return (days - days % 7) / 7;
  2835. }
  2836. ],
  2837. ["days", dayDiff]
  2838. ];
  2839. const results = {};
  2840. let lowestOrder, highWater;
  2841. for (const [unit, differ] of differs) {
  2842. if (units.indexOf(unit) >= 0) {
  2843. lowestOrder = unit;
  2844. let delta = differ(cursor, later);
  2845. highWater = cursor.plus({ [unit]: delta });
  2846. if (highWater > later) {
  2847. cursor = cursor.plus({ [unit]: delta - 1 });
  2848. delta -= 1;
  2849. } else {
  2850. cursor = highWater;
  2851. }
  2852. results[unit] = delta;
  2853. }
  2854. }
  2855. return [cursor, results, highWater, lowestOrder];
  2856. }
  2857. function diff_default(earlier, later, units, opts) {
  2858. let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);
  2859. const remainingMillis = later - cursor;
  2860. const lowerOrderUnits = units.filter(
  2861. (u3) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u3) >= 0
  2862. );
  2863. if (lowerOrderUnits.length === 0) {
  2864. if (highWater < later) {
  2865. highWater = cursor.plus({ [lowestOrder]: 1 });
  2866. }
  2867. if (highWater !== cursor) {
  2868. results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);
  2869. }
  2870. }
  2871. const duration = Duration.fromObject(results, opts);
  2872. if (lowerOrderUnits.length > 0) {
  2873. return Duration.fromMillis(remainingMillis, opts).shiftTo(...lowerOrderUnits).plus(duration);
  2874. } else {
  2875. return duration;
  2876. }
  2877. }
  2878. // node_modules/luxon/src/impl/digits.js
  2879. var numberingSystems = {
  2880. arab: "[\u0660-\u0669]",
  2881. arabext: "[\u06F0-\u06F9]",
  2882. bali: "[\u1B50-\u1B59]",
  2883. beng: "[\u09E6-\u09EF]",
  2884. deva: "[\u0966-\u096F]",
  2885. fullwide: "[\uFF10-\uFF19]",
  2886. gujr: "[\u0AE6-\u0AEF]",
  2887. hanidec: "[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",
  2888. khmr: "[\u17E0-\u17E9]",
  2889. knda: "[\u0CE6-\u0CEF]",
  2890. laoo: "[\u0ED0-\u0ED9]",
  2891. limb: "[\u1946-\u194F]",
  2892. mlym: "[\u0D66-\u0D6F]",
  2893. mong: "[\u1810-\u1819]",
  2894. mymr: "[\u1040-\u1049]",
  2895. orya: "[\u0B66-\u0B6F]",
  2896. tamldec: "[\u0BE6-\u0BEF]",
  2897. telu: "[\u0C66-\u0C6F]",
  2898. thai: "[\u0E50-\u0E59]",
  2899. tibt: "[\u0F20-\u0F29]",
  2900. latn: "\\d"
  2901. };
  2902. var numberingSystemsUTF16 = {
  2903. arab: [1632, 1641],
  2904. arabext: [1776, 1785],
  2905. bali: [6992, 7001],
  2906. beng: [2534, 2543],
  2907. deva: [2406, 2415],
  2908. fullwide: [65296, 65303],
  2909. gujr: [2790, 2799],
  2910. khmr: [6112, 6121],
  2911. knda: [3302, 3311],
  2912. laoo: [3792, 3801],
  2913. limb: [6470, 6479],
  2914. mlym: [3430, 3439],
  2915. mong: [6160, 6169],
  2916. mymr: [4160, 4169],
  2917. orya: [2918, 2927],
  2918. tamldec: [3046, 3055],
  2919. telu: [3174, 3183],
  2920. thai: [3664, 3673],
  2921. tibt: [3872, 3881]
  2922. };
  2923. var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split("");
  2924. function parseDigits(str) {
  2925. let value = parseInt(str, 10);
  2926. if (isNaN(value)) {
  2927. value = "";
  2928. for (let i4 = 0; i4 < str.length; i4++) {
  2929. const code = str.charCodeAt(i4);
  2930. if (str[i4].search(numberingSystems.hanidec) !== -1) {
  2931. value += hanidecChars.indexOf(str[i4]);
  2932. } else {
  2933. for (const key in numberingSystemsUTF16) {
  2934. const [min, max] = numberingSystemsUTF16[key];
  2935. if (code >= min && code <= max) {
  2936. value += code - min;
  2937. }
  2938. }
  2939. }
  2940. }
  2941. return parseInt(value, 10);
  2942. } else {
  2943. return value;
  2944. }
  2945. }
  2946. function digitRegex({ numberingSystem }, append = "") {
  2947. return new RegExp(`${numberingSystems[numberingSystem || "latn"]}${append}`);
  2948. }
  2949. // node_modules/luxon/src/impl/tokenParser.js
  2950. var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support";
  2951. function intUnit(regex, post = (i4) => i4) {
  2952. return { regex, deser: ([s6]) => post(parseDigits(s6)) };
  2953. }
  2954. var NBSP = String.fromCharCode(160);
  2955. var spaceOrNBSP = `[ ${NBSP}]`;
  2956. var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
  2957. function fixListRegex(s6) {
  2958. return s6.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
  2959. }
  2960. function stripInsensitivities(s6) {
  2961. return s6.replace(/\./g, "").replace(spaceOrNBSPRegExp, " ").toLowerCase();
  2962. }
  2963. function oneOf(strings, startIndex) {
  2964. if (strings === null) {
  2965. return null;
  2966. } else {
  2967. return {
  2968. regex: RegExp(strings.map(fixListRegex).join("|")),
  2969. deser: ([s6]) => strings.findIndex((i4) => stripInsensitivities(s6) === stripInsensitivities(i4)) + startIndex
  2970. };
  2971. }
  2972. }
  2973. function offset(regex, groups) {
  2974. return { regex, deser: ([, h3, m3]) => signedOffset(h3, m3), groups };
  2975. }
  2976. function simple(regex) {
  2977. return { regex, deser: ([s6]) => s6 };
  2978. }
  2979. function escapeToken(value) {
  2980. return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
  2981. }
  2982. function unitForToken(token, loc) {
  2983. 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: ([s6]) => s6, literal: true }), unitate = (t5) => {
  2984. if (token.literal) {
  2985. return literal(t5);
  2986. }
  2987. switch (t5.val) {
  2988. case "G":
  2989. return oneOf(loc.eras("short", false), 0);
  2990. case "GG":
  2991. return oneOf(loc.eras("long", false), 0);
  2992. case "y":
  2993. return intUnit(oneToSix);
  2994. case "yy":
  2995. return intUnit(twoToFour, untruncateYear);
  2996. case "yyyy":
  2997. return intUnit(four);
  2998. case "yyyyy":
  2999. return intUnit(fourToSix);
  3000. case "yyyyyy":
  3001. return intUnit(six);
  3002. case "M":
  3003. return intUnit(oneOrTwo);
  3004. case "MM":
  3005. return intUnit(two);
  3006. case "MMM":
  3007. return oneOf(loc.months("short", true, false), 1);
  3008. case "MMMM":
  3009. return oneOf(loc.months("long", true, false), 1);
  3010. case "L":
  3011. return intUnit(oneOrTwo);
  3012. case "LL":
  3013. return intUnit(two);
  3014. case "LLL":
  3015. return oneOf(loc.months("short", false, false), 1);
  3016. case "LLLL":
  3017. return oneOf(loc.months("long", false, false), 1);
  3018. case "d":
  3019. return intUnit(oneOrTwo);
  3020. case "dd":
  3021. return intUnit(two);
  3022. case "o":
  3023. return intUnit(oneToThree);
  3024. case "ooo":
  3025. return intUnit(three);
  3026. case "HH":
  3027. return intUnit(two);
  3028. case "H":
  3029. return intUnit(oneOrTwo);
  3030. case "hh":
  3031. return intUnit(two);
  3032. case "h":
  3033. return intUnit(oneOrTwo);
  3034. case "mm":
  3035. return intUnit(two);
  3036. case "m":
  3037. return intUnit(oneOrTwo);
  3038. case "q":
  3039. return intUnit(oneOrTwo);
  3040. case "qq":
  3041. return intUnit(two);
  3042. case "s":
  3043. return intUnit(oneOrTwo);
  3044. case "ss":
  3045. return intUnit(two);
  3046. case "S":
  3047. return intUnit(oneToThree);
  3048. case "SSS":
  3049. return intUnit(three);
  3050. case "u":
  3051. return simple(oneToNine);
  3052. case "uu":
  3053. return simple(oneOrTwo);
  3054. case "uuu":
  3055. return intUnit(one);
  3056. case "a":
  3057. return oneOf(loc.meridiems(), 0);
  3058. case "kkkk":
  3059. return intUnit(four);
  3060. case "kk":
  3061. return intUnit(twoToFour, untruncateYear);
  3062. case "W":
  3063. return intUnit(oneOrTwo);
  3064. case "WW":
  3065. return intUnit(two);
  3066. case "E":
  3067. case "c":
  3068. return intUnit(one);
  3069. case "EEE":
  3070. return oneOf(loc.weekdays("short", false, false), 1);
  3071. case "EEEE":
  3072. return oneOf(loc.weekdays("long", false, false), 1);
  3073. case "ccc":
  3074. return oneOf(loc.weekdays("short", true, false), 1);
  3075. case "cccc":
  3076. return oneOf(loc.weekdays("long", true, false), 1);
  3077. case "Z":
  3078. case "ZZ":
  3079. return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);
  3080. case "ZZZ":
  3081. return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);
  3082. case "z":
  3083. return simple(/[a-z_+-/]{1,256}?/i);
  3084. default:
  3085. return literal(t5);
  3086. }
  3087. };
  3088. const unit = unitate(token) || {
  3089. invalidReason: MISSING_FTP
  3090. };
  3091. unit.token = token;
  3092. return unit;
  3093. }
  3094. var partTypeStyleToTokenVal = {
  3095. year: {
  3096. "2-digit": "yy",
  3097. numeric: "yyyyy"
  3098. },
  3099. month: {
  3100. numeric: "M",
  3101. "2-digit": "MM",
  3102. short: "MMM",
  3103. long: "MMMM"
  3104. },
  3105. day: {
  3106. numeric: "d",
  3107. "2-digit": "dd"
  3108. },
  3109. weekday: {
  3110. short: "EEE",
  3111. long: "EEEE"
  3112. },
  3113. dayperiod: "a",
  3114. dayPeriod: "a",
  3115. hour: {
  3116. numeric: "h",
  3117. "2-digit": "hh"
  3118. },
  3119. minute: {
  3120. numeric: "m",
  3121. "2-digit": "mm"
  3122. },
  3123. second: {
  3124. numeric: "s",
  3125. "2-digit": "ss"
  3126. },
  3127. timeZoneName: {
  3128. long: "ZZZZZ",
  3129. short: "ZZZ"
  3130. }
  3131. };
  3132. function tokenForPart(part, locale, formatOpts) {
  3133. const { type, value } = part;
  3134. if (type === "literal") {
  3135. return {
  3136. literal: true,
  3137. val: value
  3138. };
  3139. }
  3140. const style = formatOpts[type];
  3141. let val = partTypeStyleToTokenVal[type];
  3142. if (typeof val === "object") {
  3143. val = val[style];
  3144. }
  3145. if (val) {
  3146. return {
  3147. literal: false,
  3148. val
  3149. };
  3150. }
  3151. return void 0;
  3152. }
  3153. function buildRegex(units) {
  3154. const re2 = units.map((u3) => u3.regex).reduce((f2, r3) => `${f2}(${r3.source})`, "");
  3155. return [`^${re2}$`, units];
  3156. }
  3157. function match(input, regex, handlers) {
  3158. const matches = input.match(regex);
  3159. if (matches) {
  3160. const all = {};
  3161. let matchIndex = 1;
  3162. for (const i4 in handlers) {
  3163. if (hasOwnProperty(handlers, i4)) {
  3164. const h3 = handlers[i4], groups = h3.groups ? h3.groups + 1 : 1;
  3165. if (!h3.literal && h3.token) {
  3166. all[h3.token.val[0]] = h3.deser(matches.slice(matchIndex, matchIndex + groups));
  3167. }
  3168. matchIndex += groups;
  3169. }
  3170. }
  3171. return [matches, all];
  3172. } else {
  3173. return [matches, {}];
  3174. }
  3175. }
  3176. function dateTimeFromMatches(matches) {
  3177. const toField = (token) => {
  3178. switch (token) {
  3179. case "S":
  3180. return "millisecond";
  3181. case "s":
  3182. return "second";
  3183. case "m":
  3184. return "minute";
  3185. case "h":
  3186. case "H":
  3187. return "hour";
  3188. case "d":
  3189. return "day";
  3190. case "o":
  3191. return "ordinal";
  3192. case "L":
  3193. case "M":
  3194. return "month";
  3195. case "y":
  3196. return "year";
  3197. case "E":
  3198. case "c":
  3199. return "weekday";
  3200. case "W":
  3201. return "weekNumber";
  3202. case "k":
  3203. return "weekYear";
  3204. case "q":
  3205. return "quarter";
  3206. default:
  3207. return null;
  3208. }
  3209. };
  3210. let zone = null;
  3211. let specificOffset;
  3212. if (!isUndefined(matches.z)) {
  3213. zone = IANAZone.create(matches.z);
  3214. }
  3215. if (!isUndefined(matches.Z)) {
  3216. if (!zone) {
  3217. zone = new FixedOffsetZone(matches.Z);
  3218. }
  3219. specificOffset = matches.Z;
  3220. }
  3221. if (!isUndefined(matches.q)) {
  3222. matches.M = (matches.q - 1) * 3 + 1;
  3223. }
  3224. if (!isUndefined(matches.h)) {
  3225. if (matches.h < 12 && matches.a === 1) {
  3226. matches.h += 12;
  3227. } else if (matches.h === 12 && matches.a === 0) {
  3228. matches.h = 0;
  3229. }
  3230. }
  3231. if (matches.G === 0 && matches.y) {
  3232. matches.y = -matches.y;
  3233. }
  3234. if (!isUndefined(matches.u)) {
  3235. matches.S = parseMillis(matches.u);
  3236. }
  3237. const vals = Object.keys(matches).reduce((r3, k2) => {
  3238. const f2 = toField(k2);
  3239. if (f2) {
  3240. r3[f2] = matches[k2];
  3241. }
  3242. return r3;
  3243. }, {});
  3244. return [vals, zone, specificOffset];
  3245. }
  3246. var dummyDateTimeCache = null;
  3247. function getDummyDateTime() {
  3248. if (!dummyDateTimeCache) {
  3249. dummyDateTimeCache = DateTime.fromMillis(1555555555555);
  3250. }
  3251. return dummyDateTimeCache;
  3252. }
  3253. function maybeExpandMacroToken(token, locale) {
  3254. if (token.literal) {
  3255. return token;
  3256. }
  3257. const formatOpts = Formatter.macroTokenToFormatOpts(token.val);
  3258. const tokens = formatOptsToTokens(formatOpts, locale);
  3259. if (tokens == null || tokens.includes(void 0)) {
  3260. return token;
  3261. }
  3262. return tokens;
  3263. }
  3264. function expandMacroTokens(tokens, locale) {
  3265. return Array.prototype.concat(...tokens.map((t5) => maybeExpandMacroToken(t5, locale)));
  3266. }
  3267. function explainFromTokens(locale, input, format) {
  3268. const tokens = expandMacroTokens(Formatter.parseFormat(format), locale), units = tokens.map((t5) => unitForToken(t5, locale)), disqualifyingUnit = units.find((t5) => t5.invalidReason);
  3269. if (disqualifyingUnit) {
  3270. return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };
  3271. } else {
  3272. 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];
  3273. if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) {
  3274. throw new ConflictingSpecificationError(
  3275. "Can't include meridiem when specifying 24-hour format"
  3276. );
  3277. }
  3278. return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };
  3279. }
  3280. }
  3281. function parseFromTokens(locale, input, format) {
  3282. const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);
  3283. return [result, zone, specificOffset, invalidReason];
  3284. }
  3285. function formatOptsToTokens(formatOpts, locale) {
  3286. if (!formatOpts) {
  3287. return null;
  3288. }
  3289. const formatter = Formatter.create(locale, formatOpts);
  3290. const parts = formatter.formatDateTimeParts(getDummyDateTime());
  3291. return parts.map((p5) => tokenForPart(p5, locale, formatOpts));
  3292. }
  3293. // node_modules/luxon/src/impl/conversions.js
  3294. var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
  3295. var leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
  3296. function unitOutOfRange(unit, value) {
  3297. return new Invalid(
  3298. "unit out of range",
  3299. `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`
  3300. );
  3301. }
  3302. function dayOfWeek(year, month, day) {
  3303. const d3 = new Date(Date.UTC(year, month - 1, day));
  3304. if (year < 100 && year >= 0) {
  3305. d3.setUTCFullYear(d3.getUTCFullYear() - 1900);
  3306. }
  3307. const js = d3.getUTCDay();
  3308. return js === 0 ? 7 : js;
  3309. }
  3310. function computeOrdinal(year, month, day) {
  3311. return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];
  3312. }
  3313. function uncomputeOrdinal(year, ordinal) {
  3314. const table = isLeapYear(year) ? leapLadder : nonLeapLadder, month0 = table.findIndex((i4) => i4 < ordinal), day = ordinal - table[month0];
  3315. return { month: month0 + 1, day };
  3316. }
  3317. function gregorianToWeek(gregObj) {
  3318. const { year, month, day } = gregObj, ordinal = computeOrdinal(year, month, day), weekday = dayOfWeek(year, month, day);
  3319. let weekNumber = Math.floor((ordinal - weekday + 10) / 7), weekYear;
  3320. if (weekNumber < 1) {
  3321. weekYear = year - 1;
  3322. weekNumber = weeksInWeekYear(weekYear);
  3323. } else if (weekNumber > weeksInWeekYear(year)) {
  3324. weekYear = year + 1;
  3325. weekNumber = 1;
  3326. } else {
  3327. weekYear = year;
  3328. }
  3329. return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };
  3330. }
  3331. function weekToGregorian(weekData) {
  3332. const { weekYear, weekNumber, weekday } = weekData, weekdayOfJan4 = dayOfWeek(weekYear, 1, 4), yearInDays = daysInYear(weekYear);
  3333. let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 3, year;
  3334. if (ordinal < 1) {
  3335. year = weekYear - 1;
  3336. ordinal += daysInYear(year);
  3337. } else if (ordinal > yearInDays) {
  3338. year = weekYear + 1;
  3339. ordinal -= daysInYear(weekYear);
  3340. } else {
  3341. year = weekYear;
  3342. }
  3343. const { month, day } = uncomputeOrdinal(year, ordinal);
  3344. return { year, month, day, ...timeObject(weekData) };
  3345. }
  3346. function gregorianToOrdinal(gregData) {
  3347. const { year, month, day } = gregData;
  3348. const ordinal = computeOrdinal(year, month, day);
  3349. return { year, ordinal, ...timeObject(gregData) };
  3350. }
  3351. function ordinalToGregorian(ordinalData) {
  3352. const { year, ordinal } = ordinalData;
  3353. const { month, day } = uncomputeOrdinal(year, ordinal);
  3354. return { year, month, day, ...timeObject(ordinalData) };
  3355. }
  3356. function hasInvalidWeekData(obj) {
  3357. const validYear = isInteger(obj.weekYear), validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear)), validWeekday = integerBetween(obj.weekday, 1, 7);
  3358. if (!validYear) {
  3359. return unitOutOfRange("weekYear", obj.weekYear);
  3360. } else if (!validWeek) {
  3361. return unitOutOfRange("week", obj.week);
  3362. } else if (!validWeekday) {
  3363. return unitOutOfRange("weekday", obj.weekday);
  3364. } else
  3365. return false;
  3366. }
  3367. function hasInvalidOrdinalData(obj) {
  3368. const validYear = isInteger(obj.year), validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));
  3369. if (!validYear) {
  3370. return unitOutOfRange("year", obj.year);
  3371. } else if (!validOrdinal) {
  3372. return unitOutOfRange("ordinal", obj.ordinal);
  3373. } else
  3374. return false;
  3375. }
  3376. function hasInvalidGregorianData(obj) {
  3377. const validYear = isInteger(obj.year), validMonth = integerBetween(obj.month, 1, 12), validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));
  3378. if (!validYear) {
  3379. return unitOutOfRange("year", obj.year);
  3380. } else if (!validMonth) {
  3381. return unitOutOfRange("month", obj.month);
  3382. } else if (!validDay) {
  3383. return unitOutOfRange("day", obj.day);
  3384. } else
  3385. return false;
  3386. }
  3387. function hasInvalidTimeData(obj) {
  3388. const { hour, minute, second, millisecond } = obj;
  3389. 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);
  3390. if (!validHour) {
  3391. return unitOutOfRange("hour", hour);
  3392. } else if (!validMinute) {
  3393. return unitOutOfRange("minute", minute);
  3394. } else if (!validSecond) {
  3395. return unitOutOfRange("second", second);
  3396. } else if (!validMillisecond) {
  3397. return unitOutOfRange("millisecond", millisecond);
  3398. } else
  3399. return false;
  3400. }
  3401. // node_modules/luxon/src/datetime.js
  3402. var INVALID3 = "Invalid DateTime";
  3403. var MAX_DATE = 864e13;
  3404. function unsupportedZone(zone) {
  3405. return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`);
  3406. }
  3407. function possiblyCachedWeekData(dt) {
  3408. if (dt.weekData === null) {
  3409. dt.weekData = gregorianToWeek(dt.c);
  3410. }
  3411. return dt.weekData;
  3412. }
  3413. function clone2(inst, alts) {
  3414. const current = {
  3415. ts: inst.ts,
  3416. zone: inst.zone,
  3417. c: inst.c,
  3418. o: inst.o,
  3419. loc: inst.loc,
  3420. invalid: inst.invalid
  3421. };
  3422. return new DateTime({ ...current, ...alts, old: current });
  3423. }
  3424. function fixOffset(localTS, o3, tz) {
  3425. let utcGuess = localTS - o3 * 60 * 1e3;
  3426. const o22 = tz.offset(utcGuess);
  3427. if (o3 === o22) {
  3428. return [utcGuess, o3];
  3429. }
  3430. utcGuess -= (o22 - o3) * 60 * 1e3;
  3431. const o32 = tz.offset(utcGuess);
  3432. if (o22 === o32) {
  3433. return [utcGuess, o22];
  3434. }
  3435. return [localTS - Math.min(o22, o32) * 60 * 1e3, Math.max(o22, o32)];
  3436. }
  3437. function tsToObj(ts, offset2) {
  3438. ts += offset2 * 60 * 1e3;
  3439. const d3 = new Date(ts);
  3440. return {
  3441. year: d3.getUTCFullYear(),
  3442. month: d3.getUTCMonth() + 1,
  3443. day: d3.getUTCDate(),
  3444. hour: d3.getUTCHours(),
  3445. minute: d3.getUTCMinutes(),
  3446. second: d3.getUTCSeconds(),
  3447. millisecond: d3.getUTCMilliseconds()
  3448. };
  3449. }
  3450. function objToTS(obj, offset2, zone) {
  3451. return fixOffset(objToLocalTS(obj), offset2, zone);
  3452. }
  3453. function adjustTime(inst, dur) {
  3454. 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, c3 = {
  3455. ...inst.c,
  3456. year,
  3457. month,
  3458. day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
  3459. }, millisToAdd = Duration.fromObject({
  3460. years: dur.years - Math.trunc(dur.years),
  3461. quarters: dur.quarters - Math.trunc(dur.quarters),
  3462. months: dur.months - Math.trunc(dur.months),
  3463. weeks: dur.weeks - Math.trunc(dur.weeks),
  3464. days: dur.days - Math.trunc(dur.days),
  3465. hours: dur.hours,
  3466. minutes: dur.minutes,
  3467. seconds: dur.seconds,
  3468. milliseconds: dur.milliseconds
  3469. }).as("milliseconds"), localTS = objToLocalTS(c3);
  3470. let [ts, o3] = fixOffset(localTS, oPre, inst.zone);
  3471. if (millisToAdd !== 0) {
  3472. ts += millisToAdd;
  3473. o3 = inst.zone.offset(ts);
  3474. }
  3475. return { ts, o: o3 };
  3476. }
  3477. function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {
  3478. const { setZone, zone } = opts;
  3479. if (parsed && Object.keys(parsed).length !== 0) {
  3480. const interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, {
  3481. ...opts,
  3482. zone: interpretationZone,
  3483. specificOffset
  3484. });
  3485. return setZone ? inst : inst.setZone(zone);
  3486. } else {
  3487. return DateTime.invalid(
  3488. new Invalid("unparsable", `the input "${text}" can't be parsed as ${format}`)
  3489. );
  3490. }
  3491. }
  3492. function toTechFormat(dt, format, allowZ = true) {
  3493. return dt.isValid ? Formatter.create(Locale.create("en-US"), {
  3494. allowZ,
  3495. forceSimple: true
  3496. }).formatDateTimeFromString(dt, format) : null;
  3497. }
  3498. function toISODate(o3, extended) {
  3499. const longFormat = o3.c.year > 9999 || o3.c.year < 0;
  3500. let c3 = "";
  3501. if (longFormat && o3.c.year >= 0)
  3502. c3 += "+";
  3503. c3 += padStart(o3.c.year, longFormat ? 6 : 4);
  3504. if (extended) {
  3505. c3 += "-";
  3506. c3 += padStart(o3.c.month);
  3507. c3 += "-";
  3508. c3 += padStart(o3.c.day);
  3509. } else {
  3510. c3 += padStart(o3.c.month);
  3511. c3 += padStart(o3.c.day);
  3512. }
  3513. return c3;
  3514. }
  3515. function toISOTime(o3, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) {
  3516. let c3 = padStart(o3.c.hour);
  3517. if (extended) {
  3518. c3 += ":";
  3519. c3 += padStart(o3.c.minute);
  3520. if (o3.c.second !== 0 || !suppressSeconds) {
  3521. c3 += ":";
  3522. }
  3523. } else {
  3524. c3 += padStart(o3.c.minute);
  3525. }
  3526. if (o3.c.second !== 0 || !suppressSeconds) {
  3527. c3 += padStart(o3.c.second);
  3528. if (o3.c.millisecond !== 0 || !suppressMilliseconds) {
  3529. c3 += ".";
  3530. c3 += padStart(o3.c.millisecond, 3);
  3531. }
  3532. }
  3533. if (includeOffset) {
  3534. if (o3.isOffsetFixed && o3.offset === 0 && !extendedZone) {
  3535. c3 += "Z";
  3536. } else if (o3.o < 0) {
  3537. c3 += "-";
  3538. c3 += padStart(Math.trunc(-o3.o / 60));
  3539. c3 += ":";
  3540. c3 += padStart(Math.trunc(-o3.o % 60));
  3541. } else {
  3542. c3 += "+";
  3543. c3 += padStart(Math.trunc(o3.o / 60));
  3544. c3 += ":";
  3545. c3 += padStart(Math.trunc(o3.o % 60));
  3546. }
  3547. }
  3548. if (extendedZone) {
  3549. c3 += "[" + o3.zone.ianaName + "]";
  3550. }
  3551. return c3;
  3552. }
  3553. var defaultUnitValues = {
  3554. month: 1,
  3555. day: 1,
  3556. hour: 0,
  3557. minute: 0,
  3558. second: 0,
  3559. millisecond: 0
  3560. };
  3561. var defaultWeekUnitValues = {
  3562. weekNumber: 1,
  3563. weekday: 1,
  3564. hour: 0,
  3565. minute: 0,
  3566. second: 0,
  3567. millisecond: 0
  3568. };
  3569. var defaultOrdinalUnitValues = {
  3570. ordinal: 1,
  3571. hour: 0,
  3572. minute: 0,
  3573. second: 0,
  3574. millisecond: 0
  3575. };
  3576. var orderedUnits2 = ["year", "month", "day", "hour", "minute", "second", "millisecond"];
  3577. var orderedWeekUnits = [
  3578. "weekYear",
  3579. "weekNumber",
  3580. "weekday",
  3581. "hour",
  3582. "minute",
  3583. "second",
  3584. "millisecond"
  3585. ];
  3586. var orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
  3587. function normalizeUnit(unit) {
  3588. const normalized = {
  3589. year: "year",
  3590. years: "year",
  3591. month: "month",
  3592. months: "month",
  3593. day: "day",
  3594. days: "day",
  3595. hour: "hour",
  3596. hours: "hour",
  3597. minute: "minute",
  3598. minutes: "minute",
  3599. quarter: "quarter",
  3600. quarters: "quarter",
  3601. second: "second",
  3602. seconds: "second",
  3603. millisecond: "millisecond",
  3604. milliseconds: "millisecond",
  3605. weekday: "weekday",
  3606. weekdays: "weekday",
  3607. weeknumber: "weekNumber",
  3608. weeksnumber: "weekNumber",
  3609. weeknumbers: "weekNumber",
  3610. weekyear: "weekYear",
  3611. weekyears: "weekYear",
  3612. ordinal: "ordinal"
  3613. }[unit.toLowerCase()];
  3614. if (!normalized)
  3615. throw new InvalidUnitError(unit);
  3616. return normalized;
  3617. }
  3618. function quickDT(obj, opts) {
  3619. const zone = normalizeZone(opts.zone, Settings.defaultZone), loc = Locale.fromObject(opts), tsNow = Settings.now();
  3620. let ts, o3;
  3621. if (!isUndefined(obj.year)) {
  3622. for (const u3 of orderedUnits2) {
  3623. if (isUndefined(obj[u3])) {
  3624. obj[u3] = defaultUnitValues[u3];
  3625. }
  3626. }
  3627. const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);
  3628. if (invalid) {
  3629. return DateTime.invalid(invalid);
  3630. }
  3631. const offsetProvis = zone.offset(tsNow);
  3632. [ts, o3] = objToTS(obj, offsetProvis, zone);
  3633. } else {
  3634. ts = tsNow;
  3635. }
  3636. return new DateTime({ ts, zone, loc, o: o3 });
  3637. }
  3638. function diffRelative(start, end, opts) {
  3639. const round = isUndefined(opts.round) ? true : opts.round, format = (c3, unit) => {
  3640. c3 = roundTo(c3, round || opts.calendary ? 0 : 2, true);
  3641. const formatter = end.loc.clone(opts).relFormatter(opts);
  3642. return formatter.format(c3, unit);
  3643. }, differ = (unit) => {
  3644. if (opts.calendary) {
  3645. if (!end.hasSame(start, unit)) {
  3646. return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);
  3647. } else
  3648. return 0;
  3649. } else {
  3650. return end.diff(start, unit).get(unit);
  3651. }
  3652. };
  3653. if (opts.unit) {
  3654. return format(differ(opts.unit), opts.unit);
  3655. }
  3656. for (const unit of opts.units) {
  3657. const count = differ(unit);
  3658. if (Math.abs(count) >= 1) {
  3659. return format(count, unit);
  3660. }
  3661. }
  3662. return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);
  3663. }
  3664. function lastOpts(argList) {
  3665. let opts = {}, args;
  3666. if (argList.length > 0 && typeof argList[argList.length - 1] === "object") {
  3667. opts = argList[argList.length - 1];
  3668. args = Array.from(argList).slice(0, argList.length - 1);
  3669. } else {
  3670. args = Array.from(argList);
  3671. }
  3672. return [opts, args];
  3673. }
  3674. var DateTime = class {
  3675. constructor(config) {
  3676. const zone = config.zone || Settings.defaultZone;
  3677. let invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null);
  3678. this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;
  3679. let c3 = null, o3 = null;
  3680. if (!invalid) {
  3681. const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);
  3682. if (unchanged) {
  3683. [c3, o3] = [config.old.c, config.old.o];
  3684. } else {
  3685. const ot = zone.offset(this.ts);
  3686. c3 = tsToObj(this.ts, ot);
  3687. invalid = Number.isNaN(c3.year) ? new Invalid("invalid input") : null;
  3688. c3 = invalid ? null : c3;
  3689. o3 = invalid ? null : ot;
  3690. }
  3691. }
  3692. this._zone = zone;
  3693. this.loc = config.loc || Locale.create();
  3694. this.invalid = invalid;
  3695. this.weekData = null;
  3696. this.c = c3;
  3697. this.o = o3;
  3698. this.isLuxonDateTime = true;
  3699. }
  3700. static now() {
  3701. return new DateTime({});
  3702. }
  3703. static local() {
  3704. const [opts, args] = lastOpts(arguments), [year, month, day, hour, minute, second, millisecond] = args;
  3705. return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);
  3706. }
  3707. static utc() {
  3708. const [opts, args] = lastOpts(arguments), [year, month, day, hour, minute, second, millisecond] = args;
  3709. opts.zone = FixedOffsetZone.utcInstance;
  3710. return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);
  3711. }
  3712. static fromJSDate(date, options = {}) {
  3713. const ts = isDate(date) ? date.valueOf() : NaN;
  3714. if (Number.isNaN(ts)) {
  3715. return DateTime.invalid("invalid input");
  3716. }
  3717. const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);
  3718. if (!zoneToUse.isValid) {
  3719. return DateTime.invalid(unsupportedZone(zoneToUse));
  3720. }
  3721. return new DateTime({
  3722. ts,
  3723. zone: zoneToUse,
  3724. loc: Locale.fromObject(options)
  3725. });
  3726. }
  3727. static fromMillis(milliseconds, options = {}) {
  3728. if (!isNumber(milliseconds)) {
  3729. throw new InvalidArgumentError(
  3730. `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`
  3731. );
  3732. } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {
  3733. return DateTime.invalid("Timestamp out of range");
  3734. } else {
  3735. return new DateTime({
  3736. ts: milliseconds,
  3737. zone: normalizeZone(options.zone, Settings.defaultZone),
  3738. loc: Locale.fromObject(options)
  3739. });
  3740. }
  3741. }
  3742. static fromSeconds(seconds, options = {}) {
  3743. if (!isNumber(seconds)) {
  3744. throw new InvalidArgumentError("fromSeconds requires a numerical input");
  3745. } else {
  3746. return new DateTime({
  3747. ts: seconds * 1e3,
  3748. zone: normalizeZone(options.zone, Settings.defaultZone),
  3749. loc: Locale.fromObject(options)
  3750. });
  3751. }
  3752. }
  3753. static fromObject(obj, opts = {}) {
  3754. obj = obj || {};
  3755. const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);
  3756. if (!zoneToUse.isValid) {
  3757. return DateTime.invalid(unsupportedZone(zoneToUse));
  3758. }
  3759. 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);
  3760. if ((containsGregor || containsOrdinal) && definiteWeekDef) {
  3761. throw new ConflictingSpecificationError(
  3762. "Can't mix weekYear/weekNumber units with year/month/day or ordinals"
  3763. );
  3764. }
  3765. if (containsGregorMD && containsOrdinal) {
  3766. throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");
  3767. }
  3768. const useWeekData = definiteWeekDef || normalized.weekday && !containsGregor;
  3769. let units, defaultValues, objNow = tsToObj(tsNow, offsetProvis);
  3770. if (useWeekData) {
  3771. units = orderedWeekUnits;
  3772. defaultValues = defaultWeekUnitValues;
  3773. objNow = gregorianToWeek(objNow);
  3774. } else if (containsOrdinal) {
  3775. units = orderedOrdinalUnits;
  3776. defaultValues = defaultOrdinalUnitValues;
  3777. objNow = gregorianToOrdinal(objNow);
  3778. } else {
  3779. units = orderedUnits2;
  3780. defaultValues = defaultUnitValues;
  3781. }
  3782. let foundFirst = false;
  3783. for (const u3 of units) {
  3784. const v4 = normalized[u3];
  3785. if (!isUndefined(v4)) {
  3786. foundFirst = true;
  3787. } else if (foundFirst) {
  3788. normalized[u3] = defaultValues[u3];
  3789. } else {
  3790. normalized[u3] = objNow[u3];
  3791. }
  3792. }
  3793. const higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), invalid = higherOrderInvalid || hasInvalidTimeData(normalized);
  3794. if (invalid) {
  3795. return DateTime.invalid(invalid);
  3796. }
  3797. const gregorian = useWeekData ? weekToGregorian(normalized) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse), inst = new DateTime({
  3798. ts: tsFinal,
  3799. zone: zoneToUse,
  3800. o: offsetFinal,
  3801. loc
  3802. });
  3803. if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {
  3804. return DateTime.invalid(
  3805. "mismatched weekday",
  3806. `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`
  3807. );
  3808. }
  3809. return inst;
  3810. }
  3811. static fromISO(text, opts = {}) {
  3812. const [vals, parsedZone] = parseISODate(text);
  3813. return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text);
  3814. }
  3815. static fromRFC2822(text, opts = {}) {
  3816. const [vals, parsedZone] = parseRFC2822Date(text);
  3817. return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text);
  3818. }
  3819. static fromHTTP(text, opts = {}) {
  3820. const [vals, parsedZone] = parseHTTPDate(text);
  3821. return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts);
  3822. }
  3823. static fromFormat(text, fmt, opts = {}) {
  3824. if (isUndefined(text) || isUndefined(fmt)) {
  3825. throw new InvalidArgumentError("fromFormat requires an input string and a format");
  3826. }
  3827. const { locale = null, numberingSystem = null } = opts, localeToUse = Locale.fromOpts({
  3828. locale,
  3829. numberingSystem,
  3830. defaultToEN: true
  3831. }), [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);
  3832. if (invalid) {
  3833. return DateTime.invalid(invalid);
  3834. } else {
  3835. return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);
  3836. }
  3837. }
  3838. static fromString(text, fmt, opts = {}) {
  3839. return DateTime.fromFormat(text, fmt, opts);
  3840. }
  3841. static fromSQL(text, opts = {}) {
  3842. const [vals, parsedZone] = parseSQL(text);
  3843. return parseDataToDateTime(vals, parsedZone, opts, "SQL", text);
  3844. }
  3845. static invalid(reason, explanation = null) {
  3846. if (!reason) {
  3847. throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");
  3848. }
  3849. const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
  3850. if (Settings.throwOnInvalid) {
  3851. throw new InvalidDateTimeError(invalid);
  3852. } else {
  3853. return new DateTime({ invalid });
  3854. }
  3855. }
  3856. static isDateTime(o3) {
  3857. return o3 && o3.isLuxonDateTime || false;
  3858. }
  3859. static parseFormatForOpts(formatOpts, localeOpts = {}) {
  3860. const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));
  3861. return !tokenList ? null : tokenList.map((t5) => t5 ? t5.val : null).join("");
  3862. }
  3863. static expandFormat(fmt, localeOpts = {}) {
  3864. const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));
  3865. return expanded.map((t5) => t5.val).join("");
  3866. }
  3867. get(unit) {
  3868. return this[unit];
  3869. }
  3870. get isValid() {
  3871. return this.invalid === null;
  3872. }
  3873. get invalidReason() {
  3874. return this.invalid ? this.invalid.reason : null;
  3875. }
  3876. get invalidExplanation() {
  3877. return this.invalid ? this.invalid.explanation : null;
  3878. }
  3879. get locale() {
  3880. return this.isValid ? this.loc.locale : null;
  3881. }
  3882. get numberingSystem() {
  3883. return this.isValid ? this.loc.numberingSystem : null;
  3884. }
  3885. get outputCalendar() {
  3886. return this.isValid ? this.loc.outputCalendar : null;
  3887. }
  3888. get zone() {
  3889. return this._zone;
  3890. }
  3891. get zoneName() {
  3892. return this.isValid ? this.zone.name : null;
  3893. }
  3894. get year() {
  3895. return this.isValid ? this.c.year : NaN;
  3896. }
  3897. get quarter() {
  3898. return this.isValid ? Math.ceil(this.c.month / 3) : NaN;
  3899. }
  3900. get month() {
  3901. return this.isValid ? this.c.month : NaN;
  3902. }
  3903. get day() {
  3904. return this.isValid ? this.c.day : NaN;
  3905. }
  3906. get hour() {
  3907. return this.isValid ? this.c.hour : NaN;
  3908. }
  3909. get minute() {
  3910. return this.isValid ? this.c.minute : NaN;
  3911. }
  3912. get second() {
  3913. return this.isValid ? this.c.second : NaN;
  3914. }
  3915. get millisecond() {
  3916. return this.isValid ? this.c.millisecond : NaN;
  3917. }
  3918. get weekYear() {
  3919. return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;
  3920. }
  3921. get weekNumber() {
  3922. return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;
  3923. }
  3924. get weekday() {
  3925. return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;
  3926. }
  3927. get ordinal() {
  3928. return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;
  3929. }
  3930. get monthShort() {
  3931. return this.isValid ? Info.months("short", { locObj: this.loc })[this.month - 1] : null;
  3932. }
  3933. get monthLong() {
  3934. return this.isValid ? Info.months("long", { locObj: this.loc })[this.month - 1] : null;
  3935. }
  3936. get weekdayShort() {
  3937. return this.isValid ? Info.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null;
  3938. }
  3939. get weekdayLong() {
  3940. return this.isValid ? Info.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null;
  3941. }
  3942. get offset() {
  3943. return this.isValid ? +this.o : NaN;
  3944. }
  3945. get offsetNameShort() {
  3946. if (this.isValid) {
  3947. return this.zone.offsetName(this.ts, {
  3948. format: "short",
  3949. locale: this.locale
  3950. });
  3951. } else {
  3952. return null;
  3953. }
  3954. }
  3955. get offsetNameLong() {
  3956. if (this.isValid) {
  3957. return this.zone.offsetName(this.ts, {
  3958. format: "long",
  3959. locale: this.locale
  3960. });
  3961. } else {
  3962. return null;
  3963. }
  3964. }
  3965. get isOffsetFixed() {
  3966. return this.isValid ? this.zone.isUniversal : null;
  3967. }
  3968. get isInDST() {
  3969. if (this.isOffsetFixed) {
  3970. return false;
  3971. } else {
  3972. return this.offset > this.set({ month: 1, day: 1 }).offset || this.offset > this.set({ month: 5 }).offset;
  3973. }
  3974. }
  3975. get isInLeapYear() {
  3976. return isLeapYear(this.year);
  3977. }
  3978. get daysInMonth() {
  3979. return daysInMonth(this.year, this.month);
  3980. }
  3981. get daysInYear() {
  3982. return this.isValid ? daysInYear(this.year) : NaN;
  3983. }
  3984. get weeksInWeekYear() {
  3985. return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;
  3986. }
  3987. resolvedLocaleOptions(opts = {}) {
  3988. const { locale, numberingSystem, calendar } = Formatter.create(
  3989. this.loc.clone(opts),
  3990. opts
  3991. ).resolvedOptions(this);
  3992. return { locale, numberingSystem, outputCalendar: calendar };
  3993. }
  3994. toUTC(offset2 = 0, opts = {}) {
  3995. return this.setZone(FixedOffsetZone.instance(offset2), opts);
  3996. }
  3997. toLocal() {
  3998. return this.setZone(Settings.defaultZone);
  3999. }
  4000. setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {
  4001. zone = normalizeZone(zone, Settings.defaultZone);
  4002. if (zone.equals(this.zone)) {
  4003. return this;
  4004. } else if (!zone.isValid) {
  4005. return DateTime.invalid(unsupportedZone(zone));
  4006. } else {
  4007. let newTS = this.ts;
  4008. if (keepLocalTime || keepCalendarTime) {
  4009. const offsetGuess = zone.offset(this.ts);
  4010. const asObj = this.toObject();
  4011. [newTS] = objToTS(asObj, offsetGuess, zone);
  4012. }
  4013. return clone2(this, { ts: newTS, zone });
  4014. }
  4015. }
  4016. reconfigure({ locale, numberingSystem, outputCalendar } = {}) {
  4017. const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });
  4018. return clone2(this, { loc });
  4019. }
  4020. setLocale(locale) {
  4021. return this.reconfigure({ locale });
  4022. }
  4023. set(values) {
  4024. if (!this.isValid)
  4025. return this;
  4026. 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;
  4027. if ((containsGregor || containsOrdinal) && definiteWeekDef) {
  4028. throw new ConflictingSpecificationError(
  4029. "Can't mix weekYear/weekNumber units with year/month/day or ordinals"
  4030. );
  4031. }
  4032. if (containsGregorMD && containsOrdinal) {
  4033. throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");
  4034. }
  4035. let mixed;
  4036. if (settingWeekStuff) {
  4037. mixed = weekToGregorian({ ...gregorianToWeek(this.c), ...normalized });
  4038. } else if (!isUndefined(normalized.ordinal)) {
  4039. mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });
  4040. } else {
  4041. mixed = { ...this.toObject(), ...normalized };
  4042. if (isUndefined(normalized.day)) {
  4043. mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);
  4044. }
  4045. }
  4046. const [ts, o3] = objToTS(mixed, this.o, this.zone);
  4047. return clone2(this, { ts, o: o3 });
  4048. }
  4049. plus(duration) {
  4050. if (!this.isValid)
  4051. return this;
  4052. const dur = Duration.fromDurationLike(duration);
  4053. return clone2(this, adjustTime(this, dur));
  4054. }
  4055. minus(duration) {
  4056. if (!this.isValid)
  4057. return this;
  4058. const dur = Duration.fromDurationLike(duration).negate();
  4059. return clone2(this, adjustTime(this, dur));
  4060. }
  4061. startOf(unit) {
  4062. if (!this.isValid)
  4063. return this;
  4064. const o3 = {}, normalizedUnit = Duration.normalizeUnit(unit);
  4065. switch (normalizedUnit) {
  4066. case "years":
  4067. o3.month = 1;
  4068. case "quarters":
  4069. case "months":
  4070. o3.day = 1;
  4071. case "weeks":
  4072. case "days":
  4073. o3.hour = 0;
  4074. case "hours":
  4075. o3.minute = 0;
  4076. case "minutes":
  4077. o3.second = 0;
  4078. case "seconds":
  4079. o3.millisecond = 0;
  4080. break;
  4081. case "milliseconds":
  4082. break;
  4083. }
  4084. if (normalizedUnit === "weeks") {
  4085. o3.weekday = 1;
  4086. }
  4087. if (normalizedUnit === "quarters") {
  4088. const q2 = Math.ceil(this.month / 3);
  4089. o3.month = (q2 - 1) * 3 + 1;
  4090. }
  4091. return this.set(o3);
  4092. }
  4093. endOf(unit) {
  4094. return this.isValid ? this.plus({ [unit]: 1 }).startOf(unit).minus(1) : this;
  4095. }
  4096. toFormat(fmt, opts = {}) {
  4097. return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID3;
  4098. }
  4099. toLocaleString(formatOpts = DATE_SHORT, opts = {}) {
  4100. return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID3;
  4101. }
  4102. toLocaleParts(opts = {}) {
  4103. return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : [];
  4104. }
  4105. toISO({
  4106. format = "extended",
  4107. suppressSeconds = false,
  4108. suppressMilliseconds = false,
  4109. includeOffset = true,
  4110. extendedZone = false
  4111. } = {}) {
  4112. if (!this.isValid) {
  4113. return null;
  4114. }
  4115. const ext = format === "extended";
  4116. let c3 = toISODate(this, ext);
  4117. c3 += "T";
  4118. c3 += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);
  4119. return c3;
  4120. }
  4121. toISODate({ format = "extended" } = {}) {
  4122. if (!this.isValid) {
  4123. return null;
  4124. }
  4125. return toISODate(this, format === "extended");
  4126. }
  4127. toISOWeekDate() {
  4128. return toTechFormat(this, "kkkk-'W'WW-c");
  4129. }
  4130. toISOTime({
  4131. suppressMilliseconds = false,
  4132. suppressSeconds = false,
  4133. includeOffset = true,
  4134. includePrefix = false,
  4135. extendedZone = false,
  4136. format = "extended"
  4137. } = {}) {
  4138. if (!this.isValid) {
  4139. return null;
  4140. }
  4141. let c3 = includePrefix ? "T" : "";
  4142. return c3 + toISOTime(
  4143. this,
  4144. format === "extended",
  4145. suppressSeconds,
  4146. suppressMilliseconds,
  4147. includeOffset,
  4148. extendedZone
  4149. );
  4150. }
  4151. toRFC2822() {
  4152. return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false);
  4153. }
  4154. toHTTP() {
  4155. return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'");
  4156. }
  4157. toSQLDate() {
  4158. if (!this.isValid) {
  4159. return null;
  4160. }
  4161. return toISODate(this, true);
  4162. }
  4163. toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {
  4164. let fmt = "HH:mm:ss.SSS";
  4165. if (includeZone || includeOffset) {
  4166. if (includeOffsetSpace) {
  4167. fmt += " ";
  4168. }
  4169. if (includeZone) {
  4170. fmt += "z";
  4171. } else if (includeOffset) {
  4172. fmt += "ZZ";
  4173. }
  4174. }
  4175. return toTechFormat(this, fmt, true);
  4176. }
  4177. toSQL(opts = {}) {
  4178. if (!this.isValid) {
  4179. return null;
  4180. }
  4181. return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;
  4182. }
  4183. toString() {
  4184. return this.isValid ? this.toISO() : INVALID3;
  4185. }
  4186. valueOf() {
  4187. return this.toMillis();
  4188. }
  4189. toMillis() {
  4190. return this.isValid ? this.ts : NaN;
  4191. }
  4192. toSeconds() {
  4193. return this.isValid ? this.ts / 1e3 : NaN;
  4194. }
  4195. toUnixInteger() {
  4196. return this.isValid ? Math.floor(this.ts / 1e3) : NaN;
  4197. }
  4198. toJSON() {
  4199. return this.toISO();
  4200. }
  4201. toBSON() {
  4202. return this.toJSDate();
  4203. }
  4204. toObject(opts = {}) {
  4205. if (!this.isValid)
  4206. return {};
  4207. const base = { ...this.c };
  4208. if (opts.includeConfig) {
  4209. base.outputCalendar = this.outputCalendar;
  4210. base.numberingSystem = this.loc.numberingSystem;
  4211. base.locale = this.loc.locale;
  4212. }
  4213. return base;
  4214. }
  4215. toJSDate() {
  4216. return new Date(this.isValid ? this.ts : NaN);
  4217. }
  4218. diff(otherDateTime, unit = "milliseconds", opts = {}) {
  4219. if (!this.isValid || !otherDateTime.isValid) {
  4220. return Duration.invalid("created by diffing an invalid DateTime");
  4221. }
  4222. const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };
  4223. 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);
  4224. return otherIsLater ? diffed.negate() : diffed;
  4225. }
  4226. diffNow(unit = "milliseconds", opts = {}) {
  4227. return this.diff(DateTime.now(), unit, opts);
  4228. }
  4229. until(otherDateTime) {
  4230. return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;
  4231. }
  4232. hasSame(otherDateTime, unit) {
  4233. if (!this.isValid)
  4234. return false;
  4235. const inputMs = otherDateTime.valueOf();
  4236. const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });
  4237. return adjustedToZone.startOf(unit) <= inputMs && inputMs <= adjustedToZone.endOf(unit);
  4238. }
  4239. equals(other) {
  4240. return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc);
  4241. }
  4242. toRelative(options = {}) {
  4243. if (!this.isValid)
  4244. return null;
  4245. const base = options.base || DateTime.fromObject({}, { zone: this.zone }), padding = options.padding ? this < base ? -options.padding : options.padding : 0;
  4246. let units = ["years", "months", "days", "hours", "minutes", "seconds"];
  4247. let unit = options.unit;
  4248. if (Array.isArray(options.unit)) {
  4249. units = options.unit;
  4250. unit = void 0;
  4251. }
  4252. return diffRelative(base, this.plus(padding), {
  4253. ...options,
  4254. numeric: "always",
  4255. units,
  4256. unit
  4257. });
  4258. }
  4259. toRelativeCalendar(options = {}) {
  4260. if (!this.isValid)
  4261. return null;
  4262. return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {
  4263. ...options,
  4264. numeric: "auto",
  4265. units: ["years", "months", "days"],
  4266. calendary: true
  4267. });
  4268. }
  4269. static min(...dateTimes) {
  4270. if (!dateTimes.every(DateTime.isDateTime)) {
  4271. throw new InvalidArgumentError("min requires all arguments be DateTimes");
  4272. }
  4273. return bestBy(dateTimes, (i4) => i4.valueOf(), Math.min);
  4274. }
  4275. static max(...dateTimes) {
  4276. if (!dateTimes.every(DateTime.isDateTime)) {
  4277. throw new InvalidArgumentError("max requires all arguments be DateTimes");
  4278. }
  4279. return bestBy(dateTimes, (i4) => i4.valueOf(), Math.max);
  4280. }
  4281. static fromFormatExplain(text, fmt, options = {}) {
  4282. const { locale = null, numberingSystem = null } = options, localeToUse = Locale.fromOpts({
  4283. locale,
  4284. numberingSystem,
  4285. defaultToEN: true
  4286. });
  4287. return explainFromTokens(localeToUse, text, fmt);
  4288. }
  4289. static fromStringExplain(text, fmt, options = {}) {
  4290. return DateTime.fromFormatExplain(text, fmt, options);
  4291. }
  4292. static get DATE_SHORT() {
  4293. return DATE_SHORT;
  4294. }
  4295. static get DATE_MED() {
  4296. return DATE_MED;
  4297. }
  4298. static get DATE_MED_WITH_WEEKDAY() {
  4299. return DATE_MED_WITH_WEEKDAY;
  4300. }
  4301. static get DATE_FULL() {
  4302. return DATE_FULL;
  4303. }
  4304. static get DATE_HUGE() {
  4305. return DATE_HUGE;
  4306. }
  4307. static get TIME_SIMPLE() {
  4308. return TIME_SIMPLE;
  4309. }
  4310. static get TIME_WITH_SECONDS() {
  4311. return TIME_WITH_SECONDS;
  4312. }
  4313. static get TIME_WITH_SHORT_OFFSET() {
  4314. return TIME_WITH_SHORT_OFFSET;
  4315. }
  4316. static get TIME_WITH_LONG_OFFSET() {
  4317. return TIME_WITH_LONG_OFFSET;
  4318. }
  4319. static get TIME_24_SIMPLE() {
  4320. return TIME_24_SIMPLE;
  4321. }
  4322. static get TIME_24_WITH_SECONDS() {
  4323. return TIME_24_WITH_SECONDS;
  4324. }
  4325. static get TIME_24_WITH_SHORT_OFFSET() {
  4326. return TIME_24_WITH_SHORT_OFFSET;
  4327. }
  4328. static get TIME_24_WITH_LONG_OFFSET() {
  4329. return TIME_24_WITH_LONG_OFFSET;
  4330. }
  4331. static get DATETIME_SHORT() {
  4332. return DATETIME_SHORT;
  4333. }
  4334. static get DATETIME_SHORT_WITH_SECONDS() {
  4335. return DATETIME_SHORT_WITH_SECONDS;
  4336. }
  4337. static get DATETIME_MED() {
  4338. return DATETIME_MED;
  4339. }
  4340. static get DATETIME_MED_WITH_SECONDS() {
  4341. return DATETIME_MED_WITH_SECONDS;
  4342. }
  4343. static get DATETIME_MED_WITH_WEEKDAY() {
  4344. return DATETIME_MED_WITH_WEEKDAY;
  4345. }
  4346. static get DATETIME_FULL() {
  4347. return DATETIME_FULL;
  4348. }
  4349. static get DATETIME_FULL_WITH_SECONDS() {
  4350. return DATETIME_FULL_WITH_SECONDS;
  4351. }
  4352. static get DATETIME_HUGE() {
  4353. return DATETIME_HUGE;
  4354. }
  4355. static get DATETIME_HUGE_WITH_SECONDS() {
  4356. return DATETIME_HUGE_WITH_SECONDS;
  4357. }
  4358. };
  4359. function friendlyDateTime(dateTimeish) {
  4360. if (DateTime.isDateTime(dateTimeish)) {
  4361. return dateTimeish;
  4362. } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {
  4363. return DateTime.fromJSDate(dateTimeish);
  4364. } else if (dateTimeish && typeof dateTimeish === "object") {
  4365. return DateTime.fromObject(dateTimeish);
  4366. } else {
  4367. throw new InvalidArgumentError(
  4368. `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`
  4369. );
  4370. }
  4371. }
  4372. // node_modules/@arcgis/core/chunks/languageUtils.js
  4373. var T = class {
  4374. constructor(e3) {
  4375. this.value = e3;
  4376. }
  4377. };
  4378. var M = class {
  4379. constructor(e3) {
  4380. this.value = e3;
  4381. }
  4382. };
  4383. var N = M;
  4384. var D2 = T;
  4385. var k = { type: "VOID" };
  4386. var j = { type: "BREAK" };
  4387. var A = { type: "CONTINUE" };
  4388. function R(e3, t5, n5) {
  4389. return "" === t5 || null == t5 || t5 === n5 || t5 === n5 ? e3 : e3 = e3.split(t5).join(n5);
  4390. }
  4391. function F2(t5) {
  4392. return t5 instanceof r2;
  4393. }
  4394. function C2(e3) {
  4395. return e3 instanceof s4;
  4396. }
  4397. function I(e3) {
  4398. return !!w3(e3) || (!!Z(e3) || (!!z(e3) || (!!_(e3) || (null === e3 || (e3 === k || "number" == typeof e3)))));
  4399. }
  4400. function v3(e3, t5) {
  4401. return void 0 === e3 ? t5 : e3;
  4402. }
  4403. function O(e3) {
  4404. return null == e3 ? "" : Y(e3) || E(e3) ? "Array" : z(e3) ? "Date" : w3(e3) ? "String" : _(e3) ? "Boolean" : Z(e3) ? "Number" : "esri.arcade.Attachment" === (e3 == null ? void 0 : e3.declaredClass) ? "Attachment" : "esri.arcade.Portal" === (e3 == null ? void 0 : e3.declaredClass) ? "Portal" : "esri.arcade.Dictionary" === (e3 == null ? void 0 : e3.declaredClass) ? "Dictionary" : e3 instanceof s4 ? "Module" : J(e3) ? "Feature" : e3 instanceof w ? "Point" : e3 instanceof v ? "Polygon" : e3 instanceof m ? "Polyline" : e3 instanceof u ? "Multipoint" : e3 instanceof w2 ? "Extent" : F2(e3) ? "Function" : P2(e3) ? "FeatureSet" : G(e3) ? "FeatureSetCollection" : e3 === k ? "" : "number" == typeof e3 && isNaN(e3) ? "Number" : "Unrecognised Type";
  4405. }
  4406. function w3(e3) {
  4407. return "string" == typeof e3 || e3 instanceof String;
  4408. }
  4409. function _(e3) {
  4410. return "boolean" == typeof e3;
  4411. }
  4412. function Z(e3) {
  4413. return "number" == typeof e3;
  4414. }
  4415. function L(e3) {
  4416. return "number" == typeof e3 && isFinite(e3) && Math.floor(e3) === e3;
  4417. }
  4418. function Y(e3) {
  4419. return e3 instanceof Array;
  4420. }
  4421. function J(e3) {
  4422. return "esri.arcade.Feature" === (e3 == null ? void 0 : e3.arcadeDeclaredClass);
  4423. }
  4424. function P2(e3) {
  4425. return true === (e3 && e3.declaredRootClass && "esri.arcade.featureset.support.FeatureSet" === e3.declaredRootClass);
  4426. }
  4427. function G(e3) {
  4428. return true === (e3 && e3.declaredRootClass && "esri.arcade.featureSetCollection" === e3.declaredRootClass);
  4429. }
  4430. function E(e3) {
  4431. return e3 instanceof t3;
  4432. }
  4433. function z(e3) {
  4434. return e3 instanceof Date;
  4435. }
  4436. function V(e3, t5, n5, r3, a2) {
  4437. if (e3.length < t5 || e3.length > n5)
  4438. throw new t2(r3, e.WrongNumberOfParameters, a2);
  4439. }
  4440. function H(e3) {
  4441. return e3 < 0 ? -Math.round(-e3) : Math.round(e3);
  4442. }
  4443. function U() {
  4444. let e3 = Date.now();
  4445. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t5) => {
  4446. const n5 = (e3 + 16 * Math.random()) % 16 | 0;
  4447. return e3 = Math.floor(e3 / 16), ("x" === t5 ? n5 : 3 & n5 | 8).toString(16);
  4448. });
  4449. }
  4450. function q(e3, t5) {
  4451. return isNaN(e3) || null == t5 || "" === t5 ? e3.toString() : (t5 = R(t5, "\u2030", ""), t5 = R(t5, "\xA4", ""), s(e3, { pattern: t5 }));
  4452. }
  4453. function B(e3, t5) {
  4454. const n5 = DateTime.fromJSDate(e3);
  4455. return null == t5 || "" === t5 ? n5.toISO({ suppressMilliseconds: true }) : n5.toFormat(W(t5), { locale: l(), numberingSystem: "latn" });
  4456. }
  4457. function W(e3) {
  4458. e3 = e3.replace(/LTS|LT|LL?L?L?|l{1,4}/g, "[$&]");
  4459. let t5 = "";
  4460. const n5 = /(\[[^\[]*\])|(\\)?([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;
  4461. for (const r3 of e3.match(n5))
  4462. switch (r3) {
  4463. case "D":
  4464. t5 += "d";
  4465. break;
  4466. case "DD":
  4467. t5 += "dd";
  4468. break;
  4469. case "DDD":
  4470. t5 += "o";
  4471. break;
  4472. case "d":
  4473. t5 += "c";
  4474. break;
  4475. case "ddd":
  4476. t5 += "ccc";
  4477. break;
  4478. case "dddd":
  4479. t5 += "cccc";
  4480. break;
  4481. case "M":
  4482. t5 += "L";
  4483. break;
  4484. case "MM":
  4485. t5 += "LL";
  4486. break;
  4487. case "MMM":
  4488. t5 += "LLL";
  4489. break;
  4490. case "MMMM":
  4491. t5 += "LLLL";
  4492. break;
  4493. case "YY":
  4494. t5 += "yy";
  4495. break;
  4496. case "Y":
  4497. case "YYYY":
  4498. t5 += "yyyy";
  4499. break;
  4500. case "Q":
  4501. t5 += "q";
  4502. break;
  4503. case "Z":
  4504. t5 += "ZZ";
  4505. break;
  4506. case "ZZ":
  4507. t5 += "ZZZ";
  4508. break;
  4509. case "S":
  4510. t5 += "'S'";
  4511. break;
  4512. case "SS":
  4513. t5 += "'SS'";
  4514. break;
  4515. case "SSS":
  4516. t5 += "u";
  4517. break;
  4518. case "A":
  4519. case "a":
  4520. t5 += "a";
  4521. break;
  4522. case "m":
  4523. case "mm":
  4524. case "h":
  4525. case "hh":
  4526. case "H":
  4527. case "HH":
  4528. case "s":
  4529. case "ss":
  4530. case "X":
  4531. case "x":
  4532. t5 += r3;
  4533. break;
  4534. default:
  4535. r3.length >= 2 && "[" === r3.slice(0, 1) && "]" === r3.slice(-1) ? t5 += `'${r3.slice(1, -1)}'` : t5 += `'${r3}'`;
  4536. }
  4537. return t5;
  4538. }
  4539. function $(e3, t5, n5) {
  4540. switch (n5) {
  4541. case ">":
  4542. return e3 > t5;
  4543. case "<":
  4544. return e3 < t5;
  4545. case ">=":
  4546. return e3 >= t5;
  4547. case "<=":
  4548. return e3 <= t5;
  4549. }
  4550. return false;
  4551. }
  4552. function Q(e3, t5, n5) {
  4553. if (null === e3) {
  4554. if (null === t5 || t5 === k)
  4555. return $(null, null, n5);
  4556. if (Z(t5))
  4557. return $(0, t5, n5);
  4558. if (w3(t5))
  4559. return $(0, re(t5), n5);
  4560. if (_(t5))
  4561. return $(0, re(t5), n5);
  4562. if (z(t5))
  4563. return $(0, t5.getTime(), n5);
  4564. }
  4565. if (e3 === k) {
  4566. if (null === t5 || t5 === k)
  4567. return $(null, null, n5);
  4568. if (Z(t5))
  4569. return $(0, t5, n5);
  4570. if (w3(t5))
  4571. return $(0, re(t5), n5);
  4572. if (_(t5))
  4573. return $(0, re(t5), n5);
  4574. if (z(t5))
  4575. return $(0, t5.getTime(), n5);
  4576. } else if (Z(e3)) {
  4577. if (Z(t5))
  4578. return $(e3, t5, n5);
  4579. if (_(t5))
  4580. return $(e3, re(t5), n5);
  4581. if (null === t5 || t5 === k)
  4582. return $(e3, 0, n5);
  4583. if (w3(t5))
  4584. return $(e3, re(t5), n5);
  4585. if (z(t5))
  4586. return $(e3, t5.getTime(), n5);
  4587. } else if (w3(e3)) {
  4588. if (w3(t5))
  4589. return $(K(e3), K(t5), n5);
  4590. if (z(t5))
  4591. return $(re(e3), t5.getTime(), n5);
  4592. if (Z(t5))
  4593. return $(re(e3), t5, n5);
  4594. if (null === t5 || t5 === k)
  4595. return $(re(e3), 0, n5);
  4596. if (_(t5))
  4597. return $(re(e3), re(t5), n5);
  4598. } else if (z(e3)) {
  4599. if (z(t5))
  4600. return $(e3, t5, n5);
  4601. if (null === t5 || t5 === k)
  4602. return $(e3.getTime(), 0, n5);
  4603. if (Z(t5))
  4604. return $(e3.getTime(), t5, n5);
  4605. if (_(t5))
  4606. return $(e3.getTime(), re(t5), n5);
  4607. if (w3(t5))
  4608. return $(e3.getTime(), re(t5), n5);
  4609. } else if (_(e3)) {
  4610. if (_(t5))
  4611. return $(e3, t5, n5);
  4612. if (Z(t5))
  4613. return $(re(e3), re(t5), n5);
  4614. if (z(t5))
  4615. return $(re(e3), t5.getTime(), n5);
  4616. if (null === t5 || t5 === k)
  4617. return $(re(e3), 0, n5);
  4618. if (w3(t5))
  4619. return $(re(e3), re(t5), n5);
  4620. }
  4621. return !!X(e3, t5) && ("<=" === n5 || ">=" === n5);
  4622. }
  4623. function X(e3, t5) {
  4624. if (e3 === t5)
  4625. return true;
  4626. if (null === e3 && t5 === k || null === t5 && e3 === k)
  4627. return true;
  4628. if (z(e3) && z(t5))
  4629. return e3.getTime() === t5.getTime();
  4630. if (e3 instanceof h2)
  4631. return e3.equalityTest(t5);
  4632. if (e3 instanceof i3)
  4633. return e3.equalityTest(t5);
  4634. if (e3 instanceof w && t5 instanceof w) {
  4635. const n5 = e3.cache._arcadeCacheId, r3 = t5.cache._arcadeCacheId;
  4636. if (null != n5)
  4637. return n5 === r3;
  4638. }
  4639. if (void 0 !== e3 && void 0 !== t5 && null !== e3 && null !== t5 && "object" == typeof e3 && "object" == typeof t5) {
  4640. if (e3._arcadeCacheId === t5._arcadeCacheId && void 0 !== e3._arcadeCacheId && null !== e3._arcadeCacheId)
  4641. return true;
  4642. if (e3._underlyingGraphic === t5._underlyingGraphic && void 0 !== e3._underlyingGraphic && null !== e3._underlyingGraphic)
  4643. return true;
  4644. }
  4645. return false;
  4646. }
  4647. function K(e3, n5) {
  4648. if (w3(e3))
  4649. return e3;
  4650. if (null === e3)
  4651. return "";
  4652. if (Z(e3))
  4653. return q(e3, n5);
  4654. if (_(e3))
  4655. return e3.toString();
  4656. if (z(e3))
  4657. return B(e3, n5);
  4658. if (e3 instanceof p)
  4659. return JSON.stringify(e3.toJSON());
  4660. if (Y(e3)) {
  4661. const t5 = [];
  4662. for (let n6 = 0; n6 < e3.length; n6++)
  4663. t5[n6] = ne(e3[n6]);
  4664. return "[" + t5.join(",") + "]";
  4665. }
  4666. if (e3 instanceof t3) {
  4667. const t5 = [];
  4668. for (let n6 = 0; n6 < e3.length(); n6++)
  4669. t5[n6] = ne(e3.get(n6));
  4670. return "[" + t5.join(",") + "]";
  4671. }
  4672. return null !== e3 && "object" == typeof e3 && void 0 !== e3.castToText ? e3.castToText() : F2(e3) ? "object, Function" : e3 === k ? "" : C2(e3) ? "object, Module" : "";
  4673. }
  4674. function ee(e3) {
  4675. const n5 = [];
  4676. if (!Y(e3))
  4677. return null;
  4678. if (e3 instanceof t3) {
  4679. for (let t5 = 0; t5 < e3.length(); t5++)
  4680. n5[t5] = re(e3.get(t5));
  4681. return n5;
  4682. }
  4683. for (let t5 = 0; t5 < e3.length; t5++)
  4684. n5[t5] = re(e3[t5]);
  4685. return n5;
  4686. }
  4687. function te(e3, n5, r3 = false) {
  4688. if (w3(e3))
  4689. return e3;
  4690. if (null === e3)
  4691. return "";
  4692. if (Z(e3))
  4693. return q(e3, n5);
  4694. if (_(e3))
  4695. return e3.toString();
  4696. if (z(e3))
  4697. return B(e3, n5);
  4698. if (e3 instanceof p)
  4699. return e3 instanceof w2 ? '{"xmin":' + e3.xmin.toString() + ',"ymin":' + e3.ymin.toString() + "," + (e3.hasZ ? '"zmin":' + e3.zmin.toString() + "," : "") + (e3.hasM ? '"mmin":' + e3.mmin.toString() + "," : "") + '"xmax":' + e3.xmax.toString() + ',"ymax":' + e3.ymax.toString() + "," + (e3.hasZ ? '"zmax":' + e3.zmax.toString() + "," : "") + (e3.hasM ? '"mmax":' + e3.mmax.toString() + "," : "") + '"spatialReference":' + ye(e3.spatialReference) + "}" : ye(e3.toJSON(), (e4, t5) => e4.key === t5.key ? 0 : "spatialReference" === e4.key ? 1 : "spatialReference" === t5.key || e4.key < t5.key ? -1 : e4.key > t5.key ? 1 : 0);
  4700. if (Y(e3)) {
  4701. const t5 = [];
  4702. for (let n6 = 0; n6 < e3.length; n6++)
  4703. t5[n6] = ne(e3[n6], r3);
  4704. return "[" + t5.join(",") + "]";
  4705. }
  4706. if (e3 instanceof t3) {
  4707. const t5 = [];
  4708. for (let n6 = 0; n6 < e3.length(); n6++)
  4709. t5[n6] = ne(e3.get(n6), r3);
  4710. return "[" + t5.join(",") + "]";
  4711. }
  4712. return null !== e3 && "object" == typeof e3 && void 0 !== e3.castToText ? e3.castToText(r3) : F2(e3) ? "object, Function" : e3 === k ? "" : C2(e3) ? "object, Module" : "";
  4713. }
  4714. function ne(e3, n5 = false) {
  4715. if (null === e3)
  4716. return "null";
  4717. if (_(e3) || Z(e3) || w3(e3))
  4718. return JSON.stringify(e3);
  4719. if (e3 instanceof p)
  4720. return te(e3, null, n5);
  4721. if (e3 instanceof t3)
  4722. return te(e3, null, n5);
  4723. if (e3 instanceof Array)
  4724. return te(e3, null, n5);
  4725. if (e3 instanceof Date)
  4726. return n5 ? JSON.stringify(e3.getTime()) : JSON.stringify(B(e3, ""));
  4727. if (null !== e3 && "object" == typeof e3) {
  4728. if (void 0 !== e3.castToText)
  4729. return e3.castToText(n5);
  4730. } else if (e3 === k)
  4731. return "null";
  4732. return "null";
  4733. }
  4734. function re(e3, t5) {
  4735. return Z(e3) ? e3 : null === e3 || "" === e3 ? 0 : z(e3) ? NaN : _(e3) ? e3 ? 1 : 0 : Y(e3) || "" === e3 || void 0 === e3 ? NaN : void 0 !== t5 && w3(e3) ? (t5 = R(t5, "\u2030", ""), t5 = R(t5, "\xA4", ""), p2(e3, { pattern: t5 })) : e3 === k ? 0 : Number(e3);
  4736. }
  4737. function ae(e3) {
  4738. if (z(e3))
  4739. return e3;
  4740. if (w3(e3)) {
  4741. const t5 = oe(e3);
  4742. if (t5)
  4743. return t5.toJSDate();
  4744. }
  4745. return null;
  4746. }
  4747. function ie(e3) {
  4748. return z(e3) ? DateTime.fromJSDate(e3) : w3(e3) ? oe(e3) : null;
  4749. }
  4750. function oe(e3) {
  4751. const t5 = / (\d\d)/;
  4752. let n5 = DateTime.fromISO(e3);
  4753. return n5.isValid || t5.test(e3) && (e3 = e3.replace(t5, "T$1"), n5 = DateTime.fromISO(e3), n5.isValid) ? n5 : null;
  4754. }
  4755. function le(e3) {
  4756. return _(e3) ? e3 : w3(e3) ? "true" === (e3 = e3.toLowerCase()) : !!Z(e3) && (0 !== e3 && !isNaN(e3));
  4757. }
  4758. function se(e3, t5) {
  4759. return t(e3) ? null : (null !== e3.spatialReference && void 0 !== e3.spatialReference || (e3.spatialReference = t5), e3);
  4760. }
  4761. function ue(e3) {
  4762. if (null === e3)
  4763. return null;
  4764. if (e3 instanceof w)
  4765. return "NaN" === e3.x || null === e3.x || isNaN(e3.x) ? null : e3;
  4766. if (e3 instanceof v) {
  4767. if (0 === e3.rings.length)
  4768. return null;
  4769. for (const t5 of e3.rings)
  4770. if (t5.length > 0)
  4771. return e3;
  4772. return null;
  4773. }
  4774. if (e3 instanceof m) {
  4775. if (0 === e3.paths.length)
  4776. return null;
  4777. for (const t5 of e3.paths)
  4778. if (t5.length > 0)
  4779. return e3;
  4780. return null;
  4781. }
  4782. return e3 instanceof u ? 0 === e3.points.length ? null : e3 : e3 instanceof w2 ? "NaN" === e3.xmin || null === e3.xmin || isNaN(e3.xmin) ? null : e3 : null;
  4783. }
  4784. function fe(e3, t5) {
  4785. if (!e3)
  4786. return t5;
  4787. if (!e3.domain)
  4788. return t5;
  4789. let n5 = null;
  4790. if ("string" === e3.field.type || "esriFieldTypeString" === e3.field.type)
  4791. t5 = K(t5);
  4792. else {
  4793. if (null == t5)
  4794. return null;
  4795. if ("" === t5)
  4796. return t5;
  4797. t5 = re(t5);
  4798. }
  4799. for (let r3 = 0; r3 < e3.domain.codedValues.length; r3++) {
  4800. const a2 = e3.domain.codedValues[r3];
  4801. a2.code === t5 && (n5 = a2);
  4802. }
  4803. return null === n5 ? t5 : n5.name;
  4804. }
  4805. function ce(e3, t5) {
  4806. if (!e3)
  4807. return t5;
  4808. if (!e3.domain)
  4809. return t5;
  4810. let n5 = null;
  4811. t5 = K(t5);
  4812. for (let r3 = 0; r3 < e3.domain.codedValues.length; r3++) {
  4813. const a2 = e3.domain.codedValues[r3];
  4814. a2.name === t5 && (n5 = a2);
  4815. }
  4816. return null === n5 ? t5 : n5.code;
  4817. }
  4818. function me(e3, t5, n5 = null, r3 = null) {
  4819. if (!t5)
  4820. return null;
  4821. if (!t5.fields)
  4822. return null;
  4823. let a2, i4, o3 = null;
  4824. for (let l5 = 0; l5 < t5.fields.length; l5++) {
  4825. const n6 = t5.fields[l5];
  4826. n6.name.toLowerCase() === e3.toString().toLowerCase() && (o3 = n6);
  4827. }
  4828. if (null === o3)
  4829. throw new t2(null, e.FieldNotFound, null, { key: e3 });
  4830. return null === r3 && n5 && t5.typeIdField && (r3 = n5.hasField(t5.typeIdField) ? n5.field(t5.typeIdField) : null), null != r3 && t5.types.some((e4) => e4.id === r3 && (a2 = e4.domains && e4.domains[o3.name], a2 && "inherited" === a2.type && (a2 = de(o3.name, t5), i4 = true), true)), i4 || a2 || (a2 = de(e3, t5)), { field: o3, domain: a2 };
  4831. }
  4832. function de(e3, t5) {
  4833. let n5;
  4834. return t5.fields.some((t6) => (t6.name.toLowerCase() === e3.toLowerCase() && (n5 = t6.domain), !!n5)), n5;
  4835. }
  4836. function ye(e3, t5) {
  4837. t5 || (t5 = {}), "function" == typeof t5 && (t5 = { cmp: t5 });
  4838. const n5 = "boolean" == typeof t5.cycles && t5.cycles, r3 = t5.cmp && (a2 = t5.cmp, function(e4) {
  4839. return function(t6, n6) {
  4840. const r4 = { key: t6, value: e4[t6] }, i5 = { key: n6, value: e4[n6] };
  4841. return a2(r4, i5);
  4842. };
  4843. });
  4844. var a2;
  4845. const i4 = [];
  4846. return function e4(t6) {
  4847. if (t6 && t6.toJSON && "function" == typeof t6.toJSON && (t6 = t6.toJSON()), void 0 === t6)
  4848. return;
  4849. if ("number" == typeof t6)
  4850. return isFinite(t6) ? "" + t6 : "null";
  4851. if ("object" != typeof t6)
  4852. return JSON.stringify(t6);
  4853. let a3, o3;
  4854. if (Array.isArray(t6)) {
  4855. for (o3 = "[", a3 = 0; a3 < t6.length; a3++)
  4856. a3 && (o3 += ","), o3 += e4(t6[a3]) || "null";
  4857. return o3 + "]";
  4858. }
  4859. if (null === t6)
  4860. return "null";
  4861. if (i4.includes(t6)) {
  4862. if (n5)
  4863. return JSON.stringify("__cycle__");
  4864. throw new TypeError("Converting circular structure to JSON");
  4865. }
  4866. const l5 = i4.push(t6) - 1, s6 = Object.keys(t6).sort(r3 && r3(t6));
  4867. for (o3 = "", a3 = 0; a3 < s6.length; a3++) {
  4868. const n6 = s6[a3], r4 = e4(t6[n6]);
  4869. r4 && (o3 && (o3 += ","), o3 += JSON.stringify(n6) + ":" + r4);
  4870. }
  4871. return i4.splice(l5, 1), "{" + o3 + "}";
  4872. }(e3);
  4873. }
  4874. function pe(e3) {
  4875. if (null === e3)
  4876. return null;
  4877. const t5 = [];
  4878. for (const n5 of e3)
  4879. n5 && n5.arcadeDeclaredClass && "esri.arcade.Feature" === n5.arcadeDeclaredClass ? t5.push(n5.geometry()) : t5.push(n5);
  4880. return t5;
  4881. }
  4882. function ge(e3, t5) {
  4883. if (!(t5 instanceof w))
  4884. throw new t2(null, e.InvalidParameter, null);
  4885. e3.push(t5.hasZ ? t5.hasM ? [t5.x, t5.y, t5.z, t5.m] : [t5.x, t5.y, t5.z] : [t5.x, t5.y]);
  4886. }
  4887. function he(e3, t5) {
  4888. if (Y(e3) || E(e3)) {
  4889. let n5 = false, a2 = false, i4 = [], o3 = t5;
  4890. if (Y(e3)) {
  4891. for (const t6 of e3)
  4892. ge(i4, t6);
  4893. i4.length > 0 && (o3 = e3[0].spatialReference, n5 = e3[0].hasZ, a2 = e3[0].hasM);
  4894. } else if (e3 instanceof i3)
  4895. i4 = e3._elements, i4.length > 0 && (n5 = e3._hasZ, a2 = e3._hasM, o3 = e3.get(0).spatialReference);
  4896. else {
  4897. if (!E(e3))
  4898. throw new t2(null, e.InvalidParameter, null);
  4899. for (const t6 of e3.toArray())
  4900. ge(i4, t6);
  4901. i4.length > 0 && (o3 = e3.get(0).spatialReference, n5 = true === e3.get(0).hasZ, a2 = true === e3.get(0).hasM);
  4902. }
  4903. if (0 === i4.length)
  4904. return null;
  4905. return h(i4, a2, n5) || (i4 = i4.slice(0).reverse()), new v({ rings: [i4], spatialReference: o3, hasZ: n5, hasM: a2 });
  4906. }
  4907. return e3;
  4908. }
  4909. function Se(e3, t5) {
  4910. if (Y(e3) || E(e3)) {
  4911. let n5 = false, a2 = false, i4 = [], o3 = t5;
  4912. if (Y(e3)) {
  4913. for (const t6 of e3)
  4914. ge(i4, t6);
  4915. i4.length > 0 && (o3 = e3[0].spatialReference, n5 = true === e3[0].hasZ, a2 = true === e3[0].hasM);
  4916. } else if (e3 instanceof i3)
  4917. i4 = e3._elements, i4.length > 0 && (n5 = e3._hasZ, a2 = e3._hasM, o3 = e3.get(0).spatialReference);
  4918. else if (E(e3)) {
  4919. for (const t6 of e3.toArray())
  4920. ge(i4, t6);
  4921. i4.length > 0 && (o3 = e3.get(0).spatialReference, n5 = true === e3.get(0).hasZ, a2 = true === e3.get(0).hasM);
  4922. }
  4923. return 0 === i4.length ? null : new m({ paths: [i4], spatialReference: o3, hasZ: n5, hasM: a2 });
  4924. }
  4925. return e3;
  4926. }
  4927. function be(e3, t5) {
  4928. if (Y(e3) || E(e3)) {
  4929. let n5 = false, a2 = false, i4 = [], l5 = t5;
  4930. if (Y(e3)) {
  4931. for (const t6 of e3)
  4932. ge(i4, t6);
  4933. i4.length > 0 && (l5 = e3[0].spatialReference, n5 = true === e3[0].hasZ, a2 = true === e3[0].hasM);
  4934. } else if (e3 instanceof i3)
  4935. i4 = e3._elements, i4.length > 0 && (n5 = e3._hasZ, a2 = e3._hasM, l5 = e3.get(0).spatialReference);
  4936. else if (E(e3)) {
  4937. for (const t6 of e3.toArray())
  4938. ge(i4, t6);
  4939. i4.length > 0 && (l5 = e3.get(0).spatialReference, n5 = true === e3.get(0).hasZ, a2 = true === e3.get(0).hasM);
  4940. }
  4941. return 0 === i4.length ? null : new u({ points: i4, spatialReference: l5, hasZ: n5, hasM: a2 });
  4942. }
  4943. return e3;
  4944. }
  4945. function xe(e3, n5 = false) {
  4946. const r3 = [];
  4947. if (null === e3)
  4948. return r3;
  4949. if (true === Y(e3)) {
  4950. for (let t5 = 0; t5 < e3.length; t5++) {
  4951. const a2 = K(e3[t5]);
  4952. "" === a2 && true !== n5 || r3.push(a2);
  4953. }
  4954. return r3;
  4955. }
  4956. if (e3 instanceof t3) {
  4957. for (let t5 = 0; t5 < e3.length(); t5++) {
  4958. const a2 = K(e3.get(t5));
  4959. "" === a2 && true !== n5 || r3.push(a2);
  4960. }
  4961. return r3;
  4962. }
  4963. if (I(e3)) {
  4964. const t5 = K(e3);
  4965. return "" === t5 && true !== n5 || r3.push(t5), r3;
  4966. }
  4967. return [];
  4968. }
  4969. var Te = 0;
  4970. function Me(e3) {
  4971. return Te++, Te % 100 == 0 ? (Te = 0, new Promise((t5) => {
  4972. setTimeout(() => {
  4973. t5(e3);
  4974. }, 0);
  4975. })) : e3;
  4976. }
  4977. function Ne(e3, t5, n5) {
  4978. switch (n5) {
  4979. case "&":
  4980. return e3 & t5;
  4981. case "|":
  4982. return e3 | t5;
  4983. case "^":
  4984. return e3 ^ t5;
  4985. case "<<":
  4986. return e3 << t5;
  4987. case ">>":
  4988. return e3 >> t5;
  4989. case ">>>":
  4990. return e3 >>> t5;
  4991. }
  4992. }
  4993. function De(e3, n5 = null) {
  4994. return null == e3 ? null : _(e3) || Z(e3) || w3(e3) ? e3 : e3 instanceof p ? true === (n5 == null ? void 0 : n5.keepGeometryType) ? e3 : e3.toJSON() : e3 instanceof t3 ? e3.toArray().map((e4) => De(e4, n5)) : e3 instanceof Array ? e3.map((e4) => De(e4, n5)) : e3 instanceof Date ? e3 : null !== e3 && "object" == typeof e3 && void 0 !== e3.castAsJson ? e3.castAsJson(n5) : null;
  4995. }
  4996. async function ke(e3, t5, n5, r3, a2) {
  4997. const i4 = await je(e3, t5, n5);
  4998. a2[r3] = i4;
  4999. }
  5000. async function je(e3, n5 = null, r3 = null) {
  5001. if (e3 instanceof t3 && (e3 = e3.toArray()), null == e3)
  5002. return null;
  5003. if (I(e3) || e3 instanceof p || e3 instanceof Date)
  5004. return De(e3, r3);
  5005. if (e3 instanceof Array) {
  5006. const t5 = [], a2 = [];
  5007. for (const o3 of e3)
  5008. null === o3 || I(o3) || o3 instanceof p || o3 instanceof Date ? a2.push(De(o3, r3)) : (a2.push(null), t5.push(ke(o3, n5, r3, a2.length - 1, a2)));
  5009. return t5.length > 0 && await Promise.all(t5), a2;
  5010. }
  5011. return null !== e3 && "object" == typeof e3 && void 0 !== e3.castAsJsonAsync ? e3.castAsJsonAsync(n5, r3) : null;
  5012. }
  5013. function Ae(e3, t5, n5) {
  5014. const r3 = e3.fullSchema();
  5015. if (null === r3)
  5016. return null;
  5017. if (!r3.fields)
  5018. return null;
  5019. return me(t5, r3, e3, n5);
  5020. }
  5021. function Re(e3) {
  5022. const t5 = e3.fullSchema();
  5023. return null === t5 ? null : t5.fields && t5.typeIdField ? { subtypeField: t5.typeIdField, subtypes: t5.types ? t5.types.map((e4) => ({ name: e4.name, code: e4.id })) : [] } : null;
  5024. }
  5025. function Fe(e3, t5, n5, r3) {
  5026. const a2 = e3.fullSchema();
  5027. if (null === a2)
  5028. return null;
  5029. if (!a2.fields)
  5030. return null;
  5031. const i4 = me(t5, a2, e3, r3);
  5032. if (void 0 === n5)
  5033. try {
  5034. n5 = e3.field(t5);
  5035. } catch (o3) {
  5036. return null;
  5037. }
  5038. return fe(i4, n5);
  5039. }
  5040. function Ce(e3, t5, n5, r3) {
  5041. const a2 = e3.fullSchema();
  5042. if (null === a2)
  5043. return null;
  5044. if (!a2.fields)
  5045. return null;
  5046. if (void 0 === n5) {
  5047. try {
  5048. n5 = e3.field(t5);
  5049. } catch (i4) {
  5050. return null;
  5051. }
  5052. return n5;
  5053. }
  5054. return ce(me(t5, a2, e3, r3), n5);
  5055. }
  5056. function Ie(e3) {
  5057. const t5 = e3.fullSchema();
  5058. if (null === t5)
  5059. return null;
  5060. if (!t5.fields)
  5061. return null;
  5062. const n5 = [];
  5063. for (const r3 of t5.fields)
  5064. n5.push(o2(r3));
  5065. return { objectIdField: t5.objectIdField, globalIdField: t5.globalIdField, geometryType: void 0 === v2[t5.geometryType] ? "" : v2[t5.geometryType], fields: n5 };
  5066. }
  5067. var ve = Object.freeze(Object.defineProperty({ __proto__: null, ReturnResultE: T, ImplicitResultE: M, ImplicitResult: N, ReturnResult: D2, voidOperation: k, breakResult: j, continueResult: A, multiReplace: R, isFunctionParameter: F2, isModule: C2, isSimpleType: I, defaultUndefined: v3, getType: O, isString: w3, isBoolean: _, isNumber: Z, isInteger: L, isArray: Y, isFeature: J, isFeatureSet: P2, isFeatureSetCollection: G, isImmutableArray: E, isDate: z, pcCheck: V, absRound: H, generateUUID: U, formatNumber: q, formatDate: B, standardiseDateFormat: W, greaterThanLessThan: Q, equalityTest: X, toString: K, toNumberArray: ee, toStringExplicit: te, toNumber: re, toDate: ae, toDateTime: ie, toBoolean: le, fixSpatialReference: se, fixNullGeometry: ue, getDomainValue: fe, getDomainCode: ce, getDomain: me, stableStringify: ye, autoCastFeatureToGeometry: pe, autoCastArrayOfPointsToPolygon: he, autoCastArrayOfPointsToPolyline: Se, autoCastArrayOfPointsToMultiPoint: be, toStringArray: xe, tick: Me, binaryOperator: Ne, castAsJson: De, castAsJsonAsync: je, featureFullDomain: Ae, featureSubtypes: Re, featureDomainValueLookup: Fe, featureDomainCodeLookup: Ce, featureSchema: Ie }, Symbol.toStringTag, { value: "Module" }));
  5068. export {
  5069. e,
  5070. t2 as t,
  5071. s2 as s,
  5072. c,
  5073. i,
  5074. u2 as u,
  5075. l2 as l,
  5076. p3 as p,
  5077. t3 as t2,
  5078. r2 as r,
  5079. n2 as n,
  5080. e2,
  5081. s3 as s2,
  5082. i3 as i2,
  5083. h2 as h,
  5084. DateTime,
  5085. t4 as t3,
  5086. i2 as i3,
  5087. n3 as n2,
  5088. o2 as o,
  5089. l3 as l2,
  5090. y2 as y,
  5091. c2,
  5092. m2 as m,
  5093. f,
  5094. d2 as d,
  5095. F,
  5096. S,
  5097. v2 as v,
  5098. P,
  5099. b,
  5100. D,
  5101. s4 as s3,
  5102. N,
  5103. D2,
  5104. k,
  5105. j,
  5106. A,
  5107. R,
  5108. F2,
  5109. I,
  5110. v3 as v2,
  5111. O,
  5112. w3 as w,
  5113. _,
  5114. Z,
  5115. L,
  5116. Y,
  5117. J,
  5118. P2,
  5119. G,
  5120. E,
  5121. z,
  5122. V,
  5123. H,
  5124. U,
  5125. W,
  5126. Q,
  5127. X,
  5128. K,
  5129. ee,
  5130. te,
  5131. re,
  5132. ae,
  5133. ie,
  5134. le,
  5135. se,
  5136. ue,
  5137. fe,
  5138. ce,
  5139. me,
  5140. pe,
  5141. he,
  5142. Se,
  5143. be,
  5144. xe,
  5145. Me,
  5146. Ne,
  5147. De,
  5148. je,
  5149. Ae,
  5150. Re,
  5151. Fe,
  5152. Ce,
  5153. Ie,
  5154. ve
  5155. };
  5156. //# sourceMappingURL=chunk-FT2BCPUP.js.map