cli.mjs 476 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034
  1. #!/usr/bin/env node
  2. import kc, { writeFileSync as Nc } from "fs";
  3. import Mc from "node:events";
  4. import Dc from "node:child_process";
  5. import qc from "node:path";
  6. import Fc from "node:fs";
  7. import Vc from "node:process";
  8. import Lc from "util";
  9. import _i from "path";
  10. var j = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
  11. function Hc(e) {
  12. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  13. }
  14. function Uc(e) {
  15. if (e.__esModule) return e;
  16. var t = e.default;
  17. if (typeof t == "function") {
  18. var r = function n() {
  19. return this instanceof n ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
  20. };
  21. r.prototype = t.prototype;
  22. } else r = {};
  23. return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(n) {
  24. var i = Object.getOwnPropertyDescriptor(e, n);
  25. Object.defineProperty(r, n, i.get ? i : {
  26. enumerable: !0,
  27. get: function() {
  28. return e[n];
  29. }
  30. });
  31. }), r;
  32. }
  33. var pe = {}, Yt = {}, bt = {};
  34. let ya = class extends Error {
  35. /**
  36. * Constructs the CommanderError class
  37. * @param {number} exitCode suggested exit code which could be used with process.exit
  38. * @param {string} code an id string representing the error
  39. * @param {string} message human-readable description of the error
  40. */
  41. constructor(t, r, n) {
  42. super(n), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.code = r, this.exitCode = t, this.nestedError = void 0;
  43. }
  44. }, zc = class extends ya {
  45. /**
  46. * Constructs the InvalidArgumentError class
  47. * @param {string} [message] explanation of why argument is invalid
  48. */
  49. constructor(t) {
  50. super(1, "commander.invalidArgument", t), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name;
  51. }
  52. };
  53. bt.CommanderError = ya;
  54. bt.InvalidArgumentError = zc;
  55. const { InvalidArgumentError: Gc } = bt;
  56. let Bc = class {
  57. /**
  58. * Initialize a new command argument with the given name and description.
  59. * The default is that the argument is required, and you can explicitly
  60. * indicate this with <> around the name. Put [] around the name for an optional argument.
  61. *
  62. * @param {string} name
  63. * @param {string} [description]
  64. */
  65. constructor(t, r) {
  66. switch (this.description = r || "", this.variadic = !1, this.parseArg = void 0, this.defaultValue = void 0, this.defaultValueDescription = void 0, this.argChoices = void 0, t[0]) {
  67. case "<":
  68. this.required = !0, this._name = t.slice(1, -1);
  69. break;
  70. case "[":
  71. this.required = !1, this._name = t.slice(1, -1);
  72. break;
  73. default:
  74. this.required = !0, this._name = t;
  75. break;
  76. }
  77. this._name.length > 3 && this._name.slice(-3) === "..." && (this.variadic = !0, this._name = this._name.slice(0, -3));
  78. }
  79. /**
  80. * Return argument name.
  81. *
  82. * @return {string}
  83. */
  84. name() {
  85. return this._name;
  86. }
  87. /**
  88. * @package
  89. */
  90. _concatValue(t, r) {
  91. return r === this.defaultValue || !Array.isArray(r) ? [t] : r.concat(t);
  92. }
  93. /**
  94. * Set the default value, and optionally supply the description to be displayed in the help.
  95. *
  96. * @param {*} value
  97. * @param {string} [description]
  98. * @return {Argument}
  99. */
  100. default(t, r) {
  101. return this.defaultValue = t, this.defaultValueDescription = r, this;
  102. }
  103. /**
  104. * Set the custom handler for processing CLI command arguments into argument values.
  105. *
  106. * @param {Function} [fn]
  107. * @return {Argument}
  108. */
  109. argParser(t) {
  110. return this.parseArg = t, this;
  111. }
  112. /**
  113. * Only allow argument value to be one of choices.
  114. *
  115. * @param {string[]} values
  116. * @return {Argument}
  117. */
  118. choices(t) {
  119. return this.argChoices = t.slice(), this.parseArg = (r, n) => {
  120. if (!this.argChoices.includes(r))
  121. throw new Gc(
  122. `Allowed choices are ${this.argChoices.join(", ")}.`
  123. );
  124. return this.variadic ? this._concatValue(r, n) : r;
  125. }, this;
  126. }
  127. /**
  128. * Make argument required.
  129. *
  130. * @returns {Argument}
  131. */
  132. argRequired() {
  133. return this.required = !0, this;
  134. }
  135. /**
  136. * Make argument optional.
  137. *
  138. * @returns {Argument}
  139. */
  140. argOptional() {
  141. return this.required = !1, this;
  142. }
  143. };
  144. function Kc(e) {
  145. const t = e.name() + (e.variadic === !0 ? "..." : "");
  146. return e.required ? "<" + t + ">" : "[" + t + "]";
  147. }
  148. Yt.Argument = Bc;
  149. Yt.humanReadableArgName = Kc;
  150. var vi = {}, qr = {};
  151. const { humanReadableArgName: Wc } = Yt;
  152. let Jc = class {
  153. constructor() {
  154. this.helpWidth = void 0, this.minWidthToWrap = 40, this.sortSubcommands = !1, this.sortOptions = !1, this.showGlobalOptions = !1;
  155. }
  156. /**
  157. * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`
  158. * and just before calling `formatHelp()`.
  159. *
  160. * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.
  161. *
  162. * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions
  163. */
  164. prepareContext(t) {
  165. this.helpWidth = this.helpWidth ?? t.helpWidth ?? 80;
  166. }
  167. /**
  168. * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.
  169. *
  170. * @param {Command} cmd
  171. * @returns {Command[]}
  172. */
  173. visibleCommands(t) {
  174. const r = t.commands.filter((i) => !i._hidden), n = t._getHelpCommand();
  175. return n && !n._hidden && r.push(n), this.sortSubcommands && r.sort((i, s) => i.name().localeCompare(s.name())), r;
  176. }
  177. /**
  178. * Compare options for sort.
  179. *
  180. * @param {Option} a
  181. * @param {Option} b
  182. * @returns {number}
  183. */
  184. compareOptions(t, r) {
  185. const n = (i) => i.short ? i.short.replace(/^-/, "") : i.long.replace(/^--/, "");
  186. return n(t).localeCompare(n(r));
  187. }
  188. /**
  189. * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
  190. *
  191. * @param {Command} cmd
  192. * @returns {Option[]}
  193. */
  194. visibleOptions(t) {
  195. const r = t.options.filter((i) => !i.hidden), n = t._getHelpOption();
  196. if (n && !n.hidden) {
  197. const i = n.short && t._findOption(n.short), s = n.long && t._findOption(n.long);
  198. !i && !s ? r.push(n) : n.long && !s ? r.push(
  199. t.createOption(n.long, n.description)
  200. ) : n.short && !i && r.push(
  201. t.createOption(n.short, n.description)
  202. );
  203. }
  204. return this.sortOptions && r.sort(this.compareOptions), r;
  205. }
  206. /**
  207. * Get an array of the visible global options. (Not including help.)
  208. *
  209. * @param {Command} cmd
  210. * @returns {Option[]}
  211. */
  212. visibleGlobalOptions(t) {
  213. if (!this.showGlobalOptions) return [];
  214. const r = [];
  215. for (let n = t.parent; n; n = n.parent) {
  216. const i = n.options.filter(
  217. (s) => !s.hidden
  218. );
  219. r.push(...i);
  220. }
  221. return this.sortOptions && r.sort(this.compareOptions), r;
  222. }
  223. /**
  224. * Get an array of the arguments if any have a description.
  225. *
  226. * @param {Command} cmd
  227. * @returns {Argument[]}
  228. */
  229. visibleArguments(t) {
  230. return t._argsDescription && t.registeredArguments.forEach((r) => {
  231. r.description = r.description || t._argsDescription[r.name()] || "";
  232. }), t.registeredArguments.find((r) => r.description) ? t.registeredArguments : [];
  233. }
  234. /**
  235. * Get the command term to show in the list of subcommands.
  236. *
  237. * @param {Command} cmd
  238. * @returns {string}
  239. */
  240. subcommandTerm(t) {
  241. const r = t.registeredArguments.map((n) => Wc(n)).join(" ");
  242. return t._name + (t._aliases[0] ? "|" + t._aliases[0] : "") + (t.options.length ? " [options]" : "") + // simplistic check for non-help option
  243. (r ? " " + r : "");
  244. }
  245. /**
  246. * Get the option term to show in the list of options.
  247. *
  248. * @param {Option} option
  249. * @returns {string}
  250. */
  251. optionTerm(t) {
  252. return t.flags;
  253. }
  254. /**
  255. * Get the argument term to show in the list of arguments.
  256. *
  257. * @param {Argument} argument
  258. * @returns {string}
  259. */
  260. argumentTerm(t) {
  261. return t.name();
  262. }
  263. /**
  264. * Get the longest command term length.
  265. *
  266. * @param {Command} cmd
  267. * @param {Help} helper
  268. * @returns {number}
  269. */
  270. longestSubcommandTermLength(t, r) {
  271. return r.visibleCommands(t).reduce((n, i) => Math.max(
  272. n,
  273. this.displayWidth(
  274. r.styleSubcommandTerm(r.subcommandTerm(i))
  275. )
  276. ), 0);
  277. }
  278. /**
  279. * Get the longest option term length.
  280. *
  281. * @param {Command} cmd
  282. * @param {Help} helper
  283. * @returns {number}
  284. */
  285. longestOptionTermLength(t, r) {
  286. return r.visibleOptions(t).reduce((n, i) => Math.max(
  287. n,
  288. this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))
  289. ), 0);
  290. }
  291. /**
  292. * Get the longest global option term length.
  293. *
  294. * @param {Command} cmd
  295. * @param {Help} helper
  296. * @returns {number}
  297. */
  298. longestGlobalOptionTermLength(t, r) {
  299. return r.visibleGlobalOptions(t).reduce((n, i) => Math.max(
  300. n,
  301. this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))
  302. ), 0);
  303. }
  304. /**
  305. * Get the longest argument term length.
  306. *
  307. * @param {Command} cmd
  308. * @param {Help} helper
  309. * @returns {number}
  310. */
  311. longestArgumentTermLength(t, r) {
  312. return r.visibleArguments(t).reduce((n, i) => Math.max(
  313. n,
  314. this.displayWidth(
  315. r.styleArgumentTerm(r.argumentTerm(i))
  316. )
  317. ), 0);
  318. }
  319. /**
  320. * Get the command usage to be displayed at the top of the built-in help.
  321. *
  322. * @param {Command} cmd
  323. * @returns {string}
  324. */
  325. commandUsage(t) {
  326. let r = t._name;
  327. t._aliases[0] && (r = r + "|" + t._aliases[0]);
  328. let n = "";
  329. for (let i = t.parent; i; i = i.parent)
  330. n = i.name() + " " + n;
  331. return n + r + " " + t.usage();
  332. }
  333. /**
  334. * Get the description for the command.
  335. *
  336. * @param {Command} cmd
  337. * @returns {string}
  338. */
  339. commandDescription(t) {
  340. return t.description();
  341. }
  342. /**
  343. * Get the subcommand summary to show in the list of subcommands.
  344. * (Fallback to description for backwards compatibility.)
  345. *
  346. * @param {Command} cmd
  347. * @returns {string}
  348. */
  349. subcommandDescription(t) {
  350. return t.summary() || t.description();
  351. }
  352. /**
  353. * Get the option description to show in the list of options.
  354. *
  355. * @param {Option} option
  356. * @return {string}
  357. */
  358. optionDescription(t) {
  359. const r = [];
  360. if (t.argChoices && r.push(
  361. // use stringify to match the display of the default value
  362. `choices: ${t.argChoices.map((n) => JSON.stringify(n)).join(", ")}`
  363. ), t.defaultValue !== void 0 && (t.required || t.optional || t.isBoolean() && typeof t.defaultValue == "boolean") && r.push(
  364. `default: ${t.defaultValueDescription || JSON.stringify(t.defaultValue)}`
  365. ), t.presetArg !== void 0 && t.optional && r.push(`preset: ${JSON.stringify(t.presetArg)}`), t.envVar !== void 0 && r.push(`env: ${t.envVar}`), r.length > 0) {
  366. const n = `(${r.join(", ")})`;
  367. return t.description ? `${t.description} ${n}` : n;
  368. }
  369. return t.description;
  370. }
  371. /**
  372. * Get the argument description to show in the list of arguments.
  373. *
  374. * @param {Argument} argument
  375. * @return {string}
  376. */
  377. argumentDescription(t) {
  378. const r = [];
  379. if (t.argChoices && r.push(
  380. // use stringify to match the display of the default value
  381. `choices: ${t.argChoices.map((n) => JSON.stringify(n)).join(", ")}`
  382. ), t.defaultValue !== void 0 && r.push(
  383. `default: ${t.defaultValueDescription || JSON.stringify(t.defaultValue)}`
  384. ), r.length > 0) {
  385. const n = `(${r.join(", ")})`;
  386. return t.description ? `${t.description} ${n}` : n;
  387. }
  388. return t.description;
  389. }
  390. /**
  391. * Format a list of items, given a heading and an array of formatted items.
  392. *
  393. * @param {string} heading
  394. * @param {string[]} items
  395. * @param {Help} helper
  396. * @returns string[]
  397. */
  398. formatItemList(t, r, n) {
  399. return r.length === 0 ? [] : [n.styleTitle(t), ...r, ""];
  400. }
  401. /**
  402. * Group items by their help group heading.
  403. *
  404. * @param {Command[] | Option[]} unsortedItems
  405. * @param {Command[] | Option[]} visibleItems
  406. * @param {Function} getGroup
  407. * @returns {Map<string, Command[] | Option[]>}
  408. */
  409. groupItems(t, r, n) {
  410. const i = /* @__PURE__ */ new Map();
  411. return t.forEach((s) => {
  412. const o = n(s);
  413. i.has(o) || i.set(o, []);
  414. }), r.forEach((s) => {
  415. const o = n(s);
  416. i.has(o) || i.set(o, []), i.get(o).push(s);
  417. }), i;
  418. }
  419. /**
  420. * Generate the built-in help text.
  421. *
  422. * @param {Command} cmd
  423. * @param {Help} helper
  424. * @returns {string}
  425. */
  426. formatHelp(t, r) {
  427. const n = r.padWidth(t, r), i = r.helpWidth ?? 80;
  428. function s(u, h) {
  429. return r.formatItem(u, n, h, r);
  430. }
  431. let o = [
  432. `${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,
  433. ""
  434. ];
  435. const a = r.commandDescription(t);
  436. a.length > 0 && (o = o.concat([
  437. r.boxWrap(
  438. r.styleCommandDescription(a),
  439. i
  440. ),
  441. ""
  442. ]));
  443. const l = r.visibleArguments(t).map((u) => s(
  444. r.styleArgumentTerm(r.argumentTerm(u)),
  445. r.styleArgumentDescription(r.argumentDescription(u))
  446. ));
  447. if (o = o.concat(
  448. this.formatItemList("Arguments:", l, r)
  449. ), this.groupItems(
  450. t.options,
  451. r.visibleOptions(t),
  452. (u) => u.helpGroupHeading ?? "Options:"
  453. ).forEach((u, h) => {
  454. const y = u.map((_) => s(
  455. r.styleOptionTerm(r.optionTerm(_)),
  456. r.styleOptionDescription(r.optionDescription(_))
  457. ));
  458. o = o.concat(this.formatItemList(h, y, r));
  459. }), r.showGlobalOptions) {
  460. const u = r.visibleGlobalOptions(t).map((h) => s(
  461. r.styleOptionTerm(r.optionTerm(h)),
  462. r.styleOptionDescription(r.optionDescription(h))
  463. ));
  464. o = o.concat(
  465. this.formatItemList("Global Options:", u, r)
  466. );
  467. }
  468. return this.groupItems(
  469. t.commands,
  470. r.visibleCommands(t),
  471. (u) => u.helpGroup() || "Commands:"
  472. ).forEach((u, h) => {
  473. const y = u.map((_) => s(
  474. r.styleSubcommandTerm(r.subcommandTerm(_)),
  475. r.styleSubcommandDescription(r.subcommandDescription(_))
  476. ));
  477. o = o.concat(this.formatItemList(h, y, r));
  478. }), o.join(`
  479. `);
  480. }
  481. /**
  482. * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.
  483. *
  484. * @param {string} str
  485. * @returns {number}
  486. */
  487. displayWidth(t) {
  488. return ga(t).length;
  489. }
  490. /**
  491. * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.
  492. *
  493. * @param {string} str
  494. * @returns {string}
  495. */
  496. styleTitle(t) {
  497. return t;
  498. }
  499. styleUsage(t) {
  500. return t.split(" ").map((r) => r === "[options]" ? this.styleOptionText(r) : r === "[command]" ? this.styleSubcommandText(r) : r[0] === "[" || r[0] === "<" ? this.styleArgumentText(r) : this.styleCommandText(r)).join(" ");
  501. }
  502. styleCommandDescription(t) {
  503. return this.styleDescriptionText(t);
  504. }
  505. styleOptionDescription(t) {
  506. return this.styleDescriptionText(t);
  507. }
  508. styleSubcommandDescription(t) {
  509. return this.styleDescriptionText(t);
  510. }
  511. styleArgumentDescription(t) {
  512. return this.styleDescriptionText(t);
  513. }
  514. styleDescriptionText(t) {
  515. return t;
  516. }
  517. styleOptionTerm(t) {
  518. return this.styleOptionText(t);
  519. }
  520. styleSubcommandTerm(t) {
  521. return t.split(" ").map((r) => r === "[options]" ? this.styleOptionText(r) : r[0] === "[" || r[0] === "<" ? this.styleArgumentText(r) : this.styleSubcommandText(r)).join(" ");
  522. }
  523. styleArgumentTerm(t) {
  524. return this.styleArgumentText(t);
  525. }
  526. styleOptionText(t) {
  527. return t;
  528. }
  529. styleArgumentText(t) {
  530. return t;
  531. }
  532. styleSubcommandText(t) {
  533. return t;
  534. }
  535. styleCommandText(t) {
  536. return t;
  537. }
  538. /**
  539. * Calculate the pad width from the maximum term length.
  540. *
  541. * @param {Command} cmd
  542. * @param {Help} helper
  543. * @returns {number}
  544. */
  545. padWidth(t, r) {
  546. return Math.max(
  547. r.longestOptionTermLength(t, r),
  548. r.longestGlobalOptionTermLength(t, r),
  549. r.longestSubcommandTermLength(t, r),
  550. r.longestArgumentTermLength(t, r)
  551. );
  552. }
  553. /**
  554. * Detect manually wrapped and indented strings by checking for line break followed by whitespace.
  555. *
  556. * @param {string} str
  557. * @returns {boolean}
  558. */
  559. preformatted(t) {
  560. return /\n[^\S\r\n]/.test(t);
  561. }
  562. /**
  563. * Format the "item", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.
  564. *
  565. * So "TTT", 5, "DDD DDDD DD DDD" might be formatted for this.helpWidth=17 like so:
  566. * TTT DDD DDDD
  567. * DD DDD
  568. *
  569. * @param {string} term
  570. * @param {number} termWidth
  571. * @param {string} description
  572. * @param {Help} helper
  573. * @returns {string}
  574. */
  575. formatItem(t, r, n, i) {
  576. const o = " ".repeat(2);
  577. if (!n) return o + t;
  578. const a = t.padEnd(
  579. r + t.length - i.displayWidth(t)
  580. ), l = 2, f = (this.helpWidth ?? 80) - r - l - 2;
  581. let u;
  582. return f < this.minWidthToWrap || i.preformatted(n) ? u = n : u = i.boxWrap(n, f).replace(
  583. /\n/g,
  584. `
  585. ` + " ".repeat(r + l)
  586. ), o + a + " ".repeat(l) + u.replace(/\n/g, `
  587. ${o}`);
  588. }
  589. /**
  590. * Wrap a string at whitespace, preserving existing line breaks.
  591. * Wrapping is skipped if the width is less than `minWidthToWrap`.
  592. *
  593. * @param {string} str
  594. * @param {number} width
  595. * @returns {string}
  596. */
  597. boxWrap(t, r) {
  598. if (r < this.minWidthToWrap) return t;
  599. const n = t.split(/\r\n|\n/), i = /[\s]*[^\s]+/g, s = [];
  600. return n.forEach((o) => {
  601. const a = o.match(i);
  602. if (a === null) {
  603. s.push("");
  604. return;
  605. }
  606. let l = [a.shift()], c = this.displayWidth(l[0]);
  607. a.forEach((f) => {
  608. const u = this.displayWidth(f);
  609. if (c + u <= r) {
  610. l.push(f), c += u;
  611. return;
  612. }
  613. s.push(l.join(""));
  614. const h = f.trimStart();
  615. l = [h], c = this.displayWidth(h);
  616. }), s.push(l.join(""));
  617. }), s.join(`
  618. `);
  619. }
  620. };
  621. function ga(e) {
  622. const t = /\x1b\[\d*(;\d*)*m/g;
  623. return e.replace(t, "");
  624. }
  625. qr.Help = Jc;
  626. qr.stripColor = ga;
  627. var Fr = {};
  628. const { InvalidArgumentError: Yc } = bt;
  629. let Xc = class {
  630. /**
  631. * Initialize a new `Option` with the given `flags` and `description`.
  632. *
  633. * @param {string} flags
  634. * @param {string} [description]
  635. */
  636. constructor(t, r) {
  637. this.flags = t, this.description = r || "", this.required = t.includes("<"), this.optional = t.includes("["), this.variadic = /\w\.\.\.[>\]]$/.test(t), this.mandatory = !1;
  638. const n = Zc(t);
  639. this.short = n.shortFlag, this.long = n.longFlag, this.negate = !1, this.long && (this.negate = this.long.startsWith("--no-")), this.defaultValue = void 0, this.defaultValueDescription = void 0, this.presetArg = void 0, this.envVar = void 0, this.parseArg = void 0, this.hidden = !1, this.argChoices = void 0, this.conflictsWith = [], this.implied = void 0, this.helpGroupHeading = void 0;
  640. }
  641. /**
  642. * Set the default value, and optionally supply the description to be displayed in the help.
  643. *
  644. * @param {*} value
  645. * @param {string} [description]
  646. * @return {Option}
  647. */
  648. default(t, r) {
  649. return this.defaultValue = t, this.defaultValueDescription = r, this;
  650. }
  651. /**
  652. * Preset to use when option used without option-argument, especially optional but also boolean and negated.
  653. * The custom processing (parseArg) is called.
  654. *
  655. * @example
  656. * new Option('--color').default('GREYSCALE').preset('RGB');
  657. * new Option('--donate [amount]').preset('20').argParser(parseFloat);
  658. *
  659. * @param {*} arg
  660. * @return {Option}
  661. */
  662. preset(t) {
  663. return this.presetArg = t, this;
  664. }
  665. /**
  666. * Add option name(s) that conflict with this option.
  667. * An error will be displayed if conflicting options are found during parsing.
  668. *
  669. * @example
  670. * new Option('--rgb').conflicts('cmyk');
  671. * new Option('--js').conflicts(['ts', 'jsx']);
  672. *
  673. * @param {(string | string[])} names
  674. * @return {Option}
  675. */
  676. conflicts(t) {
  677. return this.conflictsWith = this.conflictsWith.concat(t), this;
  678. }
  679. /**
  680. * Specify implied option values for when this option is set and the implied options are not.
  681. *
  682. * The custom processing (parseArg) is not called on the implied values.
  683. *
  684. * @example
  685. * program
  686. * .addOption(new Option('--log', 'write logging information to file'))
  687. * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
  688. *
  689. * @param {object} impliedOptionValues
  690. * @return {Option}
  691. */
  692. implies(t) {
  693. let r = t;
  694. return typeof t == "string" && (r = { [t]: !0 }), this.implied = Object.assign(this.implied || {}, r), this;
  695. }
  696. /**
  697. * Set environment variable to check for option value.
  698. *
  699. * An environment variable is only used if when processed the current option value is
  700. * undefined, or the source of the current value is 'default' or 'config' or 'env'.
  701. *
  702. * @param {string} name
  703. * @return {Option}
  704. */
  705. env(t) {
  706. return this.envVar = t, this;
  707. }
  708. /**
  709. * Set the custom handler for processing CLI option arguments into option values.
  710. *
  711. * @param {Function} [fn]
  712. * @return {Option}
  713. */
  714. argParser(t) {
  715. return this.parseArg = t, this;
  716. }
  717. /**
  718. * Whether the option is mandatory and must have a value after parsing.
  719. *
  720. * @param {boolean} [mandatory=true]
  721. * @return {Option}
  722. */
  723. makeOptionMandatory(t = !0) {
  724. return this.mandatory = !!t, this;
  725. }
  726. /**
  727. * Hide option in help.
  728. *
  729. * @param {boolean} [hide=true]
  730. * @return {Option}
  731. */
  732. hideHelp(t = !0) {
  733. return this.hidden = !!t, this;
  734. }
  735. /**
  736. * @package
  737. */
  738. _concatValue(t, r) {
  739. return r === this.defaultValue || !Array.isArray(r) ? [t] : r.concat(t);
  740. }
  741. /**
  742. * Only allow option value to be one of choices.
  743. *
  744. * @param {string[]} values
  745. * @return {Option}
  746. */
  747. choices(t) {
  748. return this.argChoices = t.slice(), this.parseArg = (r, n) => {
  749. if (!this.argChoices.includes(r))
  750. throw new Yc(
  751. `Allowed choices are ${this.argChoices.join(", ")}.`
  752. );
  753. return this.variadic ? this._concatValue(r, n) : r;
  754. }, this;
  755. }
  756. /**
  757. * Return option name.
  758. *
  759. * @return {string}
  760. */
  761. name() {
  762. return this.long ? this.long.replace(/^--/, "") : this.short.replace(/^-/, "");
  763. }
  764. /**
  765. * Return option name, in a camelcase format that can be used
  766. * as an object attribute key.
  767. *
  768. * @return {string}
  769. */
  770. attributeName() {
  771. return this.negate ? Ks(this.name().replace(/^no-/, "")) : Ks(this.name());
  772. }
  773. /**
  774. * Set the help group heading.
  775. *
  776. * @param {string} heading
  777. * @return {Option}
  778. */
  779. helpGroup(t) {
  780. return this.helpGroupHeading = t, this;
  781. }
  782. /**
  783. * Check if `arg` matches the short or long flag.
  784. *
  785. * @param {string} arg
  786. * @return {boolean}
  787. * @package
  788. */
  789. is(t) {
  790. return this.short === t || this.long === t;
  791. }
  792. /**
  793. * Return whether a boolean option.
  794. *
  795. * Options are one of boolean, negated, required argument, or optional argument.
  796. *
  797. * @return {boolean}
  798. * @package
  799. */
  800. isBoolean() {
  801. return !this.required && !this.optional && !this.negate;
  802. }
  803. }, Qc = class {
  804. /**
  805. * @param {Option[]} options
  806. */
  807. constructor(t) {
  808. this.positiveOptions = /* @__PURE__ */ new Map(), this.negativeOptions = /* @__PURE__ */ new Map(), this.dualOptions = /* @__PURE__ */ new Set(), t.forEach((r) => {
  809. r.negate ? this.negativeOptions.set(r.attributeName(), r) : this.positiveOptions.set(r.attributeName(), r);
  810. }), this.negativeOptions.forEach((r, n) => {
  811. this.positiveOptions.has(n) && this.dualOptions.add(n);
  812. });
  813. }
  814. /**
  815. * Did the value come from the option, and not from possible matching dual option?
  816. *
  817. * @param {*} value
  818. * @param {Option} option
  819. * @returns {boolean}
  820. */
  821. valueFromOption(t, r) {
  822. const n = r.attributeName();
  823. if (!this.dualOptions.has(n)) return !0;
  824. const i = this.negativeOptions.get(n).presetArg, s = i !== void 0 ? i : !1;
  825. return r.negate === (s === t);
  826. }
  827. };
  828. function Ks(e) {
  829. return e.split("-").reduce((t, r) => t + r[0].toUpperCase() + r.slice(1));
  830. }
  831. function Zc(e) {
  832. let t, r;
  833. const n = /^-[^-]$/, i = /^--[^-]/, s = e.split(/[ |,]+/).concat("guard");
  834. if (n.test(s[0]) && (t = s.shift()), i.test(s[0]) && (r = s.shift()), !t && n.test(s[0]) && (t = s.shift()), !t && i.test(s[0]) && (t = r, r = s.shift()), s[0].startsWith("-")) {
  835. const o = s[0], a = `option creation failed due to '${o}' in option flags '${e}'`;
  836. throw /^-[^-][^-]/.test(o) ? new Error(
  837. `${a}
  838. - a short flag is a single dash and a single character
  839. - either use a single dash and a single character (for a short flag)
  840. - or use a double dash for a long option (and can have two, like '--ws, --workspace')`
  841. ) : n.test(o) ? new Error(`${a}
  842. - too many short flags`) : i.test(o) ? new Error(`${a}
  843. - too many long flags`) : new Error(`${a}
  844. - unrecognised flag format`);
  845. }
  846. if (t === void 0 && r === void 0)
  847. throw new Error(
  848. `option creation failed due to no flags found in '${e}'.`
  849. );
  850. return { shortFlag: t, longFlag: r };
  851. }
  852. Fr.Option = Xc;
  853. Fr.DualOptions = Qc;
  854. var $a = {};
  855. const _a = 3;
  856. function eu(e, t) {
  857. if (Math.abs(e.length - t.length) > _a)
  858. return Math.max(e.length, t.length);
  859. const r = [];
  860. for (let n = 0; n <= e.length; n++)
  861. r[n] = [n];
  862. for (let n = 0; n <= t.length; n++)
  863. r[0][n] = n;
  864. for (let n = 1; n <= t.length; n++)
  865. for (let i = 1; i <= e.length; i++) {
  866. let s = 1;
  867. e[i - 1] === t[n - 1] ? s = 0 : s = 1, r[i][n] = Math.min(
  868. r[i - 1][n] + 1,
  869. // deletion
  870. r[i][n - 1] + 1,
  871. // insertion
  872. r[i - 1][n - 1] + s
  873. // substitution
  874. ), i > 1 && n > 1 && e[i - 1] === t[n - 2] && e[i - 2] === t[n - 1] && (r[i][n] = Math.min(r[i][n], r[i - 2][n - 2] + 1));
  875. }
  876. return r[e.length][t.length];
  877. }
  878. function tu(e, t) {
  879. if (!t || t.length === 0) return "";
  880. t = Array.from(new Set(t));
  881. const r = e.startsWith("--");
  882. r && (e = e.slice(2), t = t.map((o) => o.slice(2)));
  883. let n = [], i = _a;
  884. const s = 0.4;
  885. return t.forEach((o) => {
  886. if (o.length <= 1) return;
  887. const a = eu(e, o), l = Math.max(e.length, o.length);
  888. (l - a) / l > s && (a < i ? (i = a, n = [o]) : a === i && n.push(o));
  889. }), n.sort((o, a) => o.localeCompare(a)), r && (n = n.map((o) => `--${o}`)), n.length > 1 ? `
  890. (Did you mean one of ${n.join(", ")}?)` : n.length === 1 ? `
  891. (Did you mean ${n[0]}?)` : "";
  892. }
  893. $a.suggestSimilar = tu;
  894. const ru = Mc.EventEmitter, Cn = Dc, Ce = qc, or = Fc, H = Vc, { Argument: nu, humanReadableArgName: iu } = Yt, { CommanderError: In } = bt, { Help: su, stripColor: ou } = qr, { Option: Ws, DualOptions: au } = Fr, { suggestSimilar: Js } = $a;
  895. let lu = class va extends ru {
  896. /**
  897. * Initialize a new `Command`.
  898. *
  899. * @param {string} [name]
  900. */
  901. constructor(t) {
  902. super(), this.commands = [], this.options = [], this.parent = null, this._allowUnknownOption = !1, this._allowExcessArguments = !1, this.registeredArguments = [], this._args = this.registeredArguments, this.args = [], this.rawArgs = [], this.processedArgs = [], this._scriptPath = null, this._name = t || "", this._optionValues = {}, this._optionValueSources = {}, this._storeOptionsAsProperties = !1, this._actionHandler = null, this._executableHandler = !1, this._executableFile = null, this._executableDir = null, this._defaultCommandName = null, this._exitCallback = null, this._aliases = [], this._combineFlagAndOptionalValue = !0, this._description = "", this._summary = "", this._argsDescription = void 0, this._enablePositionalOptions = !1, this._passThroughOptions = !1, this._lifeCycleHooks = {}, this._showHelpAfterError = !1, this._showSuggestionAfterError = !0, this._savedState = null, this._outputConfiguration = {
  903. writeOut: (r) => H.stdout.write(r),
  904. writeErr: (r) => H.stderr.write(r),
  905. outputError: (r, n) => n(r),
  906. getOutHelpWidth: () => H.stdout.isTTY ? H.stdout.columns : void 0,
  907. getErrHelpWidth: () => H.stderr.isTTY ? H.stderr.columns : void 0,
  908. getOutHasColors: () => {
  909. var r, n;
  910. return Kn() ?? (H.stdout.isTTY && ((n = (r = H.stdout).hasColors) == null ? void 0 : n.call(r)));
  911. },
  912. getErrHasColors: () => {
  913. var r, n;
  914. return Kn() ?? (H.stderr.isTTY && ((n = (r = H.stderr).hasColors) == null ? void 0 : n.call(r)));
  915. },
  916. stripColor: (r) => ou(r)
  917. }, this._hidden = !1, this._helpOption = void 0, this._addImplicitHelpCommand = void 0, this._helpCommand = void 0, this._helpConfiguration = {}, this._helpGroupHeading = void 0, this._defaultCommandGroup = void 0, this._defaultOptionGroup = void 0;
  918. }
  919. /**
  920. * Copy settings that are useful to have in common across root command and subcommands.
  921. *
  922. * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
  923. *
  924. * @param {Command} sourceCommand
  925. * @return {Command} `this` command for chaining
  926. */
  927. copyInheritedSettings(t) {
  928. return this._outputConfiguration = t._outputConfiguration, this._helpOption = t._helpOption, this._helpCommand = t._helpCommand, this._helpConfiguration = t._helpConfiguration, this._exitCallback = t._exitCallback, this._storeOptionsAsProperties = t._storeOptionsAsProperties, this._combineFlagAndOptionalValue = t._combineFlagAndOptionalValue, this._allowExcessArguments = t._allowExcessArguments, this._enablePositionalOptions = t._enablePositionalOptions, this._showHelpAfterError = t._showHelpAfterError, this._showSuggestionAfterError = t._showSuggestionAfterError, this;
  929. }
  930. /**
  931. * @returns {Command[]}
  932. * @private
  933. */
  934. _getCommandAndAncestors() {
  935. const t = [];
  936. for (let r = this; r; r = r.parent)
  937. t.push(r);
  938. return t;
  939. }
  940. /**
  941. * Define a command.
  942. *
  943. * There are two styles of command: pay attention to where to put the description.
  944. *
  945. * @example
  946. * // Command implemented using action handler (description is supplied separately to `.command`)
  947. * program
  948. * .command('clone <source> [destination]')
  949. * .description('clone a repository into a newly created directory')
  950. * .action((source, destination) => {
  951. * console.log('clone command called');
  952. * });
  953. *
  954. * // Command implemented using separate executable file (description is second parameter to `.command`)
  955. * program
  956. * .command('start <service>', 'start named service')
  957. * .command('stop [service]', 'stop named service, or all if no name supplied');
  958. *
  959. * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
  960. * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)
  961. * @param {object} [execOpts] - configuration options (for executable)
  962. * @return {Command} returns new command for action handler, or `this` for executable command
  963. */
  964. command(t, r, n) {
  965. let i = r, s = n;
  966. typeof i == "object" && i !== null && (s = i, i = null), s = s || {};
  967. const [, o, a] = t.match(/([^ ]+) *(.*)/), l = this.createCommand(o);
  968. return i && (l.description(i), l._executableHandler = !0), s.isDefault && (this._defaultCommandName = l._name), l._hidden = !!(s.noHelp || s.hidden), l._executableFile = s.executableFile || null, a && l.arguments(a), this._registerCommand(l), l.parent = this, l.copyInheritedSettings(this), i ? this : l;
  969. }
  970. /**
  971. * Factory routine to create a new unattached command.
  972. *
  973. * See .command() for creating an attached subcommand, which uses this routine to
  974. * create the command. You can override createCommand to customise subcommands.
  975. *
  976. * @param {string} [name]
  977. * @return {Command} new command
  978. */
  979. createCommand(t) {
  980. return new va(t);
  981. }
  982. /**
  983. * You can customise the help with a subclass of Help by overriding createHelp,
  984. * or by overriding Help properties using configureHelp().
  985. *
  986. * @return {Help}
  987. */
  988. createHelp() {
  989. return Object.assign(new su(), this.configureHelp());
  990. }
  991. /**
  992. * You can customise the help by overriding Help properties using configureHelp(),
  993. * or with a subclass of Help by overriding createHelp().
  994. *
  995. * @param {object} [configuration] - configuration options
  996. * @return {(Command | object)} `this` command for chaining, or stored configuration
  997. */
  998. configureHelp(t) {
  999. return t === void 0 ? this._helpConfiguration : (this._helpConfiguration = t, this);
  1000. }
  1001. /**
  1002. * The default output goes to stdout and stderr. You can customise this for special
  1003. * applications. You can also customise the display of errors by overriding outputError.
  1004. *
  1005. * The configuration properties are all functions:
  1006. *
  1007. * // change how output being written, defaults to stdout and stderr
  1008. * writeOut(str)
  1009. * writeErr(str)
  1010. * // change how output being written for errors, defaults to writeErr
  1011. * outputError(str, write) // used for displaying errors and not used for displaying help
  1012. * // specify width for wrapping help
  1013. * getOutHelpWidth()
  1014. * getErrHelpWidth()
  1015. * // color support, currently only used with Help
  1016. * getOutHasColors()
  1017. * getErrHasColors()
  1018. * stripColor() // used to remove ANSI escape codes if output does not have colors
  1019. *
  1020. * @param {object} [configuration] - configuration options
  1021. * @return {(Command | object)} `this` command for chaining, or stored configuration
  1022. */
  1023. configureOutput(t) {
  1024. return t === void 0 ? this._outputConfiguration : (this._outputConfiguration = Object.assign(
  1025. {},
  1026. this._outputConfiguration,
  1027. t
  1028. ), this);
  1029. }
  1030. /**
  1031. * Display the help or a custom message after an error occurs.
  1032. *
  1033. * @param {(boolean|string)} [displayHelp]
  1034. * @return {Command} `this` command for chaining
  1035. */
  1036. showHelpAfterError(t = !0) {
  1037. return typeof t != "string" && (t = !!t), this._showHelpAfterError = t, this;
  1038. }
  1039. /**
  1040. * Display suggestion of similar commands for unknown commands, or options for unknown options.
  1041. *
  1042. * @param {boolean} [displaySuggestion]
  1043. * @return {Command} `this` command for chaining
  1044. */
  1045. showSuggestionAfterError(t = !0) {
  1046. return this._showSuggestionAfterError = !!t, this;
  1047. }
  1048. /**
  1049. * Add a prepared subcommand.
  1050. *
  1051. * See .command() for creating an attached subcommand which inherits settings from its parent.
  1052. *
  1053. * @param {Command} cmd - new subcommand
  1054. * @param {object} [opts] - configuration options
  1055. * @return {Command} `this` command for chaining
  1056. */
  1057. addCommand(t, r) {
  1058. if (!t._name)
  1059. throw new Error(`Command passed to .addCommand() must have a name
  1060. - specify the name in Command constructor or using .name()`);
  1061. return r = r || {}, r.isDefault && (this._defaultCommandName = t._name), (r.noHelp || r.hidden) && (t._hidden = !0), this._registerCommand(t), t.parent = this, t._checkForBrokenPassThrough(), this;
  1062. }
  1063. /**
  1064. * Factory routine to create a new unattached argument.
  1065. *
  1066. * See .argument() for creating an attached argument, which uses this routine to
  1067. * create the argument. You can override createArgument to return a custom argument.
  1068. *
  1069. * @param {string} name
  1070. * @param {string} [description]
  1071. * @return {Argument} new argument
  1072. */
  1073. createArgument(t, r) {
  1074. return new nu(t, r);
  1075. }
  1076. /**
  1077. * Define argument syntax for command.
  1078. *
  1079. * The default is that the argument is required, and you can explicitly
  1080. * indicate this with <> around the name. Put [] around the name for an optional argument.
  1081. *
  1082. * @example
  1083. * program.argument('<input-file>');
  1084. * program.argument('[output-file]');
  1085. *
  1086. * @param {string} name
  1087. * @param {string} [description]
  1088. * @param {(Function|*)} [parseArg] - custom argument processing function or default value
  1089. * @param {*} [defaultValue]
  1090. * @return {Command} `this` command for chaining
  1091. */
  1092. argument(t, r, n, i) {
  1093. const s = this.createArgument(t, r);
  1094. return typeof n == "function" ? s.default(i).argParser(n) : s.default(n), this.addArgument(s), this;
  1095. }
  1096. /**
  1097. * Define argument syntax for command, adding multiple at once (without descriptions).
  1098. *
  1099. * See also .argument().
  1100. *
  1101. * @example
  1102. * program.arguments('<cmd> [env]');
  1103. *
  1104. * @param {string} names
  1105. * @return {Command} `this` command for chaining
  1106. */
  1107. arguments(t) {
  1108. return t.trim().split(/ +/).forEach((r) => {
  1109. this.argument(r);
  1110. }), this;
  1111. }
  1112. /**
  1113. * Define argument syntax for command, adding a prepared argument.
  1114. *
  1115. * @param {Argument} argument
  1116. * @return {Command} `this` command for chaining
  1117. */
  1118. addArgument(t) {
  1119. const r = this.registeredArguments.slice(-1)[0];
  1120. if (r && r.variadic)
  1121. throw new Error(
  1122. `only the last argument can be variadic '${r.name()}'`
  1123. );
  1124. if (t.required && t.defaultValue !== void 0 && t.parseArg === void 0)
  1125. throw new Error(
  1126. `a default value for a required argument is never used: '${t.name()}'`
  1127. );
  1128. return this.registeredArguments.push(t), this;
  1129. }
  1130. /**
  1131. * Customise or override default help command. By default a help command is automatically added if your command has subcommands.
  1132. *
  1133. * @example
  1134. * program.helpCommand('help [cmd]');
  1135. * program.helpCommand('help [cmd]', 'show help');
  1136. * program.helpCommand(false); // suppress default help command
  1137. * program.helpCommand(true); // add help command even if no subcommands
  1138. *
  1139. * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added
  1140. * @param {string} [description] - custom description
  1141. * @return {Command} `this` command for chaining
  1142. */
  1143. helpCommand(t, r) {
  1144. if (typeof t == "boolean")
  1145. return this._addImplicitHelpCommand = t, t && this._defaultCommandGroup && this._initCommandGroup(this._getHelpCommand()), this;
  1146. const n = t ?? "help [command]", [, i, s] = n.match(/([^ ]+) *(.*)/), o = r ?? "display help for command", a = this.createCommand(i);
  1147. return a.helpOption(!1), s && a.arguments(s), o && a.description(o), this._addImplicitHelpCommand = !0, this._helpCommand = a, (t || r) && this._initCommandGroup(a), this;
  1148. }
  1149. /**
  1150. * Add prepared custom help command.
  1151. *
  1152. * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`
  1153. * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only
  1154. * @return {Command} `this` command for chaining
  1155. */
  1156. addHelpCommand(t, r) {
  1157. return typeof t != "object" ? (this.helpCommand(t, r), this) : (this._addImplicitHelpCommand = !0, this._helpCommand = t, this._initCommandGroup(t), this);
  1158. }
  1159. /**
  1160. * Lazy create help command.
  1161. *
  1162. * @return {(Command|null)}
  1163. * @package
  1164. */
  1165. _getHelpCommand() {
  1166. return this._addImplicitHelpCommand ?? (this.commands.length && !this._actionHandler && !this._findCommand("help")) ? (this._helpCommand === void 0 && this.helpCommand(void 0, void 0), this._helpCommand) : null;
  1167. }
  1168. /**
  1169. * Add hook for life cycle event.
  1170. *
  1171. * @param {string} event
  1172. * @param {Function} listener
  1173. * @return {Command} `this` command for chaining
  1174. */
  1175. hook(t, r) {
  1176. const n = ["preSubcommand", "preAction", "postAction"];
  1177. if (!n.includes(t))
  1178. throw new Error(`Unexpected value for event passed to hook : '${t}'.
  1179. Expecting one of '${n.join("', '")}'`);
  1180. return this._lifeCycleHooks[t] ? this._lifeCycleHooks[t].push(r) : this._lifeCycleHooks[t] = [r], this;
  1181. }
  1182. /**
  1183. * Register callback to use as replacement for calling process.exit.
  1184. *
  1185. * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing
  1186. * @return {Command} `this` command for chaining
  1187. */
  1188. exitOverride(t) {
  1189. return t ? this._exitCallback = t : this._exitCallback = (r) => {
  1190. if (r.code !== "commander.executeSubCommandAsync")
  1191. throw r;
  1192. }, this;
  1193. }
  1194. /**
  1195. * Call process.exit, and _exitCallback if defined.
  1196. *
  1197. * @param {number} exitCode exit code for using with process.exit
  1198. * @param {string} code an id string representing the error
  1199. * @param {string} message human-readable description of the error
  1200. * @return never
  1201. * @private
  1202. */
  1203. _exit(t, r, n) {
  1204. this._exitCallback && this._exitCallback(new In(t, r, n)), H.exit(t);
  1205. }
  1206. /**
  1207. * Register callback `fn` for the command.
  1208. *
  1209. * @example
  1210. * program
  1211. * .command('serve')
  1212. * .description('start service')
  1213. * .action(function() {
  1214. * // do work here
  1215. * });
  1216. *
  1217. * @param {Function} fn
  1218. * @return {Command} `this` command for chaining
  1219. */
  1220. action(t) {
  1221. const r = (n) => {
  1222. const i = this.registeredArguments.length, s = n.slice(0, i);
  1223. return this._storeOptionsAsProperties ? s[i] = this : s[i] = this.opts(), s.push(this), t.apply(this, s);
  1224. };
  1225. return this._actionHandler = r, this;
  1226. }
  1227. /**
  1228. * Factory routine to create a new unattached option.
  1229. *
  1230. * See .option() for creating an attached option, which uses this routine to
  1231. * create the option. You can override createOption to return a custom option.
  1232. *
  1233. * @param {string} flags
  1234. * @param {string} [description]
  1235. * @return {Option} new option
  1236. */
  1237. createOption(t, r) {
  1238. return new Ws(t, r);
  1239. }
  1240. /**
  1241. * Wrap parseArgs to catch 'commander.invalidArgument'.
  1242. *
  1243. * @param {(Option | Argument)} target
  1244. * @param {string} value
  1245. * @param {*} previous
  1246. * @param {string} invalidArgumentMessage
  1247. * @private
  1248. */
  1249. _callParseArg(t, r, n, i) {
  1250. try {
  1251. return t.parseArg(r, n);
  1252. } catch (s) {
  1253. if (s.code === "commander.invalidArgument") {
  1254. const o = `${i} ${s.message}`;
  1255. this.error(o, { exitCode: s.exitCode, code: s.code });
  1256. }
  1257. throw s;
  1258. }
  1259. }
  1260. /**
  1261. * Check for option flag conflicts.
  1262. * Register option if no conflicts found, or throw on conflict.
  1263. *
  1264. * @param {Option} option
  1265. * @private
  1266. */
  1267. _registerOption(t) {
  1268. const r = t.short && this._findOption(t.short) || t.long && this._findOption(t.long);
  1269. if (r) {
  1270. const n = t.long && this._findOption(t.long) ? t.long : t.short;
  1271. throw new Error(`Cannot add option '${t.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${n}'
  1272. - already used by option '${r.flags}'`);
  1273. }
  1274. this._initOptionGroup(t), this.options.push(t);
  1275. }
  1276. /**
  1277. * Check for command name and alias conflicts with existing commands.
  1278. * Register command if no conflicts found, or throw on conflict.
  1279. *
  1280. * @param {Command} command
  1281. * @private
  1282. */
  1283. _registerCommand(t) {
  1284. const r = (i) => [i.name()].concat(i.aliases()), n = r(t).find(
  1285. (i) => this._findCommand(i)
  1286. );
  1287. if (n) {
  1288. const i = r(this._findCommand(n)).join("|"), s = r(t).join("|");
  1289. throw new Error(
  1290. `cannot add command '${s}' as already have command '${i}'`
  1291. );
  1292. }
  1293. this._initCommandGroup(t), this.commands.push(t);
  1294. }
  1295. /**
  1296. * Add an option.
  1297. *
  1298. * @param {Option} option
  1299. * @return {Command} `this` command for chaining
  1300. */
  1301. addOption(t) {
  1302. this._registerOption(t);
  1303. const r = t.name(), n = t.attributeName();
  1304. if (t.negate) {
  1305. const s = t.long.replace(/^--no-/, "--");
  1306. this._findOption(s) || this.setOptionValueWithSource(
  1307. n,
  1308. t.defaultValue === void 0 ? !0 : t.defaultValue,
  1309. "default"
  1310. );
  1311. } else t.defaultValue !== void 0 && this.setOptionValueWithSource(n, t.defaultValue, "default");
  1312. const i = (s, o, a) => {
  1313. s == null && t.presetArg !== void 0 && (s = t.presetArg);
  1314. const l = this.getOptionValue(n);
  1315. s !== null && t.parseArg ? s = this._callParseArg(t, s, l, o) : s !== null && t.variadic && (s = t._concatValue(s, l)), s == null && (t.negate ? s = !1 : t.isBoolean() || t.optional ? s = !0 : s = ""), this.setOptionValueWithSource(n, s, a);
  1316. };
  1317. return this.on("option:" + r, (s) => {
  1318. const o = `error: option '${t.flags}' argument '${s}' is invalid.`;
  1319. i(s, o, "cli");
  1320. }), t.envVar && this.on("optionEnv:" + r, (s) => {
  1321. const o = `error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;
  1322. i(s, o, "env");
  1323. }), this;
  1324. }
  1325. /**
  1326. * Internal implementation shared by .option() and .requiredOption()
  1327. *
  1328. * @return {Command} `this` command for chaining
  1329. * @private
  1330. */
  1331. _optionEx(t, r, n, i, s) {
  1332. if (typeof r == "object" && r instanceof Ws)
  1333. throw new Error(
  1334. "To add an Option object use addOption() instead of option() or requiredOption()"
  1335. );
  1336. const o = this.createOption(r, n);
  1337. if (o.makeOptionMandatory(!!t.mandatory), typeof i == "function")
  1338. o.default(s).argParser(i);
  1339. else if (i instanceof RegExp) {
  1340. const a = i;
  1341. i = (l, c) => {
  1342. const f = a.exec(l);
  1343. return f ? f[0] : c;
  1344. }, o.default(s).argParser(i);
  1345. } else
  1346. o.default(i);
  1347. return this.addOption(o);
  1348. }
  1349. /**
  1350. * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
  1351. *
  1352. * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
  1353. * option-argument is indicated by `<>` and an optional option-argument by `[]`.
  1354. *
  1355. * See the README for more details, and see also addOption() and requiredOption().
  1356. *
  1357. * @example
  1358. * program
  1359. * .option('-p, --pepper', 'add pepper')
  1360. * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument
  1361. * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
  1362. * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
  1363. *
  1364. * @param {string} flags
  1365. * @param {string} [description]
  1366. * @param {(Function|*)} [parseArg] - custom option processing function or default value
  1367. * @param {*} [defaultValue]
  1368. * @return {Command} `this` command for chaining
  1369. */
  1370. option(t, r, n, i) {
  1371. return this._optionEx({}, t, r, n, i);
  1372. }
  1373. /**
  1374. * Add a required option which must have a value after parsing. This usually means
  1375. * the option must be specified on the command line. (Otherwise the same as .option().)
  1376. *
  1377. * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
  1378. *
  1379. * @param {string} flags
  1380. * @param {string} [description]
  1381. * @param {(Function|*)} [parseArg] - custom option processing function or default value
  1382. * @param {*} [defaultValue]
  1383. * @return {Command} `this` command for chaining
  1384. */
  1385. requiredOption(t, r, n, i) {
  1386. return this._optionEx(
  1387. { mandatory: !0 },
  1388. t,
  1389. r,
  1390. n,
  1391. i
  1392. );
  1393. }
  1394. /**
  1395. * Alter parsing of short flags with optional values.
  1396. *
  1397. * @example
  1398. * // for `.option('-f,--flag [value]'):
  1399. * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour
  1400. * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
  1401. *
  1402. * @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.
  1403. * @return {Command} `this` command for chaining
  1404. */
  1405. combineFlagAndOptionalValue(t = !0) {
  1406. return this._combineFlagAndOptionalValue = !!t, this;
  1407. }
  1408. /**
  1409. * Allow unknown options on the command line.
  1410. *
  1411. * @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options.
  1412. * @return {Command} `this` command for chaining
  1413. */
  1414. allowUnknownOption(t = !0) {
  1415. return this._allowUnknownOption = !!t, this;
  1416. }
  1417. /**
  1418. * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
  1419. *
  1420. * @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments.
  1421. * @return {Command} `this` command for chaining
  1422. */
  1423. allowExcessArguments(t = !0) {
  1424. return this._allowExcessArguments = !!t, this;
  1425. }
  1426. /**
  1427. * Enable positional options. Positional means global options are specified before subcommands which lets
  1428. * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
  1429. * The default behaviour is non-positional and global options may appear anywhere on the command line.
  1430. *
  1431. * @param {boolean} [positional]
  1432. * @return {Command} `this` command for chaining
  1433. */
  1434. enablePositionalOptions(t = !0) {
  1435. return this._enablePositionalOptions = !!t, this;
  1436. }
  1437. /**
  1438. * Pass through options that come after command-arguments rather than treat them as command-options,
  1439. * so actual command-options come before command-arguments. Turning this on for a subcommand requires
  1440. * positional options to have been enabled on the program (parent commands).
  1441. * The default behaviour is non-positional and options may appear before or after command-arguments.
  1442. *
  1443. * @param {boolean} [passThrough] for unknown options.
  1444. * @return {Command} `this` command for chaining
  1445. */
  1446. passThroughOptions(t = !0) {
  1447. return this._passThroughOptions = !!t, this._checkForBrokenPassThrough(), this;
  1448. }
  1449. /**
  1450. * @private
  1451. */
  1452. _checkForBrokenPassThrough() {
  1453. if (this.parent && this._passThroughOptions && !this.parent._enablePositionalOptions)
  1454. throw new Error(
  1455. `passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`
  1456. );
  1457. }
  1458. /**
  1459. * Whether to store option values as properties on command object,
  1460. * or store separately (specify false). In both cases the option values can be accessed using .opts().
  1461. *
  1462. * @param {boolean} [storeAsProperties=true]
  1463. * @return {Command} `this` command for chaining
  1464. */
  1465. storeOptionsAsProperties(t = !0) {
  1466. if (this.options.length)
  1467. throw new Error("call .storeOptionsAsProperties() before adding options");
  1468. if (Object.keys(this._optionValues).length)
  1469. throw new Error(
  1470. "call .storeOptionsAsProperties() before setting option values"
  1471. );
  1472. return this._storeOptionsAsProperties = !!t, this;
  1473. }
  1474. /**
  1475. * Retrieve option value.
  1476. *
  1477. * @param {string} key
  1478. * @return {object} value
  1479. */
  1480. getOptionValue(t) {
  1481. return this._storeOptionsAsProperties ? this[t] : this._optionValues[t];
  1482. }
  1483. /**
  1484. * Store option value.
  1485. *
  1486. * @param {string} key
  1487. * @param {object} value
  1488. * @return {Command} `this` command for chaining
  1489. */
  1490. setOptionValue(t, r) {
  1491. return this.setOptionValueWithSource(t, r, void 0);
  1492. }
  1493. /**
  1494. * Store option value and where the value came from.
  1495. *
  1496. * @param {string} key
  1497. * @param {object} value
  1498. * @param {string} source - expected values are default/config/env/cli/implied
  1499. * @return {Command} `this` command for chaining
  1500. */
  1501. setOptionValueWithSource(t, r, n) {
  1502. return this._storeOptionsAsProperties ? this[t] = r : this._optionValues[t] = r, this._optionValueSources[t] = n, this;
  1503. }
  1504. /**
  1505. * Get source of option value.
  1506. * Expected values are default | config | env | cli | implied
  1507. *
  1508. * @param {string} key
  1509. * @return {string}
  1510. */
  1511. getOptionValueSource(t) {
  1512. return this._optionValueSources[t];
  1513. }
  1514. /**
  1515. * Get source of option value. See also .optsWithGlobals().
  1516. * Expected values are default | config | env | cli | implied
  1517. *
  1518. * @param {string} key
  1519. * @return {string}
  1520. */
  1521. getOptionValueSourceWithGlobals(t) {
  1522. let r;
  1523. return this._getCommandAndAncestors().forEach((n) => {
  1524. n.getOptionValueSource(t) !== void 0 && (r = n.getOptionValueSource(t));
  1525. }), r;
  1526. }
  1527. /**
  1528. * Get user arguments from implied or explicit arguments.
  1529. * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.
  1530. *
  1531. * @private
  1532. */
  1533. _prepareUserArgs(t, r) {
  1534. var i;
  1535. if (t !== void 0 && !Array.isArray(t))
  1536. throw new Error("first parameter to parse must be array or undefined");
  1537. if (r = r || {}, t === void 0 && r.from === void 0) {
  1538. (i = H.versions) != null && i.electron && (r.from = "electron");
  1539. const s = H.execArgv ?? [];
  1540. (s.includes("-e") || s.includes("--eval") || s.includes("-p") || s.includes("--print")) && (r.from = "eval");
  1541. }
  1542. t === void 0 && (t = H.argv), this.rawArgs = t.slice();
  1543. let n;
  1544. switch (r.from) {
  1545. case void 0:
  1546. case "node":
  1547. this._scriptPath = t[1], n = t.slice(2);
  1548. break;
  1549. case "electron":
  1550. H.defaultApp ? (this._scriptPath = t[1], n = t.slice(2)) : n = t.slice(1);
  1551. break;
  1552. case "user":
  1553. n = t.slice(0);
  1554. break;
  1555. case "eval":
  1556. n = t.slice(1);
  1557. break;
  1558. default:
  1559. throw new Error(
  1560. `unexpected parse option { from: '${r.from}' }`
  1561. );
  1562. }
  1563. return !this._name && this._scriptPath && this.nameFromFilename(this._scriptPath), this._name = this._name || "program", n;
  1564. }
  1565. /**
  1566. * Parse `argv`, setting options and invoking commands when defined.
  1567. *
  1568. * Use parseAsync instead of parse if any of your action handlers are async.
  1569. *
  1570. * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
  1571. *
  1572. * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
  1573. * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
  1574. * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
  1575. * - `'user'`: just user arguments
  1576. *
  1577. * @example
  1578. * program.parse(); // parse process.argv and auto-detect electron and special node flags
  1579. * program.parse(process.argv); // assume argv[0] is app and argv[1] is script
  1580. * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
  1581. *
  1582. * @param {string[]} [argv] - optional, defaults to process.argv
  1583. * @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron
  1584. * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'
  1585. * @return {Command} `this` command for chaining
  1586. */
  1587. parse(t, r) {
  1588. this._prepareForParse();
  1589. const n = this._prepareUserArgs(t, r);
  1590. return this._parseCommand([], n), this;
  1591. }
  1592. /**
  1593. * Parse `argv`, setting options and invoking commands when defined.
  1594. *
  1595. * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
  1596. *
  1597. * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
  1598. * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
  1599. * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
  1600. * - `'user'`: just user arguments
  1601. *
  1602. * @example
  1603. * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags
  1604. * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script
  1605. * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
  1606. *
  1607. * @param {string[]} [argv]
  1608. * @param {object} [parseOptions]
  1609. * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'
  1610. * @return {Promise}
  1611. */
  1612. async parseAsync(t, r) {
  1613. this._prepareForParse();
  1614. const n = this._prepareUserArgs(t, r);
  1615. return await this._parseCommand([], n), this;
  1616. }
  1617. _prepareForParse() {
  1618. this._savedState === null ? this.saveStateBeforeParse() : this.restoreStateBeforeParse();
  1619. }
  1620. /**
  1621. * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.
  1622. * Not usually called directly, but available for subclasses to save their custom state.
  1623. *
  1624. * This is called in a lazy way. Only commands used in parsing chain will have state saved.
  1625. */
  1626. saveStateBeforeParse() {
  1627. this._savedState = {
  1628. // name is stable if supplied by author, but may be unspecified for root command and deduced during parsing
  1629. _name: this._name,
  1630. // option values before parse have default values (including false for negated options)
  1631. // shallow clones
  1632. _optionValues: { ...this._optionValues },
  1633. _optionValueSources: { ...this._optionValueSources }
  1634. };
  1635. }
  1636. /**
  1637. * Restore state before parse for calls after the first.
  1638. * Not usually called directly, but available for subclasses to save their custom state.
  1639. *
  1640. * This is called in a lazy way. Only commands used in parsing chain will have state restored.
  1641. */
  1642. restoreStateBeforeParse() {
  1643. if (this._storeOptionsAsProperties)
  1644. throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
  1645. - either make a new Command for each call to parse, or stop storing options as properties`);
  1646. this._name = this._savedState._name, this._scriptPath = null, this.rawArgs = [], this._optionValues = { ...this._savedState._optionValues }, this._optionValueSources = { ...this._savedState._optionValueSources }, this.args = [], this.processedArgs = [];
  1647. }
  1648. /**
  1649. * Throw if expected executable is missing. Add lots of help for author.
  1650. *
  1651. * @param {string} executableFile
  1652. * @param {string} executableDir
  1653. * @param {string} subcommandName
  1654. */
  1655. _checkForMissingExecutable(t, r, n) {
  1656. if (or.existsSync(t)) return;
  1657. const i = r ? `searched for local subcommand relative to directory '${r}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory", s = `'${t}' does not exist
  1658. - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
  1659. - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
  1660. - ${i}`;
  1661. throw new Error(s);
  1662. }
  1663. /**
  1664. * Execute a sub-command executable.
  1665. *
  1666. * @private
  1667. */
  1668. _executeSubCommand(t, r) {
  1669. r = r.slice();
  1670. let n = !1;
  1671. const i = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
  1672. function s(f, u) {
  1673. const h = Ce.resolve(f, u);
  1674. if (or.existsSync(h)) return h;
  1675. if (i.includes(Ce.extname(u))) return;
  1676. const y = i.find(
  1677. (_) => or.existsSync(`${h}${_}`)
  1678. );
  1679. if (y) return `${h}${y}`;
  1680. }
  1681. this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
  1682. let o = t._executableFile || `${this._name}-${t._name}`, a = this._executableDir || "";
  1683. if (this._scriptPath) {
  1684. let f;
  1685. try {
  1686. f = or.realpathSync(this._scriptPath);
  1687. } catch {
  1688. f = this._scriptPath;
  1689. }
  1690. a = Ce.resolve(
  1691. Ce.dirname(f),
  1692. a
  1693. );
  1694. }
  1695. if (a) {
  1696. let f = s(a, o);
  1697. if (!f && !t._executableFile && this._scriptPath) {
  1698. const u = Ce.basename(
  1699. this._scriptPath,
  1700. Ce.extname(this._scriptPath)
  1701. );
  1702. u !== this._name && (f = s(
  1703. a,
  1704. `${u}-${t._name}`
  1705. ));
  1706. }
  1707. o = f || o;
  1708. }
  1709. n = i.includes(Ce.extname(o));
  1710. let l;
  1711. H.platform !== "win32" ? n ? (r.unshift(o), r = Ys(H.execArgv).concat(r), l = Cn.spawn(H.argv[0], r, { stdio: "inherit" })) : l = Cn.spawn(o, r, { stdio: "inherit" }) : (this._checkForMissingExecutable(
  1712. o,
  1713. a,
  1714. t._name
  1715. ), r.unshift(o), r = Ys(H.execArgv).concat(r), l = Cn.spawn(H.execPath, r, { stdio: "inherit" })), l.killed || ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"].forEach((u) => {
  1716. H.on(u, () => {
  1717. l.killed === !1 && l.exitCode === null && l.kill(u);
  1718. });
  1719. });
  1720. const c = this._exitCallback;
  1721. l.on("close", (f) => {
  1722. f = f ?? 1, c ? c(
  1723. new In(
  1724. f,
  1725. "commander.executeSubCommandAsync",
  1726. "(close)"
  1727. )
  1728. ) : H.exit(f);
  1729. }), l.on("error", (f) => {
  1730. if (f.code === "ENOENT")
  1731. this._checkForMissingExecutable(
  1732. o,
  1733. a,
  1734. t._name
  1735. );
  1736. else if (f.code === "EACCES")
  1737. throw new Error(`'${o}' not executable`);
  1738. if (!c)
  1739. H.exit(1);
  1740. else {
  1741. const u = new In(
  1742. 1,
  1743. "commander.executeSubCommandAsync",
  1744. "(error)"
  1745. );
  1746. u.nestedError = f, c(u);
  1747. }
  1748. }), this.runningCommand = l;
  1749. }
  1750. /**
  1751. * @private
  1752. */
  1753. _dispatchSubcommand(t, r, n) {
  1754. const i = this._findCommand(t);
  1755. i || this.help({ error: !0 }), i._prepareForParse();
  1756. let s;
  1757. return s = this._chainOrCallSubCommandHook(
  1758. s,
  1759. i,
  1760. "preSubcommand"
  1761. ), s = this._chainOrCall(s, () => {
  1762. if (i._executableHandler)
  1763. this._executeSubCommand(i, r.concat(n));
  1764. else
  1765. return i._parseCommand(r, n);
  1766. }), s;
  1767. }
  1768. /**
  1769. * Invoke help directly if possible, or dispatch if necessary.
  1770. * e.g. help foo
  1771. *
  1772. * @private
  1773. */
  1774. _dispatchHelpCommand(t) {
  1775. var n, i;
  1776. t || this.help();
  1777. const r = this._findCommand(t);
  1778. return r && !r._executableHandler && r.help(), this._dispatchSubcommand(
  1779. t,
  1780. [],
  1781. [((n = this._getHelpOption()) == null ? void 0 : n.long) ?? ((i = this._getHelpOption()) == null ? void 0 : i.short) ?? "--help"]
  1782. );
  1783. }
  1784. /**
  1785. * Check this.args against expected this.registeredArguments.
  1786. *
  1787. * @private
  1788. */
  1789. _checkNumberOfArguments() {
  1790. this.registeredArguments.forEach((t, r) => {
  1791. t.required && this.args[r] == null && this.missingArgument(t.name());
  1792. }), !(this.registeredArguments.length > 0 && this.registeredArguments[this.registeredArguments.length - 1].variadic) && this.args.length > this.registeredArguments.length && this._excessArguments(this.args);
  1793. }
  1794. /**
  1795. * Process this.args using this.registeredArguments and save as this.processedArgs!
  1796. *
  1797. * @private
  1798. */
  1799. _processArguments() {
  1800. const t = (n, i, s) => {
  1801. let o = i;
  1802. if (i !== null && n.parseArg) {
  1803. const a = `error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;
  1804. o = this._callParseArg(
  1805. n,
  1806. i,
  1807. s,
  1808. a
  1809. );
  1810. }
  1811. return o;
  1812. };
  1813. this._checkNumberOfArguments();
  1814. const r = [];
  1815. this.registeredArguments.forEach((n, i) => {
  1816. let s = n.defaultValue;
  1817. n.variadic ? i < this.args.length ? (s = this.args.slice(i), n.parseArg && (s = s.reduce((o, a) => t(n, a, o), n.defaultValue))) : s === void 0 && (s = []) : i < this.args.length && (s = this.args[i], n.parseArg && (s = t(n, s, n.defaultValue))), r[i] = s;
  1818. }), this.processedArgs = r;
  1819. }
  1820. /**
  1821. * Once we have a promise we chain, but call synchronously until then.
  1822. *
  1823. * @param {(Promise|undefined)} promise
  1824. * @param {Function} fn
  1825. * @return {(Promise|undefined)}
  1826. * @private
  1827. */
  1828. _chainOrCall(t, r) {
  1829. return t && t.then && typeof t.then == "function" ? t.then(() => r()) : r();
  1830. }
  1831. /**
  1832. *
  1833. * @param {(Promise|undefined)} promise
  1834. * @param {string} event
  1835. * @return {(Promise|undefined)}
  1836. * @private
  1837. */
  1838. _chainOrCallHooks(t, r) {
  1839. let n = t;
  1840. const i = [];
  1841. return this._getCommandAndAncestors().reverse().filter((s) => s._lifeCycleHooks[r] !== void 0).forEach((s) => {
  1842. s._lifeCycleHooks[r].forEach((o) => {
  1843. i.push({ hookedCommand: s, callback: o });
  1844. });
  1845. }), r === "postAction" && i.reverse(), i.forEach((s) => {
  1846. n = this._chainOrCall(n, () => s.callback(s.hookedCommand, this));
  1847. }), n;
  1848. }
  1849. /**
  1850. *
  1851. * @param {(Promise|undefined)} promise
  1852. * @param {Command} subCommand
  1853. * @param {string} event
  1854. * @return {(Promise|undefined)}
  1855. * @private
  1856. */
  1857. _chainOrCallSubCommandHook(t, r, n) {
  1858. let i = t;
  1859. return this._lifeCycleHooks[n] !== void 0 && this._lifeCycleHooks[n].forEach((s) => {
  1860. i = this._chainOrCall(i, () => s(this, r));
  1861. }), i;
  1862. }
  1863. /**
  1864. * Process arguments in context of this command.
  1865. * Returns action result, in case it is a promise.
  1866. *
  1867. * @private
  1868. */
  1869. _parseCommand(t, r) {
  1870. const n = this.parseOptions(r);
  1871. if (this._parseOptionsEnv(), this._parseOptionsImplied(), t = t.concat(n.operands), r = n.unknown, this.args = t.concat(r), t && this._findCommand(t[0]))
  1872. return this._dispatchSubcommand(t[0], t.slice(1), r);
  1873. if (this._getHelpCommand() && t[0] === this._getHelpCommand().name())
  1874. return this._dispatchHelpCommand(t[1]);
  1875. if (this._defaultCommandName)
  1876. return this._outputHelpIfRequested(r), this._dispatchSubcommand(
  1877. this._defaultCommandName,
  1878. t,
  1879. r
  1880. );
  1881. this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName && this.help({ error: !0 }), this._outputHelpIfRequested(n.unknown), this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
  1882. const i = () => {
  1883. n.unknown.length > 0 && this.unknownOption(n.unknown[0]);
  1884. }, s = `command:${this.name()}`;
  1885. if (this._actionHandler) {
  1886. i(), this._processArguments();
  1887. let o;
  1888. return o = this._chainOrCallHooks(o, "preAction"), o = this._chainOrCall(
  1889. o,
  1890. () => this._actionHandler(this.processedArgs)
  1891. ), this.parent && (o = this._chainOrCall(o, () => {
  1892. this.parent.emit(s, t, r);
  1893. })), o = this._chainOrCallHooks(o, "postAction"), o;
  1894. }
  1895. if (this.parent && this.parent.listenerCount(s))
  1896. i(), this._processArguments(), this.parent.emit(s, t, r);
  1897. else if (t.length) {
  1898. if (this._findCommand("*"))
  1899. return this._dispatchSubcommand("*", t, r);
  1900. this.listenerCount("command:*") ? this.emit("command:*", t, r) : this.commands.length ? this.unknownCommand() : (i(), this._processArguments());
  1901. } else this.commands.length ? (i(), this.help({ error: !0 })) : (i(), this._processArguments());
  1902. }
  1903. /**
  1904. * Find matching command.
  1905. *
  1906. * @private
  1907. * @return {Command | undefined}
  1908. */
  1909. _findCommand(t) {
  1910. if (t)
  1911. return this.commands.find(
  1912. (r) => r._name === t || r._aliases.includes(t)
  1913. );
  1914. }
  1915. /**
  1916. * Return an option matching `arg` if any.
  1917. *
  1918. * @param {string} arg
  1919. * @return {Option}
  1920. * @package
  1921. */
  1922. _findOption(t) {
  1923. return this.options.find((r) => r.is(t));
  1924. }
  1925. /**
  1926. * Display an error message if a mandatory option does not have a value.
  1927. * Called after checking for help flags in leaf subcommand.
  1928. *
  1929. * @private
  1930. */
  1931. _checkForMissingMandatoryOptions() {
  1932. this._getCommandAndAncestors().forEach((t) => {
  1933. t.options.forEach((r) => {
  1934. r.mandatory && t.getOptionValue(r.attributeName()) === void 0 && t.missingMandatoryOptionValue(r);
  1935. });
  1936. });
  1937. }
  1938. /**
  1939. * Display an error message if conflicting options are used together in this.
  1940. *
  1941. * @private
  1942. */
  1943. _checkForConflictingLocalOptions() {
  1944. const t = this.options.filter((n) => {
  1945. const i = n.attributeName();
  1946. return this.getOptionValue(i) === void 0 ? !1 : this.getOptionValueSource(i) !== "default";
  1947. });
  1948. t.filter(
  1949. (n) => n.conflictsWith.length > 0
  1950. ).forEach((n) => {
  1951. const i = t.find(
  1952. (s) => n.conflictsWith.includes(s.attributeName())
  1953. );
  1954. i && this._conflictingOption(n, i);
  1955. });
  1956. }
  1957. /**
  1958. * Display an error message if conflicting options are used together.
  1959. * Called after checking for help flags in leaf subcommand.
  1960. *
  1961. * @private
  1962. */
  1963. _checkForConflictingOptions() {
  1964. this._getCommandAndAncestors().forEach((t) => {
  1965. t._checkForConflictingLocalOptions();
  1966. });
  1967. }
  1968. /**
  1969. * Parse options from `argv` removing known options,
  1970. * and return argv split into operands and unknown arguments.
  1971. *
  1972. * Side effects: modifies command by storing options. Does not reset state if called again.
  1973. *
  1974. * Examples:
  1975. *
  1976. * argv => operands, unknown
  1977. * --known kkk op => [op], []
  1978. * op --known kkk => [op], []
  1979. * sub --unknown uuu op => [sub], [--unknown uuu op]
  1980. * sub -- --unknown uuu op => [sub --unknown uuu op], []
  1981. *
  1982. * @param {string[]} argv
  1983. * @return {{operands: string[], unknown: string[]}}
  1984. */
  1985. parseOptions(t) {
  1986. const r = [], n = [];
  1987. let i = r;
  1988. const s = t.slice();
  1989. function o(c) {
  1990. return c.length > 1 && c[0] === "-";
  1991. }
  1992. const a = (c) => /^-\d*\.?\d+(e[+-]?\d+)?$/.test(c) ? !this._getCommandAndAncestors().some(
  1993. (f) => f.options.map((u) => u.short).some((u) => /^-\d$/.test(u))
  1994. ) : !1;
  1995. let l = null;
  1996. for (; s.length; ) {
  1997. const c = s.shift();
  1998. if (c === "--") {
  1999. i === n && i.push(c), i.push(...s);
  2000. break;
  2001. }
  2002. if (l && (!o(c) || a(c))) {
  2003. this.emit(`option:${l.name()}`, c);
  2004. continue;
  2005. }
  2006. if (l = null, o(c)) {
  2007. const f = this._findOption(c);
  2008. if (f) {
  2009. if (f.required) {
  2010. const u = s.shift();
  2011. u === void 0 && this.optionMissingArgument(f), this.emit(`option:${f.name()}`, u);
  2012. } else if (f.optional) {
  2013. let u = null;
  2014. s.length > 0 && (!o(s[0]) || a(s[0])) && (u = s.shift()), this.emit(`option:${f.name()}`, u);
  2015. } else
  2016. this.emit(`option:${f.name()}`);
  2017. l = f.variadic ? f : null;
  2018. continue;
  2019. }
  2020. }
  2021. if (c.length > 2 && c[0] === "-" && c[1] !== "-") {
  2022. const f = this._findOption(`-${c[1]}`);
  2023. if (f) {
  2024. f.required || f.optional && this._combineFlagAndOptionalValue ? this.emit(`option:${f.name()}`, c.slice(2)) : (this.emit(`option:${f.name()}`), s.unshift(`-${c.slice(2)}`));
  2025. continue;
  2026. }
  2027. }
  2028. if (/^--[^=]+=/.test(c)) {
  2029. const f = c.indexOf("="), u = this._findOption(c.slice(0, f));
  2030. if (u && (u.required || u.optional)) {
  2031. this.emit(`option:${u.name()}`, c.slice(f + 1));
  2032. continue;
  2033. }
  2034. }
  2035. if (i === r && o(c) && !(this.commands.length === 0 && a(c)) && (i = n), (this._enablePositionalOptions || this._passThroughOptions) && r.length === 0 && n.length === 0) {
  2036. if (this._findCommand(c)) {
  2037. r.push(c), s.length > 0 && n.push(...s);
  2038. break;
  2039. } else if (this._getHelpCommand() && c === this._getHelpCommand().name()) {
  2040. r.push(c), s.length > 0 && r.push(...s);
  2041. break;
  2042. } else if (this._defaultCommandName) {
  2043. n.push(c), s.length > 0 && n.push(...s);
  2044. break;
  2045. }
  2046. }
  2047. if (this._passThroughOptions) {
  2048. i.push(c), s.length > 0 && i.push(...s);
  2049. break;
  2050. }
  2051. i.push(c);
  2052. }
  2053. return { operands: r, unknown: n };
  2054. }
  2055. /**
  2056. * Return an object containing local option values as key-value pairs.
  2057. *
  2058. * @return {object}
  2059. */
  2060. opts() {
  2061. if (this._storeOptionsAsProperties) {
  2062. const t = {}, r = this.options.length;
  2063. for (let n = 0; n < r; n++) {
  2064. const i = this.options[n].attributeName();
  2065. t[i] = i === this._versionOptionName ? this._version : this[i];
  2066. }
  2067. return t;
  2068. }
  2069. return this._optionValues;
  2070. }
  2071. /**
  2072. * Return an object containing merged local and global option values as key-value pairs.
  2073. *
  2074. * @return {object}
  2075. */
  2076. optsWithGlobals() {
  2077. return this._getCommandAndAncestors().reduce(
  2078. (t, r) => Object.assign(t, r.opts()),
  2079. {}
  2080. );
  2081. }
  2082. /**
  2083. * Display error message and exit (or call exitOverride).
  2084. *
  2085. * @param {string} message
  2086. * @param {object} [errorOptions]
  2087. * @param {string} [errorOptions.code] - an id string representing the error
  2088. * @param {number} [errorOptions.exitCode] - used with process.exit
  2089. */
  2090. error(t, r) {
  2091. this._outputConfiguration.outputError(
  2092. `${t}
  2093. `,
  2094. this._outputConfiguration.writeErr
  2095. ), typeof this._showHelpAfterError == "string" ? this._outputConfiguration.writeErr(`${this._showHelpAfterError}
  2096. `) : this._showHelpAfterError && (this._outputConfiguration.writeErr(`
  2097. `), this.outputHelp({ error: !0 }));
  2098. const n = r || {}, i = n.exitCode || 1, s = n.code || "commander.error";
  2099. this._exit(i, s, t);
  2100. }
  2101. /**
  2102. * Apply any option related environment variables, if option does
  2103. * not have a value from cli or client code.
  2104. *
  2105. * @private
  2106. */
  2107. _parseOptionsEnv() {
  2108. this.options.forEach((t) => {
  2109. if (t.envVar && t.envVar in H.env) {
  2110. const r = t.attributeName();
  2111. (this.getOptionValue(r) === void 0 || ["default", "config", "env"].includes(
  2112. this.getOptionValueSource(r)
  2113. )) && (t.required || t.optional ? this.emit(`optionEnv:${t.name()}`, H.env[t.envVar]) : this.emit(`optionEnv:${t.name()}`));
  2114. }
  2115. });
  2116. }
  2117. /**
  2118. * Apply any implied option values, if option is undefined or default value.
  2119. *
  2120. * @private
  2121. */
  2122. _parseOptionsImplied() {
  2123. const t = new au(this.options), r = (n) => this.getOptionValue(n) !== void 0 && !["default", "implied"].includes(this.getOptionValueSource(n));
  2124. this.options.filter(
  2125. (n) => n.implied !== void 0 && r(n.attributeName()) && t.valueFromOption(
  2126. this.getOptionValue(n.attributeName()),
  2127. n
  2128. )
  2129. ).forEach((n) => {
  2130. Object.keys(n.implied).filter((i) => !r(i)).forEach((i) => {
  2131. this.setOptionValueWithSource(
  2132. i,
  2133. n.implied[i],
  2134. "implied"
  2135. );
  2136. });
  2137. });
  2138. }
  2139. /**
  2140. * Argument `name` is missing.
  2141. *
  2142. * @param {string} name
  2143. * @private
  2144. */
  2145. missingArgument(t) {
  2146. const r = `error: missing required argument '${t}'`;
  2147. this.error(r, { code: "commander.missingArgument" });
  2148. }
  2149. /**
  2150. * `Option` is missing an argument.
  2151. *
  2152. * @param {Option} option
  2153. * @private
  2154. */
  2155. optionMissingArgument(t) {
  2156. const r = `error: option '${t.flags}' argument missing`;
  2157. this.error(r, { code: "commander.optionMissingArgument" });
  2158. }
  2159. /**
  2160. * `Option` does not have a value, and is a mandatory option.
  2161. *
  2162. * @param {Option} option
  2163. * @private
  2164. */
  2165. missingMandatoryOptionValue(t) {
  2166. const r = `error: required option '${t.flags}' not specified`;
  2167. this.error(r, { code: "commander.missingMandatoryOptionValue" });
  2168. }
  2169. /**
  2170. * `Option` conflicts with another option.
  2171. *
  2172. * @param {Option} option
  2173. * @param {Option} conflictingOption
  2174. * @private
  2175. */
  2176. _conflictingOption(t, r) {
  2177. const n = (o) => {
  2178. const a = o.attributeName(), l = this.getOptionValue(a), c = this.options.find(
  2179. (u) => u.negate && a === u.attributeName()
  2180. ), f = this.options.find(
  2181. (u) => !u.negate && a === u.attributeName()
  2182. );
  2183. return c && (c.presetArg === void 0 && l === !1 || c.presetArg !== void 0 && l === c.presetArg) ? c : f || o;
  2184. }, i = (o) => {
  2185. const a = n(o), l = a.attributeName();
  2186. return this.getOptionValueSource(l) === "env" ? `environment variable '${a.envVar}'` : `option '${a.flags}'`;
  2187. }, s = `error: ${i(t)} cannot be used with ${i(r)}`;
  2188. this.error(s, { code: "commander.conflictingOption" });
  2189. }
  2190. /**
  2191. * Unknown option `flag`.
  2192. *
  2193. * @param {string} flag
  2194. * @private
  2195. */
  2196. unknownOption(t) {
  2197. if (this._allowUnknownOption) return;
  2198. let r = "";
  2199. if (t.startsWith("--") && this._showSuggestionAfterError) {
  2200. let i = [], s = this;
  2201. do {
  2202. const o = s.createHelp().visibleOptions(s).filter((a) => a.long).map((a) => a.long);
  2203. i = i.concat(o), s = s.parent;
  2204. } while (s && !s._enablePositionalOptions);
  2205. r = Js(t, i);
  2206. }
  2207. const n = `error: unknown option '${t}'${r}`;
  2208. this.error(n, { code: "commander.unknownOption" });
  2209. }
  2210. /**
  2211. * Excess arguments, more than expected.
  2212. *
  2213. * @param {string[]} receivedArgs
  2214. * @private
  2215. */
  2216. _excessArguments(t) {
  2217. if (this._allowExcessArguments) return;
  2218. const r = this.registeredArguments.length, n = r === 1 ? "" : "s", s = `error: too many arguments${this.parent ? ` for '${this.name()}'` : ""}. Expected ${r} argument${n} but got ${t.length}.`;
  2219. this.error(s, { code: "commander.excessArguments" });
  2220. }
  2221. /**
  2222. * Unknown command.
  2223. *
  2224. * @private
  2225. */
  2226. unknownCommand() {
  2227. const t = this.args[0];
  2228. let r = "";
  2229. if (this._showSuggestionAfterError) {
  2230. const i = [];
  2231. this.createHelp().visibleCommands(this).forEach((s) => {
  2232. i.push(s.name()), s.alias() && i.push(s.alias());
  2233. }), r = Js(t, i);
  2234. }
  2235. const n = `error: unknown command '${t}'${r}`;
  2236. this.error(n, { code: "commander.unknownCommand" });
  2237. }
  2238. /**
  2239. * Get or set the program version.
  2240. *
  2241. * This method auto-registers the "-V, --version" option which will print the version number.
  2242. *
  2243. * You can optionally supply the flags and description to override the defaults.
  2244. *
  2245. * @param {string} [str]
  2246. * @param {string} [flags]
  2247. * @param {string} [description]
  2248. * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments
  2249. */
  2250. version(t, r, n) {
  2251. if (t === void 0) return this._version;
  2252. this._version = t, r = r || "-V, --version", n = n || "output the version number";
  2253. const i = this.createOption(r, n);
  2254. return this._versionOptionName = i.attributeName(), this._registerOption(i), this.on("option:" + i.name(), () => {
  2255. this._outputConfiguration.writeOut(`${t}
  2256. `), this._exit(0, "commander.version", t);
  2257. }), this;
  2258. }
  2259. /**
  2260. * Set the description.
  2261. *
  2262. * @param {string} [str]
  2263. * @param {object} [argsDescription]
  2264. * @return {(string|Command)}
  2265. */
  2266. description(t, r) {
  2267. return t === void 0 && r === void 0 ? this._description : (this._description = t, r && (this._argsDescription = r), this);
  2268. }
  2269. /**
  2270. * Set the summary. Used when listed as subcommand of parent.
  2271. *
  2272. * @param {string} [str]
  2273. * @return {(string|Command)}
  2274. */
  2275. summary(t) {
  2276. return t === void 0 ? this._summary : (this._summary = t, this);
  2277. }
  2278. /**
  2279. * Set an alias for the command.
  2280. *
  2281. * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
  2282. *
  2283. * @param {string} [alias]
  2284. * @return {(string|Command)}
  2285. */
  2286. alias(t) {
  2287. var i;
  2288. if (t === void 0) return this._aliases[0];
  2289. let r = this;
  2290. if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler && (r = this.commands[this.commands.length - 1]), t === r._name)
  2291. throw new Error("Command alias can't be the same as its name");
  2292. const n = (i = this.parent) == null ? void 0 : i._findCommand(t);
  2293. if (n) {
  2294. const s = [n.name()].concat(n.aliases()).join("|");
  2295. throw new Error(
  2296. `cannot add alias '${t}' to command '${this.name()}' as already have command '${s}'`
  2297. );
  2298. }
  2299. return r._aliases.push(t), this;
  2300. }
  2301. /**
  2302. * Set aliases for the command.
  2303. *
  2304. * Only the first alias is shown in the auto-generated help.
  2305. *
  2306. * @param {string[]} [aliases]
  2307. * @return {(string[]|Command)}
  2308. */
  2309. aliases(t) {
  2310. return t === void 0 ? this._aliases : (t.forEach((r) => this.alias(r)), this);
  2311. }
  2312. /**
  2313. * Set / get the command usage `str`.
  2314. *
  2315. * @param {string} [str]
  2316. * @return {(string|Command)}
  2317. */
  2318. usage(t) {
  2319. if (t === void 0) {
  2320. if (this._usage) return this._usage;
  2321. const r = this.registeredArguments.map((n) => iu(n));
  2322. return [].concat(
  2323. this.options.length || this._helpOption !== null ? "[options]" : [],
  2324. this.commands.length ? "[command]" : [],
  2325. this.registeredArguments.length ? r : []
  2326. ).join(" ");
  2327. }
  2328. return this._usage = t, this;
  2329. }
  2330. /**
  2331. * Get or set the name of the command.
  2332. *
  2333. * @param {string} [str]
  2334. * @return {(string|Command)}
  2335. */
  2336. name(t) {
  2337. return t === void 0 ? this._name : (this._name = t, this);
  2338. }
  2339. /**
  2340. * Set/get the help group heading for this subcommand in parent command's help.
  2341. *
  2342. * @param {string} [heading]
  2343. * @return {Command | string}
  2344. */
  2345. helpGroup(t) {
  2346. return t === void 0 ? this._helpGroupHeading ?? "" : (this._helpGroupHeading = t, this);
  2347. }
  2348. /**
  2349. * Set/get the default help group heading for subcommands added to this command.
  2350. * (This does not override a group set directly on the subcommand using .helpGroup().)
  2351. *
  2352. * @example
  2353. * program.commandsGroup('Development Commands:);
  2354. * program.command('watch')...
  2355. * program.command('lint')...
  2356. * ...
  2357. *
  2358. * @param {string} [heading]
  2359. * @returns {Command | string}
  2360. */
  2361. commandsGroup(t) {
  2362. return t === void 0 ? this._defaultCommandGroup ?? "" : (this._defaultCommandGroup = t, this);
  2363. }
  2364. /**
  2365. * Set/get the default help group heading for options added to this command.
  2366. * (This does not override a group set directly on the option using .helpGroup().)
  2367. *
  2368. * @example
  2369. * program
  2370. * .optionsGroup('Development Options:')
  2371. * .option('-d, --debug', 'output extra debugging')
  2372. * .option('-p, --profile', 'output profiling information')
  2373. *
  2374. * @param {string} [heading]
  2375. * @returns {Command | string}
  2376. */
  2377. optionsGroup(t) {
  2378. return t === void 0 ? this._defaultOptionGroup ?? "" : (this._defaultOptionGroup = t, this);
  2379. }
  2380. /**
  2381. * @param {Option} option
  2382. * @private
  2383. */
  2384. _initOptionGroup(t) {
  2385. this._defaultOptionGroup && !t.helpGroupHeading && t.helpGroup(this._defaultOptionGroup);
  2386. }
  2387. /**
  2388. * @param {Command} cmd
  2389. * @private
  2390. */
  2391. _initCommandGroup(t) {
  2392. this._defaultCommandGroup && !t.helpGroup() && t.helpGroup(this._defaultCommandGroup);
  2393. }
  2394. /**
  2395. * Set the name of the command from script filename, such as process.argv[1],
  2396. * or require.main.filename, or __filename.
  2397. *
  2398. * (Used internally and public although not documented in README.)
  2399. *
  2400. * @example
  2401. * program.nameFromFilename(require.main.filename);
  2402. *
  2403. * @param {string} filename
  2404. * @return {Command}
  2405. */
  2406. nameFromFilename(t) {
  2407. return this._name = Ce.basename(t, Ce.extname(t)), this;
  2408. }
  2409. /**
  2410. * Get or set the directory for searching for executable subcommands of this command.
  2411. *
  2412. * @example
  2413. * program.executableDir(__dirname);
  2414. * // or
  2415. * program.executableDir('subcommands');
  2416. *
  2417. * @param {string} [path]
  2418. * @return {(string|null|Command)}
  2419. */
  2420. executableDir(t) {
  2421. return t === void 0 ? this._executableDir : (this._executableDir = t, this);
  2422. }
  2423. /**
  2424. * Return program help documentation.
  2425. *
  2426. * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout
  2427. * @return {string}
  2428. */
  2429. helpInformation(t) {
  2430. const r = this.createHelp(), n = this._getOutputContext(t);
  2431. r.prepareContext({
  2432. error: n.error,
  2433. helpWidth: n.helpWidth,
  2434. outputHasColors: n.hasColors
  2435. });
  2436. const i = r.formatHelp(this, r);
  2437. return n.hasColors ? i : this._outputConfiguration.stripColor(i);
  2438. }
  2439. /**
  2440. * @typedef HelpContext
  2441. * @type {object}
  2442. * @property {boolean} error
  2443. * @property {number} helpWidth
  2444. * @property {boolean} hasColors
  2445. * @property {function} write - includes stripColor if needed
  2446. *
  2447. * @returns {HelpContext}
  2448. * @private
  2449. */
  2450. _getOutputContext(t) {
  2451. t = t || {};
  2452. const r = !!t.error;
  2453. let n, i, s;
  2454. return r ? (n = (a) => this._outputConfiguration.writeErr(a), i = this._outputConfiguration.getErrHasColors(), s = this._outputConfiguration.getErrHelpWidth()) : (n = (a) => this._outputConfiguration.writeOut(a), i = this._outputConfiguration.getOutHasColors(), s = this._outputConfiguration.getOutHelpWidth()), { error: r, write: (a) => (i || (a = this._outputConfiguration.stripColor(a)), n(a)), hasColors: i, helpWidth: s };
  2455. }
  2456. /**
  2457. * Output help information for this command.
  2458. *
  2459. * Outputs built-in help, and custom text added using `.addHelpText()`.
  2460. *
  2461. * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout
  2462. */
  2463. outputHelp(t) {
  2464. var o;
  2465. let r;
  2466. typeof t == "function" && (r = t, t = void 0);
  2467. const n = this._getOutputContext(t), i = {
  2468. error: n.error,
  2469. write: n.write,
  2470. command: this
  2471. };
  2472. this._getCommandAndAncestors().reverse().forEach((a) => a.emit("beforeAllHelp", i)), this.emit("beforeHelp", i);
  2473. let s = this.helpInformation({ error: n.error });
  2474. if (r && (s = r(s), typeof s != "string" && !Buffer.isBuffer(s)))
  2475. throw new Error("outputHelp callback must return a string or a Buffer");
  2476. n.write(s), (o = this._getHelpOption()) != null && o.long && this.emit(this._getHelpOption().long), this.emit("afterHelp", i), this._getCommandAndAncestors().forEach(
  2477. (a) => a.emit("afterAllHelp", i)
  2478. );
  2479. }
  2480. /**
  2481. * You can pass in flags and a description to customise the built-in help option.
  2482. * Pass in false to disable the built-in help option.
  2483. *
  2484. * @example
  2485. * program.helpOption('-?, --help' 'show help'); // customise
  2486. * program.helpOption(false); // disable
  2487. *
  2488. * @param {(string | boolean)} flags
  2489. * @param {string} [description]
  2490. * @return {Command} `this` command for chaining
  2491. */
  2492. helpOption(t, r) {
  2493. return typeof t == "boolean" ? (t ? (this._helpOption === null && (this._helpOption = void 0), this._defaultOptionGroup && this._initOptionGroup(this._getHelpOption())) : this._helpOption = null, this) : (this._helpOption = this.createOption(
  2494. t ?? "-h, --help",
  2495. r ?? "display help for command"
  2496. ), (t || r) && this._initOptionGroup(this._helpOption), this);
  2497. }
  2498. /**
  2499. * Lazy create help option.
  2500. * Returns null if has been disabled with .helpOption(false).
  2501. *
  2502. * @returns {(Option | null)} the help option
  2503. * @package
  2504. */
  2505. _getHelpOption() {
  2506. return this._helpOption === void 0 && this.helpOption(void 0, void 0), this._helpOption;
  2507. }
  2508. /**
  2509. * Supply your own option to use for the built-in help option.
  2510. * This is an alternative to using helpOption() to customise the flags and description etc.
  2511. *
  2512. * @param {Option} option
  2513. * @return {Command} `this` command for chaining
  2514. */
  2515. addHelpOption(t) {
  2516. return this._helpOption = t, this._initOptionGroup(t), this;
  2517. }
  2518. /**
  2519. * Output help information and exit.
  2520. *
  2521. * Outputs built-in help, and custom text added using `.addHelpText()`.
  2522. *
  2523. * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout
  2524. */
  2525. help(t) {
  2526. this.outputHelp(t);
  2527. let r = Number(H.exitCode ?? 0);
  2528. r === 0 && t && typeof t != "function" && t.error && (r = 1), this._exit(r, "commander.help", "(outputHelp)");
  2529. }
  2530. /**
  2531. * // Do a little typing to coordinate emit and listener for the help text events.
  2532. * @typedef HelpTextEventContext
  2533. * @type {object}
  2534. * @property {boolean} error
  2535. * @property {Command} command
  2536. * @property {function} write
  2537. */
  2538. /**
  2539. * Add additional text to be displayed with the built-in help.
  2540. *
  2541. * Position is 'before' or 'after' to affect just this command,
  2542. * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
  2543. *
  2544. * @param {string} position - before or after built-in help
  2545. * @param {(string | Function)} text - string to add, or a function returning a string
  2546. * @return {Command} `this` command for chaining
  2547. */
  2548. addHelpText(t, r) {
  2549. const n = ["beforeAll", "before", "after", "afterAll"];
  2550. if (!n.includes(t))
  2551. throw new Error(`Unexpected value for position to addHelpText.
  2552. Expecting one of '${n.join("', '")}'`);
  2553. const i = `${t}Help`;
  2554. return this.on(i, (s) => {
  2555. let o;
  2556. typeof r == "function" ? o = r({ error: s.error, command: s.command }) : o = r, o && s.write(`${o}
  2557. `);
  2558. }), this;
  2559. }
  2560. /**
  2561. * Output help information if help flags specified
  2562. *
  2563. * @param {Array} args - array of options to search for help flags
  2564. * @private
  2565. */
  2566. _outputHelpIfRequested(t) {
  2567. const r = this._getHelpOption();
  2568. r && t.find((i) => r.is(i)) && (this.outputHelp(), this._exit(0, "commander.helpDisplayed", "(outputHelp)"));
  2569. }
  2570. };
  2571. function Ys(e) {
  2572. return e.map((t) => {
  2573. if (!t.startsWith("--inspect"))
  2574. return t;
  2575. let r, n = "127.0.0.1", i = "9229", s;
  2576. return (s = t.match(/^(--inspect(-brk)?)$/)) !== null ? r = s[1] : (s = t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null ? (r = s[1], /^\d+$/.test(s[3]) ? i = s[3] : n = s[3]) : (s = t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null && (r = s[1], n = s[3], i = s[4]), r && i !== "0" ? `${r}=${n}:${parseInt(i) + 1}` : t;
  2577. });
  2578. }
  2579. function Kn() {
  2580. if (H.env.NO_COLOR || H.env.FORCE_COLOR === "0" || H.env.FORCE_COLOR === "false")
  2581. return !1;
  2582. if (H.env.FORCE_COLOR || H.env.CLICOLOR_FORCE !== void 0)
  2583. return !0;
  2584. }
  2585. vi.Command = lu;
  2586. vi.useColor = Kn;
  2587. const { Argument: ba } = Yt, { Command: bi } = vi, { CommanderError: cu, InvalidArgumentError: wa } = bt, { Help: uu } = qr, { Option: Pa } = Fr;
  2588. pe.program = new bi();
  2589. pe.createCommand = (e) => new bi(e);
  2590. pe.createOption = (e, t) => new Pa(e, t);
  2591. pe.createArgument = (e, t) => new ba(e, t);
  2592. pe.Command = bi;
  2593. pe.Option = Pa;
  2594. pe.Argument = ba;
  2595. pe.Help = uu;
  2596. pe.CommanderError = cu;
  2597. pe.InvalidArgumentError = wa;
  2598. pe.InvalidOptionArgumentError = wa;
  2599. const {
  2600. Command: fu
  2601. } = pe;
  2602. var nt = {};
  2603. const Oa = Lc;
  2604. nt.format = Oa.format;
  2605. nt.inherits = Oa.inherits;
  2606. const du = (e) => new URL(e);
  2607. nt.swaggerParamRegExp = /\{([^/}]+)}/g;
  2608. const pu = ["get", "post", "put", "delete", "patch", "options", "head", "trace"];
  2609. function Tn(e, t) {
  2610. if (e.url && e.url.startsWith("/")) {
  2611. const r = du(t), n = r.protocol + "//" + r.hostname + e.url;
  2612. return e.url = n, e;
  2613. }
  2614. }
  2615. function hu(e, t) {
  2616. e.openapi && t && (t.startsWith("http:") || t.startsWith("https:")) && (e.servers && e.servers.map((r) => Tn(r, t)), ["paths", "webhooks"].forEach((r) => {
  2617. Object.keys(e[r] || []).forEach((n) => {
  2618. const i = e[r][n];
  2619. Object.keys(i).forEach((s) => {
  2620. s === "servers" ? i[s].map((o) => Tn(o, t)) : pu.includes(s) && i[s].servers && i[s].servers.map((o) => Tn(o, t));
  2621. });
  2622. });
  2623. }));
  2624. }
  2625. nt.fixOasRelativeServers = hu;
  2626. const mu = !1, yu = /\r?\n/, gu = /\bono[ @]/;
  2627. function $u(e) {
  2628. return !!(e && e.configurable && typeof e.get == "function");
  2629. }
  2630. function _u(e) {
  2631. return !!// If there is no stack property, then it's writable, since assigning it will create it
  2632. (!e || e.writable || typeof e.set == "function");
  2633. }
  2634. function Ea(e, t) {
  2635. let r = Sa(e.stack), n = t ? t.stack : void 0;
  2636. return r && n ? r + `
  2637. ` + n : r || n;
  2638. }
  2639. function vu(e, t, r) {
  2640. r ? Object.defineProperty(t, "stack", {
  2641. get: () => {
  2642. let n = e.get.apply(t);
  2643. return Ea({ stack: n }, r);
  2644. },
  2645. enumerable: !1,
  2646. configurable: !0
  2647. }) : bu(t, e);
  2648. }
  2649. function Sa(e) {
  2650. if (e) {
  2651. let t = e.split(yu), r;
  2652. for (let n = 0; n < t.length; n++) {
  2653. let i = t[n];
  2654. if (gu.test(i))
  2655. r === void 0 && (r = n);
  2656. else if (r !== void 0) {
  2657. t.splice(r, n - r);
  2658. break;
  2659. }
  2660. }
  2661. if (t.length > 0)
  2662. return t.join(`
  2663. `);
  2664. }
  2665. return e;
  2666. }
  2667. function bu(e, t) {
  2668. Object.defineProperty(e, "stack", {
  2669. get: () => Sa(t.get.apply(e)),
  2670. enumerable: !1,
  2671. configurable: !0
  2672. });
  2673. }
  2674. const wu = ["function", "symbol", "undefined"], Pu = ["constructor", "prototype", "__proto__"], Ou = Object.getPrototypeOf({});
  2675. function xa() {
  2676. let e = {}, t = this;
  2677. for (let r of ja(t))
  2678. if (typeof r == "string") {
  2679. let n = t[r], i = typeof n;
  2680. wu.includes(i) || (e[r] = n);
  2681. }
  2682. return e;
  2683. }
  2684. function ja(e, t = []) {
  2685. let r = [];
  2686. for (; e && e !== Ou; )
  2687. r = r.concat(Object.getOwnPropertyNames(e), Object.getOwnPropertySymbols(e)), e = Object.getPrototypeOf(e);
  2688. let n = new Set(r);
  2689. for (let i of t.concat(Pu))
  2690. n.delete(i);
  2691. return n;
  2692. }
  2693. const Eu = ["name", "message", "stack"];
  2694. function gr(e, t, r) {
  2695. let n = e;
  2696. return Su(n, t), t && typeof t == "object" && xu(n, t), n.toJSON = xa, r && typeof r == "object" && Object.assign(n, r), n;
  2697. }
  2698. function Su(e, t) {
  2699. let r = Object.getOwnPropertyDescriptor(e, "stack");
  2700. $u(r) ? vu(r, e, t) : _u(r) && (e.stack = Ea(e, t));
  2701. }
  2702. function xu(e, t) {
  2703. let r = ja(t, Eu), n = e, i = t;
  2704. for (let s of r)
  2705. if (n[s] === void 0)
  2706. try {
  2707. n[s] = i[s];
  2708. } catch {
  2709. }
  2710. }
  2711. function ju(e) {
  2712. return e = e || {}, {
  2713. concatMessages: e.concatMessages === void 0 ? !0 : !!e.concatMessages,
  2714. format: e.format === void 0 ? mu : typeof e.format == "function" ? e.format : !1
  2715. };
  2716. }
  2717. function Au(e, t) {
  2718. let r, n, i, s = "";
  2719. return typeof e[0] == "string" ? i = e : typeof e[1] == "string" ? (e[0] instanceof Error ? r = e[0] : n = e[0], i = e.slice(1)) : (r = e[0], n = e[1], i = e.slice(2)), i.length > 0 && (t.format ? s = t.format.apply(void 0, i) : s = i.join(" ")), t.concatMessages && r && r.message && (s += (s ? `
  2720. ` : "") + r.message), { originalError: r, props: n, message: s };
  2721. }
  2722. const Ke = wi;
  2723. function wi(e, t) {
  2724. t = ju(t);
  2725. function r(...n) {
  2726. let { originalError: i, props: s, message: o } = Au(n, t), a = new e(o);
  2727. return gr(a, i, s);
  2728. }
  2729. return r[Symbol.species] = e, r;
  2730. }
  2731. wi.toJSON = function(t) {
  2732. return xa.call(t);
  2733. };
  2734. wi.extend = function(t, r, n) {
  2735. return n || r instanceof Error ? gr(t, r, n) : r ? gr(t, void 0, r) : gr(t);
  2736. };
  2737. const Xs = xe;
  2738. xe.error = new Ke(Error);
  2739. xe.eval = new Ke(EvalError);
  2740. xe.range = new Ke(RangeError);
  2741. xe.reference = new Ke(ReferenceError);
  2742. xe.syntax = new Ke(SyntaxError);
  2743. xe.type = new Ke(TypeError);
  2744. xe.uri = new Ke(URIError);
  2745. const Cu = xe;
  2746. function xe(...e) {
  2747. let t = e[0];
  2748. if (typeof t == "object" && typeof t.name == "string") {
  2749. for (let r of Object.values(Cu))
  2750. if (typeof r == "function" && r.name === "ono") {
  2751. let n = r[Symbol.species];
  2752. if (n && n !== Error && (t instanceof n || t.name === n.name))
  2753. return r.apply(void 0, e);
  2754. }
  2755. }
  2756. return xe.error.apply(void 0, e);
  2757. }
  2758. typeof module == "object" && typeof module.exports == "object" && (module.exports = Object.assign(module.exports.default, module.exports));
  2759. const Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  2760. __proto__: null,
  2761. Ono: Ke,
  2762. default: Xs,
  2763. ono: Xs
  2764. }, Symbol.toStringTag, { value: "Module" })), je = /* @__PURE__ */ Uc(Iu);
  2765. var Wn = { exports: {} }, mt = {}, $e = {}, $t = {}, Xt = {}, D = {}, zt = {};
  2766. (function(e) {
  2767. Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0;
  2768. class t {
  2769. }
  2770. e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
  2771. class r extends t {
  2772. constructor(m) {
  2773. if (super(), !e.IDENTIFIER.test(m))
  2774. throw new Error("CodeGen: name must be a valid identifier");
  2775. this.str = m;
  2776. }
  2777. toString() {
  2778. return this.str;
  2779. }
  2780. emptyStr() {
  2781. return !1;
  2782. }
  2783. get names() {
  2784. return { [this.str]: 1 };
  2785. }
  2786. }
  2787. e.Name = r;
  2788. class n extends t {
  2789. constructor(m) {
  2790. super(), this._items = typeof m == "string" ? [m] : m;
  2791. }
  2792. toString() {
  2793. return this.str;
  2794. }
  2795. emptyStr() {
  2796. if (this._items.length > 1)
  2797. return !1;
  2798. const m = this._items[0];
  2799. return m === "" || m === '""';
  2800. }
  2801. get str() {
  2802. var m;
  2803. return (m = this._str) !== null && m !== void 0 ? m : this._str = this._items.reduce(($, E) => `${$}${E}`, "");
  2804. }
  2805. get names() {
  2806. var m;
  2807. return (m = this._names) !== null && m !== void 0 ? m : this._names = this._items.reduce(($, E) => (E instanceof r && ($[E.str] = ($[E.str] || 0) + 1), $), {});
  2808. }
  2809. }
  2810. e._Code = n, e.nil = new n("");
  2811. function i(p, ...m) {
  2812. const $ = [p[0]];
  2813. let E = 0;
  2814. for (; E < m.length; )
  2815. a($, m[E]), $.push(p[++E]);
  2816. return new n($);
  2817. }
  2818. e._ = i;
  2819. const s = new n("+");
  2820. function o(p, ...m) {
  2821. const $ = [y(p[0])];
  2822. let E = 0;
  2823. for (; E < m.length; )
  2824. $.push(s), a($, m[E]), $.push(s, y(p[++E]));
  2825. return l($), new n($);
  2826. }
  2827. e.str = o;
  2828. function a(p, m) {
  2829. m instanceof n ? p.push(...m._items) : m instanceof r ? p.push(m) : p.push(u(m));
  2830. }
  2831. e.addCodeArg = a;
  2832. function l(p) {
  2833. let m = 1;
  2834. for (; m < p.length - 1; ) {
  2835. if (p[m] === s) {
  2836. const $ = c(p[m - 1], p[m + 1]);
  2837. if ($ !== void 0) {
  2838. p.splice(m - 1, 3, $);
  2839. continue;
  2840. }
  2841. p[m++] = "+";
  2842. }
  2843. m++;
  2844. }
  2845. }
  2846. function c(p, m) {
  2847. if (m === '""')
  2848. return p;
  2849. if (p === '""')
  2850. return m;
  2851. if (typeof p == "string")
  2852. return m instanceof r || p[p.length - 1] !== '"' ? void 0 : typeof m != "string" ? `${p.slice(0, -1)}${m}"` : m[0] === '"' ? p.slice(0, -1) + m.slice(1) : void 0;
  2853. if (typeof m == "string" && m[0] === '"' && !(p instanceof r))
  2854. return `"${p}${m.slice(1)}`;
  2855. }
  2856. function f(p, m) {
  2857. return m.emptyStr() ? p : p.emptyStr() ? m : o`${p}${m}`;
  2858. }
  2859. e.strConcat = f;
  2860. function u(p) {
  2861. return typeof p == "number" || typeof p == "boolean" || p === null ? p : y(Array.isArray(p) ? p.join(",") : p);
  2862. }
  2863. function h(p) {
  2864. return new n(y(p));
  2865. }
  2866. e.stringify = h;
  2867. function y(p) {
  2868. return JSON.stringify(p).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
  2869. }
  2870. e.safeStringify = y;
  2871. function _(p) {
  2872. return typeof p == "string" && e.IDENTIFIER.test(p) ? new n(`.${p}`) : i`[${p}]`;
  2873. }
  2874. e.getProperty = _;
  2875. function b(p) {
  2876. if (typeof p == "string" && e.IDENTIFIER.test(p))
  2877. return new n(`${p}`);
  2878. throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`);
  2879. }
  2880. e.getEsmExportName = b;
  2881. function v(p) {
  2882. return new n(p.toString());
  2883. }
  2884. e.regexpCode = v;
  2885. })(zt);
  2886. var Jn = {};
  2887. (function(e) {
  2888. Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0;
  2889. const t = zt;
  2890. class r extends Error {
  2891. constructor(c) {
  2892. super(`CodeGen: "code" for ${c} not defined`), this.value = c.value;
  2893. }
  2894. }
  2895. var n;
  2896. (function(l) {
  2897. l[l.Started = 0] = "Started", l[l.Completed = 1] = "Completed";
  2898. })(n || (e.UsedValueState = n = {})), e.varKinds = {
  2899. const: new t.Name("const"),
  2900. let: new t.Name("let"),
  2901. var: new t.Name("var")
  2902. };
  2903. class i {
  2904. constructor({ prefixes: c, parent: f } = {}) {
  2905. this._names = {}, this._prefixes = c, this._parent = f;
  2906. }
  2907. toName(c) {
  2908. return c instanceof t.Name ? c : this.name(c);
  2909. }
  2910. name(c) {
  2911. return new t.Name(this._newName(c));
  2912. }
  2913. _newName(c) {
  2914. const f = this._names[c] || this._nameGroup(c);
  2915. return `${c}${f.index++}`;
  2916. }
  2917. _nameGroup(c) {
  2918. var f, u;
  2919. if (!((u = (f = this._parent) === null || f === void 0 ? void 0 : f._prefixes) === null || u === void 0) && u.has(c) || this._prefixes && !this._prefixes.has(c))
  2920. throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);
  2921. return this._names[c] = { prefix: c, index: 0 };
  2922. }
  2923. }
  2924. e.Scope = i;
  2925. class s extends t.Name {
  2926. constructor(c, f) {
  2927. super(f), this.prefix = c;
  2928. }
  2929. setValue(c, { property: f, itemIndex: u }) {
  2930. this.value = c, this.scopePath = (0, t._)`.${new t.Name(f)}[${u}]`;
  2931. }
  2932. }
  2933. e.ValueScopeName = s;
  2934. const o = (0, t._)`\n`;
  2935. class a extends i {
  2936. constructor(c) {
  2937. super(c), this._values = {}, this._scope = c.scope, this.opts = { ...c, _n: c.lines ? o : t.nil };
  2938. }
  2939. get() {
  2940. return this._scope;
  2941. }
  2942. name(c) {
  2943. return new s(c, this._newName(c));
  2944. }
  2945. value(c, f) {
  2946. var u;
  2947. if (f.ref === void 0)
  2948. throw new Error("CodeGen: ref must be passed in value");
  2949. const h = this.toName(c), { prefix: y } = h, _ = (u = f.key) !== null && u !== void 0 ? u : f.ref;
  2950. let b = this._values[y];
  2951. if (b) {
  2952. const m = b.get(_);
  2953. if (m)
  2954. return m;
  2955. } else
  2956. b = this._values[y] = /* @__PURE__ */ new Map();
  2957. b.set(_, h);
  2958. const v = this._scope[y] || (this._scope[y] = []), p = v.length;
  2959. return v[p] = f.ref, h.setValue(f, { property: y, itemIndex: p }), h;
  2960. }
  2961. getValue(c, f) {
  2962. const u = this._values[c];
  2963. if (u)
  2964. return u.get(f);
  2965. }
  2966. scopeRefs(c, f = this._values) {
  2967. return this._reduceValues(f, (u) => {
  2968. if (u.scopePath === void 0)
  2969. throw new Error(`CodeGen: name "${u}" has no value`);
  2970. return (0, t._)`${c}${u.scopePath}`;
  2971. });
  2972. }
  2973. scopeCode(c = this._values, f, u) {
  2974. return this._reduceValues(c, (h) => {
  2975. if (h.value === void 0)
  2976. throw new Error(`CodeGen: name "${h}" has no value`);
  2977. return h.value.code;
  2978. }, f, u);
  2979. }
  2980. _reduceValues(c, f, u = {}, h) {
  2981. let y = t.nil;
  2982. for (const _ in c) {
  2983. const b = c[_];
  2984. if (!b)
  2985. continue;
  2986. const v = u[_] = u[_] || /* @__PURE__ */ new Map();
  2987. b.forEach((p) => {
  2988. if (v.has(p))
  2989. return;
  2990. v.set(p, n.Started);
  2991. let m = f(p);
  2992. if (m) {
  2993. const $ = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
  2994. y = (0, t._)`${y}${$} ${p} = ${m};${this.opts._n}`;
  2995. } else if (m = h == null ? void 0 : h(p))
  2996. y = (0, t._)`${y}${m}${this.opts._n}`;
  2997. else
  2998. throw new r(p);
  2999. v.set(p, n.Completed);
  3000. });
  3001. }
  3002. return y;
  3003. }
  3004. }
  3005. e.ValueScope = a;
  3006. })(Jn);
  3007. (function(e) {
  3008. Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0;
  3009. const t = zt, r = Jn;
  3010. var n = zt;
  3011. Object.defineProperty(e, "_", { enumerable: !0, get: function() {
  3012. return n._;
  3013. } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
  3014. return n.str;
  3015. } }), Object.defineProperty(e, "strConcat", { enumerable: !0, get: function() {
  3016. return n.strConcat;
  3017. } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() {
  3018. return n.nil;
  3019. } }), Object.defineProperty(e, "getProperty", { enumerable: !0, get: function() {
  3020. return n.getProperty;
  3021. } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() {
  3022. return n.stringify;
  3023. } }), Object.defineProperty(e, "regexpCode", { enumerable: !0, get: function() {
  3024. return n.regexpCode;
  3025. } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
  3026. return n.Name;
  3027. } });
  3028. var i = Jn;
  3029. Object.defineProperty(e, "Scope", { enumerable: !0, get: function() {
  3030. return i.Scope;
  3031. } }), Object.defineProperty(e, "ValueScope", { enumerable: !0, get: function() {
  3032. return i.ValueScope;
  3033. } }), Object.defineProperty(e, "ValueScopeName", { enumerable: !0, get: function() {
  3034. return i.ValueScopeName;
  3035. } }), Object.defineProperty(e, "varKinds", { enumerable: !0, get: function() {
  3036. return i.varKinds;
  3037. } }), e.operators = {
  3038. GT: new t._Code(">"),
  3039. GTE: new t._Code(">="),
  3040. LT: new t._Code("<"),
  3041. LTE: new t._Code("<="),
  3042. EQ: new t._Code("==="),
  3043. NEQ: new t._Code("!=="),
  3044. NOT: new t._Code("!"),
  3045. OR: new t._Code("||"),
  3046. AND: new t._Code("&&"),
  3047. ADD: new t._Code("+")
  3048. };
  3049. class s {
  3050. optimizeNodes() {
  3051. return this;
  3052. }
  3053. optimizeNames(d, g) {
  3054. return this;
  3055. }
  3056. }
  3057. class o extends s {
  3058. constructor(d, g, O) {
  3059. super(), this.varKind = d, this.name = g, this.rhs = O;
  3060. }
  3061. render({ es5: d, _n: g }) {
  3062. const O = d ? r.varKinds.var : this.varKind, R = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
  3063. return `${O} ${this.name}${R};` + g;
  3064. }
  3065. optimizeNames(d, g) {
  3066. if (d[this.name.str])
  3067. return this.rhs && (this.rhs = Me(this.rhs, d, g)), this;
  3068. }
  3069. get names() {
  3070. return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
  3071. }
  3072. }
  3073. class a extends s {
  3074. constructor(d, g, O) {
  3075. super(), this.lhs = d, this.rhs = g, this.sideEffects = O;
  3076. }
  3077. render({ _n: d }) {
  3078. return `${this.lhs} = ${this.rhs};` + d;
  3079. }
  3080. optimizeNames(d, g) {
  3081. if (!(this.lhs instanceof t.Name && !d[this.lhs.str] && !this.sideEffects))
  3082. return this.rhs = Me(this.rhs, d, g), this;
  3083. }
  3084. get names() {
  3085. const d = this.lhs instanceof t.Name ? {} : { ...this.lhs.names };
  3086. return st(d, this.rhs);
  3087. }
  3088. }
  3089. class l extends a {
  3090. constructor(d, g, O, R) {
  3091. super(d, O, R), this.op = g;
  3092. }
  3093. render({ _n: d }) {
  3094. return `${this.lhs} ${this.op}= ${this.rhs};` + d;
  3095. }
  3096. }
  3097. class c extends s {
  3098. constructor(d) {
  3099. super(), this.label = d, this.names = {};
  3100. }
  3101. render({ _n: d }) {
  3102. return `${this.label}:` + d;
  3103. }
  3104. }
  3105. class f extends s {
  3106. constructor(d) {
  3107. super(), this.label = d, this.names = {};
  3108. }
  3109. render({ _n: d }) {
  3110. return `break${this.label ? ` ${this.label}` : ""};` + d;
  3111. }
  3112. }
  3113. class u extends s {
  3114. constructor(d) {
  3115. super(), this.error = d;
  3116. }
  3117. render({ _n: d }) {
  3118. return `throw ${this.error};` + d;
  3119. }
  3120. get names() {
  3121. return this.error.names;
  3122. }
  3123. }
  3124. class h extends s {
  3125. constructor(d) {
  3126. super(), this.code = d;
  3127. }
  3128. render({ _n: d }) {
  3129. return `${this.code};` + d;
  3130. }
  3131. optimizeNodes() {
  3132. return `${this.code}` ? this : void 0;
  3133. }
  3134. optimizeNames(d, g) {
  3135. return this.code = Me(this.code, d, g), this;
  3136. }
  3137. get names() {
  3138. return this.code instanceof t._CodeOrName ? this.code.names : {};
  3139. }
  3140. }
  3141. class y extends s {
  3142. constructor(d = []) {
  3143. super(), this.nodes = d;
  3144. }
  3145. render(d) {
  3146. return this.nodes.reduce((g, O) => g + O.render(d), "");
  3147. }
  3148. optimizeNodes() {
  3149. const { nodes: d } = this;
  3150. let g = d.length;
  3151. for (; g--; ) {
  3152. const O = d[g].optimizeNodes();
  3153. Array.isArray(O) ? d.splice(g, 1, ...O) : O ? d[g] = O : d.splice(g, 1);
  3154. }
  3155. return d.length > 0 ? this : void 0;
  3156. }
  3157. optimizeNames(d, g) {
  3158. const { nodes: O } = this;
  3159. let R = O.length;
  3160. for (; R--; ) {
  3161. const N = O[R];
  3162. N.optimizeNames(d, g) || (At(d, N.names), O.splice(R, 1));
  3163. }
  3164. return O.length > 0 ? this : void 0;
  3165. }
  3166. get names() {
  3167. return this.nodes.reduce((d, g) => Ae(d, g.names), {});
  3168. }
  3169. }
  3170. class _ extends y {
  3171. render(d) {
  3172. return "{" + d._n + super.render(d) + "}" + d._n;
  3173. }
  3174. }
  3175. class b extends y {
  3176. }
  3177. class v extends _ {
  3178. }
  3179. v.kind = "else";
  3180. class p extends _ {
  3181. constructor(d, g) {
  3182. super(g), this.condition = d;
  3183. }
  3184. render(d) {
  3185. let g = `if(${this.condition})` + super.render(d);
  3186. return this.else && (g += "else " + this.else.render(d)), g;
  3187. }
  3188. optimizeNodes() {
  3189. super.optimizeNodes();
  3190. const d = this.condition;
  3191. if (d === !0)
  3192. return this.nodes;
  3193. let g = this.else;
  3194. if (g) {
  3195. const O = g.optimizeNodes();
  3196. g = this.else = Array.isArray(O) ? new v(O) : O;
  3197. }
  3198. if (g)
  3199. return d === !1 ? g instanceof p ? g : g.nodes : this.nodes.length ? this : new p(ir(d), g instanceof p ? [g] : g.nodes);
  3200. if (!(d === !1 || !this.nodes.length))
  3201. return this;
  3202. }
  3203. optimizeNames(d, g) {
  3204. var O;
  3205. if (this.else = (O = this.else) === null || O === void 0 ? void 0 : O.optimizeNames(d, g), !!(super.optimizeNames(d, g) || this.else))
  3206. return this.condition = Me(this.condition, d, g), this;
  3207. }
  3208. get names() {
  3209. const d = super.names;
  3210. return st(d, this.condition), this.else && Ae(d, this.else.names), d;
  3211. }
  3212. }
  3213. p.kind = "if";
  3214. class m extends _ {
  3215. }
  3216. m.kind = "for";
  3217. class $ extends m {
  3218. constructor(d) {
  3219. super(), this.iteration = d;
  3220. }
  3221. render(d) {
  3222. return `for(${this.iteration})` + super.render(d);
  3223. }
  3224. optimizeNames(d, g) {
  3225. if (super.optimizeNames(d, g))
  3226. return this.iteration = Me(this.iteration, d, g), this;
  3227. }
  3228. get names() {
  3229. return Ae(super.names, this.iteration.names);
  3230. }
  3231. }
  3232. class E extends m {
  3233. constructor(d, g, O, R) {
  3234. super(), this.varKind = d, this.name = g, this.from = O, this.to = R;
  3235. }
  3236. render(d) {
  3237. const g = d.es5 ? r.varKinds.var : this.varKind, { name: O, from: R, to: N } = this;
  3238. return `for(${g} ${O}=${R}; ${O}<${N}; ${O}++)` + super.render(d);
  3239. }
  3240. get names() {
  3241. const d = st(super.names, this.from);
  3242. return st(d, this.to);
  3243. }
  3244. }
  3245. class S extends m {
  3246. constructor(d, g, O, R) {
  3247. super(), this.loop = d, this.varKind = g, this.name = O, this.iterable = R;
  3248. }
  3249. render(d) {
  3250. return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(d);
  3251. }
  3252. optimizeNames(d, g) {
  3253. if (super.optimizeNames(d, g))
  3254. return this.iterable = Me(this.iterable, d, g), this;
  3255. }
  3256. get names() {
  3257. return Ae(super.names, this.iterable.names);
  3258. }
  3259. }
  3260. class A extends _ {
  3261. constructor(d, g, O) {
  3262. super(), this.name = d, this.args = g, this.async = O;
  3263. }
  3264. render(d) {
  3265. return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(d);
  3266. }
  3267. }
  3268. A.kind = "func";
  3269. class U extends y {
  3270. render(d) {
  3271. return "return " + super.render(d);
  3272. }
  3273. }
  3274. U.kind = "return";
  3275. class fe extends _ {
  3276. render(d) {
  3277. let g = "try" + super.render(d);
  3278. return this.catch && (g += this.catch.render(d)), this.finally && (g += this.finally.render(d)), g;
  3279. }
  3280. optimizeNodes() {
  3281. var d, g;
  3282. return super.optimizeNodes(), (d = this.catch) === null || d === void 0 || d.optimizeNodes(), (g = this.finally) === null || g === void 0 || g.optimizeNodes(), this;
  3283. }
  3284. optimizeNames(d, g) {
  3285. var O, R;
  3286. return super.optimizeNames(d, g), (O = this.catch) === null || O === void 0 || O.optimizeNames(d, g), (R = this.finally) === null || R === void 0 || R.optimizeNames(d, g), this;
  3287. }
  3288. get names() {
  3289. const d = super.names;
  3290. return this.catch && Ae(d, this.catch.names), this.finally && Ae(d, this.finally.names), d;
  3291. }
  3292. }
  3293. class ce extends _ {
  3294. constructor(d) {
  3295. super(), this.error = d;
  3296. }
  3297. render(d) {
  3298. return `catch(${this.error})` + super.render(d);
  3299. }
  3300. }
  3301. ce.kind = "catch";
  3302. class ve extends _ {
  3303. render(d) {
  3304. return "finally" + super.render(d);
  3305. }
  3306. }
  3307. ve.kind = "finally";
  3308. class jt {
  3309. constructor(d, g = {}) {
  3310. this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...g, _n: g.lines ? `
  3311. ` : "" }, this._extScope = d, this._scope = new r.Scope({ parent: d }), this._nodes = [new b()];
  3312. }
  3313. toString() {
  3314. return this._root.render(this.opts);
  3315. }
  3316. // returns unique name in the internal scope
  3317. name(d) {
  3318. return this._scope.name(d);
  3319. }
  3320. // reserves unique name in the external scope
  3321. scopeName(d) {
  3322. return this._extScope.name(d);
  3323. }
  3324. // reserves unique name in the external scope and assigns value to it
  3325. scopeValue(d, g) {
  3326. const O = this._extScope.value(d, g);
  3327. return (this._values[O.prefix] || (this._values[O.prefix] = /* @__PURE__ */ new Set())).add(O), O;
  3328. }
  3329. getScopeValue(d, g) {
  3330. return this._extScope.getValue(d, g);
  3331. }
  3332. // return code that assigns values in the external scope to the names that are used internally
  3333. // (same names that were returned by gen.scopeName or gen.scopeValue)
  3334. scopeRefs(d) {
  3335. return this._extScope.scopeRefs(d, this._values);
  3336. }
  3337. scopeCode() {
  3338. return this._extScope.scopeCode(this._values);
  3339. }
  3340. _def(d, g, O, R) {
  3341. const N = this._scope.toName(g);
  3342. return O !== void 0 && R && (this._constants[N.str] = O), this._leafNode(new o(d, N, O)), N;
  3343. }
  3344. // `const` declaration (`var` in es5 mode)
  3345. const(d, g, O) {
  3346. return this._def(r.varKinds.const, d, g, O);
  3347. }
  3348. // `let` declaration with optional assignment (`var` in es5 mode)
  3349. let(d, g, O) {
  3350. return this._def(r.varKinds.let, d, g, O);
  3351. }
  3352. // `var` declaration with optional assignment
  3353. var(d, g, O) {
  3354. return this._def(r.varKinds.var, d, g, O);
  3355. }
  3356. // assignment code
  3357. assign(d, g, O) {
  3358. return this._leafNode(new a(d, g, O));
  3359. }
  3360. // `+=` code
  3361. add(d, g) {
  3362. return this._leafNode(new l(d, e.operators.ADD, g));
  3363. }
  3364. // appends passed SafeExpr to code or executes Block
  3365. code(d) {
  3366. return typeof d == "function" ? d() : d !== t.nil && this._leafNode(new h(d)), this;
  3367. }
  3368. // returns code for object literal for the passed argument list of key-value pairs
  3369. object(...d) {
  3370. const g = ["{"];
  3371. for (const [O, R] of d)
  3372. g.length > 1 && g.push(","), g.push(O), (O !== R || this.opts.es5) && (g.push(":"), (0, t.addCodeArg)(g, R));
  3373. return g.push("}"), new t._Code(g);
  3374. }
  3375. // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
  3376. if(d, g, O) {
  3377. if (this._blockNode(new p(d)), g && O)
  3378. this.code(g).else().code(O).endIf();
  3379. else if (g)
  3380. this.code(g).endIf();
  3381. else if (O)
  3382. throw new Error('CodeGen: "else" body without "then" body');
  3383. return this;
  3384. }
  3385. // `else if` clause - invalid without `if` or after `else` clauses
  3386. elseIf(d) {
  3387. return this._elseNode(new p(d));
  3388. }
  3389. // `else` clause - only valid after `if` or `else if` clauses
  3390. else() {
  3391. return this._elseNode(new v());
  3392. }
  3393. // end `if` statement (needed if gen.if was used only with condition)
  3394. endIf() {
  3395. return this._endBlockNode(p, v);
  3396. }
  3397. _for(d, g) {
  3398. return this._blockNode(d), g && this.code(g).endFor(), this;
  3399. }
  3400. // a generic `for` clause (or statement if `forBody` is passed)
  3401. for(d, g) {
  3402. return this._for(new $(d), g);
  3403. }
  3404. // `for` statement for a range of values
  3405. forRange(d, g, O, R, N = this.opts.es5 ? r.varKinds.var : r.varKinds.let) {
  3406. const z = this._scope.toName(d);
  3407. return this._for(new E(N, z, g, O), () => R(z));
  3408. }
  3409. // `for-of` statement (in es5 mode replace with a normal for loop)
  3410. forOf(d, g, O, R = r.varKinds.const) {
  3411. const N = this._scope.toName(d);
  3412. if (this.opts.es5) {
  3413. const z = g instanceof t.Name ? g : this.var("_arr", g);
  3414. return this.forRange("_i", 0, (0, t._)`${z}.length`, (L) => {
  3415. this.var(N, (0, t._)`${z}[${L}]`), O(N);
  3416. });
  3417. }
  3418. return this._for(new S("of", R, N, g), () => O(N));
  3419. }
  3420. // `for-in` statement.
  3421. // With option `ownProperties` replaced with a `for-of` loop for object keys
  3422. forIn(d, g, O, R = this.opts.es5 ? r.varKinds.var : r.varKinds.const) {
  3423. if (this.opts.ownProperties)
  3424. return this.forOf(d, (0, t._)`Object.keys(${g})`, O);
  3425. const N = this._scope.toName(d);
  3426. return this._for(new S("in", R, N, g), () => O(N));
  3427. }
  3428. // end `for` loop
  3429. endFor() {
  3430. return this._endBlockNode(m);
  3431. }
  3432. // `label` statement
  3433. label(d) {
  3434. return this._leafNode(new c(d));
  3435. }
  3436. // `break` statement
  3437. break(d) {
  3438. return this._leafNode(new f(d));
  3439. }
  3440. // `return` statement
  3441. return(d) {
  3442. const g = new U();
  3443. if (this._blockNode(g), this.code(d), g.nodes.length !== 1)
  3444. throw new Error('CodeGen: "return" should have one node');
  3445. return this._endBlockNode(U);
  3446. }
  3447. // `try` statement
  3448. try(d, g, O) {
  3449. if (!g && !O)
  3450. throw new Error('CodeGen: "try" without "catch" and "finally"');
  3451. const R = new fe();
  3452. if (this._blockNode(R), this.code(d), g) {
  3453. const N = this.name("e");
  3454. this._currNode = R.catch = new ce(N), g(N);
  3455. }
  3456. return O && (this._currNode = R.finally = new ve(), this.code(O)), this._endBlockNode(ce, ve);
  3457. }
  3458. // `throw` statement
  3459. throw(d) {
  3460. return this._leafNode(new u(d));
  3461. }
  3462. // start self-balancing block
  3463. block(d, g) {
  3464. return this._blockStarts.push(this._nodes.length), d && this.code(d).endBlock(g), this;
  3465. }
  3466. // end the current self-balancing block
  3467. endBlock(d) {
  3468. const g = this._blockStarts.pop();
  3469. if (g === void 0)
  3470. throw new Error("CodeGen: not in self-balancing block");
  3471. const O = this._nodes.length - g;
  3472. if (O < 0 || d !== void 0 && O !== d)
  3473. throw new Error(`CodeGen: wrong number of nodes: ${O} vs ${d} expected`);
  3474. return this._nodes.length = g, this;
  3475. }
  3476. // `function` heading (or definition if funcBody is passed)
  3477. func(d, g = t.nil, O, R) {
  3478. return this._blockNode(new A(d, g, O)), R && this.code(R).endFunc(), this;
  3479. }
  3480. // end function definition
  3481. endFunc() {
  3482. return this._endBlockNode(A);
  3483. }
  3484. optimize(d = 1) {
  3485. for (; d-- > 0; )
  3486. this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants);
  3487. }
  3488. _leafNode(d) {
  3489. return this._currNode.nodes.push(d), this;
  3490. }
  3491. _blockNode(d) {
  3492. this._currNode.nodes.push(d), this._nodes.push(d);
  3493. }
  3494. _endBlockNode(d, g) {
  3495. const O = this._currNode;
  3496. if (O instanceof d || g && O instanceof g)
  3497. return this._nodes.pop(), this;
  3498. throw new Error(`CodeGen: not in block "${g ? `${d.kind}/${g.kind}` : d.kind}"`);
  3499. }
  3500. _elseNode(d) {
  3501. const g = this._currNode;
  3502. if (!(g instanceof p))
  3503. throw new Error('CodeGen: "else" without "if"');
  3504. return this._currNode = g.else = d, this;
  3505. }
  3506. get _root() {
  3507. return this._nodes[0];
  3508. }
  3509. get _currNode() {
  3510. const d = this._nodes;
  3511. return d[d.length - 1];
  3512. }
  3513. set _currNode(d) {
  3514. const g = this._nodes;
  3515. g[g.length - 1] = d;
  3516. }
  3517. }
  3518. e.CodeGen = jt;
  3519. function Ae(P, d) {
  3520. for (const g in d)
  3521. P[g] = (P[g] || 0) + (d[g] || 0);
  3522. return P;
  3523. }
  3524. function st(P, d) {
  3525. return d instanceof t._CodeOrName ? Ae(P, d.names) : P;
  3526. }
  3527. function Me(P, d, g) {
  3528. if (P instanceof t.Name)
  3529. return O(P);
  3530. if (!R(P))
  3531. return P;
  3532. return new t._Code(P._items.reduce((N, z) => (z instanceof t.Name && (z = O(z)), z instanceof t._Code ? N.push(...z._items) : N.push(z), N), []));
  3533. function O(N) {
  3534. const z = g[N.str];
  3535. return z === void 0 || d[N.str] !== 1 ? N : (delete d[N.str], z);
  3536. }
  3537. function R(N) {
  3538. return N instanceof t._Code && N._items.some((z) => z instanceof t.Name && d[z.str] === 1 && g[z.str] !== void 0);
  3539. }
  3540. }
  3541. function At(P, d) {
  3542. for (const g in d)
  3543. P[g] = (P[g] || 0) - (d[g] || 0);
  3544. }
  3545. function ir(P) {
  3546. return typeof P == "boolean" || typeof P == "number" || P === null ? !P : (0, t._)`!${x(P)}`;
  3547. }
  3548. e.not = ir;
  3549. const hn = w(e.operators.AND);
  3550. function mn(...P) {
  3551. return P.reduce(hn);
  3552. }
  3553. e.and = mn;
  3554. const sr = w(e.operators.OR);
  3555. function C(...P) {
  3556. return P.reduce(sr);
  3557. }
  3558. e.or = C;
  3559. function w(P) {
  3560. return (d, g) => d === t.nil ? g : g === t.nil ? d : (0, t._)`${x(d)} ${P} ${x(g)}`;
  3561. }
  3562. function x(P) {
  3563. return P instanceof t.Name ? P : (0, t._)`(${P})`;
  3564. }
  3565. })(D);
  3566. var I = {};
  3567. Object.defineProperty(I, "__esModule", { value: !0 });
  3568. I.checkStrictMode = I.getErrorPath = I.Type = I.useFunc = I.setEvaluated = I.evaluatedPropsToName = I.mergeEvaluated = I.eachItem = I.unescapeJsonPointer = I.escapeJsonPointer = I.escapeFragment = I.unescapeFragment = I.schemaRefOrVal = I.schemaHasRulesButRef = I.schemaHasRules = I.checkUnknownRules = I.alwaysValidSchema = I.toHash = void 0;
  3569. const G = D, Tu = zt;
  3570. function Ru(e) {
  3571. const t = {};
  3572. for (const r of e)
  3573. t[r] = !0;
  3574. return t;
  3575. }
  3576. I.toHash = Ru;
  3577. function ku(e, t) {
  3578. return typeof t == "boolean" ? t : Object.keys(t).length === 0 ? !0 : (Aa(e, t), !Ca(t, e.self.RULES.all));
  3579. }
  3580. I.alwaysValidSchema = ku;
  3581. function Aa(e, t = e.schema) {
  3582. const { opts: r, self: n } = e;
  3583. if (!r.strictSchema || typeof t == "boolean")
  3584. return;
  3585. const i = n.RULES.keywords;
  3586. for (const s in t)
  3587. i[s] || Ra(e, `unknown keyword: "${s}"`);
  3588. }
  3589. I.checkUnknownRules = Aa;
  3590. function Ca(e, t) {
  3591. if (typeof e == "boolean")
  3592. return !e;
  3593. for (const r in e)
  3594. if (t[r])
  3595. return !0;
  3596. return !1;
  3597. }
  3598. I.schemaHasRules = Ca;
  3599. function Nu(e, t) {
  3600. if (typeof e == "boolean")
  3601. return !e;
  3602. for (const r in e)
  3603. if (r !== "$ref" && t.all[r])
  3604. return !0;
  3605. return !1;
  3606. }
  3607. I.schemaHasRulesButRef = Nu;
  3608. function Mu({ topSchemaRef: e, schemaPath: t }, r, n, i) {
  3609. if (!i) {
  3610. if (typeof r == "number" || typeof r == "boolean")
  3611. return r;
  3612. if (typeof r == "string")
  3613. return (0, G._)`${r}`;
  3614. }
  3615. return (0, G._)`${e}${t}${(0, G.getProperty)(n)}`;
  3616. }
  3617. I.schemaRefOrVal = Mu;
  3618. function Du(e) {
  3619. return Ia(decodeURIComponent(e));
  3620. }
  3621. I.unescapeFragment = Du;
  3622. function qu(e) {
  3623. return encodeURIComponent(Pi(e));
  3624. }
  3625. I.escapeFragment = qu;
  3626. function Pi(e) {
  3627. return typeof e == "number" ? `${e}` : e.replace(/~/g, "~0").replace(/\//g, "~1");
  3628. }
  3629. I.escapeJsonPointer = Pi;
  3630. function Ia(e) {
  3631. return e.replace(/~1/g, "/").replace(/~0/g, "~");
  3632. }
  3633. I.unescapeJsonPointer = Ia;
  3634. function Fu(e, t) {
  3635. if (Array.isArray(e))
  3636. for (const r of e)
  3637. t(r);
  3638. else
  3639. t(e);
  3640. }
  3641. I.eachItem = Fu;
  3642. function Qs({ mergeNames: e, mergeToName: t, mergeValues: r, resultToName: n }) {
  3643. return (i, s, o, a) => {
  3644. const l = o === void 0 ? s : o instanceof G.Name ? (s instanceof G.Name ? e(i, s, o) : t(i, s, o), o) : s instanceof G.Name ? (t(i, o, s), s) : r(s, o);
  3645. return a === G.Name && !(l instanceof G.Name) ? n(i, l) : l;
  3646. };
  3647. }
  3648. I.mergeEvaluated = {
  3649. props: Qs({
  3650. mergeNames: (e, t, r) => e.if((0, G._)`${r} !== true && ${t} !== undefined`, () => {
  3651. e.if((0, G._)`${t} === true`, () => e.assign(r, !0), () => e.assign(r, (0, G._)`${r} || {}`).code((0, G._)`Object.assign(${r}, ${t})`));
  3652. }),
  3653. mergeToName: (e, t, r) => e.if((0, G._)`${r} !== true`, () => {
  3654. t === !0 ? e.assign(r, !0) : (e.assign(r, (0, G._)`${r} || {}`), Oi(e, r, t));
  3655. }),
  3656. mergeValues: (e, t) => e === !0 ? !0 : { ...e, ...t },
  3657. resultToName: Ta
  3658. }),
  3659. items: Qs({
  3660. mergeNames: (e, t, r) => e.if((0, G._)`${r} !== true && ${t} !== undefined`, () => e.assign(r, (0, G._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),
  3661. mergeToName: (e, t, r) => e.if((0, G._)`${r} !== true`, () => e.assign(r, t === !0 ? !0 : (0, G._)`${r} > ${t} ? ${r} : ${t}`)),
  3662. mergeValues: (e, t) => e === !0 ? !0 : Math.max(e, t),
  3663. resultToName: (e, t) => e.var("items", t)
  3664. })
  3665. };
  3666. function Ta(e, t) {
  3667. if (t === !0)
  3668. return e.var("props", !0);
  3669. const r = e.var("props", (0, G._)`{}`);
  3670. return t !== void 0 && Oi(e, r, t), r;
  3671. }
  3672. I.evaluatedPropsToName = Ta;
  3673. function Oi(e, t, r) {
  3674. Object.keys(r).forEach((n) => e.assign((0, G._)`${t}${(0, G.getProperty)(n)}`, !0));
  3675. }
  3676. I.setEvaluated = Oi;
  3677. const Zs = {};
  3678. function Vu(e, t) {
  3679. return e.scopeValue("func", {
  3680. ref: t,
  3681. code: Zs[t.code] || (Zs[t.code] = new Tu._Code(t.code))
  3682. });
  3683. }
  3684. I.useFunc = Vu;
  3685. var Yn;
  3686. (function(e) {
  3687. e[e.Num = 0] = "Num", e[e.Str = 1] = "Str";
  3688. })(Yn || (I.Type = Yn = {}));
  3689. function Lu(e, t, r) {
  3690. if (e instanceof G.Name) {
  3691. const n = t === Yn.Num;
  3692. return r ? n ? (0, G._)`"[" + ${e} + "]"` : (0, G._)`"['" + ${e} + "']"` : n ? (0, G._)`"/" + ${e}` : (0, G._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
  3693. }
  3694. return r ? (0, G.getProperty)(e).toString() : "/" + Pi(e);
  3695. }
  3696. I.getErrorPath = Lu;
  3697. function Ra(e, t, r = e.opts.strictSchema) {
  3698. if (r) {
  3699. if (t = `strict mode: ${t}`, r === !0)
  3700. throw new Error(t);
  3701. e.self.logger.warn(t);
  3702. }
  3703. }
  3704. I.checkStrictMode = Ra;
  3705. var ue = {};
  3706. Object.defineProperty(ue, "__esModule", { value: !0 });
  3707. const ee = D, Hu = {
  3708. // validation function arguments
  3709. data: new ee.Name("data"),
  3710. // data passed to validation function
  3711. // args passed from referencing schema
  3712. valCxt: new ee.Name("valCxt"),
  3713. // validation/data context - should not be used directly, it is destructured to the names below
  3714. instancePath: new ee.Name("instancePath"),
  3715. parentData: new ee.Name("parentData"),
  3716. parentDataProperty: new ee.Name("parentDataProperty"),
  3717. rootData: new ee.Name("rootData"),
  3718. // root data - same as the data passed to the first/top validation function
  3719. dynamicAnchors: new ee.Name("dynamicAnchors"),
  3720. // used to support recursiveRef and dynamicRef
  3721. // function scoped variables
  3722. vErrors: new ee.Name("vErrors"),
  3723. // null or array of validation errors
  3724. errors: new ee.Name("errors"),
  3725. // counter of validation errors
  3726. this: new ee.Name("this"),
  3727. // "globals"
  3728. self: new ee.Name("self"),
  3729. scope: new ee.Name("scope"),
  3730. // JTD serialize/parse name for JSON string and position
  3731. json: new ee.Name("json"),
  3732. jsonPos: new ee.Name("jsonPos"),
  3733. jsonLen: new ee.Name("jsonLen"),
  3734. jsonPart: new ee.Name("jsonPart")
  3735. };
  3736. ue.default = Hu;
  3737. (function(e) {
  3738. Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
  3739. const t = D, r = I, n = ue;
  3740. e.keywordError = {
  3741. message: ({ keyword: v }) => (0, t.str)`must pass "${v}" keyword validation`
  3742. }, e.keyword$DataError = {
  3743. message: ({ keyword: v, schemaType: p }) => p ? (0, t.str)`"${v}" keyword must be ${p} ($data)` : (0, t.str)`"${v}" keyword is invalid ($data)`
  3744. };
  3745. function i(v, p = e.keywordError, m, $) {
  3746. const { it: E } = v, { gen: S, compositeRule: A, allErrors: U } = E, fe = u(v, p, m);
  3747. $ ?? (A || U) ? l(S, fe) : c(E, (0, t._)`[${fe}]`);
  3748. }
  3749. e.reportError = i;
  3750. function s(v, p = e.keywordError, m) {
  3751. const { it: $ } = v, { gen: E, compositeRule: S, allErrors: A } = $, U = u(v, p, m);
  3752. l(E, U), S || A || c($, n.default.vErrors);
  3753. }
  3754. e.reportExtraError = s;
  3755. function o(v, p) {
  3756. v.assign(n.default.errors, p), v.if((0, t._)`${n.default.vErrors} !== null`, () => v.if(p, () => v.assign((0, t._)`${n.default.vErrors}.length`, p), () => v.assign(n.default.vErrors, null)));
  3757. }
  3758. e.resetErrorsCount = o;
  3759. function a({ gen: v, keyword: p, schemaValue: m, data: $, errsCount: E, it: S }) {
  3760. if (E === void 0)
  3761. throw new Error("ajv implementation error");
  3762. const A = v.name("err");
  3763. v.forRange("i", E, n.default.errors, (U) => {
  3764. v.const(A, (0, t._)`${n.default.vErrors}[${U}]`), v.if((0, t._)`${A}.instancePath === undefined`, () => v.assign((0, t._)`${A}.instancePath`, (0, t.strConcat)(n.default.instancePath, S.errorPath))), v.assign((0, t._)`${A}.schemaPath`, (0, t.str)`${S.errSchemaPath}/${p}`), S.opts.verbose && (v.assign((0, t._)`${A}.schema`, m), v.assign((0, t._)`${A}.data`, $));
  3765. });
  3766. }
  3767. e.extendErrors = a;
  3768. function l(v, p) {
  3769. const m = v.const("err", p);
  3770. v.if((0, t._)`${n.default.vErrors} === null`, () => v.assign(n.default.vErrors, (0, t._)`[${m}]`), (0, t._)`${n.default.vErrors}.push(${m})`), v.code((0, t._)`${n.default.errors}++`);
  3771. }
  3772. function c(v, p) {
  3773. const { gen: m, validateName: $, schemaEnv: E } = v;
  3774. E.$async ? m.throw((0, t._)`new ${v.ValidationError}(${p})`) : (m.assign((0, t._)`${$}.errors`, p), m.return(!1));
  3775. }
  3776. const f = {
  3777. keyword: new t.Name("keyword"),
  3778. schemaPath: new t.Name("schemaPath"),
  3779. // also used in JTD errors
  3780. params: new t.Name("params"),
  3781. propertyName: new t.Name("propertyName"),
  3782. message: new t.Name("message"),
  3783. schema: new t.Name("schema"),
  3784. parentSchema: new t.Name("parentSchema")
  3785. };
  3786. function u(v, p, m) {
  3787. const { createErrors: $ } = v.it;
  3788. return $ === !1 ? (0, t._)`{}` : h(v, p, m);
  3789. }
  3790. function h(v, p, m = {}) {
  3791. const { gen: $, it: E } = v, S = [
  3792. y(E, m),
  3793. _(v, m)
  3794. ];
  3795. return b(v, p, S), $.object(...S);
  3796. }
  3797. function y({ errorPath: v }, { instancePath: p }) {
  3798. const m = p ? (0, t.str)`${v}${(0, r.getErrorPath)(p, r.Type.Str)}` : v;
  3799. return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, m)];
  3800. }
  3801. function _({ keyword: v, it: { errSchemaPath: p } }, { schemaPath: m, parentSchema: $ }) {
  3802. let E = $ ? p : (0, t.str)`${p}/${v}`;
  3803. return m && (E = (0, t.str)`${E}${(0, r.getErrorPath)(m, r.Type.Str)}`), [f.schemaPath, E];
  3804. }
  3805. function b(v, { params: p, message: m }, $) {
  3806. const { keyword: E, data: S, schemaValue: A, it: U } = v, { opts: fe, propertyName: ce, topSchemaRef: ve, schemaPath: jt } = U;
  3807. $.push([f.keyword, E], [f.params, typeof p == "function" ? p(v) : p || (0, t._)`{}`]), fe.messages && $.push([f.message, typeof m == "function" ? m(v) : m]), fe.verbose && $.push([f.schema, A], [f.parentSchema, (0, t._)`${ve}${jt}`], [n.default.data, S]), ce && $.push([f.propertyName, ce]);
  3808. }
  3809. })(Xt);
  3810. Object.defineProperty($t, "__esModule", { value: !0 });
  3811. $t.boolOrEmptySchema = $t.topBoolOrEmptySchema = void 0;
  3812. const Uu = Xt, zu = D, Gu = ue, Bu = {
  3813. message: "boolean schema is false"
  3814. };
  3815. function Ku(e) {
  3816. const { gen: t, schema: r, validateName: n } = e;
  3817. r === !1 ? ka(e, !1) : typeof r == "object" && r.$async === !0 ? t.return(Gu.default.data) : (t.assign((0, zu._)`${n}.errors`, null), t.return(!0));
  3818. }
  3819. $t.topBoolOrEmptySchema = Ku;
  3820. function Wu(e, t) {
  3821. const { gen: r, schema: n } = e;
  3822. n === !1 ? (r.var(t, !1), ka(e)) : r.var(t, !0);
  3823. }
  3824. $t.boolOrEmptySchema = Wu;
  3825. function ka(e, t) {
  3826. const { gen: r, data: n } = e, i = {
  3827. gen: r,
  3828. keyword: "false schema",
  3829. data: n,
  3830. schema: !1,
  3831. schemaCode: !1,
  3832. schemaValue: !1,
  3833. params: {},
  3834. it: e
  3835. };
  3836. (0, Uu.reportError)(i, Bu, void 0, t);
  3837. }
  3838. var Y = {}, rt = {};
  3839. Object.defineProperty(rt, "__esModule", { value: !0 });
  3840. rt.getRules = rt.isJSONType = void 0;
  3841. const Ju = ["string", "number", "integer", "boolean", "null", "object", "array"], Yu = new Set(Ju);
  3842. function Xu(e) {
  3843. return typeof e == "string" && Yu.has(e);
  3844. }
  3845. rt.isJSONType = Xu;
  3846. function Qu() {
  3847. const e = {
  3848. number: { type: "number", rules: [] },
  3849. string: { type: "string", rules: [] },
  3850. array: { type: "array", rules: [] },
  3851. object: { type: "object", rules: [] }
  3852. };
  3853. return {
  3854. types: { ...e, integer: !0, boolean: !0, null: !0 },
  3855. rules: [{ rules: [] }, e.number, e.string, e.array, e.object],
  3856. post: { rules: [] },
  3857. all: {},
  3858. keywords: {}
  3859. };
  3860. }
  3861. rt.getRules = Qu;
  3862. var Ie = {};
  3863. Object.defineProperty(Ie, "__esModule", { value: !0 });
  3864. Ie.shouldUseRule = Ie.shouldUseGroup = Ie.schemaHasRulesForType = void 0;
  3865. function Zu({ schema: e, self: t }, r) {
  3866. const n = t.RULES.types[r];
  3867. return n && n !== !0 && Na(e, n);
  3868. }
  3869. Ie.schemaHasRulesForType = Zu;
  3870. function Na(e, t) {
  3871. return t.rules.some((r) => Ma(e, r));
  3872. }
  3873. Ie.shouldUseGroup = Na;
  3874. function Ma(e, t) {
  3875. var r;
  3876. return e[t.keyword] !== void 0 || ((r = t.definition.implements) === null || r === void 0 ? void 0 : r.some((n) => e[n] !== void 0));
  3877. }
  3878. Ie.shouldUseRule = Ma;
  3879. Object.defineProperty(Y, "__esModule", { value: !0 });
  3880. Y.reportTypeError = Y.checkDataTypes = Y.checkDataType = Y.coerceAndCheckDataType = Y.getJSONTypes = Y.getSchemaTypes = Y.DataType = void 0;
  3881. const ef = rt, tf = Ie, rf = Xt, q = D, Da = I;
  3882. var yt;
  3883. (function(e) {
  3884. e[e.Correct = 0] = "Correct", e[e.Wrong = 1] = "Wrong";
  3885. })(yt || (Y.DataType = yt = {}));
  3886. function nf(e) {
  3887. const t = qa(e.type);
  3888. if (t.includes("null")) {
  3889. if (e.nullable === !1)
  3890. throw new Error("type: null contradicts nullable: false");
  3891. } else {
  3892. if (!t.length && e.nullable !== void 0)
  3893. throw new Error('"nullable" cannot be used without "type"');
  3894. e.nullable === !0 && t.push("null");
  3895. }
  3896. return t;
  3897. }
  3898. Y.getSchemaTypes = nf;
  3899. function qa(e) {
  3900. const t = Array.isArray(e) ? e : e ? [e] : [];
  3901. if (t.every(ef.isJSONType))
  3902. return t;
  3903. throw new Error("type must be JSONType or JSONType[]: " + t.join(","));
  3904. }
  3905. Y.getJSONTypes = qa;
  3906. function sf(e, t) {
  3907. const { gen: r, data: n, opts: i } = e, s = of(t, i.coerceTypes), o = t.length > 0 && !(s.length === 0 && t.length === 1 && (0, tf.schemaHasRulesForType)(e, t[0]));
  3908. if (o) {
  3909. const a = Ei(t, n, i.strictNumbers, yt.Wrong);
  3910. r.if(a, () => {
  3911. s.length ? af(e, t, s) : Si(e);
  3912. });
  3913. }
  3914. return o;
  3915. }
  3916. Y.coerceAndCheckDataType = sf;
  3917. const Fa = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
  3918. function of(e, t) {
  3919. return t ? e.filter((r) => Fa.has(r) || t === "array" && r === "array") : [];
  3920. }
  3921. function af(e, t, r) {
  3922. const { gen: n, data: i, opts: s } = e, o = n.let("dataType", (0, q._)`typeof ${i}`), a = n.let("coerced", (0, q._)`undefined`);
  3923. s.coerceTypes === "array" && n.if((0, q._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`, () => n.assign(i, (0, q._)`${i}[0]`).assign(o, (0, q._)`typeof ${i}`).if(Ei(t, i, s.strictNumbers), () => n.assign(a, i))), n.if((0, q._)`${a} !== undefined`);
  3924. for (const c of r)
  3925. (Fa.has(c) || c === "array" && s.coerceTypes === "array") && l(c);
  3926. n.else(), Si(e), n.endIf(), n.if((0, q._)`${a} !== undefined`, () => {
  3927. n.assign(i, a), lf(e, a);
  3928. });
  3929. function l(c) {
  3930. switch (c) {
  3931. case "string":
  3932. n.elseIf((0, q._)`${o} == "number" || ${o} == "boolean"`).assign(a, (0, q._)`"" + ${i}`).elseIf((0, q._)`${i} === null`).assign(a, (0, q._)`""`);
  3933. return;
  3934. case "number":
  3935. n.elseIf((0, q._)`${o} == "boolean" || ${i} === null
  3936. || (${o} == "string" && ${i} && ${i} == +${i})`).assign(a, (0, q._)`+${i}`);
  3937. return;
  3938. case "integer":
  3939. n.elseIf((0, q._)`${o} === "boolean" || ${i} === null
  3940. || (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a, (0, q._)`+${i}`);
  3941. return;
  3942. case "boolean":
  3943. n.elseIf((0, q._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a, !1).elseIf((0, q._)`${i} === "true" || ${i} === 1`).assign(a, !0);
  3944. return;
  3945. case "null":
  3946. n.elseIf((0, q._)`${i} === "" || ${i} === 0 || ${i} === false`), n.assign(a, null);
  3947. return;
  3948. case "array":
  3949. n.elseIf((0, q._)`${o} === "string" || ${o} === "number"
  3950. || ${o} === "boolean" || ${i} === null`).assign(a, (0, q._)`[${i}]`);
  3951. }
  3952. }
  3953. }
  3954. function lf({ gen: e, parentData: t, parentDataProperty: r }, n) {
  3955. e.if((0, q._)`${t} !== undefined`, () => e.assign((0, q._)`${t}[${r}]`, n));
  3956. }
  3957. function Xn(e, t, r, n = yt.Correct) {
  3958. const i = n === yt.Correct ? q.operators.EQ : q.operators.NEQ;
  3959. let s;
  3960. switch (e) {
  3961. case "null":
  3962. return (0, q._)`${t} ${i} null`;
  3963. case "array":
  3964. s = (0, q._)`Array.isArray(${t})`;
  3965. break;
  3966. case "object":
  3967. s = (0, q._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;
  3968. break;
  3969. case "integer":
  3970. s = o((0, q._)`!(${t} % 1) && !isNaN(${t})`);
  3971. break;
  3972. case "number":
  3973. s = o();
  3974. break;
  3975. default:
  3976. return (0, q._)`typeof ${t} ${i} ${e}`;
  3977. }
  3978. return n === yt.Correct ? s : (0, q.not)(s);
  3979. function o(a = q.nil) {
  3980. return (0, q.and)((0, q._)`typeof ${t} == "number"`, a, r ? (0, q._)`isFinite(${t})` : q.nil);
  3981. }
  3982. }
  3983. Y.checkDataType = Xn;
  3984. function Ei(e, t, r, n) {
  3985. if (e.length === 1)
  3986. return Xn(e[0], t, r, n);
  3987. let i;
  3988. const s = (0, Da.toHash)(e);
  3989. if (s.array && s.object) {
  3990. const o = (0, q._)`typeof ${t} != "object"`;
  3991. i = s.null ? o : (0, q._)`!${t} || ${o}`, delete s.null, delete s.array, delete s.object;
  3992. } else
  3993. i = q.nil;
  3994. s.number && delete s.integer;
  3995. for (const o in s)
  3996. i = (0, q.and)(i, Xn(o, t, r, n));
  3997. return i;
  3998. }
  3999. Y.checkDataTypes = Ei;
  4000. const cf = {
  4001. message: ({ schema: e }) => `must be ${e}`,
  4002. params: ({ schema: e, schemaValue: t }) => typeof e == "string" ? (0, q._)`{type: ${e}}` : (0, q._)`{type: ${t}}`
  4003. };
  4004. function Si(e) {
  4005. const t = uf(e);
  4006. (0, rf.reportError)(t, cf);
  4007. }
  4008. Y.reportTypeError = Si;
  4009. function uf(e) {
  4010. const { gen: t, data: r, schema: n } = e, i = (0, Da.schemaRefOrVal)(e, n, "type");
  4011. return {
  4012. gen: t,
  4013. keyword: "type",
  4014. data: r,
  4015. schema: n.type,
  4016. schemaCode: i,
  4017. schemaValue: i,
  4018. parentSchema: n,
  4019. params: {},
  4020. it: e
  4021. };
  4022. }
  4023. var Vr = {};
  4024. Object.defineProperty(Vr, "__esModule", { value: !0 });
  4025. Vr.assignDefaults = void 0;
  4026. const at = D, ff = I;
  4027. function df(e, t) {
  4028. const { properties: r, items: n } = e.schema;
  4029. if (t === "object" && r)
  4030. for (const i in r)
  4031. eo(e, i, r[i].default);
  4032. else t === "array" && Array.isArray(n) && n.forEach((i, s) => eo(e, s, i.default));
  4033. }
  4034. Vr.assignDefaults = df;
  4035. function eo(e, t, r) {
  4036. const { gen: n, compositeRule: i, data: s, opts: o } = e;
  4037. if (r === void 0)
  4038. return;
  4039. const a = (0, at._)`${s}${(0, at.getProperty)(t)}`;
  4040. if (i) {
  4041. (0, ff.checkStrictMode)(e, `default is ignored for: ${a}`);
  4042. return;
  4043. }
  4044. let l = (0, at._)`${a} === undefined`;
  4045. o.useDefaults === "empty" && (l = (0, at._)`${l} || ${a} === null || ${a} === ""`), n.if(l, (0, at._)`${a} = ${(0, at.stringify)(r)}`);
  4046. }
  4047. var we = {}, F = {};
  4048. Object.defineProperty(F, "__esModule", { value: !0 });
  4049. F.validateUnion = F.validateArray = F.usePattern = F.callValidateCode = F.schemaProperties = F.allSchemaProperties = F.noPropertyInData = F.propertyInData = F.isOwnProperty = F.hasPropFunc = F.reportMissingProp = F.checkMissingProp = F.checkReportMissingProp = void 0;
  4050. const K = D, xi = I, De = ue, pf = I;
  4051. function hf(e, t) {
  4052. const { gen: r, data: n, it: i } = e;
  4053. r.if(Ai(r, n, t, i.opts.ownProperties), () => {
  4054. e.setParams({ missingProperty: (0, K._)`${t}` }, !0), e.error();
  4055. });
  4056. }
  4057. F.checkReportMissingProp = hf;
  4058. function mf({ gen: e, data: t, it: { opts: r } }, n, i) {
  4059. return (0, K.or)(...n.map((s) => (0, K.and)(Ai(e, t, s, r.ownProperties), (0, K._)`${i} = ${s}`)));
  4060. }
  4061. F.checkMissingProp = mf;
  4062. function yf(e, t) {
  4063. e.setParams({ missingProperty: t }, !0), e.error();
  4064. }
  4065. F.reportMissingProp = yf;
  4066. function Va(e) {
  4067. return e.scopeValue("func", {
  4068. // eslint-disable-next-line @typescript-eslint/unbound-method
  4069. ref: Object.prototype.hasOwnProperty,
  4070. code: (0, K._)`Object.prototype.hasOwnProperty`
  4071. });
  4072. }
  4073. F.hasPropFunc = Va;
  4074. function ji(e, t, r) {
  4075. return (0, K._)`${Va(e)}.call(${t}, ${r})`;
  4076. }
  4077. F.isOwnProperty = ji;
  4078. function gf(e, t, r, n) {
  4079. const i = (0, K._)`${t}${(0, K.getProperty)(r)} !== undefined`;
  4080. return n ? (0, K._)`${i} && ${ji(e, t, r)}` : i;
  4081. }
  4082. F.propertyInData = gf;
  4083. function Ai(e, t, r, n) {
  4084. const i = (0, K._)`${t}${(0, K.getProperty)(r)} === undefined`;
  4085. return n ? (0, K.or)(i, (0, K.not)(ji(e, t, r))) : i;
  4086. }
  4087. F.noPropertyInData = Ai;
  4088. function La(e) {
  4089. return e ? Object.keys(e).filter((t) => t !== "__proto__") : [];
  4090. }
  4091. F.allSchemaProperties = La;
  4092. function $f(e, t) {
  4093. return La(t).filter((r) => !(0, xi.alwaysValidSchema)(e, t[r]));
  4094. }
  4095. F.schemaProperties = $f;
  4096. function _f({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: n, schemaPath: i, errorPath: s }, it: o }, a, l, c) {
  4097. const f = c ? (0, K._)`${e}, ${t}, ${n}${i}` : t, u = [
  4098. [De.default.instancePath, (0, K.strConcat)(De.default.instancePath, s)],
  4099. [De.default.parentData, o.parentData],
  4100. [De.default.parentDataProperty, o.parentDataProperty],
  4101. [De.default.rootData, De.default.rootData]
  4102. ];
  4103. o.opts.dynamicRef && u.push([De.default.dynamicAnchors, De.default.dynamicAnchors]);
  4104. const h = (0, K._)`${f}, ${r.object(...u)}`;
  4105. return l !== K.nil ? (0, K._)`${a}.call(${l}, ${h})` : (0, K._)`${a}(${h})`;
  4106. }
  4107. F.callValidateCode = _f;
  4108. const vf = (0, K._)`new RegExp`;
  4109. function bf({ gen: e, it: { opts: t } }, r) {
  4110. const n = t.unicodeRegExp ? "u" : "", { regExp: i } = t.code, s = i(r, n);
  4111. return e.scopeValue("pattern", {
  4112. key: s.toString(),
  4113. ref: s,
  4114. code: (0, K._)`${i.code === "new RegExp" ? vf : (0, pf.useFunc)(e, i)}(${r}, ${n})`
  4115. });
  4116. }
  4117. F.usePattern = bf;
  4118. function wf(e) {
  4119. const { gen: t, data: r, keyword: n, it: i } = e, s = t.name("valid");
  4120. if (i.allErrors) {
  4121. const a = t.let("valid", !0);
  4122. return o(() => t.assign(a, !1)), a;
  4123. }
  4124. return t.var(s, !0), o(() => t.break()), s;
  4125. function o(a) {
  4126. const l = t.const("len", (0, K._)`${r}.length`);
  4127. t.forRange("i", 0, l, (c) => {
  4128. e.subschema({
  4129. keyword: n,
  4130. dataProp: c,
  4131. dataPropType: xi.Type.Num
  4132. }, s), t.if((0, K.not)(s), a);
  4133. });
  4134. }
  4135. }
  4136. F.validateArray = wf;
  4137. function Pf(e) {
  4138. const { gen: t, schema: r, keyword: n, it: i } = e;
  4139. if (!Array.isArray(r))
  4140. throw new Error("ajv implementation error");
  4141. if (r.some((l) => (0, xi.alwaysValidSchema)(i, l)) && !i.opts.unevaluated)
  4142. return;
  4143. const o = t.let("valid", !1), a = t.name("_valid");
  4144. t.block(() => r.forEach((l, c) => {
  4145. const f = e.subschema({
  4146. keyword: n,
  4147. schemaProp: c,
  4148. compositeRule: !0
  4149. }, a);
  4150. t.assign(o, (0, K._)`${o} || ${a}`), e.mergeValidEvaluated(f, a) || t.if((0, K.not)(o));
  4151. })), e.result(o, () => e.reset(), () => e.error(!0));
  4152. }
  4153. F.validateUnion = Pf;
  4154. Object.defineProperty(we, "__esModule", { value: !0 });
  4155. we.validateKeywordUsage = we.validSchemaType = we.funcKeywordCode = we.macroKeywordCode = void 0;
  4156. const ie = D, Je = ue, Of = F, Ef = Xt;
  4157. function Sf(e, t) {
  4158. const { gen: r, keyword: n, schema: i, parentSchema: s, it: o } = e, a = t.macro.call(o.self, i, s, o), l = Ha(r, n, a);
  4159. o.opts.validateSchema !== !1 && o.self.validateSchema(a, !0);
  4160. const c = r.name("valid");
  4161. e.subschema({
  4162. schema: a,
  4163. schemaPath: ie.nil,
  4164. errSchemaPath: `${o.errSchemaPath}/${n}`,
  4165. topSchemaRef: l,
  4166. compositeRule: !0
  4167. }, c), e.pass(c, () => e.error(!0));
  4168. }
  4169. we.macroKeywordCode = Sf;
  4170. function xf(e, t) {
  4171. var r;
  4172. const { gen: n, keyword: i, schema: s, parentSchema: o, $data: a, it: l } = e;
  4173. Af(l, t);
  4174. const c = !a && t.compile ? t.compile.call(l.self, s, o, l) : t.validate, f = Ha(n, i, c), u = n.let("valid");
  4175. e.block$data(u, h), e.ok((r = t.valid) !== null && r !== void 0 ? r : u);
  4176. function h() {
  4177. if (t.errors === !1)
  4178. b(), t.modifying && to(e), v(() => e.error());
  4179. else {
  4180. const p = t.async ? y() : _();
  4181. t.modifying && to(e), v(() => jf(e, p));
  4182. }
  4183. }
  4184. function y() {
  4185. const p = n.let("ruleErrs", null);
  4186. return n.try(() => b((0, ie._)`await `), (m) => n.assign(u, !1).if((0, ie._)`${m} instanceof ${l.ValidationError}`, () => n.assign(p, (0, ie._)`${m}.errors`), () => n.throw(m))), p;
  4187. }
  4188. function _() {
  4189. const p = (0, ie._)`${f}.errors`;
  4190. return n.assign(p, null), b(ie.nil), p;
  4191. }
  4192. function b(p = t.async ? (0, ie._)`await ` : ie.nil) {
  4193. const m = l.opts.passContext ? Je.default.this : Je.default.self, $ = !("compile" in t && !a || t.schema === !1);
  4194. n.assign(u, (0, ie._)`${p}${(0, Of.callValidateCode)(e, f, m, $)}`, t.modifying);
  4195. }
  4196. function v(p) {
  4197. var m;
  4198. n.if((0, ie.not)((m = t.valid) !== null && m !== void 0 ? m : u), p);
  4199. }
  4200. }
  4201. we.funcKeywordCode = xf;
  4202. function to(e) {
  4203. const { gen: t, data: r, it: n } = e;
  4204. t.if(n.parentData, () => t.assign(r, (0, ie._)`${n.parentData}[${n.parentDataProperty}]`));
  4205. }
  4206. function jf(e, t) {
  4207. const { gen: r } = e;
  4208. r.if((0, ie._)`Array.isArray(${t})`, () => {
  4209. r.assign(Je.default.vErrors, (0, ie._)`${Je.default.vErrors} === null ? ${t} : ${Je.default.vErrors}.concat(${t})`).assign(Je.default.errors, (0, ie._)`${Je.default.vErrors}.length`), (0, Ef.extendErrors)(e);
  4210. }, () => e.error());
  4211. }
  4212. function Af({ schemaEnv: e }, t) {
  4213. if (t.async && !e.$async)
  4214. throw new Error("async keyword in sync schema");
  4215. }
  4216. function Ha(e, t, r) {
  4217. if (r === void 0)
  4218. throw new Error(`keyword "${t}" failed to compile`);
  4219. return e.scopeValue("keyword", typeof r == "function" ? { ref: r } : { ref: r, code: (0, ie.stringify)(r) });
  4220. }
  4221. function Cf(e, t, r = !1) {
  4222. return !t.length || t.some((n) => n === "array" ? Array.isArray(e) : n === "object" ? e && typeof e == "object" && !Array.isArray(e) : typeof e == n || r && typeof e > "u");
  4223. }
  4224. we.validSchemaType = Cf;
  4225. function If({ schema: e, opts: t, self: r, errSchemaPath: n }, i, s) {
  4226. if (Array.isArray(i.keyword) ? !i.keyword.includes(s) : i.keyword !== s)
  4227. throw new Error("ajv implementation error");
  4228. const o = i.dependencies;
  4229. if (o != null && o.some((a) => !Object.prototype.hasOwnProperty.call(e, a)))
  4230. throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);
  4231. if (i.validateSchema && !i.validateSchema(e[s])) {
  4232. const l = `keyword "${s}" value is invalid at path "${n}": ` + r.errorsText(i.validateSchema.errors);
  4233. if (t.validateSchema === "log")
  4234. r.logger.error(l);
  4235. else
  4236. throw new Error(l);
  4237. }
  4238. }
  4239. we.validateKeywordUsage = If;
  4240. var ze = {};
  4241. Object.defineProperty(ze, "__esModule", { value: !0 });
  4242. ze.extendSubschemaMode = ze.extendSubschemaData = ze.getSubschema = void 0;
  4243. const be = D, Ua = I;
  4244. function Tf(e, { keyword: t, schemaProp: r, schema: n, schemaPath: i, errSchemaPath: s, topSchemaRef: o }) {
  4245. if (t !== void 0 && n !== void 0)
  4246. throw new Error('both "keyword" and "schema" passed, only one allowed');
  4247. if (t !== void 0) {
  4248. const a = e.schema[t];
  4249. return r === void 0 ? {
  4250. schema: a,
  4251. schemaPath: (0, be._)`${e.schemaPath}${(0, be.getProperty)(t)}`,
  4252. errSchemaPath: `${e.errSchemaPath}/${t}`
  4253. } : {
  4254. schema: a[r],
  4255. schemaPath: (0, be._)`${e.schemaPath}${(0, be.getProperty)(t)}${(0, be.getProperty)(r)}`,
  4256. errSchemaPath: `${e.errSchemaPath}/${t}/${(0, Ua.escapeFragment)(r)}`
  4257. };
  4258. }
  4259. if (n !== void 0) {
  4260. if (i === void 0 || s === void 0 || o === void 0)
  4261. throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
  4262. return {
  4263. schema: n,
  4264. schemaPath: i,
  4265. topSchemaRef: o,
  4266. errSchemaPath: s
  4267. };
  4268. }
  4269. throw new Error('either "keyword" or "schema" must be passed');
  4270. }
  4271. ze.getSubschema = Tf;
  4272. function Rf(e, t, { dataProp: r, dataPropType: n, data: i, dataTypes: s, propertyName: o }) {
  4273. if (i !== void 0 && r !== void 0)
  4274. throw new Error('both "data" and "dataProp" passed, only one allowed');
  4275. const { gen: a } = t;
  4276. if (r !== void 0) {
  4277. const { errorPath: c, dataPathArr: f, opts: u } = t, h = a.let("data", (0, be._)`${t.data}${(0, be.getProperty)(r)}`, !0);
  4278. l(h), e.errorPath = (0, be.str)`${c}${(0, Ua.getErrorPath)(r, n, u.jsPropertySyntax)}`, e.parentDataProperty = (0, be._)`${r}`, e.dataPathArr = [...f, e.parentDataProperty];
  4279. }
  4280. if (i !== void 0) {
  4281. const c = i instanceof be.Name ? i : a.let("data", i, !0);
  4282. l(c), o !== void 0 && (e.propertyName = o);
  4283. }
  4284. s && (e.dataTypes = s);
  4285. function l(c) {
  4286. e.data = c, e.dataLevel = t.dataLevel + 1, e.dataTypes = [], t.definedProperties = /* @__PURE__ */ new Set(), e.parentData = t.data, e.dataNames = [...t.dataNames, c];
  4287. }
  4288. }
  4289. ze.extendSubschemaData = Rf;
  4290. function kf(e, { jtdDiscriminator: t, jtdMetadata: r, compositeRule: n, createErrors: i, allErrors: s }) {
  4291. n !== void 0 && (e.compositeRule = n), i !== void 0 && (e.createErrors = i), s !== void 0 && (e.allErrors = s), e.jtdDiscriminator = t, e.jtdMetadata = r;
  4292. }
  4293. ze.extendSubschemaMode = kf;
  4294. var Z = {}, za = function e(t, r) {
  4295. if (t === r) return !0;
  4296. if (t && r && typeof t == "object" && typeof r == "object") {
  4297. if (t.constructor !== r.constructor) return !1;
  4298. var n, i, s;
  4299. if (Array.isArray(t)) {
  4300. if (n = t.length, n != r.length) return !1;
  4301. for (i = n; i-- !== 0; )
  4302. if (!e(t[i], r[i])) return !1;
  4303. return !0;
  4304. }
  4305. if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
  4306. if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
  4307. if (t.toString !== Object.prototype.toString) return t.toString() === r.toString();
  4308. if (s = Object.keys(t), n = s.length, n !== Object.keys(r).length) return !1;
  4309. for (i = n; i-- !== 0; )
  4310. if (!Object.prototype.hasOwnProperty.call(r, s[i])) return !1;
  4311. for (i = n; i-- !== 0; ) {
  4312. var o = s[i];
  4313. if (!e(t[o], r[o])) return !1;
  4314. }
  4315. return !0;
  4316. }
  4317. return t !== t && r !== r;
  4318. }, Ga = { exports: {} }, He = Ga.exports = function(e, t, r) {
  4319. typeof t == "function" && (r = t, t = {}), r = t.cb || r;
  4320. var n = typeof r == "function" ? r : r.pre || function() {
  4321. }, i = r.post || function() {
  4322. };
  4323. $r(t, n, i, e, "", e);
  4324. };
  4325. He.keywords = {
  4326. additionalItems: !0,
  4327. items: !0,
  4328. contains: !0,
  4329. additionalProperties: !0,
  4330. propertyNames: !0,
  4331. not: !0,
  4332. if: !0,
  4333. then: !0,
  4334. else: !0
  4335. };
  4336. He.arrayKeywords = {
  4337. items: !0,
  4338. allOf: !0,
  4339. anyOf: !0,
  4340. oneOf: !0
  4341. };
  4342. He.propsKeywords = {
  4343. $defs: !0,
  4344. definitions: !0,
  4345. properties: !0,
  4346. patternProperties: !0,
  4347. dependencies: !0
  4348. };
  4349. He.skipKeywords = {
  4350. default: !0,
  4351. enum: !0,
  4352. const: !0,
  4353. required: !0,
  4354. maximum: !0,
  4355. minimum: !0,
  4356. exclusiveMaximum: !0,
  4357. exclusiveMinimum: !0,
  4358. multipleOf: !0,
  4359. maxLength: !0,
  4360. minLength: !0,
  4361. pattern: !0,
  4362. format: !0,
  4363. maxItems: !0,
  4364. minItems: !0,
  4365. uniqueItems: !0,
  4366. maxProperties: !0,
  4367. minProperties: !0
  4368. };
  4369. function $r(e, t, r, n, i, s, o, a, l, c) {
  4370. if (n && typeof n == "object" && !Array.isArray(n)) {
  4371. t(n, i, s, o, a, l, c);
  4372. for (var f in n) {
  4373. var u = n[f];
  4374. if (Array.isArray(u)) {
  4375. if (f in He.arrayKeywords)
  4376. for (var h = 0; h < u.length; h++)
  4377. $r(e, t, r, u[h], i + "/" + f + "/" + h, s, i, f, n, h);
  4378. } else if (f in He.propsKeywords) {
  4379. if (u && typeof u == "object")
  4380. for (var y in u)
  4381. $r(e, t, r, u[y], i + "/" + f + "/" + Nf(y), s, i, f, n, y);
  4382. } else (f in He.keywords || e.allKeys && !(f in He.skipKeywords)) && $r(e, t, r, u, i + "/" + f, s, i, f, n);
  4383. }
  4384. r(n, i, s, o, a, l, c);
  4385. }
  4386. }
  4387. function Nf(e) {
  4388. return e.replace(/~/g, "~0").replace(/\//g, "~1");
  4389. }
  4390. var Mf = Ga.exports;
  4391. Object.defineProperty(Z, "__esModule", { value: !0 });
  4392. Z.getSchemaRefs = Z.resolveUrl = Z.normalizeId = Z._getFullPath = Z.getFullPath = Z.inlineRef = void 0;
  4393. const Df = I, qf = za, Ff = Mf, Vf = /* @__PURE__ */ new Set([
  4394. "type",
  4395. "format",
  4396. "pattern",
  4397. "maxLength",
  4398. "minLength",
  4399. "maxProperties",
  4400. "minProperties",
  4401. "maxItems",
  4402. "minItems",
  4403. "maximum",
  4404. "minimum",
  4405. "uniqueItems",
  4406. "multipleOf",
  4407. "required",
  4408. "enum",
  4409. "const"
  4410. ]);
  4411. function Lf(e, t = !0) {
  4412. return typeof e == "boolean" ? !0 : t === !0 ? !Qn(e) : t ? Ba(e) <= t : !1;
  4413. }
  4414. Z.inlineRef = Lf;
  4415. const Hf = /* @__PURE__ */ new Set([
  4416. "$ref",
  4417. "$recursiveRef",
  4418. "$recursiveAnchor",
  4419. "$dynamicRef",
  4420. "$dynamicAnchor"
  4421. ]);
  4422. function Qn(e) {
  4423. for (const t in e) {
  4424. if (Hf.has(t))
  4425. return !0;
  4426. const r = e[t];
  4427. if (Array.isArray(r) && r.some(Qn) || typeof r == "object" && Qn(r))
  4428. return !0;
  4429. }
  4430. return !1;
  4431. }
  4432. function Ba(e) {
  4433. let t = 0;
  4434. for (const r in e) {
  4435. if (r === "$ref")
  4436. return 1 / 0;
  4437. if (t++, !Vf.has(r) && (typeof e[r] == "object" && (0, Df.eachItem)(e[r], (n) => t += Ba(n)), t === 1 / 0))
  4438. return 1 / 0;
  4439. }
  4440. return t;
  4441. }
  4442. function Ka(e, t = "", r) {
  4443. r !== !1 && (t = gt(t));
  4444. const n = e.parse(t);
  4445. return Wa(e, n);
  4446. }
  4447. Z.getFullPath = Ka;
  4448. function Wa(e, t) {
  4449. return e.serialize(t).split("#")[0] + "#";
  4450. }
  4451. Z._getFullPath = Wa;
  4452. const Uf = /#\/?$/;
  4453. function gt(e) {
  4454. return e ? e.replace(Uf, "") : "";
  4455. }
  4456. Z.normalizeId = gt;
  4457. function zf(e, t, r) {
  4458. return r = gt(r), e.resolve(t, r);
  4459. }
  4460. Z.resolveUrl = zf;
  4461. const Gf = /^[a-z_][-a-z0-9._]*$/i;
  4462. function Bf(e, t) {
  4463. if (typeof e == "boolean")
  4464. return {};
  4465. const { schemaId: r, uriResolver: n } = this.opts, i = gt(e[r] || t), s = { "": i }, o = Ka(n, i, !1), a = {}, l = /* @__PURE__ */ new Set();
  4466. return Ff(e, { allKeys: !0 }, (u, h, y, _) => {
  4467. if (_ === void 0)
  4468. return;
  4469. const b = o + h;
  4470. let v = s[_];
  4471. typeof u[r] == "string" && (v = p.call(this, u[r])), m.call(this, u.$anchor), m.call(this, u.$dynamicAnchor), s[h] = v;
  4472. function p($) {
  4473. const E = this.opts.uriResolver.resolve;
  4474. if ($ = gt(v ? E(v, $) : $), l.has($))
  4475. throw f($);
  4476. l.add($);
  4477. let S = this.refs[$];
  4478. return typeof S == "string" && (S = this.refs[S]), typeof S == "object" ? c(u, S.schema, $) : $ !== gt(b) && ($[0] === "#" ? (c(u, a[$], $), a[$] = u) : this.refs[$] = b), $;
  4479. }
  4480. function m($) {
  4481. if (typeof $ == "string") {
  4482. if (!Gf.test($))
  4483. throw new Error(`invalid anchor "${$}"`);
  4484. p.call(this, `#${$}`);
  4485. }
  4486. }
  4487. }), a;
  4488. function c(u, h, y) {
  4489. if (h !== void 0 && !qf(u, h))
  4490. throw f(y);
  4491. }
  4492. function f(u) {
  4493. return new Error(`reference "${u}" resolves to more than one schema`);
  4494. }
  4495. }
  4496. Z.getSchemaRefs = Bf;
  4497. Object.defineProperty($e, "__esModule", { value: !0 });
  4498. $e.getData = $e.KeywordCxt = $e.validateFunctionCode = void 0;
  4499. const Ja = $t, ro = Y, Ci = Ie, Er = Y, Kf = Vr, qt = we, Rn = ze, T = D, M = ue, Wf = Z, Te = I, It = Xt;
  4500. function Jf(e) {
  4501. if (Qa(e) && (Za(e), Xa(e))) {
  4502. Qf(e);
  4503. return;
  4504. }
  4505. Ya(e, () => (0, Ja.topBoolOrEmptySchema)(e));
  4506. }
  4507. $e.validateFunctionCode = Jf;
  4508. function Ya({ gen: e, validateName: t, schema: r, schemaEnv: n, opts: i }, s) {
  4509. i.code.es5 ? e.func(t, (0, T._)`${M.default.data}, ${M.default.valCxt}`, n.$async, () => {
  4510. e.code((0, T._)`"use strict"; ${no(r, i)}`), Xf(e, i), e.code(s);
  4511. }) : e.func(t, (0, T._)`${M.default.data}, ${Yf(i)}`, n.$async, () => e.code(no(r, i)).code(s));
  4512. }
  4513. function Yf(e) {
  4514. return (0, T._)`{${M.default.instancePath}="", ${M.default.parentData}, ${M.default.parentDataProperty}, ${M.default.rootData}=${M.default.data}${e.dynamicRef ? (0, T._)`, ${M.default.dynamicAnchors}={}` : T.nil}}={}`;
  4515. }
  4516. function Xf(e, t) {
  4517. e.if(M.default.valCxt, () => {
  4518. e.var(M.default.instancePath, (0, T._)`${M.default.valCxt}.${M.default.instancePath}`), e.var(M.default.parentData, (0, T._)`${M.default.valCxt}.${M.default.parentData}`), e.var(M.default.parentDataProperty, (0, T._)`${M.default.valCxt}.${M.default.parentDataProperty}`), e.var(M.default.rootData, (0, T._)`${M.default.valCxt}.${M.default.rootData}`), t.dynamicRef && e.var(M.default.dynamicAnchors, (0, T._)`${M.default.valCxt}.${M.default.dynamicAnchors}`);
  4519. }, () => {
  4520. e.var(M.default.instancePath, (0, T._)`""`), e.var(M.default.parentData, (0, T._)`undefined`), e.var(M.default.parentDataProperty, (0, T._)`undefined`), e.var(M.default.rootData, M.default.data), t.dynamicRef && e.var(M.default.dynamicAnchors, (0, T._)`{}`);
  4521. });
  4522. }
  4523. function Qf(e) {
  4524. const { schema: t, opts: r, gen: n } = e;
  4525. Ya(e, () => {
  4526. r.$comment && t.$comment && tl(e), nd(e), n.let(M.default.vErrors, null), n.let(M.default.errors, 0), r.unevaluated && Zf(e), el(e), od(e);
  4527. });
  4528. }
  4529. function Zf(e) {
  4530. const { gen: t, validateName: r } = e;
  4531. e.evaluated = t.const("evaluated", (0, T._)`${r}.evaluated`), t.if((0, T._)`${e.evaluated}.dynamicProps`, () => t.assign((0, T._)`${e.evaluated}.props`, (0, T._)`undefined`)), t.if((0, T._)`${e.evaluated}.dynamicItems`, () => t.assign((0, T._)`${e.evaluated}.items`, (0, T._)`undefined`));
  4532. }
  4533. function no(e, t) {
  4534. const r = typeof e == "object" && e[t.schemaId];
  4535. return r && (t.code.source || t.code.process) ? (0, T._)`/*# sourceURL=${r} */` : T.nil;
  4536. }
  4537. function ed(e, t) {
  4538. if (Qa(e) && (Za(e), Xa(e))) {
  4539. td(e, t);
  4540. return;
  4541. }
  4542. (0, Ja.boolOrEmptySchema)(e, t);
  4543. }
  4544. function Xa({ schema: e, self: t }) {
  4545. if (typeof e == "boolean")
  4546. return !e;
  4547. for (const r in e)
  4548. if (t.RULES.all[r])
  4549. return !0;
  4550. return !1;
  4551. }
  4552. function Qa(e) {
  4553. return typeof e.schema != "boolean";
  4554. }
  4555. function td(e, t) {
  4556. const { schema: r, gen: n, opts: i } = e;
  4557. i.$comment && r.$comment && tl(e), id(e), sd(e);
  4558. const s = n.const("_errs", M.default.errors);
  4559. el(e, s), n.var(t, (0, T._)`${s} === ${M.default.errors}`);
  4560. }
  4561. function Za(e) {
  4562. (0, Te.checkUnknownRules)(e), rd(e);
  4563. }
  4564. function el(e, t) {
  4565. if (e.opts.jtd)
  4566. return io(e, [], !1, t);
  4567. const r = (0, ro.getSchemaTypes)(e.schema), n = (0, ro.coerceAndCheckDataType)(e, r);
  4568. io(e, r, !n, t);
  4569. }
  4570. function rd(e) {
  4571. const { schema: t, errSchemaPath: r, opts: n, self: i } = e;
  4572. t.$ref && n.ignoreKeywordsWithRef && (0, Te.schemaHasRulesButRef)(t, i.RULES) && i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`);
  4573. }
  4574. function nd(e) {
  4575. const { schema: t, opts: r } = e;
  4576. t.default !== void 0 && r.useDefaults && r.strictSchema && (0, Te.checkStrictMode)(e, "default is ignored in the schema root");
  4577. }
  4578. function id(e) {
  4579. const t = e.schema[e.opts.schemaId];
  4580. t && (e.baseId = (0, Wf.resolveUrl)(e.opts.uriResolver, e.baseId, t));
  4581. }
  4582. function sd(e) {
  4583. if (e.schema.$async && !e.schemaEnv.$async)
  4584. throw new Error("async schema in sync schema");
  4585. }
  4586. function tl({ gen: e, schemaEnv: t, schema: r, errSchemaPath: n, opts: i }) {
  4587. const s = r.$comment;
  4588. if (i.$comment === !0)
  4589. e.code((0, T._)`${M.default.self}.logger.log(${s})`);
  4590. else if (typeof i.$comment == "function") {
  4591. const o = (0, T.str)`${n}/$comment`, a = e.scopeValue("root", { ref: t.root });
  4592. e.code((0, T._)`${M.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`);
  4593. }
  4594. }
  4595. function od(e) {
  4596. const { gen: t, schemaEnv: r, validateName: n, ValidationError: i, opts: s } = e;
  4597. r.$async ? t.if((0, T._)`${M.default.errors} === 0`, () => t.return(M.default.data), () => t.throw((0, T._)`new ${i}(${M.default.vErrors})`)) : (t.assign((0, T._)`${n}.errors`, M.default.vErrors), s.unevaluated && ad(e), t.return((0, T._)`${M.default.errors} === 0`));
  4598. }
  4599. function ad({ gen: e, evaluated: t, props: r, items: n }) {
  4600. r instanceof T.Name && e.assign((0, T._)`${t}.props`, r), n instanceof T.Name && e.assign((0, T._)`${t}.items`, n);
  4601. }
  4602. function io(e, t, r, n) {
  4603. const { gen: i, schema: s, data: o, allErrors: a, opts: l, self: c } = e, { RULES: f } = c;
  4604. if (s.$ref && (l.ignoreKeywordsWithRef || !(0, Te.schemaHasRulesButRef)(s, f))) {
  4605. i.block(() => il(e, "$ref", f.all.$ref.definition));
  4606. return;
  4607. }
  4608. l.jtd || ld(e, t), i.block(() => {
  4609. for (const h of f.rules)
  4610. u(h);
  4611. u(f.post);
  4612. });
  4613. function u(h) {
  4614. (0, Ci.shouldUseGroup)(s, h) && (h.type ? (i.if((0, Er.checkDataType)(h.type, o, l.strictNumbers)), so(e, h), t.length === 1 && t[0] === h.type && r && (i.else(), (0, Er.reportTypeError)(e)), i.endIf()) : so(e, h), a || i.if((0, T._)`${M.default.errors} === ${n || 0}`));
  4615. }
  4616. }
  4617. function so(e, t) {
  4618. const { gen: r, schema: n, opts: { useDefaults: i } } = e;
  4619. i && (0, Kf.assignDefaults)(e, t.type), r.block(() => {
  4620. for (const s of t.rules)
  4621. (0, Ci.shouldUseRule)(n, s) && il(e, s.keyword, s.definition, t.type);
  4622. });
  4623. }
  4624. function ld(e, t) {
  4625. e.schemaEnv.meta || !e.opts.strictTypes || (cd(e, t), e.opts.allowUnionTypes || ud(e, t), fd(e, e.dataTypes));
  4626. }
  4627. function cd(e, t) {
  4628. if (t.length) {
  4629. if (!e.dataTypes.length) {
  4630. e.dataTypes = t;
  4631. return;
  4632. }
  4633. t.forEach((r) => {
  4634. rl(e.dataTypes, r) || Ii(e, `type "${r}" not allowed by context "${e.dataTypes.join(",")}"`);
  4635. }), pd(e, t);
  4636. }
  4637. }
  4638. function ud(e, t) {
  4639. t.length > 1 && !(t.length === 2 && t.includes("null")) && Ii(e, "use allowUnionTypes to allow union type keyword");
  4640. }
  4641. function fd(e, t) {
  4642. const r = e.self.RULES.all;
  4643. for (const n in r) {
  4644. const i = r[n];
  4645. if (typeof i == "object" && (0, Ci.shouldUseRule)(e.schema, i)) {
  4646. const { type: s } = i.definition;
  4647. s.length && !s.some((o) => dd(t, o)) && Ii(e, `missing type "${s.join(",")}" for keyword "${n}"`);
  4648. }
  4649. }
  4650. }
  4651. function dd(e, t) {
  4652. return e.includes(t) || t === "number" && e.includes("integer");
  4653. }
  4654. function rl(e, t) {
  4655. return e.includes(t) || t === "integer" && e.includes("number");
  4656. }
  4657. function pd(e, t) {
  4658. const r = [];
  4659. for (const n of e.dataTypes)
  4660. rl(t, n) ? r.push(n) : t.includes("integer") && n === "number" && r.push("integer");
  4661. e.dataTypes = r;
  4662. }
  4663. function Ii(e, t) {
  4664. const r = e.schemaEnv.baseId + e.errSchemaPath;
  4665. t += ` at "${r}" (strictTypes)`, (0, Te.checkStrictMode)(e, t, e.opts.strictTypes);
  4666. }
  4667. class nl {
  4668. constructor(t, r, n) {
  4669. if ((0, qt.validateKeywordUsage)(t, r, n), this.gen = t.gen, this.allErrors = t.allErrors, this.keyword = n, this.data = t.data, this.schema = t.schema[n], this.$data = r.$data && t.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, Te.schemaRefOrVal)(t, this.schema, n, this.$data), this.schemaType = r.schemaType, this.parentSchema = t.schema, this.params = {}, this.it = t, this.def = r, this.$data)
  4670. this.schemaCode = t.gen.const("vSchema", sl(this.$data, t));
  4671. else if (this.schemaCode = this.schemaValue, !(0, qt.validSchemaType)(this.schema, r.schemaType, r.allowUndefined))
  4672. throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);
  4673. ("code" in r ? r.trackErrors : r.errors !== !1) && (this.errsCount = t.gen.const("_errs", M.default.errors));
  4674. }
  4675. result(t, r, n) {
  4676. this.failResult((0, T.not)(t), r, n);
  4677. }
  4678. failResult(t, r, n) {
  4679. this.gen.if(t), n ? n() : this.error(), r ? (this.gen.else(), r(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else();
  4680. }
  4681. pass(t, r) {
  4682. this.failResult((0, T.not)(t), void 0, r);
  4683. }
  4684. fail(t) {
  4685. if (t === void 0) {
  4686. this.error(), this.allErrors || this.gen.if(!1);
  4687. return;
  4688. }
  4689. this.gen.if(t), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else();
  4690. }
  4691. fail$data(t) {
  4692. if (!this.$data)
  4693. return this.fail(t);
  4694. const { schemaCode: r } = this;
  4695. this.fail((0, T._)`${r} !== undefined && (${(0, T.or)(this.invalid$data(), t)})`);
  4696. }
  4697. error(t, r, n) {
  4698. if (r) {
  4699. this.setParams(r), this._error(t, n), this.setParams({});
  4700. return;
  4701. }
  4702. this._error(t, n);
  4703. }
  4704. _error(t, r) {
  4705. (t ? It.reportExtraError : It.reportError)(this, this.def.error, r);
  4706. }
  4707. $dataError() {
  4708. (0, It.reportError)(this, this.def.$dataError || It.keyword$DataError);
  4709. }
  4710. reset() {
  4711. if (this.errsCount === void 0)
  4712. throw new Error('add "trackErrors" to keyword definition');
  4713. (0, It.resetErrorsCount)(this.gen, this.errsCount);
  4714. }
  4715. ok(t) {
  4716. this.allErrors || this.gen.if(t);
  4717. }
  4718. setParams(t, r) {
  4719. r ? Object.assign(this.params, t) : this.params = t;
  4720. }
  4721. block$data(t, r, n = T.nil) {
  4722. this.gen.block(() => {
  4723. this.check$data(t, n), r();
  4724. });
  4725. }
  4726. check$data(t = T.nil, r = T.nil) {
  4727. if (!this.$data)
  4728. return;
  4729. const { gen: n, schemaCode: i, schemaType: s, def: o } = this;
  4730. n.if((0, T.or)((0, T._)`${i} === undefined`, r)), t !== T.nil && n.assign(t, !0), (s.length || o.validateSchema) && (n.elseIf(this.invalid$data()), this.$dataError(), t !== T.nil && n.assign(t, !1)), n.else();
  4731. }
  4732. invalid$data() {
  4733. const { gen: t, schemaCode: r, schemaType: n, def: i, it: s } = this;
  4734. return (0, T.or)(o(), a());
  4735. function o() {
  4736. if (n.length) {
  4737. if (!(r instanceof T.Name))
  4738. throw new Error("ajv implementation error");
  4739. const l = Array.isArray(n) ? n : [n];
  4740. return (0, T._)`${(0, Er.checkDataTypes)(l, r, s.opts.strictNumbers, Er.DataType.Wrong)}`;
  4741. }
  4742. return T.nil;
  4743. }
  4744. function a() {
  4745. if (i.validateSchema) {
  4746. const l = t.scopeValue("validate$data", { ref: i.validateSchema });
  4747. return (0, T._)`!${l}(${r})`;
  4748. }
  4749. return T.nil;
  4750. }
  4751. }
  4752. subschema(t, r) {
  4753. const n = (0, Rn.getSubschema)(this.it, t);
  4754. (0, Rn.extendSubschemaData)(n, this.it, t), (0, Rn.extendSubschemaMode)(n, t);
  4755. const i = { ...this.it, ...n, items: void 0, props: void 0 };
  4756. return ed(i, r), i;
  4757. }
  4758. mergeEvaluated(t, r) {
  4759. const { it: n, gen: i } = this;
  4760. n.opts.unevaluated && (n.props !== !0 && t.props !== void 0 && (n.props = Te.mergeEvaluated.props(i, t.props, n.props, r)), n.items !== !0 && t.items !== void 0 && (n.items = Te.mergeEvaluated.items(i, t.items, n.items, r)));
  4761. }
  4762. mergeValidEvaluated(t, r) {
  4763. const { it: n, gen: i } = this;
  4764. if (n.opts.unevaluated && (n.props !== !0 || n.items !== !0))
  4765. return i.if(r, () => this.mergeEvaluated(t, T.Name)), !0;
  4766. }
  4767. }
  4768. $e.KeywordCxt = nl;
  4769. function il(e, t, r, n) {
  4770. const i = new nl(e, r, t);
  4771. "code" in r ? r.code(i, n) : i.$data && r.validate ? (0, qt.funcKeywordCode)(i, r) : "macro" in r ? (0, qt.macroKeywordCode)(i, r) : (r.compile || r.validate) && (0, qt.funcKeywordCode)(i, r);
  4772. }
  4773. const hd = /^\/(?:[^~]|~0|~1)*$/, md = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
  4774. function sl(e, { dataLevel: t, dataNames: r, dataPathArr: n }) {
  4775. let i, s;
  4776. if (e === "")
  4777. return M.default.rootData;
  4778. if (e[0] === "/") {
  4779. if (!hd.test(e))
  4780. throw new Error(`Invalid JSON-pointer: ${e}`);
  4781. i = e, s = M.default.rootData;
  4782. } else {
  4783. const c = md.exec(e);
  4784. if (!c)
  4785. throw new Error(`Invalid JSON-pointer: ${e}`);
  4786. const f = +c[1];
  4787. if (i = c[2], i === "#") {
  4788. if (f >= t)
  4789. throw new Error(l("property/index", f));
  4790. return n[t - f];
  4791. }
  4792. if (f > t)
  4793. throw new Error(l("data", f));
  4794. if (s = r[t - f], !i)
  4795. return s;
  4796. }
  4797. let o = s;
  4798. const a = i.split("/");
  4799. for (const c of a)
  4800. c && (s = (0, T._)`${s}${(0, T.getProperty)((0, Te.unescapeJsonPointer)(c))}`, o = (0, T._)`${o} && ${s}`);
  4801. return o;
  4802. function l(c, f) {
  4803. return `Cannot access ${c} ${f} levels up, current level is ${t}`;
  4804. }
  4805. }
  4806. $e.getData = sl;
  4807. var Qt = {};
  4808. Object.defineProperty(Qt, "__esModule", { value: !0 });
  4809. class yd extends Error {
  4810. constructor(t) {
  4811. super("validation failed"), this.errors = t, this.ajv = this.validation = !0;
  4812. }
  4813. }
  4814. Qt.default = yd;
  4815. var wt = {};
  4816. Object.defineProperty(wt, "__esModule", { value: !0 });
  4817. const kn = Z;
  4818. class gd extends Error {
  4819. constructor(t, r, n, i) {
  4820. super(i || `can't resolve reference ${n} from id ${r}`), this.missingRef = (0, kn.resolveUrl)(t, r, n), this.missingSchema = (0, kn.normalizeId)((0, kn.getFullPath)(t, this.missingRef));
  4821. }
  4822. }
  4823. wt.default = gd;
  4824. var se = {};
  4825. Object.defineProperty(se, "__esModule", { value: !0 });
  4826. se.resolveSchema = se.getCompilingSchema = se.resolveRef = se.compileSchema = se.SchemaEnv = void 0;
  4827. const he = D, $d = Qt, We = ue, ge = Z, oo = I, _d = $e;
  4828. class Lr {
  4829. constructor(t) {
  4830. var r;
  4831. this.refs = {}, this.dynamicAnchors = {};
  4832. let n;
  4833. typeof t.schema == "object" && (n = t.schema), this.schema = t.schema, this.schemaId = t.schemaId, this.root = t.root || this, this.baseId = (r = t.baseId) !== null && r !== void 0 ? r : (0, ge.normalizeId)(n == null ? void 0 : n[t.schemaId || "$id"]), this.schemaPath = t.schemaPath, this.localRefs = t.localRefs, this.meta = t.meta, this.$async = n == null ? void 0 : n.$async, this.refs = {};
  4834. }
  4835. }
  4836. se.SchemaEnv = Lr;
  4837. function Ti(e) {
  4838. const t = ol.call(this, e);
  4839. if (t)
  4840. return t;
  4841. const r = (0, ge.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: n, lines: i } = this.opts.code, { ownProperties: s } = this.opts, o = new he.CodeGen(this.scope, { es5: n, lines: i, ownProperties: s });
  4842. let a;
  4843. e.$async && (a = o.scopeValue("Error", {
  4844. ref: $d.default,
  4845. code: (0, he._)`require("ajv/dist/runtime/validation_error").default`
  4846. }));
  4847. const l = o.scopeName("validate");
  4848. e.validateName = l;
  4849. const c = {
  4850. gen: o,
  4851. allErrors: this.opts.allErrors,
  4852. data: We.default.data,
  4853. parentData: We.default.parentData,
  4854. parentDataProperty: We.default.parentDataProperty,
  4855. dataNames: [We.default.data],
  4856. dataPathArr: [he.nil],
  4857. // TODO can its length be used as dataLevel if nil is removed?
  4858. dataLevel: 0,
  4859. dataTypes: [],
  4860. definedProperties: /* @__PURE__ */ new Set(),
  4861. topSchemaRef: o.scopeValue("schema", this.opts.code.source === !0 ? { ref: e.schema, code: (0, he.stringify)(e.schema) } : { ref: e.schema }),
  4862. validateName: l,
  4863. ValidationError: a,
  4864. schema: e.schema,
  4865. schemaEnv: e,
  4866. rootId: r,
  4867. baseId: e.baseId || r,
  4868. schemaPath: he.nil,
  4869. errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"),
  4870. errorPath: (0, he._)`""`,
  4871. opts: this.opts,
  4872. self: this
  4873. };
  4874. let f;
  4875. try {
  4876. this._compilations.add(e), (0, _d.validateFunctionCode)(c), o.optimize(this.opts.code.optimize);
  4877. const u = o.toString();
  4878. f = `${o.scopeRefs(We.default.scope)}return ${u}`, this.opts.code.process && (f = this.opts.code.process(f, e));
  4879. const y = new Function(`${We.default.self}`, `${We.default.scope}`, f)(this, this.scope.get());
  4880. if (this.scope.value(l, { ref: y }), y.errors = null, y.schema = e.schema, y.schemaEnv = e, e.$async && (y.$async = !0), this.opts.code.source === !0 && (y.source = { validateName: l, validateCode: u, scopeValues: o._values }), this.opts.unevaluated) {
  4881. const { props: _, items: b } = c;
  4882. y.evaluated = {
  4883. props: _ instanceof he.Name ? void 0 : _,
  4884. items: b instanceof he.Name ? void 0 : b,
  4885. dynamicProps: _ instanceof he.Name,
  4886. dynamicItems: b instanceof he.Name
  4887. }, y.source && (y.source.evaluated = (0, he.stringify)(y.evaluated));
  4888. }
  4889. return e.validate = y, e;
  4890. } catch (u) {
  4891. throw delete e.validate, delete e.validateName, f && this.logger.error("Error compiling schema, function code:", f), u;
  4892. } finally {
  4893. this._compilations.delete(e);
  4894. }
  4895. }
  4896. se.compileSchema = Ti;
  4897. function vd(e, t, r) {
  4898. var n;
  4899. r = (0, ge.resolveUrl)(this.opts.uriResolver, t, r);
  4900. const i = e.refs[r];
  4901. if (i)
  4902. return i;
  4903. let s = Pd.call(this, e, r);
  4904. if (s === void 0) {
  4905. const o = (n = e.localRefs) === null || n === void 0 ? void 0 : n[r], { schemaId: a } = this.opts;
  4906. o && (s = new Lr({ schema: o, schemaId: a, root: e, baseId: t }));
  4907. }
  4908. if (s !== void 0)
  4909. return e.refs[r] = bd.call(this, s);
  4910. }
  4911. se.resolveRef = vd;
  4912. function bd(e) {
  4913. return (0, ge.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : Ti.call(this, e);
  4914. }
  4915. function ol(e) {
  4916. for (const t of this._compilations)
  4917. if (wd(t, e))
  4918. return t;
  4919. }
  4920. se.getCompilingSchema = ol;
  4921. function wd(e, t) {
  4922. return e.schema === t.schema && e.root === t.root && e.baseId === t.baseId;
  4923. }
  4924. function Pd(e, t) {
  4925. let r;
  4926. for (; typeof (r = this.refs[t]) == "string"; )
  4927. t = r;
  4928. return r || this.schemas[t] || Hr.call(this, e, t);
  4929. }
  4930. function Hr(e, t) {
  4931. const r = this.opts.uriResolver.parse(t), n = (0, ge._getFullPath)(this.opts.uriResolver, r);
  4932. let i = (0, ge.getFullPath)(this.opts.uriResolver, e.baseId, void 0);
  4933. if (Object.keys(e.schema).length > 0 && n === i)
  4934. return Nn.call(this, r, e);
  4935. const s = (0, ge.normalizeId)(n), o = this.refs[s] || this.schemas[s];
  4936. if (typeof o == "string") {
  4937. const a = Hr.call(this, e, o);
  4938. return typeof (a == null ? void 0 : a.schema) != "object" ? void 0 : Nn.call(this, r, a);
  4939. }
  4940. if (typeof (o == null ? void 0 : o.schema) == "object") {
  4941. if (o.validate || Ti.call(this, o), s === (0, ge.normalizeId)(t)) {
  4942. const { schema: a } = o, { schemaId: l } = this.opts, c = a[l];
  4943. return c && (i = (0, ge.resolveUrl)(this.opts.uriResolver, i, c)), new Lr({ schema: a, schemaId: l, root: e, baseId: i });
  4944. }
  4945. return Nn.call(this, r, o);
  4946. }
  4947. }
  4948. se.resolveSchema = Hr;
  4949. const Od = /* @__PURE__ */ new Set([
  4950. "properties",
  4951. "patternProperties",
  4952. "enum",
  4953. "dependencies",
  4954. "definitions"
  4955. ]);
  4956. function Nn(e, { baseId: t, schema: r, root: n }) {
  4957. var i;
  4958. if (((i = e.fragment) === null || i === void 0 ? void 0 : i[0]) !== "/")
  4959. return;
  4960. for (const a of e.fragment.slice(1).split("/")) {
  4961. if (typeof r == "boolean")
  4962. return;
  4963. const l = r[(0, oo.unescapeFragment)(a)];
  4964. if (l === void 0)
  4965. return;
  4966. r = l;
  4967. const c = typeof r == "object" && r[this.opts.schemaId];
  4968. !Od.has(a) && c && (t = (0, ge.resolveUrl)(this.opts.uriResolver, t, c));
  4969. }
  4970. let s;
  4971. if (typeof r != "boolean" && r.$ref && !(0, oo.schemaHasRulesButRef)(r, this.RULES)) {
  4972. const a = (0, ge.resolveUrl)(this.opts.uriResolver, t, r.$ref);
  4973. s = Hr.call(this, n, a);
  4974. }
  4975. const { schemaId: o } = this.opts;
  4976. if (s = s || new Lr({ schema: r, schemaId: o, root: n, baseId: t }), s.schema !== s.root.schema)
  4977. return s;
  4978. }
  4979. const Ed = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", Sd = "Meta-schema for $data reference (JSON AnySchema extension proposal)", xd = "object", jd = [
  4980. "$data"
  4981. ], Ad = {
  4982. $data: {
  4983. type: "string",
  4984. anyOf: [
  4985. {
  4986. format: "relative-json-pointer"
  4987. },
  4988. {
  4989. format: "json-pointer"
  4990. }
  4991. ]
  4992. }
  4993. }, Cd = !1, Id = {
  4994. $id: Ed,
  4995. description: Sd,
  4996. type: xd,
  4997. required: jd,
  4998. properties: Ad,
  4999. additionalProperties: Cd
  5000. };
  5001. var Ri = {}, Ur = { exports: {} };
  5002. const Td = {
  5003. 0: 0,
  5004. 1: 1,
  5005. 2: 2,
  5006. 3: 3,
  5007. 4: 4,
  5008. 5: 5,
  5009. 6: 6,
  5010. 7: 7,
  5011. 8: 8,
  5012. 9: 9,
  5013. a: 10,
  5014. A: 10,
  5015. b: 11,
  5016. B: 11,
  5017. c: 12,
  5018. C: 12,
  5019. d: 13,
  5020. D: 13,
  5021. e: 14,
  5022. E: 14,
  5023. f: 15,
  5024. F: 15
  5025. };
  5026. var Rd = {
  5027. HEX: Td
  5028. };
  5029. const { HEX: kd } = Rd, Nd = /^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;
  5030. function al(e) {
  5031. if (cl(e, ".") < 3)
  5032. return { host: e, isIPV4: !1 };
  5033. const t = e.match(Nd) || [], [r] = t;
  5034. return r ? { host: Dd(r, "."), isIPV4: !0 } : { host: e, isIPV4: !1 };
  5035. }
  5036. function ao(e, t = !1) {
  5037. let r = "", n = !0;
  5038. for (const i of e) {
  5039. if (kd[i] === void 0) return;
  5040. i !== "0" && n === !0 && (n = !1), n || (r += i);
  5041. }
  5042. return t && r.length === 0 && (r = "0"), r;
  5043. }
  5044. function Md(e) {
  5045. let t = 0;
  5046. const r = { error: !1, address: "", zone: "" }, n = [], i = [];
  5047. let s = !1, o = !1, a = !1;
  5048. function l() {
  5049. if (i.length) {
  5050. if (s === !1) {
  5051. const c = ao(i);
  5052. if (c !== void 0)
  5053. n.push(c);
  5054. else
  5055. return r.error = !0, !1;
  5056. }
  5057. i.length = 0;
  5058. }
  5059. return !0;
  5060. }
  5061. for (let c = 0; c < e.length; c++) {
  5062. const f = e[c];
  5063. if (!(f === "[" || f === "]"))
  5064. if (f === ":") {
  5065. if (o === !0 && (a = !0), !l())
  5066. break;
  5067. if (t++, n.push(":"), t > 7) {
  5068. r.error = !0;
  5069. break;
  5070. }
  5071. c - 1 >= 0 && e[c - 1] === ":" && (o = !0);
  5072. continue;
  5073. } else if (f === "%") {
  5074. if (!l())
  5075. break;
  5076. s = !0;
  5077. } else {
  5078. i.push(f);
  5079. continue;
  5080. }
  5081. }
  5082. return i.length && (s ? r.zone = i.join("") : a ? n.push(i.join("")) : n.push(ao(i))), r.address = n.join(""), r;
  5083. }
  5084. function ll(e) {
  5085. if (cl(e, ":") < 2)
  5086. return { host: e, isIPV6: !1 };
  5087. const t = Md(e);
  5088. if (t.error)
  5089. return { host: e, isIPV6: !1 };
  5090. {
  5091. let r = t.address, n = t.address;
  5092. return t.zone && (r += "%" + t.zone, n += "%25" + t.zone), { host: r, escapedHost: n, isIPV6: !0 };
  5093. }
  5094. }
  5095. function Dd(e, t) {
  5096. let r = "", n = !0;
  5097. const i = e.length;
  5098. for (let s = 0; s < i; s++) {
  5099. const o = e[s];
  5100. o === "0" && n ? (s + 1 <= i && e[s + 1] === t || s + 1 === i) && (r += o, n = !1) : (o === t ? n = !0 : n = !1, r += o);
  5101. }
  5102. return r;
  5103. }
  5104. function cl(e, t) {
  5105. let r = 0;
  5106. for (let n = 0; n < e.length; n++)
  5107. e[n] === t && r++;
  5108. return r;
  5109. }
  5110. const lo = /^\.\.?\//u, co = /^\/\.(?:\/|$)/u, uo = /^\/\.\.(?:\/|$)/u, qd = /^\/?(?:.|\n)*?(?=\/|$)/u;
  5111. function Fd(e) {
  5112. const t = [];
  5113. for (; e.length; )
  5114. if (e.match(lo))
  5115. e = e.replace(lo, "");
  5116. else if (e.match(co))
  5117. e = e.replace(co, "/");
  5118. else if (e.match(uo))
  5119. e = e.replace(uo, "/"), t.pop();
  5120. else if (e === "." || e === "..")
  5121. e = "";
  5122. else {
  5123. const r = e.match(qd);
  5124. if (r) {
  5125. const n = r[0];
  5126. e = e.slice(n.length), t.push(n);
  5127. } else
  5128. throw new Error("Unexpected dot segment condition");
  5129. }
  5130. return t.join("");
  5131. }
  5132. function Vd(e, t) {
  5133. const r = t !== !0 ? escape : unescape;
  5134. return e.scheme !== void 0 && (e.scheme = r(e.scheme)), e.userinfo !== void 0 && (e.userinfo = r(e.userinfo)), e.host !== void 0 && (e.host = r(e.host)), e.path !== void 0 && (e.path = r(e.path)), e.query !== void 0 && (e.query = r(e.query)), e.fragment !== void 0 && (e.fragment = r(e.fragment)), e;
  5135. }
  5136. function Ld(e) {
  5137. const t = [];
  5138. if (e.userinfo !== void 0 && (t.push(e.userinfo), t.push("@")), e.host !== void 0) {
  5139. let r = unescape(e.host);
  5140. const n = al(r);
  5141. if (n.isIPV4)
  5142. r = n.host;
  5143. else {
  5144. const i = ll(n.host);
  5145. i.isIPV6 === !0 ? r = `[${i.escapedHost}]` : r = e.host;
  5146. }
  5147. t.push(r);
  5148. }
  5149. return (typeof e.port == "number" || typeof e.port == "string") && (t.push(":"), t.push(String(e.port))), t.length ? t.join("") : void 0;
  5150. }
  5151. var Hd = {
  5152. recomposeAuthority: Ld,
  5153. normalizeComponentEncoding: Vd,
  5154. removeDotSegments: Fd,
  5155. normalizeIPv4: al,
  5156. normalizeIPv6: ll
  5157. };
  5158. const Ud = /^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu, zd = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
  5159. function ul(e) {
  5160. return typeof e.secure == "boolean" ? e.secure : String(e.scheme).toLowerCase() === "wss";
  5161. }
  5162. function fl(e) {
  5163. return e.host || (e.error = e.error || "HTTP URIs must have a host."), e;
  5164. }
  5165. function dl(e) {
  5166. const t = String(e.scheme).toLowerCase() === "https";
  5167. return (e.port === (t ? 443 : 80) || e.port === "") && (e.port = void 0), e.path || (e.path = "/"), e;
  5168. }
  5169. function Gd(e) {
  5170. return e.secure = ul(e), e.resourceName = (e.path || "/") + (e.query ? "?" + e.query : ""), e.path = void 0, e.query = void 0, e;
  5171. }
  5172. function Bd(e) {
  5173. if ((e.port === (ul(e) ? 443 : 80) || e.port === "") && (e.port = void 0), typeof e.secure == "boolean" && (e.scheme = e.secure ? "wss" : "ws", e.secure = void 0), e.resourceName) {
  5174. const [t, r] = e.resourceName.split("?");
  5175. e.path = t && t !== "/" ? t : void 0, e.query = r, e.resourceName = void 0;
  5176. }
  5177. return e.fragment = void 0, e;
  5178. }
  5179. function Kd(e, t) {
  5180. if (!e.path)
  5181. return e.error = "URN can not be parsed", e;
  5182. const r = e.path.match(zd);
  5183. if (r) {
  5184. const n = t.scheme || e.scheme || "urn";
  5185. e.nid = r[1].toLowerCase(), e.nss = r[2];
  5186. const i = `${n}:${t.nid || e.nid}`, s = ki[i];
  5187. e.path = void 0, s && (e = s.parse(e, t));
  5188. } else
  5189. e.error = e.error || "URN can not be parsed.";
  5190. return e;
  5191. }
  5192. function Wd(e, t) {
  5193. const r = t.scheme || e.scheme || "urn", n = e.nid.toLowerCase(), i = `${r}:${t.nid || n}`, s = ki[i];
  5194. s && (e = s.serialize(e, t));
  5195. const o = e, a = e.nss;
  5196. return o.path = `${n || t.nid}:${a}`, t.skipEscape = !0, o;
  5197. }
  5198. function Jd(e, t) {
  5199. const r = e;
  5200. return r.uuid = r.nss, r.nss = void 0, !t.tolerant && (!r.uuid || !Ud.test(r.uuid)) && (r.error = r.error || "UUID is not valid."), r;
  5201. }
  5202. function Yd(e) {
  5203. const t = e;
  5204. return t.nss = (e.uuid || "").toLowerCase(), t;
  5205. }
  5206. const pl = {
  5207. scheme: "http",
  5208. domainHost: !0,
  5209. parse: fl,
  5210. serialize: dl
  5211. }, Xd = {
  5212. scheme: "https",
  5213. domainHost: pl.domainHost,
  5214. parse: fl,
  5215. serialize: dl
  5216. }, _r = {
  5217. scheme: "ws",
  5218. domainHost: !0,
  5219. parse: Gd,
  5220. serialize: Bd
  5221. }, Qd = {
  5222. scheme: "wss",
  5223. domainHost: _r.domainHost,
  5224. parse: _r.parse,
  5225. serialize: _r.serialize
  5226. }, Zd = {
  5227. scheme: "urn",
  5228. parse: Kd,
  5229. serialize: Wd,
  5230. skipNormalize: !0
  5231. }, ep = {
  5232. scheme: "urn:uuid",
  5233. parse: Jd,
  5234. serialize: Yd,
  5235. skipNormalize: !0
  5236. }, ki = {
  5237. http: pl,
  5238. https: Xd,
  5239. ws: _r,
  5240. wss: Qd,
  5241. urn: Zd,
  5242. "urn:uuid": ep
  5243. };
  5244. var tp = ki;
  5245. const { normalizeIPv6: rp, normalizeIPv4: np, removeDotSegments: kt, recomposeAuthority: ip, normalizeComponentEncoding: ar } = Hd, Ni = tp;
  5246. function sp(e, t) {
  5247. return typeof e == "string" ? e = Pe(Re(e, t), t) : typeof e == "object" && (e = Re(Pe(e, t), t)), e;
  5248. }
  5249. function op(e, t, r) {
  5250. const n = Object.assign({ scheme: "null" }, r), i = hl(Re(e, n), Re(t, n), n, !0);
  5251. return Pe(i, { ...n, skipEscape: !0 });
  5252. }
  5253. function hl(e, t, r, n) {
  5254. const i = {};
  5255. return n || (e = Re(Pe(e, r), r), t = Re(Pe(t, r), r)), r = r || {}, !r.tolerant && t.scheme ? (i.scheme = t.scheme, i.userinfo = t.userinfo, i.host = t.host, i.port = t.port, i.path = kt(t.path || ""), i.query = t.query) : (t.userinfo !== void 0 || t.host !== void 0 || t.port !== void 0 ? (i.userinfo = t.userinfo, i.host = t.host, i.port = t.port, i.path = kt(t.path || ""), i.query = t.query) : (t.path ? (t.path.charAt(0) === "/" ? i.path = kt(t.path) : ((e.userinfo !== void 0 || e.host !== void 0 || e.port !== void 0) && !e.path ? i.path = "/" + t.path : e.path ? i.path = e.path.slice(0, e.path.lastIndexOf("/") + 1) + t.path : i.path = t.path, i.path = kt(i.path)), i.query = t.query) : (i.path = e.path, t.query !== void 0 ? i.query = t.query : i.query = e.query), i.userinfo = e.userinfo, i.host = e.host, i.port = e.port), i.scheme = e.scheme), i.fragment = t.fragment, i;
  5256. }
  5257. function ap(e, t, r) {
  5258. return typeof e == "string" ? (e = unescape(e), e = Pe(ar(Re(e, r), !0), { ...r, skipEscape: !0 })) : typeof e == "object" && (e = Pe(ar(e, !0), { ...r, skipEscape: !0 })), typeof t == "string" ? (t = unescape(t), t = Pe(ar(Re(t, r), !0), { ...r, skipEscape: !0 })) : typeof t == "object" && (t = Pe(ar(t, !0), { ...r, skipEscape: !0 })), e.toLowerCase() === t.toLowerCase();
  5259. }
  5260. function Pe(e, t) {
  5261. const r = {
  5262. host: e.host,
  5263. scheme: e.scheme,
  5264. userinfo: e.userinfo,
  5265. port: e.port,
  5266. path: e.path,
  5267. query: e.query,
  5268. nid: e.nid,
  5269. nss: e.nss,
  5270. uuid: e.uuid,
  5271. fragment: e.fragment,
  5272. reference: e.reference,
  5273. resourceName: e.resourceName,
  5274. secure: e.secure,
  5275. error: ""
  5276. }, n = Object.assign({}, t), i = [], s = Ni[(n.scheme || r.scheme || "").toLowerCase()];
  5277. s && s.serialize && s.serialize(r, n), r.path !== void 0 && (n.skipEscape ? r.path = unescape(r.path) : (r.path = escape(r.path), r.scheme !== void 0 && (r.path = r.path.split("%3A").join(":")))), n.reference !== "suffix" && r.scheme && i.push(r.scheme, ":");
  5278. const o = ip(r);
  5279. if (o !== void 0 && (n.reference !== "suffix" && i.push("//"), i.push(o), r.path && r.path.charAt(0) !== "/" && i.push("/")), r.path !== void 0) {
  5280. let a = r.path;
  5281. !n.absolutePath && (!s || !s.absolutePath) && (a = kt(a)), o === void 0 && (a = a.replace(/^\/\//u, "/%2F")), i.push(a);
  5282. }
  5283. return r.query !== void 0 && i.push("?", r.query), r.fragment !== void 0 && i.push("#", r.fragment), i.join("");
  5284. }
  5285. const lp = Array.from({ length: 127 }, (e, t) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));
  5286. function cp(e) {
  5287. let t = 0;
  5288. for (let r = 0, n = e.length; r < n; ++r)
  5289. if (t = e.charCodeAt(r), t > 126 || lp[t])
  5290. return !0;
  5291. return !1;
  5292. }
  5293. const up = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
  5294. function Re(e, t) {
  5295. const r = Object.assign({}, t), n = {
  5296. scheme: void 0,
  5297. userinfo: void 0,
  5298. host: "",
  5299. port: void 0,
  5300. path: "",
  5301. query: void 0,
  5302. fragment: void 0
  5303. }, i = e.indexOf("%") !== -1;
  5304. let s = !1;
  5305. r.reference === "suffix" && (e = (r.scheme ? r.scheme + ":" : "") + "//" + e);
  5306. const o = e.match(up);
  5307. if (o) {
  5308. if (n.scheme = o[1], n.userinfo = o[3], n.host = o[4], n.port = parseInt(o[5], 10), n.path = o[6] || "", n.query = o[7], n.fragment = o[8], isNaN(n.port) && (n.port = o[5]), n.host) {
  5309. const l = np(n.host);
  5310. if (l.isIPV4 === !1) {
  5311. const c = rp(l.host);
  5312. n.host = c.host.toLowerCase(), s = c.isIPV6;
  5313. } else
  5314. n.host = l.host, s = !0;
  5315. }
  5316. n.scheme === void 0 && n.userinfo === void 0 && n.host === void 0 && n.port === void 0 && n.query === void 0 && !n.path ? n.reference = "same-document" : n.scheme === void 0 ? n.reference = "relative" : n.fragment === void 0 ? n.reference = "absolute" : n.reference = "uri", r.reference && r.reference !== "suffix" && r.reference !== n.reference && (n.error = n.error || "URI is not a " + r.reference + " reference.");
  5317. const a = Ni[(r.scheme || n.scheme || "").toLowerCase()];
  5318. if (!r.unicodeSupport && (!a || !a.unicodeSupport) && n.host && (r.domainHost || a && a.domainHost) && s === !1 && cp(n.host))
  5319. try {
  5320. n.host = URL.domainToASCII(n.host.toLowerCase());
  5321. } catch (l) {
  5322. n.error = n.error || "Host's domain name can not be converted to ASCII: " + l;
  5323. }
  5324. (!a || a && !a.skipNormalize) && (i && n.scheme !== void 0 && (n.scheme = unescape(n.scheme)), i && n.host !== void 0 && (n.host = unescape(n.host)), n.path && (n.path = escape(unescape(n.path))), n.fragment && (n.fragment = encodeURI(decodeURIComponent(n.fragment)))), a && a.parse && a.parse(n, r);
  5325. } else
  5326. n.error = n.error || "URI can not be parsed.";
  5327. return n;
  5328. }
  5329. const Mi = {
  5330. SCHEMES: Ni,
  5331. normalize: sp,
  5332. resolve: op,
  5333. resolveComponents: hl,
  5334. equal: ap,
  5335. serialize: Pe,
  5336. parse: Re
  5337. };
  5338. Ur.exports = Mi;
  5339. Ur.exports.default = Mi;
  5340. Ur.exports.fastUri = Mi;
  5341. var fp = Ur.exports;
  5342. Object.defineProperty(Ri, "__esModule", { value: !0 });
  5343. const ml = fp;
  5344. ml.code = 'require("ajv/dist/runtime/uri").default';
  5345. Ri.default = ml;
  5346. (function(e) {
  5347. Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
  5348. var t = $e;
  5349. Object.defineProperty(e, "KeywordCxt", { enumerable: !0, get: function() {
  5350. return t.KeywordCxt;
  5351. } });
  5352. var r = D;
  5353. Object.defineProperty(e, "_", { enumerable: !0, get: function() {
  5354. return r._;
  5355. } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
  5356. return r.str;
  5357. } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() {
  5358. return r.stringify;
  5359. } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() {
  5360. return r.nil;
  5361. } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
  5362. return r.Name;
  5363. } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
  5364. return r.CodeGen;
  5365. } });
  5366. const n = Qt, i = wt, s = rt, o = se, a = D, l = Z, c = Y, f = I, u = Id, h = Ri, y = (C, w) => new RegExp(C, w);
  5367. y.code = "new RegExp";
  5368. const _ = ["removeAdditional", "useDefaults", "coerceTypes"], b = /* @__PURE__ */ new Set([
  5369. "validate",
  5370. "serialize",
  5371. "parse",
  5372. "wrapper",
  5373. "root",
  5374. "schema",
  5375. "keyword",
  5376. "pattern",
  5377. "formats",
  5378. "validate$data",
  5379. "func",
  5380. "obj",
  5381. "Error"
  5382. ]), v = {
  5383. errorDataPath: "",
  5384. format: "`validateFormats: false` can be used instead.",
  5385. nullable: '"nullable" keyword is supported by default.',
  5386. jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
  5387. extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
  5388. missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
  5389. processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
  5390. sourceCode: "Use option `code: {source: true}`",
  5391. strictDefaults: "It is default now, see option `strict`.",
  5392. strictKeywords: "It is default now, see option `strict`.",
  5393. uniqueItems: '"uniqueItems" keyword is always validated.',
  5394. unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
  5395. cache: "Map is used as cache, schema object as key.",
  5396. serialize: "Map is used as cache, schema object as key.",
  5397. ajvErrors: "It is default now."
  5398. }, p = {
  5399. ignoreKeywordsWithRef: "",
  5400. jsPropertySyntax: "",
  5401. unicode: '"minLength"/"maxLength" account for unicode characters by default.'
  5402. }, m = 200;
  5403. function $(C) {
  5404. var w, x, P, d, g, O, R, N, z, L, X, ot, yn, gn, $n, _n, vn, bn, wn, Pn, On, En, Sn, xn, jn;
  5405. const Ct = C.strict, An = (w = C.code) === null || w === void 0 ? void 0 : w.optimize, Gs = An === !0 || An === void 0 ? 1 : An || 0, Bs = (P = (x = C.code) === null || x === void 0 ? void 0 : x.regExp) !== null && P !== void 0 ? P : y, Rc = (d = C.uriResolver) !== null && d !== void 0 ? d : h.default;
  5406. return {
  5407. strictSchema: (O = (g = C.strictSchema) !== null && g !== void 0 ? g : Ct) !== null && O !== void 0 ? O : !0,
  5408. strictNumbers: (N = (R = C.strictNumbers) !== null && R !== void 0 ? R : Ct) !== null && N !== void 0 ? N : !0,
  5409. strictTypes: (L = (z = C.strictTypes) !== null && z !== void 0 ? z : Ct) !== null && L !== void 0 ? L : "log",
  5410. strictTuples: (ot = (X = C.strictTuples) !== null && X !== void 0 ? X : Ct) !== null && ot !== void 0 ? ot : "log",
  5411. strictRequired: (gn = (yn = C.strictRequired) !== null && yn !== void 0 ? yn : Ct) !== null && gn !== void 0 ? gn : !1,
  5412. code: C.code ? { ...C.code, optimize: Gs, regExp: Bs } : { optimize: Gs, regExp: Bs },
  5413. loopRequired: ($n = C.loopRequired) !== null && $n !== void 0 ? $n : m,
  5414. loopEnum: (_n = C.loopEnum) !== null && _n !== void 0 ? _n : m,
  5415. meta: (vn = C.meta) !== null && vn !== void 0 ? vn : !0,
  5416. messages: (bn = C.messages) !== null && bn !== void 0 ? bn : !0,
  5417. inlineRefs: (wn = C.inlineRefs) !== null && wn !== void 0 ? wn : !0,
  5418. schemaId: (Pn = C.schemaId) !== null && Pn !== void 0 ? Pn : "$id",
  5419. addUsedSchema: (On = C.addUsedSchema) !== null && On !== void 0 ? On : !0,
  5420. validateSchema: (En = C.validateSchema) !== null && En !== void 0 ? En : !0,
  5421. validateFormats: (Sn = C.validateFormats) !== null && Sn !== void 0 ? Sn : !0,
  5422. unicodeRegExp: (xn = C.unicodeRegExp) !== null && xn !== void 0 ? xn : !0,
  5423. int32range: (jn = C.int32range) !== null && jn !== void 0 ? jn : !0,
  5424. uriResolver: Rc
  5425. };
  5426. }
  5427. class E {
  5428. constructor(w = {}) {
  5429. this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), w = this.opts = { ...w, ...$(w) };
  5430. const { es5: x, lines: P } = this.opts.code;
  5431. this.scope = new a.ValueScope({ scope: {}, prefixes: b, es5: x, lines: P }), this.logger = Ae(w.logger);
  5432. const d = w.validateFormats;
  5433. w.validateFormats = !1, this.RULES = (0, s.getRules)(), S.call(this, v, w, "NOT SUPPORTED"), S.call(this, p, w, "DEPRECATED", "warn"), this._metaOpts = ve.call(this), w.formats && fe.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), w.keywords && ce.call(this, w.keywords), typeof w.meta == "object" && this.addMetaSchema(w.meta), U.call(this), w.validateFormats = d;
  5434. }
  5435. _addVocabularies() {
  5436. this.addKeyword("$async");
  5437. }
  5438. _addDefaultMetaSchema() {
  5439. const { $data: w, meta: x, schemaId: P } = this.opts;
  5440. let d = u;
  5441. P === "id" && (d = { ...u }, d.id = d.$id, delete d.$id), x && w && this.addMetaSchema(d, d[P], !1);
  5442. }
  5443. defaultMeta() {
  5444. const { meta: w, schemaId: x } = this.opts;
  5445. return this.opts.defaultMeta = typeof w == "object" ? w[x] || w : void 0;
  5446. }
  5447. validate(w, x) {
  5448. let P;
  5449. if (typeof w == "string") {
  5450. if (P = this.getSchema(w), !P)
  5451. throw new Error(`no schema with key or ref "${w}"`);
  5452. } else
  5453. P = this.compile(w);
  5454. const d = P(x);
  5455. return "$async" in P || (this.errors = P.errors), d;
  5456. }
  5457. compile(w, x) {
  5458. const P = this._addSchema(w, x);
  5459. return P.validate || this._compileSchemaEnv(P);
  5460. }
  5461. compileAsync(w, x) {
  5462. if (typeof this.opts.loadSchema != "function")
  5463. throw new Error("options.loadSchema should be a function");
  5464. const { loadSchema: P } = this.opts;
  5465. return d.call(this, w, x);
  5466. async function d(L, X) {
  5467. await g.call(this, L.$schema);
  5468. const ot = this._addSchema(L, X);
  5469. return ot.validate || O.call(this, ot);
  5470. }
  5471. async function g(L) {
  5472. L && !this.getSchema(L) && await d.call(this, { $ref: L }, !0);
  5473. }
  5474. async function O(L) {
  5475. try {
  5476. return this._compileSchemaEnv(L);
  5477. } catch (X) {
  5478. if (!(X instanceof i.default))
  5479. throw X;
  5480. return R.call(this, X), await N.call(this, X.missingSchema), O.call(this, L);
  5481. }
  5482. }
  5483. function R({ missingSchema: L, missingRef: X }) {
  5484. if (this.refs[L])
  5485. throw new Error(`AnySchema ${L} is loaded but ${X} cannot be resolved`);
  5486. }
  5487. async function N(L) {
  5488. const X = await z.call(this, L);
  5489. this.refs[L] || await g.call(this, X.$schema), this.refs[L] || this.addSchema(X, L, x);
  5490. }
  5491. async function z(L) {
  5492. const X = this._loading[L];
  5493. if (X)
  5494. return X;
  5495. try {
  5496. return await (this._loading[L] = P(L));
  5497. } finally {
  5498. delete this._loading[L];
  5499. }
  5500. }
  5501. }
  5502. // Adds schema to the instance
  5503. addSchema(w, x, P, d = this.opts.validateSchema) {
  5504. if (Array.isArray(w)) {
  5505. for (const O of w)
  5506. this.addSchema(O, void 0, P, d);
  5507. return this;
  5508. }
  5509. let g;
  5510. if (typeof w == "object") {
  5511. const { schemaId: O } = this.opts;
  5512. if (g = w[O], g !== void 0 && typeof g != "string")
  5513. throw new Error(`schema ${O} must be string`);
  5514. }
  5515. return x = (0, l.normalizeId)(x || g), this._checkUnique(x), this.schemas[x] = this._addSchema(w, P, x, d, !0), this;
  5516. }
  5517. // Add schema that will be used to validate other schemas
  5518. // options in META_IGNORE_OPTIONS are alway set to false
  5519. addMetaSchema(w, x, P = this.opts.validateSchema) {
  5520. return this.addSchema(w, x, !0, P), this;
  5521. }
  5522. // Validate schema against its meta-schema
  5523. validateSchema(w, x) {
  5524. if (typeof w == "boolean")
  5525. return !0;
  5526. let P;
  5527. if (P = w.$schema, P !== void 0 && typeof P != "string")
  5528. throw new Error("$schema must be a string");
  5529. if (P = P || this.opts.defaultMeta || this.defaultMeta(), !P)
  5530. return this.logger.warn("meta-schema not available"), this.errors = null, !0;
  5531. const d = this.validate(P, w);
  5532. if (!d && x) {
  5533. const g = "schema is invalid: " + this.errorsText();
  5534. if (this.opts.validateSchema === "log")
  5535. this.logger.error(g);
  5536. else
  5537. throw new Error(g);
  5538. }
  5539. return d;
  5540. }
  5541. // Get compiled schema by `key` or `ref`.
  5542. // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
  5543. getSchema(w) {
  5544. let x;
  5545. for (; typeof (x = A.call(this, w)) == "string"; )
  5546. w = x;
  5547. if (x === void 0) {
  5548. const { schemaId: P } = this.opts, d = new o.SchemaEnv({ schema: {}, schemaId: P });
  5549. if (x = o.resolveSchema.call(this, d, w), !x)
  5550. return;
  5551. this.refs[w] = x;
  5552. }
  5553. return x.validate || this._compileSchemaEnv(x);
  5554. }
  5555. // Remove cached schema(s).
  5556. // If no parameter is passed all schemas but meta-schemas are removed.
  5557. // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
  5558. // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
  5559. removeSchema(w) {
  5560. if (w instanceof RegExp)
  5561. return this._removeAllSchemas(this.schemas, w), this._removeAllSchemas(this.refs, w), this;
  5562. switch (typeof w) {
  5563. case "undefined":
  5564. return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
  5565. case "string": {
  5566. const x = A.call(this, w);
  5567. return typeof x == "object" && this._cache.delete(x.schema), delete this.schemas[w], delete this.refs[w], this;
  5568. }
  5569. case "object": {
  5570. const x = w;
  5571. this._cache.delete(x);
  5572. let P = w[this.opts.schemaId];
  5573. return P && (P = (0, l.normalizeId)(P), delete this.schemas[P], delete this.refs[P]), this;
  5574. }
  5575. default:
  5576. throw new Error("ajv.removeSchema: invalid parameter");
  5577. }
  5578. }
  5579. // add "vocabulary" - a collection of keywords
  5580. addVocabulary(w) {
  5581. for (const x of w)
  5582. this.addKeyword(x);
  5583. return this;
  5584. }
  5585. addKeyword(w, x) {
  5586. let P;
  5587. if (typeof w == "string")
  5588. P = w, typeof x == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), x.keyword = P);
  5589. else if (typeof w == "object" && x === void 0) {
  5590. if (x = w, P = x.keyword, Array.isArray(P) && !P.length)
  5591. throw new Error("addKeywords: keyword must be string or non-empty array");
  5592. } else
  5593. throw new Error("invalid addKeywords parameters");
  5594. if (Me.call(this, P, x), !x)
  5595. return (0, f.eachItem)(P, (g) => At.call(this, g)), this;
  5596. hn.call(this, x);
  5597. const d = {
  5598. ...x,
  5599. type: (0, c.getJSONTypes)(x.type),
  5600. schemaType: (0, c.getJSONTypes)(x.schemaType)
  5601. };
  5602. return (0, f.eachItem)(P, d.type.length === 0 ? (g) => At.call(this, g, d) : (g) => d.type.forEach((O) => At.call(this, g, d, O))), this;
  5603. }
  5604. getKeyword(w) {
  5605. const x = this.RULES.all[w];
  5606. return typeof x == "object" ? x.definition : !!x;
  5607. }
  5608. // Remove keyword
  5609. removeKeyword(w) {
  5610. const { RULES: x } = this;
  5611. delete x.keywords[w], delete x.all[w];
  5612. for (const P of x.rules) {
  5613. const d = P.rules.findIndex((g) => g.keyword === w);
  5614. d >= 0 && P.rules.splice(d, 1);
  5615. }
  5616. return this;
  5617. }
  5618. // Add format
  5619. addFormat(w, x) {
  5620. return typeof x == "string" && (x = new RegExp(x)), this.formats[w] = x, this;
  5621. }
  5622. errorsText(w = this.errors, { separator: x = ", ", dataVar: P = "data" } = {}) {
  5623. return !w || w.length === 0 ? "No errors" : w.map((d) => `${P}${d.instancePath} ${d.message}`).reduce((d, g) => d + x + g);
  5624. }
  5625. $dataMetaSchema(w, x) {
  5626. const P = this.RULES.all;
  5627. w = JSON.parse(JSON.stringify(w));
  5628. for (const d of x) {
  5629. const g = d.split("/").slice(1);
  5630. let O = w;
  5631. for (const R of g)
  5632. O = O[R];
  5633. for (const R in P) {
  5634. const N = P[R];
  5635. if (typeof N != "object")
  5636. continue;
  5637. const { $data: z } = N.definition, L = O[R];
  5638. z && L && (O[R] = sr(L));
  5639. }
  5640. }
  5641. return w;
  5642. }
  5643. _removeAllSchemas(w, x) {
  5644. for (const P in w) {
  5645. const d = w[P];
  5646. (!x || x.test(P)) && (typeof d == "string" ? delete w[P] : d && !d.meta && (this._cache.delete(d.schema), delete w[P]));
  5647. }
  5648. }
  5649. _addSchema(w, x, P, d = this.opts.validateSchema, g = this.opts.addUsedSchema) {
  5650. let O;
  5651. const { schemaId: R } = this.opts;
  5652. if (typeof w == "object")
  5653. O = w[R];
  5654. else {
  5655. if (this.opts.jtd)
  5656. throw new Error("schema must be object");
  5657. if (typeof w != "boolean")
  5658. throw new Error("schema must be object or boolean");
  5659. }
  5660. let N = this._cache.get(w);
  5661. if (N !== void 0)
  5662. return N;
  5663. P = (0, l.normalizeId)(O || P);
  5664. const z = l.getSchemaRefs.call(this, w, P);
  5665. return N = new o.SchemaEnv({ schema: w, schemaId: R, meta: x, baseId: P, localRefs: z }), this._cache.set(N.schema, N), g && !P.startsWith("#") && (P && this._checkUnique(P), this.refs[P] = N), d && this.validateSchema(w, !0), N;
  5666. }
  5667. _checkUnique(w) {
  5668. if (this.schemas[w] || this.refs[w])
  5669. throw new Error(`schema with key or id "${w}" already exists`);
  5670. }
  5671. _compileSchemaEnv(w) {
  5672. if (w.meta ? this._compileMetaSchema(w) : o.compileSchema.call(this, w), !w.validate)
  5673. throw new Error("ajv implementation error");
  5674. return w.validate;
  5675. }
  5676. _compileMetaSchema(w) {
  5677. const x = this.opts;
  5678. this.opts = this._metaOpts;
  5679. try {
  5680. o.compileSchema.call(this, w);
  5681. } finally {
  5682. this.opts = x;
  5683. }
  5684. }
  5685. }
  5686. E.ValidationError = n.default, E.MissingRefError = i.default, e.default = E;
  5687. function S(C, w, x, P = "error") {
  5688. for (const d in C) {
  5689. const g = d;
  5690. g in w && this.logger[P](`${x}: option ${d}. ${C[g]}`);
  5691. }
  5692. }
  5693. function A(C) {
  5694. return C = (0, l.normalizeId)(C), this.schemas[C] || this.refs[C];
  5695. }
  5696. function U() {
  5697. const C = this.opts.schemas;
  5698. if (C)
  5699. if (Array.isArray(C))
  5700. this.addSchema(C);
  5701. else
  5702. for (const w in C)
  5703. this.addSchema(C[w], w);
  5704. }
  5705. function fe() {
  5706. for (const C in this.opts.formats) {
  5707. const w = this.opts.formats[C];
  5708. w && this.addFormat(C, w);
  5709. }
  5710. }
  5711. function ce(C) {
  5712. if (Array.isArray(C)) {
  5713. this.addVocabulary(C);
  5714. return;
  5715. }
  5716. this.logger.warn("keywords option as map is deprecated, pass array");
  5717. for (const w in C) {
  5718. const x = C[w];
  5719. x.keyword || (x.keyword = w), this.addKeyword(x);
  5720. }
  5721. }
  5722. function ve() {
  5723. const C = { ...this.opts };
  5724. for (const w of _)
  5725. delete C[w];
  5726. return C;
  5727. }
  5728. const jt = { log() {
  5729. }, warn() {
  5730. }, error() {
  5731. } };
  5732. function Ae(C) {
  5733. if (C === !1)
  5734. return jt;
  5735. if (C === void 0)
  5736. return console;
  5737. if (C.log && C.warn && C.error)
  5738. return C;
  5739. throw new Error("logger must implement log, warn and error methods");
  5740. }
  5741. const st = /^[a-z_$][a-z0-9_$:-]*$/i;
  5742. function Me(C, w) {
  5743. const { RULES: x } = this;
  5744. if ((0, f.eachItem)(C, (P) => {
  5745. if (x.keywords[P])
  5746. throw new Error(`Keyword ${P} is already defined`);
  5747. if (!st.test(P))
  5748. throw new Error(`Keyword ${P} has invalid name`);
  5749. }), !!w && w.$data && !("code" in w || "validate" in w))
  5750. throw new Error('$data keyword must have "code" or "validate" function');
  5751. }
  5752. function At(C, w, x) {
  5753. var P;
  5754. const d = w == null ? void 0 : w.post;
  5755. if (x && d)
  5756. throw new Error('keyword with "post" flag cannot have "type"');
  5757. const { RULES: g } = this;
  5758. let O = d ? g.post : g.rules.find(({ type: N }) => N === x);
  5759. if (O || (O = { type: x, rules: [] }, g.rules.push(O)), g.keywords[C] = !0, !w)
  5760. return;
  5761. const R = {
  5762. keyword: C,
  5763. definition: {
  5764. ...w,
  5765. type: (0, c.getJSONTypes)(w.type),
  5766. schemaType: (0, c.getJSONTypes)(w.schemaType)
  5767. }
  5768. };
  5769. w.before ? ir.call(this, O, R, w.before) : O.rules.push(R), g.all[C] = R, (P = w.implements) === null || P === void 0 || P.forEach((N) => this.addKeyword(N));
  5770. }
  5771. function ir(C, w, x) {
  5772. const P = C.rules.findIndex((d) => d.keyword === x);
  5773. P >= 0 ? C.rules.splice(P, 0, w) : (C.rules.push(w), this.logger.warn(`rule ${x} is not defined`));
  5774. }
  5775. function hn(C) {
  5776. let { metaSchema: w } = C;
  5777. w !== void 0 && (C.$data && this.opts.$data && (w = sr(w)), C.validateSchema = this.compile(w, !0));
  5778. }
  5779. const mn = {
  5780. $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
  5781. };
  5782. function sr(C) {
  5783. return { anyOf: [C, mn] };
  5784. }
  5785. })(mt);
  5786. var Di = {}, qi = {}, Ee = {};
  5787. Object.defineProperty(Ee, "__esModule", { value: !0 });
  5788. Ee.callRef = Ee.getValidate = void 0;
  5789. const dp = wt, fo = F, ae = D, lt = ue, po = se, lr = I, pp = {
  5790. keyword: "$ref",
  5791. schemaType: "string",
  5792. code(e) {
  5793. const { gen: t, schema: r, it: n } = e, { baseId: i, schemaEnv: s, validateName: o, opts: a, self: l } = n, { root: c } = s;
  5794. if ((r === "#" || r === "#/") && i === c.baseId)
  5795. return u();
  5796. const f = po.resolveRef.call(l, c, i, r);
  5797. if (f === void 0)
  5798. throw new dp.default(n.opts.uriResolver, i, r);
  5799. if (f instanceof po.SchemaEnv)
  5800. return h(f);
  5801. return y(f);
  5802. function u() {
  5803. if (s === c)
  5804. return vr(e, o, s, s.$async);
  5805. const _ = t.scopeValue("root", { ref: c });
  5806. return vr(e, (0, ae._)`${_}.validate`, c, c.$async);
  5807. }
  5808. function h(_) {
  5809. const b = yl(e, _);
  5810. vr(e, b, _, _.$async);
  5811. }
  5812. function y(_) {
  5813. const b = t.scopeValue("schema", a.code.source === !0 ? { ref: _, code: (0, ae.stringify)(_) } : { ref: _ }), v = t.name("valid"), p = e.subschema({
  5814. schema: _,
  5815. dataTypes: [],
  5816. schemaPath: ae.nil,
  5817. topSchemaRef: b,
  5818. errSchemaPath: r
  5819. }, v);
  5820. e.mergeEvaluated(p), e.ok(v);
  5821. }
  5822. }
  5823. };
  5824. function yl(e, t) {
  5825. const { gen: r } = e;
  5826. return t.validate ? r.scopeValue("validate", { ref: t.validate }) : (0, ae._)`${r.scopeValue("wrapper", { ref: t })}.validate`;
  5827. }
  5828. Ee.getValidate = yl;
  5829. function vr(e, t, r, n) {
  5830. const { gen: i, it: s } = e, { allErrors: o, schemaEnv: a, opts: l } = s, c = l.passContext ? lt.default.this : ae.nil;
  5831. n ? f() : u();
  5832. function f() {
  5833. if (!a.$async)
  5834. throw new Error("async schema referenced by sync schema");
  5835. const _ = i.let("valid");
  5836. i.try(() => {
  5837. i.code((0, ae._)`await ${(0, fo.callValidateCode)(e, t, c)}`), y(t), o || i.assign(_, !0);
  5838. }, (b) => {
  5839. i.if((0, ae._)`!(${b} instanceof ${s.ValidationError})`, () => i.throw(b)), h(b), o || i.assign(_, !1);
  5840. }), e.ok(_);
  5841. }
  5842. function u() {
  5843. e.result((0, fo.callValidateCode)(e, t, c), () => y(t), () => h(t));
  5844. }
  5845. function h(_) {
  5846. const b = (0, ae._)`${_}.errors`;
  5847. i.assign(lt.default.vErrors, (0, ae._)`${lt.default.vErrors} === null ? ${b} : ${lt.default.vErrors}.concat(${b})`), i.assign(lt.default.errors, (0, ae._)`${lt.default.vErrors}.length`);
  5848. }
  5849. function y(_) {
  5850. var b;
  5851. if (!s.opts.unevaluated)
  5852. return;
  5853. const v = (b = r == null ? void 0 : r.validate) === null || b === void 0 ? void 0 : b.evaluated;
  5854. if (s.props !== !0)
  5855. if (v && !v.dynamicProps)
  5856. v.props !== void 0 && (s.props = lr.mergeEvaluated.props(i, v.props, s.props));
  5857. else {
  5858. const p = i.var("props", (0, ae._)`${_}.evaluated.props`);
  5859. s.props = lr.mergeEvaluated.props(i, p, s.props, ae.Name);
  5860. }
  5861. if (s.items !== !0)
  5862. if (v && !v.dynamicItems)
  5863. v.items !== void 0 && (s.items = lr.mergeEvaluated.items(i, v.items, s.items));
  5864. else {
  5865. const p = i.var("items", (0, ae._)`${_}.evaluated.items`);
  5866. s.items = lr.mergeEvaluated.items(i, p, s.items, ae.Name);
  5867. }
  5868. }
  5869. }
  5870. Ee.callRef = vr;
  5871. Ee.default = pp;
  5872. Object.defineProperty(qi, "__esModule", { value: !0 });
  5873. const hp = Ee, mp = [
  5874. "$schema",
  5875. "id",
  5876. "$defs",
  5877. { keyword: "$comment" },
  5878. "definitions",
  5879. hp.default
  5880. ];
  5881. qi.default = mp;
  5882. var Fi = {}, Vi = {};
  5883. Object.defineProperty(Vi, "__esModule", { value: !0 });
  5884. const Zn = mt, yp = D, qe = yp.operators, ei = {
  5885. maximum: {
  5886. exclusive: "exclusiveMaximum",
  5887. ops: [
  5888. { okStr: "<=", ok: qe.LTE, fail: qe.GT },
  5889. { okStr: "<", ok: qe.LT, fail: qe.GTE }
  5890. ]
  5891. },
  5892. minimum: {
  5893. exclusive: "exclusiveMinimum",
  5894. ops: [
  5895. { okStr: ">=", ok: qe.GTE, fail: qe.LT },
  5896. { okStr: ">", ok: qe.GT, fail: qe.LTE }
  5897. ]
  5898. }
  5899. }, gp = {
  5900. message: (e) => Zn.str`must be ${ti(e).okStr} ${e.schemaCode}`,
  5901. params: (e) => Zn._`{comparison: ${ti(e).okStr}, limit: ${e.schemaCode}}`
  5902. }, $p = {
  5903. keyword: Object.keys(ei),
  5904. type: "number",
  5905. schemaType: "number",
  5906. $data: !0,
  5907. error: gp,
  5908. code(e) {
  5909. const { data: t, schemaCode: r } = e;
  5910. e.fail$data(Zn._`${t} ${ti(e).fail} ${r} || isNaN(${t})`);
  5911. }
  5912. };
  5913. function ti(e) {
  5914. var t;
  5915. const r = e.keyword, n = !((t = e.parentSchema) === null || t === void 0) && t[ei[r].exclusive] ? 1 : 0;
  5916. return ei[r].ops[n];
  5917. }
  5918. Vi.default = $p;
  5919. var Li = {};
  5920. Object.defineProperty(Li, "__esModule", { value: !0 });
  5921. const ho = {
  5922. exclusiveMaximum: "maximum",
  5923. exclusiveMinimum: "minimum"
  5924. }, _p = {
  5925. keyword: Object.keys(ho),
  5926. type: "number",
  5927. schemaType: "boolean",
  5928. code({ keyword: e, parentSchema: t }) {
  5929. const r = ho[e];
  5930. if (t[r] === void 0)
  5931. throw new Error(`${e} can only be used with ${r}`);
  5932. }
  5933. };
  5934. Li.default = _p;
  5935. var zr = {};
  5936. Object.defineProperty(zr, "__esModule", { value: !0 });
  5937. const Ft = D, vp = {
  5938. message: ({ schemaCode: e }) => (0, Ft.str)`must be multiple of ${e}`,
  5939. params: ({ schemaCode: e }) => (0, Ft._)`{multipleOf: ${e}}`
  5940. }, bp = {
  5941. keyword: "multipleOf",
  5942. type: "number",
  5943. schemaType: "number",
  5944. $data: !0,
  5945. error: vp,
  5946. code(e) {
  5947. const { gen: t, data: r, schemaCode: n, it: i } = e, s = i.opts.multipleOfPrecision, o = t.let("res"), a = s ? (0, Ft._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}` : (0, Ft._)`${o} !== parseInt(${o})`;
  5948. e.fail$data((0, Ft._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`);
  5949. }
  5950. };
  5951. zr.default = bp;
  5952. var Gr = {}, Hi = {};
  5953. Object.defineProperty(Hi, "__esModule", { value: !0 });
  5954. function gl(e) {
  5955. const t = e.length;
  5956. let r = 0, n = 0, i;
  5957. for (; n < t; )
  5958. r++, i = e.charCodeAt(n++), i >= 55296 && i <= 56319 && n < t && (i = e.charCodeAt(n), (i & 64512) === 56320 && n++);
  5959. return r;
  5960. }
  5961. Hi.default = gl;
  5962. gl.code = 'require("ajv/dist/runtime/ucs2length").default';
  5963. Object.defineProperty(Gr, "__esModule", { value: !0 });
  5964. const Ye = D, wp = I, Pp = Hi, Op = {
  5965. message({ keyword: e, schemaCode: t }) {
  5966. const r = e === "maxLength" ? "more" : "fewer";
  5967. return (0, Ye.str)`must NOT have ${r} than ${t} characters`;
  5968. },
  5969. params: ({ schemaCode: e }) => (0, Ye._)`{limit: ${e}}`
  5970. }, Ep = {
  5971. keyword: ["maxLength", "minLength"],
  5972. type: "string",
  5973. schemaType: "number",
  5974. $data: !0,
  5975. error: Op,
  5976. code(e) {
  5977. const { keyword: t, data: r, schemaCode: n, it: i } = e, s = t === "maxLength" ? Ye.operators.GT : Ye.operators.LT, o = i.opts.unicode === !1 ? (0, Ye._)`${r}.length` : (0, Ye._)`${(0, wp.useFunc)(e.gen, Pp.default)}(${r})`;
  5978. e.fail$data((0, Ye._)`${o} ${s} ${n}`);
  5979. }
  5980. };
  5981. Gr.default = Ep;
  5982. var Br = {};
  5983. Object.defineProperty(Br, "__esModule", { value: !0 });
  5984. const Sp = F, Sr = D, xp = {
  5985. message: ({ schemaCode: e }) => (0, Sr.str)`must match pattern "${e}"`,
  5986. params: ({ schemaCode: e }) => (0, Sr._)`{pattern: ${e}}`
  5987. }, jp = {
  5988. keyword: "pattern",
  5989. type: "string",
  5990. schemaType: "string",
  5991. $data: !0,
  5992. error: xp,
  5993. code(e) {
  5994. const { data: t, $data: r, schema: n, schemaCode: i, it: s } = e, o = s.opts.unicodeRegExp ? "u" : "", a = r ? (0, Sr._)`(new RegExp(${i}, ${o}))` : (0, Sp.usePattern)(e, n);
  5995. e.fail$data((0, Sr._)`!${a}.test(${t})`);
  5996. }
  5997. };
  5998. Br.default = jp;
  5999. var Kr = {};
  6000. Object.defineProperty(Kr, "__esModule", { value: !0 });
  6001. const Vt = D, Ap = {
  6002. message({ keyword: e, schemaCode: t }) {
  6003. const r = e === "maxProperties" ? "more" : "fewer";
  6004. return (0, Vt.str)`must NOT have ${r} than ${t} properties`;
  6005. },
  6006. params: ({ schemaCode: e }) => (0, Vt._)`{limit: ${e}}`
  6007. }, Cp = {
  6008. keyword: ["maxProperties", "minProperties"],
  6009. type: "object",
  6010. schemaType: "number",
  6011. $data: !0,
  6012. error: Ap,
  6013. code(e) {
  6014. const { keyword: t, data: r, schemaCode: n } = e, i = t === "maxProperties" ? Vt.operators.GT : Vt.operators.LT;
  6015. e.fail$data((0, Vt._)`Object.keys(${r}).length ${i} ${n}`);
  6016. }
  6017. };
  6018. Kr.default = Cp;
  6019. var Wr = {};
  6020. Object.defineProperty(Wr, "__esModule", { value: !0 });
  6021. const Tt = F, Lt = D, Ip = I, Tp = {
  6022. message: ({ params: { missingProperty: e } }) => (0, Lt.str)`must have required property '${e}'`,
  6023. params: ({ params: { missingProperty: e } }) => (0, Lt._)`{missingProperty: ${e}}`
  6024. }, Rp = {
  6025. keyword: "required",
  6026. type: "object",
  6027. schemaType: "array",
  6028. $data: !0,
  6029. error: Tp,
  6030. code(e) {
  6031. const { gen: t, schema: r, schemaCode: n, data: i, $data: s, it: o } = e, { opts: a } = o;
  6032. if (!s && r.length === 0)
  6033. return;
  6034. const l = r.length >= a.loopRequired;
  6035. if (o.allErrors ? c() : f(), a.strictRequired) {
  6036. const y = e.parentSchema.properties, { definedProperties: _ } = e.it;
  6037. for (const b of r)
  6038. if ((y == null ? void 0 : y[b]) === void 0 && !_.has(b)) {
  6039. const v = o.schemaEnv.baseId + o.errSchemaPath, p = `required property "${b}" is not defined at "${v}" (strictRequired)`;
  6040. (0, Ip.checkStrictMode)(o, p, o.opts.strictRequired);
  6041. }
  6042. }
  6043. function c() {
  6044. if (l || s)
  6045. e.block$data(Lt.nil, u);
  6046. else
  6047. for (const y of r)
  6048. (0, Tt.checkReportMissingProp)(e, y);
  6049. }
  6050. function f() {
  6051. const y = t.let("missing");
  6052. if (l || s) {
  6053. const _ = t.let("valid", !0);
  6054. e.block$data(_, () => h(y, _)), e.ok(_);
  6055. } else
  6056. t.if((0, Tt.checkMissingProp)(e, r, y)), (0, Tt.reportMissingProp)(e, y), t.else();
  6057. }
  6058. function u() {
  6059. t.forOf("prop", n, (y) => {
  6060. e.setParams({ missingProperty: y }), t.if((0, Tt.noPropertyInData)(t, i, y, a.ownProperties), () => e.error());
  6061. });
  6062. }
  6063. function h(y, _) {
  6064. e.setParams({ missingProperty: y }), t.forOf(y, n, () => {
  6065. t.assign(_, (0, Tt.propertyInData)(t, i, y, a.ownProperties)), t.if((0, Lt.not)(_), () => {
  6066. e.error(), t.break();
  6067. });
  6068. }, Lt.nil);
  6069. }
  6070. }
  6071. };
  6072. Wr.default = Rp;
  6073. var Jr = {};
  6074. Object.defineProperty(Jr, "__esModule", { value: !0 });
  6075. const Ht = D, kp = {
  6076. message({ keyword: e, schemaCode: t }) {
  6077. const r = e === "maxItems" ? "more" : "fewer";
  6078. return (0, Ht.str)`must NOT have ${r} than ${t} items`;
  6079. },
  6080. params: ({ schemaCode: e }) => (0, Ht._)`{limit: ${e}}`
  6081. }, Np = {
  6082. keyword: ["maxItems", "minItems"],
  6083. type: "array",
  6084. schemaType: "number",
  6085. $data: !0,
  6086. error: kp,
  6087. code(e) {
  6088. const { keyword: t, data: r, schemaCode: n } = e, i = t === "maxItems" ? Ht.operators.GT : Ht.operators.LT;
  6089. e.fail$data((0, Ht._)`${r}.length ${i} ${n}`);
  6090. }
  6091. };
  6092. Jr.default = Np;
  6093. var Yr = {}, Zt = {};
  6094. Object.defineProperty(Zt, "__esModule", { value: !0 });
  6095. const $l = za;
  6096. $l.code = 'require("ajv/dist/runtime/equal").default';
  6097. Zt.default = $l;
  6098. Object.defineProperty(Yr, "__esModule", { value: !0 });
  6099. const Mn = Y, Q = D, Mp = I, Dp = Zt, qp = {
  6100. message: ({ params: { i: e, j: t } }) => (0, Q.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,
  6101. params: ({ params: { i: e, j: t } }) => (0, Q._)`{i: ${e}, j: ${t}}`
  6102. }, Fp = {
  6103. keyword: "uniqueItems",
  6104. type: "array",
  6105. schemaType: "boolean",
  6106. $data: !0,
  6107. error: qp,
  6108. code(e) {
  6109. const { gen: t, data: r, $data: n, schema: i, parentSchema: s, schemaCode: o, it: a } = e;
  6110. if (!n && !i)
  6111. return;
  6112. const l = t.let("valid"), c = s.items ? (0, Mn.getSchemaTypes)(s.items) : [];
  6113. e.block$data(l, f, (0, Q._)`${o} === false`), e.ok(l);
  6114. function f() {
  6115. const _ = t.let("i", (0, Q._)`${r}.length`), b = t.let("j");
  6116. e.setParams({ i: _, j: b }), t.assign(l, !0), t.if((0, Q._)`${_} > 1`, () => (u() ? h : y)(_, b));
  6117. }
  6118. function u() {
  6119. return c.length > 0 && !c.some((_) => _ === "object" || _ === "array");
  6120. }
  6121. function h(_, b) {
  6122. const v = t.name("item"), p = (0, Mn.checkDataTypes)(c, v, a.opts.strictNumbers, Mn.DataType.Wrong), m = t.const("indices", (0, Q._)`{}`);
  6123. t.for((0, Q._)`;${_}--;`, () => {
  6124. t.let(v, (0, Q._)`${r}[${_}]`), t.if(p, (0, Q._)`continue`), c.length > 1 && t.if((0, Q._)`typeof ${v} == "string"`, (0, Q._)`${v} += "_"`), t.if((0, Q._)`typeof ${m}[${v}] == "number"`, () => {
  6125. t.assign(b, (0, Q._)`${m}[${v}]`), e.error(), t.assign(l, !1).break();
  6126. }).code((0, Q._)`${m}[${v}] = ${_}`);
  6127. });
  6128. }
  6129. function y(_, b) {
  6130. const v = (0, Mp.useFunc)(t, Dp.default), p = t.name("outer");
  6131. t.label(p).for((0, Q._)`;${_}--;`, () => t.for((0, Q._)`${b} = ${_}; ${b}--;`, () => t.if((0, Q._)`${v}(${r}[${_}], ${r}[${b}])`, () => {
  6132. e.error(), t.assign(l, !1).break(p);
  6133. })));
  6134. }
  6135. }
  6136. };
  6137. Yr.default = Fp;
  6138. var Xr = {};
  6139. Object.defineProperty(Xr, "__esModule", { value: !0 });
  6140. const ri = D, Vp = I, Lp = Zt, Hp = {
  6141. message: "must be equal to constant",
  6142. params: ({ schemaCode: e }) => (0, ri._)`{allowedValue: ${e}}`
  6143. }, Up = {
  6144. keyword: "const",
  6145. $data: !0,
  6146. error: Hp,
  6147. code(e) {
  6148. const { gen: t, data: r, $data: n, schemaCode: i, schema: s } = e;
  6149. n || s && typeof s == "object" ? e.fail$data((0, ri._)`!${(0, Vp.useFunc)(t, Lp.default)}(${r}, ${i})`) : e.fail((0, ri._)`${s} !== ${r}`);
  6150. }
  6151. };
  6152. Xr.default = Up;
  6153. var Qr = {};
  6154. Object.defineProperty(Qr, "__esModule", { value: !0 });
  6155. const Nt = D, zp = I, Gp = Zt, Bp = {
  6156. message: "must be equal to one of the allowed values",
  6157. params: ({ schemaCode: e }) => (0, Nt._)`{allowedValues: ${e}}`
  6158. }, Kp = {
  6159. keyword: "enum",
  6160. schemaType: "array",
  6161. $data: !0,
  6162. error: Bp,
  6163. code(e) {
  6164. const { gen: t, data: r, $data: n, schema: i, schemaCode: s, it: o } = e;
  6165. if (!n && i.length === 0)
  6166. throw new Error("enum must have non-empty array");
  6167. const a = i.length >= o.opts.loopEnum;
  6168. let l;
  6169. const c = () => l ?? (l = (0, zp.useFunc)(t, Gp.default));
  6170. let f;
  6171. if (a || n)
  6172. f = t.let("valid"), e.block$data(f, u);
  6173. else {
  6174. if (!Array.isArray(i))
  6175. throw new Error("ajv implementation error");
  6176. const y = t.const("vSchema", s);
  6177. f = (0, Nt.or)(...i.map((_, b) => h(y, b)));
  6178. }
  6179. e.pass(f);
  6180. function u() {
  6181. t.assign(f, !1), t.forOf("v", s, (y) => t.if((0, Nt._)`${c()}(${r}, ${y})`, () => t.assign(f, !0).break()));
  6182. }
  6183. function h(y, _) {
  6184. const b = i[_];
  6185. return typeof b == "object" && b !== null ? (0, Nt._)`${c()}(${r}, ${y}[${_}])` : (0, Nt._)`${r} === ${b}`;
  6186. }
  6187. }
  6188. };
  6189. Qr.default = Kp;
  6190. Object.defineProperty(Fi, "__esModule", { value: !0 });
  6191. const Wp = Vi, Jp = Li, Yp = zr, Xp = Gr, Qp = Br, Zp = Kr, eh = Wr, th = Jr, rh = Yr, nh = Xr, ih = Qr, sh = [
  6192. // number
  6193. Wp.default,
  6194. Jp.default,
  6195. Yp.default,
  6196. // string
  6197. Xp.default,
  6198. Qp.default,
  6199. // object
  6200. Zp.default,
  6201. eh.default,
  6202. // array
  6203. th.default,
  6204. rh.default,
  6205. // any
  6206. { keyword: "type", schemaType: ["string", "array"] },
  6207. { keyword: "nullable", schemaType: "boolean" },
  6208. nh.default,
  6209. ih.default
  6210. ];
  6211. Fi.default = sh;
  6212. var Zr = {}, Pt = {};
  6213. Object.defineProperty(Pt, "__esModule", { value: !0 });
  6214. Pt.validateAdditionalItems = void 0;
  6215. const Xe = D, ni = I, oh = {
  6216. message: ({ params: { len: e } }) => (0, Xe.str)`must NOT have more than ${e} items`,
  6217. params: ({ params: { len: e } }) => (0, Xe._)`{limit: ${e}}`
  6218. }, ah = {
  6219. keyword: "additionalItems",
  6220. type: "array",
  6221. schemaType: ["boolean", "object"],
  6222. before: "uniqueItems",
  6223. error: oh,
  6224. code(e) {
  6225. const { parentSchema: t, it: r } = e, { items: n } = t;
  6226. if (!Array.isArray(n)) {
  6227. (0, ni.checkStrictMode)(r, '"additionalItems" is ignored when "items" is not an array of schemas');
  6228. return;
  6229. }
  6230. _l(e, n);
  6231. }
  6232. };
  6233. function _l(e, t) {
  6234. const { gen: r, schema: n, data: i, keyword: s, it: o } = e;
  6235. o.items = !0;
  6236. const a = r.const("len", (0, Xe._)`${i}.length`);
  6237. if (n === !1)
  6238. e.setParams({ len: t.length }), e.pass((0, Xe._)`${a} <= ${t.length}`);
  6239. else if (typeof n == "object" && !(0, ni.alwaysValidSchema)(o, n)) {
  6240. const c = r.var("valid", (0, Xe._)`${a} <= ${t.length}`);
  6241. r.if((0, Xe.not)(c), () => l(c)), e.ok(c);
  6242. }
  6243. function l(c) {
  6244. r.forRange("i", t.length, a, (f) => {
  6245. e.subschema({ keyword: s, dataProp: f, dataPropType: ni.Type.Num }, c), o.allErrors || r.if((0, Xe.not)(c), () => r.break());
  6246. });
  6247. }
  6248. }
  6249. Pt.validateAdditionalItems = _l;
  6250. Pt.default = ah;
  6251. var Ui = {}, Ot = {};
  6252. Object.defineProperty(Ot, "__esModule", { value: !0 });
  6253. Ot.validateTuple = void 0;
  6254. const mo = D, br = I, lh = F, ch = {
  6255. keyword: "items",
  6256. type: "array",
  6257. schemaType: ["object", "array", "boolean"],
  6258. before: "uniqueItems",
  6259. code(e) {
  6260. const { schema: t, it: r } = e;
  6261. if (Array.isArray(t))
  6262. return vl(e, "additionalItems", t);
  6263. r.items = !0, !(0, br.alwaysValidSchema)(r, t) && e.ok((0, lh.validateArray)(e));
  6264. }
  6265. };
  6266. function vl(e, t, r = e.schema) {
  6267. const { gen: n, parentSchema: i, data: s, keyword: o, it: a } = e;
  6268. f(i), a.opts.unevaluated && r.length && a.items !== !0 && (a.items = br.mergeEvaluated.items(n, r.length, a.items));
  6269. const l = n.name("valid"), c = n.const("len", (0, mo._)`${s}.length`);
  6270. r.forEach((u, h) => {
  6271. (0, br.alwaysValidSchema)(a, u) || (n.if((0, mo._)`${c} > ${h}`, () => e.subschema({
  6272. keyword: o,
  6273. schemaProp: h,
  6274. dataProp: h
  6275. }, l)), e.ok(l));
  6276. });
  6277. function f(u) {
  6278. const { opts: h, errSchemaPath: y } = a, _ = r.length, b = _ === u.minItems && (_ === u.maxItems || u[t] === !1);
  6279. if (h.strictTuples && !b) {
  6280. const v = `"${o}" is ${_}-tuple, but minItems or maxItems/${t} are not specified or different at path "${y}"`;
  6281. (0, br.checkStrictMode)(a, v, h.strictTuples);
  6282. }
  6283. }
  6284. }
  6285. Ot.validateTuple = vl;
  6286. Ot.default = ch;
  6287. Object.defineProperty(Ui, "__esModule", { value: !0 });
  6288. const uh = Ot, fh = {
  6289. keyword: "prefixItems",
  6290. type: "array",
  6291. schemaType: ["array"],
  6292. before: "uniqueItems",
  6293. code: (e) => (0, uh.validateTuple)(e, "items")
  6294. };
  6295. Ui.default = fh;
  6296. var zi = {};
  6297. Object.defineProperty(zi, "__esModule", { value: !0 });
  6298. const yo = D, dh = I, ph = F, hh = Pt, mh = {
  6299. message: ({ params: { len: e } }) => (0, yo.str)`must NOT have more than ${e} items`,
  6300. params: ({ params: { len: e } }) => (0, yo._)`{limit: ${e}}`
  6301. }, yh = {
  6302. keyword: "items",
  6303. type: "array",
  6304. schemaType: ["object", "boolean"],
  6305. before: "uniqueItems",
  6306. error: mh,
  6307. code(e) {
  6308. const { schema: t, parentSchema: r, it: n } = e, { prefixItems: i } = r;
  6309. n.items = !0, !(0, dh.alwaysValidSchema)(n, t) && (i ? (0, hh.validateAdditionalItems)(e, i) : e.ok((0, ph.validateArray)(e)));
  6310. }
  6311. };
  6312. zi.default = yh;
  6313. var Gi = {};
  6314. Object.defineProperty(Gi, "__esModule", { value: !0 });
  6315. const de = D, cr = I, gh = {
  6316. message: ({ params: { min: e, max: t } }) => t === void 0 ? (0, de.str)`must contain at least ${e} valid item(s)` : (0, de.str)`must contain at least ${e} and no more than ${t} valid item(s)`,
  6317. params: ({ params: { min: e, max: t } }) => t === void 0 ? (0, de._)`{minContains: ${e}}` : (0, de._)`{minContains: ${e}, maxContains: ${t}}`
  6318. }, $h = {
  6319. keyword: "contains",
  6320. type: "array",
  6321. schemaType: ["object", "boolean"],
  6322. before: "uniqueItems",
  6323. trackErrors: !0,
  6324. error: gh,
  6325. code(e) {
  6326. const { gen: t, schema: r, parentSchema: n, data: i, it: s } = e;
  6327. let o, a;
  6328. const { minContains: l, maxContains: c } = n;
  6329. s.opts.next ? (o = l === void 0 ? 1 : l, a = c) : o = 1;
  6330. const f = t.const("len", (0, de._)`${i}.length`);
  6331. if (e.setParams({ min: o, max: a }), a === void 0 && o === 0) {
  6332. (0, cr.checkStrictMode)(s, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
  6333. return;
  6334. }
  6335. if (a !== void 0 && o > a) {
  6336. (0, cr.checkStrictMode)(s, '"minContains" > "maxContains" is always invalid'), e.fail();
  6337. return;
  6338. }
  6339. if ((0, cr.alwaysValidSchema)(s, r)) {
  6340. let b = (0, de._)`${f} >= ${o}`;
  6341. a !== void 0 && (b = (0, de._)`${b} && ${f} <= ${a}`), e.pass(b);
  6342. return;
  6343. }
  6344. s.items = !0;
  6345. const u = t.name("valid");
  6346. a === void 0 && o === 1 ? y(u, () => t.if(u, () => t.break())) : o === 0 ? (t.let(u, !0), a !== void 0 && t.if((0, de._)`${i}.length > 0`, h)) : (t.let(u, !1), h()), e.result(u, () => e.reset());
  6347. function h() {
  6348. const b = t.name("_valid"), v = t.let("count", 0);
  6349. y(b, () => t.if(b, () => _(v)));
  6350. }
  6351. function y(b, v) {
  6352. t.forRange("i", 0, f, (p) => {
  6353. e.subschema({
  6354. keyword: "contains",
  6355. dataProp: p,
  6356. dataPropType: cr.Type.Num,
  6357. compositeRule: !0
  6358. }, b), v();
  6359. });
  6360. }
  6361. function _(b) {
  6362. t.code((0, de._)`${b}++`), a === void 0 ? t.if((0, de._)`${b} >= ${o}`, () => t.assign(u, !0).break()) : (t.if((0, de._)`${b} > ${a}`, () => t.assign(u, !1).break()), o === 1 ? t.assign(u, !0) : t.if((0, de._)`${b} >= ${o}`, () => t.assign(u, !0)));
  6363. }
  6364. }
  6365. };
  6366. Gi.default = $h;
  6367. var en = {};
  6368. (function(e) {
  6369. Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
  6370. const t = D, r = I, n = F;
  6371. e.error = {
  6372. message: ({ params: { property: l, depsCount: c, deps: f } }) => {
  6373. const u = c === 1 ? "property" : "properties";
  6374. return (0, t.str)`must have ${u} ${f} when property ${l} is present`;
  6375. },
  6376. params: ({ params: { property: l, depsCount: c, deps: f, missingProperty: u } }) => (0, t._)`{property: ${l},
  6377. missingProperty: ${u},
  6378. depsCount: ${c},
  6379. deps: ${f}}`
  6380. // TODO change to reference
  6381. };
  6382. const i = {
  6383. keyword: "dependencies",
  6384. type: "object",
  6385. schemaType: "object",
  6386. error: e.error,
  6387. code(l) {
  6388. const [c, f] = s(l);
  6389. o(l, c), a(l, f);
  6390. }
  6391. };
  6392. function s({ schema: l }) {
  6393. const c = {}, f = {};
  6394. for (const u in l) {
  6395. if (u === "__proto__")
  6396. continue;
  6397. const h = Array.isArray(l[u]) ? c : f;
  6398. h[u] = l[u];
  6399. }
  6400. return [c, f];
  6401. }
  6402. function o(l, c = l.schema) {
  6403. const { gen: f, data: u, it: h } = l;
  6404. if (Object.keys(c).length === 0)
  6405. return;
  6406. const y = f.let("missing");
  6407. for (const _ in c) {
  6408. const b = c[_];
  6409. if (b.length === 0)
  6410. continue;
  6411. const v = (0, n.propertyInData)(f, u, _, h.opts.ownProperties);
  6412. l.setParams({
  6413. property: _,
  6414. depsCount: b.length,
  6415. deps: b.join(", ")
  6416. }), h.allErrors ? f.if(v, () => {
  6417. for (const p of b)
  6418. (0, n.checkReportMissingProp)(l, p);
  6419. }) : (f.if((0, t._)`${v} && (${(0, n.checkMissingProp)(l, b, y)})`), (0, n.reportMissingProp)(l, y), f.else());
  6420. }
  6421. }
  6422. e.validatePropertyDeps = o;
  6423. function a(l, c = l.schema) {
  6424. const { gen: f, data: u, keyword: h, it: y } = l, _ = f.name("valid");
  6425. for (const b in c)
  6426. (0, r.alwaysValidSchema)(y, c[b]) || (f.if(
  6427. (0, n.propertyInData)(f, u, b, y.opts.ownProperties),
  6428. () => {
  6429. const v = l.subschema({ keyword: h, schemaProp: b }, _);
  6430. l.mergeValidEvaluated(v, _);
  6431. },
  6432. () => f.var(_, !0)
  6433. // TODO var
  6434. ), l.ok(_));
  6435. }
  6436. e.validateSchemaDeps = a, e.default = i;
  6437. })(en);
  6438. var Bi = {};
  6439. Object.defineProperty(Bi, "__esModule", { value: !0 });
  6440. const bl = D, _h = I, vh = {
  6441. message: "property name must be valid",
  6442. params: ({ params: e }) => (0, bl._)`{propertyName: ${e.propertyName}}`
  6443. }, bh = {
  6444. keyword: "propertyNames",
  6445. type: "object",
  6446. schemaType: ["object", "boolean"],
  6447. error: vh,
  6448. code(e) {
  6449. const { gen: t, schema: r, data: n, it: i } = e;
  6450. if ((0, _h.alwaysValidSchema)(i, r))
  6451. return;
  6452. const s = t.name("valid");
  6453. t.forIn("key", n, (o) => {
  6454. e.setParams({ propertyName: o }), e.subschema({
  6455. keyword: "propertyNames",
  6456. data: o,
  6457. dataTypes: ["string"],
  6458. propertyName: o,
  6459. compositeRule: !0
  6460. }, s), t.if((0, bl.not)(s), () => {
  6461. e.error(!0), i.allErrors || t.break();
  6462. });
  6463. }), e.ok(s);
  6464. }
  6465. };
  6466. Bi.default = bh;
  6467. var tn = {};
  6468. Object.defineProperty(tn, "__esModule", { value: !0 });
  6469. const ur = F, ye = D, wh = ue, fr = I, Ph = {
  6470. message: "must NOT have additional properties",
  6471. params: ({ params: e }) => (0, ye._)`{additionalProperty: ${e.additionalProperty}}`
  6472. }, Oh = {
  6473. keyword: "additionalProperties",
  6474. type: ["object"],
  6475. schemaType: ["boolean", "object"],
  6476. allowUndefined: !0,
  6477. trackErrors: !0,
  6478. error: Ph,
  6479. code(e) {
  6480. const { gen: t, schema: r, parentSchema: n, data: i, errsCount: s, it: o } = e;
  6481. if (!s)
  6482. throw new Error("ajv implementation error");
  6483. const { allErrors: a, opts: l } = o;
  6484. if (o.props = !0, l.removeAdditional !== "all" && (0, fr.alwaysValidSchema)(o, r))
  6485. return;
  6486. const c = (0, ur.allSchemaProperties)(n.properties), f = (0, ur.allSchemaProperties)(n.patternProperties);
  6487. u(), e.ok((0, ye._)`${s} === ${wh.default.errors}`);
  6488. function u() {
  6489. t.forIn("key", i, (v) => {
  6490. !c.length && !f.length ? _(v) : t.if(h(v), () => _(v));
  6491. });
  6492. }
  6493. function h(v) {
  6494. let p;
  6495. if (c.length > 8) {
  6496. const m = (0, fr.schemaRefOrVal)(o, n.properties, "properties");
  6497. p = (0, ur.isOwnProperty)(t, m, v);
  6498. } else c.length ? p = (0, ye.or)(...c.map((m) => (0, ye._)`${v} === ${m}`)) : p = ye.nil;
  6499. return f.length && (p = (0, ye.or)(p, ...f.map((m) => (0, ye._)`${(0, ur.usePattern)(e, m)}.test(${v})`))), (0, ye.not)(p);
  6500. }
  6501. function y(v) {
  6502. t.code((0, ye._)`delete ${i}[${v}]`);
  6503. }
  6504. function _(v) {
  6505. if (l.removeAdditional === "all" || l.removeAdditional && r === !1) {
  6506. y(v);
  6507. return;
  6508. }
  6509. if (r === !1) {
  6510. e.setParams({ additionalProperty: v }), e.error(), a || t.break();
  6511. return;
  6512. }
  6513. if (typeof r == "object" && !(0, fr.alwaysValidSchema)(o, r)) {
  6514. const p = t.name("valid");
  6515. l.removeAdditional === "failing" ? (b(v, p, !1), t.if((0, ye.not)(p), () => {
  6516. e.reset(), y(v);
  6517. })) : (b(v, p), a || t.if((0, ye.not)(p), () => t.break()));
  6518. }
  6519. }
  6520. function b(v, p, m) {
  6521. const $ = {
  6522. keyword: "additionalProperties",
  6523. dataProp: v,
  6524. dataPropType: fr.Type.Str
  6525. };
  6526. m === !1 && Object.assign($, {
  6527. compositeRule: !0,
  6528. createErrors: !1,
  6529. allErrors: !1
  6530. }), e.subschema($, p);
  6531. }
  6532. }
  6533. };
  6534. tn.default = Oh;
  6535. var Ki = {};
  6536. Object.defineProperty(Ki, "__esModule", { value: !0 });
  6537. const Eh = $e, go = F, Dn = I, $o = tn, Sh = {
  6538. keyword: "properties",
  6539. type: "object",
  6540. schemaType: "object",
  6541. code(e) {
  6542. const { gen: t, schema: r, parentSchema: n, data: i, it: s } = e;
  6543. s.opts.removeAdditional === "all" && n.additionalProperties === void 0 && $o.default.code(new Eh.KeywordCxt(s, $o.default, "additionalProperties"));
  6544. const o = (0, go.allSchemaProperties)(r);
  6545. for (const u of o)
  6546. s.definedProperties.add(u);
  6547. s.opts.unevaluated && o.length && s.props !== !0 && (s.props = Dn.mergeEvaluated.props(t, (0, Dn.toHash)(o), s.props));
  6548. const a = o.filter((u) => !(0, Dn.alwaysValidSchema)(s, r[u]));
  6549. if (a.length === 0)
  6550. return;
  6551. const l = t.name("valid");
  6552. for (const u of a)
  6553. c(u) ? f(u) : (t.if((0, go.propertyInData)(t, i, u, s.opts.ownProperties)), f(u), s.allErrors || t.else().var(l, !0), t.endIf()), e.it.definedProperties.add(u), e.ok(l);
  6554. function c(u) {
  6555. return s.opts.useDefaults && !s.compositeRule && r[u].default !== void 0;
  6556. }
  6557. function f(u) {
  6558. e.subschema({
  6559. keyword: "properties",
  6560. schemaProp: u,
  6561. dataProp: u
  6562. }, l);
  6563. }
  6564. }
  6565. };
  6566. Ki.default = Sh;
  6567. var Wi = {};
  6568. Object.defineProperty(Wi, "__esModule", { value: !0 });
  6569. const _o = F, dr = D, vo = I, bo = I, xh = {
  6570. keyword: "patternProperties",
  6571. type: "object",
  6572. schemaType: "object",
  6573. code(e) {
  6574. const { gen: t, schema: r, data: n, parentSchema: i, it: s } = e, { opts: o } = s, a = (0, _o.allSchemaProperties)(r), l = a.filter((b) => (0, vo.alwaysValidSchema)(s, r[b]));
  6575. if (a.length === 0 || l.length === a.length && (!s.opts.unevaluated || s.props === !0))
  6576. return;
  6577. const c = o.strictSchema && !o.allowMatchingProperties && i.properties, f = t.name("valid");
  6578. s.props !== !0 && !(s.props instanceof dr.Name) && (s.props = (0, bo.evaluatedPropsToName)(t, s.props));
  6579. const { props: u } = s;
  6580. h();
  6581. function h() {
  6582. for (const b of a)
  6583. c && y(b), s.allErrors ? _(b) : (t.var(f, !0), _(b), t.if(f));
  6584. }
  6585. function y(b) {
  6586. for (const v in c)
  6587. new RegExp(b).test(v) && (0, vo.checkStrictMode)(s, `property ${v} matches pattern ${b} (use allowMatchingProperties)`);
  6588. }
  6589. function _(b) {
  6590. t.forIn("key", n, (v) => {
  6591. t.if((0, dr._)`${(0, _o.usePattern)(e, b)}.test(${v})`, () => {
  6592. const p = l.includes(b);
  6593. p || e.subschema({
  6594. keyword: "patternProperties",
  6595. schemaProp: b,
  6596. dataProp: v,
  6597. dataPropType: bo.Type.Str
  6598. }, f), s.opts.unevaluated && u !== !0 ? t.assign((0, dr._)`${u}[${v}]`, !0) : !p && !s.allErrors && t.if((0, dr.not)(f), () => t.break());
  6599. });
  6600. });
  6601. }
  6602. }
  6603. };
  6604. Wi.default = xh;
  6605. var Ji = {};
  6606. Object.defineProperty(Ji, "__esModule", { value: !0 });
  6607. const jh = I, Ah = {
  6608. keyword: "not",
  6609. schemaType: ["object", "boolean"],
  6610. trackErrors: !0,
  6611. code(e) {
  6612. const { gen: t, schema: r, it: n } = e;
  6613. if ((0, jh.alwaysValidSchema)(n, r)) {
  6614. e.fail();
  6615. return;
  6616. }
  6617. const i = t.name("valid");
  6618. e.subschema({
  6619. keyword: "not",
  6620. compositeRule: !0,
  6621. createErrors: !1,
  6622. allErrors: !1
  6623. }, i), e.failResult(i, () => e.reset(), () => e.error());
  6624. },
  6625. error: { message: "must NOT be valid" }
  6626. };
  6627. Ji.default = Ah;
  6628. var Yi = {};
  6629. Object.defineProperty(Yi, "__esModule", { value: !0 });
  6630. const Ch = F, Ih = {
  6631. keyword: "anyOf",
  6632. schemaType: "array",
  6633. trackErrors: !0,
  6634. code: Ch.validateUnion,
  6635. error: { message: "must match a schema in anyOf" }
  6636. };
  6637. Yi.default = Ih;
  6638. var Xi = {};
  6639. Object.defineProperty(Xi, "__esModule", { value: !0 });
  6640. const wr = D, Th = I, Rh = {
  6641. message: "must match exactly one schema in oneOf",
  6642. params: ({ params: e }) => (0, wr._)`{passingSchemas: ${e.passing}}`
  6643. }, kh = {
  6644. keyword: "oneOf",
  6645. schemaType: "array",
  6646. trackErrors: !0,
  6647. error: Rh,
  6648. code(e) {
  6649. const { gen: t, schema: r, parentSchema: n, it: i } = e;
  6650. if (!Array.isArray(r))
  6651. throw new Error("ajv implementation error");
  6652. if (i.opts.discriminator && n.discriminator)
  6653. return;
  6654. const s = r, o = t.let("valid", !1), a = t.let("passing", null), l = t.name("_valid");
  6655. e.setParams({ passing: a }), t.block(c), e.result(o, () => e.reset(), () => e.error(!0));
  6656. function c() {
  6657. s.forEach((f, u) => {
  6658. let h;
  6659. (0, Th.alwaysValidSchema)(i, f) ? t.var(l, !0) : h = e.subschema({
  6660. keyword: "oneOf",
  6661. schemaProp: u,
  6662. compositeRule: !0
  6663. }, l), u > 0 && t.if((0, wr._)`${l} && ${o}`).assign(o, !1).assign(a, (0, wr._)`[${a}, ${u}]`).else(), t.if(l, () => {
  6664. t.assign(o, !0), t.assign(a, u), h && e.mergeEvaluated(h, wr.Name);
  6665. });
  6666. });
  6667. }
  6668. }
  6669. };
  6670. Xi.default = kh;
  6671. var Qi = {};
  6672. Object.defineProperty(Qi, "__esModule", { value: !0 });
  6673. const Nh = I, Mh = {
  6674. keyword: "allOf",
  6675. schemaType: "array",
  6676. code(e) {
  6677. const { gen: t, schema: r, it: n } = e;
  6678. if (!Array.isArray(r))
  6679. throw new Error("ajv implementation error");
  6680. const i = t.name("valid");
  6681. r.forEach((s, o) => {
  6682. if ((0, Nh.alwaysValidSchema)(n, s))
  6683. return;
  6684. const a = e.subschema({ keyword: "allOf", schemaProp: o }, i);
  6685. e.ok(i), e.mergeEvaluated(a);
  6686. });
  6687. }
  6688. };
  6689. Qi.default = Mh;
  6690. var Zi = {};
  6691. Object.defineProperty(Zi, "__esModule", { value: !0 });
  6692. const xr = D, wl = I, Dh = {
  6693. message: ({ params: e }) => (0, xr.str)`must match "${e.ifClause}" schema`,
  6694. params: ({ params: e }) => (0, xr._)`{failingKeyword: ${e.ifClause}}`
  6695. }, qh = {
  6696. keyword: "if",
  6697. schemaType: ["object", "boolean"],
  6698. trackErrors: !0,
  6699. error: Dh,
  6700. code(e) {
  6701. const { gen: t, parentSchema: r, it: n } = e;
  6702. r.then === void 0 && r.else === void 0 && (0, wl.checkStrictMode)(n, '"if" without "then" and "else" is ignored');
  6703. const i = wo(n, "then"), s = wo(n, "else");
  6704. if (!i && !s)
  6705. return;
  6706. const o = t.let("valid", !0), a = t.name("_valid");
  6707. if (l(), e.reset(), i && s) {
  6708. const f = t.let("ifClause");
  6709. e.setParams({ ifClause: f }), t.if(a, c("then", f), c("else", f));
  6710. } else i ? t.if(a, c("then")) : t.if((0, xr.not)(a), c("else"));
  6711. e.pass(o, () => e.error(!0));
  6712. function l() {
  6713. const f = e.subschema({
  6714. keyword: "if",
  6715. compositeRule: !0,
  6716. createErrors: !1,
  6717. allErrors: !1
  6718. }, a);
  6719. e.mergeEvaluated(f);
  6720. }
  6721. function c(f, u) {
  6722. return () => {
  6723. const h = e.subschema({ keyword: f }, a);
  6724. t.assign(o, a), e.mergeValidEvaluated(h, o), u ? t.assign(u, (0, xr._)`${f}`) : e.setParams({ ifClause: f });
  6725. };
  6726. }
  6727. }
  6728. };
  6729. function wo(e, t) {
  6730. const r = e.schema[t];
  6731. return r !== void 0 && !(0, wl.alwaysValidSchema)(e, r);
  6732. }
  6733. Zi.default = qh;
  6734. var es = {};
  6735. Object.defineProperty(es, "__esModule", { value: !0 });
  6736. const Fh = I, Vh = {
  6737. keyword: ["then", "else"],
  6738. schemaType: ["object", "boolean"],
  6739. code({ keyword: e, parentSchema: t, it: r }) {
  6740. t.if === void 0 && (0, Fh.checkStrictMode)(r, `"${e}" without "if" is ignored`);
  6741. }
  6742. };
  6743. es.default = Vh;
  6744. Object.defineProperty(Zr, "__esModule", { value: !0 });
  6745. const Lh = Pt, Hh = Ui, Uh = Ot, zh = zi, Gh = Gi, Bh = en, Kh = Bi, Wh = tn, Jh = Ki, Yh = Wi, Xh = Ji, Qh = Yi, Zh = Xi, em = Qi, tm = Zi, rm = es;
  6746. function nm(e = !1) {
  6747. const t = [
  6748. // any
  6749. Xh.default,
  6750. Qh.default,
  6751. Zh.default,
  6752. em.default,
  6753. tm.default,
  6754. rm.default,
  6755. // object
  6756. Kh.default,
  6757. Wh.default,
  6758. Bh.default,
  6759. Jh.default,
  6760. Yh.default
  6761. ];
  6762. return e ? t.push(Hh.default, zh.default) : t.push(Lh.default, Uh.default), t.push(Gh.default), t;
  6763. }
  6764. Zr.default = nm;
  6765. var rn = {}, ts = {};
  6766. Object.defineProperty(ts, "__esModule", { value: !0 });
  6767. const W = D, im = {
  6768. message: ({ schemaCode: e }) => (0, W.str)`must match format "${e}"`,
  6769. params: ({ schemaCode: e }) => (0, W._)`{format: ${e}}`
  6770. }, sm = {
  6771. keyword: "format",
  6772. type: ["number", "string"],
  6773. schemaType: "string",
  6774. $data: !0,
  6775. error: im,
  6776. code(e, t) {
  6777. const { gen: r, data: n, $data: i, schema: s, schemaCode: o, it: a } = e, { opts: l, errSchemaPath: c, schemaEnv: f, self: u } = a;
  6778. if (!l.validateFormats)
  6779. return;
  6780. i ? h() : y();
  6781. function h() {
  6782. const _ = r.scopeValue("formats", {
  6783. ref: u.formats,
  6784. code: l.code.formats
  6785. }), b = r.const("fDef", (0, W._)`${_}[${o}]`), v = r.let("fType"), p = r.let("format");
  6786. r.if((0, W._)`typeof ${b} == "object" && !(${b} instanceof RegExp)`, () => r.assign(v, (0, W._)`${b}.type || "string"`).assign(p, (0, W._)`${b}.validate`), () => r.assign(v, (0, W._)`"string"`).assign(p, b)), e.fail$data((0, W.or)(m(), $()));
  6787. function m() {
  6788. return l.strictSchema === !1 ? W.nil : (0, W._)`${o} && !${p}`;
  6789. }
  6790. function $() {
  6791. const E = f.$async ? (0, W._)`(${b}.async ? await ${p}(${n}) : ${p}(${n}))` : (0, W._)`${p}(${n})`, S = (0, W._)`(typeof ${p} == "function" ? ${E} : ${p}.test(${n}))`;
  6792. return (0, W._)`${p} && ${p} !== true && ${v} === ${t} && !${S}`;
  6793. }
  6794. }
  6795. function y() {
  6796. const _ = u.formats[s];
  6797. if (!_) {
  6798. m();
  6799. return;
  6800. }
  6801. if (_ === !0)
  6802. return;
  6803. const [b, v, p] = $(_);
  6804. b === t && e.pass(E());
  6805. function m() {
  6806. if (l.strictSchema === !1) {
  6807. u.logger.warn(S());
  6808. return;
  6809. }
  6810. throw new Error(S());
  6811. function S() {
  6812. return `unknown format "${s}" ignored in schema at path "${c}"`;
  6813. }
  6814. }
  6815. function $(S) {
  6816. const A = S instanceof RegExp ? (0, W.regexpCode)(S) : l.code.formats ? (0, W._)`${l.code.formats}${(0, W.getProperty)(s)}` : void 0, U = r.scopeValue("formats", { key: s, ref: S, code: A });
  6817. return typeof S == "object" && !(S instanceof RegExp) ? [S.type || "string", S.validate, (0, W._)`${U}.validate`] : ["string", S, U];
  6818. }
  6819. function E() {
  6820. if (typeof _ == "object" && !(_ instanceof RegExp) && _.async) {
  6821. if (!f.$async)
  6822. throw new Error("async format in sync schema");
  6823. return (0, W._)`await ${p}(${n})`;
  6824. }
  6825. return typeof v == "function" ? (0, W._)`${p}(${n})` : (0, W._)`${p}.test(${n})`;
  6826. }
  6827. }
  6828. }
  6829. };
  6830. ts.default = sm;
  6831. Object.defineProperty(rn, "__esModule", { value: !0 });
  6832. const om = ts, am = [om.default];
  6833. rn.default = am;
  6834. Object.defineProperty(Di, "__esModule", { value: !0 });
  6835. const lm = qi, cm = Fi, um = Zr, fm = rn, dm = ["title", "description", "default"], pm = [
  6836. lm.default,
  6837. cm.default,
  6838. um.default(),
  6839. fm.default,
  6840. dm
  6841. ];
  6842. Di.default = pm;
  6843. var nn = {}, sn = {};
  6844. Object.defineProperty(sn, "__esModule", { value: !0 });
  6845. sn.DiscrError = void 0;
  6846. var Po;
  6847. (function(e) {
  6848. e.Tag = "tag", e.Mapping = "mapping";
  6849. })(Po || (sn.DiscrError = Po = {}));
  6850. Object.defineProperty(nn, "__esModule", { value: !0 });
  6851. const ft = D, ii = sn, Oo = se, hm = wt, mm = I, ym = {
  6852. message: ({ params: { discrError: e, tagName: t } }) => e === ii.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`,
  6853. params: ({ params: { discrError: e, tag: t, tagName: r } }) => (0, ft._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`
  6854. }, gm = {
  6855. keyword: "discriminator",
  6856. type: "object",
  6857. schemaType: "object",
  6858. error: ym,
  6859. code(e) {
  6860. const { gen: t, data: r, schema: n, parentSchema: i, it: s } = e, { oneOf: o } = i;
  6861. if (!s.opts.discriminator)
  6862. throw new Error("discriminator: requires discriminator option");
  6863. const a = n.propertyName;
  6864. if (typeof a != "string")
  6865. throw new Error("discriminator: requires propertyName");
  6866. if (n.mapping)
  6867. throw new Error("discriminator: mapping is not supported");
  6868. if (!o)
  6869. throw new Error("discriminator: requires oneOf keyword");
  6870. const l = t.let("valid", !1), c = t.const("tag", (0, ft._)`${r}${(0, ft.getProperty)(a)}`);
  6871. t.if((0, ft._)`typeof ${c} == "string"`, () => f(), () => e.error(!1, { discrError: ii.DiscrError.Tag, tag: c, tagName: a })), e.ok(l);
  6872. function f() {
  6873. const y = h();
  6874. t.if(!1);
  6875. for (const _ in y)
  6876. t.elseIf((0, ft._)`${c} === ${_}`), t.assign(l, u(y[_]));
  6877. t.else(), e.error(!1, { discrError: ii.DiscrError.Mapping, tag: c, tagName: a }), t.endIf();
  6878. }
  6879. function u(y) {
  6880. const _ = t.name("valid"), b = e.subschema({ keyword: "oneOf", schemaProp: y }, _);
  6881. return e.mergeEvaluated(b, ft.Name), _;
  6882. }
  6883. function h() {
  6884. var y;
  6885. const _ = {}, b = p(i);
  6886. let v = !0;
  6887. for (let E = 0; E < o.length; E++) {
  6888. let S = o[E];
  6889. if (S != null && S.$ref && !(0, mm.schemaHasRulesButRef)(S, s.self.RULES)) {
  6890. const U = S.$ref;
  6891. if (S = Oo.resolveRef.call(s.self, s.schemaEnv.root, s.baseId, U), S instanceof Oo.SchemaEnv && (S = S.schema), S === void 0)
  6892. throw new hm.default(s.opts.uriResolver, s.baseId, U);
  6893. }
  6894. const A = (y = S == null ? void 0 : S.properties) === null || y === void 0 ? void 0 : y[a];
  6895. if (typeof A != "object")
  6896. throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);
  6897. v = v && (b || p(S)), m(A, E);
  6898. }
  6899. if (!v)
  6900. throw new Error(`discriminator: "${a}" must be required`);
  6901. return _;
  6902. function p({ required: E }) {
  6903. return Array.isArray(E) && E.includes(a);
  6904. }
  6905. function m(E, S) {
  6906. if (E.const)
  6907. $(E.const, S);
  6908. else if (E.enum)
  6909. for (const A of E.enum)
  6910. $(A, S);
  6911. else
  6912. throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`);
  6913. }
  6914. function $(E, S) {
  6915. if (typeof E != "string" || E in _)
  6916. throw new Error(`discriminator: "${a}" values must be unique strings`);
  6917. _[E] = S;
  6918. }
  6919. }
  6920. }
  6921. };
  6922. nn.default = gm;
  6923. const $m = "http://json-schema.org/draft-04/schema#", _m = "http://json-schema.org/draft-04/schema#", vm = "Core schema meta-schema", bm = {
  6924. schemaArray: {
  6925. type: "array",
  6926. minItems: 1,
  6927. items: {
  6928. $ref: "#"
  6929. }
  6930. },
  6931. positiveInteger: {
  6932. type: "integer",
  6933. minimum: 0
  6934. },
  6935. positiveIntegerDefault0: {
  6936. allOf: [
  6937. {
  6938. $ref: "#/definitions/positiveInteger"
  6939. },
  6940. {
  6941. default: 0
  6942. }
  6943. ]
  6944. },
  6945. simpleTypes: {
  6946. enum: [
  6947. "array",
  6948. "boolean",
  6949. "integer",
  6950. "null",
  6951. "number",
  6952. "object",
  6953. "string"
  6954. ]
  6955. },
  6956. stringArray: {
  6957. type: "array",
  6958. items: {
  6959. type: "string"
  6960. },
  6961. minItems: 1,
  6962. uniqueItems: !0
  6963. }
  6964. }, wm = "object", Pm = {
  6965. id: {
  6966. type: "string",
  6967. format: "uri"
  6968. },
  6969. $schema: {
  6970. type: "string",
  6971. format: "uri"
  6972. },
  6973. title: {
  6974. type: "string"
  6975. },
  6976. description: {
  6977. type: "string"
  6978. },
  6979. default: {},
  6980. multipleOf: {
  6981. type: "number",
  6982. minimum: 0,
  6983. exclusiveMinimum: !0
  6984. },
  6985. maximum: {
  6986. type: "number"
  6987. },
  6988. exclusiveMaximum: {
  6989. type: "boolean",
  6990. default: !1
  6991. },
  6992. minimum: {
  6993. type: "number"
  6994. },
  6995. exclusiveMinimum: {
  6996. type: "boolean",
  6997. default: !1
  6998. },
  6999. maxLength: {
  7000. $ref: "#/definitions/positiveInteger"
  7001. },
  7002. minLength: {
  7003. $ref: "#/definitions/positiveIntegerDefault0"
  7004. },
  7005. pattern: {
  7006. type: "string",
  7007. format: "regex"
  7008. },
  7009. additionalItems: {
  7010. anyOf: [
  7011. {
  7012. type: "boolean"
  7013. },
  7014. {
  7015. $ref: "#"
  7016. }
  7017. ],
  7018. default: {}
  7019. },
  7020. items: {
  7021. anyOf: [
  7022. {
  7023. $ref: "#"
  7024. },
  7025. {
  7026. $ref: "#/definitions/schemaArray"
  7027. }
  7028. ],
  7029. default: {}
  7030. },
  7031. maxItems: {
  7032. $ref: "#/definitions/positiveInteger"
  7033. },
  7034. minItems: {
  7035. $ref: "#/definitions/positiveIntegerDefault0"
  7036. },
  7037. uniqueItems: {
  7038. type: "boolean",
  7039. default: !1
  7040. },
  7041. maxProperties: {
  7042. $ref: "#/definitions/positiveInteger"
  7043. },
  7044. minProperties: {
  7045. $ref: "#/definitions/positiveIntegerDefault0"
  7046. },
  7047. required: {
  7048. $ref: "#/definitions/stringArray"
  7049. },
  7050. additionalProperties: {
  7051. anyOf: [
  7052. {
  7053. type: "boolean"
  7054. },
  7055. {
  7056. $ref: "#"
  7057. }
  7058. ],
  7059. default: {}
  7060. },
  7061. definitions: {
  7062. type: "object",
  7063. additionalProperties: {
  7064. $ref: "#"
  7065. },
  7066. default: {}
  7067. },
  7068. properties: {
  7069. type: "object",
  7070. additionalProperties: {
  7071. $ref: "#"
  7072. },
  7073. default: {}
  7074. },
  7075. patternProperties: {
  7076. type: "object",
  7077. additionalProperties: {
  7078. $ref: "#"
  7079. },
  7080. default: {}
  7081. },
  7082. dependencies: {
  7083. type: "object",
  7084. additionalProperties: {
  7085. anyOf: [
  7086. {
  7087. $ref: "#"
  7088. },
  7089. {
  7090. $ref: "#/definitions/stringArray"
  7091. }
  7092. ]
  7093. }
  7094. },
  7095. enum: {
  7096. type: "array",
  7097. minItems: 1,
  7098. uniqueItems: !0
  7099. },
  7100. type: {
  7101. anyOf: [
  7102. {
  7103. $ref: "#/definitions/simpleTypes"
  7104. },
  7105. {
  7106. type: "array",
  7107. items: {
  7108. $ref: "#/definitions/simpleTypes"
  7109. },
  7110. minItems: 1,
  7111. uniqueItems: !0
  7112. }
  7113. ]
  7114. },
  7115. allOf: {
  7116. $ref: "#/definitions/schemaArray"
  7117. },
  7118. anyOf: {
  7119. $ref: "#/definitions/schemaArray"
  7120. },
  7121. oneOf: {
  7122. $ref: "#/definitions/schemaArray"
  7123. },
  7124. not: {
  7125. $ref: "#"
  7126. }
  7127. }, Om = {
  7128. exclusiveMaximum: [
  7129. "maximum"
  7130. ],
  7131. exclusiveMinimum: [
  7132. "minimum"
  7133. ]
  7134. }, Em = {
  7135. id: $m,
  7136. $schema: _m,
  7137. description: vm,
  7138. definitions: bm,
  7139. type: wm,
  7140. properties: Pm,
  7141. dependencies: Om,
  7142. default: {}
  7143. };
  7144. (function(e, t) {
  7145. Object.defineProperty(t, "__esModule", { value: !0 }), t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = void 0;
  7146. const r = mt, n = Di, i = nn, s = Em, o = ["/properties"], a = "http://json-schema.org/draft-04/schema";
  7147. class l extends r.default {
  7148. constructor(h = {}) {
  7149. super({
  7150. ...h,
  7151. schemaId: "id"
  7152. });
  7153. }
  7154. _addVocabularies() {
  7155. super._addVocabularies(), n.default.forEach((h) => this.addVocabulary(h)), this.opts.discriminator && this.addKeyword(i.default);
  7156. }
  7157. _addDefaultMetaSchema() {
  7158. if (super._addDefaultMetaSchema(), !this.opts.meta)
  7159. return;
  7160. const h = this.opts.$data ? this.$dataMetaSchema(s, o) : s;
  7161. this.addMetaSchema(h, a, !1), this.refs["http://json-schema.org/schema"] = a;
  7162. }
  7163. defaultMeta() {
  7164. return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(a) ? a : void 0);
  7165. }
  7166. }
  7167. e.exports = t = l, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = l;
  7168. var c = mt;
  7169. Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
  7170. return c.KeywordCxt;
  7171. } });
  7172. var f = mt;
  7173. Object.defineProperty(t, "_", { enumerable: !0, get: function() {
  7174. return f._;
  7175. } }), Object.defineProperty(t, "str", { enumerable: !0, get: function() {
  7176. return f.str;
  7177. } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() {
  7178. return f.stringify;
  7179. } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() {
  7180. return f.nil;
  7181. } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() {
  7182. return f.Name;
  7183. } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
  7184. return f.CodeGen;
  7185. } });
  7186. })(Wn, Wn.exports);
  7187. var Sm = Wn.exports, si = { exports: {} }, rs = {}, ns = {}, is = {};
  7188. Object.defineProperty(is, "__esModule", { value: !0 });
  7189. const xm = {
  7190. keyword: "id",
  7191. code() {
  7192. throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
  7193. }
  7194. };
  7195. is.default = xm;
  7196. Object.defineProperty(ns, "__esModule", { value: !0 });
  7197. const jm = is, Am = Ee, Cm = [
  7198. "$schema",
  7199. "$id",
  7200. "$defs",
  7201. "$vocabulary",
  7202. { keyword: "$comment" },
  7203. "definitions",
  7204. jm.default,
  7205. Am.default
  7206. ];
  7207. ns.default = Cm;
  7208. var ss = {}, os = {};
  7209. Object.defineProperty(os, "__esModule", { value: !0 });
  7210. const jr = D, Fe = jr.operators, Ar = {
  7211. maximum: { okStr: "<=", ok: Fe.LTE, fail: Fe.GT },
  7212. minimum: { okStr: ">=", ok: Fe.GTE, fail: Fe.LT },
  7213. exclusiveMaximum: { okStr: "<", ok: Fe.LT, fail: Fe.GTE },
  7214. exclusiveMinimum: { okStr: ">", ok: Fe.GT, fail: Fe.LTE }
  7215. }, Im = {
  7216. message: ({ keyword: e, schemaCode: t }) => (0, jr.str)`must be ${Ar[e].okStr} ${t}`,
  7217. params: ({ keyword: e, schemaCode: t }) => (0, jr._)`{comparison: ${Ar[e].okStr}, limit: ${t}}`
  7218. }, Tm = {
  7219. keyword: Object.keys(Ar),
  7220. type: "number",
  7221. schemaType: "number",
  7222. $data: !0,
  7223. error: Im,
  7224. code(e) {
  7225. const { keyword: t, data: r, schemaCode: n } = e;
  7226. e.fail$data((0, jr._)`${r} ${Ar[t].fail} ${n} || isNaN(${r})`);
  7227. }
  7228. };
  7229. os.default = Tm;
  7230. Object.defineProperty(ss, "__esModule", { value: !0 });
  7231. const Rm = os, km = zr, Nm = Gr, Mm = Br, Dm = Kr, qm = Wr, Fm = Jr, Vm = Yr, Lm = Xr, Hm = Qr, Um = [
  7232. // number
  7233. Rm.default,
  7234. km.default,
  7235. // string
  7236. Nm.default,
  7237. Mm.default,
  7238. // object
  7239. Dm.default,
  7240. qm.default,
  7241. // array
  7242. Fm.default,
  7243. Vm.default,
  7244. // any
  7245. { keyword: "type", schemaType: ["string", "array"] },
  7246. { keyword: "nullable", schemaType: "boolean" },
  7247. Lm.default,
  7248. Hm.default
  7249. ];
  7250. ss.default = Um;
  7251. var as = {}, Et = {};
  7252. Object.defineProperty(Et, "__esModule", { value: !0 });
  7253. Et.dynamicAnchor = void 0;
  7254. const qn = D, zm = ue, Eo = se, Gm = Ee, Bm = {
  7255. keyword: "$dynamicAnchor",
  7256. schemaType: "string",
  7257. code: (e) => Pl(e, e.schema)
  7258. };
  7259. function Pl(e, t) {
  7260. const { gen: r, it: n } = e;
  7261. n.schemaEnv.root.dynamicAnchors[t] = !0;
  7262. const i = (0, qn._)`${zm.default.dynamicAnchors}${(0, qn.getProperty)(t)}`, s = n.errSchemaPath === "#" ? n.validateName : Km(e);
  7263. r.if((0, qn._)`!${i}`, () => r.assign(i, s));
  7264. }
  7265. Et.dynamicAnchor = Pl;
  7266. function Km(e) {
  7267. const { schemaEnv: t, schema: r, self: n } = e.it, { root: i, baseId: s, localRefs: o, meta: a } = t.root, { schemaId: l } = n.opts, c = new Eo.SchemaEnv({ schema: r, schemaId: l, root: i, baseId: s, localRefs: o, meta: a });
  7268. return Eo.compileSchema.call(n, c), (0, Gm.getValidate)(e, c);
  7269. }
  7270. Et.default = Bm;
  7271. var St = {};
  7272. Object.defineProperty(St, "__esModule", { value: !0 });
  7273. St.dynamicRef = void 0;
  7274. const So = D, Wm = ue, xo = Ee, Jm = {
  7275. keyword: "$dynamicRef",
  7276. schemaType: "string",
  7277. code: (e) => Ol(e, e.schema)
  7278. };
  7279. function Ol(e, t) {
  7280. const { gen: r, keyword: n, it: i } = e;
  7281. if (t[0] !== "#")
  7282. throw new Error(`"${n}" only supports hash fragment reference`);
  7283. const s = t.slice(1);
  7284. if (i.allErrors)
  7285. o();
  7286. else {
  7287. const l = r.let("valid", !1);
  7288. o(l), e.ok(l);
  7289. }
  7290. function o(l) {
  7291. if (i.schemaEnv.root.dynamicAnchors[s]) {
  7292. const c = r.let("_v", (0, So._)`${Wm.default.dynamicAnchors}${(0, So.getProperty)(s)}`);
  7293. r.if(c, a(c, l), a(i.validateName, l));
  7294. } else
  7295. a(i.validateName, l)();
  7296. }
  7297. function a(l, c) {
  7298. return c ? () => r.block(() => {
  7299. (0, xo.callRef)(e, l), r.let(c, !0);
  7300. }) : () => (0, xo.callRef)(e, l);
  7301. }
  7302. }
  7303. St.dynamicRef = Ol;
  7304. St.default = Jm;
  7305. var ls = {};
  7306. Object.defineProperty(ls, "__esModule", { value: !0 });
  7307. const Ym = Et, Xm = I, Qm = {
  7308. keyword: "$recursiveAnchor",
  7309. schemaType: "boolean",
  7310. code(e) {
  7311. e.schema ? (0, Ym.dynamicAnchor)(e, "") : (0, Xm.checkStrictMode)(e.it, "$recursiveAnchor: false is ignored");
  7312. }
  7313. };
  7314. ls.default = Qm;
  7315. var cs = {};
  7316. Object.defineProperty(cs, "__esModule", { value: !0 });
  7317. const Zm = St, ey = {
  7318. keyword: "$recursiveRef",
  7319. schemaType: "string",
  7320. code: (e) => (0, Zm.dynamicRef)(e, e.schema)
  7321. };
  7322. cs.default = ey;
  7323. Object.defineProperty(as, "__esModule", { value: !0 });
  7324. const ty = Et, ry = St, ny = ls, iy = cs, sy = [ty.default, ry.default, ny.default, iy.default];
  7325. as.default = sy;
  7326. var us = {}, fs = {};
  7327. Object.defineProperty(fs, "__esModule", { value: !0 });
  7328. const jo = en, oy = {
  7329. keyword: "dependentRequired",
  7330. type: "object",
  7331. schemaType: "object",
  7332. error: jo.error,
  7333. code: (e) => (0, jo.validatePropertyDeps)(e)
  7334. };
  7335. fs.default = oy;
  7336. var ds = {};
  7337. Object.defineProperty(ds, "__esModule", { value: !0 });
  7338. const ay = en, ly = {
  7339. keyword: "dependentSchemas",
  7340. type: "object",
  7341. schemaType: "object",
  7342. code: (e) => (0, ay.validateSchemaDeps)(e)
  7343. };
  7344. ds.default = ly;
  7345. var ps = {};
  7346. Object.defineProperty(ps, "__esModule", { value: !0 });
  7347. const cy = I, uy = {
  7348. keyword: ["maxContains", "minContains"],
  7349. type: "array",
  7350. schemaType: "number",
  7351. code({ keyword: e, parentSchema: t, it: r }) {
  7352. t.contains === void 0 && (0, cy.checkStrictMode)(r, `"${e}" without "contains" is ignored`);
  7353. }
  7354. };
  7355. ps.default = uy;
  7356. Object.defineProperty(us, "__esModule", { value: !0 });
  7357. const fy = fs, dy = ds, py = ps, hy = [fy.default, dy.default, py.default];
  7358. us.default = hy;
  7359. var hs = {}, ms = {};
  7360. Object.defineProperty(ms, "__esModule", { value: !0 });
  7361. const Ve = D, Ao = I, my = ue, yy = {
  7362. message: "must NOT have unevaluated properties",
  7363. params: ({ params: e }) => (0, Ve._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`
  7364. }, gy = {
  7365. keyword: "unevaluatedProperties",
  7366. type: "object",
  7367. schemaType: ["boolean", "object"],
  7368. trackErrors: !0,
  7369. error: yy,
  7370. code(e) {
  7371. const { gen: t, schema: r, data: n, errsCount: i, it: s } = e;
  7372. if (!i)
  7373. throw new Error("ajv implementation error");
  7374. const { allErrors: o, props: a } = s;
  7375. a instanceof Ve.Name ? t.if((0, Ve._)`${a} !== true`, () => t.forIn("key", n, (u) => t.if(c(a, u), () => l(u)))) : a !== !0 && t.forIn("key", n, (u) => a === void 0 ? l(u) : t.if(f(a, u), () => l(u))), s.props = !0, e.ok((0, Ve._)`${i} === ${my.default.errors}`);
  7376. function l(u) {
  7377. if (r === !1) {
  7378. e.setParams({ unevaluatedProperty: u }), e.error(), o || t.break();
  7379. return;
  7380. }
  7381. if (!(0, Ao.alwaysValidSchema)(s, r)) {
  7382. const h = t.name("valid");
  7383. e.subschema({
  7384. keyword: "unevaluatedProperties",
  7385. dataProp: u,
  7386. dataPropType: Ao.Type.Str
  7387. }, h), o || t.if((0, Ve.not)(h), () => t.break());
  7388. }
  7389. }
  7390. function c(u, h) {
  7391. return (0, Ve._)`!${u} || !${u}[${h}]`;
  7392. }
  7393. function f(u, h) {
  7394. const y = [];
  7395. for (const _ in u)
  7396. u[_] === !0 && y.push((0, Ve._)`${h} !== ${_}`);
  7397. return (0, Ve.and)(...y);
  7398. }
  7399. }
  7400. };
  7401. ms.default = gy;
  7402. var ys = {};
  7403. Object.defineProperty(ys, "__esModule", { value: !0 });
  7404. const Qe = D, Co = I, $y = {
  7405. message: ({ params: { len: e } }) => (0, Qe.str)`must NOT have more than ${e} items`,
  7406. params: ({ params: { len: e } }) => (0, Qe._)`{limit: ${e}}`
  7407. }, _y = {
  7408. keyword: "unevaluatedItems",
  7409. type: "array",
  7410. schemaType: ["boolean", "object"],
  7411. error: $y,
  7412. code(e) {
  7413. const { gen: t, schema: r, data: n, it: i } = e, s = i.items || 0;
  7414. if (s === !0)
  7415. return;
  7416. const o = t.const("len", (0, Qe._)`${n}.length`);
  7417. if (r === !1)
  7418. e.setParams({ len: s }), e.fail((0, Qe._)`${o} > ${s}`);
  7419. else if (typeof r == "object" && !(0, Co.alwaysValidSchema)(i, r)) {
  7420. const l = t.var("valid", (0, Qe._)`${o} <= ${s}`);
  7421. t.if((0, Qe.not)(l), () => a(l, s)), e.ok(l);
  7422. }
  7423. i.items = !0;
  7424. function a(l, c) {
  7425. t.forRange("i", c, o, (f) => {
  7426. e.subschema({ keyword: "unevaluatedItems", dataProp: f, dataPropType: Co.Type.Num }, l), i.allErrors || t.if((0, Qe.not)(l), () => t.break());
  7427. });
  7428. }
  7429. }
  7430. };
  7431. ys.default = _y;
  7432. Object.defineProperty(hs, "__esModule", { value: !0 });
  7433. const vy = ms, by = ys, wy = [vy.default, by.default];
  7434. hs.default = wy;
  7435. var _t = {};
  7436. Object.defineProperty(_t, "__esModule", { value: !0 });
  7437. _t.contentVocabulary = _t.metadataVocabulary = void 0;
  7438. _t.metadataVocabulary = [
  7439. "title",
  7440. "description",
  7441. "default",
  7442. "deprecated",
  7443. "readOnly",
  7444. "writeOnly",
  7445. "examples"
  7446. ];
  7447. _t.contentVocabulary = [
  7448. "contentMediaType",
  7449. "contentEncoding",
  7450. "contentSchema"
  7451. ];
  7452. Object.defineProperty(rs, "__esModule", { value: !0 });
  7453. const Py = ns, Oy = ss, Ey = Zr, Sy = as, xy = us, jy = hs, Ay = rn, Io = _t, Cy = [
  7454. Sy.default,
  7455. Py.default,
  7456. Oy.default,
  7457. (0, Ey.default)(!0),
  7458. Ay.default,
  7459. Io.metadataVocabulary,
  7460. Io.contentVocabulary,
  7461. xy.default,
  7462. jy.default
  7463. ];
  7464. rs.default = Cy;
  7465. var gs = {};
  7466. const Iy = "https://json-schema.org/draft/2020-12/schema", Ty = "https://json-schema.org/draft/2020-12/schema", Ry = {
  7467. "https://json-schema.org/draft/2020-12/vocab/core": !0,
  7468. "https://json-schema.org/draft/2020-12/vocab/applicator": !0,
  7469. "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0,
  7470. "https://json-schema.org/draft/2020-12/vocab/validation": !0,
  7471. "https://json-schema.org/draft/2020-12/vocab/meta-data": !0,
  7472. "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0,
  7473. "https://json-schema.org/draft/2020-12/vocab/content": !0
  7474. }, ky = "meta", Ny = "Core and Validation specifications meta-schema", My = [
  7475. {
  7476. $ref: "meta/core"
  7477. },
  7478. {
  7479. $ref: "meta/applicator"
  7480. },
  7481. {
  7482. $ref: "meta/unevaluated"
  7483. },
  7484. {
  7485. $ref: "meta/validation"
  7486. },
  7487. {
  7488. $ref: "meta/meta-data"
  7489. },
  7490. {
  7491. $ref: "meta/format-annotation"
  7492. },
  7493. {
  7494. $ref: "meta/content"
  7495. }
  7496. ], Dy = [
  7497. "object",
  7498. "boolean"
  7499. ], qy = "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", Fy = {
  7500. definitions: {
  7501. $comment: '"definitions" has been replaced by "$defs".',
  7502. type: "object",
  7503. additionalProperties: {
  7504. $dynamicRef: "#meta"
  7505. },
  7506. deprecated: !0,
  7507. default: {}
  7508. },
  7509. dependencies: {
  7510. $comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',
  7511. type: "object",
  7512. additionalProperties: {
  7513. anyOf: [
  7514. {
  7515. $dynamicRef: "#meta"
  7516. },
  7517. {
  7518. $ref: "meta/validation#/$defs/stringArray"
  7519. }
  7520. ]
  7521. },
  7522. deprecated: !0,
  7523. default: {}
  7524. },
  7525. $recursiveAnchor: {
  7526. $comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".',
  7527. $ref: "meta/core#/$defs/anchorString",
  7528. deprecated: !0
  7529. },
  7530. $recursiveRef: {
  7531. $comment: '"$recursiveRef" has been replaced by "$dynamicRef".',
  7532. $ref: "meta/core#/$defs/uriReferenceString",
  7533. deprecated: !0
  7534. }
  7535. }, Vy = {
  7536. $schema: Iy,
  7537. $id: Ty,
  7538. $vocabulary: Ry,
  7539. $dynamicAnchor: ky,
  7540. title: Ny,
  7541. allOf: My,
  7542. type: Dy,
  7543. $comment: qy,
  7544. properties: Fy
  7545. }, Ly = "https://json-schema.org/draft/2020-12/schema", Hy = "https://json-schema.org/draft/2020-12/meta/applicator", Uy = {
  7546. "https://json-schema.org/draft/2020-12/vocab/applicator": !0
  7547. }, zy = "meta", Gy = "Applicator vocabulary meta-schema", By = [
  7548. "object",
  7549. "boolean"
  7550. ], Ky = {
  7551. prefixItems: {
  7552. $ref: "#/$defs/schemaArray"
  7553. },
  7554. items: {
  7555. $dynamicRef: "#meta"
  7556. },
  7557. contains: {
  7558. $dynamicRef: "#meta"
  7559. },
  7560. additionalProperties: {
  7561. $dynamicRef: "#meta"
  7562. },
  7563. properties: {
  7564. type: "object",
  7565. additionalProperties: {
  7566. $dynamicRef: "#meta"
  7567. },
  7568. default: {}
  7569. },
  7570. patternProperties: {
  7571. type: "object",
  7572. additionalProperties: {
  7573. $dynamicRef: "#meta"
  7574. },
  7575. propertyNames: {
  7576. format: "regex"
  7577. },
  7578. default: {}
  7579. },
  7580. dependentSchemas: {
  7581. type: "object",
  7582. additionalProperties: {
  7583. $dynamicRef: "#meta"
  7584. },
  7585. default: {}
  7586. },
  7587. propertyNames: {
  7588. $dynamicRef: "#meta"
  7589. },
  7590. if: {
  7591. $dynamicRef: "#meta"
  7592. },
  7593. then: {
  7594. $dynamicRef: "#meta"
  7595. },
  7596. else: {
  7597. $dynamicRef: "#meta"
  7598. },
  7599. allOf: {
  7600. $ref: "#/$defs/schemaArray"
  7601. },
  7602. anyOf: {
  7603. $ref: "#/$defs/schemaArray"
  7604. },
  7605. oneOf: {
  7606. $ref: "#/$defs/schemaArray"
  7607. },
  7608. not: {
  7609. $dynamicRef: "#meta"
  7610. }
  7611. }, Wy = {
  7612. schemaArray: {
  7613. type: "array",
  7614. minItems: 1,
  7615. items: {
  7616. $dynamicRef: "#meta"
  7617. }
  7618. }
  7619. }, Jy = {
  7620. $schema: Ly,
  7621. $id: Hy,
  7622. $vocabulary: Uy,
  7623. $dynamicAnchor: zy,
  7624. title: Gy,
  7625. type: By,
  7626. properties: Ky,
  7627. $defs: Wy
  7628. }, Yy = "https://json-schema.org/draft/2020-12/schema", Xy = "https://json-schema.org/draft/2020-12/meta/unevaluated", Qy = {
  7629. "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0
  7630. }, Zy = "meta", eg = "Unevaluated applicator vocabulary meta-schema", tg = [
  7631. "object",
  7632. "boolean"
  7633. ], rg = {
  7634. unevaluatedItems: {
  7635. $dynamicRef: "#meta"
  7636. },
  7637. unevaluatedProperties: {
  7638. $dynamicRef: "#meta"
  7639. }
  7640. }, ng = {
  7641. $schema: Yy,
  7642. $id: Xy,
  7643. $vocabulary: Qy,
  7644. $dynamicAnchor: Zy,
  7645. title: eg,
  7646. type: tg,
  7647. properties: rg
  7648. }, ig = "https://json-schema.org/draft/2020-12/schema", sg = "https://json-schema.org/draft/2020-12/meta/content", og = {
  7649. "https://json-schema.org/draft/2020-12/vocab/content": !0
  7650. }, ag = "meta", lg = "Content vocabulary meta-schema", cg = [
  7651. "object",
  7652. "boolean"
  7653. ], ug = {
  7654. contentEncoding: {
  7655. type: "string"
  7656. },
  7657. contentMediaType: {
  7658. type: "string"
  7659. },
  7660. contentSchema: {
  7661. $dynamicRef: "#meta"
  7662. }
  7663. }, fg = {
  7664. $schema: ig,
  7665. $id: sg,
  7666. $vocabulary: og,
  7667. $dynamicAnchor: ag,
  7668. title: lg,
  7669. type: cg,
  7670. properties: ug
  7671. }, dg = "https://json-schema.org/draft/2020-12/schema", pg = "https://json-schema.org/draft/2020-12/meta/core", hg = {
  7672. "https://json-schema.org/draft/2020-12/vocab/core": !0
  7673. }, mg = "meta", yg = "Core vocabulary meta-schema", gg = [
  7674. "object",
  7675. "boolean"
  7676. ], $g = {
  7677. $id: {
  7678. $ref: "#/$defs/uriReferenceString",
  7679. $comment: "Non-empty fragments not allowed.",
  7680. pattern: "^[^#]*#?$"
  7681. },
  7682. $schema: {
  7683. $ref: "#/$defs/uriString"
  7684. },
  7685. $ref: {
  7686. $ref: "#/$defs/uriReferenceString"
  7687. },
  7688. $anchor: {
  7689. $ref: "#/$defs/anchorString"
  7690. },
  7691. $dynamicRef: {
  7692. $ref: "#/$defs/uriReferenceString"
  7693. },
  7694. $dynamicAnchor: {
  7695. $ref: "#/$defs/anchorString"
  7696. },
  7697. $vocabulary: {
  7698. type: "object",
  7699. propertyNames: {
  7700. $ref: "#/$defs/uriString"
  7701. },
  7702. additionalProperties: {
  7703. type: "boolean"
  7704. }
  7705. },
  7706. $comment: {
  7707. type: "string"
  7708. },
  7709. $defs: {
  7710. type: "object",
  7711. additionalProperties: {
  7712. $dynamicRef: "#meta"
  7713. }
  7714. }
  7715. }, _g = {
  7716. anchorString: {
  7717. type: "string",
  7718. pattern: "^[A-Za-z_][-A-Za-z0-9._]*$"
  7719. },
  7720. uriString: {
  7721. type: "string",
  7722. format: "uri"
  7723. },
  7724. uriReferenceString: {
  7725. type: "string",
  7726. format: "uri-reference"
  7727. }
  7728. }, vg = {
  7729. $schema: dg,
  7730. $id: pg,
  7731. $vocabulary: hg,
  7732. $dynamicAnchor: mg,
  7733. title: yg,
  7734. type: gg,
  7735. properties: $g,
  7736. $defs: _g
  7737. }, bg = "https://json-schema.org/draft/2020-12/schema", wg = "https://json-schema.org/draft/2020-12/meta/format-annotation", Pg = {
  7738. "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0
  7739. }, Og = "meta", Eg = "Format vocabulary meta-schema for annotation results", Sg = [
  7740. "object",
  7741. "boolean"
  7742. ], xg = {
  7743. format: {
  7744. type: "string"
  7745. }
  7746. }, jg = {
  7747. $schema: bg,
  7748. $id: wg,
  7749. $vocabulary: Pg,
  7750. $dynamicAnchor: Og,
  7751. title: Eg,
  7752. type: Sg,
  7753. properties: xg
  7754. }, Ag = "https://json-schema.org/draft/2020-12/schema", Cg = "https://json-schema.org/draft/2020-12/meta/meta-data", Ig = {
  7755. "https://json-schema.org/draft/2020-12/vocab/meta-data": !0
  7756. }, Tg = "meta", Rg = "Meta-data vocabulary meta-schema", kg = [
  7757. "object",
  7758. "boolean"
  7759. ], Ng = {
  7760. title: {
  7761. type: "string"
  7762. },
  7763. description: {
  7764. type: "string"
  7765. },
  7766. default: !0,
  7767. deprecated: {
  7768. type: "boolean",
  7769. default: !1
  7770. },
  7771. readOnly: {
  7772. type: "boolean",
  7773. default: !1
  7774. },
  7775. writeOnly: {
  7776. type: "boolean",
  7777. default: !1
  7778. },
  7779. examples: {
  7780. type: "array",
  7781. items: !0
  7782. }
  7783. }, Mg = {
  7784. $schema: Ag,
  7785. $id: Cg,
  7786. $vocabulary: Ig,
  7787. $dynamicAnchor: Tg,
  7788. title: Rg,
  7789. type: kg,
  7790. properties: Ng
  7791. }, Dg = "https://json-schema.org/draft/2020-12/schema", qg = "https://json-schema.org/draft/2020-12/meta/validation", Fg = {
  7792. "https://json-schema.org/draft/2020-12/vocab/validation": !0
  7793. }, Vg = "meta", Lg = "Validation vocabulary meta-schema", Hg = [
  7794. "object",
  7795. "boolean"
  7796. ], Ug = {
  7797. type: {
  7798. anyOf: [
  7799. {
  7800. $ref: "#/$defs/simpleTypes"
  7801. },
  7802. {
  7803. type: "array",
  7804. items: {
  7805. $ref: "#/$defs/simpleTypes"
  7806. },
  7807. minItems: 1,
  7808. uniqueItems: !0
  7809. }
  7810. ]
  7811. },
  7812. const: !0,
  7813. enum: {
  7814. type: "array",
  7815. items: !0
  7816. },
  7817. multipleOf: {
  7818. type: "number",
  7819. exclusiveMinimum: 0
  7820. },
  7821. maximum: {
  7822. type: "number"
  7823. },
  7824. exclusiveMaximum: {
  7825. type: "number"
  7826. },
  7827. minimum: {
  7828. type: "number"
  7829. },
  7830. exclusiveMinimum: {
  7831. type: "number"
  7832. },
  7833. maxLength: {
  7834. $ref: "#/$defs/nonNegativeInteger"
  7835. },
  7836. minLength: {
  7837. $ref: "#/$defs/nonNegativeIntegerDefault0"
  7838. },
  7839. pattern: {
  7840. type: "string",
  7841. format: "regex"
  7842. },
  7843. maxItems: {
  7844. $ref: "#/$defs/nonNegativeInteger"
  7845. },
  7846. minItems: {
  7847. $ref: "#/$defs/nonNegativeIntegerDefault0"
  7848. },
  7849. uniqueItems: {
  7850. type: "boolean",
  7851. default: !1
  7852. },
  7853. maxContains: {
  7854. $ref: "#/$defs/nonNegativeInteger"
  7855. },
  7856. minContains: {
  7857. $ref: "#/$defs/nonNegativeInteger",
  7858. default: 1
  7859. },
  7860. maxProperties: {
  7861. $ref: "#/$defs/nonNegativeInteger"
  7862. },
  7863. minProperties: {
  7864. $ref: "#/$defs/nonNegativeIntegerDefault0"
  7865. },
  7866. required: {
  7867. $ref: "#/$defs/stringArray"
  7868. },
  7869. dependentRequired: {
  7870. type: "object",
  7871. additionalProperties: {
  7872. $ref: "#/$defs/stringArray"
  7873. }
  7874. }
  7875. }, zg = {
  7876. nonNegativeInteger: {
  7877. type: "integer",
  7878. minimum: 0
  7879. },
  7880. nonNegativeIntegerDefault0: {
  7881. $ref: "#/$defs/nonNegativeInteger",
  7882. default: 0
  7883. },
  7884. simpleTypes: {
  7885. enum: [
  7886. "array",
  7887. "boolean",
  7888. "integer",
  7889. "null",
  7890. "number",
  7891. "object",
  7892. "string"
  7893. ]
  7894. },
  7895. stringArray: {
  7896. type: "array",
  7897. items: {
  7898. type: "string"
  7899. },
  7900. uniqueItems: !0,
  7901. default: []
  7902. }
  7903. }, Gg = {
  7904. $schema: Dg,
  7905. $id: qg,
  7906. $vocabulary: Fg,
  7907. $dynamicAnchor: Vg,
  7908. title: Lg,
  7909. type: Hg,
  7910. properties: Ug,
  7911. $defs: zg
  7912. };
  7913. Object.defineProperty(gs, "__esModule", { value: !0 });
  7914. const Bg = Vy, Kg = Jy, Wg = ng, Jg = fg, Yg = vg, Xg = jg, Qg = Mg, Zg = Gg, e$ = ["/properties"];
  7915. function t$(e) {
  7916. return [
  7917. Bg,
  7918. Kg,
  7919. Wg,
  7920. Jg,
  7921. Yg,
  7922. t(this, Xg),
  7923. Qg,
  7924. t(this, Zg)
  7925. ].forEach((r) => this.addMetaSchema(r, void 0, !1)), this;
  7926. function t(r, n) {
  7927. return e ? r.$dataMetaSchema(n, e$) : n;
  7928. }
  7929. }
  7930. gs.default = t$;
  7931. (function(e, t) {
  7932. Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = t.Ajv2020 = void 0;
  7933. const r = mt, n = rs, i = nn, s = gs, o = "https://json-schema.org/draft/2020-12/schema";
  7934. class a extends r.default {
  7935. constructor(y = {}) {
  7936. super({
  7937. ...y,
  7938. dynamicRef: !0,
  7939. next: !0,
  7940. unevaluated: !0
  7941. });
  7942. }
  7943. _addVocabularies() {
  7944. super._addVocabularies(), n.default.forEach((y) => this.addVocabulary(y)), this.opts.discriminator && this.addKeyword(i.default);
  7945. }
  7946. _addDefaultMetaSchema() {
  7947. super._addDefaultMetaSchema();
  7948. const { $data: y, meta: _ } = this.opts;
  7949. _ && (s.default.call(this, y), this.refs["http://json-schema.org/schema"] = o);
  7950. }
  7951. defaultMeta() {
  7952. return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(o) ? o : void 0);
  7953. }
  7954. }
  7955. t.Ajv2020 = a, e.exports = t = a, e.exports.Ajv2020 = a, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = a;
  7956. var l = $e;
  7957. Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
  7958. return l.KeywordCxt;
  7959. } });
  7960. var c = D;
  7961. Object.defineProperty(t, "_", { enumerable: !0, get: function() {
  7962. return c._;
  7963. } }), Object.defineProperty(t, "str", { enumerable: !0, get: function() {
  7964. return c.str;
  7965. } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() {
  7966. return c.stringify;
  7967. } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() {
  7968. return c.nil;
  7969. } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() {
  7970. return c.Name;
  7971. } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
  7972. return c.CodeGen;
  7973. } });
  7974. var f = Qt;
  7975. Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
  7976. return f.default;
  7977. } });
  7978. var u = wt;
  7979. Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
  7980. return u.default;
  7981. } });
  7982. })(si, si.exports);
  7983. var r$ = si.exports, oi = { exports: {} };
  7984. const n$ = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/apiDeclaration.json#", i$ = "http://json-schema.org/draft-04/schema#", s$ = "object", o$ = [
  7985. "swaggerVersion",
  7986. "basePath",
  7987. "apis"
  7988. ], a$ = {
  7989. swaggerVersion: {
  7990. enum: [
  7991. "1.2"
  7992. ]
  7993. },
  7994. apiVersion: {
  7995. type: "string"
  7996. },
  7997. basePath: {
  7998. type: "string",
  7999. format: "uri",
  8000. pattern: "^https?://"
  8001. },
  8002. resourcePath: {
  8003. type: "string",
  8004. format: "uri",
  8005. pattern: "^/"
  8006. },
  8007. apis: {
  8008. type: "array",
  8009. items: {
  8010. $ref: "#/definitions/apiObject"
  8011. }
  8012. },
  8013. models: {
  8014. type: "object",
  8015. additionalProperties: {
  8016. $ref: "modelsObject.json#"
  8017. }
  8018. },
  8019. produces: {
  8020. $ref: "#/definitions/mimeTypeArray"
  8021. },
  8022. consumes: {
  8023. $ref: "#/definitions/mimeTypeArray"
  8024. },
  8025. authorizations: {
  8026. $ref: "authorizationObject.json#"
  8027. }
  8028. }, l$ = !1, c$ = {
  8029. apiObject: {
  8030. type: "object",
  8031. required: [
  8032. "path",
  8033. "operations"
  8034. ],
  8035. properties: {
  8036. path: {
  8037. type: "string",
  8038. format: "uri-template",
  8039. pattern: "^/"
  8040. },
  8041. description: {
  8042. type: "string"
  8043. },
  8044. operations: {
  8045. type: "array",
  8046. items: {
  8047. $ref: "operationObject.json#"
  8048. }
  8049. }
  8050. },
  8051. additionalProperties: !1
  8052. },
  8053. mimeTypeArray: {
  8054. type: "array",
  8055. items: {
  8056. type: "string",
  8057. format: "mime-type"
  8058. },
  8059. uniqueItems: !0
  8060. }
  8061. }, u$ = {
  8062. id: n$,
  8063. $schema: i$,
  8064. type: s$,
  8065. required: o$,
  8066. properties: a$,
  8067. additionalProperties: l$,
  8068. definitions: c$
  8069. }, f$ = "A JSON Schema for Swagger 2.0 API.", d$ = "http://swagger.io/v2/schema.json#", p$ = "http://json-schema.org/draft-04/schema#", h$ = "object", m$ = [
  8070. "swagger",
  8071. "info",
  8072. "paths"
  8073. ], y$ = !1, g$ = {
  8074. "^x-": {
  8075. $ref: "#/definitions/vendorExtension"
  8076. }
  8077. }, $$ = {
  8078. swagger: {
  8079. type: "string",
  8080. enum: [
  8081. "2.0"
  8082. ],
  8083. description: "The Swagger version of this document."
  8084. },
  8085. info: {
  8086. $ref: "#/definitions/info"
  8087. },
  8088. host: {
  8089. type: "string",
  8090. pattern: "^[^{}/ :\\\\]+(?::\\d+)?$",
  8091. description: "The host (name or ip) of the API. Example: 'swagger.io'"
  8092. },
  8093. basePath: {
  8094. type: "string",
  8095. pattern: "^/",
  8096. description: "The base path to the API. Example: '/api'."
  8097. },
  8098. schemes: {
  8099. $ref: "#/definitions/schemesList"
  8100. },
  8101. consumes: {
  8102. description: "A list of MIME types accepted by the API.",
  8103. allOf: [
  8104. {
  8105. $ref: "#/definitions/mediaTypeList"
  8106. }
  8107. ]
  8108. },
  8109. produces: {
  8110. description: "A list of MIME types the API can produce.",
  8111. allOf: [
  8112. {
  8113. $ref: "#/definitions/mediaTypeList"
  8114. }
  8115. ]
  8116. },
  8117. paths: {
  8118. $ref: "#/definitions/paths"
  8119. },
  8120. definitions: {
  8121. $ref: "#/definitions/definitions"
  8122. },
  8123. parameters: {
  8124. $ref: "#/definitions/parameterDefinitions"
  8125. },
  8126. responses: {
  8127. $ref: "#/definitions/responseDefinitions"
  8128. },
  8129. security: {
  8130. $ref: "#/definitions/security"
  8131. },
  8132. securityDefinitions: {
  8133. $ref: "#/definitions/securityDefinitions"
  8134. },
  8135. tags: {
  8136. type: "array",
  8137. items: {
  8138. $ref: "#/definitions/tag"
  8139. },
  8140. uniqueItems: !0
  8141. },
  8142. externalDocs: {
  8143. $ref: "#/definitions/externalDocs"
  8144. }
  8145. }, _$ = {
  8146. info: {
  8147. type: "object",
  8148. description: "General information about the API.",
  8149. required: [
  8150. "version",
  8151. "title"
  8152. ],
  8153. additionalProperties: !1,
  8154. patternProperties: {
  8155. "^x-": {
  8156. $ref: "#/definitions/vendorExtension"
  8157. }
  8158. },
  8159. properties: {
  8160. title: {
  8161. type: "string",
  8162. description: "A unique and precise title of the API."
  8163. },
  8164. version: {
  8165. type: "string",
  8166. description: "A semantic version number of the API."
  8167. },
  8168. description: {
  8169. type: "string",
  8170. description: "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."
  8171. },
  8172. termsOfService: {
  8173. type: "string",
  8174. description: "The terms of service for the API."
  8175. },
  8176. contact: {
  8177. $ref: "#/definitions/contact"
  8178. },
  8179. license: {
  8180. $ref: "#/definitions/license"
  8181. }
  8182. }
  8183. },
  8184. contact: {
  8185. type: "object",
  8186. description: "Contact information for the owners of the API.",
  8187. additionalProperties: !1,
  8188. properties: {
  8189. name: {
  8190. type: "string",
  8191. description: "The identifying name of the contact person/organization."
  8192. },
  8193. url: {
  8194. type: "string",
  8195. description: "The URL pointing to the contact information.",
  8196. format: "uri"
  8197. },
  8198. email: {
  8199. type: "string",
  8200. description: "The email address of the contact person/organization.",
  8201. format: "email"
  8202. }
  8203. },
  8204. patternProperties: {
  8205. "^x-": {
  8206. $ref: "#/definitions/vendorExtension"
  8207. }
  8208. }
  8209. },
  8210. license: {
  8211. type: "object",
  8212. required: [
  8213. "name"
  8214. ],
  8215. additionalProperties: !1,
  8216. properties: {
  8217. name: {
  8218. type: "string",
  8219. description: "The name of the license type. It's encouraged to use an OSI compatible license."
  8220. },
  8221. url: {
  8222. type: "string",
  8223. description: "The URL pointing to the license.",
  8224. format: "uri"
  8225. }
  8226. },
  8227. patternProperties: {
  8228. "^x-": {
  8229. $ref: "#/definitions/vendorExtension"
  8230. }
  8231. }
  8232. },
  8233. paths: {
  8234. type: "object",
  8235. description: "Relative paths to the individual endpoints. They must be relative to the 'basePath'.",
  8236. patternProperties: {
  8237. "^x-": {
  8238. $ref: "#/definitions/vendorExtension"
  8239. },
  8240. "^/": {
  8241. $ref: "#/definitions/pathItem"
  8242. }
  8243. },
  8244. additionalProperties: !1
  8245. },
  8246. definitions: {
  8247. type: "object",
  8248. additionalProperties: {
  8249. $ref: "#/definitions/schema"
  8250. },
  8251. description: "One or more JSON objects describing the schemas being consumed and produced by the API."
  8252. },
  8253. parameterDefinitions: {
  8254. type: "object",
  8255. additionalProperties: {
  8256. $ref: "#/definitions/parameter"
  8257. },
  8258. description: "One or more JSON representations for parameters"
  8259. },
  8260. responseDefinitions: {
  8261. type: "object",
  8262. additionalProperties: {
  8263. $ref: "#/definitions/response"
  8264. },
  8265. description: "One or more JSON representations for responses"
  8266. },
  8267. externalDocs: {
  8268. type: "object",
  8269. additionalProperties: !1,
  8270. description: "information about external documentation",
  8271. required: [
  8272. "url"
  8273. ],
  8274. properties: {
  8275. description: {
  8276. type: "string"
  8277. },
  8278. url: {
  8279. type: "string",
  8280. format: "uri"
  8281. }
  8282. },
  8283. patternProperties: {
  8284. "^x-": {
  8285. $ref: "#/definitions/vendorExtension"
  8286. }
  8287. }
  8288. },
  8289. examples: {
  8290. type: "object",
  8291. additionalProperties: !0
  8292. },
  8293. mimeType: {
  8294. type: "string",
  8295. description: "The MIME type of the HTTP message."
  8296. },
  8297. operation: {
  8298. type: "object",
  8299. required: [
  8300. "responses"
  8301. ],
  8302. additionalProperties: !1,
  8303. patternProperties: {
  8304. "^x-": {
  8305. $ref: "#/definitions/vendorExtension"
  8306. }
  8307. },
  8308. properties: {
  8309. tags: {
  8310. type: "array",
  8311. items: {
  8312. type: "string"
  8313. },
  8314. uniqueItems: !0
  8315. },
  8316. summary: {
  8317. type: "string",
  8318. description: "A brief summary of the operation."
  8319. },
  8320. description: {
  8321. type: "string",
  8322. description: "A longer description of the operation, GitHub Flavored Markdown is allowed."
  8323. },
  8324. externalDocs: {
  8325. $ref: "#/definitions/externalDocs"
  8326. },
  8327. operationId: {
  8328. type: "string",
  8329. description: "A unique identifier of the operation."
  8330. },
  8331. produces: {
  8332. description: "A list of MIME types the API can produce.",
  8333. allOf: [
  8334. {
  8335. $ref: "#/definitions/mediaTypeList"
  8336. }
  8337. ]
  8338. },
  8339. consumes: {
  8340. description: "A list of MIME types the API can consume.",
  8341. allOf: [
  8342. {
  8343. $ref: "#/definitions/mediaTypeList"
  8344. }
  8345. ]
  8346. },
  8347. parameters: {
  8348. $ref: "#/definitions/parametersList"
  8349. },
  8350. responses: {
  8351. $ref: "#/definitions/responses"
  8352. },
  8353. schemes: {
  8354. $ref: "#/definitions/schemesList"
  8355. },
  8356. deprecated: {
  8357. type: "boolean",
  8358. default: !1
  8359. },
  8360. security: {
  8361. $ref: "#/definitions/security"
  8362. }
  8363. }
  8364. },
  8365. pathItem: {
  8366. type: "object",
  8367. additionalProperties: !1,
  8368. patternProperties: {
  8369. "^x-": {
  8370. $ref: "#/definitions/vendorExtension"
  8371. }
  8372. },
  8373. properties: {
  8374. $ref: {
  8375. type: "string"
  8376. },
  8377. get: {
  8378. $ref: "#/definitions/operation"
  8379. },
  8380. put: {
  8381. $ref: "#/definitions/operation"
  8382. },
  8383. post: {
  8384. $ref: "#/definitions/operation"
  8385. },
  8386. delete: {
  8387. $ref: "#/definitions/operation"
  8388. },
  8389. options: {
  8390. $ref: "#/definitions/operation"
  8391. },
  8392. head: {
  8393. $ref: "#/definitions/operation"
  8394. },
  8395. patch: {
  8396. $ref: "#/definitions/operation"
  8397. },
  8398. parameters: {
  8399. $ref: "#/definitions/parametersList"
  8400. }
  8401. }
  8402. },
  8403. responses: {
  8404. type: "object",
  8405. description: "Response objects names can either be any valid HTTP status code or 'default'.",
  8406. minProperties: 1,
  8407. additionalProperties: !1,
  8408. patternProperties: {
  8409. "^([0-9]{3})$|^(default)$": {
  8410. $ref: "#/definitions/responseValue"
  8411. },
  8412. "^x-": {
  8413. $ref: "#/definitions/vendorExtension"
  8414. }
  8415. },
  8416. not: {
  8417. type: "object",
  8418. additionalProperties: !1,
  8419. patternProperties: {
  8420. "^x-": {
  8421. $ref: "#/definitions/vendorExtension"
  8422. }
  8423. }
  8424. }
  8425. },
  8426. responseValue: {
  8427. oneOf: [
  8428. {
  8429. $ref: "#/definitions/response"
  8430. },
  8431. {
  8432. $ref: "#/definitions/jsonReference"
  8433. }
  8434. ]
  8435. },
  8436. response: {
  8437. type: "object",
  8438. required: [
  8439. "description"
  8440. ],
  8441. properties: {
  8442. description: {
  8443. type: "string"
  8444. },
  8445. schema: {
  8446. oneOf: [
  8447. {
  8448. $ref: "#/definitions/schema"
  8449. },
  8450. {
  8451. $ref: "#/definitions/fileSchema"
  8452. }
  8453. ]
  8454. },
  8455. headers: {
  8456. $ref: "#/definitions/headers"
  8457. },
  8458. examples: {
  8459. $ref: "#/definitions/examples"
  8460. }
  8461. },
  8462. additionalProperties: !1,
  8463. patternProperties: {
  8464. "^x-": {
  8465. $ref: "#/definitions/vendorExtension"
  8466. }
  8467. }
  8468. },
  8469. headers: {
  8470. type: "object",
  8471. additionalProperties: {
  8472. $ref: "#/definitions/header"
  8473. }
  8474. },
  8475. header: {
  8476. type: "object",
  8477. additionalProperties: !1,
  8478. required: [
  8479. "type"
  8480. ],
  8481. properties: {
  8482. type: {
  8483. type: "string",
  8484. enum: [
  8485. "string",
  8486. "number",
  8487. "integer",
  8488. "boolean",
  8489. "array"
  8490. ]
  8491. },
  8492. format: {
  8493. type: "string"
  8494. },
  8495. items: {
  8496. $ref: "#/definitions/primitivesItems"
  8497. },
  8498. collectionFormat: {
  8499. $ref: "#/definitions/collectionFormat"
  8500. },
  8501. default: {
  8502. $ref: "#/definitions/default"
  8503. },
  8504. maximum: {
  8505. $ref: "#/definitions/maximum"
  8506. },
  8507. exclusiveMaximum: {
  8508. $ref: "#/definitions/exclusiveMaximum"
  8509. },
  8510. minimum: {
  8511. $ref: "#/definitions/minimum"
  8512. },
  8513. exclusiveMinimum: {
  8514. $ref: "#/definitions/exclusiveMinimum"
  8515. },
  8516. maxLength: {
  8517. $ref: "#/definitions/maxLength"
  8518. },
  8519. minLength: {
  8520. $ref: "#/definitions/minLength"
  8521. },
  8522. pattern: {
  8523. $ref: "#/definitions/pattern"
  8524. },
  8525. maxItems: {
  8526. $ref: "#/definitions/maxItems"
  8527. },
  8528. minItems: {
  8529. $ref: "#/definitions/minItems"
  8530. },
  8531. uniqueItems: {
  8532. $ref: "#/definitions/uniqueItems"
  8533. },
  8534. enum: {
  8535. $ref: "#/definitions/enum"
  8536. },
  8537. multipleOf: {
  8538. $ref: "#/definitions/multipleOf"
  8539. },
  8540. description: {
  8541. type: "string"
  8542. }
  8543. },
  8544. patternProperties: {
  8545. "^x-": {
  8546. $ref: "#/definitions/vendorExtension"
  8547. }
  8548. }
  8549. },
  8550. vendorExtension: {
  8551. description: "Any property starting with x- is valid.",
  8552. additionalProperties: !0,
  8553. additionalItems: !0
  8554. },
  8555. bodyParameter: {
  8556. type: "object",
  8557. required: [
  8558. "name",
  8559. "in",
  8560. "schema"
  8561. ],
  8562. patternProperties: {
  8563. "^x-": {
  8564. $ref: "#/definitions/vendorExtension"
  8565. }
  8566. },
  8567. properties: {
  8568. description: {
  8569. type: "string",
  8570. description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
  8571. },
  8572. name: {
  8573. type: "string",
  8574. description: "The name of the parameter."
  8575. },
  8576. in: {
  8577. type: "string",
  8578. description: "Determines the location of the parameter.",
  8579. enum: [
  8580. "body"
  8581. ]
  8582. },
  8583. required: {
  8584. type: "boolean",
  8585. description: "Determines whether or not this parameter is required or optional.",
  8586. default: !1
  8587. },
  8588. schema: {
  8589. $ref: "#/definitions/schema"
  8590. }
  8591. },
  8592. additionalProperties: !1
  8593. },
  8594. headerParameterSubSchema: {
  8595. additionalProperties: !1,
  8596. patternProperties: {
  8597. "^x-": {
  8598. $ref: "#/definitions/vendorExtension"
  8599. }
  8600. },
  8601. properties: {
  8602. required: {
  8603. type: "boolean",
  8604. description: "Determines whether or not this parameter is required or optional.",
  8605. default: !1
  8606. },
  8607. in: {
  8608. type: "string",
  8609. description: "Determines the location of the parameter.",
  8610. enum: [
  8611. "header"
  8612. ]
  8613. },
  8614. description: {
  8615. type: "string",
  8616. description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
  8617. },
  8618. name: {
  8619. type: "string",
  8620. description: "The name of the parameter."
  8621. },
  8622. type: {
  8623. type: "string",
  8624. enum: [
  8625. "string",
  8626. "number",
  8627. "boolean",
  8628. "integer",
  8629. "array"
  8630. ]
  8631. },
  8632. format: {
  8633. type: "string"
  8634. },
  8635. items: {
  8636. $ref: "#/definitions/primitivesItems"
  8637. },
  8638. collectionFormat: {
  8639. $ref: "#/definitions/collectionFormat"
  8640. },
  8641. default: {
  8642. $ref: "#/definitions/default"
  8643. },
  8644. maximum: {
  8645. $ref: "#/definitions/maximum"
  8646. },
  8647. exclusiveMaximum: {
  8648. $ref: "#/definitions/exclusiveMaximum"
  8649. },
  8650. minimum: {
  8651. $ref: "#/definitions/minimum"
  8652. },
  8653. exclusiveMinimum: {
  8654. $ref: "#/definitions/exclusiveMinimum"
  8655. },
  8656. maxLength: {
  8657. $ref: "#/definitions/maxLength"
  8658. },
  8659. minLength: {
  8660. $ref: "#/definitions/minLength"
  8661. },
  8662. pattern: {
  8663. $ref: "#/definitions/pattern"
  8664. },
  8665. maxItems: {
  8666. $ref: "#/definitions/maxItems"
  8667. },
  8668. minItems: {
  8669. $ref: "#/definitions/minItems"
  8670. },
  8671. uniqueItems: {
  8672. $ref: "#/definitions/uniqueItems"
  8673. },
  8674. enum: {
  8675. $ref: "#/definitions/enum"
  8676. },
  8677. multipleOf: {
  8678. $ref: "#/definitions/multipleOf"
  8679. }
  8680. }
  8681. },
  8682. queryParameterSubSchema: {
  8683. additionalProperties: !1,
  8684. patternProperties: {
  8685. "^x-": {
  8686. $ref: "#/definitions/vendorExtension"
  8687. }
  8688. },
  8689. properties: {
  8690. required: {
  8691. type: "boolean",
  8692. description: "Determines whether or not this parameter is required or optional.",
  8693. default: !1
  8694. },
  8695. in: {
  8696. type: "string",
  8697. description: "Determines the location of the parameter.",
  8698. enum: [
  8699. "query"
  8700. ]
  8701. },
  8702. description: {
  8703. type: "string",
  8704. description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
  8705. },
  8706. name: {
  8707. type: "string",
  8708. description: "The name of the parameter."
  8709. },
  8710. allowEmptyValue: {
  8711. type: "boolean",
  8712. default: !1,
  8713. description: "allows sending a parameter by name only or with an empty value."
  8714. },
  8715. type: {
  8716. type: "string",
  8717. enum: [
  8718. "string",
  8719. "number",
  8720. "boolean",
  8721. "integer",
  8722. "array"
  8723. ]
  8724. },
  8725. format: {
  8726. type: "string"
  8727. },
  8728. items: {
  8729. $ref: "#/definitions/primitivesItems"
  8730. },
  8731. collectionFormat: {
  8732. $ref: "#/definitions/collectionFormatWithMulti"
  8733. },
  8734. default: {
  8735. $ref: "#/definitions/default"
  8736. },
  8737. maximum: {
  8738. $ref: "#/definitions/maximum"
  8739. },
  8740. exclusiveMaximum: {
  8741. $ref: "#/definitions/exclusiveMaximum"
  8742. },
  8743. minimum: {
  8744. $ref: "#/definitions/minimum"
  8745. },
  8746. exclusiveMinimum: {
  8747. $ref: "#/definitions/exclusiveMinimum"
  8748. },
  8749. maxLength: {
  8750. $ref: "#/definitions/maxLength"
  8751. },
  8752. minLength: {
  8753. $ref: "#/definitions/minLength"
  8754. },
  8755. pattern: {
  8756. $ref: "#/definitions/pattern"
  8757. },
  8758. maxItems: {
  8759. $ref: "#/definitions/maxItems"
  8760. },
  8761. minItems: {
  8762. $ref: "#/definitions/minItems"
  8763. },
  8764. uniqueItems: {
  8765. $ref: "#/definitions/uniqueItems"
  8766. },
  8767. enum: {
  8768. $ref: "#/definitions/enum"
  8769. },
  8770. multipleOf: {
  8771. $ref: "#/definitions/multipleOf"
  8772. }
  8773. }
  8774. },
  8775. formDataParameterSubSchema: {
  8776. additionalProperties: !1,
  8777. patternProperties: {
  8778. "^x-": {
  8779. $ref: "#/definitions/vendorExtension"
  8780. }
  8781. },
  8782. properties: {
  8783. required: {
  8784. type: "boolean",
  8785. description: "Determines whether or not this parameter is required or optional.",
  8786. default: !1
  8787. },
  8788. in: {
  8789. type: "string",
  8790. description: "Determines the location of the parameter.",
  8791. enum: [
  8792. "formData"
  8793. ]
  8794. },
  8795. description: {
  8796. type: "string",
  8797. description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
  8798. },
  8799. name: {
  8800. type: "string",
  8801. description: "The name of the parameter."
  8802. },
  8803. allowEmptyValue: {
  8804. type: "boolean",
  8805. default: !1,
  8806. description: "allows sending a parameter by name only or with an empty value."
  8807. },
  8808. type: {
  8809. type: "string",
  8810. enum: [
  8811. "string",
  8812. "number",
  8813. "boolean",
  8814. "integer",
  8815. "array",
  8816. "file"
  8817. ]
  8818. },
  8819. format: {
  8820. type: "string"
  8821. },
  8822. items: {
  8823. $ref: "#/definitions/primitivesItems"
  8824. },
  8825. collectionFormat: {
  8826. $ref: "#/definitions/collectionFormatWithMulti"
  8827. },
  8828. default: {
  8829. $ref: "#/definitions/default"
  8830. },
  8831. maximum: {
  8832. $ref: "#/definitions/maximum"
  8833. },
  8834. exclusiveMaximum: {
  8835. $ref: "#/definitions/exclusiveMaximum"
  8836. },
  8837. minimum: {
  8838. $ref: "#/definitions/minimum"
  8839. },
  8840. exclusiveMinimum: {
  8841. $ref: "#/definitions/exclusiveMinimum"
  8842. },
  8843. maxLength: {
  8844. $ref: "#/definitions/maxLength"
  8845. },
  8846. minLength: {
  8847. $ref: "#/definitions/minLength"
  8848. },
  8849. pattern: {
  8850. $ref: "#/definitions/pattern"
  8851. },
  8852. maxItems: {
  8853. $ref: "#/definitions/maxItems"
  8854. },
  8855. minItems: {
  8856. $ref: "#/definitions/minItems"
  8857. },
  8858. uniqueItems: {
  8859. $ref: "#/definitions/uniqueItems"
  8860. },
  8861. enum: {
  8862. $ref: "#/definitions/enum"
  8863. },
  8864. multipleOf: {
  8865. $ref: "#/definitions/multipleOf"
  8866. }
  8867. }
  8868. },
  8869. pathParameterSubSchema: {
  8870. additionalProperties: !1,
  8871. patternProperties: {
  8872. "^x-": {
  8873. $ref: "#/definitions/vendorExtension"
  8874. }
  8875. },
  8876. required: [
  8877. "required"
  8878. ],
  8879. properties: {
  8880. required: {
  8881. type: "boolean",
  8882. enum: [
  8883. !0
  8884. ],
  8885. description: "Determines whether or not this parameter is required or optional."
  8886. },
  8887. in: {
  8888. type: "string",
  8889. description: "Determines the location of the parameter.",
  8890. enum: [
  8891. "path"
  8892. ]
  8893. },
  8894. description: {
  8895. type: "string",
  8896. description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
  8897. },
  8898. name: {
  8899. type: "string",
  8900. description: "The name of the parameter."
  8901. },
  8902. type: {
  8903. type: "string",
  8904. enum: [
  8905. "string",
  8906. "number",
  8907. "boolean",
  8908. "integer",
  8909. "array"
  8910. ]
  8911. },
  8912. format: {
  8913. type: "string"
  8914. },
  8915. items: {
  8916. $ref: "#/definitions/primitivesItems"
  8917. },
  8918. collectionFormat: {
  8919. $ref: "#/definitions/collectionFormat"
  8920. },
  8921. default: {
  8922. $ref: "#/definitions/default"
  8923. },
  8924. maximum: {
  8925. $ref: "#/definitions/maximum"
  8926. },
  8927. exclusiveMaximum: {
  8928. $ref: "#/definitions/exclusiveMaximum"
  8929. },
  8930. minimum: {
  8931. $ref: "#/definitions/minimum"
  8932. },
  8933. exclusiveMinimum: {
  8934. $ref: "#/definitions/exclusiveMinimum"
  8935. },
  8936. maxLength: {
  8937. $ref: "#/definitions/maxLength"
  8938. },
  8939. minLength: {
  8940. $ref: "#/definitions/minLength"
  8941. },
  8942. pattern: {
  8943. $ref: "#/definitions/pattern"
  8944. },
  8945. maxItems: {
  8946. $ref: "#/definitions/maxItems"
  8947. },
  8948. minItems: {
  8949. $ref: "#/definitions/minItems"
  8950. },
  8951. uniqueItems: {
  8952. $ref: "#/definitions/uniqueItems"
  8953. },
  8954. enum: {
  8955. $ref: "#/definitions/enum"
  8956. },
  8957. multipleOf: {
  8958. $ref: "#/definitions/multipleOf"
  8959. }
  8960. }
  8961. },
  8962. nonBodyParameter: {
  8963. type: "object",
  8964. required: [
  8965. "name",
  8966. "in",
  8967. "type"
  8968. ],
  8969. oneOf: [
  8970. {
  8971. $ref: "#/definitions/headerParameterSubSchema"
  8972. },
  8973. {
  8974. $ref: "#/definitions/formDataParameterSubSchema"
  8975. },
  8976. {
  8977. $ref: "#/definitions/queryParameterSubSchema"
  8978. },
  8979. {
  8980. $ref: "#/definitions/pathParameterSubSchema"
  8981. }
  8982. ]
  8983. },
  8984. parameter: {
  8985. oneOf: [
  8986. {
  8987. $ref: "#/definitions/bodyParameter"
  8988. },
  8989. {
  8990. $ref: "#/definitions/nonBodyParameter"
  8991. }
  8992. ]
  8993. },
  8994. schema: {
  8995. type: "object",
  8996. description: "A deterministic version of a JSON Schema object.",
  8997. patternProperties: {
  8998. "^x-": {
  8999. $ref: "#/definitions/vendorExtension"
  9000. }
  9001. },
  9002. properties: {
  9003. $ref: {
  9004. type: "string"
  9005. },
  9006. format: {
  9007. type: "string"
  9008. },
  9009. title: {
  9010. $ref: "http://json-schema.org/draft-04/schema#/properties/title"
  9011. },
  9012. description: {
  9013. $ref: "http://json-schema.org/draft-04/schema#/properties/description"
  9014. },
  9015. default: {
  9016. $ref: "http://json-schema.org/draft-04/schema#/properties/default"
  9017. },
  9018. multipleOf: {
  9019. $ref: "http://json-schema.org/draft-04/schema#/properties/multipleOf"
  9020. },
  9021. maximum: {
  9022. $ref: "http://json-schema.org/draft-04/schema#/properties/maximum"
  9023. },
  9024. exclusiveMaximum: {
  9025. $ref: "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
  9026. },
  9027. minimum: {
  9028. $ref: "http://json-schema.org/draft-04/schema#/properties/minimum"
  9029. },
  9030. exclusiveMinimum: {
  9031. $ref: "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
  9032. },
  9033. maxLength: {
  9034. $ref: "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
  9035. },
  9036. minLength: {
  9037. $ref: "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
  9038. },
  9039. pattern: {
  9040. $ref: "http://json-schema.org/draft-04/schema#/properties/pattern"
  9041. },
  9042. maxItems: {
  9043. $ref: "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
  9044. },
  9045. minItems: {
  9046. $ref: "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
  9047. },
  9048. uniqueItems: {
  9049. $ref: "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
  9050. },
  9051. maxProperties: {
  9052. $ref: "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
  9053. },
  9054. minProperties: {
  9055. $ref: "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
  9056. },
  9057. required: {
  9058. $ref: "http://json-schema.org/draft-04/schema#/definitions/stringArray"
  9059. },
  9060. enum: {
  9061. $ref: "http://json-schema.org/draft-04/schema#/properties/enum"
  9062. },
  9063. additionalProperties: {
  9064. anyOf: [
  9065. {
  9066. $ref: "#/definitions/schema"
  9067. },
  9068. {
  9069. type: "boolean"
  9070. }
  9071. ],
  9072. default: {}
  9073. },
  9074. type: {
  9075. $ref: "http://json-schema.org/draft-04/schema#/properties/type"
  9076. },
  9077. items: {
  9078. anyOf: [
  9079. {
  9080. $ref: "#/definitions/schema"
  9081. },
  9082. {
  9083. type: "array",
  9084. minItems: 1,
  9085. items: {
  9086. $ref: "#/definitions/schema"
  9087. }
  9088. }
  9089. ],
  9090. default: {}
  9091. },
  9092. allOf: {
  9093. type: "array",
  9094. minItems: 1,
  9095. items: {
  9096. $ref: "#/definitions/schema"
  9097. }
  9098. },
  9099. properties: {
  9100. type: "object",
  9101. additionalProperties: {
  9102. $ref: "#/definitions/schema"
  9103. },
  9104. default: {}
  9105. },
  9106. discriminator: {
  9107. type: "string"
  9108. },
  9109. readOnly: {
  9110. type: "boolean",
  9111. default: !1
  9112. },
  9113. xml: {
  9114. $ref: "#/definitions/xml"
  9115. },
  9116. externalDocs: {
  9117. $ref: "#/definitions/externalDocs"
  9118. },
  9119. example: {}
  9120. },
  9121. additionalProperties: !1
  9122. },
  9123. fileSchema: {
  9124. type: "object",
  9125. description: "A deterministic version of a JSON Schema object.",
  9126. patternProperties: {
  9127. "^x-": {
  9128. $ref: "#/definitions/vendorExtension"
  9129. }
  9130. },
  9131. required: [
  9132. "type"
  9133. ],
  9134. properties: {
  9135. format: {
  9136. type: "string"
  9137. },
  9138. title: {
  9139. $ref: "http://json-schema.org/draft-04/schema#/properties/title"
  9140. },
  9141. description: {
  9142. $ref: "http://json-schema.org/draft-04/schema#/properties/description"
  9143. },
  9144. default: {
  9145. $ref: "http://json-schema.org/draft-04/schema#/properties/default"
  9146. },
  9147. required: {
  9148. $ref: "http://json-schema.org/draft-04/schema#/definitions/stringArray"
  9149. },
  9150. type: {
  9151. type: "string",
  9152. enum: [
  9153. "file"
  9154. ]
  9155. },
  9156. readOnly: {
  9157. type: "boolean",
  9158. default: !1
  9159. },
  9160. externalDocs: {
  9161. $ref: "#/definitions/externalDocs"
  9162. },
  9163. example: {}
  9164. },
  9165. additionalProperties: !1
  9166. },
  9167. primitivesItems: {
  9168. type: "object",
  9169. additionalProperties: !1,
  9170. properties: {
  9171. type: {
  9172. type: "string",
  9173. enum: [
  9174. "string",
  9175. "number",
  9176. "integer",
  9177. "boolean",
  9178. "array"
  9179. ]
  9180. },
  9181. format: {
  9182. type: "string"
  9183. },
  9184. items: {
  9185. $ref: "#/definitions/primitivesItems"
  9186. },
  9187. collectionFormat: {
  9188. $ref: "#/definitions/collectionFormat"
  9189. },
  9190. default: {
  9191. $ref: "#/definitions/default"
  9192. },
  9193. maximum: {
  9194. $ref: "#/definitions/maximum"
  9195. },
  9196. exclusiveMaximum: {
  9197. $ref: "#/definitions/exclusiveMaximum"
  9198. },
  9199. minimum: {
  9200. $ref: "#/definitions/minimum"
  9201. },
  9202. exclusiveMinimum: {
  9203. $ref: "#/definitions/exclusiveMinimum"
  9204. },
  9205. maxLength: {
  9206. $ref: "#/definitions/maxLength"
  9207. },
  9208. minLength: {
  9209. $ref: "#/definitions/minLength"
  9210. },
  9211. pattern: {
  9212. $ref: "#/definitions/pattern"
  9213. },
  9214. maxItems: {
  9215. $ref: "#/definitions/maxItems"
  9216. },
  9217. minItems: {
  9218. $ref: "#/definitions/minItems"
  9219. },
  9220. uniqueItems: {
  9221. $ref: "#/definitions/uniqueItems"
  9222. },
  9223. enum: {
  9224. $ref: "#/definitions/enum"
  9225. },
  9226. multipleOf: {
  9227. $ref: "#/definitions/multipleOf"
  9228. }
  9229. },
  9230. patternProperties: {
  9231. "^x-": {
  9232. $ref: "#/definitions/vendorExtension"
  9233. }
  9234. }
  9235. },
  9236. security: {
  9237. type: "array",
  9238. items: {
  9239. $ref: "#/definitions/securityRequirement"
  9240. },
  9241. uniqueItems: !0
  9242. },
  9243. securityRequirement: {
  9244. type: "object",
  9245. additionalProperties: {
  9246. type: "array",
  9247. items: {
  9248. type: "string"
  9249. },
  9250. uniqueItems: !0
  9251. }
  9252. },
  9253. xml: {
  9254. type: "object",
  9255. additionalProperties: !1,
  9256. properties: {
  9257. name: {
  9258. type: "string"
  9259. },
  9260. namespace: {
  9261. type: "string"
  9262. },
  9263. prefix: {
  9264. type: "string"
  9265. },
  9266. attribute: {
  9267. type: "boolean",
  9268. default: !1
  9269. },
  9270. wrapped: {
  9271. type: "boolean",
  9272. default: !1
  9273. }
  9274. },
  9275. patternProperties: {
  9276. "^x-": {
  9277. $ref: "#/definitions/vendorExtension"
  9278. }
  9279. }
  9280. },
  9281. tag: {
  9282. type: "object",
  9283. additionalProperties: !1,
  9284. required: [
  9285. "name"
  9286. ],
  9287. properties: {
  9288. name: {
  9289. type: "string"
  9290. },
  9291. description: {
  9292. type: "string"
  9293. },
  9294. externalDocs: {
  9295. $ref: "#/definitions/externalDocs"
  9296. }
  9297. },
  9298. patternProperties: {
  9299. "^x-": {
  9300. $ref: "#/definitions/vendorExtension"
  9301. }
  9302. }
  9303. },
  9304. securityDefinitions: {
  9305. type: "object",
  9306. additionalProperties: {
  9307. oneOf: [
  9308. {
  9309. $ref: "#/definitions/basicAuthenticationSecurity"
  9310. },
  9311. {
  9312. $ref: "#/definitions/apiKeySecurity"
  9313. },
  9314. {
  9315. $ref: "#/definitions/oauth2ImplicitSecurity"
  9316. },
  9317. {
  9318. $ref: "#/definitions/oauth2PasswordSecurity"
  9319. },
  9320. {
  9321. $ref: "#/definitions/oauth2ApplicationSecurity"
  9322. },
  9323. {
  9324. $ref: "#/definitions/oauth2AccessCodeSecurity"
  9325. }
  9326. ]
  9327. }
  9328. },
  9329. basicAuthenticationSecurity: {
  9330. type: "object",
  9331. additionalProperties: !1,
  9332. required: [
  9333. "type"
  9334. ],
  9335. properties: {
  9336. type: {
  9337. type: "string",
  9338. enum: [
  9339. "basic"
  9340. ]
  9341. },
  9342. description: {
  9343. type: "string"
  9344. }
  9345. },
  9346. patternProperties: {
  9347. "^x-": {
  9348. $ref: "#/definitions/vendorExtension"
  9349. }
  9350. }
  9351. },
  9352. apiKeySecurity: {
  9353. type: "object",
  9354. additionalProperties: !1,
  9355. required: [
  9356. "type",
  9357. "name",
  9358. "in"
  9359. ],
  9360. properties: {
  9361. type: {
  9362. type: "string",
  9363. enum: [
  9364. "apiKey"
  9365. ]
  9366. },
  9367. name: {
  9368. type: "string"
  9369. },
  9370. in: {
  9371. type: "string",
  9372. enum: [
  9373. "header",
  9374. "query"
  9375. ]
  9376. },
  9377. description: {
  9378. type: "string"
  9379. }
  9380. },
  9381. patternProperties: {
  9382. "^x-": {
  9383. $ref: "#/definitions/vendorExtension"
  9384. }
  9385. }
  9386. },
  9387. oauth2ImplicitSecurity: {
  9388. type: "object",
  9389. additionalProperties: !1,
  9390. required: [
  9391. "type",
  9392. "flow",
  9393. "authorizationUrl"
  9394. ],
  9395. properties: {
  9396. type: {
  9397. type: "string",
  9398. enum: [
  9399. "oauth2"
  9400. ]
  9401. },
  9402. flow: {
  9403. type: "string",
  9404. enum: [
  9405. "implicit"
  9406. ]
  9407. },
  9408. scopes: {
  9409. $ref: "#/definitions/oauth2Scopes"
  9410. },
  9411. authorizationUrl: {
  9412. type: "string",
  9413. format: "uri"
  9414. },
  9415. description: {
  9416. type: "string"
  9417. }
  9418. },
  9419. patternProperties: {
  9420. "^x-": {
  9421. $ref: "#/definitions/vendorExtension"
  9422. }
  9423. }
  9424. },
  9425. oauth2PasswordSecurity: {
  9426. type: "object",
  9427. additionalProperties: !1,
  9428. required: [
  9429. "type",
  9430. "flow",
  9431. "tokenUrl"
  9432. ],
  9433. properties: {
  9434. type: {
  9435. type: "string",
  9436. enum: [
  9437. "oauth2"
  9438. ]
  9439. },
  9440. flow: {
  9441. type: "string",
  9442. enum: [
  9443. "password"
  9444. ]
  9445. },
  9446. scopes: {
  9447. $ref: "#/definitions/oauth2Scopes"
  9448. },
  9449. tokenUrl: {
  9450. type: "string",
  9451. format: "uri"
  9452. },
  9453. description: {
  9454. type: "string"
  9455. }
  9456. },
  9457. patternProperties: {
  9458. "^x-": {
  9459. $ref: "#/definitions/vendorExtension"
  9460. }
  9461. }
  9462. },
  9463. oauth2ApplicationSecurity: {
  9464. type: "object",
  9465. additionalProperties: !1,
  9466. required: [
  9467. "type",
  9468. "flow",
  9469. "tokenUrl"
  9470. ],
  9471. properties: {
  9472. type: {
  9473. type: "string",
  9474. enum: [
  9475. "oauth2"
  9476. ]
  9477. },
  9478. flow: {
  9479. type: "string",
  9480. enum: [
  9481. "application"
  9482. ]
  9483. },
  9484. scopes: {
  9485. $ref: "#/definitions/oauth2Scopes"
  9486. },
  9487. tokenUrl: {
  9488. type: "string",
  9489. format: "uri"
  9490. },
  9491. description: {
  9492. type: "string"
  9493. }
  9494. },
  9495. patternProperties: {
  9496. "^x-": {
  9497. $ref: "#/definitions/vendorExtension"
  9498. }
  9499. }
  9500. },
  9501. oauth2AccessCodeSecurity: {
  9502. type: "object",
  9503. additionalProperties: !1,
  9504. required: [
  9505. "type",
  9506. "flow",
  9507. "authorizationUrl",
  9508. "tokenUrl"
  9509. ],
  9510. properties: {
  9511. type: {
  9512. type: "string",
  9513. enum: [
  9514. "oauth2"
  9515. ]
  9516. },
  9517. flow: {
  9518. type: "string",
  9519. enum: [
  9520. "accessCode"
  9521. ]
  9522. },
  9523. scopes: {
  9524. $ref: "#/definitions/oauth2Scopes"
  9525. },
  9526. authorizationUrl: {
  9527. type: "string",
  9528. format: "uri"
  9529. },
  9530. tokenUrl: {
  9531. type: "string",
  9532. format: "uri"
  9533. },
  9534. description: {
  9535. type: "string"
  9536. }
  9537. },
  9538. patternProperties: {
  9539. "^x-": {
  9540. $ref: "#/definitions/vendorExtension"
  9541. }
  9542. }
  9543. },
  9544. oauth2Scopes: {
  9545. type: "object",
  9546. additionalProperties: {
  9547. type: "string"
  9548. }
  9549. },
  9550. mediaTypeList: {
  9551. type: "array",
  9552. items: {
  9553. $ref: "#/definitions/mimeType"
  9554. },
  9555. uniqueItems: !0
  9556. },
  9557. parametersList: {
  9558. type: "array",
  9559. description: "The parameters needed to send a valid API call.",
  9560. additionalItems: !1,
  9561. items: {
  9562. oneOf: [
  9563. {
  9564. $ref: "#/definitions/parameter"
  9565. },
  9566. {
  9567. $ref: "#/definitions/jsonReference"
  9568. }
  9569. ]
  9570. },
  9571. uniqueItems: !0
  9572. },
  9573. schemesList: {
  9574. type: "array",
  9575. description: "The transfer protocol of the API.",
  9576. items: {
  9577. type: "string",
  9578. enum: [
  9579. "http",
  9580. "https",
  9581. "ws",
  9582. "wss"
  9583. ]
  9584. },
  9585. uniqueItems: !0
  9586. },
  9587. collectionFormat: {
  9588. type: "string",
  9589. enum: [
  9590. "csv",
  9591. "ssv",
  9592. "tsv",
  9593. "pipes"
  9594. ],
  9595. default: "csv"
  9596. },
  9597. collectionFormatWithMulti: {
  9598. type: "string",
  9599. enum: [
  9600. "csv",
  9601. "ssv",
  9602. "tsv",
  9603. "pipes",
  9604. "multi"
  9605. ],
  9606. default: "csv"
  9607. },
  9608. title: {
  9609. $ref: "http://json-schema.org/draft-04/schema#/properties/title"
  9610. },
  9611. description: {
  9612. $ref: "http://json-schema.org/draft-04/schema#/properties/description"
  9613. },
  9614. default: {
  9615. $ref: "http://json-schema.org/draft-04/schema#/properties/default"
  9616. },
  9617. multipleOf: {
  9618. $ref: "http://json-schema.org/draft-04/schema#/properties/multipleOf"
  9619. },
  9620. maximum: {
  9621. $ref: "http://json-schema.org/draft-04/schema#/properties/maximum"
  9622. },
  9623. exclusiveMaximum: {
  9624. $ref: "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
  9625. },
  9626. minimum: {
  9627. $ref: "http://json-schema.org/draft-04/schema#/properties/minimum"
  9628. },
  9629. exclusiveMinimum: {
  9630. $ref: "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
  9631. },
  9632. maxLength: {
  9633. $ref: "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
  9634. },
  9635. minLength: {
  9636. $ref: "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
  9637. },
  9638. pattern: {
  9639. $ref: "http://json-schema.org/draft-04/schema#/properties/pattern"
  9640. },
  9641. maxItems: {
  9642. $ref: "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
  9643. },
  9644. minItems: {
  9645. $ref: "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
  9646. },
  9647. uniqueItems: {
  9648. $ref: "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
  9649. },
  9650. enum: {
  9651. $ref: "http://json-schema.org/draft-04/schema#/properties/enum"
  9652. },
  9653. jsonReference: {
  9654. type: "object",
  9655. required: [
  9656. "$ref"
  9657. ],
  9658. additionalProperties: !1,
  9659. properties: {
  9660. $ref: {
  9661. type: "string"
  9662. }
  9663. }
  9664. }
  9665. }, v$ = {
  9666. title: f$,
  9667. id: d$,
  9668. $schema: p$,
  9669. type: h$,
  9670. required: m$,
  9671. additionalProperties: y$,
  9672. patternProperties: g$,
  9673. properties: $$,
  9674. definitions: _$
  9675. }, b$ = "https://spec.openapis.org/oas/3.0/schema/2019-04-02", w$ = "http://json-schema.org/draft-04/schema#", P$ = "Validation schema for OpenAPI Specification 3.0.X.", O$ = "object", E$ = [
  9676. "openapi",
  9677. "info",
  9678. "paths"
  9679. ], S$ = {
  9680. openapi: {
  9681. type: "string",
  9682. pattern: "^3\\.0\\.\\d(-.+)?$"
  9683. },
  9684. info: {
  9685. $ref: "#/definitions/Info"
  9686. },
  9687. externalDocs: {
  9688. $ref: "#/definitions/ExternalDocumentation"
  9689. },
  9690. servers: {
  9691. type: "array",
  9692. items: {
  9693. $ref: "#/definitions/Server"
  9694. }
  9695. },
  9696. security: {
  9697. type: "array",
  9698. items: {
  9699. $ref: "#/definitions/SecurityRequirement"
  9700. }
  9701. },
  9702. tags: {
  9703. type: "array",
  9704. items: {
  9705. $ref: "#/definitions/Tag"
  9706. },
  9707. uniqueItems: !0
  9708. },
  9709. paths: {
  9710. $ref: "#/definitions/Paths"
  9711. },
  9712. components: {
  9713. $ref: "#/definitions/Components"
  9714. }
  9715. }, x$ = {
  9716. "^x-": {}
  9717. }, j$ = !1, A$ = {
  9718. Reference: {
  9719. type: "object",
  9720. required: [
  9721. "$ref"
  9722. ],
  9723. patternProperties: {
  9724. "^\\$ref$": {
  9725. type: "string",
  9726. format: "uri-reference"
  9727. }
  9728. }
  9729. },
  9730. Info: {
  9731. type: "object",
  9732. required: [
  9733. "title",
  9734. "version"
  9735. ],
  9736. properties: {
  9737. title: {
  9738. type: "string"
  9739. },
  9740. description: {
  9741. type: "string"
  9742. },
  9743. termsOfService: {
  9744. type: "string",
  9745. format: "uri-reference"
  9746. },
  9747. contact: {
  9748. $ref: "#/definitions/Contact"
  9749. },
  9750. license: {
  9751. $ref: "#/definitions/License"
  9752. },
  9753. version: {
  9754. type: "string"
  9755. }
  9756. },
  9757. patternProperties: {
  9758. "^x-": {}
  9759. },
  9760. additionalProperties: !1
  9761. },
  9762. Contact: {
  9763. type: "object",
  9764. properties: {
  9765. name: {
  9766. type: "string"
  9767. },
  9768. url: {
  9769. type: "string",
  9770. format: "uri-reference"
  9771. },
  9772. email: {
  9773. type: "string",
  9774. format: "email"
  9775. }
  9776. },
  9777. patternProperties: {
  9778. "^x-": {}
  9779. },
  9780. additionalProperties: !1
  9781. },
  9782. License: {
  9783. type: "object",
  9784. required: [
  9785. "name"
  9786. ],
  9787. properties: {
  9788. name: {
  9789. type: "string"
  9790. },
  9791. url: {
  9792. type: "string",
  9793. format: "uri-reference"
  9794. }
  9795. },
  9796. patternProperties: {
  9797. "^x-": {}
  9798. },
  9799. additionalProperties: !1
  9800. },
  9801. Server: {
  9802. type: "object",
  9803. required: [
  9804. "url"
  9805. ],
  9806. properties: {
  9807. url: {
  9808. type: "string"
  9809. },
  9810. description: {
  9811. type: "string"
  9812. },
  9813. variables: {
  9814. type: "object",
  9815. additionalProperties: {
  9816. $ref: "#/definitions/ServerVariable"
  9817. }
  9818. }
  9819. },
  9820. patternProperties: {
  9821. "^x-": {}
  9822. },
  9823. additionalProperties: !1
  9824. },
  9825. ServerVariable: {
  9826. type: "object",
  9827. required: [
  9828. "default"
  9829. ],
  9830. properties: {
  9831. enum: {
  9832. type: "array",
  9833. items: {
  9834. type: "string"
  9835. }
  9836. },
  9837. default: {
  9838. type: "string"
  9839. },
  9840. description: {
  9841. type: "string"
  9842. }
  9843. },
  9844. patternProperties: {
  9845. "^x-": {}
  9846. },
  9847. additionalProperties: !1
  9848. },
  9849. Components: {
  9850. type: "object",
  9851. properties: {
  9852. schemas: {
  9853. type: "object",
  9854. patternProperties: {
  9855. "^[a-zA-Z0-9\\.\\-_]+$": {
  9856. oneOf: [
  9857. {
  9858. $ref: "#/definitions/Schema"
  9859. },
  9860. {
  9861. $ref: "#/definitions/Reference"
  9862. }
  9863. ]
  9864. }
  9865. }
  9866. },
  9867. responses: {
  9868. type: "object",
  9869. patternProperties: {
  9870. "^[a-zA-Z0-9\\.\\-_]+$": {
  9871. oneOf: [
  9872. {
  9873. $ref: "#/definitions/Reference"
  9874. },
  9875. {
  9876. $ref: "#/definitions/Response"
  9877. }
  9878. ]
  9879. }
  9880. }
  9881. },
  9882. parameters: {
  9883. type: "object",
  9884. patternProperties: {
  9885. "^[a-zA-Z0-9\\.\\-_]+$": {
  9886. oneOf: [
  9887. {
  9888. $ref: "#/definitions/Reference"
  9889. },
  9890. {
  9891. $ref: "#/definitions/Parameter"
  9892. }
  9893. ]
  9894. }
  9895. }
  9896. },
  9897. examples: {
  9898. type: "object",
  9899. patternProperties: {
  9900. "^[a-zA-Z0-9\\.\\-_]+$": {
  9901. oneOf: [
  9902. {
  9903. $ref: "#/definitions/Reference"
  9904. },
  9905. {
  9906. $ref: "#/definitions/Example"
  9907. }
  9908. ]
  9909. }
  9910. }
  9911. },
  9912. requestBodies: {
  9913. type: "object",
  9914. patternProperties: {
  9915. "^[a-zA-Z0-9\\.\\-_]+$": {
  9916. oneOf: [
  9917. {
  9918. $ref: "#/definitions/Reference"
  9919. },
  9920. {
  9921. $ref: "#/definitions/RequestBody"
  9922. }
  9923. ]
  9924. }
  9925. }
  9926. },
  9927. headers: {
  9928. type: "object",
  9929. patternProperties: {
  9930. "^[a-zA-Z0-9\\.\\-_]+$": {
  9931. oneOf: [
  9932. {
  9933. $ref: "#/definitions/Reference"
  9934. },
  9935. {
  9936. $ref: "#/definitions/Header"
  9937. }
  9938. ]
  9939. }
  9940. }
  9941. },
  9942. securitySchemes: {
  9943. type: "object",
  9944. patternProperties: {
  9945. "^[a-zA-Z0-9\\.\\-_]+$": {
  9946. oneOf: [
  9947. {
  9948. $ref: "#/definitions/Reference"
  9949. },
  9950. {
  9951. $ref: "#/definitions/SecurityScheme"
  9952. }
  9953. ]
  9954. }
  9955. }
  9956. },
  9957. links: {
  9958. type: "object",
  9959. patternProperties: {
  9960. "^[a-zA-Z0-9\\.\\-_]+$": {
  9961. oneOf: [
  9962. {
  9963. $ref: "#/definitions/Reference"
  9964. },
  9965. {
  9966. $ref: "#/definitions/Link"
  9967. }
  9968. ]
  9969. }
  9970. }
  9971. },
  9972. callbacks: {
  9973. type: "object",
  9974. patternProperties: {
  9975. "^[a-zA-Z0-9\\.\\-_]+$": {
  9976. oneOf: [
  9977. {
  9978. $ref: "#/definitions/Reference"
  9979. },
  9980. {
  9981. $ref: "#/definitions/Callback"
  9982. }
  9983. ]
  9984. }
  9985. }
  9986. }
  9987. },
  9988. patternProperties: {
  9989. "^x-": {}
  9990. },
  9991. additionalProperties: !1
  9992. },
  9993. Schema: {
  9994. type: "object",
  9995. properties: {
  9996. title: {
  9997. type: "string"
  9998. },
  9999. multipleOf: {
  10000. type: "number",
  10001. minimum: 0,
  10002. exclusiveMinimum: !0
  10003. },
  10004. maximum: {
  10005. type: "number"
  10006. },
  10007. exclusiveMaximum: {
  10008. type: "boolean",
  10009. default: !1
  10010. },
  10011. minimum: {
  10012. type: "number"
  10013. },
  10014. exclusiveMinimum: {
  10015. type: "boolean",
  10016. default: !1
  10017. },
  10018. maxLength: {
  10019. type: "integer",
  10020. minimum: 0
  10021. },
  10022. minLength: {
  10023. type: "integer",
  10024. minimum: 0,
  10025. default: 0
  10026. },
  10027. pattern: {
  10028. type: "string",
  10029. format: "regex"
  10030. },
  10031. maxItems: {
  10032. type: "integer",
  10033. minimum: 0
  10034. },
  10035. minItems: {
  10036. type: "integer",
  10037. minimum: 0,
  10038. default: 0
  10039. },
  10040. uniqueItems: {
  10041. type: "boolean",
  10042. default: !1
  10043. },
  10044. maxProperties: {
  10045. type: "integer",
  10046. minimum: 0
  10047. },
  10048. minProperties: {
  10049. type: "integer",
  10050. minimum: 0,
  10051. default: 0
  10052. },
  10053. required: {
  10054. type: "array",
  10055. items: {
  10056. type: "string"
  10057. },
  10058. minItems: 1,
  10059. uniqueItems: !0
  10060. },
  10061. enum: {
  10062. type: "array",
  10063. items: {},
  10064. minItems: 1,
  10065. uniqueItems: !1
  10066. },
  10067. type: {
  10068. type: "string",
  10069. enum: [
  10070. "array",
  10071. "boolean",
  10072. "integer",
  10073. "number",
  10074. "object",
  10075. "string"
  10076. ]
  10077. },
  10078. not: {
  10079. oneOf: [
  10080. {
  10081. $ref: "#/definitions/Schema"
  10082. },
  10083. {
  10084. $ref: "#/definitions/Reference"
  10085. }
  10086. ]
  10087. },
  10088. allOf: {
  10089. type: "array",
  10090. items: {
  10091. oneOf: [
  10092. {
  10093. $ref: "#/definitions/Schema"
  10094. },
  10095. {
  10096. $ref: "#/definitions/Reference"
  10097. }
  10098. ]
  10099. }
  10100. },
  10101. oneOf: {
  10102. type: "array",
  10103. items: {
  10104. oneOf: [
  10105. {
  10106. $ref: "#/definitions/Schema"
  10107. },
  10108. {
  10109. $ref: "#/definitions/Reference"
  10110. }
  10111. ]
  10112. }
  10113. },
  10114. anyOf: {
  10115. type: "array",
  10116. items: {
  10117. oneOf: [
  10118. {
  10119. $ref: "#/definitions/Schema"
  10120. },
  10121. {
  10122. $ref: "#/definitions/Reference"
  10123. }
  10124. ]
  10125. }
  10126. },
  10127. items: {
  10128. oneOf: [
  10129. {
  10130. $ref: "#/definitions/Schema"
  10131. },
  10132. {
  10133. $ref: "#/definitions/Reference"
  10134. }
  10135. ]
  10136. },
  10137. properties: {
  10138. type: "object",
  10139. additionalProperties: {
  10140. oneOf: [
  10141. {
  10142. $ref: "#/definitions/Schema"
  10143. },
  10144. {
  10145. $ref: "#/definitions/Reference"
  10146. }
  10147. ]
  10148. }
  10149. },
  10150. additionalProperties: {
  10151. oneOf: [
  10152. {
  10153. $ref: "#/definitions/Schema"
  10154. },
  10155. {
  10156. $ref: "#/definitions/Reference"
  10157. },
  10158. {
  10159. type: "boolean"
  10160. }
  10161. ],
  10162. default: !0
  10163. },
  10164. description: {
  10165. type: "string"
  10166. },
  10167. format: {
  10168. type: "string"
  10169. },
  10170. default: {},
  10171. nullable: {
  10172. type: "boolean",
  10173. default: !1
  10174. },
  10175. discriminator: {
  10176. $ref: "#/definitions/Discriminator"
  10177. },
  10178. readOnly: {
  10179. type: "boolean",
  10180. default: !1
  10181. },
  10182. writeOnly: {
  10183. type: "boolean",
  10184. default: !1
  10185. },
  10186. example: {},
  10187. externalDocs: {
  10188. $ref: "#/definitions/ExternalDocumentation"
  10189. },
  10190. deprecated: {
  10191. type: "boolean",
  10192. default: !1
  10193. },
  10194. xml: {
  10195. $ref: "#/definitions/XML"
  10196. }
  10197. },
  10198. patternProperties: {
  10199. "^x-": {}
  10200. },
  10201. additionalProperties: !1
  10202. },
  10203. Discriminator: {
  10204. type: "object",
  10205. required: [
  10206. "propertyName"
  10207. ],
  10208. properties: {
  10209. propertyName: {
  10210. type: "string"
  10211. },
  10212. mapping: {
  10213. type: "object",
  10214. additionalProperties: {
  10215. type: "string"
  10216. }
  10217. }
  10218. }
  10219. },
  10220. XML: {
  10221. type: "object",
  10222. properties: {
  10223. name: {
  10224. type: "string"
  10225. },
  10226. namespace: {
  10227. type: "string",
  10228. format: "uri"
  10229. },
  10230. prefix: {
  10231. type: "string"
  10232. },
  10233. attribute: {
  10234. type: "boolean",
  10235. default: !1
  10236. },
  10237. wrapped: {
  10238. type: "boolean",
  10239. default: !1
  10240. }
  10241. },
  10242. patternProperties: {
  10243. "^x-": {}
  10244. },
  10245. additionalProperties: !1
  10246. },
  10247. Response: {
  10248. type: "object",
  10249. required: [
  10250. "description"
  10251. ],
  10252. properties: {
  10253. description: {
  10254. type: "string"
  10255. },
  10256. headers: {
  10257. type: "object",
  10258. additionalProperties: {
  10259. oneOf: [
  10260. {
  10261. $ref: "#/definitions/Header"
  10262. },
  10263. {
  10264. $ref: "#/definitions/Reference"
  10265. }
  10266. ]
  10267. }
  10268. },
  10269. content: {
  10270. type: "object",
  10271. additionalProperties: {
  10272. $ref: "#/definitions/MediaType"
  10273. }
  10274. },
  10275. links: {
  10276. type: "object",
  10277. additionalProperties: {
  10278. oneOf: [
  10279. {
  10280. $ref: "#/definitions/Link"
  10281. },
  10282. {
  10283. $ref: "#/definitions/Reference"
  10284. }
  10285. ]
  10286. }
  10287. }
  10288. },
  10289. patternProperties: {
  10290. "^x-": {}
  10291. },
  10292. additionalProperties: !1
  10293. },
  10294. MediaType: {
  10295. type: "object",
  10296. properties: {
  10297. schema: {
  10298. oneOf: [
  10299. {
  10300. $ref: "#/definitions/Schema"
  10301. },
  10302. {
  10303. $ref: "#/definitions/Reference"
  10304. }
  10305. ]
  10306. },
  10307. example: {},
  10308. examples: {
  10309. type: "object",
  10310. additionalProperties: {
  10311. oneOf: [
  10312. {
  10313. $ref: "#/definitions/Example"
  10314. },
  10315. {
  10316. $ref: "#/definitions/Reference"
  10317. }
  10318. ]
  10319. }
  10320. },
  10321. encoding: {
  10322. type: "object",
  10323. additionalProperties: {
  10324. $ref: "#/definitions/Encoding"
  10325. }
  10326. }
  10327. },
  10328. patternProperties: {
  10329. "^x-": {}
  10330. },
  10331. additionalProperties: !1,
  10332. allOf: [
  10333. {
  10334. $ref: "#/definitions/ExampleXORExamples"
  10335. }
  10336. ]
  10337. },
  10338. Example: {
  10339. type: "object",
  10340. properties: {
  10341. summary: {
  10342. type: "string"
  10343. },
  10344. description: {
  10345. type: "string"
  10346. },
  10347. value: {},
  10348. externalValue: {
  10349. type: "string",
  10350. format: "uri-reference"
  10351. }
  10352. },
  10353. patternProperties: {
  10354. "^x-": {}
  10355. },
  10356. additionalProperties: !1
  10357. },
  10358. Header: {
  10359. type: "object",
  10360. properties: {
  10361. description: {
  10362. type: "string"
  10363. },
  10364. required: {
  10365. type: "boolean",
  10366. default: !1
  10367. },
  10368. deprecated: {
  10369. type: "boolean",
  10370. default: !1
  10371. },
  10372. allowEmptyValue: {
  10373. type: "boolean",
  10374. default: !1
  10375. },
  10376. style: {
  10377. type: "string",
  10378. enum: [
  10379. "simple"
  10380. ],
  10381. default: "simple"
  10382. },
  10383. explode: {
  10384. type: "boolean"
  10385. },
  10386. allowReserved: {
  10387. type: "boolean",
  10388. default: !1
  10389. },
  10390. schema: {
  10391. oneOf: [
  10392. {
  10393. $ref: "#/definitions/Schema"
  10394. },
  10395. {
  10396. $ref: "#/definitions/Reference"
  10397. }
  10398. ]
  10399. },
  10400. content: {
  10401. type: "object",
  10402. additionalProperties: {
  10403. $ref: "#/definitions/MediaType"
  10404. },
  10405. minProperties: 1,
  10406. maxProperties: 1
  10407. },
  10408. example: {},
  10409. examples: {
  10410. type: "object",
  10411. additionalProperties: {
  10412. oneOf: [
  10413. {
  10414. $ref: "#/definitions/Example"
  10415. },
  10416. {
  10417. $ref: "#/definitions/Reference"
  10418. }
  10419. ]
  10420. }
  10421. }
  10422. },
  10423. patternProperties: {
  10424. "^x-": {}
  10425. },
  10426. additionalProperties: !1,
  10427. allOf: [
  10428. {
  10429. $ref: "#/definitions/ExampleXORExamples"
  10430. },
  10431. {
  10432. $ref: "#/definitions/SchemaXORContent"
  10433. }
  10434. ]
  10435. },
  10436. Paths: {
  10437. type: "object",
  10438. patternProperties: {
  10439. "^\\/": {
  10440. $ref: "#/definitions/PathItem"
  10441. },
  10442. "^x-": {}
  10443. },
  10444. additionalProperties: !1
  10445. },
  10446. PathItem: {
  10447. type: "object",
  10448. properties: {
  10449. $ref: {
  10450. type: "string"
  10451. },
  10452. summary: {
  10453. type: "string"
  10454. },
  10455. description: {
  10456. type: "string"
  10457. },
  10458. servers: {
  10459. type: "array",
  10460. items: {
  10461. $ref: "#/definitions/Server"
  10462. }
  10463. },
  10464. parameters: {
  10465. type: "array",
  10466. items: {
  10467. oneOf: [
  10468. {
  10469. $ref: "#/definitions/Parameter"
  10470. },
  10471. {
  10472. $ref: "#/definitions/Reference"
  10473. }
  10474. ]
  10475. },
  10476. uniqueItems: !0
  10477. }
  10478. },
  10479. patternProperties: {
  10480. "^(get|put|post|delete|options|head|patch|trace)$": {
  10481. $ref: "#/definitions/Operation"
  10482. },
  10483. "^x-": {}
  10484. },
  10485. additionalProperties: !1
  10486. },
  10487. Operation: {
  10488. type: "object",
  10489. required: [
  10490. "responses"
  10491. ],
  10492. properties: {
  10493. tags: {
  10494. type: "array",
  10495. items: {
  10496. type: "string"
  10497. }
  10498. },
  10499. summary: {
  10500. type: "string"
  10501. },
  10502. description: {
  10503. type: "string"
  10504. },
  10505. externalDocs: {
  10506. $ref: "#/definitions/ExternalDocumentation"
  10507. },
  10508. operationId: {
  10509. type: "string"
  10510. },
  10511. parameters: {
  10512. type: "array",
  10513. items: {
  10514. oneOf: [
  10515. {
  10516. $ref: "#/definitions/Parameter"
  10517. },
  10518. {
  10519. $ref: "#/definitions/Reference"
  10520. }
  10521. ]
  10522. },
  10523. uniqueItems: !0
  10524. },
  10525. requestBody: {
  10526. oneOf: [
  10527. {
  10528. $ref: "#/definitions/RequestBody"
  10529. },
  10530. {
  10531. $ref: "#/definitions/Reference"
  10532. }
  10533. ]
  10534. },
  10535. responses: {
  10536. $ref: "#/definitions/Responses"
  10537. },
  10538. callbacks: {
  10539. type: "object",
  10540. additionalProperties: {
  10541. oneOf: [
  10542. {
  10543. $ref: "#/definitions/Callback"
  10544. },
  10545. {
  10546. $ref: "#/definitions/Reference"
  10547. }
  10548. ]
  10549. }
  10550. },
  10551. deprecated: {
  10552. type: "boolean",
  10553. default: !1
  10554. },
  10555. security: {
  10556. type: "array",
  10557. items: {
  10558. $ref: "#/definitions/SecurityRequirement"
  10559. }
  10560. },
  10561. servers: {
  10562. type: "array",
  10563. items: {
  10564. $ref: "#/definitions/Server"
  10565. }
  10566. }
  10567. },
  10568. patternProperties: {
  10569. "^x-": {}
  10570. },
  10571. additionalProperties: !1
  10572. },
  10573. Responses: {
  10574. type: "object",
  10575. properties: {
  10576. default: {
  10577. oneOf: [
  10578. {
  10579. $ref: "#/definitions/Response"
  10580. },
  10581. {
  10582. $ref: "#/definitions/Reference"
  10583. }
  10584. ]
  10585. }
  10586. },
  10587. patternProperties: {
  10588. "^[1-5](?:\\d{2}|XX)$": {
  10589. oneOf: [
  10590. {
  10591. $ref: "#/definitions/Response"
  10592. },
  10593. {
  10594. $ref: "#/definitions/Reference"
  10595. }
  10596. ]
  10597. },
  10598. "^x-": {}
  10599. },
  10600. minProperties: 1,
  10601. additionalProperties: !1
  10602. },
  10603. SecurityRequirement: {
  10604. type: "object",
  10605. additionalProperties: {
  10606. type: "array",
  10607. items: {
  10608. type: "string"
  10609. }
  10610. }
  10611. },
  10612. Tag: {
  10613. type: "object",
  10614. required: [
  10615. "name"
  10616. ],
  10617. properties: {
  10618. name: {
  10619. type: "string"
  10620. },
  10621. description: {
  10622. type: "string"
  10623. },
  10624. externalDocs: {
  10625. $ref: "#/definitions/ExternalDocumentation"
  10626. }
  10627. },
  10628. patternProperties: {
  10629. "^x-": {}
  10630. },
  10631. additionalProperties: !1
  10632. },
  10633. ExternalDocumentation: {
  10634. type: "object",
  10635. required: [
  10636. "url"
  10637. ],
  10638. properties: {
  10639. description: {
  10640. type: "string"
  10641. },
  10642. url: {
  10643. type: "string",
  10644. format: "uri-reference"
  10645. }
  10646. },
  10647. patternProperties: {
  10648. "^x-": {}
  10649. },
  10650. additionalProperties: !1
  10651. },
  10652. ExampleXORExamples: {
  10653. description: "Example and examples are mutually exclusive",
  10654. not: {
  10655. required: [
  10656. "example",
  10657. "examples"
  10658. ]
  10659. }
  10660. },
  10661. SchemaXORContent: {
  10662. description: "Schema and content are mutually exclusive, at least one is required",
  10663. not: {
  10664. required: [
  10665. "schema",
  10666. "content"
  10667. ]
  10668. },
  10669. oneOf: [
  10670. {
  10671. required: [
  10672. "schema"
  10673. ]
  10674. },
  10675. {
  10676. required: [
  10677. "content"
  10678. ],
  10679. description: "Some properties are not allowed if content is present",
  10680. allOf: [
  10681. {
  10682. not: {
  10683. required: [
  10684. "style"
  10685. ]
  10686. }
  10687. },
  10688. {
  10689. not: {
  10690. required: [
  10691. "explode"
  10692. ]
  10693. }
  10694. },
  10695. {
  10696. not: {
  10697. required: [
  10698. "allowReserved"
  10699. ]
  10700. }
  10701. },
  10702. {
  10703. not: {
  10704. required: [
  10705. "example"
  10706. ]
  10707. }
  10708. },
  10709. {
  10710. not: {
  10711. required: [
  10712. "examples"
  10713. ]
  10714. }
  10715. }
  10716. ]
  10717. }
  10718. ]
  10719. },
  10720. Parameter: {
  10721. type: "object",
  10722. properties: {
  10723. name: {
  10724. type: "string"
  10725. },
  10726. in: {
  10727. type: "string"
  10728. },
  10729. description: {
  10730. type: "string"
  10731. },
  10732. required: {
  10733. type: "boolean",
  10734. default: !1
  10735. },
  10736. deprecated: {
  10737. type: "boolean",
  10738. default: !1
  10739. },
  10740. allowEmptyValue: {
  10741. type: "boolean",
  10742. default: !1
  10743. },
  10744. style: {
  10745. type: "string"
  10746. },
  10747. explode: {
  10748. type: "boolean"
  10749. },
  10750. allowReserved: {
  10751. type: "boolean",
  10752. default: !1
  10753. },
  10754. schema: {
  10755. oneOf: [
  10756. {
  10757. $ref: "#/definitions/Schema"
  10758. },
  10759. {
  10760. $ref: "#/definitions/Reference"
  10761. }
  10762. ]
  10763. },
  10764. content: {
  10765. type: "object",
  10766. additionalProperties: {
  10767. $ref: "#/definitions/MediaType"
  10768. },
  10769. minProperties: 1,
  10770. maxProperties: 1
  10771. },
  10772. example: {},
  10773. examples: {
  10774. type: "object",
  10775. additionalProperties: {
  10776. oneOf: [
  10777. {
  10778. $ref: "#/definitions/Example"
  10779. },
  10780. {
  10781. $ref: "#/definitions/Reference"
  10782. }
  10783. ]
  10784. }
  10785. }
  10786. },
  10787. patternProperties: {
  10788. "^x-": {}
  10789. },
  10790. additionalProperties: !1,
  10791. required: [
  10792. "name",
  10793. "in"
  10794. ],
  10795. allOf: [
  10796. {
  10797. $ref: "#/definitions/ExampleXORExamples"
  10798. },
  10799. {
  10800. $ref: "#/definitions/SchemaXORContent"
  10801. },
  10802. {
  10803. $ref: "#/definitions/ParameterLocation"
  10804. }
  10805. ]
  10806. },
  10807. ParameterLocation: {
  10808. description: "Parameter location",
  10809. oneOf: [
  10810. {
  10811. description: "Parameter in path",
  10812. required: [
  10813. "required"
  10814. ],
  10815. properties: {
  10816. in: {
  10817. enum: [
  10818. "path"
  10819. ]
  10820. },
  10821. style: {
  10822. enum: [
  10823. "matrix",
  10824. "label",
  10825. "simple"
  10826. ],
  10827. default: "simple"
  10828. },
  10829. required: {
  10830. enum: [
  10831. !0
  10832. ]
  10833. }
  10834. }
  10835. },
  10836. {
  10837. description: "Parameter in query",
  10838. properties: {
  10839. in: {
  10840. enum: [
  10841. "query"
  10842. ]
  10843. },
  10844. style: {
  10845. enum: [
  10846. "form",
  10847. "spaceDelimited",
  10848. "pipeDelimited",
  10849. "deepObject"
  10850. ],
  10851. default: "form"
  10852. }
  10853. }
  10854. },
  10855. {
  10856. description: "Parameter in header",
  10857. properties: {
  10858. in: {
  10859. enum: [
  10860. "header"
  10861. ]
  10862. },
  10863. style: {
  10864. enum: [
  10865. "simple"
  10866. ],
  10867. default: "simple"
  10868. }
  10869. }
  10870. },
  10871. {
  10872. description: "Parameter in cookie",
  10873. properties: {
  10874. in: {
  10875. enum: [
  10876. "cookie"
  10877. ]
  10878. },
  10879. style: {
  10880. enum: [
  10881. "form"
  10882. ],
  10883. default: "form"
  10884. }
  10885. }
  10886. }
  10887. ]
  10888. },
  10889. RequestBody: {
  10890. type: "object",
  10891. required: [
  10892. "content"
  10893. ],
  10894. properties: {
  10895. description: {
  10896. type: "string"
  10897. },
  10898. content: {
  10899. type: "object",
  10900. additionalProperties: {
  10901. $ref: "#/definitions/MediaType"
  10902. }
  10903. },
  10904. required: {
  10905. type: "boolean",
  10906. default: !1
  10907. }
  10908. },
  10909. patternProperties: {
  10910. "^x-": {}
  10911. },
  10912. additionalProperties: !1
  10913. },
  10914. SecurityScheme: {
  10915. oneOf: [
  10916. {
  10917. $ref: "#/definitions/APIKeySecurityScheme"
  10918. },
  10919. {
  10920. $ref: "#/definitions/HTTPSecurityScheme"
  10921. },
  10922. {
  10923. $ref: "#/definitions/OAuth2SecurityScheme"
  10924. },
  10925. {
  10926. $ref: "#/definitions/OpenIdConnectSecurityScheme"
  10927. }
  10928. ]
  10929. },
  10930. APIKeySecurityScheme: {
  10931. type: "object",
  10932. required: [
  10933. "type",
  10934. "name",
  10935. "in"
  10936. ],
  10937. properties: {
  10938. type: {
  10939. type: "string",
  10940. enum: [
  10941. "apiKey"
  10942. ]
  10943. },
  10944. name: {
  10945. type: "string"
  10946. },
  10947. in: {
  10948. type: "string",
  10949. enum: [
  10950. "header",
  10951. "query",
  10952. "cookie"
  10953. ]
  10954. },
  10955. description: {
  10956. type: "string"
  10957. }
  10958. },
  10959. patternProperties: {
  10960. "^x-": {}
  10961. },
  10962. additionalProperties: !1
  10963. },
  10964. HTTPSecurityScheme: {
  10965. type: "object",
  10966. required: [
  10967. "scheme",
  10968. "type"
  10969. ],
  10970. properties: {
  10971. scheme: {
  10972. type: "string"
  10973. },
  10974. bearerFormat: {
  10975. type: "string"
  10976. },
  10977. description: {
  10978. type: "string"
  10979. },
  10980. type: {
  10981. type: "string",
  10982. enum: [
  10983. "http"
  10984. ]
  10985. }
  10986. },
  10987. patternProperties: {
  10988. "^x-": {}
  10989. },
  10990. additionalProperties: !1,
  10991. oneOf: [
  10992. {
  10993. description: "Bearer",
  10994. properties: {
  10995. scheme: {
  10996. enum: [
  10997. "bearer"
  10998. ]
  10999. }
  11000. }
  11001. },
  11002. {
  11003. description: "Non Bearer",
  11004. not: {
  11005. required: [
  11006. "bearerFormat"
  11007. ]
  11008. },
  11009. properties: {
  11010. scheme: {
  11011. not: {
  11012. enum: [
  11013. "bearer"
  11014. ]
  11015. }
  11016. }
  11017. }
  11018. }
  11019. ]
  11020. },
  11021. OAuth2SecurityScheme: {
  11022. type: "object",
  11023. required: [
  11024. "type",
  11025. "flows"
  11026. ],
  11027. properties: {
  11028. type: {
  11029. type: "string",
  11030. enum: [
  11031. "oauth2"
  11032. ]
  11033. },
  11034. flows: {
  11035. $ref: "#/definitions/OAuthFlows"
  11036. },
  11037. description: {
  11038. type: "string"
  11039. }
  11040. },
  11041. patternProperties: {
  11042. "^x-": {}
  11043. },
  11044. additionalProperties: !1
  11045. },
  11046. OpenIdConnectSecurityScheme: {
  11047. type: "object",
  11048. required: [
  11049. "type",
  11050. "openIdConnectUrl"
  11051. ],
  11052. properties: {
  11053. type: {
  11054. type: "string",
  11055. enum: [
  11056. "openIdConnect"
  11057. ]
  11058. },
  11059. openIdConnectUrl: {
  11060. type: "string",
  11061. format: "uri-reference"
  11062. },
  11063. description: {
  11064. type: "string"
  11065. }
  11066. },
  11067. patternProperties: {
  11068. "^x-": {}
  11069. },
  11070. additionalProperties: !1
  11071. },
  11072. OAuthFlows: {
  11073. type: "object",
  11074. properties: {
  11075. implicit: {
  11076. $ref: "#/definitions/ImplicitOAuthFlow"
  11077. },
  11078. password: {
  11079. $ref: "#/definitions/PasswordOAuthFlow"
  11080. },
  11081. clientCredentials: {
  11082. $ref: "#/definitions/ClientCredentialsFlow"
  11083. },
  11084. authorizationCode: {
  11085. $ref: "#/definitions/AuthorizationCodeOAuthFlow"
  11086. }
  11087. },
  11088. patternProperties: {
  11089. "^x-": {}
  11090. },
  11091. additionalProperties: !1
  11092. },
  11093. ImplicitOAuthFlow: {
  11094. type: "object",
  11095. required: [
  11096. "authorizationUrl",
  11097. "scopes"
  11098. ],
  11099. properties: {
  11100. authorizationUrl: {
  11101. type: "string",
  11102. format: "uri-reference"
  11103. },
  11104. refreshUrl: {
  11105. type: "string",
  11106. format: "uri-reference"
  11107. },
  11108. scopes: {
  11109. type: "object",
  11110. additionalProperties: {
  11111. type: "string"
  11112. }
  11113. }
  11114. },
  11115. patternProperties: {
  11116. "^x-": {}
  11117. },
  11118. additionalProperties: !1
  11119. },
  11120. PasswordOAuthFlow: {
  11121. type: "object",
  11122. required: [
  11123. "tokenUrl"
  11124. ],
  11125. properties: {
  11126. tokenUrl: {
  11127. type: "string",
  11128. format: "uri-reference"
  11129. },
  11130. refreshUrl: {
  11131. type: "string",
  11132. format: "uri-reference"
  11133. },
  11134. scopes: {
  11135. type: "object",
  11136. additionalProperties: {
  11137. type: "string"
  11138. }
  11139. }
  11140. },
  11141. patternProperties: {
  11142. "^x-": {}
  11143. },
  11144. additionalProperties: !1
  11145. },
  11146. ClientCredentialsFlow: {
  11147. type: "object",
  11148. required: [
  11149. "tokenUrl"
  11150. ],
  11151. properties: {
  11152. tokenUrl: {
  11153. type: "string",
  11154. format: "uri-reference"
  11155. },
  11156. refreshUrl: {
  11157. type: "string",
  11158. format: "uri-reference"
  11159. },
  11160. scopes: {
  11161. type: "object",
  11162. additionalProperties: {
  11163. type: "string"
  11164. }
  11165. }
  11166. },
  11167. patternProperties: {
  11168. "^x-": {}
  11169. },
  11170. additionalProperties: !1
  11171. },
  11172. AuthorizationCodeOAuthFlow: {
  11173. type: "object",
  11174. required: [
  11175. "authorizationUrl",
  11176. "tokenUrl"
  11177. ],
  11178. properties: {
  11179. authorizationUrl: {
  11180. type: "string",
  11181. format: "uri-reference"
  11182. },
  11183. tokenUrl: {
  11184. type: "string",
  11185. format: "uri-reference"
  11186. },
  11187. refreshUrl: {
  11188. type: "string",
  11189. format: "uri-reference"
  11190. },
  11191. scopes: {
  11192. type: "object",
  11193. additionalProperties: {
  11194. type: "string"
  11195. }
  11196. }
  11197. },
  11198. patternProperties: {
  11199. "^x-": {}
  11200. },
  11201. additionalProperties: !1
  11202. },
  11203. Link: {
  11204. type: "object",
  11205. properties: {
  11206. operationId: {
  11207. type: "string"
  11208. },
  11209. operationRef: {
  11210. type: "string",
  11211. format: "uri-reference"
  11212. },
  11213. parameters: {
  11214. type: "object",
  11215. additionalProperties: {}
  11216. },
  11217. requestBody: {},
  11218. description: {
  11219. type: "string"
  11220. },
  11221. server: {
  11222. $ref: "#/definitions/Server"
  11223. }
  11224. },
  11225. patternProperties: {
  11226. "^x-": {}
  11227. },
  11228. additionalProperties: !1,
  11229. not: {
  11230. description: "Operation Id and Operation Ref are mutually exclusive",
  11231. required: [
  11232. "operationId",
  11233. "operationRef"
  11234. ]
  11235. }
  11236. },
  11237. Callback: {
  11238. type: "object",
  11239. additionalProperties: {
  11240. $ref: "#/definitions/PathItem"
  11241. },
  11242. patternProperties: {
  11243. "^x-": {}
  11244. }
  11245. },
  11246. Encoding: {
  11247. type: "object",
  11248. properties: {
  11249. contentType: {
  11250. type: "string"
  11251. },
  11252. headers: {
  11253. type: "object",
  11254. additionalProperties: {
  11255. $ref: "#/definitions/Header"
  11256. }
  11257. },
  11258. style: {
  11259. type: "string",
  11260. enum: [
  11261. "form",
  11262. "spaceDelimited",
  11263. "pipeDelimited",
  11264. "deepObject"
  11265. ]
  11266. },
  11267. explode: {
  11268. type: "boolean"
  11269. },
  11270. allowReserved: {
  11271. type: "boolean",
  11272. default: !1
  11273. }
  11274. },
  11275. additionalProperties: !1
  11276. }
  11277. }, C$ = {
  11278. id: b$,
  11279. $schema: w$,
  11280. description: P$,
  11281. type: O$,
  11282. required: E$,
  11283. properties: S$,
  11284. patternProperties: x$,
  11285. additionalProperties: j$,
  11286. definitions: A$
  11287. }, I$ = "https://spec.openapis.org/oas/3.1/schema/2021-04-15", T$ = "https://json-schema.org/draft/2020-12/schema", R$ = "object", k$ = {
  11288. openapi: {
  11289. type: "string",
  11290. pattern: "^3\\.1\\.\\d+(-.+)?$"
  11291. },
  11292. info: {
  11293. $ref: "#/$defs/info"
  11294. },
  11295. jsonSchemaDialect: {
  11296. $ref: "#/$defs/uri",
  11297. default: "https://spec.openapis.org/oas/3.1/dialect/base"
  11298. },
  11299. servers: {
  11300. type: "array",
  11301. items: {
  11302. $ref: "#/$defs/server"
  11303. }
  11304. },
  11305. paths: {
  11306. $ref: "#/$defs/paths"
  11307. },
  11308. webhooks: {
  11309. type: "object",
  11310. additionalProperties: {
  11311. $ref: "#/$defs/path-item-or-reference"
  11312. }
  11313. },
  11314. components: {
  11315. $ref: "#/$defs/components"
  11316. },
  11317. security: {
  11318. type: "array",
  11319. items: {
  11320. $ref: "#/$defs/security-requirement"
  11321. }
  11322. },
  11323. tags: {
  11324. type: "array",
  11325. items: {
  11326. $ref: "#/$defs/tag"
  11327. }
  11328. },
  11329. externalDocs: {
  11330. $ref: "#/$defs/external-documentation"
  11331. }
  11332. }, N$ = [
  11333. "openapi",
  11334. "info"
  11335. ], M$ = [
  11336. {
  11337. required: [
  11338. "paths"
  11339. ]
  11340. },
  11341. {
  11342. required: [
  11343. "components"
  11344. ]
  11345. },
  11346. {
  11347. required: [
  11348. "webhooks"
  11349. ]
  11350. }
  11351. ], D$ = "#/$defs/specification-extensions", q$ = !1, F$ = {
  11352. info: {
  11353. type: "object",
  11354. properties: {
  11355. title: {
  11356. type: "string"
  11357. },
  11358. summary: {
  11359. type: "string"
  11360. },
  11361. description: {
  11362. type: "string"
  11363. },
  11364. termsOfService: {
  11365. type: "string"
  11366. },
  11367. contact: {
  11368. $ref: "#/$defs/contact"
  11369. },
  11370. license: {
  11371. $ref: "#/$defs/license"
  11372. },
  11373. version: {
  11374. type: "string"
  11375. }
  11376. },
  11377. required: [
  11378. "title",
  11379. "version"
  11380. ],
  11381. $ref: "#/$defs/specification-extensions",
  11382. unevaluatedProperties: !1
  11383. },
  11384. contact: {
  11385. type: "object",
  11386. properties: {
  11387. name: {
  11388. type: "string"
  11389. },
  11390. url: {
  11391. type: "string"
  11392. },
  11393. email: {
  11394. type: "string"
  11395. }
  11396. },
  11397. $ref: "#/$defs/specification-extensions",
  11398. unevaluatedProperties: !1
  11399. },
  11400. license: {
  11401. type: "object",
  11402. properties: {
  11403. name: {
  11404. type: "string"
  11405. },
  11406. identifier: {
  11407. type: "string"
  11408. },
  11409. url: {
  11410. $ref: "#/$defs/uri"
  11411. }
  11412. },
  11413. required: [
  11414. "name"
  11415. ],
  11416. oneOf: [
  11417. {
  11418. required: [
  11419. "identifier"
  11420. ]
  11421. },
  11422. {
  11423. required: [
  11424. "url"
  11425. ]
  11426. }
  11427. ],
  11428. $ref: "#/$defs/specification-extensions",
  11429. unevaluatedProperties: !1
  11430. },
  11431. server: {
  11432. type: "object",
  11433. properties: {
  11434. url: {
  11435. $ref: "#/$defs/uri"
  11436. },
  11437. description: {
  11438. type: "string"
  11439. },
  11440. variables: {
  11441. type: "object",
  11442. additionalProperties: {
  11443. $ref: "#/$defs/server-variable"
  11444. }
  11445. }
  11446. },
  11447. required: [
  11448. "url"
  11449. ],
  11450. $ref: "#/$defs/specification-extensions",
  11451. unevaluatedProperties: !1
  11452. },
  11453. "server-variable": {
  11454. type: "object",
  11455. properties: {
  11456. enum: {
  11457. type: "array",
  11458. items: {
  11459. type: "string"
  11460. },
  11461. minItems: 1
  11462. },
  11463. default: {
  11464. type: "string"
  11465. },
  11466. descriptions: {
  11467. type: "string"
  11468. }
  11469. },
  11470. required: [
  11471. "default"
  11472. ],
  11473. $ref: "#/$defs/specification-extensions",
  11474. unevaluatedProperties: !1
  11475. },
  11476. components: {
  11477. type: "object",
  11478. properties: {
  11479. schemas: {
  11480. type: "object",
  11481. additionalProperties: {
  11482. $dynamicRef: "#meta"
  11483. }
  11484. },
  11485. responses: {
  11486. type: "object",
  11487. additionalProperties: {
  11488. $ref: "#/$defs/response-or-reference"
  11489. }
  11490. },
  11491. parameters: {
  11492. type: "object",
  11493. additionalProperties: {
  11494. $ref: "#/$defs/parameter-or-reference"
  11495. }
  11496. },
  11497. examples: {
  11498. type: "object",
  11499. additionalProperties: {
  11500. $ref: "#/$defs/example-or-reference"
  11501. }
  11502. },
  11503. requestBodies: {
  11504. type: "object",
  11505. additionalProperties: {
  11506. $ref: "#/$defs/request-body-or-reference"
  11507. }
  11508. },
  11509. headers: {
  11510. type: "object",
  11511. additionalProperties: {
  11512. $ref: "#/$defs/header-or-reference"
  11513. }
  11514. },
  11515. securitySchemes: {
  11516. type: "object",
  11517. additionalProperties: {
  11518. $ref: "#/$defs/security-scheme-or-reference"
  11519. }
  11520. },
  11521. links: {
  11522. type: "object",
  11523. additionalProperties: {
  11524. $ref: "#/$defs/link-or-reference"
  11525. }
  11526. },
  11527. callbacks: {
  11528. type: "object",
  11529. additionalProperties: {
  11530. $ref: "#/$defs/callbacks-or-reference"
  11531. }
  11532. },
  11533. pathItems: {
  11534. type: "object",
  11535. additionalProperties: {
  11536. $ref: "#/$defs/path-item-or-reference"
  11537. }
  11538. }
  11539. },
  11540. patternProperties: {
  11541. "^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$": {
  11542. $comment: "Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected",
  11543. propertyNames: {
  11544. pattern: "^[a-zA-Z0-9._-]+$"
  11545. }
  11546. }
  11547. },
  11548. $ref: "#/$defs/specification-extensions",
  11549. unevaluatedProperties: !1
  11550. },
  11551. paths: {
  11552. type: "object",
  11553. patternProperties: {
  11554. "^/": {
  11555. $ref: "#/$defs/path-item"
  11556. }
  11557. },
  11558. $ref: "#/$defs/specification-extensions",
  11559. unevaluatedProperties: !1
  11560. },
  11561. "path-item": {
  11562. type: "object",
  11563. properties: {
  11564. summary: {
  11565. type: "string"
  11566. },
  11567. description: {
  11568. type: "string"
  11569. },
  11570. servers: {
  11571. type: "array",
  11572. items: {
  11573. $ref: "#/$defs/server"
  11574. }
  11575. },
  11576. parameters: {
  11577. type: "array",
  11578. items: {
  11579. $ref: "#/$defs/parameter-or-reference"
  11580. }
  11581. }
  11582. },
  11583. patternProperties: {
  11584. "^(get|put|post|delete|options|head|patch|trace)$": {
  11585. $ref: "#/$defs/operation"
  11586. }
  11587. },
  11588. $ref: "#/$defs/specification-extensions",
  11589. unevaluatedProperties: !1
  11590. },
  11591. "path-item-or-reference": {
  11592. if: {
  11593. required: [
  11594. "$ref"
  11595. ]
  11596. },
  11597. then: {
  11598. $ref: "#/$defs/reference"
  11599. },
  11600. else: {
  11601. $ref: "#/$defs/path-item"
  11602. }
  11603. },
  11604. operation: {
  11605. type: "object",
  11606. properties: {
  11607. tags: {
  11608. type: "array",
  11609. items: {
  11610. type: "string"
  11611. }
  11612. },
  11613. summary: {
  11614. type: "string"
  11615. },
  11616. description: {
  11617. type: "string"
  11618. },
  11619. externalDocs: {
  11620. $ref: "#/$defs/external-documentation"
  11621. },
  11622. operationId: {
  11623. type: "string"
  11624. },
  11625. parameters: {
  11626. type: "array",
  11627. items: {
  11628. $ref: "#/$defs/parameter-or-reference"
  11629. }
  11630. },
  11631. requestBody: {
  11632. $ref: "#/$defs/request-body-or-reference"
  11633. },
  11634. responses: {
  11635. $ref: "#/$defs/responses"
  11636. },
  11637. callbacks: {
  11638. type: "object",
  11639. additionalProperties: {
  11640. $ref: "#/$defs/callbacks-or-reference"
  11641. }
  11642. },
  11643. deprecated: {
  11644. default: !1,
  11645. type: "boolean"
  11646. },
  11647. security: {
  11648. type: "array",
  11649. items: {
  11650. $ref: "#/$defs/security-requirement"
  11651. }
  11652. },
  11653. servers: {
  11654. type: "array",
  11655. items: {
  11656. $ref: "#/$defs/server"
  11657. }
  11658. }
  11659. },
  11660. $ref: "#/$defs/specification-extensions",
  11661. unevaluatedProperties: !1
  11662. },
  11663. "external-documentation": {
  11664. type: "object",
  11665. properties: {
  11666. description: {
  11667. type: "string"
  11668. },
  11669. url: {
  11670. $ref: "#/$defs/uri"
  11671. }
  11672. },
  11673. required: [
  11674. "url"
  11675. ],
  11676. $ref: "#/$defs/specification-extensions",
  11677. unevaluatedProperties: !1
  11678. },
  11679. parameter: {
  11680. type: "object",
  11681. properties: {
  11682. name: {
  11683. type: "string"
  11684. },
  11685. in: {
  11686. enum: [
  11687. "query",
  11688. "header",
  11689. "path",
  11690. "cookie"
  11691. ]
  11692. },
  11693. description: {
  11694. type: "string"
  11695. },
  11696. required: {
  11697. default: !1,
  11698. type: "boolean"
  11699. },
  11700. deprecated: {
  11701. default: !1,
  11702. type: "boolean"
  11703. },
  11704. allowEmptyValue: {
  11705. default: !1,
  11706. type: "boolean"
  11707. },
  11708. schema: {
  11709. $dynamicRef: "#meta"
  11710. },
  11711. content: {
  11712. $ref: "#/$defs/content"
  11713. }
  11714. },
  11715. required: [
  11716. "in"
  11717. ],
  11718. oneOf: [
  11719. {
  11720. required: [
  11721. "schema"
  11722. ]
  11723. },
  11724. {
  11725. required: [
  11726. "content"
  11727. ]
  11728. }
  11729. ],
  11730. dependentSchemas: {
  11731. schema: {
  11732. properties: {
  11733. style: {
  11734. type: "string"
  11735. },
  11736. explode: {
  11737. type: "boolean"
  11738. },
  11739. allowReserved: {
  11740. default: !1,
  11741. type: "boolean"
  11742. }
  11743. },
  11744. allOf: [
  11745. {
  11746. $ref: "#/$defs/examples"
  11747. },
  11748. {
  11749. $ref: "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path"
  11750. },
  11751. {
  11752. $ref: "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header"
  11753. },
  11754. {
  11755. $ref: "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query"
  11756. },
  11757. {
  11758. $ref: "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie"
  11759. },
  11760. {
  11761. $ref: "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-form"
  11762. }
  11763. ],
  11764. $defs: {
  11765. "styles-for-path": {
  11766. if: {
  11767. properties: {
  11768. in: {
  11769. const: "path"
  11770. }
  11771. },
  11772. required: [
  11773. "in"
  11774. ]
  11775. },
  11776. then: {
  11777. properties: {
  11778. style: {
  11779. default: "simple",
  11780. enum: [
  11781. "matrix",
  11782. "label",
  11783. "simple"
  11784. ]
  11785. },
  11786. required: {
  11787. const: !0
  11788. }
  11789. },
  11790. required: [
  11791. "required"
  11792. ]
  11793. }
  11794. },
  11795. "styles-for-header": {
  11796. if: {
  11797. properties: {
  11798. in: {
  11799. const: "header"
  11800. }
  11801. },
  11802. required: [
  11803. "in"
  11804. ]
  11805. },
  11806. then: {
  11807. properties: {
  11808. style: {
  11809. default: "simple",
  11810. enum: [
  11811. "simple"
  11812. ]
  11813. }
  11814. }
  11815. }
  11816. },
  11817. "styles-for-query": {
  11818. if: {
  11819. properties: {
  11820. in: {
  11821. const: "query"
  11822. }
  11823. },
  11824. required: [
  11825. "in"
  11826. ]
  11827. },
  11828. then: {
  11829. properties: {
  11830. style: {
  11831. default: "form",
  11832. enum: [
  11833. "form",
  11834. "spaceDelimited",
  11835. "pipeDelimited",
  11836. "deepObject"
  11837. ]
  11838. }
  11839. }
  11840. }
  11841. },
  11842. "styles-for-cookie": {
  11843. if: {
  11844. properties: {
  11845. in: {
  11846. const: "cookie"
  11847. }
  11848. },
  11849. required: [
  11850. "in"
  11851. ]
  11852. },
  11853. then: {
  11854. properties: {
  11855. style: {
  11856. default: "form",
  11857. enum: [
  11858. "form"
  11859. ]
  11860. }
  11861. }
  11862. }
  11863. },
  11864. "styles-for-form": {
  11865. if: {
  11866. properties: {
  11867. style: {
  11868. const: "form"
  11869. }
  11870. },
  11871. required: [
  11872. "style"
  11873. ]
  11874. },
  11875. then: {
  11876. properties: {
  11877. explode: {
  11878. default: !0
  11879. }
  11880. }
  11881. },
  11882. else: {
  11883. properties: {
  11884. explode: {
  11885. default: !1
  11886. }
  11887. }
  11888. }
  11889. }
  11890. }
  11891. }
  11892. },
  11893. $ref: "#/$defs/specification-extensions",
  11894. unevaluatedProperties: !1
  11895. },
  11896. "parameter-or-reference": {
  11897. if: {
  11898. required: [
  11899. "$ref"
  11900. ]
  11901. },
  11902. then: {
  11903. $ref: "#/$defs/reference"
  11904. },
  11905. else: {
  11906. $ref: "#/$defs/parameter"
  11907. }
  11908. },
  11909. "request-body": {
  11910. type: "object",
  11911. properties: {
  11912. description: {
  11913. type: "string"
  11914. },
  11915. content: {
  11916. $ref: "#/$defs/content"
  11917. },
  11918. required: {
  11919. default: !1,
  11920. type: "boolean"
  11921. }
  11922. },
  11923. required: [
  11924. "content"
  11925. ],
  11926. $ref: "#/$defs/specification-extensions",
  11927. unevaluatedProperties: !1
  11928. },
  11929. "request-body-or-reference": {
  11930. if: {
  11931. required: [
  11932. "$ref"
  11933. ]
  11934. },
  11935. then: {
  11936. $ref: "#/$defs/reference"
  11937. },
  11938. else: {
  11939. $ref: "#/$defs/request-body"
  11940. }
  11941. },
  11942. content: {
  11943. type: "object",
  11944. additionalProperties: {
  11945. $ref: "#/$defs/media-type"
  11946. },
  11947. propertyNames: {
  11948. format: "media-range"
  11949. }
  11950. },
  11951. "media-type": {
  11952. type: "object",
  11953. properties: {
  11954. schema: {
  11955. $dynamicRef: "#meta"
  11956. },
  11957. encoding: {
  11958. type: "object",
  11959. additionalProperties: {
  11960. $ref: "#/$defs/encoding"
  11961. }
  11962. }
  11963. },
  11964. allOf: [
  11965. {
  11966. $ref: "#/$defs/specification-extensions"
  11967. },
  11968. {
  11969. $ref: "#/$defs/examples"
  11970. }
  11971. ],
  11972. unevaluatedProperties: !1
  11973. },
  11974. encoding: {
  11975. type: "object",
  11976. properties: {
  11977. contentType: {
  11978. type: "string",
  11979. format: "media-range"
  11980. },
  11981. headers: {
  11982. type: "object",
  11983. additionalProperties: {
  11984. $ref: "#/$defs/header-or-reference"
  11985. }
  11986. },
  11987. style: {
  11988. default: "form",
  11989. enum: [
  11990. "form",
  11991. "spaceDelimited",
  11992. "pipeDelimited",
  11993. "deepObject"
  11994. ]
  11995. },
  11996. explode: {
  11997. type: "boolean"
  11998. },
  11999. allowReserved: {
  12000. default: !1,
  12001. type: "boolean"
  12002. }
  12003. },
  12004. allOf: [
  12005. {
  12006. $ref: "#/$defs/specification-extensions"
  12007. },
  12008. {
  12009. $ref: "#/$defs/encoding/$defs/explode-default"
  12010. }
  12011. ],
  12012. unevaluatedProperties: !1,
  12013. $defs: {
  12014. "explode-default": {
  12015. if: {
  12016. properties: {
  12017. style: {
  12018. const: "form"
  12019. }
  12020. },
  12021. required: [
  12022. "style"
  12023. ]
  12024. },
  12025. then: {
  12026. properties: {
  12027. explode: {
  12028. default: !0
  12029. }
  12030. }
  12031. },
  12032. else: {
  12033. properties: {
  12034. explode: {
  12035. default: !1
  12036. }
  12037. }
  12038. }
  12039. }
  12040. }
  12041. },
  12042. responses: {
  12043. type: "object",
  12044. properties: {
  12045. default: {
  12046. $ref: "#/$defs/response-or-reference"
  12047. }
  12048. },
  12049. patternProperties: {
  12050. "^[1-5][0-9X]{2}$": {
  12051. $ref: "#/$defs/response-or-reference"
  12052. }
  12053. },
  12054. $ref: "#/$defs/specification-extensions",
  12055. unevaluatedProperties: !1
  12056. },
  12057. response: {
  12058. type: "object",
  12059. properties: {
  12060. description: {
  12061. type: "string"
  12062. },
  12063. headers: {
  12064. type: "object",
  12065. additionalProperties: {
  12066. $ref: "#/$defs/header-or-reference"
  12067. }
  12068. },
  12069. content: {
  12070. $ref: "#/$defs/content"
  12071. },
  12072. links: {
  12073. type: "object",
  12074. additionalProperties: {
  12075. $ref: "#/$defs/link-or-reference"
  12076. }
  12077. }
  12078. },
  12079. required: [
  12080. "description"
  12081. ],
  12082. $ref: "#/$defs/specification-extensions",
  12083. unevaluatedProperties: !1
  12084. },
  12085. "response-or-reference": {
  12086. if: {
  12087. required: [
  12088. "$ref"
  12089. ]
  12090. },
  12091. then: {
  12092. $ref: "#/$defs/reference"
  12093. },
  12094. else: {
  12095. $ref: "#/$defs/response"
  12096. }
  12097. },
  12098. callbacks: {
  12099. type: "object",
  12100. $ref: "#/$defs/specification-extensions",
  12101. additionalProperties: {
  12102. $ref: "#/$defs/path-item-or-reference"
  12103. }
  12104. },
  12105. "callbacks-or-reference": {
  12106. if: {
  12107. required: [
  12108. "$ref"
  12109. ]
  12110. },
  12111. then: {
  12112. $ref: "#/$defs/reference"
  12113. },
  12114. else: {
  12115. $ref: "#/$defs/callbacks"
  12116. }
  12117. },
  12118. example: {
  12119. type: "object",
  12120. properties: {
  12121. summary: {
  12122. type: "string"
  12123. },
  12124. description: {
  12125. type: "string"
  12126. },
  12127. value: !0,
  12128. externalValue: {
  12129. $ref: "#/$defs/uri"
  12130. }
  12131. },
  12132. $ref: "#/$defs/specification-extensions",
  12133. unevaluatedProperties: !1
  12134. },
  12135. "example-or-reference": {
  12136. if: {
  12137. required: [
  12138. "$ref"
  12139. ]
  12140. },
  12141. then: {
  12142. $ref: "#/$defs/reference"
  12143. },
  12144. else: {
  12145. $ref: "#/$defs/example"
  12146. }
  12147. },
  12148. link: {
  12149. type: "object",
  12150. properties: {
  12151. operationRef: {
  12152. $ref: "#/$defs/uri"
  12153. },
  12154. operationId: !0,
  12155. parameters: {
  12156. $ref: "#/$defs/map-of-strings"
  12157. },
  12158. requestBody: !0,
  12159. description: {
  12160. type: "string"
  12161. },
  12162. body: {
  12163. $ref: "#/$defs/server"
  12164. }
  12165. },
  12166. oneOf: [
  12167. {
  12168. required: [
  12169. "operationRef"
  12170. ]
  12171. },
  12172. {
  12173. required: [
  12174. "operationId"
  12175. ]
  12176. }
  12177. ],
  12178. $ref: "#/$defs/specification-extensions",
  12179. unevaluatedProperties: !1
  12180. },
  12181. "link-or-reference": {
  12182. if: {
  12183. required: [
  12184. "$ref"
  12185. ]
  12186. },
  12187. then: {
  12188. $ref: "#/$defs/reference"
  12189. },
  12190. else: {
  12191. $ref: "#/$defs/link"
  12192. }
  12193. },
  12194. header: {
  12195. type: "object",
  12196. properties: {
  12197. description: {
  12198. type: "string"
  12199. },
  12200. required: {
  12201. default: !1,
  12202. type: "boolean"
  12203. },
  12204. deprecated: {
  12205. default: !1,
  12206. type: "boolean"
  12207. },
  12208. allowEmptyValue: {
  12209. default: !1,
  12210. type: "boolean"
  12211. }
  12212. },
  12213. dependentSchemas: {
  12214. schema: {
  12215. properties: {
  12216. style: {
  12217. default: "simple",
  12218. enum: [
  12219. "simple"
  12220. ]
  12221. },
  12222. explode: {
  12223. default: !1,
  12224. type: "boolean"
  12225. },
  12226. allowReserved: {
  12227. default: !1,
  12228. type: "boolean"
  12229. },
  12230. schema: {
  12231. $dynamicRef: "#meta"
  12232. }
  12233. },
  12234. $ref: "#/$defs/examples"
  12235. },
  12236. content: {
  12237. properties: {
  12238. content: {
  12239. $ref: "#/$defs/content"
  12240. }
  12241. }
  12242. }
  12243. },
  12244. $ref: "#/$defs/specification-extensions",
  12245. unevaluatedProperties: !1
  12246. },
  12247. "header-or-reference": {
  12248. if: {
  12249. required: [
  12250. "$ref"
  12251. ]
  12252. },
  12253. then: {
  12254. $ref: "#/$defs/reference"
  12255. },
  12256. else: {
  12257. $ref: "#/$defs/header"
  12258. }
  12259. },
  12260. tag: {
  12261. type: "object",
  12262. properties: {
  12263. name: {
  12264. type: "string"
  12265. },
  12266. description: {
  12267. type: "string"
  12268. },
  12269. externalDocs: {
  12270. $ref: "#/$defs/external-documentation"
  12271. }
  12272. },
  12273. required: [
  12274. "name"
  12275. ],
  12276. $ref: "#/$defs/specification-extensions",
  12277. unevaluatedProperties: !1
  12278. },
  12279. reference: {
  12280. type: "object",
  12281. properties: {
  12282. $ref: {
  12283. $ref: "#/$defs/uri"
  12284. },
  12285. summary: {
  12286. type: "string"
  12287. },
  12288. description: {
  12289. type: "string"
  12290. }
  12291. },
  12292. unevaluatedProperties: !1
  12293. },
  12294. schema: {
  12295. $dynamicAnchor: "meta",
  12296. type: [
  12297. "object",
  12298. "boolean"
  12299. ]
  12300. },
  12301. "security-scheme": {
  12302. type: "object",
  12303. properties: {
  12304. type: {
  12305. enum: [
  12306. "apiKey",
  12307. "http",
  12308. "mutualTLS",
  12309. "oauth2",
  12310. "openIdConnect"
  12311. ]
  12312. },
  12313. description: {
  12314. type: "string"
  12315. }
  12316. },
  12317. required: [
  12318. "type"
  12319. ],
  12320. allOf: [
  12321. {
  12322. $ref: "#/$defs/specification-extensions"
  12323. },
  12324. {
  12325. $ref: "#/$defs/security-scheme/$defs/type-apikey"
  12326. },
  12327. {
  12328. $ref: "#/$defs/security-scheme/$defs/type-http"
  12329. },
  12330. {
  12331. $ref: "#/$defs/security-scheme/$defs/type-http-bearer"
  12332. },
  12333. {
  12334. $ref: "#/$defs/security-scheme/$defs/type-oauth2"
  12335. },
  12336. {
  12337. $ref: "#/$defs/security-scheme/$defs/type-oidc"
  12338. }
  12339. ],
  12340. unevaluatedProperties: !1,
  12341. $defs: {
  12342. "type-apikey": {
  12343. if: {
  12344. properties: {
  12345. type: {
  12346. const: "apiKey"
  12347. }
  12348. },
  12349. required: [
  12350. "type"
  12351. ]
  12352. },
  12353. then: {
  12354. properties: {
  12355. name: {
  12356. type: "string"
  12357. },
  12358. in: {
  12359. enum: [
  12360. "query",
  12361. "header",
  12362. "cookie"
  12363. ]
  12364. }
  12365. },
  12366. required: [
  12367. "name",
  12368. "in"
  12369. ]
  12370. }
  12371. },
  12372. "type-http": {
  12373. if: {
  12374. properties: {
  12375. type: {
  12376. const: "http"
  12377. }
  12378. },
  12379. required: [
  12380. "type"
  12381. ]
  12382. },
  12383. then: {
  12384. properties: {
  12385. scheme: {
  12386. type: "string"
  12387. }
  12388. },
  12389. required: [
  12390. "scheme"
  12391. ]
  12392. }
  12393. },
  12394. "type-http-bearer": {
  12395. if: {
  12396. properties: {
  12397. type: {
  12398. const: "http"
  12399. },
  12400. scheme: {
  12401. const: "bearer"
  12402. }
  12403. },
  12404. required: [
  12405. "type",
  12406. "scheme"
  12407. ]
  12408. },
  12409. then: {
  12410. properties: {
  12411. bearerFormat: {
  12412. type: "string"
  12413. }
  12414. },
  12415. required: [
  12416. "scheme"
  12417. ]
  12418. }
  12419. },
  12420. "type-oauth2": {
  12421. if: {
  12422. properties: {
  12423. type: {
  12424. const: "oauth2"
  12425. }
  12426. },
  12427. required: [
  12428. "type"
  12429. ]
  12430. },
  12431. then: {
  12432. properties: {
  12433. flows: {
  12434. $ref: "#/$defs/oauth-flows"
  12435. }
  12436. },
  12437. required: [
  12438. "flows"
  12439. ]
  12440. }
  12441. },
  12442. "type-oidc": {
  12443. if: {
  12444. properties: {
  12445. type: {
  12446. const: "openIdConnect"
  12447. }
  12448. },
  12449. required: [
  12450. "type"
  12451. ]
  12452. },
  12453. then: {
  12454. properties: {
  12455. openIdConnectUrl: {
  12456. $ref: "#/$defs/uri"
  12457. }
  12458. },
  12459. required: [
  12460. "openIdConnectUrl"
  12461. ]
  12462. }
  12463. }
  12464. }
  12465. },
  12466. "security-scheme-or-reference": {
  12467. if: {
  12468. required: [
  12469. "$ref"
  12470. ]
  12471. },
  12472. then: {
  12473. $ref: "#/$defs/reference"
  12474. },
  12475. else: {
  12476. $ref: "#/$defs/security-scheme"
  12477. }
  12478. },
  12479. "oauth-flows": {
  12480. type: "object",
  12481. properties: {
  12482. implicit: {
  12483. $ref: "#/$defs/oauth-flows/$defs/implicit"
  12484. },
  12485. password: {
  12486. $ref: "#/$defs/oauth-flows/$defs/password"
  12487. },
  12488. clientCredentials: {
  12489. $ref: "#/$defs/oauth-flows/$defs/client-credentials"
  12490. },
  12491. authorizationCode: {
  12492. $ref: "#/$defs/oauth-flows/$defs/authorization-code"
  12493. }
  12494. },
  12495. $ref: "#/$defs/specification-extensions",
  12496. unevaluatedProperties: !1,
  12497. $defs: {
  12498. implicit: {
  12499. type: "object",
  12500. properties: {
  12501. authorizationUrl: {
  12502. type: "string"
  12503. },
  12504. refreshUrl: {
  12505. type: "string"
  12506. },
  12507. scopes: {
  12508. $ref: "#/$defs/map-of-strings"
  12509. }
  12510. },
  12511. required: [
  12512. "authorizationUrl",
  12513. "scopes"
  12514. ],
  12515. $ref: "#/$defs/specification-extensions",
  12516. unevaluatedProperties: !1
  12517. },
  12518. password: {
  12519. type: "object",
  12520. properties: {
  12521. tokenUrl: {
  12522. type: "string"
  12523. },
  12524. refreshUrl: {
  12525. type: "string"
  12526. },
  12527. scopes: {
  12528. $ref: "#/$defs/map-of-strings"
  12529. }
  12530. },
  12531. required: [
  12532. "tokenUrl",
  12533. "scopes"
  12534. ],
  12535. $ref: "#/$defs/specification-extensions",
  12536. unevaluatedProperties: !1
  12537. },
  12538. "client-credentials": {
  12539. type: "object",
  12540. properties: {
  12541. tokenUrl: {
  12542. type: "string"
  12543. },
  12544. refreshUrl: {
  12545. type: "string"
  12546. },
  12547. scopes: {
  12548. $ref: "#/$defs/map-of-strings"
  12549. }
  12550. },
  12551. required: [
  12552. "tokenUrl",
  12553. "scopes"
  12554. ],
  12555. $ref: "#/$defs/specification-extensions",
  12556. unevaluatedProperties: !1
  12557. },
  12558. "authorization-code": {
  12559. type: "object",
  12560. properties: {
  12561. authorizationUrl: {
  12562. type: "string"
  12563. },
  12564. tokenUrl: {
  12565. type: "string"
  12566. },
  12567. refreshUrl: {
  12568. type: "string"
  12569. },
  12570. scopes: {
  12571. $ref: "#/$defs/map-of-strings"
  12572. }
  12573. },
  12574. required: [
  12575. "authorizationUrl",
  12576. "tokenUrl",
  12577. "scopes"
  12578. ],
  12579. $ref: "#/$defs/specification-extensions",
  12580. unevaluatedProperties: !1
  12581. }
  12582. }
  12583. },
  12584. "security-requirement": {
  12585. type: "object",
  12586. additionalProperties: {
  12587. type: "array",
  12588. items: {
  12589. type: "string"
  12590. }
  12591. }
  12592. },
  12593. "specification-extensions": {
  12594. patternProperties: {
  12595. "^x-": !0
  12596. }
  12597. },
  12598. examples: {
  12599. properties: {
  12600. example: !0,
  12601. examples: {
  12602. type: "object",
  12603. additionalProperties: {
  12604. $ref: "#/$defs/example-or-reference"
  12605. }
  12606. }
  12607. }
  12608. },
  12609. uri: {
  12610. type: "string",
  12611. format: "uri"
  12612. },
  12613. "map-of-strings": {
  12614. type: "object",
  12615. additionalProperties: {
  12616. type: "string"
  12617. }
  12618. }
  12619. }, V$ = {
  12620. $id: I$,
  12621. $schema: T$,
  12622. type: R$,
  12623. properties: k$,
  12624. required: N$,
  12625. anyOf: M$,
  12626. $ref: D$,
  12627. unevaluatedProperties: q$,
  12628. $defs: F$
  12629. };
  12630. (function(e, t) {
  12631. Object.defineProperty(t, "__esModule", { value: !0 }), t.openapi = t.openapiV31 = t.openapiV3 = t.openapiV2 = t.openapiV1 = void 0, t.openapiV1 = u$, t.openapiV2 = v$, t.openapiV3 = C$, t.openapiV31 = V$, t.openapi = {
  12632. v1: t.openapiV1,
  12633. v2: t.openapiV2,
  12634. v3: t.openapiV3,
  12635. v31: t.openapiV31
  12636. }, t.default = t.openapi, e.exports = Object.assign(e.exports.default, e.exports);
  12637. })(oi, oi.exports);
  12638. var L$ = oi.exports;
  12639. const H$ = nt, { ono: U$ } = je, z$ = Sm, G$ = r$, { openapi: Fn } = L$;
  12640. var El = B$;
  12641. function B$(e) {
  12642. let t, r;
  12643. if (e.swagger)
  12644. r = Fn.v2, t = Vn();
  12645. else if (e.openapi.startsWith("3.1")) {
  12646. r = Fn.v31;
  12647. const i = r.$defs.schema;
  12648. delete i.$dynamicAnchor, r.$defs.components.properties.schemas.additionalProperties = i, r.$defs.header.dependentSchemas.schema.properties.schema = i, r.$defs["media-type"].properties.schema = i, r.$defs.parameter.properties.schema = i, t = Vn(!1);
  12649. } else
  12650. r = Fn.v3, t = Vn();
  12651. if (!t.validate(r, e)) {
  12652. let i = t.errors, s = `Swagger schema validation failed.
  12653. ` + K$(i);
  12654. throw U$.syntax(i, { details: i }, s);
  12655. }
  12656. }
  12657. function Vn(e = !0) {
  12658. const t = {
  12659. allErrors: !0,
  12660. strict: !1,
  12661. validateFormats: !1
  12662. };
  12663. return e ? new z$(t) : new G$(t);
  12664. }
  12665. function K$(e, t) {
  12666. t = t || " ";
  12667. let r = "";
  12668. for (let n of e)
  12669. r += H$.format(`${t}#${n.instancePath.length ? n.instancePath : "/"} ${n.message}
  12670. `);
  12671. return r;
  12672. }
  12673. var W$ = [
  12674. "get",
  12675. "put",
  12676. "post",
  12677. "delete",
  12678. "options",
  12679. "head",
  12680. "patch"
  12681. ];
  12682. const J$ = nt, { ono: te } = je, Y$ = W$, ai = ["array", "boolean", "integer", "number", "string"], Sl = ["array", "boolean", "integer", "number", "string", "object", "null", void 0];
  12683. var xl = X$;
  12684. function X$(e) {
  12685. if (e.openapi)
  12686. return;
  12687. let t = Object.keys(e.paths || {}), r = [];
  12688. for (let i of t) {
  12689. let s = e.paths[i], o = "/paths" + i;
  12690. s && i.indexOf("/") === 0 && Q$(e, s, o, r);
  12691. }
  12692. let n = Object.keys(e.definitions || {});
  12693. for (let i of n) {
  12694. let s = e.definitions[i], o = "/definitions/" + i;
  12695. jl(s, o);
  12696. }
  12697. }
  12698. function Q$(e, t, r, n) {
  12699. for (let i of Y$) {
  12700. let s = t[i], o = r + "/" + i;
  12701. if (s) {
  12702. let a = s.operationId;
  12703. if (a)
  12704. if (n.indexOf(a) === -1)
  12705. n.push(a);
  12706. else
  12707. throw te.syntax(`Validation failed. Duplicate operation id '${a}'`);
  12708. Z$(e, t, r, s, o);
  12709. let l = Object.keys(s.responses || {});
  12710. for (let c of l) {
  12711. let f = s.responses[c], u = o + "/responses/" + c;
  12712. n_(c, f || {}, u);
  12713. }
  12714. }
  12715. }
  12716. }
  12717. function Z$(e, t, r, n, i) {
  12718. let s = t.parameters || [], o = n.parameters || [];
  12719. try {
  12720. To(s);
  12721. } catch (l) {
  12722. throw te.syntax(l, `Validation failed. ${r} has duplicate parameters`);
  12723. }
  12724. try {
  12725. To(o);
  12726. } catch (l) {
  12727. throw te.syntax(l, `Validation failed. ${i} has duplicate parameters`);
  12728. }
  12729. let a = s.reduce((l, c) => (l.some((u) => u.in === c.in && u.name === c.name) || l.push(c), l), o.slice());
  12730. e_(a, i), t_(a, r, i), r_(a, e, n, i);
  12731. }
  12732. function e_(e, t) {
  12733. let r = e.filter((i) => i.in === "body"), n = e.filter((i) => i.in === "formData");
  12734. if (r.length > 1)
  12735. throw te.syntax(
  12736. `Validation failed. ${t} has ${r.length} body parameters. Only one is allowed.`
  12737. );
  12738. if (r.length > 0 && n.length > 0)
  12739. throw te.syntax(
  12740. `Validation failed. ${t} has body parameters and formData parameters. Only one or the other is allowed.`
  12741. );
  12742. }
  12743. function t_(e, t, r) {
  12744. let n = t.match(J$.swaggerParamRegExp) || [];
  12745. for (let i = 0; i < n.length; i++)
  12746. for (let s = i + 1; s < n.length; s++)
  12747. if (n[i] === n[s])
  12748. throw te.syntax(
  12749. `Validation failed. ${r} has multiple path placeholders named ${n[i]}`
  12750. );
  12751. e = e.filter((i) => i.in === "path");
  12752. for (let i of e) {
  12753. if (i.required !== !0)
  12754. throw te.syntax(
  12755. `Validation failed. Path parameters cannot be optional. Set required=true for the "${i.name}" parameter at ${r}`
  12756. );
  12757. let s = n.indexOf("{" + i.name + "}");
  12758. if (s === -1)
  12759. throw te.syntax(
  12760. `Validation failed. ${r} has a path parameter named "${i.name}", but there is no corresponding {${i.name}} in the path string`
  12761. );
  12762. n.splice(s, 1);
  12763. }
  12764. if (n.length > 0)
  12765. throw te.syntax(`Validation failed. ${r} is missing path parameter(s) for ${n}`);
  12766. }
  12767. function r_(e, t, r, n) {
  12768. for (let i of e) {
  12769. let s = n + "/parameters/" + i.name, o, a;
  12770. switch (i.in) {
  12771. case "body":
  12772. o = i.schema, a = Sl;
  12773. break;
  12774. case "formData":
  12775. o = i, a = ai.concat("file");
  12776. break;
  12777. default:
  12778. o = i, a = ai;
  12779. }
  12780. if (li(o, s, a), jl(o, s), o.type === "file") {
  12781. let l = /multipart\/(.*\+)?form-data/, c = /application\/(.*\+)?x-www-form-urlencoded/;
  12782. if (!(r.consumes || t.consumes || []).some((h) => l.test(h) || c.test(h)))
  12783. throw te.syntax(
  12784. `Validation failed. ${n} has a file parameter, so it must consume multipart/form-data or application/x-www-form-urlencoded`
  12785. );
  12786. }
  12787. }
  12788. }
  12789. function To(e) {
  12790. for (let t = 0; t < e.length - 1; t++) {
  12791. let r = e[t];
  12792. for (let n = t + 1; n < e.length; n++) {
  12793. let i = e[n];
  12794. if (r.name === i.name && r.in === i.in)
  12795. throw te.syntax(`Validation failed. Found multiple ${r.in} parameters named "${r.name}"`);
  12796. }
  12797. }
  12798. }
  12799. function n_(e, t, r) {
  12800. if (e !== "default" && (e < 100 || e > 599))
  12801. throw te.syntax(`Validation failed. ${r} has an invalid response code (${e})`);
  12802. let n = Object.keys(t.headers || {});
  12803. for (let i of n) {
  12804. let s = t.headers[i], o = r + "/headers/" + i;
  12805. li(s, o, ai);
  12806. }
  12807. if (t.schema) {
  12808. let i = Sl.concat("file");
  12809. if (i.indexOf(t.schema.type) === -1)
  12810. throw te.syntax(
  12811. `Validation failed. ${r} has an invalid response schema type (${t.schema.type})`
  12812. );
  12813. li(t.schema, r + "/schema", i);
  12814. }
  12815. }
  12816. function li(e, t, r) {
  12817. if (r.indexOf(e.type) === -1)
  12818. throw te.syntax(
  12819. `Validation failed. ${t} has an invalid type (${e.type})`
  12820. );
  12821. if (e.type === "array" && !e.items)
  12822. throw te.syntax(`Validation failed. ${t} is an array, so it must include an "items" schema`);
  12823. }
  12824. function jl(e, t) {
  12825. function r(n, i) {
  12826. if (n.properties)
  12827. for (let s in n.properties)
  12828. n.properties.hasOwnProperty(s) && (i[s] = n.properties[s]);
  12829. if (n.allOf)
  12830. for (let s of n.allOf)
  12831. r(s, i);
  12832. }
  12833. if (!(Array.isArray(e.type) && !e.type.includes("object")) && !(!Array.isArray(e.type) && e.type !== "object") && e.required && Array.isArray(e.required)) {
  12834. let n = {};
  12835. r(e, n);
  12836. for (let i of e.required)
  12837. if (!n[i])
  12838. throw te.syntax(
  12839. `Validation failed. Property '${i}' listed as required but does not exist in '${t}'`
  12840. );
  12841. }
  12842. }
  12843. var er = {}, $s = {}, pr = {}, hr = {}, B = {}, on = {}, i_ = j && j.__importDefault || function(e) {
  12844. return e && e.__esModule ? e : { default: e };
  12845. };
  12846. Object.defineProperty(on, "__esModule", { value: !0 });
  12847. on.default = s_;
  12848. const Ro = i_(_i);
  12849. function s_(e) {
  12850. var r, n, i, s;
  12851. return e.startsWith("\\\\?\\") ? e : e.split((n = (r = Ro.default) == null ? void 0 : r.win32) == null ? void 0 : n.sep).join(((s = (i = Ro.default) == null ? void 0 : i.posix) == null ? void 0 : s.sep) ?? "/");
  12852. }
  12853. var an = {};
  12854. Object.defineProperty(an, "__esModule", { value: !0 });
  12855. an.isWindows = void 0;
  12856. const o_ = /^win/.test(globalThis.process ? globalThis.process.platform : ""), a_ = () => o_;
  12857. an.isWindows = a_;
  12858. var l_ = j && j.__createBinding || (Object.create ? function(e, t, r, n) {
  12859. n === void 0 && (n = r);
  12860. var i = Object.getOwnPropertyDescriptor(t, r);
  12861. (!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: function() {
  12862. return t[r];
  12863. } }), Object.defineProperty(e, n, i);
  12864. } : function(e, t, r, n) {
  12865. n === void 0 && (n = r), e[n] = t[r];
  12866. }), c_ = j && j.__setModuleDefault || (Object.create ? function(e, t) {
  12867. Object.defineProperty(e, "default", { enumerable: !0, value: t });
  12868. } : function(e, t) {
  12869. e.default = t;
  12870. }), u_ = j && j.__importStar || function(e) {
  12871. if (e && e.__esModule) return e;
  12872. var t = {};
  12873. if (e != null) for (var r in e) r !== "default" && Object.prototype.hasOwnProperty.call(e, r) && l_(t, e, r);
  12874. return c_(t, e), t;
  12875. }, f_ = j && j.__importDefault || function(e) {
  12876. return e && e.__esModule ? e : { default: e };
  12877. };
  12878. Object.defineProperty(B, "__esModule", { value: !0 });
  12879. B.parse = void 0;
  12880. B.resolve = Al;
  12881. B.cwd = Cl;
  12882. B.getProtocol = _s;
  12883. B.getExtension = __;
  12884. B.stripQuery = Il;
  12885. B.getHash = Tl;
  12886. B.stripHash = ui;
  12887. B.isHttp = v_;
  12888. B.isFileSystemPath = fi;
  12889. B.fromFileSystemPath = b_;
  12890. B.toFileSystemPath = w_;
  12891. B.safePointerToPath = P_;
  12892. B.relative = O_;
  12893. const Cr = f_(on), ci = u_(_i), d_ = /\//g, p_ = /^(\w{2,}):\/\//i, h_ = /~1/g, m_ = /~0/g, y_ = _i, Pr = an, g_ = [
  12894. [/\?/g, "%3F"],
  12895. [/#/g, "%23"]
  12896. ], Ln = [/%23/g, "#", /%24/g, "$", /%26/g, "&", /%2C/g, ",", /%40/g, "@"], $_ = (e) => new URL(e);
  12897. B.parse = $_;
  12898. function Al(e, t) {
  12899. var s;
  12900. const r = new URL((0, Cr.default)(e), "resolve://"), n = new URL((0, Cr.default)(t), r), i = ((s = t.match(/(\s*)$/)) == null ? void 0 : s[1]) || "";
  12901. if (n.protocol === "resolve:") {
  12902. const { pathname: o, search: a, hash: l } = n;
  12903. return o + a + l + i;
  12904. }
  12905. return n.toString() + i;
  12906. }
  12907. function Cl() {
  12908. if (typeof window < "u")
  12909. return location.href;
  12910. const e = process.cwd(), t = e.slice(-1);
  12911. return t === "/" || t === "\\" ? e : e + "/";
  12912. }
  12913. function _s(e) {
  12914. const t = p_.exec(e || "");
  12915. if (t)
  12916. return t[1].toLowerCase();
  12917. }
  12918. function __(e) {
  12919. const t = e.lastIndexOf(".");
  12920. return t >= 0 ? Il(e.substr(t).toLowerCase()) : "";
  12921. }
  12922. function Il(e) {
  12923. const t = e.indexOf("?");
  12924. return t >= 0 && (e = e.substr(0, t)), e;
  12925. }
  12926. function Tl(e) {
  12927. if (!e)
  12928. return "#";
  12929. const t = e.indexOf("#");
  12930. return t >= 0 ? e.substring(t) : "#";
  12931. }
  12932. function ui(e) {
  12933. if (!e)
  12934. return "";
  12935. const t = e.indexOf("#");
  12936. return t >= 0 && (e = e.substring(0, t)), e;
  12937. }
  12938. function v_(e) {
  12939. const t = _s(e);
  12940. return t === "http" || t === "https" ? !0 : t === void 0 ? typeof window < "u" : !1;
  12941. }
  12942. function fi(e) {
  12943. if (typeof window < "u" || typeof process < "u" && process.browser)
  12944. return !1;
  12945. const t = _s(e);
  12946. return t === void 0 || t === "file";
  12947. }
  12948. function b_(e) {
  12949. var t;
  12950. if ((0, Pr.isWindows)()) {
  12951. const r = Cl(), n = e.toUpperCase(), s = (0, Cr.default)(r).toUpperCase(), o = n.includes(s), a = n.includes(s), l = ((t = ci.win32) == null ? void 0 : t.isAbsolute(e)) || e.startsWith("http://") || e.startsWith("https://") || e.startsWith("file://");
  12952. !(o || a || l) && !r.startsWith("http") && (e = (0, y_.join)(r, e)), e = (0, Cr.default)(e);
  12953. }
  12954. e = encodeURI(e);
  12955. for (const r of g_)
  12956. e = e.replace(r[0], r[1]);
  12957. return e;
  12958. }
  12959. function w_(e, t) {
  12960. e = decodeURI(e);
  12961. for (let n = 0; n < Ln.length; n += 2)
  12962. e = e.replace(Ln[n], Ln[n + 1]);
  12963. let r = e.substr(0, 7).toLowerCase() === "file://";
  12964. return r && (e = e[7] === "/" ? e.substr(8) : e.substr(7), (0, Pr.isWindows)() && e[1] === "/" && (e = e[0] + ":" + e.substr(1)), t ? e = "file:///" + e : (r = !1, e = (0, Pr.isWindows)() ? e : "/" + e)), (0, Pr.isWindows)() && !r && (e = e.replace(d_, "\\"), e.substr(1, 2) === ":\\" && (e = e[0].toUpperCase() + e.substr(1))), e;
  12965. }
  12966. function P_(e) {
  12967. return e.length <= 1 || e[0] !== "#" || e[1] !== "/" ? [] : e.slice(2).split("/").map((t) => decodeURIComponent(t).replace(h_, "/").replace(m_, "~"));
  12968. }
  12969. function O_(e, t) {
  12970. if (!fi(e) || !fi(t))
  12971. return Al(e, t);
  12972. const r = ci.default.dirname(ui(e)), n = ui(t);
  12973. return ci.default.relative(r, n) + Tl(t);
  12974. }
  12975. var V = {};
  12976. Object.defineProperty(V, "__esModule", { value: !0 });
  12977. V.InvalidPointerError = V.TimeoutError = V.MissingPointerError = V.UnmatchedResolverError = V.ResolverError = V.UnmatchedParserError = V.ParserError = V.JSONParserErrorGroup = V.JSONParserError = void 0;
  12978. V.isHandledError = T_;
  12979. V.normalizeError = R_;
  12980. const Rl = je, vs = B;
  12981. class Ne extends Error {
  12982. constructor(t, r) {
  12983. super(), this.code = "EUNKNOWN", this.name = "JSONParserError", this.message = t, this.source = r, this.path = null, Rl.Ono.extend(this);
  12984. }
  12985. get footprint() {
  12986. return `${this.path}+${this.source}+${this.code}+${this.message}`;
  12987. }
  12988. }
  12989. V.JSONParserError = Ne;
  12990. class ln extends Error {
  12991. constructor(t) {
  12992. super(), this.files = t, this.name = "JSONParserErrorGroup", this.message = `${this.errors.length} error${this.errors.length > 1 ? "s" : ""} occurred while reading '${(0, vs.toFileSystemPath)(t.$refs._root$Ref.path)}'`, Rl.Ono.extend(this);
  12993. }
  12994. static getParserErrors(t) {
  12995. const r = [];
  12996. for (const n of Object.values(t.$refs._$refs))
  12997. n.errors && r.push(...n.errors);
  12998. return r;
  12999. }
  13000. get errors() {
  13001. return ln.getParserErrors(this.files);
  13002. }
  13003. }
  13004. V.JSONParserErrorGroup = ln;
  13005. class E_ extends Ne {
  13006. constructor(t, r) {
  13007. super(`Error parsing ${r}: ${t}`, r), this.code = "EPARSER", this.name = "ParserError";
  13008. }
  13009. }
  13010. V.ParserError = E_;
  13011. class S_ extends Ne {
  13012. constructor(t) {
  13013. super(`Could not find parser for "${t}"`, t), this.code = "EUNMATCHEDPARSER", this.name = "UnmatchedParserError";
  13014. }
  13015. }
  13016. V.UnmatchedParserError = S_;
  13017. class x_ extends Ne {
  13018. constructor(t, r) {
  13019. super(t.message || `Error reading file "${r}"`, r), this.code = "ERESOLVER", this.name = "ResolverError", "code" in t && (this.ioErrorCode = String(t.code));
  13020. }
  13021. }
  13022. V.ResolverError = x_;
  13023. class j_ extends Ne {
  13024. constructor(t) {
  13025. super(`Could not find resolver for "${t}"`, t), this.code = "EUNMATCHEDRESOLVER", this.name = "UnmatchedResolverError";
  13026. }
  13027. }
  13028. V.UnmatchedResolverError = j_;
  13029. class A_ extends Ne {
  13030. constructor(t, r) {
  13031. super(`Token "${t}" does not exist.`, (0, vs.stripHash)(r)), this.code = "EUNMATCHEDRESOLVER", this.name = "MissingPointerError";
  13032. }
  13033. }
  13034. V.MissingPointerError = A_;
  13035. class C_ extends Ne {
  13036. constructor(t) {
  13037. super(`Dereferencing timeout reached: ${t}ms`), this.code = "ETIMEOUT", this.name = "TimeoutError";
  13038. }
  13039. }
  13040. V.TimeoutError = C_;
  13041. class I_ extends Ne {
  13042. constructor(t, r) {
  13043. super(`Invalid $ref pointer "${t}". Pointers must begin with "#/"`, (0, vs.stripHash)(r)), this.code = "EUNMATCHEDRESOLVER", this.name = "InvalidPointerError";
  13044. }
  13045. }
  13046. V.InvalidPointerError = I_;
  13047. function T_(e) {
  13048. return e instanceof Ne || e instanceof ln;
  13049. }
  13050. function R_(e) {
  13051. return e.path === null && (e.path = []), e;
  13052. }
  13053. var ko;
  13054. function cn() {
  13055. if (ko) return hr;
  13056. ko = 1;
  13057. var e = j && j.__createBinding || (Object.create ? function(p, m, $, E) {
  13058. E === void 0 && (E = $);
  13059. var S = Object.getOwnPropertyDescriptor(m, $);
  13060. (!S || ("get" in S ? !m.__esModule : S.writable || S.configurable)) && (S = { enumerable: !0, get: function() {
  13061. return m[$];
  13062. } }), Object.defineProperty(p, E, S);
  13063. } : function(p, m, $, E) {
  13064. E === void 0 && (E = $), p[E] = m[$];
  13065. }), t = j && j.__setModuleDefault || (Object.create ? function(p, m) {
  13066. Object.defineProperty(p, "default", { enumerable: !0, value: m });
  13067. } : function(p, m) {
  13068. p.default = m;
  13069. }), r = j && j.__importStar || function(p) {
  13070. if (p && p.__esModule) return p;
  13071. var m = {};
  13072. if (p != null) for (var $ in p) $ !== "default" && Object.prototype.hasOwnProperty.call(p, $) && e(m, p, $);
  13073. return t(m, p), m;
  13074. }, n = j && j.__importDefault || function(p) {
  13075. return p && p.__esModule ? p : { default: p };
  13076. };
  13077. Object.defineProperty(hr, "__esModule", { value: !0 });
  13078. const i = n(tr()), s = r(B), o = V, a = /\//g, l = /~/g, c = /~1/g, f = /~0/g, u = (p) => {
  13079. try {
  13080. return decodeURIComponent(p);
  13081. } catch {
  13082. return p;
  13083. }
  13084. };
  13085. class h {
  13086. constructor(m, $, E) {
  13087. this.$ref = m, this.path = $, this.originalPath = E || $, this.value = void 0, this.circular = !1, this.indirections = 0;
  13088. }
  13089. /**
  13090. * Resolves the value of a nested property within the given object.
  13091. *
  13092. * @param obj - The object that will be crawled
  13093. * @param options
  13094. * @param pathFromRoot - the path of place that initiated resolving
  13095. *
  13096. * @returns
  13097. * Returns a JSON pointer whose {@link Pointer#value} is the resolved value.
  13098. * If resolving this value required resolving other JSON references, then
  13099. * the {@link Pointer#$ref} and {@link Pointer#path} will reflect the resolution path
  13100. * of the resolved value.
  13101. */
  13102. resolve(m, $, E) {
  13103. const S = h.parse(this.path, this.originalPath);
  13104. this.value = b(m);
  13105. for (let A = 0; A < S.length; A++) {
  13106. if (y(this, $, E) && (this.path = h.join(this.path, S.slice(A))), typeof this.value == "object" && this.value !== null && !v(E) && "$ref" in this.value)
  13107. return this;
  13108. const U = S[A];
  13109. if (this.value[U] === void 0 || this.value[U] === null && A === S.length - 1) {
  13110. let fe = !1;
  13111. for (let ce = S.length - 1; ce > A; ce--) {
  13112. const ve = S.slice(A, ce + 1).join("/");
  13113. if (this.value[ve] !== void 0) {
  13114. this.value = this.value[ve], A = ce, fe = !0;
  13115. break;
  13116. }
  13117. }
  13118. if (fe)
  13119. continue;
  13120. throw this.value = null, new o.MissingPointerError(U, decodeURI(this.originalPath));
  13121. } else
  13122. this.value = this.value[U];
  13123. }
  13124. return (!this.value || this.value.$ref && s.resolve(this.path, this.value.$ref) !== E) && y(this, $, E), this;
  13125. }
  13126. /**
  13127. * Sets the value of a nested property within the given object.
  13128. *
  13129. * @param obj - The object that will be crawled
  13130. * @param value - the value to assign
  13131. * @param options
  13132. *
  13133. * @returns
  13134. * Returns the modified object, or an entirely new object if the entire object is overwritten.
  13135. */
  13136. set(m, $, E) {
  13137. const S = h.parse(this.path);
  13138. let A;
  13139. if (S.length === 0)
  13140. return this.value = $, $;
  13141. this.value = b(m);
  13142. for (let U = 0; U < S.length - 1; U++)
  13143. y(this, E), A = S[U], this.value && this.value[A] !== void 0 ? this.value = this.value[A] : this.value = _(this, A, {});
  13144. return y(this, E), A = S[S.length - 1], _(this, A, $), m;
  13145. }
  13146. /**
  13147. * Parses a JSON pointer (or a path containing a JSON pointer in the hash)
  13148. * and returns an array of the pointer's tokens.
  13149. * (e.g. "schema.json#/definitions/person/name" => ["definitions", "person", "name"])
  13150. *
  13151. * The pointer is parsed according to RFC 6901
  13152. * {@link https://tools.ietf.org/html/rfc6901#section-3}
  13153. *
  13154. * @param path
  13155. * @param [originalPath]
  13156. * @returns
  13157. */
  13158. static parse(m, $) {
  13159. const E = s.getHash(m).substring(1);
  13160. if (!E)
  13161. return [];
  13162. const S = E.split("/");
  13163. for (let A = 0; A < S.length; A++)
  13164. S[A] = u(S[A].replace(c, "/").replace(f, "~"));
  13165. if (S[0] !== "")
  13166. throw new o.InvalidPointerError(S, $ === void 0 ? m : $);
  13167. return S.slice(1);
  13168. }
  13169. /**
  13170. * Creates a JSON pointer path, by joining one or more tokens to a base path.
  13171. *
  13172. * @param base - The base path (e.g. "schema.json#/definitions/person")
  13173. * @param tokens - The token(s) to append (e.g. ["name", "first"])
  13174. * @returns
  13175. */
  13176. static join(m, $) {
  13177. m.indexOf("#") === -1 && (m += "#"), $ = Array.isArray($) ? $ : [$];
  13178. for (let E = 0; E < $.length; E++) {
  13179. const S = $[E];
  13180. m += "/" + encodeURIComponent(S.replace(l, "~0").replace(a, "~1"));
  13181. }
  13182. return m;
  13183. }
  13184. }
  13185. function y(p, m, $) {
  13186. if (i.default.isAllowed$Ref(p.value, m)) {
  13187. const E = s.resolve(p.path, p.value.$ref);
  13188. if (E === p.path && !v($))
  13189. p.circular = !0;
  13190. else {
  13191. const S = p.$ref.$refs._resolve(E, p.path, m);
  13192. return S === null ? !1 : (p.indirections += S.indirections + 1, i.default.isExtended$Ref(p.value) ? (p.value = i.default.dereference(p.value, S.value), !1) : (p.$ref = S.$ref, p.path = S.path, p.value = S.value, !0));
  13193. }
  13194. }
  13195. }
  13196. hr.default = h;
  13197. function _(p, m, $) {
  13198. if (p.value && typeof p.value == "object")
  13199. m === "-" && Array.isArray(p.value) ? p.value.push($) : p.value[m] = $;
  13200. else
  13201. throw new o.JSONParserError(`Error assigning $ref pointer "${p.path}".
  13202. Cannot set "${m}" of a non-object.`);
  13203. return $;
  13204. }
  13205. function b(p) {
  13206. if ((0, o.isHandledError)(p))
  13207. throw p;
  13208. return p;
  13209. }
  13210. function v(p) {
  13211. return typeof p == "string" && h.parse(p).length == 0;
  13212. }
  13213. return hr;
  13214. }
  13215. var No;
  13216. function tr() {
  13217. if (No) return pr;
  13218. No = 1;
  13219. var e = j && j.__importDefault || function(s) {
  13220. return s && s.__esModule ? s : { default: s };
  13221. };
  13222. Object.defineProperty(pr, "__esModule", { value: !0 });
  13223. const t = e(cn()), r = V, n = B;
  13224. class i {
  13225. constructor(o) {
  13226. this.errors = [], this.$refs = o;
  13227. }
  13228. /**
  13229. * Pushes an error to errors array.
  13230. *
  13231. * @param err - The error to be pushed
  13232. * @returns
  13233. */
  13234. addError(o) {
  13235. this.errors === void 0 && (this.errors = []);
  13236. const a = this.errors.map(({ footprint: l }) => l);
  13237. "errors" in o && Array.isArray(o.errors) ? this.errors.push(...o.errors.map(r.normalizeError).filter(({ footprint: l }) => !a.includes(l))) : (!("footprint" in o) || !a.includes(o.footprint)) && this.errors.push((0, r.normalizeError)(o));
  13238. }
  13239. /**
  13240. * Determines whether the given JSON reference exists within this {@link $Ref#value}.
  13241. *
  13242. * @param path - The full path being resolved, optionally with a JSON pointer in the hash
  13243. * @param options
  13244. * @returns
  13245. */
  13246. exists(o, a) {
  13247. try {
  13248. return this.resolve(o, a), !0;
  13249. } catch {
  13250. return !1;
  13251. }
  13252. }
  13253. /**
  13254. * Resolves the given JSON reference within this {@link $Ref#value} and returns the resolved value.
  13255. *
  13256. * @param path - The full path being resolved, optionally with a JSON pointer in the hash
  13257. * @param options
  13258. * @returns - Returns the resolved value
  13259. */
  13260. get(o, a) {
  13261. var l;
  13262. return (l = this.resolve(o, a)) == null ? void 0 : l.value;
  13263. }
  13264. /**
  13265. * Resolves the given JSON reference within this {@link $Ref#value}.
  13266. *
  13267. * @param path - The full path being resolved, optionally with a JSON pointer in the hash
  13268. * @param options
  13269. * @param friendlyPath - The original user-specified path (used for error messages)
  13270. * @param pathFromRoot - The path of `obj` from the schema root
  13271. * @returns
  13272. */
  13273. resolve(o, a, l, c) {
  13274. const f = new t.default(this, o, l);
  13275. try {
  13276. return f.resolve(this.value, a, c);
  13277. } catch (u) {
  13278. if (!a || !a.continueOnError || !(0, r.isHandledError)(u))
  13279. throw u;
  13280. return u.path === null && (u.path = (0, n.safePointerToPath)((0, n.getHash)(c))), u instanceof r.InvalidPointerError && (u.source = decodeURI((0, n.stripHash)(c))), this.addError(u), null;
  13281. }
  13282. }
  13283. /**
  13284. * Sets the value of a nested property within this {@link $Ref#value}.
  13285. * If the property, or any of its parents don't exist, they will be created.
  13286. *
  13287. * @param path - The full path of the property to set, optionally with a JSON pointer in the hash
  13288. * @param value - The value to assign
  13289. */
  13290. set(o, a) {
  13291. const l = new t.default(this, o);
  13292. this.value = l.set(this.value, a);
  13293. }
  13294. /**
  13295. * Determines whether the given value is a JSON reference.
  13296. *
  13297. * @param value - The value to inspect
  13298. * @returns
  13299. */
  13300. static is$Ref(o) {
  13301. return !!o && typeof o == "object" && o !== null && "$ref" in o && typeof o.$ref == "string" && o.$ref.length > 0;
  13302. }
  13303. /**
  13304. * Determines whether the given value is an external JSON reference.
  13305. *
  13306. * @param value - The value to inspect
  13307. * @returns
  13308. */
  13309. static isExternal$Ref(o) {
  13310. return i.is$Ref(o) && o.$ref[0] !== "#";
  13311. }
  13312. /**
  13313. * Determines whether the given value is a JSON reference, and whether it is allowed by the options.
  13314. * For example, if it references an external file, then options.resolve.external must be true.
  13315. *
  13316. * @param value - The value to inspect
  13317. * @param options
  13318. * @returns
  13319. */
  13320. static isAllowed$Ref(o, a) {
  13321. var l;
  13322. if (this.is$Ref(o)) {
  13323. if (o.$ref.substring(0, 2) === "#/" || o.$ref === "#")
  13324. return !0;
  13325. if (o.$ref[0] !== "#" && (!a || (l = a.resolve) != null && l.external))
  13326. return !0;
  13327. }
  13328. }
  13329. /**
  13330. * Determines whether the given value is a JSON reference that "extends" its resolved value.
  13331. * That is, it has extra properties (in addition to "$ref"), so rather than simply pointing to
  13332. * an existing value, this $ref actually creates a NEW value that is a shallow copy of the resolved
  13333. * value, plus the extra properties.
  13334. *
  13335. * @example: {
  13336. person: {
  13337. properties: {
  13338. firstName: { type: string }
  13339. lastName: { type: string }
  13340. }
  13341. }
  13342. employee: {
  13343. properties: {
  13344. $ref: #/person/properties
  13345. salary: { type: number }
  13346. }
  13347. }
  13348. }
  13349. * In this example, "employee" is an extended $ref, since it extends "person" with an additional
  13350. * property (salary). The result is a NEW value that looks like this:
  13351. *
  13352. * {
  13353. * properties: {
  13354. * firstName: { type: string }
  13355. * lastName: { type: string }
  13356. * salary: { type: number }
  13357. * }
  13358. * }
  13359. *
  13360. * @param value - The value to inspect
  13361. * @returns
  13362. */
  13363. static isExtended$Ref(o) {
  13364. return i.is$Ref(o) && Object.keys(o).length > 1;
  13365. }
  13366. /**
  13367. * Returns the resolved value of a JSON Reference.
  13368. * If necessary, the resolved value is merged with the JSON Reference to create a new object
  13369. *
  13370. * @example: {
  13371. person: {
  13372. properties: {
  13373. firstName: { type: string }
  13374. lastName: { type: string }
  13375. }
  13376. }
  13377. employee: {
  13378. properties: {
  13379. $ref: #/person/properties
  13380. salary: { type: number }
  13381. }
  13382. }
  13383. } When "person" and "employee" are merged, you end up with the following object:
  13384. *
  13385. * {
  13386. * properties: {
  13387. * firstName: { type: string }
  13388. * lastName: { type: string }
  13389. * salary: { type: number }
  13390. * }
  13391. * }
  13392. *
  13393. * @param $ref - The JSON reference object (the one with the "$ref" property)
  13394. * @param resolvedValue - The resolved value, which can be any type
  13395. * @returns - Returns the dereferenced value
  13396. */
  13397. static dereference(o, a) {
  13398. if (a && typeof a == "object" && i.isExtended$Ref(o)) {
  13399. const l = {};
  13400. for (const c of Object.keys(o))
  13401. c !== "$ref" && (l[c] = o[c]);
  13402. for (const c of Object.keys(a))
  13403. c in l || (l[c] = a[c]);
  13404. return l;
  13405. } else
  13406. return a;
  13407. }
  13408. }
  13409. return pr.default = i, pr;
  13410. }
  13411. var k_ = j && j.__createBinding || (Object.create ? function(e, t, r, n) {
  13412. n === void 0 && (n = r);
  13413. var i = Object.getOwnPropertyDescriptor(t, r);
  13414. (!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: function() {
  13415. return t[r];
  13416. } }), Object.defineProperty(e, n, i);
  13417. } : function(e, t, r, n) {
  13418. n === void 0 && (n = r), e[n] = t[r];
  13419. }), N_ = j && j.__setModuleDefault || (Object.create ? function(e, t) {
  13420. Object.defineProperty(e, "default", { enumerable: !0, value: t });
  13421. } : function(e, t) {
  13422. e.default = t;
  13423. }), M_ = j && j.__importStar || function(e) {
  13424. if (e && e.__esModule) return e;
  13425. var t = {};
  13426. if (e != null) for (var r in e) r !== "default" && Object.prototype.hasOwnProperty.call(e, r) && k_(t, e, r);
  13427. return N_(t, e), t;
  13428. }, kl = j && j.__importDefault || function(e) {
  13429. return e && e.__esModule ? e : { default: e };
  13430. };
  13431. Object.defineProperty($s, "__esModule", { value: !0 });
  13432. const Mo = je, D_ = kl(tr()), Le = M_(B), Do = kl(on);
  13433. class q_ {
  13434. /**
  13435. * Returns the paths/URLs of all the files in your schema (including the main schema file).
  13436. *
  13437. * See https://apitools.dev/json-schema-ref-parser/docs/refs.html#pathstypes
  13438. *
  13439. * @param types (optional) Optionally only return certain types of paths ("file", "http", etc.)
  13440. */
  13441. paths(...t) {
  13442. return qo(this._$refs, t.flat()).map((n) => (0, Do.default)(n.decoded));
  13443. }
  13444. /**
  13445. * Returns a map of paths/URLs and their correspond values.
  13446. *
  13447. * See https://apitools.dev/json-schema-ref-parser/docs/refs.html#valuestypes
  13448. *
  13449. * @param types (optional) Optionally only return values from certain locations ("file", "http", etc.)
  13450. */
  13451. values(...t) {
  13452. const r = this._$refs;
  13453. return qo(r, t.flat()).reduce((i, s) => (i[(0, Do.default)(s.decoded)] = r[s.encoded].value, i), {});
  13454. }
  13455. /**
  13456. * Returns `true` if the given path exists in the schema; otherwise, returns `false`
  13457. *
  13458. * See https://apitools.dev/json-schema-ref-parser/docs/refs.html#existsref
  13459. *
  13460. * @param $ref The JSON Reference path, optionally with a JSON Pointer in the hash
  13461. */
  13462. /**
  13463. * Determines whether the given JSON reference exists.
  13464. *
  13465. * @param path - The path being resolved, optionally with a JSON pointer in the hash
  13466. * @param [options]
  13467. * @returns
  13468. */
  13469. exists(t, r) {
  13470. try {
  13471. return this._resolve(t, "", r), !0;
  13472. } catch {
  13473. return !1;
  13474. }
  13475. }
  13476. /**
  13477. * Resolves the given JSON reference and returns the resolved value.
  13478. *
  13479. * @param path - The path being resolved, with a JSON pointer in the hash
  13480. * @param [options]
  13481. * @returns - Returns the resolved value
  13482. */
  13483. get(t, r) {
  13484. return this._resolve(t, "", r).value;
  13485. }
  13486. /**
  13487. * Sets the value at the given path in the schema. If the property, or any of its parents, don't exist, they will be created.
  13488. *
  13489. * @param path The JSON Reference path, optionally with a JSON Pointer in the hash
  13490. * @param value The value to assign. Can be anything (object, string, number, etc.)
  13491. */
  13492. set(t, r) {
  13493. const n = Le.resolve(this._root$Ref.path, t), i = Le.stripHash(n), s = this._$refs[i];
  13494. if (!s)
  13495. throw (0, Mo.ono)(`Error resolving $ref pointer "${t}".
  13496. "${i}" not found.`);
  13497. s.set(n, r);
  13498. }
  13499. /**
  13500. * Returns the specified {@link $Ref} object, or undefined.
  13501. *
  13502. * @param path - The path being resolved, optionally with a JSON pointer in the hash
  13503. * @returns
  13504. * @protected
  13505. */
  13506. _get$Ref(t) {
  13507. t = Le.resolve(this._root$Ref.path, t);
  13508. const r = Le.stripHash(t);
  13509. return this._$refs[r];
  13510. }
  13511. /**
  13512. * Creates a new {@link $Ref} object and adds it to this {@link $Refs} object.
  13513. *
  13514. * @param path - The file path or URL of the referenced file
  13515. */
  13516. _add(t) {
  13517. const r = Le.stripHash(t), n = new D_.default(this);
  13518. return n.path = r, this._$refs[r] = n, this._root$Ref = this._root$Ref || n, n;
  13519. }
  13520. /**
  13521. * Resolves the given JSON reference.
  13522. *
  13523. * @param path - The path being resolved, optionally with a JSON pointer in the hash
  13524. * @param pathFromRoot - The path of `obj` from the schema root
  13525. * @param [options]
  13526. * @returns
  13527. * @protected
  13528. */
  13529. _resolve(t, r, n) {
  13530. const i = Le.resolve(this._root$Ref.path, t), s = Le.stripHash(i), o = this._$refs[s];
  13531. if (!o)
  13532. throw (0, Mo.ono)(`Error resolving $ref pointer "${t}".
  13533. "${s}" not found.`);
  13534. return o.resolve(i, n, t, r);
  13535. }
  13536. constructor() {
  13537. this._$refs = {}, this.toJSON = this.values, this.circular = !1, this._$refs = {}, this._root$Ref = null;
  13538. }
  13539. }
  13540. $s.default = q_;
  13541. function qo(e, t) {
  13542. let r = Object.keys(e);
  13543. return t = Array.isArray(t[0]) ? t[0] : Array.prototype.slice.call(t), t.length > 0 && t[0] && (r = r.filter((n) => t.includes(e[n].pathType))), r.map((n) => ({
  13544. encoded: n,
  13545. decoded: e[n].pathType === "file" ? Le.toFileSystemPath(n, !0) : n
  13546. }));
  13547. }
  13548. var un = {}, xt = {};
  13549. Object.defineProperty(xt, "__esModule", { value: !0 });
  13550. xt.all = F_;
  13551. xt.filter = V_;
  13552. xt.sort = L_;
  13553. xt.run = H_;
  13554. function F_(e) {
  13555. return Object.keys(e || {}).filter((t) => typeof e[t] == "object").map((t) => (e[t].name = t, e[t]));
  13556. }
  13557. function V_(e, t, r) {
  13558. return e.filter((n) => !!Nl(n, t, r));
  13559. }
  13560. function L_(e) {
  13561. for (const t of e)
  13562. t.order = t.order || Number.MAX_SAFE_INTEGER;
  13563. return e.sort((t, r) => t.order - r.order);
  13564. }
  13565. async function H_(e, t, r, n) {
  13566. let i, s, o = 0;
  13567. return new Promise((a, l) => {
  13568. c();
  13569. function c() {
  13570. if (i = e[o++], !i)
  13571. return l(s);
  13572. try {
  13573. const y = Nl(i, t, r, f, n);
  13574. if (y && typeof y.then == "function")
  13575. y.then(u, h);
  13576. else if (y !== void 0)
  13577. u(y);
  13578. else if (o === e.length)
  13579. throw new Error("No promise has been returned or callback has been called.");
  13580. } catch (y) {
  13581. h(y);
  13582. }
  13583. }
  13584. function f(y, _) {
  13585. y ? h(y) : u(_);
  13586. }
  13587. function u(y) {
  13588. a({
  13589. plugin: i,
  13590. result: y
  13591. });
  13592. }
  13593. function h(y) {
  13594. s = {
  13595. plugin: i,
  13596. error: y
  13597. }, c();
  13598. }
  13599. });
  13600. }
  13601. function Nl(e, t, r, n, i) {
  13602. const s = e[t];
  13603. if (typeof s == "function")
  13604. return s.apply(e, [r, n, i]);
  13605. if (!n) {
  13606. if (s instanceof RegExp)
  13607. return s.test(r.url);
  13608. if (typeof s == "string")
  13609. return s === r.extension;
  13610. if (Array.isArray(s))
  13611. return s.indexOf(r.extension) !== -1;
  13612. }
  13613. return s;
  13614. }
  13615. var U_ = j && j.__createBinding || (Object.create ? function(e, t, r, n) {
  13616. n === void 0 && (n = r);
  13617. var i = Object.getOwnPropertyDescriptor(t, r);
  13618. (!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: function() {
  13619. return t[r];
  13620. } }), Object.defineProperty(e, n, i);
  13621. } : function(e, t, r, n) {
  13622. n === void 0 && (n = r), e[n] = t[r];
  13623. }), z_ = j && j.__setModuleDefault || (Object.create ? function(e, t) {
  13624. Object.defineProperty(e, "default", { enumerable: !0, value: t });
  13625. } : function(e, t) {
  13626. e.default = t;
  13627. }), Ml = j && j.__importStar || function(e) {
  13628. if (e && e.__esModule) return e;
  13629. var t = {};
  13630. if (e != null) for (var r in e) r !== "default" && Object.prototype.hasOwnProperty.call(e, r) && U_(t, e, r);
  13631. return z_(t, e), t;
  13632. };
  13633. Object.defineProperty(un, "__esModule", { value: !0 });
  13634. const di = je, G_ = Ml(B), Ue = Ml(xt), et = V;
  13635. async function B_(e, t, r) {
  13636. const n = e.indexOf("#");
  13637. let i = "";
  13638. n >= 0 && (i = e.substring(n), e = e.substring(0, n));
  13639. const s = t._add(e), o = {
  13640. url: e,
  13641. hash: i,
  13642. extension: G_.getExtension(e)
  13643. };
  13644. try {
  13645. const a = await K_(o, r, t);
  13646. s.pathType = a.plugin.name, o.data = a.result;
  13647. const l = await W_(o, r, t);
  13648. return s.value = l.result, l.result;
  13649. } catch (a) {
  13650. throw (0, et.isHandledError)(a) && (s.value = a), a;
  13651. }
  13652. }
  13653. async function K_(e, t, r) {
  13654. let n = Ue.all(t.resolve);
  13655. n = Ue.filter(n, "canRead", e), Ue.sort(n);
  13656. try {
  13657. return await Ue.run(n, "read", e, r);
  13658. } catch (i) {
  13659. throw !i && t.continueOnError ? new et.UnmatchedResolverError(e.url) : !i || !("error" in i) ? di.ono.syntax(`Unable to resolve $ref pointer "${e.url}"`) : i.error instanceof et.ResolverError ? i.error : new et.ResolverError(i, e.url);
  13660. }
  13661. }
  13662. async function W_(e, t, r) {
  13663. const n = Ue.all(t.parse), i = Ue.filter(n, "canParse", e), s = i.length > 0 ? i : n;
  13664. Ue.sort(s);
  13665. try {
  13666. const o = await Ue.run(s, "parse", e, r);
  13667. if (!o.plugin.allowEmpty && J_(o.result))
  13668. throw di.ono.syntax(`Error parsing "${e.url}" as ${o.plugin.name}.
  13669. Parsed value is empty`);
  13670. return o;
  13671. } catch (o) {
  13672. throw !o && t.continueOnError ? new et.UnmatchedParserError(e.url) : o && o.message && o.message.startsWith("Error parsing") ? o : !o || !("error" in o) ? di.ono.syntax(`Unable to parse ${e.url}`) : o.error instanceof et.ParserError ? o.error : new et.ParserError(o.error.message, e.url);
  13673. }
  13674. }
  13675. function J_(e) {
  13676. return e === void 0 || typeof e == "object" && Object.keys(e).length === 0 || typeof e == "string" && e.trim().length === 0 || Buffer.isBuffer(e) && e.length === 0;
  13677. }
  13678. un.default = B_;
  13679. var fn = {}, bs = {}, ws = {};
  13680. Object.defineProperty(ws, "__esModule", { value: !0 });
  13681. const Fo = V;
  13682. ws.default = {
  13683. /**
  13684. * The order that this parser will run, in relation to other parsers.
  13685. */
  13686. order: 100,
  13687. /**
  13688. * Whether to allow "empty" files. This includes zero-byte files, as well as empty JSON objects.
  13689. */
  13690. allowEmpty: !0,
  13691. /**
  13692. * Determines whether this parser can parse a given file reference.
  13693. * Parsers that match will be tried, in order, until one successfully parses the file.
  13694. * Parsers that don't match will be skipped, UNLESS none of the parsers match, in which case
  13695. * every parser will be tried.
  13696. */
  13697. canParse: ".json",
  13698. /**
  13699. * Allow JSON files with byte order marks (BOM)
  13700. */
  13701. allowBOM: !0,
  13702. /**
  13703. * Parses the given file as JSON
  13704. */
  13705. async parse(e) {
  13706. let t = e.data;
  13707. if (Buffer.isBuffer(t) && (t = t.toString()), typeof t == "string") {
  13708. if (t.trim().length === 0)
  13709. return;
  13710. try {
  13711. return JSON.parse(t);
  13712. } catch (r) {
  13713. if (this.allowBOM)
  13714. try {
  13715. const n = t.indexOf("{");
  13716. return t = t.slice(n), JSON.parse(t);
  13717. } catch (n) {
  13718. throw new Fo.ParserError(n.message, e.url);
  13719. }
  13720. throw new Fo.ParserError(r.message, e.url);
  13721. }
  13722. } else
  13723. return t;
  13724. }
  13725. };
  13726. var Ps = {}, re = {}, Os = {}, _e = {};
  13727. function Dl(e) {
  13728. return typeof e > "u" || e === null;
  13729. }
  13730. function Y_(e) {
  13731. return typeof e == "object" && e !== null;
  13732. }
  13733. function X_(e) {
  13734. return Array.isArray(e) ? e : Dl(e) ? [] : [e];
  13735. }
  13736. function Q_(e, t) {
  13737. var r, n, i, s;
  13738. if (t)
  13739. for (s = Object.keys(t), r = 0, n = s.length; r < n; r += 1)
  13740. i = s[r], e[i] = t[i];
  13741. return e;
  13742. }
  13743. function Z_(e, t) {
  13744. var r = "", n;
  13745. for (n = 0; n < t; n += 1)
  13746. r += e;
  13747. return r;
  13748. }
  13749. function ev(e) {
  13750. return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
  13751. }
  13752. _e.isNothing = Dl;
  13753. _e.isObject = Y_;
  13754. _e.toArray = X_;
  13755. _e.repeat = Z_;
  13756. _e.isNegativeZero = ev;
  13757. _e.extend = Q_;
  13758. function ql(e, t) {
  13759. var r = "", n = e.reason || "(unknown reason)";
  13760. return e.mark ? (e.mark.name && (r += 'in "' + e.mark.name + '" '), r += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !t && e.mark.snippet && (r += `
  13761. ` + e.mark.snippet), n + " " + r) : n;
  13762. }
  13763. function Gt(e, t) {
  13764. Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = ql(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
  13765. }
  13766. Gt.prototype = Object.create(Error.prototype);
  13767. Gt.prototype.constructor = Gt;
  13768. Gt.prototype.toString = function(t) {
  13769. return this.name + ": " + ql(this, t);
  13770. };
  13771. var rr = Gt, Mt = _e;
  13772. function Hn(e, t, r, n, i) {
  13773. var s = "", o = "", a = Math.floor(i / 2) - 1;
  13774. return n - t > a && (s = " ... ", t = n - a + s.length), r - n > a && (o = " ...", r = n + a - o.length), {
  13775. str: s + e.slice(t, r).replace(/\t/g, "→") + o,
  13776. pos: n - t + s.length
  13777. // relative position
  13778. };
  13779. }
  13780. function Un(e, t) {
  13781. return Mt.repeat(" ", t - e.length) + e;
  13782. }
  13783. function tv(e, t) {
  13784. if (t = Object.create(t || null), !e.buffer) return null;
  13785. t.maxLength || (t.maxLength = 79), typeof t.indent != "number" && (t.indent = 1), typeof t.linesBefore != "number" && (t.linesBefore = 3), typeof t.linesAfter != "number" && (t.linesAfter = 2);
  13786. for (var r = /\r?\n|\r|\0/g, n = [0], i = [], s, o = -1; s = r.exec(e.buffer); )
  13787. i.push(s.index), n.push(s.index + s[0].length), e.position <= s.index && o < 0 && (o = n.length - 2);
  13788. o < 0 && (o = n.length - 1);
  13789. var a = "", l, c, f = Math.min(e.line + t.linesAfter, i.length).toString().length, u = t.maxLength - (t.indent + f + 3);
  13790. for (l = 1; l <= t.linesBefore && !(o - l < 0); l++)
  13791. c = Hn(
  13792. e.buffer,
  13793. n[o - l],
  13794. i[o - l],
  13795. e.position - (n[o] - n[o - l]),
  13796. u
  13797. ), a = Mt.repeat(" ", t.indent) + Un((e.line - l + 1).toString(), f) + " | " + c.str + `
  13798. ` + a;
  13799. for (c = Hn(e.buffer, n[o], i[o], e.position, u), a += Mt.repeat(" ", t.indent) + Un((e.line + 1).toString(), f) + " | " + c.str + `
  13800. `, a += Mt.repeat("-", t.indent + f + 3 + c.pos) + `^
  13801. `, l = 1; l <= t.linesAfter && !(o + l >= i.length); l++)
  13802. c = Hn(
  13803. e.buffer,
  13804. n[o + l],
  13805. i[o + l],
  13806. e.position - (n[o] - n[o + l]),
  13807. u
  13808. ), a += Mt.repeat(" ", t.indent) + Un((e.line + l + 1).toString(), f) + " | " + c.str + `
  13809. `;
  13810. return a.replace(/\n$/, "");
  13811. }
  13812. var rv = tv, Vo = rr, nv = [
  13813. "kind",
  13814. "multi",
  13815. "resolve",
  13816. "construct",
  13817. "instanceOf",
  13818. "predicate",
  13819. "represent",
  13820. "representName",
  13821. "defaultStyle",
  13822. "styleAliases"
  13823. ], iv = [
  13824. "scalar",
  13825. "sequence",
  13826. "mapping"
  13827. ];
  13828. function sv(e) {
  13829. var t = {};
  13830. return e !== null && Object.keys(e).forEach(function(r) {
  13831. e[r].forEach(function(n) {
  13832. t[String(n)] = r;
  13833. });
  13834. }), t;
  13835. }
  13836. function ov(e, t) {
  13837. if (t = t || {}, Object.keys(t).forEach(function(r) {
  13838. if (nv.indexOf(r) === -1)
  13839. throw new Vo('Unknown option "' + r + '" is met in definition of "' + e + '" YAML type.');
  13840. }), this.options = t, this.tag = e, this.kind = t.kind || null, this.resolve = t.resolve || function() {
  13841. return !0;
  13842. }, this.construct = t.construct || function(r) {
  13843. return r;
  13844. }, this.instanceOf = t.instanceOf || null, this.predicate = t.predicate || null, this.represent = t.represent || null, this.representName = t.representName || null, this.defaultStyle = t.defaultStyle || null, this.multi = t.multi || !1, this.styleAliases = sv(t.styleAliases || null), iv.indexOf(this.kind) === -1)
  13845. throw new Vo('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
  13846. }
  13847. var oe = ov, Rt = rr, zn = oe;
  13848. function Lo(e, t) {
  13849. var r = [];
  13850. return e[t].forEach(function(n) {
  13851. var i = r.length;
  13852. r.forEach(function(s, o) {
  13853. s.tag === n.tag && s.kind === n.kind && s.multi === n.multi && (i = o);
  13854. }), r[i] = n;
  13855. }), r;
  13856. }
  13857. function av() {
  13858. var e = {
  13859. scalar: {},
  13860. sequence: {},
  13861. mapping: {},
  13862. fallback: {},
  13863. multi: {
  13864. scalar: [],
  13865. sequence: [],
  13866. mapping: [],
  13867. fallback: []
  13868. }
  13869. }, t, r;
  13870. function n(i) {
  13871. i.multi ? (e.multi[i.kind].push(i), e.multi.fallback.push(i)) : e[i.kind][i.tag] = e.fallback[i.tag] = i;
  13872. }
  13873. for (t = 0, r = arguments.length; t < r; t += 1)
  13874. arguments[t].forEach(n);
  13875. return e;
  13876. }
  13877. function pi(e) {
  13878. return this.extend(e);
  13879. }
  13880. pi.prototype.extend = function(t) {
  13881. var r = [], n = [];
  13882. if (t instanceof zn)
  13883. n.push(t);
  13884. else if (Array.isArray(t))
  13885. n = n.concat(t);
  13886. else if (t && (Array.isArray(t.implicit) || Array.isArray(t.explicit)))
  13887. t.implicit && (r = r.concat(t.implicit)), t.explicit && (n = n.concat(t.explicit));
  13888. else
  13889. throw new Rt("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
  13890. r.forEach(function(s) {
  13891. if (!(s instanceof zn))
  13892. throw new Rt("Specified list of YAML types (or a single Type object) contains a non-Type object.");
  13893. if (s.loadKind && s.loadKind !== "scalar")
  13894. throw new Rt("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
  13895. if (s.multi)
  13896. throw new Rt("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
  13897. }), n.forEach(function(s) {
  13898. if (!(s instanceof zn))
  13899. throw new Rt("Specified list of YAML types (or a single Type object) contains a non-Type object.");
  13900. });
  13901. var i = Object.create(pi.prototype);
  13902. return i.implicit = (this.implicit || []).concat(r), i.explicit = (this.explicit || []).concat(n), i.compiledImplicit = Lo(i, "implicit"), i.compiledExplicit = Lo(i, "explicit"), i.compiledTypeMap = av(i.compiledImplicit, i.compiledExplicit), i;
  13903. };
  13904. var Fl = pi, lv = oe, Vl = new lv("tag:yaml.org,2002:str", {
  13905. kind: "scalar",
  13906. construct: function(e) {
  13907. return e !== null ? e : "";
  13908. }
  13909. }), cv = oe, Ll = new cv("tag:yaml.org,2002:seq", {
  13910. kind: "sequence",
  13911. construct: function(e) {
  13912. return e !== null ? e : [];
  13913. }
  13914. }), uv = oe, Hl = new uv("tag:yaml.org,2002:map", {
  13915. kind: "mapping",
  13916. construct: function(e) {
  13917. return e !== null ? e : {};
  13918. }
  13919. }), fv = Fl, Ul = new fv({
  13920. explicit: [
  13921. Vl,
  13922. Ll,
  13923. Hl
  13924. ]
  13925. }), dv = oe;
  13926. function pv(e) {
  13927. if (e === null) return !0;
  13928. var t = e.length;
  13929. return t === 1 && e === "~" || t === 4 && (e === "null" || e === "Null" || e === "NULL");
  13930. }
  13931. function hv() {
  13932. return null;
  13933. }
  13934. function mv(e) {
  13935. return e === null;
  13936. }
  13937. var zl = new dv("tag:yaml.org,2002:null", {
  13938. kind: "scalar",
  13939. resolve: pv,
  13940. construct: hv,
  13941. predicate: mv,
  13942. represent: {
  13943. canonical: function() {
  13944. return "~";
  13945. },
  13946. lowercase: function() {
  13947. return "null";
  13948. },
  13949. uppercase: function() {
  13950. return "NULL";
  13951. },
  13952. camelcase: function() {
  13953. return "Null";
  13954. },
  13955. empty: function() {
  13956. return "";
  13957. }
  13958. },
  13959. defaultStyle: "lowercase"
  13960. }), yv = oe;
  13961. function gv(e) {
  13962. if (e === null) return !1;
  13963. var t = e.length;
  13964. return t === 4 && (e === "true" || e === "True" || e === "TRUE") || t === 5 && (e === "false" || e === "False" || e === "FALSE");
  13965. }
  13966. function $v(e) {
  13967. return e === "true" || e === "True" || e === "TRUE";
  13968. }
  13969. function _v(e) {
  13970. return Object.prototype.toString.call(e) === "[object Boolean]";
  13971. }
  13972. var Gl = new yv("tag:yaml.org,2002:bool", {
  13973. kind: "scalar",
  13974. resolve: gv,
  13975. construct: $v,
  13976. predicate: _v,
  13977. represent: {
  13978. lowercase: function(e) {
  13979. return e ? "true" : "false";
  13980. },
  13981. uppercase: function(e) {
  13982. return e ? "TRUE" : "FALSE";
  13983. },
  13984. camelcase: function(e) {
  13985. return e ? "True" : "False";
  13986. }
  13987. },
  13988. defaultStyle: "lowercase"
  13989. }), vv = _e, bv = oe;
  13990. function wv(e) {
  13991. return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
  13992. }
  13993. function Pv(e) {
  13994. return 48 <= e && e <= 55;
  13995. }
  13996. function Ov(e) {
  13997. return 48 <= e && e <= 57;
  13998. }
  13999. function Ev(e) {
  14000. if (e === null) return !1;
  14001. var t = e.length, r = 0, n = !1, i;
  14002. if (!t) return !1;
  14003. if (i = e[r], (i === "-" || i === "+") && (i = e[++r]), i === "0") {
  14004. if (r + 1 === t) return !0;
  14005. if (i = e[++r], i === "b") {
  14006. for (r++; r < t; r++)
  14007. if (i = e[r], i !== "_") {
  14008. if (i !== "0" && i !== "1") return !1;
  14009. n = !0;
  14010. }
  14011. return n && i !== "_";
  14012. }
  14013. if (i === "x") {
  14014. for (r++; r < t; r++)
  14015. if (i = e[r], i !== "_") {
  14016. if (!wv(e.charCodeAt(r))) return !1;
  14017. n = !0;
  14018. }
  14019. return n && i !== "_";
  14020. }
  14021. if (i === "o") {
  14022. for (r++; r < t; r++)
  14023. if (i = e[r], i !== "_") {
  14024. if (!Pv(e.charCodeAt(r))) return !1;
  14025. n = !0;
  14026. }
  14027. return n && i !== "_";
  14028. }
  14029. }
  14030. if (i === "_") return !1;
  14031. for (; r < t; r++)
  14032. if (i = e[r], i !== "_") {
  14033. if (!Ov(e.charCodeAt(r)))
  14034. return !1;
  14035. n = !0;
  14036. }
  14037. return !(!n || i === "_");
  14038. }
  14039. function Sv(e) {
  14040. var t = e, r = 1, n;
  14041. if (t.indexOf("_") !== -1 && (t = t.replace(/_/g, "")), n = t[0], (n === "-" || n === "+") && (n === "-" && (r = -1), t = t.slice(1), n = t[0]), t === "0") return 0;
  14042. if (n === "0") {
  14043. if (t[1] === "b") return r * parseInt(t.slice(2), 2);
  14044. if (t[1] === "x") return r * parseInt(t.slice(2), 16);
  14045. if (t[1] === "o") return r * parseInt(t.slice(2), 8);
  14046. }
  14047. return r * parseInt(t, 10);
  14048. }
  14049. function xv(e) {
  14050. return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !vv.isNegativeZero(e);
  14051. }
  14052. var Bl = new bv("tag:yaml.org,2002:int", {
  14053. kind: "scalar",
  14054. resolve: Ev,
  14055. construct: Sv,
  14056. predicate: xv,
  14057. represent: {
  14058. binary: function(e) {
  14059. return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
  14060. },
  14061. octal: function(e) {
  14062. return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
  14063. },
  14064. decimal: function(e) {
  14065. return e.toString(10);
  14066. },
  14067. /* eslint-disable max-len */
  14068. hexadecimal: function(e) {
  14069. return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
  14070. }
  14071. },
  14072. defaultStyle: "decimal",
  14073. styleAliases: {
  14074. binary: [2, "bin"],
  14075. octal: [8, "oct"],
  14076. decimal: [10, "dec"],
  14077. hexadecimal: [16, "hex"]
  14078. }
  14079. }), Kl = _e, jv = oe, Av = new RegExp(
  14080. // 2.5e4, 2.5 and integers
  14081. "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
  14082. );
  14083. function Cv(e) {
  14084. return !(e === null || !Av.test(e) || // Quick hack to not allow integers end with `_`
  14085. // Probably should update regexp & check speed
  14086. e[e.length - 1] === "_");
  14087. }
  14088. function Iv(e) {
  14089. var t, r;
  14090. return t = e.replace(/_/g, "").toLowerCase(), r = t[0] === "-" ? -1 : 1, "+-".indexOf(t[0]) >= 0 && (t = t.slice(1)), t === ".inf" ? r === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : t === ".nan" ? NaN : r * parseFloat(t, 10);
  14091. }
  14092. var Tv = /^[-+]?[0-9]+e/;
  14093. function Rv(e, t) {
  14094. var r;
  14095. if (isNaN(e))
  14096. switch (t) {
  14097. case "lowercase":
  14098. return ".nan";
  14099. case "uppercase":
  14100. return ".NAN";
  14101. case "camelcase":
  14102. return ".NaN";
  14103. }
  14104. else if (Number.POSITIVE_INFINITY === e)
  14105. switch (t) {
  14106. case "lowercase":
  14107. return ".inf";
  14108. case "uppercase":
  14109. return ".INF";
  14110. case "camelcase":
  14111. return ".Inf";
  14112. }
  14113. else if (Number.NEGATIVE_INFINITY === e)
  14114. switch (t) {
  14115. case "lowercase":
  14116. return "-.inf";
  14117. case "uppercase":
  14118. return "-.INF";
  14119. case "camelcase":
  14120. return "-.Inf";
  14121. }
  14122. else if (Kl.isNegativeZero(e))
  14123. return "-0.0";
  14124. return r = e.toString(10), Tv.test(r) ? r.replace("e", ".e") : r;
  14125. }
  14126. function kv(e) {
  14127. return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || Kl.isNegativeZero(e));
  14128. }
  14129. var Wl = new jv("tag:yaml.org,2002:float", {
  14130. kind: "scalar",
  14131. resolve: Cv,
  14132. construct: Iv,
  14133. predicate: kv,
  14134. represent: Rv,
  14135. defaultStyle: "lowercase"
  14136. }), Jl = Ul.extend({
  14137. implicit: [
  14138. zl,
  14139. Gl,
  14140. Bl,
  14141. Wl
  14142. ]
  14143. }), Yl = Jl, Nv = oe, Xl = new RegExp(
  14144. "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
  14145. ), Ql = new RegExp(
  14146. "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
  14147. );
  14148. function Mv(e) {
  14149. return e === null ? !1 : Xl.exec(e) !== null || Ql.exec(e) !== null;
  14150. }
  14151. function Dv(e) {
  14152. var t, r, n, i, s, o, a, l = 0, c = null, f, u, h;
  14153. if (t = Xl.exec(e), t === null && (t = Ql.exec(e)), t === null) throw new Error("Date resolve error");
  14154. if (r = +t[1], n = +t[2] - 1, i = +t[3], !t[4])
  14155. return new Date(Date.UTC(r, n, i));
  14156. if (s = +t[4], o = +t[5], a = +t[6], t[7]) {
  14157. for (l = t[7].slice(0, 3); l.length < 3; )
  14158. l += "0";
  14159. l = +l;
  14160. }
  14161. return t[9] && (f = +t[10], u = +(t[11] || 0), c = (f * 60 + u) * 6e4, t[9] === "-" && (c = -c)), h = new Date(Date.UTC(r, n, i, s, o, a, l)), c && h.setTime(h.getTime() - c), h;
  14162. }
  14163. function qv(e) {
  14164. return e.toISOString();
  14165. }
  14166. var Zl = new Nv("tag:yaml.org,2002:timestamp", {
  14167. kind: "scalar",
  14168. resolve: Mv,
  14169. construct: Dv,
  14170. instanceOf: Date,
  14171. represent: qv
  14172. }), Fv = oe;
  14173. function Vv(e) {
  14174. return e === "<<" || e === null;
  14175. }
  14176. var ec = new Fv("tag:yaml.org,2002:merge", {
  14177. kind: "scalar",
  14178. resolve: Vv
  14179. }), Lv = oe, Es = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
  14180. \r`;
  14181. function Hv(e) {
  14182. if (e === null) return !1;
  14183. var t, r, n = 0, i = e.length, s = Es;
  14184. for (r = 0; r < i; r++)
  14185. if (t = s.indexOf(e.charAt(r)), !(t > 64)) {
  14186. if (t < 0) return !1;
  14187. n += 6;
  14188. }
  14189. return n % 8 === 0;
  14190. }
  14191. function Uv(e) {
  14192. var t, r, n = e.replace(/[\r\n=]/g, ""), i = n.length, s = Es, o = 0, a = [];
  14193. for (t = 0; t < i; t++)
  14194. t % 4 === 0 && t && (a.push(o >> 16 & 255), a.push(o >> 8 & 255), a.push(o & 255)), o = o << 6 | s.indexOf(n.charAt(t));
  14195. return r = i % 4 * 6, r === 0 ? (a.push(o >> 16 & 255), a.push(o >> 8 & 255), a.push(o & 255)) : r === 18 ? (a.push(o >> 10 & 255), a.push(o >> 2 & 255)) : r === 12 && a.push(o >> 4 & 255), new Uint8Array(a);
  14196. }
  14197. function zv(e) {
  14198. var t = "", r = 0, n, i, s = e.length, o = Es;
  14199. for (n = 0; n < s; n++)
  14200. n % 3 === 0 && n && (t += o[r >> 18 & 63], t += o[r >> 12 & 63], t += o[r >> 6 & 63], t += o[r & 63]), r = (r << 8) + e[n];
  14201. return i = s % 3, i === 0 ? (t += o[r >> 18 & 63], t += o[r >> 12 & 63], t += o[r >> 6 & 63], t += o[r & 63]) : i === 2 ? (t += o[r >> 10 & 63], t += o[r >> 4 & 63], t += o[r << 2 & 63], t += o[64]) : i === 1 && (t += o[r >> 2 & 63], t += o[r << 4 & 63], t += o[64], t += o[64]), t;
  14202. }
  14203. function Gv(e) {
  14204. return Object.prototype.toString.call(e) === "[object Uint8Array]";
  14205. }
  14206. var tc = new Lv("tag:yaml.org,2002:binary", {
  14207. kind: "scalar",
  14208. resolve: Hv,
  14209. construct: Uv,
  14210. predicate: Gv,
  14211. represent: zv
  14212. }), Bv = oe, Kv = Object.prototype.hasOwnProperty, Wv = Object.prototype.toString;
  14213. function Jv(e) {
  14214. if (e === null) return !0;
  14215. var t = [], r, n, i, s, o, a = e;
  14216. for (r = 0, n = a.length; r < n; r += 1) {
  14217. if (i = a[r], o = !1, Wv.call(i) !== "[object Object]") return !1;
  14218. for (s in i)
  14219. if (Kv.call(i, s))
  14220. if (!o) o = !0;
  14221. else return !1;
  14222. if (!o) return !1;
  14223. if (t.indexOf(s) === -1) t.push(s);
  14224. else return !1;
  14225. }
  14226. return !0;
  14227. }
  14228. function Yv(e) {
  14229. return e !== null ? e : [];
  14230. }
  14231. var rc = new Bv("tag:yaml.org,2002:omap", {
  14232. kind: "sequence",
  14233. resolve: Jv,
  14234. construct: Yv
  14235. }), Xv = oe, Qv = Object.prototype.toString;
  14236. function Zv(e) {
  14237. if (e === null) return !0;
  14238. var t, r, n, i, s, o = e;
  14239. for (s = new Array(o.length), t = 0, r = o.length; t < r; t += 1) {
  14240. if (n = o[t], Qv.call(n) !== "[object Object]" || (i = Object.keys(n), i.length !== 1)) return !1;
  14241. s[t] = [i[0], n[i[0]]];
  14242. }
  14243. return !0;
  14244. }
  14245. function e0(e) {
  14246. if (e === null) return [];
  14247. var t, r, n, i, s, o = e;
  14248. for (s = new Array(o.length), t = 0, r = o.length; t < r; t += 1)
  14249. n = o[t], i = Object.keys(n), s[t] = [i[0], n[i[0]]];
  14250. return s;
  14251. }
  14252. var nc = new Xv("tag:yaml.org,2002:pairs", {
  14253. kind: "sequence",
  14254. resolve: Zv,
  14255. construct: e0
  14256. }), t0 = oe, r0 = Object.prototype.hasOwnProperty;
  14257. function n0(e) {
  14258. if (e === null) return !0;
  14259. var t, r = e;
  14260. for (t in r)
  14261. if (r0.call(r, t) && r[t] !== null)
  14262. return !1;
  14263. return !0;
  14264. }
  14265. function i0(e) {
  14266. return e !== null ? e : {};
  14267. }
  14268. var ic = new t0("tag:yaml.org,2002:set", {
  14269. kind: "mapping",
  14270. resolve: n0,
  14271. construct: i0
  14272. }), Ss = Yl.extend({
  14273. implicit: [
  14274. Zl,
  14275. ec
  14276. ],
  14277. explicit: [
  14278. tc,
  14279. rc,
  14280. nc,
  14281. ic
  14282. ]
  14283. }), Ze = _e, sc = rr, s0 = rv, o0 = Ss, Be = Object.prototype.hasOwnProperty, Ir = 1, oc = 2, ac = 3, Tr = 4, Gn = 1, a0 = 2, Ho = 3, l0 = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, c0 = /[\x85\u2028\u2029]/, u0 = /[,\[\]\{\}]/, lc = /^(?:!|!!|![a-z\-]+!)$/i, cc = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
  14284. function Uo(e) {
  14285. return Object.prototype.toString.call(e);
  14286. }
  14287. function Oe(e) {
  14288. return e === 10 || e === 13;
  14289. }
  14290. function tt(e) {
  14291. return e === 9 || e === 32;
  14292. }
  14293. function le(e) {
  14294. return e === 9 || e === 32 || e === 10 || e === 13;
  14295. }
  14296. function pt(e) {
  14297. return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
  14298. }
  14299. function f0(e) {
  14300. var t;
  14301. return 48 <= e && e <= 57 ? e - 48 : (t = e | 32, 97 <= t && t <= 102 ? t - 97 + 10 : -1);
  14302. }
  14303. function d0(e) {
  14304. return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
  14305. }
  14306. function p0(e) {
  14307. return 48 <= e && e <= 57 ? e - 48 : -1;
  14308. }
  14309. function zo(e) {
  14310. return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
  14311. ` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "…" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
  14312. }
  14313. function h0(e) {
  14314. return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode(
  14315. (e - 65536 >> 10) + 55296,
  14316. (e - 65536 & 1023) + 56320
  14317. );
  14318. }
  14319. var uc = new Array(256), fc = new Array(256);
  14320. for (var ct = 0; ct < 256; ct++)
  14321. uc[ct] = zo(ct) ? 1 : 0, fc[ct] = zo(ct);
  14322. function m0(e, t) {
  14323. this.input = e, this.filename = t.filename || null, this.schema = t.schema || o0, this.onWarning = t.onWarning || null, this.legacy = t.legacy || !1, this.json = t.json || !1, this.listener = t.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
  14324. }
  14325. function dc(e, t) {
  14326. var r = {
  14327. name: e.filename,
  14328. buffer: e.input.slice(0, -1),
  14329. // omit trailing \0
  14330. position: e.position,
  14331. line: e.line,
  14332. column: e.position - e.lineStart
  14333. };
  14334. return r.snippet = s0(r), new sc(t, r);
  14335. }
  14336. function k(e, t) {
  14337. throw dc(e, t);
  14338. }
  14339. function Rr(e, t) {
  14340. e.onWarning && e.onWarning.call(null, dc(e, t));
  14341. }
  14342. var Go = {
  14343. YAML: function(t, r, n) {
  14344. var i, s, o;
  14345. t.version !== null && k(t, "duplication of %YAML directive"), n.length !== 1 && k(t, "YAML directive accepts exactly one argument"), i = /^([0-9]+)\.([0-9]+)$/.exec(n[0]), i === null && k(t, "ill-formed argument of the YAML directive"), s = parseInt(i[1], 10), o = parseInt(i[2], 10), s !== 1 && k(t, "unacceptable YAML version of the document"), t.version = n[0], t.checkLineBreaks = o < 2, o !== 1 && o !== 2 && Rr(t, "unsupported YAML version of the document");
  14346. },
  14347. TAG: function(t, r, n) {
  14348. var i, s;
  14349. n.length !== 2 && k(t, "TAG directive accepts exactly two arguments"), i = n[0], s = n[1], lc.test(i) || k(t, "ill-formed tag handle (first argument) of the TAG directive"), Be.call(t.tagMap, i) && k(t, 'there is a previously declared suffix for "' + i + '" tag handle'), cc.test(s) || k(t, "ill-formed tag prefix (second argument) of the TAG directive");
  14350. try {
  14351. s = decodeURIComponent(s);
  14352. } catch {
  14353. k(t, "tag prefix is malformed: " + s);
  14354. }
  14355. t.tagMap[i] = s;
  14356. }
  14357. };
  14358. function Ge(e, t, r, n) {
  14359. var i, s, o, a;
  14360. if (t < r) {
  14361. if (a = e.input.slice(t, r), n)
  14362. for (i = 0, s = a.length; i < s; i += 1)
  14363. o = a.charCodeAt(i), o === 9 || 32 <= o && o <= 1114111 || k(e, "expected valid JSON character");
  14364. else l0.test(a) && k(e, "the stream contains non-printable characters");
  14365. e.result += a;
  14366. }
  14367. }
  14368. function Bo(e, t, r, n) {
  14369. var i, s, o, a;
  14370. for (Ze.isObject(r) || k(e, "cannot merge mappings; the provided source object is unacceptable"), i = Object.keys(r), o = 0, a = i.length; o < a; o += 1)
  14371. s = i[o], Be.call(t, s) || (t[s] = r[s], n[s] = !0);
  14372. }
  14373. function ht(e, t, r, n, i, s, o, a, l) {
  14374. var c, f;
  14375. if (Array.isArray(i))
  14376. for (i = Array.prototype.slice.call(i), c = 0, f = i.length; c < f; c += 1)
  14377. Array.isArray(i[c]) && k(e, "nested arrays are not supported inside keys"), typeof i == "object" && Uo(i[c]) === "[object Object]" && (i[c] = "[object Object]");
  14378. if (typeof i == "object" && Uo(i) === "[object Object]" && (i = "[object Object]"), i = String(i), t === null && (t = {}), n === "tag:yaml.org,2002:merge")
  14379. if (Array.isArray(s))
  14380. for (c = 0, f = s.length; c < f; c += 1)
  14381. Bo(e, t, s[c], r);
  14382. else
  14383. Bo(e, t, s, r);
  14384. else
  14385. !e.json && !Be.call(r, i) && Be.call(t, i) && (e.line = o || e.line, e.lineStart = a || e.lineStart, e.position = l || e.position, k(e, "duplicated mapping key")), i === "__proto__" ? Object.defineProperty(t, i, {
  14386. configurable: !0,
  14387. enumerable: !0,
  14388. writable: !0,
  14389. value: s
  14390. }) : t[i] = s, delete r[i];
  14391. return t;
  14392. }
  14393. function xs(e) {
  14394. var t;
  14395. t = e.input.charCodeAt(e.position), t === 10 ? e.position++ : t === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : k(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
  14396. }
  14397. function J(e, t, r) {
  14398. for (var n = 0, i = e.input.charCodeAt(e.position); i !== 0; ) {
  14399. for (; tt(i); )
  14400. i === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), i = e.input.charCodeAt(++e.position);
  14401. if (t && i === 35)
  14402. do
  14403. i = e.input.charCodeAt(++e.position);
  14404. while (i !== 10 && i !== 13 && i !== 0);
  14405. if (Oe(i))
  14406. for (xs(e), i = e.input.charCodeAt(e.position), n++, e.lineIndent = 0; i === 32; )
  14407. e.lineIndent++, i = e.input.charCodeAt(++e.position);
  14408. else
  14409. break;
  14410. }
  14411. return r !== -1 && n !== 0 && e.lineIndent < r && Rr(e, "deficient indentation"), n;
  14412. }
  14413. function dn(e) {
  14414. var t = e.position, r;
  14415. return r = e.input.charCodeAt(t), !!((r === 45 || r === 46) && r === e.input.charCodeAt(t + 1) && r === e.input.charCodeAt(t + 2) && (t += 3, r = e.input.charCodeAt(t), r === 0 || le(r)));
  14416. }
  14417. function js(e, t) {
  14418. t === 1 ? e.result += " " : t > 1 && (e.result += Ze.repeat(`
  14419. `, t - 1));
  14420. }
  14421. function y0(e, t, r) {
  14422. var n, i, s, o, a, l, c, f, u = e.kind, h = e.result, y;
  14423. if (y = e.input.charCodeAt(e.position), le(y) || pt(y) || y === 35 || y === 38 || y === 42 || y === 33 || y === 124 || y === 62 || y === 39 || y === 34 || y === 37 || y === 64 || y === 96 || (y === 63 || y === 45) && (i = e.input.charCodeAt(e.position + 1), le(i) || r && pt(i)))
  14424. return !1;
  14425. for (e.kind = "scalar", e.result = "", s = o = e.position, a = !1; y !== 0; ) {
  14426. if (y === 58) {
  14427. if (i = e.input.charCodeAt(e.position + 1), le(i) || r && pt(i))
  14428. break;
  14429. } else if (y === 35) {
  14430. if (n = e.input.charCodeAt(e.position - 1), le(n))
  14431. break;
  14432. } else {
  14433. if (e.position === e.lineStart && dn(e) || r && pt(y))
  14434. break;
  14435. if (Oe(y))
  14436. if (l = e.line, c = e.lineStart, f = e.lineIndent, J(e, !1, -1), e.lineIndent >= t) {
  14437. a = !0, y = e.input.charCodeAt(e.position);
  14438. continue;
  14439. } else {
  14440. e.position = o, e.line = l, e.lineStart = c, e.lineIndent = f;
  14441. break;
  14442. }
  14443. }
  14444. a && (Ge(e, s, o, !1), js(e, e.line - l), s = o = e.position, a = !1), tt(y) || (o = e.position + 1), y = e.input.charCodeAt(++e.position);
  14445. }
  14446. return Ge(e, s, o, !1), e.result ? !0 : (e.kind = u, e.result = h, !1);
  14447. }
  14448. function g0(e, t) {
  14449. var r, n, i;
  14450. if (r = e.input.charCodeAt(e.position), r !== 39)
  14451. return !1;
  14452. for (e.kind = "scalar", e.result = "", e.position++, n = i = e.position; (r = e.input.charCodeAt(e.position)) !== 0; )
  14453. if (r === 39)
  14454. if (Ge(e, n, e.position, !0), r = e.input.charCodeAt(++e.position), r === 39)
  14455. n = e.position, e.position++, i = e.position;
  14456. else
  14457. return !0;
  14458. else Oe(r) ? (Ge(e, n, i, !0), js(e, J(e, !1, t)), n = i = e.position) : e.position === e.lineStart && dn(e) ? k(e, "unexpected end of the document within a single quoted scalar") : (e.position++, i = e.position);
  14459. k(e, "unexpected end of the stream within a single quoted scalar");
  14460. }
  14461. function $0(e, t) {
  14462. var r, n, i, s, o, a;
  14463. if (a = e.input.charCodeAt(e.position), a !== 34)
  14464. return !1;
  14465. for (e.kind = "scalar", e.result = "", e.position++, r = n = e.position; (a = e.input.charCodeAt(e.position)) !== 0; ) {
  14466. if (a === 34)
  14467. return Ge(e, r, e.position, !0), e.position++, !0;
  14468. if (a === 92) {
  14469. if (Ge(e, r, e.position, !0), a = e.input.charCodeAt(++e.position), Oe(a))
  14470. J(e, !1, t);
  14471. else if (a < 256 && uc[a])
  14472. e.result += fc[a], e.position++;
  14473. else if ((o = d0(a)) > 0) {
  14474. for (i = o, s = 0; i > 0; i--)
  14475. a = e.input.charCodeAt(++e.position), (o = f0(a)) >= 0 ? s = (s << 4) + o : k(e, "expected hexadecimal character");
  14476. e.result += h0(s), e.position++;
  14477. } else
  14478. k(e, "unknown escape sequence");
  14479. r = n = e.position;
  14480. } else Oe(a) ? (Ge(e, r, n, !0), js(e, J(e, !1, t)), r = n = e.position) : e.position === e.lineStart && dn(e) ? k(e, "unexpected end of the document within a double quoted scalar") : (e.position++, n = e.position);
  14481. }
  14482. k(e, "unexpected end of the stream within a double quoted scalar");
  14483. }
  14484. function _0(e, t) {
  14485. var r = !0, n, i, s, o = e.tag, a, l = e.anchor, c, f, u, h, y, _ = /* @__PURE__ */ Object.create(null), b, v, p, m;
  14486. if (m = e.input.charCodeAt(e.position), m === 91)
  14487. f = 93, y = !1, a = [];
  14488. else if (m === 123)
  14489. f = 125, y = !0, a = {};
  14490. else
  14491. return !1;
  14492. for (e.anchor !== null && (e.anchorMap[e.anchor] = a), m = e.input.charCodeAt(++e.position); m !== 0; ) {
  14493. if (J(e, !0, t), m = e.input.charCodeAt(e.position), m === f)
  14494. return e.position++, e.tag = o, e.anchor = l, e.kind = y ? "mapping" : "sequence", e.result = a, !0;
  14495. r ? m === 44 && k(e, "expected the node content, but found ','") : k(e, "missed comma between flow collection entries"), v = b = p = null, u = h = !1, m === 63 && (c = e.input.charCodeAt(e.position + 1), le(c) && (u = h = !0, e.position++, J(e, !0, t))), n = e.line, i = e.lineStart, s = e.position, vt(e, t, Ir, !1, !0), v = e.tag, b = e.result, J(e, !0, t), m = e.input.charCodeAt(e.position), (h || e.line === n) && m === 58 && (u = !0, m = e.input.charCodeAt(++e.position), J(e, !0, t), vt(e, t, Ir, !1, !0), p = e.result), y ? ht(e, a, _, v, b, p, n, i, s) : u ? a.push(ht(e, null, _, v, b, p, n, i, s)) : a.push(b), J(e, !0, t), m = e.input.charCodeAt(e.position), m === 44 ? (r = !0, m = e.input.charCodeAt(++e.position)) : r = !1;
  14496. }
  14497. k(e, "unexpected end of the stream within a flow collection");
  14498. }
  14499. function v0(e, t) {
  14500. var r, n, i = Gn, s = !1, o = !1, a = t, l = 0, c = !1, f, u;
  14501. if (u = e.input.charCodeAt(e.position), u === 124)
  14502. n = !1;
  14503. else if (u === 62)
  14504. n = !0;
  14505. else
  14506. return !1;
  14507. for (e.kind = "scalar", e.result = ""; u !== 0; )
  14508. if (u = e.input.charCodeAt(++e.position), u === 43 || u === 45)
  14509. Gn === i ? i = u === 43 ? Ho : a0 : k(e, "repeat of a chomping mode identifier");
  14510. else if ((f = p0(u)) >= 0)
  14511. f === 0 ? k(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : o ? k(e, "repeat of an indentation width identifier") : (a = t + f - 1, o = !0);
  14512. else
  14513. break;
  14514. if (tt(u)) {
  14515. do
  14516. u = e.input.charCodeAt(++e.position);
  14517. while (tt(u));
  14518. if (u === 35)
  14519. do
  14520. u = e.input.charCodeAt(++e.position);
  14521. while (!Oe(u) && u !== 0);
  14522. }
  14523. for (; u !== 0; ) {
  14524. for (xs(e), e.lineIndent = 0, u = e.input.charCodeAt(e.position); (!o || e.lineIndent < a) && u === 32; )
  14525. e.lineIndent++, u = e.input.charCodeAt(++e.position);
  14526. if (!o && e.lineIndent > a && (a = e.lineIndent), Oe(u)) {
  14527. l++;
  14528. continue;
  14529. }
  14530. if (e.lineIndent < a) {
  14531. i === Ho ? e.result += Ze.repeat(`
  14532. `, s ? 1 + l : l) : i === Gn && s && (e.result += `
  14533. `);
  14534. break;
  14535. }
  14536. for (n ? tt(u) ? (c = !0, e.result += Ze.repeat(`
  14537. `, s ? 1 + l : l)) : c ? (c = !1, e.result += Ze.repeat(`
  14538. `, l + 1)) : l === 0 ? s && (e.result += " ") : e.result += Ze.repeat(`
  14539. `, l) : e.result += Ze.repeat(`
  14540. `, s ? 1 + l : l), s = !0, o = !0, l = 0, r = e.position; !Oe(u) && u !== 0; )
  14541. u = e.input.charCodeAt(++e.position);
  14542. Ge(e, r, e.position, !1);
  14543. }
  14544. return !0;
  14545. }
  14546. function Ko(e, t) {
  14547. var r, n = e.tag, i = e.anchor, s = [], o, a = !1, l;
  14548. if (e.firstTabInLine !== -1) return !1;
  14549. for (e.anchor !== null && (e.anchorMap[e.anchor] = s), l = e.input.charCodeAt(e.position); l !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, k(e, "tab characters must not be used in indentation")), !(l !== 45 || (o = e.input.charCodeAt(e.position + 1), !le(o)))); ) {
  14550. if (a = !0, e.position++, J(e, !0, -1) && e.lineIndent <= t) {
  14551. s.push(null), l = e.input.charCodeAt(e.position);
  14552. continue;
  14553. }
  14554. if (r = e.line, vt(e, t, ac, !1, !0), s.push(e.result), J(e, !0, -1), l = e.input.charCodeAt(e.position), (e.line === r || e.lineIndent > t) && l !== 0)
  14555. k(e, "bad indentation of a sequence entry");
  14556. else if (e.lineIndent < t)
  14557. break;
  14558. }
  14559. return a ? (e.tag = n, e.anchor = i, e.kind = "sequence", e.result = s, !0) : !1;
  14560. }
  14561. function b0(e, t, r) {
  14562. var n, i, s, o, a, l, c = e.tag, f = e.anchor, u = {}, h = /* @__PURE__ */ Object.create(null), y = null, _ = null, b = null, v = !1, p = !1, m;
  14563. if (e.firstTabInLine !== -1) return !1;
  14564. for (e.anchor !== null && (e.anchorMap[e.anchor] = u), m = e.input.charCodeAt(e.position); m !== 0; ) {
  14565. if (!v && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, k(e, "tab characters must not be used in indentation")), n = e.input.charCodeAt(e.position + 1), s = e.line, (m === 63 || m === 58) && le(n))
  14566. m === 63 ? (v && (ht(e, u, h, y, _, null, o, a, l), y = _ = b = null), p = !0, v = !0, i = !0) : v ? (v = !1, i = !0) : k(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, m = n;
  14567. else {
  14568. if (o = e.line, a = e.lineStart, l = e.position, !vt(e, r, oc, !1, !0))
  14569. break;
  14570. if (e.line === s) {
  14571. for (m = e.input.charCodeAt(e.position); tt(m); )
  14572. m = e.input.charCodeAt(++e.position);
  14573. if (m === 58)
  14574. m = e.input.charCodeAt(++e.position), le(m) || k(e, "a whitespace character is expected after the key-value separator within a block mapping"), v && (ht(e, u, h, y, _, null, o, a, l), y = _ = b = null), p = !0, v = !1, i = !1, y = e.tag, _ = e.result;
  14575. else if (p)
  14576. k(e, "can not read an implicit mapping pair; a colon is missed");
  14577. else
  14578. return e.tag = c, e.anchor = f, !0;
  14579. } else if (p)
  14580. k(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
  14581. else
  14582. return e.tag = c, e.anchor = f, !0;
  14583. }
  14584. if ((e.line === s || e.lineIndent > t) && (v && (o = e.line, a = e.lineStart, l = e.position), vt(e, t, Tr, !0, i) && (v ? _ = e.result : b = e.result), v || (ht(e, u, h, y, _, b, o, a, l), y = _ = b = null), J(e, !0, -1), m = e.input.charCodeAt(e.position)), (e.line === s || e.lineIndent > t) && m !== 0)
  14585. k(e, "bad indentation of a mapping entry");
  14586. else if (e.lineIndent < t)
  14587. break;
  14588. }
  14589. return v && ht(e, u, h, y, _, null, o, a, l), p && (e.tag = c, e.anchor = f, e.kind = "mapping", e.result = u), p;
  14590. }
  14591. function w0(e) {
  14592. var t, r = !1, n = !1, i, s, o;
  14593. if (o = e.input.charCodeAt(e.position), o !== 33) return !1;
  14594. if (e.tag !== null && k(e, "duplication of a tag property"), o = e.input.charCodeAt(++e.position), o === 60 ? (r = !0, o = e.input.charCodeAt(++e.position)) : o === 33 ? (n = !0, i = "!!", o = e.input.charCodeAt(++e.position)) : i = "!", t = e.position, r) {
  14595. do
  14596. o = e.input.charCodeAt(++e.position);
  14597. while (o !== 0 && o !== 62);
  14598. e.position < e.length ? (s = e.input.slice(t, e.position), o = e.input.charCodeAt(++e.position)) : k(e, "unexpected end of the stream within a verbatim tag");
  14599. } else {
  14600. for (; o !== 0 && !le(o); )
  14601. o === 33 && (n ? k(e, "tag suffix cannot contain exclamation marks") : (i = e.input.slice(t - 1, e.position + 1), lc.test(i) || k(e, "named tag handle cannot contain such characters"), n = !0, t = e.position + 1)), o = e.input.charCodeAt(++e.position);
  14602. s = e.input.slice(t, e.position), u0.test(s) && k(e, "tag suffix cannot contain flow indicator characters");
  14603. }
  14604. s && !cc.test(s) && k(e, "tag name cannot contain such characters: " + s);
  14605. try {
  14606. s = decodeURIComponent(s);
  14607. } catch {
  14608. k(e, "tag name is malformed: " + s);
  14609. }
  14610. return r ? e.tag = s : Be.call(e.tagMap, i) ? e.tag = e.tagMap[i] + s : i === "!" ? e.tag = "!" + s : i === "!!" ? e.tag = "tag:yaml.org,2002:" + s : k(e, 'undeclared tag handle "' + i + '"'), !0;
  14611. }
  14612. function P0(e) {
  14613. var t, r;
  14614. if (r = e.input.charCodeAt(e.position), r !== 38) return !1;
  14615. for (e.anchor !== null && k(e, "duplication of an anchor property"), r = e.input.charCodeAt(++e.position), t = e.position; r !== 0 && !le(r) && !pt(r); )
  14616. r = e.input.charCodeAt(++e.position);
  14617. return e.position === t && k(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(t, e.position), !0;
  14618. }
  14619. function O0(e) {
  14620. var t, r, n;
  14621. if (n = e.input.charCodeAt(e.position), n !== 42) return !1;
  14622. for (n = e.input.charCodeAt(++e.position), t = e.position; n !== 0 && !le(n) && !pt(n); )
  14623. n = e.input.charCodeAt(++e.position);
  14624. return e.position === t && k(e, "name of an alias node must contain at least one character"), r = e.input.slice(t, e.position), Be.call(e.anchorMap, r) || k(e, 'unidentified alias "' + r + '"'), e.result = e.anchorMap[r], J(e, !0, -1), !0;
  14625. }
  14626. function vt(e, t, r, n, i) {
  14627. var s, o, a, l = 1, c = !1, f = !1, u, h, y, _, b, v;
  14628. if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, s = o = a = Tr === r || ac === r, n && J(e, !0, -1) && (c = !0, e.lineIndent > t ? l = 1 : e.lineIndent === t ? l = 0 : e.lineIndent < t && (l = -1)), l === 1)
  14629. for (; w0(e) || P0(e); )
  14630. J(e, !0, -1) ? (c = !0, a = s, e.lineIndent > t ? l = 1 : e.lineIndent === t ? l = 0 : e.lineIndent < t && (l = -1)) : a = !1;
  14631. if (a && (a = c || i), (l === 1 || Tr === r) && (Ir === r || oc === r ? b = t : b = t + 1, v = e.position - e.lineStart, l === 1 ? a && (Ko(e, v) || b0(e, v, b)) || _0(e, b) ? f = !0 : (o && v0(e, b) || g0(e, b) || $0(e, b) ? f = !0 : O0(e) ? (f = !0, (e.tag !== null || e.anchor !== null) && k(e, "alias node should not have any properties")) : y0(e, b, Ir === r) && (f = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : l === 0 && (f = a && Ko(e, v))), e.tag === null)
  14632. e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
  14633. else if (e.tag === "?") {
  14634. for (e.result !== null && e.kind !== "scalar" && k(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), u = 0, h = e.implicitTypes.length; u < h; u += 1)
  14635. if (_ = e.implicitTypes[u], _.resolve(e.result)) {
  14636. e.result = _.construct(e.result), e.tag = _.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
  14637. break;
  14638. }
  14639. } else if (e.tag !== "!") {
  14640. if (Be.call(e.typeMap[e.kind || "fallback"], e.tag))
  14641. _ = e.typeMap[e.kind || "fallback"][e.tag];
  14642. else
  14643. for (_ = null, y = e.typeMap.multi[e.kind || "fallback"], u = 0, h = y.length; u < h; u += 1)
  14644. if (e.tag.slice(0, y[u].tag.length) === y[u].tag) {
  14645. _ = y[u];
  14646. break;
  14647. }
  14648. _ || k(e, "unknown tag !<" + e.tag + ">"), e.result !== null && _.kind !== e.kind && k(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + _.kind + '", not "' + e.kind + '"'), _.resolve(e.result, e.tag) ? (e.result = _.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : k(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
  14649. }
  14650. return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || f;
  14651. }
  14652. function E0(e) {
  14653. var t = e.position, r, n, i, s = !1, o;
  14654. for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (o = e.input.charCodeAt(e.position)) !== 0 && (J(e, !0, -1), o = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || o !== 37)); ) {
  14655. for (s = !0, o = e.input.charCodeAt(++e.position), r = e.position; o !== 0 && !le(o); )
  14656. o = e.input.charCodeAt(++e.position);
  14657. for (n = e.input.slice(r, e.position), i = [], n.length < 1 && k(e, "directive name must not be less than one character in length"); o !== 0; ) {
  14658. for (; tt(o); )
  14659. o = e.input.charCodeAt(++e.position);
  14660. if (o === 35) {
  14661. do
  14662. o = e.input.charCodeAt(++e.position);
  14663. while (o !== 0 && !Oe(o));
  14664. break;
  14665. }
  14666. if (Oe(o)) break;
  14667. for (r = e.position; o !== 0 && !le(o); )
  14668. o = e.input.charCodeAt(++e.position);
  14669. i.push(e.input.slice(r, e.position));
  14670. }
  14671. o !== 0 && xs(e), Be.call(Go, n) ? Go[n](e, n, i) : Rr(e, 'unknown document directive "' + n + '"');
  14672. }
  14673. if (J(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, J(e, !0, -1)) : s && k(e, "directives end mark is expected"), vt(e, e.lineIndent - 1, Tr, !1, !0), J(e, !0, -1), e.checkLineBreaks && c0.test(e.input.slice(t, e.position)) && Rr(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && dn(e)) {
  14674. e.input.charCodeAt(e.position) === 46 && (e.position += 3, J(e, !0, -1));
  14675. return;
  14676. }
  14677. if (e.position < e.length - 1)
  14678. k(e, "end of the stream or a document separator is expected");
  14679. else
  14680. return;
  14681. }
  14682. function pc(e, t) {
  14683. e = String(e), t = t || {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += `
  14684. `), e.charCodeAt(0) === 65279 && (e = e.slice(1)));
  14685. var r = new m0(e, t), n = e.indexOf("\0");
  14686. for (n !== -1 && (r.position = n, k(r, "null byte is not allowed in input")), r.input += "\0"; r.input.charCodeAt(r.position) === 32; )
  14687. r.lineIndent += 1, r.position += 1;
  14688. for (; r.position < r.length - 1; )
  14689. E0(r);
  14690. return r.documents;
  14691. }
  14692. function S0(e, t, r) {
  14693. t !== null && typeof t == "object" && typeof r > "u" && (r = t, t = null);
  14694. var n = pc(e, r);
  14695. if (typeof t != "function")
  14696. return n;
  14697. for (var i = 0, s = n.length; i < s; i += 1)
  14698. t(n[i]);
  14699. }
  14700. function x0(e, t) {
  14701. var r = pc(e, t);
  14702. if (r.length !== 0) {
  14703. if (r.length === 1)
  14704. return r[0];
  14705. throw new sc("expected a single document in the stream, but found more");
  14706. }
  14707. }
  14708. Os.loadAll = S0;
  14709. Os.load = x0;
  14710. var hc = {}, pn = _e, nr = rr, j0 = Ss, mc = Object.prototype.toString, yc = Object.prototype.hasOwnProperty, As = 65279, A0 = 9, Bt = 10, C0 = 13, I0 = 32, T0 = 33, R0 = 34, hi = 35, k0 = 37, N0 = 38, M0 = 39, D0 = 42, gc = 44, q0 = 45, kr = 58, F0 = 61, V0 = 62, L0 = 63, H0 = 64, $c = 91, _c = 93, U0 = 96, vc = 123, z0 = 124, bc = 125, ne = {};
  14711. ne[0] = "\\0";
  14712. ne[7] = "\\a";
  14713. ne[8] = "\\b";
  14714. ne[9] = "\\t";
  14715. ne[10] = "\\n";
  14716. ne[11] = "\\v";
  14717. ne[12] = "\\f";
  14718. ne[13] = "\\r";
  14719. ne[27] = "\\e";
  14720. ne[34] = '\\"';
  14721. ne[92] = "\\\\";
  14722. ne[133] = "\\N";
  14723. ne[160] = "\\_";
  14724. ne[8232] = "\\L";
  14725. ne[8233] = "\\P";
  14726. var G0 = [
  14727. "y",
  14728. "Y",
  14729. "yes",
  14730. "Yes",
  14731. "YES",
  14732. "on",
  14733. "On",
  14734. "ON",
  14735. "n",
  14736. "N",
  14737. "no",
  14738. "No",
  14739. "NO",
  14740. "off",
  14741. "Off",
  14742. "OFF"
  14743. ], B0 = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
  14744. function K0(e, t) {
  14745. var r, n, i, s, o, a, l;
  14746. if (t === null) return {};
  14747. for (r = {}, n = Object.keys(t), i = 0, s = n.length; i < s; i += 1)
  14748. o = n[i], a = String(t[o]), o.slice(0, 2) === "!!" && (o = "tag:yaml.org,2002:" + o.slice(2)), l = e.compiledTypeMap.fallback[o], l && yc.call(l.styleAliases, a) && (a = l.styleAliases[a]), r[o] = a;
  14749. return r;
  14750. }
  14751. function W0(e) {
  14752. var t, r, n;
  14753. if (t = e.toString(16).toUpperCase(), e <= 255)
  14754. r = "x", n = 2;
  14755. else if (e <= 65535)
  14756. r = "u", n = 4;
  14757. else if (e <= 4294967295)
  14758. r = "U", n = 8;
  14759. else
  14760. throw new nr("code point within a string may not be greater than 0xFFFFFFFF");
  14761. return "\\" + r + pn.repeat("0", n - t.length) + t;
  14762. }
  14763. var J0 = 1, Kt = 2;
  14764. function Y0(e) {
  14765. this.schema = e.schema || j0, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = pn.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = K0(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? Kt : J0, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
  14766. }
  14767. function Wo(e, t) {
  14768. for (var r = pn.repeat(" ", t), n = 0, i = -1, s = "", o, a = e.length; n < a; )
  14769. i = e.indexOf(`
  14770. `, n), i === -1 ? (o = e.slice(n), n = a) : (o = e.slice(n, i + 1), n = i + 1), o.length && o !== `
  14771. ` && (s += r), s += o;
  14772. return s;
  14773. }
  14774. function mi(e, t) {
  14775. return `
  14776. ` + pn.repeat(" ", e.indent * t);
  14777. }
  14778. function X0(e, t) {
  14779. var r, n, i;
  14780. for (r = 0, n = e.implicitTypes.length; r < n; r += 1)
  14781. if (i = e.implicitTypes[r], i.resolve(t))
  14782. return !0;
  14783. return !1;
  14784. }
  14785. function Nr(e) {
  14786. return e === I0 || e === A0;
  14787. }
  14788. function Wt(e) {
  14789. return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== As || 65536 <= e && e <= 1114111;
  14790. }
  14791. function Jo(e) {
  14792. return Wt(e) && e !== As && e !== C0 && e !== Bt;
  14793. }
  14794. function Yo(e, t, r) {
  14795. var n = Jo(e), i = n && !Nr(e);
  14796. return (
  14797. // ns-plain-safe
  14798. (r ? (
  14799. // c = flow-in
  14800. n
  14801. ) : n && e !== gc && e !== $c && e !== _c && e !== vc && e !== bc) && e !== hi && !(t === kr && !i) || Jo(t) && !Nr(t) && e === hi || t === kr && i
  14802. );
  14803. }
  14804. function Q0(e) {
  14805. return Wt(e) && e !== As && !Nr(e) && e !== q0 && e !== L0 && e !== kr && e !== gc && e !== $c && e !== _c && e !== vc && e !== bc && e !== hi && e !== N0 && e !== D0 && e !== T0 && e !== z0 && e !== F0 && e !== V0 && e !== M0 && e !== R0 && e !== k0 && e !== H0 && e !== U0;
  14806. }
  14807. function Z0(e) {
  14808. return !Nr(e) && e !== kr;
  14809. }
  14810. function Dt(e, t) {
  14811. var r = e.charCodeAt(t), n;
  14812. return r >= 55296 && r <= 56319 && t + 1 < e.length && (n = e.charCodeAt(t + 1), n >= 56320 && n <= 57343) ? (r - 55296) * 1024 + n - 56320 + 65536 : r;
  14813. }
  14814. function wc(e) {
  14815. var t = /^\n* /;
  14816. return t.test(e);
  14817. }
  14818. var Pc = 1, yi = 2, Oc = 3, Ec = 4, dt = 5;
  14819. function eb(e, t, r, n, i, s, o, a) {
  14820. var l, c = 0, f = null, u = !1, h = !1, y = n !== -1, _ = -1, b = Q0(Dt(e, 0)) && Z0(Dt(e, e.length - 1));
  14821. if (t || o)
  14822. for (l = 0; l < e.length; c >= 65536 ? l += 2 : l++) {
  14823. if (c = Dt(e, l), !Wt(c))
  14824. return dt;
  14825. b = b && Yo(c, f, a), f = c;
  14826. }
  14827. else {
  14828. for (l = 0; l < e.length; c >= 65536 ? l += 2 : l++) {
  14829. if (c = Dt(e, l), c === Bt)
  14830. u = !0, y && (h = h || // Foldable line = too long, and not more-indented.
  14831. l - _ - 1 > n && e[_ + 1] !== " ", _ = l);
  14832. else if (!Wt(c))
  14833. return dt;
  14834. b = b && Yo(c, f, a), f = c;
  14835. }
  14836. h = h || y && l - _ - 1 > n && e[_ + 1] !== " ";
  14837. }
  14838. return !u && !h ? b && !o && !i(e) ? Pc : s === Kt ? dt : yi : r > 9 && wc(e) ? dt : o ? s === Kt ? dt : yi : h ? Ec : Oc;
  14839. }
  14840. function tb(e, t, r, n, i) {
  14841. e.dump = function() {
  14842. if (t.length === 0)
  14843. return e.quotingType === Kt ? '""' : "''";
  14844. if (!e.noCompatMode && (G0.indexOf(t) !== -1 || B0.test(t)))
  14845. return e.quotingType === Kt ? '"' + t + '"' : "'" + t + "'";
  14846. var s = e.indent * Math.max(1, r), o = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - s), a = n || e.flowLevel > -1 && r >= e.flowLevel;
  14847. function l(c) {
  14848. return X0(e, c);
  14849. }
  14850. switch (eb(
  14851. t,
  14852. a,
  14853. e.indent,
  14854. o,
  14855. l,
  14856. e.quotingType,
  14857. e.forceQuotes && !n,
  14858. i
  14859. )) {
  14860. case Pc:
  14861. return t;
  14862. case yi:
  14863. return "'" + t.replace(/'/g, "''") + "'";
  14864. case Oc:
  14865. return "|" + Xo(t, e.indent) + Qo(Wo(t, s));
  14866. case Ec:
  14867. return ">" + Xo(t, e.indent) + Qo(Wo(rb(t, o), s));
  14868. case dt:
  14869. return '"' + nb(t) + '"';
  14870. default:
  14871. throw new nr("impossible error: invalid scalar style");
  14872. }
  14873. }();
  14874. }
  14875. function Xo(e, t) {
  14876. var r = wc(e) ? String(t) : "", n = e[e.length - 1] === `
  14877. `, i = n && (e[e.length - 2] === `
  14878. ` || e === `
  14879. `), s = i ? "+" : n ? "" : "-";
  14880. return r + s + `
  14881. `;
  14882. }
  14883. function Qo(e) {
  14884. return e[e.length - 1] === `
  14885. ` ? e.slice(0, -1) : e;
  14886. }
  14887. function rb(e, t) {
  14888. for (var r = /(\n+)([^\n]*)/g, n = function() {
  14889. var c = e.indexOf(`
  14890. `);
  14891. return c = c !== -1 ? c : e.length, r.lastIndex = c, Zo(e.slice(0, c), t);
  14892. }(), i = e[0] === `
  14893. ` || e[0] === " ", s, o; o = r.exec(e); ) {
  14894. var a = o[1], l = o[2];
  14895. s = l[0] === " ", n += a + (!i && !s && l !== "" ? `
  14896. ` : "") + Zo(l, t), i = s;
  14897. }
  14898. return n;
  14899. }
  14900. function Zo(e, t) {
  14901. if (e === "" || e[0] === " ") return e;
  14902. for (var r = / [^ ]/g, n, i = 0, s, o = 0, a = 0, l = ""; n = r.exec(e); )
  14903. a = n.index, a - i > t && (s = o > i ? o : a, l += `
  14904. ` + e.slice(i, s), i = s + 1), o = a;
  14905. return l += `
  14906. `, e.length - i > t && o > i ? l += e.slice(i, o) + `
  14907. ` + e.slice(o + 1) : l += e.slice(i), l.slice(1);
  14908. }
  14909. function nb(e) {
  14910. for (var t = "", r = 0, n, i = 0; i < e.length; r >= 65536 ? i += 2 : i++)
  14911. r = Dt(e, i), n = ne[r], !n && Wt(r) ? (t += e[i], r >= 65536 && (t += e[i + 1])) : t += n || W0(r);
  14912. return t;
  14913. }
  14914. function ib(e, t, r) {
  14915. var n = "", i = e.tag, s, o, a;
  14916. for (s = 0, o = r.length; s < o; s += 1)
  14917. a = r[s], e.replacer && (a = e.replacer.call(r, String(s), a)), (ke(e, t, a, !1, !1) || typeof a > "u" && ke(e, t, null, !1, !1)) && (n !== "" && (n += "," + (e.condenseFlow ? "" : " ")), n += e.dump);
  14918. e.tag = i, e.dump = "[" + n + "]";
  14919. }
  14920. function ea(e, t, r, n) {
  14921. var i = "", s = e.tag, o, a, l;
  14922. for (o = 0, a = r.length; o < a; o += 1)
  14923. l = r[o], e.replacer && (l = e.replacer.call(r, String(o), l)), (ke(e, t + 1, l, !0, !0, !1, !0) || typeof l > "u" && ke(e, t + 1, null, !0, !0, !1, !0)) && ((!n || i !== "") && (i += mi(e, t)), e.dump && Bt === e.dump.charCodeAt(0) ? i += "-" : i += "- ", i += e.dump);
  14924. e.tag = s, e.dump = i || "[]";
  14925. }
  14926. function sb(e, t, r) {
  14927. var n = "", i = e.tag, s = Object.keys(r), o, a, l, c, f;
  14928. for (o = 0, a = s.length; o < a; o += 1)
  14929. f = "", n !== "" && (f += ", "), e.condenseFlow && (f += '"'), l = s[o], c = r[l], e.replacer && (c = e.replacer.call(r, l, c)), ke(e, t, l, !1, !1) && (e.dump.length > 1024 && (f += "? "), f += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), ke(e, t, c, !1, !1) && (f += e.dump, n += f));
  14930. e.tag = i, e.dump = "{" + n + "}";
  14931. }
  14932. function ob(e, t, r, n) {
  14933. var i = "", s = e.tag, o = Object.keys(r), a, l, c, f, u, h;
  14934. if (e.sortKeys === !0)
  14935. o.sort();
  14936. else if (typeof e.sortKeys == "function")
  14937. o.sort(e.sortKeys);
  14938. else if (e.sortKeys)
  14939. throw new nr("sortKeys must be a boolean or a function");
  14940. for (a = 0, l = o.length; a < l; a += 1)
  14941. h = "", (!n || i !== "") && (h += mi(e, t)), c = o[a], f = r[c], e.replacer && (f = e.replacer.call(r, c, f)), ke(e, t + 1, c, !0, !0, !0) && (u = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, u && (e.dump && Bt === e.dump.charCodeAt(0) ? h += "?" : h += "? "), h += e.dump, u && (h += mi(e, t)), ke(e, t + 1, f, !0, u) && (e.dump && Bt === e.dump.charCodeAt(0) ? h += ":" : h += ": ", h += e.dump, i += h));
  14942. e.tag = s, e.dump = i || "{}";
  14943. }
  14944. function ta(e, t, r) {
  14945. var n, i, s, o, a, l;
  14946. for (i = r ? e.explicitTypes : e.implicitTypes, s = 0, o = i.length; s < o; s += 1)
  14947. if (a = i[s], (a.instanceOf || a.predicate) && (!a.instanceOf || typeof t == "object" && t instanceof a.instanceOf) && (!a.predicate || a.predicate(t))) {
  14948. if (r ? a.multi && a.representName ? e.tag = a.representName(t) : e.tag = a.tag : e.tag = "?", a.represent) {
  14949. if (l = e.styleMap[a.tag] || a.defaultStyle, mc.call(a.represent) === "[object Function]")
  14950. n = a.represent(t, l);
  14951. else if (yc.call(a.represent, l))
  14952. n = a.represent[l](t, l);
  14953. else
  14954. throw new nr("!<" + a.tag + '> tag resolver accepts not "' + l + '" style');
  14955. e.dump = n;
  14956. }
  14957. return !0;
  14958. }
  14959. return !1;
  14960. }
  14961. function ke(e, t, r, n, i, s, o) {
  14962. e.tag = null, e.dump = r, ta(e, r, !1) || ta(e, r, !0);
  14963. var a = mc.call(e.dump), l = n, c;
  14964. n && (n = e.flowLevel < 0 || e.flowLevel > t);
  14965. var f = a === "[object Object]" || a === "[object Array]", u, h;
  14966. if (f && (u = e.duplicates.indexOf(r), h = u !== -1), (e.tag !== null && e.tag !== "?" || h || e.indent !== 2 && t > 0) && (i = !1), h && e.usedDuplicates[u])
  14967. e.dump = "*ref_" + u;
  14968. else {
  14969. if (f && h && !e.usedDuplicates[u] && (e.usedDuplicates[u] = !0), a === "[object Object]")
  14970. n && Object.keys(e.dump).length !== 0 ? (ob(e, t, e.dump, i), h && (e.dump = "&ref_" + u + e.dump)) : (sb(e, t, e.dump), h && (e.dump = "&ref_" + u + " " + e.dump));
  14971. else if (a === "[object Array]")
  14972. n && e.dump.length !== 0 ? (e.noArrayIndent && !o && t > 0 ? ea(e, t - 1, e.dump, i) : ea(e, t, e.dump, i), h && (e.dump = "&ref_" + u + e.dump)) : (ib(e, t, e.dump), h && (e.dump = "&ref_" + u + " " + e.dump));
  14973. else if (a === "[object String]")
  14974. e.tag !== "?" && tb(e, e.dump, t, s, l);
  14975. else {
  14976. if (a === "[object Undefined]")
  14977. return !1;
  14978. if (e.skipInvalid) return !1;
  14979. throw new nr("unacceptable kind of an object to dump " + a);
  14980. }
  14981. e.tag !== null && e.tag !== "?" && (c = encodeURI(
  14982. e.tag[0] === "!" ? e.tag.slice(1) : e.tag
  14983. ).replace(/!/g, "%21"), e.tag[0] === "!" ? c = "!" + c : c.slice(0, 18) === "tag:yaml.org,2002:" ? c = "!!" + c.slice(18) : c = "!<" + c + ">", e.dump = c + " " + e.dump);
  14984. }
  14985. return !0;
  14986. }
  14987. function ab(e, t) {
  14988. var r = [], n = [], i, s;
  14989. for (gi(e, r, n), i = 0, s = n.length; i < s; i += 1)
  14990. t.duplicates.push(r[n[i]]);
  14991. t.usedDuplicates = new Array(s);
  14992. }
  14993. function gi(e, t, r) {
  14994. var n, i, s;
  14995. if (e !== null && typeof e == "object")
  14996. if (i = t.indexOf(e), i !== -1)
  14997. r.indexOf(i) === -1 && r.push(i);
  14998. else if (t.push(e), Array.isArray(e))
  14999. for (i = 0, s = e.length; i < s; i += 1)
  15000. gi(e[i], t, r);
  15001. else
  15002. for (n = Object.keys(e), i = 0, s = n.length; i < s; i += 1)
  15003. gi(e[n[i]], t, r);
  15004. }
  15005. function lb(e, t) {
  15006. t = t || {};
  15007. var r = new Y0(t);
  15008. r.noRefs || ab(e, r);
  15009. var n = e;
  15010. return r.replacer && (n = r.replacer.call({ "": n }, "", n)), ke(r, 0, n, !0, !0) ? r.dump + `
  15011. ` : "";
  15012. }
  15013. hc.dump = lb;
  15014. var Sc = Os, cb = hc;
  15015. function Cs(e, t) {
  15016. return function() {
  15017. throw new Error("Function yaml." + e + " is removed in js-yaml 4. Use yaml." + t + " instead, which is now safe by default.");
  15018. };
  15019. }
  15020. re.Type = oe;
  15021. re.Schema = Fl;
  15022. re.FAILSAFE_SCHEMA = Ul;
  15023. re.JSON_SCHEMA = Jl;
  15024. re.CORE_SCHEMA = Yl;
  15025. re.DEFAULT_SCHEMA = Ss;
  15026. re.load = Sc.load;
  15027. re.loadAll = Sc.loadAll;
  15028. re.dump = cb.dump;
  15029. re.YAMLException = rr;
  15030. re.types = {
  15031. binary: tc,
  15032. float: Wl,
  15033. map: Hl,
  15034. null: zl,
  15035. pairs: nc,
  15036. set: ic,
  15037. timestamp: Zl,
  15038. bool: Gl,
  15039. int: Bl,
  15040. merge: ec,
  15041. omap: rc,
  15042. seq: Ll,
  15043. str: Vl
  15044. };
  15045. re.safeLoad = Cs("safeLoad", "load");
  15046. re.safeLoadAll = Cs("safeLoadAll", "loadAll");
  15047. re.safeDump = Cs("safeDump", "dump");
  15048. var ub = j && j.__importDefault || function(e) {
  15049. return e && e.__esModule ? e : { default: e };
  15050. };
  15051. Object.defineProperty(Ps, "__esModule", { value: !0 });
  15052. const fb = V, db = ub(re), pb = re;
  15053. Ps.default = {
  15054. /**
  15055. * The order that this parser will run, in relation to other parsers.
  15056. */
  15057. order: 200,
  15058. /**
  15059. * Whether to allow "empty" files. This includes zero-byte files, as well as empty JSON objects.
  15060. */
  15061. allowEmpty: !0,
  15062. /**
  15063. * Determines whether this parser can parse a given file reference.
  15064. * Parsers that match will be tried, in order, until one successfully parses the file.
  15065. * Parsers that don't match will be skipped, UNLESS none of the parsers match, in which case
  15066. * every parser will be tried.
  15067. */
  15068. canParse: [".yaml", ".yml", ".json"],
  15069. // JSON is valid YAML
  15070. /**
  15071. * Parses the given file as YAML
  15072. *
  15073. * @param file - An object containing information about the referenced file
  15074. * @param file.url - The full URL of the referenced file
  15075. * @param file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.)
  15076. * @param file.data - The file contents. This will be whatever data type was returned by the resolver
  15077. * @returns
  15078. */
  15079. async parse(e) {
  15080. let t = e.data;
  15081. if (Buffer.isBuffer(t) && (t = t.toString()), typeof t == "string")
  15082. try {
  15083. return db.default.load(t, { schema: pb.JSON_SCHEMA });
  15084. } catch (r) {
  15085. throw new fb.ParserError((r == null ? void 0 : r.message) || "Parser Error", e.url);
  15086. }
  15087. else
  15088. return t;
  15089. }
  15090. };
  15091. var Is = {};
  15092. Object.defineProperty(Is, "__esModule", { value: !0 });
  15093. const hb = V, mb = /\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;
  15094. Is.default = {
  15095. /**
  15096. * The order that this parser will run, in relation to other parsers.
  15097. */
  15098. order: 300,
  15099. /**
  15100. * Whether to allow "empty" files (zero bytes).
  15101. */
  15102. allowEmpty: !0,
  15103. /**
  15104. * The encoding that the text is expected to be in.
  15105. */
  15106. encoding: "utf8",
  15107. /**
  15108. * Determines whether this parser can parse a given file reference.
  15109. * Parsers that return true will be tried, in order, until one successfully parses the file.
  15110. * Parsers that return false will be skipped, UNLESS all parsers returned false, in which case
  15111. * every parser will be tried.
  15112. */
  15113. canParse(e) {
  15114. return (typeof e.data == "string" || Buffer.isBuffer(e.data)) && mb.test(e.url);
  15115. },
  15116. /**
  15117. * Parses the given file as text
  15118. */
  15119. parse(e) {
  15120. if (typeof e.data == "string")
  15121. return e.data;
  15122. if (Buffer.isBuffer(e.data))
  15123. return e.data.toString(this.encoding);
  15124. throw new hb.ParserError("data is not text", e.url);
  15125. }
  15126. };
  15127. var Ts = {};
  15128. Object.defineProperty(Ts, "__esModule", { value: !0 });
  15129. const yb = /\.(jpeg|jpg|gif|png|bmp|ico)$/i;
  15130. Ts.default = {
  15131. /**
  15132. * The order that this parser will run, in relation to other parsers.
  15133. */
  15134. order: 400,
  15135. /**
  15136. * Whether to allow "empty" files (zero bytes).
  15137. */
  15138. allowEmpty: !0,
  15139. /**
  15140. * Determines whether this parser can parse a given file reference.
  15141. * Parsers that return true will be tried, in order, until one successfully parses the file.
  15142. * Parsers that return false will be skipped, UNLESS all parsers returned false, in which case
  15143. * every parser will be tried.
  15144. */
  15145. canParse(e) {
  15146. return Buffer.isBuffer(e.data) && yb.test(e.url);
  15147. },
  15148. /**
  15149. * Parses the given data as a Buffer (byte array).
  15150. */
  15151. parse(e) {
  15152. return Buffer.isBuffer(e.data) ? e.data : Buffer.from(e.data);
  15153. }
  15154. };
  15155. var Rs = {}, gb = j && j.__createBinding || (Object.create ? function(e, t, r, n) {
  15156. n === void 0 && (n = r);
  15157. var i = Object.getOwnPropertyDescriptor(t, r);
  15158. (!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: function() {
  15159. return t[r];
  15160. } }), Object.defineProperty(e, n, i);
  15161. } : function(e, t, r, n) {
  15162. n === void 0 && (n = r), e[n] = t[r];
  15163. }), $b = j && j.__setModuleDefault || (Object.create ? function(e, t) {
  15164. Object.defineProperty(e, "default", { enumerable: !0, value: t });
  15165. } : function(e, t) {
  15166. e.default = t;
  15167. }), _b = j && j.__importStar || function(e) {
  15168. if (e && e.__esModule) return e;
  15169. var t = {};
  15170. if (e != null) for (var r in e) r !== "default" && Object.prototype.hasOwnProperty.call(e, r) && gb(t, e, r);
  15171. return $b(t, e), t;
  15172. }, vb = j && j.__importDefault || function(e) {
  15173. return e && e.__esModule ? e : { default: e };
  15174. };
  15175. Object.defineProperty(Rs, "__esModule", { value: !0 });
  15176. const bb = vb(kc), ra = je, na = _b(B), ia = V;
  15177. Rs.default = {
  15178. /**
  15179. * The order that this resolver will run, in relation to other resolvers.
  15180. */
  15181. order: 100,
  15182. /**
  15183. * Determines whether this resolver can read a given file reference.
  15184. * Resolvers that return true will be tried, in order, until one successfully resolves the file.
  15185. * Resolvers that return false will not be given a chance to resolve the file.
  15186. */
  15187. canRead(e) {
  15188. return na.isFileSystemPath(e.url);
  15189. },
  15190. /**
  15191. * Reads the given file and returns its raw contents as a Buffer.
  15192. */
  15193. async read(e) {
  15194. let t;
  15195. try {
  15196. t = na.toFileSystemPath(e.url);
  15197. } catch (r) {
  15198. throw new ia.ResolverError(ra.ono.uri(r, `Malformed URI: ${e.url}`), e.url);
  15199. }
  15200. try {
  15201. return await bb.default.promises.readFile(t);
  15202. } catch (r) {
  15203. throw new ia.ResolverError((0, ra.ono)(r, `Error opening file "${t}"`), t);
  15204. }
  15205. }
  15206. };
  15207. var ks = {}, wb = j && j.__createBinding || (Object.create ? function(e, t, r, n) {
  15208. n === void 0 && (n = r);
  15209. var i = Object.getOwnPropertyDescriptor(t, r);
  15210. (!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: function() {
  15211. return t[r];
  15212. } }), Object.defineProperty(e, n, i);
  15213. } : function(e, t, r, n) {
  15214. n === void 0 && (n = r), e[n] = t[r];
  15215. }), Pb = j && j.__setModuleDefault || (Object.create ? function(e, t) {
  15216. Object.defineProperty(e, "default", { enumerable: !0, value: t });
  15217. } : function(e, t) {
  15218. e.default = t;
  15219. }), Ob = j && j.__importStar || function(e) {
  15220. if (e && e.__esModule) return e;
  15221. var t = {};
  15222. if (e != null) for (var r in e) r !== "default" && Object.prototype.hasOwnProperty.call(e, r) && wb(t, e, r);
  15223. return Pb(t, e), t;
  15224. };
  15225. Object.defineProperty(ks, "__esModule", { value: !0 });
  15226. const mr = je, Ut = Ob(B), sa = V;
  15227. ks.default = {
  15228. /**
  15229. * The order that this resolver will run, in relation to other resolvers.
  15230. */
  15231. order: 200,
  15232. /**
  15233. * HTTP headers to send when downloading files.
  15234. *
  15235. * @example:
  15236. * {
  15237. * "User-Agent": "JSON Schema $Ref Parser",
  15238. * Accept: "application/json"
  15239. * }
  15240. */
  15241. headers: null,
  15242. /**
  15243. * HTTP request timeout (in milliseconds).
  15244. */
  15245. timeout: 6e4,
  15246. // 60 seconds
  15247. /**
  15248. * The maximum number of HTTP redirects to follow.
  15249. * To disable automatic following of redirects, set this to zero.
  15250. */
  15251. redirects: 5,
  15252. /**
  15253. * The `withCredentials` option of XMLHttpRequest.
  15254. * Set this to `true` if you're downloading files from a CORS-enabled server that requires authentication
  15255. */
  15256. withCredentials: !1,
  15257. /**
  15258. * Determines whether this resolver can read a given file reference.
  15259. * Resolvers that return true will be tried in order, until one successfully resolves the file.
  15260. * Resolvers that return false will not be given a chance to resolve the file.
  15261. */
  15262. canRead(e) {
  15263. return Ut.isHttp(e.url);
  15264. },
  15265. /**
  15266. * Reads the given URL and returns its raw contents as a Buffer.
  15267. */
  15268. read(e) {
  15269. const t = Ut.parse(e.url);
  15270. return typeof window < "u" && !t.protocol && (t.protocol = Ut.parse(location.href).protocol), xc(t, this);
  15271. }
  15272. };
  15273. async function xc(e, t, r) {
  15274. e = Ut.parse(e);
  15275. const n = r || [];
  15276. n.push(e.href);
  15277. try {
  15278. const i = await Eb(e, t);
  15279. if (i.status >= 400)
  15280. throw (0, mr.ono)({ status: i.status }, `HTTP ERROR ${i.status}`);
  15281. if (i.status >= 300) {
  15282. if (!Number.isNaN(t.redirects) && n.length > t.redirects)
  15283. throw new sa.ResolverError((0, mr.ono)({ status: i.status }, `Error downloading ${n[0]}.
  15284. Too many redirects:
  15285. ${n.join(`
  15286. `)}`));
  15287. if (!("location" in i.headers) || !i.headers.location)
  15288. throw (0, mr.ono)({ status: i.status }, `HTTP ${i.status} redirect with no location header`);
  15289. {
  15290. const s = Ut.resolve(e.href, i.headers.location);
  15291. return xc(s, t, n);
  15292. }
  15293. } else {
  15294. if (i.body) {
  15295. const s = await i.arrayBuffer();
  15296. return Buffer.from(s);
  15297. }
  15298. return Buffer.alloc(0);
  15299. }
  15300. } catch (i) {
  15301. throw new sa.ResolverError((0, mr.ono)(i, `Error downloading ${e.href}`), e.href);
  15302. }
  15303. }
  15304. async function Eb(e, t) {
  15305. let r, n;
  15306. t.timeout && (r = new AbortController(), n = setTimeout(() => r.abort(), t.timeout));
  15307. const i = await fetch(e, {
  15308. method: "GET",
  15309. headers: t.headers || {},
  15310. credentials: t.withCredentials ? "include" : "same-origin",
  15311. signal: r ? r.signal : null
  15312. });
  15313. return n && clearTimeout(n), i;
  15314. }
  15315. (function(e) {
  15316. var t = j && j.__importDefault || function(h) {
  15317. return h && h.__esModule ? h : { default: h };
  15318. };
  15319. Object.defineProperty(e, "__esModule", { value: !0 }), e.getNewOptions = e.getJsonSchemaRefParserDefaultOptions = void 0;
  15320. const r = t(ws), n = t(Ps), i = t(Is), s = t(Ts), o = t(Rs), a = t(ks), l = () => ({
  15321. /**
  15322. * Determines how different types of files will be parsed.
  15323. *
  15324. * You can add additional parsers of your own, replace an existing one with
  15325. * your own implementation, or disable any parser by setting it to false.
  15326. */
  15327. parse: {
  15328. json: { ...r.default },
  15329. yaml: { ...n.default },
  15330. text: { ...i.default },
  15331. binary: { ...s.default }
  15332. },
  15333. /**
  15334. * Determines how JSON References will be resolved.
  15335. *
  15336. * You can add additional resolvers of your own, replace an existing one with
  15337. * your own implementation, or disable any resolver by setting it to false.
  15338. */
  15339. resolve: {
  15340. file: { ...o.default },
  15341. http: { ...a.default },
  15342. /**
  15343. * Determines whether external $ref pointers will be resolved.
  15344. * If this option is disabled, then none of above resolvers will be called.
  15345. * Instead, external $ref pointers will simply be ignored.
  15346. *
  15347. * @type {boolean}
  15348. */
  15349. external: !0
  15350. },
  15351. /**
  15352. * By default, JSON Schema $Ref Parser throws the first error it encounters. Setting `continueOnError` to `true`
  15353. * causes it to keep processing as much as possible and then throw a single error that contains all errors
  15354. * that were encountered.
  15355. */
  15356. continueOnError: !1,
  15357. /**
  15358. * Determines the types of JSON references that are allowed.
  15359. */
  15360. dereference: {
  15361. /**
  15362. * Dereference circular (recursive) JSON references?
  15363. * If false, then a {@link ReferenceError} will be thrown if a circular reference is found.
  15364. * If "ignore", then circular references will not be dereferenced.
  15365. *
  15366. * @type {boolean|string}
  15367. */
  15368. circular: !0,
  15369. /**
  15370. * A function, called for each path, which can return true to stop this path and all
  15371. * subpaths from being dereferenced further. This is useful in schemas where some
  15372. * subpaths contain literal $ref keys that should not be dereferenced.
  15373. *
  15374. * @type {function}
  15375. */
  15376. excludedPathMatcher: () => !1,
  15377. referenceResolution: "relative"
  15378. },
  15379. mutateInputSchema: !0
  15380. });
  15381. e.getJsonSchemaRefParserDefaultOptions = l;
  15382. const c = (h) => {
  15383. const y = (0, e.getJsonSchemaRefParserDefaultOptions)();
  15384. return h && f(y, h), y;
  15385. };
  15386. e.getNewOptions = c;
  15387. function f(h, y) {
  15388. if (u(y)) {
  15389. const _ = Object.keys(y).filter((b) => !["__proto__", "constructor", "prototype"].includes(b));
  15390. for (let b = 0; b < _.length; b++) {
  15391. const v = _[b], p = y[v], m = h[v];
  15392. u(p) ? h[v] = f(m || {}, p) : p !== void 0 && (h[v] = p);
  15393. }
  15394. }
  15395. return h;
  15396. }
  15397. function u(h) {
  15398. return h && typeof h == "object" && !Array.isArray(h) && !(h instanceof RegExp) && !(h instanceof Date);
  15399. }
  15400. })(bs);
  15401. Object.defineProperty(fn, "__esModule", { value: !0 });
  15402. fn.normalizeArgs = jc;
  15403. const Sb = bs;
  15404. function jc(e) {
  15405. let t, r, n, i;
  15406. const s = Array.prototype.slice.call(e);
  15407. typeof s[s.length - 1] == "function" && (i = s.pop()), typeof s[0] == "string" ? (t = s[0], typeof s[2] == "object" ? (r = s[1], n = s[2]) : (r = void 0, n = s[1])) : (t = "", r = s[0], n = s[1]);
  15408. try {
  15409. n = (0, Sb.getNewOptions)(n);
  15410. } catch (o) {
  15411. console.error(`JSON Schema Ref Parser: Error normalizing options: ${o}`);
  15412. }
  15413. return !n.mutateInputSchema && typeof r == "object" && (r = JSON.parse(JSON.stringify(r))), {
  15414. path: t,
  15415. schema: r,
  15416. options: n,
  15417. callback: i
  15418. };
  15419. }
  15420. fn.default = jc;
  15421. var Ns = {}, xb = j && j.__createBinding || (Object.create ? function(e, t, r, n) {
  15422. n === void 0 && (n = r);
  15423. var i = Object.getOwnPropertyDescriptor(t, r);
  15424. (!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: function() {
  15425. return t[r];
  15426. } }), Object.defineProperty(e, n, i);
  15427. } : function(e, t, r, n) {
  15428. n === void 0 && (n = r), e[n] = t[r];
  15429. }), jb = j && j.__setModuleDefault || (Object.create ? function(e, t) {
  15430. Object.defineProperty(e, "default", { enumerable: !0, value: t });
  15431. } : function(e, t) {
  15432. e.default = t;
  15433. }), Ab = j && j.__importStar || function(e) {
  15434. if (e && e.__esModule) return e;
  15435. var t = {};
  15436. if (e != null) for (var r in e) r !== "default" && Object.prototype.hasOwnProperty.call(e, r) && xb(t, e, r);
  15437. return jb(t, e), t;
  15438. }, Ms = j && j.__importDefault || function(e) {
  15439. return e && e.__esModule ? e : { default: e };
  15440. };
  15441. Object.defineProperty(Ns, "__esModule", { value: !0 });
  15442. const Cb = Ms(tr()), Ib = Ms(cn()), Tb = Ms(un), ut = Ab(B), Rb = V;
  15443. function kb(e, t) {
  15444. var r;
  15445. if (!((r = t.resolve) != null && r.external))
  15446. return Promise.resolve();
  15447. try {
  15448. const n = Ds(e.schema, e.$refs._root$Ref.path + "#", e.$refs, t);
  15449. return Promise.all(n);
  15450. } catch (n) {
  15451. return Promise.reject(n);
  15452. }
  15453. }
  15454. function Ds(e, t, r, n, i, s) {
  15455. i || (i = /* @__PURE__ */ new Set());
  15456. let o = [];
  15457. if (e && typeof e == "object" && !ArrayBuffer.isView(e) && !i.has(e)) {
  15458. i.add(e), Cb.default.isExternal$Ref(e) && o.push(Nb(e, t, r, n));
  15459. const a = Object.keys(e);
  15460. for (const l of a) {
  15461. const c = Ib.default.join(t, l), f = e[l];
  15462. o = o.concat(Ds(f, c, r, n, i));
  15463. }
  15464. }
  15465. return o;
  15466. }
  15467. async function Nb(e, t, r, n) {
  15468. var l;
  15469. const i = ((l = n.dereference) == null ? void 0 : l.externalReferenceResolution) === "root", s = ut.resolve(i ? ut.cwd() : t, e.$ref), o = ut.stripHash(s), a = r._$refs[o];
  15470. if (a)
  15471. return Promise.resolve(a.value);
  15472. try {
  15473. const c = await (0, Tb.default)(s, r, n), f = Ds(c, o + "#", r, n, /* @__PURE__ */ new Set(), !0);
  15474. return Promise.all(f);
  15475. } catch (c) {
  15476. if (!(n != null && n.continueOnError) || !(0, Rb.isHandledError)(c))
  15477. throw c;
  15478. return r._$refs[o] && (c.source = decodeURI(ut.stripHash(t)), c.path = ut.safePointerToPath(ut.getHash(t))), [];
  15479. }
  15480. }
  15481. Ns.default = kb;
  15482. var qs = {}, Mb = j && j.__createBinding || (Object.create ? function(e, t, r, n) {
  15483. n === void 0 && (n = r);
  15484. var i = Object.getOwnPropertyDescriptor(t, r);
  15485. (!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: function() {
  15486. return t[r];
  15487. } }), Object.defineProperty(e, n, i);
  15488. } : function(e, t, r, n) {
  15489. n === void 0 && (n = r), e[n] = t[r];
  15490. }), Db = j && j.__setModuleDefault || (Object.create ? function(e, t) {
  15491. Object.defineProperty(e, "default", { enumerable: !0, value: t });
  15492. } : function(e, t) {
  15493. e.default = t;
  15494. }), qb = j && j.__importStar || function(e) {
  15495. if (e && e.__esModule) return e;
  15496. var t = {};
  15497. if (e != null) for (var r in e) r !== "default" && Object.prototype.hasOwnProperty.call(e, r) && Mb(t, e, r);
  15498. return Db(t, e), t;
  15499. }, Ac = j && j.__importDefault || function(e) {
  15500. return e && e.__esModule ? e : { default: e };
  15501. };
  15502. Object.defineProperty(qs, "__esModule", { value: !0 });
  15503. const Mr = Ac(tr()), Jt = Ac(cn()), Bn = qb(B);
  15504. function Fb(e, t) {
  15505. const r = [];
  15506. Fs(e, "schema", e.$refs._root$Ref.path + "#", "#", 0, r, e.$refs, t), Vb(r);
  15507. }
  15508. function Fs(e, t, r, n, i, s, o, a) {
  15509. const l = t === null ? e : e[t];
  15510. if (l && typeof l == "object" && !ArrayBuffer.isView(l))
  15511. if (Mr.default.isAllowed$Ref(l))
  15512. oa(e, t, r, n, i, s, o, a);
  15513. else {
  15514. const c = Object.keys(l).sort((f, u) => f === "definitions" ? -1 : u === "definitions" ? 1 : f.length - u.length);
  15515. for (const f of c) {
  15516. const u = Jt.default.join(r, f), h = Jt.default.join(n, f), y = l[f];
  15517. Mr.default.isAllowed$Ref(y) ? oa(l, f, r, h, i, s, o, a) : Fs(l, f, u, h, i, s, o, a);
  15518. }
  15519. }
  15520. }
  15521. function oa(e, t, r, n, i, s, o, a) {
  15522. const l = t === null ? e : e[t], c = Bn.resolve(r, l.$ref), f = o._resolve(c, n, a);
  15523. if (f === null)
  15524. return;
  15525. const h = Jt.default.parse(n).length, y = Bn.stripHash(f.path), _ = Bn.getHash(f.path), b = y !== o._root$Ref.path, v = Mr.default.isExtended$Ref(l);
  15526. i += f.indirections;
  15527. const p = Lb(s, e, t);
  15528. if (p)
  15529. if (h < p.depth || i < p.indirections)
  15530. Hb(s, p);
  15531. else
  15532. return;
  15533. s.push({
  15534. $ref: l,
  15535. // The JSON Reference (e.g. {$ref: string})
  15536. parent: e,
  15537. // The object that contains this $ref pointer
  15538. key: t,
  15539. // The key in `parent` that is the $ref pointer
  15540. pathFromRoot: n,
  15541. // The path to the $ref pointer, from the JSON Schema root
  15542. depth: h,
  15543. // How far from the JSON Schema root is this $ref pointer?
  15544. file: y,
  15545. // The file that the $ref pointer resolves to
  15546. hash: _,
  15547. // The hash within `file` that the $ref pointer resolves to
  15548. value: f.value,
  15549. // The resolved value of the $ref pointer
  15550. circular: f.circular,
  15551. // Is this $ref pointer DIRECTLY circular? (i.e. it references itself)
  15552. extended: v,
  15553. // Does this $ref extend its resolved value? (i.e. it has extra properties, in addition to "$ref")
  15554. external: b,
  15555. // Does this $ref pointer point to a file other than the main JSON Schema file?
  15556. indirections: i
  15557. // The number of indirect references that were traversed to resolve the value
  15558. }), (!p || b) && Fs(f.value, null, f.path, n, i + 1, s, o, a);
  15559. }
  15560. function Vb(e) {
  15561. e.sort((i, s) => {
  15562. if (i.file !== s.file)
  15563. return i.file < s.file ? -1 : 1;
  15564. if (i.hash !== s.hash)
  15565. return i.hash < s.hash ? -1 : 1;
  15566. if (i.circular !== s.circular)
  15567. return i.circular ? -1 : 1;
  15568. if (i.extended !== s.extended)
  15569. return i.extended ? 1 : -1;
  15570. if (i.indirections !== s.indirections)
  15571. return i.indirections - s.indirections;
  15572. if (i.depth !== s.depth)
  15573. return i.depth - s.depth;
  15574. {
  15575. const o = i.pathFromRoot.lastIndexOf("/definitions"), a = s.pathFromRoot.lastIndexOf("/definitions");
  15576. return o !== a ? a - o : i.pathFromRoot.length - s.pathFromRoot.length;
  15577. }
  15578. });
  15579. let t, r, n;
  15580. for (const i of e)
  15581. i.external ? i.file === t && i.hash === r ? i.$ref.$ref = n : i.file === t && i.hash.indexOf(r + "/") === 0 ? i.$ref.$ref = Jt.default.join(n, Jt.default.parse(i.hash.replace(r, "#"))) : (t = i.file, r = i.hash, n = i.pathFromRoot, i.$ref = i.parent[i.key] = Mr.default.dereference(i.$ref, i.value), i.circular && (i.$ref.$ref = i.pathFromRoot)) : i.$ref.$ref = i.hash;
  15582. }
  15583. function Lb(e, t, r) {
  15584. for (const n of e)
  15585. if (n && n.parent === t && n.key === r)
  15586. return n;
  15587. }
  15588. function Hb(e, t) {
  15589. const r = e.indexOf(t);
  15590. e.splice(r, 1);
  15591. }
  15592. qs.default = Fb;
  15593. var Vs = {}, Ub = j && j.__createBinding || (Object.create ? function(e, t, r, n) {
  15594. n === void 0 && (n = r);
  15595. var i = Object.getOwnPropertyDescriptor(t, r);
  15596. (!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: function() {
  15597. return t[r];
  15598. } }), Object.defineProperty(e, n, i);
  15599. } : function(e, t, r, n) {
  15600. n === void 0 && (n = r), e[n] = t[r];
  15601. }), zb = j && j.__setModuleDefault || (Object.create ? function(e, t) {
  15602. Object.defineProperty(e, "default", { enumerable: !0, value: t });
  15603. } : function(e, t) {
  15604. e.default = t;
  15605. }), Gb = j && j.__importStar || function(e) {
  15606. if (e && e.__esModule) return e;
  15607. var t = {};
  15608. if (e != null) for (var r in e) r !== "default" && Object.prototype.hasOwnProperty.call(e, r) && Ub(t, e, r);
  15609. return zb(t, e), t;
  15610. }, Cc = j && j.__importDefault || function(e) {
  15611. return e && e.__esModule ? e : { default: e };
  15612. };
  15613. Object.defineProperty(Vs, "__esModule", { value: !0 });
  15614. const Dr = Cc(tr()), aa = Cc(cn()), Bb = je, la = Gb(B), Kb = V;
  15615. Vs.default = Wb;
  15616. function Wb(e, t) {
  15617. const r = Date.now(), n = Ls(e.schema, e.$refs._root$Ref.path, "#", /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Map(), e.$refs, t, r);
  15618. e.$refs.circular = n.circular, e.schema = n.value;
  15619. }
  15620. function Ls(e, t, r, n, i, s, o, a, l) {
  15621. var y;
  15622. let c;
  15623. const f = {
  15624. value: e,
  15625. circular: !1
  15626. };
  15627. if (a && a.timeoutMs && Date.now() - l > a.timeoutMs)
  15628. throw new Kb.TimeoutError(a.timeoutMs);
  15629. const u = a.dereference || {}, h = u.excludedPathMatcher || (() => !1);
  15630. if (((u == null ? void 0 : u.circular) === "ignore" || !i.has(e)) && e && typeof e == "object" && !ArrayBuffer.isView(e) && !h(r)) {
  15631. if (n.add(e), i.add(e), Dr.default.isAllowed$Ref(e, a))
  15632. c = ca(e, t, r, n, i, s, o, a, l), f.circular = c.circular, f.value = c.value;
  15633. else
  15634. for (const _ of Object.keys(e)) {
  15635. const b = aa.default.join(t, _), v = aa.default.join(r, _);
  15636. if (h(v))
  15637. continue;
  15638. const p = e[_];
  15639. let m = !1;
  15640. Dr.default.isAllowed$Ref(p, a) ? (c = ca(p, b, v, n, i, s, o, a, l), m = c.circular, e[_] !== c.value && (e[_] = c.value, (y = u == null ? void 0 : u.onDereference) == null || y.call(u, p.$ref, e[_], e, _))) : n.has(p) ? m = Ic(b, o, a) : (c = Ls(p, b, v, n, i, s, o, a, l), m = c.circular, e[_] !== c.value && (e[_] = c.value)), f.circular = f.circular || m;
  15641. }
  15642. n.delete(e);
  15643. }
  15644. return f;
  15645. }
  15646. function ca(e, t, r, n, i, s, o, a, l) {
  15647. var m, $;
  15648. const f = Dr.default.isExternal$Ref(e) && ((m = a == null ? void 0 : a.dereference) == null ? void 0 : m.externalReferenceResolution) === "root", u = la.resolve(f ? la.cwd() : t, e.$ref), h = s.get(u);
  15649. if (h && !h.circular) {
  15650. const E = Object.keys(e);
  15651. if (E.length > 1) {
  15652. const S = {};
  15653. for (const A of E)
  15654. A !== "$ref" && !(A in h.value) && (S[A] = e[A]);
  15655. return {
  15656. circular: h.circular,
  15657. value: Object.assign({}, h.value, S)
  15658. };
  15659. }
  15660. return h;
  15661. }
  15662. const y = o._resolve(u, t, a);
  15663. if (y === null)
  15664. return {
  15665. circular: !1,
  15666. value: null
  15667. };
  15668. const _ = y.circular;
  15669. let b = _ || n.has(y.value);
  15670. b && Ic(t, o, a);
  15671. let v = Dr.default.dereference(e, y.value);
  15672. if (!b) {
  15673. const E = Ls(v, y.path, r, n, i, s, o, a, l);
  15674. b = E.circular, v = E.value;
  15675. }
  15676. b && !_ && (($ = a.dereference) == null ? void 0 : $.circular) === "ignore" && (v = e), _ && (v.$ref = r);
  15677. const p = {
  15678. circular: b,
  15679. value: v
  15680. };
  15681. return Object.keys(e).length === 1 && s.set(u, p), p;
  15682. }
  15683. function Ic(e, t, r) {
  15684. if (t.circular = !0, !r.dereference.circular)
  15685. throw Bb.ono.reference(`Circular $ref pointer found at ${e}`);
  15686. return !0;
  15687. }
  15688. var Hs = {}, Us = {};
  15689. Object.defineProperty(Us, "__esModule", { value: !0 });
  15690. function Jb() {
  15691. return typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : typeof setImmediate == "function" ? setImmediate : function(t) {
  15692. setTimeout(t, 0);
  15693. };
  15694. }
  15695. Us.default = Jb();
  15696. var Yb = j && j.__importDefault || function(e) {
  15697. return e && e.__esModule ? e : { default: e };
  15698. };
  15699. Object.defineProperty(Hs, "__esModule", { value: !0 });
  15700. Hs.default = Xb;
  15701. const ua = Yb(Us);
  15702. function Xb(e, t) {
  15703. if (e) {
  15704. t.then(function(r) {
  15705. (0, ua.default)(function() {
  15706. e(null, r);
  15707. });
  15708. }, function(r) {
  15709. (0, ua.default)(function() {
  15710. e(r);
  15711. });
  15712. });
  15713. return;
  15714. } else
  15715. return t;
  15716. }
  15717. (function(e) {
  15718. var t = j && j.__createBinding || (Object.create ? function(m, $, E, S) {
  15719. S === void 0 && (S = E);
  15720. var A = Object.getOwnPropertyDescriptor($, E);
  15721. (!A || ("get" in A ? !$.__esModule : A.writable || A.configurable)) && (A = { enumerable: !0, get: function() {
  15722. return $[E];
  15723. } }), Object.defineProperty(m, S, A);
  15724. } : function(m, $, E, S) {
  15725. S === void 0 && (S = E), m[S] = $[E];
  15726. }), r = j && j.__setModuleDefault || (Object.create ? function(m, $) {
  15727. Object.defineProperty(m, "default", { enumerable: !0, value: $ });
  15728. } : function(m, $) {
  15729. m.default = $;
  15730. }), n = j && j.__importStar || function(m) {
  15731. if (m && m.__esModule) return m;
  15732. var $ = {};
  15733. if (m != null) for (var E in m) E !== "default" && Object.prototype.hasOwnProperty.call(m, E) && t($, m, E);
  15734. return r($, m), $;
  15735. }, i = j && j.__importDefault || function(m) {
  15736. return m && m.__esModule ? m : { default: m };
  15737. };
  15738. Object.defineProperty(e, "__esModule", { value: !0 }), e.getJsonSchemaRefParserDefaultOptions = e.jsonSchemaParserNormalizeArgs = e.dereferenceInternal = e.JSONParserErrorGroup = e.isHandledError = e.UnmatchedParserError = e.ParserError = e.ResolverError = e.MissingPointerError = e.InvalidPointerError = e.JSONParserError = e.UnmatchedResolverError = e.dereference = e.bundle = e.resolve = e.parse = e.$RefParser = void 0;
  15739. const s = i($s), o = i(un), a = i(fn);
  15740. e.jsonSchemaParserNormalizeArgs = a.default;
  15741. const l = i(Ns), c = i(qs), f = i(Vs);
  15742. e.dereferenceInternal = f.default;
  15743. const u = n(B), h = V;
  15744. Object.defineProperty(e, "JSONParserError", { enumerable: !0, get: function() {
  15745. return h.JSONParserError;
  15746. } }), Object.defineProperty(e, "InvalidPointerError", { enumerable: !0, get: function() {
  15747. return h.InvalidPointerError;
  15748. } }), Object.defineProperty(e, "MissingPointerError", { enumerable: !0, get: function() {
  15749. return h.MissingPointerError;
  15750. } }), Object.defineProperty(e, "ResolverError", { enumerable: !0, get: function() {
  15751. return h.ResolverError;
  15752. } }), Object.defineProperty(e, "ParserError", { enumerable: !0, get: function() {
  15753. return h.ParserError;
  15754. } }), Object.defineProperty(e, "UnmatchedParserError", { enumerable: !0, get: function() {
  15755. return h.UnmatchedParserError;
  15756. } }), Object.defineProperty(e, "UnmatchedResolverError", { enumerable: !0, get: function() {
  15757. return h.UnmatchedResolverError;
  15758. } }), Object.defineProperty(e, "isHandledError", { enumerable: !0, get: function() {
  15759. return h.isHandledError;
  15760. } }), Object.defineProperty(e, "JSONParserErrorGroup", { enumerable: !0, get: function() {
  15761. return h.JSONParserErrorGroup;
  15762. } });
  15763. const y = je, _ = i(Hs), b = bs;
  15764. Object.defineProperty(e, "getJsonSchemaRefParserDefaultOptions", { enumerable: !0, get: function() {
  15765. return b.getJsonSchemaRefParserDefaultOptions;
  15766. } });
  15767. class v {
  15768. constructor() {
  15769. this.schema = null, this.$refs = new s.default();
  15770. }
  15771. async parse() {
  15772. const $ = (0, a.default)(arguments);
  15773. let E;
  15774. if (!$.path && !$.schema) {
  15775. const A = (0, y.ono)(`Expected a file path, URL, or object. Got ${$.path || $.schema}`);
  15776. return (0, _.default)($.callback, Promise.reject(A));
  15777. }
  15778. this.schema = null, this.$refs = new s.default();
  15779. let S = "http";
  15780. if (u.isFileSystemPath($.path))
  15781. $.path = u.fromFileSystemPath($.path), S = "file";
  15782. else if (!$.path && $.schema && "$id" in $.schema && $.schema.$id) {
  15783. const A = u.parse($.schema.$id), U = A.protocol === "https:" ? 443 : 80;
  15784. $.path = `${A.protocol}//${A.hostname}:${U}`;
  15785. }
  15786. if ($.path = u.resolve(u.cwd(), $.path), $.schema && typeof $.schema == "object") {
  15787. const A = this.$refs._add($.path);
  15788. A.value = $.schema, A.pathType = S, E = Promise.resolve($.schema);
  15789. } else
  15790. E = (0, o.default)($.path, this.$refs, $.options);
  15791. try {
  15792. const A = await E;
  15793. if (A !== null && typeof A == "object" && !Buffer.isBuffer(A))
  15794. return this.schema = A, (0, _.default)($.callback, Promise.resolve(this.schema));
  15795. if ($.options.continueOnError)
  15796. return this.schema = null, (0, _.default)($.callback, Promise.resolve(this.schema));
  15797. throw y.ono.syntax(`"${this.$refs._root$Ref.path || A}" is not a valid JSON Schema`);
  15798. } catch (A) {
  15799. return !$.options.continueOnError || !(0, h.isHandledError)(A) ? (0, _.default)($.callback, Promise.reject(A)) : (this.$refs._$refs[u.stripHash($.path)] && this.$refs._$refs[u.stripHash($.path)].addError(A), (0, _.default)($.callback, Promise.resolve(null)));
  15800. }
  15801. }
  15802. static parse() {
  15803. const $ = new v();
  15804. return $.parse.apply($, arguments);
  15805. }
  15806. async resolve() {
  15807. const $ = (0, a.default)(arguments);
  15808. try {
  15809. return await this.parse($.path, $.schema, $.options), await (0, l.default)(this, $.options), p(this), (0, _.default)($.callback, Promise.resolve(this.$refs));
  15810. } catch (E) {
  15811. return (0, _.default)($.callback, Promise.reject(E));
  15812. }
  15813. }
  15814. static resolve() {
  15815. const $ = new v();
  15816. return $.resolve.apply($, arguments);
  15817. }
  15818. static bundle() {
  15819. const $ = new v();
  15820. return $.bundle.apply($, arguments);
  15821. }
  15822. async bundle() {
  15823. const $ = (0, a.default)(arguments);
  15824. try {
  15825. return await this.resolve($.path, $.schema, $.options), (0, c.default)(this, $.options), p(this), (0, _.default)($.callback, Promise.resolve(this.schema));
  15826. } catch (E) {
  15827. return (0, _.default)($.callback, Promise.reject(E));
  15828. }
  15829. }
  15830. static dereference() {
  15831. const $ = new v();
  15832. return $.dereference.apply($, arguments);
  15833. }
  15834. async dereference() {
  15835. const $ = (0, a.default)(arguments);
  15836. try {
  15837. return await this.resolve($.path, $.schema, $.options), (0, f.default)(this, $.options), p(this), (0, _.default)($.callback, Promise.resolve(this.schema));
  15838. } catch (E) {
  15839. return (0, _.default)($.callback, Promise.reject(E));
  15840. }
  15841. }
  15842. }
  15843. e.$RefParser = v, e.default = v;
  15844. function p(m) {
  15845. if (h.JSONParserErrorGroup.getParserErrors(m).length > 0)
  15846. throw new h.JSONParserErrorGroup(m);
  15847. }
  15848. e.parse = v.parse, e.resolve = v.resolve, e.bundle = v.bundle, e.dereference = v.dereference;
  15849. })(er);
  15850. const { getJsonSchemaRefParserDefaultOptions: Qb } = er, Zb = El, ew = xl;
  15851. var tw = zs;
  15852. function $i(e, t) {
  15853. if (fa(t)) {
  15854. const r = Object.keys(t).filter((n) => !["__proto__", "constructor", "prototype"].includes(n));
  15855. for (let n = 0; n < r.length; n++) {
  15856. const i = r[n], s = t[i], o = e[i];
  15857. fa(s) ? e[i] = $i(o || {}, s) : s !== void 0 && (e[i] = s);
  15858. }
  15859. }
  15860. return e;
  15861. }
  15862. function fa(e) {
  15863. return e && typeof e == "object" && !Array.isArray(e) && !(e instanceof RegExp) && !(e instanceof Date);
  15864. }
  15865. function zs(e) {
  15866. const t = Qb(), r = $i(t, zs.defaults);
  15867. return $i(r, e);
  15868. }
  15869. zs.defaults = {
  15870. /**
  15871. * Determines how the API definition will be validated.
  15872. *
  15873. * You can add additional validators of your own, replace an existing one with
  15874. * your own implemenation, or disable any validator by setting it to false.
  15875. */
  15876. validate: {
  15877. schema: Zb,
  15878. spec: ew
  15879. }
  15880. };
  15881. function rw() {
  15882. return typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : typeof setImmediate == "function" ? setImmediate : function(t) {
  15883. setTimeout(t, 0);
  15884. };
  15885. }
  15886. var nw = rw(), da = nw, iw = function(t, r) {
  15887. if (t) {
  15888. r.then(function(n) {
  15889. da(function() {
  15890. t(null, n);
  15891. });
  15892. }, function(n) {
  15893. da(function() {
  15894. t(n);
  15895. });
  15896. });
  15897. return;
  15898. } else
  15899. return r;
  15900. };
  15901. const sw = El, ow = xl, { jsonSchemaParserNormalizeArgs: pa } = er, aw = nt, ha = tw, yr = iw, { ono: me } = je, { $RefParser: lw } = er, { dereferenceInternal: cw } = er, Tc = ["3.1.0", "3.1.1"], uw = ["3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4"], ma = [...Tc, ...uw];
  15902. class it extends lw {
  15903. /**
  15904. * Parses the given Swagger API.
  15905. * This method does not resolve any JSON references.
  15906. * It just reads a single file in JSON or YAML format, and parse it as a JavaScript object.
  15907. *
  15908. * @param {string} [path] - The file path or URL of the JSON schema
  15909. * @param {object} [api] - The Swagger API object. This object will be used instead of reading from `path`.
  15910. * @param {ParserOptions} [options] - Options that determine how the API is parsed
  15911. * @param {Function} [callback] - An error-first callback. The second parameter is the parsed API object.
  15912. * @returns {Promise} - The returned promise resolves with the parsed API object.
  15913. */
  15914. async parse(t, r, n, i) {
  15915. let s = pa(arguments);
  15916. s.options = new ha(s.options);
  15917. try {
  15918. let o = await super.parse(s.path, s.schema, s.options);
  15919. if (o.swagger) {
  15920. if (o.swagger === void 0 || o.info === void 0 || o.paths === void 0)
  15921. throw me.syntax(`${s.path || s.schema} is not a valid Swagger API definition`);
  15922. if (typeof o.swagger == "number")
  15923. throw me.syntax('Swagger version number must be a string (e.g. "2.0") not a number.');
  15924. if (typeof o.info.version == "number")
  15925. throw me.syntax('API version number must be a string (e.g. "1.0.0") not a number.');
  15926. if (o.swagger !== "2.0")
  15927. throw me.syntax(`Unrecognized Swagger version: ${o.swagger}. Expected 2.0`);
  15928. } else {
  15929. if (o.openapi === void 0 || o.info === void 0)
  15930. throw me.syntax(`${s.path || s.schema} is not a valid Openapi API definition`);
  15931. if (o.paths === void 0)
  15932. if (Tc.indexOf(o.openapi) !== -1) {
  15933. if (o.webhooks === void 0)
  15934. throw me.syntax(`${s.path || s.schema} is not a valid Openapi API definition`);
  15935. } else
  15936. throw me.syntax(`${s.path || s.schema} is not a valid Openapi API definition`);
  15937. else {
  15938. if (typeof o.openapi == "number")
  15939. throw me.syntax('Openapi version number must be a string (e.g. "3.0.0") not a number.');
  15940. if (typeof o.info.version == "number")
  15941. throw me.syntax('API version number must be a string (e.g. "1.0.0") not a number.');
  15942. if (ma.indexOf(o.openapi) === -1)
  15943. throw me.syntax(
  15944. `Unsupported OpenAPI version: ${o.openapi}. Swagger Parser only supports versions ${ma.join(", ")}`
  15945. );
  15946. }
  15947. aw.fixOasRelativeServers(o, s.path);
  15948. }
  15949. return yr(s.callback, Promise.resolve(o));
  15950. } catch (o) {
  15951. return yr(s.callback, Promise.reject(o));
  15952. }
  15953. }
  15954. /**
  15955. * Parses, dereferences, and validates the given Swagger API.
  15956. * Depending on the options, validation can include JSON Schema validation and/or Swagger Spec validation.
  15957. *
  15958. * @param {string} [path] - The file path or URL of the JSON schema
  15959. * @param {object} [api] - The Swagger API object. This object will be used instead of reading from `path`.
  15960. * @param {ParserOptions} [options] - Options that determine how the API is parsed, dereferenced, and validated
  15961. * @param {Function} [callback] - An error-first callback. The second parameter is the parsed API object.
  15962. * @returns {Promise} - The returned promise resolves with the parsed API object.
  15963. */
  15964. async validate(t, r, n, i) {
  15965. let s = this, o = pa(arguments);
  15966. o.options = new ha(o.options);
  15967. let a = o.options.dereference.circular;
  15968. o.options.validate.schema && (o.options.dereference.circular = "ignore");
  15969. try {
  15970. if (await this.dereference(o.path, o.schema, o.options), o.options.dereference.circular = a, o.options.validate.schema && (sw(s.api), s.$refs.circular)) {
  15971. if (a === !0)
  15972. cw(s, o.options);
  15973. else if (a === !1)
  15974. throw me.reference("The API contains circular references");
  15975. }
  15976. return o.options.validate.spec && ow(s.api), yr(o.callback, Promise.resolve(s.schema));
  15977. } catch (l) {
  15978. return yr(o.callback, Promise.reject(l));
  15979. }
  15980. }
  15981. }
  15982. Object.defineProperty(it.prototype, "api", {
  15983. configurable: !0,
  15984. enumerable: !0,
  15985. get() {
  15986. return this.schema;
  15987. }
  15988. });
  15989. const Se = it;
  15990. Se.validate = (...e) => new it().validate(...e);
  15991. Se.dereference = (...e) => new it().dereference(...e);
  15992. Se.bundle = (...e) => new it().bundle(...e);
  15993. Se.parse = (...e) => new it().parse(...e);
  15994. Se.resolve = (...e) => new it().resolve(...e);
  15995. Se.default = Se;
  15996. Se.SwaggerParser = Se;
  15997. var fw = Se;
  15998. const dw = /* @__PURE__ */ Hc(fw), Or = (e) => e.split("-").map((t) => {
  15999. var r;
  16000. return ((r = t[0]) == null ? void 0 : r.toUpperCase()) + t.slice(1);
  16001. }).join(""), pw = (e) => e.length > 0 ? e.reverse().map((t) => `By${Or(t.slice(1, -1))}`).join("") : "";
  16002. function hw(e, t) {
  16003. const r = t.split("/").filter(Boolean), n = r.filter((l) => l.startsWith("{")), i = r.filter((l) => !l.startsWith("{")), s = pw(n);
  16004. if (i.length <= 1)
  16005. return `${e.toLowerCase()}${Or(i[0] || "root")}${s}`;
  16006. const [o, ...a] = i.reverse();
  16007. return `${e.toLowerCase()}${Or(o)}${s}For${a.reverse().map(Or).join("")}`;
  16008. }
  16009. async function mw(e, t) {
  16010. const r = await dw.parse(e);
  16011. Object.entries(r.paths || {}).forEach(([i, s]) => {
  16012. const o = s;
  16013. ["get", "post", "put", "delete", "patch", "options", "head", "trace"].forEach((a) => {
  16014. const l = o[a];
  16015. l == null || l.operationId != null && !(t != null && t.overwriteExisting) || (l.operationId = hw(a, i));
  16016. });
  16017. });
  16018. const n = JSON.stringify(r, null, 2);
  16019. if (n == null)
  16020. throw new Error(`Failed to generate operation IDs for ${e}`);
  16021. return n;
  16022. }
  16023. const yw = async () => {
  16024. const e = new fu();
  16025. e.name("generate-operation-ids").description("Generate operationId for OpenAPI specification").argument("<input-file>", "OpenAPI specification file").option("-o, --out <output-file>", "Output file (defaults to input file)").option("--overwrite-existing", "Overwrite existing operationId values").parse();
  16026. const { out: t, overwriteExisting: r } = e.opts(), [n] = e.args, i = await mw(n, { overwriteExisting: r }).catch(console.error);
  16027. i != null && Nc(t ?? n, i);
  16028. };
  16029. import.meta.url === `file://${process.argv[1]}` && yw();
  16030. export {
  16031. yw as main
  16032. };