_apidocs.html 682 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>API</title>
  5. <meta charset="utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  8. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css" integrity="sha256-vK3UTo/8wHbaUn+dTQD0X6dzidqc5l7gczvH+Bnowwk=" crossorigin="anonymous" />
  9. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/fontawesome.min.css" integrity="sha256-AaQqnjfGDRZd/lUp0Dvy7URGOyRsh8g9JdWUkyYxNfI=" crossorigin="anonymous" />
  10. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/solid.min.css" integrity="sha256-3FfMfpeajSEpxWZTFowWZPTv7k3GEu7w4rQv49EWsEY=" crossorigin="anonymous" />
  11. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prism-themes@1.1.0/themes/prism-a11y-dark.css" integrity="sha256-d2qy226pP+oHAtEQPujaiXPslYW1Rmtla3Ivu1fFYxU=" crossorigin="anonymous">
  12. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma-switch@2.0.0/dist/css/bulma-switch.min.css" integrity="sha256-jCV/cXwP13w0GNHLgFx6SFgTNAvJPvS5MIhuE30Ng08=" crossorigin="anonymous">
  13. <style>
  14. @media screen and (min-width: 768px) {
  15. .navbar-burger {
  16. display: none;
  17. }
  18. }
  19. </style>
  20. </head>
  21. <body class="has-navbar-fixed-top">
  22. <script>var main = (function () {
  23. 'use strict';
  24. function noop() { }
  25. const identity = x => x;
  26. function assign(tar, src) {
  27. // @ts-ignore
  28. for (const k in src)
  29. tar[k] = src[k];
  30. return tar;
  31. }
  32. function is_promise(value) {
  33. return value && typeof value === 'object' && typeof value.then === 'function';
  34. }
  35. function add_location(element, file, line, column, char) {
  36. element.__svelte_meta = {
  37. loc: { file, line, column, char }
  38. };
  39. }
  40. function run(fn) {
  41. return fn();
  42. }
  43. function blank_object() {
  44. return Object.create(null);
  45. }
  46. function run_all(fns) {
  47. fns.forEach(run);
  48. }
  49. function is_function(thing) {
  50. return typeof thing === 'function';
  51. }
  52. function safe_not_equal(a, b) {
  53. return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
  54. }
  55. function not_equal(a, b) {
  56. return a != a ? b == b : a !== b;
  57. }
  58. function validate_store(store, name) {
  59. if (!store || typeof store.subscribe !== 'function') {
  60. throw new Error(`'${name}' is not a store with a 'subscribe' method`);
  61. }
  62. }
  63. function subscribe(store, callback) {
  64. const unsub = store.subscribe(callback);
  65. return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
  66. }
  67. function get_store_value(store) {
  68. let value;
  69. subscribe(store, _ => value = _)();
  70. return value;
  71. }
  72. function component_subscribe(component, store, callback) {
  73. component.$$.on_destroy.push(subscribe(store, callback));
  74. }
  75. function create_slot(definition, ctx, fn) {
  76. if (definition) {
  77. const slot_ctx = get_slot_context(definition, ctx, fn);
  78. return definition[0](slot_ctx);
  79. }
  80. }
  81. function get_slot_context(definition, ctx, fn) {
  82. return definition[1]
  83. ? assign({}, assign(ctx.$$scope.ctx, definition[1](fn ? fn(ctx) : {})))
  84. : ctx.$$scope.ctx;
  85. }
  86. function get_slot_changes(definition, ctx, changed, fn) {
  87. return definition[1]
  88. ? assign({}, assign(ctx.$$scope.changed || {}, definition[1](fn ? fn(changed) : {})))
  89. : ctx.$$scope.changed || {};
  90. }
  91. function exclude_internal_props(props) {
  92. const result = {};
  93. for (const k in props)
  94. if (k[0] !== '$')
  95. result[k] = props[k];
  96. return result;
  97. }
  98. function once(fn) {
  99. let ran = false;
  100. return function (...args) {
  101. if (ran)
  102. return;
  103. ran = true;
  104. fn.call(this, ...args);
  105. };
  106. }
  107. function null_to_empty(value) {
  108. return value == null ? '' : value;
  109. }
  110. function set_store_value(store, ret, value = ret) {
  111. store.set(value);
  112. return ret;
  113. }
  114. const is_client = typeof window !== 'undefined';
  115. let now = is_client
  116. ? () => window.performance.now()
  117. : () => Date.now();
  118. let raf = is_client ? cb => requestAnimationFrame(cb) : noop;
  119. // used internally for testing
  120. function set_now(fn) {
  121. now = fn;
  122. }
  123. function set_raf(fn) {
  124. raf = fn;
  125. }
  126. const tasks = new Set();
  127. let running = false;
  128. function run_tasks() {
  129. tasks.forEach(task => {
  130. if (!task[0](now())) {
  131. tasks.delete(task);
  132. task[1]();
  133. }
  134. });
  135. running = tasks.size > 0;
  136. if (running)
  137. raf(run_tasks);
  138. }
  139. function clear_loops() {
  140. // for testing...
  141. tasks.forEach(task => tasks.delete(task));
  142. running = false;
  143. }
  144. function loop(fn) {
  145. let task;
  146. if (!running) {
  147. running = true;
  148. raf(run_tasks);
  149. }
  150. return {
  151. promise: new Promise(fulfil => {
  152. tasks.add(task = [fn, fulfil]);
  153. }),
  154. abort() {
  155. tasks.delete(task);
  156. }
  157. };
  158. }
  159. function append(target, node) {
  160. target.appendChild(node);
  161. }
  162. function insert(target, node, anchor) {
  163. target.insertBefore(node, anchor || null);
  164. }
  165. function detach(node) {
  166. node.parentNode.removeChild(node);
  167. }
  168. function destroy_each(iterations, detaching) {
  169. for (let i = 0; i < iterations.length; i += 1) {
  170. if (iterations[i])
  171. iterations[i].d(detaching);
  172. }
  173. }
  174. function element(name) {
  175. return document.createElement(name);
  176. }
  177. function element_is(name, is) {
  178. return document.createElement(name, { is });
  179. }
  180. function object_without_properties(obj, exclude) {
  181. // eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion
  182. const target = {};
  183. for (const k in obj) {
  184. if (Object.prototype.hasOwnProperty.call(obj, k)
  185. // @ts-ignore
  186. && exclude.indexOf(k) === -1) {
  187. // @ts-ignore
  188. target[k] = obj[k];
  189. }
  190. }
  191. return target;
  192. }
  193. function svg_element(name) {
  194. return document.createElementNS('http://www.w3.org/2000/svg', name);
  195. }
  196. function text(data) {
  197. return document.createTextNode(data);
  198. }
  199. function space() {
  200. return text(' ');
  201. }
  202. function empty() {
  203. return text('');
  204. }
  205. function listen(node, event, handler, options) {
  206. node.addEventListener(event, handler, options);
  207. return () => node.removeEventListener(event, handler, options);
  208. }
  209. function prevent_default(fn) {
  210. return function (event) {
  211. event.preventDefault();
  212. // @ts-ignore
  213. return fn.call(this, event);
  214. };
  215. }
  216. function stop_propagation(fn) {
  217. return function (event) {
  218. event.stopPropagation();
  219. // @ts-ignore
  220. return fn.call(this, event);
  221. };
  222. }
  223. function self$1(fn) {
  224. return function (event) {
  225. // @ts-ignore
  226. if (event.target === this)
  227. fn.call(this, event);
  228. };
  229. }
  230. function attr(node, attribute, value) {
  231. if (value == null)
  232. node.removeAttribute(attribute);
  233. else
  234. node.setAttribute(attribute, value);
  235. }
  236. function set_attributes(node, attributes) {
  237. for (const key in attributes) {
  238. if (key === 'style') {
  239. node.style.cssText = attributes[key];
  240. }
  241. else if (key in node) {
  242. node[key] = attributes[key];
  243. }
  244. else {
  245. attr(node, key, attributes[key]);
  246. }
  247. }
  248. }
  249. function set_svg_attributes(node, attributes) {
  250. for (const key in attributes) {
  251. attr(node, key, attributes[key]);
  252. }
  253. }
  254. function set_custom_element_data(node, prop, value) {
  255. if (prop in node) {
  256. node[prop] = value;
  257. }
  258. else {
  259. attr(node, prop, value);
  260. }
  261. }
  262. function xlink_attr(node, attribute, value) {
  263. node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);
  264. }
  265. function get_binding_group_value(group) {
  266. const value = [];
  267. for (let i = 0; i < group.length; i += 1) {
  268. if (group[i].checked)
  269. value.push(group[i].__value);
  270. }
  271. return value;
  272. }
  273. function to_number(value) {
  274. return value === '' ? undefined : +value;
  275. }
  276. function time_ranges_to_array(ranges) {
  277. const array = [];
  278. for (let i = 0; i < ranges.length; i += 1) {
  279. array.push({ start: ranges.start(i), end: ranges.end(i) });
  280. }
  281. return array;
  282. }
  283. function children(element) {
  284. return Array.from(element.childNodes);
  285. }
  286. function claim_element(nodes, name, attributes, svg) {
  287. for (let i = 0; i < nodes.length; i += 1) {
  288. const node = nodes[i];
  289. if (node.nodeName === name) {
  290. for (let j = 0; j < node.attributes.length; j += 1) {
  291. const attribute = node.attributes[j];
  292. if (!attributes[attribute.name])
  293. node.removeAttribute(attribute.name);
  294. }
  295. return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes
  296. }
  297. }
  298. return svg ? svg_element(name) : element(name);
  299. }
  300. function claim_text(nodes, data) {
  301. for (let i = 0; i < nodes.length; i += 1) {
  302. const node = nodes[i];
  303. if (node.nodeType === 3) {
  304. node.data = '' + data;
  305. return nodes.splice(i, 1)[0];
  306. }
  307. }
  308. return text(data);
  309. }
  310. function claim_space(nodes) {
  311. return claim_text(nodes, ' ');
  312. }
  313. function set_data(text, data) {
  314. data = '' + data;
  315. if (text.data !== data)
  316. text.data = data;
  317. }
  318. function set_input_value(input, value) {
  319. if (value != null || input.value) {
  320. input.value = value;
  321. }
  322. }
  323. function set_input_type(input, type) {
  324. try {
  325. input.type = type;
  326. }
  327. catch (e) {
  328. // do nothing
  329. }
  330. }
  331. function set_style(node, key, value, important) {
  332. node.style.setProperty(key, value, important ? 'important' : '');
  333. }
  334. function select_option(select, value) {
  335. for (let i = 0; i < select.options.length; i += 1) {
  336. const option = select.options[i];
  337. if (option.__value === value) {
  338. option.selected = true;
  339. return;
  340. }
  341. }
  342. }
  343. function select_options(select, value) {
  344. for (let i = 0; i < select.options.length; i += 1) {
  345. const option = select.options[i];
  346. option.selected = ~value.indexOf(option.__value);
  347. }
  348. }
  349. function select_value(select) {
  350. const selected_option = select.querySelector(':checked') || select.options[0];
  351. return selected_option && selected_option.__value;
  352. }
  353. function select_multiple_value(select) {
  354. return [].map.call(select.querySelectorAll(':checked'), option => option.__value);
  355. }
  356. function add_resize_listener(element, fn) {
  357. if (getComputedStyle(element).position === 'static') {
  358. element.style.position = 'relative';
  359. }
  360. const object = document.createElement('object');
  361. object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');
  362. object.type = 'text/html';
  363. object.tabIndex = -1;
  364. let win;
  365. object.onload = () => {
  366. win = object.contentDocument.defaultView;
  367. win.addEventListener('resize', fn);
  368. };
  369. if (/Trident/.test(navigator.userAgent)) {
  370. element.appendChild(object);
  371. object.data = 'about:blank';
  372. }
  373. else {
  374. object.data = 'about:blank';
  375. element.appendChild(object);
  376. }
  377. return {
  378. cancel: () => {
  379. win && win.removeEventListener && win.removeEventListener('resize', fn);
  380. element.removeChild(object);
  381. }
  382. };
  383. }
  384. function toggle_class(element, name, toggle) {
  385. element.classList[toggle ? 'add' : 'remove'](name);
  386. }
  387. function custom_event(type, detail) {
  388. const e = document.createEvent('CustomEvent');
  389. e.initCustomEvent(type, false, false, detail);
  390. return e;
  391. }
  392. class HtmlTag {
  393. constructor(html, anchor = null) {
  394. this.e = element('div');
  395. this.a = anchor;
  396. this.u(html);
  397. }
  398. m(target, anchor = null) {
  399. for (let i = 0; i < this.n.length; i += 1) {
  400. insert(target, this.n[i], anchor);
  401. }
  402. this.t = target;
  403. }
  404. u(html) {
  405. this.e.innerHTML = html;
  406. this.n = Array.from(this.e.childNodes);
  407. }
  408. p(html) {
  409. this.d();
  410. this.u(html);
  411. this.m(this.t, this.a);
  412. }
  413. d() {
  414. this.n.forEach(detach);
  415. }
  416. }
  417. let stylesheet;
  418. let active = 0;
  419. let current_rules = {};
  420. // https://github.com/darkskyapp/string-hash/blob/master/index.js
  421. function hash(str) {
  422. let hash = 5381;
  423. let i = str.length;
  424. while (i--)
  425. hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
  426. return hash >>> 0;
  427. }
  428. function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {
  429. const step = 16.666 / duration;
  430. let keyframes = '{\n';
  431. for (let p = 0; p <= 1; p += step) {
  432. const t = a + (b - a) * ease(p);
  433. keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`;
  434. }
  435. const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
  436. const name = `__svelte_${hash(rule)}_${uid}`;
  437. if (!current_rules[name]) {
  438. if (!stylesheet) {
  439. const style = element('style');
  440. document.head.appendChild(style);
  441. stylesheet = style.sheet;
  442. }
  443. current_rules[name] = true;
  444. stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);
  445. }
  446. const animation = node.style.animation || '';
  447. node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;
  448. active += 1;
  449. return name;
  450. }
  451. function delete_rule(node, name) {
  452. node.style.animation = (node.style.animation || '')
  453. .split(', ')
  454. .filter(name
  455. ? anim => anim.indexOf(name) < 0 // remove specific animation
  456. : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations
  457. )
  458. .join(', ');
  459. if (name && !--active)
  460. clear_rules();
  461. }
  462. function clear_rules() {
  463. raf(() => {
  464. if (active)
  465. return;
  466. let i = stylesheet.cssRules.length;
  467. while (i--)
  468. stylesheet.deleteRule(i);
  469. current_rules = {};
  470. });
  471. }
  472. function create_animation(node, from, fn, params) {
  473. if (!from)
  474. return noop;
  475. const to = node.getBoundingClientRect();
  476. if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)
  477. return noop;
  478. const { delay = 0, duration = 300, easing = identity,
  479. // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?
  480. start: start_time = now() + delay,
  481. // @ts-ignore todo:
  482. end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);
  483. let running = true;
  484. let started = false;
  485. let name;
  486. function start() {
  487. if (css) {
  488. name = create_rule(node, 0, 1, duration, delay, easing, css);
  489. }
  490. if (!delay) {
  491. started = true;
  492. }
  493. }
  494. function stop() {
  495. if (css)
  496. delete_rule(node, name);
  497. running = false;
  498. }
  499. loop(now => {
  500. if (!started && now >= start_time) {
  501. started = true;
  502. }
  503. if (started && now >= end) {
  504. tick(1, 0);
  505. stop();
  506. }
  507. if (!running) {
  508. return false;
  509. }
  510. if (started) {
  511. const p = now - start_time;
  512. const t = 0 + 1 * easing(p / duration);
  513. tick(t, 1 - t);
  514. }
  515. return true;
  516. });
  517. start();
  518. tick(0, 1);
  519. return stop;
  520. }
  521. function fix_position(node) {
  522. const style = getComputedStyle(node);
  523. if (style.position !== 'absolute' && style.position !== 'fixed') {
  524. const { width, height } = style;
  525. const a = node.getBoundingClientRect();
  526. node.style.position = 'absolute';
  527. node.style.width = width;
  528. node.style.height = height;
  529. add_transform(node, a);
  530. }
  531. }
  532. function add_transform(node, a) {
  533. const b = node.getBoundingClientRect();
  534. if (a.left !== b.left || a.top !== b.top) {
  535. const style = getComputedStyle(node);
  536. const transform = style.transform === 'none' ? '' : style.transform;
  537. node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;
  538. }
  539. }
  540. let current_component;
  541. function set_current_component(component) {
  542. current_component = component;
  543. }
  544. function get_current_component() {
  545. if (!current_component)
  546. throw new Error(`Function called outside component initialization`);
  547. return current_component;
  548. }
  549. function beforeUpdate(fn) {
  550. get_current_component().$$.before_update.push(fn);
  551. }
  552. function onMount(fn) {
  553. get_current_component().$$.on_mount.push(fn);
  554. }
  555. function afterUpdate(fn) {
  556. get_current_component().$$.after_update.push(fn);
  557. }
  558. function onDestroy(fn) {
  559. get_current_component().$$.on_destroy.push(fn);
  560. }
  561. function createEventDispatcher() {
  562. const component = current_component;
  563. return (type, detail) => {
  564. const callbacks = component.$$.callbacks[type];
  565. if (callbacks) {
  566. // TODO are there situations where events could be dispatched
  567. // in a server (non-DOM) environment?
  568. const event = custom_event(type, detail);
  569. callbacks.slice().forEach(fn => {
  570. fn.call(component, event);
  571. });
  572. }
  573. };
  574. }
  575. function setContext(key, context) {
  576. get_current_component().$$.context.set(key, context);
  577. }
  578. function getContext(key) {
  579. return get_current_component().$$.context.get(key);
  580. }
  581. // TODO figure out if we still want to support
  582. // shorthand events, or if we want to implement
  583. // a real bubbling mechanism
  584. function bubble(component, event) {
  585. const callbacks = component.$$.callbacks[event.type];
  586. if (callbacks) {
  587. callbacks.slice().forEach(fn => fn(event));
  588. }
  589. }
  590. const dirty_components = [];
  591. const intros = { enabled: false };
  592. const binding_callbacks = [];
  593. const render_callbacks = [];
  594. const flush_callbacks = [];
  595. const resolved_promise = Promise.resolve();
  596. let update_scheduled = false;
  597. function schedule_update() {
  598. if (!update_scheduled) {
  599. update_scheduled = true;
  600. resolved_promise.then(flush);
  601. }
  602. }
  603. function tick() {
  604. schedule_update();
  605. return resolved_promise;
  606. }
  607. function add_render_callback(fn) {
  608. render_callbacks.push(fn);
  609. }
  610. function add_flush_callback(fn) {
  611. flush_callbacks.push(fn);
  612. }
  613. function flush() {
  614. const seen_callbacks = new Set();
  615. do {
  616. // first, call beforeUpdate functions
  617. // and update components
  618. while (dirty_components.length) {
  619. const component = dirty_components.shift();
  620. set_current_component(component);
  621. update(component.$$);
  622. }
  623. while (binding_callbacks.length)
  624. binding_callbacks.pop()();
  625. // then, once components are updated, call
  626. // afterUpdate functions. This may cause
  627. // subsequent updates...
  628. for (let i = 0; i < render_callbacks.length; i += 1) {
  629. const callback = render_callbacks[i];
  630. if (!seen_callbacks.has(callback)) {
  631. callback();
  632. // ...so guard against infinite loops
  633. seen_callbacks.add(callback);
  634. }
  635. }
  636. render_callbacks.length = 0;
  637. } while (dirty_components.length);
  638. while (flush_callbacks.length) {
  639. flush_callbacks.pop()();
  640. }
  641. update_scheduled = false;
  642. }
  643. function update($$) {
  644. if ($$.fragment) {
  645. $$.update($$.dirty);
  646. run_all($$.before_update);
  647. $$.fragment.p($$.dirty, $$.ctx);
  648. $$.dirty = null;
  649. $$.after_update.forEach(add_render_callback);
  650. }
  651. }
  652. let promise;
  653. function wait() {
  654. if (!promise) {
  655. promise = Promise.resolve();
  656. promise.then(() => {
  657. promise = null;
  658. });
  659. }
  660. return promise;
  661. }
  662. function dispatch(node, direction, kind) {
  663. node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
  664. }
  665. const outroing = new Set();
  666. let outros;
  667. function group_outros() {
  668. outros = {
  669. r: 0,
  670. c: [],
  671. p: outros // parent group
  672. };
  673. }
  674. function check_outros() {
  675. if (!outros.r) {
  676. run_all(outros.c);
  677. }
  678. outros = outros.p;
  679. }
  680. function transition_in(block, local) {
  681. if (block && block.i) {
  682. outroing.delete(block);
  683. block.i(local);
  684. }
  685. }
  686. function transition_out(block, local, detach, callback) {
  687. if (block && block.o) {
  688. if (outroing.has(block))
  689. return;
  690. outroing.add(block);
  691. outros.c.push(() => {
  692. outroing.delete(block);
  693. if (callback) {
  694. if (detach)
  695. block.d(1);
  696. callback();
  697. }
  698. });
  699. block.o(local);
  700. }
  701. }
  702. const null_transition = { duration: 0 };
  703. function create_in_transition(node, fn, params) {
  704. let config = fn(node, params);
  705. let running = false;
  706. let animation_name;
  707. let task;
  708. let uid = 0;
  709. function cleanup() {
  710. if (animation_name)
  711. delete_rule(node, animation_name);
  712. }
  713. function go() {
  714. const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
  715. if (css)
  716. animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);
  717. tick(0, 1);
  718. const start_time = now() + delay;
  719. const end_time = start_time + duration;
  720. if (task)
  721. task.abort();
  722. running = true;
  723. add_render_callback(() => dispatch(node, true, 'start'));
  724. task = loop(now => {
  725. if (running) {
  726. if (now >= end_time) {
  727. tick(1, 0);
  728. dispatch(node, true, 'end');
  729. cleanup();
  730. return running = false;
  731. }
  732. if (now >= start_time) {
  733. const t = easing((now - start_time) / duration);
  734. tick(t, 1 - t);
  735. }
  736. }
  737. return running;
  738. });
  739. }
  740. let started = false;
  741. return {
  742. start() {
  743. if (started)
  744. return;
  745. delete_rule(node);
  746. if (is_function(config)) {
  747. config = config();
  748. wait().then(go);
  749. }
  750. else {
  751. go();
  752. }
  753. },
  754. invalidate() {
  755. started = false;
  756. },
  757. end() {
  758. if (running) {
  759. cleanup();
  760. running = false;
  761. }
  762. }
  763. };
  764. }
  765. function create_out_transition(node, fn, params) {
  766. let config = fn(node, params);
  767. let running = true;
  768. let animation_name;
  769. const group = outros;
  770. group.r += 1;
  771. function go() {
  772. const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
  773. if (css)
  774. animation_name = create_rule(node, 1, 0, duration, delay, easing, css);
  775. const start_time = now() + delay;
  776. const end_time = start_time + duration;
  777. add_render_callback(() => dispatch(node, false, 'start'));
  778. loop(now => {
  779. if (running) {
  780. if (now >= end_time) {
  781. tick(0, 1);
  782. dispatch(node, false, 'end');
  783. if (!--group.r) {
  784. // this will result in `end()` being called,
  785. // so we don't need to clean up here
  786. run_all(group.c);
  787. }
  788. return false;
  789. }
  790. if (now >= start_time) {
  791. const t = easing((now - start_time) / duration);
  792. tick(1 - t, t);
  793. }
  794. }
  795. return running;
  796. });
  797. }
  798. if (is_function(config)) {
  799. wait().then(() => {
  800. // @ts-ignore
  801. config = config();
  802. go();
  803. });
  804. }
  805. else {
  806. go();
  807. }
  808. return {
  809. end(reset) {
  810. if (reset && config.tick) {
  811. config.tick(1, 0);
  812. }
  813. if (running) {
  814. if (animation_name)
  815. delete_rule(node, animation_name);
  816. running = false;
  817. }
  818. }
  819. };
  820. }
  821. function create_bidirectional_transition(node, fn, params, intro) {
  822. let config = fn(node, params);
  823. let t = intro ? 0 : 1;
  824. let running_program = null;
  825. let pending_program = null;
  826. let animation_name = null;
  827. function clear_animation() {
  828. if (animation_name)
  829. delete_rule(node, animation_name);
  830. }
  831. function init(program, duration) {
  832. const d = program.b - t;
  833. duration *= Math.abs(d);
  834. return {
  835. a: t,
  836. b: program.b,
  837. d,
  838. duration,
  839. start: program.start,
  840. end: program.start + duration,
  841. group: program.group
  842. };
  843. }
  844. function go(b) {
  845. const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
  846. const program = {
  847. start: now() + delay,
  848. b
  849. };
  850. if (!b) {
  851. // @ts-ignore todo: improve typings
  852. program.group = outros;
  853. outros.r += 1;
  854. }
  855. if (running_program) {
  856. pending_program = program;
  857. }
  858. else {
  859. // if this is an intro, and there's a delay, we need to do
  860. // an initial tick and/or apply CSS animation immediately
  861. if (css) {
  862. clear_animation();
  863. animation_name = create_rule(node, t, b, duration, delay, easing, css);
  864. }
  865. if (b)
  866. tick(0, 1);
  867. running_program = init(program, duration);
  868. add_render_callback(() => dispatch(node, b, 'start'));
  869. loop(now => {
  870. if (pending_program && now > pending_program.start) {
  871. running_program = init(pending_program, duration);
  872. pending_program = null;
  873. dispatch(node, running_program.b, 'start');
  874. if (css) {
  875. clear_animation();
  876. animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);
  877. }
  878. }
  879. if (running_program) {
  880. if (now >= running_program.end) {
  881. tick(t = running_program.b, 1 - t);
  882. dispatch(node, running_program.b, 'end');
  883. if (!pending_program) {
  884. // we're done
  885. if (running_program.b) {
  886. // intro — we can tidy up immediately
  887. clear_animation();
  888. }
  889. else {
  890. // outro — needs to be coordinated
  891. if (!--running_program.group.r)
  892. run_all(running_program.group.c);
  893. }
  894. }
  895. running_program = null;
  896. }
  897. else if (now >= running_program.start) {
  898. const p = now - running_program.start;
  899. t = running_program.a + running_program.d * easing(p / running_program.duration);
  900. tick(t, 1 - t);
  901. }
  902. }
  903. return !!(running_program || pending_program);
  904. });
  905. }
  906. }
  907. return {
  908. run(b) {
  909. if (is_function(config)) {
  910. wait().then(() => {
  911. // @ts-ignore
  912. config = config();
  913. go(b);
  914. });
  915. }
  916. else {
  917. go(b);
  918. }
  919. },
  920. end() {
  921. clear_animation();
  922. running_program = pending_program = null;
  923. }
  924. };
  925. }
  926. function handle_promise(promise, info) {
  927. const token = info.token = {};
  928. function update(type, index, key, value) {
  929. if (info.token !== token)
  930. return;
  931. info.resolved = key && { [key]: value };
  932. const child_ctx = assign(assign({}, info.ctx), info.resolved);
  933. const block = type && (info.current = type)(child_ctx);
  934. if (info.block) {
  935. if (info.blocks) {
  936. info.blocks.forEach((block, i) => {
  937. if (i !== index && block) {
  938. group_outros();
  939. transition_out(block, 1, 1, () => {
  940. info.blocks[i] = null;
  941. });
  942. check_outros();
  943. }
  944. });
  945. }
  946. else {
  947. info.block.d(1);
  948. }
  949. block.c();
  950. transition_in(block, 1);
  951. block.m(info.mount(), info.anchor);
  952. flush();
  953. }
  954. info.block = block;
  955. if (info.blocks)
  956. info.blocks[index] = block;
  957. }
  958. if (is_promise(promise)) {
  959. const current_component = get_current_component();
  960. promise.then(value => {
  961. set_current_component(current_component);
  962. update(info.then, 1, info.value, value);
  963. set_current_component(null);
  964. }, error => {
  965. set_current_component(current_component);
  966. update(info.catch, 2, info.error, error);
  967. set_current_component(null);
  968. });
  969. // if we previously had a then/catch block, destroy it
  970. if (info.current !== info.pending) {
  971. update(info.pending, 0);
  972. return true;
  973. }
  974. }
  975. else {
  976. if (info.current !== info.then) {
  977. update(info.then, 1, info.value, promise);
  978. return true;
  979. }
  980. info.resolved = { [info.value]: promise };
  981. }
  982. }
  983. const globals = (typeof window !== 'undefined' ? window : global);
  984. function destroy_block(block, lookup) {
  985. block.d(1);
  986. lookup.delete(block.key);
  987. }
  988. function outro_and_destroy_block(block, lookup) {
  989. transition_out(block, 1, 1, () => {
  990. lookup.delete(block.key);
  991. });
  992. }
  993. function fix_and_destroy_block(block, lookup) {
  994. block.f();
  995. destroy_block(block, lookup);
  996. }
  997. function fix_and_outro_and_destroy_block(block, lookup) {
  998. block.f();
  999. outro_and_destroy_block(block, lookup);
  1000. }
  1001. function update_keyed_each(old_blocks, changed, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {
  1002. let o = old_blocks.length;
  1003. let n = list.length;
  1004. let i = o;
  1005. const old_indexes = {};
  1006. while (i--)
  1007. old_indexes[old_blocks[i].key] = i;
  1008. const new_blocks = [];
  1009. const new_lookup = new Map();
  1010. const deltas = new Map();
  1011. i = n;
  1012. while (i--) {
  1013. const child_ctx = get_context(ctx, list, i);
  1014. const key = get_key(child_ctx);
  1015. let block = lookup.get(key);
  1016. if (!block) {
  1017. block = create_each_block(key, child_ctx);
  1018. block.c();
  1019. }
  1020. else if (dynamic) {
  1021. block.p(changed, child_ctx);
  1022. }
  1023. new_lookup.set(key, new_blocks[i] = block);
  1024. if (key in old_indexes)
  1025. deltas.set(key, Math.abs(i - old_indexes[key]));
  1026. }
  1027. const will_move = new Set();
  1028. const did_move = new Set();
  1029. function insert(block) {
  1030. transition_in(block, 1);
  1031. block.m(node, next);
  1032. lookup.set(block.key, block);
  1033. next = block.first;
  1034. n--;
  1035. }
  1036. while (o && n) {
  1037. const new_block = new_blocks[n - 1];
  1038. const old_block = old_blocks[o - 1];
  1039. const new_key = new_block.key;
  1040. const old_key = old_block.key;
  1041. if (new_block === old_block) {
  1042. // do nothing
  1043. next = new_block.first;
  1044. o--;
  1045. n--;
  1046. }
  1047. else if (!new_lookup.has(old_key)) {
  1048. // remove old block
  1049. destroy(old_block, lookup);
  1050. o--;
  1051. }
  1052. else if (!lookup.has(new_key) || will_move.has(new_key)) {
  1053. insert(new_block);
  1054. }
  1055. else if (did_move.has(old_key)) {
  1056. o--;
  1057. }
  1058. else if (deltas.get(new_key) > deltas.get(old_key)) {
  1059. did_move.add(new_key);
  1060. insert(new_block);
  1061. }
  1062. else {
  1063. will_move.add(old_key);
  1064. o--;
  1065. }
  1066. }
  1067. while (o--) {
  1068. const old_block = old_blocks[o];
  1069. if (!new_lookup.has(old_block.key))
  1070. destroy(old_block, lookup);
  1071. }
  1072. while (n)
  1073. insert(new_blocks[n - 1]);
  1074. return new_blocks;
  1075. }
  1076. function measure(blocks) {
  1077. const rects = {};
  1078. let i = blocks.length;
  1079. while (i--)
  1080. rects[blocks[i].key] = blocks[i].node.getBoundingClientRect();
  1081. return rects;
  1082. }
  1083. function get_spread_update(levels, updates) {
  1084. const update = {};
  1085. const to_null_out = {};
  1086. const accounted_for = { $$scope: 1 };
  1087. let i = levels.length;
  1088. while (i--) {
  1089. const o = levels[i];
  1090. const n = updates[i];
  1091. if (n) {
  1092. for (const key in o) {
  1093. if (!(key in n))
  1094. to_null_out[key] = 1;
  1095. }
  1096. for (const key in n) {
  1097. if (!accounted_for[key]) {
  1098. update[key] = n[key];
  1099. accounted_for[key] = 1;
  1100. }
  1101. }
  1102. levels[i] = n;
  1103. }
  1104. else {
  1105. for (const key in o) {
  1106. accounted_for[key] = 1;
  1107. }
  1108. }
  1109. }
  1110. for (const key in to_null_out) {
  1111. if (!(key in update))
  1112. update[key] = undefined;
  1113. }
  1114. return update;
  1115. }
  1116. function get_spread_object(spread_props) {
  1117. return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};
  1118. }
  1119. const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
  1120. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  1121. // https://infra.spec.whatwg.org/#noncharacter
  1122. function spread(args) {
  1123. const attributes = Object.assign({}, ...args);
  1124. let str = '';
  1125. Object.keys(attributes).forEach(name => {
  1126. if (invalid_attribute_name_character.test(name))
  1127. return;
  1128. const value = attributes[name];
  1129. if (value === undefined)
  1130. return;
  1131. if (value === true)
  1132. str += " " + name;
  1133. const escaped = String(value)
  1134. .replace(/"/g, '&#34;')
  1135. .replace(/'/g, '&#39;');
  1136. str += " " + name + "=" + JSON.stringify(escaped);
  1137. });
  1138. return str;
  1139. }
  1140. const escaped = {
  1141. '"': '&quot;',
  1142. "'": '&#39;',
  1143. '&': '&amp;',
  1144. '<': '&lt;',
  1145. '>': '&gt;'
  1146. };
  1147. function escape$1(html) {
  1148. return String(html).replace(/["'&<>]/g, match => escaped[match]);
  1149. }
  1150. function each(items, fn) {
  1151. let str = '';
  1152. for (let i = 0; i < items.length; i += 1) {
  1153. str += fn(items[i], i);
  1154. }
  1155. return str;
  1156. }
  1157. const missing_component = {
  1158. $$render: () => ''
  1159. };
  1160. function validate_component(component, name) {
  1161. if (!component || !component.$$render) {
  1162. if (name === 'svelte:component')
  1163. name += ' this={...}';
  1164. throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);
  1165. }
  1166. return component;
  1167. }
  1168. function debug(file, line, column, values) {
  1169. console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console
  1170. console.log(values); // eslint-disable-line no-console
  1171. return '';
  1172. }
  1173. let on_destroy;
  1174. function create_ssr_component(fn) {
  1175. function $$render(result, props, bindings, slots) {
  1176. const parent_component = current_component;
  1177. const $$ = {
  1178. on_destroy,
  1179. context: new Map(parent_component ? parent_component.$$.context : []),
  1180. // these will be immediately discarded
  1181. on_mount: [],
  1182. before_update: [],
  1183. after_update: [],
  1184. callbacks: blank_object()
  1185. };
  1186. set_current_component({ $$ });
  1187. const html = fn(result, props, bindings, slots);
  1188. set_current_component(parent_component);
  1189. return html;
  1190. }
  1191. return {
  1192. render: (props = {}, options = {}) => {
  1193. on_destroy = [];
  1194. const result = { head: '', css: new Set() };
  1195. const html = $$render(result, props, {}, options);
  1196. run_all(on_destroy);
  1197. return {
  1198. html,
  1199. css: {
  1200. code: Array.from(result.css).map(css => css.code).join('\n'),
  1201. map: null // TODO
  1202. },
  1203. head: result.head
  1204. };
  1205. },
  1206. $$render
  1207. };
  1208. }
  1209. function add_attribute(name, value, boolean) {
  1210. if (value == null || (boolean && !value))
  1211. return '';
  1212. return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape$1(value)) : `"${value}"`}`}`;
  1213. }
  1214. function add_classes(classes) {
  1215. return classes ? ` class="${classes}"` : ``;
  1216. }
  1217. function bind(component, name, callback) {
  1218. if (component.$$.props.indexOf(name) === -1)
  1219. return;
  1220. component.$$.bound[name] = callback;
  1221. callback(component.$$.ctx[name]);
  1222. }
  1223. function mount_component(component, target, anchor) {
  1224. const { fragment, on_mount, on_destroy, after_update } = component.$$;
  1225. fragment.m(target, anchor);
  1226. // onMount happens before the initial afterUpdate
  1227. add_render_callback(() => {
  1228. const new_on_destroy = on_mount.map(run).filter(is_function);
  1229. if (on_destroy) {
  1230. on_destroy.push(...new_on_destroy);
  1231. }
  1232. else {
  1233. // Edge case - component was destroyed immediately,
  1234. // most likely as a result of a binding initialising
  1235. run_all(new_on_destroy);
  1236. }
  1237. component.$$.on_mount = [];
  1238. });
  1239. after_update.forEach(add_render_callback);
  1240. }
  1241. function destroy_component(component, detaching) {
  1242. if (component.$$.fragment) {
  1243. run_all(component.$$.on_destroy);
  1244. component.$$.fragment.d(detaching);
  1245. // TODO null out other refs, including component.$$ (but need to
  1246. // preserve final state?)
  1247. component.$$.on_destroy = component.$$.fragment = null;
  1248. component.$$.ctx = {};
  1249. }
  1250. }
  1251. function make_dirty(component, key) {
  1252. if (!component.$$.dirty) {
  1253. dirty_components.push(component);
  1254. schedule_update();
  1255. component.$$.dirty = blank_object();
  1256. }
  1257. component.$$.dirty[key] = true;
  1258. }
  1259. function init(component, options, instance, create_fragment, not_equal, prop_names) {
  1260. const parent_component = current_component;
  1261. set_current_component(component);
  1262. const props = options.props || {};
  1263. const $$ = component.$$ = {
  1264. fragment: null,
  1265. ctx: null,
  1266. // state
  1267. props: prop_names,
  1268. update: noop,
  1269. not_equal,
  1270. bound: blank_object(),
  1271. // lifecycle
  1272. on_mount: [],
  1273. on_destroy: [],
  1274. before_update: [],
  1275. after_update: [],
  1276. context: new Map(parent_component ? parent_component.$$.context : []),
  1277. // everything else
  1278. callbacks: blank_object(),
  1279. dirty: null
  1280. };
  1281. let ready = false;
  1282. $$.ctx = instance
  1283. ? instance(component, props, (key, ret, value = ret) => {
  1284. if ($$.ctx && not_equal($$.ctx[key], $$.ctx[key] = value)) {
  1285. if ($$.bound[key])
  1286. $$.bound[key](value);
  1287. if (ready)
  1288. make_dirty(component, key);
  1289. }
  1290. return ret;
  1291. })
  1292. : props;
  1293. $$.update();
  1294. ready = true;
  1295. run_all($$.before_update);
  1296. $$.fragment = create_fragment($$.ctx);
  1297. if (options.target) {
  1298. if (options.hydrate) {
  1299. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  1300. $$.fragment.l(children(options.target));
  1301. }
  1302. else {
  1303. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  1304. $$.fragment.c();
  1305. }
  1306. if (options.intro)
  1307. transition_in(component.$$.fragment);
  1308. mount_component(component, options.target, options.anchor);
  1309. flush();
  1310. }
  1311. set_current_component(parent_component);
  1312. }
  1313. let SvelteElement;
  1314. if (typeof HTMLElement !== 'undefined') {
  1315. SvelteElement = class extends HTMLElement {
  1316. constructor() {
  1317. super();
  1318. this.attachShadow({ mode: 'open' });
  1319. }
  1320. connectedCallback() {
  1321. // @ts-ignore todo: improve typings
  1322. for (const key in this.$$.slotted) {
  1323. // @ts-ignore todo: improve typings
  1324. this.appendChild(this.$$.slotted[key]);
  1325. }
  1326. }
  1327. attributeChangedCallback(attr, _oldValue, newValue) {
  1328. this[attr] = newValue;
  1329. }
  1330. $destroy() {
  1331. destroy_component(this, 1);
  1332. this.$destroy = noop;
  1333. }
  1334. $on(type, callback) {
  1335. // TODO should this delegate to addEventListener?
  1336. const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
  1337. callbacks.push(callback);
  1338. return () => {
  1339. const index = callbacks.indexOf(callback);
  1340. if (index !== -1)
  1341. callbacks.splice(index, 1);
  1342. };
  1343. }
  1344. $set() {
  1345. // overridden by instance, if it has props
  1346. }
  1347. };
  1348. }
  1349. class SvelteComponent {
  1350. $destroy() {
  1351. destroy_component(this, 1);
  1352. this.$destroy = noop;
  1353. }
  1354. $on(type, callback) {
  1355. const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
  1356. callbacks.push(callback);
  1357. return () => {
  1358. const index = callbacks.indexOf(callback);
  1359. if (index !== -1)
  1360. callbacks.splice(index, 1);
  1361. };
  1362. }
  1363. $set() {
  1364. // overridden by instance, if it has props
  1365. }
  1366. }
  1367. function dispatch_dev(type, detail) {
  1368. document.dispatchEvent(custom_event(type, detail));
  1369. }
  1370. function append_dev(target, node) {
  1371. dispatch_dev("SvelteDOMInsert", { target, node });
  1372. append(target, node);
  1373. }
  1374. function insert_dev(target, node, anchor) {
  1375. dispatch_dev("SvelteDOMInsert", { target, node, anchor });
  1376. insert(target, node, anchor);
  1377. }
  1378. function detach_dev(node) {
  1379. dispatch_dev("SvelteDOMRemove", { node });
  1380. detach(node);
  1381. }
  1382. function detach_between_dev(before, after) {
  1383. while (before.nextSibling && before.nextSibling !== after) {
  1384. detach_dev(before.nextSibling);
  1385. }
  1386. }
  1387. function detach_before_dev(after) {
  1388. while (after.previousSibling) {
  1389. detach_dev(after.previousSibling);
  1390. }
  1391. }
  1392. function detach_after_dev(before) {
  1393. while (before.nextSibling) {
  1394. detach_dev(before.nextSibling);
  1395. }
  1396. }
  1397. function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
  1398. const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : [];
  1399. if (has_prevent_default)
  1400. modifiers.push('preventDefault');
  1401. if (has_stop_propagation)
  1402. modifiers.push('stopPropagation');
  1403. dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers });
  1404. const dispose = listen(node, event, handler, options);
  1405. return () => {
  1406. dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers });
  1407. dispose();
  1408. };
  1409. }
  1410. function attr_dev(node, attribute, value) {
  1411. attr(node, attribute, value);
  1412. if (value == null)
  1413. dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute });
  1414. else
  1415. dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value });
  1416. }
  1417. function prop_dev(node, property, value) {
  1418. node[property] = value;
  1419. dispatch_dev("SvelteDOMSetProperty", { node, property, value });
  1420. }
  1421. function dataset_dev(node, property, value) {
  1422. node.dataset[property] = value;
  1423. dispatch_dev("SvelteDOMSetDataset", { node, property, value });
  1424. }
  1425. function set_data_dev(text, data) {
  1426. data = '' + data;
  1427. if (text.data === data)
  1428. return;
  1429. dispatch_dev("SvelteDOMSetData", { node: text, data });
  1430. text.data = data;
  1431. }
  1432. class SvelteComponentDev extends SvelteComponent {
  1433. constructor(options) {
  1434. if (!options || (!options.target && !options.$$inline)) {
  1435. throw new Error(`'target' is a required option`);
  1436. }
  1437. super();
  1438. }
  1439. $destroy() {
  1440. super.$destroy();
  1441. this.$destroy = () => {
  1442. console.warn(`Component was already destroyed`); // eslint-disable-line no-console
  1443. };
  1444. }
  1445. }
  1446. 'use strict';
  1447. var has = Object.prototype.hasOwnProperty
  1448. , undef;
  1449. /**
  1450. * Decode a URI encoded string.
  1451. *
  1452. * @param {String} input The URI encoded string.
  1453. * @returns {String|Null} The decoded string.
  1454. * @api private
  1455. */
  1456. function decode(input) {
  1457. try {
  1458. return decodeURIComponent(input.replace(/\+/g, ' '));
  1459. } catch (e) {
  1460. return null;
  1461. }
  1462. }
  1463. /**
  1464. * Attempts to encode a given input.
  1465. *
  1466. * @param {String} input The string that needs to be encoded.
  1467. * @returns {String|Null} The encoded string.
  1468. * @api private
  1469. */
  1470. function encode(input) {
  1471. try {
  1472. return encodeURIComponent(input);
  1473. } catch (e) {
  1474. return null;
  1475. }
  1476. }
  1477. /**
  1478. * Simple query string parser.
  1479. *
  1480. * @param {String} query The query string that needs to be parsed.
  1481. * @returns {Object}
  1482. * @api public
  1483. */
  1484. function querystring(query) {
  1485. var parser = /([^=?&]+)=?([^&]*)/g
  1486. , result = {}
  1487. , part;
  1488. while (part = parser.exec(query)) {
  1489. var key = decode(part[1])
  1490. , value = decode(part[2]);
  1491. //
  1492. // Prevent overriding of existing properties. This ensures that build-in
  1493. // methods like `toString` or __proto__ are not overriden by malicious
  1494. // querystrings.
  1495. //
  1496. // In the case if failed decoding, we want to omit the key/value pairs
  1497. // from the result.
  1498. //
  1499. if (key === null || value === null || key in result) continue;
  1500. result[key] = value;
  1501. }
  1502. return result;
  1503. }
  1504. /**
  1505. * Transform a query string to an object.
  1506. *
  1507. * @param {Object} obj Object that should be transformed.
  1508. * @param {String} prefix Optional prefix.
  1509. * @returns {String}
  1510. * @api public
  1511. */
  1512. function querystringify(obj, prefix) {
  1513. prefix = prefix || '';
  1514. var pairs = []
  1515. , value
  1516. , key;
  1517. //
  1518. // Optionally prefix with a '?' if needed
  1519. //
  1520. if ('string' !== typeof prefix) prefix = '?';
  1521. for (key in obj) {
  1522. if (has.call(obj, key)) {
  1523. value = obj[key];
  1524. //
  1525. // Edge cases where we actually want to encode the value to an empty
  1526. // string instead of the stringified value.
  1527. //
  1528. if (!value && (value === null || value === undef || isNaN(value))) {
  1529. value = '';
  1530. }
  1531. key = encodeURIComponent(key);
  1532. value = encodeURIComponent(value);
  1533. //
  1534. // If we failed to encode the strings, we should bail out as we don't
  1535. // want to add invalid strings to the query.
  1536. //
  1537. if (key === null || value === null) continue;
  1538. pairs.push(key +'='+ value);
  1539. }
  1540. }
  1541. return pairs.length ? prefix + pairs.join('&') : '';
  1542. }
  1543. //
  1544. // Expose the module.
  1545. //
  1546. var stringify = querystringify;
  1547. var parse = querystring;
  1548. var querystringify_1 = {
  1549. stringify: stringify,
  1550. parse: parse
  1551. };
  1552. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  1553. function commonjsRequire () {
  1554. throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
  1555. }
  1556. function unwrapExports (x) {
  1557. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
  1558. }
  1559. function createCommonjsModule(fn, module) {
  1560. return module = { exports: {} }, fn(module, module.exports), module.exports;
  1561. }
  1562. function getCjsExportFromNamespace (n) {
  1563. return n && n['default'] || n;
  1564. }
  1565. var prism = createCommonjsModule(function (module) {
  1566. /* **********************************************
  1567. Begin prism-core.js
  1568. ********************************************** */
  1569. var _self = (typeof window !== 'undefined')
  1570. ? window // if in browser
  1571. : (
  1572. (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
  1573. ? self // if in worker
  1574. : {} // if in node js
  1575. );
  1576. /**
  1577. * Prism: Lightweight, robust, elegant syntax highlighting
  1578. * MIT license http://www.opensource.org/licenses/mit-license.php/
  1579. * @author Lea Verou http://lea.verou.me
  1580. */
  1581. var Prism = (function (_self){
  1582. // Private helper vars
  1583. var lang = /\blang(?:uage)?-([\w-]+)\b/i;
  1584. var uniqueId = 0;
  1585. var _ = {
  1586. manual: _self.Prism && _self.Prism.manual,
  1587. disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
  1588. util: {
  1589. encode: function (tokens) {
  1590. if (tokens instanceof Token) {
  1591. return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias);
  1592. } else if (Array.isArray(tokens)) {
  1593. return tokens.map(_.util.encode);
  1594. } else {
  1595. return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
  1596. }
  1597. },
  1598. type: function (o) {
  1599. return Object.prototype.toString.call(o).slice(8, -1);
  1600. },
  1601. objId: function (obj) {
  1602. if (!obj['__id']) {
  1603. Object.defineProperty(obj, '__id', { value: ++uniqueId });
  1604. }
  1605. return obj['__id'];
  1606. },
  1607. // Deep clone a language definition (e.g. to extend it)
  1608. clone: function deepClone(o, visited) {
  1609. var clone, id, type = _.util.type(o);
  1610. visited = visited || {};
  1611. switch (type) {
  1612. case 'Object':
  1613. id = _.util.objId(o);
  1614. if (visited[id]) {
  1615. return visited[id];
  1616. }
  1617. clone = {};
  1618. visited[id] = clone;
  1619. for (var key in o) {
  1620. if (o.hasOwnProperty(key)) {
  1621. clone[key] = deepClone(o[key], visited);
  1622. }
  1623. }
  1624. return clone;
  1625. case 'Array':
  1626. id = _.util.objId(o);
  1627. if (visited[id]) {
  1628. return visited[id];
  1629. }
  1630. clone = [];
  1631. visited[id] = clone;
  1632. o.forEach(function (v, i) {
  1633. clone[i] = deepClone(v, visited);
  1634. });
  1635. return clone;
  1636. default:
  1637. return o;
  1638. }
  1639. }
  1640. },
  1641. languages: {
  1642. extend: function (id, redef) {
  1643. var lang = _.util.clone(_.languages[id]);
  1644. for (var key in redef) {
  1645. lang[key] = redef[key];
  1646. }
  1647. return lang;
  1648. },
  1649. /**
  1650. * Insert a token before another token in a language literal
  1651. * As this needs to recreate the object (we cannot actually insert before keys in object literals),
  1652. * we cannot just provide an object, we need an object and a key.
  1653. * @param inside The key (or language id) of the parent
  1654. * @param before The key to insert before.
  1655. * @param insert Object with the key/value pairs to insert
  1656. * @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted.
  1657. */
  1658. insertBefore: function (inside, before, insert, root) {
  1659. root = root || _.languages;
  1660. var grammar = root[inside];
  1661. var ret = {};
  1662. for (var token in grammar) {
  1663. if (grammar.hasOwnProperty(token)) {
  1664. if (token == before) {
  1665. for (var newToken in insert) {
  1666. if (insert.hasOwnProperty(newToken)) {
  1667. ret[newToken] = insert[newToken];
  1668. }
  1669. }
  1670. }
  1671. // Do not insert token which also occur in insert. See #1525
  1672. if (!insert.hasOwnProperty(token)) {
  1673. ret[token] = grammar[token];
  1674. }
  1675. }
  1676. }
  1677. var old = root[inside];
  1678. root[inside] = ret;
  1679. // Update references in other language definitions
  1680. _.languages.DFS(_.languages, function(key, value) {
  1681. if (value === old && key != inside) {
  1682. this[key] = ret;
  1683. }
  1684. });
  1685. return ret;
  1686. },
  1687. // Traverse a language definition with Depth First Search
  1688. DFS: function DFS(o, callback, type, visited) {
  1689. visited = visited || {};
  1690. var objId = _.util.objId;
  1691. for (var i in o) {
  1692. if (o.hasOwnProperty(i)) {
  1693. callback.call(o, i, o[i], type || i);
  1694. var property = o[i],
  1695. propertyType = _.util.type(property);
  1696. if (propertyType === 'Object' && !visited[objId(property)]) {
  1697. visited[objId(property)] = true;
  1698. DFS(property, callback, null, visited);
  1699. }
  1700. else if (propertyType === 'Array' && !visited[objId(property)]) {
  1701. visited[objId(property)] = true;
  1702. DFS(property, callback, i, visited);
  1703. }
  1704. }
  1705. }
  1706. }
  1707. },
  1708. plugins: {},
  1709. highlightAll: function(async, callback) {
  1710. _.highlightAllUnder(document, async, callback);
  1711. },
  1712. highlightAllUnder: function(container, async, callback) {
  1713. var env = {
  1714. callback: callback,
  1715. selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
  1716. };
  1717. _.hooks.run('before-highlightall', env);
  1718. var elements = container.querySelectorAll(env.selector);
  1719. for (var i=0, element; element = elements[i++];) {
  1720. _.highlightElement(element, async === true, env.callback);
  1721. }
  1722. },
  1723. highlightElement: function(element, async, callback) {
  1724. // Find language
  1725. var language = 'none', grammar, parent = element;
  1726. while (parent && !lang.test(parent.className)) {
  1727. parent = parent.parentNode;
  1728. }
  1729. if (parent) {
  1730. language = (parent.className.match(lang) || [,'none'])[1].toLowerCase();
  1731. grammar = _.languages[language];
  1732. }
  1733. // Set language on the element, if not present
  1734. element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
  1735. if (element.parentNode) {
  1736. // Set language on the parent, for styling
  1737. parent = element.parentNode;
  1738. if (/pre/i.test(parent.nodeName)) {
  1739. parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
  1740. }
  1741. }
  1742. var code = element.textContent;
  1743. var env = {
  1744. element: element,
  1745. language: language,
  1746. grammar: grammar,
  1747. code: code
  1748. };
  1749. var insertHighlightedCode = function (highlightedCode) {
  1750. env.highlightedCode = highlightedCode;
  1751. _.hooks.run('before-insert', env);
  1752. env.element.innerHTML = env.highlightedCode;
  1753. _.hooks.run('after-highlight', env);
  1754. _.hooks.run('complete', env);
  1755. callback && callback.call(env.element);
  1756. };
  1757. _.hooks.run('before-sanity-check', env);
  1758. if (!env.code) {
  1759. _.hooks.run('complete', env);
  1760. return;
  1761. }
  1762. _.hooks.run('before-highlight', env);
  1763. if (!env.grammar) {
  1764. insertHighlightedCode(_.util.encode(env.code));
  1765. return;
  1766. }
  1767. if (async && _self.Worker) {
  1768. var worker = new Worker(_.filename);
  1769. worker.onmessage = function(evt) {
  1770. insertHighlightedCode(evt.data);
  1771. };
  1772. worker.postMessage(JSON.stringify({
  1773. language: env.language,
  1774. code: env.code,
  1775. immediateClose: true
  1776. }));
  1777. }
  1778. else {
  1779. insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
  1780. }
  1781. },
  1782. highlight: function (text, grammar, language) {
  1783. var env = {
  1784. code: text,
  1785. grammar: grammar,
  1786. language: language
  1787. };
  1788. _.hooks.run('before-tokenize', env);
  1789. env.tokens = _.tokenize(env.code, env.grammar);
  1790. _.hooks.run('after-tokenize', env);
  1791. return Token.stringify(_.util.encode(env.tokens), env.language);
  1792. },
  1793. matchGrammar: function (text, strarr, grammar, index, startPos, oneshot, target) {
  1794. for (var token in grammar) {
  1795. if(!grammar.hasOwnProperty(token) || !grammar[token]) {
  1796. continue;
  1797. }
  1798. if (token == target) {
  1799. return;
  1800. }
  1801. var patterns = grammar[token];
  1802. patterns = (_.util.type(patterns) === "Array") ? patterns : [patterns];
  1803. for (var j = 0; j < patterns.length; ++j) {
  1804. var pattern = patterns[j],
  1805. inside = pattern.inside,
  1806. lookbehind = !!pattern.lookbehind,
  1807. greedy = !!pattern.greedy,
  1808. lookbehindLength = 0,
  1809. alias = pattern.alias;
  1810. if (greedy && !pattern.pattern.global) {
  1811. // Without the global flag, lastIndex won't work
  1812. var flags = pattern.pattern.toString().match(/[imuy]*$/)[0];
  1813. pattern.pattern = RegExp(pattern.pattern.source, flags + "g");
  1814. }
  1815. pattern = pattern.pattern || pattern;
  1816. // Don’t cache length as it changes during the loop
  1817. for (var i = index, pos = startPos; i < strarr.length; pos += strarr[i].length, ++i) {
  1818. var str = strarr[i];
  1819. if (strarr.length > text.length) {
  1820. // Something went terribly wrong, ABORT, ABORT!
  1821. return;
  1822. }
  1823. if (str instanceof Token) {
  1824. continue;
  1825. }
  1826. if (greedy && i != strarr.length - 1) {
  1827. pattern.lastIndex = pos;
  1828. var match = pattern.exec(text);
  1829. if (!match) {
  1830. break;
  1831. }
  1832. var from = match.index + (lookbehind ? match[1].length : 0),
  1833. to = match.index + match[0].length,
  1834. k = i,
  1835. p = pos;
  1836. for (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) {
  1837. p += strarr[k].length;
  1838. // Move the index i to the element in strarr that is closest to from
  1839. if (from >= p) {
  1840. ++i;
  1841. pos = p;
  1842. }
  1843. }
  1844. // If strarr[i] is a Token, then the match starts inside another Token, which is invalid
  1845. if (strarr[i] instanceof Token) {
  1846. continue;
  1847. }
  1848. // Number of tokens to delete and replace with the new match
  1849. delNum = k - i;
  1850. str = text.slice(pos, p);
  1851. match.index -= pos;
  1852. } else {
  1853. pattern.lastIndex = 0;
  1854. var match = pattern.exec(str),
  1855. delNum = 1;
  1856. }
  1857. if (!match) {
  1858. if (oneshot) {
  1859. break;
  1860. }
  1861. continue;
  1862. }
  1863. if(lookbehind) {
  1864. lookbehindLength = match[1] ? match[1].length : 0;
  1865. }
  1866. var from = match.index + lookbehindLength,
  1867. match = match[0].slice(lookbehindLength),
  1868. to = from + match.length,
  1869. before = str.slice(0, from),
  1870. after = str.slice(to);
  1871. var args = [i, delNum];
  1872. if (before) {
  1873. ++i;
  1874. pos += before.length;
  1875. args.push(before);
  1876. }
  1877. var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy);
  1878. args.push(wrapped);
  1879. if (after) {
  1880. args.push(after);
  1881. }
  1882. Array.prototype.splice.apply(strarr, args);
  1883. if (delNum != 1)
  1884. _.matchGrammar(text, strarr, grammar, i, pos, true, token);
  1885. if (oneshot)
  1886. break;
  1887. }
  1888. }
  1889. }
  1890. },
  1891. tokenize: function(text, grammar) {
  1892. var strarr = [text];
  1893. var rest = grammar.rest;
  1894. if (rest) {
  1895. for (var token in rest) {
  1896. grammar[token] = rest[token];
  1897. }
  1898. delete grammar.rest;
  1899. }
  1900. _.matchGrammar(text, strarr, grammar, 0, 0, false);
  1901. return strarr;
  1902. },
  1903. hooks: {
  1904. all: {},
  1905. add: function (name, callback) {
  1906. var hooks = _.hooks.all;
  1907. hooks[name] = hooks[name] || [];
  1908. hooks[name].push(callback);
  1909. },
  1910. run: function (name, env) {
  1911. var callbacks = _.hooks.all[name];
  1912. if (!callbacks || !callbacks.length) {
  1913. return;
  1914. }
  1915. for (var i=0, callback; callback = callbacks[i++];) {
  1916. callback(env);
  1917. }
  1918. }
  1919. },
  1920. Token: Token
  1921. };
  1922. _self.Prism = _;
  1923. function Token(type, content, alias, matchedStr, greedy) {
  1924. this.type = type;
  1925. this.content = content;
  1926. this.alias = alias;
  1927. // Copy of the full string this token was created from
  1928. this.length = (matchedStr || "").length|0;
  1929. this.greedy = !!greedy;
  1930. }
  1931. Token.stringify = function(o, language) {
  1932. if (typeof o == 'string') {
  1933. return o;
  1934. }
  1935. if (Array.isArray(o)) {
  1936. return o.map(function(element) {
  1937. return Token.stringify(element, language);
  1938. }).join('');
  1939. }
  1940. var env = {
  1941. type: o.type,
  1942. content: Token.stringify(o.content, language),
  1943. tag: 'span',
  1944. classes: ['token', o.type],
  1945. attributes: {},
  1946. language: language
  1947. };
  1948. if (o.alias) {
  1949. var aliases = Array.isArray(o.alias) ? o.alias : [o.alias];
  1950. Array.prototype.push.apply(env.classes, aliases);
  1951. }
  1952. _.hooks.run('wrap', env);
  1953. var attributes = Object.keys(env.attributes).map(function(name) {
  1954. return name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
  1955. }).join(' ');
  1956. return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + '</' + env.tag + '>';
  1957. };
  1958. if (!_self.document) {
  1959. if (!_self.addEventListener) {
  1960. // in Node.js
  1961. return _;
  1962. }
  1963. if (!_.disableWorkerMessageHandler) {
  1964. // In worker
  1965. _self.addEventListener('message', function (evt) {
  1966. var message = JSON.parse(evt.data),
  1967. lang = message.language,
  1968. code = message.code,
  1969. immediateClose = message.immediateClose;
  1970. _self.postMessage(_.highlight(code, _.languages[lang], lang));
  1971. if (immediateClose) {
  1972. _self.close();
  1973. }
  1974. }, false);
  1975. }
  1976. return _;
  1977. }
  1978. //Get current script and highlight
  1979. var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop();
  1980. if (script) {
  1981. _.filename = script.src;
  1982. if (!_.manual && !script.hasAttribute('data-manual')) {
  1983. if(document.readyState !== "loading") {
  1984. if (window.requestAnimationFrame) {
  1985. window.requestAnimationFrame(_.highlightAll);
  1986. } else {
  1987. window.setTimeout(_.highlightAll, 16);
  1988. }
  1989. }
  1990. else {
  1991. document.addEventListener('DOMContentLoaded', _.highlightAll);
  1992. }
  1993. }
  1994. }
  1995. return _;
  1996. })(_self);
  1997. if ('object' !== 'undefined' && module.exports) {
  1998. module.exports = Prism;
  1999. }
  2000. // hack for components to work correctly in node.js
  2001. if (typeof commonjsGlobal !== 'undefined') {
  2002. commonjsGlobal.Prism = Prism;
  2003. }
  2004. /* **********************************************
  2005. Begin prism-markup.js
  2006. ********************************************** */
  2007. Prism.languages.markup = {
  2008. 'comment': /<!--[\s\S]*?-->/,
  2009. 'prolog': /<\?[\s\S]+?\?>/,
  2010. 'doctype': /<!DOCTYPE[\s\S]+?>/i,
  2011. 'cdata': /<!\[CDATA\[[\s\S]*?]]>/i,
  2012. 'tag': {
  2013. pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,
  2014. greedy: true,
  2015. inside: {
  2016. 'tag': {
  2017. pattern: /^<\/?[^\s>\/]+/i,
  2018. inside: {
  2019. 'punctuation': /^<\/?/,
  2020. 'namespace': /^[^\s>\/:]+:/
  2021. }
  2022. },
  2023. 'attr-value': {
  2024. pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,
  2025. inside: {
  2026. 'punctuation': [
  2027. /^=/,
  2028. {
  2029. pattern: /^(\s*)["']|["']$/,
  2030. lookbehind: true
  2031. }
  2032. ]
  2033. }
  2034. },
  2035. 'punctuation': /\/?>/,
  2036. 'attr-name': {
  2037. pattern: /[^\s>\/]+/,
  2038. inside: {
  2039. 'namespace': /^[^\s>\/:]+:/
  2040. }
  2041. }
  2042. }
  2043. },
  2044. 'entity': /&#?[\da-z]{1,8};/i
  2045. };
  2046. Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
  2047. Prism.languages.markup['entity'];
  2048. // Plugin to make entity title show the real entity, idea by Roman Komarov
  2049. Prism.hooks.add('wrap', function(env) {
  2050. if (env.type === 'entity') {
  2051. env.attributes['title'] = env.content.replace(/&amp;/, '&');
  2052. }
  2053. });
  2054. Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
  2055. /**
  2056. * Adds an inlined language to markup.
  2057. *
  2058. * An example of an inlined language is CSS with `<style>` tags.
  2059. *
  2060. * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
  2061. * case insensitive.
  2062. * @param {string} lang The language key.
  2063. * @example
  2064. * addInlined('style', 'css');
  2065. */
  2066. value: function addInlined(tagName, lang) {
  2067. var includedCdataInside = {};
  2068. includedCdataInside['language-' + lang] = {
  2069. pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
  2070. lookbehind: true,
  2071. inside: Prism.languages[lang]
  2072. };
  2073. includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
  2074. var inside = {
  2075. 'included-cdata': {
  2076. pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
  2077. inside: includedCdataInside
  2078. }
  2079. };
  2080. inside['language-' + lang] = {
  2081. pattern: /[\s\S]+/,
  2082. inside: Prism.languages[lang]
  2083. };
  2084. var def = {};
  2085. def[tagName] = {
  2086. pattern: RegExp(/(<__[\s\S]*?>)(?:<!\[CDATA\[[\s\S]*?\]\]>\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g, tagName), 'i'),
  2087. lookbehind: true,
  2088. greedy: true,
  2089. inside: inside
  2090. };
  2091. Prism.languages.insertBefore('markup', 'cdata', def);
  2092. }
  2093. });
  2094. Prism.languages.xml = Prism.languages.extend('markup', {});
  2095. Prism.languages.html = Prism.languages.markup;
  2096. Prism.languages.mathml = Prism.languages.markup;
  2097. Prism.languages.svg = Prism.languages.markup;
  2098. /* **********************************************
  2099. Begin prism-css.js
  2100. ********************************************** */
  2101. (function (Prism) {
  2102. var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;
  2103. Prism.languages.css = {
  2104. 'comment': /\/\*[\s\S]*?\*\//,
  2105. 'atrule': {
  2106. pattern: /@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,
  2107. inside: {
  2108. 'rule': /@[\w-]+/
  2109. // See rest below
  2110. }
  2111. },
  2112. 'url': {
  2113. pattern: RegExp('url\\((?:' + string.source + '|[^\n\r()]*)\\)', 'i'),
  2114. inside: {
  2115. 'function': /^url/i,
  2116. 'punctuation': /^\(|\)$/
  2117. }
  2118. },
  2119. 'selector': RegExp('[^{}\\s](?:[^{};"\']|' + string.source + ')*?(?=\\s*\\{)'),
  2120. 'string': {
  2121. pattern: string,
  2122. greedy: true
  2123. },
  2124. 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
  2125. 'important': /!important\b/i,
  2126. 'function': /[-a-z0-9]+(?=\()/i,
  2127. 'punctuation': /[(){};:,]/
  2128. };
  2129. Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
  2130. var markup = Prism.languages.markup;
  2131. if (markup) {
  2132. markup.tag.addInlined('style', 'css');
  2133. Prism.languages.insertBefore('inside', 'attr-value', {
  2134. 'style-attr': {
  2135. pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,
  2136. inside: {
  2137. 'attr-name': {
  2138. pattern: /^\s*style/i,
  2139. inside: markup.tag.inside
  2140. },
  2141. 'punctuation': /^\s*=\s*['"]|['"]\s*$/,
  2142. 'attr-value': {
  2143. pattern: /.+/i,
  2144. inside: Prism.languages.css
  2145. }
  2146. },
  2147. alias: 'language-css'
  2148. }
  2149. }, markup.tag);
  2150. }
  2151. }(Prism));
  2152. /* **********************************************
  2153. Begin prism-clike.js
  2154. ********************************************** */
  2155. Prism.languages.clike = {
  2156. 'comment': [
  2157. {
  2158. pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
  2159. lookbehind: true
  2160. },
  2161. {
  2162. pattern: /(^|[^\\:])\/\/.*/,
  2163. lookbehind: true,
  2164. greedy: true
  2165. }
  2166. ],
  2167. 'string': {
  2168. pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
  2169. greedy: true
  2170. },
  2171. 'class-name': {
  2172. pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,
  2173. lookbehind: true,
  2174. inside: {
  2175. punctuation: /[.\\]/
  2176. }
  2177. },
  2178. 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
  2179. 'boolean': /\b(?:true|false)\b/,
  2180. 'function': /\w+(?=\()/,
  2181. 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,
  2182. 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
  2183. 'punctuation': /[{}[\];(),.:]/
  2184. };
  2185. /* **********************************************
  2186. Begin prism-javascript.js
  2187. ********************************************** */
  2188. Prism.languages.javascript = Prism.languages.extend('clike', {
  2189. 'class-name': [
  2190. Prism.languages.clike['class-name'],
  2191. {
  2192. pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,
  2193. lookbehind: true
  2194. }
  2195. ],
  2196. 'keyword': [
  2197. {
  2198. pattern: /((?:^|})\s*)(?:catch|finally)\b/,
  2199. lookbehind: true
  2200. },
  2201. {
  2202. pattern: /(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
  2203. lookbehind: true
  2204. },
  2205. ],
  2206. 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
  2207. // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
  2208. 'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
  2209. 'operator': /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/
  2210. });
  2211. Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
  2212. Prism.languages.insertBefore('javascript', 'keyword', {
  2213. 'regex': {
  2214. pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,
  2215. lookbehind: true,
  2216. greedy: true
  2217. },
  2218. // This must be declared before keyword because we use "function" inside the look-forward
  2219. 'function-variable': {
  2220. pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,
  2221. alias: 'function'
  2222. },
  2223. 'parameter': [
  2224. {
  2225. pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,
  2226. lookbehind: true,
  2227. inside: Prism.languages.javascript
  2228. },
  2229. {
  2230. pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,
  2231. inside: Prism.languages.javascript
  2232. },
  2233. {
  2234. pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,
  2235. lookbehind: true,
  2236. inside: Prism.languages.javascript
  2237. },
  2238. {
  2239. pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,
  2240. lookbehind: true,
  2241. inside: Prism.languages.javascript
  2242. }
  2243. ],
  2244. 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
  2245. });
  2246. Prism.languages.insertBefore('javascript', 'string', {
  2247. 'template-string': {
  2248. pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,
  2249. greedy: true,
  2250. inside: {
  2251. 'template-punctuation': {
  2252. pattern: /^`|`$/,
  2253. alias: 'string'
  2254. },
  2255. 'interpolation': {
  2256. pattern: /((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,
  2257. lookbehind: true,
  2258. inside: {
  2259. 'interpolation-punctuation': {
  2260. pattern: /^\${|}$/,
  2261. alias: 'punctuation'
  2262. },
  2263. rest: Prism.languages.javascript
  2264. }
  2265. },
  2266. 'string': /[\s\S]+/
  2267. }
  2268. }
  2269. });
  2270. if (Prism.languages.markup) {
  2271. Prism.languages.markup.tag.addInlined('script', 'javascript');
  2272. }
  2273. Prism.languages.js = Prism.languages.javascript;
  2274. /* **********************************************
  2275. Begin prism-file-highlight.js
  2276. ********************************************** */
  2277. (function () {
  2278. if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) {
  2279. return;
  2280. }
  2281. /**
  2282. * @param {Element} [container=document]
  2283. */
  2284. self.Prism.fileHighlight = function(container) {
  2285. container = container || document;
  2286. var Extensions = {
  2287. 'js': 'javascript',
  2288. 'py': 'python',
  2289. 'rb': 'ruby',
  2290. 'ps1': 'powershell',
  2291. 'psm1': 'powershell',
  2292. 'sh': 'bash',
  2293. 'bat': 'batch',
  2294. 'h': 'c',
  2295. 'tex': 'latex'
  2296. };
  2297. Array.prototype.slice.call(container.querySelectorAll('pre[data-src]')).forEach(function (pre) {
  2298. // ignore if already loaded
  2299. if (pre.hasAttribute('data-src-loaded')) {
  2300. return;
  2301. }
  2302. // load current
  2303. var src = pre.getAttribute('data-src');
  2304. var language, parent = pre;
  2305. var lang = /\blang(?:uage)?-([\w-]+)\b/i;
  2306. while (parent && !lang.test(parent.className)) {
  2307. parent = parent.parentNode;
  2308. }
  2309. if (parent) {
  2310. language = (pre.className.match(lang) || [, ''])[1];
  2311. }
  2312. if (!language) {
  2313. var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
  2314. language = Extensions[extension] || extension;
  2315. }
  2316. var code = document.createElement('code');
  2317. code.className = 'language-' + language;
  2318. pre.textContent = '';
  2319. code.textContent = 'Loading…';
  2320. pre.appendChild(code);
  2321. var xhr = new XMLHttpRequest();
  2322. xhr.open('GET', src, true);
  2323. xhr.onreadystatechange = function () {
  2324. if (xhr.readyState == 4) {
  2325. if (xhr.status < 400 && xhr.responseText) {
  2326. code.textContent = xhr.responseText;
  2327. Prism.highlightElement(code);
  2328. // mark as loaded
  2329. pre.setAttribute('data-src-loaded', '');
  2330. }
  2331. else if (xhr.status >= 400) {
  2332. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  2333. }
  2334. else {
  2335. code.textContent = '✖ Error: File does not exist or is empty';
  2336. }
  2337. }
  2338. };
  2339. xhr.send(null);
  2340. });
  2341. if (Prism.plugins.toolbar) {
  2342. Prism.plugins.toolbar.registerButton('download-file', function (env) {
  2343. var pre = env.element.parentNode;
  2344. if (!pre || !/pre/i.test(pre.nodeName) || !pre.hasAttribute('data-src') || !pre.hasAttribute('data-download-link')) {
  2345. return;
  2346. }
  2347. var src = pre.getAttribute('data-src');
  2348. var a = document.createElement('a');
  2349. a.textContent = pre.getAttribute('data-download-link-label') || 'Download';
  2350. a.setAttribute('download', '');
  2351. a.href = src;
  2352. return a;
  2353. });
  2354. }
  2355. };
  2356. document.addEventListener('DOMContentLoaded', function () {
  2357. // execute inside handler, for dropping Event as argument
  2358. self.Prism.fileHighlight();
  2359. });
  2360. })();
  2361. });
  2362. var marked = createCommonjsModule(function (module, exports) {
  2363. /**
  2364. * marked - a markdown parser
  2365. * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT Licensed)
  2366. * https://github.com/markedjs/marked
  2367. */
  2368. ;(function(root) {
  2369. 'use strict';
  2370. /**
  2371. * Block-Level Grammar
  2372. */
  2373. var block = {
  2374. newline: /^\n+/,
  2375. code: /^( {4}[^\n]+\n*)+/,
  2376. fences: /^ {0,3}(`{3,}|~{3,})([^`~\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
  2377. hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
  2378. heading: /^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
  2379. blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
  2380. list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
  2381. html: '^ {0,3}(?:' // optional indentation
  2382. + '<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
  2383. + '|comment[^\\n]*(\\n+|$)' // (2)
  2384. + '|<\\?[\\s\\S]*?\\?>\\n*' // (3)
  2385. + '|<![A-Z][\\s\\S]*?>\\n*' // (4)
  2386. + '|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*' // (5)
  2387. + '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)' // (6)
  2388. + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
  2389. + '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
  2390. + ')',
  2391. def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
  2392. nptable: noop,
  2393. table: noop,
  2394. lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
  2395. // regex template, placeholders will be replaced according to different paragraph
  2396. // interruption rules of commonmark and the original markdown spec:
  2397. _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,
  2398. text: /^[^\n]+/
  2399. };
  2400. block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
  2401. block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
  2402. block.def = edit(block.def)
  2403. .replace('label', block._label)
  2404. .replace('title', block._title)
  2405. .getRegex();
  2406. block.bullet = /(?:[*+-]|\d{1,9}\.)/;
  2407. block.item = /^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/;
  2408. block.item = edit(block.item, 'gm')
  2409. .replace(/bull/g, block.bullet)
  2410. .getRegex();
  2411. block.list = edit(block.list)
  2412. .replace(/bull/g, block.bullet)
  2413. .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
  2414. .replace('def', '\\n+(?=' + block.def.source + ')')
  2415. .getRegex();
  2416. block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
  2417. + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
  2418. + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
  2419. + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
  2420. + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
  2421. + '|track|ul';
  2422. block._comment = /<!--(?!-?>)[\s\S]*?-->/;
  2423. block.html = edit(block.html, 'i')
  2424. .replace('comment', block._comment)
  2425. .replace('tag', block._tag)
  2426. .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
  2427. .getRegex();
  2428. block.paragraph = edit(block._paragraph)
  2429. .replace('hr', block.hr)
  2430. .replace('heading', ' {0,3}#{1,6} +')
  2431. .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
  2432. .replace('blockquote', ' {0,3}>')
  2433. .replace('fences', ' {0,3}(?:`{3,}|~{3,})[^`\\n]*\\n')
  2434. .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
  2435. .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
  2436. .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
  2437. .getRegex();
  2438. block.blockquote = edit(block.blockquote)
  2439. .replace('paragraph', block.paragraph)
  2440. .getRegex();
  2441. /**
  2442. * Normal Block Grammar
  2443. */
  2444. block.normal = merge({}, block);
  2445. /**
  2446. * GFM Block Grammar
  2447. */
  2448. block.gfm = merge({}, block.normal, {
  2449. nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,
  2450. table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/
  2451. });
  2452. /**
  2453. * Pedantic grammar (original John Gruber's loose markdown specification)
  2454. */
  2455. block.pedantic = merge({}, block.normal, {
  2456. html: edit(
  2457. '^ *(?:comment *(?:\\n|\\s*$)'
  2458. + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
  2459. + '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
  2460. .replace('comment', block._comment)
  2461. .replace(/tag/g, '(?!(?:'
  2462. + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
  2463. + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'
  2464. + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
  2465. .getRegex(),
  2466. def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
  2467. heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
  2468. fences: noop, // fences not supported
  2469. paragraph: edit(block.normal._paragraph)
  2470. .replace('hr', block.hr)
  2471. .replace('heading', ' *#{1,6} *[^\n]')
  2472. .replace('lheading', block.lheading)
  2473. .replace('blockquote', ' {0,3}>')
  2474. .replace('|fences', '')
  2475. .replace('|list', '')
  2476. .replace('|html', '')
  2477. .getRegex()
  2478. });
  2479. /**
  2480. * Block Lexer
  2481. */
  2482. function Lexer(options) {
  2483. this.tokens = [];
  2484. this.tokens.links = Object.create(null);
  2485. this.options = options || marked.defaults;
  2486. this.rules = block.normal;
  2487. if (this.options.pedantic) {
  2488. this.rules = block.pedantic;
  2489. } else if (this.options.gfm) {
  2490. this.rules = block.gfm;
  2491. }
  2492. }
  2493. /**
  2494. * Expose Block Rules
  2495. */
  2496. Lexer.rules = block;
  2497. /**
  2498. * Static Lex Method
  2499. */
  2500. Lexer.lex = function(src, options) {
  2501. var lexer = new Lexer(options);
  2502. return lexer.lex(src);
  2503. };
  2504. /**
  2505. * Preprocessing
  2506. */
  2507. Lexer.prototype.lex = function(src) {
  2508. src = src
  2509. .replace(/\r\n|\r/g, '\n')
  2510. .replace(/\t/g, ' ')
  2511. .replace(/\u00a0/g, ' ')
  2512. .replace(/\u2424/g, '\n');
  2513. return this.token(src, true);
  2514. };
  2515. /**
  2516. * Lexing
  2517. */
  2518. Lexer.prototype.token = function(src, top) {
  2519. src = src.replace(/^ +$/gm, '');
  2520. var next,
  2521. loose,
  2522. cap,
  2523. bull,
  2524. b,
  2525. item,
  2526. listStart,
  2527. listItems,
  2528. t,
  2529. space,
  2530. i,
  2531. tag,
  2532. l,
  2533. isordered,
  2534. istask,
  2535. ischecked;
  2536. while (src) {
  2537. // newline
  2538. if (cap = this.rules.newline.exec(src)) {
  2539. src = src.substring(cap[0].length);
  2540. if (cap[0].length > 1) {
  2541. this.tokens.push({
  2542. type: 'space'
  2543. });
  2544. }
  2545. }
  2546. // code
  2547. if (cap = this.rules.code.exec(src)) {
  2548. var lastToken = this.tokens[this.tokens.length - 1];
  2549. src = src.substring(cap[0].length);
  2550. // An indented code block cannot interrupt a paragraph.
  2551. if (lastToken && lastToken.type === 'paragraph') {
  2552. lastToken.text += '\n' + cap[0].trimRight();
  2553. } else {
  2554. cap = cap[0].replace(/^ {4}/gm, '');
  2555. this.tokens.push({
  2556. type: 'code',
  2557. codeBlockStyle: 'indented',
  2558. text: !this.options.pedantic
  2559. ? rtrim(cap, '\n')
  2560. : cap
  2561. });
  2562. }
  2563. continue;
  2564. }
  2565. // fences
  2566. if (cap = this.rules.fences.exec(src)) {
  2567. src = src.substring(cap[0].length);
  2568. this.tokens.push({
  2569. type: 'code',
  2570. lang: cap[2] ? cap[2].trim() : cap[2],
  2571. text: cap[3] || ''
  2572. });
  2573. continue;
  2574. }
  2575. // heading
  2576. if (cap = this.rules.heading.exec(src)) {
  2577. src = src.substring(cap[0].length);
  2578. this.tokens.push({
  2579. type: 'heading',
  2580. depth: cap[1].length,
  2581. text: cap[2]
  2582. });
  2583. continue;
  2584. }
  2585. // table no leading pipe (gfm)
  2586. if (cap = this.rules.nptable.exec(src)) {
  2587. item = {
  2588. type: 'table',
  2589. header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
  2590. align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
  2591. cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
  2592. };
  2593. if (item.header.length === item.align.length) {
  2594. src = src.substring(cap[0].length);
  2595. for (i = 0; i < item.align.length; i++) {
  2596. if (/^ *-+: *$/.test(item.align[i])) {
  2597. item.align[i] = 'right';
  2598. } else if (/^ *:-+: *$/.test(item.align[i])) {
  2599. item.align[i] = 'center';
  2600. } else if (/^ *:-+ *$/.test(item.align[i])) {
  2601. item.align[i] = 'left';
  2602. } else {
  2603. item.align[i] = null;
  2604. }
  2605. }
  2606. for (i = 0; i < item.cells.length; i++) {
  2607. item.cells[i] = splitCells(item.cells[i], item.header.length);
  2608. }
  2609. this.tokens.push(item);
  2610. continue;
  2611. }
  2612. }
  2613. // hr
  2614. if (cap = this.rules.hr.exec(src)) {
  2615. src = src.substring(cap[0].length);
  2616. this.tokens.push({
  2617. type: 'hr'
  2618. });
  2619. continue;
  2620. }
  2621. // blockquote
  2622. if (cap = this.rules.blockquote.exec(src)) {
  2623. src = src.substring(cap[0].length);
  2624. this.tokens.push({
  2625. type: 'blockquote_start'
  2626. });
  2627. cap = cap[0].replace(/^ *> ?/gm, '');
  2628. // Pass `top` to keep the current
  2629. // "toplevel" state. This is exactly
  2630. // how markdown.pl works.
  2631. this.token(cap, top);
  2632. this.tokens.push({
  2633. type: 'blockquote_end'
  2634. });
  2635. continue;
  2636. }
  2637. // list
  2638. if (cap = this.rules.list.exec(src)) {
  2639. src = src.substring(cap[0].length);
  2640. bull = cap[2];
  2641. isordered = bull.length > 1;
  2642. listStart = {
  2643. type: 'list_start',
  2644. ordered: isordered,
  2645. start: isordered ? +bull : '',
  2646. loose: false
  2647. };
  2648. this.tokens.push(listStart);
  2649. // Get each top-level item.
  2650. cap = cap[0].match(this.rules.item);
  2651. listItems = [];
  2652. next = false;
  2653. l = cap.length;
  2654. i = 0;
  2655. for (; i < l; i++) {
  2656. item = cap[i];
  2657. // Remove the list item's bullet
  2658. // so it is seen as the next token.
  2659. space = item.length;
  2660. item = item.replace(/^ *([*+-]|\d+\.) */, '');
  2661. // Outdent whatever the
  2662. // list item contains. Hacky.
  2663. if (~item.indexOf('\n ')) {
  2664. space -= item.length;
  2665. item = !this.options.pedantic
  2666. ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
  2667. : item.replace(/^ {1,4}/gm, '');
  2668. }
  2669. // Determine whether the next list item belongs here.
  2670. // Backpedal if it does not belong in this list.
  2671. if (i !== l - 1) {
  2672. b = block.bullet.exec(cap[i + 1])[0];
  2673. if (bull.length > 1 ? b.length === 1
  2674. : (b.length > 1 || (this.options.smartLists && b !== bull))) {
  2675. src = cap.slice(i + 1).join('\n') + src;
  2676. i = l - 1;
  2677. }
  2678. }
  2679. // Determine whether item is loose or not.
  2680. // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
  2681. // for discount behavior.
  2682. loose = next || /\n\n(?!\s*$)/.test(item);
  2683. if (i !== l - 1) {
  2684. next = item.charAt(item.length - 1) === '\n';
  2685. if (!loose) loose = next;
  2686. }
  2687. if (loose) {
  2688. listStart.loose = true;
  2689. }
  2690. // Check for task list items
  2691. istask = /^\[[ xX]\] /.test(item);
  2692. ischecked = undefined;
  2693. if (istask) {
  2694. ischecked = item[1] !== ' ';
  2695. item = item.replace(/^\[[ xX]\] +/, '');
  2696. }
  2697. t = {
  2698. type: 'list_item_start',
  2699. task: istask,
  2700. checked: ischecked,
  2701. loose: loose
  2702. };
  2703. listItems.push(t);
  2704. this.tokens.push(t);
  2705. // Recurse.
  2706. this.token(item, false);
  2707. this.tokens.push({
  2708. type: 'list_item_end'
  2709. });
  2710. }
  2711. if (listStart.loose) {
  2712. l = listItems.length;
  2713. i = 0;
  2714. for (; i < l; i++) {
  2715. listItems[i].loose = true;
  2716. }
  2717. }
  2718. this.tokens.push({
  2719. type: 'list_end'
  2720. });
  2721. continue;
  2722. }
  2723. // html
  2724. if (cap = this.rules.html.exec(src)) {
  2725. src = src.substring(cap[0].length);
  2726. this.tokens.push({
  2727. type: this.options.sanitize
  2728. ? 'paragraph'
  2729. : 'html',
  2730. pre: !this.options.sanitizer
  2731. && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
  2732. text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]
  2733. });
  2734. continue;
  2735. }
  2736. // def
  2737. if (top && (cap = this.rules.def.exec(src))) {
  2738. src = src.substring(cap[0].length);
  2739. if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);
  2740. tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
  2741. if (!this.tokens.links[tag]) {
  2742. this.tokens.links[tag] = {
  2743. href: cap[2],
  2744. title: cap[3]
  2745. };
  2746. }
  2747. continue;
  2748. }
  2749. // table (gfm)
  2750. if (cap = this.rules.table.exec(src)) {
  2751. item = {
  2752. type: 'table',
  2753. header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
  2754. align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
  2755. cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
  2756. };
  2757. if (item.header.length === item.align.length) {
  2758. src = src.substring(cap[0].length);
  2759. for (i = 0; i < item.align.length; i++) {
  2760. if (/^ *-+: *$/.test(item.align[i])) {
  2761. item.align[i] = 'right';
  2762. } else if (/^ *:-+: *$/.test(item.align[i])) {
  2763. item.align[i] = 'center';
  2764. } else if (/^ *:-+ *$/.test(item.align[i])) {
  2765. item.align[i] = 'left';
  2766. } else {
  2767. item.align[i] = null;
  2768. }
  2769. }
  2770. for (i = 0; i < item.cells.length; i++) {
  2771. item.cells[i] = splitCells(
  2772. item.cells[i].replace(/^ *\| *| *\| *$/g, ''),
  2773. item.header.length);
  2774. }
  2775. this.tokens.push(item);
  2776. continue;
  2777. }
  2778. }
  2779. // lheading
  2780. if (cap = this.rules.lheading.exec(src)) {
  2781. src = src.substring(cap[0].length);
  2782. this.tokens.push({
  2783. type: 'heading',
  2784. depth: cap[2].charAt(0) === '=' ? 1 : 2,
  2785. text: cap[1]
  2786. });
  2787. continue;
  2788. }
  2789. // top-level paragraph
  2790. if (top && (cap = this.rules.paragraph.exec(src))) {
  2791. src = src.substring(cap[0].length);
  2792. this.tokens.push({
  2793. type: 'paragraph',
  2794. text: cap[1].charAt(cap[1].length - 1) === '\n'
  2795. ? cap[1].slice(0, -1)
  2796. : cap[1]
  2797. });
  2798. continue;
  2799. }
  2800. // text
  2801. if (cap = this.rules.text.exec(src)) {
  2802. // Top-level should never reach here.
  2803. src = src.substring(cap[0].length);
  2804. this.tokens.push({
  2805. type: 'text',
  2806. text: cap[0]
  2807. });
  2808. continue;
  2809. }
  2810. if (src) {
  2811. throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));
  2812. }
  2813. }
  2814. return this.tokens;
  2815. };
  2816. /**
  2817. * Inline-Level Grammar
  2818. */
  2819. var inline = {
  2820. escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
  2821. autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
  2822. url: noop,
  2823. tag: '^comment'
  2824. + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
  2825. + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
  2826. + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
  2827. + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
  2828. + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
  2829. link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
  2830. reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
  2831. nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
  2832. strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,
  2833. em: /^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,
  2834. code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
  2835. br: /^( {2,}|\\)\n(?!\s*$)/,
  2836. del: noop,
  2837. text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/
  2838. };
  2839. // list of punctuation marks from common mark spec
  2840. // without ` and ] to workaround Rule 17 (inline code blocks/links)
  2841. inline._punctuation = '!"#$%&\'()*+,\\-./:;<=>?@\\[^_{|}~';
  2842. inline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex();
  2843. inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
  2844. inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
  2845. inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
  2846. inline.autolink = edit(inline.autolink)
  2847. .replace('scheme', inline._scheme)
  2848. .replace('email', inline._email)
  2849. .getRegex();
  2850. inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
  2851. inline.tag = edit(inline.tag)
  2852. .replace('comment', block._comment)
  2853. .replace('attribute', inline._attribute)
  2854. .getRegex();
  2855. inline._label = /(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
  2856. inline._href = /<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/;
  2857. inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
  2858. inline.link = edit(inline.link)
  2859. .replace('label', inline._label)
  2860. .replace('href', inline._href)
  2861. .replace('title', inline._title)
  2862. .getRegex();
  2863. inline.reflink = edit(inline.reflink)
  2864. .replace('label', inline._label)
  2865. .getRegex();
  2866. /**
  2867. * Normal Inline Grammar
  2868. */
  2869. inline.normal = merge({}, inline);
  2870. /**
  2871. * Pedantic Inline Grammar
  2872. */
  2873. inline.pedantic = merge({}, inline.normal, {
  2874. strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
  2875. em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,
  2876. link: edit(/^!?\[(label)\]\((.*?)\)/)
  2877. .replace('label', inline._label)
  2878. .getRegex(),
  2879. reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/)
  2880. .replace('label', inline._label)
  2881. .getRegex()
  2882. });
  2883. /**
  2884. * GFM Inline Grammar
  2885. */
  2886. inline.gfm = merge({}, inline.normal, {
  2887. escape: edit(inline.escape).replace('])', '~|])').getRegex(),
  2888. _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
  2889. url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
  2890. _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
  2891. del: /^~+(?=\S)([\s\S]*?\S)~+/,
  2892. text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/
  2893. });
  2894. inline.gfm.url = edit(inline.gfm.url, 'i')
  2895. .replace('email', inline.gfm._extended_email)
  2896. .getRegex();
  2897. /**
  2898. * GFM + Line Breaks Inline Grammar
  2899. */
  2900. inline.breaks = merge({}, inline.gfm, {
  2901. br: edit(inline.br).replace('{2,}', '*').getRegex(),
  2902. text: edit(inline.gfm.text)
  2903. .replace('\\b_', '\\b_| {2,}\\n')
  2904. .replace(/\{2,\}/g, '*')
  2905. .getRegex()
  2906. });
  2907. /**
  2908. * Inline Lexer & Compiler
  2909. */
  2910. function InlineLexer(links, options) {
  2911. this.options = options || marked.defaults;
  2912. this.links = links;
  2913. this.rules = inline.normal;
  2914. this.renderer = this.options.renderer || new Renderer();
  2915. this.renderer.options = this.options;
  2916. if (!this.links) {
  2917. throw new Error('Tokens array requires a `links` property.');
  2918. }
  2919. if (this.options.pedantic) {
  2920. this.rules = inline.pedantic;
  2921. } else if (this.options.gfm) {
  2922. if (this.options.breaks) {
  2923. this.rules = inline.breaks;
  2924. } else {
  2925. this.rules = inline.gfm;
  2926. }
  2927. }
  2928. }
  2929. /**
  2930. * Expose Inline Rules
  2931. */
  2932. InlineLexer.rules = inline;
  2933. /**
  2934. * Static Lexing/Compiling Method
  2935. */
  2936. InlineLexer.output = function(src, links, options) {
  2937. var inline = new InlineLexer(links, options);
  2938. return inline.output(src);
  2939. };
  2940. /**
  2941. * Lexing/Compiling
  2942. */
  2943. InlineLexer.prototype.output = function(src) {
  2944. var out = '',
  2945. link,
  2946. text,
  2947. href,
  2948. title,
  2949. cap,
  2950. prevCapZero;
  2951. while (src) {
  2952. // escape
  2953. if (cap = this.rules.escape.exec(src)) {
  2954. src = src.substring(cap[0].length);
  2955. out += escape(cap[1]);
  2956. continue;
  2957. }
  2958. // tag
  2959. if (cap = this.rules.tag.exec(src)) {
  2960. if (!this.inLink && /^<a /i.test(cap[0])) {
  2961. this.inLink = true;
  2962. } else if (this.inLink && /^<\/a>/i.test(cap[0])) {
  2963. this.inLink = false;
  2964. }
  2965. if (!this.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
  2966. this.inRawBlock = true;
  2967. } else if (this.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
  2968. this.inRawBlock = false;
  2969. }
  2970. src = src.substring(cap[0].length);
  2971. out += this.options.sanitize
  2972. ? this.options.sanitizer
  2973. ? this.options.sanitizer(cap[0])
  2974. : escape(cap[0])
  2975. : cap[0];
  2976. continue;
  2977. }
  2978. // link
  2979. if (cap = this.rules.link.exec(src)) {
  2980. var lastParenIndex = findClosingBracket(cap[2], '()');
  2981. if (lastParenIndex > -1) {
  2982. var linkLen = 4 + cap[1].length + lastParenIndex;
  2983. cap[2] = cap[2].substring(0, lastParenIndex);
  2984. cap[0] = cap[0].substring(0, linkLen).trim();
  2985. cap[3] = '';
  2986. }
  2987. src = src.substring(cap[0].length);
  2988. this.inLink = true;
  2989. href = cap[2];
  2990. if (this.options.pedantic) {
  2991. link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
  2992. if (link) {
  2993. href = link[1];
  2994. title = link[3];
  2995. } else {
  2996. title = '';
  2997. }
  2998. } else {
  2999. title = cap[3] ? cap[3].slice(1, -1) : '';
  3000. }
  3001. href = href.trim().replace(/^<([\s\S]*)>$/, '$1');
  3002. out += this.outputLink(cap, {
  3003. href: InlineLexer.escapes(href),
  3004. title: InlineLexer.escapes(title)
  3005. });
  3006. this.inLink = false;
  3007. continue;
  3008. }
  3009. // reflink, nolink
  3010. if ((cap = this.rules.reflink.exec(src))
  3011. || (cap = this.rules.nolink.exec(src))) {
  3012. src = src.substring(cap[0].length);
  3013. link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
  3014. link = this.links[link.toLowerCase()];
  3015. if (!link || !link.href) {
  3016. out += cap[0].charAt(0);
  3017. src = cap[0].substring(1) + src;
  3018. continue;
  3019. }
  3020. this.inLink = true;
  3021. out += this.outputLink(cap, link);
  3022. this.inLink = false;
  3023. continue;
  3024. }
  3025. // strong
  3026. if (cap = this.rules.strong.exec(src)) {
  3027. src = src.substring(cap[0].length);
  3028. out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1]));
  3029. continue;
  3030. }
  3031. // em
  3032. if (cap = this.rules.em.exec(src)) {
  3033. src = src.substring(cap[0].length);
  3034. out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1]));
  3035. continue;
  3036. }
  3037. // code
  3038. if (cap = this.rules.code.exec(src)) {
  3039. src = src.substring(cap[0].length);
  3040. out += this.renderer.codespan(escape(cap[2].trim(), true));
  3041. continue;
  3042. }
  3043. // br
  3044. if (cap = this.rules.br.exec(src)) {
  3045. src = src.substring(cap[0].length);
  3046. out += this.renderer.br();
  3047. continue;
  3048. }
  3049. // del (gfm)
  3050. if (cap = this.rules.del.exec(src)) {
  3051. src = src.substring(cap[0].length);
  3052. out += this.renderer.del(this.output(cap[1]));
  3053. continue;
  3054. }
  3055. // autolink
  3056. if (cap = this.rules.autolink.exec(src)) {
  3057. src = src.substring(cap[0].length);
  3058. if (cap[2] === '@') {
  3059. text = escape(this.mangle(cap[1]));
  3060. href = 'mailto:' + text;
  3061. } else {
  3062. text = escape(cap[1]);
  3063. href = text;
  3064. }
  3065. out += this.renderer.link(href, null, text);
  3066. continue;
  3067. }
  3068. // url (gfm)
  3069. if (!this.inLink && (cap = this.rules.url.exec(src))) {
  3070. if (cap[2] === '@') {
  3071. text = escape(cap[0]);
  3072. href = 'mailto:' + text;
  3073. } else {
  3074. // do extended autolink path validation
  3075. do {
  3076. prevCapZero = cap[0];
  3077. cap[0] = this.rules._backpedal.exec(cap[0])[0];
  3078. } while (prevCapZero !== cap[0]);
  3079. text = escape(cap[0]);
  3080. if (cap[1] === 'www.') {
  3081. href = 'http://' + text;
  3082. } else {
  3083. href = text;
  3084. }
  3085. }
  3086. src = src.substring(cap[0].length);
  3087. out += this.renderer.link(href, null, text);
  3088. continue;
  3089. }
  3090. // text
  3091. if (cap = this.rules.text.exec(src)) {
  3092. src = src.substring(cap[0].length);
  3093. if (this.inRawBlock) {
  3094. out += this.renderer.text(this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]);
  3095. } else {
  3096. out += this.renderer.text(escape(this.smartypants(cap[0])));
  3097. }
  3098. continue;
  3099. }
  3100. if (src) {
  3101. throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));
  3102. }
  3103. }
  3104. return out;
  3105. };
  3106. InlineLexer.escapes = function(text) {
  3107. return text ? text.replace(InlineLexer.rules._escapes, '$1') : text;
  3108. };
  3109. /**
  3110. * Compile Link
  3111. */
  3112. InlineLexer.prototype.outputLink = function(cap, link) {
  3113. var href = link.href,
  3114. title = link.title ? escape(link.title) : null;
  3115. return cap[0].charAt(0) !== '!'
  3116. ? this.renderer.link(href, title, this.output(cap[1]))
  3117. : this.renderer.image(href, title, escape(cap[1]));
  3118. };
  3119. /**
  3120. * Smartypants Transformations
  3121. */
  3122. InlineLexer.prototype.smartypants = function(text) {
  3123. if (!this.options.smartypants) return text;
  3124. return text
  3125. // em-dashes
  3126. .replace(/---/g, '\u2014')
  3127. // en-dashes
  3128. .replace(/--/g, '\u2013')
  3129. // opening singles
  3130. .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
  3131. // closing singles & apostrophes
  3132. .replace(/'/g, '\u2019')
  3133. // opening doubles
  3134. .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
  3135. // closing doubles
  3136. .replace(/"/g, '\u201d')
  3137. // ellipses
  3138. .replace(/\.{3}/g, '\u2026');
  3139. };
  3140. /**
  3141. * Mangle Links
  3142. */
  3143. InlineLexer.prototype.mangle = function(text) {
  3144. if (!this.options.mangle) return text;
  3145. var out = '',
  3146. l = text.length,
  3147. i = 0,
  3148. ch;
  3149. for (; i < l; i++) {
  3150. ch = text.charCodeAt(i);
  3151. if (Math.random() > 0.5) {
  3152. ch = 'x' + ch.toString(16);
  3153. }
  3154. out += '&#' + ch + ';';
  3155. }
  3156. return out;
  3157. };
  3158. /**
  3159. * Renderer
  3160. */
  3161. function Renderer(options) {
  3162. this.options = options || marked.defaults;
  3163. }
  3164. Renderer.prototype.code = function(code, infostring, escaped) {
  3165. var lang = (infostring || '').match(/\S*/)[0];
  3166. if (this.options.highlight) {
  3167. var out = this.options.highlight(code, lang);
  3168. if (out != null && out !== code) {
  3169. escaped = true;
  3170. code = out;
  3171. }
  3172. }
  3173. if (!lang) {
  3174. return '<pre><code>'
  3175. + (escaped ? code : escape(code, true))
  3176. + '</code></pre>';
  3177. }
  3178. return '<pre><code class="'
  3179. + this.options.langPrefix
  3180. + escape(lang, true)
  3181. + '">'
  3182. + (escaped ? code : escape(code, true))
  3183. + '</code></pre>\n';
  3184. };
  3185. Renderer.prototype.blockquote = function(quote) {
  3186. return '<blockquote>\n' + quote + '</blockquote>\n';
  3187. };
  3188. Renderer.prototype.html = function(html) {
  3189. return html;
  3190. };
  3191. Renderer.prototype.heading = function(text, level, raw, slugger) {
  3192. if (this.options.headerIds) {
  3193. return '<h'
  3194. + level
  3195. + ' id="'
  3196. + this.options.headerPrefix
  3197. + slugger.slug(raw)
  3198. + '">'
  3199. + text
  3200. + '</h'
  3201. + level
  3202. + '>\n';
  3203. }
  3204. // ignore IDs
  3205. return '<h' + level + '>' + text + '</h' + level + '>\n';
  3206. };
  3207. Renderer.prototype.hr = function() {
  3208. return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
  3209. };
  3210. Renderer.prototype.list = function(body, ordered, start) {
  3211. var type = ordered ? 'ol' : 'ul',
  3212. startatt = (ordered && start !== 1) ? (' start="' + start + '"') : '';
  3213. return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
  3214. };
  3215. Renderer.prototype.listitem = function(text) {
  3216. return '<li>' + text + '</li>\n';
  3217. };
  3218. Renderer.prototype.checkbox = function(checked) {
  3219. return '<input '
  3220. + (checked ? 'checked="" ' : '')
  3221. + 'disabled="" type="checkbox"'
  3222. + (this.options.xhtml ? ' /' : '')
  3223. + '> ';
  3224. };
  3225. Renderer.prototype.paragraph = function(text) {
  3226. return '<p>' + text + '</p>\n';
  3227. };
  3228. Renderer.prototype.table = function(header, body) {
  3229. if (body) body = '<tbody>' + body + '</tbody>';
  3230. return '<table>\n'
  3231. + '<thead>\n'
  3232. + header
  3233. + '</thead>\n'
  3234. + body
  3235. + '</table>\n';
  3236. };
  3237. Renderer.prototype.tablerow = function(content) {
  3238. return '<tr>\n' + content + '</tr>\n';
  3239. };
  3240. Renderer.prototype.tablecell = function(content, flags) {
  3241. var type = flags.header ? 'th' : 'td';
  3242. var tag = flags.align
  3243. ? '<' + type + ' align="' + flags.align + '">'
  3244. : '<' + type + '>';
  3245. return tag + content + '</' + type + '>\n';
  3246. };
  3247. // span level renderer
  3248. Renderer.prototype.strong = function(text) {
  3249. return '<strong>' + text + '</strong>';
  3250. };
  3251. Renderer.prototype.em = function(text) {
  3252. return '<em>' + text + '</em>';
  3253. };
  3254. Renderer.prototype.codespan = function(text) {
  3255. return '<code>' + text + '</code>';
  3256. };
  3257. Renderer.prototype.br = function() {
  3258. return this.options.xhtml ? '<br/>' : '<br>';
  3259. };
  3260. Renderer.prototype.del = function(text) {
  3261. return '<del>' + text + '</del>';
  3262. };
  3263. Renderer.prototype.link = function(href, title, text) {
  3264. href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
  3265. if (href === null) {
  3266. return text;
  3267. }
  3268. var out = '<a href="' + escape(href) + '"';
  3269. if (title) {
  3270. out += ' title="' + title + '"';
  3271. }
  3272. out += '>' + text + '</a>';
  3273. return out;
  3274. };
  3275. Renderer.prototype.image = function(href, title, text) {
  3276. href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
  3277. if (href === null) {
  3278. return text;
  3279. }
  3280. var out = '<img src="' + href + '" alt="' + text + '"';
  3281. if (title) {
  3282. out += ' title="' + title + '"';
  3283. }
  3284. out += this.options.xhtml ? '/>' : '>';
  3285. return out;
  3286. };
  3287. Renderer.prototype.text = function(text) {
  3288. return text;
  3289. };
  3290. /**
  3291. * TextRenderer
  3292. * returns only the textual part of the token
  3293. */
  3294. function TextRenderer() {}
  3295. // no need for block level renderers
  3296. TextRenderer.prototype.strong =
  3297. TextRenderer.prototype.em =
  3298. TextRenderer.prototype.codespan =
  3299. TextRenderer.prototype.del =
  3300. TextRenderer.prototype.text = function(text) {
  3301. return text;
  3302. };
  3303. TextRenderer.prototype.link =
  3304. TextRenderer.prototype.image = function(href, title, text) {
  3305. return '' + text;
  3306. };
  3307. TextRenderer.prototype.br = function() {
  3308. return '';
  3309. };
  3310. /**
  3311. * Parsing & Compiling
  3312. */
  3313. function Parser(options) {
  3314. this.tokens = [];
  3315. this.token = null;
  3316. this.options = options || marked.defaults;
  3317. this.options.renderer = this.options.renderer || new Renderer();
  3318. this.renderer = this.options.renderer;
  3319. this.renderer.options = this.options;
  3320. this.slugger = new Slugger();
  3321. }
  3322. /**
  3323. * Static Parse Method
  3324. */
  3325. Parser.parse = function(src, options) {
  3326. var parser = new Parser(options);
  3327. return parser.parse(src);
  3328. };
  3329. /**
  3330. * Parse Loop
  3331. */
  3332. Parser.prototype.parse = function(src) {
  3333. this.inline = new InlineLexer(src.links, this.options);
  3334. // use an InlineLexer with a TextRenderer to extract pure text
  3335. this.inlineText = new InlineLexer(
  3336. src.links,
  3337. merge({}, this.options, { renderer: new TextRenderer() })
  3338. );
  3339. this.tokens = src.reverse();
  3340. var out = '';
  3341. while (this.next()) {
  3342. out += this.tok();
  3343. }
  3344. return out;
  3345. };
  3346. /**
  3347. * Next Token
  3348. */
  3349. Parser.prototype.next = function() {
  3350. this.token = this.tokens.pop();
  3351. return this.token;
  3352. };
  3353. /**
  3354. * Preview Next Token
  3355. */
  3356. Parser.prototype.peek = function() {
  3357. return this.tokens[this.tokens.length - 1] || 0;
  3358. };
  3359. /**
  3360. * Parse Text Tokens
  3361. */
  3362. Parser.prototype.parseText = function() {
  3363. var body = this.token.text;
  3364. while (this.peek().type === 'text') {
  3365. body += '\n' + this.next().text;
  3366. }
  3367. return this.inline.output(body);
  3368. };
  3369. /**
  3370. * Parse Current Token
  3371. */
  3372. Parser.prototype.tok = function() {
  3373. switch (this.token.type) {
  3374. case 'space': {
  3375. return '';
  3376. }
  3377. case 'hr': {
  3378. return this.renderer.hr();
  3379. }
  3380. case 'heading': {
  3381. return this.renderer.heading(
  3382. this.inline.output(this.token.text),
  3383. this.token.depth,
  3384. unescape(this.inlineText.output(this.token.text)),
  3385. this.slugger);
  3386. }
  3387. case 'code': {
  3388. return this.renderer.code(this.token.text,
  3389. this.token.lang,
  3390. this.token.escaped);
  3391. }
  3392. case 'table': {
  3393. var header = '',
  3394. body = '',
  3395. i,
  3396. row,
  3397. cell,
  3398. j;
  3399. // header
  3400. cell = '';
  3401. for (i = 0; i < this.token.header.length; i++) {
  3402. cell += this.renderer.tablecell(
  3403. this.inline.output(this.token.header[i]),
  3404. { header: true, align: this.token.align[i] }
  3405. );
  3406. }
  3407. header += this.renderer.tablerow(cell);
  3408. for (i = 0; i < this.token.cells.length; i++) {
  3409. row = this.token.cells[i];
  3410. cell = '';
  3411. for (j = 0; j < row.length; j++) {
  3412. cell += this.renderer.tablecell(
  3413. this.inline.output(row[j]),
  3414. { header: false, align: this.token.align[j] }
  3415. );
  3416. }
  3417. body += this.renderer.tablerow(cell);
  3418. }
  3419. return this.renderer.table(header, body);
  3420. }
  3421. case 'blockquote_start': {
  3422. body = '';
  3423. while (this.next().type !== 'blockquote_end') {
  3424. body += this.tok();
  3425. }
  3426. return this.renderer.blockquote(body);
  3427. }
  3428. case 'list_start': {
  3429. body = '';
  3430. var ordered = this.token.ordered,
  3431. start = this.token.start;
  3432. while (this.next().type !== 'list_end') {
  3433. body += this.tok();
  3434. }
  3435. return this.renderer.list(body, ordered, start);
  3436. }
  3437. case 'list_item_start': {
  3438. body = '';
  3439. var loose = this.token.loose;
  3440. var checked = this.token.checked;
  3441. var task = this.token.task;
  3442. if (this.token.task) {
  3443. body += this.renderer.checkbox(checked);
  3444. }
  3445. while (this.next().type !== 'list_item_end') {
  3446. body += !loose && this.token.type === 'text'
  3447. ? this.parseText()
  3448. : this.tok();
  3449. }
  3450. return this.renderer.listitem(body, task, checked);
  3451. }
  3452. case 'html': {
  3453. // TODO parse inline content if parameter markdown=1
  3454. return this.renderer.html(this.token.text);
  3455. }
  3456. case 'paragraph': {
  3457. return this.renderer.paragraph(this.inline.output(this.token.text));
  3458. }
  3459. case 'text': {
  3460. return this.renderer.paragraph(this.parseText());
  3461. }
  3462. default: {
  3463. var errMsg = 'Token with "' + this.token.type + '" type was not found.';
  3464. if (this.options.silent) {
  3465. console.log(errMsg);
  3466. } else {
  3467. throw new Error(errMsg);
  3468. }
  3469. }
  3470. }
  3471. };
  3472. /**
  3473. * Slugger generates header id
  3474. */
  3475. function Slugger() {
  3476. this.seen = {};
  3477. }
  3478. /**
  3479. * Convert string to unique id
  3480. */
  3481. Slugger.prototype.slug = function(value) {
  3482. var slug = value
  3483. .toLowerCase()
  3484. .trim()
  3485. .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '')
  3486. .replace(/\s/g, '-');
  3487. if (this.seen.hasOwnProperty(slug)) {
  3488. var originalSlug = slug;
  3489. do {
  3490. this.seen[originalSlug]++;
  3491. slug = originalSlug + '-' + this.seen[originalSlug];
  3492. } while (this.seen.hasOwnProperty(slug));
  3493. }
  3494. this.seen[slug] = 0;
  3495. return slug;
  3496. };
  3497. /**
  3498. * Helpers
  3499. */
  3500. function escape(html, encode) {
  3501. if (encode) {
  3502. if (escape.escapeTest.test(html)) {
  3503. return html.replace(escape.escapeReplace, function(ch) { return escape.replacements[ch]; });
  3504. }
  3505. } else {
  3506. if (escape.escapeTestNoEncode.test(html)) {
  3507. return html.replace(escape.escapeReplaceNoEncode, function(ch) { return escape.replacements[ch]; });
  3508. }
  3509. }
  3510. return html;
  3511. }
  3512. escape.escapeTest = /[&<>"']/;
  3513. escape.escapeReplace = /[&<>"']/g;
  3514. escape.replacements = {
  3515. '&': '&amp;',
  3516. '<': '&lt;',
  3517. '>': '&gt;',
  3518. '"': '&quot;',
  3519. "'": '&#39;'
  3520. };
  3521. escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/;
  3522. escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g;
  3523. function unescape(html) {
  3524. // explicitly match decimal, hex, and named HTML entities
  3525. return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) {
  3526. n = n.toLowerCase();
  3527. if (n === 'colon') return ':';
  3528. if (n.charAt(0) === '#') {
  3529. return n.charAt(1) === 'x'
  3530. ? String.fromCharCode(parseInt(n.substring(2), 16))
  3531. : String.fromCharCode(+n.substring(1));
  3532. }
  3533. return '';
  3534. });
  3535. }
  3536. function edit(regex, opt) {
  3537. regex = regex.source || regex;
  3538. opt = opt || '';
  3539. return {
  3540. replace: function(name, val) {
  3541. val = val.source || val;
  3542. val = val.replace(/(^|[^\[])\^/g, '$1');
  3543. regex = regex.replace(name, val);
  3544. return this;
  3545. },
  3546. getRegex: function() {
  3547. return new RegExp(regex, opt);
  3548. }
  3549. };
  3550. }
  3551. function cleanUrl(sanitize, base, href) {
  3552. if (sanitize) {
  3553. try {
  3554. var prot = decodeURIComponent(unescape(href))
  3555. .replace(/[^\w:]/g, '')
  3556. .toLowerCase();
  3557. } catch (e) {
  3558. return null;
  3559. }
  3560. if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
  3561. return null;
  3562. }
  3563. }
  3564. if (base && !originIndependentUrl.test(href)) {
  3565. href = resolveUrl(base, href);
  3566. }
  3567. try {
  3568. href = encodeURI(href).replace(/%25/g, '%');
  3569. } catch (e) {
  3570. return null;
  3571. }
  3572. return href;
  3573. }
  3574. function resolveUrl(base, href) {
  3575. if (!baseUrls[' ' + base]) {
  3576. // we can ignore everything in base after the last slash of its path component,
  3577. // but we might need to add _that_
  3578. // https://tools.ietf.org/html/rfc3986#section-3
  3579. if (/^[^:]+:\/*[^/]*$/.test(base)) {
  3580. baseUrls[' ' + base] = base + '/';
  3581. } else {
  3582. baseUrls[' ' + base] = rtrim(base, '/', true);
  3583. }
  3584. }
  3585. base = baseUrls[' ' + base];
  3586. if (href.slice(0, 2) === '//') {
  3587. return base.replace(/:[\s\S]*/, ':') + href;
  3588. } else if (href.charAt(0) === '/') {
  3589. return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href;
  3590. } else {
  3591. return base + href;
  3592. }
  3593. }
  3594. var baseUrls = {};
  3595. var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
  3596. function noop() {}
  3597. noop.exec = noop;
  3598. function merge(obj) {
  3599. var i = 1,
  3600. target,
  3601. key;
  3602. for (; i < arguments.length; i++) {
  3603. target = arguments[i];
  3604. for (key in target) {
  3605. if (Object.prototype.hasOwnProperty.call(target, key)) {
  3606. obj[key] = target[key];
  3607. }
  3608. }
  3609. }
  3610. return obj;
  3611. }
  3612. function splitCells(tableRow, count) {
  3613. // ensure that every cell-delimiting pipe has a space
  3614. // before it to distinguish it from an escaped pipe
  3615. var row = tableRow.replace(/\|/g, function(match, offset, str) {
  3616. var escaped = false,
  3617. curr = offset;
  3618. while (--curr >= 0 && str[curr] === '\\') escaped = !escaped;
  3619. if (escaped) {
  3620. // odd number of slashes means | is escaped
  3621. // so we leave it alone
  3622. return '|';
  3623. } else {
  3624. // add space before unescaped |
  3625. return ' |';
  3626. }
  3627. }),
  3628. cells = row.split(/ \|/),
  3629. i = 0;
  3630. if (cells.length > count) {
  3631. cells.splice(count);
  3632. } else {
  3633. while (cells.length < count) cells.push('');
  3634. }
  3635. for (; i < cells.length; i++) {
  3636. // leading or trailing whitespace is ignored per the gfm spec
  3637. cells[i] = cells[i].trim().replace(/\\\|/g, '|');
  3638. }
  3639. return cells;
  3640. }
  3641. // Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
  3642. // /c*$/ is vulnerable to REDOS.
  3643. // invert: Remove suffix of non-c chars instead. Default falsey.
  3644. function rtrim(str, c, invert) {
  3645. if (str.length === 0) {
  3646. return '';
  3647. }
  3648. // Length of suffix matching the invert condition.
  3649. var suffLen = 0;
  3650. // Step left until we fail to match the invert condition.
  3651. while (suffLen < str.length) {
  3652. var currChar = str.charAt(str.length - suffLen - 1);
  3653. if (currChar === c && !invert) {
  3654. suffLen++;
  3655. } else if (currChar !== c && invert) {
  3656. suffLen++;
  3657. } else {
  3658. break;
  3659. }
  3660. }
  3661. return str.substr(0, str.length - suffLen);
  3662. }
  3663. function findClosingBracket(str, b) {
  3664. if (str.indexOf(b[1]) === -1) {
  3665. return -1;
  3666. }
  3667. var level = 0;
  3668. for (var i = 0; i < str.length; i++) {
  3669. if (str[i] === '\\') {
  3670. i++;
  3671. } else if (str[i] === b[0]) {
  3672. level++;
  3673. } else if (str[i] === b[1]) {
  3674. level--;
  3675. if (level < 0) {
  3676. return i;
  3677. }
  3678. }
  3679. }
  3680. return -1;
  3681. }
  3682. function checkSanitizeDeprecation(opt) {
  3683. if (opt && opt.sanitize && !opt.silent) {
  3684. console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
  3685. }
  3686. }
  3687. /**
  3688. * Marked
  3689. */
  3690. function marked(src, opt, callback) {
  3691. // throw error in case of non string input
  3692. if (typeof src === 'undefined' || src === null) {
  3693. throw new Error('marked(): input parameter is undefined or null');
  3694. }
  3695. if (typeof src !== 'string') {
  3696. throw new Error('marked(): input parameter is of type '
  3697. + Object.prototype.toString.call(src) + ', string expected');
  3698. }
  3699. if (callback || typeof opt === 'function') {
  3700. if (!callback) {
  3701. callback = opt;
  3702. opt = null;
  3703. }
  3704. opt = merge({}, marked.defaults, opt || {});
  3705. checkSanitizeDeprecation(opt);
  3706. var highlight = opt.highlight,
  3707. tokens,
  3708. pending,
  3709. i = 0;
  3710. try {
  3711. tokens = Lexer.lex(src, opt);
  3712. } catch (e) {
  3713. return callback(e);
  3714. }
  3715. pending = tokens.length;
  3716. var done = function(err) {
  3717. if (err) {
  3718. opt.highlight = highlight;
  3719. return callback(err);
  3720. }
  3721. var out;
  3722. try {
  3723. out = Parser.parse(tokens, opt);
  3724. } catch (e) {
  3725. err = e;
  3726. }
  3727. opt.highlight = highlight;
  3728. return err
  3729. ? callback(err)
  3730. : callback(null, out);
  3731. };
  3732. if (!highlight || highlight.length < 3) {
  3733. return done();
  3734. }
  3735. delete opt.highlight;
  3736. if (!pending) return done();
  3737. for (; i < tokens.length; i++) {
  3738. (function(token) {
  3739. if (token.type !== 'code') {
  3740. return --pending || done();
  3741. }
  3742. return highlight(token.text, token.lang, function(err, code) {
  3743. if (err) return done(err);
  3744. if (code == null || code === token.text) {
  3745. return --pending || done();
  3746. }
  3747. token.text = code;
  3748. token.escaped = true;
  3749. --pending || done();
  3750. });
  3751. })(tokens[i]);
  3752. }
  3753. return;
  3754. }
  3755. try {
  3756. if (opt) opt = merge({}, marked.defaults, opt);
  3757. checkSanitizeDeprecation(opt);
  3758. return Parser.parse(Lexer.lex(src, opt), opt);
  3759. } catch (e) {
  3760. e.message += '\nPlease report this to https://github.com/markedjs/marked.';
  3761. if ((opt || marked.defaults).silent) {
  3762. return '<p>An error occurred:</p><pre>'
  3763. + escape(e.message + '', true)
  3764. + '</pre>';
  3765. }
  3766. throw e;
  3767. }
  3768. }
  3769. /**
  3770. * Options
  3771. */
  3772. marked.options =
  3773. marked.setOptions = function(opt) {
  3774. merge(marked.defaults, opt);
  3775. return marked;
  3776. };
  3777. marked.getDefaults = function() {
  3778. return {
  3779. baseUrl: null,
  3780. breaks: false,
  3781. gfm: true,
  3782. headerIds: true,
  3783. headerPrefix: '',
  3784. highlight: null,
  3785. langPrefix: 'language-',
  3786. mangle: true,
  3787. pedantic: false,
  3788. renderer: new Renderer(),
  3789. sanitize: false,
  3790. sanitizer: null,
  3791. silent: false,
  3792. smartLists: false,
  3793. smartypants: false,
  3794. xhtml: false
  3795. };
  3796. };
  3797. marked.defaults = marked.getDefaults();
  3798. /**
  3799. * Expose
  3800. */
  3801. marked.Parser = Parser;
  3802. marked.parser = Parser.parse;
  3803. marked.Renderer = Renderer;
  3804. marked.TextRenderer = TextRenderer;
  3805. marked.Lexer = Lexer;
  3806. marked.lexer = Lexer.lex;
  3807. marked.InlineLexer = InlineLexer;
  3808. marked.inlineLexer = InlineLexer.output;
  3809. marked.Slugger = Slugger;
  3810. marked.parse = marked;
  3811. if ('object' !== 'undefined' && 'object' === 'object') {
  3812. module.exports = marked;
  3813. } else if (typeof undefined === 'function' && undefined.amd) {
  3814. undefined(function() { return marked; });
  3815. } else {
  3816. root.marked = marked;
  3817. }
  3818. })(commonjsGlobal || (typeof window !== 'undefined' ? window : commonjsGlobal));
  3819. });
  3820. var speakingurl = createCommonjsModule(function (module) {
  3821. (function (root) {
  3822. 'use strict';
  3823. /**
  3824. * charMap
  3825. * @type {Object}
  3826. */
  3827. var charMap = {
  3828. // latin
  3829. 'À': 'A',
  3830. 'Á': 'A',
  3831. 'Â': 'A',
  3832. 'Ã': 'A',
  3833. 'Ä': 'Ae',
  3834. 'Å': 'A',
  3835. 'Æ': 'AE',
  3836. 'Ç': 'C',
  3837. 'È': 'E',
  3838. 'É': 'E',
  3839. 'Ê': 'E',
  3840. 'Ë': 'E',
  3841. 'Ì': 'I',
  3842. 'Í': 'I',
  3843. 'Î': 'I',
  3844. 'Ï': 'I',
  3845. 'Ð': 'D',
  3846. 'Ñ': 'N',
  3847. 'Ò': 'O',
  3848. 'Ó': 'O',
  3849. 'Ô': 'O',
  3850. 'Õ': 'O',
  3851. 'Ö': 'Oe',
  3852. 'Ő': 'O',
  3853. 'Ø': 'O',
  3854. 'Ù': 'U',
  3855. 'Ú': 'U',
  3856. 'Û': 'U',
  3857. 'Ü': 'Ue',
  3858. 'Ű': 'U',
  3859. 'Ý': 'Y',
  3860. 'Þ': 'TH',
  3861. 'ß': 'ss',
  3862. 'à': 'a',
  3863. 'á': 'a',
  3864. 'â': 'a',
  3865. 'ã': 'a',
  3866. 'ä': 'ae',
  3867. 'å': 'a',
  3868. 'æ': 'ae',
  3869. 'ç': 'c',
  3870. 'è': 'e',
  3871. 'é': 'e',
  3872. 'ê': 'e',
  3873. 'ë': 'e',
  3874. 'ì': 'i',
  3875. 'í': 'i',
  3876. 'î': 'i',
  3877. 'ï': 'i',
  3878. 'ð': 'd',
  3879. 'ñ': 'n',
  3880. 'ò': 'o',
  3881. 'ó': 'o',
  3882. 'ô': 'o',
  3883. 'õ': 'o',
  3884. 'ö': 'oe',
  3885. 'ő': 'o',
  3886. 'ø': 'o',
  3887. 'ù': 'u',
  3888. 'ú': 'u',
  3889. 'û': 'u',
  3890. 'ü': 'ue',
  3891. 'ű': 'u',
  3892. 'ý': 'y',
  3893. 'þ': 'th',
  3894. 'ÿ': 'y',
  3895. 'ẞ': 'SS',
  3896. // language specific
  3897. // Arabic
  3898. 'ا': 'a',
  3899. 'أ': 'a',
  3900. 'إ': 'i',
  3901. 'آ': 'aa',
  3902. 'ؤ': 'u',
  3903. 'ئ': 'e',
  3904. 'ء': 'a',
  3905. 'ب': 'b',
  3906. 'ت': 't',
  3907. 'ث': 'th',
  3908. 'ج': 'j',
  3909. 'ح': 'h',
  3910. 'خ': 'kh',
  3911. 'د': 'd',
  3912. 'ذ': 'th',
  3913. 'ر': 'r',
  3914. 'ز': 'z',
  3915. 'س': 's',
  3916. 'ش': 'sh',
  3917. 'ص': 's',
  3918. 'ض': 'dh',
  3919. 'ط': 't',
  3920. 'ظ': 'z',
  3921. 'ع': 'a',
  3922. 'غ': 'gh',
  3923. 'ف': 'f',
  3924. 'ق': 'q',
  3925. 'ك': 'k',
  3926. 'ل': 'l',
  3927. 'م': 'm',
  3928. 'ن': 'n',
  3929. 'ه': 'h',
  3930. 'و': 'w',
  3931. 'ي': 'y',
  3932. 'ى': 'a',
  3933. 'ة': 'h',
  3934. 'ﻻ': 'la',
  3935. 'ﻷ': 'laa',
  3936. 'ﻹ': 'lai',
  3937. 'ﻵ': 'laa',
  3938. // Persian additional characters than Arabic
  3939. 'گ': 'g',
  3940. 'چ': 'ch',
  3941. 'پ': 'p',
  3942. 'ژ': 'zh',
  3943. 'ک': 'k',
  3944. 'ی': 'y',
  3945. // Arabic diactrics
  3946. 'َ': 'a',
  3947. 'ً': 'an',
  3948. 'ِ': 'e',
  3949. 'ٍ': 'en',
  3950. 'ُ': 'u',
  3951. 'ٌ': 'on',
  3952. 'ْ': '',
  3953. // Arabic numbers
  3954. '٠': '0',
  3955. '١': '1',
  3956. '٢': '2',
  3957. '٣': '3',
  3958. '٤': '4',
  3959. '٥': '5',
  3960. '٦': '6',
  3961. '٧': '7',
  3962. '٨': '8',
  3963. '٩': '9',
  3964. // Persian numbers
  3965. '۰': '0',
  3966. '۱': '1',
  3967. '۲': '2',
  3968. '۳': '3',
  3969. '۴': '4',
  3970. '۵': '5',
  3971. '۶': '6',
  3972. '۷': '7',
  3973. '۸': '8',
  3974. '۹': '9',
  3975. // Burmese consonants
  3976. 'က': 'k',
  3977. 'ခ': 'kh',
  3978. 'ဂ': 'g',
  3979. 'ဃ': 'ga',
  3980. 'င': 'ng',
  3981. 'စ': 's',
  3982. 'ဆ': 'sa',
  3983. 'ဇ': 'z',
  3984. 'စျ': 'za',
  3985. 'ည': 'ny',
  3986. 'ဋ': 't',
  3987. 'ဌ': 'ta',
  3988. 'ဍ': 'd',
  3989. 'ဎ': 'da',
  3990. 'ဏ': 'na',
  3991. 'တ': 't',
  3992. 'ထ': 'ta',
  3993. 'ဒ': 'd',
  3994. 'ဓ': 'da',
  3995. 'န': 'n',
  3996. 'ပ': 'p',
  3997. 'ဖ': 'pa',
  3998. 'ဗ': 'b',
  3999. 'ဘ': 'ba',
  4000. 'မ': 'm',
  4001. 'ယ': 'y',
  4002. 'ရ': 'ya',
  4003. 'လ': 'l',
  4004. 'ဝ': 'w',
  4005. 'သ': 'th',
  4006. 'ဟ': 'h',
  4007. 'ဠ': 'la',
  4008. 'အ': 'a',
  4009. // consonant character combos
  4010. 'ြ': 'y',
  4011. 'ျ': 'ya',
  4012. 'ွ': 'w',
  4013. 'ြွ': 'yw',
  4014. 'ျွ': 'ywa',
  4015. 'ှ': 'h',
  4016. // independent vowels
  4017. 'ဧ': 'e',
  4018. '၏': '-e',
  4019. 'ဣ': 'i',
  4020. 'ဤ': '-i',
  4021. 'ဉ': 'u',
  4022. 'ဦ': '-u',
  4023. 'ဩ': 'aw',
  4024. 'သြော': 'aw',
  4025. 'ဪ': 'aw',
  4026. // numbers
  4027. '၀': '0',
  4028. '၁': '1',
  4029. '၂': '2',
  4030. '၃': '3',
  4031. '၄': '4',
  4032. '၅': '5',
  4033. '၆': '6',
  4034. '၇': '7',
  4035. '၈': '8',
  4036. '၉': '9',
  4037. // virama and tone marks which are silent in transliteration
  4038. '္': '',
  4039. '့': '',
  4040. 'း': '',
  4041. // Czech
  4042. 'č': 'c',
  4043. 'ď': 'd',
  4044. 'ě': 'e',
  4045. 'ň': 'n',
  4046. 'ř': 'r',
  4047. 'š': 's',
  4048. 'ť': 't',
  4049. 'ů': 'u',
  4050. 'ž': 'z',
  4051. 'Č': 'C',
  4052. 'Ď': 'D',
  4053. 'Ě': 'E',
  4054. 'Ň': 'N',
  4055. 'Ř': 'R',
  4056. 'Š': 'S',
  4057. 'Ť': 'T',
  4058. 'Ů': 'U',
  4059. 'Ž': 'Z',
  4060. // Dhivehi
  4061. 'ހ': 'h',
  4062. 'ށ': 'sh',
  4063. 'ނ': 'n',
  4064. 'ރ': 'r',
  4065. 'ބ': 'b',
  4066. 'ޅ': 'lh',
  4067. 'ކ': 'k',
  4068. 'އ': 'a',
  4069. 'ވ': 'v',
  4070. 'މ': 'm',
  4071. 'ފ': 'f',
  4072. 'ދ': 'dh',
  4073. 'ތ': 'th',
  4074. 'ލ': 'l',
  4075. 'ގ': 'g',
  4076. 'ޏ': 'gn',
  4077. 'ސ': 's',
  4078. 'ޑ': 'd',
  4079. 'ޒ': 'z',
  4080. 'ޓ': 't',
  4081. 'ޔ': 'y',
  4082. 'ޕ': 'p',
  4083. 'ޖ': 'j',
  4084. 'ޗ': 'ch',
  4085. 'ޘ': 'tt',
  4086. 'ޙ': 'hh',
  4087. 'ޚ': 'kh',
  4088. 'ޛ': 'th',
  4089. 'ޜ': 'z',
  4090. 'ޝ': 'sh',
  4091. 'ޞ': 's',
  4092. 'ޟ': 'd',
  4093. 'ޠ': 't',
  4094. 'ޡ': 'z',
  4095. 'ޢ': 'a',
  4096. 'ޣ': 'gh',
  4097. 'ޤ': 'q',
  4098. 'ޥ': 'w',
  4099. 'ަ': 'a',
  4100. 'ާ': 'aa',
  4101. 'ި': 'i',
  4102. 'ީ': 'ee',
  4103. 'ު': 'u',
  4104. 'ޫ': 'oo',
  4105. 'ެ': 'e',
  4106. 'ޭ': 'ey',
  4107. 'ޮ': 'o',
  4108. 'ޯ': 'oa',
  4109. 'ް': '',
  4110. // Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian
  4111. // National system (2002)
  4112. 'ა': 'a',
  4113. 'ბ': 'b',
  4114. 'გ': 'g',
  4115. 'დ': 'd',
  4116. 'ე': 'e',
  4117. 'ვ': 'v',
  4118. 'ზ': 'z',
  4119. 'თ': 't',
  4120. 'ი': 'i',
  4121. 'კ': 'k',
  4122. 'ლ': 'l',
  4123. 'მ': 'm',
  4124. 'ნ': 'n',
  4125. 'ო': 'o',
  4126. 'პ': 'p',
  4127. 'ჟ': 'zh',
  4128. 'რ': 'r',
  4129. 'ს': 's',
  4130. 'ტ': 't',
  4131. 'უ': 'u',
  4132. 'ფ': 'p',
  4133. 'ქ': 'k',
  4134. 'ღ': 'gh',
  4135. 'ყ': 'q',
  4136. 'შ': 'sh',
  4137. 'ჩ': 'ch',
  4138. 'ც': 'ts',
  4139. 'ძ': 'dz',
  4140. 'წ': 'ts',
  4141. 'ჭ': 'ch',
  4142. 'ხ': 'kh',
  4143. 'ჯ': 'j',
  4144. 'ჰ': 'h',
  4145. // Greek
  4146. 'α': 'a',
  4147. 'β': 'v',
  4148. 'γ': 'g',
  4149. 'δ': 'd',
  4150. 'ε': 'e',
  4151. 'ζ': 'z',
  4152. 'η': 'i',
  4153. 'θ': 'th',
  4154. 'ι': 'i',
  4155. 'κ': 'k',
  4156. 'λ': 'l',
  4157. 'μ': 'm',
  4158. 'ν': 'n',
  4159. 'ξ': 'ks',
  4160. 'ο': 'o',
  4161. 'π': 'p',
  4162. 'ρ': 'r',
  4163. 'σ': 's',
  4164. 'τ': 't',
  4165. 'υ': 'y',
  4166. 'φ': 'f',
  4167. 'χ': 'x',
  4168. 'ψ': 'ps',
  4169. 'ω': 'o',
  4170. 'ά': 'a',
  4171. 'έ': 'e',
  4172. 'ί': 'i',
  4173. 'ό': 'o',
  4174. 'ύ': 'y',
  4175. 'ή': 'i',
  4176. 'ώ': 'o',
  4177. 'ς': 's',
  4178. 'ϊ': 'i',
  4179. 'ΰ': 'y',
  4180. 'ϋ': 'y',
  4181. 'ΐ': 'i',
  4182. 'Α': 'A',
  4183. 'Β': 'B',
  4184. 'Γ': 'G',
  4185. 'Δ': 'D',
  4186. 'Ε': 'E',
  4187. 'Ζ': 'Z',
  4188. 'Η': 'I',
  4189. 'Θ': 'TH',
  4190. 'Ι': 'I',
  4191. 'Κ': 'K',
  4192. 'Λ': 'L',
  4193. 'Μ': 'M',
  4194. 'Ν': 'N',
  4195. 'Ξ': 'KS',
  4196. 'Ο': 'O',
  4197. 'Π': 'P',
  4198. 'Ρ': 'R',
  4199. 'Σ': 'S',
  4200. 'Τ': 'T',
  4201. 'Υ': 'Y',
  4202. 'Φ': 'F',
  4203. 'Χ': 'X',
  4204. 'Ψ': 'PS',
  4205. 'Ω': 'O',
  4206. 'Ά': 'A',
  4207. 'Έ': 'E',
  4208. 'Ί': 'I',
  4209. 'Ό': 'O',
  4210. 'Ύ': 'Y',
  4211. 'Ή': 'I',
  4212. 'Ώ': 'O',
  4213. 'Ϊ': 'I',
  4214. 'Ϋ': 'Y',
  4215. // Latvian
  4216. 'ā': 'a',
  4217. // 'č': 'c', // duplicate
  4218. 'ē': 'e',
  4219. 'ģ': 'g',
  4220. 'ī': 'i',
  4221. 'ķ': 'k',
  4222. 'ļ': 'l',
  4223. 'ņ': 'n',
  4224. // 'š': 's', // duplicate
  4225. 'ū': 'u',
  4226. // 'ž': 'z', // duplicate
  4227. 'Ā': 'A',
  4228. // 'Č': 'C', // duplicate
  4229. 'Ē': 'E',
  4230. 'Ģ': 'G',
  4231. 'Ī': 'I',
  4232. 'Ķ': 'k',
  4233. 'Ļ': 'L',
  4234. 'Ņ': 'N',
  4235. // 'Š': 'S', // duplicate
  4236. 'Ū': 'U',
  4237. // 'Ž': 'Z', // duplicate
  4238. // Macedonian
  4239. 'Ќ': 'Kj',
  4240. 'ќ': 'kj',
  4241. 'Љ': 'Lj',
  4242. 'љ': 'lj',
  4243. 'Њ': 'Nj',
  4244. 'њ': 'nj',
  4245. 'Тс': 'Ts',
  4246. 'тс': 'ts',
  4247. // Polish
  4248. 'ą': 'a',
  4249. 'ć': 'c',
  4250. 'ę': 'e',
  4251. 'ł': 'l',
  4252. 'ń': 'n',
  4253. // 'ó': 'o', // duplicate
  4254. 'ś': 's',
  4255. 'ź': 'z',
  4256. 'ż': 'z',
  4257. 'Ą': 'A',
  4258. 'Ć': 'C',
  4259. 'Ę': 'E',
  4260. 'Ł': 'L',
  4261. 'Ń': 'N',
  4262. 'Ś': 'S',
  4263. 'Ź': 'Z',
  4264. 'Ż': 'Z',
  4265. // Ukranian
  4266. 'Є': 'Ye',
  4267. 'І': 'I',
  4268. 'Ї': 'Yi',
  4269. 'Ґ': 'G',
  4270. 'є': 'ye',
  4271. 'і': 'i',
  4272. 'ї': 'yi',
  4273. 'ґ': 'g',
  4274. // Romanian
  4275. 'ă': 'a',
  4276. 'Ă': 'A',
  4277. 'ș': 's',
  4278. 'Ș': 'S',
  4279. // 'ş': 's', // duplicate
  4280. // 'Ş': 'S', // duplicate
  4281. 'ț': 't',
  4282. 'Ț': 'T',
  4283. 'ţ': 't',
  4284. 'Ţ': 'T',
  4285. // Russian https://en.wikipedia.org/wiki/Romanization_of_Russian
  4286. // ICAO
  4287. 'а': 'a',
  4288. 'б': 'b',
  4289. 'в': 'v',
  4290. 'г': 'g',
  4291. 'д': 'd',
  4292. 'е': 'e',
  4293. 'ё': 'yo',
  4294. 'ж': 'zh',
  4295. 'з': 'z',
  4296. 'и': 'i',
  4297. 'й': 'i',
  4298. 'к': 'k',
  4299. 'л': 'l',
  4300. 'м': 'm',
  4301. 'н': 'n',
  4302. 'о': 'o',
  4303. 'п': 'p',
  4304. 'р': 'r',
  4305. 'с': 's',
  4306. 'т': 't',
  4307. 'у': 'u',
  4308. 'ф': 'f',
  4309. 'х': 'kh',
  4310. 'ц': 'c',
  4311. 'ч': 'ch',
  4312. 'ш': 'sh',
  4313. 'щ': 'sh',
  4314. 'ъ': '',
  4315. 'ы': 'y',
  4316. 'ь': '',
  4317. 'э': 'e',
  4318. 'ю': 'yu',
  4319. 'я': 'ya',
  4320. 'А': 'A',
  4321. 'Б': 'B',
  4322. 'В': 'V',
  4323. 'Г': 'G',
  4324. 'Д': 'D',
  4325. 'Е': 'E',
  4326. 'Ё': 'Yo',
  4327. 'Ж': 'Zh',
  4328. 'З': 'Z',
  4329. 'И': 'I',
  4330. 'Й': 'I',
  4331. 'К': 'K',
  4332. 'Л': 'L',
  4333. 'М': 'M',
  4334. 'Н': 'N',
  4335. 'О': 'O',
  4336. 'П': 'P',
  4337. 'Р': 'R',
  4338. 'С': 'S',
  4339. 'Т': 'T',
  4340. 'У': 'U',
  4341. 'Ф': 'F',
  4342. 'Х': 'Kh',
  4343. 'Ц': 'C',
  4344. 'Ч': 'Ch',
  4345. 'Ш': 'Sh',
  4346. 'Щ': 'Sh',
  4347. 'Ъ': '',
  4348. 'Ы': 'Y',
  4349. 'Ь': '',
  4350. 'Э': 'E',
  4351. 'Ю': 'Yu',
  4352. 'Я': 'Ya',
  4353. // Serbian
  4354. 'ђ': 'dj',
  4355. 'ј': 'j',
  4356. // 'љ': 'lj', // duplicate
  4357. // 'њ': 'nj', // duplicate
  4358. 'ћ': 'c',
  4359. 'џ': 'dz',
  4360. 'Ђ': 'Dj',
  4361. 'Ј': 'j',
  4362. // 'Љ': 'Lj', // duplicate
  4363. // 'Њ': 'Nj', // duplicate
  4364. 'Ћ': 'C',
  4365. 'Џ': 'Dz',
  4366. // Slovak
  4367. 'ľ': 'l',
  4368. 'ĺ': 'l',
  4369. 'ŕ': 'r',
  4370. 'Ľ': 'L',
  4371. 'Ĺ': 'L',
  4372. 'Ŕ': 'R',
  4373. // Turkish
  4374. 'ş': 's',
  4375. 'Ş': 'S',
  4376. 'ı': 'i',
  4377. 'İ': 'I',
  4378. // 'ç': 'c', // duplicate
  4379. // 'Ç': 'C', // duplicate
  4380. // 'ü': 'u', // duplicate, see langCharMap
  4381. // 'Ü': 'U', // duplicate, see langCharMap
  4382. // 'ö': 'o', // duplicate, see langCharMap
  4383. // 'Ö': 'O', // duplicate, see langCharMap
  4384. 'ğ': 'g',
  4385. 'Ğ': 'G',
  4386. // Vietnamese
  4387. 'ả': 'a',
  4388. 'Ả': 'A',
  4389. 'ẳ': 'a',
  4390. 'Ẳ': 'A',
  4391. 'ẩ': 'a',
  4392. 'Ẩ': 'A',
  4393. 'đ': 'd',
  4394. 'Đ': 'D',
  4395. 'ẹ': 'e',
  4396. 'Ẹ': 'E',
  4397. 'ẽ': 'e',
  4398. 'Ẽ': 'E',
  4399. 'ẻ': 'e',
  4400. 'Ẻ': 'E',
  4401. 'ế': 'e',
  4402. 'Ế': 'E',
  4403. 'ề': 'e',
  4404. 'Ề': 'E',
  4405. 'ệ': 'e',
  4406. 'Ệ': 'E',
  4407. 'ễ': 'e',
  4408. 'Ễ': 'E',
  4409. 'ể': 'e',
  4410. 'Ể': 'E',
  4411. 'ỏ': 'o',
  4412. 'ọ': 'o',
  4413. 'Ọ': 'o',
  4414. 'ố': 'o',
  4415. 'Ố': 'O',
  4416. 'ồ': 'o',
  4417. 'Ồ': 'O',
  4418. 'ổ': 'o',
  4419. 'Ổ': 'O',
  4420. 'ộ': 'o',
  4421. 'Ộ': 'O',
  4422. 'ỗ': 'o',
  4423. 'Ỗ': 'O',
  4424. 'ơ': 'o',
  4425. 'Ơ': 'O',
  4426. 'ớ': 'o',
  4427. 'Ớ': 'O',
  4428. 'ờ': 'o',
  4429. 'Ờ': 'O',
  4430. 'ợ': 'o',
  4431. 'Ợ': 'O',
  4432. 'ỡ': 'o',
  4433. 'Ỡ': 'O',
  4434. 'Ở': 'o',
  4435. 'ở': 'o',
  4436. 'ị': 'i',
  4437. 'Ị': 'I',
  4438. 'ĩ': 'i',
  4439. 'Ĩ': 'I',
  4440. 'ỉ': 'i',
  4441. 'Ỉ': 'i',
  4442. 'ủ': 'u',
  4443. 'Ủ': 'U',
  4444. 'ụ': 'u',
  4445. 'Ụ': 'U',
  4446. 'ũ': 'u',
  4447. 'Ũ': 'U',
  4448. 'ư': 'u',
  4449. 'Ư': 'U',
  4450. 'ứ': 'u',
  4451. 'Ứ': 'U',
  4452. 'ừ': 'u',
  4453. 'Ừ': 'U',
  4454. 'ự': 'u',
  4455. 'Ự': 'U',
  4456. 'ữ': 'u',
  4457. 'Ữ': 'U',
  4458. 'ử': 'u',
  4459. 'Ử': 'ư',
  4460. 'ỷ': 'y',
  4461. 'Ỷ': 'y',
  4462. 'ỳ': 'y',
  4463. 'Ỳ': 'Y',
  4464. 'ỵ': 'y',
  4465. 'Ỵ': 'Y',
  4466. 'ỹ': 'y',
  4467. 'Ỹ': 'Y',
  4468. 'ạ': 'a',
  4469. 'Ạ': 'A',
  4470. 'ấ': 'a',
  4471. 'Ấ': 'A',
  4472. 'ầ': 'a',
  4473. 'Ầ': 'A',
  4474. 'ậ': 'a',
  4475. 'Ậ': 'A',
  4476. 'ẫ': 'a',
  4477. 'Ẫ': 'A',
  4478. // 'ă': 'a', // duplicate
  4479. // 'Ă': 'A', // duplicate
  4480. 'ắ': 'a',
  4481. 'Ắ': 'A',
  4482. 'ằ': 'a',
  4483. 'Ằ': 'A',
  4484. 'ặ': 'a',
  4485. 'Ặ': 'A',
  4486. 'ẵ': 'a',
  4487. 'Ẵ': 'A',
  4488. "⓪": "0",
  4489. "①": "1",
  4490. "②": "2",
  4491. "③": "3",
  4492. "④": "4",
  4493. "⑤": "5",
  4494. "⑥": "6",
  4495. "⑦": "7",
  4496. "⑧": "8",
  4497. "⑨": "9",
  4498. "⑩": "10",
  4499. "⑪": "11",
  4500. "⑫": "12",
  4501. "⑬": "13",
  4502. "⑭": "14",
  4503. "⑮": "15",
  4504. "⑯": "16",
  4505. "⑰": "17",
  4506. "⑱": "18",
  4507. "⑲": "18",
  4508. "⑳": "18",
  4509. "⓵": "1",
  4510. "⓶": "2",
  4511. "⓷": "3",
  4512. "⓸": "4",
  4513. "⓹": "5",
  4514. "⓺": "6",
  4515. "⓻": "7",
  4516. "⓼": "8",
  4517. "⓽": "9",
  4518. "⓾": "10",
  4519. "⓿": "0",
  4520. "⓫": "11",
  4521. "⓬": "12",
  4522. "⓭": "13",
  4523. "⓮": "14",
  4524. "⓯": "15",
  4525. "⓰": "16",
  4526. "⓱": "17",
  4527. "⓲": "18",
  4528. "⓳": "19",
  4529. "⓴": "20",
  4530. "Ⓐ": "A",
  4531. "Ⓑ": "B",
  4532. "Ⓒ": "C",
  4533. "Ⓓ": "D",
  4534. "Ⓔ": "E",
  4535. "Ⓕ": "F",
  4536. "Ⓖ": "G",
  4537. "Ⓗ": "H",
  4538. "Ⓘ": "I",
  4539. "Ⓙ": "J",
  4540. "Ⓚ": "K",
  4541. "Ⓛ": "L",
  4542. "Ⓜ": "M",
  4543. "Ⓝ": "N",
  4544. "Ⓞ": "O",
  4545. "Ⓟ": "P",
  4546. "Ⓠ": "Q",
  4547. "Ⓡ": "R",
  4548. "Ⓢ": "S",
  4549. "Ⓣ": "T",
  4550. "Ⓤ": "U",
  4551. "Ⓥ": "V",
  4552. "Ⓦ": "W",
  4553. "Ⓧ": "X",
  4554. "Ⓨ": "Y",
  4555. "Ⓩ": "Z",
  4556. "ⓐ": "a",
  4557. "ⓑ": "b",
  4558. "ⓒ": "c",
  4559. "ⓓ": "d",
  4560. "ⓔ": "e",
  4561. "ⓕ": "f",
  4562. "ⓖ": "g",
  4563. "ⓗ": "h",
  4564. "ⓘ": "i",
  4565. "ⓙ": "j",
  4566. "ⓚ": "k",
  4567. "ⓛ": "l",
  4568. "ⓜ": "m",
  4569. "ⓝ": "n",
  4570. "ⓞ": "o",
  4571. "ⓟ": "p",
  4572. "ⓠ": "q",
  4573. "ⓡ": "r",
  4574. "ⓢ": "s",
  4575. "ⓣ": "t",
  4576. "ⓤ": "u",
  4577. "ⓦ": "v",
  4578. "ⓥ": "w",
  4579. "ⓧ": "x",
  4580. "ⓨ": "y",
  4581. "ⓩ": "z",
  4582. // symbols
  4583. '“': '"',
  4584. '”': '"',
  4585. '‘': "'",
  4586. '’': "'",
  4587. '∂': 'd',
  4588. 'ƒ': 'f',
  4589. '™': '(TM)',
  4590. '©': '(C)',
  4591. 'œ': 'oe',
  4592. 'Œ': 'OE',
  4593. '®': '(R)',
  4594. '†': '+',
  4595. '℠': '(SM)',
  4596. '…': '...',
  4597. '˚': 'o',
  4598. 'º': 'o',
  4599. 'ª': 'a',
  4600. '•': '*',
  4601. '၊': ',',
  4602. '။': '.',
  4603. // currency
  4604. '$': 'USD',
  4605. '€': 'EUR',
  4606. '₢': 'BRN',
  4607. '₣': 'FRF',
  4608. '£': 'GBP',
  4609. '₤': 'ITL',
  4610. '₦': 'NGN',
  4611. '₧': 'ESP',
  4612. '₩': 'KRW',
  4613. '₪': 'ILS',
  4614. '₫': 'VND',
  4615. '₭': 'LAK',
  4616. '₮': 'MNT',
  4617. '₯': 'GRD',
  4618. '₱': 'ARS',
  4619. '₲': 'PYG',
  4620. '₳': 'ARA',
  4621. '₴': 'UAH',
  4622. '₵': 'GHS',
  4623. '¢': 'cent',
  4624. '¥': 'CNY',
  4625. '元': 'CNY',
  4626. '円': 'YEN',
  4627. '﷼': 'IRR',
  4628. '₠': 'EWE',
  4629. '฿': 'THB',
  4630. '₨': 'INR',
  4631. '₹': 'INR',
  4632. '₰': 'PF',
  4633. '₺': 'TRY',
  4634. '؋': 'AFN',
  4635. '₼': 'AZN',
  4636. 'лв': 'BGN',
  4637. '៛': 'KHR',
  4638. '₡': 'CRC',
  4639. '₸': 'KZT',
  4640. 'ден': 'MKD',
  4641. 'zł': 'PLN',
  4642. '₽': 'RUB',
  4643. '₾': 'GEL'
  4644. };
  4645. /**
  4646. * special look ahead character array
  4647. * These characters form with consonants to become 'single'/consonant combo
  4648. * @type [Array]
  4649. */
  4650. var lookAheadCharArray = [
  4651. // burmese
  4652. '်',
  4653. // Dhivehi
  4654. 'ް'
  4655. ];
  4656. /**
  4657. * diatricMap for languages where transliteration changes entirely as more diatrics are added
  4658. * @type {Object}
  4659. */
  4660. var diatricMap = {
  4661. // Burmese
  4662. // dependent vowels
  4663. 'ာ': 'a',
  4664. 'ါ': 'a',
  4665. 'ေ': 'e',
  4666. 'ဲ': 'e',
  4667. 'ိ': 'i',
  4668. 'ီ': 'i',
  4669. 'ို': 'o',
  4670. 'ု': 'u',
  4671. 'ူ': 'u',
  4672. 'ေါင်': 'aung',
  4673. 'ော': 'aw',
  4674. 'ော်': 'aw',
  4675. 'ေါ': 'aw',
  4676. 'ေါ်': 'aw',
  4677. '်': '်', // this is special case but the character will be converted to latin in the code
  4678. 'က်': 'et',
  4679. 'ိုက်': 'aik',
  4680. 'ောက်': 'auk',
  4681. 'င်': 'in',
  4682. 'ိုင်': 'aing',
  4683. 'ောင်': 'aung',
  4684. 'စ်': 'it',
  4685. 'ည်': 'i',
  4686. 'တ်': 'at',
  4687. 'ိတ်': 'eik',
  4688. 'ုတ်': 'ok',
  4689. 'ွတ်': 'ut',
  4690. 'ေတ်': 'it',
  4691. 'ဒ်': 'd',
  4692. 'ိုဒ်': 'ok',
  4693. 'ုဒ်': 'ait',
  4694. 'န်': 'an',
  4695. 'ာန်': 'an',
  4696. 'ိန်': 'ein',
  4697. 'ုန်': 'on',
  4698. 'ွန်': 'un',
  4699. 'ပ်': 'at',
  4700. 'ိပ်': 'eik',
  4701. 'ုပ်': 'ok',
  4702. 'ွပ်': 'ut',
  4703. 'န်ုပ်': 'nub',
  4704. 'မ်': 'an',
  4705. 'ိမ်': 'ein',
  4706. 'ုမ်': 'on',
  4707. 'ွမ်': 'un',
  4708. 'ယ်': 'e',
  4709. 'ိုလ်': 'ol',
  4710. 'ဉ်': 'in',
  4711. 'ံ': 'an',
  4712. 'ိံ': 'ein',
  4713. 'ုံ': 'on',
  4714. // Dhivehi
  4715. 'ައް': 'ah',
  4716. 'ަށް': 'ah'
  4717. };
  4718. /**
  4719. * langCharMap language specific characters translations
  4720. * @type {Object}
  4721. */
  4722. var langCharMap = {
  4723. 'en': {}, // default language
  4724. 'az': { // Azerbaijani
  4725. 'ç': 'c',
  4726. 'ə': 'e',
  4727. 'ğ': 'g',
  4728. 'ı': 'i',
  4729. 'ö': 'o',
  4730. 'ş': 's',
  4731. 'ü': 'u',
  4732. 'Ç': 'C',
  4733. 'Ə': 'E',
  4734. 'Ğ': 'G',
  4735. 'İ': 'I',
  4736. 'Ö': 'O',
  4737. 'Ş': 'S',
  4738. 'Ü': 'U'
  4739. },
  4740. 'cs': { // Czech
  4741. 'č': 'c',
  4742. 'ď': 'd',
  4743. 'ě': 'e',
  4744. 'ň': 'n',
  4745. 'ř': 'r',
  4746. 'š': 's',
  4747. 'ť': 't',
  4748. 'ů': 'u',
  4749. 'ž': 'z',
  4750. 'Č': 'C',
  4751. 'Ď': 'D',
  4752. 'Ě': 'E',
  4753. 'Ň': 'N',
  4754. 'Ř': 'R',
  4755. 'Š': 'S',
  4756. 'Ť': 'T',
  4757. 'Ů': 'U',
  4758. 'Ž': 'Z'
  4759. },
  4760. 'fi': { // Finnish
  4761. // 'å': 'a', duplicate see charMap/latin
  4762. // 'Å': 'A', duplicate see charMap/latin
  4763. 'ä': 'a', // ok
  4764. 'Ä': 'A', // ok
  4765. 'ö': 'o', // ok
  4766. 'Ö': 'O' // ok
  4767. },
  4768. 'hu': { // Hungarian
  4769. 'ä': 'a', // ok
  4770. 'Ä': 'A', // ok
  4771. // 'á': 'a', duplicate see charMap/latin
  4772. // 'Á': 'A', duplicate see charMap/latin
  4773. 'ö': 'o', // ok
  4774. 'Ö': 'O', // ok
  4775. // 'ő': 'o', duplicate see charMap/latin
  4776. // 'Ő': 'O', duplicate see charMap/latin
  4777. 'ü': 'u',
  4778. 'Ü': 'U',
  4779. 'ű': 'u',
  4780. 'Ű': 'U'
  4781. },
  4782. 'lt': { // Lithuanian
  4783. 'ą': 'a',
  4784. 'č': 'c',
  4785. 'ę': 'e',
  4786. 'ė': 'e',
  4787. 'į': 'i',
  4788. 'š': 's',
  4789. 'ų': 'u',
  4790. 'ū': 'u',
  4791. 'ž': 'z',
  4792. 'Ą': 'A',
  4793. 'Č': 'C',
  4794. 'Ę': 'E',
  4795. 'Ė': 'E',
  4796. 'Į': 'I',
  4797. 'Š': 'S',
  4798. 'Ų': 'U',
  4799. 'Ū': 'U'
  4800. },
  4801. 'lv': { // Latvian
  4802. 'ā': 'a',
  4803. 'č': 'c',
  4804. 'ē': 'e',
  4805. 'ģ': 'g',
  4806. 'ī': 'i',
  4807. 'ķ': 'k',
  4808. 'ļ': 'l',
  4809. 'ņ': 'n',
  4810. 'š': 's',
  4811. 'ū': 'u',
  4812. 'ž': 'z',
  4813. 'Ā': 'A',
  4814. 'Č': 'C',
  4815. 'Ē': 'E',
  4816. 'Ģ': 'G',
  4817. 'Ī': 'i',
  4818. 'Ķ': 'k',
  4819. 'Ļ': 'L',
  4820. 'Ņ': 'N',
  4821. 'Š': 'S',
  4822. 'Ū': 'u',
  4823. 'Ž': 'Z'
  4824. },
  4825. 'pl': { // Polish
  4826. 'ą': 'a',
  4827. 'ć': 'c',
  4828. 'ę': 'e',
  4829. 'ł': 'l',
  4830. 'ń': 'n',
  4831. 'ó': 'o',
  4832. 'ś': 's',
  4833. 'ź': 'z',
  4834. 'ż': 'z',
  4835. 'Ą': 'A',
  4836. 'Ć': 'C',
  4837. 'Ę': 'e',
  4838. 'Ł': 'L',
  4839. 'Ń': 'N',
  4840. 'Ó': 'O',
  4841. 'Ś': 'S',
  4842. 'Ź': 'Z',
  4843. 'Ż': 'Z'
  4844. },
  4845. 'sv': { // Swedish
  4846. // 'å': 'a', duplicate see charMap/latin
  4847. // 'Å': 'A', duplicate see charMap/latin
  4848. 'ä': 'a', // ok
  4849. 'Ä': 'A', // ok
  4850. 'ö': 'o', // ok
  4851. 'Ö': 'O' // ok
  4852. },
  4853. 'sk': { // Slovak
  4854. 'ä': 'a',
  4855. 'Ä': 'A'
  4856. },
  4857. 'sr': { // Serbian
  4858. 'љ': 'lj',
  4859. 'њ': 'nj',
  4860. 'Љ': 'Lj',
  4861. 'Њ': 'Nj',
  4862. 'đ': 'dj',
  4863. 'Đ': 'Dj'
  4864. },
  4865. 'tr': { // Turkish
  4866. 'Ü': 'U',
  4867. 'Ö': 'O',
  4868. 'ü': 'u',
  4869. 'ö': 'o'
  4870. }
  4871. };
  4872. /**
  4873. * symbolMap language specific symbol translations
  4874. * translations must be transliterated already
  4875. * @type {Object}
  4876. */
  4877. var symbolMap = {
  4878. 'ar': {
  4879. '∆': 'delta',
  4880. '∞': 'la-nihaya',
  4881. '♥': 'hob',
  4882. '&': 'wa',
  4883. '|': 'aw',
  4884. '<': 'aqal-men',
  4885. '>': 'akbar-men',
  4886. '∑': 'majmou',
  4887. '¤': 'omla'
  4888. },
  4889. 'az': {},
  4890. 'ca': {
  4891. '∆': 'delta',
  4892. '∞': 'infinit',
  4893. '♥': 'amor',
  4894. '&': 'i',
  4895. '|': 'o',
  4896. '<': 'menys que',
  4897. '>': 'mes que',
  4898. '∑': 'suma dels',
  4899. '¤': 'moneda'
  4900. },
  4901. 'cs': {
  4902. '∆': 'delta',
  4903. '∞': 'nekonecno',
  4904. '♥': 'laska',
  4905. '&': 'a',
  4906. '|': 'nebo',
  4907. '<': 'mensi nez',
  4908. '>': 'vetsi nez',
  4909. '∑': 'soucet',
  4910. '¤': 'mena'
  4911. },
  4912. 'de': {
  4913. '∆': 'delta',
  4914. '∞': 'unendlich',
  4915. '♥': 'Liebe',
  4916. '&': 'und',
  4917. '|': 'oder',
  4918. '<': 'kleiner als',
  4919. '>': 'groesser als',
  4920. '∑': 'Summe von',
  4921. '¤': 'Waehrung'
  4922. },
  4923. 'dv': {
  4924. '∆': 'delta',
  4925. '∞': 'kolunulaa',
  4926. '♥': 'loabi',
  4927. '&': 'aai',
  4928. '|': 'noonee',
  4929. '<': 'ah vure kuda',
  4930. '>': 'ah vure bodu',
  4931. '∑': 'jumula',
  4932. '¤': 'faisaa'
  4933. },
  4934. 'en': {
  4935. '∆': 'delta',
  4936. '∞': 'infinity',
  4937. '♥': 'love',
  4938. '&': 'and',
  4939. '|': 'or',
  4940. '<': 'less than',
  4941. '>': 'greater than',
  4942. '∑': 'sum',
  4943. '¤': 'currency'
  4944. },
  4945. 'es': {
  4946. '∆': 'delta',
  4947. '∞': 'infinito',
  4948. '♥': 'amor',
  4949. '&': 'y',
  4950. '|': 'u',
  4951. '<': 'menos que',
  4952. '>': 'mas que',
  4953. '∑': 'suma de los',
  4954. '¤': 'moneda'
  4955. },
  4956. 'fa': {
  4957. '∆': 'delta',
  4958. '∞': 'bi-nahayat',
  4959. '♥': 'eshgh',
  4960. '&': 'va',
  4961. '|': 'ya',
  4962. '<': 'kamtar-az',
  4963. '>': 'bishtar-az',
  4964. '∑': 'majmooe',
  4965. '¤': 'vahed'
  4966. },
  4967. 'fi': {
  4968. '∆': 'delta',
  4969. '∞': 'aarettomyys',
  4970. '♥': 'rakkaus',
  4971. '&': 'ja',
  4972. '|': 'tai',
  4973. '<': 'pienempi kuin',
  4974. '>': 'suurempi kuin',
  4975. '∑': 'summa',
  4976. '¤': 'valuutta'
  4977. },
  4978. 'fr': {
  4979. '∆': 'delta',
  4980. '∞': 'infiniment',
  4981. '♥': 'Amour',
  4982. '&': 'et',
  4983. '|': 'ou',
  4984. '<': 'moins que',
  4985. '>': 'superieure a',
  4986. '∑': 'somme des',
  4987. '¤': 'monnaie'
  4988. },
  4989. 'ge': {
  4990. '∆': 'delta',
  4991. '∞': 'usasruloba',
  4992. '♥': 'siqvaruli',
  4993. '&': 'da',
  4994. '|': 'an',
  4995. '<': 'naklebi',
  4996. '>': 'meti',
  4997. '∑': 'jami',
  4998. '¤': 'valuta'
  4999. },
  5000. 'gr': {},
  5001. 'hu': {
  5002. '∆': 'delta',
  5003. '∞': 'vegtelen',
  5004. '♥': 'szerelem',
  5005. '&': 'es',
  5006. '|': 'vagy',
  5007. '<': 'kisebb mint',
  5008. '>': 'nagyobb mint',
  5009. '∑': 'szumma',
  5010. '¤': 'penznem'
  5011. },
  5012. 'it': {
  5013. '∆': 'delta',
  5014. '∞': 'infinito',
  5015. '♥': 'amore',
  5016. '&': 'e',
  5017. '|': 'o',
  5018. '<': 'minore di',
  5019. '>': 'maggiore di',
  5020. '∑': 'somma',
  5021. '¤': 'moneta'
  5022. },
  5023. 'lt': {
  5024. '∆': 'delta',
  5025. '∞': 'begalybe',
  5026. '♥': 'meile',
  5027. '&': 'ir',
  5028. '|': 'ar',
  5029. '<': 'maziau nei',
  5030. '>': 'daugiau nei',
  5031. '∑': 'suma',
  5032. '¤': 'valiuta'
  5033. },
  5034. 'lv': {
  5035. '∆': 'delta',
  5036. '∞': 'bezgaliba',
  5037. '♥': 'milestiba',
  5038. '&': 'un',
  5039. '|': 'vai',
  5040. '<': 'mazak neka',
  5041. '>': 'lielaks neka',
  5042. '∑': 'summa',
  5043. '¤': 'valuta'
  5044. },
  5045. 'my': {
  5046. '∆': 'kwahkhyaet',
  5047. '∞': 'asaonasme',
  5048. '♥': 'akhyait',
  5049. '&': 'nhin',
  5050. '|': 'tho',
  5051. '<': 'ngethaw',
  5052. '>': 'kyithaw',
  5053. '∑': 'paungld',
  5054. '¤': 'ngwekye'
  5055. },
  5056. 'mk': {},
  5057. 'nl': {
  5058. '∆': 'delta',
  5059. '∞': 'oneindig',
  5060. '♥': 'liefde',
  5061. '&': 'en',
  5062. '|': 'of',
  5063. '<': 'kleiner dan',
  5064. '>': 'groter dan',
  5065. '∑': 'som',
  5066. '¤': 'valuta'
  5067. },
  5068. 'pl': {
  5069. '∆': 'delta',
  5070. '∞': 'nieskonczonosc',
  5071. '♥': 'milosc',
  5072. '&': 'i',
  5073. '|': 'lub',
  5074. '<': 'mniejsze niz',
  5075. '>': 'wieksze niz',
  5076. '∑': 'suma',
  5077. '¤': 'waluta'
  5078. },
  5079. 'pt': {
  5080. '∆': 'delta',
  5081. '∞': 'infinito',
  5082. '♥': 'amor',
  5083. '&': 'e',
  5084. '|': 'ou',
  5085. '<': 'menor que',
  5086. '>': 'maior que',
  5087. '∑': 'soma',
  5088. '¤': 'moeda'
  5089. },
  5090. 'ro': {
  5091. '∆': 'delta',
  5092. '∞': 'infinit',
  5093. '♥': 'dragoste',
  5094. '&': 'si',
  5095. '|': 'sau',
  5096. '<': 'mai mic ca',
  5097. '>': 'mai mare ca',
  5098. '∑': 'suma',
  5099. '¤': 'valuta'
  5100. },
  5101. 'ru': {
  5102. '∆': 'delta',
  5103. '∞': 'beskonechno',
  5104. '♥': 'lubov',
  5105. '&': 'i',
  5106. '|': 'ili',
  5107. '<': 'menshe',
  5108. '>': 'bolshe',
  5109. '∑': 'summa',
  5110. '¤': 'valjuta'
  5111. },
  5112. 'sk': {
  5113. '∆': 'delta',
  5114. '∞': 'nekonecno',
  5115. '♥': 'laska',
  5116. '&': 'a',
  5117. '|': 'alebo',
  5118. '<': 'menej ako',
  5119. '>': 'viac ako',
  5120. '∑': 'sucet',
  5121. '¤': 'mena'
  5122. },
  5123. 'sr': {},
  5124. 'tr': {
  5125. '∆': 'delta',
  5126. '∞': 'sonsuzluk',
  5127. '♥': 'ask',
  5128. '&': 've',
  5129. '|': 'veya',
  5130. '<': 'kucuktur',
  5131. '>': 'buyuktur',
  5132. '∑': 'toplam',
  5133. '¤': 'para birimi'
  5134. },
  5135. 'uk': {
  5136. '∆': 'delta',
  5137. '∞': 'bezkinechnist',
  5138. '♥': 'lubov',
  5139. '&': 'i',
  5140. '|': 'abo',
  5141. '<': 'menshe',
  5142. '>': 'bilshe',
  5143. '∑': 'suma',
  5144. '¤': 'valjuta'
  5145. },
  5146. 'vn': {
  5147. '∆': 'delta',
  5148. '∞': 'vo cuc',
  5149. '♥': 'yeu',
  5150. '&': 'va',
  5151. '|': 'hoac',
  5152. '<': 'nho hon',
  5153. '>': 'lon hon',
  5154. '∑': 'tong',
  5155. '¤': 'tien te'
  5156. }
  5157. };
  5158. var uricChars = [';', '?', ':', '@', '&', '=', '+', '$', ',', '/'].join('');
  5159. var uricNoSlashChars = [';', '?', ':', '@', '&', '=', '+', '$', ','].join('');
  5160. var markChars = ['.', '!', '~', '*', "'", '(', ')'].join('');
  5161. /**
  5162. * getSlug
  5163. * @param {string} input input string
  5164. * @param {object|string} opts config object or separator string/char
  5165. * @api public
  5166. * @return {string} sluggified string
  5167. */
  5168. var getSlug = function getSlug(input, opts) {
  5169. var separator = '-';
  5170. var result = '';
  5171. var diatricString = '';
  5172. var convertSymbols = true;
  5173. var customReplacements = {};
  5174. var maintainCase;
  5175. var titleCase;
  5176. var truncate;
  5177. var uricFlag;
  5178. var uricNoSlashFlag;
  5179. var markFlag;
  5180. var symbol;
  5181. var langChar;
  5182. var lucky;
  5183. var i;
  5184. var ch;
  5185. var l;
  5186. var lastCharWasSymbol;
  5187. var lastCharWasDiatric;
  5188. var allowedChars = '';
  5189. if (typeof input !== 'string') {
  5190. return '';
  5191. }
  5192. if (typeof opts === 'string') {
  5193. separator = opts;
  5194. }
  5195. symbol = symbolMap.en;
  5196. langChar = langCharMap.en;
  5197. if (typeof opts === 'object') {
  5198. maintainCase = opts.maintainCase || false;
  5199. customReplacements = (opts.custom && typeof opts.custom === 'object') ? opts.custom : customReplacements;
  5200. truncate = (+opts.truncate > 1 && opts.truncate) || false;
  5201. uricFlag = opts.uric || false;
  5202. uricNoSlashFlag = opts.uricNoSlash || false;
  5203. markFlag = opts.mark || false;
  5204. convertSymbols = (opts.symbols === false || opts.lang === false) ? false : true;
  5205. separator = opts.separator || separator;
  5206. if (uricFlag) {
  5207. allowedChars += uricChars;
  5208. }
  5209. if (uricNoSlashFlag) {
  5210. allowedChars += uricNoSlashChars;
  5211. }
  5212. if (markFlag) {
  5213. allowedChars += markChars;
  5214. }
  5215. symbol = (opts.lang && symbolMap[opts.lang] && convertSymbols) ?
  5216. symbolMap[opts.lang] : (convertSymbols ? symbolMap.en : {});
  5217. langChar = (opts.lang && langCharMap[opts.lang]) ?
  5218. langCharMap[opts.lang] :
  5219. opts.lang === false || opts.lang === true ? {} : langCharMap.en;
  5220. // if titleCase config is an Array, rewrite to object format
  5221. if (opts.titleCase && typeof opts.titleCase.length === 'number' && Array.prototype.toString.call(opts.titleCase)) {
  5222. opts.titleCase.forEach(function (v) {
  5223. customReplacements[v + ''] = v + '';
  5224. });
  5225. titleCase = true;
  5226. } else {
  5227. titleCase = !!opts.titleCase;
  5228. }
  5229. // if custom config is an Array, rewrite to object format
  5230. if (opts.custom && typeof opts.custom.length === 'number' && Array.prototype.toString.call(opts.custom)) {
  5231. opts.custom.forEach(function (v) {
  5232. customReplacements[v + ''] = v + '';
  5233. });
  5234. }
  5235. // custom replacements
  5236. Object.keys(customReplacements).forEach(function (v) {
  5237. var r;
  5238. if (v.length > 1) {
  5239. r = new RegExp('\\b' + escapeChars(v) + '\\b', 'gi');
  5240. } else {
  5241. r = new RegExp(escapeChars(v), 'gi');
  5242. }
  5243. input = input.replace(r, customReplacements[v]);
  5244. });
  5245. // add all custom replacement to allowed charlist
  5246. for (ch in customReplacements) {
  5247. allowedChars += ch;
  5248. }
  5249. }
  5250. allowedChars += separator;
  5251. // escape all necessary chars
  5252. allowedChars = escapeChars(allowedChars);
  5253. // trim whitespaces
  5254. input = input.replace(/(^\s+|\s+$)/g, '');
  5255. lastCharWasSymbol = false;
  5256. lastCharWasDiatric = false;
  5257. for (i = 0, l = input.length; i < l; i++) {
  5258. ch = input[i];
  5259. if (isReplacedCustomChar(ch, customReplacements)) {
  5260. // don't convert a already converted char
  5261. lastCharWasSymbol = false;
  5262. } else if (langChar[ch]) {
  5263. // process language specific diactrics chars conversion
  5264. ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? ' ' + langChar[ch] : langChar[ch];
  5265. lastCharWasSymbol = false;
  5266. } else if (ch in charMap) {
  5267. // the transliteration changes entirely when some special characters are added
  5268. if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {
  5269. diatricString += ch;
  5270. ch = '';
  5271. } else if (lastCharWasDiatric === true) {
  5272. ch = diatricMap[diatricString] + charMap[ch];
  5273. diatricString = '';
  5274. } else {
  5275. // process diactrics chars
  5276. ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? ' ' + charMap[ch] : charMap[ch];
  5277. }
  5278. lastCharWasSymbol = false;
  5279. lastCharWasDiatric = false;
  5280. } else if (ch in diatricMap) {
  5281. diatricString += ch;
  5282. ch = '';
  5283. // end of string, put the whole meaningful word
  5284. if (i === l - 1) {
  5285. ch = diatricMap[diatricString];
  5286. }
  5287. lastCharWasDiatric = true;
  5288. } else if (
  5289. // process symbol chars
  5290. symbol[ch] && !(uricFlag && uricChars
  5291. .indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars
  5292. // .indexOf(ch) !== -1) && !(markFlag && markChars
  5293. .indexOf(ch) !== -1)) {
  5294. ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
  5295. ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : '';
  5296. lastCharWasSymbol = true;
  5297. } else {
  5298. if (lastCharWasDiatric === true) {
  5299. ch = diatricMap[diatricString] + ch;
  5300. diatricString = '';
  5301. lastCharWasDiatric = false;
  5302. } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) {
  5303. // process latin chars
  5304. ch = ' ' + ch;
  5305. }
  5306. lastCharWasSymbol = false;
  5307. }
  5308. // add allowed chars
  5309. result += ch.replace(new RegExp('[^\\w\\s' + allowedChars + '_-]', 'g'), separator);
  5310. }
  5311. if (titleCase) {
  5312. result = result.replace(/(\w)(\S*)/g, function (_, i, r) {
  5313. var j = i.toUpperCase() + (r !== null ? r : '');
  5314. return (Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0) ? j : j.toLowerCase();
  5315. });
  5316. }
  5317. // eliminate duplicate separators
  5318. // add separator
  5319. // trim separators from start and end
  5320. result = result.replace(/\s+/g, separator)
  5321. .replace(new RegExp('\\' + separator + '+', 'g'), separator)
  5322. .replace(new RegExp('(^\\' + separator + '+|\\' + separator + '+$)', 'g'), '');
  5323. if (truncate && result.length > truncate) {
  5324. lucky = result.charAt(truncate) === separator;
  5325. result = result.slice(0, truncate);
  5326. if (!lucky) {
  5327. result = result.slice(0, result.lastIndexOf(separator));
  5328. }
  5329. }
  5330. if (!maintainCase && !titleCase) {
  5331. result = result.toLowerCase();
  5332. }
  5333. return result;
  5334. };
  5335. /**
  5336. * createSlug curried(opts)(input)
  5337. * @param {object|string} opts config object or input string
  5338. * @return {Function} function getSlugWithConfig()
  5339. **/
  5340. var createSlug = function createSlug(opts) {
  5341. /**
  5342. * getSlugWithConfig
  5343. * @param {string} input string
  5344. * @return {string} slug string
  5345. */
  5346. return function getSlugWithConfig(input) {
  5347. return getSlug(input, opts);
  5348. };
  5349. };
  5350. /**
  5351. * escape Chars
  5352. * @param {string} input string
  5353. */
  5354. var escapeChars = function escapeChars(input) {
  5355. return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, '\\$&');
  5356. };
  5357. /**
  5358. * check if the char is an already converted char from custom list
  5359. * @param {char} ch character to check
  5360. * @param {object} customReplacements custom translation map
  5361. */
  5362. var isReplacedCustomChar = function (ch, customReplacements) {
  5363. for (var c in customReplacements) {
  5364. if (customReplacements[c] === ch) {
  5365. return true;
  5366. }
  5367. }
  5368. };
  5369. if ('object' !== 'undefined' && module.exports) {
  5370. // export functions for use in Node
  5371. module.exports = getSlug;
  5372. module.exports.createSlug = createSlug;
  5373. } else if (typeof undefined !== 'undefined' && undefined.amd) {
  5374. // export function for use in AMD
  5375. undefined([], function () {
  5376. return getSlug;
  5377. });
  5378. } else {
  5379. // don't overwrite global if exists
  5380. try {
  5381. if (root.getSlug || root.createSlug) {
  5382. throw 'speakingurl: globals exists /(getSlug|createSlug)/';
  5383. } else {
  5384. root.getSlug = getSlug;
  5385. root.createSlug = createSlug;
  5386. }
  5387. } catch (e) {}
  5388. }
  5389. })(commonjsGlobal);
  5390. });
  5391. var speakingurl_1 = speakingurl.createSlug;
  5392. var speakingurl$1 = speakingurl;
  5393. var urlJoin = createCommonjsModule(function (module) {
  5394. (function (name, context, definition) {
  5395. if ('object' !== 'undefined' && module.exports) module.exports = definition();
  5396. else if (typeof undefined === 'function' && undefined.amd) undefined(definition);
  5397. else context[name] = definition();
  5398. })('urljoin', commonjsGlobal, function () {
  5399. function normalize (strArray) {
  5400. var resultArray = [];
  5401. if (strArray.length === 0) { return ''; }
  5402. if (typeof strArray[0] !== 'string') {
  5403. throw new TypeError('Url must be a string. Received ' + strArray[0]);
  5404. }
  5405. // If the first part is a plain protocol, we combine it with the next part.
  5406. if (strArray[0].match(/^[^/:]+:\/*$/) && strArray.length > 1) {
  5407. var first = strArray.shift();
  5408. strArray[0] = first + strArray[0];
  5409. }
  5410. // There must be two or three slashes in the file protocol, two slashes in anything else.
  5411. if (strArray[0].match(/^file:\/\/\//)) {
  5412. strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1:///');
  5413. } else {
  5414. strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1://');
  5415. }
  5416. for (var i = 0; i < strArray.length; i++) {
  5417. var component = strArray[i];
  5418. if (typeof component !== 'string') {
  5419. throw new TypeError('Url must be a string. Received ' + component);
  5420. }
  5421. if (component === '') { continue; }
  5422. if (i > 0) {
  5423. // Removing the starting slashes for each component but the first.
  5424. component = component.replace(/^[\/]+/, '');
  5425. }
  5426. if (i < strArray.length - 1) {
  5427. // Removing the ending slashes for each component but the last.
  5428. component = component.replace(/[\/]+$/, '');
  5429. } else {
  5430. // For the last component we will combine multiple slashes to a single one.
  5431. component = component.replace(/[\/]+$/, '/');
  5432. }
  5433. resultArray.push(component);
  5434. }
  5435. var str = resultArray.join('/');
  5436. // Each input component is now separated by a single slash except the possible first plain protocol part.
  5437. // remove trailing slash before parameters or hash
  5438. str = str.replace(/\/(\?|&|#[^!])/g, '$1');
  5439. // replace ? in parameters with &
  5440. var parts = str.split('?');
  5441. str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');
  5442. return str;
  5443. }
  5444. return function () {
  5445. var input;
  5446. if (typeof arguments[0] === 'object') {
  5447. input = arguments[0];
  5448. } else {
  5449. input = [].slice.call(arguments);
  5450. }
  5451. return normalize(input);
  5452. };
  5453. });
  5454. });
  5455. var uritemplate = createCommonjsModule(function (module) {
  5456. /*global unescape, module, define, window, global*/
  5457. /*
  5458. UriTemplate Copyright (c) 2012-2013 Franz Antesberger. All Rights Reserved.
  5459. Available via the MIT license.
  5460. */
  5461. (function (exportCallback) {
  5462. "use strict";
  5463. var UriTemplateError = (function () {
  5464. function UriTemplateError (options) {
  5465. this.options = options;
  5466. }
  5467. UriTemplateError.prototype.toString = function () {
  5468. if (JSON && JSON.stringify) {
  5469. return JSON.stringify(this.options);
  5470. }
  5471. else {
  5472. return this.options;
  5473. }
  5474. };
  5475. return UriTemplateError;
  5476. }());
  5477. var objectHelper = (function () {
  5478. function isArray (value) {
  5479. return Object.prototype.toString.apply(value) === '[object Array]';
  5480. }
  5481. function isString (value) {
  5482. return Object.prototype.toString.apply(value) === '[object String]';
  5483. }
  5484. function isNumber (value) {
  5485. return Object.prototype.toString.apply(value) === '[object Number]';
  5486. }
  5487. function isBoolean (value) {
  5488. return Object.prototype.toString.apply(value) === '[object Boolean]';
  5489. }
  5490. function join (arr, separator) {
  5491. var
  5492. result = '',
  5493. first = true,
  5494. index;
  5495. for (index = 0; index < arr.length; index += 1) {
  5496. if (first) {
  5497. first = false;
  5498. }
  5499. else {
  5500. result += separator;
  5501. }
  5502. result += arr[index];
  5503. }
  5504. return result;
  5505. }
  5506. function map (arr, mapper) {
  5507. var
  5508. result = [],
  5509. index = 0;
  5510. for (; index < arr.length; index += 1) {
  5511. result.push(mapper(arr[index]));
  5512. }
  5513. return result;
  5514. }
  5515. function filter (arr, predicate) {
  5516. var
  5517. result = [],
  5518. index = 0;
  5519. for (; index < arr.length; index += 1) {
  5520. if (predicate(arr[index])) {
  5521. result.push(arr[index]);
  5522. }
  5523. }
  5524. return result;
  5525. }
  5526. function deepFreezeUsingObjectFreeze (object) {
  5527. if (typeof object !== "object" || object === null) {
  5528. return object;
  5529. }
  5530. Object.freeze(object);
  5531. var property, propertyName;
  5532. for (propertyName in object) {
  5533. if (object.hasOwnProperty(propertyName)) {
  5534. property = object[propertyName];
  5535. // be aware, arrays are 'object', too
  5536. if (typeof property === "object") {
  5537. deepFreeze(property);
  5538. }
  5539. }
  5540. }
  5541. return object;
  5542. }
  5543. function deepFreeze (object) {
  5544. if (typeof Object.freeze === 'function') {
  5545. return deepFreezeUsingObjectFreeze(object);
  5546. }
  5547. return object;
  5548. }
  5549. return {
  5550. isArray: isArray,
  5551. isString: isString,
  5552. isNumber: isNumber,
  5553. isBoolean: isBoolean,
  5554. join: join,
  5555. map: map,
  5556. filter: filter,
  5557. deepFreeze: deepFreeze
  5558. };
  5559. }());
  5560. var charHelper = (function () {
  5561. function isAlpha (chr) {
  5562. return (chr >= 'a' && chr <= 'z') || ((chr >= 'A' && chr <= 'Z'));
  5563. }
  5564. function isDigit (chr) {
  5565. return chr >= '0' && chr <= '9';
  5566. }
  5567. function isHexDigit (chr) {
  5568. return isDigit(chr) || (chr >= 'a' && chr <= 'f') || (chr >= 'A' && chr <= 'F');
  5569. }
  5570. return {
  5571. isAlpha: isAlpha,
  5572. isDigit: isDigit,
  5573. isHexDigit: isHexDigit
  5574. };
  5575. }());
  5576. var pctEncoder = (function () {
  5577. var utf8 = {
  5578. encode: function (chr) {
  5579. // see http://ecmanaut.blogspot.de/2006/07/encoding-decoding-utf8-in-javascript.html
  5580. return unescape(encodeURIComponent(chr));
  5581. },
  5582. numBytes: function (firstCharCode) {
  5583. if (firstCharCode <= 0x7F) {
  5584. return 1;
  5585. }
  5586. else if (0xC2 <= firstCharCode && firstCharCode <= 0xDF) {
  5587. return 2;
  5588. }
  5589. else if (0xE0 <= firstCharCode && firstCharCode <= 0xEF) {
  5590. return 3;
  5591. }
  5592. else if (0xF0 <= firstCharCode && firstCharCode <= 0xF4) {
  5593. return 4;
  5594. }
  5595. // no valid first octet
  5596. return 0;
  5597. },
  5598. isValidFollowingCharCode: function (charCode) {
  5599. return 0x80 <= charCode && charCode <= 0xBF;
  5600. }
  5601. };
  5602. /**
  5603. * encodes a character, if needed or not.
  5604. * @param chr
  5605. * @return pct-encoded character
  5606. */
  5607. function encodeCharacter (chr) {
  5608. var
  5609. result = '',
  5610. octets = utf8.encode(chr),
  5611. octet,
  5612. index;
  5613. for (index = 0; index < octets.length; index += 1) {
  5614. octet = octets.charCodeAt(index);
  5615. result += '%' + (octet < 0x10 ? '0' : '') + octet.toString(16).toUpperCase();
  5616. }
  5617. return result;
  5618. }
  5619. /**
  5620. * Returns, whether the given text at start is in the form 'percent hex-digit hex-digit', like '%3F'
  5621. * @param text
  5622. * @param start
  5623. * @return {boolean|*|*}
  5624. */
  5625. function isPercentDigitDigit (text, start) {
  5626. return text.charAt(start) === '%' && charHelper.isHexDigit(text.charAt(start + 1)) && charHelper.isHexDigit(text.charAt(start + 2));
  5627. }
  5628. /**
  5629. * Parses a hex number from start with length 2.
  5630. * @param text a string
  5631. * @param start the start index of the 2-digit hex number
  5632. * @return {Number}
  5633. */
  5634. function parseHex2 (text, start) {
  5635. return parseInt(text.substr(start, 2), 16);
  5636. }
  5637. /**
  5638. * Returns whether or not the given char sequence is a correctly pct-encoded sequence.
  5639. * @param chr
  5640. * @return {boolean}
  5641. */
  5642. function isPctEncoded (chr) {
  5643. if (!isPercentDigitDigit(chr, 0)) {
  5644. return false;
  5645. }
  5646. var firstCharCode = parseHex2(chr, 1);
  5647. var numBytes = utf8.numBytes(firstCharCode);
  5648. if (numBytes === 0) {
  5649. return false;
  5650. }
  5651. for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {
  5652. if (!isPercentDigitDigit(chr, 3*byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(chr, 3*byteNumber + 1))) {
  5653. return false;
  5654. }
  5655. }
  5656. return true;
  5657. }
  5658. /**
  5659. * Reads as much as needed from the text, e.g. '%20' or '%C3%B6'. It does not decode!
  5660. * @param text
  5661. * @param startIndex
  5662. * @return the character or pct-string of the text at startIndex
  5663. */
  5664. function pctCharAt(text, startIndex) {
  5665. var chr = text.charAt(startIndex);
  5666. if (!isPercentDigitDigit(text, startIndex)) {
  5667. return chr;
  5668. }
  5669. var utf8CharCode = parseHex2(text, startIndex + 1);
  5670. var numBytes = utf8.numBytes(utf8CharCode);
  5671. if (numBytes === 0) {
  5672. return chr;
  5673. }
  5674. for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {
  5675. if (!isPercentDigitDigit(text, startIndex + 3 * byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(text, startIndex + 3 * byteNumber + 1))) {
  5676. return chr;
  5677. }
  5678. }
  5679. return text.substr(startIndex, 3 * numBytes);
  5680. }
  5681. return {
  5682. encodeCharacter: encodeCharacter,
  5683. isPctEncoded: isPctEncoded,
  5684. pctCharAt: pctCharAt
  5685. };
  5686. }());
  5687. var rfcCharHelper = (function () {
  5688. /**
  5689. * Returns if an character is an varchar character according 2.3 of rfc 6570
  5690. * @param chr
  5691. * @return (Boolean)
  5692. */
  5693. function isVarchar (chr) {
  5694. return charHelper.isAlpha(chr) || charHelper.isDigit(chr) || chr === '_' || pctEncoder.isPctEncoded(chr);
  5695. }
  5696. /**
  5697. * Returns if chr is an unreserved character according 1.5 of rfc 6570
  5698. * @param chr
  5699. * @return {Boolean}
  5700. */
  5701. function isUnreserved (chr) {
  5702. return charHelper.isAlpha(chr) || charHelper.isDigit(chr) || chr === '-' || chr === '.' || chr === '_' || chr === '~';
  5703. }
  5704. /**
  5705. * Returns if chr is an reserved character according 1.5 of rfc 6570
  5706. * or the percent character mentioned in 3.2.1.
  5707. * @param chr
  5708. * @return {Boolean}
  5709. */
  5710. function isReserved (chr) {
  5711. return chr === ':' || chr === '/' || chr === '?' || chr === '#' || chr === '[' || chr === ']' || chr === '@' || chr === '!' || chr === '$' || chr === '&' || chr === '(' ||
  5712. chr === ')' || chr === '*' || chr === '+' || chr === ',' || chr === ';' || chr === '=' || chr === "'";
  5713. }
  5714. return {
  5715. isVarchar: isVarchar,
  5716. isUnreserved: isUnreserved,
  5717. isReserved: isReserved
  5718. };
  5719. }());
  5720. /**
  5721. * encoding of rfc 6570
  5722. */
  5723. var encodingHelper = (function () {
  5724. function encode (text, passReserved) {
  5725. var
  5726. result = '',
  5727. index,
  5728. chr = '';
  5729. if (typeof text === "number" || typeof text === "boolean") {
  5730. text = text.toString();
  5731. }
  5732. for (index = 0; index < text.length; index += chr.length) {
  5733. chr = text.charAt(index);
  5734. result += rfcCharHelper.isUnreserved(chr) || (passReserved && rfcCharHelper.isReserved(chr)) ? chr : pctEncoder.encodeCharacter(chr);
  5735. }
  5736. return result;
  5737. }
  5738. function encodePassReserved (text) {
  5739. return encode(text, true);
  5740. }
  5741. function encodeLiteralCharacter (literal, index) {
  5742. var chr = pctEncoder.pctCharAt(literal, index);
  5743. if (chr.length > 1) {
  5744. return chr;
  5745. }
  5746. else {
  5747. return rfcCharHelper.isReserved(chr) || rfcCharHelper.isUnreserved(chr) ? chr : pctEncoder.encodeCharacter(chr);
  5748. }
  5749. }
  5750. function encodeLiteral (literal) {
  5751. var
  5752. result = '',
  5753. index,
  5754. chr = '';
  5755. for (index = 0; index < literal.length; index += chr.length) {
  5756. chr = pctEncoder.pctCharAt(literal, index);
  5757. if (chr.length > 1) {
  5758. result += chr;
  5759. }
  5760. else {
  5761. result += rfcCharHelper.isReserved(chr) || rfcCharHelper.isUnreserved(chr) ? chr : pctEncoder.encodeCharacter(chr);
  5762. }
  5763. }
  5764. return result;
  5765. }
  5766. return {
  5767. encode: encode,
  5768. encodePassReserved: encodePassReserved,
  5769. encodeLiteral: encodeLiteral,
  5770. encodeLiteralCharacter: encodeLiteralCharacter
  5771. };
  5772. }());
  5773. // the operators defined by rfc 6570
  5774. var operators = (function () {
  5775. var
  5776. bySymbol = {};
  5777. function create (symbol) {
  5778. bySymbol[symbol] = {
  5779. symbol: symbol,
  5780. separator: (symbol === '?') ? '&' : (symbol === '' || symbol === '+' || symbol === '#') ? ',' : symbol,
  5781. named: symbol === ';' || symbol === '&' || symbol === '?',
  5782. ifEmpty: (symbol === '&' || symbol === '?') ? '=' : '',
  5783. first: (symbol === '+' ) ? '' : symbol,
  5784. encode: (symbol === '+' || symbol === '#') ? encodingHelper.encodePassReserved : encodingHelper.encode,
  5785. toString: function () {
  5786. return this.symbol;
  5787. }
  5788. };
  5789. }
  5790. create('');
  5791. create('+');
  5792. create('#');
  5793. create('.');
  5794. create('/');
  5795. create(';');
  5796. create('?');
  5797. create('&');
  5798. return {
  5799. valueOf: function (chr) {
  5800. if (bySymbol[chr]) {
  5801. return bySymbol[chr];
  5802. }
  5803. if ("=,!@|".indexOf(chr) >= 0) {
  5804. return null;
  5805. }
  5806. return bySymbol[''];
  5807. }
  5808. };
  5809. }());
  5810. /**
  5811. * Detects, whether a given element is defined in the sense of rfc 6570
  5812. * Section 2.3 of the RFC makes clear defintions:
  5813. * * undefined and null are not defined.
  5814. * * the empty string is defined
  5815. * * an array ("list") is defined, if it is not empty (even if all elements are not defined)
  5816. * * an object ("map") is defined, if it contains at least one property with defined value
  5817. * @param object
  5818. * @return {Boolean}
  5819. */
  5820. function isDefined (object) {
  5821. var
  5822. propertyName;
  5823. if (object === null || object === undefined) {
  5824. return false;
  5825. }
  5826. if (objectHelper.isArray(object)) {
  5827. // Section 2.3: A variable defined as a list value is considered undefined if the list contains zero members
  5828. return object.length > 0;
  5829. }
  5830. if (typeof object === "string" || typeof object === "number" || typeof object === "boolean") {
  5831. // falsy values like empty strings, false or 0 are "defined"
  5832. return true;
  5833. }
  5834. // else Object
  5835. for (propertyName in object) {
  5836. if (object.hasOwnProperty(propertyName) && isDefined(object[propertyName])) {
  5837. return true;
  5838. }
  5839. }
  5840. return false;
  5841. }
  5842. var LiteralExpression = (function () {
  5843. function LiteralExpression (literal) {
  5844. this.literal = encodingHelper.encodeLiteral(literal);
  5845. }
  5846. LiteralExpression.prototype.expand = function () {
  5847. return this.literal;
  5848. };
  5849. LiteralExpression.prototype.toString = LiteralExpression.prototype.expand;
  5850. return LiteralExpression;
  5851. }());
  5852. var parse = (function () {
  5853. function parseExpression (expressionText) {
  5854. var
  5855. operator,
  5856. varspecs = [],
  5857. varspec = null,
  5858. varnameStart = null,
  5859. maxLengthStart = null,
  5860. index,
  5861. chr = '';
  5862. function closeVarname () {
  5863. var varname = expressionText.substring(varnameStart, index);
  5864. if (varname.length === 0) {
  5865. throw new UriTemplateError({expressionText: expressionText, message: "a varname must be specified", position: index});
  5866. }
  5867. varspec = {varname: varname, exploded: false, maxLength: null};
  5868. varnameStart = null;
  5869. }
  5870. function closeMaxLength () {
  5871. if (maxLengthStart === index) {
  5872. throw new UriTemplateError({expressionText: expressionText, message: "after a ':' you have to specify the length", position: index});
  5873. }
  5874. varspec.maxLength = parseInt(expressionText.substring(maxLengthStart, index), 10);
  5875. maxLengthStart = null;
  5876. }
  5877. operator = (function (operatorText) {
  5878. var op = operators.valueOf(operatorText);
  5879. if (op === null) {
  5880. throw new UriTemplateError({expressionText: expressionText, message: "illegal use of reserved operator", position: index, operator: operatorText});
  5881. }
  5882. return op;
  5883. }(expressionText.charAt(0)));
  5884. index = operator.symbol.length;
  5885. varnameStart = index;
  5886. for (; index < expressionText.length; index += chr.length) {
  5887. chr = pctEncoder.pctCharAt(expressionText, index);
  5888. if (varnameStart !== null) {
  5889. // the spec says: varname = varchar *( ["."] varchar )
  5890. // so a dot is allowed except for the first char
  5891. if (chr === '.') {
  5892. if (varnameStart === index) {
  5893. throw new UriTemplateError({expressionText: expressionText, message: "a varname MUST NOT start with a dot", position: index});
  5894. }
  5895. continue;
  5896. }
  5897. if (rfcCharHelper.isVarchar(chr)) {
  5898. continue;
  5899. }
  5900. closeVarname();
  5901. }
  5902. if (maxLengthStart !== null) {
  5903. if (index === maxLengthStart && chr === '0') {
  5904. throw new UriTemplateError({expressionText: expressionText, message: "A :prefix must not start with digit 0", position: index});
  5905. }
  5906. if (charHelper.isDigit(chr)) {
  5907. if (index - maxLengthStart >= 4) {
  5908. throw new UriTemplateError({expressionText: expressionText, message: "A :prefix must have max 4 digits", position: index});
  5909. }
  5910. continue;
  5911. }
  5912. closeMaxLength();
  5913. }
  5914. if (chr === ':') {
  5915. if (varspec.maxLength !== null) {
  5916. throw new UriTemplateError({expressionText: expressionText, message: "only one :maxLength is allowed per varspec", position: index});
  5917. }
  5918. if (varspec.exploded) {
  5919. throw new UriTemplateError({expressionText: expressionText, message: "an exploeded varspec MUST NOT be varspeced", position: index});
  5920. }
  5921. maxLengthStart = index + 1;
  5922. continue;
  5923. }
  5924. if (chr === '*') {
  5925. if (varspec === null) {
  5926. throw new UriTemplateError({expressionText: expressionText, message: "exploded without varspec", position: index});
  5927. }
  5928. if (varspec.exploded) {
  5929. throw new UriTemplateError({expressionText: expressionText, message: "exploded twice", position: index});
  5930. }
  5931. if (varspec.maxLength) {
  5932. throw new UriTemplateError({expressionText: expressionText, message: "an explode (*) MUST NOT follow to a prefix", position: index});
  5933. }
  5934. varspec.exploded = true;
  5935. continue;
  5936. }
  5937. // the only legal character now is the comma
  5938. if (chr === ',') {
  5939. varspecs.push(varspec);
  5940. varspec = null;
  5941. varnameStart = index + 1;
  5942. continue;
  5943. }
  5944. throw new UriTemplateError({expressionText: expressionText, message: "illegal character", character: chr, position: index});
  5945. } // for chr
  5946. if (varnameStart !== null) {
  5947. closeVarname();
  5948. }
  5949. if (maxLengthStart !== null) {
  5950. closeMaxLength();
  5951. }
  5952. varspecs.push(varspec);
  5953. return new VariableExpression(expressionText, operator, varspecs);
  5954. }
  5955. function parse (uriTemplateText) {
  5956. // assert filled string
  5957. var
  5958. index,
  5959. chr,
  5960. expressions = [],
  5961. braceOpenIndex = null,
  5962. literalStart = 0;
  5963. for (index = 0; index < uriTemplateText.length; index += 1) {
  5964. chr = uriTemplateText.charAt(index);
  5965. if (literalStart !== null) {
  5966. if (chr === '}') {
  5967. throw new UriTemplateError({templateText: uriTemplateText, message: "unopened brace closed", position: index});
  5968. }
  5969. if (chr === '{') {
  5970. if (literalStart < index) {
  5971. expressions.push(new LiteralExpression(uriTemplateText.substring(literalStart, index)));
  5972. }
  5973. literalStart = null;
  5974. braceOpenIndex = index;
  5975. }
  5976. continue;
  5977. }
  5978. if (braceOpenIndex !== null) {
  5979. // here just { is forbidden
  5980. if (chr === '{') {
  5981. throw new UriTemplateError({templateText: uriTemplateText, message: "brace already opened", position: index});
  5982. }
  5983. if (chr === '}') {
  5984. if (braceOpenIndex + 1 === index) {
  5985. throw new UriTemplateError({templateText: uriTemplateText, message: "empty braces", position: braceOpenIndex});
  5986. }
  5987. try {
  5988. expressions.push(parseExpression(uriTemplateText.substring(braceOpenIndex + 1, index)));
  5989. }
  5990. catch (error) {
  5991. if (error.prototype === UriTemplateError.prototype) {
  5992. throw new UriTemplateError({templateText: uriTemplateText, message: error.options.message, position: braceOpenIndex + error.options.position, details: error.options});
  5993. }
  5994. throw error;
  5995. }
  5996. braceOpenIndex = null;
  5997. literalStart = index + 1;
  5998. }
  5999. continue;
  6000. }
  6001. throw new Error('reached unreachable code');
  6002. }
  6003. if (braceOpenIndex !== null) {
  6004. throw new UriTemplateError({templateText: uriTemplateText, message: "unclosed brace", position: braceOpenIndex});
  6005. }
  6006. if (literalStart < uriTemplateText.length) {
  6007. expressions.push(new LiteralExpression(uriTemplateText.substr(literalStart)));
  6008. }
  6009. return new UriTemplate(uriTemplateText, expressions);
  6010. }
  6011. return parse;
  6012. }());
  6013. var VariableExpression = (function () {
  6014. // helper function if JSON is not available
  6015. function prettyPrint (value) {
  6016. return (JSON && JSON.stringify) ? JSON.stringify(value) : value;
  6017. }
  6018. function isEmpty (value) {
  6019. if (!isDefined(value)) {
  6020. return true;
  6021. }
  6022. if (objectHelper.isString(value)) {
  6023. return value === '';
  6024. }
  6025. if (objectHelper.isNumber(value) || objectHelper.isBoolean(value)) {
  6026. return false;
  6027. }
  6028. if (objectHelper.isArray(value)) {
  6029. return value.length === 0;
  6030. }
  6031. for (var propertyName in value) {
  6032. if (value.hasOwnProperty(propertyName)) {
  6033. return false;
  6034. }
  6035. }
  6036. return true;
  6037. }
  6038. function propertyArray (object) {
  6039. var
  6040. result = [],
  6041. propertyName;
  6042. for (propertyName in object) {
  6043. if (object.hasOwnProperty(propertyName)) {
  6044. result.push({name: propertyName, value: object[propertyName]});
  6045. }
  6046. }
  6047. return result;
  6048. }
  6049. function VariableExpression (templateText, operator, varspecs) {
  6050. this.templateText = templateText;
  6051. this.operator = operator;
  6052. this.varspecs = varspecs;
  6053. }
  6054. VariableExpression.prototype.toString = function () {
  6055. return this.templateText;
  6056. };
  6057. function expandSimpleValue(varspec, operator, value) {
  6058. var result = '';
  6059. value = value.toString();
  6060. if (operator.named) {
  6061. result += encodingHelper.encodeLiteral(varspec.varname);
  6062. if (value === '') {
  6063. result += operator.ifEmpty;
  6064. return result;
  6065. }
  6066. result += '=';
  6067. }
  6068. if (varspec.maxLength !== null) {
  6069. value = value.substr(0, varspec.maxLength);
  6070. }
  6071. result += operator.encode(value);
  6072. return result;
  6073. }
  6074. function valueDefined (nameValue) {
  6075. return isDefined(nameValue.value);
  6076. }
  6077. function expandNotExploded(varspec, operator, value) {
  6078. var
  6079. arr = [],
  6080. result = '';
  6081. if (operator.named) {
  6082. result += encodingHelper.encodeLiteral(varspec.varname);
  6083. if (isEmpty(value)) {
  6084. result += operator.ifEmpty;
  6085. return result;
  6086. }
  6087. result += '=';
  6088. }
  6089. if (objectHelper.isArray(value)) {
  6090. arr = value;
  6091. arr = objectHelper.filter(arr, isDefined);
  6092. arr = objectHelper.map(arr, operator.encode);
  6093. result += objectHelper.join(arr, ',');
  6094. }
  6095. else {
  6096. arr = propertyArray(value);
  6097. arr = objectHelper.filter(arr, valueDefined);
  6098. arr = objectHelper.map(arr, function (nameValue) {
  6099. return operator.encode(nameValue.name) + ',' + operator.encode(nameValue.value);
  6100. });
  6101. result += objectHelper.join(arr, ',');
  6102. }
  6103. return result;
  6104. }
  6105. function expandExplodedNamed (varspec, operator, value) {
  6106. var
  6107. isArray = objectHelper.isArray(value),
  6108. arr = [];
  6109. if (isArray) {
  6110. arr = value;
  6111. arr = objectHelper.filter(arr, isDefined);
  6112. arr = objectHelper.map(arr, function (listElement) {
  6113. var tmp = encodingHelper.encodeLiteral(varspec.varname);
  6114. if (isEmpty(listElement)) {
  6115. tmp += operator.ifEmpty;
  6116. }
  6117. else {
  6118. tmp += '=' + operator.encode(listElement);
  6119. }
  6120. return tmp;
  6121. });
  6122. }
  6123. else {
  6124. arr = propertyArray(value);
  6125. arr = objectHelper.filter(arr, valueDefined);
  6126. arr = objectHelper.map(arr, function (nameValue) {
  6127. var tmp = encodingHelper.encodeLiteral(nameValue.name);
  6128. if (isEmpty(nameValue.value)) {
  6129. tmp += operator.ifEmpty;
  6130. }
  6131. else {
  6132. tmp += '=' + operator.encode(nameValue.value);
  6133. }
  6134. return tmp;
  6135. });
  6136. }
  6137. return objectHelper.join(arr, operator.separator);
  6138. }
  6139. function expandExplodedUnnamed (operator, value) {
  6140. var
  6141. arr = [],
  6142. result = '';
  6143. if (objectHelper.isArray(value)) {
  6144. arr = value;
  6145. arr = objectHelper.filter(arr, isDefined);
  6146. arr = objectHelper.map(arr, operator.encode);
  6147. result += objectHelper.join(arr, operator.separator);
  6148. }
  6149. else {
  6150. arr = propertyArray(value);
  6151. arr = objectHelper.filter(arr, function (nameValue) {
  6152. return isDefined(nameValue.value);
  6153. });
  6154. arr = objectHelper.map(arr, function (nameValue) {
  6155. return operator.encode(nameValue.name) + '=' + operator.encode(nameValue.value);
  6156. });
  6157. result += objectHelper.join(arr, operator.separator);
  6158. }
  6159. return result;
  6160. }
  6161. VariableExpression.prototype.expand = function (variables) {
  6162. var
  6163. expanded = [],
  6164. index,
  6165. varspec,
  6166. value,
  6167. valueIsArr,
  6168. oneExploded = false,
  6169. operator = this.operator;
  6170. // expand each varspec and join with operator's separator
  6171. for (index = 0; index < this.varspecs.length; index += 1) {
  6172. varspec = this.varspecs[index];
  6173. value = variables[varspec.varname];
  6174. // if (!isDefined(value)) {
  6175. // if (variables.hasOwnProperty(varspec.name)) {
  6176. if (value === null || value === undefined) {
  6177. continue;
  6178. }
  6179. if (varspec.exploded) {
  6180. oneExploded = true;
  6181. }
  6182. valueIsArr = objectHelper.isArray(value);
  6183. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6184. expanded.push(expandSimpleValue(varspec, operator, value));
  6185. }
  6186. else if (varspec.maxLength && isDefined(value)) {
  6187. // 2.4.1 of the spec says: "Prefix modifiers are not applicable to variables that have composite values."
  6188. throw new Error('Prefix modifiers are not applicable to variables that have composite values. You tried to expand ' + this + " with " + prettyPrint(value));
  6189. }
  6190. else if (!varspec.exploded) {
  6191. if (operator.named || !isEmpty(value)) {
  6192. expanded.push(expandNotExploded(varspec, operator, value));
  6193. }
  6194. }
  6195. else if (isDefined(value)) {
  6196. if (operator.named) {
  6197. expanded.push(expandExplodedNamed(varspec, operator, value));
  6198. }
  6199. else {
  6200. expanded.push(expandExplodedUnnamed(operator, value));
  6201. }
  6202. }
  6203. }
  6204. if (expanded.length === 0) {
  6205. return "";
  6206. }
  6207. else {
  6208. return operator.first + objectHelper.join(expanded, operator.separator);
  6209. }
  6210. };
  6211. return VariableExpression;
  6212. }());
  6213. var UriTemplate = (function () {
  6214. function UriTemplate (templateText, expressions) {
  6215. this.templateText = templateText;
  6216. this.expressions = expressions;
  6217. objectHelper.deepFreeze(this);
  6218. }
  6219. UriTemplate.prototype.toString = function () {
  6220. return this.templateText;
  6221. };
  6222. UriTemplate.prototype.expand = function (variables) {
  6223. // this.expressions.map(function (expression) {return expression.expand(variables);}).join('');
  6224. var
  6225. index,
  6226. result = '';
  6227. for (index = 0; index < this.expressions.length; index += 1) {
  6228. result += this.expressions[index].expand(variables);
  6229. }
  6230. return result;
  6231. };
  6232. UriTemplate.parse = parse;
  6233. UriTemplate.UriTemplateError = UriTemplateError;
  6234. return UriTemplate;
  6235. }());
  6236. exportCallback(UriTemplate);
  6237. }(function (UriTemplate) {
  6238. "use strict";
  6239. // export UriTemplate, when module is present, or pass it to window or global
  6240. if ('object' !== "undefined") {
  6241. module.exports = UriTemplate;
  6242. }
  6243. else if (typeof undefined === "function") {
  6244. undefined([],function() {
  6245. return UriTemplate;
  6246. });
  6247. }
  6248. else if (typeof window !== "undefined") {
  6249. window.UriTemplate = UriTemplate;
  6250. }
  6251. else {
  6252. commonjsGlobal.UriTemplate = UriTemplate;
  6253. }
  6254. }
  6255. ));
  6256. });
  6257. var store2 = createCommonjsModule(function (module) {
  6258. /*! store2 - v2.10.0 - 2019-09-27
  6259. * Copyright (c) 2019 Nathan Bubna; Licensed (MIT OR GPL-3.0) */
  6260. ;(function(window, define) {
  6261. var _ = {
  6262. version: "2.10.0",
  6263. areas: {},
  6264. apis: {},
  6265. // utilities
  6266. inherit: function(api, o) {
  6267. for (var p in api) {
  6268. if (!o.hasOwnProperty(p)) {
  6269. Object.defineProperty(o, p, Object.getOwnPropertyDescriptor(api, p));
  6270. }
  6271. }
  6272. return o;
  6273. },
  6274. stringify: function(d) {
  6275. return d === undefined || typeof d === "function" ? d+'' : JSON.stringify(d);
  6276. },
  6277. parse: function(s) {
  6278. // if it doesn't parse, return as is
  6279. try{ return JSON.parse(s); }catch(e){ return s; }
  6280. },
  6281. // extension hooks
  6282. fn: function(name, fn) {
  6283. _.storeAPI[name] = fn;
  6284. for (var api in _.apis) {
  6285. _.apis[api][name] = fn;
  6286. }
  6287. },
  6288. get: function(area, key){ return area.getItem(key); },
  6289. set: function(area, key, string){ area.setItem(key, string); },
  6290. remove: function(area, key){ area.removeItem(key); },
  6291. key: function(area, i){ return area.key(i); },
  6292. length: function(area){ return area.length; },
  6293. clear: function(area){ area.clear(); },
  6294. // core functions
  6295. Store: function(id, area, namespace) {
  6296. var store = _.inherit(_.storeAPI, function(key, data, overwrite) {
  6297. if (arguments.length === 0){ return store.getAll(); }
  6298. if (typeof data === "function"){ return store.transact(key, data, overwrite); }// fn=data, alt=overwrite
  6299. if (data !== undefined){ return store.set(key, data, overwrite); }
  6300. if (typeof key === "string" || typeof key === "number"){ return store.get(key); }
  6301. if (typeof key === "function"){ return store.each(key); }
  6302. if (!key){ return store.clear(); }
  6303. return store.setAll(key, data);// overwrite=data, data=key
  6304. });
  6305. store._id = id;
  6306. try {
  6307. var testKey = '_-bad-_';
  6308. area.setItem(testKey, 'wolf');
  6309. store._area = area;
  6310. area.removeItem(testKey);
  6311. } catch (e) {}
  6312. if (!store._area) {
  6313. store._area = _.storage('fake');
  6314. }
  6315. store._ns = namespace || '';
  6316. if (!_.areas[id]) {
  6317. _.areas[id] = store._area;
  6318. }
  6319. if (!_.apis[store._ns+store._id]) {
  6320. _.apis[store._ns+store._id] = store;
  6321. }
  6322. return store;
  6323. },
  6324. storeAPI: {
  6325. // admin functions
  6326. area: function(id, area) {
  6327. var store = this[id];
  6328. if (!store || !store.area) {
  6329. store = _.Store(id, area, this._ns);//new area-specific api in this namespace
  6330. if (!this[id]){ this[id] = store; }
  6331. }
  6332. return store;
  6333. },
  6334. namespace: function(namespace, singleArea) {
  6335. if (!namespace){
  6336. return this._ns ? this._ns.substring(0,this._ns.length-1) : '';
  6337. }
  6338. var ns = namespace, store = this[ns];
  6339. if (!store || !store.namespace) {
  6340. store = _.Store(this._id, this._area, this._ns+ns+'.');//new namespaced api
  6341. if (!this[ns]){ this[ns] = store; }
  6342. if (!singleArea) {
  6343. for (var name in _.areas) {
  6344. store.area(name, _.areas[name]);
  6345. }
  6346. }
  6347. }
  6348. return store;
  6349. },
  6350. isFake: function(){ return this._area.name === 'fake'; },
  6351. toString: function() {
  6352. return 'store'+(this._ns?'.'+this.namespace():'')+'['+this._id+']';
  6353. },
  6354. // storage functions
  6355. has: function(key) {
  6356. if (this._area.has) {
  6357. return this._area.has(this._in(key));//extension hook
  6358. }
  6359. return !!(this._in(key) in this._area);
  6360. },
  6361. size: function(){ return this.keys().length; },
  6362. each: function(fn, fill) {// fill is used by keys(fillList) and getAll(fillList))
  6363. for (var i=0, m=_.length(this._area); i<m; i++) {
  6364. var key = this._out(_.key(this._area, i));
  6365. if (key !== undefined) {
  6366. if (fn.call(this, key, this.get(key), fill) === false) {
  6367. break;
  6368. }
  6369. }
  6370. if (m > _.length(this._area)) { m--; i--; }// in case of removeItem
  6371. }
  6372. return fill || this;
  6373. },
  6374. keys: function(fillList) {
  6375. return this.each(function(k, v, list){ list.push(k); }, fillList || []);
  6376. },
  6377. get: function(key, alt) {
  6378. var s = _.get(this._area, this._in(key));
  6379. return s !== null ? _.parse(s) : alt || s;// support alt for easy default mgmt
  6380. },
  6381. getAll: function(fillObj) {
  6382. return this.each(function(k, v, all){ all[k] = v; }, fillObj || {});
  6383. },
  6384. transact: function(key, fn, alt) {
  6385. var val = this.get(key, alt),
  6386. ret = fn(val);
  6387. this.set(key, ret === undefined ? val : ret);
  6388. return this;
  6389. },
  6390. set: function(key, data, overwrite) {
  6391. var d = this.get(key);
  6392. if (d != null && overwrite === false) {
  6393. return data;
  6394. }
  6395. return _.set(this._area, this._in(key), _.stringify(data), overwrite) || d;
  6396. },
  6397. setAll: function(data, overwrite) {
  6398. var changed, val;
  6399. for (var key in data) {
  6400. val = data[key];
  6401. if (this.set(key, val, overwrite) !== val) {
  6402. changed = true;
  6403. }
  6404. }
  6405. return changed;
  6406. },
  6407. add: function(key, data) {
  6408. var d = this.get(key);
  6409. if (d instanceof Array) {
  6410. data = d.concat(data);
  6411. } else if (d !== null) {
  6412. var type = typeof d;
  6413. if (type === typeof data && type === 'object') {
  6414. for (var k in data) {
  6415. d[k] = data[k];
  6416. }
  6417. data = d;
  6418. } else {
  6419. data = d + data;
  6420. }
  6421. }
  6422. _.set(this._area, this._in(key), _.stringify(data));
  6423. return data;
  6424. },
  6425. remove: function(key, alt) {
  6426. var d = this.get(key, alt);
  6427. _.remove(this._area, this._in(key));
  6428. return d;
  6429. },
  6430. clear: function() {
  6431. if (!this._ns) {
  6432. _.clear(this._area);
  6433. } else {
  6434. this.each(function(k){ _.remove(this._area, this._in(k)); }, 1);
  6435. }
  6436. return this;
  6437. },
  6438. clearAll: function() {
  6439. var area = this._area;
  6440. for (var id in _.areas) {
  6441. if (_.areas.hasOwnProperty(id)) {
  6442. this._area = _.areas[id];
  6443. this.clear();
  6444. }
  6445. }
  6446. this._area = area;
  6447. return this;
  6448. },
  6449. // internal use functions
  6450. _in: function(k) {
  6451. if (typeof k !== "string"){ k = _.stringify(k); }
  6452. return this._ns ? this._ns + k : k;
  6453. },
  6454. _out: function(k) {
  6455. return this._ns ?
  6456. k && k.indexOf(this._ns) === 0 ?
  6457. k.substring(this._ns.length) :
  6458. undefined : // so each() knows to skip it
  6459. k;
  6460. }
  6461. },// end _.storeAPI
  6462. storage: function(name) {
  6463. return _.inherit(_.storageAPI, { items: {}, name: name });
  6464. },
  6465. storageAPI: {
  6466. length: 0,
  6467. has: function(k){ return this.items.hasOwnProperty(k); },
  6468. key: function(i) {
  6469. var c = 0;
  6470. for (var k in this.items){
  6471. if (this.has(k) && i === c++) {
  6472. return k;
  6473. }
  6474. }
  6475. },
  6476. setItem: function(k, v) {
  6477. if (!this.has(k)) {
  6478. this.length++;
  6479. }
  6480. this.items[k] = v;
  6481. },
  6482. removeItem: function(k) {
  6483. if (this.has(k)) {
  6484. delete this.items[k];
  6485. this.length--;
  6486. }
  6487. },
  6488. getItem: function(k){ return this.has(k) ? this.items[k] : null; },
  6489. clear: function(){ for (var k in this.items){ this.removeItem(k); } }
  6490. }// end _.storageAPI
  6491. };
  6492. var store =
  6493. // safely set this up (throws error in IE10/32bit mode for local files)
  6494. _.Store("local", (function(){try{ return localStorage; }catch(e){}})());
  6495. store.local = store;// for completeness
  6496. store._ = _;// for extenders and debuggers...
  6497. // safely setup store.session (throws exception in FF for file:/// urls)
  6498. store.area("session", (function(){try{ return sessionStorage; }catch(e){}})());
  6499. store.area("page", _.storage("page"));
  6500. if (typeof define === 'function' && define.amd !== undefined) {
  6501. define('store2', [], function () {
  6502. return store;
  6503. });
  6504. } else if ('object' !== 'undefined' && module.exports) {
  6505. module.exports = store;
  6506. } else {
  6507. // expose the primary store fn to the global object and save conflicts
  6508. if (window.store){ _.conflict = window.store; }
  6509. window.store = store;
  6510. }
  6511. })(commonjsGlobal, commonjsGlobal && commonjsGlobal.define);
  6512. });
  6513. 'use strict';
  6514. var bind$1 = function bind(fn, thisArg) {
  6515. return function wrap() {
  6516. var args = new Array(arguments.length);
  6517. for (var i = 0; i < args.length; i++) {
  6518. args[i] = arguments[i];
  6519. }
  6520. return fn.apply(thisArg, args);
  6521. };
  6522. };
  6523. /*!
  6524. * Determine if an object is a Buffer
  6525. *
  6526. * @author Feross Aboukhadijeh <https://feross.org>
  6527. * @license MIT
  6528. */
  6529. var isBuffer = function isBuffer (obj) {
  6530. return obj != null && obj.constructor != null &&
  6531. typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
  6532. };
  6533. 'use strict';
  6534. /*global toString:true*/
  6535. // utils is a library of generic helper functions non-specific to axios
  6536. var toString = Object.prototype.toString;
  6537. /**
  6538. * Determine if a value is an Array
  6539. *
  6540. * @param {Object} val The value to test
  6541. * @returns {boolean} True if value is an Array, otherwise false
  6542. */
  6543. function isArray(val) {
  6544. return toString.call(val) === '[object Array]';
  6545. }
  6546. /**
  6547. * Determine if a value is an ArrayBuffer
  6548. *
  6549. * @param {Object} val The value to test
  6550. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  6551. */
  6552. function isArrayBuffer(val) {
  6553. return toString.call(val) === '[object ArrayBuffer]';
  6554. }
  6555. /**
  6556. * Determine if a value is a FormData
  6557. *
  6558. * @param {Object} val The value to test
  6559. * @returns {boolean} True if value is an FormData, otherwise false
  6560. */
  6561. function isFormData(val) {
  6562. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  6563. }
  6564. /**
  6565. * Determine if a value is a view on an ArrayBuffer
  6566. *
  6567. * @param {Object} val The value to test
  6568. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  6569. */
  6570. function isArrayBufferView(val) {
  6571. var result;
  6572. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  6573. result = ArrayBuffer.isView(val);
  6574. } else {
  6575. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  6576. }
  6577. return result;
  6578. }
  6579. /**
  6580. * Determine if a value is a String
  6581. *
  6582. * @param {Object} val The value to test
  6583. * @returns {boolean} True if value is a String, otherwise false
  6584. */
  6585. function isString(val) {
  6586. return typeof val === 'string';
  6587. }
  6588. /**
  6589. * Determine if a value is a Number
  6590. *
  6591. * @param {Object} val The value to test
  6592. * @returns {boolean} True if value is a Number, otherwise false
  6593. */
  6594. function isNumber(val) {
  6595. return typeof val === 'number';
  6596. }
  6597. /**
  6598. * Determine if a value is undefined
  6599. *
  6600. * @param {Object} val The value to test
  6601. * @returns {boolean} True if the value is undefined, otherwise false
  6602. */
  6603. function isUndefined(val) {
  6604. return typeof val === 'undefined';
  6605. }
  6606. /**
  6607. * Determine if a value is an Object
  6608. *
  6609. * @param {Object} val The value to test
  6610. * @returns {boolean} True if value is an Object, otherwise false
  6611. */
  6612. function isObject(val) {
  6613. return val !== null && typeof val === 'object';
  6614. }
  6615. /**
  6616. * Determine if a value is a Date
  6617. *
  6618. * @param {Object} val The value to test
  6619. * @returns {boolean} True if value is a Date, otherwise false
  6620. */
  6621. function isDate(val) {
  6622. return toString.call(val) === '[object Date]';
  6623. }
  6624. /**
  6625. * Determine if a value is a File
  6626. *
  6627. * @param {Object} val The value to test
  6628. * @returns {boolean} True if value is a File, otherwise false
  6629. */
  6630. function isFile(val) {
  6631. return toString.call(val) === '[object File]';
  6632. }
  6633. /**
  6634. * Determine if a value is a Blob
  6635. *
  6636. * @param {Object} val The value to test
  6637. * @returns {boolean} True if value is a Blob, otherwise false
  6638. */
  6639. function isBlob(val) {
  6640. return toString.call(val) === '[object Blob]';
  6641. }
  6642. /**
  6643. * Determine if a value is a Function
  6644. *
  6645. * @param {Object} val The value to test
  6646. * @returns {boolean} True if value is a Function, otherwise false
  6647. */
  6648. function isFunction(val) {
  6649. return toString.call(val) === '[object Function]';
  6650. }
  6651. /**
  6652. * Determine if a value is a Stream
  6653. *
  6654. * @param {Object} val The value to test
  6655. * @returns {boolean} True if value is a Stream, otherwise false
  6656. */
  6657. function isStream(val) {
  6658. return isObject(val) && isFunction(val.pipe);
  6659. }
  6660. /**
  6661. * Determine if a value is a URLSearchParams object
  6662. *
  6663. * @param {Object} val The value to test
  6664. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  6665. */
  6666. function isURLSearchParams(val) {
  6667. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  6668. }
  6669. /**
  6670. * Trim excess whitespace off the beginning and end of a string
  6671. *
  6672. * @param {String} str The String to trim
  6673. * @returns {String} The String freed of excess whitespace
  6674. */
  6675. function trim(str) {
  6676. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  6677. }
  6678. /**
  6679. * Determine if we're running in a standard browser environment
  6680. *
  6681. * This allows axios to run in a web worker, and react-native.
  6682. * Both environments support XMLHttpRequest, but not fully standard globals.
  6683. *
  6684. * web workers:
  6685. * typeof window -> undefined
  6686. * typeof document -> undefined
  6687. *
  6688. * react-native:
  6689. * navigator.product -> 'ReactNative'
  6690. * nativescript
  6691. * navigator.product -> 'NativeScript' or 'NS'
  6692. */
  6693. function isStandardBrowserEnv() {
  6694. if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
  6695. navigator.product === 'NativeScript' ||
  6696. navigator.product === 'NS')) {
  6697. return false;
  6698. }
  6699. return (
  6700. typeof window !== 'undefined' &&
  6701. typeof document !== 'undefined'
  6702. );
  6703. }
  6704. /**
  6705. * Iterate over an Array or an Object invoking a function for each item.
  6706. *
  6707. * If `obj` is an Array callback will be called passing
  6708. * the value, index, and complete array for each item.
  6709. *
  6710. * If 'obj' is an Object callback will be called passing
  6711. * the value, key, and complete object for each property.
  6712. *
  6713. * @param {Object|Array} obj The object to iterate
  6714. * @param {Function} fn The callback to invoke for each item
  6715. */
  6716. function forEach(obj, fn) {
  6717. // Don't bother if no value provided
  6718. if (obj === null || typeof obj === 'undefined') {
  6719. return;
  6720. }
  6721. // Force an array if not already something iterable
  6722. if (typeof obj !== 'object') {
  6723. /*eslint no-param-reassign:0*/
  6724. obj = [obj];
  6725. }
  6726. if (isArray(obj)) {
  6727. // Iterate over array values
  6728. for (var i = 0, l = obj.length; i < l; i++) {
  6729. fn.call(null, obj[i], i, obj);
  6730. }
  6731. } else {
  6732. // Iterate over object keys
  6733. for (var key in obj) {
  6734. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  6735. fn.call(null, obj[key], key, obj);
  6736. }
  6737. }
  6738. }
  6739. }
  6740. /**
  6741. * Accepts varargs expecting each argument to be an object, then
  6742. * immutably merges the properties of each object and returns result.
  6743. *
  6744. * When multiple objects contain the same key the later object in
  6745. * the arguments list will take precedence.
  6746. *
  6747. * Example:
  6748. *
  6749. * ```js
  6750. * var result = merge({foo: 123}, {foo: 456});
  6751. * console.log(result.foo); // outputs 456
  6752. * ```
  6753. *
  6754. * @param {Object} obj1 Object to merge
  6755. * @returns {Object} Result of all merge properties
  6756. */
  6757. function merge(/* obj1, obj2, obj3, ... */) {
  6758. var result = {};
  6759. function assignValue(val, key) {
  6760. if (typeof result[key] === 'object' && typeof val === 'object') {
  6761. result[key] = merge(result[key], val);
  6762. } else {
  6763. result[key] = val;
  6764. }
  6765. }
  6766. for (var i = 0, l = arguments.length; i < l; i++) {
  6767. forEach(arguments[i], assignValue);
  6768. }
  6769. return result;
  6770. }
  6771. /**
  6772. * Function equal to merge with the difference being that no reference
  6773. * to original objects is kept.
  6774. *
  6775. * @see merge
  6776. * @param {Object} obj1 Object to merge
  6777. * @returns {Object} Result of all merge properties
  6778. */
  6779. function deepMerge(/* obj1, obj2, obj3, ... */) {
  6780. var result = {};
  6781. function assignValue(val, key) {
  6782. if (typeof result[key] === 'object' && typeof val === 'object') {
  6783. result[key] = deepMerge(result[key], val);
  6784. } else if (typeof val === 'object') {
  6785. result[key] = deepMerge({}, val);
  6786. } else {
  6787. result[key] = val;
  6788. }
  6789. }
  6790. for (var i = 0, l = arguments.length; i < l; i++) {
  6791. forEach(arguments[i], assignValue);
  6792. }
  6793. return result;
  6794. }
  6795. /**
  6796. * Extends object a by mutably adding to it the properties of object b.
  6797. *
  6798. * @param {Object} a The object to be extended
  6799. * @param {Object} b The object to copy properties from
  6800. * @param {Object} thisArg The object to bind function to
  6801. * @return {Object} The resulting value of object a
  6802. */
  6803. function extend(a, b, thisArg) {
  6804. forEach(b, function assignValue(val, key) {
  6805. if (thisArg && typeof val === 'function') {
  6806. a[key] = bind$1(val, thisArg);
  6807. } else {
  6808. a[key] = val;
  6809. }
  6810. });
  6811. return a;
  6812. }
  6813. var utils = {
  6814. isArray: isArray,
  6815. isArrayBuffer: isArrayBuffer,
  6816. isBuffer: isBuffer,
  6817. isFormData: isFormData,
  6818. isArrayBufferView: isArrayBufferView,
  6819. isString: isString,
  6820. isNumber: isNumber,
  6821. isObject: isObject,
  6822. isUndefined: isUndefined,
  6823. isDate: isDate,
  6824. isFile: isFile,
  6825. isBlob: isBlob,
  6826. isFunction: isFunction,
  6827. isStream: isStream,
  6828. isURLSearchParams: isURLSearchParams,
  6829. isStandardBrowserEnv: isStandardBrowserEnv,
  6830. forEach: forEach,
  6831. merge: merge,
  6832. deepMerge: deepMerge,
  6833. extend: extend,
  6834. trim: trim
  6835. };
  6836. var utils_1 = utils.isArray;
  6837. var utils_2 = utils.isArrayBuffer;
  6838. var utils_3 = utils.isBuffer;
  6839. var utils_4 = utils.isFormData;
  6840. var utils_5 = utils.isArrayBufferView;
  6841. var utils_6 = utils.isString;
  6842. var utils_7 = utils.isNumber;
  6843. var utils_8 = utils.isObject;
  6844. var utils_9 = utils.isUndefined;
  6845. var utils_10 = utils.isDate;
  6846. var utils_11 = utils.isFile;
  6847. var utils_12 = utils.isBlob;
  6848. var utils_13 = utils.isFunction;
  6849. var utils_14 = utils.isStream;
  6850. var utils_15 = utils.isURLSearchParams;
  6851. var utils_16 = utils.isStandardBrowserEnv;
  6852. var utils_17 = utils.forEach;
  6853. var utils_18 = utils.merge;
  6854. var utils_19 = utils.deepMerge;
  6855. var utils_20 = utils.extend;
  6856. var utils_21 = utils.trim;
  6857. 'use strict';
  6858. function encode$1(val) {
  6859. return encodeURIComponent(val).
  6860. replace(/%40/gi, '@').
  6861. replace(/%3A/gi, ':').
  6862. replace(/%24/g, '$').
  6863. replace(/%2C/gi, ',').
  6864. replace(/%20/g, '+').
  6865. replace(/%5B/gi, '[').
  6866. replace(/%5D/gi, ']');
  6867. }
  6868. /**
  6869. * Build a URL by appending params to the end
  6870. *
  6871. * @param {string} url The base of the url (e.g., http://www.google.com)
  6872. * @param {object} [params] The params to be appended
  6873. * @returns {string} The formatted url
  6874. */
  6875. var buildURL = function buildURL(url, params, paramsSerializer) {
  6876. /*eslint no-param-reassign:0*/
  6877. if (!params) {
  6878. return url;
  6879. }
  6880. var serializedParams;
  6881. if (paramsSerializer) {
  6882. serializedParams = paramsSerializer(params);
  6883. } else if (utils.isURLSearchParams(params)) {
  6884. serializedParams = params.toString();
  6885. } else {
  6886. var parts = [];
  6887. utils.forEach(params, function serialize(val, key) {
  6888. if (val === null || typeof val === 'undefined') {
  6889. return;
  6890. }
  6891. if (utils.isArray(val)) {
  6892. key = key + '[]';
  6893. } else {
  6894. val = [val];
  6895. }
  6896. utils.forEach(val, function parseValue(v) {
  6897. if (utils.isDate(v)) {
  6898. v = v.toISOString();
  6899. } else if (utils.isObject(v)) {
  6900. v = JSON.stringify(v);
  6901. }
  6902. parts.push(encode$1(key) + '=' + encode$1(v));
  6903. });
  6904. });
  6905. serializedParams = parts.join('&');
  6906. }
  6907. if (serializedParams) {
  6908. var hashmarkIndex = url.indexOf('#');
  6909. if (hashmarkIndex !== -1) {
  6910. url = url.slice(0, hashmarkIndex);
  6911. }
  6912. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  6913. }
  6914. return url;
  6915. };
  6916. 'use strict';
  6917. function InterceptorManager() {
  6918. this.handlers = [];
  6919. }
  6920. /**
  6921. * Add a new interceptor to the stack
  6922. *
  6923. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  6924. * @param {Function} rejected The function to handle `reject` for a `Promise`
  6925. *
  6926. * @return {Number} An ID used to remove interceptor later
  6927. */
  6928. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  6929. this.handlers.push({
  6930. fulfilled: fulfilled,
  6931. rejected: rejected
  6932. });
  6933. return this.handlers.length - 1;
  6934. };
  6935. /**
  6936. * Remove an interceptor from the stack
  6937. *
  6938. * @param {Number} id The ID that was returned by `use`
  6939. */
  6940. InterceptorManager.prototype.eject = function eject(id) {
  6941. if (this.handlers[id]) {
  6942. this.handlers[id] = null;
  6943. }
  6944. };
  6945. /**
  6946. * Iterate over all the registered interceptors
  6947. *
  6948. * This method is particularly useful for skipping over any
  6949. * interceptors that may have become `null` calling `eject`.
  6950. *
  6951. * @param {Function} fn The function to call for each interceptor
  6952. */
  6953. InterceptorManager.prototype.forEach = function forEach(fn) {
  6954. utils.forEach(this.handlers, function forEachHandler(h) {
  6955. if (h !== null) {
  6956. fn(h);
  6957. }
  6958. });
  6959. };
  6960. var InterceptorManager_1 = InterceptorManager;
  6961. 'use strict';
  6962. /**
  6963. * Transform the data for a request or a response
  6964. *
  6965. * @param {Object|String} data The data to be transformed
  6966. * @param {Array} headers The headers for the request or response
  6967. * @param {Array|Function} fns A single function or Array of functions
  6968. * @returns {*} The resulting transformed data
  6969. */
  6970. var transformData = function transformData(data, headers, fns) {
  6971. /*eslint no-param-reassign:0*/
  6972. utils.forEach(fns, function transform(fn) {
  6973. data = fn(data, headers);
  6974. });
  6975. return data;
  6976. };
  6977. 'use strict';
  6978. var isCancel = function isCancel(value) {
  6979. return !!(value && value.__CANCEL__);
  6980. };
  6981. 'use strict';
  6982. var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
  6983. utils.forEach(headers, function processHeader(value, name) {
  6984. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  6985. headers[normalizedName] = value;
  6986. delete headers[name];
  6987. }
  6988. });
  6989. };
  6990. 'use strict';
  6991. /**
  6992. * Update an Error with the specified config, error code, and response.
  6993. *
  6994. * @param {Error} error The error to update.
  6995. * @param {Object} config The config.
  6996. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  6997. * @param {Object} [request] The request.
  6998. * @param {Object} [response] The response.
  6999. * @returns {Error} The error.
  7000. */
  7001. var enhanceError = function enhanceError(error, config, code, request, response) {
  7002. error.config = config;
  7003. if (code) {
  7004. error.code = code;
  7005. }
  7006. error.request = request;
  7007. error.response = response;
  7008. error.isAxiosError = true;
  7009. error.toJSON = function() {
  7010. return {
  7011. // Standard
  7012. message: this.message,
  7013. name: this.name,
  7014. // Microsoft
  7015. description: this.description,
  7016. number: this.number,
  7017. // Mozilla
  7018. fileName: this.fileName,
  7019. lineNumber: this.lineNumber,
  7020. columnNumber: this.columnNumber,
  7021. stack: this.stack,
  7022. // Axios
  7023. config: this.config,
  7024. code: this.code
  7025. };
  7026. };
  7027. return error;
  7028. };
  7029. 'use strict';
  7030. /**
  7031. * Create an Error with the specified message, config, error code, request and response.
  7032. *
  7033. * @param {string} message The error message.
  7034. * @param {Object} config The config.
  7035. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  7036. * @param {Object} [request] The request.
  7037. * @param {Object} [response] The response.
  7038. * @returns {Error} The created error.
  7039. */
  7040. var createError = function createError(message, config, code, request, response) {
  7041. var error = new Error(message);
  7042. return enhanceError(error, config, code, request, response);
  7043. };
  7044. 'use strict';
  7045. /**
  7046. * Resolve or reject a Promise based on response status.
  7047. *
  7048. * @param {Function} resolve A function that resolves the promise.
  7049. * @param {Function} reject A function that rejects the promise.
  7050. * @param {object} response The response.
  7051. */
  7052. var settle = function settle(resolve, reject, response) {
  7053. var validateStatus = response.config.validateStatus;
  7054. if (!validateStatus || validateStatus(response.status)) {
  7055. resolve(response);
  7056. } else {
  7057. reject(createError(
  7058. 'Request failed with status code ' + response.status,
  7059. response.config,
  7060. null,
  7061. response.request,
  7062. response
  7063. ));
  7064. }
  7065. };
  7066. 'use strict';
  7067. // Headers whose duplicates are ignored by node
  7068. // c.f. https://nodejs.org/api/http.html#http_message_headers
  7069. var ignoreDuplicateOf = [
  7070. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  7071. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  7072. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  7073. 'referer', 'retry-after', 'user-agent'
  7074. ];
  7075. /**
  7076. * Parse headers into an object
  7077. *
  7078. * ```
  7079. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  7080. * Content-Type: application/json
  7081. * Connection: keep-alive
  7082. * Transfer-Encoding: chunked
  7083. * ```
  7084. *
  7085. * @param {String} headers Headers needing to be parsed
  7086. * @returns {Object} Headers parsed into an object
  7087. */
  7088. var parseHeaders = function parseHeaders(headers) {
  7089. var parsed = {};
  7090. var key;
  7091. var val;
  7092. var i;
  7093. if (!headers) { return parsed; }
  7094. utils.forEach(headers.split('\n'), function parser(line) {
  7095. i = line.indexOf(':');
  7096. key = utils.trim(line.substr(0, i)).toLowerCase();
  7097. val = utils.trim(line.substr(i + 1));
  7098. if (key) {
  7099. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  7100. return;
  7101. }
  7102. if (key === 'set-cookie') {
  7103. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  7104. } else {
  7105. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  7106. }
  7107. }
  7108. });
  7109. return parsed;
  7110. };
  7111. 'use strict';
  7112. var isURLSameOrigin = (
  7113. utils.isStandardBrowserEnv() ?
  7114. // Standard browser envs have full support of the APIs needed to test
  7115. // whether the request URL is of the same origin as current location.
  7116. (function standardBrowserEnv() {
  7117. var msie = /(msie|trident)/i.test(navigator.userAgent);
  7118. var urlParsingNode = document.createElement('a');
  7119. var originURL;
  7120. /**
  7121. * Parse a URL to discover it's components
  7122. *
  7123. * @param {String} url The URL to be parsed
  7124. * @returns {Object}
  7125. */
  7126. function resolveURL(url) {
  7127. var href = url;
  7128. if (msie) {
  7129. // IE needs attribute set twice to normalize properties
  7130. urlParsingNode.setAttribute('href', href);
  7131. href = urlParsingNode.href;
  7132. }
  7133. urlParsingNode.setAttribute('href', href);
  7134. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  7135. return {
  7136. href: urlParsingNode.href,
  7137. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  7138. host: urlParsingNode.host,
  7139. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  7140. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  7141. hostname: urlParsingNode.hostname,
  7142. port: urlParsingNode.port,
  7143. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  7144. urlParsingNode.pathname :
  7145. '/' + urlParsingNode.pathname
  7146. };
  7147. }
  7148. originURL = resolveURL(window.location.href);
  7149. /**
  7150. * Determine if a URL shares the same origin as the current location
  7151. *
  7152. * @param {String} requestURL The URL to test
  7153. * @returns {boolean} True if URL shares the same origin, otherwise false
  7154. */
  7155. return function isURLSameOrigin(requestURL) {
  7156. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  7157. return (parsed.protocol === originURL.protocol &&
  7158. parsed.host === originURL.host);
  7159. };
  7160. })() :
  7161. // Non standard browser envs (web workers, react-native) lack needed support.
  7162. (function nonStandardBrowserEnv() {
  7163. return function isURLSameOrigin() {
  7164. return true;
  7165. };
  7166. })()
  7167. );
  7168. 'use strict';
  7169. var cookies = (
  7170. utils.isStandardBrowserEnv() ?
  7171. // Standard browser envs support document.cookie
  7172. (function standardBrowserEnv() {
  7173. return {
  7174. write: function write(name, value, expires, path, domain, secure) {
  7175. var cookie = [];
  7176. cookie.push(name + '=' + encodeURIComponent(value));
  7177. if (utils.isNumber(expires)) {
  7178. cookie.push('expires=' + new Date(expires).toGMTString());
  7179. }
  7180. if (utils.isString(path)) {
  7181. cookie.push('path=' + path);
  7182. }
  7183. if (utils.isString(domain)) {
  7184. cookie.push('domain=' + domain);
  7185. }
  7186. if (secure === true) {
  7187. cookie.push('secure');
  7188. }
  7189. document.cookie = cookie.join('; ');
  7190. },
  7191. read: function read(name) {
  7192. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  7193. return (match ? decodeURIComponent(match[3]) : null);
  7194. },
  7195. remove: function remove(name) {
  7196. this.write(name, '', Date.now() - 86400000);
  7197. }
  7198. };
  7199. })() :
  7200. // Non standard browser env (web workers, react-native) lack needed support.
  7201. (function nonStandardBrowserEnv() {
  7202. return {
  7203. write: function write() {},
  7204. read: function read() { return null; },
  7205. remove: function remove() {}
  7206. };
  7207. })()
  7208. );
  7209. 'use strict';
  7210. var xhr = function xhrAdapter(config) {
  7211. return new Promise(function dispatchXhrRequest(resolve, reject) {
  7212. var requestData = config.data;
  7213. var requestHeaders = config.headers;
  7214. if (utils.isFormData(requestData)) {
  7215. delete requestHeaders['Content-Type']; // Let the browser set it
  7216. }
  7217. var request = new XMLHttpRequest();
  7218. // HTTP basic authentication
  7219. if (config.auth) {
  7220. var username = config.auth.username || '';
  7221. var password = config.auth.password || '';
  7222. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  7223. }
  7224. request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
  7225. // Set the request timeout in MS
  7226. request.timeout = config.timeout;
  7227. // Listen for ready state
  7228. request.onreadystatechange = function handleLoad() {
  7229. if (!request || request.readyState !== 4) {
  7230. return;
  7231. }
  7232. // The request errored out and we didn't get a response, this will be
  7233. // handled by onerror instead
  7234. // With one exception: request that using file: protocol, most browsers
  7235. // will return status as 0 even though it's a successful request
  7236. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  7237. return;
  7238. }
  7239. // Prepare the response
  7240. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  7241. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  7242. var response = {
  7243. data: responseData,
  7244. status: request.status,
  7245. statusText: request.statusText,
  7246. headers: responseHeaders,
  7247. config: config,
  7248. request: request
  7249. };
  7250. settle(resolve, reject, response);
  7251. // Clean up request
  7252. request = null;
  7253. };
  7254. // Handle browser request cancellation (as opposed to a manual cancellation)
  7255. request.onabort = function handleAbort() {
  7256. if (!request) {
  7257. return;
  7258. }
  7259. reject(createError('Request aborted', config, 'ECONNABORTED', request));
  7260. // Clean up request
  7261. request = null;
  7262. };
  7263. // Handle low level network errors
  7264. request.onerror = function handleError() {
  7265. // Real errors are hidden from us by the browser
  7266. // onerror should only fire if it's a network error
  7267. reject(createError('Network Error', config, null, request));
  7268. // Clean up request
  7269. request = null;
  7270. };
  7271. // Handle timeout
  7272. request.ontimeout = function handleTimeout() {
  7273. reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
  7274. request));
  7275. // Clean up request
  7276. request = null;
  7277. };
  7278. // Add xsrf header
  7279. // This is only done if running in a standard browser environment.
  7280. // Specifically not if we're in a web worker, or react-native.
  7281. if (utils.isStandardBrowserEnv()) {
  7282. var cookies$1 = cookies;
  7283. // Add xsrf header
  7284. var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
  7285. cookies$1.read(config.xsrfCookieName) :
  7286. undefined;
  7287. if (xsrfValue) {
  7288. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  7289. }
  7290. }
  7291. // Add headers to the request
  7292. if ('setRequestHeader' in request) {
  7293. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  7294. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  7295. // Remove Content-Type if data is undefined
  7296. delete requestHeaders[key];
  7297. } else {
  7298. // Otherwise add header to the request
  7299. request.setRequestHeader(key, val);
  7300. }
  7301. });
  7302. }
  7303. // Add withCredentials to request if needed
  7304. if (config.withCredentials) {
  7305. request.withCredentials = true;
  7306. }
  7307. // Add responseType to request if needed
  7308. if (config.responseType) {
  7309. try {
  7310. request.responseType = config.responseType;
  7311. } catch (e) {
  7312. // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
  7313. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
  7314. if (config.responseType !== 'json') {
  7315. throw e;
  7316. }
  7317. }
  7318. }
  7319. // Handle progress if needed
  7320. if (typeof config.onDownloadProgress === 'function') {
  7321. request.addEventListener('progress', config.onDownloadProgress);
  7322. }
  7323. // Not all browsers support upload events
  7324. if (typeof config.onUploadProgress === 'function' && request.upload) {
  7325. request.upload.addEventListener('progress', config.onUploadProgress);
  7326. }
  7327. if (config.cancelToken) {
  7328. // Handle cancellation
  7329. config.cancelToken.promise.then(function onCanceled(cancel) {
  7330. if (!request) {
  7331. return;
  7332. }
  7333. request.abort();
  7334. reject(cancel);
  7335. // Clean up request
  7336. request = null;
  7337. });
  7338. }
  7339. if (requestData === undefined) {
  7340. requestData = null;
  7341. }
  7342. // Send the request
  7343. request.send(requestData);
  7344. });
  7345. };
  7346. 'use strict';
  7347. var DEFAULT_CONTENT_TYPE = {
  7348. 'Content-Type': 'application/x-www-form-urlencoded'
  7349. };
  7350. function setContentTypeIfUnset(headers, value) {
  7351. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  7352. headers['Content-Type'] = value;
  7353. }
  7354. }
  7355. function getDefaultAdapter() {
  7356. var adapter;
  7357. // Only Node.JS has a process variable that is of [[Class]] process
  7358. if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
  7359. // For node use HTTP adapter
  7360. adapter = xhr;
  7361. } else if (typeof XMLHttpRequest !== 'undefined') {
  7362. // For browsers use XHR adapter
  7363. adapter = xhr;
  7364. }
  7365. return adapter;
  7366. }
  7367. var defaults = {
  7368. adapter: getDefaultAdapter(),
  7369. transformRequest: [function transformRequest(data, headers) {
  7370. normalizeHeaderName(headers, 'Accept');
  7371. normalizeHeaderName(headers, 'Content-Type');
  7372. if (utils.isFormData(data) ||
  7373. utils.isArrayBuffer(data) ||
  7374. utils.isBuffer(data) ||
  7375. utils.isStream(data) ||
  7376. utils.isFile(data) ||
  7377. utils.isBlob(data)
  7378. ) {
  7379. return data;
  7380. }
  7381. if (utils.isArrayBufferView(data)) {
  7382. return data.buffer;
  7383. }
  7384. if (utils.isURLSearchParams(data)) {
  7385. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  7386. return data.toString();
  7387. }
  7388. if (utils.isObject(data)) {
  7389. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  7390. return JSON.stringify(data);
  7391. }
  7392. return data;
  7393. }],
  7394. transformResponse: [function transformResponse(data) {
  7395. /*eslint no-param-reassign:0*/
  7396. if (typeof data === 'string') {
  7397. try {
  7398. data = JSON.parse(data);
  7399. } catch (e) { /* Ignore */ }
  7400. }
  7401. return data;
  7402. }],
  7403. /**
  7404. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  7405. * timeout is not created.
  7406. */
  7407. timeout: 0,
  7408. xsrfCookieName: 'XSRF-TOKEN',
  7409. xsrfHeaderName: 'X-XSRF-TOKEN',
  7410. maxContentLength: -1,
  7411. validateStatus: function validateStatus(status) {
  7412. return status >= 200 && status < 300;
  7413. }
  7414. };
  7415. defaults.headers = {
  7416. common: {
  7417. 'Accept': 'application/json, text/plain, */*'
  7418. }
  7419. };
  7420. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  7421. defaults.headers[method] = {};
  7422. });
  7423. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  7424. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  7425. });
  7426. var defaults_1 = defaults;
  7427. 'use strict';
  7428. /**
  7429. * Determines whether the specified URL is absolute
  7430. *
  7431. * @param {string} url The URL to test
  7432. * @returns {boolean} True if the specified URL is absolute, otherwise false
  7433. */
  7434. var isAbsoluteURL = function isAbsoluteURL(url) {
  7435. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  7436. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  7437. // by any combination of letters, digits, plus, period, or hyphen.
  7438. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  7439. };
  7440. 'use strict';
  7441. /**
  7442. * Creates a new URL by combining the specified URLs
  7443. *
  7444. * @param {string} baseURL The base URL
  7445. * @param {string} relativeURL The relative URL
  7446. * @returns {string} The combined URL
  7447. */
  7448. var combineURLs = function combineURLs(baseURL, relativeURL) {
  7449. return relativeURL
  7450. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  7451. : baseURL;
  7452. };
  7453. 'use strict';
  7454. /**
  7455. * Throws a `Cancel` if cancellation has been requested.
  7456. */
  7457. function throwIfCancellationRequested(config) {
  7458. if (config.cancelToken) {
  7459. config.cancelToken.throwIfRequested();
  7460. }
  7461. }
  7462. /**
  7463. * Dispatch a request to the server using the configured adapter.
  7464. *
  7465. * @param {object} config The config that is to be used for the request
  7466. * @returns {Promise} The Promise to be fulfilled
  7467. */
  7468. var dispatchRequest = function dispatchRequest(config) {
  7469. throwIfCancellationRequested(config);
  7470. // Support baseURL config
  7471. if (config.baseURL && !isAbsoluteURL(config.url)) {
  7472. config.url = combineURLs(config.baseURL, config.url);
  7473. }
  7474. // Ensure headers exist
  7475. config.headers = config.headers || {};
  7476. // Transform request data
  7477. config.data = transformData(
  7478. config.data,
  7479. config.headers,
  7480. config.transformRequest
  7481. );
  7482. // Flatten headers
  7483. config.headers = utils.merge(
  7484. config.headers.common || {},
  7485. config.headers[config.method] || {},
  7486. config.headers || {}
  7487. );
  7488. utils.forEach(
  7489. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  7490. function cleanHeaderConfig(method) {
  7491. delete config.headers[method];
  7492. }
  7493. );
  7494. var adapter = config.adapter || defaults_1.adapter;
  7495. return adapter(config).then(function onAdapterResolution(response) {
  7496. throwIfCancellationRequested(config);
  7497. // Transform response data
  7498. response.data = transformData(
  7499. response.data,
  7500. response.headers,
  7501. config.transformResponse
  7502. );
  7503. return response;
  7504. }, function onAdapterRejection(reason) {
  7505. if (!isCancel(reason)) {
  7506. throwIfCancellationRequested(config);
  7507. // Transform response data
  7508. if (reason && reason.response) {
  7509. reason.response.data = transformData(
  7510. reason.response.data,
  7511. reason.response.headers,
  7512. config.transformResponse
  7513. );
  7514. }
  7515. }
  7516. return Promise.reject(reason);
  7517. });
  7518. };
  7519. 'use strict';
  7520. /**
  7521. * Config-specific merge-function which creates a new config-object
  7522. * by merging two configuration objects together.
  7523. *
  7524. * @param {Object} config1
  7525. * @param {Object} config2
  7526. * @returns {Object} New object resulting from merging config2 to config1
  7527. */
  7528. var mergeConfig = function mergeConfig(config1, config2) {
  7529. // eslint-disable-next-line no-param-reassign
  7530. config2 = config2 || {};
  7531. var config = {};
  7532. utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) {
  7533. if (typeof config2[prop] !== 'undefined') {
  7534. config[prop] = config2[prop];
  7535. }
  7536. });
  7537. utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) {
  7538. if (utils.isObject(config2[prop])) {
  7539. config[prop] = utils.deepMerge(config1[prop], config2[prop]);
  7540. } else if (typeof config2[prop] !== 'undefined') {
  7541. config[prop] = config2[prop];
  7542. } else if (utils.isObject(config1[prop])) {
  7543. config[prop] = utils.deepMerge(config1[prop]);
  7544. } else if (typeof config1[prop] !== 'undefined') {
  7545. config[prop] = config1[prop];
  7546. }
  7547. });
  7548. utils.forEach([
  7549. 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
  7550. 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
  7551. 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength',
  7552. 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken',
  7553. 'socketPath'
  7554. ], function defaultToConfig2(prop) {
  7555. if (typeof config2[prop] !== 'undefined') {
  7556. config[prop] = config2[prop];
  7557. } else if (typeof config1[prop] !== 'undefined') {
  7558. config[prop] = config1[prop];
  7559. }
  7560. });
  7561. return config;
  7562. };
  7563. 'use strict';
  7564. /**
  7565. * Create a new instance of Axios
  7566. *
  7567. * @param {Object} instanceConfig The default config for the instance
  7568. */
  7569. function Axios(instanceConfig) {
  7570. this.defaults = instanceConfig;
  7571. this.interceptors = {
  7572. request: new InterceptorManager_1(),
  7573. response: new InterceptorManager_1()
  7574. };
  7575. }
  7576. /**
  7577. * Dispatch a request
  7578. *
  7579. * @param {Object} config The config specific for this request (merged with this.defaults)
  7580. */
  7581. Axios.prototype.request = function request(config) {
  7582. /*eslint no-param-reassign:0*/
  7583. // Allow for axios('example/url'[, config]) a la fetch API
  7584. if (typeof config === 'string') {
  7585. config = arguments[1] || {};
  7586. config.url = arguments[0];
  7587. } else {
  7588. config = config || {};
  7589. }
  7590. config = mergeConfig(this.defaults, config);
  7591. config.method = config.method ? config.method.toLowerCase() : 'get';
  7592. // Hook up interceptors middleware
  7593. var chain = [dispatchRequest, undefined];
  7594. var promise = Promise.resolve(config);
  7595. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  7596. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  7597. });
  7598. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  7599. chain.push(interceptor.fulfilled, interceptor.rejected);
  7600. });
  7601. while (chain.length) {
  7602. promise = promise.then(chain.shift(), chain.shift());
  7603. }
  7604. return promise;
  7605. };
  7606. Axios.prototype.getUri = function getUri(config) {
  7607. config = mergeConfig(this.defaults, config);
  7608. return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
  7609. };
  7610. // Provide aliases for supported request methods
  7611. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  7612. /*eslint func-names:0*/
  7613. Axios.prototype[method] = function(url, config) {
  7614. return this.request(utils.merge(config || {}, {
  7615. method: method,
  7616. url: url
  7617. }));
  7618. };
  7619. });
  7620. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  7621. /*eslint func-names:0*/
  7622. Axios.prototype[method] = function(url, data, config) {
  7623. return this.request(utils.merge(config || {}, {
  7624. method: method,
  7625. url: url,
  7626. data: data
  7627. }));
  7628. };
  7629. });
  7630. var Axios_1 = Axios;
  7631. 'use strict';
  7632. /**
  7633. * A `Cancel` is an object that is thrown when an operation is canceled.
  7634. *
  7635. * @class
  7636. * @param {string=} message The message.
  7637. */
  7638. function Cancel(message) {
  7639. this.message = message;
  7640. }
  7641. Cancel.prototype.toString = function toString() {
  7642. return 'Cancel' + (this.message ? ': ' + this.message : '');
  7643. };
  7644. Cancel.prototype.__CANCEL__ = true;
  7645. var Cancel_1 = Cancel;
  7646. 'use strict';
  7647. /**
  7648. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  7649. *
  7650. * @class
  7651. * @param {Function} executor The executor function.
  7652. */
  7653. function CancelToken(executor) {
  7654. if (typeof executor !== 'function') {
  7655. throw new TypeError('executor must be a function.');
  7656. }
  7657. var resolvePromise;
  7658. this.promise = new Promise(function promiseExecutor(resolve) {
  7659. resolvePromise = resolve;
  7660. });
  7661. var token = this;
  7662. executor(function cancel(message) {
  7663. if (token.reason) {
  7664. // Cancellation has already been requested
  7665. return;
  7666. }
  7667. token.reason = new Cancel_1(message);
  7668. resolvePromise(token.reason);
  7669. });
  7670. }
  7671. /**
  7672. * Throws a `Cancel` if cancellation has been requested.
  7673. */
  7674. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  7675. if (this.reason) {
  7676. throw this.reason;
  7677. }
  7678. };
  7679. /**
  7680. * Returns an object that contains a new `CancelToken` and a function that, when called,
  7681. * cancels the `CancelToken`.
  7682. */
  7683. CancelToken.source = function source() {
  7684. var cancel;
  7685. var token = new CancelToken(function executor(c) {
  7686. cancel = c;
  7687. });
  7688. return {
  7689. token: token,
  7690. cancel: cancel
  7691. };
  7692. };
  7693. var CancelToken_1 = CancelToken;
  7694. 'use strict';
  7695. /**
  7696. * Syntactic sugar for invoking a function and expanding an array for arguments.
  7697. *
  7698. * Common use case would be to use `Function.prototype.apply`.
  7699. *
  7700. * ```js
  7701. * function f(x, y, z) {}
  7702. * var args = [1, 2, 3];
  7703. * f.apply(null, args);
  7704. * ```
  7705. *
  7706. * With `spread` this example can be re-written.
  7707. *
  7708. * ```js
  7709. * spread(function(x, y, z) {})([1, 2, 3]);
  7710. * ```
  7711. *
  7712. * @param {Function} callback
  7713. * @returns {Function}
  7714. */
  7715. var spread$1 = function spread(callback) {
  7716. return function wrap(arr) {
  7717. return callback.apply(null, arr);
  7718. };
  7719. };
  7720. 'use strict';
  7721. /**
  7722. * Create an instance of Axios
  7723. *
  7724. * @param {Object} defaultConfig The default config for the instance
  7725. * @return {Axios} A new instance of Axios
  7726. */
  7727. function createInstance(defaultConfig) {
  7728. var context = new Axios_1(defaultConfig);
  7729. var instance = bind$1(Axios_1.prototype.request, context);
  7730. // Copy axios.prototype to instance
  7731. utils.extend(instance, Axios_1.prototype, context);
  7732. // Copy context to instance
  7733. utils.extend(instance, context);
  7734. return instance;
  7735. }
  7736. // Create the default instance to be exported
  7737. var axios = createInstance(defaults_1);
  7738. // Expose Axios class to allow class inheritance
  7739. axios.Axios = Axios_1;
  7740. // Factory for creating new instances
  7741. axios.create = function create(instanceConfig) {
  7742. return createInstance(mergeConfig(axios.defaults, instanceConfig));
  7743. };
  7744. // Expose Cancel & CancelToken
  7745. axios.Cancel = Cancel_1;
  7746. axios.CancelToken = CancelToken_1;
  7747. axios.isCancel = isCancel;
  7748. // Expose all/spread
  7749. axios.all = function all(promises) {
  7750. return Promise.all(promises);
  7751. };
  7752. axios.spread = spread$1;
  7753. var axios_1 = axios;
  7754. // Allow use of default import syntax in TypeScript
  7755. var default_1 = axios;
  7756. axios_1.default = default_1;
  7757. var axios$1 = axios_1;
  7758. 'use strict';
  7759. var has$1 = Object.prototype.hasOwnProperty;
  7760. var isArray$1 = Array.isArray;
  7761. var hexTable = (function () {
  7762. var array = [];
  7763. for (var i = 0; i < 256; ++i) {
  7764. array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
  7765. }
  7766. return array;
  7767. }());
  7768. var compactQueue = function compactQueue(queue) {
  7769. while (queue.length > 1) {
  7770. var item = queue.pop();
  7771. var obj = item.obj[item.prop];
  7772. if (isArray$1(obj)) {
  7773. var compacted = [];
  7774. for (var j = 0; j < obj.length; ++j) {
  7775. if (typeof obj[j] !== 'undefined') {
  7776. compacted.push(obj[j]);
  7777. }
  7778. }
  7779. item.obj[item.prop] = compacted;
  7780. }
  7781. }
  7782. };
  7783. var arrayToObject = function arrayToObject(source, options) {
  7784. var obj = options && options.plainObjects ? Object.create(null) : {};
  7785. for (var i = 0; i < source.length; ++i) {
  7786. if (typeof source[i] !== 'undefined') {
  7787. obj[i] = source[i];
  7788. }
  7789. }
  7790. return obj;
  7791. };
  7792. var merge$1 = function merge(target, source, options) {
  7793. if (!source) {
  7794. return target;
  7795. }
  7796. if (typeof source !== 'object') {
  7797. if (isArray$1(target)) {
  7798. target.push(source);
  7799. } else if (target && typeof target === 'object') {
  7800. if ((options && (options.plainObjects || options.allowPrototypes)) || !has$1.call(Object.prototype, source)) {
  7801. target[source] = true;
  7802. }
  7803. } else {
  7804. return [target, source];
  7805. }
  7806. return target;
  7807. }
  7808. if (!target || typeof target !== 'object') {
  7809. return [target].concat(source);
  7810. }
  7811. var mergeTarget = target;
  7812. if (isArray$1(target) && !isArray$1(source)) {
  7813. mergeTarget = arrayToObject(target, options);
  7814. }
  7815. if (isArray$1(target) && isArray$1(source)) {
  7816. source.forEach(function (item, i) {
  7817. if (has$1.call(target, i)) {
  7818. var targetItem = target[i];
  7819. if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
  7820. target[i] = merge(targetItem, item, options);
  7821. } else {
  7822. target.push(item);
  7823. }
  7824. } else {
  7825. target[i] = item;
  7826. }
  7827. });
  7828. return target;
  7829. }
  7830. return Object.keys(source).reduce(function (acc, key) {
  7831. var value = source[key];
  7832. if (has$1.call(acc, key)) {
  7833. acc[key] = merge(acc[key], value, options);
  7834. } else {
  7835. acc[key] = value;
  7836. }
  7837. return acc;
  7838. }, mergeTarget);
  7839. };
  7840. var assign$1 = function assignSingleSource(target, source) {
  7841. return Object.keys(source).reduce(function (acc, key) {
  7842. acc[key] = source[key];
  7843. return acc;
  7844. }, target);
  7845. };
  7846. var decode$1 = function (str, decoder, charset) {
  7847. var strWithoutPlus = str.replace(/\+/g, ' ');
  7848. if (charset === 'iso-8859-1') {
  7849. // unescape never throws, no try...catch needed:
  7850. return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
  7851. }
  7852. // utf-8
  7853. try {
  7854. return decodeURIComponent(strWithoutPlus);
  7855. } catch (e) {
  7856. return strWithoutPlus;
  7857. }
  7858. };
  7859. var encode$2 = function encode(str, defaultEncoder, charset) {
  7860. // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
  7861. // It has been adapted here for stricter adherence to RFC 3986
  7862. if (str.length === 0) {
  7863. return str;
  7864. }
  7865. var string = str;
  7866. if (typeof str === 'symbol') {
  7867. string = Symbol.prototype.toString.call(str);
  7868. } else if (typeof str !== 'string') {
  7869. string = String(str);
  7870. }
  7871. if (charset === 'iso-8859-1') {
  7872. return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
  7873. return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
  7874. });
  7875. }
  7876. var out = '';
  7877. for (var i = 0; i < string.length; ++i) {
  7878. var c = string.charCodeAt(i);
  7879. if (
  7880. c === 0x2D // -
  7881. || c === 0x2E // .
  7882. || c === 0x5F // _
  7883. || c === 0x7E // ~
  7884. || (c >= 0x30 && c <= 0x39) // 0-9
  7885. || (c >= 0x41 && c <= 0x5A) // a-z
  7886. || (c >= 0x61 && c <= 0x7A) // A-Z
  7887. ) {
  7888. out += string.charAt(i);
  7889. continue;
  7890. }
  7891. if (c < 0x80) {
  7892. out = out + hexTable[c];
  7893. continue;
  7894. }
  7895. if (c < 0x800) {
  7896. out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
  7897. continue;
  7898. }
  7899. if (c < 0xD800 || c >= 0xE000) {
  7900. out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
  7901. continue;
  7902. }
  7903. i += 1;
  7904. c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
  7905. out += hexTable[0xF0 | (c >> 18)]
  7906. + hexTable[0x80 | ((c >> 12) & 0x3F)]
  7907. + hexTable[0x80 | ((c >> 6) & 0x3F)]
  7908. + hexTable[0x80 | (c & 0x3F)];
  7909. }
  7910. return out;
  7911. };
  7912. var compact = function compact(value) {
  7913. var queue = [{ obj: { o: value }, prop: 'o' }];
  7914. var refs = [];
  7915. for (var i = 0; i < queue.length; ++i) {
  7916. var item = queue[i];
  7917. var obj = item.obj[item.prop];
  7918. var keys = Object.keys(obj);
  7919. for (var j = 0; j < keys.length; ++j) {
  7920. var key = keys[j];
  7921. var val = obj[key];
  7922. if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
  7923. queue.push({ obj: obj, prop: key });
  7924. refs.push(val);
  7925. }
  7926. }
  7927. }
  7928. compactQueue(queue);
  7929. return value;
  7930. };
  7931. var isRegExp = function isRegExp(obj) {
  7932. return Object.prototype.toString.call(obj) === '[object RegExp]';
  7933. };
  7934. var isBuffer$1 = function isBuffer(obj) {
  7935. if (!obj || typeof obj !== 'object') {
  7936. return false;
  7937. }
  7938. return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
  7939. };
  7940. var combine = function combine(a, b) {
  7941. return [].concat(a, b);
  7942. };
  7943. var utils$1 = {
  7944. arrayToObject: arrayToObject,
  7945. assign: assign$1,
  7946. combine: combine,
  7947. compact: compact,
  7948. decode: decode$1,
  7949. encode: encode$2,
  7950. isBuffer: isBuffer$1,
  7951. isRegExp: isRegExp,
  7952. merge: merge$1
  7953. };
  7954. var utils_1$1 = utils$1.arrayToObject;
  7955. var utils_2$1 = utils$1.assign;
  7956. var utils_3$1 = utils$1.combine;
  7957. var utils_4$1 = utils$1.compact;
  7958. var utils_5$1 = utils$1.decode;
  7959. var utils_6$1 = utils$1.encode;
  7960. var utils_7$1 = utils$1.isBuffer;
  7961. var utils_8$1 = utils$1.isRegExp;
  7962. var utils_9$1 = utils$1.merge;
  7963. 'use strict';
  7964. var replace = String.prototype.replace;
  7965. var percentTwenties = /%20/g;
  7966. var Format = {
  7967. RFC1738: 'RFC1738',
  7968. RFC3986: 'RFC3986'
  7969. };
  7970. var formats = utils$1.assign(
  7971. {
  7972. 'default': Format.RFC3986,
  7973. formatters: {
  7974. RFC1738: function (value) {
  7975. return replace.call(value, percentTwenties, '+');
  7976. },
  7977. RFC3986: function (value) {
  7978. return String(value);
  7979. }
  7980. }
  7981. },
  7982. Format
  7983. );
  7984. 'use strict';
  7985. var has$2 = Object.prototype.hasOwnProperty;
  7986. var arrayPrefixGenerators = {
  7987. brackets: function brackets(prefix) {
  7988. return prefix + '[]';
  7989. },
  7990. comma: 'comma',
  7991. indices: function indices(prefix, key) {
  7992. return prefix + '[' + key + ']';
  7993. },
  7994. repeat: function repeat(prefix) {
  7995. return prefix;
  7996. }
  7997. };
  7998. var isArray$2 = Array.isArray;
  7999. var push = Array.prototype.push;
  8000. var pushToArray = function (arr, valueOrArray) {
  8001. push.apply(arr, isArray$2(valueOrArray) ? valueOrArray : [valueOrArray]);
  8002. };
  8003. var toISO = Date.prototype.toISOString;
  8004. var defaultFormat = formats['default'];
  8005. var defaults$1 = {
  8006. addQueryPrefix: false,
  8007. allowDots: false,
  8008. charset: 'utf-8',
  8009. charsetSentinel: false,
  8010. delimiter: '&',
  8011. encode: true,
  8012. encoder: utils$1.encode,
  8013. encodeValuesOnly: false,
  8014. format: defaultFormat,
  8015. formatter: formats.formatters[defaultFormat],
  8016. // deprecated
  8017. indices: false,
  8018. serializeDate: function serializeDate(date) {
  8019. return toISO.call(date);
  8020. },
  8021. skipNulls: false,
  8022. strictNullHandling: false
  8023. };
  8024. var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
  8025. return typeof v === 'string'
  8026. || typeof v === 'number'
  8027. || typeof v === 'boolean'
  8028. || typeof v === 'symbol'
  8029. || typeof v === 'bigint';
  8030. };
  8031. var stringify$1 = function stringify(
  8032. object,
  8033. prefix,
  8034. generateArrayPrefix,
  8035. strictNullHandling,
  8036. skipNulls,
  8037. encoder,
  8038. filter,
  8039. sort,
  8040. allowDots,
  8041. serializeDate,
  8042. formatter,
  8043. encodeValuesOnly,
  8044. charset
  8045. ) {
  8046. var obj = object;
  8047. if (typeof filter === 'function') {
  8048. obj = filter(prefix, obj);
  8049. } else if (obj instanceof Date) {
  8050. obj = serializeDate(obj);
  8051. } else if (generateArrayPrefix === 'comma' && isArray$2(obj)) {
  8052. obj = obj.join(',');
  8053. }
  8054. if (obj === null) {
  8055. if (strictNullHandling) {
  8056. return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key') : prefix;
  8057. }
  8058. obj = '';
  8059. }
  8060. if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
  8061. if (encoder) {
  8062. var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key');
  8063. return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value'))];
  8064. }
  8065. return [formatter(prefix) + '=' + formatter(String(obj))];
  8066. }
  8067. var values = [];
  8068. if (typeof obj === 'undefined') {
  8069. return values;
  8070. }
  8071. var objKeys;
  8072. if (isArray$2(filter)) {
  8073. objKeys = filter;
  8074. } else {
  8075. var keys = Object.keys(obj);
  8076. objKeys = sort ? keys.sort(sort) : keys;
  8077. }
  8078. for (var i = 0; i < objKeys.length; ++i) {
  8079. var key = objKeys[i];
  8080. if (skipNulls && obj[key] === null) {
  8081. continue;
  8082. }
  8083. if (isArray$2(obj)) {
  8084. pushToArray(values, stringify(
  8085. obj[key],
  8086. typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix,
  8087. generateArrayPrefix,
  8088. strictNullHandling,
  8089. skipNulls,
  8090. encoder,
  8091. filter,
  8092. sort,
  8093. allowDots,
  8094. serializeDate,
  8095. formatter,
  8096. encodeValuesOnly,
  8097. charset
  8098. ));
  8099. } else {
  8100. pushToArray(values, stringify(
  8101. obj[key],
  8102. prefix + (allowDots ? '.' + key : '[' + key + ']'),
  8103. generateArrayPrefix,
  8104. strictNullHandling,
  8105. skipNulls,
  8106. encoder,
  8107. filter,
  8108. sort,
  8109. allowDots,
  8110. serializeDate,
  8111. formatter,
  8112. encodeValuesOnly,
  8113. charset
  8114. ));
  8115. }
  8116. }
  8117. return values;
  8118. };
  8119. var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
  8120. if (!opts) {
  8121. return defaults$1;
  8122. }
  8123. if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
  8124. throw new TypeError('Encoder has to be a function.');
  8125. }
  8126. var charset = opts.charset || defaults$1.charset;
  8127. if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
  8128. throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
  8129. }
  8130. var format = formats['default'];
  8131. if (typeof opts.format !== 'undefined') {
  8132. if (!has$2.call(formats.formatters, opts.format)) {
  8133. throw new TypeError('Unknown format option provided.');
  8134. }
  8135. format = opts.format;
  8136. }
  8137. var formatter = formats.formatters[format];
  8138. var filter = defaults$1.filter;
  8139. if (typeof opts.filter === 'function' || isArray$2(opts.filter)) {
  8140. filter = opts.filter;
  8141. }
  8142. return {
  8143. addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
  8144. allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
  8145. charset: charset,
  8146. charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
  8147. delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
  8148. encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
  8149. encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
  8150. encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
  8151. filter: filter,
  8152. formatter: formatter,
  8153. serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
  8154. skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
  8155. sort: typeof opts.sort === 'function' ? opts.sort : null,
  8156. strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
  8157. };
  8158. };
  8159. var stringify_1 = function (object, opts) {
  8160. var obj = object;
  8161. var options = normalizeStringifyOptions(opts);
  8162. var objKeys;
  8163. var filter;
  8164. if (typeof options.filter === 'function') {
  8165. filter = options.filter;
  8166. obj = filter('', obj);
  8167. } else if (isArray$2(options.filter)) {
  8168. filter = options.filter;
  8169. objKeys = filter;
  8170. }
  8171. var keys = [];
  8172. if (typeof obj !== 'object' || obj === null) {
  8173. return '';
  8174. }
  8175. var arrayFormat;
  8176. if (opts && opts.arrayFormat in arrayPrefixGenerators) {
  8177. arrayFormat = opts.arrayFormat;
  8178. } else if (opts && 'indices' in opts) {
  8179. arrayFormat = opts.indices ? 'indices' : 'repeat';
  8180. } else {
  8181. arrayFormat = 'indices';
  8182. }
  8183. var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
  8184. if (!objKeys) {
  8185. objKeys = Object.keys(obj);
  8186. }
  8187. if (options.sort) {
  8188. objKeys.sort(options.sort);
  8189. }
  8190. for (var i = 0; i < objKeys.length; ++i) {
  8191. var key = objKeys[i];
  8192. if (options.skipNulls && obj[key] === null) {
  8193. continue;
  8194. }
  8195. pushToArray(keys, stringify$1(
  8196. obj[key],
  8197. key,
  8198. generateArrayPrefix,
  8199. options.strictNullHandling,
  8200. options.skipNulls,
  8201. options.encode ? options.encoder : null,
  8202. options.filter,
  8203. options.sort,
  8204. options.allowDots,
  8205. options.serializeDate,
  8206. options.formatter,
  8207. options.encodeValuesOnly,
  8208. options.charset
  8209. ));
  8210. }
  8211. var joined = keys.join(options.delimiter);
  8212. var prefix = options.addQueryPrefix === true ? '?' : '';
  8213. if (options.charsetSentinel) {
  8214. if (options.charset === 'iso-8859-1') {
  8215. // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
  8216. prefix += 'utf8=%26%2310003%3B&';
  8217. } else {
  8218. // encodeURIComponent('✓')
  8219. prefix += 'utf8=%E2%9C%93&';
  8220. }
  8221. }
  8222. return joined.length > 0 ? prefix + joined : '';
  8223. };
  8224. 'use strict';
  8225. var has$3 = Object.prototype.hasOwnProperty;
  8226. var defaults$2 = {
  8227. allowDots: false,
  8228. allowPrototypes: false,
  8229. arrayLimit: 20,
  8230. charset: 'utf-8',
  8231. charsetSentinel: false,
  8232. comma: false,
  8233. decoder: utils$1.decode,
  8234. delimiter: '&',
  8235. depth: 5,
  8236. ignoreQueryPrefix: false,
  8237. interpretNumericEntities: false,
  8238. parameterLimit: 1000,
  8239. parseArrays: true,
  8240. plainObjects: false,
  8241. strictNullHandling: false
  8242. };
  8243. var interpretNumericEntities = function (str) {
  8244. return str.replace(/&#(\d+);/g, function ($0, numberStr) {
  8245. return String.fromCharCode(parseInt(numberStr, 10));
  8246. });
  8247. };
  8248. // This is what browsers will submit when the ✓ character occurs in an
  8249. // application/x-www-form-urlencoded body and the encoding of the page containing
  8250. // the form is iso-8859-1, or when the submitted form has an accept-charset
  8251. // attribute of iso-8859-1. Presumably also with other charsets that do not contain
  8252. // the ✓ character, such as us-ascii.
  8253. var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
  8254. // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
  8255. var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
  8256. var parseValues = function parseQueryStringValues(str, options) {
  8257. var obj = {};
  8258. var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
  8259. var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
  8260. var parts = cleanStr.split(options.delimiter, limit);
  8261. var skipIndex = -1; // Keep track of where the utf8 sentinel was found
  8262. var i;
  8263. var charset = options.charset;
  8264. if (options.charsetSentinel) {
  8265. for (i = 0; i < parts.length; ++i) {
  8266. if (parts[i].indexOf('utf8=') === 0) {
  8267. if (parts[i] === charsetSentinel) {
  8268. charset = 'utf-8';
  8269. } else if (parts[i] === isoSentinel) {
  8270. charset = 'iso-8859-1';
  8271. }
  8272. skipIndex = i;
  8273. i = parts.length; // The eslint settings do not allow break;
  8274. }
  8275. }
  8276. }
  8277. for (i = 0; i < parts.length; ++i) {
  8278. if (i === skipIndex) {
  8279. continue;
  8280. }
  8281. var part = parts[i];
  8282. var bracketEqualsPos = part.indexOf(']=');
  8283. var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
  8284. var key, val;
  8285. if (pos === -1) {
  8286. key = options.decoder(part, defaults$2.decoder, charset, 'key');
  8287. val = options.strictNullHandling ? null : '';
  8288. } else {
  8289. key = options.decoder(part.slice(0, pos), defaults$2.decoder, charset, 'key');
  8290. val = options.decoder(part.slice(pos + 1), defaults$2.decoder, charset, 'value');
  8291. }
  8292. if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
  8293. val = interpretNumericEntities(val);
  8294. }
  8295. if (val && options.comma && val.indexOf(',') > -1) {
  8296. val = val.split(',');
  8297. }
  8298. if (has$3.call(obj, key)) {
  8299. obj[key] = utils$1.combine(obj[key], val);
  8300. } else {
  8301. obj[key] = val;
  8302. }
  8303. }
  8304. return obj;
  8305. };
  8306. var parseObject = function (chain, val, options) {
  8307. var leaf = val;
  8308. for (var i = chain.length - 1; i >= 0; --i) {
  8309. var obj;
  8310. var root = chain[i];
  8311. if (root === '[]' && options.parseArrays) {
  8312. obj = [].concat(leaf);
  8313. } else {
  8314. obj = options.plainObjects ? Object.create(null) : {};
  8315. var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
  8316. var index = parseInt(cleanRoot, 10);
  8317. if (!options.parseArrays && cleanRoot === '') {
  8318. obj = { 0: leaf };
  8319. } else if (
  8320. !isNaN(index)
  8321. && root !== cleanRoot
  8322. && String(index) === cleanRoot
  8323. && index >= 0
  8324. && (options.parseArrays && index <= options.arrayLimit)
  8325. ) {
  8326. obj = [];
  8327. obj[index] = leaf;
  8328. } else {
  8329. obj[cleanRoot] = leaf;
  8330. }
  8331. }
  8332. leaf = obj;
  8333. }
  8334. return leaf;
  8335. };
  8336. var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
  8337. if (!givenKey) {
  8338. return;
  8339. }
  8340. // Transform dot notation to bracket notation
  8341. var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
  8342. // The regex chunks
  8343. var brackets = /(\[[^[\]]*])/;
  8344. var child = /(\[[^[\]]*])/g;
  8345. // Get the parent
  8346. var segment = options.depth > 0 && brackets.exec(key);
  8347. var parent = segment ? key.slice(0, segment.index) : key;
  8348. // Stash the parent if it exists
  8349. var keys = [];
  8350. if (parent) {
  8351. // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
  8352. if (!options.plainObjects && has$3.call(Object.prototype, parent)) {
  8353. if (!options.allowPrototypes) {
  8354. return;
  8355. }
  8356. }
  8357. keys.push(parent);
  8358. }
  8359. // Loop through children appending to the array until we hit depth
  8360. var i = 0;
  8361. while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
  8362. i += 1;
  8363. if (!options.plainObjects && has$3.call(Object.prototype, segment[1].slice(1, -1))) {
  8364. if (!options.allowPrototypes) {
  8365. return;
  8366. }
  8367. }
  8368. keys.push(segment[1]);
  8369. }
  8370. // If there's a remainder, just add whatever is left
  8371. if (segment) {
  8372. keys.push('[' + key.slice(segment.index) + ']');
  8373. }
  8374. return parseObject(keys, val, options);
  8375. };
  8376. var normalizeParseOptions = function normalizeParseOptions(opts) {
  8377. if (!opts) {
  8378. return defaults$2;
  8379. }
  8380. if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
  8381. throw new TypeError('Decoder has to be a function.');
  8382. }
  8383. if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
  8384. throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');
  8385. }
  8386. var charset = typeof opts.charset === 'undefined' ? defaults$2.charset : opts.charset;
  8387. return {
  8388. allowDots: typeof opts.allowDots === 'undefined' ? defaults$2.allowDots : !!opts.allowDots,
  8389. allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults$2.allowPrototypes,
  8390. arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults$2.arrayLimit,
  8391. charset: charset,
  8392. charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$2.charsetSentinel,
  8393. comma: typeof opts.comma === 'boolean' ? opts.comma : defaults$2.comma,
  8394. decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults$2.decoder,
  8395. delimiter: typeof opts.delimiter === 'string' || utils$1.isRegExp(opts.delimiter) ? opts.delimiter : defaults$2.delimiter,
  8396. // eslint-disable-next-line no-implicit-coercion, no-extra-parens
  8397. depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults$2.depth,
  8398. ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
  8399. interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults$2.interpretNumericEntities,
  8400. parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults$2.parameterLimit,
  8401. parseArrays: opts.parseArrays !== false,
  8402. plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults$2.plainObjects,
  8403. strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$2.strictNullHandling
  8404. };
  8405. };
  8406. var parse$1 = function (str, opts) {
  8407. var options = normalizeParseOptions(opts);
  8408. if (str === '' || str === null || typeof str === 'undefined') {
  8409. return options.plainObjects ? Object.create(null) : {};
  8410. }
  8411. var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
  8412. var obj = options.plainObjects ? Object.create(null) : {};
  8413. // Iterate over the keys and setup the new object
  8414. var keys = Object.keys(tempObj);
  8415. for (var i = 0; i < keys.length; ++i) {
  8416. var key = keys[i];
  8417. var newObj = parseKeys(key, tempObj[key], options);
  8418. obj = utils$1.merge(obj, newObj, options);
  8419. }
  8420. return utils$1.compact(obj);
  8421. };
  8422. 'use strict';
  8423. var lib = {
  8424. formats: formats,
  8425. parse: parse$1,
  8426. stringify: stringify_1
  8427. };
  8428. var lib_1 = lib.formats;
  8429. var lib_2 = lib.parse;
  8430. var lib_3 = lib.stringify;
  8431. var client = function(axios, { url, ...credentials }) {
  8432. const config = {
  8433. url,
  8434. method: 'post',
  8435. data: lib.stringify(credentials)
  8436. };
  8437. return () => axios(config).then(res => res.data);
  8438. };
  8439. function getMaxAge(res) {
  8440. return res.expires_in;
  8441. }
  8442. function headerFormatter(res) {
  8443. return 'Bearer ' + res.access_token;
  8444. }
  8445. var interceptor = function (tokenProvider, authenticate) {
  8446. const getToken = tokenProvider.tokenCache(authenticate, { getMaxAge });
  8447. return tokenProvider({ getToken, headerFormatter });
  8448. };
  8449. var src = {
  8450. client: client,
  8451. interceptor: interceptor
  8452. };
  8453. var src_1 = src.client;
  8454. var src_2 = src.interceptor;
  8455. 'use strict';
  8456. /**
  8457. * Check if we're required to add a port number.
  8458. *
  8459. * @see https://url.spec.whatwg.org/#default-port
  8460. * @param {Number|String} port Port number we need to check
  8461. * @param {String} protocol Protocol we need to check against.
  8462. * @returns {Boolean} Is it a default port for the given protocol
  8463. * @api private
  8464. */
  8465. var requiresPort = function required(port, protocol) {
  8466. protocol = protocol.split(':')[0];
  8467. port = +port;
  8468. if (!port) return false;
  8469. switch (protocol) {
  8470. case 'http':
  8471. case 'ws':
  8472. return port !== 80;
  8473. case 'https':
  8474. case 'wss':
  8475. return port !== 443;
  8476. case 'ftp':
  8477. return port !== 21;
  8478. case 'gopher':
  8479. return port !== 70;
  8480. case 'file':
  8481. return false;
  8482. }
  8483. return port !== 0;
  8484. };
  8485. 'use strict';
  8486. var slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//
  8487. , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i
  8488. , whitespace = '[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]'
  8489. , left = new RegExp('^'+ whitespace +'+');
  8490. /**
  8491. * Trim a given string.
  8492. *
  8493. * @param {String} str String to trim.
  8494. * @public
  8495. */
  8496. function trimLeft(str) {
  8497. return (str ? str : '').toString().replace(left, '');
  8498. }
  8499. /**
  8500. * These are the parse rules for the URL parser, it informs the parser
  8501. * about:
  8502. *
  8503. * 0. The char it Needs to parse, if it's a string it should be done using
  8504. * indexOf, RegExp using exec and NaN means set as current value.
  8505. * 1. The property we should set when parsing this value.
  8506. * 2. Indication if it's backwards or forward parsing, when set as number it's
  8507. * the value of extra chars that should be split off.
  8508. * 3. Inherit from location if non existing in the parser.
  8509. * 4. `toLowerCase` the resulting value.
  8510. */
  8511. var rules = [
  8512. ['#', 'hash'], // Extract from the back.
  8513. ['?', 'query'], // Extract from the back.
  8514. function sanitize(address) { // Sanitize what is left of the address
  8515. return address.replace('\\', '/');
  8516. },
  8517. ['/', 'pathname'], // Extract from the back.
  8518. ['@', 'auth', 1], // Extract from the front.
  8519. [NaN, 'host', undefined, 1, 1], // Set left over value.
  8520. [/:(\d+)$/, 'port', undefined, 1], // RegExp the back.
  8521. [NaN, 'hostname', undefined, 1, 1] // Set left over.
  8522. ];
  8523. /**
  8524. * These properties should not be copied or inherited from. This is only needed
  8525. * for all non blob URL's as a blob URL does not include a hash, only the
  8526. * origin.
  8527. *
  8528. * @type {Object}
  8529. * @private
  8530. */
  8531. var ignore = { hash: 1, query: 1 };
  8532. /**
  8533. * The location object differs when your code is loaded through a normal page,
  8534. * Worker or through a worker using a blob. And with the blobble begins the
  8535. * trouble as the location object will contain the URL of the blob, not the
  8536. * location of the page where our code is loaded in. The actual origin is
  8537. * encoded in the `pathname` so we can thankfully generate a good "default"
  8538. * location from it so we can generate proper relative URL's again.
  8539. *
  8540. * @param {Object|String} loc Optional default location object.
  8541. * @returns {Object} lolcation object.
  8542. * @public
  8543. */
  8544. function lolcation(loc) {
  8545. var globalVar;
  8546. if (typeof window !== 'undefined') globalVar = window;
  8547. else if (typeof commonjsGlobal !== 'undefined') globalVar = commonjsGlobal;
  8548. else if (typeof self !== 'undefined') globalVar = self;
  8549. else globalVar = {};
  8550. var location = globalVar.location || {};
  8551. loc = loc || location;
  8552. var finaldestination = {}
  8553. , type = typeof loc
  8554. , key;
  8555. if ('blob:' === loc.protocol) {
  8556. finaldestination = new Url(unescape(loc.pathname), {});
  8557. } else if ('string' === type) {
  8558. finaldestination = new Url(loc, {});
  8559. for (key in ignore) delete finaldestination[key];
  8560. } else if ('object' === type) {
  8561. for (key in loc) {
  8562. if (key in ignore) continue;
  8563. finaldestination[key] = loc[key];
  8564. }
  8565. if (finaldestination.slashes === undefined) {
  8566. finaldestination.slashes = slashes.test(loc.href);
  8567. }
  8568. }
  8569. return finaldestination;
  8570. }
  8571. /**
  8572. * @typedef ProtocolExtract
  8573. * @type Object
  8574. * @property {String} protocol Protocol matched in the URL, in lowercase.
  8575. * @property {Boolean} slashes `true` if protocol is followed by "//", else `false`.
  8576. * @property {String} rest Rest of the URL that is not part of the protocol.
  8577. */
  8578. /**
  8579. * Extract protocol information from a URL with/without double slash ("//").
  8580. *
  8581. * @param {String} address URL we want to extract from.
  8582. * @return {ProtocolExtract} Extracted information.
  8583. * @private
  8584. */
  8585. function extractProtocol(address) {
  8586. address = trimLeft(address);
  8587. var match = protocolre.exec(address);
  8588. return {
  8589. protocol: match[1] ? match[1].toLowerCase() : '',
  8590. slashes: !!match[2],
  8591. rest: match[3]
  8592. };
  8593. }
  8594. /**
  8595. * Resolve a relative URL pathname against a base URL pathname.
  8596. *
  8597. * @param {String} relative Pathname of the relative URL.
  8598. * @param {String} base Pathname of the base URL.
  8599. * @return {String} Resolved pathname.
  8600. * @private
  8601. */
  8602. function resolve(relative, base) {
  8603. if (relative === '') return base;
  8604. var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))
  8605. , i = path.length
  8606. , last = path[i - 1]
  8607. , unshift = false
  8608. , up = 0;
  8609. while (i--) {
  8610. if (path[i] === '.') {
  8611. path.splice(i, 1);
  8612. } else if (path[i] === '..') {
  8613. path.splice(i, 1);
  8614. up++;
  8615. } else if (up) {
  8616. if (i === 0) unshift = true;
  8617. path.splice(i, 1);
  8618. up--;
  8619. }
  8620. }
  8621. if (unshift) path.unshift('');
  8622. if (last === '.' || last === '..') path.push('');
  8623. return path.join('/');
  8624. }
  8625. /**
  8626. * The actual URL instance. Instead of returning an object we've opted-in to
  8627. * create an actual constructor as it's much more memory efficient and
  8628. * faster and it pleases my OCD.
  8629. *
  8630. * It is worth noting that we should not use `URL` as class name to prevent
  8631. * clashes with the global URL instance that got introduced in browsers.
  8632. *
  8633. * @constructor
  8634. * @param {String} address URL we want to parse.
  8635. * @param {Object|String} [location] Location defaults for relative paths.
  8636. * @param {Boolean|Function} [parser] Parser for the query string.
  8637. * @private
  8638. */
  8639. function Url(address, location, parser) {
  8640. address = trimLeft(address);
  8641. if (!(this instanceof Url)) {
  8642. return new Url(address, location, parser);
  8643. }
  8644. var relative, extracted, parse, instruction, index, key
  8645. , instructions = rules.slice()
  8646. , type = typeof location
  8647. , url = this
  8648. , i = 0;
  8649. //
  8650. // The following if statements allows this module two have compatibility with
  8651. // 2 different API:
  8652. //
  8653. // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments
  8654. // where the boolean indicates that the query string should also be parsed.
  8655. //
  8656. // 2. The `URL` interface of the browser which accepts a URL, object as
  8657. // arguments. The supplied object will be used as default values / fall-back
  8658. // for relative paths.
  8659. //
  8660. if ('object' !== type && 'string' !== type) {
  8661. parser = location;
  8662. location = null;
  8663. }
  8664. if (parser && 'function' !== typeof parser) parser = querystringify_1.parse;
  8665. location = lolcation(location);
  8666. //
  8667. // Extract protocol information before running the instructions.
  8668. //
  8669. extracted = extractProtocol(address || '');
  8670. relative = !extracted.protocol && !extracted.slashes;
  8671. url.slashes = extracted.slashes || relative && location.slashes;
  8672. url.protocol = extracted.protocol || location.protocol || '';
  8673. address = extracted.rest;
  8674. //
  8675. // When the authority component is absent the URL starts with a path
  8676. // component.
  8677. //
  8678. if (!extracted.slashes) instructions[3] = [/(.*)/, 'pathname'];
  8679. for (; i < instructions.length; i++) {
  8680. instruction = instructions[i];
  8681. if (typeof instruction === 'function') {
  8682. address = instruction(address);
  8683. continue;
  8684. }
  8685. parse = instruction[0];
  8686. key = instruction[1];
  8687. if (parse !== parse) {
  8688. url[key] = address;
  8689. } else if ('string' === typeof parse) {
  8690. if (~(index = address.indexOf(parse))) {
  8691. if ('number' === typeof instruction[2]) {
  8692. url[key] = address.slice(0, index);
  8693. address = address.slice(index + instruction[2]);
  8694. } else {
  8695. url[key] = address.slice(index);
  8696. address = address.slice(0, index);
  8697. }
  8698. }
  8699. } else if ((index = parse.exec(address))) {
  8700. url[key] = index[1];
  8701. address = address.slice(0, index.index);
  8702. }
  8703. url[key] = url[key] || (
  8704. relative && instruction[3] ? location[key] || '' : ''
  8705. );
  8706. //
  8707. // Hostname, host and protocol should be lowercased so they can be used to
  8708. // create a proper `origin`.
  8709. //
  8710. if (instruction[4]) url[key] = url[key].toLowerCase();
  8711. }
  8712. //
  8713. // Also parse the supplied query string in to an object. If we're supplied
  8714. // with a custom parser as function use that instead of the default build-in
  8715. // parser.
  8716. //
  8717. if (parser) url.query = parser(url.query);
  8718. //
  8719. // If the URL is relative, resolve the pathname against the base URL.
  8720. //
  8721. if (
  8722. relative
  8723. && location.slashes
  8724. && url.pathname.charAt(0) !== '/'
  8725. && (url.pathname !== '' || location.pathname !== '')
  8726. ) {
  8727. url.pathname = resolve(url.pathname, location.pathname);
  8728. }
  8729. //
  8730. // We should not add port numbers if they are already the default port number
  8731. // for a given protocol. As the host also contains the port number we're going
  8732. // override it with the hostname which contains no port number.
  8733. //
  8734. if (!requiresPort(url.port, url.protocol)) {
  8735. url.host = url.hostname;
  8736. url.port = '';
  8737. }
  8738. //
  8739. // Parse down the `auth` for the username and password.
  8740. //
  8741. url.username = url.password = '';
  8742. if (url.auth) {
  8743. instruction = url.auth.split(':');
  8744. url.username = instruction[0] || '';
  8745. url.password = instruction[1] || '';
  8746. }
  8747. url.origin = url.protocol && url.host && url.protocol !== 'file:'
  8748. ? url.protocol +'//'+ url.host
  8749. : 'null';
  8750. //
  8751. // The href is just the compiled result.
  8752. //
  8753. url.href = url.toString();
  8754. }
  8755. /**
  8756. * This is convenience method for changing properties in the URL instance to
  8757. * insure that they all propagate correctly.
  8758. *
  8759. * @param {String} part Property we need to adjust.
  8760. * @param {Mixed} value The newly assigned value.
  8761. * @param {Boolean|Function} fn When setting the query, it will be the function
  8762. * used to parse the query.
  8763. * When setting the protocol, double slash will be
  8764. * removed from the final url if it is true.
  8765. * @returns {URL} URL instance for chaining.
  8766. * @public
  8767. */
  8768. function set(part, value, fn) {
  8769. var url = this;
  8770. switch (part) {
  8771. case 'query':
  8772. if ('string' === typeof value && value.length) {
  8773. value = (fn || querystringify_1.parse)(value);
  8774. }
  8775. url[part] = value;
  8776. break;
  8777. case 'port':
  8778. url[part] = value;
  8779. if (!requiresPort(value, url.protocol)) {
  8780. url.host = url.hostname;
  8781. url[part] = '';
  8782. } else if (value) {
  8783. url.host = url.hostname +':'+ value;
  8784. }
  8785. break;
  8786. case 'hostname':
  8787. url[part] = value;
  8788. if (url.port) value += ':'+ url.port;
  8789. url.host = value;
  8790. break;
  8791. case 'host':
  8792. url[part] = value;
  8793. if (/:\d+$/.test(value)) {
  8794. value = value.split(':');
  8795. url.port = value.pop();
  8796. url.hostname = value.join(':');
  8797. } else {
  8798. url.hostname = value;
  8799. url.port = '';
  8800. }
  8801. break;
  8802. case 'protocol':
  8803. url.protocol = value.toLowerCase();
  8804. url.slashes = !fn;
  8805. break;
  8806. case 'pathname':
  8807. case 'hash':
  8808. if (value) {
  8809. var char = part === 'pathname' ? '/' : '#';
  8810. url[part] = value.charAt(0) !== char ? char + value : value;
  8811. } else {
  8812. url[part] = value;
  8813. }
  8814. break;
  8815. default:
  8816. url[part] = value;
  8817. }
  8818. for (var i = 0; i < rules.length; i++) {
  8819. var ins = rules[i];
  8820. if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
  8821. }
  8822. url.origin = url.protocol && url.host && url.protocol !== 'file:'
  8823. ? url.protocol +'//'+ url.host
  8824. : 'null';
  8825. url.href = url.toString();
  8826. return url;
  8827. }
  8828. /**
  8829. * Transform the properties back in to a valid and full URL string.
  8830. *
  8831. * @param {Function} stringify Optional query stringify function.
  8832. * @returns {String} Compiled version of the URL.
  8833. * @public
  8834. */
  8835. function toString$1(stringify) {
  8836. if (!stringify || 'function' !== typeof stringify) stringify = querystringify_1.stringify;
  8837. var query
  8838. , url = this
  8839. , protocol = url.protocol;
  8840. if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';
  8841. var result = protocol + (url.slashes ? '//' : '');
  8842. if (url.username) {
  8843. result += url.username;
  8844. if (url.password) result += ':'+ url.password;
  8845. result += '@';
  8846. }
  8847. result += url.host + url.pathname;
  8848. query = 'object' === typeof url.query ? stringify(url.query) : url.query;
  8849. if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;
  8850. if (url.hash) result += url.hash;
  8851. return result;
  8852. }
  8853. Url.prototype = { set: set, toString: toString$1 };
  8854. //
  8855. // Expose the URL parser and some additional properties that might be useful for
  8856. // others or testing.
  8857. //
  8858. Url.extractProtocol = extractProtocol;
  8859. Url.location = lolcation;
  8860. Url.trimLeft = trimLeft;
  8861. Url.qs = querystringify_1;
  8862. var urlParse = Url;
  8863. var index_min = createCommonjsModule(function (module) {
  8864. module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n});},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n={statusCodes:[401]};t.default=function e(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=t.interceptors.response.use(function(e){return e},function(s){var i=o.hasOwnProperty("statusCodes")&&o.statusCodes.length?o.statusCodes:n.statusCodes;if(!s.response||s.response.status&&-1===i.indexOf(+s.response.status))return Promise.reject(s);t.interceptors.response.eject(u);var c=r(s),f=t.interceptors.request.use(function(e){return c.then(function(){return e})});return c.then(function(){return t.interceptors.request.eject(f),t(s.response.config)}).catch(function(e){return t.interceptors.request.eject(f),Promise.reject(e)}).finally(function(){return e(t,r,o)})});return t};}]);
  8865. });
  8866. var createAuthRefreshInterceptor = unwrapExports(index_min);
  8867. /* global DOMException */
  8868. var clipboardCopy_1 = clipboardCopy;
  8869. function clipboardCopy (text) {
  8870. // Use the Async Clipboard API when available. Requires a secure browing
  8871. // context (i.e. HTTPS)
  8872. if (navigator.clipboard) {
  8873. return navigator.clipboard.writeText(text).catch(function (err) {
  8874. throw (err !== undefined ? err : new DOMException('The request is not allowed', 'NotAllowedError'))
  8875. })
  8876. }
  8877. // ...Otherwise, use document.execCommand() fallback
  8878. // Put the text to copy into a <span>
  8879. var span = document.createElement('span');
  8880. span.textContent = text;
  8881. // Preserve consecutive spaces and newlines
  8882. span.style.whiteSpace = 'pre';
  8883. // Add the <span> to the page
  8884. document.body.appendChild(span);
  8885. // Make a selection object representing the range of text selected by the user
  8886. var selection = window.getSelection();
  8887. var range = window.document.createRange();
  8888. selection.removeAllRanges();
  8889. range.selectNode(span);
  8890. selection.addRange(range);
  8891. // Copy text to the clipboard
  8892. var success = false;
  8893. try {
  8894. success = window.document.execCommand('copy');
  8895. } catch (err) {
  8896. console.log('error', err);
  8897. }
  8898. // Cleanup
  8899. selection.removeAllRanges();
  8900. window.document.body.removeChild(span);
  8901. return success
  8902. ? Promise.resolve()
  8903. : Promise.reject(new DOMException('The request is not allowed', 'NotAllowedError'))
  8904. }
  8905. const subscriber_queue = [];
  8906. /**
  8907. * Creates a `Readable` store that allows reading by subscription.
  8908. * @param value initial value
  8909. * @param {StartStopNotifier}start start and stop notifications for subscriptions
  8910. */
  8911. function readable(value, start) {
  8912. return {
  8913. subscribe: writable(value, start).subscribe,
  8914. };
  8915. }
  8916. /**
  8917. * Create a `Writable` store that allows both updating and reading by subscription.
  8918. * @param {*=}value initial value
  8919. * @param {StartStopNotifier=}start start and stop notifications for subscriptions
  8920. */
  8921. function writable(value, start = noop) {
  8922. let stop;
  8923. const subscribers = [];
  8924. function set(new_value) {
  8925. if (safe_not_equal(value, new_value)) {
  8926. value = new_value;
  8927. if (stop) { // store is ready
  8928. const run_queue = !subscriber_queue.length;
  8929. for (let i = 0; i < subscribers.length; i += 1) {
  8930. const s = subscribers[i];
  8931. s[1]();
  8932. subscriber_queue.push(s, value);
  8933. }
  8934. if (run_queue) {
  8935. for (let i = 0; i < subscriber_queue.length; i += 2) {
  8936. subscriber_queue[i][0](subscriber_queue[i + 1]);
  8937. }
  8938. subscriber_queue.length = 0;
  8939. }
  8940. }
  8941. }
  8942. }
  8943. function update(fn) {
  8944. set(fn(value));
  8945. }
  8946. function subscribe(run, invalidate = noop) {
  8947. const subscriber = [run, invalidate];
  8948. subscribers.push(subscriber);
  8949. if (subscribers.length === 1) {
  8950. stop = start(set) || noop;
  8951. }
  8952. run(value);
  8953. return () => {
  8954. const index = subscribers.indexOf(subscriber);
  8955. if (index !== -1) {
  8956. subscribers.splice(index, 1);
  8957. }
  8958. if (subscribers.length === 0) {
  8959. stop();
  8960. stop = null;
  8961. }
  8962. };
  8963. }
  8964. return { set, update, subscribe };
  8965. }
  8966. /**
  8967. * Derived value store by synchronizing one or more readable stores and
  8968. * applying an aggregation function over its input values.
  8969. * @param {Stores} stores input stores
  8970. * @param {function(Stores=, function(*)=):*}fn function callback that aggregates the values
  8971. * @param {*=}initial_value when used asynchronously
  8972. */
  8973. function derived(stores, fn, initial_value) {
  8974. const single = !Array.isArray(stores);
  8975. const stores_array = single
  8976. ? [stores]
  8977. : stores;
  8978. const auto = fn.length < 2;
  8979. return readable(initial_value, (set) => {
  8980. let inited = false;
  8981. const values = [];
  8982. let pending = 0;
  8983. let cleanup = noop;
  8984. const sync = () => {
  8985. if (pending) {
  8986. return;
  8987. }
  8988. cleanup();
  8989. const result = fn(single ? values[0] : values, set);
  8990. if (auto) {
  8991. set(result);
  8992. }
  8993. else {
  8994. cleanup = is_function(result) ? result : noop;
  8995. }
  8996. };
  8997. const unsubscribers = stores_array.map((store, i) => store.subscribe((value) => {
  8998. values[i] = value;
  8999. pending &= ~(1 << i);
  9000. if (inited) {
  9001. sync();
  9002. }
  9003. }, () => {
  9004. pending |= (1 << i);
  9005. }));
  9006. inited = true;
  9007. sync();
  9008. return function stop() {
  9009. run_all(unsubscribers);
  9010. cleanup();
  9011. };
  9012. });
  9013. }
  9014. const env = writable("");
  9015. const token = writable("");
  9016. env.subscribe(val => {
  9017. if (val != "") {
  9018. store2.set("env", val);
  9019. }
  9020. });
  9021. function unique(value, index, self) {
  9022. return self.indexOf(value) === index;
  9023. }
  9024. function add(data, val) {
  9025. const arr = data.split(";");
  9026. arr.push(val);
  9027. return arr
  9028. .filter(unique)
  9029. .filter(String)
  9030. .join(";");
  9031. }
  9032. function remove(data, val) {
  9033. return data
  9034. .split(";")
  9035. .filter(v => v != val)
  9036. .join(";");
  9037. }
  9038. function createAuth() {
  9039. const { subscribe, update } = writable("");
  9040. return {
  9041. subscribe,
  9042. add: val => update(data => add(data, val)),
  9043. remove: val => update(data => remove(data, val))
  9044. };
  9045. }
  9046. const auth = createAuth();
  9047. prism.languages.json = {
  9048. property: {
  9049. pattern: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
  9050. greedy: true
  9051. },
  9052. string: {
  9053. pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
  9054. greedy: true
  9055. },
  9056. comment: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
  9057. number: /-?\d+\.?\d*(e[+-]?\d+)?/i,
  9058. punctuation: /[{}[\],]/,
  9059. operator: /:/,
  9060. boolean: /\b(?:true|false)\b/,
  9061. null: {
  9062. pattern: /\bnull\b/,
  9063. alias: "keyword"
  9064. }
  9065. };
  9066. const highlight = function(code, lang) {
  9067. const supported = ["xml", "json"];
  9068. if (!supported.includes(lang)) {
  9069. lang = "markup";
  9070. }
  9071. return prism.highlight(code, prism.languages[lang], lang);
  9072. };
  9073. marked.setOptions({
  9074. highlight
  9075. });
  9076. const renderer = new marked.Renderer();
  9077. renderer.pre = renderer.code;
  9078. renderer.code = function(code, infostring, escaped) {
  9079. const out = this.pre(code, infostring, escaped);
  9080. return out.replace("<pre>", `<pre class="language-${infostring}">`);
  9081. };
  9082. const markdown = function(source) {
  9083. return source ? marked(source, { renderer: renderer }) : "";
  9084. };
  9085. const toc = function(source) {
  9086. if (!source) {
  9087. return [];
  9088. }
  9089. const tokens = marked.lexer(source);
  9090. const headings = tokens.filter(elem => elem.type === "heading");
  9091. const depths = headings.map(head => head.depth);
  9092. const minDepth = Math.min(...depths);
  9093. return headings.map(head => ({
  9094. text: head.text,
  9095. level: head.depth - minDepth
  9096. }));
  9097. };
  9098. const colorize = function(str, prefix = "is-") {
  9099. switch (str) {
  9100. case "get":
  9101. return `${prefix}success`;
  9102. case "post":
  9103. return `${prefix}link`;
  9104. case "put":
  9105. return `${prefix}primary`;
  9106. case "patch":
  9107. return `${prefix}info`;
  9108. case "delete":
  9109. return `${prefix}danger`;
  9110. case 200:
  9111. case 201:
  9112. case 202:
  9113. case 204:
  9114. return `${prefix}info`;
  9115. case 401:
  9116. case 403:
  9117. case 404:
  9118. case 422:
  9119. return `${prefix}warning`;
  9120. case 500:
  9121. return `${prefix}danger`;
  9122. }
  9123. };
  9124. const slugify = function(str) {
  9125. return speakingurl$1(str, "-");
  9126. };
  9127. const alias = str => {
  9128. return str && str.match("json") ? "json" : "markup";
  9129. };
  9130. const stringify$2 = obj => {
  9131. if (typeof obj === "string") {
  9132. return obj;
  9133. }
  9134. if (obj) {
  9135. return JSON.stringify(obj, null, " ");
  9136. }
  9137. return "";
  9138. };
  9139. const expandUrl = (uri, obj) => {
  9140. const tpl = uritemplate.parse(uri);
  9141. return tpl.expand(obj);
  9142. };
  9143. const actionFilter = (act, regex) => {
  9144. return (
  9145. act.path.match(regex) || act.method.match(regex) || act.title.match(regex)
  9146. );
  9147. };
  9148. const filteredItem = (title, key, items) => {
  9149. if (items.length === 0) {
  9150. return false;
  9151. }
  9152. return { title: title, [key]: items };
  9153. };
  9154. const filterActions = (tagActions, regex) => {
  9155. return tagActions
  9156. .map(tag => {
  9157. const children = tag.children.map(child => {
  9158. const actions = child.actions.filter(act => actionFilter(act, regex));
  9159. return filteredItem(child.title, "actions", actions);
  9160. });
  9161. return filteredItem(tag.title, "children", children.filter(Boolean));
  9162. })
  9163. .filter(Boolean);
  9164. };
  9165. const basePath = config => {
  9166. if (config.basePath.endsWith("/")) {
  9167. return config.basePath;
  9168. } else {
  9169. return config.basePath + "/";
  9170. }
  9171. };
  9172. const tokenName = env => `token:${env}`;
  9173. const setToken = (env, token) => store2.session.set(tokenName(env), token);
  9174. const getToken = env => store2.session.get(tokenName(env));
  9175. const removeToken = env => store2.session.remove(tokenName(env));
  9176. const refreshTokenName = env => `refresh-token:${env}`;
  9177. const setRefreshToken = (env, token) =>
  9178. store2.session.set(refreshTokenName(env), token);
  9179. const getRefreshToken = env => store2.session.get(refreshTokenName(env));
  9180. const removeRefreshToken = env => store2.session.remove(refreshTokenName(env));
  9181. const isAuth = (environment, name) => {
  9182. return environment.auth && environment.auth.name === name;
  9183. };
  9184. const pushHistory = href => history.pushState(history.state, "", href);
  9185. const requestToken = async (client, options) => {
  9186. const authRequest = src.client(client, options);
  9187. const authCode = await authRequest();
  9188. if (typeof authCode === "string") {
  9189. const authParsed = querystringify_1.parse(authCode);
  9190. return {
  9191. accessToken: authParsed.access_token,
  9192. refreshToken: authParsed.refresh_token
  9193. };
  9194. }
  9195. return {
  9196. accessToken: authCode.access_token,
  9197. refreshToken: authCode.refresh_token
  9198. };
  9199. };
  9200. const exchangeToken = async (code, options) => {
  9201. return requestToken(axios$1.create(), {
  9202. url: options.tokenUrl,
  9203. grant_type: "authorization_code",
  9204. client_id: options.clientId,
  9205. client_secret: options.clientSecret,
  9206. redirect_uri: options.callbackUrl,
  9207. code: code
  9208. });
  9209. };
  9210. const populate = arr => {
  9211. return arr
  9212. .filter(obj => obj.used)
  9213. .reduce((prev, cur) => {
  9214. prev[cur.name] = cur.value;
  9215. return prev;
  9216. }, {});
  9217. };
  9218. const allowBody = action => {
  9219. return ["put", "post", "patch"].includes(action.method);
  9220. };
  9221. const refreshInterceptor = (env, options) => {
  9222. const refreshToken = getRefreshToken(env);
  9223. return async failedRequest => {
  9224. const {
  9225. accessToken: newAccessToken,
  9226. refreshToken: newRefreshToken
  9227. } = await requestToken(axios$1, {
  9228. url: options.tokenUrl,
  9229. grant_type: "refresh_token",
  9230. client_id: options.clientId,
  9231. client_secret: options.clientSecret,
  9232. refresh_token: refreshToken
  9233. });
  9234. if (newAccessToken) {
  9235. token.set(newAccessToken);
  9236. setToken(env, newAccessToken);
  9237. }
  9238. if (newRefreshToken) {
  9239. setRefreshToken(env, newRefreshToken);
  9240. }
  9241. failedRequest.response.config.headers[
  9242. "Authorization"
  9243. ] = `Bearer ${newAccessToken}`;
  9244. };
  9245. };
  9246. const sendRequest = (
  9247. env,
  9248. environment,
  9249. action,
  9250. { headers, parameters, body }
  9251. ) => {
  9252. const client = axios$1.create({
  9253. baseURL: environment.url
  9254. });
  9255. const options = {
  9256. method: action.method,
  9257. headers: populate(headers)
  9258. };
  9259. if (environment.auth) {
  9260. switch (environment.auth.name) {
  9261. case "basic":
  9262. options.auth = environment.auth.options;
  9263. break;
  9264. case "apikey":
  9265. options.headers[environment.auth.options.header] =
  9266. environment.auth.options.key;
  9267. break;
  9268. case "oauth2":
  9269. options.headers["Authorization"] = `Bearer ${getToken(env)}`;
  9270. break;
  9271. }
  9272. }
  9273. const expandedUrl = expandUrl(action.pathTemplate, populate(parameters));
  9274. const destUrl = urlParse(expandedUrl, true);
  9275. options.params = destUrl.query;
  9276. options.url = destUrl.pathname;
  9277. if (allowBody(action)) {
  9278. options.data = body;
  9279. }
  9280. if (isAuth(environment, "oauth2")) {
  9281. createAuthRefreshInterceptor(
  9282. client,
  9283. refreshInterceptor(env, environment.auth.options)
  9284. );
  9285. }
  9286. return client.request(options);
  9287. };
  9288. const copyUrl = (url, parameters) => {
  9289. const expandedUrl = expandUrl(url.pathname, populate(parameters));
  9290. clipboardCopy_1(url.origin + expandedUrl);
  9291. };
  9292. const getEnv = () => store2.get("env");
  9293. /* usr/local/lib/node_modules/snowboard/templates/winter/components/MenuItem.svelte generated by Svelte v3.12.1 */
  9294. function add_css() {
  9295. var style = element("style");
  9296. style.id = 'svelte-39af3j-style';
  9297. style.textContent = ".tag.svelte-39af3j{width:3.5rem}.menu-ellipsis.svelte-39af3j{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding:0.25em 0.75em}.menu-action.svelte-39af3j{vertical-align:middle}";
  9298. append(document.head, style);
  9299. }
  9300. function get_each_context(ctx, list, i) {
  9301. const child_ctx = Object.create(ctx);
  9302. child_ctx.action = list[i];
  9303. return child_ctx;
  9304. }
  9305. // (29:0) {#if title}
  9306. function create_if_block_1(ctx) {
  9307. var li, a, span, i, t0, t1, dispose;
  9308. return {
  9309. c() {
  9310. li = element("li");
  9311. a = element("a");
  9312. span = element("span");
  9313. i = element("i");
  9314. t0 = space();
  9315. t1 = text(ctx.title);
  9316. attr(i, "class", "fas");
  9317. toggle_class(i, "fa-chevron-right", ctx.hidden);
  9318. toggle_class(i, "fa-chevron-down", !ctx.hidden);
  9319. attr(span, "class", "icon has-text-grey-light");
  9320. attr(a, "href", "javascript:void(0)");
  9321. dispose = listen(a, "click", ctx.click_handler);
  9322. },
  9323. m(target, anchor) {
  9324. insert(target, li, anchor);
  9325. append(li, a);
  9326. append(a, span);
  9327. append(span, i);
  9328. append(a, t0);
  9329. append(a, t1);
  9330. },
  9331. p(changed, ctx) {
  9332. if (changed.hidden) {
  9333. toggle_class(i, "fa-chevron-right", ctx.hidden);
  9334. toggle_class(i, "fa-chevron-down", !ctx.hidden);
  9335. }
  9336. if (changed.title) {
  9337. set_data(t1, ctx.title);
  9338. }
  9339. },
  9340. d(detaching) {
  9341. if (detaching) {
  9342. detach(li);
  9343. }
  9344. dispose();
  9345. }
  9346. };
  9347. }
  9348. // (43:0) {#if actions.length > 0}
  9349. function create_if_block(ctx) {
  9350. var li, ul;
  9351. let each_value = ctx.actions;
  9352. let each_blocks = [];
  9353. for (let i = 0; i < each_value.length; i += 1) {
  9354. each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
  9355. }
  9356. return {
  9357. c() {
  9358. li = element("li");
  9359. ul = element("ul");
  9360. for (let i = 0; i < each_blocks.length; i += 1) {
  9361. each_blocks[i].c();
  9362. }
  9363. toggle_class(li, "is-hidden", ctx.hidden);
  9364. },
  9365. m(target, anchor) {
  9366. insert(target, li, anchor);
  9367. append(li, ul);
  9368. for (let i = 0; i < each_blocks.length; i += 1) {
  9369. each_blocks[i].m(ul, null);
  9370. }
  9371. },
  9372. p(changed, ctx) {
  9373. if (changed.actions || changed.currentSlug || changed.colorize) {
  9374. each_value = ctx.actions;
  9375. let i;
  9376. for (i = 0; i < each_value.length; i += 1) {
  9377. const child_ctx = get_each_context(ctx, each_value, i);
  9378. if (each_blocks[i]) {
  9379. each_blocks[i].p(changed, child_ctx);
  9380. } else {
  9381. each_blocks[i] = create_each_block(child_ctx);
  9382. each_blocks[i].c();
  9383. each_blocks[i].m(ul, null);
  9384. }
  9385. }
  9386. for (; i < each_blocks.length; i += 1) {
  9387. each_blocks[i].d(1);
  9388. }
  9389. each_blocks.length = each_value.length;
  9390. }
  9391. if (changed.hidden) {
  9392. toggle_class(li, "is-hidden", ctx.hidden);
  9393. }
  9394. },
  9395. d(detaching) {
  9396. if (detaching) {
  9397. detach(li);
  9398. }
  9399. destroy_each(each_blocks, detaching);
  9400. }
  9401. };
  9402. }
  9403. // (46:6) {#each actions as action}
  9404. function create_each_block(ctx) {
  9405. var li, a, code, t0_value = ctx.action.method + "", t0, code_class_value, t1, span, t2_value = ctx.action.title + "", t2, a_data_slug_value, a_href_value, t3, dispose;
  9406. return {
  9407. c() {
  9408. li = element("li");
  9409. a = element("a");
  9410. code = element("code");
  9411. t0 = text(t0_value);
  9412. t1 = space();
  9413. span = element("span");
  9414. t2 = text(t2_value);
  9415. t3 = space();
  9416. attr(code, "class", code_class_value = "tag " + colorize(ctx.action.method) + " is-uppercase" + " svelte-39af3j");
  9417. attr(span, "class", "menu-action svelte-39af3j");
  9418. attr(a, "data-slug", a_data_slug_value = ctx.action.slug);
  9419. attr(a, "href", a_href_value = "#/" + ctx.action.slug);
  9420. attr(a, "class", "menu-ellipsis svelte-39af3j");
  9421. toggle_class(a, "is-active", ctx.action.slug === ctx.currentSlug);
  9422. dispose = listen(a, "click", ctx.handleClick);
  9423. },
  9424. m(target, anchor) {
  9425. insert(target, li, anchor);
  9426. append(li, a);
  9427. append(a, code);
  9428. append(code, t0);
  9429. append(a, t1);
  9430. append(a, span);
  9431. append(span, t2);
  9432. append(li, t3);
  9433. },
  9434. p(changed, ctx) {
  9435. if ((changed.actions) && t0_value !== (t0_value = ctx.action.method + "")) {
  9436. set_data(t0, t0_value);
  9437. }
  9438. if ((changed.actions) && code_class_value !== (code_class_value = "tag " + colorize(ctx.action.method) + " is-uppercase" + " svelte-39af3j")) {
  9439. attr(code, "class", code_class_value);
  9440. }
  9441. if ((changed.actions) && t2_value !== (t2_value = ctx.action.title + "")) {
  9442. set_data(t2, t2_value);
  9443. }
  9444. if ((changed.actions) && a_data_slug_value !== (a_data_slug_value = ctx.action.slug)) {
  9445. attr(a, "data-slug", a_data_slug_value);
  9446. }
  9447. if ((changed.actions) && a_href_value !== (a_href_value = "#/" + ctx.action.slug)) {
  9448. attr(a, "href", a_href_value);
  9449. }
  9450. if ((changed.actions || changed.currentSlug)) {
  9451. toggle_class(a, "is-active", ctx.action.slug === ctx.currentSlug);
  9452. }
  9453. },
  9454. d(detaching) {
  9455. if (detaching) {
  9456. detach(li);
  9457. }
  9458. dispose();
  9459. }
  9460. };
  9461. }
  9462. function create_fragment(ctx) {
  9463. var t, if_block1_anchor;
  9464. var if_block0 = (ctx.title) && create_if_block_1(ctx);
  9465. var if_block1 = (ctx.actions.length > 0) && create_if_block(ctx);
  9466. return {
  9467. c() {
  9468. if (if_block0) if_block0.c();
  9469. t = space();
  9470. if (if_block1) if_block1.c();
  9471. if_block1_anchor = empty();
  9472. },
  9473. m(target, anchor) {
  9474. if (if_block0) if_block0.m(target, anchor);
  9475. insert(target, t, anchor);
  9476. if (if_block1) if_block1.m(target, anchor);
  9477. insert(target, if_block1_anchor, anchor);
  9478. },
  9479. p(changed, ctx) {
  9480. if (ctx.title) {
  9481. if (if_block0) {
  9482. if_block0.p(changed, ctx);
  9483. } else {
  9484. if_block0 = create_if_block_1(ctx);
  9485. if_block0.c();
  9486. if_block0.m(t.parentNode, t);
  9487. }
  9488. } else if (if_block0) {
  9489. if_block0.d(1);
  9490. if_block0 = null;
  9491. }
  9492. if (ctx.actions.length > 0) {
  9493. if (if_block1) {
  9494. if_block1.p(changed, ctx);
  9495. } else {
  9496. if_block1 = create_if_block(ctx);
  9497. if_block1.c();
  9498. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  9499. }
  9500. } else if (if_block1) {
  9501. if_block1.d(1);
  9502. if_block1 = null;
  9503. }
  9504. },
  9505. i: noop,
  9506. o: noop,
  9507. d(detaching) {
  9508. if (if_block0) if_block0.d(detaching);
  9509. if (detaching) {
  9510. detach(t);
  9511. }
  9512. if (if_block1) if_block1.d(detaching);
  9513. if (detaching) {
  9514. detach(if_block1_anchor);
  9515. }
  9516. }
  9517. };
  9518. }
  9519. function instance($$self, $$props, $$invalidate) {
  9520. let { title, actions, currentSlug, hidden = false, handleClick } = $$props;
  9521. const click_handler = () => ($$invalidate('hidden', hidden = !hidden));
  9522. $$self.$set = $$props => {
  9523. if ('title' in $$props) $$invalidate('title', title = $$props.title);
  9524. if ('actions' in $$props) $$invalidate('actions', actions = $$props.actions);
  9525. if ('currentSlug' in $$props) $$invalidate('currentSlug', currentSlug = $$props.currentSlug);
  9526. if ('hidden' in $$props) $$invalidate('hidden', hidden = $$props.hidden);
  9527. if ('handleClick' in $$props) $$invalidate('handleClick', handleClick = $$props.handleClick);
  9528. };
  9529. return {
  9530. title,
  9531. actions,
  9532. currentSlug,
  9533. hidden,
  9534. handleClick,
  9535. click_handler
  9536. };
  9537. }
  9538. class MenuItem extends SvelteComponent {
  9539. constructor(options) {
  9540. super();
  9541. if (!document.getElementById("svelte-39af3j-style")) add_css();
  9542. init(this, options, instance, create_fragment, safe_not_equal, ["title", "actions", "currentSlug", "hidden", "handleClick"]);
  9543. }
  9544. }
  9545. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/MenuPanel.svelte generated by Svelte v3.12.1 */
  9546. function add_css$1() {
  9547. var style = element("style");
  9548. style.id = 'svelte-1xl6iim-style';
  9549. style.textContent = ".hero.svelte-1xl6iim,.menu-wrapper.svelte-1xl6iim{padding:0 2.75rem 0 2rem}.hero.svelte-1xl6iim{position:sticky;top:54px;background-color:#fafafa;margin-bottom:1.5rem}.hero-body.svelte-1xl6iim{padding:1.5rem 0;box-shadow:0 2px 0 0 #f5f5f5}.menu-wrapper.svelte-1xl6iim::-webkit-scrollbar{display:none}@media screen and (min-width: 768px){.hero.svelte-1xl6iim,.menu-wrapper.svelte-1xl6iim{width:-moz-calc(25% - 0.5rem);width:-webkit-calc(25% - 0.5rem);width:-o-calc(25% - 0.5rem);width:calc(25% - 0.5rem)}.hero.svelte-1xl6iim{position:fixed;padding:0 1.25rem}.menu-wrapper.svelte-1xl6iim{position:fixed;top:140px;padding:1.5rem 1.25rem 1.25rem;height:-moz-calc(100% - 150px - 2.5rem);height:-webkit-calc(100% - 150px - 2.5rem);height:-o-calc(100% - 150px - 2.5rem);height:calc(100% - 150px - 2.5rem);overflow:-moz-scrollbars-none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:auto;transition:opacity 0.3s, left 0.3s}.menu.is-collapsed.svelte-1xl6iim{width:3rem}.is-collapsed.svelte-1xl6iim .hero.svelte-1xl6iim,.is-collapsed.svelte-1xl6iim .hero-body.svelte-1xl6iim{width:calc(3rem - 2px)}.is-collapsed.svelte-1xl6iim .hero.svelte-1xl6iim{padding-left:0;padding-right:0}.is-collapsed.svelte-1xl6iim .hero-body.svelte-1xl6iim{padding-left:0.3175rem;padding-right:0.3175rem;box-shadow:none}.is-collapsed.svelte-1xl6iim .input.is-rounded.svelte-1xl6iim{padding-left:0;padding-right:0;opacity:0}.is-collapsed.svelte-1xl6iim .icon-input-search.svelte-1xl6iim{color:#b5b5b5;background-color:#eee;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;cursor:pointer;pointer-events:auto}.is-collapsed.svelte-1xl6iim .icon-input-search.svelte-1xl6iim:hover{color:#999;background-color:#e0e0e0}.is-collapsed.svelte-1xl6iim .menu-wrapper.svelte-1xl6iim{left:-30%;opacity:0}}";
  9550. append(document.head, style);
  9551. }
  9552. function get_each_context_1(ctx, list, i) {
  9553. const child_ctx = Object.create(ctx);
  9554. child_ctx.child = list[i];
  9555. return child_ctx;
  9556. }
  9557. function get_each_context$1(ctx, list, i) {
  9558. const child_ctx = Object.create(ctx);
  9559. child_ctx.tag = list[i];
  9560. return child_ctx;
  9561. }
  9562. function get_each_context_2(ctx, list, i) {
  9563. const child_ctx = Object.create(ctx);
  9564. child_ctx.header = list[i];
  9565. return child_ctx;
  9566. }
  9567. // (156:6) {#if tagHeaders}
  9568. function create_if_block_1$1(ctx) {
  9569. var li, ul;
  9570. let each_value_2 = ctx.tagHeaders;
  9571. let each_blocks = [];
  9572. for (let i = 0; i < each_value_2.length; i += 1) {
  9573. each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i));
  9574. }
  9575. return {
  9576. c() {
  9577. li = element("li");
  9578. ul = element("ul");
  9579. for (let i = 0; i < each_blocks.length; i += 1) {
  9580. each_blocks[i].c();
  9581. }
  9582. },
  9583. m(target, anchor) {
  9584. insert(target, li, anchor);
  9585. append(li, ul);
  9586. for (let i = 0; i < each_blocks.length; i += 1) {
  9587. each_blocks[i].m(ul, null);
  9588. }
  9589. },
  9590. p(changed, ctx) {
  9591. if (changed.tagHeaders || changed.headerLink) {
  9592. each_value_2 = ctx.tagHeaders;
  9593. let i;
  9594. for (i = 0; i < each_value_2.length; i += 1) {
  9595. const child_ctx = get_each_context_2(ctx, each_value_2, i);
  9596. if (each_blocks[i]) {
  9597. each_blocks[i].p(changed, child_ctx);
  9598. } else {
  9599. each_blocks[i] = create_each_block_2(child_ctx);
  9600. each_blocks[i].c();
  9601. each_blocks[i].m(ul, null);
  9602. }
  9603. }
  9604. for (; i < each_blocks.length; i += 1) {
  9605. each_blocks[i].d(1);
  9606. }
  9607. each_blocks.length = each_value_2.length;
  9608. }
  9609. },
  9610. d(detaching) {
  9611. if (detaching) {
  9612. detach(li);
  9613. }
  9614. destroy_each(each_blocks, detaching);
  9615. }
  9616. };
  9617. }
  9618. // (160:14) {#if header.level === 0}
  9619. function create_if_block_2(ctx) {
  9620. var li, a, t0_value = ctx.header.text + "", t0, a_href_value, t1, dispose;
  9621. return {
  9622. c() {
  9623. li = element("li");
  9624. a = element("a");
  9625. t0 = text(t0_value);
  9626. t1 = space();
  9627. attr(a, "href", a_href_value = "#" + headerLink(ctx.header.text));
  9628. dispose = listen(a, "click", ctx.tocClick);
  9629. },
  9630. m(target, anchor) {
  9631. insert(target, li, anchor);
  9632. append(li, a);
  9633. append(a, t0);
  9634. append(li, t1);
  9635. },
  9636. p(changed, ctx) {
  9637. if ((changed.tagHeaders) && t0_value !== (t0_value = ctx.header.text + "")) {
  9638. set_data(t0, t0_value);
  9639. }
  9640. if ((changed.tagHeaders) && a_href_value !== (a_href_value = "#" + headerLink(ctx.header.text))) {
  9641. attr(a, "href", a_href_value);
  9642. }
  9643. },
  9644. d(detaching) {
  9645. if (detaching) {
  9646. detach(li);
  9647. }
  9648. dispose();
  9649. }
  9650. };
  9651. }
  9652. // (159:12) {#each tagHeaders as header}
  9653. function create_each_block_2(ctx) {
  9654. var if_block_anchor;
  9655. var if_block = (ctx.header.level === 0) && create_if_block_2(ctx);
  9656. return {
  9657. c() {
  9658. if (if_block) if_block.c();
  9659. if_block_anchor = empty();
  9660. },
  9661. m(target, anchor) {
  9662. if (if_block) if_block.m(target, anchor);
  9663. insert(target, if_block_anchor, anchor);
  9664. },
  9665. p(changed, ctx) {
  9666. if (ctx.header.level === 0) {
  9667. if (if_block) {
  9668. if_block.p(changed, ctx);
  9669. } else {
  9670. if_block = create_if_block_2(ctx);
  9671. if_block.c();
  9672. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  9673. }
  9674. } else if (if_block) {
  9675. if_block.d(1);
  9676. if_block = null;
  9677. }
  9678. },
  9679. d(detaching) {
  9680. if (if_block) if_block.d(detaching);
  9681. if (detaching) {
  9682. detach(if_block_anchor);
  9683. }
  9684. }
  9685. };
  9686. }
  9687. // (174:6) {#if tag.title}
  9688. function create_if_block$1(ctx) {
  9689. var p, t_value = ctx.tag.title + "", t;
  9690. return {
  9691. c() {
  9692. p = element("p");
  9693. t = text(t_value);
  9694. attr(p, "class", "menu-label");
  9695. },
  9696. m(target, anchor) {
  9697. insert(target, p, anchor);
  9698. append(p, t);
  9699. },
  9700. p(changed, ctx) {
  9701. if ((changed.filteredActions) && t_value !== (t_value = ctx.tag.title + "")) {
  9702. set_data(t, t_value);
  9703. }
  9704. },
  9705. d(detaching) {
  9706. if (detaching) {
  9707. detach(p);
  9708. }
  9709. }
  9710. };
  9711. }
  9712. // (179:8) {#each tag.children as child}
  9713. function create_each_block_1(ctx) {
  9714. var current;
  9715. var menuitem = new MenuItem({
  9716. props: {
  9717. title: ctx.child.title,
  9718. actions: ctx.child.actions,
  9719. hidden: ctx.actionsCount > 50,
  9720. currentSlug: ctx.currentSlug,
  9721. handleClick: ctx.handleClick
  9722. }
  9723. });
  9724. return {
  9725. c() {
  9726. menuitem.$$.fragment.c();
  9727. },
  9728. m(target, anchor) {
  9729. mount_component(menuitem, target, anchor);
  9730. current = true;
  9731. },
  9732. p(changed, ctx) {
  9733. var menuitem_changes = {};
  9734. if (changed.filteredActions) menuitem_changes.title = ctx.child.title;
  9735. if (changed.filteredActions) menuitem_changes.actions = ctx.child.actions;
  9736. if (changed.actionsCount) menuitem_changes.hidden = ctx.actionsCount > 50;
  9737. if (changed.currentSlug) menuitem_changes.currentSlug = ctx.currentSlug;
  9738. if (changed.handleClick) menuitem_changes.handleClick = ctx.handleClick;
  9739. menuitem.$set(menuitem_changes);
  9740. },
  9741. i(local) {
  9742. if (current) return;
  9743. transition_in(menuitem.$$.fragment, local);
  9744. current = true;
  9745. },
  9746. o(local) {
  9747. transition_out(menuitem.$$.fragment, local);
  9748. current = false;
  9749. },
  9750. d(detaching) {
  9751. destroy_component(menuitem, detaching);
  9752. }
  9753. };
  9754. }
  9755. // (173:4) {#each filteredActions as tag}
  9756. function create_each_block$1(ctx) {
  9757. var t0, ul, t1, current;
  9758. var if_block = (ctx.tag.title) && create_if_block$1(ctx);
  9759. let each_value_1 = ctx.tag.children;
  9760. let each_blocks = [];
  9761. for (let i = 0; i < each_value_1.length; i += 1) {
  9762. each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
  9763. }
  9764. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  9765. each_blocks[i] = null;
  9766. });
  9767. return {
  9768. c() {
  9769. if (if_block) if_block.c();
  9770. t0 = space();
  9771. ul = element("ul");
  9772. for (let i = 0; i < each_blocks.length; i += 1) {
  9773. each_blocks[i].c();
  9774. }
  9775. t1 = space();
  9776. attr(ul, "class", "menu-list");
  9777. },
  9778. m(target, anchor) {
  9779. if (if_block) if_block.m(target, anchor);
  9780. insert(target, t0, anchor);
  9781. insert(target, ul, anchor);
  9782. for (let i = 0; i < each_blocks.length; i += 1) {
  9783. each_blocks[i].m(ul, null);
  9784. }
  9785. append(ul, t1);
  9786. current = true;
  9787. },
  9788. p(changed, ctx) {
  9789. if (ctx.tag.title) {
  9790. if (if_block) {
  9791. if_block.p(changed, ctx);
  9792. } else {
  9793. if_block = create_if_block$1(ctx);
  9794. if_block.c();
  9795. if_block.m(t0.parentNode, t0);
  9796. }
  9797. } else if (if_block) {
  9798. if_block.d(1);
  9799. if_block = null;
  9800. }
  9801. if (changed.filteredActions || changed.actionsCount || changed.currentSlug || changed.handleClick) {
  9802. each_value_1 = ctx.tag.children;
  9803. let i;
  9804. for (i = 0; i < each_value_1.length; i += 1) {
  9805. const child_ctx = get_each_context_1(ctx, each_value_1, i);
  9806. if (each_blocks[i]) {
  9807. each_blocks[i].p(changed, child_ctx);
  9808. transition_in(each_blocks[i], 1);
  9809. } else {
  9810. each_blocks[i] = create_each_block_1(child_ctx);
  9811. each_blocks[i].c();
  9812. transition_in(each_blocks[i], 1);
  9813. each_blocks[i].m(ul, t1);
  9814. }
  9815. }
  9816. group_outros();
  9817. for (i = each_value_1.length; i < each_blocks.length; i += 1) {
  9818. out(i);
  9819. }
  9820. check_outros();
  9821. }
  9822. },
  9823. i(local) {
  9824. if (current) return;
  9825. for (let i = 0; i < each_value_1.length; i += 1) {
  9826. transition_in(each_blocks[i]);
  9827. }
  9828. current = true;
  9829. },
  9830. o(local) {
  9831. each_blocks = each_blocks.filter(Boolean);
  9832. for (let i = 0; i < each_blocks.length; i += 1) {
  9833. transition_out(each_blocks[i]);
  9834. }
  9835. current = false;
  9836. },
  9837. d(detaching) {
  9838. if (if_block) if_block.d(detaching);
  9839. if (detaching) {
  9840. detach(t0);
  9841. detach(ul);
  9842. }
  9843. destroy_each(each_blocks, detaching);
  9844. }
  9845. };
  9846. }
  9847. function create_fragment$1(ctx) {
  9848. var aside, section, div1, div0, p0, input, t0, span, t1, div2, p1, t3, ul, li, a, t4, a_href_value, t5, t6, current, dispose;
  9849. var if_block = (ctx.tagHeaders) && create_if_block_1$1(ctx);
  9850. let each_value = ctx.filteredActions;
  9851. let each_blocks = [];
  9852. for (let i_1 = 0; i_1 < each_value.length; i_1 += 1) {
  9853. each_blocks[i_1] = create_each_block$1(get_each_context$1(ctx, each_value, i_1));
  9854. }
  9855. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  9856. each_blocks[i] = null;
  9857. });
  9858. return {
  9859. c() {
  9860. aside = element("aside");
  9861. section = element("section");
  9862. div1 = element("div");
  9863. div0 = element("div");
  9864. p0 = element("p");
  9865. input = element("input");
  9866. t0 = space();
  9867. span = element("span");
  9868. span.innerHTML = `<i class="fas fa-search"></i>`;
  9869. t1 = space();
  9870. div2 = element("div");
  9871. p1 = element("p");
  9872. p1.textContent = "API";
  9873. t3 = space();
  9874. ul = element("ul");
  9875. li = element("li");
  9876. a = element("a");
  9877. t4 = text("Introduction");
  9878. t5 = space();
  9879. if (if_block) if_block.c();
  9880. t6 = space();
  9881. for (let i_1 = 0; i_1 < each_blocks.length; i_1 += 1) {
  9882. each_blocks[i_1].c();
  9883. }
  9884. attr(input, "id", "search-input-text");
  9885. attr(input, "class", "input is-rounded svelte-1xl6iim");
  9886. attr(input, "placeholder", "Filter by path, method, and title...");
  9887. attr(span, "class", "icon is-right icon-input-search svelte-1xl6iim");
  9888. attr(p0, "class", "control has-icons-right");
  9889. attr(div0, "class", "field");
  9890. attr(div1, "class", "hero-body svelte-1xl6iim");
  9891. attr(section, "class", "hero is-sticky svelte-1xl6iim");
  9892. attr(p1, "class", "menu-label");
  9893. attr(a, "href", a_href_value = basePath(ctx.config));
  9894. attr(ul, "class", "menu-list");
  9895. attr(div2, "class", "menu-wrapper svelte-1xl6iim");
  9896. attr(aside, "class", "menu svelte-1xl6iim");
  9897. toggle_class(aside, "is-collapsed", ctx.isCollapsed);
  9898. dispose = [
  9899. listen(input, "input", ctx.input_input_handler),
  9900. listen(span, "click", ctx.searchClick),
  9901. listen(a, "click", prevent_default(ctx.tocClick))
  9902. ];
  9903. },
  9904. m(target, anchor) {
  9905. insert(target, aside, anchor);
  9906. append(aside, section);
  9907. append(section, div1);
  9908. append(div1, div0);
  9909. append(div0, p0);
  9910. append(p0, input);
  9911. set_input_value(input, ctx.query);
  9912. append(p0, t0);
  9913. append(p0, span);
  9914. append(aside, t1);
  9915. append(aside, div2);
  9916. append(div2, p1);
  9917. append(div2, t3);
  9918. append(div2, ul);
  9919. append(ul, li);
  9920. append(li, a);
  9921. append(a, t4);
  9922. append(ul, t5);
  9923. if (if_block) if_block.m(ul, null);
  9924. append(div2, t6);
  9925. for (let i_1 = 0; i_1 < each_blocks.length; i_1 += 1) {
  9926. each_blocks[i_1].m(div2, null);
  9927. }
  9928. current = true;
  9929. },
  9930. p(changed, ctx) {
  9931. if (changed.query && (input.value !== ctx.query)) set_input_value(input, ctx.query);
  9932. if ((!current || changed.config) && a_href_value !== (a_href_value = basePath(ctx.config))) {
  9933. attr(a, "href", a_href_value);
  9934. }
  9935. if (ctx.tagHeaders) {
  9936. if (if_block) {
  9937. if_block.p(changed, ctx);
  9938. } else {
  9939. if_block = create_if_block_1$1(ctx);
  9940. if_block.c();
  9941. if_block.m(ul, null);
  9942. }
  9943. } else if (if_block) {
  9944. if_block.d(1);
  9945. if_block = null;
  9946. }
  9947. if (changed.filteredActions || changed.actionsCount || changed.currentSlug || changed.handleClick) {
  9948. each_value = ctx.filteredActions;
  9949. let i_1;
  9950. for (i_1 = 0; i_1 < each_value.length; i_1 += 1) {
  9951. const child_ctx = get_each_context$1(ctx, each_value, i_1);
  9952. if (each_blocks[i_1]) {
  9953. each_blocks[i_1].p(changed, child_ctx);
  9954. transition_in(each_blocks[i_1], 1);
  9955. } else {
  9956. each_blocks[i_1] = create_each_block$1(child_ctx);
  9957. each_blocks[i_1].c();
  9958. transition_in(each_blocks[i_1], 1);
  9959. each_blocks[i_1].m(div2, null);
  9960. }
  9961. }
  9962. group_outros();
  9963. for (i_1 = each_value.length; i_1 < each_blocks.length; i_1 += 1) {
  9964. out(i_1);
  9965. }
  9966. check_outros();
  9967. }
  9968. if (changed.isCollapsed) {
  9969. toggle_class(aside, "is-collapsed", ctx.isCollapsed);
  9970. }
  9971. },
  9972. i(local) {
  9973. if (current) return;
  9974. for (let i_1 = 0; i_1 < each_value.length; i_1 += 1) {
  9975. transition_in(each_blocks[i_1]);
  9976. }
  9977. current = true;
  9978. },
  9979. o(local) {
  9980. each_blocks = each_blocks.filter(Boolean);
  9981. for (let i_1 = 0; i_1 < each_blocks.length; i_1 += 1) {
  9982. transition_out(each_blocks[i_1]);
  9983. }
  9984. current = false;
  9985. },
  9986. d(detaching) {
  9987. if (detaching) {
  9988. detach(aside);
  9989. }
  9990. if (if_block) if_block.d();
  9991. destroy_each(each_blocks, detaching);
  9992. run_all(dispose);
  9993. }
  9994. };
  9995. }
  9996. function escape$2(text) {
  9997. return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
  9998. }
  9999. function headerLink(text) {
  10000. return text.toLowerCase().replace(/\s/g, "-");
  10001. }
  10002. function instance$1($$self, $$props, $$invalidate) {
  10003. let { config = {}, tagActions = [], tagHeaders = [], currentSlug, actionsCount, isCollapsed, handleClick, tocClick, searchClick } = $$props;
  10004. let query = "";
  10005. function input_input_handler() {
  10006. query = this.value;
  10007. $$invalidate('query', query);
  10008. }
  10009. $$self.$set = $$props => {
  10010. if ('config' in $$props) $$invalidate('config', config = $$props.config);
  10011. if ('tagActions' in $$props) $$invalidate('tagActions', tagActions = $$props.tagActions);
  10012. if ('tagHeaders' in $$props) $$invalidate('tagHeaders', tagHeaders = $$props.tagHeaders);
  10013. if ('currentSlug' in $$props) $$invalidate('currentSlug', currentSlug = $$props.currentSlug);
  10014. if ('actionsCount' in $$props) $$invalidate('actionsCount', actionsCount = $$props.actionsCount);
  10015. if ('isCollapsed' in $$props) $$invalidate('isCollapsed', isCollapsed = $$props.isCollapsed);
  10016. if ('handleClick' in $$props) $$invalidate('handleClick', handleClick = $$props.handleClick);
  10017. if ('tocClick' in $$props) $$invalidate('tocClick', tocClick = $$props.tocClick);
  10018. if ('searchClick' in $$props) $$invalidate('searchClick', searchClick = $$props.searchClick);
  10019. };
  10020. let regex, filteredActions;
  10021. $$self.$$.update = ($$dirty = { query: 1, tagActions: 1, regex: 1 }) => {
  10022. if ($$dirty.query) { $$invalidate('regex', regex = new RegExp(escape$2(query), "gi")); }
  10023. if ($$dirty.tagActions || $$dirty.regex) { $$invalidate('filteredActions', filteredActions = filterActions(tagActions, regex)); }
  10024. };
  10025. return {
  10026. config,
  10027. tagActions,
  10028. tagHeaders,
  10029. currentSlug,
  10030. actionsCount,
  10031. isCollapsed,
  10032. handleClick,
  10033. tocClick,
  10034. searchClick,
  10035. query,
  10036. filteredActions,
  10037. input_input_handler
  10038. };
  10039. }
  10040. class MenuPanel extends SvelteComponent {
  10041. constructor(options) {
  10042. super();
  10043. if (!document.getElementById("svelte-1xl6iim-style")) add_css$1();
  10044. init(this, options, instance$1, create_fragment$1, safe_not_equal, ["config", "tagActions", "tagHeaders", "currentSlug", "actionsCount", "isCollapsed", "handleClick", "tocClick", "searchClick"]);
  10045. }
  10046. }
  10047. /* usr/local/lib/node_modules/snowboard/templates/winter/tables/HeaderTable.svelte generated by Svelte v3.12.1 */
  10048. function get_each_context$2(ctx, list, i) {
  10049. const child_ctx = Object.create(ctx);
  10050. child_ctx.name = list[i].name;
  10051. child_ctx.example = list[i].example;
  10052. return child_ctx;
  10053. }
  10054. // (5:0) {#if headers.length > 0}
  10055. function create_if_block$2(ctx) {
  10056. var table, thead, t_1, tbody;
  10057. let each_value = ctx.headers;
  10058. let each_blocks = [];
  10059. for (let i = 0; i < each_value.length; i += 1) {
  10060. each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
  10061. }
  10062. return {
  10063. c() {
  10064. table = element("table");
  10065. thead = element("thead");
  10066. thead.innerHTML = `<tr><th colspan="2">Headers</th></tr>`;
  10067. t_1 = space();
  10068. tbody = element("tbody");
  10069. for (let i = 0; i < each_blocks.length; i += 1) {
  10070. each_blocks[i].c();
  10071. }
  10072. attr(table, "class", "table is-stripped is-fullwidth");
  10073. },
  10074. m(target, anchor) {
  10075. insert(target, table, anchor);
  10076. append(table, thead);
  10077. append(table, t_1);
  10078. append(table, tbody);
  10079. for (let i = 0; i < each_blocks.length; i += 1) {
  10080. each_blocks[i].m(tbody, null);
  10081. }
  10082. },
  10083. p(changed, ctx) {
  10084. if (changed.headers) {
  10085. each_value = ctx.headers;
  10086. let i;
  10087. for (i = 0; i < each_value.length; i += 1) {
  10088. const child_ctx = get_each_context$2(ctx, each_value, i);
  10089. if (each_blocks[i]) {
  10090. each_blocks[i].p(changed, child_ctx);
  10091. } else {
  10092. each_blocks[i] = create_each_block$2(child_ctx);
  10093. each_blocks[i].c();
  10094. each_blocks[i].m(tbody, null);
  10095. }
  10096. }
  10097. for (; i < each_blocks.length; i += 1) {
  10098. each_blocks[i].d(1);
  10099. }
  10100. each_blocks.length = each_value.length;
  10101. }
  10102. },
  10103. d(detaching) {
  10104. if (detaching) {
  10105. detach(table);
  10106. }
  10107. destroy_each(each_blocks, detaching);
  10108. }
  10109. };
  10110. }
  10111. // (13:6) {#each headers as { name, example }}
  10112. function create_each_block$2(ctx) {
  10113. var tr, td0, t0_value = ctx.name + "", t0, t1, td1, code, t2_value = ctx.example + "", t2, t3;
  10114. return {
  10115. c() {
  10116. tr = element("tr");
  10117. td0 = element("td");
  10118. t0 = text(t0_value);
  10119. t1 = space();
  10120. td1 = element("td");
  10121. code = element("code");
  10122. t2 = text(t2_value);
  10123. t3 = space();
  10124. },
  10125. m(target, anchor) {
  10126. insert(target, tr, anchor);
  10127. append(tr, td0);
  10128. append(td0, t0);
  10129. append(tr, t1);
  10130. append(tr, td1);
  10131. append(td1, code);
  10132. append(code, t2);
  10133. append(tr, t3);
  10134. },
  10135. p(changed, ctx) {
  10136. if ((changed.headers) && t0_value !== (t0_value = ctx.name + "")) {
  10137. set_data(t0, t0_value);
  10138. }
  10139. if ((changed.headers) && t2_value !== (t2_value = ctx.example + "")) {
  10140. set_data(t2, t2_value);
  10141. }
  10142. },
  10143. d(detaching) {
  10144. if (detaching) {
  10145. detach(tr);
  10146. }
  10147. }
  10148. };
  10149. }
  10150. function create_fragment$2(ctx) {
  10151. var if_block_anchor;
  10152. var if_block = (ctx.headers.length > 0) && create_if_block$2(ctx);
  10153. return {
  10154. c() {
  10155. if (if_block) if_block.c();
  10156. if_block_anchor = empty();
  10157. },
  10158. m(target, anchor) {
  10159. if (if_block) if_block.m(target, anchor);
  10160. insert(target, if_block_anchor, anchor);
  10161. },
  10162. p(changed, ctx) {
  10163. if (ctx.headers.length > 0) {
  10164. if (if_block) {
  10165. if_block.p(changed, ctx);
  10166. } else {
  10167. if_block = create_if_block$2(ctx);
  10168. if_block.c();
  10169. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  10170. }
  10171. } else if (if_block) {
  10172. if_block.d(1);
  10173. if_block = null;
  10174. }
  10175. },
  10176. i: noop,
  10177. o: noop,
  10178. d(detaching) {
  10179. if (if_block) if_block.d(detaching);
  10180. if (detaching) {
  10181. detach(if_block_anchor);
  10182. }
  10183. }
  10184. };
  10185. }
  10186. function instance$2($$self, $$props, $$invalidate) {
  10187. let { headers = [] } = $$props;
  10188. $$self.$set = $$props => {
  10189. if ('headers' in $$props) $$invalidate('headers', headers = $$props.headers);
  10190. };
  10191. return { headers };
  10192. }
  10193. class HeaderTable extends SvelteComponent {
  10194. constructor(options) {
  10195. super();
  10196. init(this, options, instance$2, create_fragment$2, safe_not_equal, ["headers"]);
  10197. }
  10198. }
  10199. /* usr/local/lib/node_modules/snowboard/templates/winter/components/CodeBlock.svelte generated by Svelte v3.12.1 */
  10200. // (10:0) {#if body}
  10201. function create_if_block$3(ctx) {
  10202. var pre, code, raw_value = highlight(stringify$2(ctx.body), ctx.mime) + "", code_class_value, pre_class_value;
  10203. return {
  10204. c() {
  10205. pre = element("pre");
  10206. code = element("code");
  10207. attr(code, "class", code_class_value = "language-" + ctx.mime);
  10208. attr(pre, "class", pre_class_value = "language-" + ctx.mime);
  10209. },
  10210. m(target, anchor) {
  10211. insert(target, pre, anchor);
  10212. append(pre, code);
  10213. code.innerHTML = raw_value;
  10214. },
  10215. p(changed, ctx) {
  10216. if ((changed.body || changed.mime) && raw_value !== (raw_value = highlight(stringify$2(ctx.body), ctx.mime) + "")) {
  10217. code.innerHTML = raw_value;
  10218. }
  10219. if ((changed.mime) && code_class_value !== (code_class_value = "language-" + ctx.mime)) {
  10220. attr(code, "class", code_class_value);
  10221. }
  10222. if ((changed.mime) && pre_class_value !== (pre_class_value = "language-" + ctx.mime)) {
  10223. attr(pre, "class", pre_class_value);
  10224. }
  10225. },
  10226. d(detaching) {
  10227. if (detaching) {
  10228. detach(pre);
  10229. }
  10230. }
  10231. };
  10232. }
  10233. function create_fragment$3(ctx) {
  10234. var if_block_anchor;
  10235. var if_block = (ctx.body) && create_if_block$3(ctx);
  10236. return {
  10237. c() {
  10238. if (if_block) if_block.c();
  10239. if_block_anchor = empty();
  10240. },
  10241. m(target, anchor) {
  10242. if (if_block) if_block.m(target, anchor);
  10243. insert(target, if_block_anchor, anchor);
  10244. },
  10245. p(changed, ctx) {
  10246. if (ctx.body) {
  10247. if (if_block) {
  10248. if_block.p(changed, ctx);
  10249. } else {
  10250. if_block = create_if_block$3(ctx);
  10251. if_block.c();
  10252. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  10253. }
  10254. } else if (if_block) {
  10255. if_block.d(1);
  10256. if_block = null;
  10257. }
  10258. },
  10259. i: noop,
  10260. o: noop,
  10261. d(detaching) {
  10262. if (if_block) if_block.d(detaching);
  10263. if (detaching) {
  10264. detach(if_block_anchor);
  10265. }
  10266. }
  10267. };
  10268. }
  10269. function instance$3($$self, $$props, $$invalidate) {
  10270. let { type, body } = $$props;
  10271. $$self.$set = $$props => {
  10272. if ('type' in $$props) $$invalidate('type', type = $$props.type);
  10273. if ('body' in $$props) $$invalidate('body', body = $$props.body);
  10274. };
  10275. let mime;
  10276. $$self.$$.update = ($$dirty = { type: 1 }) => {
  10277. if ($$dirty.type) { $$invalidate('mime', mime = alias(type)); }
  10278. };
  10279. return { type, body, mime };
  10280. }
  10281. class CodeBlock extends SvelteComponent {
  10282. constructor(options) {
  10283. super();
  10284. init(this, options, instance$3, create_fragment$3, safe_not_equal, ["type", "body"]);
  10285. }
  10286. }
  10287. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/CodePanel.svelte generated by Svelte v3.12.1 */
  10288. function add_css$2() {
  10289. var style = element("style");
  10290. style.id = 'svelte-15v28ah-style';
  10291. style.textContent = ".tab-content.svelte-15v28ah{display:none}.tab-content.is-active.svelte-15v28ah{display:block}";
  10292. append(document.head, style);
  10293. }
  10294. // (32:0) {#if example || schema}
  10295. function create_if_block$4(ctx) {
  10296. var div2, div0, ul, li0, a0, t1, li1, a1, t3, div1, section0, section0_class_value, t4, section1, section1_class_value, current, dispose;
  10297. var codeblock0 = new CodeBlock({
  10298. props: { type: ctx.contentType, body: ctx.example }
  10299. });
  10300. var codeblock1 = new CodeBlock({
  10301. props: {
  10302. type: "application/json",
  10303. body: ctx.schema
  10304. }
  10305. });
  10306. return {
  10307. c() {
  10308. div2 = element("div");
  10309. div0 = element("div");
  10310. ul = element("ul");
  10311. li0 = element("li");
  10312. a0 = element("a");
  10313. a0.textContent = "Body";
  10314. t1 = space();
  10315. li1 = element("li");
  10316. a1 = element("a");
  10317. a1.textContent = "Schema";
  10318. t3 = space();
  10319. div1 = element("div");
  10320. section0 = element("section");
  10321. codeblock0.$$.fragment.c();
  10322. t4 = space();
  10323. section1 = element("section");
  10324. codeblock1.$$.fragment.c();
  10325. attr(a0, "data-index", "0");
  10326. attr(a0, "href", "javascript:void(0)");
  10327. toggle_class(li0, "is-active", ctx.tabIndex === 0);
  10328. attr(a1, "data-index", "1");
  10329. attr(a1, "href", "javascript:void(0)");
  10330. toggle_class(li1, "is-active", ctx.tabIndex === 1);
  10331. attr(div0, "class", "tabs is-fullwidth");
  10332. toggle_class(div0, "is-toggle", ctx.asToggle);
  10333. attr(section0, "class", section0_class_value = "tab-content " + ctx.activeBody + " svelte-15v28ah");
  10334. attr(section1, "class", section1_class_value = "tab-content " + ctx.activeSchema + " svelte-15v28ah");
  10335. attr(div2, "class", "tabs-with-content");
  10336. dispose = [
  10337. listen(a0, "click", ctx.tabSelect),
  10338. listen(a1, "click", ctx.tabSelect)
  10339. ];
  10340. },
  10341. m(target, anchor) {
  10342. insert(target, div2, anchor);
  10343. append(div2, div0);
  10344. append(div0, ul);
  10345. append(ul, li0);
  10346. append(li0, a0);
  10347. append(ul, t1);
  10348. append(ul, li1);
  10349. append(li1, a1);
  10350. append(div2, t3);
  10351. append(div2, div1);
  10352. append(div1, section0);
  10353. mount_component(codeblock0, section0, null);
  10354. append(div1, t4);
  10355. append(div1, section1);
  10356. mount_component(codeblock1, section1, null);
  10357. current = true;
  10358. },
  10359. p(changed, ctx) {
  10360. if (changed.tabIndex) {
  10361. toggle_class(li0, "is-active", ctx.tabIndex === 0);
  10362. toggle_class(li1, "is-active", ctx.tabIndex === 1);
  10363. }
  10364. if (changed.asToggle) {
  10365. toggle_class(div0, "is-toggle", ctx.asToggle);
  10366. }
  10367. var codeblock0_changes = {};
  10368. if (changed.contentType) codeblock0_changes.type = ctx.contentType;
  10369. if (changed.example) codeblock0_changes.body = ctx.example;
  10370. codeblock0.$set(codeblock0_changes);
  10371. if ((!current || changed.activeBody) && section0_class_value !== (section0_class_value = "tab-content " + ctx.activeBody + " svelte-15v28ah")) {
  10372. attr(section0, "class", section0_class_value);
  10373. }
  10374. var codeblock1_changes = {};
  10375. if (changed.schema) codeblock1_changes.body = ctx.schema;
  10376. codeblock1.$set(codeblock1_changes);
  10377. if ((!current || changed.activeSchema) && section1_class_value !== (section1_class_value = "tab-content " + ctx.activeSchema + " svelte-15v28ah")) {
  10378. attr(section1, "class", section1_class_value);
  10379. }
  10380. },
  10381. i(local) {
  10382. if (current) return;
  10383. transition_in(codeblock0.$$.fragment, local);
  10384. transition_in(codeblock1.$$.fragment, local);
  10385. current = true;
  10386. },
  10387. o(local) {
  10388. transition_out(codeblock0.$$.fragment, local);
  10389. transition_out(codeblock1.$$.fragment, local);
  10390. current = false;
  10391. },
  10392. d(detaching) {
  10393. if (detaching) {
  10394. detach(div2);
  10395. }
  10396. destroy_component(codeblock0);
  10397. destroy_component(codeblock1);
  10398. run_all(dispose);
  10399. }
  10400. };
  10401. }
  10402. function create_fragment$4(ctx) {
  10403. var if_block_anchor, current;
  10404. var if_block = (ctx.example || ctx.schema) && create_if_block$4(ctx);
  10405. return {
  10406. c() {
  10407. if (if_block) if_block.c();
  10408. if_block_anchor = empty();
  10409. },
  10410. m(target, anchor) {
  10411. if (if_block) if_block.m(target, anchor);
  10412. insert(target, if_block_anchor, anchor);
  10413. current = true;
  10414. },
  10415. p(changed, ctx) {
  10416. if (ctx.example || ctx.schema) {
  10417. if (if_block) {
  10418. if_block.p(changed, ctx);
  10419. transition_in(if_block, 1);
  10420. } else {
  10421. if_block = create_if_block$4(ctx);
  10422. if_block.c();
  10423. transition_in(if_block, 1);
  10424. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  10425. }
  10426. } else if (if_block) {
  10427. group_outros();
  10428. transition_out(if_block, 1, 1, () => {
  10429. if_block = null;
  10430. });
  10431. check_outros();
  10432. }
  10433. },
  10434. i(local) {
  10435. if (current) return;
  10436. transition_in(if_block);
  10437. current = true;
  10438. },
  10439. o(local) {
  10440. transition_out(if_block);
  10441. current = false;
  10442. },
  10443. d(detaching) {
  10444. if (if_block) if_block.d(detaching);
  10445. if (detaching) {
  10446. detach(if_block_anchor);
  10447. }
  10448. }
  10449. };
  10450. }
  10451. function instance$4($$self, $$props, $$invalidate) {
  10452. let { contentType, example, schema, asToggle } = $$props;
  10453. let activeBody = "is-active";
  10454. let activeSchema = "";
  10455. let tabIndex = 0;
  10456. const tabSelect = event => {
  10457. const index = event.target.dataset["index"];
  10458. $$invalidate('tabIndex', tabIndex = parseInt(index, 10));
  10459. };
  10460. $$self.$set = $$props => {
  10461. if ('contentType' in $$props) $$invalidate('contentType', contentType = $$props.contentType);
  10462. if ('example' in $$props) $$invalidate('example', example = $$props.example);
  10463. if ('schema' in $$props) $$invalidate('schema', schema = $$props.schema);
  10464. if ('asToggle' in $$props) $$invalidate('asToggle', asToggle = $$props.asToggle);
  10465. };
  10466. $$self.$$.update = ($$dirty = { tabIndex: 1 }) => {
  10467. if ($$dirty.tabIndex) { $$invalidate('activeBody', activeBody = tabIndex === 0 ? "is-active" : ""); }
  10468. if ($$dirty.tabIndex) { $$invalidate('activeSchema', activeSchema = tabIndex === 1 ? "is-active" : ""); }
  10469. };
  10470. return {
  10471. contentType,
  10472. example,
  10473. schema,
  10474. asToggle,
  10475. activeBody,
  10476. activeSchema,
  10477. tabIndex,
  10478. tabSelect
  10479. };
  10480. }
  10481. class CodePanel extends SvelteComponent {
  10482. constructor(options) {
  10483. super();
  10484. if (!document.getElementById("svelte-15v28ah-style")) add_css$2();
  10485. init(this, options, instance$4, create_fragment$4, safe_not_equal, ["contentType", "example", "schema", "asToggle", "tabSelect"]);
  10486. }
  10487. get tabSelect() {
  10488. return this.$$.ctx.tabSelect;
  10489. }
  10490. }
  10491. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/RequestPanel.svelte generated by Svelte v3.12.1 */
  10492. // (16:0) {#if description}
  10493. function create_if_block_1$2(ctx) {
  10494. var div, raw_value = markdown(ctx.description) + "";
  10495. return {
  10496. c() {
  10497. div = element("div");
  10498. attr(div, "class", "content");
  10499. },
  10500. m(target, anchor) {
  10501. insert(target, div, anchor);
  10502. div.innerHTML = raw_value;
  10503. },
  10504. p(changed, ctx) {
  10505. if ((changed.description) && raw_value !== (raw_value = markdown(ctx.description) + "")) {
  10506. div.innerHTML = raw_value;
  10507. }
  10508. },
  10509. d(detaching) {
  10510. if (detaching) {
  10511. detach(div);
  10512. }
  10513. }
  10514. };
  10515. }
  10516. // (26:0) {#if showRequest}
  10517. function create_if_block$5(ctx) {
  10518. var hr;
  10519. return {
  10520. c() {
  10521. hr = element("hr");
  10522. },
  10523. m(target, anchor) {
  10524. insert(target, hr, anchor);
  10525. },
  10526. d(detaching) {
  10527. if (detaching) {
  10528. detach(hr);
  10529. }
  10530. }
  10531. };
  10532. }
  10533. function create_fragment$5(ctx) {
  10534. var t0, t1, t2, if_block1_anchor, current;
  10535. var if_block0 = (ctx.description) && create_if_block_1$2(ctx);
  10536. var headertable = new HeaderTable({ props: { headers: ctx.headers } });
  10537. var codepanel = new CodePanel({
  10538. props: {
  10539. contentType: ctx.contentType,
  10540. example: ctx.example,
  10541. schema: ctx.schema,
  10542. asToggle: true
  10543. }
  10544. });
  10545. var if_block1 = (ctx.showRequest) && create_if_block$5(ctx);
  10546. return {
  10547. c() {
  10548. if (if_block0) if_block0.c();
  10549. t0 = space();
  10550. headertable.$$.fragment.c();
  10551. t1 = space();
  10552. codepanel.$$.fragment.c();
  10553. t2 = space();
  10554. if (if_block1) if_block1.c();
  10555. if_block1_anchor = empty();
  10556. },
  10557. m(target, anchor) {
  10558. if (if_block0) if_block0.m(target, anchor);
  10559. insert(target, t0, anchor);
  10560. mount_component(headertable, target, anchor);
  10561. insert(target, t1, anchor);
  10562. mount_component(codepanel, target, anchor);
  10563. insert(target, t2, anchor);
  10564. if (if_block1) if_block1.m(target, anchor);
  10565. insert(target, if_block1_anchor, anchor);
  10566. current = true;
  10567. },
  10568. p(changed, ctx) {
  10569. if (ctx.description) {
  10570. if (if_block0) {
  10571. if_block0.p(changed, ctx);
  10572. } else {
  10573. if_block0 = create_if_block_1$2(ctx);
  10574. if_block0.c();
  10575. if_block0.m(t0.parentNode, t0);
  10576. }
  10577. } else if (if_block0) {
  10578. if_block0.d(1);
  10579. if_block0 = null;
  10580. }
  10581. var headertable_changes = {};
  10582. if (changed.headers) headertable_changes.headers = ctx.headers;
  10583. headertable.$set(headertable_changes);
  10584. var codepanel_changes = {};
  10585. if (changed.contentType) codepanel_changes.contentType = ctx.contentType;
  10586. if (changed.example) codepanel_changes.example = ctx.example;
  10587. if (changed.schema) codepanel_changes.schema = ctx.schema;
  10588. codepanel.$set(codepanel_changes);
  10589. if (ctx.showRequest) {
  10590. if (!if_block1) {
  10591. if_block1 = create_if_block$5(ctx);
  10592. if_block1.c();
  10593. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  10594. }
  10595. } else if (if_block1) {
  10596. if_block1.d(1);
  10597. if_block1 = null;
  10598. }
  10599. },
  10600. i(local) {
  10601. if (current) return;
  10602. transition_in(headertable.$$.fragment, local);
  10603. transition_in(codepanel.$$.fragment, local);
  10604. current = true;
  10605. },
  10606. o(local) {
  10607. transition_out(headertable.$$.fragment, local);
  10608. transition_out(codepanel.$$.fragment, local);
  10609. current = false;
  10610. },
  10611. d(detaching) {
  10612. if (if_block0) if_block0.d(detaching);
  10613. if (detaching) {
  10614. detach(t0);
  10615. }
  10616. destroy_component(headertable, detaching);
  10617. if (detaching) {
  10618. detach(t1);
  10619. }
  10620. destroy_component(codepanel, detaching);
  10621. if (detaching) {
  10622. detach(t2);
  10623. }
  10624. if (if_block1) if_block1.d(detaching);
  10625. if (detaching) {
  10626. detach(if_block1_anchor);
  10627. }
  10628. }
  10629. };
  10630. }
  10631. function instance$5($$self, $$props, $$invalidate) {
  10632. let { description, headers, contentType, example, schema } = $$props;
  10633. $$self.$set = $$props => {
  10634. if ('description' in $$props) $$invalidate('description', description = $$props.description);
  10635. if ('headers' in $$props) $$invalidate('headers', headers = $$props.headers);
  10636. if ('contentType' in $$props) $$invalidate('contentType', contentType = $$props.contentType);
  10637. if ('example' in $$props) $$invalidate('example', example = $$props.example);
  10638. if ('schema' in $$props) $$invalidate('schema', schema = $$props.schema);
  10639. };
  10640. let showRequest;
  10641. $$self.$$.update = ($$dirty = { description: 1, headers: 1, example: 1 }) => {
  10642. if ($$dirty.description || $$dirty.headers || $$dirty.example) { $$invalidate('showRequest', showRequest = !!(description || headers.length !== 0 || example)); }
  10643. };
  10644. return {
  10645. description,
  10646. headers,
  10647. contentType,
  10648. example,
  10649. schema,
  10650. showRequest
  10651. };
  10652. }
  10653. class RequestPanel extends SvelteComponent {
  10654. constructor(options) {
  10655. super();
  10656. init(this, options, instance$5, create_fragment$5, safe_not_equal, ["description", "headers", "contentType", "example", "schema"]);
  10657. }
  10658. }
  10659. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ResponsePanel.svelte generated by Svelte v3.12.1 */
  10660. // (20:6) {#if title}
  10661. function create_if_block_1$3(ctx) {
  10662. var t;
  10663. return {
  10664. c() {
  10665. t = text(ctx.title);
  10666. },
  10667. m(target, anchor) {
  10668. insert(target, t, anchor);
  10669. },
  10670. p(changed, ctx) {
  10671. if (changed.title) {
  10672. set_data(t, ctx.title);
  10673. }
  10674. },
  10675. d(detaching) {
  10676. if (detaching) {
  10677. detach(t);
  10678. }
  10679. }
  10680. };
  10681. }
  10682. // (29:4) {#if description}
  10683. function create_if_block$6(ctx) {
  10684. var div, raw_value = markdown(ctx.description) + "";
  10685. return {
  10686. c() {
  10687. div = element("div");
  10688. attr(div, "class", "content");
  10689. },
  10690. m(target, anchor) {
  10691. insert(target, div, anchor);
  10692. div.innerHTML = raw_value;
  10693. },
  10694. p(changed, ctx) {
  10695. if ((changed.description) && raw_value !== (raw_value = markdown(ctx.description) + "")) {
  10696. div.innerHTML = raw_value;
  10697. }
  10698. },
  10699. d(detaching) {
  10700. if (detaching) {
  10701. detach(div);
  10702. }
  10703. }
  10704. };
  10705. }
  10706. function create_fragment$6(ctx) {
  10707. var div1, header, p, t0, t1, a, span, t2_value = ctx.contentType || '' + "", t2, t3, code, t4, code_class_value, t5, div0, t6, t7, current;
  10708. var if_block0 = (ctx.title) && create_if_block_1$3(ctx);
  10709. var if_block1 = (ctx.description) && create_if_block$6(ctx);
  10710. var headertable = new HeaderTable({ props: { headers: ctx.headers } });
  10711. var codepanel = new CodePanel({
  10712. props: {
  10713. contentType: ctx.contentType,
  10714. example: ctx.example,
  10715. schema: ctx.schema
  10716. }
  10717. });
  10718. return {
  10719. c() {
  10720. div1 = element("div");
  10721. header = element("header");
  10722. p = element("p");
  10723. t0 = text("Response\n ");
  10724. if (if_block0) if_block0.c();
  10725. t1 = space();
  10726. a = element("a");
  10727. span = element("span");
  10728. t2 = text(t2_value);
  10729. t3 = space();
  10730. code = element("code");
  10731. t4 = text(ctx.statusCode);
  10732. t5 = space();
  10733. div0 = element("div");
  10734. if (if_block1) if_block1.c();
  10735. t6 = space();
  10736. headertable.$$.fragment.c();
  10737. t7 = space();
  10738. codepanel.$$.fragment.c();
  10739. attr(p, "class", "card-header-title");
  10740. attr(span, "class", "tag is-medium is-white");
  10741. attr(code, "class", code_class_value = "tag is-medium " + colorize(ctx.statusCode));
  10742. attr(a, "href", "javascript:void(0)");
  10743. attr(a, "class", "card-header-icon is-family-code");
  10744. attr(header, "class", "card-header");
  10745. attr(div0, "class", "card-content");
  10746. attr(div1, "class", "card");
  10747. },
  10748. m(target, anchor) {
  10749. insert(target, div1, anchor);
  10750. append(div1, header);
  10751. append(header, p);
  10752. append(p, t0);
  10753. if (if_block0) if_block0.m(p, null);
  10754. append(header, t1);
  10755. append(header, a);
  10756. append(a, span);
  10757. append(span, t2);
  10758. append(a, t3);
  10759. append(a, code);
  10760. append(code, t4);
  10761. append(div1, t5);
  10762. append(div1, div0);
  10763. if (if_block1) if_block1.m(div0, null);
  10764. append(div0, t6);
  10765. mount_component(headertable, div0, null);
  10766. append(div0, t7);
  10767. mount_component(codepanel, div0, null);
  10768. current = true;
  10769. },
  10770. p(changed, ctx) {
  10771. if (ctx.title) {
  10772. if (if_block0) {
  10773. if_block0.p(changed, ctx);
  10774. } else {
  10775. if_block0 = create_if_block_1$3(ctx);
  10776. if_block0.c();
  10777. if_block0.m(p, null);
  10778. }
  10779. } else if (if_block0) {
  10780. if_block0.d(1);
  10781. if_block0 = null;
  10782. }
  10783. if ((!current || changed.contentType) && t2_value !== (t2_value = ctx.contentType || '' + "")) {
  10784. set_data(t2, t2_value);
  10785. }
  10786. if (!current || changed.statusCode) {
  10787. set_data(t4, ctx.statusCode);
  10788. }
  10789. if ((!current || changed.statusCode) && code_class_value !== (code_class_value = "tag is-medium " + colorize(ctx.statusCode))) {
  10790. attr(code, "class", code_class_value);
  10791. }
  10792. if (ctx.description) {
  10793. if (if_block1) {
  10794. if_block1.p(changed, ctx);
  10795. } else {
  10796. if_block1 = create_if_block$6(ctx);
  10797. if_block1.c();
  10798. if_block1.m(div0, t6);
  10799. }
  10800. } else if (if_block1) {
  10801. if_block1.d(1);
  10802. if_block1 = null;
  10803. }
  10804. var headertable_changes = {};
  10805. if (changed.headers) headertable_changes.headers = ctx.headers;
  10806. headertable.$set(headertable_changes);
  10807. var codepanel_changes = {};
  10808. if (changed.contentType) codepanel_changes.contentType = ctx.contentType;
  10809. if (changed.example) codepanel_changes.example = ctx.example;
  10810. if (changed.schema) codepanel_changes.schema = ctx.schema;
  10811. codepanel.$set(codepanel_changes);
  10812. },
  10813. i(local) {
  10814. if (current) return;
  10815. transition_in(headertable.$$.fragment, local);
  10816. transition_in(codepanel.$$.fragment, local);
  10817. current = true;
  10818. },
  10819. o(local) {
  10820. transition_out(headertable.$$.fragment, local);
  10821. transition_out(codepanel.$$.fragment, local);
  10822. current = false;
  10823. },
  10824. d(detaching) {
  10825. if (detaching) {
  10826. detach(div1);
  10827. }
  10828. if (if_block0) if_block0.d();
  10829. if (if_block1) if_block1.d();
  10830. destroy_component(headertable);
  10831. destroy_component(codepanel);
  10832. }
  10833. };
  10834. }
  10835. function instance$6($$self, $$props, $$invalidate) {
  10836. let { title, description, headers, statusCode, contentType, example, schema } = $$props;
  10837. $$self.$set = $$props => {
  10838. if ('title' in $$props) $$invalidate('title', title = $$props.title);
  10839. if ('description' in $$props) $$invalidate('description', description = $$props.description);
  10840. if ('headers' in $$props) $$invalidate('headers', headers = $$props.headers);
  10841. if ('statusCode' in $$props) $$invalidate('statusCode', statusCode = $$props.statusCode);
  10842. if ('contentType' in $$props) $$invalidate('contentType', contentType = $$props.contentType);
  10843. if ('example' in $$props) $$invalidate('example', example = $$props.example);
  10844. if ('schema' in $$props) $$invalidate('schema', schema = $$props.schema);
  10845. };
  10846. return {
  10847. title,
  10848. description,
  10849. headers,
  10850. statusCode,
  10851. contentType,
  10852. example,
  10853. schema
  10854. };
  10855. }
  10856. class ResponsePanel extends SvelteComponent {
  10857. constructor(options) {
  10858. super();
  10859. init(this, options, instance$6, create_fragment$6, safe_not_equal, ["title", "description", "headers", "statusCode", "contentType", "example", "schema"]);
  10860. }
  10861. }
  10862. /* usr/local/lib/node_modules/snowboard/templates/winter/tables/ParameterTable.svelte generated by Svelte v3.12.1 */
  10863. function get_each_context$3(ctx, list, i) {
  10864. const child_ctx = Object.create(ctx);
  10865. child_ctx.name = list[i].name;
  10866. child_ctx.example = list[i].example;
  10867. child_ctx.required = list[i].required;
  10868. child_ctx.description = list[i].description;
  10869. child_ctx.schema = list[i].schema;
  10870. return child_ctx;
  10871. }
  10872. // (36:10) {:else}
  10873. function create_else_block(ctx) {
  10874. var div;
  10875. return {
  10876. c() {
  10877. div = element("div");
  10878. div.textContent = "-";
  10879. attr(div, "class", "content");
  10880. },
  10881. m(target, anchor) {
  10882. insert(target, div, anchor);
  10883. },
  10884. p: noop,
  10885. d(detaching) {
  10886. if (detaching) {
  10887. detach(div);
  10888. }
  10889. }
  10890. };
  10891. }
  10892. // (32:10) {#if description}
  10893. function create_if_block_2$1(ctx) {
  10894. var div, raw_value = markdown(ctx.description) + "";
  10895. return {
  10896. c() {
  10897. div = element("div");
  10898. attr(div, "class", "content");
  10899. },
  10900. m(target, anchor) {
  10901. insert(target, div, anchor);
  10902. div.innerHTML = raw_value;
  10903. },
  10904. p(changed, ctx) {
  10905. if ((changed.parameters) && raw_value !== (raw_value = markdown(ctx.description) + "")) {
  10906. div.innerHTML = raw_value;
  10907. }
  10908. },
  10909. d(detaching) {
  10910. if (detaching) {
  10911. detach(div);
  10912. }
  10913. }
  10914. };
  10915. }
  10916. // (40:10) {#if example}
  10917. function create_if_block_1$4(ctx) {
  10918. var div, span, t1, code, t2_value = ctx.example + "", t2;
  10919. return {
  10920. c() {
  10921. div = element("div");
  10922. span = element("span");
  10923. span.textContent = "Example:";
  10924. t1 = space();
  10925. code = element("code");
  10926. t2 = text(t2_value);
  10927. attr(code, "class", "tag");
  10928. },
  10929. m(target, anchor) {
  10930. insert(target, div, anchor);
  10931. append(div, span);
  10932. append(div, t1);
  10933. append(div, code);
  10934. append(code, t2);
  10935. },
  10936. p(changed, ctx) {
  10937. if ((changed.parameters) && t2_value !== (t2_value = ctx.example + "")) {
  10938. set_data(t2, t2_value);
  10939. }
  10940. },
  10941. d(detaching) {
  10942. if (detaching) {
  10943. detach(div);
  10944. }
  10945. }
  10946. };
  10947. }
  10948. // (47:10) {#if schema.enum}
  10949. function create_if_block$7(ctx) {
  10950. var div, span, t1, code, t2_value = ctx.schema.enum + "", t2;
  10951. return {
  10952. c() {
  10953. div = element("div");
  10954. span = element("span");
  10955. span.textContent = "Values:";
  10956. t1 = space();
  10957. code = element("code");
  10958. t2 = text(t2_value);
  10959. },
  10960. m(target, anchor) {
  10961. insert(target, div, anchor);
  10962. append(div, span);
  10963. append(div, t1);
  10964. append(div, code);
  10965. append(code, t2);
  10966. },
  10967. p(changed, ctx) {
  10968. if ((changed.parameters) && t2_value !== (t2_value = ctx.schema.enum + "")) {
  10969. set_data(t2, t2_value);
  10970. }
  10971. },
  10972. d(detaching) {
  10973. if (detaching) {
  10974. detach(div);
  10975. }
  10976. }
  10977. };
  10978. }
  10979. // (15:4) {#each parameters as { name, example, required, description, schema }}
  10980. function create_each_block$3(ctx) {
  10981. var tr, td0, code, t0_value = ctx.name + "", t0, t1, td1, div, span0, t2_value = ctx.schema.type + "", t2, t3, span1, t4_value = ctx.required ? 'required' : 'optional' + "", t4, t5, td2, t6, t7, t8;
  10982. function select_block_type(changed, ctx) {
  10983. if (ctx.description) return create_if_block_2$1;
  10984. return create_else_block;
  10985. }
  10986. var current_block_type = select_block_type(null, ctx);
  10987. var if_block0 = current_block_type(ctx);
  10988. var if_block1 = (ctx.example) && create_if_block_1$4(ctx);
  10989. var if_block2 = (ctx.schema.enum) && create_if_block$7(ctx);
  10990. return {
  10991. c() {
  10992. tr = element("tr");
  10993. td0 = element("td");
  10994. code = element("code");
  10995. t0 = text(t0_value);
  10996. t1 = space();
  10997. td1 = element("td");
  10998. div = element("div");
  10999. span0 = element("span");
  11000. t2 = text(t2_value);
  11001. t3 = space();
  11002. span1 = element("span");
  11003. t4 = text(t4_value);
  11004. t5 = space();
  11005. td2 = element("td");
  11006. if_block0.c();
  11007. t6 = space();
  11008. if (if_block1) if_block1.c();
  11009. t7 = space();
  11010. if (if_block2) if_block2.c();
  11011. t8 = space();
  11012. attr(span0, "class", "tag");
  11013. attr(span1, "class", "tag");
  11014. toggle_class(span1, "is-dark", ctx.required);
  11015. toggle_class(span1, "is-white", !ctx.required);
  11016. attr(div, "class", "tags has-addons");
  11017. },
  11018. m(target, anchor) {
  11019. insert(target, tr, anchor);
  11020. append(tr, td0);
  11021. append(td0, code);
  11022. append(code, t0);
  11023. append(tr, t1);
  11024. append(tr, td1);
  11025. append(td1, div);
  11026. append(div, span0);
  11027. append(span0, t2);
  11028. append(div, t3);
  11029. append(div, span1);
  11030. append(span1, t4);
  11031. append(tr, t5);
  11032. append(tr, td2);
  11033. if_block0.m(td2, null);
  11034. append(td2, t6);
  11035. if (if_block1) if_block1.m(td2, null);
  11036. append(td2, t7);
  11037. if (if_block2) if_block2.m(td2, null);
  11038. append(tr, t8);
  11039. },
  11040. p(changed, ctx) {
  11041. if ((changed.parameters) && t0_value !== (t0_value = ctx.name + "")) {
  11042. set_data(t0, t0_value);
  11043. }
  11044. if ((changed.parameters) && t2_value !== (t2_value = ctx.schema.type + "")) {
  11045. set_data(t2, t2_value);
  11046. }
  11047. if ((changed.parameters) && t4_value !== (t4_value = ctx.required ? 'required' : 'optional' + "")) {
  11048. set_data(t4, t4_value);
  11049. }
  11050. if (changed.parameters) {
  11051. toggle_class(span1, "is-dark", ctx.required);
  11052. toggle_class(span1, "is-white", !ctx.required);
  11053. }
  11054. if (current_block_type === (current_block_type = select_block_type(changed, ctx)) && if_block0) {
  11055. if_block0.p(changed, ctx);
  11056. } else {
  11057. if_block0.d(1);
  11058. if_block0 = current_block_type(ctx);
  11059. if (if_block0) {
  11060. if_block0.c();
  11061. if_block0.m(td2, t6);
  11062. }
  11063. }
  11064. if (ctx.example) {
  11065. if (if_block1) {
  11066. if_block1.p(changed, ctx);
  11067. } else {
  11068. if_block1 = create_if_block_1$4(ctx);
  11069. if_block1.c();
  11070. if_block1.m(td2, t7);
  11071. }
  11072. } else if (if_block1) {
  11073. if_block1.d(1);
  11074. if_block1 = null;
  11075. }
  11076. if (ctx.schema.enum) {
  11077. if (if_block2) {
  11078. if_block2.p(changed, ctx);
  11079. } else {
  11080. if_block2 = create_if_block$7(ctx);
  11081. if_block2.c();
  11082. if_block2.m(td2, null);
  11083. }
  11084. } else if (if_block2) {
  11085. if_block2.d(1);
  11086. if_block2 = null;
  11087. }
  11088. },
  11089. d(detaching) {
  11090. if (detaching) {
  11091. detach(tr);
  11092. }
  11093. if_block0.d();
  11094. if (if_block1) if_block1.d();
  11095. if (if_block2) if_block2.d();
  11096. }
  11097. };
  11098. }
  11099. function create_fragment$7(ctx) {
  11100. var table, thead, tr, th, t0, t1, tbody;
  11101. let each_value = ctx.parameters;
  11102. let each_blocks = [];
  11103. for (let i = 0; i < each_value.length; i += 1) {
  11104. each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
  11105. }
  11106. return {
  11107. c() {
  11108. table = element("table");
  11109. thead = element("thead");
  11110. tr = element("tr");
  11111. th = element("th");
  11112. t0 = text(ctx.title);
  11113. t1 = space();
  11114. tbody = element("tbody");
  11115. for (let i = 0; i < each_blocks.length; i += 1) {
  11116. each_blocks[i].c();
  11117. }
  11118. attr(th, "colspan", "3");
  11119. attr(table, "class", "table table-bordered is-bordered is-fullwidth");
  11120. },
  11121. m(target, anchor) {
  11122. insert(target, table, anchor);
  11123. append(table, thead);
  11124. append(thead, tr);
  11125. append(tr, th);
  11126. append(th, t0);
  11127. append(table, t1);
  11128. append(table, tbody);
  11129. for (let i = 0; i < each_blocks.length; i += 1) {
  11130. each_blocks[i].m(tbody, null);
  11131. }
  11132. },
  11133. p(changed, ctx) {
  11134. if (changed.title) {
  11135. set_data(t0, ctx.title);
  11136. }
  11137. if (changed.parameters || changed.markdown) {
  11138. each_value = ctx.parameters;
  11139. let i;
  11140. for (i = 0; i < each_value.length; i += 1) {
  11141. const child_ctx = get_each_context$3(ctx, each_value, i);
  11142. if (each_blocks[i]) {
  11143. each_blocks[i].p(changed, child_ctx);
  11144. } else {
  11145. each_blocks[i] = create_each_block$3(child_ctx);
  11146. each_blocks[i].c();
  11147. each_blocks[i].m(tbody, null);
  11148. }
  11149. }
  11150. for (; i < each_blocks.length; i += 1) {
  11151. each_blocks[i].d(1);
  11152. }
  11153. each_blocks.length = each_value.length;
  11154. }
  11155. },
  11156. i: noop,
  11157. o: noop,
  11158. d(detaching) {
  11159. if (detaching) {
  11160. detach(table);
  11161. }
  11162. destroy_each(each_blocks, detaching);
  11163. }
  11164. };
  11165. }
  11166. function instance$7($$self, $$props, $$invalidate) {
  11167. let { title, parameters } = $$props;
  11168. $$self.$set = $$props => {
  11169. if ('title' in $$props) $$invalidate('title', title = $$props.title);
  11170. if ('parameters' in $$props) $$invalidate('parameters', parameters = $$props.parameters);
  11171. };
  11172. return { title, parameters };
  11173. }
  11174. class ParameterTable extends SvelteComponent {
  11175. constructor(options) {
  11176. super();
  11177. init(this, options, instance$7, create_fragment$7, safe_not_equal, ["title", "parameters"]);
  11178. }
  11179. }
  11180. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ParameterPanel.svelte generated by Svelte v3.12.1 */
  11181. // (10:0) {#if pathParameters.length > 0}
  11182. function create_if_block_1$5(ctx) {
  11183. var current;
  11184. var parametertable = new ParameterTable({
  11185. props: {
  11186. parameters: ctx.pathParameters,
  11187. title: "Path Parameters"
  11188. }
  11189. });
  11190. return {
  11191. c() {
  11192. parametertable.$$.fragment.c();
  11193. },
  11194. m(target, anchor) {
  11195. mount_component(parametertable, target, anchor);
  11196. current = true;
  11197. },
  11198. p(changed, ctx) {
  11199. var parametertable_changes = {};
  11200. if (changed.pathParameters) parametertable_changes.parameters = ctx.pathParameters;
  11201. parametertable.$set(parametertable_changes);
  11202. },
  11203. i(local) {
  11204. if (current) return;
  11205. transition_in(parametertable.$$.fragment, local);
  11206. current = true;
  11207. },
  11208. o(local) {
  11209. transition_out(parametertable.$$.fragment, local);
  11210. current = false;
  11211. },
  11212. d(detaching) {
  11213. destroy_component(parametertable, detaching);
  11214. }
  11215. };
  11216. }
  11217. // (14:0) {#if queryParameters.length > 0}
  11218. function create_if_block$8(ctx) {
  11219. var current;
  11220. var parametertable = new ParameterTable({
  11221. props: {
  11222. parameters: ctx.queryParameters,
  11223. title: "Query Parameters"
  11224. }
  11225. });
  11226. return {
  11227. c() {
  11228. parametertable.$$.fragment.c();
  11229. },
  11230. m(target, anchor) {
  11231. mount_component(parametertable, target, anchor);
  11232. current = true;
  11233. },
  11234. p(changed, ctx) {
  11235. var parametertable_changes = {};
  11236. if (changed.queryParameters) parametertable_changes.parameters = ctx.queryParameters;
  11237. parametertable.$set(parametertable_changes);
  11238. },
  11239. i(local) {
  11240. if (current) return;
  11241. transition_in(parametertable.$$.fragment, local);
  11242. current = true;
  11243. },
  11244. o(local) {
  11245. transition_out(parametertable.$$.fragment, local);
  11246. current = false;
  11247. },
  11248. d(detaching) {
  11249. destroy_component(parametertable, detaching);
  11250. }
  11251. };
  11252. }
  11253. function create_fragment$8(ctx) {
  11254. var t, if_block1_anchor, current;
  11255. var if_block0 = (ctx.pathParameters.length > 0) && create_if_block_1$5(ctx);
  11256. var if_block1 = (ctx.queryParameters.length > 0) && create_if_block$8(ctx);
  11257. return {
  11258. c() {
  11259. if (if_block0) if_block0.c();
  11260. t = space();
  11261. if (if_block1) if_block1.c();
  11262. if_block1_anchor = empty();
  11263. },
  11264. m(target, anchor) {
  11265. if (if_block0) if_block0.m(target, anchor);
  11266. insert(target, t, anchor);
  11267. if (if_block1) if_block1.m(target, anchor);
  11268. insert(target, if_block1_anchor, anchor);
  11269. current = true;
  11270. },
  11271. p(changed, ctx) {
  11272. if (ctx.pathParameters.length > 0) {
  11273. if (if_block0) {
  11274. if_block0.p(changed, ctx);
  11275. transition_in(if_block0, 1);
  11276. } else {
  11277. if_block0 = create_if_block_1$5(ctx);
  11278. if_block0.c();
  11279. transition_in(if_block0, 1);
  11280. if_block0.m(t.parentNode, t);
  11281. }
  11282. } else if (if_block0) {
  11283. group_outros();
  11284. transition_out(if_block0, 1, 1, () => {
  11285. if_block0 = null;
  11286. });
  11287. check_outros();
  11288. }
  11289. if (ctx.queryParameters.length > 0) {
  11290. if (if_block1) {
  11291. if_block1.p(changed, ctx);
  11292. transition_in(if_block1, 1);
  11293. } else {
  11294. if_block1 = create_if_block$8(ctx);
  11295. if_block1.c();
  11296. transition_in(if_block1, 1);
  11297. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  11298. }
  11299. } else if (if_block1) {
  11300. group_outros();
  11301. transition_out(if_block1, 1, 1, () => {
  11302. if_block1 = null;
  11303. });
  11304. check_outros();
  11305. }
  11306. },
  11307. i(local) {
  11308. if (current) return;
  11309. transition_in(if_block0);
  11310. transition_in(if_block1);
  11311. current = true;
  11312. },
  11313. o(local) {
  11314. transition_out(if_block0);
  11315. transition_out(if_block1);
  11316. current = false;
  11317. },
  11318. d(detaching) {
  11319. if (if_block0) if_block0.d(detaching);
  11320. if (detaching) {
  11321. detach(t);
  11322. }
  11323. if (if_block1) if_block1.d(detaching);
  11324. if (detaching) {
  11325. detach(if_block1_anchor);
  11326. }
  11327. }
  11328. };
  11329. }
  11330. function instance$8($$self, $$props, $$invalidate) {
  11331. let { parameters = [] } = $$props;
  11332. $$self.$set = $$props => {
  11333. if ('parameters' in $$props) $$invalidate('parameters', parameters = $$props.parameters);
  11334. };
  11335. let pathParameters, queryParameters;
  11336. $$self.$$.update = ($$dirty = { parameters: 1 }) => {
  11337. if ($$dirty.parameters) { $$invalidate('pathParameters', pathParameters = parameters.filter(param => param.location === "path")); }
  11338. if ($$dirty.parameters) { $$invalidate('queryParameters', queryParameters = parameters.filter(param => param.location === "query")); }
  11339. };
  11340. return {
  11341. parameters,
  11342. pathParameters,
  11343. queryParameters
  11344. };
  11345. }
  11346. class ParameterPanel extends SvelteComponent {
  11347. constructor(options) {
  11348. super();
  11349. init(this, options, instance$8, create_fragment$8, safe_not_equal, ["parameters"]);
  11350. }
  11351. }
  11352. /* usr/local/lib/node_modules/snowboard/templates/winter/components/LoginButton.svelte generated by Svelte v3.12.1 */
  11353. function create_fragment$9(ctx) {
  11354. var a, span0, t, span1;
  11355. return {
  11356. c() {
  11357. a = element("a");
  11358. span0 = element("span");
  11359. span0.innerHTML = `<i class="fas fa-sign-in-alt" aria-hidden="true"></i>`;
  11360. t = space();
  11361. span1 = element("span");
  11362. span1.textContent = "Login";
  11363. attr(span0, "class", "icon");
  11364. attr(a, "href", ctx.authorizeUrl);
  11365. attr(a, "class", "button is-dark is-rounded");
  11366. toggle_class(a, "is-fullwidth", ctx.fullWidth);
  11367. },
  11368. m(target, anchor) {
  11369. insert(target, a, anchor);
  11370. append(a, span0);
  11371. append(a, t);
  11372. append(a, span1);
  11373. },
  11374. p(changed, ctx) {
  11375. if (changed.authorizeUrl) {
  11376. attr(a, "href", ctx.authorizeUrl);
  11377. }
  11378. if (changed.fullWidth) {
  11379. toggle_class(a, "is-fullwidth", ctx.fullWidth);
  11380. }
  11381. },
  11382. i: noop,
  11383. o: noop,
  11384. d(detaching) {
  11385. if (detaching) {
  11386. detach(a);
  11387. }
  11388. }
  11389. };
  11390. }
  11391. function instance$9($$self, $$props, $$invalidate) {
  11392. let { authOptions, fullWidth } = $$props;
  11393. $$self.$set = $$props => {
  11394. if ('authOptions' in $$props) $$invalidate('authOptions', authOptions = $$props.authOptions);
  11395. if ('fullWidth' in $$props) $$invalidate('fullWidth', fullWidth = $$props.fullWidth);
  11396. };
  11397. let authorizeParams, authorizeUrl;
  11398. $$self.$$.update = ($$dirty = { authOptions: 1, authorizeParams: 1 }) => {
  11399. if ($$dirty.authOptions) { $$invalidate('authorizeParams', authorizeParams = querystringify_1.stringify(
  11400. {
  11401. client_id: authOptions.clientId,
  11402. redirect_uri: authOptions.callbackUrl,
  11403. response_type: "code",
  11404. scope: authOptions.scopes || ""
  11405. },
  11406. true
  11407. )); }
  11408. if ($$dirty.authOptions || $$dirty.authorizeParams) { $$invalidate('authorizeUrl', authorizeUrl = `${authOptions.authorizeUrl}${authorizeParams}`); }
  11409. };
  11410. return { authOptions, fullWidth, authorizeUrl };
  11411. }
  11412. class LoginButton extends SvelteComponent {
  11413. constructor(options) {
  11414. super();
  11415. init(this, options, instance$9, create_fragment$9, safe_not_equal, ["authOptions", "fullWidth"]);
  11416. }
  11417. }
  11418. /* usr/local/lib/node_modules/snowboard/templates/winter/components/LogoutButton.svelte generated by Svelte v3.12.1 */
  11419. function create_fragment$a(ctx) {
  11420. var a, dispose;
  11421. return {
  11422. c() {
  11423. a = element("a");
  11424. a.innerHTML = `<span class="icon has-text-grey"><i class="fas fa-sign-out-alt" aria-hidden="true"></i></span> <span>Logout</span>`;
  11425. attr(a, "href", "javascript:void(0)");
  11426. attr(a, "class", "button is-light");
  11427. dispose = listen(a, "click", ctx.handleClick);
  11428. },
  11429. m(target, anchor) {
  11430. insert(target, a, anchor);
  11431. },
  11432. p: noop,
  11433. i: noop,
  11434. o: noop,
  11435. d(detaching) {
  11436. if (detaching) {
  11437. detach(a);
  11438. }
  11439. dispose();
  11440. }
  11441. };
  11442. }
  11443. function instance$a($$self, $$props, $$invalidate) {
  11444. let $env;
  11445. component_subscribe($$self, env, $$value => { $env = $$value; $$invalidate('$env', $env); });
  11446. function handleClick() {
  11447. auth.remove($env);
  11448. removeToken($env);
  11449. removeRefreshToken($env);
  11450. }
  11451. return { handleClick };
  11452. }
  11453. class LogoutButton extends SvelteComponent {
  11454. constructor(options) {
  11455. super();
  11456. init(this, options, instance$a, create_fragment$a, safe_not_equal, []);
  11457. }
  11458. }
  11459. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/SelectorPanel.svelte generated by Svelte v3.12.1 */
  11460. function add_css$3() {
  11461. var style = element("style");
  11462. style.id = 'svelte-cjzzpf-style';
  11463. style.textContent = ".icon-info.svelte-cjzzpf{cursor:pointer}.content.svelte-cjzzpf{padding:1rem 1.5rem}";
  11464. append(document.head, style);
  11465. }
  11466. function get_each_context$4(ctx, list, i) {
  11467. const child_ctx = Object.create(ctx);
  11468. child_ctx.envName = list[i];
  11469. return child_ctx;
  11470. }
  11471. // (44:0) {#if isAuth(environment, 'oauth2')}
  11472. function create_if_block_1$6(ctx) {
  11473. var show_if, current_block_type_index, if_block, if_block_anchor, current;
  11474. var if_block_creators = [
  11475. create_if_block_2$2,
  11476. create_if_block_3,
  11477. create_else_block_1
  11478. ];
  11479. var if_blocks = [];
  11480. function select_block_type(changed, ctx) {
  11481. if (ctx.authenticating) return 0;
  11482. if ((show_if == null) || changed.$auth || changed.$env) show_if = !!(ctx.$auth.includes(ctx.$env));
  11483. if (show_if) return 1;
  11484. return 2;
  11485. }
  11486. current_block_type_index = select_block_type(null, ctx);
  11487. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  11488. return {
  11489. c() {
  11490. if_block.c();
  11491. if_block_anchor = empty();
  11492. },
  11493. m(target, anchor) {
  11494. if_blocks[current_block_type_index].m(target, anchor);
  11495. insert(target, if_block_anchor, anchor);
  11496. current = true;
  11497. },
  11498. p(changed, ctx) {
  11499. var previous_block_index = current_block_type_index;
  11500. current_block_type_index = select_block_type(changed, ctx);
  11501. if (current_block_type_index === previous_block_index) {
  11502. if_blocks[current_block_type_index].p(changed, ctx);
  11503. } else {
  11504. group_outros();
  11505. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  11506. if_blocks[previous_block_index] = null;
  11507. });
  11508. check_outros();
  11509. if_block = if_blocks[current_block_type_index];
  11510. if (!if_block) {
  11511. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  11512. if_block.c();
  11513. }
  11514. transition_in(if_block, 1);
  11515. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  11516. }
  11517. },
  11518. i(local) {
  11519. if (current) return;
  11520. transition_in(if_block);
  11521. current = true;
  11522. },
  11523. o(local) {
  11524. transition_out(if_block);
  11525. current = false;
  11526. },
  11527. d(detaching) {
  11528. if_blocks[current_block_type_index].d(detaching);
  11529. if (detaching) {
  11530. detach(if_block_anchor);
  11531. }
  11532. }
  11533. };
  11534. }
  11535. // (59:2) {:else}
  11536. function create_else_block_1(ctx) {
  11537. var div1, div0, p, current;
  11538. var loginbutton = new LoginButton({ props: { authOptions: ctx.environment.auth.options } });
  11539. return {
  11540. c() {
  11541. div1 = element("div");
  11542. div0 = element("div");
  11543. p = element("p");
  11544. loginbutton.$$.fragment.c();
  11545. attr(p, "class", "control");
  11546. attr(div0, "class", "field is-grouped");
  11547. attr(div1, "class", "navbar-item");
  11548. },
  11549. m(target, anchor) {
  11550. insert(target, div1, anchor);
  11551. append(div1, div0);
  11552. append(div0, p);
  11553. mount_component(loginbutton, p, null);
  11554. current = true;
  11555. },
  11556. p(changed, ctx) {
  11557. var loginbutton_changes = {};
  11558. if (changed.environment) loginbutton_changes.authOptions = ctx.environment.auth.options;
  11559. loginbutton.$set(loginbutton_changes);
  11560. },
  11561. i(local) {
  11562. if (current) return;
  11563. transition_in(loginbutton.$$.fragment, local);
  11564. current = true;
  11565. },
  11566. o(local) {
  11567. transition_out(loginbutton.$$.fragment, local);
  11568. current = false;
  11569. },
  11570. d(detaching) {
  11571. if (detaching) {
  11572. detach(div1);
  11573. }
  11574. destroy_component(loginbutton);
  11575. }
  11576. };
  11577. }
  11578. // (51:33)
  11579. function create_if_block_3(ctx) {
  11580. var div1, div0, p, current;
  11581. var logoutbutton = new LogoutButton({});
  11582. return {
  11583. c() {
  11584. div1 = element("div");
  11585. div0 = element("div");
  11586. p = element("p");
  11587. logoutbutton.$$.fragment.c();
  11588. attr(p, "class", "control");
  11589. attr(div0, "class", "field is-grouped");
  11590. attr(div1, "class", "navbar-item");
  11591. },
  11592. m(target, anchor) {
  11593. insert(target, div1, anchor);
  11594. append(div1, div0);
  11595. append(div0, p);
  11596. mount_component(logoutbutton, p, null);
  11597. current = true;
  11598. },
  11599. p: noop,
  11600. i(local) {
  11601. if (current) return;
  11602. transition_in(logoutbutton.$$.fragment, local);
  11603. current = true;
  11604. },
  11605. o(local) {
  11606. transition_out(logoutbutton.$$.fragment, local);
  11607. current = false;
  11608. },
  11609. d(detaching) {
  11610. if (detaching) {
  11611. detach(div1);
  11612. }
  11613. destroy_component(logoutbutton);
  11614. }
  11615. };
  11616. }
  11617. // (45:2) {#if authenticating}
  11618. function create_if_block_2$2(ctx) {
  11619. var div;
  11620. return {
  11621. c() {
  11622. div = element("div");
  11623. div.innerHTML = `<span class="icon is-medium has-text-danger"><i class="fas fa-2x fa-spinner fa-pulse"></i></span>`;
  11624. attr(div, "class", "navbar-item");
  11625. },
  11626. m(target, anchor) {
  11627. insert(target, div, anchor);
  11628. },
  11629. p: noop,
  11630. i: noop,
  11631. o: noop,
  11632. d(detaching) {
  11633. if (detaching) {
  11634. detach(div);
  11635. }
  11636. }
  11637. };
  11638. }
  11639. // (76:4) {#each Object.keys(environments) as envName}
  11640. function create_each_block$4(ctx) {
  11641. var a, t0_value = ctx.envName + "", t0, t1, a_data_name_value, dispose;
  11642. return {
  11643. c() {
  11644. a = element("a");
  11645. t0 = text(t0_value);
  11646. t1 = space();
  11647. attr(a, "data-name", a_data_name_value = ctx.envName);
  11648. attr(a, "href", "javascript:void(0)");
  11649. attr(a, "class", "navbar-item");
  11650. dispose = listen(a, "click", ctx.handleClick);
  11651. },
  11652. m(target, anchor) {
  11653. insert(target, a, anchor);
  11654. append(a, t0);
  11655. append(a, t1);
  11656. },
  11657. p(changed, ctx) {
  11658. if ((changed.environments) && t0_value !== (t0_value = ctx.envName + "")) {
  11659. set_data(t0, t0_value);
  11660. }
  11661. if ((changed.environments) && a_data_name_value !== (a_data_name_value = ctx.envName)) {
  11662. attr(a, "data-name", a_data_name_value);
  11663. }
  11664. },
  11665. d(detaching) {
  11666. if (detaching) {
  11667. detach(a);
  11668. }
  11669. dispose();
  11670. }
  11671. };
  11672. }
  11673. // (102:8) {:else}
  11674. function create_else_block$1(ctx) {
  11675. var span;
  11676. return {
  11677. c() {
  11678. span = element("span");
  11679. span.textContent = "None";
  11680. attr(span, "class", "is-capitalized");
  11681. },
  11682. m(target, anchor) {
  11683. insert(target, span, anchor);
  11684. },
  11685. p: noop,
  11686. d(detaching) {
  11687. if (detaching) {
  11688. detach(span);
  11689. }
  11690. }
  11691. };
  11692. }
  11693. // (100:8) {#if environment.auth}
  11694. function create_if_block$9(ctx) {
  11695. var span, t_value = ctx.environment.auth.name + "", t;
  11696. return {
  11697. c() {
  11698. span = element("span");
  11699. t = text(t_value);
  11700. attr(span, "class", "is-capitalized");
  11701. },
  11702. m(target, anchor) {
  11703. insert(target, span, anchor);
  11704. append(span, t);
  11705. },
  11706. p(changed, ctx) {
  11707. if ((changed.environment) && t_value !== (t_value = ctx.environment.auth.name + "")) {
  11708. set_data(t, t_value);
  11709. }
  11710. },
  11711. d(detaching) {
  11712. if (detaching) {
  11713. detach(span);
  11714. }
  11715. }
  11716. };
  11717. }
  11718. function create_fragment$b(ctx) {
  11719. var show_if = isAuth(ctx.environment, 'oauth2'), t0, div1, a0, t1, t2, div0, t3, div4, a1, t4, div3, div2, p0, t5, t6_value = ctx.environment.url + "", t6, t7, p1, t8, current, dispose;
  11720. var if_block0 = (show_if) && create_if_block_1$6(ctx);
  11721. let each_value = Object.keys(ctx.environments);
  11722. let each_blocks = [];
  11723. for (let i_1 = 0; i_1 < each_value.length; i_1 += 1) {
  11724. each_blocks[i_1] = create_each_block$4(get_each_context$4(ctx, each_value, i_1));
  11725. }
  11726. function select_block_type_1(changed, ctx) {
  11727. if (ctx.environment.auth) return create_if_block$9;
  11728. return create_else_block$1;
  11729. }
  11730. var current_block_type = select_block_type_1(null, ctx);
  11731. var if_block1 = current_block_type(ctx);
  11732. return {
  11733. c() {
  11734. if (if_block0) if_block0.c();
  11735. t0 = space();
  11736. div1 = element("div");
  11737. a0 = element("a");
  11738. t1 = text(ctx.$env);
  11739. t2 = space();
  11740. div0 = element("div");
  11741. for (let i_1 = 0; i_1 < each_blocks.length; i_1 += 1) {
  11742. each_blocks[i_1].c();
  11743. }
  11744. t3 = space();
  11745. div4 = element("div");
  11746. a1 = element("a");
  11747. a1.innerHTML = `<span class="icon icon-info is-medium has-text-grey-light svelte-cjzzpf"><i class="fas fa-lg fa-info-circle"></i></span>`;
  11748. t4 = space();
  11749. div3 = element("div");
  11750. div2 = element("div");
  11751. p0 = element("p");
  11752. t5 = text("BaseURL: ");
  11753. t6 = text(t6_value);
  11754. t7 = space();
  11755. p1 = element("p");
  11756. t8 = text("Auth:\n ");
  11757. if_block1.c();
  11758. attr(a0, "href", "javascript:void(0)");
  11759. attr(a0, "class", "navbar-link");
  11760. attr(div0, "class", "navbar-dropdown is-right");
  11761. attr(div1, "class", "navbar-item has-dropdown is-capitalized");
  11762. toggle_class(div1, "is-active", ctx.show);
  11763. attr(a1, "href", "javascript:void(0)");
  11764. attr(a1, "class", "navbar-link is-arrowless");
  11765. attr(div2, "class", "content svelte-cjzzpf");
  11766. attr(div3, "class", "navbar-dropdown is-right");
  11767. attr(div4, "class", "navbar-item has-dropdown is-hoverable");
  11768. dispose = listen(a0, "click", ctx.toggleClick);
  11769. },
  11770. m(target, anchor) {
  11771. if (if_block0) if_block0.m(target, anchor);
  11772. insert(target, t0, anchor);
  11773. insert(target, div1, anchor);
  11774. append(div1, a0);
  11775. append(a0, t1);
  11776. append(div1, t2);
  11777. append(div1, div0);
  11778. for (let i_1 = 0; i_1 < each_blocks.length; i_1 += 1) {
  11779. each_blocks[i_1].m(div0, null);
  11780. }
  11781. insert(target, t3, anchor);
  11782. insert(target, div4, anchor);
  11783. append(div4, a1);
  11784. append(div4, t4);
  11785. append(div4, div3);
  11786. append(div3, div2);
  11787. append(div2, p0);
  11788. append(p0, t5);
  11789. append(p0, t6);
  11790. append(div2, t7);
  11791. append(div2, p1);
  11792. append(p1, t8);
  11793. if_block1.m(p1, null);
  11794. current = true;
  11795. },
  11796. p(changed, ctx) {
  11797. if (changed.environment) show_if = isAuth(ctx.environment, 'oauth2');
  11798. if (show_if) {
  11799. if (if_block0) {
  11800. if_block0.p(changed, ctx);
  11801. transition_in(if_block0, 1);
  11802. } else {
  11803. if_block0 = create_if_block_1$6(ctx);
  11804. if_block0.c();
  11805. transition_in(if_block0, 1);
  11806. if_block0.m(t0.parentNode, t0);
  11807. }
  11808. } else if (if_block0) {
  11809. group_outros();
  11810. transition_out(if_block0, 1, 1, () => {
  11811. if_block0 = null;
  11812. });
  11813. check_outros();
  11814. }
  11815. if (!current || changed.$env) {
  11816. set_data(t1, ctx.$env);
  11817. }
  11818. if (changed.environments) {
  11819. each_value = Object.keys(ctx.environments);
  11820. let i_1;
  11821. for (i_1 = 0; i_1 < each_value.length; i_1 += 1) {
  11822. const child_ctx = get_each_context$4(ctx, each_value, i_1);
  11823. if (each_blocks[i_1]) {
  11824. each_blocks[i_1].p(changed, child_ctx);
  11825. } else {
  11826. each_blocks[i_1] = create_each_block$4(child_ctx);
  11827. each_blocks[i_1].c();
  11828. each_blocks[i_1].m(div0, null);
  11829. }
  11830. }
  11831. for (; i_1 < each_blocks.length; i_1 += 1) {
  11832. each_blocks[i_1].d(1);
  11833. }
  11834. each_blocks.length = each_value.length;
  11835. }
  11836. if (changed.show) {
  11837. toggle_class(div1, "is-active", ctx.show);
  11838. }
  11839. if ((!current || changed.environment) && t6_value !== (t6_value = ctx.environment.url + "")) {
  11840. set_data(t6, t6_value);
  11841. }
  11842. if (current_block_type === (current_block_type = select_block_type_1(changed, ctx)) && if_block1) {
  11843. if_block1.p(changed, ctx);
  11844. } else {
  11845. if_block1.d(1);
  11846. if_block1 = current_block_type(ctx);
  11847. if (if_block1) {
  11848. if_block1.c();
  11849. if_block1.m(p1, null);
  11850. }
  11851. }
  11852. },
  11853. i(local) {
  11854. if (current) return;
  11855. transition_in(if_block0);
  11856. current = true;
  11857. },
  11858. o(local) {
  11859. transition_out(if_block0);
  11860. current = false;
  11861. },
  11862. d(detaching) {
  11863. if (if_block0) if_block0.d(detaching);
  11864. if (detaching) {
  11865. detach(t0);
  11866. detach(div1);
  11867. }
  11868. destroy_each(each_blocks, detaching);
  11869. if (detaching) {
  11870. detach(t3);
  11871. detach(div4);
  11872. }
  11873. if_block1.d();
  11874. dispose();
  11875. }
  11876. };
  11877. }
  11878. function instance$b($$self, $$props, $$invalidate) {
  11879. let $env, $auth;
  11880. component_subscribe($$self, env, $$value => { $env = $$value; $$invalidate('$env', $env); });
  11881. component_subscribe($$self, auth, $$value => { $auth = $$value; $$invalidate('$auth', $auth); });
  11882. let { environments, authenticating } = $$props;
  11883. let show = false;
  11884. function handleClick(event) {
  11885. $$invalidate('show', show = false);
  11886. const envName = event.target.dataset["name"];
  11887. env.set(envName);
  11888. const authToken = getToken($env);
  11889. if (authToken) {
  11890. auth.add(envName);
  11891. token.set(authToken);
  11892. }
  11893. }
  11894. function toggleClick() {
  11895. $$invalidate('show', show = !show);
  11896. }
  11897. $$self.$set = $$props => {
  11898. if ('environments' in $$props) $$invalidate('environments', environments = $$props.environments);
  11899. if ('authenticating' in $$props) $$invalidate('authenticating', authenticating = $$props.authenticating);
  11900. };
  11901. let environment;
  11902. $$self.$$.update = ($$dirty = { environments: 1, $env: 1 }) => {
  11903. if ($$dirty.environments || $$dirty.$env) { $$invalidate('environment', environment = environments[$env]); }
  11904. };
  11905. return {
  11906. environments,
  11907. authenticating,
  11908. show,
  11909. handleClick,
  11910. toggleClick,
  11911. environment,
  11912. $env,
  11913. $auth
  11914. };
  11915. }
  11916. class SelectorPanel extends SvelteComponent {
  11917. constructor(options) {
  11918. super();
  11919. if (!document.getElementById("svelte-cjzzpf-style")) add_css$3();
  11920. init(this, options, instance$b, create_fragment$b, safe_not_equal, ["environments", "authenticating"]);
  11921. }
  11922. }
  11923. /* usr/local/lib/node_modules/snowboard/templates/winter/components/ToggleIcon.svelte generated by Svelte v3.12.1 */
  11924. function add_css$4() {
  11925. var style = element("style");
  11926. style.id = 'svelte-o7a14x-style';
  11927. style.textContent = ".toggle-icon.svelte-o7a14x{cursor:pointer}";
  11928. append(document.head, style);
  11929. }
  11930. function create_fragment$c(ctx) {
  11931. var span, i, span_class_value, dispose;
  11932. return {
  11933. c() {
  11934. span = element("span");
  11935. i = element("i");
  11936. attr(i, "class", "fas");
  11937. toggle_class(i, "fa-chevron-up", !ctx.show);
  11938. toggle_class(i, "fa-chevron-down", ctx.show);
  11939. attr(span, "class", span_class_value = "toggle-icon icon " + ctx.additionalClass + " svelte-o7a14x");
  11940. toggle_class(span, "has-text-grey", !ctx.dark);
  11941. dispose = listen(span, "click", ctx.toggle);
  11942. },
  11943. m(target, anchor) {
  11944. insert(target, span, anchor);
  11945. append(span, i);
  11946. },
  11947. p(changed, ctx) {
  11948. if (changed.show) {
  11949. toggle_class(i, "fa-chevron-up", !ctx.show);
  11950. toggle_class(i, "fa-chevron-down", ctx.show);
  11951. }
  11952. if ((changed.additionalClass) && span_class_value !== (span_class_value = "toggle-icon icon " + ctx.additionalClass + " svelte-o7a14x")) {
  11953. attr(span, "class", span_class_value);
  11954. }
  11955. if ((changed.additionalClass || changed.dark)) {
  11956. toggle_class(span, "has-text-grey", !ctx.dark);
  11957. }
  11958. },
  11959. i: noop,
  11960. o: noop,
  11961. d(detaching) {
  11962. if (detaching) {
  11963. detach(span);
  11964. }
  11965. dispose();
  11966. }
  11967. };
  11968. }
  11969. function instance$c($$self, $$props, $$invalidate) {
  11970. let { dark = false, show = false, additionalClass = "", handleClick } = $$props;
  11971. function toggle(event) {
  11972. $$invalidate('show', show = !show);
  11973. handleClick(event);
  11974. }
  11975. $$self.$set = $$props => {
  11976. if ('dark' in $$props) $$invalidate('dark', dark = $$props.dark);
  11977. if ('show' in $$props) $$invalidate('show', show = $$props.show);
  11978. if ('additionalClass' in $$props) $$invalidate('additionalClass', additionalClass = $$props.additionalClass);
  11979. if ('handleClick' in $$props) $$invalidate('handleClick', handleClick = $$props.handleClick);
  11980. };
  11981. return {
  11982. dark,
  11983. show,
  11984. additionalClass,
  11985. handleClick,
  11986. toggle
  11987. };
  11988. }
  11989. class ToggleIcon extends SvelteComponent {
  11990. constructor(options) {
  11991. super();
  11992. if (!document.getElementById("svelte-o7a14x-style")) add_css$4();
  11993. init(this, options, instance$c, create_fragment$c, safe_not_equal, ["dark", "show", "additionalClass", "handleClick"]);
  11994. }
  11995. }
  11996. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/CollapsiblePanel.svelte generated by Svelte v3.12.1 */
  11997. function add_css$5() {
  11998. var style = element("style");
  11999. style.id = 'svelte-ymjevm-style';
  12000. style.textContent = ".panel-section.svelte-ymjevm{padding:1em;border:1px solid #dbdbdb;border-top:none}.panel-button.svelte-ymjevm{border-radius:4px}.panel-dark.svelte-ymjevm{border:1px solid #363636}";
  12001. append(document.head, style);
  12002. }
  12003. const get_body_slot_changes = () => ({});
  12004. const get_body_slot_context = () => ({});
  12005. const get_heading_slot_changes = () => ({});
  12006. const get_heading_slot_context = () => ({});
  12007. function create_fragment$d(ctx) {
  12008. var div2, div0, t0, t1, div1, current;
  12009. const heading_slot_template = ctx.$$slots.heading;
  12010. const heading_slot = create_slot(heading_slot_template, ctx, get_heading_slot_context);
  12011. var toggleicon = new ToggleIcon({
  12012. props: {
  12013. dark: ctx.dark,
  12014. show: ctx.show,
  12015. additionalClass: "is-pulled-right",
  12016. handleClick: ctx.func
  12017. }
  12018. });
  12019. const body_slot_template = ctx.$$slots.body;
  12020. const body_slot = create_slot(body_slot_template, ctx, get_body_slot_context);
  12021. return {
  12022. c() {
  12023. div2 = element("div");
  12024. div0 = element("div");
  12025. if (heading_slot) heading_slot.c();
  12026. t0 = space();
  12027. toggleicon.$$.fragment.c();
  12028. t1 = space();
  12029. div1 = element("div");
  12030. if (body_slot) body_slot.c();
  12031. attr(div0, "class", "panel-heading svelte-ymjevm");
  12032. toggle_class(div0, "has-background-dark", ctx.dark);
  12033. toggle_class(div0, "has-text-white", ctx.dark);
  12034. toggle_class(div0, "panel-dark", ctx.dark);
  12035. toggle_class(div0, "panel-button", !ctx.show);
  12036. attr(div1, "class", "panel-section has-background-white svelte-ymjevm");
  12037. toggle_class(div1, "is-hidden", !ctx.show);
  12038. attr(div2, "class", "panel");
  12039. },
  12040. l(nodes) {
  12041. if (heading_slot) heading_slot.l(div0_nodes);
  12042. if (body_slot) body_slot.l(div1_nodes);
  12043. },
  12044. m(target, anchor) {
  12045. insert(target, div2, anchor);
  12046. append(div2, div0);
  12047. if (heading_slot) {
  12048. heading_slot.m(div0, null);
  12049. }
  12050. append(div0, t0);
  12051. mount_component(toggleicon, div0, null);
  12052. append(div2, t1);
  12053. append(div2, div1);
  12054. if (body_slot) {
  12055. body_slot.m(div1, null);
  12056. }
  12057. current = true;
  12058. },
  12059. p(changed, ctx) {
  12060. if (heading_slot && heading_slot.p && changed.$$scope) {
  12061. heading_slot.p(
  12062. get_slot_changes(heading_slot_template, ctx, changed, get_heading_slot_changes),
  12063. get_slot_context(heading_slot_template, ctx, get_heading_slot_context)
  12064. );
  12065. }
  12066. var toggleicon_changes = {};
  12067. if (changed.dark) toggleicon_changes.dark = ctx.dark;
  12068. if (changed.show) toggleicon_changes.show = ctx.show;
  12069. if (changed.show) toggleicon_changes.handleClick = ctx.func;
  12070. toggleicon.$set(toggleicon_changes);
  12071. if (changed.dark) {
  12072. toggle_class(div0, "has-background-dark", ctx.dark);
  12073. toggle_class(div0, "has-text-white", ctx.dark);
  12074. toggle_class(div0, "panel-dark", ctx.dark);
  12075. }
  12076. if (changed.show) {
  12077. toggle_class(div0, "panel-button", !ctx.show);
  12078. }
  12079. if (body_slot && body_slot.p && changed.$$scope) {
  12080. body_slot.p(
  12081. get_slot_changes(body_slot_template, ctx, changed, get_body_slot_changes),
  12082. get_slot_context(body_slot_template, ctx, get_body_slot_context)
  12083. );
  12084. }
  12085. if (changed.show) {
  12086. toggle_class(div1, "is-hidden", !ctx.show);
  12087. }
  12088. },
  12089. i(local) {
  12090. if (current) return;
  12091. transition_in(heading_slot, local);
  12092. transition_in(toggleicon.$$.fragment, local);
  12093. transition_in(body_slot, local);
  12094. current = true;
  12095. },
  12096. o(local) {
  12097. transition_out(heading_slot, local);
  12098. transition_out(toggleicon.$$.fragment, local);
  12099. transition_out(body_slot, local);
  12100. current = false;
  12101. },
  12102. d(detaching) {
  12103. if (detaching) {
  12104. detach(div2);
  12105. }
  12106. if (heading_slot) heading_slot.d(detaching);
  12107. destroy_component(toggleicon);
  12108. if (body_slot) body_slot.d(detaching);
  12109. }
  12110. };
  12111. }
  12112. function instance$d($$self, $$props, $$invalidate) {
  12113. let { dark = false, show = false } = $$props;
  12114. let { $$slots = {}, $$scope } = $$props;
  12115. const func = () => ($$invalidate('show', show = !show));
  12116. $$self.$set = $$props => {
  12117. if ('dark' in $$props) $$invalidate('dark', dark = $$props.dark);
  12118. if ('show' in $$props) $$invalidate('show', show = $$props.show);
  12119. if ('$$scope' in $$props) $$invalidate('$$scope', $$scope = $$props.$$scope);
  12120. };
  12121. return { dark, show, func, $$slots, $$scope };
  12122. }
  12123. class CollapsiblePanel extends SvelteComponent {
  12124. constructor(options) {
  12125. super();
  12126. if (!document.getElementById("svelte-ymjevm-style")) add_css$5();
  12127. init(this, options, instance$d, create_fragment$d, safe_not_equal, ["dark", "show"]);
  12128. }
  12129. }
  12130. /* usr/local/lib/node_modules/snowboard/templates/winter/components/FieldDisabled.svelte generated by Svelte v3.12.1 */
  12131. function add_css$6() {
  12132. var style = element("style");
  12133. style.id = 'svelte-a7ak6u-style';
  12134. style.textContent = ".control-switch.svelte-a7ak6u{padding-top:0.4rem}.has-border.svelte-a7ak6u{border-color:#dbdbdb}";
  12135. append(document.head, style);
  12136. }
  12137. function create_fragment$e(ctx) {
  12138. var div, p0, input0, input0_id_value, t0, label, label_for_value, t1, p1, input1, t2, p2, input2;
  12139. return {
  12140. c() {
  12141. div = element("div");
  12142. p0 = element("p");
  12143. input0 = element("input");
  12144. t0 = space();
  12145. label = element("label");
  12146. t1 = space();
  12147. p1 = element("p");
  12148. input1 = element("input");
  12149. t2 = space();
  12150. p2 = element("p");
  12151. input2 = element("input");
  12152. attr(input0, "class", "switch is-rounded is-success");
  12153. attr(input0, "id", input0_id_value = "h-" + ctx.name);
  12154. attr(input0, "type", "checkbox");
  12155. input0.checked = true;
  12156. input0.disabled = true;
  12157. attr(label, "for", label_for_value = "h-" + ctx.name);
  12158. attr(p0, "class", "control control-switch svelte-a7ak6u");
  12159. attr(input1, "class", "input is-rounded has-border svelte-a7ak6u");
  12160. attr(input1, "type", "text");
  12161. attr(input1, "placeholder", ctx.placeholder);
  12162. input1.disabled = true;
  12163. attr(p1, "class", "control");
  12164. attr(input2, "class", "input is-rounded has-border is-family-code svelte-a7ak6u");
  12165. attr(input2, "type", "text");
  12166. input2.value = ctx.value;
  12167. input2.disabled = true;
  12168. attr(p2, "class", "control is-expanded");
  12169. attr(div, "class", "field has-addons");
  12170. },
  12171. m(target, anchor) {
  12172. insert(target, div, anchor);
  12173. append(div, p0);
  12174. append(p0, input0);
  12175. append(p0, t0);
  12176. append(p0, label);
  12177. append(div, t1);
  12178. append(div, p1);
  12179. append(p1, input1);
  12180. append(div, t2);
  12181. append(div, p2);
  12182. append(p2, input2);
  12183. },
  12184. p(changed, ctx) {
  12185. if ((changed.name) && input0_id_value !== (input0_id_value = "h-" + ctx.name)) {
  12186. attr(input0, "id", input0_id_value);
  12187. }
  12188. if ((changed.name) && label_for_value !== (label_for_value = "h-" + ctx.name)) {
  12189. attr(label, "for", label_for_value);
  12190. }
  12191. if (changed.placeholder) {
  12192. attr(input1, "placeholder", ctx.placeholder);
  12193. }
  12194. if (changed.value) {
  12195. input2.value = ctx.value;
  12196. }
  12197. },
  12198. i: noop,
  12199. o: noop,
  12200. d(detaching) {
  12201. if (detaching) {
  12202. detach(div);
  12203. }
  12204. }
  12205. };
  12206. }
  12207. function instance$e($$self, $$props, $$invalidate) {
  12208. let { name, placeholder, value } = $$props;
  12209. $$self.$set = $$props => {
  12210. if ('name' in $$props) $$invalidate('name', name = $$props.name);
  12211. if ('placeholder' in $$props) $$invalidate('placeholder', placeholder = $$props.placeholder);
  12212. if ('value' in $$props) $$invalidate('value', value = $$props.value);
  12213. };
  12214. return { name, placeholder, value };
  12215. }
  12216. class FieldDisabled extends SvelteComponent {
  12217. constructor(options) {
  12218. super();
  12219. if (!document.getElementById("svelte-a7ak6u-style")) add_css$6();
  12220. init(this, options, instance$e, create_fragment$e, safe_not_equal, ["name", "placeholder", "value"]);
  12221. }
  12222. }
  12223. /* usr/local/lib/node_modules/snowboard/templates/winter/components/FieldSwitch.svelte generated by Svelte v3.12.1 */
  12224. function add_css$7() {
  12225. var style = element("style");
  12226. style.id = 'svelte-a7ak6u-style';
  12227. style.textContent = ".control-switch.svelte-a7ak6u{padding-top:0.4rem}.has-border.svelte-a7ak6u{border-color:#dbdbdb}";
  12228. append(document.head, style);
  12229. }
  12230. function create_fragment$f(ctx) {
  12231. var div, p0, input0, input0_id_value, t0, label, label_for_value, t1, p1, input1, t2, p2, input2, dispose;
  12232. return {
  12233. c() {
  12234. div = element("div");
  12235. p0 = element("p");
  12236. input0 = element("input");
  12237. t0 = space();
  12238. label = element("label");
  12239. t1 = space();
  12240. p1 = element("p");
  12241. input1 = element("input");
  12242. t2 = space();
  12243. p2 = element("p");
  12244. input2 = element("input");
  12245. attr(input0, "class", "switch is-rounded is-success");
  12246. attr(input0, "id", input0_id_value = "p-" + ctx.name);
  12247. attr(input0, "type", "checkbox");
  12248. input0.disabled = ctx.required;
  12249. attr(label, "for", label_for_value = "p-" + ctx.name);
  12250. attr(p0, "class", "control control-switch svelte-a7ak6u");
  12251. attr(input1, "class", "input is-rounded has-border svelte-a7ak6u");
  12252. attr(input1, "type", "text");
  12253. attr(input1, "placeholder", ctx.name);
  12254. input1.disabled = true;
  12255. attr(p1, "class", "control");
  12256. attr(input2, "class", "input has-border is-family-code svelte-a7ak6u");
  12257. attr(input2, "type", "text");
  12258. toggle_class(input2, "is-rounded", ctx.rounded);
  12259. attr(p2, "class", "control is-expanded");
  12260. attr(div, "class", "field has-addons");
  12261. dispose = [
  12262. listen(input0, "change", ctx.input0_change_handler),
  12263. listen(input2, "input", ctx.input2_input_handler)
  12264. ];
  12265. },
  12266. m(target, anchor) {
  12267. insert(target, div, anchor);
  12268. append(div, p0);
  12269. append(p0, input0);
  12270. input0.checked = ctx.used;
  12271. append(p0, t0);
  12272. append(p0, label);
  12273. append(div, t1);
  12274. append(div, p1);
  12275. append(p1, input1);
  12276. append(div, t2);
  12277. append(div, p2);
  12278. append(p2, input2);
  12279. set_input_value(input2, ctx.value);
  12280. },
  12281. p(changed, ctx) {
  12282. if (changed.used) input0.checked = ctx.used;
  12283. if ((changed.name) && input0_id_value !== (input0_id_value = "p-" + ctx.name)) {
  12284. attr(input0, "id", input0_id_value);
  12285. }
  12286. if (changed.required) {
  12287. input0.disabled = ctx.required;
  12288. }
  12289. if ((changed.name) && label_for_value !== (label_for_value = "p-" + ctx.name)) {
  12290. attr(label, "for", label_for_value);
  12291. }
  12292. if (changed.name) {
  12293. attr(input1, "placeholder", ctx.name);
  12294. }
  12295. if (changed.value && (input2.value !== ctx.value)) set_input_value(input2, ctx.value);
  12296. if (changed.rounded) {
  12297. toggle_class(input2, "is-rounded", ctx.rounded);
  12298. }
  12299. },
  12300. i: noop,
  12301. o: noop,
  12302. d(detaching) {
  12303. if (detaching) {
  12304. detach(div);
  12305. }
  12306. run_all(dispose);
  12307. }
  12308. };
  12309. }
  12310. function instance$f($$self, $$props, $$invalidate) {
  12311. let { used, required, name, value, rounded } = $$props;
  12312. function input0_change_handler() {
  12313. used = this.checked;
  12314. $$invalidate('used', used);
  12315. }
  12316. function input2_input_handler() {
  12317. value = this.value;
  12318. $$invalidate('value', value);
  12319. }
  12320. $$self.$set = $$props => {
  12321. if ('used' in $$props) $$invalidate('used', used = $$props.used);
  12322. if ('required' in $$props) $$invalidate('required', required = $$props.required);
  12323. if ('name' in $$props) $$invalidate('name', name = $$props.name);
  12324. if ('value' in $$props) $$invalidate('value', value = $$props.value);
  12325. if ('rounded' in $$props) $$invalidate('rounded', rounded = $$props.rounded);
  12326. };
  12327. return {
  12328. used,
  12329. required,
  12330. name,
  12331. value,
  12332. rounded,
  12333. input0_change_handler,
  12334. input2_input_handler
  12335. };
  12336. }
  12337. class FieldSwitch extends SvelteComponent {
  12338. constructor(options) {
  12339. super();
  12340. if (!document.getElementById("svelte-a7ak6u-style")) add_css$7();
  12341. init(this, options, instance$f, create_fragment$f, safe_not_equal, ["used", "required", "name", "value", "rounded"]);
  12342. }
  12343. }
  12344. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/PlaygroundPanel.svelte generated by Svelte v3.12.1 */
  12345. function add_css$8() {
  12346. var style = element("style");
  12347. style.id = 'svelte-c3oocm-style';
  12348. style.textContent = ".small-section.svelte-c3oocm{padding-top:0.5rem}.button-left.svelte-c3oocm{justify-content:left}.control-switch.svelte-c3oocm{padding-top:0.4rem}.container-content.svelte-c3oocm{padding:0.5rem 1rem;border-radius:4px;margin-top:0.5rem;background-color:#2b2b2b}.content-header.svelte-c3oocm{color:#fff;border-bottom:dashed 1px #777;padding-top:0.5rem;padding-bottom:1rem}.hero-small.svelte-c3oocm{padding:1.5rem}.has-border.svelte-c3oocm{border-color:#dbdbdb}.hero-rounded.svelte-c3oocm{border-radius:4px}";
  12349. append(document.head, style);
  12350. }
  12351. function get_each_context$5(ctx, list, i) {
  12352. const child_ctx = Object.create(ctx);
  12353. child_ctx.key = list[i][0];
  12354. child_ctx.val = list[i][1];
  12355. return child_ctx;
  12356. }
  12357. function get_each_context_1$1(ctx, list, i) {
  12358. const child_ctx = Object.create(ctx);
  12359. child_ctx.param = list[i];
  12360. child_ctx.each_value_1 = list;
  12361. child_ctx.param_index = i;
  12362. return child_ctx;
  12363. }
  12364. function get_each_context_2$1(ctx, list, i) {
  12365. const child_ctx = Object.create(ctx);
  12366. child_ctx.header = list[i];
  12367. child_ctx.each_value_2 = list;
  12368. child_ctx.header_index = i;
  12369. return child_ctx;
  12370. }
  12371. // (125:2) <span slot="heading">
  12372. function create_heading_slot(ctx) {
  12373. var span;
  12374. return {
  12375. c() {
  12376. span = element("span");
  12377. span.textContent = "Playground";
  12378. attr(span, "slot", "heading");
  12379. },
  12380. m(target, anchor) {
  12381. insert(target, span, anchor);
  12382. },
  12383. d(detaching) {
  12384. if (detaching) {
  12385. detach(span);
  12386. }
  12387. }
  12388. };
  12389. }
  12390. // (134:8) {:else}
  12391. function create_else_block_4(ctx) {
  12392. var a, span0, t0_value = ctx.currentAction.method + "", t0, t1, span1, t2_value = ctx.currentUrl.origin + "", t2, t3, span2, t4_value = ctx.currentUrl.pathname + "", t4, dispose;
  12393. return {
  12394. c() {
  12395. a = element("a");
  12396. span0 = element("span");
  12397. t0 = text(t0_value);
  12398. t1 = text("\n  \n ");
  12399. span1 = element("span");
  12400. t2 = text(t2_value);
  12401. t3 = space();
  12402. span2 = element("span");
  12403. t4 = text(t4_value);
  12404. attr(span0, "class", "is-uppercase has-text-weight-bold");
  12405. attr(span2, "class", "has-text-weight-bold");
  12406. attr(a, "href", "javascript:void(0)");
  12407. attr(a, "class", "button button-left is-warning is-family-code is-fullwidth svelte-c3oocm");
  12408. dispose = listen(a, "click", ctx.handleCopy);
  12409. },
  12410. m(target, anchor) {
  12411. insert(target, a, anchor);
  12412. append(a, span0);
  12413. append(span0, t0);
  12414. append(a, t1);
  12415. append(a, span1);
  12416. append(span1, t2);
  12417. append(a, t3);
  12418. append(a, span2);
  12419. append(span2, t4);
  12420. },
  12421. p(changed, ctx) {
  12422. if ((changed.currentAction) && t0_value !== (t0_value = ctx.currentAction.method + "")) {
  12423. set_data(t0, t0_value);
  12424. }
  12425. if ((changed.currentUrl) && t2_value !== (t2_value = ctx.currentUrl.origin + "")) {
  12426. set_data(t2, t2_value);
  12427. }
  12428. if ((changed.currentUrl) && t4_value !== (t4_value = ctx.currentUrl.pathname + "")) {
  12429. set_data(t4, t4_value);
  12430. }
  12431. },
  12432. d(detaching) {
  12433. if (detaching) {
  12434. detach(a);
  12435. }
  12436. dispose();
  12437. }
  12438. };
  12439. }
  12440. // (129:8) {#if copying}
  12441. function create_if_block_11(ctx) {
  12442. var button;
  12443. return {
  12444. c() {
  12445. button = element("button");
  12446. button.innerHTML = `<span>URL has been copied to clipboard.</span>`;
  12447. attr(button, "class", "button button-left is-warning is-family-code is-fullwidth svelte-c3oocm");
  12448. },
  12449. m(target, anchor) {
  12450. insert(target, button, anchor);
  12451. },
  12452. p: noop,
  12453. d(detaching) {
  12454. if (detaching) {
  12455. detach(button);
  12456. }
  12457. }
  12458. };
  12459. }
  12460. // (153:8) {:else}
  12461. function create_else_block_3(ctx) {
  12462. var button, dispose;
  12463. return {
  12464. c() {
  12465. button = element("button");
  12466. button.innerHTML = `<span class="icon"><i class="fas fa-paper-plane"></i></span> <span>Send</span>`;
  12467. attr(button, "class", "button is-success is-fullwidth");
  12468. dispose = listen(button, "click", ctx.handleClick);
  12469. },
  12470. m(target, anchor) {
  12471. insert(target, button, anchor);
  12472. },
  12473. p: noop,
  12474. i: noop,
  12475. o: noop,
  12476. d(detaching) {
  12477. if (detaching) {
  12478. detach(button);
  12479. }
  12480. dispose();
  12481. }
  12482. };
  12483. }
  12484. // (149:8) {#if isAuth(environment, 'oauth2') && !$auth.includes($env)}
  12485. function create_if_block_10(ctx) {
  12486. var current;
  12487. var loginbutton = new LoginButton({
  12488. props: {
  12489. authOptions: ctx.environment.auth.options,
  12490. fullWidth: true
  12491. }
  12492. });
  12493. return {
  12494. c() {
  12495. loginbutton.$$.fragment.c();
  12496. },
  12497. m(target, anchor) {
  12498. mount_component(loginbutton, target, anchor);
  12499. current = true;
  12500. },
  12501. p(changed, ctx) {
  12502. var loginbutton_changes = {};
  12503. if (changed.environment) loginbutton_changes.authOptions = ctx.environment.auth.options;
  12504. loginbutton.$set(loginbutton_changes);
  12505. },
  12506. i(local) {
  12507. if (current) return;
  12508. transition_in(loginbutton.$$.fragment, local);
  12509. current = true;
  12510. },
  12511. o(local) {
  12512. transition_out(loginbutton.$$.fragment, local);
  12513. current = false;
  12514. },
  12515. d(detaching) {
  12516. destroy_component(loginbutton, detaching);
  12517. }
  12518. };
  12519. }
  12520. // (185:6) {:else}
  12521. function create_else_block_2(ctx) {
  12522. var each_1_anchor, current;
  12523. let each_value_2 = ctx.requestHeaders;
  12524. let each_blocks = [];
  12525. for (let i = 0; i < each_value_2.length; i += 1) {
  12526. each_blocks[i] = create_each_block_2$1(get_each_context_2$1(ctx, each_value_2, i));
  12527. }
  12528. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  12529. each_blocks[i] = null;
  12530. });
  12531. return {
  12532. c() {
  12533. for (let i = 0; i < each_blocks.length; i += 1) {
  12534. each_blocks[i].c();
  12535. }
  12536. each_1_anchor = empty();
  12537. },
  12538. m(target, anchor) {
  12539. for (let i = 0; i < each_blocks.length; i += 1) {
  12540. each_blocks[i].m(target, anchor);
  12541. }
  12542. insert(target, each_1_anchor, anchor);
  12543. current = true;
  12544. },
  12545. p(changed, ctx) {
  12546. if (changed.requestHeaders) {
  12547. each_value_2 = ctx.requestHeaders;
  12548. let i;
  12549. for (i = 0; i < each_value_2.length; i += 1) {
  12550. const child_ctx = get_each_context_2$1(ctx, each_value_2, i);
  12551. if (each_blocks[i]) {
  12552. each_blocks[i].p(changed, child_ctx);
  12553. transition_in(each_blocks[i], 1);
  12554. } else {
  12555. each_blocks[i] = create_each_block_2$1(child_ctx);
  12556. each_blocks[i].c();
  12557. transition_in(each_blocks[i], 1);
  12558. each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
  12559. }
  12560. }
  12561. group_outros();
  12562. for (i = each_value_2.length; i < each_blocks.length; i += 1) {
  12563. out(i);
  12564. }
  12565. check_outros();
  12566. }
  12567. },
  12568. i(local) {
  12569. if (current) return;
  12570. for (let i = 0; i < each_value_2.length; i += 1) {
  12571. transition_in(each_blocks[i]);
  12572. }
  12573. current = true;
  12574. },
  12575. o(local) {
  12576. each_blocks = each_blocks.filter(Boolean);
  12577. for (let i = 0; i < each_blocks.length; i += 1) {
  12578. transition_out(each_blocks[i]);
  12579. }
  12580. current = false;
  12581. },
  12582. d(detaching) {
  12583. destroy_each(each_blocks, detaching);
  12584. if (detaching) {
  12585. detach(each_1_anchor);
  12586. }
  12587. }
  12588. };
  12589. }
  12590. // (181:6) {#if requestHeaders.length === 0 && !environment.auth}
  12591. function create_if_block_9(ctx) {
  12592. var p;
  12593. return {
  12594. c() {
  12595. p = element("p");
  12596. p.innerHTML = `<em>No configurable headers.</em>`;
  12597. },
  12598. m(target, anchor) {
  12599. insert(target, p, anchor);
  12600. },
  12601. p: noop,
  12602. i: noop,
  12603. o: noop,
  12604. d(detaching) {
  12605. if (detaching) {
  12606. detach(p);
  12607. }
  12608. }
  12609. };
  12610. }
  12611. // (186:8) {#each requestHeaders as header}
  12612. function create_each_block_2$1(ctx) {
  12613. var updating_used, updating_value, current;
  12614. function fieldswitch_used_binding(value) {
  12615. ctx.fieldswitch_used_binding.call(null, value, ctx);
  12616. updating_used = true;
  12617. add_flush_callback(() => updating_used = false);
  12618. }
  12619. function fieldswitch_value_binding(value_1) {
  12620. ctx.fieldswitch_value_binding.call(null, value_1, ctx);
  12621. updating_value = true;
  12622. add_flush_callback(() => updating_value = false);
  12623. }
  12624. let fieldswitch_props = {
  12625. name: ctx.header.name,
  12626. required: ctx.header.required,
  12627. rounded: true
  12628. };
  12629. if (ctx.header.used !== void 0) {
  12630. fieldswitch_props.used = ctx.header.used;
  12631. }
  12632. if (ctx.header.value !== void 0) {
  12633. fieldswitch_props.value = ctx.header.value;
  12634. }
  12635. var fieldswitch = new FieldSwitch({ props: fieldswitch_props });
  12636. binding_callbacks.push(() => bind(fieldswitch, 'used', fieldswitch_used_binding));
  12637. binding_callbacks.push(() => bind(fieldswitch, 'value', fieldswitch_value_binding));
  12638. return {
  12639. c() {
  12640. fieldswitch.$$.fragment.c();
  12641. },
  12642. m(target, anchor) {
  12643. mount_component(fieldswitch, target, anchor);
  12644. current = true;
  12645. },
  12646. p(changed, new_ctx) {
  12647. ctx = new_ctx;
  12648. var fieldswitch_changes = {};
  12649. if (changed.requestHeaders) fieldswitch_changes.name = ctx.header.name;
  12650. if (changed.requestHeaders) fieldswitch_changes.required = ctx.header.required;
  12651. if (!updating_used && changed.requestHeaders) {
  12652. fieldswitch_changes.used = ctx.header.used;
  12653. }
  12654. if (!updating_value && changed.requestHeaders) {
  12655. fieldswitch_changes.value = ctx.header.value;
  12656. }
  12657. fieldswitch.$set(fieldswitch_changes);
  12658. },
  12659. i(local) {
  12660. if (current) return;
  12661. transition_in(fieldswitch.$$.fragment, local);
  12662. current = true;
  12663. },
  12664. o(local) {
  12665. transition_out(fieldswitch.$$.fragment, local);
  12666. current = false;
  12667. },
  12668. d(detaching) {
  12669. destroy_component(fieldswitch, detaching);
  12670. }
  12671. };
  12672. }
  12673. // (196:6) {#if isAuth(environment, 'basic')}
  12674. function create_if_block_8(ctx) {
  12675. var current;
  12676. var fielddisabled = new FieldDisabled({
  12677. props: {
  12678. name: "authorization",
  12679. placeholder: "Authorization",
  12680. value: "Basic " + basicAuth(ctx.environment.auth.options.username, ctx.environment.auth.options.password)
  12681. }
  12682. });
  12683. return {
  12684. c() {
  12685. fielddisabled.$$.fragment.c();
  12686. },
  12687. m(target, anchor) {
  12688. mount_component(fielddisabled, target, anchor);
  12689. current = true;
  12690. },
  12691. p(changed, ctx) {
  12692. var fielddisabled_changes = {};
  12693. if (changed.environment) fielddisabled_changes.value = "Basic " + basicAuth(ctx.environment.auth.options.username, ctx.environment.auth.options.password);
  12694. fielddisabled.$set(fielddisabled_changes);
  12695. },
  12696. i(local) {
  12697. if (current) return;
  12698. transition_in(fielddisabled.$$.fragment, local);
  12699. current = true;
  12700. },
  12701. o(local) {
  12702. transition_out(fielddisabled.$$.fragment, local);
  12703. current = false;
  12704. },
  12705. d(detaching) {
  12706. destroy_component(fielddisabled, detaching);
  12707. }
  12708. };
  12709. }
  12710. // (203:6) {#if isAuth(environment, 'apikey')}
  12711. function create_if_block_7(ctx) {
  12712. var current;
  12713. var fielddisabled = new FieldDisabled({
  12714. props: {
  12715. name: "authorization",
  12716. placeholder: ctx.environment.auth.options.header,
  12717. value: ctx.environment.auth.options.key
  12718. }
  12719. });
  12720. return {
  12721. c() {
  12722. fielddisabled.$$.fragment.c();
  12723. },
  12724. m(target, anchor) {
  12725. mount_component(fielddisabled, target, anchor);
  12726. current = true;
  12727. },
  12728. p(changed, ctx) {
  12729. var fielddisabled_changes = {};
  12730. if (changed.environment) fielddisabled_changes.placeholder = ctx.environment.auth.options.header;
  12731. if (changed.environment) fielddisabled_changes.value = ctx.environment.auth.options.key;
  12732. fielddisabled.$set(fielddisabled_changes);
  12733. },
  12734. i(local) {
  12735. if (current) return;
  12736. transition_in(fielddisabled.$$.fragment, local);
  12737. current = true;
  12738. },
  12739. o(local) {
  12740. transition_out(fielddisabled.$$.fragment, local);
  12741. current = false;
  12742. },
  12743. d(detaching) {
  12744. destroy_component(fielddisabled, detaching);
  12745. }
  12746. };
  12747. }
  12748. // (210:6) {#if isAuth(environment, 'oauth2')}
  12749. function create_if_block_5(ctx) {
  12750. var show_if = ctx.$auth.includes(ctx.$env), if_block_anchor, current;
  12751. var if_block = (show_if) && create_if_block_6(ctx);
  12752. return {
  12753. c() {
  12754. if (if_block) if_block.c();
  12755. if_block_anchor = empty();
  12756. },
  12757. m(target, anchor) {
  12758. if (if_block) if_block.m(target, anchor);
  12759. insert(target, if_block_anchor, anchor);
  12760. current = true;
  12761. },
  12762. p(changed, ctx) {
  12763. if (changed.$auth || changed.$env) show_if = ctx.$auth.includes(ctx.$env);
  12764. if (show_if) {
  12765. if (if_block) {
  12766. if_block.p(changed, ctx);
  12767. transition_in(if_block, 1);
  12768. } else {
  12769. if_block = create_if_block_6(ctx);
  12770. if_block.c();
  12771. transition_in(if_block, 1);
  12772. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  12773. }
  12774. } else if (if_block) {
  12775. group_outros();
  12776. transition_out(if_block, 1, 1, () => {
  12777. if_block = null;
  12778. });
  12779. check_outros();
  12780. }
  12781. },
  12782. i(local) {
  12783. if (current) return;
  12784. transition_in(if_block);
  12785. current = true;
  12786. },
  12787. o(local) {
  12788. transition_out(if_block);
  12789. current = false;
  12790. },
  12791. d(detaching) {
  12792. if (if_block) if_block.d(detaching);
  12793. if (detaching) {
  12794. detach(if_block_anchor);
  12795. }
  12796. }
  12797. };
  12798. }
  12799. // (211:8) {#if $auth.includes($env)}
  12800. function create_if_block_6(ctx) {
  12801. var current;
  12802. var fielddisabled = new FieldDisabled({
  12803. props: {
  12804. name: "authorization",
  12805. placeholder: "Authorization",
  12806. value: "Bearer " + ctx.$token
  12807. }
  12808. });
  12809. return {
  12810. c() {
  12811. fielddisabled.$$.fragment.c();
  12812. },
  12813. m(target, anchor) {
  12814. mount_component(fielddisabled, target, anchor);
  12815. current = true;
  12816. },
  12817. p(changed, ctx) {
  12818. var fielddisabled_changes = {};
  12819. if (changed.$token) fielddisabled_changes.value = "Bearer " + ctx.$token;
  12820. fielddisabled.$set(fielddisabled_changes);
  12821. },
  12822. i(local) {
  12823. if (current) return;
  12824. transition_in(fielddisabled.$$.fragment, local);
  12825. current = true;
  12826. },
  12827. o(local) {
  12828. transition_out(fielddisabled.$$.fragment, local);
  12829. current = false;
  12830. },
  12831. d(detaching) {
  12832. destroy_component(fielddisabled, detaching);
  12833. }
  12834. };
  12835. }
  12836. // (225:6) {:else}
  12837. function create_else_block_1$1(ctx) {
  12838. var each_1_anchor, current;
  12839. let each_value_1 = ctx.requestParameters;
  12840. let each_blocks = [];
  12841. for (let i = 0; i < each_value_1.length; i += 1) {
  12842. each_blocks[i] = create_each_block_1$1(get_each_context_1$1(ctx, each_value_1, i));
  12843. }
  12844. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  12845. each_blocks[i] = null;
  12846. });
  12847. return {
  12848. c() {
  12849. for (let i = 0; i < each_blocks.length; i += 1) {
  12850. each_blocks[i].c();
  12851. }
  12852. each_1_anchor = empty();
  12853. },
  12854. m(target, anchor) {
  12855. for (let i = 0; i < each_blocks.length; i += 1) {
  12856. each_blocks[i].m(target, anchor);
  12857. }
  12858. insert(target, each_1_anchor, anchor);
  12859. current = true;
  12860. },
  12861. p(changed, ctx) {
  12862. if (changed.requestParameters) {
  12863. each_value_1 = ctx.requestParameters;
  12864. let i;
  12865. for (i = 0; i < each_value_1.length; i += 1) {
  12866. const child_ctx = get_each_context_1$1(ctx, each_value_1, i);
  12867. if (each_blocks[i]) {
  12868. each_blocks[i].p(changed, child_ctx);
  12869. transition_in(each_blocks[i], 1);
  12870. } else {
  12871. each_blocks[i] = create_each_block_1$1(child_ctx);
  12872. each_blocks[i].c();
  12873. transition_in(each_blocks[i], 1);
  12874. each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
  12875. }
  12876. }
  12877. group_outros();
  12878. for (i = each_value_1.length; i < each_blocks.length; i += 1) {
  12879. out(i);
  12880. }
  12881. check_outros();
  12882. }
  12883. },
  12884. i(local) {
  12885. if (current) return;
  12886. for (let i = 0; i < each_value_1.length; i += 1) {
  12887. transition_in(each_blocks[i]);
  12888. }
  12889. current = true;
  12890. },
  12891. o(local) {
  12892. each_blocks = each_blocks.filter(Boolean);
  12893. for (let i = 0; i < each_blocks.length; i += 1) {
  12894. transition_out(each_blocks[i]);
  12895. }
  12896. current = false;
  12897. },
  12898. d(detaching) {
  12899. destroy_each(each_blocks, detaching);
  12900. if (detaching) {
  12901. detach(each_1_anchor);
  12902. }
  12903. }
  12904. };
  12905. }
  12906. // (221:6) {#if requestParameters.length === 0}
  12907. function create_if_block_4(ctx) {
  12908. var p;
  12909. return {
  12910. c() {
  12911. p = element("p");
  12912. p.innerHTML = `<em>No configurable parameters.</em>`;
  12913. },
  12914. m(target, anchor) {
  12915. insert(target, p, anchor);
  12916. },
  12917. p: noop,
  12918. i: noop,
  12919. o: noop,
  12920. d(detaching) {
  12921. if (detaching) {
  12922. detach(p);
  12923. }
  12924. }
  12925. };
  12926. }
  12927. // (226:8) {#each requestParameters as param}
  12928. function create_each_block_1$1(ctx) {
  12929. var updating_used, updating_value, current;
  12930. function fieldswitch_used_binding_1(value) {
  12931. ctx.fieldswitch_used_binding_1.call(null, value, ctx);
  12932. updating_used = true;
  12933. add_flush_callback(() => updating_used = false);
  12934. }
  12935. function fieldswitch_value_binding_1(value_1) {
  12936. ctx.fieldswitch_value_binding_1.call(null, value_1, ctx);
  12937. updating_value = true;
  12938. add_flush_callback(() => updating_value = false);
  12939. }
  12940. let fieldswitch_props = {
  12941. name: ctx.param.name,
  12942. required: ctx.param.required
  12943. };
  12944. if (ctx.param.used !== void 0) {
  12945. fieldswitch_props.used = ctx.param.used;
  12946. }
  12947. if (ctx.param.value !== void 0) {
  12948. fieldswitch_props.value = ctx.param.value;
  12949. }
  12950. var fieldswitch = new FieldSwitch({ props: fieldswitch_props });
  12951. binding_callbacks.push(() => bind(fieldswitch, 'used', fieldswitch_used_binding_1));
  12952. binding_callbacks.push(() => bind(fieldswitch, 'value', fieldswitch_value_binding_1));
  12953. return {
  12954. c() {
  12955. fieldswitch.$$.fragment.c();
  12956. },
  12957. m(target, anchor) {
  12958. mount_component(fieldswitch, target, anchor);
  12959. current = true;
  12960. },
  12961. p(changed, new_ctx) {
  12962. ctx = new_ctx;
  12963. var fieldswitch_changes = {};
  12964. if (changed.requestParameters) fieldswitch_changes.name = ctx.param.name;
  12965. if (changed.requestParameters) fieldswitch_changes.required = ctx.param.required;
  12966. if (!updating_used && changed.requestParameters) {
  12967. fieldswitch_changes.used = ctx.param.used;
  12968. }
  12969. if (!updating_value && changed.requestParameters) {
  12970. fieldswitch_changes.value = ctx.param.value;
  12971. }
  12972. fieldswitch.$set(fieldswitch_changes);
  12973. },
  12974. i(local) {
  12975. if (current) return;
  12976. transition_in(fieldswitch.$$.fragment, local);
  12977. current = true;
  12978. },
  12979. o(local) {
  12980. transition_out(fieldswitch.$$.fragment, local);
  12981. current = false;
  12982. },
  12983. d(detaching) {
  12984. destroy_component(fieldswitch, detaching);
  12985. }
  12986. };
  12987. }
  12988. // (242:6) {:else}
  12989. function create_else_block$2(ctx) {
  12990. var p;
  12991. return {
  12992. c() {
  12993. p = element("p");
  12994. p.innerHTML = `<i>Body is only available for POST, PUT and PATCH.</i>`;
  12995. },
  12996. m(target, anchor) {
  12997. insert(target, p, anchor);
  12998. },
  12999. p: noop,
  13000. d(detaching) {
  13001. if (detaching) {
  13002. detach(p);
  13003. }
  13004. }
  13005. };
  13006. }
  13007. // (237:6) {#if allowBody(currentAction)}
  13008. function create_if_block_3$1(ctx) {
  13009. var textarea, dispose;
  13010. return {
  13011. c() {
  13012. textarea = element("textarea");
  13013. attr(textarea, "class", "textarea is-family-code");
  13014. attr(textarea, "rows", "8");
  13015. dispose = listen(textarea, "input", ctx.textarea_input_handler);
  13016. },
  13017. m(target, anchor) {
  13018. insert(target, textarea, anchor);
  13019. set_input_value(textarea, ctx.requestBody);
  13020. },
  13021. p(changed, ctx) {
  13022. if (changed.requestBody) set_input_value(textarea, ctx.requestBody);
  13023. },
  13024. d(detaching) {
  13025. if (detaching) {
  13026. detach(textarea);
  13027. }
  13028. dispose();
  13029. }
  13030. };
  13031. }
  13032. // (282:4) {:catch}
  13033. function create_catch_block(ctx) {
  13034. var div;
  13035. return {
  13036. c() {
  13037. div = element("div");
  13038. div.textContent = " ";
  13039. },
  13040. m(target, anchor) {
  13041. insert(target, div, anchor);
  13042. },
  13043. p: noop,
  13044. i: noop,
  13045. o: noop,
  13046. d(detaching) {
  13047. if (detaching) {
  13048. detach(div);
  13049. }
  13050. }
  13051. };
  13052. }
  13053. // (255:4) {:then value}
  13054. function create_then_block(ctx) {
  13055. var show_if = Object.keys(ctx.value).length > 0, if_block_anchor, current;
  13056. var if_block = (show_if) && create_if_block_1$7(ctx);
  13057. return {
  13058. c() {
  13059. if (if_block) if_block.c();
  13060. if_block_anchor = empty();
  13061. },
  13062. m(target, anchor) {
  13063. if (if_block) if_block.m(target, anchor);
  13064. insert(target, if_block_anchor, anchor);
  13065. current = true;
  13066. },
  13067. p(changed, ctx) {
  13068. if (changed.response) show_if = Object.keys(ctx.value).length > 0;
  13069. if (show_if) {
  13070. if (if_block) {
  13071. if_block.p(changed, ctx);
  13072. transition_in(if_block, 1);
  13073. } else {
  13074. if_block = create_if_block_1$7(ctx);
  13075. if_block.c();
  13076. transition_in(if_block, 1);
  13077. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  13078. }
  13079. } else if (if_block) {
  13080. group_outros();
  13081. transition_out(if_block, 1, 1, () => {
  13082. if_block = null;
  13083. });
  13084. check_outros();
  13085. }
  13086. },
  13087. i(local) {
  13088. if (current) return;
  13089. transition_in(if_block);
  13090. current = true;
  13091. },
  13092. o(local) {
  13093. transition_out(if_block);
  13094. current = false;
  13095. },
  13096. d(detaching) {
  13097. if (if_block) if_block.d(detaching);
  13098. if (detaching) {
  13099. detach(if_block_anchor);
  13100. }
  13101. }
  13102. };
  13103. }
  13104. // (256:6) {#if Object.keys(value).length > 0}
  13105. function create_if_block_1$7(ctx) {
  13106. var div1, section1, section0, div0, h1, t0_value = ctx.value.status + "", t0, t1, t2_value = ctx.value.statusText + "", t2, section1_class_value, t3, show_if = Object.keys(ctx.value.headers).length > 0, current;
  13107. var if_block = (show_if) && create_if_block_2$3(ctx);
  13108. return {
  13109. c() {
  13110. div1 = element("div");
  13111. section1 = element("section");
  13112. section0 = element("section");
  13113. div0 = element("div");
  13114. h1 = element("h1");
  13115. t0 = text(t0_value);
  13116. t1 = space();
  13117. t2 = text(t2_value);
  13118. t3 = space();
  13119. if (if_block) if_block.c();
  13120. attr(h1, "class", "title");
  13121. attr(div0, "class", "container has-text-centered");
  13122. attr(section0, "class", "hero-body hero-small svelte-c3oocm");
  13123. attr(section1, "class", section1_class_value = "hero hero-rounded " + colorize(ctx.value.status) + " svelte-c3oocm");
  13124. attr(div1, "class", "small-section svelte-c3oocm");
  13125. },
  13126. m(target, anchor) {
  13127. insert(target, div1, anchor);
  13128. append(div1, section1);
  13129. append(section1, section0);
  13130. append(section0, div0);
  13131. append(div0, h1);
  13132. append(h1, t0);
  13133. append(h1, t1);
  13134. append(h1, t2);
  13135. append(div1, t3);
  13136. if (if_block) if_block.m(div1, null);
  13137. current = true;
  13138. },
  13139. p(changed, ctx) {
  13140. if ((!current || changed.response) && t0_value !== (t0_value = ctx.value.status + "")) {
  13141. set_data(t0, t0_value);
  13142. }
  13143. if ((!current || changed.response) && t2_value !== (t2_value = ctx.value.statusText + "")) {
  13144. set_data(t2, t2_value);
  13145. }
  13146. if ((!current || changed.response) && section1_class_value !== (section1_class_value = "hero hero-rounded " + colorize(ctx.value.status) + " svelte-c3oocm")) {
  13147. attr(section1, "class", section1_class_value);
  13148. }
  13149. if (changed.response) show_if = Object.keys(ctx.value.headers).length > 0;
  13150. if (show_if) {
  13151. if (if_block) {
  13152. if_block.p(changed, ctx);
  13153. transition_in(if_block, 1);
  13154. } else {
  13155. if_block = create_if_block_2$3(ctx);
  13156. if_block.c();
  13157. transition_in(if_block, 1);
  13158. if_block.m(div1, null);
  13159. }
  13160. } else if (if_block) {
  13161. group_outros();
  13162. transition_out(if_block, 1, 1, () => {
  13163. if_block = null;
  13164. });
  13165. check_outros();
  13166. }
  13167. },
  13168. i(local) {
  13169. if (current) return;
  13170. transition_in(if_block);
  13171. current = true;
  13172. },
  13173. o(local) {
  13174. transition_out(if_block);
  13175. current = false;
  13176. },
  13177. d(detaching) {
  13178. if (detaching) {
  13179. detach(div1);
  13180. }
  13181. if (if_block) if_block.d();
  13182. }
  13183. };
  13184. }
  13185. // (266:10) {#if Object.keys(value.headers).length > 0}
  13186. function create_if_block_2$3(ctx) {
  13187. var div1, div0, t, current;
  13188. let each_value = Object.entries(ctx.value.headers);
  13189. let each_blocks = [];
  13190. for (let i = 0; i < each_value.length; i += 1) {
  13191. each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
  13192. }
  13193. var codeblock = new CodeBlock({
  13194. props: { type: contentType(ctx.value.headers), body: ctx.value.data }
  13195. });
  13196. return {
  13197. c() {
  13198. div1 = element("div");
  13199. div0 = element("div");
  13200. for (let i = 0; i < each_blocks.length; i += 1) {
  13201. each_blocks[i].c();
  13202. }
  13203. t = space();
  13204. codeblock.$$.fragment.c();
  13205. attr(div0, "class", "content-header svelte-c3oocm");
  13206. attr(div1, "class", "container container-content svelte-c3oocm");
  13207. },
  13208. m(target, anchor) {
  13209. insert(target, div1, anchor);
  13210. append(div1, div0);
  13211. for (let i = 0; i < each_blocks.length; i += 1) {
  13212. each_blocks[i].m(div0, null);
  13213. }
  13214. append(div1, t);
  13215. mount_component(codeblock, div1, null);
  13216. current = true;
  13217. },
  13218. p(changed, ctx) {
  13219. if (changed.response) {
  13220. each_value = Object.entries(ctx.value.headers);
  13221. let i;
  13222. for (i = 0; i < each_value.length; i += 1) {
  13223. const child_ctx = get_each_context$5(ctx, each_value, i);
  13224. if (each_blocks[i]) {
  13225. each_blocks[i].p(changed, child_ctx);
  13226. } else {
  13227. each_blocks[i] = create_each_block$5(child_ctx);
  13228. each_blocks[i].c();
  13229. each_blocks[i].m(div0, null);
  13230. }
  13231. }
  13232. for (; i < each_blocks.length; i += 1) {
  13233. each_blocks[i].d(1);
  13234. }
  13235. each_blocks.length = each_value.length;
  13236. }
  13237. var codeblock_changes = {};
  13238. if (changed.response) codeblock_changes.type = contentType(ctx.value.headers);
  13239. if (changed.response) codeblock_changes.body = ctx.value.data;
  13240. codeblock.$set(codeblock_changes);
  13241. },
  13242. i(local) {
  13243. if (current) return;
  13244. transition_in(codeblock.$$.fragment, local);
  13245. current = true;
  13246. },
  13247. o(local) {
  13248. transition_out(codeblock.$$.fragment, local);
  13249. current = false;
  13250. },
  13251. d(detaching) {
  13252. if (detaching) {
  13253. detach(div1);
  13254. }
  13255. destroy_each(each_blocks, detaching);
  13256. destroy_component(codeblock);
  13257. }
  13258. };
  13259. }
  13260. // (269:16) {#each Object.entries(value.headers) as [key, val]}
  13261. function create_each_block$5(ctx) {
  13262. var p, span, t0_value = ctx.key + "", t0, t1, t2_value = ctx.val + "", t2, t3;
  13263. return {
  13264. c() {
  13265. p = element("p");
  13266. span = element("span");
  13267. t0 = text(t0_value);
  13268. t1 = text("\n : ");
  13269. t2 = text(t2_value);
  13270. t3 = space();
  13271. attr(span, "class", "is-capitalized");
  13272. attr(p, "class", "is-family-code");
  13273. },
  13274. m(target, anchor) {
  13275. insert(target, p, anchor);
  13276. append(p, span);
  13277. append(span, t0);
  13278. append(p, t1);
  13279. append(p, t2);
  13280. append(p, t3);
  13281. },
  13282. p(changed, ctx) {
  13283. if ((changed.response) && t0_value !== (t0_value = ctx.key + "")) {
  13284. set_data(t0, t0_value);
  13285. }
  13286. if ((changed.response) && t2_value !== (t2_value = ctx.val + "")) {
  13287. set_data(t2, t2_value);
  13288. }
  13289. },
  13290. d(detaching) {
  13291. if (detaching) {
  13292. detach(p);
  13293. }
  13294. }
  13295. };
  13296. }
  13297. // (249:21) <div class="section has-text-centered"> <span class="icon is-medium has-text-danger"> <i class="fas fa-2x fa-spinner fa-pulse" /> </span> </div> {:then value}
  13298. function create_pending_block(ctx) {
  13299. var div;
  13300. return {
  13301. c() {
  13302. div = element("div");
  13303. div.innerHTML = `<span class="icon is-medium has-text-danger"><i class="fas fa-2x fa-spinner fa-pulse"></i></span>`;
  13304. attr(div, "class", "section has-text-centered");
  13305. },
  13306. m(target, anchor) {
  13307. insert(target, div, anchor);
  13308. },
  13309. p: noop,
  13310. i: noop,
  13311. o: noop,
  13312. d(detaching) {
  13313. if (detaching) {
  13314. detach(div);
  13315. }
  13316. }
  13317. };
  13318. }
  13319. // (286:4) {#if error}
  13320. function create_if_block$a(ctx) {
  13321. var div1, section1, section0, div0, p, t;
  13322. return {
  13323. c() {
  13324. div1 = element("div");
  13325. section1 = element("section");
  13326. section0 = element("section");
  13327. div0 = element("div");
  13328. p = element("p");
  13329. t = text(ctx.error);
  13330. attr(p, "class", "subtitle");
  13331. attr(div0, "class", "container");
  13332. attr(section0, "class", "hero-body");
  13333. attr(section1, "class", "hero is-danger");
  13334. attr(div1, "class", "small-section svelte-c3oocm");
  13335. },
  13336. m(target, anchor) {
  13337. insert(target, div1, anchor);
  13338. append(div1, section1);
  13339. append(section1, section0);
  13340. append(section0, div0);
  13341. append(div0, p);
  13342. append(p, t);
  13343. },
  13344. p(changed, ctx) {
  13345. if (changed.error) {
  13346. set_data(t, ctx.error);
  13347. }
  13348. },
  13349. d(detaching) {
  13350. if (detaching) {
  13351. detach(div1);
  13352. }
  13353. }
  13354. };
  13355. }
  13356. // (126:2) <div slot="body">
  13357. function create_body_slot(ctx) {
  13358. var div0, div3, div1, t0, div2, show_if_4, current_block_type_index, if_block1, t1, div4, ul, li0, a0, t3, li1, a1, t5, li2, a2, t7, div5, current_block_type_index_1, if_block2, t8, show_if_3 = isAuth(ctx.environment, 'basic'), t9, show_if_2 = isAuth(ctx.environment, 'apikey'), t10, show_if_1 = isAuth(ctx.environment, 'oauth2'), t11, div6, current_block_type_index_2, if_block6, t12, div7, show_if, t13, promise, t14, current, dispose;
  13359. function select_block_type(changed, ctx) {
  13360. if (ctx.copying) return create_if_block_11;
  13361. return create_else_block_4;
  13362. }
  13363. var current_block_type = select_block_type(null, ctx);
  13364. var if_block0 = current_block_type(ctx);
  13365. var if_block_creators = [
  13366. create_if_block_10,
  13367. create_else_block_3
  13368. ];
  13369. var if_blocks = [];
  13370. function select_block_type_1(changed, ctx) {
  13371. if ((show_if_4 == null) || changed.environment || changed.$auth || changed.$env) show_if_4 = !!(isAuth(ctx.environment, 'oauth2') && !ctx.$auth.includes(ctx.$env));
  13372. if (show_if_4) return 0;
  13373. return 1;
  13374. }
  13375. current_block_type_index = select_block_type_1(null, ctx);
  13376. if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  13377. var if_block_creators_1 = [
  13378. create_if_block_9,
  13379. create_else_block_2
  13380. ];
  13381. var if_blocks_1 = [];
  13382. function select_block_type_2(changed, ctx) {
  13383. if (ctx.requestHeaders.length === 0 && !ctx.environment.auth) return 0;
  13384. return 1;
  13385. }
  13386. current_block_type_index_1 = select_block_type_2(null, ctx);
  13387. if_block2 = if_blocks_1[current_block_type_index_1] = if_block_creators_1[current_block_type_index_1](ctx);
  13388. var if_block3 = (show_if_3) && create_if_block_8(ctx);
  13389. var if_block4 = (show_if_2) && create_if_block_7(ctx);
  13390. var if_block5 = (show_if_1) && create_if_block_5(ctx);
  13391. var if_block_creators_2 = [
  13392. create_if_block_4,
  13393. create_else_block_1$1
  13394. ];
  13395. var if_blocks_2 = [];
  13396. function select_block_type_3(changed, ctx) {
  13397. if (ctx.requestParameters.length === 0) return 0;
  13398. return 1;
  13399. }
  13400. current_block_type_index_2 = select_block_type_3(null, ctx);
  13401. if_block6 = if_blocks_2[current_block_type_index_2] = if_block_creators_2[current_block_type_index_2](ctx);
  13402. function select_block_type_4(changed, ctx) {
  13403. if ((show_if == null) || changed.currentAction) show_if = !!(allowBody(ctx.currentAction));
  13404. if (show_if) return create_if_block_3$1;
  13405. return create_else_block$2;
  13406. }
  13407. var current_block_type_1 = select_block_type_4(null, ctx);
  13408. var if_block7 = current_block_type_1(ctx);
  13409. let info = {
  13410. ctx,
  13411. current: null,
  13412. token: null,
  13413. pending: create_pending_block,
  13414. then: create_then_block,
  13415. catch: create_catch_block,
  13416. value: 'value',
  13417. error: 'null',
  13418. blocks: [,,,]
  13419. };
  13420. handle_promise(promise = ctx.response, info);
  13421. var if_block8 = (ctx.error) && create_if_block$a(ctx);
  13422. return {
  13423. c() {
  13424. div0 = element("div");
  13425. div3 = element("div");
  13426. div1 = element("div");
  13427. if_block0.c();
  13428. t0 = space();
  13429. div2 = element("div");
  13430. if_block1.c();
  13431. t1 = space();
  13432. div4 = element("div");
  13433. ul = element("ul");
  13434. li0 = element("li");
  13435. a0 = element("a");
  13436. a0.textContent = "Headers";
  13437. t3 = space();
  13438. li1 = element("li");
  13439. a1 = element("a");
  13440. a1.textContent = "Parameters";
  13441. t5 = space();
  13442. li2 = element("li");
  13443. a2 = element("a");
  13444. a2.textContent = "Body";
  13445. t7 = space();
  13446. div5 = element("div");
  13447. if_block2.c();
  13448. t8 = space();
  13449. if (if_block3) if_block3.c();
  13450. t9 = space();
  13451. if (if_block4) if_block4.c();
  13452. t10 = space();
  13453. if (if_block5) if_block5.c();
  13454. t11 = space();
  13455. div6 = element("div");
  13456. if_block6.c();
  13457. t12 = space();
  13458. div7 = element("div");
  13459. if_block7.c();
  13460. t13 = space();
  13461. info.block.c();
  13462. t14 = space();
  13463. if (if_block8) if_block8.c();
  13464. attr(div1, "class", "column");
  13465. attr(div2, "class", "column is-one-fifth");
  13466. attr(div3, "class", "columns");
  13467. attr(a0, "href", "javascript:void(0)");
  13468. toggle_class(li0, "is-active", ctx.requestTab === 0);
  13469. attr(a1, "href", "javascript:void(0)");
  13470. toggle_class(li1, "is-active", ctx.requestTab === 1);
  13471. attr(a2, "href", "javascript:void(0)");
  13472. toggle_class(li2, "is-active", ctx.requestTab === 2);
  13473. attr(div4, "class", "tabs is-boxed");
  13474. attr(div5, "class", "section-headers");
  13475. toggle_class(div5, "is-hidden", ctx.requestTab != 0);
  13476. attr(div6, "class", "section-parameters");
  13477. toggle_class(div6, "is-hidden", ctx.requestTab != 1);
  13478. attr(div7, "class", "section-body");
  13479. toggle_class(div7, "is-hidden", ctx.requestTab != 2);
  13480. attr(div0, "slot", "body");
  13481. dispose = [
  13482. listen(a0, "click", ctx.click_handler),
  13483. listen(a1, "click", ctx.click_handler_1),
  13484. listen(a2, "click", ctx.click_handler_2)
  13485. ];
  13486. },
  13487. m(target, anchor) {
  13488. insert(target, div0, anchor);
  13489. append(div0, div3);
  13490. append(div3, div1);
  13491. if_block0.m(div1, null);
  13492. append(div3, t0);
  13493. append(div3, div2);
  13494. if_blocks[current_block_type_index].m(div2, null);
  13495. append(div0, t1);
  13496. append(div0, div4);
  13497. append(div4, ul);
  13498. append(ul, li0);
  13499. append(li0, a0);
  13500. append(ul, t3);
  13501. append(ul, li1);
  13502. append(li1, a1);
  13503. append(ul, t5);
  13504. append(ul, li2);
  13505. append(li2, a2);
  13506. append(div0, t7);
  13507. append(div0, div5);
  13508. if_blocks_1[current_block_type_index_1].m(div5, null);
  13509. append(div5, t8);
  13510. if (if_block3) if_block3.m(div5, null);
  13511. append(div5, t9);
  13512. if (if_block4) if_block4.m(div5, null);
  13513. append(div5, t10);
  13514. if (if_block5) if_block5.m(div5, null);
  13515. append(div0, t11);
  13516. append(div0, div6);
  13517. if_blocks_2[current_block_type_index_2].m(div6, null);
  13518. append(div0, t12);
  13519. append(div0, div7);
  13520. if_block7.m(div7, null);
  13521. append(div0, t13);
  13522. info.block.m(div0, info.anchor = null);
  13523. info.mount = () => div0;
  13524. info.anchor = t14;
  13525. append(div0, t14);
  13526. if (if_block8) if_block8.m(div0, null);
  13527. current = true;
  13528. },
  13529. p(changed, new_ctx) {
  13530. ctx = new_ctx;
  13531. if (current_block_type === (current_block_type = select_block_type(changed, ctx)) && if_block0) {
  13532. if_block0.p(changed, ctx);
  13533. } else {
  13534. if_block0.d(1);
  13535. if_block0 = current_block_type(ctx);
  13536. if (if_block0) {
  13537. if_block0.c();
  13538. if_block0.m(div1, null);
  13539. }
  13540. }
  13541. var previous_block_index = current_block_type_index;
  13542. current_block_type_index = select_block_type_1(changed, ctx);
  13543. if (current_block_type_index === previous_block_index) {
  13544. if_blocks[current_block_type_index].p(changed, ctx);
  13545. } else {
  13546. group_outros();
  13547. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  13548. if_blocks[previous_block_index] = null;
  13549. });
  13550. check_outros();
  13551. if_block1 = if_blocks[current_block_type_index];
  13552. if (!if_block1) {
  13553. if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  13554. if_block1.c();
  13555. }
  13556. transition_in(if_block1, 1);
  13557. if_block1.m(div2, null);
  13558. }
  13559. if (changed.requestTab) {
  13560. toggle_class(li0, "is-active", ctx.requestTab === 0);
  13561. toggle_class(li1, "is-active", ctx.requestTab === 1);
  13562. toggle_class(li2, "is-active", ctx.requestTab === 2);
  13563. }
  13564. var previous_block_index_1 = current_block_type_index_1;
  13565. current_block_type_index_1 = select_block_type_2(changed, ctx);
  13566. if (current_block_type_index_1 === previous_block_index_1) {
  13567. if_blocks_1[current_block_type_index_1].p(changed, ctx);
  13568. } else {
  13569. group_outros();
  13570. transition_out(if_blocks_1[previous_block_index_1], 1, 1, () => {
  13571. if_blocks_1[previous_block_index_1] = null;
  13572. });
  13573. check_outros();
  13574. if_block2 = if_blocks_1[current_block_type_index_1];
  13575. if (!if_block2) {
  13576. if_block2 = if_blocks_1[current_block_type_index_1] = if_block_creators_1[current_block_type_index_1](ctx);
  13577. if_block2.c();
  13578. }
  13579. transition_in(if_block2, 1);
  13580. if_block2.m(div5, t8);
  13581. }
  13582. if (changed.environment) show_if_3 = isAuth(ctx.environment, 'basic');
  13583. if (show_if_3) {
  13584. if (if_block3) {
  13585. if_block3.p(changed, ctx);
  13586. transition_in(if_block3, 1);
  13587. } else {
  13588. if_block3 = create_if_block_8(ctx);
  13589. if_block3.c();
  13590. transition_in(if_block3, 1);
  13591. if_block3.m(div5, t9);
  13592. }
  13593. } else if (if_block3) {
  13594. group_outros();
  13595. transition_out(if_block3, 1, 1, () => {
  13596. if_block3 = null;
  13597. });
  13598. check_outros();
  13599. }
  13600. if (changed.environment) show_if_2 = isAuth(ctx.environment, 'apikey');
  13601. if (show_if_2) {
  13602. if (if_block4) {
  13603. if_block4.p(changed, ctx);
  13604. transition_in(if_block4, 1);
  13605. } else {
  13606. if_block4 = create_if_block_7(ctx);
  13607. if_block4.c();
  13608. transition_in(if_block4, 1);
  13609. if_block4.m(div5, t10);
  13610. }
  13611. } else if (if_block4) {
  13612. group_outros();
  13613. transition_out(if_block4, 1, 1, () => {
  13614. if_block4 = null;
  13615. });
  13616. check_outros();
  13617. }
  13618. if (changed.environment) show_if_1 = isAuth(ctx.environment, 'oauth2');
  13619. if (show_if_1) {
  13620. if (if_block5) {
  13621. if_block5.p(changed, ctx);
  13622. transition_in(if_block5, 1);
  13623. } else {
  13624. if_block5 = create_if_block_5(ctx);
  13625. if_block5.c();
  13626. transition_in(if_block5, 1);
  13627. if_block5.m(div5, null);
  13628. }
  13629. } else if (if_block5) {
  13630. group_outros();
  13631. transition_out(if_block5, 1, 1, () => {
  13632. if_block5 = null;
  13633. });
  13634. check_outros();
  13635. }
  13636. if (changed.requestTab) {
  13637. toggle_class(div5, "is-hidden", ctx.requestTab != 0);
  13638. }
  13639. var previous_block_index_2 = current_block_type_index_2;
  13640. current_block_type_index_2 = select_block_type_3(changed, ctx);
  13641. if (current_block_type_index_2 === previous_block_index_2) {
  13642. if_blocks_2[current_block_type_index_2].p(changed, ctx);
  13643. } else {
  13644. group_outros();
  13645. transition_out(if_blocks_2[previous_block_index_2], 1, 1, () => {
  13646. if_blocks_2[previous_block_index_2] = null;
  13647. });
  13648. check_outros();
  13649. if_block6 = if_blocks_2[current_block_type_index_2];
  13650. if (!if_block6) {
  13651. if_block6 = if_blocks_2[current_block_type_index_2] = if_block_creators_2[current_block_type_index_2](ctx);
  13652. if_block6.c();
  13653. }
  13654. transition_in(if_block6, 1);
  13655. if_block6.m(div6, null);
  13656. }
  13657. if (changed.requestTab) {
  13658. toggle_class(div6, "is-hidden", ctx.requestTab != 1);
  13659. }
  13660. if (current_block_type_1 === (current_block_type_1 = select_block_type_4(changed, ctx)) && if_block7) {
  13661. if_block7.p(changed, ctx);
  13662. } else {
  13663. if_block7.d(1);
  13664. if_block7 = current_block_type_1(ctx);
  13665. if (if_block7) {
  13666. if_block7.c();
  13667. if_block7.m(div7, null);
  13668. }
  13669. }
  13670. if (changed.requestTab) {
  13671. toggle_class(div7, "is-hidden", ctx.requestTab != 2);
  13672. }
  13673. info.ctx = ctx;
  13674. if (('response' in changed) && promise !== (promise = ctx.response) && handle_promise(promise, info)) {
  13675. // nothing
  13676. } else {
  13677. info.block.p(changed, assign(assign({}, ctx), info.resolved));
  13678. }
  13679. if (ctx.error) {
  13680. if (if_block8) {
  13681. if_block8.p(changed, ctx);
  13682. } else {
  13683. if_block8 = create_if_block$a(ctx);
  13684. if_block8.c();
  13685. if_block8.m(div0, null);
  13686. }
  13687. } else if (if_block8) {
  13688. if_block8.d(1);
  13689. if_block8 = null;
  13690. }
  13691. },
  13692. i(local) {
  13693. if (current) return;
  13694. transition_in(if_block1);
  13695. transition_in(if_block2);
  13696. transition_in(if_block3);
  13697. transition_in(if_block4);
  13698. transition_in(if_block5);
  13699. transition_in(if_block6);
  13700. transition_in(info.block);
  13701. current = true;
  13702. },
  13703. o(local) {
  13704. transition_out(if_block1);
  13705. transition_out(if_block2);
  13706. transition_out(if_block3);
  13707. transition_out(if_block4);
  13708. transition_out(if_block5);
  13709. transition_out(if_block6);
  13710. for (let i = 0; i < 3; i += 1) {
  13711. const block = info.blocks[i];
  13712. transition_out(block);
  13713. }
  13714. current = false;
  13715. },
  13716. d(detaching) {
  13717. if (detaching) {
  13718. detach(div0);
  13719. }
  13720. if_block0.d();
  13721. if_blocks[current_block_type_index].d();
  13722. if_blocks_1[current_block_type_index_1].d();
  13723. if (if_block3) if_block3.d();
  13724. if (if_block4) if_block4.d();
  13725. if (if_block5) if_block5.d();
  13726. if_blocks_2[current_block_type_index_2].d();
  13727. if_block7.d();
  13728. info.block.d();
  13729. info.token = null;
  13730. info = null;
  13731. if (if_block8) if_block8.d();
  13732. run_all(dispose);
  13733. }
  13734. };
  13735. }
  13736. // (124:0) <CollapsiblePanel dark={true} {show}>
  13737. function create_default_slot(ctx) {
  13738. var t, current;
  13739. return {
  13740. c() {
  13741. t = space();
  13742. },
  13743. m(target, anchor) {
  13744. insert(target, t, anchor);
  13745. },
  13746. p: noop,
  13747. i: noop,
  13748. o: noop,
  13749. d(detaching) {
  13750. if (detaching) {
  13751. detach(t);
  13752. }
  13753. }
  13754. };
  13755. }
  13756. function create_fragment$g(ctx) {
  13757. var current;
  13758. var collapsiblepanel = new CollapsiblePanel({
  13759. props: {
  13760. dark: true,
  13761. show: ctx.show,
  13762. $$slots: {
  13763. default: [create_default_slot],
  13764. body: [create_body_slot],
  13765. heading: [create_heading_slot]
  13766. },
  13767. $$scope: { ctx }
  13768. }
  13769. });
  13770. return {
  13771. c() {
  13772. collapsiblepanel.$$.fragment.c();
  13773. },
  13774. m(target, anchor) {
  13775. mount_component(collapsiblepanel, target, anchor);
  13776. current = true;
  13777. },
  13778. p(changed, ctx) {
  13779. var collapsiblepanel_changes = {};
  13780. if (changed.show) collapsiblepanel_changes.show = ctx.show;
  13781. if (changed.$$scope || changed.error || changed.response || changed.requestTab || changed.currentAction || changed.requestBody || changed.requestParameters || changed.environment || changed.$auth || changed.$env || changed.$token || changed.requestHeaders || changed.copying || changed.currentUrl) collapsiblepanel_changes.$$scope = { changed, ctx };
  13782. collapsiblepanel.$set(collapsiblepanel_changes);
  13783. },
  13784. i(local) {
  13785. if (current) return;
  13786. transition_in(collapsiblepanel.$$.fragment, local);
  13787. current = true;
  13788. },
  13789. o(local) {
  13790. transition_out(collapsiblepanel.$$.fragment, local);
  13791. current = false;
  13792. },
  13793. d(detaching) {
  13794. destroy_component(collapsiblepanel, detaching);
  13795. }
  13796. };
  13797. }
  13798. function contentType(headers) {
  13799. return headers && headers["content-type"];
  13800. }
  13801. function basicAuth(username, password) {
  13802. return btoa(`${username}:${password}`);
  13803. }
  13804. function instance$g($$self, $$props, $$invalidate) {
  13805. let $env, $auth, $token;
  13806. component_subscribe($$self, env, $$value => { $env = $$value; $$invalidate('$env', $env); });
  13807. component_subscribe($$self, auth, $$value => { $auth = $$value; $$invalidate('$auth', $auth); });
  13808. component_subscribe($$self, token, $$value => { $token = $$value; $$invalidate('$token', $token); });
  13809. let { show = true, environments, currentAction, currentSample, requestHeaders, requestParameters, requestBody } = $$props;
  13810. let response = {};
  13811. let requestTab = 0;
  13812. let error;
  13813. let copying = false;
  13814. afterUpdate(() => {
  13815. $$invalidate('response', response = {});
  13816. });
  13817. function handleClick() {
  13818. $$invalidate('error', error = undefined);
  13819. $$invalidate('response', response = sendRequest($env, environment, currentAction, {
  13820. headers: requestHeaders,
  13821. parameters: requestParameters,
  13822. body: requestBody
  13823. }).catch(function(err) {
  13824. $$invalidate('error', error = err);
  13825. return Promise.reject(err);
  13826. }));
  13827. }
  13828. function handleTab(index) {
  13829. $$invalidate('error', error = undefined);
  13830. $$invalidate('requestTab', requestTab = index);
  13831. }
  13832. function handleCopy() {
  13833. $$invalidate('copying', copying = true);
  13834. setTimeout(() => {
  13835. $$invalidate('copying', copying = false);
  13836. }, 2000);
  13837. copyUrl(currentUrl, requestParameters);
  13838. }
  13839. const click_handler = () => handleTab(0);
  13840. const click_handler_1 = () => handleTab(1);
  13841. const click_handler_2 = () => handleTab(2);
  13842. function fieldswitch_used_binding(value, { header }) {
  13843. header.used = value;
  13844. $$invalidate('requestHeaders', requestHeaders);
  13845. }
  13846. function fieldswitch_value_binding(value_1, { header }) {
  13847. header.value = value_1;
  13848. $$invalidate('requestHeaders', requestHeaders);
  13849. }
  13850. function fieldswitch_used_binding_1(value, { param }) {
  13851. param.used = value;
  13852. $$invalidate('requestParameters', requestParameters);
  13853. }
  13854. function fieldswitch_value_binding_1(value_1, { param }) {
  13855. param.value = value_1;
  13856. $$invalidate('requestParameters', requestParameters);
  13857. }
  13858. function textarea_input_handler() {
  13859. requestBody = this.value;
  13860. $$invalidate('requestBody', requestBody);
  13861. }
  13862. $$self.$set = $$props => {
  13863. if ('show' in $$props) $$invalidate('show', show = $$props.show);
  13864. if ('environments' in $$props) $$invalidate('environments', environments = $$props.environments);
  13865. if ('currentAction' in $$props) $$invalidate('currentAction', currentAction = $$props.currentAction);
  13866. if ('currentSample' in $$props) $$invalidate('currentSample', currentSample = $$props.currentSample);
  13867. if ('requestHeaders' in $$props) $$invalidate('requestHeaders', requestHeaders = $$props.requestHeaders);
  13868. if ('requestParameters' in $$props) $$invalidate('requestParameters', requestParameters = $$props.requestParameters);
  13869. if ('requestBody' in $$props) $$invalidate('requestBody', requestBody = $$props.requestBody);
  13870. };
  13871. let environment, currentUrl;
  13872. $$self.$$.update = ($$dirty = { environments: 1, $env: 1, environment: 1, currentAction: 1, currentUrl: 1 }) => {
  13873. if ($$dirty.environments || $$dirty.$env) { $$invalidate('environment', environment = environments[$env]); }
  13874. if ($$dirty.environment || $$dirty.currentAction) { $$invalidate('currentUrl', currentUrl = urlParse(urlJoin(environment.url, currentAction.path))); }
  13875. if ($$dirty.currentUrl) { {
  13876. $$invalidate('error', error = currentUrl && undefined);
  13877. } }
  13878. };
  13879. return {
  13880. show,
  13881. environments,
  13882. currentAction,
  13883. currentSample,
  13884. requestHeaders,
  13885. requestParameters,
  13886. requestBody,
  13887. response,
  13888. requestTab,
  13889. error,
  13890. copying,
  13891. handleClick,
  13892. handleTab,
  13893. handleCopy,
  13894. environment,
  13895. $env,
  13896. currentUrl,
  13897. $auth,
  13898. $token,
  13899. click_handler,
  13900. click_handler_1,
  13901. click_handler_2,
  13902. fieldswitch_used_binding,
  13903. fieldswitch_value_binding,
  13904. fieldswitch_used_binding_1,
  13905. fieldswitch_value_binding_1,
  13906. textarea_input_handler
  13907. };
  13908. }
  13909. class PlaygroundPanel extends SvelteComponent {
  13910. constructor(options) {
  13911. super();
  13912. if (!document.getElementById("svelte-c3oocm-style")) add_css$8();
  13913. init(this, options, instance$g, create_fragment$g, safe_not_equal, ["show", "environments", "currentAction", "currentSample", "requestHeaders", "requestParameters", "requestBody"]);
  13914. }
  13915. }
  13916. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ScenarioPanel.svelte generated by Svelte v3.12.1 */
  13917. // (30:2) <span slot="heading">
  13918. function create_heading_slot$1(ctx) {
  13919. var span, t_value = ctx.title(ctx.index) + "", t;
  13920. return {
  13921. c() {
  13922. span = element("span");
  13923. t = text(t_value);
  13924. attr(span, "slot", "heading");
  13925. },
  13926. m(target, anchor) {
  13927. insert(target, span, anchor);
  13928. append(span, t);
  13929. },
  13930. p(changed, ctx) {
  13931. if ((changed.index) && t_value !== (t_value = ctx.title(ctx.index) + "")) {
  13932. set_data(t, t_value);
  13933. }
  13934. },
  13935. d(detaching) {
  13936. if (detaching) {
  13937. detach(span);
  13938. }
  13939. }
  13940. };
  13941. }
  13942. // (31:2) <div slot="body">
  13943. function create_body_slot$1(ctx) {
  13944. var div, t, current;
  13945. var requestpanel = new RequestPanel({
  13946. props: {
  13947. description: ctx.request.description,
  13948. headers: ctx.request.headers,
  13949. contentType: ctx.request.contentType,
  13950. example: ctx.request.example,
  13951. schema: ctx.request.schema
  13952. }
  13953. });
  13954. var responsepanel = new ResponsePanel({
  13955. props: {
  13956. title: ctx.response.title,
  13957. description: ctx.response.description,
  13958. statusCode: ctx.response.statusCode,
  13959. headers: ctx.response.headers,
  13960. contentType: ctx.response.contentType,
  13961. example: ctx.response.example,
  13962. schema: ctx.response.schema
  13963. }
  13964. });
  13965. return {
  13966. c() {
  13967. div = element("div");
  13968. requestpanel.$$.fragment.c();
  13969. t = space();
  13970. responsepanel.$$.fragment.c();
  13971. attr(div, "slot", "body");
  13972. },
  13973. m(target, anchor) {
  13974. insert(target, div, anchor);
  13975. mount_component(requestpanel, div, null);
  13976. append(div, t);
  13977. mount_component(responsepanel, div, null);
  13978. current = true;
  13979. },
  13980. p(changed, ctx) {
  13981. var requestpanel_changes = {};
  13982. if (changed.request) requestpanel_changes.description = ctx.request.description;
  13983. if (changed.request) requestpanel_changes.headers = ctx.request.headers;
  13984. if (changed.request) requestpanel_changes.contentType = ctx.request.contentType;
  13985. if (changed.request) requestpanel_changes.example = ctx.request.example;
  13986. if (changed.request) requestpanel_changes.schema = ctx.request.schema;
  13987. requestpanel.$set(requestpanel_changes);
  13988. var responsepanel_changes = {};
  13989. if (changed.response) responsepanel_changes.title = ctx.response.title;
  13990. if (changed.response) responsepanel_changes.description = ctx.response.description;
  13991. if (changed.response) responsepanel_changes.statusCode = ctx.response.statusCode;
  13992. if (changed.response) responsepanel_changes.headers = ctx.response.headers;
  13993. if (changed.response) responsepanel_changes.contentType = ctx.response.contentType;
  13994. if (changed.response) responsepanel_changes.example = ctx.response.example;
  13995. if (changed.response) responsepanel_changes.schema = ctx.response.schema;
  13996. responsepanel.$set(responsepanel_changes);
  13997. },
  13998. i(local) {
  13999. if (current) return;
  14000. transition_in(requestpanel.$$.fragment, local);
  14001. transition_in(responsepanel.$$.fragment, local);
  14002. current = true;
  14003. },
  14004. o(local) {
  14005. transition_out(requestpanel.$$.fragment, local);
  14006. transition_out(responsepanel.$$.fragment, local);
  14007. current = false;
  14008. },
  14009. d(detaching) {
  14010. if (detaching) {
  14011. detach(div);
  14012. }
  14013. destroy_component(requestpanel);
  14014. destroy_component(responsepanel);
  14015. }
  14016. };
  14017. }
  14018. // (29:0) <CollapsiblePanel {show}>
  14019. function create_default_slot$1(ctx) {
  14020. var t, current;
  14021. return {
  14022. c() {
  14023. t = space();
  14024. },
  14025. m(target, anchor) {
  14026. insert(target, t, anchor);
  14027. },
  14028. p: noop,
  14029. i: noop,
  14030. o: noop,
  14031. d(detaching) {
  14032. if (detaching) {
  14033. detach(t);
  14034. }
  14035. }
  14036. };
  14037. }
  14038. function create_fragment$h(ctx) {
  14039. var current;
  14040. var collapsiblepanel = new CollapsiblePanel({
  14041. props: {
  14042. show: ctx.show,
  14043. $$slots: {
  14044. default: [create_default_slot$1],
  14045. body: [create_body_slot$1],
  14046. heading: [create_heading_slot$1]
  14047. },
  14048. $$scope: { ctx }
  14049. }
  14050. });
  14051. return {
  14052. c() {
  14053. collapsiblepanel.$$.fragment.c();
  14054. },
  14055. m(target, anchor) {
  14056. mount_component(collapsiblepanel, target, anchor);
  14057. current = true;
  14058. },
  14059. p(changed, ctx) {
  14060. var collapsiblepanel_changes = {};
  14061. if (changed.show) collapsiblepanel_changes.show = ctx.show;
  14062. if (changed.$$scope || changed.response || changed.request || changed.index) collapsiblepanel_changes.$$scope = { changed, ctx };
  14063. collapsiblepanel.$set(collapsiblepanel_changes);
  14064. },
  14065. i(local) {
  14066. if (current) return;
  14067. transition_in(collapsiblepanel.$$.fragment, local);
  14068. current = true;
  14069. },
  14070. o(local) {
  14071. transition_out(collapsiblepanel.$$.fragment, local);
  14072. current = false;
  14073. },
  14074. d(detaching) {
  14075. destroy_component(collapsiblepanel, detaching);
  14076. }
  14077. };
  14078. }
  14079. function instance$h($$self, $$props, $$invalidate) {
  14080. let { show, count, index, request, response } = $$props;
  14081. function title(index) {
  14082. if (request.title) {
  14083. return `Request ${request.title}`;
  14084. }
  14085. if (count === 1) {
  14086. return "Request";
  14087. } else {
  14088. return `Request ${index + 1}`;
  14089. }
  14090. }
  14091. $$self.$set = $$props => {
  14092. if ('show' in $$props) $$invalidate('show', show = $$props.show);
  14093. if ('count' in $$props) $$invalidate('count', count = $$props.count);
  14094. if ('index' in $$props) $$invalidate('index', index = $$props.index);
  14095. if ('request' in $$props) $$invalidate('request', request = $$props.request);
  14096. if ('response' in $$props) $$invalidate('response', response = $$props.response);
  14097. };
  14098. return {
  14099. show,
  14100. count,
  14101. index,
  14102. request,
  14103. response,
  14104. title
  14105. };
  14106. }
  14107. class ScenarioPanel extends SvelteComponent {
  14108. constructor(options) {
  14109. super();
  14110. init(this, options, instance$h, create_fragment$h, safe_not_equal, ["show", "count", "index", "request", "response"]);
  14111. }
  14112. }
  14113. /* usr/local/lib/node_modules/snowboard/templates/winter.svelte generated by Svelte v3.12.1 */
  14114. const { Object: Object_1, document: document_1 } = globals;
  14115. function add_css$9() {
  14116. var style = element("style");
  14117. style.id = 'svelte-t5bxdu-style';
  14118. style.textContent = ".sidenav.svelte-t5bxdu{padding:1rem 0 1rem 0.75rem}.main.svelte-t5bxdu{padding:3rem;background-color:#fff;box-shadow:0 2px 0 2px #f5f5f5}.breadcrumb-right.svelte-t5bxdu{margin-top:0.3em}.box-wrapper.svelte-t5bxdu{border-radius:0}body{background-color:#fafafa}code[class*=\"language-\"], pre[class*=\"language-\"]{font-family:monospace}.token.number, .token.tag{display:inline;padding:inherit;font-size:inherit;line-height:inherit;text-align:inherit;vertical-align:inherit;border-radius:inherit;font-weight:inherit;white-space:inherit;background:inherit;margin:inherit}.icon-brand.svelte-t5bxdu{margin-right:0.5rem}.menu-collapsible.svelte-t5bxdu{display:none}.footer.svelte-t5bxdu .content.svelte-t5bxdu{transition:margin 0.3s}@media screen and (min-width: 768px){.menu-collapsible.svelte-t5bxdu{display:block;position:fixed;border-top:1px solid #eee;width:calc(25% - 0.5rem);height:calc(2.5rem + 10px);left:0;bottom:0;font-size:1.33333em;line-height:calc(2.5rem + 5px);text-align:center;color:#b5b5b5;font-weight:300;box-shadow:2px 0 0 #f5f5f5;cursor:pointer}.menu-collapsible.svelte-t5bxdu:hover{background:rgba(0, 0, 0, 0.05);box-shadow:2px 0 0 #eee;border-color:#e8e8e8}.is-collapsed.svelte-t5bxdu .sidenav.svelte-t5bxdu{width:3.75rem}.is-collapsed.svelte-t5bxdu .main.svelte-t5bxdu{width:calc(100% - 4.5rem)}.is-collapsed.svelte-t5bxdu .menu-collapsible.svelte-t5bxdu{width:calc(3rem - 2px)}.menu-collapsible.svelte-t5bxdu,.sidenav.svelte-t5bxdu,.main.svelte-t5bxdu{transition:width 0.3s}}";
  14119. append(document_1.head, style);
  14120. }
  14121. function get_each_context$6(ctx, list, i) {
  14122. const child_ctx = Object_1.create(ctx);
  14123. child_ctx.request = list[i].request;
  14124. child_ctx.response = list[i].response;
  14125. child_ctx.index = i;
  14126. return child_ctx;
  14127. }
  14128. function get_each_context_1$2(ctx, list, i) {
  14129. const child_ctx = Object_1.create(ctx);
  14130. child_ctx.tag = list[i];
  14131. return child_ctx;
  14132. }
  14133. // (311:6) {#if config.playground.enabled}
  14134. function create_if_block_6$1(ctx) {
  14135. var current;
  14136. var selectorpanel = new SelectorPanel({
  14137. props: {
  14138. environments: ctx.config.playground.environments,
  14139. authenticating: ctx.authenticating
  14140. }
  14141. });
  14142. return {
  14143. c() {
  14144. selectorpanel.$$.fragment.c();
  14145. },
  14146. m(target, anchor) {
  14147. mount_component(selectorpanel, target, anchor);
  14148. current = true;
  14149. },
  14150. p(changed, ctx) {
  14151. var selectorpanel_changes = {};
  14152. if (changed.config) selectorpanel_changes.environments = ctx.config.playground.environments;
  14153. if (changed.authenticating) selectorpanel_changes.authenticating = ctx.authenticating;
  14154. selectorpanel.$set(selectorpanel_changes);
  14155. },
  14156. i(local) {
  14157. if (current) return;
  14158. transition_in(selectorpanel.$$.fragment, local);
  14159. current = true;
  14160. },
  14161. o(local) {
  14162. transition_out(selectorpanel.$$.fragment, local);
  14163. current = false;
  14164. },
  14165. d(detaching) {
  14166. destroy_component(selectorpanel, detaching);
  14167. }
  14168. };
  14169. }
  14170. // (336:6) {#if collapsed}
  14171. function create_if_block_5$1(ctx) {
  14172. var span;
  14173. return {
  14174. c() {
  14175. span = element("span");
  14176. span.textContent = "»";
  14177. attr(span, "class", "icon");
  14178. attr(span, "title", "Expand [");
  14179. },
  14180. m(target, anchor) {
  14181. insert(target, span, anchor);
  14182. },
  14183. d(detaching) {
  14184. if (detaching) {
  14185. detach(span);
  14186. }
  14187. }
  14188. };
  14189. }
  14190. // (339:6) {#if !collapsed}
  14191. function create_if_block_4$1(ctx) {
  14192. var span0, t_1, span1;
  14193. return {
  14194. c() {
  14195. span0 = element("span");
  14196. span0.textContent = "«";
  14197. t_1 = space();
  14198. span1 = element("span");
  14199. span1.textContent = "Collapse sidebar";
  14200. attr(span0, "class", "icon");
  14201. attr(span1, "class", "fa-xs");
  14202. },
  14203. m(target, anchor) {
  14204. insert(target, span0, anchor);
  14205. insert(target, t_1, anchor);
  14206. insert(target, span1, anchor);
  14207. },
  14208. d(detaching) {
  14209. if (detaching) {
  14210. detach(span0);
  14211. detach(t_1);
  14212. detach(span1);
  14213. }
  14214. }
  14215. };
  14216. }
  14217. // (347:4) {#if index === -1}
  14218. function create_if_block_3$2(ctx) {
  14219. var div, raw_value = markdown(ctx.description) + "";
  14220. return {
  14221. c() {
  14222. div = element("div");
  14223. attr(div, "class", "content");
  14224. },
  14225. m(target, anchor) {
  14226. insert(target, div, anchor);
  14227. div.innerHTML = raw_value;
  14228. },
  14229. p(changed, ctx) {
  14230. if ((changed.description) && raw_value !== (raw_value = markdown(ctx.description) + "")) {
  14231. div.innerHTML = raw_value;
  14232. }
  14233. },
  14234. d(detaching) {
  14235. if (detaching) {
  14236. detach(div);
  14237. }
  14238. }
  14239. };
  14240. }
  14241. // (353:4) {#if currentAction}
  14242. function create_if_block$b(ctx) {
  14243. var div2, div0, h1, t0_value = ctx.currentAction.title + "", t0, t1, div1, nav, ul, t2, hr, t3, div3, code0, t4_value = ctx.currentAction.method + "", t4, code0_class_value, t5, code1, t6_value = ctx.currentAction.pathTemplate + "", t6, t7, div4, raw_value = markdown(ctx.currentAction.description) + "", t8, t9, t10, each1_anchor, current;
  14244. let each_value_1 = ctx.currentAction.tags;
  14245. let each_blocks_1 = [];
  14246. for (let i = 0; i < each_value_1.length; i += 1) {
  14247. each_blocks_1[i] = create_each_block_1$2(get_each_context_1$2(ctx, each_value_1, i));
  14248. }
  14249. var if_block = (ctx.config.playground.enabled) && create_if_block_1$8(ctx);
  14250. var parameterpanel = new ParameterPanel({ props: { parameters: ctx.currentAction.parameters } });
  14251. let each_value = ctx.currentAction.transactions;
  14252. let each_blocks = [];
  14253. for (let i = 0; i < each_value.length; i += 1) {
  14254. each_blocks[i] = create_each_block$6(get_each_context$6(ctx, each_value, i));
  14255. }
  14256. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  14257. each_blocks[i] = null;
  14258. });
  14259. return {
  14260. c() {
  14261. div2 = element("div");
  14262. div0 = element("div");
  14263. h1 = element("h1");
  14264. t0 = text(t0_value);
  14265. t1 = space();
  14266. div1 = element("div");
  14267. nav = element("nav");
  14268. ul = element("ul");
  14269. for (let i = 0; i < each_blocks_1.length; i += 1) {
  14270. each_blocks_1[i].c();
  14271. }
  14272. t2 = space();
  14273. hr = element("hr");
  14274. t3 = space();
  14275. div3 = element("div");
  14276. code0 = element("code");
  14277. t4 = text(t4_value);
  14278. t5 = space();
  14279. code1 = element("code");
  14280. t6 = text(t6_value);
  14281. t7 = space();
  14282. div4 = element("div");
  14283. t8 = space();
  14284. if (if_block) if_block.c();
  14285. t9 = space();
  14286. parameterpanel.$$.fragment.c();
  14287. t10 = space();
  14288. for (let i = 0; i < each_blocks.length; i += 1) {
  14289. each_blocks[i].c();
  14290. }
  14291. each1_anchor = empty();
  14292. attr(h1, "class", "title is-4");
  14293. attr(div0, "class", "column");
  14294. attr(nav, "class", "breadcrumb breadcrumb-right is-pulled-right svelte-t5bxdu");
  14295. attr(nav, "aria-label", "breadcrumbs");
  14296. attr(div1, "class", "column");
  14297. attr(div2, "class", "columns");
  14298. attr(code0, "class", code0_class_value = "tag is-uppercase " + colorize(ctx.currentAction.method) + " svelte-t5bxdu");
  14299. attr(code1, "class", "tag ");
  14300. attr(div3, "class", "tags has-addons are-large");
  14301. attr(div4, "class", "content");
  14302. },
  14303. m(target, anchor) {
  14304. insert(target, div2, anchor);
  14305. append(div2, div0);
  14306. append(div0, h1);
  14307. append(h1, t0);
  14308. append(div2, t1);
  14309. append(div2, div1);
  14310. append(div1, nav);
  14311. append(nav, ul);
  14312. for (let i = 0; i < each_blocks_1.length; i += 1) {
  14313. each_blocks_1[i].m(ul, null);
  14314. }
  14315. insert(target, t2, anchor);
  14316. insert(target, hr, anchor);
  14317. insert(target, t3, anchor);
  14318. insert(target, div3, anchor);
  14319. append(div3, code0);
  14320. append(code0, t4);
  14321. append(div3, t5);
  14322. append(div3, code1);
  14323. append(code1, t6);
  14324. insert(target, t7, anchor);
  14325. insert(target, div4, anchor);
  14326. div4.innerHTML = raw_value;
  14327. insert(target, t8, anchor);
  14328. if (if_block) if_block.m(target, anchor);
  14329. insert(target, t9, anchor);
  14330. mount_component(parameterpanel, target, anchor);
  14331. insert(target, t10, anchor);
  14332. for (let i = 0; i < each_blocks.length; i += 1) {
  14333. each_blocks[i].m(target, anchor);
  14334. }
  14335. insert(target, each1_anchor, anchor);
  14336. current = true;
  14337. },
  14338. p(changed, ctx) {
  14339. if ((!current || changed.currentAction) && t0_value !== (t0_value = ctx.currentAction.title + "")) {
  14340. set_data(t0, t0_value);
  14341. }
  14342. if (changed.currentAction) {
  14343. each_value_1 = ctx.currentAction.tags;
  14344. let i;
  14345. for (i = 0; i < each_value_1.length; i += 1) {
  14346. const child_ctx = get_each_context_1$2(ctx, each_value_1, i);
  14347. if (each_blocks_1[i]) {
  14348. each_blocks_1[i].p(changed, child_ctx);
  14349. } else {
  14350. each_blocks_1[i] = create_each_block_1$2(child_ctx);
  14351. each_blocks_1[i].c();
  14352. each_blocks_1[i].m(ul, null);
  14353. }
  14354. }
  14355. for (; i < each_blocks_1.length; i += 1) {
  14356. each_blocks_1[i].d(1);
  14357. }
  14358. each_blocks_1.length = each_value_1.length;
  14359. }
  14360. if ((!current || changed.currentAction) && t4_value !== (t4_value = ctx.currentAction.method + "")) {
  14361. set_data(t4, t4_value);
  14362. }
  14363. if ((!current || changed.currentAction) && code0_class_value !== (code0_class_value = "tag is-uppercase " + colorize(ctx.currentAction.method) + " svelte-t5bxdu")) {
  14364. attr(code0, "class", code0_class_value);
  14365. }
  14366. if ((!current || changed.currentAction) && t6_value !== (t6_value = ctx.currentAction.pathTemplate + "")) {
  14367. set_data(t6, t6_value);
  14368. }
  14369. if ((!current || changed.currentAction) && raw_value !== (raw_value = markdown(ctx.currentAction.description) + "")) {
  14370. div4.innerHTML = raw_value;
  14371. }
  14372. if (ctx.config.playground.enabled) {
  14373. if (if_block) {
  14374. if_block.p(changed, ctx);
  14375. transition_in(if_block, 1);
  14376. } else {
  14377. if_block = create_if_block_1$8(ctx);
  14378. if_block.c();
  14379. transition_in(if_block, 1);
  14380. if_block.m(t9.parentNode, t9);
  14381. }
  14382. } else if (if_block) {
  14383. group_outros();
  14384. transition_out(if_block, 1, 1, () => {
  14385. if_block = null;
  14386. });
  14387. check_outros();
  14388. }
  14389. var parameterpanel_changes = {};
  14390. if (changed.currentAction) parameterpanel_changes.parameters = ctx.currentAction.parameters;
  14391. parameterpanel.$set(parameterpanel_changes);
  14392. if (changed.currentAction) {
  14393. each_value = ctx.currentAction.transactions;
  14394. let i;
  14395. for (i = 0; i < each_value.length; i += 1) {
  14396. const child_ctx = get_each_context$6(ctx, each_value, i);
  14397. if (each_blocks[i]) {
  14398. each_blocks[i].p(changed, child_ctx);
  14399. transition_in(each_blocks[i], 1);
  14400. } else {
  14401. each_blocks[i] = create_each_block$6(child_ctx);
  14402. each_blocks[i].c();
  14403. transition_in(each_blocks[i], 1);
  14404. each_blocks[i].m(each1_anchor.parentNode, each1_anchor);
  14405. }
  14406. }
  14407. group_outros();
  14408. for (i = each_value.length; i < each_blocks.length; i += 1) {
  14409. out(i);
  14410. }
  14411. check_outros();
  14412. }
  14413. },
  14414. i(local) {
  14415. if (current) return;
  14416. transition_in(if_block);
  14417. transition_in(parameterpanel.$$.fragment, local);
  14418. for (let i = 0; i < each_value.length; i += 1) {
  14419. transition_in(each_blocks[i]);
  14420. }
  14421. current = true;
  14422. },
  14423. o(local) {
  14424. transition_out(if_block);
  14425. transition_out(parameterpanel.$$.fragment, local);
  14426. each_blocks = each_blocks.filter(Boolean);
  14427. for (let i = 0; i < each_blocks.length; i += 1) {
  14428. transition_out(each_blocks[i]);
  14429. }
  14430. current = false;
  14431. },
  14432. d(detaching) {
  14433. if (detaching) {
  14434. detach(div2);
  14435. }
  14436. destroy_each(each_blocks_1, detaching);
  14437. if (detaching) {
  14438. detach(t2);
  14439. detach(hr);
  14440. detach(t3);
  14441. detach(div3);
  14442. detach(t7);
  14443. detach(div4);
  14444. detach(t8);
  14445. }
  14446. if (if_block) if_block.d(detaching);
  14447. if (detaching) {
  14448. detach(t9);
  14449. }
  14450. destroy_component(parameterpanel, detaching);
  14451. if (detaching) {
  14452. detach(t10);
  14453. }
  14454. destroy_each(each_blocks, detaching);
  14455. if (detaching) {
  14456. detach(each1_anchor);
  14457. }
  14458. }
  14459. };
  14460. }
  14461. // (363:14) {#each currentAction.tags as tag}
  14462. function create_each_block_1$2(ctx) {
  14463. var li, a, t0_value = ctx.tag + "", t0, t1;
  14464. return {
  14465. c() {
  14466. li = element("li");
  14467. a = element("a");
  14468. t0 = text(t0_value);
  14469. t1 = space();
  14470. attr(a, "href", "javascript:void(0)");
  14471. },
  14472. m(target, anchor) {
  14473. insert(target, li, anchor);
  14474. append(li, a);
  14475. append(a, t0);
  14476. append(li, t1);
  14477. },
  14478. p(changed, ctx) {
  14479. if ((changed.currentAction) && t0_value !== (t0_value = ctx.tag + "")) {
  14480. set_data(t0, t0_value);
  14481. }
  14482. },
  14483. d(detaching) {
  14484. if (detaching) {
  14485. detach(li);
  14486. }
  14487. }
  14488. };
  14489. }
  14490. // (386:6) {#if config.playground.enabled}
  14491. function create_if_block_1$8(ctx) {
  14492. var if_block_anchor, current;
  14493. var if_block = (ctx.environment.playground !== false) && create_if_block_2$4(ctx);
  14494. return {
  14495. c() {
  14496. if (if_block) if_block.c();
  14497. if_block_anchor = empty();
  14498. },
  14499. m(target, anchor) {
  14500. if (if_block) if_block.m(target, anchor);
  14501. insert(target, if_block_anchor, anchor);
  14502. current = true;
  14503. },
  14504. p(changed, ctx) {
  14505. if (ctx.environment.playground !== false) {
  14506. if (if_block) {
  14507. if_block.p(changed, ctx);
  14508. transition_in(if_block, 1);
  14509. } else {
  14510. if_block = create_if_block_2$4(ctx);
  14511. if_block.c();
  14512. transition_in(if_block, 1);
  14513. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  14514. }
  14515. } else if (if_block) {
  14516. group_outros();
  14517. transition_out(if_block, 1, 1, () => {
  14518. if_block = null;
  14519. });
  14520. check_outros();
  14521. }
  14522. },
  14523. i(local) {
  14524. if (current) return;
  14525. transition_in(if_block);
  14526. current = true;
  14527. },
  14528. o(local) {
  14529. transition_out(if_block);
  14530. current = false;
  14531. },
  14532. d(detaching) {
  14533. if (if_block) if_block.d(detaching);
  14534. if (detaching) {
  14535. detach(if_block_anchor);
  14536. }
  14537. }
  14538. };
  14539. }
  14540. // (387:8) {#if environment.playground !== false}
  14541. function create_if_block_2$4(ctx) {
  14542. var current;
  14543. var playgroundpanel = new PlaygroundPanel({
  14544. props: {
  14545. currentAction: ctx.currentAction,
  14546. environments: ctx.config.playground.environments,
  14547. currentSample: sample(ctx.currentAction),
  14548. requestHeaders: headersMap(ctx.currentAction),
  14549. requestParameters: parametersMap(ctx.currentAction),
  14550. requestBody: bodyMap(ctx.currentAction)
  14551. }
  14552. });
  14553. return {
  14554. c() {
  14555. playgroundpanel.$$.fragment.c();
  14556. },
  14557. m(target, anchor) {
  14558. mount_component(playgroundpanel, target, anchor);
  14559. current = true;
  14560. },
  14561. p(changed, ctx) {
  14562. var playgroundpanel_changes = {};
  14563. if (changed.currentAction) playgroundpanel_changes.currentAction = ctx.currentAction;
  14564. if (changed.config) playgroundpanel_changes.environments = ctx.config.playground.environments;
  14565. if (changed.currentAction) playgroundpanel_changes.currentSample = sample(ctx.currentAction);
  14566. if (changed.currentAction) playgroundpanel_changes.requestHeaders = headersMap(ctx.currentAction);
  14567. if (changed.currentAction) playgroundpanel_changes.requestParameters = parametersMap(ctx.currentAction);
  14568. if (changed.currentAction) playgroundpanel_changes.requestBody = bodyMap(ctx.currentAction);
  14569. playgroundpanel.$set(playgroundpanel_changes);
  14570. },
  14571. i(local) {
  14572. if (current) return;
  14573. transition_in(playgroundpanel.$$.fragment, local);
  14574. current = true;
  14575. },
  14576. o(local) {
  14577. transition_out(playgroundpanel.$$.fragment, local);
  14578. current = false;
  14579. },
  14580. d(detaching) {
  14581. destroy_component(playgroundpanel, detaching);
  14582. }
  14583. };
  14584. }
  14585. // (400:6) {#each currentAction.transactions as { request, response }
  14586. function create_each_block$6(ctx) {
  14587. var current;
  14588. var scenariopanel = new ScenarioPanel({
  14589. props: {
  14590. show: ctx.index === 0,
  14591. request: ctx.request,
  14592. response: ctx.response,
  14593. index: ctx.index,
  14594. count: ctx.currentAction.transactions.length
  14595. }
  14596. });
  14597. return {
  14598. c() {
  14599. scenariopanel.$$.fragment.c();
  14600. },
  14601. m(target, anchor) {
  14602. mount_component(scenariopanel, target, anchor);
  14603. current = true;
  14604. },
  14605. p(changed, ctx) {
  14606. var scenariopanel_changes = {};
  14607. if (changed.currentAction) scenariopanel_changes.request = ctx.request;
  14608. if (changed.currentAction) scenariopanel_changes.response = ctx.response;
  14609. if (changed.currentAction) scenariopanel_changes.count = ctx.currentAction.transactions.length;
  14610. scenariopanel.$set(scenariopanel_changes);
  14611. },
  14612. i(local) {
  14613. if (current) return;
  14614. transition_in(scenariopanel.$$.fragment, local);
  14615. current = true;
  14616. },
  14617. o(local) {
  14618. transition_out(scenariopanel.$$.fragment, local);
  14619. current = false;
  14620. },
  14621. d(detaching) {
  14622. destroy_component(scenariopanel, detaching);
  14623. }
  14624. };
  14625. }
  14626. function create_fragment$i(ctx) {
  14627. var nav, div0, a0, span0, t0, span1, t1, t2, a1, t5, div2, div1, t6, div6, div4, t7, div3, t8, t9, div5, t10, t11, footer, div7, p, strong, t12, t13, a2, current, dispose;
  14628. var if_block0 = (ctx.config.playground.enabled) && create_if_block_6$1(ctx);
  14629. var menupanel = new MenuPanel({
  14630. props: {
  14631. tagActions: ctx.tagActions,
  14632. tagHeaders: toc(ctx.description),
  14633. currentSlug: ctx.currentAction && ctx.currentAction.slug,
  14634. actionsCount: ctx.actions.length,
  14635. isCollapsed: ctx.collapsed,
  14636. config: ctx.config,
  14637. handleClick: ctx.handleClick,
  14638. tocClick: ctx.tocClick,
  14639. searchClick: ctx.searchClick
  14640. }
  14641. });
  14642. var if_block1 = (ctx.collapsed) && create_if_block_5$1(ctx);
  14643. var if_block2 = (!ctx.collapsed) && create_if_block_4$1(ctx);
  14644. var if_block3 = (ctx.index === -1) && create_if_block_3$2(ctx);
  14645. var if_block4 = (ctx.currentAction) && create_if_block$b(ctx);
  14646. return {
  14647. c() {
  14648. nav = element("nav");
  14649. div0 = element("div");
  14650. a0 = element("a");
  14651. span0 = element("span");
  14652. span0.innerHTML = `<i class="fas fa-lg fa-chalkboard"></i>`;
  14653. t0 = space();
  14654. span1 = element("span");
  14655. t1 = text(ctx.title);
  14656. t2 = space();
  14657. a1 = element("a");
  14658. a1.innerHTML = `<span aria-hidden="true"></span> <span aria-hidden="true"></span> <span aria-hidden="true"></span>`;
  14659. t5 = space();
  14660. div2 = element("div");
  14661. div1 = element("div");
  14662. if (if_block0) if_block0.c();
  14663. t6 = space();
  14664. div6 = element("div");
  14665. div4 = element("div");
  14666. menupanel.$$.fragment.c();
  14667. t7 = space();
  14668. div3 = element("div");
  14669. if (if_block1) if_block1.c();
  14670. t8 = space();
  14671. if (if_block2) if_block2.c();
  14672. t9 = space();
  14673. div5 = element("div");
  14674. if (if_block3) if_block3.c();
  14675. t10 = space();
  14676. if (if_block4) if_block4.c();
  14677. t11 = space();
  14678. footer = element("footer");
  14679. div7 = element("div");
  14680. p = element("p");
  14681. strong = element("strong");
  14682. t12 = text(ctx.title);
  14683. t13 = text("\n powered by\n ");
  14684. a2 = element("a");
  14685. a2.innerHTML = `<strong>Snowboard.</strong>`;
  14686. attr(span0, "class", "icon icon-brand is-medium has-text-grey-light svelte-t5bxdu");
  14687. attr(span1, "class", "title is-4");
  14688. attr(a0, "href", "javascript:void(0)");
  14689. attr(a0, "class", "navbar-item");
  14690. attr(a1, "href", "javascript:void(0)");
  14691. attr(a1, "role", "button");
  14692. attr(a1, "class", "navbar-burger");
  14693. attr(a1, "aria-label", "menu");
  14694. attr(a1, "aria-expanded", "false");
  14695. attr(a1, "data-target", "mainnav");
  14696. attr(div0, "class", "navbar-brand");
  14697. attr(div1, "class", "navbar-end");
  14698. attr(div2, "class", "navbar-menu");
  14699. attr(nav, "class", "navbar is-fixed-top has-shadow");
  14700. attr(nav, "role", "navigation");
  14701. attr(nav, "aria-label", "main navigation");
  14702. attr(div3, "class", "menu-collapsible svelte-t5bxdu");
  14703. attr(div4, "class", "column is-one-quarter sidenav svelte-t5bxdu");
  14704. attr(div4, "id", "mainnav");
  14705. toggle_class(div4, "is-hidden-mobile", ctx.showMenu);
  14706. attr(div5, "class", "column is-three-quarters main svelte-t5bxdu");
  14707. attr(div6, "class", "columns svelte-t5bxdu");
  14708. toggle_class(div6, "is-collapsed", ctx.collapsed);
  14709. attr(a2, "href", "https://github.com/bukalapak/snowboard");
  14710. attr(a2, "target", "_blank");
  14711. attr(div7, "class", "content column is-paddingless has-text-centered svelte-t5bxdu");
  14712. toggle_class(div7, "is-offset-one-quarter", !ctx.collapsed);
  14713. attr(footer, "class", "footer svelte-t5bxdu");
  14714. dispose = [
  14715. listen(a1, "click", ctx.burgerClick),
  14716. listen(div3, "click", ctx.collapseToggle)
  14717. ];
  14718. },
  14719. m(target, anchor) {
  14720. insert(target, nav, anchor);
  14721. append(nav, div0);
  14722. append(div0, a0);
  14723. append(a0, span0);
  14724. append(a0, t0);
  14725. append(a0, span1);
  14726. append(span1, t1);
  14727. append(div0, t2);
  14728. append(div0, a1);
  14729. append(nav, t5);
  14730. append(nav, div2);
  14731. append(div2, div1);
  14732. if (if_block0) if_block0.m(div1, null);
  14733. insert(target, t6, anchor);
  14734. insert(target, div6, anchor);
  14735. append(div6, div4);
  14736. mount_component(menupanel, div4, null);
  14737. append(div4, t7);
  14738. append(div4, div3);
  14739. if (if_block1) if_block1.m(div3, null);
  14740. append(div3, t8);
  14741. if (if_block2) if_block2.m(div3, null);
  14742. append(div6, t9);
  14743. append(div6, div5);
  14744. if (if_block3) if_block3.m(div5, null);
  14745. append(div5, t10);
  14746. if (if_block4) if_block4.m(div5, null);
  14747. insert(target, t11, anchor);
  14748. insert(target, footer, anchor);
  14749. append(footer, div7);
  14750. append(div7, p);
  14751. append(p, strong);
  14752. append(strong, t12);
  14753. append(p, t13);
  14754. append(p, a2);
  14755. current = true;
  14756. },
  14757. p(changed, ctx) {
  14758. if (!current || changed.title) {
  14759. set_data(t1, ctx.title);
  14760. }
  14761. if (ctx.config.playground.enabled) {
  14762. if (if_block0) {
  14763. if_block0.p(changed, ctx);
  14764. transition_in(if_block0, 1);
  14765. } else {
  14766. if_block0 = create_if_block_6$1(ctx);
  14767. if_block0.c();
  14768. transition_in(if_block0, 1);
  14769. if_block0.m(div1, null);
  14770. }
  14771. } else if (if_block0) {
  14772. group_outros();
  14773. transition_out(if_block0, 1, 1, () => {
  14774. if_block0 = null;
  14775. });
  14776. check_outros();
  14777. }
  14778. var menupanel_changes = {};
  14779. if (changed.tagActions) menupanel_changes.tagActions = ctx.tagActions;
  14780. if (changed.description) menupanel_changes.tagHeaders = toc(ctx.description);
  14781. if (changed.currentAction) menupanel_changes.currentSlug = ctx.currentAction && ctx.currentAction.slug;
  14782. if (changed.actions) menupanel_changes.actionsCount = ctx.actions.length;
  14783. if (changed.collapsed) menupanel_changes.isCollapsed = ctx.collapsed;
  14784. if (changed.config) menupanel_changes.config = ctx.config;
  14785. menupanel.$set(menupanel_changes);
  14786. if (ctx.collapsed) {
  14787. if (!if_block1) {
  14788. if_block1 = create_if_block_5$1(ctx);
  14789. if_block1.c();
  14790. if_block1.m(div3, t8);
  14791. }
  14792. } else if (if_block1) {
  14793. if_block1.d(1);
  14794. if_block1 = null;
  14795. }
  14796. if (!ctx.collapsed) {
  14797. if (!if_block2) {
  14798. if_block2 = create_if_block_4$1(ctx);
  14799. if_block2.c();
  14800. if_block2.m(div3, null);
  14801. }
  14802. } else if (if_block2) {
  14803. if_block2.d(1);
  14804. if_block2 = null;
  14805. }
  14806. if (changed.showMenu) {
  14807. toggle_class(div4, "is-hidden-mobile", ctx.showMenu);
  14808. }
  14809. if (ctx.index === -1) {
  14810. if (if_block3) {
  14811. if_block3.p(changed, ctx);
  14812. } else {
  14813. if_block3 = create_if_block_3$2(ctx);
  14814. if_block3.c();
  14815. if_block3.m(div5, t10);
  14816. }
  14817. } else if (if_block3) {
  14818. if_block3.d(1);
  14819. if_block3 = null;
  14820. }
  14821. if (ctx.currentAction) {
  14822. if (if_block4) {
  14823. if_block4.p(changed, ctx);
  14824. transition_in(if_block4, 1);
  14825. } else {
  14826. if_block4 = create_if_block$b(ctx);
  14827. if_block4.c();
  14828. transition_in(if_block4, 1);
  14829. if_block4.m(div5, null);
  14830. }
  14831. } else if (if_block4) {
  14832. group_outros();
  14833. transition_out(if_block4, 1, 1, () => {
  14834. if_block4 = null;
  14835. });
  14836. check_outros();
  14837. }
  14838. if (changed.collapsed) {
  14839. toggle_class(div6, "is-collapsed", ctx.collapsed);
  14840. }
  14841. if (!current || changed.title) {
  14842. set_data(t12, ctx.title);
  14843. }
  14844. if (changed.collapsed) {
  14845. toggle_class(div7, "is-offset-one-quarter", !ctx.collapsed);
  14846. }
  14847. },
  14848. i(local) {
  14849. if (current) return;
  14850. transition_in(if_block0);
  14851. transition_in(menupanel.$$.fragment, local);
  14852. transition_in(if_block4);
  14853. current = true;
  14854. },
  14855. o(local) {
  14856. transition_out(if_block0);
  14857. transition_out(menupanel.$$.fragment, local);
  14858. transition_out(if_block4);
  14859. current = false;
  14860. },
  14861. d(detaching) {
  14862. if (detaching) {
  14863. detach(nav);
  14864. }
  14865. if (if_block0) if_block0.d();
  14866. if (detaching) {
  14867. detach(t6);
  14868. detach(div6);
  14869. }
  14870. destroy_component(menupanel);
  14871. if (if_block1) if_block1.d();
  14872. if (if_block2) if_block2.d();
  14873. if (if_block3) if_block3.d();
  14874. if (if_block4) if_block4.d();
  14875. if (detaching) {
  14876. detach(t11);
  14877. detach(footer);
  14878. }
  14879. run_all(dispose);
  14880. }
  14881. };
  14882. }
  14883. function sample(action) {
  14884. return action.transactions[0].request;
  14885. }
  14886. function headersMap(action) {
  14887. return sample(action)
  14888. .headers.filter(header => header.name != "Authorization")
  14889. .map(header => {
  14890. return {
  14891. used: true,
  14892. required: false,
  14893. name: header.name,
  14894. value: header.example || ""
  14895. };
  14896. });
  14897. }
  14898. function parametersMap(action) {
  14899. return action.parameters.map(param => {
  14900. return {
  14901. used: param.required,
  14902. required: param.required,
  14903. name: param.name,
  14904. value: param.example || ""
  14905. };
  14906. });
  14907. }
  14908. function bodyMap(action) {
  14909. const example = sample(action).example;
  14910. return stringify$2(example);
  14911. }
  14912. function instance$i($$self, $$props, $$invalidate) {
  14913. let $env;
  14914. component_subscribe($$self, env, $$value => { $env = $$value; $$invalidate('$env', $env); });
  14915. let { title, description, actions, tagActions, config } = $$props;
  14916. let index = -1;
  14917. function handleClick(event) {
  14918. let target = event.target;
  14919. if (target.nodeName == "SPAN") {
  14920. target = target.parentElement;
  14921. }
  14922. const slug = target.dataset["slug"];
  14923. $$invalidate('index', index = actions.findIndex(el => el.slug === slug));
  14924. document.body.scrollTop = document.documentElement.scrollTop = 0;
  14925. }
  14926. function tocClick(event) {
  14927. $$invalidate('index', index = -1);
  14928. let href = event.target.getAttribute("href");
  14929. pushHistory(href);
  14930. }
  14931. if (config.playground.enabled) {
  14932. const savedEnv = getEnv();
  14933. if (
  14934. savedEnv &&
  14935. Object.keys(config.playground.environments).includes(savedEnv)
  14936. ) {
  14937. env.set(savedEnv);
  14938. } else {
  14939. env.set(config.playground.env);
  14940. }
  14941. const authToken = getToken($env);
  14942. if (authToken) {
  14943. auth.add($env);
  14944. token.set(authToken);
  14945. }
  14946. }
  14947. let showMenu = true;
  14948. let collapsed = false;
  14949. let authenticating = false;
  14950. function burgerClick() {
  14951. $$invalidate('showMenu', showMenu = !showMenu);
  14952. }
  14953. function collapseToggle() {
  14954. $$invalidate('collapsed', collapsed = !collapsed);
  14955. }
  14956. function searchClick() {
  14957. collapseToggle();
  14958. const searchInput = document.getElementById("search-input-text");
  14959. if (searchInput) {
  14960. searchInput.focus();
  14961. }
  14962. }
  14963. onMount(async () => {
  14964. // handle oauth2 callback
  14965. if (isAuth(environment, "oauth2")) {
  14966. const authParam = querystringify_1.parse(location.search);
  14967. if (authParam.code) {
  14968. $$invalidate('authenticating', authenticating = true);
  14969. pushHistory(basePath(config));
  14970. const { accessToken, refreshToken } = await exchangeToken(
  14971. authParam.code,
  14972. environment.auth.options
  14973. );
  14974. if (accessToken) {
  14975. setToken($env, accessToken);
  14976. auth.add($env);
  14977. token.set(accessToken);
  14978. if (refreshToken) {
  14979. setRefreshToken($env, refreshToken);
  14980. }
  14981. }
  14982. $$invalidate('authenticating', authenticating = false);
  14983. }
  14984. }
  14985. // handle permalink
  14986. const hash = location.hash;
  14987. if (hash.match("#/")) {
  14988. const slug = hash.replace("#/", "");
  14989. $$invalidate('index', index = actions.findIndex(el => el.slug === slug));
  14990. }
  14991. });
  14992. document.onkeyup = function(e) {
  14993. if ((e.which || e.keyCode) == 219) {
  14994. collapseToggle();
  14995. }
  14996. };
  14997. $$self.$set = $$props => {
  14998. if ('title' in $$props) $$invalidate('title', title = $$props.title);
  14999. if ('description' in $$props) $$invalidate('description', description = $$props.description);
  15000. if ('actions' in $$props) $$invalidate('actions', actions = $$props.actions);
  15001. if ('tagActions' in $$props) $$invalidate('tagActions', tagActions = $$props.tagActions);
  15002. if ('config' in $$props) $$invalidate('config', config = $$props.config);
  15003. };
  15004. let currentAction, environment;
  15005. $$self.$$.update = ($$dirty = { actions: 1, index: 1, currentAction: 1, title: 1, config: 1, $env: 1 }) => {
  15006. if ($$dirty.actions || $$dirty.index) { $$invalidate('currentAction', currentAction = actions[index]); }
  15007. if ($$dirty.currentAction || $$dirty.title) { {
  15008. document.title =
  15009. (currentAction && `${currentAction.title} - ${title}`) || title;
  15010. } }
  15011. if ($$dirty.config || $$dirty.$env) { $$invalidate('environment', environment =
  15012. config.playground.enabled && config.playground.environments[$env]); }
  15013. };
  15014. return {
  15015. title,
  15016. description,
  15017. actions,
  15018. tagActions,
  15019. config,
  15020. index,
  15021. handleClick,
  15022. tocClick,
  15023. showMenu,
  15024. collapsed,
  15025. authenticating,
  15026. burgerClick,
  15027. collapseToggle,
  15028. searchClick,
  15029. currentAction,
  15030. environment
  15031. };
  15032. }
  15033. class Winter extends SvelteComponent {
  15034. constructor(options) {
  15035. super();
  15036. if (!document_1.getElementById("svelte-t5bxdu-style")) add_css$9();
  15037. init(this, options, instance$i, create_fragment$i, safe_not_equal, ["title", "description", "actions", "tagActions", "config"]);
  15038. }
  15039. }
  15040. const app = new Winter({
  15041. target: document.body,
  15042. props: {"title":"mailcow API","description":"mailcow is complete e-mailing solution with advanced antispam, antivirus, nice UI and API.\n\nIn order to use this API you have to create a API key and add your IP address to the whitelist of allowed IPs this can be done by logging into the Mailcow UI using your admin account, then go to Configuration > Access > Edit administrator details > API. There you will find a collapsed API menu.\n\n**This documentation is in Work In Progress status. It contains only few endpoints.**","version":"","servers":[{"url":"https://mailcow.host/"}],"tags":[{"title":"Domains","description":"","children":[{"title":"Get domains","description":"","children":[]},{"title":"Create domain","description":"","children":[]},{"title":"Update domain","description":"","children":[]},{"title":"Delete domain","description":"","children":[]}]},{"title":"Domain antispam policies","description":"You can create antispam whitelist and blacklist policies","children":[{"title":"List whitelist domain policy","description":"","children":[]},{"title":"List blacklist domain policy","description":"","children":[]},{"title":"Create domain policy","description":"","children":[]},{"title":"Delete domain policy","description":"","children":[]}]},{"title":"Mailboxes","description":"","children":[{"title":"Get mailboxes","description":"","children":[]},{"title":"Create mailbox","description":"","children":[]},{"title":"Update mailbox","description":"","children":[]},{"title":"Delete mailbox","description":"","children":[]},{"title":"Quarantine Notifications","description":"","children":[]}]},{"title":"Aliases","description":"","children":[{"title":"GET aliases","description":"","children":[]},{"title":"Create alias","description":"","children":[]},{"title":"Update alias","description":"","children":[]},{"title":"Delete alias","description":"","children":[]}]},{"title":"Sync jobs","description":"","children":[{"title":"Get sync jobs","description":"","children":[]},{"title":"Create sync job","description":"","children":[]},{"title":"Update sync job","description":"","children":[]},{"title":"Delete sync job","description":"","children":[]}]},{"title":"Fordwarding Hosts","description":"","children":[{"title":"Get Forwarding Hosts","description":"","children":[]},{"title":"Add Forward Host","description":"","children":[]}]},{"title":"Logs","description":"","children":[{"title":"Get Postfix logs","description":"","children":[]},{"title":"Get Rspamd logs","description":"","children":[]},{"title":"Get Dovecot logs","description":"","children":[]},{"title":"Get ACME logs","description":"","children":[]},{"title":"Get SOGo logs","description":"","children":[]},{"title":"Get Watchdog logs","description":"","children":[]},{"title":"Get Api logs","description":"","children":[]},{"title":"Get Ratelimit logs","description":"","children":[]},{"title":"Get Netfilter logs","description":"","children":[]},{"title":"Get Autodiscover logs","description":"","children":[]}]},{"title":"Queue Manager","description":"","children":[{"title":"Get Queue","description":"","children":[]},{"title":"Flush Queue","description":"","children":[]},{"title":"Delete Queue","description":"","children":[]}]},{"title":"Quarantine","description":"","children":[{"title":"Get mails in Quarantine","description":"","children":[]},{"title":"Delete mails in Quarantine","description":"","children":[]}]},{"title":"Fail2Ban","description":"","children":[{"title":"Get Fail2Ban Config","description":"","children":[]},{"title":"Edit Fail2Ban","description":"","children":[]}]},{"title":"DKIM","description":"","children":[{"title":"Generate DKIM Key","description":"","children":[]},{"title":"Duplicate DKIM Key","description":"","children":[]},{"title":"Delete DKIM Key","description":"","children":[]}]},{"title":"Domain admin","description":"","children":[{"title":"Get Domain Admins","description":"","children":[]},{"title":"Create Domain Admin user","description":"","children":[]},{"title":"Delete Domain Admin","description":"","children":[]}]},{"title":"Address Rewriting","description":"","children":[{"title":"Get BCC Map","description":"","children":[]},{"title":"Create BCC Map","description":"","children":[]},{"title":"Delete BCC Map","description":"","children":[]},{"title":"Get Recipient Map","description":"","children":[]},{"title":"Create Recipient Map","description":"","children":[]},{"title":"Delete Recipient Map","description":"","children":[]}]},{"title":"Outgoing TLS Policy Map Overrides","description":"","children":[{"title":"Get TLS Policy Map","description":"","children":[]},{"title":"Create TLS Policy Map","description":"","children":[]},{"title":"Delete TLS Policy Map","description":"","children":[]}]},{"title":"oAuth Clients","description":"","children":[{"title":"Get oAuth Clients","description":"","children":[]},{"title":"Create oAuth Client","description":"","children":[]},{"title":"Delete oAuth Client","description":"","children":[]}]},{"title":"Routing","description":"","children":[{"title":"Get Sender-Dependent Transports","description":"","children":[]},{"title":"Create Sender-Dependent Transports","description":"","children":[]},{"title":"Delete Sender-Dependent Transports","description":"","children":[]},{"title":"Get Transport Maps","description":"","children":[]},{"title":"Create Transport Maps","description":"","children":[]},{"title":"Delete Transport Maps","description":"","children":[]}]},{"title":"Resources","description":"","children":[{"title":"Get Resources","description":"","children":[]},{"title":"Create Resources","description":"","children":[]},{"title":"Delete Resources","description":"","children":[]}]}],"actions":[{"title":"Get domains","path":"/api/v1/get/domain/{id}","pathTemplate":"/api/v1/get/domain/{id}","slug":"get~api~v1~get~domain~id","method":"get","description":"\nYou can list all domains existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","mailcow.tld"]}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"max_new_mailbox_quota\": 10737418240,\n \"def_new_mailbox_quota\": 3221225472,\n \"quota_used_in_domain\": \"0\",\n \"mboxes_in_domain\": 0,\n \"mboxes_left\": 10,\n \"domain_name\": \"domain.tld\",\n \"description\": \"Some description\",\n \"max_num_aliases_for_domain\": 400,\n \"max_num_mboxes_for_domain\": 10,\n \"def_quota_for_mbox\": 3221225472,\n \"max_quota_for_mbox\": 10737418240,\n \"max_quota_for_domain\": 10737418240,\n \"relayhost\": \"0\",\n \"backupmx\": \"&#10008;\",\n \"gal\": \"&#10008;\",\n \"backupmx_int\": 0,\n \"gal_int\": 0,\n \"lang\": \"en\",\n \"rl\": false,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"relay_all_recipients\": \"&#10008;\",\n \"relay_all_recipients_int\": 0,\n \"aliases_in_domain\": 0,\n \"aliases_left\": 400\n },\n {\n \"max_new_mailbox_quota\": 10737418240,\n \"def_new_mailbox_quota\": 3221225472,\n \"quota_used_in_domain\": \"0\",\n \"mboxes_in_domain\": 0,\n \"mboxes_left\": 10,\n \"domain_name\": \"domain2.tld\",\n \"description\": \"domain description\",\n \"max_num_aliases_for_domain\": 400,\n \"max_num_mboxes_for_domain\": 10,\n \"def_quota_for_mbox\": 3221225472,\n \"max_quota_for_mbox\": 10737418240,\n \"max_quota_for_domain\": 10737418240,\n \"relayhost\": \"0\",\n \"backupmx\": \"&#10004;\",\n \"gal\": \"&#10008;\",\n \"backupmx_int\": 1,\n \"gal_int\": 0,\n \"lang\": \"cs\",\n \"rl\": false,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"relay_all_recipients\": \"&#10008;\",\n \"relay_all_recipients_int\": 0,\n \"aliases_in_domain\": 0,\n \"aliases_left\": 400\n }\n]\n","schema":""}}],"tags":["Domains","Get domains"]},{"title":"Create domain","path":"/api/v1/add/domain","pathTemplate":"/api/v1/add/domain","slug":"post~api~v1~add~domain","method":"post","description":"\nYou may create your own domain using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"","description":"You can also define rate limiting. If `rl_value` is not empty string, them ratelimit object is created and returned in response.","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"Fully qualified domain name","required":false,"members":[],"schema":{"type":"string"}},{"key":"description","description":"Description of domain","required":false,"members":[],"schema":{"type":"string"}},{"key":"aliases","description":"limit count of aliases associated with this domain","required":false,"members":[],"schema":{"type":"number"}},{"key":"mailboxes","description":"limit count of mailboxes associated with this domain","required":false,"members":[],"schema":{"type":"number"}},{"key":"defquota","description":"predefined mailbox quota in `add mailbox` form","required":false,"members":[],"schema":{"type":"number"}},{"key":"maxquota","description":"maximum quota per mailbox","required":false,"members":[],"schema":{"type":"number"}},{"key":"quota","description":"maximum quota for this domain (for all mailboxes in sum)","required":false,"members":[],"schema":{"type":"number"}},{"key":"active","description":"is domain active or not","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"rl_value","description":"rate limit value","required":false,"members":[],"schema":{"type":"number"}},{"key":"rl_frame","required":false,"members":[],"schema":{"type":"enum"}},{"key":"backupmx","description":"relay domain or not","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"relay_all_recipients","description":"if not, them you have to create \"dummy\" mailbox for each address to relay","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"lang","description":"language code","required":false,"members":[],"schema":{"type":"enum"}}]},"example":"{\n \"domain\":\"domain.tld\",\n \"description\":\"some decsription\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"rl_value\":\"10\",\n \"rl_frame\":\"s\",\n \"backupmx\":\"0\",\n \"relay_all_recipients\":\"0\",\n \"lang\":\"cs\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"aliases\": {\n \"type\": \"number\"\n },\n \"mailboxes\": {\n \"type\": \"number\"\n },\n \"defquota\": {\n \"type\": \"number\"\n },\n \"maxquota\": {\n \"type\": \"number\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"rl_value\": {\n \"type\": \"number\"\n },\n \"rl_frame\": {\n \"enum\": [\n \"s\",\n \"m\",\n \"h\"\n ]\n },\n \"backupmx\": {\n \"type\": \"boolean\"\n },\n \"relay_all_recipients\": {\n \"type\": \"boolean\"\n },\n \"lang\": {\n \"enum\": [\n \"sk\",\n \"cs\",\n \"de\",\n \"en\",\n \"es\",\n \"fr\",\n \"lv\",\n \"nl\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"it\",\n \"ca\"\n ]\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":" [\n {\n \"type\": \"success\",\n \"log\": [\n \"ratelimit\",\n \"edit\",\n \"domain\",\n {\n \"rl_value\": \"10\",\n \"rl_frame\": \"s\",\n \"object\": \"domain.tld\"\n }\n ],\n \"msg\": [\n \"rl_saved\",\n \"domain.tld\"\n ]\n },\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"add\",\n \"domain\",\n {\n \"domain\": \"domain.tld\",\n \"description\": \"some decsription\",\n \"aliases\": \"400\",\n \"mailboxes\": \"10\",\n \"defquota\": \"3072\",\n \"maxquota\": \"10240\",\n \"quota\": \"10240\",\n \"active\": \"1\",\n \"rl_value\": \"10\",\n \"rl_frame\": \"s\",\n \"backupmx\": \"0\",\n \"relay_all_recipients\": \"0\",\n \"lang\":\"cs\"\n },\n null\n ],\n \"msg\": [\n \"domain_added\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Create domain"]},{"title":"Update domain","path":"/api/v1/edit/domain","pathTemplate":"/api/v1/edit/domain","slug":"post~api~v1~edit~domain","method":"post","description":"\nYou can update one or more domains per request. You can also send just attributes you want to change. \nExample: You can add domain names to items list and in attr object just include `\"active\": \"0\"` to deactivate domains.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["domain_name"],"description":"contains list of domain names you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"domain.tld\"\n ],\n \"attr\":{\n \"description\":\"domain description\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"gal\":\"1\",\n \"relayhost\":\"2\",\n \"backupmx\":\"1\",\n \"relay_all_recipients\":\"0\",\n \"lang\":\"cs\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"aliases\": {\n \"type\": \"number\"\n },\n \"mailboxes\": {\n \"type\": \"number\"\n },\n \"defquota\": {\n \"type\": \"number\"\n },\n \"maxquota\": {\n \"type\": \"number\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"gal\": {\n \"type\": \"boolean\"\n },\n \"relayhost\": {\n \"type\": \"number\"\n },\n \"backupmx\": {\n \"type\": \"boolean\"\n },\n \"relay_all_recipients\": {\n \"type\": \"boolean\"\n },\n \"lang\": {\n \"enum\": [\n \"sk\",\n \"cs\",\n \"de\",\n \"en\",\n \"es\",\n \"fr\",\n \"lv\",\n \"nl\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"it\",\n \"ca\"\n ]\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\"\n ],\n \"description\":\"domain description\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"gal\":\"1\",\n \"relayhost\":\"2\",\n \"backupmx\":\"1\",\n \"relay_all_recipients\":\"0\",\n \"lang:\"cs\"\n },\n null\n ],\n \"msg\":[\n \"domain_modified\",\n \"domain.tld\"\n ]\n }\n] \n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Update domain"]},{"title":"Delete domain","path":"/api/v1/delete/domain","pathTemplate":"/api/v1/delete/domain","slug":"post~api~v1~delete~domain","method":"post","description":"\nYou can delete one or more domains.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["domain_name"],"description":"contains list of domains you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"domain.tld\",\n \"domain2.tld\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\",\n \"domain2.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"domain_removed\",\n \"domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\",\n \"domain2.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"domain_removed\",\n \"domain2.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Delete domain"]},{"title":"List whitelist domain policy","path":"/api/v1/get/policy_wl_domain/{domain}","pathTemplate":"/api/v1/get/policy_wl_domain/{domain}","slug":"get~api~v1~get~policy~wl~domain~domain","method":"get","description":"\nYou can list all whitelist policies per domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"object\": \"domain.tld\",\n \"value\": \"*@gooddomain.tld\",\n \"prefid\": 1\n }\n]\n","schema":""}}],"tags":["Domain antispam policies","List whitelist domain policy"]},{"title":"List blacklist domain policy","path":"/api/v1/get/policy_bl_domain/{domain}","pathTemplate":"/api/v1/get/policy_bl_domain/{domain}","slug":"get~api~v1~get~policy~bl~domain~domain","method":"get","description":"\nYou can list all blacklist policies per domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"object\": \"domain.tld\",\n \"value\": \"*@baddomain.tld\",\n \"prefid\": 2\n }\n]\n","schema":""}}],"tags":["Domain antispam policies","List blacklist domain policy"]},{"title":"Create domain policy","path":"/api/v1/add/domain-policy","pathTemplate":"/api/v1/add/domain-policy","slug":"post~api~v1~add~domain-policy","method":"post","description":"\nYou may create your own domain policy using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"domain name to which policy is associated to","required":false,"members":[],"schema":{"type":"string"}},{"key":"object_list","required":false,"members":[],"schema":{"type":"enum"}},{"key":"object_from","description":"exact address or use wildcard to match whole domain","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"domain\":\"domain.tld\",\n \"object_list\":\"bl\",\n \"object_from\":\"*@baddomain.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"object_list\": {\n \"enum\": [\n \"wl\",\n \"bl\"\n ]\n },\n \"object_from\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"add\",\n \"domain\",\n {\n \"domain\":\"domain.tld\",\n \"object_list\":\"bl\",\n \"object_from\":\"*@baddomain.tld\"\n }\n ],\n \"msg\":[\n \"domain_modified\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain antispam policies","Create domain policy"]},{"title":"Delete domain policy","path":"/api/v1/delete/domain-policy","pathTemplate":"/api/v1/delete/domain-policy","slug":"post~api~v1~delete~domain-policy","method":"post","description":"\nYou can delete one o more domain policies.","parameters":[],"transactions":[{"request":{"title":"","description":"Delete domain policy by ID","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of domain policys you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"1\",\n \"2\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":" [\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"delete\",\n \"domain\",\n {\n \"prefid\":[\n \"1\",\n \"2\"\n ]\n }\n ],\n \"msg\":[\n \"item_deleted\",\n \"1\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"delete\",\n \"domain\",\n {\n \"prefid\":[\n \"1\",\n \"2\"\n ]\n }\n ],\n \"msg\":[\n \"item_deleted\",\n \"2\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain antispam policies","Delete domain policy"]},{"title":"Get mailboxes","path":"/api/v1/get/mailbox/{id}","pathTemplate":"/api/v1/get/mailbox/{id}","slug":"get~api~v1~get~mailbox~id","method":"get","description":"\nYou can list all mailboxes existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","user@domain.tld"]}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"max_new_quota\":10737418240,\n \"username\":\"info@doman3.tld\",\n \"rl\":false,\n \"is_relayed\":0,\n \"name\":\"Full name\",\n \"active\":\"&#10004;\",\n \"active_int\":1,\n \"domain\":\"doman3.tld\",\n \"local_part\":\"info\",\n \"quota\":3221225472,\n \"attributes\":{\n \"force_pw_update\":\"0\",\n \"tls_enforce_in\":\"0\",\n \"tls_enforce_out\":\"0\",\n \"sogo_access\":\"1\",\n \"mailbox_format\":\"maildir:\",\n \"quarantine_notification\":\"never\"\n },\n \"quota_used\":0,\n \"percent_in_use\":0,\n \"messages\":0,\n \"spam_aliases\":0,\n \"percent_class\":\"success\"\n }\n]\n","schema":""}}],"tags":["Mailboxes","Get mailboxes"]},{"title":"Create mailbox","path":"/api/v1/add/mailbox","pathTemplate":"/api/v1/add/mailbox","slug":"post~api~v1~add~mailbox","method":"post","description":"\nYou may create your own mailbox using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"local_part","description":"left part of email address","required":false,"members":[],"schema":{"type":"string"}},{"key":"domain","description":"domain name","required":false,"members":[],"schema":{"type":"string"}},{"key":"name","description":"Full name of the mailbox user","required":false,"members":[],"schema":{"type":"string"}},{"key":"quota","description":"mailbox quota","required":false,"members":[],"schema":{"type":"number"}},{"key":"pasword","description":"mailbox password","required":false,"members":[],"schema":{"type":"string"}},{"key":"password2","description":"mailbox password for confirmation","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"is mailbox active or not","required":false,"members":[],"schema":{"type":"boolean"}}]},"example":"{\n \"local_part\":\"info\",\n \"domain\":\"domain.tld\",\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"atedismonsin\",\n \"password2\":\"atedismonsin\",\n \"active\":\"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"local_part\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"pasword\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"mailbox\",\n {\n \"local_part\":\"info\",\n \"domain\":\"domain.tld\",\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"*\",\n \"password2\":\"*\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_added\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Create mailbox"]},{"title":"Update mailbox","path":"/api/v1/edit/mailbox","pathTemplate":"/api/v1/edit/mailbox","slug":"post~api~v1~edit~mailbox","method":"post","description":"\nYou can update one or more mailboxes per request. You can also send just attributes you want to change","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["mailbox_name"],"description":"contains list of mailboxes you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{"sender_acl":["default","info@domain2.tld","domain3.tld","asterix"]},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"info@domain.tld\"\n ],\n \"attr\":{\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"\",\n \"password2\":\"\",\n \"active\":\"1\",\n \"sender_acl\":[\n \"default\",\n \"info@domain2.tld\",\n \"domain3.tld\",\n \"*\"\n ],\n \"force_pw_update\":\"0\",\n \"sogo_access\":\"1\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"pasword\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"sender_acl\": {\n \"type\": \"array\"\n },\n \"force_pw_update\": {\n \"type\": \"boolean\"\n },\n \"sogo_access\": {\n \"type\": \"boolean\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\"\n ],\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"*\",\n \"password2\":\"*\",\n \"active\":\"1\",\n \"sender_acl\":[\n \"default\",\n \"info@domain2.tld\",\n \"domain3.tld\",\n \"*\"\n ],\n \"force_pw_update\":\"0\",\n \"sogo_access\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_modified\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Update mailbox"]},{"title":"Delete mailbox","path":"/api/v1/delete/mailbox","pathTemplate":"/api/v1/delete/mailbox","slug":"post~api~v1~delete~mailbox","method":"post","description":"\nYou can delete one or more mailboxes.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["local_part@domain"],"description":"contains list of mailboxes you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"mailbox_removed\",\n \"info@domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"mailbox_removed\",\n \"sales@domain.tld\"\n ]\n }\n] \n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Delete mailbox"]},{"title":"Quarantine Notifications","path":"/api/v1/edit/quarantine_notification","pathTemplate":"/api/v1/edit/quarantine_notification","slug":"post~api~v1~edit~quarantine~notification","method":"post","description":"\nYou can update one or more mailboxes per request.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["mailbox_name"],"description":"contains list of mailboxes you want set qurantine notifications","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"mailbox1@domain.tld\",\n \"mailbox2@domain.tld\"\n ],\n \"attr\":{\n \"quarantine_notification\":\"hourly\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"quarantine_notification\": {\n \"enum\": [\n \"hourly\",\n \"daily\",\n \"weekly\",\n \"never\"\n ]\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"","schema":""}}],"tags":["Mailboxes","Quarantine Notifications"]},{"title":"GET aliases","path":"/api/v1/get/alias/{id}","pathTemplate":"/api/v1/get/alias/{id}","slug":"get~api~v1~get~alias~id","method":"get","description":"\nYou can list mailbox aliases existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"in_primary_domain\": \"\",\n \"id\": 6,\n \"domain\": \"domain.tld\",\n \"public_comment\": null,\n \"private_comment\": null,\n \"goto\": \"destination@domain.tld\",\n \"address\": \"alias@domain.tld\",\n \"is_catch_all\": 0,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"created\": \"2019-04-04 19:29:49\",\n \"modified\": null\n },\n {\n \"in_primary_domain\": \"\",\n \"id\": 10,\n \"domain\": \"domain.tld\",\n \"public_comment\": null,\n \"private_comment\": null,\n \"goto\": \"destination@domain.tld\",\n \"address\": \"@domain.tld\",\n \"is_catch_all\": 1,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"created\": \"2019-04-27 13:42:39\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Aliases","GET aliases"]},{"title":"Create alias","path":"/api/v1/add/alias","pathTemplate":"/api/v1/add/alias","slug":"post~api~v1~add~alias","method":"post","description":"\nYou may create your own mailbox alias using this action. It takes a JSON object containing a domain informations. \nOnly one `goto*` option can be used, for ex. if you want learn as spam, then send just `goto_spam = 1` in request body.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"address","description":"alias address, for catchall use \"@domain.tld\"","required":false,"members":[],"schema":{"type":"string"}},{"key":"goto","description":"destination address, comma separated","required":false,"members":[],"schema":{"type":"string"}},{"key":"goto_null","description":"silently ignore","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"goto_spam","description":"learn as spam","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"goto_ham","description":"learn as ham","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"active","description":"is alias active or not","required":false,"members":[],"schema":{"type":"boolean"}}]},"example":"{\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"active\":\"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"address\": {\n \"type\": \"string\"\n },\n \"goto\": {\n \"type\": \"string\"\n },\n \"goto_null\": {\n \"type\": \"boolean\"\n },\n \"goto_spam\": {\n \"type\": \"boolean\"\n },\n \"goto_ham\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"alias\",\n {\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"alias_added\",\n \"alias@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Create alias"]},{"title":"Update alias","path":"/api/v1/edit/alias","pathTemplate":"/api/v1/edit/alias","slug":"post~api~v1~edit~alias","method":"post","description":"\nYou can update one or more aliases per request. You can also send just attributes you want to change","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"6\"\n ],\n \"attr\":{\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"private_comment\":\"private comment\",\n \"public_comment\":\"public comment\",\n \"active\":\"1\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"address\": {\n \"type\": \"string\"\n },\n \"goto\": {\n \"type\": \"string\"\n },\n \"goto_null\": {\n \"type\": \"boolean\"\n },\n \"goto_spam\": {\n \"type\": \"boolean\"\n },\n \"goto_ham\": {\n \"type\": \"boolean\"\n },\n \"private_comment\": {\n \"type\": \"string\"\n },\n \"public_comment\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"alias\",\n {\n \"id\":[\n \"6\"\n ],\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"private_comment\":\"private comment\",\n \"public_comment\":\"public comment\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"alias_modified\",\n \"alias@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Update alias"]},{"title":"Delete alias","path":"/api/v1/delete/alias","pathTemplate":"/api/v1/delete/alias","slug":"post~api~v1~delete~alias","method":"post","description":"\nYou can delete one or more aliases.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"[\n \"6\",\n \"9\"\n]\n","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"alias\",\n {\n \"id\":[\n \"6\",\n \"9\"\n ]\n },\n null\n ],\n \"msg\":[\n \"alias_removed\",\n \"alias@domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"alias\",\n {\n \"id\":[\n \"6\",\n \"9\"\n ]\n },\n null\n ],\n \"msg\":[\n \"alias_removed\",\n \"alias2@domain.tld\"\n ]\n }\n] \n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Delete alias"]},{"title":"Get sync jobs","path":"/api/v1/get/syncjobs/all/no_log","pathTemplate":"/api/v1/get/syncjobs/all/no_log","slug":"get~api~v1~get~syncjobs~all~no~log","method":"get","description":"\nYou can list all syn jobs existing in system.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"user2\": \"mailbox@domain.tld\",\n \"host1\": \"imap.server.tld\",\n \"authmech1\": \"PLAIN\",\n \"regextrans2\": \"\",\n \"authmd51\": 0,\n \"domain2\": \"\",\n \"subfolder2\": \"External\",\n \"user1\": \"username\",\n \"exclude\": \"(?i)spam|(?i)junk\",\n \"maxage\": 0,\n \"mins_interval\": \"20\",\n \"maxbytespersecond\": \"0\",\n \"port1\": 993,\n \"enc1\": \"TLS\",\n \"delete2duplicates\": 1,\n \"delete1\": 0,\n \"delete2\": 0,\n \"automap\": 1,\n \"skipcrossduplicates\": 0,\n \"custom_params\": \"\",\n \"timeout1\": 600,\n \"timeout2\": 600,\n \"subscribeall\": 1,\n \"is_running\": 0,\n \"last_run\": \"2019-05-22 11:40:02\",\n \"created\": \"2019-05-22 11:37:25\",\n \"modified\": \"2019-05-22 11:40:02\",\n \"active\": \"&#10003;\",\n \"active_int\": 1,\n \"log\": \"\"\n }\n]\n","schema":""}}],"tags":["Sync jobs","Get sync jobs"]},{"title":"Create sync job","path":"/api/v1/add/syncjob","pathTemplate":"/api/v1/add/syncjob","slug":"post~api~v1~add~syncjob","method":"post","description":"\nYou can create new sync job using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"The target mailbox","required":false,"members":[],"schema":{"type":"string"}},{"key":"delete2duplicates","description":"Delete duplicates on destination","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"delete1","description":"Delete from source when completed","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"delete2","description":"Delete messages on destination that are not on source","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"automap","description":"Try to automap folders (\"Sent items\", \"Sent\" => \"Sent\" etc.)","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"skipcrossduplicates","description":"Skip duplicate messages across folders (first come, first serve)","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"active","description":"Is sync job active","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"subscribeall","description":"Subscribe all folders","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"host1","description":"Hostname","required":false,"members":[],"schema":{"type":"string"}},{"key":"port1","description":"Port","required":false,"members":[],"schema":{"type":"string"}},{"key":"user1","description":"Username","required":false,"members":[],"schema":{"type":"string"}},{"key":"password1","description":"Password","required":false,"members":[],"schema":{"type":"string"}},{"key":"enc1","description":"Encryption","required":false,"members":[],"schema":{"type":"enum"}},{"key":"mins_interval","description":"Interval (min)","required":false,"members":[],"schema":{"type":"number"}},{"key":"subfolder2","description":"Sync into subfolder on destination (empty = do not use subfolder)","required":false,"members":[],"schema":{"type":"string"}},{"key":"maxage","description":"Maximum age of messages in days that will be polled from remote (0 = ignore age)","required":false,"members":[],"schema":{"type":"number"}},{"key":"maxbytespersecond","description":"Max. bytes per second (0 = unlimited)","required":false,"members":[],"schema":{"type":"number"}},{"key":"timeout1","description":"Timeout for connection to remote host","required":false,"members":[],"schema":{"type":"number"}},{"key":"timeout2","description":"Timeout for connection to local host","required":false,"members":[],"schema":{"type":"number"}},{"key":"exclude","description":"Exclude objects (regex)","required":false,"members":[],"schema":{"type":"string"}},{"key":"custom_params","description":"Custom parameters passed to imapsync command","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"username\":\"mailbox@domain.tld\",\n \"host1\":\"imap.server.tld\",\n \"port1\":\"993\",\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\",\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"subscribeall\":\"1\",\n \"active\":\"1\",\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"delete2duplicates\": {\n \"type\": \"boolean\"\n },\n \"delete1\": {\n \"type\": \"boolean\"\n },\n \"delete2\": {\n \"type\": \"boolean\"\n },\n \"automap\": {\n \"type\": \"boolean\"\n },\n \"skipcrossduplicates\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"subscribeall\": {\n \"type\": \"boolean\"\n },\n \"host1\": {\n \"type\": \"string\"\n },\n \"port1\": {\n \"type\": \"string\"\n },\n \"user1\": {\n \"type\": \"string\"\n },\n \"password1\": {\n \"type\": \"string\"\n },\n \"enc1\": {\n \"enum\": [\n \"TLS\",\n \"SSL\",\n \"PLAIN\"\n ]\n },\n \"mins_interval\": {\n \"type\": \"number\"\n },\n \"subfolder2\": {\n \"type\": \"string\"\n },\n \"maxage\": {\n \"type\": \"number\"\n },\n \"maxbytespersecond\": {\n \"type\": \"number\"\n },\n \"timeout1\": {\n \"type\": \"number\"\n },\n \"timeout2\": {\n \"type\": \"number\"\n },\n \"exclude\": {\n \"type\": \"string\"\n },\n \"custom_params\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"syncjob\",\n {\n \"username\":\"mailbox@domain.tld\",\n \"host1\":\"imap.server.tld\",\n \"port1\":993,\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\",\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"subscribeall\":\"1\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_modified\",\n \"mailbox@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Create sync job"]},{"title":"Update sync job","path":"/api/v1/edit/syncjob","pathTemplate":"/api/v1/edit/syncjob","slug":"post~api~v1~edit~syncjob","method":"post","description":"\nYou can update one or more sync jobs per request. You can also send just attributes you want to change.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"1\"\n ],\n \"attr\":{\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"active\":\"1\",\n \"subscribeall\":\"1\",\n \"host1\":\"imap.server.tld\",\n \"port1\":\"993\",\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"delete2duplicates\": {\n \"type\": \"boolean\"\n },\n \"delete1\": {\n \"type\": \"boolean\"\n },\n \"delete2\": {\n \"type\": \"boolean\"\n },\n \"automap\": {\n \"type\": \"boolean\"\n },\n \"skipcrossduplicates\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"subscribeall\": {\n \"type\": \"boolean\"\n },\n \"host1\": {\n \"type\": \"string\"\n },\n \"port1\": {\n \"type\": \"string\"\n },\n \"user1\": {\n \"type\": \"string\"\n },\n \"password1\": {\n \"type\": \"string\"\n },\n \"enc1\": {\n \"enum\": [\n \"TLS\",\n \"SSL\",\n \"PLAIN\"\n ]\n },\n \"mins_interval\": {\n \"type\": \"number\"\n },\n \"subfolder2\": {\n \"type\": \"string\"\n },\n \"maxage\": {\n \"type\": \"number\"\n },\n \"maxbytespersecond\": {\n \"type\": \"number\"\n },\n \"timeout1\": {\n \"type\": \"number\"\n },\n \"timeout2\": {\n \"type\": \"number\"\n },\n \"exclude\": {\n \"type\": \"string\"\n },\n \"custom_params\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"{\n \"type\": \"success\",\n \"log\": [\n \"entity\",\n \"action\",\n \"object\",\n {}\n ],\n \"msg\": [\n \"message\",\n \"entity name\"\n ]\n}","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Update sync job"]},{"title":"Delete sync job","path":"/api/v1/delete/syncjob","pathTemplate":"/api/v1/delete/syncjob","slug":"post~api~v1~delete~syncjob","method":"post","description":"\nYou can delete one or more sync jobs.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"6\",\n \"9\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"{\n \"type\": \"success\",\n \"log\": [\n \"entity\",\n \"action\",\n \"object\",\n {}\n ],\n \"msg\": [\n \"message\",\n \"entity name\"\n ]\n}","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Delete sync job"]},{"title":"Get Forwarding Hosts","path":"/api/v1/get/fwdhost/all","pathTemplate":"/api/v1/get/fwdhost/all","slug":"get~api~v1~get~fwdhost~all","method":"get","description":"\nYou can list all Forwarding Hosts in your system.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"host\": \"5.1.76.202\",\n \"source\": \"hosted.mailcow.de\",\n \"keep_spam\": \"yes\"\n },\n {\n \"host\": \"2a00:f820:417::202\",\n \"source\": \"hosted.mailcow.de\",\n \"keep_spam\": \"yes\"\n }\n]\n","schema":""}}],"tags":["Fordwarding Hosts","Get Forwarding Hosts"]},{"title":"Add Forward Host","path":"/api/v1/add/fwdhost","pathTemplate":"/api/v1/add/fwdhost","slug":"post~api~v1~add~fwdhost","method":"post","description":"\nAdd a new Forwarding host to mailcow. You can chose to enable or disable spam filtering of incoming emails by specifing `filter_spam` 0 = inactive, 1 = active.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"hostname","description":"contains the hostname you want to add","required":false,"members":[],"schema":{"type":"string"}},{"key":"filter_spam","description":"1 to enable spam filter, 0 to disable spam filter","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"hostname\": \"hosted.mailcow.de\",\n \"filter_spam\": \"0\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"hostname\": {\n \"type\": \"string\"\n },\n \"filter_spam\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"fwdhost\",\n \"add\",\n {\n \"hostname\": \"hosted.mailcow.de\",\n \"filter_spam\": \"0\"\n }\n ],\n \"msg\": [\n \"forwarding_host_added\",\n \"5.1.76.202, 2a00:f820:417::202\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fordwarding Hosts","Add Forward Host"]},{"title":"Get Postfix logs","path":"/api/v1/get/logs/postfix/{count}","pathTemplate":"/api/v1/get/logs/postfix/{count}","slug":"get~api~v1~get~logs~postfix~count","method":"get","description":"\nThis Api endpoint lists all Postfix logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569937433\",\n \"program\": \"postfix/qmgr\",\n \"priority\": \"info\",\n \"message\": \"EF1711500458: removed\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Postfix logs"]},{"title":"Get Rspamd logs","path":"/api/v1/get/logs/rspamd-history/{count}","pathTemplate":"/api/v1/get/logs/rspamd-history/{count}","slug":"get~api~v1~get~logs~rspamd-history~count","method":"get","description":"\nThis Api endpoint lists all Rspamd logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n {\n \"time_virtual\": 0.235653,\n \"rcpt_mime\": [\n \"github@mailcow.tld\"\n ],\n \"message-id\": \"cm.0521259281087.phrkjuk.wdljulyl.i@cmail20.com\",\n \"ip\": \"1.1.1.1\",\n \"rcpt_smtp\": [\n \"github@mailcow.tld\"\n ],\n \"action\": \"soft reject\",\n \"time_real\": 2.856102,\n \"score\": 11.59,\n \"is_skipped\": false,\n \"size\": 35513,\n \"user\": \"unknown\",\n \"sender_mime\": \"noreply@github.com\",\n \"symbols\": {\n \"FROM_NEQ_ENVFROM\": {\n \"metric_score\": 0,\n \"options\": [\n \"noreply@github.com\",\n \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n ],\n \"score\": 0,\n \"name\": \"FROM_NEQ_ENVFROM\",\n \"description\": \"From address is different to the envelope\"\n },\n \"FORGED_SENDER\": {\n \"metric_score\": 0.3,\n \"options\": [\n \"noreply@github.com\",\n \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n ],\n \"score\": 0.3,\n \"name\": \"FORGED_SENDER\",\n \"description\": \"Sender is forged (different From: header and smtp MAIL FROM: addresses)\"\n },\n \"RWL_MAILSPIKE_NEUTRAL\": {\n \"metric_score\": 0,\n \"options\": [\n \"17.21.55.203.rep.mailspike.net : 127.0.0.13\"\n ],\n \"score\": 0,\n \"name\": \"RWL_MAILSPIKE_NEUTRAL\",\n \"description\": \"Neutral result from Mailspike\"\n },\n \"HAS_LIST_UNSUB\": {\n \"metric_score\": -0.01,\n \"score\": -0.01,\n \"name\": \"HAS_LIST_UNSUB\",\n \"description\": \"Has List-Unsubscribe header\"\n },\n \"URI_COUNT_ODD\": {\n \"metric_score\": 1,\n \"options\": [\n \"25\"\n ],\n \"score\": 1,\n \"name\": \"URI_COUNT_ODD\",\n \"description\": \"Odd number of URIs in multipart\\/alternative message\"\n },\n \"MIME_TRACE\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"MIME_TRACE\",\n \"options\": [\n \"0:+\",\n \"1:+\",\n \"2:~\"\n ]\n },\n \"R_DKIM_ALLOW\": {\n \"metric_score\": -0.2,\n \"options\": [\n \"github.com:s=cm\",\n \"cmail2.com:s=cs2013\"\n ],\n \"score\": 0,\n \"name\": \"R_DKIM_ALLOW\",\n \"description\": \"DKIM verification succeed\"\n },\n \"FROM_HAS_DN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"FROM_HAS_DN\",\n \"description\": \"From header has a display name\"\n },\n \"MIME_GOOD\": {\n \"metric_score\": -0.1,\n \"options\": [\n \"multipart\\/alternative\",\n \"text\\/plain\"\n ],\n \"score\": -0.1,\n \"name\": \"MIME_GOOD\",\n \"description\": \"Known content-type\"\n },\n \"REPLYTO_ADDR_EQ_FROM\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"REPLYTO_ADDR_EQ_FROM\",\n \"description\": \"Reply-To header is identical to SMTP From\"\n },\n \"TO_MATCH_ENVRCPT_ALL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"TO_MATCH_ENVRCPT_ALL\",\n \"description\": \"All of the recipients match the envelope\"\n },\n \"ASN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"ASN\",\n \"options\": [\n \"asn:55819, ipnet:203.55.21.0\\/24, country:AU\"\n ]\n },\n \"HTML_SHORT_LINK_IMG_1\": {\n \"metric_score\": 2,\n \"score\": 2,\n \"name\": \"HTML_SHORT_LINK_IMG_1\",\n \"description\": \"Short html part (0..1K) with a link to an image\"\n },\n \"SCHAALIT_URI_823\": {\n \"metric_score\": 5,\n \"score\": 5,\n \"name\": \"SCHAALIT_URI_823\",\n \"options\": [\n \"SCHAALIT_URI_823\"\n ]\n },\n \"DMARC_POLICY_ALLOW\": {\n \"metric_score\": -0.5,\n \"options\": [\n \"github.com\",\n \"none\"\n ],\n \"score\": 0,\n \"name\": \"DMARC_POLICY_ALLOW\",\n \"description\": \"DMARC permit policy\"\n },\n \"MANY_INVISIBLE_PARTS\": {\n \"metric_score\": 1,\n \"options\": [\n \"4\"\n ],\n \"score\": 0.3,\n \"name\": \"MANY_INVISIBLE_PARTS\",\n \"description\": \"Many parts are visually hidden\"\n },\n \"DKIM_TRACE\": {\n \"metric_score\": 0,\n \"options\": [\n \"github.com:+\",\n \"cmail2.com:+\"\n ],\n \"score\": 0,\n \"name\": \"DKIM_TRACE\",\n \"description\": \"DKIM trace symbol\"\n },\n \"MX_GOOD\": {\n \"metric_score\": -0.01,\n \"options\": [\n \"mx20.inbound.createsend.com\",\n \"mx21.inbound.createsend.com\"\n ],\n \"score\": -0.01,\n \"name\": \"MX_GOOD\",\n \"description\": \"MX was ok\"\n },\n \"TO_DN_ALL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"TO_DN_ALL\",\n \"description\": \"All the recipients have display names\"\n },\n \"RCPT_MAILCOW_DOMAIN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"RCPT_MAILCOW_DOMAIN\",\n \"options\": [\n \"gc-mc.de\"\n ]\n },\n \"XM_UA_NO_VERSION\": {\n \"metric_score\": 0.01,\n \"score\": 0.01,\n \"name\": \"XM_UA_NO_VERSION\",\n \"description\": \"X-Mailer\\/User-Agent has no version\"\n },\n \"HAS_REPLYTO\": {\n \"metric_score\": 0,\n \"options\": [\n \"noreply@github.com\"\n ],\n \"score\": 0,\n \"name\": \"HAS_REPLYTO\",\n \"description\": \"Has Reply-To header\"\n },\n \"R_SPF_ALLOW\": {\n \"metric_score\": -0.2,\n \"options\": [\n \"+ip4:203.55.21.0\\/24\"\n ],\n \"score\": 0,\n \"name\": \"R_SPF_ALLOW\",\n \"description\": \"SPF verification allows sending\"\n },\n \"URIBL_GREY\": {\n \"metric_score\": 1.5,\n \"options\": [\n \"cmail2.com.multi.uribl.com\",\n \"cmail20.com.multi.uribl.com\",\n \"updatemyprofile.com.multi.uribl.com\"\n ],\n \"score\": 1.5,\n \"name\": \"URIBL_GREY\",\n \"description\": \"uribl.com grey url\"\n },\n \"CLAM_VIRUS_FAIL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"CLAM_VIRUS_FAIL\",\n \"options\": [\n \"failed to scan and retransmits exceed\"\n ]\n },\n \"GREYLIST\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"GREYLIST\",\n \"options\": [\n \"greylisted\",\n \"Wed, 25 Sep 2019 19:27:10 GMT\",\n \"new record\"\n ]\n },\n \"ARC_NA\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"ARC_NA\",\n \"description\": \"ARC signature absent\"\n },\n \"RCVD_COUNT_ZERO\": {\n \"metric_score\": 0,\n \"options\": [\n \"0\"\n ],\n \"score\": 0,\n \"name\": \"RCVD_COUNT_ZERO\",\n \"description\": \"Message has no Received headers\"\n },\n \"BAD_REP_POLICIES\": {\n \"metric_score\": 0.1,\n \"score\": 0.1,\n \"name\": \"BAD_REP_POLICIES\",\n \"description\": \"Contains valid policies but are also marked by fuzzy\\/bayes\\/surbl\\/rbl\"\n },\n \"RCPT_COUNT_ONE\": {\n \"metric_score\": 0,\n \"options\": [\n \"1\"\n ],\n \"score\": 0,\n \"name\": \"RCPT_COUNT_ONE\",\n \"description\": \"One recipient\"\n },\n \"RBL_UCEPROTECT_LEVEL1\": {\n \"metric_score\": 3.5,\n \"score\": 3.5,\n \"name\": \"RBL_UCEPROTECT_LEVEL1\",\n \"options\": [\n \"17.21.55.203.dnsbl-1.uceprotect.net\"\n ]\n },\n \"DWL_DNSWL_HI\": {\n \"metric_score\": -3.5,\n \"options\": [\n \"github.com.dwl.dnswl.org : 127.0.9.3\"\n ],\n \"score\": -3.5,\n \"name\": \"DWL_DNSWL_HI\",\n \"description\": \"Message has a valid dkim signature originated from domain listed at https:\\/\\/www.dnswl.org, high trust\"\n },\n \"RCVD_IN_DNSWL_NONE\": {\n \"metric_score\": 0,\n \"options\": [\n \"17.21.55.203.list.dnswl.org : 127.0.15.0\"\n ],\n \"score\": 0,\n \"name\": \"RCVD_IN_DNSWL_NONE\",\n \"description\": \"Sender listed at https:\\/\\/www.dnswl.org, no trust\"\n },\n \"RBL_UCEPROTECT_LEVEL2\": {\n \"metric_score\": 1.5,\n \"score\": 1.5,\n \"name\": \"RBL_UCEPROTECT_LEVEL2\",\n \"options\": [\n \"17.21.55.203.dnsbl-2.uceprotect.net\"\n ]\n }\n },\n \"subject\": \"[mailcow/mailcow-dockerized] Unable to change name of alias email address (#2997)\",\n \"required_score\": 15,\n \"unix_time\": 1569439327,\n \"sender_smtp\": \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n }\n}\n","schema":""}}],"tags":["Logs","Get Rspamd logs"]},{"title":"Get Dovecot logs","path":"/api/v1/get/logs/dovecot/{count}","pathTemplate":"/api/v1/get/logs/dovecot/{count}","slug":"get~api~v1~get~logs~dovecot~count","method":"get","description":"\nThis Api endpoint lists all Dovecot logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938740\",\n \"program\": \"dovecot\",\n \"priority\": \"info\",\n \"message\": \"managesieve-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=172.22.1.3, lip=172.22.1.250\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Dovecot logs"]},{"title":"Get ACME logs","path":"/api/v1/get/logs/acme/{count}","pathTemplate":"/api/v1/get/logs/acme/{count}","slug":"get~api~v1~get~logs~acme~count","method":"get","description":"\nThis Api endpoint lists all ACME logs from issued Lets Enctypts certificates. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569927728\",\n \"message\": \"Certificate validation done, neither changed nor due for renewal, sleeping for another day.\"\n }\n]\n","schema":""}}],"tags":["Logs","Get ACME logs"]},{"title":"Get SOGo logs","path":"/api/v1/get/logs/sogo/{count}","pathTemplate":"/api/v1/get/logs/sogo/{count}","slug":"get~api~v1~get~logs~sogo~count","method":"get","description":"\nThis Api endpoint lists all SOGo logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938874\",\n \"program\": \"sogod\",\n \"priority\": \"notice\",\n \"message\": \"[109]: mailcowdockerized_watchdog-mailcow_1.mailcowdockerized_mailcow-network \\\"GET \\/SOGo.index\\/ HTTP\\/1.1\\\" 200 2531\\/0 0.005 - - 0\"\n }\n]\n","schema":""}}],"tags":["Logs","Get SOGo logs"]},{"title":"Get Watchdog logs","path":"/api/v1/get/logs/watchdog/{count}","pathTemplate":"/api/v1/get/logs/watchdog/{count}","slug":"get~api~v1~get~logs~watchdog~count","method":"get","description":"\nThis Api endpoint lists all Watchdog logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938958\",\n \"service\": \"Fail2ban\",\n \"lvl\": \"100\",\n \"hpnow\": \"1\",\n \"hptotal\": \"1\",\n \"hpdiff\": \"0\"\n },\n {\n \"time\": \"1569938956\",\n \"service\": \"Rspamd\",\n \"lvl\": \"100\",\n \"hpnow\": \"5\",\n \"hptotal\": \"5\",\n \"hpdiff\": \"0\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Watchdog logs"]},{"title":"Get Api logs","path":"/api/v1/get/logs/api/{count}","pathTemplate":"/api/v1/get/logs/api/{count}","slug":"get~api~v1~get~logs~api~count","method":"get","description":"\nThis Api endpoint lists all Api logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569939001,\n \"uri\": \"\\/api\\/v1\\/get\\/logs\\/api\\/2\",\n \"method\": \"GET\",\n \"remote\": \"1.1.1.1\",\n \"data\": \"\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Api logs"]},{"title":"Get Ratelimit logs","path":"/api/v1/get/logs/ratelimited/{count}","pathTemplate":"/api/v1/get/logs/ratelimited/{count}","slug":"get~api~v1~get~logs~ratelimited~count","method":"get","description":"\nThis Api endpoint lists all Ratelimit logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569269003,\n \"rcpt\": \"hello@mailcow.email\",\n \"from\": \"awesome@mailcow.email\",\n \"user\": \"awesome@mailcow.email\",\n \"rl_info\": \"mailcow(RLsdz3tuabozgd4oacbdh8kc78)\",\n \"rl_name\": \"mailcow\",\n \"rl_hash\": \"RLsdz3tuabozgd4oacbdh8kc78\",\n \"qid\": \"E3CF91500458\",\n \"ip\": \"172.22.1.248\",\n \"message_id\": \"6a-5d892500-7-240abd80@90879116\",\n \"header_subject\": \"Mailcow is amazing\",\n \"header_from\": \"\\\"Awesome\\\" <awesome@mailcow.email>\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Ratelimit logs"]},{"title":"Get Netfilter logs","path":"/api/v1/get/logs/netfilter/{count}","pathTemplate":"/api/v1/get/logs/netfilter/{count}","slug":"get~api~v1~get~logs~netfilter~count","method":"get","description":"\nThis Api endpoint lists all Netfilter logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569754911,\n \"priority\": \"info\",\n \"message\": \"Whitelist was changed, it has 1 entries\"\n },\n {\n \"time\": 1569754911,\n \"priority\": \"crit\",\n \"message\": \"Add host\\/network 1.1.1.1\\/32 to blacklist\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Netfilter logs"]},{"title":"Get Autodiscover logs","path":"/api/v1/get/logs/autodiscover/{count}","pathTemplate":"/api/v1/get/logs/autodiscover/{count}","slug":"get~api~v1~get~logs~autodiscover~count","method":"get","description":"\nThis Api endpoint lists all Autodiscover logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569684212,\n \"ua\": \"Microsoft Office\\/16.0 (Windows NT 6.2; MAPICPL 16.0.11328; Pro)\",\n \"user\": \"awesome@mailcow.de\",\n \"service\": \"activesync\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Autodiscover logs"]},{"title":"Get Queue","path":"/api/v1/get/mailq/all","pathTemplate":"/api/v1/get/mailq/all","slug":"get~api~v1~get~mailq~all","method":"get","description":"\nGet the current mail queue and everything it contains.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"queue_name\": \"incoming\",\n \"queue_id\": \"B98C6260CA1\",\n \"arrival_time\": 1570091234,\n \"message_size\": 1848,\n \"sender\": \"sender@mailcow.tld\",\n \"recipients\": [\n \"recipient@awesomecow.tld\"\n ]\n }\n]\n","schema":""}}],"tags":["Queue Manager","Get Queue"]},{"title":"Flush Queue","path":"/api/v1/edit/mailq","pathTemplate":"/api/v1/edit/mailq","slug":"post~api~v1~edit~mailq","method":"post","description":"\nUsing this API you can flush the current mail queue. This will try to deliver all mails currently in it.\nThis API uses the command: `postqueue -f`","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"action","description":"use flush to flush the mail queue","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{ \n \"action\":\"flush\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"success\",\n \"msg\": \"Task completed\"\n}\n","schema":""}}],"tags":["Queue Manager","Flush Queue"]},{"title":"Delete Queue","path":"/api/v1/delete/mailq","pathTemplate":"/api/v1/delete/mailq","slug":"post~api~v1~delete~mailq","method":"post","description":"\nUsing this API you can delete the current mail queue. This will delete all mails in it.\nThis API uses the command: `postsuper -d`","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"action","description":"use super_delete to delete the mail queue","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"action\":\"super_delete\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"success\",\n \"msg\": \"Task completed\"\n}\n","schema":""}}],"tags":["Queue Manager","Delete Queue"]},{"title":"Get mails in Quarantine","path":"/api/v1/get/quarantine/all","pathTemplate":"/api/v1/get/quarantine/all","slug":"get~api~v1~get~quarantine~all","method":"get","description":"\nGet all mails that are currently in Quarantine.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"id\": 33,\n \"qid\": \"8224615004C1\",\n \"subject\": \"mailcow is awesome\",\n \"virus_flag\": 0,\n \"score\": 15.48,\n \"rcpt\": \"admin@domain.tld\",\n \"sender\": \"bounces@send.domain.tld\",\n \"created\": 1572688831\n}\n","schema":""}}],"tags":["Quarantine","Get mails in Quarantine"]},{"title":"Delete mails in Quarantine","path":"/api/v1/delete/qitem","pathTemplate":"/api/v1/delete/qitem","slug":"post~api~v1~delete~qitem","method":"post","description":"\nUsing this endpoint you can delete a email from quarantine, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of emails you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"33\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"quarantine\",\n \"delete\",\n {\n \"id\": [\n \"33\"\n ]\n }\n ],\n \"msg\": [\n \"item_deleted\",\n \"33\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Quarantine","Delete mails in Quarantine"]},{"title":"Get Fail2Ban Config","path":"/api/v1/get/fail2ban","pathTemplate":"/api/v1/get/fail2ban","slug":"get~api~v1~get~fail2ban","method":"get","description":"\nGets the current Fail2Ban configuration.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"ban_time\": 604800,\n \"netban_ipv4\": 32,\n \"netban_ipv6\": 128,\n \"max_attempts\": 1,\n \"retry_window\": 7200,\n \"whitelist\": \"1.1.1.1\",\n \"blacklist\": \"45.82.153.37\\/32\\n92.118.38.52\\/32\",\n \"perm_bans\": [\n \"45.82.153.37\\/32\",\n \"92.118.38.52\\/32\"\n ]\n}\n","schema":""}}],"tags":["Fail2Ban","Get Fail2Ban Config"]},{"title":"Edit Fail2Ban","path":"/api/v1/edit/fail2ban","pathTemplate":"/api/v1/edit/fail2ban","slug":"post~api~v1~edit~fail2ban","method":"post","description":"\nUsing this endpoint you can edit the Fail2Ban config and black or whitelist new ips.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":[],"description":"has to be none","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"description":"array containing the fail2ban settings","required":false,"members":[],"schema":{"type":"object"}}]},"example":"{ \n \"items\":[\n \"none\"\n ],\n \"attr\": {\n \"ban_time\": \"86400\",\n \"max_attempts\": \"5\",\n \"retry_window\": \"600\",\n \"netban_ipv4\": \"24\",\n \"netban_ipv6\": \"64\",\n \"whitelist\": \"mailcow.tld\",\n \"blacklist\": \"10.100.6.5/32,10.100.8.4/32\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"ban_time\": {\n \"type\": \"number\"\n },\n \"max_attempts\": {\n \"type\": \"number\"\n },\n \"retry_window\": {\n \"type\": \"number\"\n },\n \"netban_ipv4\": {\n \"type\": \"number\"\n },\n \"netban_ipv6\": {\n \"type\": \"number\"\n },\n \"whitelist\": {\n \"type\": \"string\"\n },\n \"backlist\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"type\": \"success\",\n \"log\": [\n \"fail2ban\",\n \"edit\",\n {\n \"network\": [\n \"none\"\n ],\n \"ban_time\": \"86400\",\n \"max_attempts\": \"5\",\n \"retry_window\": \"600\",\n \"netban_ipv4\": \"24\",\n \"netban_ipv6\": \"64\",\n \"whitelist\": \"mailcow.tld\",\n \"blacklist\": \"10.100.6.5/32,10.100.8.4/32\"\n }\n ],\n \"msg\": \"f2b_modified\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fail2Ban","Edit Fail2Ban"]},{"title":"Generate DKIM Key","path":"/api/v1/add/dkim","pathTemplate":"/api/v1/add/dkim","slug":"post~api~v1~add~dkim","method":"post","description":"\nUsing this endpoint you can generate new DKIM keys.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"the domain which a key should be generated for","required":false,"members":[],"schema":{"type":"string"}},{"key":"dkim_selector","description":"the DKIM selector default dkim","required":false,"members":[],"schema":{"type":"string"}},{"key":"key_size","description":"the key size (1024 or 2048)","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"domains\":\"mailcow.tld\",\n \"dkim_selector\":\"dkim\",\n \"key_size\":\"2048\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"dkim_selector\": {\n \"type\": \"string\"\n },\n \"key_size\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"add\",\n {\n \"domains\": \"hanspeterlol.de\",\n \"dkim_selector\": \"dkim\",\n \"key_size\": \"2048\"\n }\n ],\n \"msg\": [\n \"dkim_added\",\n \"hanspeterlol.de\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Generate DKIM Key"]},{"title":"Duplicate DKIM Key","path":"/api/v1/add/dkim_duplicate","pathTemplate":"/api/v1/add/dkim_duplicate","slug":"post~api~v1~add~dkim~duplicate","method":"post","description":"\nUsing this endpoint you can duplicate the DKIM Key of one domain.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"fron_domain","description":"the domain where the dkim key should be copied from","required":false,"members":[],"schema":{"type":"string"}},{"key":"to_domain","description":"the domain where the dkim key should be copied to","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"from_domain\":\"mailcow.tld\",\n \"to_domain\":\"awesomecow.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"fron_domain\": {\n \"type\": \"string\"\n },\n \"to_domain\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"duplicate\",\n {\n \"from_domain\": \"mailcow.tld\",\n \"to_domain\": \"awesomecow.tld\"\n }\n ],\n \"msg\": [\n \"dkim_duplicated\",\n \"mailcow.tld\",\n \"awesomecow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Duplicate DKIM Key"]},{"title":"Delete DKIM Key","path":"/api/v1/delete/dkim","pathTemplate":"/api/v1/delete/dkim","slug":"post~api~v1~delete~dkim","method":"post","description":"\nUsing this endpoint a existing DKIM Key can be deleted","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"[\"mailcow.tld\"]\n","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"delete\",\n {\n \"domains\": [\n \"mailcow.tld\"\n ]\n }\n ],\n \"msg\": [\n \"dkim_removed\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Delete DKIM Key"]},{"title":"Get Domain Admins","path":"/api/v1/get/domain-admin/all","pathTemplate":"/api/v1/get/domain-admin/all","slug":"get~api~v1~get~domain-admin~all","method":"get","description":"\n","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"username\": \"testadmin\",\n \"tfa_active\": \"&#10005;\",\n \"active\": \"&#10003;\",\n \"tfa_active_int\": null,\n \"active_int\": 1,\n \"created\": \"2019-10-02 10:29:41\",\n \"selected_domains\": [\n \"mailcow.tld\"\n ],\n \"unselected_domains\": [\n \"awesomemailcow.de\",\n \"mailcowisgreat.de\"\n ]\n }\n]\n","schema":""}}],"tags":["Domain admin","Get Domain Admins"]},{"title":"Create Domain Admin user","path":"/api/v1/add/domain-admin","pathTemplate":"/api/v1/add/domain-admin","slug":"post~api~v1~add~domain-admin","method":"post","description":"\nUsing this endpoint you can create a new Domain Admin user. This user has full control over a domain, and can create new mailboxes and aliases.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"the username for the admin user","required":false,"members":[],"schema":{"type":"string"}},{"key":"domains","description":"the domains the user should be a admin of","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"domain admin user password","required":false,"members":[],"schema":{"type":"string"}},{"key":"password2","description":"domain admin user password","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"username\": \"testadmin\",\n \"domains\": \"mailcow.tld\",\n \"password\": \"supersecurepw\",\n \"password2\": \"supersecurepw\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"domains\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"domain_admin\",\n \"add\",\n {\n \"username\": \"testadmin\",\n \"domains\": \"mailcow.tld\",\n \"password\": \"*\",\n \"password2\": \"*\",\n \"active\": \"1\"\n }\n ],\n \"msg\": [\n \"domain_admin_added\",\n \"testadmin\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain admin","Create Domain Admin user"]},{"title":"Delete Domain Admin","path":"/api/v1/delete/domain-admin","pathTemplate":"/api/v1/delete/domain-admin","slug":"post~api~v1~delete~domain-admin","method":"post","description":"\nUsing this endpoint a existing Domain Admin user can be deleted.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["username"],"description":"contains list of usernames of the users you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"testadmin\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"domain_admin\",\n \"delete\",\n {\n \"username\": [\n \"testadmin\"\n ]\n }\n ],\n \"msg\": [\n \"domain_admin_removed\",\n \"testadmin\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain admin","Delete Domain Admin"]},{"title":"Get BCC Map","path":"/api/v1/get/bcc/{id}","pathTemplate":"/api/v1/get/bcc/{id}","slug":"get~api~v1~get~bcc~id","method":"get","description":"\nUsing this endpoint you can get all BCC maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 3,\n \"local_dest\": \"@mailcow.tld\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active_int\": 1,\n \"active\": \"&#10003;\",\n \"type\": \"sender\",\n \"created\": \"2019-10-02 21:44:34\",\n \"domain\": \"mailcow.tld\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Address Rewriting","Get BCC Map"]},{"title":"Create BCC Map","path":"/api/v1/add/bcc","pathTemplate":"/api/v1/add/bcc","slug":"post~api~v1~add~bcc","method":"post","description":"\nUsing this endpoint you can create a BCC map to forward all mails via a bcc for a given domain.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"local_dest","description":"the domain which emails should be forwarded","required":false,"members":[],"schema":{"type":"string"}},{"key":"type","description":"the type of bcc map can be `sender` or `recipient`","required":false,"members":[],"schema":{"type":"string"}},{"key":"bcc_dest","description":"the email address where all mails should be send to","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"local_dest\": \"mailcow.tld\",\n \"type\": \"sender\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"local_dest\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n },\n \"bcc_dest\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"bcc\",\n \"add\",\n {\n \"local_dest\": \"mailcow.tld\",\n \"type\": \"sender\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": \"bcc_saved\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Create BCC Map"]},{"title":"Delete BCC Map","path":"/api/v1/delete/bcc","pathTemplate":"/api/v1/delete/bcc","slug":"post~api~v1~delete~bcc","method":"post","description":"\nUsing this endpoint you can delete a BCC map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of bcc maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"bcc\",\n \"delete\",\n {\n \"id\": [\n \"4\"\n ]\n },\n null\n ],\n \"msg\": [\n \"bcc_deleted\",\n \"4\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Delete BCC Map"]},{"title":"Get Recipient Map","path":"/api/v1/get/recipient_map/{id}","pathTemplate":"/api/v1/get/recipient_map/{id}","slug":"get~api~v1~get~recipient~map~id","method":"get","description":"\nUsing this endpoint you can get all recipient maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 3,\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active_int\": 1,\n \"active\": \"&#10003;\",\n \"created\": \"2019-10-02 22:06:29\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Address Rewriting","Get Recipient Map"]},{"title":"Create Recipient Map","path":"/api/v1/add/recipient_map","pathTemplate":"/api/v1/add/recipient_map","slug":"post~api~v1~add~recipient~map","method":"post","description":"\nUsing this endpoint you can create a recipient map to forward all mails from one email address to another.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"recipient_map_old","description":"the email address which emails should be forwarded","required":false,"members":[],"schema":{"type":"string"}},{"key":"recipient_map_new","description":"the email address that should receive the forwarded emails","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"recipient_map_old\": {\n \"type\": \"string\"\n },\n \"recipient_map_new\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"recipient_map\",\n \"add\",\n {\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"recipient_map_entry_saved\",\n \"recipient@mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Create Recipient Map"]},{"title":"Delete Recipient Map","path":"/api/v1/delete/recipient_map","pathTemplate":"/api/v1/delete/recipient_map","slug":"post~api~v1~delete~recipient~map","method":"post","description":"\nUsing this endpoint you can delete a recipient map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of recipient maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"recipient_map\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n },\n null\n ],\n \"msg\": [\n \"recipient_map_entry_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Delete Recipient Map"]},{"title":"Get TLS Policy Map","path":"/api/v1/get/tls-policy-map/{id}","pathTemplate":"/api/v1/get/tls-policy-map/{id}","slug":"get~api~v1~get~tls-policy-map~id","method":"get","description":"\nUsing this endpoint you can get all TLS policy map override maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active_int\": 1,\n \"active\": \"&#10003;\",\n \"created\": \"2019-10-03 08:42:12\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Outgoing TLS Policy Map Overrides","Get TLS Policy Map"]},{"title":"Create TLS Policy Map","path":"/api/v1/add/tls-policy-map","pathTemplate":"/api/v1/add/tls-policy-map","slug":"post~api~v1~add~tls-policy-map","method":"post","description":"\nUsing this endpoint you can create a TLS policy map override.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"dest","description":"the target domain or email address","required":false,"members":[],"schema":{"type":"string"}},{"key":"policy","description":"the policy","required":false,"members":[],"schema":{"type":"enum"}},{"key":"parameters","description":"custom parameters you find out more about them [here](http://www.postfix.org/postconf.5.html#smtp_tls_policy_maps)","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"dest\": {\n \"type\": \"string\"\n },\n \"policy\": {\n \"enum\": [\n \"none\",\n \"may\",\n \"encrypt\",\n \"dane\",\n \"fingerprint\",\n \"verify\",\n \"secure\"\n ]\n },\n \"parameters\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"tls_policy_maps\",\n \"add\",\n {\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"tls_policy_map_entry_saved\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Outgoing TLS Policy Map Overrides","Create TLS Policy Map"]},{"title":"Delete TLS Policy Map","path":"/api/v1/delete/tls-policy-map","pathTemplate":"/api/v1/delete/tls-policy-map","slug":"post~api~v1~delete~tls-policy-map","method":"post","description":"\nUsing this endpoint you can delete a TLS Policy Map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of tls policy maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"tls_policy_maps\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n },\n null\n ],\n \"msg\": [\n \"tls_policy_map_entry_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Outgoing TLS Policy Map Overrides","Delete TLS Policy Map"]},{"title":"Get oAuth Clients","path":"/api/v1/get/oauth2-client/{id}","pathTemplate":"/api/v1/get/oauth2-client/{id}","slug":"get~api~v1~get~oauth2-client~id","method":"get","description":"\nUsing this endpoint you can get all oAuth clients.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"client_id\": \"17c76aaa88c0\",\n \"client_secret\": \"73fc668a88147e32a31ff80c\",\n \"redirect_uri\": \"https:\\/\\/mailcow.tld\",\n \"grant_types\": null,\n \"scope\": \"profile\",\n \"user_id\": null\n }\n]\n","schema":""}}],"tags":["oAuth Clients","Get oAuth Clients"]},{"title":"Create oAuth Client","path":"/api/v1/add/oauth2-client","pathTemplate":"/api/v1/add/oauth2-client","slug":"post~api~v1~add~oauth2-client","method":"post","description":"\nUsing this endpoint you can create a oAuth clients.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"redirect_uri","description":"the uri where you should be redirected after oAuth","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"redirect_uri\":\"https://mailcow.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"redirect_uri\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"oauth2\",\n \"add\",\n \"client\",\n {\n \"redirect_uri\": \"https:\\/\\/mailcow.tld\"\n }\n ],\n \"msg\": \"Added client access\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["oAuth Clients","Create oAuth Client"]},{"title":"Delete oAuth Client","path":"/api/v1/delete/oauth2-client","pathTemplate":"/api/v1/delete/oauth2-client","slug":"post~api~v1~delete~oauth2-client","method":"post","description":"\nUsing this endpoint you can delete a oAuth client, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of oAuth clients you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"oauth2\",\n \"delete\",\n \"client\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"items_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["oAuth Clients","Delete oAuth Client"]},{"title":"Get Sender-Dependent Transports","path":"/api/v1/get/relayhost/{id}","pathTemplate":"/api/v1/get/relayhost/{id}","slug":"get~api~v1~get~relayhost~id","method":"get","description":"\nUsing this endpoint you can get all Sender-Dependent Transports.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\",\n \"active_int\": 1,\n \"password_short\": \"tes...\",\n \"active\": \"&#10003;\",\n \"used_by_domains\": \"\"\n }\n]\n","schema":""}}],"tags":["Routing","Get Sender-Dependent Transports"]},{"title":"Create Sender-Dependent Transports","path":"/api/v1/add/relayhost","pathTemplate":"/api/v1/add/relayhost","slug":"post~api~v1~add~relayhost","method":"post","description":"\nUsing this endpoint you can create Sender-Dependent Transports.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"hostname","description":"the hostname of the smtp server with port","required":false,"members":[],"schema":{"type":"string"}},{"key":"username","description":"the username used to authenticate","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"the password for the smtp user","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"hostname\": {\n \"type\": \"string\"\n },\n \"username\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"relayhost\",\n \"add\",\n {\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\"\n }\n ],\n \"msg\": [\n \"relayhost_added\",\n \"\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Create Sender-Dependent Transports"]},{"title":"Delete Sender-Dependent Transports","path":"/api/v1/delete/relayhost","pathTemplate":"/api/v1/delete/relayhost","slug":"post~api~v1~delete~relayhost","method":"post","description":"\nUsing this endpoint you can delete a Sender-Dependent Transport, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of Sender-Dependent Transport you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"relayhost\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"relayhost_removed\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Delete Sender-Dependent Transports"]},{"title":"Get Transport Maps","path":"/api/v1/get/transport/{id}","pathTemplate":"/api/v1/get/transport/{id}","slug":"get~api~v1~get~transport~id","method":"get","description":"\nUsing this endpoint you can get all Transport Maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"destination\": \"example.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active_int\": 1,\n \"lookup_mx_int\": 0,\n \"password_short\": \"sup...\",\n \"active\": \"&#10003;\",\n \"lookup_mx\": \"&#10005;\"\n }\n]\n","schema":""}}],"tags":["Routing","Get Transport Maps"]},{"title":"Create Transport Maps","path":"/api/v1/add/transport/all","pathTemplate":"/api/v1/add/transport/all","slug":"post~api~v1~add~transport~all","method":"post","description":"\nUsing this endpoint you can create Sender-Dependent Transports.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"destination","required":false,"members":[],"schema":{"type":"string"}},{"key":"nexthop","required":false,"members":[],"schema":{"type":"string"}},{"key":"username","description":"the username used to authenticate","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"the password for the smtp user","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"destination\": \"example.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\"\n },\n \"nexthop\": {\n \"type\": \"string\"\n },\n \"username\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"transport\",\n \"add\",\n {\n \"destination\": \"example2.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active\": \"1\"\n }\n ],\n \"msg\": [\n \"relayhost_added\",\n \"\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Create Transport Maps"]},{"title":"Delete Transport Maps","path":"/api/v1/delete/transport","pathTemplate":"/api/v1/delete/transport","slug":"post~api~v1~delete~transport","method":"post","description":"\nUsing this endpoint you can delete a Transport Maps, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of transport maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"transport\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"relayhost_removed\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Delete Transport Maps"]},{"title":"Get Resources","path":"/api/v1/get/resource/all","pathTemplate":"/api/v1/get/resource/all","slug":"get~api~v1~get~resource~all","method":"get","description":"\nUsing this endpoint you can get all Resources.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"name\": \"test@mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings\": 0,\n \"description\": \"test\",\n \"active\": \"&#10003;\",\n \"active_int\": 1,\n \"domain\": \"mailcow.tld\",\n \"local_part\": \"test\"\n }\n]\n","schema":""}}],"tags":["Resources","Get Resources"]},{"title":"Create Resources","path":"/api/v1/add/resource","pathTemplate":"/api/v1/add/resource","slug":"post~api~v1~add~resource","method":"post","description":"\nUsing this endpoint you can create Resources.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"description","description":"a description of the resource","required":false,"members":[],"schema":{"type":"string"}},{"key":"domain","description":"the domain for which the resource should be","required":false,"members":[],"schema":{"type":"string"}},{"key":"kind","description":"the kind of recouse","required":false,"members":[],"schema":{"type":"enum"}},{"key":"multiple_bookings_select","required":false,"members":[],"schema":{"type":"enum"}},{"key":"multiple_bookings_custom","description":"always empty","required":false,"members":[],"schema":{"type":"number"}},{"key":"multiple_bookings","required":false,"members":[],"schema":{"type":"enum"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"description\": \"test\",\n \"domain\": \"mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings_select\": \"0\",\n \"multiple_bookings_custom\": \"\",\n \"multiple_bookings\": \"0\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"kind\": {\n \"enum\": [\n \"location\",\n \"group\",\n \"thing\"\n ]\n },\n \"multiple_bookings_select\": {\n \"enum\": [\n \"-1\",\n \"1\",\n \"custom\"\n ]\n },\n \"multiple_bookings_custom\": {\n \"type\": \"number\"\n },\n \"multiple_bookings\": {\n \"enum\": [\n \"-1\",\n \"1\",\n \"custom\"\n ]\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"add\",\n \"resource\",\n {\n \"description\": \"test\",\n \"domain\": \"mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings_select\": \"0\",\n \"multiple_bookings_custom\": \"\",\n \"multiple_bookings\": \"0\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"resource_added\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Resources","Create Resources"]},{"title":"Delete Resources","path":"/api/v1/delete/resource","pathTemplate":"/api/v1/delete/resource","slug":"post~api~v1~delete~resource","method":"post","description":"\nUsing this endpoint you can delete a Resources, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["description@domain"],"description":"contains list of Resources you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"test@mailcow.tld\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"delete\",\n \"resource\",\n {\n \"name\": [\n \"test@mailcow.tld\"\n ]\n },\n null\n ],\n \"msg\": [\n \"resource_removed\",\n \"test@mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Resources","Delete Resources"]}],"tagActions":[{"title":"Address Rewriting","children":[{"title":"Create BCC Map","actions":[{"title":"Create BCC Map","method":"post","path":"/api/v1/add/bcc","slug":"post~api~v1~add~bcc"}]},{"title":"Create Recipient Map","actions":[{"title":"Create Recipient Map","method":"post","path":"/api/v1/add/recipient_map","slug":"post~api~v1~add~recipient~map"}]},{"title":"Delete BCC Map","actions":[{"title":"Delete BCC Map","method":"post","path":"/api/v1/delete/bcc","slug":"post~api~v1~delete~bcc"}]},{"title":"Delete Recipient Map","actions":[{"title":"Delete Recipient Map","method":"post","path":"/api/v1/delete/recipient_map","slug":"post~api~v1~delete~recipient~map"}]},{"title":"Get BCC Map","actions":[{"title":"Get BCC Map","method":"get","path":"/api/v1/get/bcc/{id}","slug":"get~api~v1~get~bcc~id"}]},{"title":"Get Recipient Map","actions":[{"title":"Get Recipient Map","method":"get","path":"/api/v1/get/recipient_map/{id}","slug":"get~api~v1~get~recipient~map~id"}]}]},{"title":"Aliases","children":[{"title":"Create alias","actions":[{"title":"Create alias","method":"post","path":"/api/v1/add/alias","slug":"post~api~v1~add~alias"}]},{"title":"Delete alias","actions":[{"title":"Delete alias","method":"post","path":"/api/v1/delete/alias","slug":"post~api~v1~delete~alias"}]},{"title":"GET aliases","actions":[{"title":"GET aliases","method":"get","path":"/api/v1/get/alias/{id}","slug":"get~api~v1~get~alias~id"}]},{"title":"Update alias","actions":[{"title":"Update alias","method":"post","path":"/api/v1/edit/alias","slug":"post~api~v1~edit~alias"}]}]},{"title":"DKIM","children":[{"title":"Delete DKIM Key","actions":[{"title":"Delete DKIM Key","method":"post","path":"/api/v1/delete/dkim","slug":"post~api~v1~delete~dkim"}]},{"title":"Duplicate DKIM Key","actions":[{"title":"Duplicate DKIM Key","method":"post","path":"/api/v1/add/dkim_duplicate","slug":"post~api~v1~add~dkim~duplicate"}]},{"title":"Generate DKIM Key","actions":[{"title":"Generate DKIM Key","method":"post","path":"/api/v1/add/dkim","slug":"post~api~v1~add~dkim"}]}]},{"title":"Domain admin","children":[{"title":"Create Domain Admin user","actions":[{"title":"Create Domain Admin user","method":"post","path":"/api/v1/add/domain-admin","slug":"post~api~v1~add~domain-admin"}]},{"title":"Delete Domain Admin","actions":[{"title":"Delete Domain Admin","method":"post","path":"/api/v1/delete/domain-admin","slug":"post~api~v1~delete~domain-admin"}]},{"title":"Get Domain Admins","actions":[{"title":"Get Domain Admins","method":"get","path":"/api/v1/get/domain-admin/all","slug":"get~api~v1~get~domain-admin~all"}]}]},{"title":"Domain antispam policies","children":[{"title":"Create domain policy","actions":[{"title":"Create domain policy","method":"post","path":"/api/v1/add/domain-policy","slug":"post~api~v1~add~domain-policy"}]},{"title":"Delete domain policy","actions":[{"title":"Delete domain policy","method":"post","path":"/api/v1/delete/domain-policy","slug":"post~api~v1~delete~domain-policy"}]},{"title":"List blacklist domain policy","actions":[{"title":"List blacklist domain policy","method":"get","path":"/api/v1/get/policy_bl_domain/{domain}","slug":"get~api~v1~get~policy~bl~domain~domain"}]},{"title":"List whitelist domain policy","actions":[{"title":"List whitelist domain policy","method":"get","path":"/api/v1/get/policy_wl_domain/{domain}","slug":"get~api~v1~get~policy~wl~domain~domain"}]}]},{"title":"Domains","children":[{"title":"Create domain","actions":[{"title":"Create domain","method":"post","path":"/api/v1/add/domain","slug":"post~api~v1~add~domain"}]},{"title":"Delete domain","actions":[{"title":"Delete domain","method":"post","path":"/api/v1/delete/domain","slug":"post~api~v1~delete~domain"}]},{"title":"Get domains","actions":[{"title":"Get domains","method":"get","path":"/api/v1/get/domain/{id}","slug":"get~api~v1~get~domain~id"}]},{"title":"Update domain","actions":[{"title":"Update domain","method":"post","path":"/api/v1/edit/domain","slug":"post~api~v1~edit~domain"}]}]},{"title":"Fail2Ban","children":[{"title":"Edit Fail2Ban","actions":[{"title":"Edit Fail2Ban","method":"post","path":"/api/v1/edit/fail2ban","slug":"post~api~v1~edit~fail2ban"}]},{"title":"Get Fail2Ban Config","actions":[{"title":"Get Fail2Ban Config","method":"get","path":"/api/v1/get/fail2ban","slug":"get~api~v1~get~fail2ban"}]}]},{"title":"Fordwarding Hosts","children":[{"title":"Add Forward Host","actions":[{"title":"Add Forward Host","method":"post","path":"/api/v1/add/fwdhost","slug":"post~api~v1~add~fwdhost"}]},{"title":"Get Forwarding Hosts","actions":[{"title":"Get Forwarding Hosts","method":"get","path":"/api/v1/get/fwdhost/all","slug":"get~api~v1~get~fwdhost~all"}]}]},{"title":"Logs","children":[{"title":"Get ACME logs","actions":[{"title":"Get ACME logs","method":"get","path":"/api/v1/get/logs/acme/{count}","slug":"get~api~v1~get~logs~acme~count"}]},{"title":"Get Api logs","actions":[{"title":"Get Api logs","method":"get","path":"/api/v1/get/logs/api/{count}","slug":"get~api~v1~get~logs~api~count"}]},{"title":"Get Autodiscover logs","actions":[{"title":"Get Autodiscover logs","method":"get","path":"/api/v1/get/logs/autodiscover/{count}","slug":"get~api~v1~get~logs~autodiscover~count"}]},{"title":"Get Dovecot logs","actions":[{"title":"Get Dovecot logs","method":"get","path":"/api/v1/get/logs/dovecot/{count}","slug":"get~api~v1~get~logs~dovecot~count"}]},{"title":"Get Netfilter logs","actions":[{"title":"Get Netfilter logs","method":"get","path":"/api/v1/get/logs/netfilter/{count}","slug":"get~api~v1~get~logs~netfilter~count"}]},{"title":"Get Postfix logs","actions":[{"title":"Get Postfix logs","method":"get","path":"/api/v1/get/logs/postfix/{count}","slug":"get~api~v1~get~logs~postfix~count"}]},{"title":"Get Ratelimit logs","actions":[{"title":"Get Ratelimit logs","method":"get","path":"/api/v1/get/logs/ratelimited/{count}","slug":"get~api~v1~get~logs~ratelimited~count"}]},{"title":"Get Rspamd logs","actions":[{"title":"Get Rspamd logs","method":"get","path":"/api/v1/get/logs/rspamd-history/{count}","slug":"get~api~v1~get~logs~rspamd-history~count"}]},{"title":"Get SOGo logs","actions":[{"title":"Get SOGo logs","method":"get","path":"/api/v1/get/logs/sogo/{count}","slug":"get~api~v1~get~logs~sogo~count"}]},{"title":"Get Watchdog logs","actions":[{"title":"Get Watchdog logs","method":"get","path":"/api/v1/get/logs/watchdog/{count}","slug":"get~api~v1~get~logs~watchdog~count"}]}]},{"title":"Mailboxes","children":[{"title":"Create mailbox","actions":[{"title":"Create mailbox","method":"post","path":"/api/v1/add/mailbox","slug":"post~api~v1~add~mailbox"}]},{"title":"Delete mailbox","actions":[{"title":"Delete mailbox","method":"post","path":"/api/v1/delete/mailbox","slug":"post~api~v1~delete~mailbox"}]},{"title":"Get mailboxes","actions":[{"title":"Get mailboxes","method":"get","path":"/api/v1/get/mailbox/{id}","slug":"get~api~v1~get~mailbox~id"}]},{"title":"Quarantine Notifications","actions":[{"title":"Quarantine Notifications","method":"post","path":"/api/v1/edit/quarantine_notification","slug":"post~api~v1~edit~quarantine~notification"}]},{"title":"Update mailbox","actions":[{"title":"Update mailbox","method":"post","path":"/api/v1/edit/mailbox","slug":"post~api~v1~edit~mailbox"}]}]},{"title":"Outgoing TLS Policy Map Overrides","children":[{"title":"Create TLS Policy Map","actions":[{"title":"Create TLS Policy Map","method":"post","path":"/api/v1/add/tls-policy-map","slug":"post~api~v1~add~tls-policy-map"}]},{"title":"Delete TLS Policy Map","actions":[{"title":"Delete TLS Policy Map","method":"post","path":"/api/v1/delete/tls-policy-map","slug":"post~api~v1~delete~tls-policy-map"}]},{"title":"Get TLS Policy Map","actions":[{"title":"Get TLS Policy Map","method":"get","path":"/api/v1/get/tls-policy-map/{id}","slug":"get~api~v1~get~tls-policy-map~id"}]}]},{"title":"Quarantine","children":[{"title":"Delete mails in Quarantine","actions":[{"title":"Delete mails in Quarantine","method":"post","path":"/api/v1/delete/qitem","slug":"post~api~v1~delete~qitem"}]},{"title":"Get mails in Quarantine","actions":[{"title":"Get mails in Quarantine","method":"get","path":"/api/v1/get/quarantine/all","slug":"get~api~v1~get~quarantine~all"}]}]},{"title":"Queue Manager","children":[{"title":"Delete Queue","actions":[{"title":"Delete Queue","method":"post","path":"/api/v1/delete/mailq","slug":"post~api~v1~delete~mailq"}]},{"title":"Flush Queue","actions":[{"title":"Flush Queue","method":"post","path":"/api/v1/edit/mailq","slug":"post~api~v1~edit~mailq"}]},{"title":"Get Queue","actions":[{"title":"Get Queue","method":"get","path":"/api/v1/get/mailq/all","slug":"get~api~v1~get~mailq~all"}]}]},{"title":"Resources","children":[{"title":"Create Resources","actions":[{"title":"Create Resources","method":"post","path":"/api/v1/add/resource","slug":"post~api~v1~add~resource"}]},{"title":"Delete Resources","actions":[{"title":"Delete Resources","method":"post","path":"/api/v1/delete/resource","slug":"post~api~v1~delete~resource"}]},{"title":"Get Resources","actions":[{"title":"Get Resources","method":"get","path":"/api/v1/get/resource/all","slug":"get~api~v1~get~resource~all"}]}]},{"title":"Routing","children":[{"title":"Create Sender-Dependent Transports","actions":[{"title":"Create Sender-Dependent Transports","method":"post","path":"/api/v1/add/relayhost","slug":"post~api~v1~add~relayhost"}]},{"title":"Create Transport Maps","actions":[{"title":"Create Transport Maps","method":"post","path":"/api/v1/add/transport/all","slug":"post~api~v1~add~transport~all"}]},{"title":"Delete Sender-Dependent Transports","actions":[{"title":"Delete Sender-Dependent Transports","method":"post","path":"/api/v1/delete/relayhost","slug":"post~api~v1~delete~relayhost"}]},{"title":"Delete Transport Maps","actions":[{"title":"Delete Transport Maps","method":"post","path":"/api/v1/delete/transport","slug":"post~api~v1~delete~transport"}]},{"title":"Get Sender-Dependent Transports","actions":[{"title":"Get Sender-Dependent Transports","method":"get","path":"/api/v1/get/relayhost/{id}","slug":"get~api~v1~get~relayhost~id"}]},{"title":"Get Transport Maps","actions":[{"title":"Get Transport Maps","method":"get","path":"/api/v1/get/transport/{id}","slug":"get~api~v1~get~transport~id"}]}]},{"title":"Sync jobs","children":[{"title":"Create sync job","actions":[{"title":"Create sync job","method":"post","path":"/api/v1/add/syncjob","slug":"post~api~v1~add~syncjob"}]},{"title":"Delete sync job","actions":[{"title":"Delete sync job","method":"post","path":"/api/v1/delete/syncjob","slug":"post~api~v1~delete~syncjob"}]},{"title":"Get sync jobs","actions":[{"title":"Get sync jobs","method":"get","path":"/api/v1/get/syncjobs/all/no_log","slug":"get~api~v1~get~syncjobs~all~no~log"}]},{"title":"Update sync job","actions":[{"title":"Update sync job","method":"post","path":"/api/v1/edit/syncjob","slug":"post~api~v1~edit~syncjob"}]}]},{"title":"oAuth Clients","children":[{"title":"Create oAuth Client","actions":[{"title":"Create oAuth Client","method":"post","path":"/api/v1/add/oauth2-client","slug":"post~api~v1~add~oauth2-client"}]},{"title":"Delete oAuth Client","actions":[{"title":"Delete oAuth Client","method":"post","path":"/api/v1/delete/oauth2-client","slug":"post~api~v1~delete~oauth2-client"}]},{"title":"Get oAuth Clients","actions":[{"title":"Get oAuth Clients","method":"get","path":"/api/v1/get/oauth2-client/{id}","slug":"get~api~v1~get~oauth2-client~id"}]}]}],"config":{"playground":{"enabled":true,"env":"easy","environments":{"easy":{"playground":false,"url":"/"},"advanced":{"url":"/"}}},"basePath":"/","stylesheets":[]}}
  15043. });
  15044. return app;
  15045. }());
  15046. </script>
  15047. </body>
  15048. </html>