pinia.js 173 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891
  1. import {
  2. computed,
  3. effectScope,
  4. getCurrentInstance,
  5. getCurrentScope,
  6. hasInjectionContext,
  7. inject,
  8. isReactive,
  9. isRef,
  10. markRaw,
  11. nextTick,
  12. onScopeDispose,
  13. reactive,
  14. ref,
  15. toRaw,
  16. toRef,
  17. toRefs,
  18. unref,
  19. watch
  20. } from "./chunk-4EPKHDIW.js";
  21. // node_modules/@vue/devtools-shared/dist/index.js
  22. var __create = Object.create;
  23. var __defProp = Object.defineProperty;
  24. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  25. var __getOwnPropNames = Object.getOwnPropertyNames;
  26. var __getProtoOf = Object.getPrototypeOf;
  27. var __hasOwnProp = Object.prototype.hasOwnProperty;
  28. var __esm = (fn, res) => function __init() {
  29. return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
  30. };
  31. var __commonJS = (cb, mod) => function __require() {
  32. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  33. };
  34. var __copyProps = (to, from, except, desc) => {
  35. if (from && typeof from === "object" || typeof from === "function") {
  36. for (let key of __getOwnPropNames(from))
  37. if (!__hasOwnProp.call(to, key) && key !== except)
  38. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  39. }
  40. return to;
  41. };
  42. var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  43. // If the importer is in node compatibility mode or this is not an ESM
  44. // file that has been converted to a CommonJS file using a Babel-
  45. // compatible transform (i.e. "__esModule" has not been set), then set
  46. // "default" to the CommonJS "module.exports" for node compatibility.
  47. isNodeMode || !mod || !mod.__esModule ? __defProp(target2, "default", { value: mod, enumerable: true }) : target2,
  48. mod
  49. ));
  50. var init_esm_shims = __esm({
  51. "../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"() {
  52. "use strict";
  53. }
  54. });
  55. var require_rfdc = __commonJS({
  56. "../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(exports, module) {
  57. "use strict";
  58. init_esm_shims();
  59. module.exports = rfdc2;
  60. function copyBuffer(cur) {
  61. if (cur instanceof Buffer) {
  62. return Buffer.from(cur);
  63. }
  64. return new cur.constructor(cur.buffer.slice(), cur.byteOffset, cur.length);
  65. }
  66. function rfdc2(opts) {
  67. opts = opts || {};
  68. if (opts.circles) return rfdcCircles(opts);
  69. const constructorHandlers = /* @__PURE__ */ new Map();
  70. constructorHandlers.set(Date, (o) => new Date(o));
  71. constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
  72. constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
  73. if (opts.constructorHandlers) {
  74. for (const handler2 of opts.constructorHandlers) {
  75. constructorHandlers.set(handler2[0], handler2[1]);
  76. }
  77. }
  78. let handler = null;
  79. return opts.proto ? cloneProto : clone;
  80. function cloneArray(a, fn) {
  81. const keys = Object.keys(a);
  82. const a2 = new Array(keys.length);
  83. for (let i = 0; i < keys.length; i++) {
  84. const k = keys[i];
  85. const cur = a[k];
  86. if (typeof cur !== "object" || cur === null) {
  87. a2[k] = cur;
  88. } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
  89. a2[k] = handler(cur, fn);
  90. } else if (ArrayBuffer.isView(cur)) {
  91. a2[k] = copyBuffer(cur);
  92. } else {
  93. a2[k] = fn(cur);
  94. }
  95. }
  96. return a2;
  97. }
  98. function clone(o) {
  99. if (typeof o !== "object" || o === null) return o;
  100. if (Array.isArray(o)) return cloneArray(o, clone);
  101. if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
  102. return handler(o, clone);
  103. }
  104. const o2 = {};
  105. for (const k in o) {
  106. if (Object.hasOwnProperty.call(o, k) === false) continue;
  107. const cur = o[k];
  108. if (typeof cur !== "object" || cur === null) {
  109. o2[k] = cur;
  110. } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
  111. o2[k] = handler(cur, clone);
  112. } else if (ArrayBuffer.isView(cur)) {
  113. o2[k] = copyBuffer(cur);
  114. } else {
  115. o2[k] = clone(cur);
  116. }
  117. }
  118. return o2;
  119. }
  120. function cloneProto(o) {
  121. if (typeof o !== "object" || o === null) return o;
  122. if (Array.isArray(o)) return cloneArray(o, cloneProto);
  123. if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
  124. return handler(o, cloneProto);
  125. }
  126. const o2 = {};
  127. for (const k in o) {
  128. const cur = o[k];
  129. if (typeof cur !== "object" || cur === null) {
  130. o2[k] = cur;
  131. } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
  132. o2[k] = handler(cur, cloneProto);
  133. } else if (ArrayBuffer.isView(cur)) {
  134. o2[k] = copyBuffer(cur);
  135. } else {
  136. o2[k] = cloneProto(cur);
  137. }
  138. }
  139. return o2;
  140. }
  141. }
  142. function rfdcCircles(opts) {
  143. const refs = [];
  144. const refsNew = [];
  145. const constructorHandlers = /* @__PURE__ */ new Map();
  146. constructorHandlers.set(Date, (o) => new Date(o));
  147. constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
  148. constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
  149. if (opts.constructorHandlers) {
  150. for (const handler2 of opts.constructorHandlers) {
  151. constructorHandlers.set(handler2[0], handler2[1]);
  152. }
  153. }
  154. let handler = null;
  155. return opts.proto ? cloneProto : clone;
  156. function cloneArray(a, fn) {
  157. const keys = Object.keys(a);
  158. const a2 = new Array(keys.length);
  159. for (let i = 0; i < keys.length; i++) {
  160. const k = keys[i];
  161. const cur = a[k];
  162. if (typeof cur !== "object" || cur === null) {
  163. a2[k] = cur;
  164. } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
  165. a2[k] = handler(cur, fn);
  166. } else if (ArrayBuffer.isView(cur)) {
  167. a2[k] = copyBuffer(cur);
  168. } else {
  169. const index = refs.indexOf(cur);
  170. if (index !== -1) {
  171. a2[k] = refsNew[index];
  172. } else {
  173. a2[k] = fn(cur);
  174. }
  175. }
  176. }
  177. return a2;
  178. }
  179. function clone(o) {
  180. if (typeof o !== "object" || o === null) return o;
  181. if (Array.isArray(o)) return cloneArray(o, clone);
  182. if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
  183. return handler(o, clone);
  184. }
  185. const o2 = {};
  186. refs.push(o);
  187. refsNew.push(o2);
  188. for (const k in o) {
  189. if (Object.hasOwnProperty.call(o, k) === false) continue;
  190. const cur = o[k];
  191. if (typeof cur !== "object" || cur === null) {
  192. o2[k] = cur;
  193. } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
  194. o2[k] = handler(cur, clone);
  195. } else if (ArrayBuffer.isView(cur)) {
  196. o2[k] = copyBuffer(cur);
  197. } else {
  198. const i = refs.indexOf(cur);
  199. if (i !== -1) {
  200. o2[k] = refsNew[i];
  201. } else {
  202. o2[k] = clone(cur);
  203. }
  204. }
  205. }
  206. refs.pop();
  207. refsNew.pop();
  208. return o2;
  209. }
  210. function cloneProto(o) {
  211. if (typeof o !== "object" || o === null) return o;
  212. if (Array.isArray(o)) return cloneArray(o, cloneProto);
  213. if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
  214. return handler(o, cloneProto);
  215. }
  216. const o2 = {};
  217. refs.push(o);
  218. refsNew.push(o2);
  219. for (const k in o) {
  220. const cur = o[k];
  221. if (typeof cur !== "object" || cur === null) {
  222. o2[k] = cur;
  223. } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
  224. o2[k] = handler(cur, cloneProto);
  225. } else if (ArrayBuffer.isView(cur)) {
  226. o2[k] = copyBuffer(cur);
  227. } else {
  228. const i = refs.indexOf(cur);
  229. if (i !== -1) {
  230. o2[k] = refsNew[i];
  231. } else {
  232. o2[k] = cloneProto(cur);
  233. }
  234. }
  235. }
  236. refs.pop();
  237. refsNew.pop();
  238. return o2;
  239. }
  240. }
  241. }
  242. });
  243. init_esm_shims();
  244. init_esm_shims();
  245. init_esm_shims();
  246. var isBrowser = typeof navigator !== "undefined";
  247. var target = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : {};
  248. var isInChromePanel = typeof target.chrome !== "undefined" && !!target.chrome.devtools;
  249. var isInIframe = isBrowser && target.self !== target.top;
  250. var _a;
  251. var isInElectron = typeof navigator !== "undefined" && ((_a = navigator.userAgent) == null ? void 0 : _a.toLowerCase().includes("electron"));
  252. var isNuxtApp = typeof window !== "undefined" && !!window.__NUXT__;
  253. init_esm_shims();
  254. var import_rfdc = __toESM(require_rfdc(), 1);
  255. var classifyRE = /(?:^|[-_/])(\w)/g;
  256. function toUpper(_, c) {
  257. return c ? c.toUpperCase() : "";
  258. }
  259. function classify(str) {
  260. return str && `${str}`.replace(classifyRE, toUpper);
  261. }
  262. function basename(filename, ext) {
  263. let normalizedFilename = filename.replace(/^[a-z]:/i, "").replace(/\\/g, "/");
  264. if (normalizedFilename.endsWith(`index${ext}`)) {
  265. normalizedFilename = normalizedFilename.replace(`/index${ext}`, ext);
  266. }
  267. const lastSlashIndex = normalizedFilename.lastIndexOf("/");
  268. const baseNameWithExt = normalizedFilename.substring(lastSlashIndex + 1);
  269. if (ext) {
  270. const extIndex = baseNameWithExt.lastIndexOf(ext);
  271. return baseNameWithExt.substring(0, extIndex);
  272. }
  273. return "";
  274. }
  275. var deepClone = (0, import_rfdc.default)({ circles: true });
  276. // node_modules/perfect-debounce/dist/index.mjs
  277. var DEBOUNCE_DEFAULTS = {
  278. trailing: true
  279. };
  280. function debounce(fn, wait = 25, options = {}) {
  281. options = { ...DEBOUNCE_DEFAULTS, ...options };
  282. if (!Number.isFinite(wait)) {
  283. throw new TypeError("Expected `wait` to be a finite number");
  284. }
  285. let leadingValue;
  286. let timeout;
  287. let resolveList = [];
  288. let currentPromise;
  289. let trailingArgs;
  290. const applyFn = (_this, args) => {
  291. currentPromise = _applyPromised(fn, _this, args);
  292. currentPromise.finally(() => {
  293. currentPromise = null;
  294. if (options.trailing && trailingArgs && !timeout) {
  295. const promise = applyFn(_this, trailingArgs);
  296. trailingArgs = null;
  297. return promise;
  298. }
  299. });
  300. return currentPromise;
  301. };
  302. return function(...args) {
  303. if (currentPromise) {
  304. if (options.trailing) {
  305. trailingArgs = args;
  306. }
  307. return currentPromise;
  308. }
  309. return new Promise((resolve) => {
  310. const shouldCallNow = !timeout && options.leading;
  311. clearTimeout(timeout);
  312. timeout = setTimeout(() => {
  313. timeout = null;
  314. const promise = options.leading ? leadingValue : applyFn(this, args);
  315. for (const _resolve of resolveList) {
  316. _resolve(promise);
  317. }
  318. resolveList = [];
  319. }, wait);
  320. if (shouldCallNow) {
  321. leadingValue = applyFn(this, args);
  322. resolve(leadingValue);
  323. } else {
  324. resolveList.push(resolve);
  325. }
  326. });
  327. };
  328. }
  329. async function _applyPromised(fn, _this, args) {
  330. return await fn.apply(_this, args);
  331. }
  332. // node_modules/hookable/dist/index.mjs
  333. function flatHooks(configHooks, hooks2 = {}, parentName) {
  334. for (const key in configHooks) {
  335. const subHook = configHooks[key];
  336. const name = parentName ? `${parentName}:${key}` : key;
  337. if (typeof subHook === "object" && subHook !== null) {
  338. flatHooks(subHook, hooks2, name);
  339. } else if (typeof subHook === "function") {
  340. hooks2[name] = subHook;
  341. }
  342. }
  343. return hooks2;
  344. }
  345. var defaultTask = { run: (function_) => function_() };
  346. var _createTask = () => defaultTask;
  347. var createTask = typeof console.createTask !== "undefined" ? console.createTask : _createTask;
  348. function serialTaskCaller(hooks2, args) {
  349. const name = args.shift();
  350. const task = createTask(name);
  351. return hooks2.reduce(
  352. (promise, hookFunction) => promise.then(() => task.run(() => hookFunction(...args))),
  353. Promise.resolve()
  354. );
  355. }
  356. function parallelTaskCaller(hooks2, args) {
  357. const name = args.shift();
  358. const task = createTask(name);
  359. return Promise.all(hooks2.map((hook2) => task.run(() => hook2(...args))));
  360. }
  361. function callEachWith(callbacks, arg0) {
  362. for (const callback of [...callbacks]) {
  363. callback(arg0);
  364. }
  365. }
  366. var Hookable = class {
  367. constructor() {
  368. this._hooks = {};
  369. this._before = void 0;
  370. this._after = void 0;
  371. this._deprecatedMessages = void 0;
  372. this._deprecatedHooks = {};
  373. this.hook = this.hook.bind(this);
  374. this.callHook = this.callHook.bind(this);
  375. this.callHookWith = this.callHookWith.bind(this);
  376. }
  377. hook(name, function_, options = {}) {
  378. if (!name || typeof function_ !== "function") {
  379. return () => {
  380. };
  381. }
  382. const originalName = name;
  383. let dep;
  384. while (this._deprecatedHooks[name]) {
  385. dep = this._deprecatedHooks[name];
  386. name = dep.to;
  387. }
  388. if (dep && !options.allowDeprecated) {
  389. let message = dep.message;
  390. if (!message) {
  391. message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
  392. }
  393. if (!this._deprecatedMessages) {
  394. this._deprecatedMessages = /* @__PURE__ */ new Set();
  395. }
  396. if (!this._deprecatedMessages.has(message)) {
  397. console.warn(message);
  398. this._deprecatedMessages.add(message);
  399. }
  400. }
  401. if (!function_.name) {
  402. try {
  403. Object.defineProperty(function_, "name", {
  404. get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
  405. configurable: true
  406. });
  407. } catch {
  408. }
  409. }
  410. this._hooks[name] = this._hooks[name] || [];
  411. this._hooks[name].push(function_);
  412. return () => {
  413. if (function_) {
  414. this.removeHook(name, function_);
  415. function_ = void 0;
  416. }
  417. };
  418. }
  419. hookOnce(name, function_) {
  420. let _unreg;
  421. let _function = (...arguments_) => {
  422. if (typeof _unreg === "function") {
  423. _unreg();
  424. }
  425. _unreg = void 0;
  426. _function = void 0;
  427. return function_(...arguments_);
  428. };
  429. _unreg = this.hook(name, _function);
  430. return _unreg;
  431. }
  432. removeHook(name, function_) {
  433. if (this._hooks[name]) {
  434. const index = this._hooks[name].indexOf(function_);
  435. if (index !== -1) {
  436. this._hooks[name].splice(index, 1);
  437. }
  438. if (this._hooks[name].length === 0) {
  439. delete this._hooks[name];
  440. }
  441. }
  442. }
  443. deprecateHook(name, deprecated) {
  444. this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
  445. const _hooks = this._hooks[name] || [];
  446. delete this._hooks[name];
  447. for (const hook2 of _hooks) {
  448. this.hook(name, hook2);
  449. }
  450. }
  451. deprecateHooks(deprecatedHooks) {
  452. Object.assign(this._deprecatedHooks, deprecatedHooks);
  453. for (const name in deprecatedHooks) {
  454. this.deprecateHook(name, deprecatedHooks[name]);
  455. }
  456. }
  457. addHooks(configHooks) {
  458. const hooks2 = flatHooks(configHooks);
  459. const removeFns = Object.keys(hooks2).map(
  460. (key) => this.hook(key, hooks2[key])
  461. );
  462. return () => {
  463. for (const unreg of removeFns.splice(0, removeFns.length)) {
  464. unreg();
  465. }
  466. };
  467. }
  468. removeHooks(configHooks) {
  469. const hooks2 = flatHooks(configHooks);
  470. for (const key in hooks2) {
  471. this.removeHook(key, hooks2[key]);
  472. }
  473. }
  474. removeAllHooks() {
  475. for (const key in this._hooks) {
  476. delete this._hooks[key];
  477. }
  478. }
  479. callHook(name, ...arguments_) {
  480. arguments_.unshift(name);
  481. return this.callHookWith(serialTaskCaller, name, ...arguments_);
  482. }
  483. callHookParallel(name, ...arguments_) {
  484. arguments_.unshift(name);
  485. return this.callHookWith(parallelTaskCaller, name, ...arguments_);
  486. }
  487. callHookWith(caller, name, ...arguments_) {
  488. const event = this._before || this._after ? { name, args: arguments_, context: {} } : void 0;
  489. if (this._before) {
  490. callEachWith(this._before, event);
  491. }
  492. const result = caller(
  493. name in this._hooks ? [...this._hooks[name]] : [],
  494. arguments_
  495. );
  496. if (result instanceof Promise) {
  497. return result.finally(() => {
  498. if (this._after && event) {
  499. callEachWith(this._after, event);
  500. }
  501. });
  502. }
  503. if (this._after && event) {
  504. callEachWith(this._after, event);
  505. }
  506. return result;
  507. }
  508. beforeEach(function_) {
  509. this._before = this._before || [];
  510. this._before.push(function_);
  511. return () => {
  512. if (this._before !== void 0) {
  513. const index = this._before.indexOf(function_);
  514. if (index !== -1) {
  515. this._before.splice(index, 1);
  516. }
  517. }
  518. };
  519. }
  520. afterEach(function_) {
  521. this._after = this._after || [];
  522. this._after.push(function_);
  523. return () => {
  524. if (this._after !== void 0) {
  525. const index = this._after.indexOf(function_);
  526. if (index !== -1) {
  527. this._after.splice(index, 1);
  528. }
  529. }
  530. };
  531. }
  532. };
  533. function createHooks() {
  534. return new Hookable();
  535. }
  536. // node_modules/birpc/dist/index.mjs
  537. var { clearTimeout: clearTimeout2, setTimeout: setTimeout2 } = globalThis;
  538. var random = Math.random.bind(Math);
  539. // node_modules/@vue/devtools-kit/dist/index.js
  540. var __create2 = Object.create;
  541. var __defProp2 = Object.defineProperty;
  542. var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
  543. var __getOwnPropNames2 = Object.getOwnPropertyNames;
  544. var __getProtoOf2 = Object.getPrototypeOf;
  545. var __hasOwnProp2 = Object.prototype.hasOwnProperty;
  546. var __esm2 = (fn, res) => function __init() {
  547. return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
  548. };
  549. var __commonJS2 = (cb, mod) => function __require() {
  550. return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  551. };
  552. var __copyProps2 = (to, from, except, desc) => {
  553. if (from && typeof from === "object" || typeof from === "function") {
  554. for (let key of __getOwnPropNames2(from))
  555. if (!__hasOwnProp2.call(to, key) && key !== except)
  556. __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
  557. }
  558. return to;
  559. };
  560. var __toESM2 = (mod, isNodeMode, target22) => (target22 = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
  561. // If the importer is in node compatibility mode or this is not an ESM
  562. // file that has been converted to a CommonJS file using a Babel-
  563. // compatible transform (i.e. "__esModule" has not been set), then set
  564. // "default" to the CommonJS "module.exports" for node compatibility.
  565. isNodeMode || !mod || !mod.__esModule ? __defProp2(target22, "default", { value: mod, enumerable: true }) : target22,
  566. mod
  567. ));
  568. var init_esm_shims2 = __esm2({
  569. "../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"() {
  570. "use strict";
  571. }
  572. });
  573. var require_speakingurl = __commonJS2({
  574. "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(exports, module) {
  575. "use strict";
  576. init_esm_shims2();
  577. (function(root) {
  578. "use strict";
  579. var charMap = {
  580. // latin
  581. "À": "A",
  582. "Á": "A",
  583. "Â": "A",
  584. "Ã": "A",
  585. "Ä": "Ae",
  586. "Å": "A",
  587. "Æ": "AE",
  588. "Ç": "C",
  589. "È": "E",
  590. "É": "E",
  591. "Ê": "E",
  592. "Ë": "E",
  593. "Ì": "I",
  594. "Í": "I",
  595. "Î": "I",
  596. "Ï": "I",
  597. "Ð": "D",
  598. "Ñ": "N",
  599. "Ò": "O",
  600. "Ó": "O",
  601. "Ô": "O",
  602. "Õ": "O",
  603. "Ö": "Oe",
  604. "Ő": "O",
  605. "Ø": "O",
  606. "Ù": "U",
  607. "Ú": "U",
  608. "Û": "U",
  609. "Ü": "Ue",
  610. "Ű": "U",
  611. "Ý": "Y",
  612. "Þ": "TH",
  613. "ß": "ss",
  614. "à": "a",
  615. "á": "a",
  616. "â": "a",
  617. "ã": "a",
  618. "ä": "ae",
  619. "å": "a",
  620. "æ": "ae",
  621. "ç": "c",
  622. "è": "e",
  623. "é": "e",
  624. "ê": "e",
  625. "ë": "e",
  626. "ì": "i",
  627. "í": "i",
  628. "î": "i",
  629. "ï": "i",
  630. "ð": "d",
  631. "ñ": "n",
  632. "ò": "o",
  633. "ó": "o",
  634. "ô": "o",
  635. "õ": "o",
  636. "ö": "oe",
  637. "ő": "o",
  638. "ø": "o",
  639. "ù": "u",
  640. "ú": "u",
  641. "û": "u",
  642. "ü": "ue",
  643. "ű": "u",
  644. "ý": "y",
  645. "þ": "th",
  646. "ÿ": "y",
  647. "ẞ": "SS",
  648. // language specific
  649. // Arabic
  650. "ا": "a",
  651. "أ": "a",
  652. "إ": "i",
  653. "آ": "aa",
  654. "ؤ": "u",
  655. "ئ": "e",
  656. "ء": "a",
  657. "ب": "b",
  658. "ت": "t",
  659. "ث": "th",
  660. "ج": "j",
  661. "ح": "h",
  662. "خ": "kh",
  663. "د": "d",
  664. "ذ": "th",
  665. "ر": "r",
  666. "ز": "z",
  667. "س": "s",
  668. "ش": "sh",
  669. "ص": "s",
  670. "ض": "dh",
  671. "ط": "t",
  672. "ظ": "z",
  673. "ع": "a",
  674. "غ": "gh",
  675. "ف": "f",
  676. "ق": "q",
  677. "ك": "k",
  678. "ل": "l",
  679. "م": "m",
  680. "ن": "n",
  681. "ه": "h",
  682. "و": "w",
  683. "ي": "y",
  684. "ى": "a",
  685. "ة": "h",
  686. "ﻻ": "la",
  687. "ﻷ": "laa",
  688. "ﻹ": "lai",
  689. "ﻵ": "laa",
  690. // Persian additional characters than Arabic
  691. "گ": "g",
  692. "چ": "ch",
  693. "پ": "p",
  694. "ژ": "zh",
  695. "ک": "k",
  696. "ی": "y",
  697. // Arabic diactrics
  698. "َ": "a",
  699. "ً": "an",
  700. "ِ": "e",
  701. "ٍ": "en",
  702. "ُ": "u",
  703. "ٌ": "on",
  704. "ْ": "",
  705. // Arabic numbers
  706. "٠": "0",
  707. "١": "1",
  708. "٢": "2",
  709. "٣": "3",
  710. "٤": "4",
  711. "٥": "5",
  712. "٦": "6",
  713. "٧": "7",
  714. "٨": "8",
  715. "٩": "9",
  716. // Persian numbers
  717. "۰": "0",
  718. "۱": "1",
  719. "۲": "2",
  720. "۳": "3",
  721. "۴": "4",
  722. "۵": "5",
  723. "۶": "6",
  724. "۷": "7",
  725. "۸": "8",
  726. "۹": "9",
  727. // Burmese consonants
  728. "က": "k",
  729. "ခ": "kh",
  730. "ဂ": "g",
  731. "ဃ": "ga",
  732. "င": "ng",
  733. "စ": "s",
  734. "ဆ": "sa",
  735. "ဇ": "z",
  736. "စျ": "za",
  737. "ည": "ny",
  738. "ဋ": "t",
  739. "ဌ": "ta",
  740. "ဍ": "d",
  741. "ဎ": "da",
  742. "ဏ": "na",
  743. "တ": "t",
  744. "ထ": "ta",
  745. "ဒ": "d",
  746. "ဓ": "da",
  747. "န": "n",
  748. "ပ": "p",
  749. "ဖ": "pa",
  750. "ဗ": "b",
  751. "ဘ": "ba",
  752. "မ": "m",
  753. "ယ": "y",
  754. "ရ": "ya",
  755. "လ": "l",
  756. "ဝ": "w",
  757. "သ": "th",
  758. "ဟ": "h",
  759. "ဠ": "la",
  760. "အ": "a",
  761. // consonant character combos
  762. "ြ": "y",
  763. "ျ": "ya",
  764. "ွ": "w",
  765. "ြွ": "yw",
  766. "ျွ": "ywa",
  767. "ှ": "h",
  768. // independent vowels
  769. "ဧ": "e",
  770. "၏": "-e",
  771. "ဣ": "i",
  772. "ဤ": "-i",
  773. "ဉ": "u",
  774. "ဦ": "-u",
  775. "ဩ": "aw",
  776. "သြော": "aw",
  777. "ဪ": "aw",
  778. // numbers
  779. "၀": "0",
  780. "၁": "1",
  781. "၂": "2",
  782. "၃": "3",
  783. "၄": "4",
  784. "၅": "5",
  785. "၆": "6",
  786. "၇": "7",
  787. "၈": "8",
  788. "၉": "9",
  789. // virama and tone marks which are silent in transliteration
  790. "္": "",
  791. "့": "",
  792. "း": "",
  793. // Czech
  794. "č": "c",
  795. "ď": "d",
  796. "ě": "e",
  797. "ň": "n",
  798. "ř": "r",
  799. "š": "s",
  800. "ť": "t",
  801. "ů": "u",
  802. "ž": "z",
  803. "Č": "C",
  804. "Ď": "D",
  805. "Ě": "E",
  806. "Ň": "N",
  807. "Ř": "R",
  808. "Š": "S",
  809. "Ť": "T",
  810. "Ů": "U",
  811. "Ž": "Z",
  812. // Dhivehi
  813. "ހ": "h",
  814. "ށ": "sh",
  815. "ނ": "n",
  816. "ރ": "r",
  817. "ބ": "b",
  818. "ޅ": "lh",
  819. "ކ": "k",
  820. "އ": "a",
  821. "ވ": "v",
  822. "މ": "m",
  823. "ފ": "f",
  824. "ދ": "dh",
  825. "ތ": "th",
  826. "ލ": "l",
  827. "ގ": "g",
  828. "ޏ": "gn",
  829. "ސ": "s",
  830. "ޑ": "d",
  831. "ޒ": "z",
  832. "ޓ": "t",
  833. "ޔ": "y",
  834. "ޕ": "p",
  835. "ޖ": "j",
  836. "ޗ": "ch",
  837. "ޘ": "tt",
  838. "ޙ": "hh",
  839. "ޚ": "kh",
  840. "ޛ": "th",
  841. "ޜ": "z",
  842. "ޝ": "sh",
  843. "ޞ": "s",
  844. "ޟ": "d",
  845. "ޠ": "t",
  846. "ޡ": "z",
  847. "ޢ": "a",
  848. "ޣ": "gh",
  849. "ޤ": "q",
  850. "ޥ": "w",
  851. "ަ": "a",
  852. "ާ": "aa",
  853. "ި": "i",
  854. "ީ": "ee",
  855. "ު": "u",
  856. "ޫ": "oo",
  857. "ެ": "e",
  858. "ޭ": "ey",
  859. "ޮ": "o",
  860. "ޯ": "oa",
  861. "ް": "",
  862. // Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian
  863. // National system (2002)
  864. "ა": "a",
  865. "ბ": "b",
  866. "გ": "g",
  867. "დ": "d",
  868. "ე": "e",
  869. "ვ": "v",
  870. "ზ": "z",
  871. "თ": "t",
  872. "ი": "i",
  873. "კ": "k",
  874. "ლ": "l",
  875. "მ": "m",
  876. "ნ": "n",
  877. "ო": "o",
  878. "პ": "p",
  879. "ჟ": "zh",
  880. "რ": "r",
  881. "ს": "s",
  882. "ტ": "t",
  883. "უ": "u",
  884. "ფ": "p",
  885. "ქ": "k",
  886. "ღ": "gh",
  887. "ყ": "q",
  888. "შ": "sh",
  889. "ჩ": "ch",
  890. "ც": "ts",
  891. "ძ": "dz",
  892. "წ": "ts",
  893. "ჭ": "ch",
  894. "ხ": "kh",
  895. "ჯ": "j",
  896. "ჰ": "h",
  897. // Greek
  898. "α": "a",
  899. "β": "v",
  900. "γ": "g",
  901. "δ": "d",
  902. "ε": "e",
  903. "ζ": "z",
  904. "η": "i",
  905. "θ": "th",
  906. "ι": "i",
  907. "κ": "k",
  908. "λ": "l",
  909. "μ": "m",
  910. "ν": "n",
  911. "ξ": "ks",
  912. "ο": "o",
  913. "π": "p",
  914. "ρ": "r",
  915. "σ": "s",
  916. "τ": "t",
  917. "υ": "y",
  918. "φ": "f",
  919. "χ": "x",
  920. "ψ": "ps",
  921. "ω": "o",
  922. "ά": "a",
  923. "έ": "e",
  924. "ί": "i",
  925. "ό": "o",
  926. "ύ": "y",
  927. "ή": "i",
  928. "ώ": "o",
  929. "ς": "s",
  930. "ϊ": "i",
  931. "ΰ": "y",
  932. "ϋ": "y",
  933. "ΐ": "i",
  934. "Α": "A",
  935. "Β": "B",
  936. "Γ": "G",
  937. "Δ": "D",
  938. "Ε": "E",
  939. "Ζ": "Z",
  940. "Η": "I",
  941. "Θ": "TH",
  942. "Ι": "I",
  943. "Κ": "K",
  944. "Λ": "L",
  945. "Μ": "M",
  946. "Ν": "N",
  947. "Ξ": "KS",
  948. "Ο": "O",
  949. "Π": "P",
  950. "Ρ": "R",
  951. "Σ": "S",
  952. "Τ": "T",
  953. "Υ": "Y",
  954. "Φ": "F",
  955. "Χ": "X",
  956. "Ψ": "PS",
  957. "Ω": "O",
  958. "Ά": "A",
  959. "Έ": "E",
  960. "Ί": "I",
  961. "Ό": "O",
  962. "Ύ": "Y",
  963. "Ή": "I",
  964. "Ώ": "O",
  965. "Ϊ": "I",
  966. "Ϋ": "Y",
  967. // Latvian
  968. "ā": "a",
  969. // 'č': 'c', // duplicate
  970. "ē": "e",
  971. "ģ": "g",
  972. "ī": "i",
  973. "ķ": "k",
  974. "ļ": "l",
  975. "ņ": "n",
  976. // 'š': 's', // duplicate
  977. "ū": "u",
  978. // 'ž': 'z', // duplicate
  979. "Ā": "A",
  980. // 'Č': 'C', // duplicate
  981. "Ē": "E",
  982. "Ģ": "G",
  983. "Ī": "I",
  984. "Ķ": "k",
  985. "Ļ": "L",
  986. "Ņ": "N",
  987. // 'Š': 'S', // duplicate
  988. "Ū": "U",
  989. // 'Ž': 'Z', // duplicate
  990. // Macedonian
  991. "Ќ": "Kj",
  992. "ќ": "kj",
  993. "Љ": "Lj",
  994. "љ": "lj",
  995. "Њ": "Nj",
  996. "њ": "nj",
  997. "Тс": "Ts",
  998. "тс": "ts",
  999. // Polish
  1000. "ą": "a",
  1001. "ć": "c",
  1002. "ę": "e",
  1003. "ł": "l",
  1004. "ń": "n",
  1005. // 'ó': 'o', // duplicate
  1006. "ś": "s",
  1007. "ź": "z",
  1008. "ż": "z",
  1009. "Ą": "A",
  1010. "Ć": "C",
  1011. "Ę": "E",
  1012. "Ł": "L",
  1013. "Ń": "N",
  1014. "Ś": "S",
  1015. "Ź": "Z",
  1016. "Ż": "Z",
  1017. // Ukranian
  1018. "Є": "Ye",
  1019. "І": "I",
  1020. "Ї": "Yi",
  1021. "Ґ": "G",
  1022. "є": "ye",
  1023. "і": "i",
  1024. "ї": "yi",
  1025. "ґ": "g",
  1026. // Romanian
  1027. "ă": "a",
  1028. "Ă": "A",
  1029. "ș": "s",
  1030. "Ș": "S",
  1031. // 'ş': 's', // duplicate
  1032. // 'Ş': 'S', // duplicate
  1033. "ț": "t",
  1034. "Ț": "T",
  1035. "ţ": "t",
  1036. "Ţ": "T",
  1037. // Russian https://en.wikipedia.org/wiki/Romanization_of_Russian
  1038. // ICAO
  1039. "а": "a",
  1040. "б": "b",
  1041. "в": "v",
  1042. "г": "g",
  1043. "д": "d",
  1044. "е": "e",
  1045. "ё": "yo",
  1046. "ж": "zh",
  1047. "з": "z",
  1048. "и": "i",
  1049. "й": "i",
  1050. "к": "k",
  1051. "л": "l",
  1052. "м": "m",
  1053. "н": "n",
  1054. "о": "o",
  1055. "п": "p",
  1056. "р": "r",
  1057. "с": "s",
  1058. "т": "t",
  1059. "у": "u",
  1060. "ф": "f",
  1061. "х": "kh",
  1062. "ц": "c",
  1063. "ч": "ch",
  1064. "ш": "sh",
  1065. "щ": "sh",
  1066. "ъ": "",
  1067. "ы": "y",
  1068. "ь": "",
  1069. "э": "e",
  1070. "ю": "yu",
  1071. "я": "ya",
  1072. "А": "A",
  1073. "Б": "B",
  1074. "В": "V",
  1075. "Г": "G",
  1076. "Д": "D",
  1077. "Е": "E",
  1078. "Ё": "Yo",
  1079. "Ж": "Zh",
  1080. "З": "Z",
  1081. "И": "I",
  1082. "Й": "I",
  1083. "К": "K",
  1084. "Л": "L",
  1085. "М": "M",
  1086. "Н": "N",
  1087. "О": "O",
  1088. "П": "P",
  1089. "Р": "R",
  1090. "С": "S",
  1091. "Т": "T",
  1092. "У": "U",
  1093. "Ф": "F",
  1094. "Х": "Kh",
  1095. "Ц": "C",
  1096. "Ч": "Ch",
  1097. "Ш": "Sh",
  1098. "Щ": "Sh",
  1099. "Ъ": "",
  1100. "Ы": "Y",
  1101. "Ь": "",
  1102. "Э": "E",
  1103. "Ю": "Yu",
  1104. "Я": "Ya",
  1105. // Serbian
  1106. "ђ": "dj",
  1107. "ј": "j",
  1108. // 'љ': 'lj', // duplicate
  1109. // 'њ': 'nj', // duplicate
  1110. "ћ": "c",
  1111. "џ": "dz",
  1112. "Ђ": "Dj",
  1113. "Ј": "j",
  1114. // 'Љ': 'Lj', // duplicate
  1115. // 'Њ': 'Nj', // duplicate
  1116. "Ћ": "C",
  1117. "Џ": "Dz",
  1118. // Slovak
  1119. "ľ": "l",
  1120. "ĺ": "l",
  1121. "ŕ": "r",
  1122. "Ľ": "L",
  1123. "Ĺ": "L",
  1124. "Ŕ": "R",
  1125. // Turkish
  1126. "ş": "s",
  1127. "Ş": "S",
  1128. "ı": "i",
  1129. "İ": "I",
  1130. // 'ç': 'c', // duplicate
  1131. // 'Ç': 'C', // duplicate
  1132. // 'ü': 'u', // duplicate, see langCharMap
  1133. // 'Ü': 'U', // duplicate, see langCharMap
  1134. // 'ö': 'o', // duplicate, see langCharMap
  1135. // 'Ö': 'O', // duplicate, see langCharMap
  1136. "ğ": "g",
  1137. "Ğ": "G",
  1138. // Vietnamese
  1139. "ả": "a",
  1140. "Ả": "A",
  1141. "ẳ": "a",
  1142. "Ẳ": "A",
  1143. "ẩ": "a",
  1144. "Ẩ": "A",
  1145. "đ": "d",
  1146. "Đ": "D",
  1147. "ẹ": "e",
  1148. "Ẹ": "E",
  1149. "ẽ": "e",
  1150. "Ẽ": "E",
  1151. "ẻ": "e",
  1152. "Ẻ": "E",
  1153. "ế": "e",
  1154. "Ế": "E",
  1155. "ề": "e",
  1156. "Ề": "E",
  1157. "ệ": "e",
  1158. "Ệ": "E",
  1159. "ễ": "e",
  1160. "Ễ": "E",
  1161. "ể": "e",
  1162. "Ể": "E",
  1163. "ỏ": "o",
  1164. "ọ": "o",
  1165. "Ọ": "o",
  1166. "ố": "o",
  1167. "Ố": "O",
  1168. "ồ": "o",
  1169. "Ồ": "O",
  1170. "ổ": "o",
  1171. "Ổ": "O",
  1172. "ộ": "o",
  1173. "Ộ": "O",
  1174. "ỗ": "o",
  1175. "Ỗ": "O",
  1176. "ơ": "o",
  1177. "Ơ": "O",
  1178. "ớ": "o",
  1179. "Ớ": "O",
  1180. "ờ": "o",
  1181. "Ờ": "O",
  1182. "ợ": "o",
  1183. "Ợ": "O",
  1184. "ỡ": "o",
  1185. "Ỡ": "O",
  1186. "Ở": "o",
  1187. "ở": "o",
  1188. "ị": "i",
  1189. "Ị": "I",
  1190. "ĩ": "i",
  1191. "Ĩ": "I",
  1192. "ỉ": "i",
  1193. "Ỉ": "i",
  1194. "ủ": "u",
  1195. "Ủ": "U",
  1196. "ụ": "u",
  1197. "Ụ": "U",
  1198. "ũ": "u",
  1199. "Ũ": "U",
  1200. "ư": "u",
  1201. "Ư": "U",
  1202. "ứ": "u",
  1203. "Ứ": "U",
  1204. "ừ": "u",
  1205. "Ừ": "U",
  1206. "ự": "u",
  1207. "Ự": "U",
  1208. "ữ": "u",
  1209. "Ữ": "U",
  1210. "ử": "u",
  1211. "Ử": "ư",
  1212. "ỷ": "y",
  1213. "Ỷ": "y",
  1214. "ỳ": "y",
  1215. "Ỳ": "Y",
  1216. "ỵ": "y",
  1217. "Ỵ": "Y",
  1218. "ỹ": "y",
  1219. "Ỹ": "Y",
  1220. "ạ": "a",
  1221. "Ạ": "A",
  1222. "ấ": "a",
  1223. "Ấ": "A",
  1224. "ầ": "a",
  1225. "Ầ": "A",
  1226. "ậ": "a",
  1227. "Ậ": "A",
  1228. "ẫ": "a",
  1229. "Ẫ": "A",
  1230. // 'ă': 'a', // duplicate
  1231. // 'Ă': 'A', // duplicate
  1232. "ắ": "a",
  1233. "Ắ": "A",
  1234. "ằ": "a",
  1235. "Ằ": "A",
  1236. "ặ": "a",
  1237. "Ặ": "A",
  1238. "ẵ": "a",
  1239. "Ẵ": "A",
  1240. "⓪": "0",
  1241. "①": "1",
  1242. "②": "2",
  1243. "③": "3",
  1244. "④": "4",
  1245. "⑤": "5",
  1246. "⑥": "6",
  1247. "⑦": "7",
  1248. "⑧": "8",
  1249. "⑨": "9",
  1250. "⑩": "10",
  1251. "⑪": "11",
  1252. "⑫": "12",
  1253. "⑬": "13",
  1254. "⑭": "14",
  1255. "⑮": "15",
  1256. "⑯": "16",
  1257. "⑰": "17",
  1258. "⑱": "18",
  1259. "⑲": "18",
  1260. "⑳": "18",
  1261. "⓵": "1",
  1262. "⓶": "2",
  1263. "⓷": "3",
  1264. "⓸": "4",
  1265. "⓹": "5",
  1266. "⓺": "6",
  1267. "⓻": "7",
  1268. "⓼": "8",
  1269. "⓽": "9",
  1270. "⓾": "10",
  1271. "⓿": "0",
  1272. "⓫": "11",
  1273. "⓬": "12",
  1274. "⓭": "13",
  1275. "⓮": "14",
  1276. "⓯": "15",
  1277. "⓰": "16",
  1278. "⓱": "17",
  1279. "⓲": "18",
  1280. "⓳": "19",
  1281. "⓴": "20",
  1282. "Ⓐ": "A",
  1283. "Ⓑ": "B",
  1284. "Ⓒ": "C",
  1285. "Ⓓ": "D",
  1286. "Ⓔ": "E",
  1287. "Ⓕ": "F",
  1288. "Ⓖ": "G",
  1289. "Ⓗ": "H",
  1290. "Ⓘ": "I",
  1291. "Ⓙ": "J",
  1292. "Ⓚ": "K",
  1293. "Ⓛ": "L",
  1294. "Ⓜ": "M",
  1295. "Ⓝ": "N",
  1296. "Ⓞ": "O",
  1297. "Ⓟ": "P",
  1298. "Ⓠ": "Q",
  1299. "Ⓡ": "R",
  1300. "Ⓢ": "S",
  1301. "Ⓣ": "T",
  1302. "Ⓤ": "U",
  1303. "Ⓥ": "V",
  1304. "Ⓦ": "W",
  1305. "Ⓧ": "X",
  1306. "Ⓨ": "Y",
  1307. "Ⓩ": "Z",
  1308. "ⓐ": "a",
  1309. "ⓑ": "b",
  1310. "ⓒ": "c",
  1311. "ⓓ": "d",
  1312. "ⓔ": "e",
  1313. "ⓕ": "f",
  1314. "ⓖ": "g",
  1315. "ⓗ": "h",
  1316. "ⓘ": "i",
  1317. "ⓙ": "j",
  1318. "ⓚ": "k",
  1319. "ⓛ": "l",
  1320. "ⓜ": "m",
  1321. "ⓝ": "n",
  1322. "ⓞ": "o",
  1323. "ⓟ": "p",
  1324. "ⓠ": "q",
  1325. "ⓡ": "r",
  1326. "ⓢ": "s",
  1327. "ⓣ": "t",
  1328. "ⓤ": "u",
  1329. "ⓦ": "v",
  1330. "ⓥ": "w",
  1331. "ⓧ": "x",
  1332. "ⓨ": "y",
  1333. "ⓩ": "z",
  1334. // symbols
  1335. "“": '"',
  1336. "”": '"',
  1337. "‘": "'",
  1338. "’": "'",
  1339. "∂": "d",
  1340. "ƒ": "f",
  1341. "™": "(TM)",
  1342. "©": "(C)",
  1343. "œ": "oe",
  1344. "Œ": "OE",
  1345. "®": "(R)",
  1346. "†": "+",
  1347. "℠": "(SM)",
  1348. "…": "...",
  1349. "˚": "o",
  1350. "º": "o",
  1351. "ª": "a",
  1352. "•": "*",
  1353. "၊": ",",
  1354. "။": ".",
  1355. // currency
  1356. "$": "USD",
  1357. "€": "EUR",
  1358. "₢": "BRN",
  1359. "₣": "FRF",
  1360. "£": "GBP",
  1361. "₤": "ITL",
  1362. "₦": "NGN",
  1363. "₧": "ESP",
  1364. "₩": "KRW",
  1365. "₪": "ILS",
  1366. "₫": "VND",
  1367. "₭": "LAK",
  1368. "₮": "MNT",
  1369. "₯": "GRD",
  1370. "₱": "ARS",
  1371. "₲": "PYG",
  1372. "₳": "ARA",
  1373. "₴": "UAH",
  1374. "₵": "GHS",
  1375. "¢": "cent",
  1376. "¥": "CNY",
  1377. "元": "CNY",
  1378. "円": "YEN",
  1379. "﷼": "IRR",
  1380. "₠": "EWE",
  1381. "฿": "THB",
  1382. "₨": "INR",
  1383. "₹": "INR",
  1384. "₰": "PF",
  1385. "₺": "TRY",
  1386. "؋": "AFN",
  1387. "₼": "AZN",
  1388. "лв": "BGN",
  1389. "៛": "KHR",
  1390. "₡": "CRC",
  1391. "₸": "KZT",
  1392. "ден": "MKD",
  1393. "zł": "PLN",
  1394. "₽": "RUB",
  1395. "₾": "GEL"
  1396. };
  1397. var lookAheadCharArray = [
  1398. // burmese
  1399. "်",
  1400. // Dhivehi
  1401. "ް"
  1402. ];
  1403. var diatricMap = {
  1404. // Burmese
  1405. // dependent vowels
  1406. "ာ": "a",
  1407. "ါ": "a",
  1408. "ေ": "e",
  1409. "ဲ": "e",
  1410. "ိ": "i",
  1411. "ီ": "i",
  1412. "ို": "o",
  1413. "ု": "u",
  1414. "ူ": "u",
  1415. "ေါင်": "aung",
  1416. "ော": "aw",
  1417. "ော်": "aw",
  1418. "ေါ": "aw",
  1419. "ေါ်": "aw",
  1420. "်": "်",
  1421. // this is special case but the character will be converted to latin in the code
  1422. "က်": "et",
  1423. "ိုက်": "aik",
  1424. "ောက်": "auk",
  1425. "င်": "in",
  1426. "ိုင်": "aing",
  1427. "ောင်": "aung",
  1428. "စ်": "it",
  1429. "ည်": "i",
  1430. "တ်": "at",
  1431. "ိတ်": "eik",
  1432. "ုတ်": "ok",
  1433. "ွတ်": "ut",
  1434. "ေတ်": "it",
  1435. "ဒ်": "d",
  1436. "ိုဒ်": "ok",
  1437. "ုဒ်": "ait",
  1438. "န်": "an",
  1439. "ာန်": "an",
  1440. "ိန်": "ein",
  1441. "ုန်": "on",
  1442. "ွန်": "un",
  1443. "ပ်": "at",
  1444. "ိပ်": "eik",
  1445. "ုပ်": "ok",
  1446. "ွပ်": "ut",
  1447. "န်ုပ်": "nub",
  1448. "မ်": "an",
  1449. "ိမ်": "ein",
  1450. "ုမ်": "on",
  1451. "ွမ်": "un",
  1452. "ယ်": "e",
  1453. "ိုလ်": "ol",
  1454. "ဉ်": "in",
  1455. "ံ": "an",
  1456. "ိံ": "ein",
  1457. "ုံ": "on",
  1458. // Dhivehi
  1459. "ައް": "ah",
  1460. "ަށް": "ah"
  1461. };
  1462. var langCharMap = {
  1463. "en": {},
  1464. // default language
  1465. "az": {
  1466. // Azerbaijani
  1467. "ç": "c",
  1468. "ə": "e",
  1469. "ğ": "g",
  1470. "ı": "i",
  1471. "ö": "o",
  1472. "ş": "s",
  1473. "ü": "u",
  1474. "Ç": "C",
  1475. "Ə": "E",
  1476. "Ğ": "G",
  1477. "İ": "I",
  1478. "Ö": "O",
  1479. "Ş": "S",
  1480. "Ü": "U"
  1481. },
  1482. "cs": {
  1483. // Czech
  1484. "č": "c",
  1485. "ď": "d",
  1486. "ě": "e",
  1487. "ň": "n",
  1488. "ř": "r",
  1489. "š": "s",
  1490. "ť": "t",
  1491. "ů": "u",
  1492. "ž": "z",
  1493. "Č": "C",
  1494. "Ď": "D",
  1495. "Ě": "E",
  1496. "Ň": "N",
  1497. "Ř": "R",
  1498. "Š": "S",
  1499. "Ť": "T",
  1500. "Ů": "U",
  1501. "Ž": "Z"
  1502. },
  1503. "fi": {
  1504. // Finnish
  1505. // 'å': 'a', duplicate see charMap/latin
  1506. // 'Å': 'A', duplicate see charMap/latin
  1507. "ä": "a",
  1508. // ok
  1509. "Ä": "A",
  1510. // ok
  1511. "ö": "o",
  1512. // ok
  1513. "Ö": "O"
  1514. // ok
  1515. },
  1516. "hu": {
  1517. // Hungarian
  1518. "ä": "a",
  1519. // ok
  1520. "Ä": "A",
  1521. // ok
  1522. // 'á': 'a', duplicate see charMap/latin
  1523. // 'Á': 'A', duplicate see charMap/latin
  1524. "ö": "o",
  1525. // ok
  1526. "Ö": "O",
  1527. // ok
  1528. // 'ő': 'o', duplicate see charMap/latin
  1529. // 'Ő': 'O', duplicate see charMap/latin
  1530. "ü": "u",
  1531. "Ü": "U",
  1532. "ű": "u",
  1533. "Ű": "U"
  1534. },
  1535. "lt": {
  1536. // Lithuanian
  1537. "ą": "a",
  1538. "č": "c",
  1539. "ę": "e",
  1540. "ė": "e",
  1541. "į": "i",
  1542. "š": "s",
  1543. "ų": "u",
  1544. "ū": "u",
  1545. "ž": "z",
  1546. "Ą": "A",
  1547. "Č": "C",
  1548. "Ę": "E",
  1549. "Ė": "E",
  1550. "Į": "I",
  1551. "Š": "S",
  1552. "Ų": "U",
  1553. "Ū": "U"
  1554. },
  1555. "lv": {
  1556. // Latvian
  1557. "ā": "a",
  1558. "č": "c",
  1559. "ē": "e",
  1560. "ģ": "g",
  1561. "ī": "i",
  1562. "ķ": "k",
  1563. "ļ": "l",
  1564. "ņ": "n",
  1565. "š": "s",
  1566. "ū": "u",
  1567. "ž": "z",
  1568. "Ā": "A",
  1569. "Č": "C",
  1570. "Ē": "E",
  1571. "Ģ": "G",
  1572. "Ī": "i",
  1573. "Ķ": "k",
  1574. "Ļ": "L",
  1575. "Ņ": "N",
  1576. "Š": "S",
  1577. "Ū": "u",
  1578. "Ž": "Z"
  1579. },
  1580. "pl": {
  1581. // Polish
  1582. "ą": "a",
  1583. "ć": "c",
  1584. "ę": "e",
  1585. "ł": "l",
  1586. "ń": "n",
  1587. "ó": "o",
  1588. "ś": "s",
  1589. "ź": "z",
  1590. "ż": "z",
  1591. "Ą": "A",
  1592. "Ć": "C",
  1593. "Ę": "e",
  1594. "Ł": "L",
  1595. "Ń": "N",
  1596. "Ó": "O",
  1597. "Ś": "S",
  1598. "Ź": "Z",
  1599. "Ż": "Z"
  1600. },
  1601. "sv": {
  1602. // Swedish
  1603. // 'å': 'a', duplicate see charMap/latin
  1604. // 'Å': 'A', duplicate see charMap/latin
  1605. "ä": "a",
  1606. // ok
  1607. "Ä": "A",
  1608. // ok
  1609. "ö": "o",
  1610. // ok
  1611. "Ö": "O"
  1612. // ok
  1613. },
  1614. "sk": {
  1615. // Slovak
  1616. "ä": "a",
  1617. "Ä": "A"
  1618. },
  1619. "sr": {
  1620. // Serbian
  1621. "љ": "lj",
  1622. "њ": "nj",
  1623. "Љ": "Lj",
  1624. "Њ": "Nj",
  1625. "đ": "dj",
  1626. "Đ": "Dj"
  1627. },
  1628. "tr": {
  1629. // Turkish
  1630. "Ü": "U",
  1631. "Ö": "O",
  1632. "ü": "u",
  1633. "ö": "o"
  1634. }
  1635. };
  1636. var symbolMap = {
  1637. "ar": {
  1638. "∆": "delta",
  1639. "∞": "la-nihaya",
  1640. "♥": "hob",
  1641. "&": "wa",
  1642. "|": "aw",
  1643. "<": "aqal-men",
  1644. ">": "akbar-men",
  1645. "∑": "majmou",
  1646. "¤": "omla"
  1647. },
  1648. "az": {},
  1649. "ca": {
  1650. "∆": "delta",
  1651. "∞": "infinit",
  1652. "♥": "amor",
  1653. "&": "i",
  1654. "|": "o",
  1655. "<": "menys que",
  1656. ">": "mes que",
  1657. "∑": "suma dels",
  1658. "¤": "moneda"
  1659. },
  1660. "cs": {
  1661. "∆": "delta",
  1662. "∞": "nekonecno",
  1663. "♥": "laska",
  1664. "&": "a",
  1665. "|": "nebo",
  1666. "<": "mensi nez",
  1667. ">": "vetsi nez",
  1668. "∑": "soucet",
  1669. "¤": "mena"
  1670. },
  1671. "de": {
  1672. "∆": "delta",
  1673. "∞": "unendlich",
  1674. "♥": "Liebe",
  1675. "&": "und",
  1676. "|": "oder",
  1677. "<": "kleiner als",
  1678. ">": "groesser als",
  1679. "∑": "Summe von",
  1680. "¤": "Waehrung"
  1681. },
  1682. "dv": {
  1683. "∆": "delta",
  1684. "∞": "kolunulaa",
  1685. "♥": "loabi",
  1686. "&": "aai",
  1687. "|": "noonee",
  1688. "<": "ah vure kuda",
  1689. ">": "ah vure bodu",
  1690. "∑": "jumula",
  1691. "¤": "faisaa"
  1692. },
  1693. "en": {
  1694. "∆": "delta",
  1695. "∞": "infinity",
  1696. "♥": "love",
  1697. "&": "and",
  1698. "|": "or",
  1699. "<": "less than",
  1700. ">": "greater than",
  1701. "∑": "sum",
  1702. "¤": "currency"
  1703. },
  1704. "es": {
  1705. "∆": "delta",
  1706. "∞": "infinito",
  1707. "♥": "amor",
  1708. "&": "y",
  1709. "|": "u",
  1710. "<": "menos que",
  1711. ">": "mas que",
  1712. "∑": "suma de los",
  1713. "¤": "moneda"
  1714. },
  1715. "fa": {
  1716. "∆": "delta",
  1717. "∞": "bi-nahayat",
  1718. "♥": "eshgh",
  1719. "&": "va",
  1720. "|": "ya",
  1721. "<": "kamtar-az",
  1722. ">": "bishtar-az",
  1723. "∑": "majmooe",
  1724. "¤": "vahed"
  1725. },
  1726. "fi": {
  1727. "∆": "delta",
  1728. "∞": "aarettomyys",
  1729. "♥": "rakkaus",
  1730. "&": "ja",
  1731. "|": "tai",
  1732. "<": "pienempi kuin",
  1733. ">": "suurempi kuin",
  1734. "∑": "summa",
  1735. "¤": "valuutta"
  1736. },
  1737. "fr": {
  1738. "∆": "delta",
  1739. "∞": "infiniment",
  1740. "♥": "Amour",
  1741. "&": "et",
  1742. "|": "ou",
  1743. "<": "moins que",
  1744. ">": "superieure a",
  1745. "∑": "somme des",
  1746. "¤": "monnaie"
  1747. },
  1748. "ge": {
  1749. "∆": "delta",
  1750. "∞": "usasruloba",
  1751. "♥": "siqvaruli",
  1752. "&": "da",
  1753. "|": "an",
  1754. "<": "naklebi",
  1755. ">": "meti",
  1756. "∑": "jami",
  1757. "¤": "valuta"
  1758. },
  1759. "gr": {},
  1760. "hu": {
  1761. "∆": "delta",
  1762. "∞": "vegtelen",
  1763. "♥": "szerelem",
  1764. "&": "es",
  1765. "|": "vagy",
  1766. "<": "kisebb mint",
  1767. ">": "nagyobb mint",
  1768. "∑": "szumma",
  1769. "¤": "penznem"
  1770. },
  1771. "it": {
  1772. "∆": "delta",
  1773. "∞": "infinito",
  1774. "♥": "amore",
  1775. "&": "e",
  1776. "|": "o",
  1777. "<": "minore di",
  1778. ">": "maggiore di",
  1779. "∑": "somma",
  1780. "¤": "moneta"
  1781. },
  1782. "lt": {
  1783. "∆": "delta",
  1784. "∞": "begalybe",
  1785. "♥": "meile",
  1786. "&": "ir",
  1787. "|": "ar",
  1788. "<": "maziau nei",
  1789. ">": "daugiau nei",
  1790. "∑": "suma",
  1791. "¤": "valiuta"
  1792. },
  1793. "lv": {
  1794. "∆": "delta",
  1795. "∞": "bezgaliba",
  1796. "♥": "milestiba",
  1797. "&": "un",
  1798. "|": "vai",
  1799. "<": "mazak neka",
  1800. ">": "lielaks neka",
  1801. "∑": "summa",
  1802. "¤": "valuta"
  1803. },
  1804. "my": {
  1805. "∆": "kwahkhyaet",
  1806. "∞": "asaonasme",
  1807. "♥": "akhyait",
  1808. "&": "nhin",
  1809. "|": "tho",
  1810. "<": "ngethaw",
  1811. ">": "kyithaw",
  1812. "∑": "paungld",
  1813. "¤": "ngwekye"
  1814. },
  1815. "mk": {},
  1816. "nl": {
  1817. "∆": "delta",
  1818. "∞": "oneindig",
  1819. "♥": "liefde",
  1820. "&": "en",
  1821. "|": "of",
  1822. "<": "kleiner dan",
  1823. ">": "groter dan",
  1824. "∑": "som",
  1825. "¤": "valuta"
  1826. },
  1827. "pl": {
  1828. "∆": "delta",
  1829. "∞": "nieskonczonosc",
  1830. "♥": "milosc",
  1831. "&": "i",
  1832. "|": "lub",
  1833. "<": "mniejsze niz",
  1834. ">": "wieksze niz",
  1835. "∑": "suma",
  1836. "¤": "waluta"
  1837. },
  1838. "pt": {
  1839. "∆": "delta",
  1840. "∞": "infinito",
  1841. "♥": "amor",
  1842. "&": "e",
  1843. "|": "ou",
  1844. "<": "menor que",
  1845. ">": "maior que",
  1846. "∑": "soma",
  1847. "¤": "moeda"
  1848. },
  1849. "ro": {
  1850. "∆": "delta",
  1851. "∞": "infinit",
  1852. "♥": "dragoste",
  1853. "&": "si",
  1854. "|": "sau",
  1855. "<": "mai mic ca",
  1856. ">": "mai mare ca",
  1857. "∑": "suma",
  1858. "¤": "valuta"
  1859. },
  1860. "ru": {
  1861. "∆": "delta",
  1862. "∞": "beskonechno",
  1863. "♥": "lubov",
  1864. "&": "i",
  1865. "|": "ili",
  1866. "<": "menshe",
  1867. ">": "bolshe",
  1868. "∑": "summa",
  1869. "¤": "valjuta"
  1870. },
  1871. "sk": {
  1872. "∆": "delta",
  1873. "∞": "nekonecno",
  1874. "♥": "laska",
  1875. "&": "a",
  1876. "|": "alebo",
  1877. "<": "menej ako",
  1878. ">": "viac ako",
  1879. "∑": "sucet",
  1880. "¤": "mena"
  1881. },
  1882. "sr": {},
  1883. "tr": {
  1884. "∆": "delta",
  1885. "∞": "sonsuzluk",
  1886. "♥": "ask",
  1887. "&": "ve",
  1888. "|": "veya",
  1889. "<": "kucuktur",
  1890. ">": "buyuktur",
  1891. "∑": "toplam",
  1892. "¤": "para birimi"
  1893. },
  1894. "uk": {
  1895. "∆": "delta",
  1896. "∞": "bezkinechnist",
  1897. "♥": "lubov",
  1898. "&": "i",
  1899. "|": "abo",
  1900. "<": "menshe",
  1901. ">": "bilshe",
  1902. "∑": "suma",
  1903. "¤": "valjuta"
  1904. },
  1905. "vn": {
  1906. "∆": "delta",
  1907. "∞": "vo cuc",
  1908. "♥": "yeu",
  1909. "&": "va",
  1910. "|": "hoac",
  1911. "<": "nho hon",
  1912. ">": "lon hon",
  1913. "∑": "tong",
  1914. "¤": "tien te"
  1915. }
  1916. };
  1917. var uricChars = [";", "?", ":", "@", "&", "=", "+", "$", ",", "/"].join("");
  1918. var uricNoSlashChars = [";", "?", ":", "@", "&", "=", "+", "$", ","].join("");
  1919. var markChars = [".", "!", "~", "*", "'", "(", ")"].join("");
  1920. var getSlug = function getSlug2(input, opts) {
  1921. var separator = "-";
  1922. var result = "";
  1923. var diatricString = "";
  1924. var convertSymbols = true;
  1925. var customReplacements = {};
  1926. var maintainCase;
  1927. var titleCase;
  1928. var truncate;
  1929. var uricFlag;
  1930. var uricNoSlashFlag;
  1931. var markFlag;
  1932. var symbol;
  1933. var langChar;
  1934. var lucky;
  1935. var i;
  1936. var ch;
  1937. var l;
  1938. var lastCharWasSymbol;
  1939. var lastCharWasDiatric;
  1940. var allowedChars = "";
  1941. if (typeof input !== "string") {
  1942. return "";
  1943. }
  1944. if (typeof opts === "string") {
  1945. separator = opts;
  1946. }
  1947. symbol = symbolMap.en;
  1948. langChar = langCharMap.en;
  1949. if (typeof opts === "object") {
  1950. maintainCase = opts.maintainCase || false;
  1951. customReplacements = opts.custom && typeof opts.custom === "object" ? opts.custom : customReplacements;
  1952. truncate = +opts.truncate > 1 && opts.truncate || false;
  1953. uricFlag = opts.uric || false;
  1954. uricNoSlashFlag = opts.uricNoSlash || false;
  1955. markFlag = opts.mark || false;
  1956. convertSymbols = opts.symbols === false || opts.lang === false ? false : true;
  1957. separator = opts.separator || separator;
  1958. if (uricFlag) {
  1959. allowedChars += uricChars;
  1960. }
  1961. if (uricNoSlashFlag) {
  1962. allowedChars += uricNoSlashChars;
  1963. }
  1964. if (markFlag) {
  1965. allowedChars += markChars;
  1966. }
  1967. symbol = opts.lang && symbolMap[opts.lang] && convertSymbols ? symbolMap[opts.lang] : convertSymbols ? symbolMap.en : {};
  1968. langChar = opts.lang && langCharMap[opts.lang] ? langCharMap[opts.lang] : opts.lang === false || opts.lang === true ? {} : langCharMap.en;
  1969. if (opts.titleCase && typeof opts.titleCase.length === "number" && Array.prototype.toString.call(opts.titleCase)) {
  1970. opts.titleCase.forEach(function(v) {
  1971. customReplacements[v + ""] = v + "";
  1972. });
  1973. titleCase = true;
  1974. } else {
  1975. titleCase = !!opts.titleCase;
  1976. }
  1977. if (opts.custom && typeof opts.custom.length === "number" && Array.prototype.toString.call(opts.custom)) {
  1978. opts.custom.forEach(function(v) {
  1979. customReplacements[v + ""] = v + "";
  1980. });
  1981. }
  1982. Object.keys(customReplacements).forEach(function(v) {
  1983. var r;
  1984. if (v.length > 1) {
  1985. r = new RegExp("\\b" + escapeChars(v) + "\\b", "gi");
  1986. } else {
  1987. r = new RegExp(escapeChars(v), "gi");
  1988. }
  1989. input = input.replace(r, customReplacements[v]);
  1990. });
  1991. for (ch in customReplacements) {
  1992. allowedChars += ch;
  1993. }
  1994. }
  1995. allowedChars += separator;
  1996. allowedChars = escapeChars(allowedChars);
  1997. input = input.replace(/(^\s+|\s+$)/g, "");
  1998. lastCharWasSymbol = false;
  1999. lastCharWasDiatric = false;
  2000. for (i = 0, l = input.length; i < l; i++) {
  2001. ch = input[i];
  2002. if (isReplacedCustomChar(ch, customReplacements)) {
  2003. lastCharWasSymbol = false;
  2004. } else if (langChar[ch]) {
  2005. ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? " " + langChar[ch] : langChar[ch];
  2006. lastCharWasSymbol = false;
  2007. } else if (ch in charMap) {
  2008. if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {
  2009. diatricString += ch;
  2010. ch = "";
  2011. } else if (lastCharWasDiatric === true) {
  2012. ch = diatricMap[diatricString] + charMap[ch];
  2013. diatricString = "";
  2014. } else {
  2015. ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? " " + charMap[ch] : charMap[ch];
  2016. }
  2017. lastCharWasSymbol = false;
  2018. lastCharWasDiatric = false;
  2019. } else if (ch in diatricMap) {
  2020. diatricString += ch;
  2021. ch = "";
  2022. if (i === l - 1) {
  2023. ch = diatricMap[diatricString];
  2024. }
  2025. lastCharWasDiatric = true;
  2026. } else if (
  2027. // process symbol chars
  2028. symbol[ch] && !(uricFlag && uricChars.indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars.indexOf(ch) !== -1)
  2029. ) {
  2030. ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
  2031. ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : "";
  2032. lastCharWasSymbol = true;
  2033. } else {
  2034. if (lastCharWasDiatric === true) {
  2035. ch = diatricMap[diatricString] + ch;
  2036. diatricString = "";
  2037. lastCharWasDiatric = false;
  2038. } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) {
  2039. ch = " " + ch;
  2040. }
  2041. lastCharWasSymbol = false;
  2042. }
  2043. result += ch.replace(new RegExp("[^\\w\\s" + allowedChars + "_-]", "g"), separator);
  2044. }
  2045. if (titleCase) {
  2046. result = result.replace(/(\w)(\S*)/g, function(_, i2, r) {
  2047. var j = i2.toUpperCase() + (r !== null ? r : "");
  2048. return Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0 ? j : j.toLowerCase();
  2049. });
  2050. }
  2051. result = result.replace(/\s+/g, separator).replace(new RegExp("\\" + separator + "+", "g"), separator).replace(new RegExp("(^\\" + separator + "+|\\" + separator + "+$)", "g"), "");
  2052. if (truncate && result.length > truncate) {
  2053. lucky = result.charAt(truncate) === separator;
  2054. result = result.slice(0, truncate);
  2055. if (!lucky) {
  2056. result = result.slice(0, result.lastIndexOf(separator));
  2057. }
  2058. }
  2059. if (!maintainCase && !titleCase) {
  2060. result = result.toLowerCase();
  2061. }
  2062. return result;
  2063. };
  2064. var createSlug = function createSlug2(opts) {
  2065. return function getSlugWithConfig(input) {
  2066. return getSlug(input, opts);
  2067. };
  2068. };
  2069. var escapeChars = function escapeChars2(input) {
  2070. return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, "\\$&");
  2071. };
  2072. var isReplacedCustomChar = function(ch, customReplacements) {
  2073. for (var c in customReplacements) {
  2074. if (customReplacements[c] === ch) {
  2075. return true;
  2076. }
  2077. }
  2078. };
  2079. if (typeof module !== "undefined" && module.exports) {
  2080. module.exports = getSlug;
  2081. module.exports.createSlug = createSlug;
  2082. } else if (typeof define !== "undefined" && define.amd) {
  2083. define([], function() {
  2084. return getSlug;
  2085. });
  2086. } else {
  2087. try {
  2088. if (root.getSlug || root.createSlug) {
  2089. throw "speakingurl: globals exists /(getSlug|createSlug)/";
  2090. } else {
  2091. root.getSlug = getSlug;
  2092. root.createSlug = createSlug;
  2093. }
  2094. } catch (e) {
  2095. }
  2096. }
  2097. })(exports);
  2098. }
  2099. });
  2100. var require_speakingurl2 = __commonJS2({
  2101. "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js"(exports, module) {
  2102. "use strict";
  2103. init_esm_shims2();
  2104. module.exports = require_speakingurl();
  2105. }
  2106. });
  2107. init_esm_shims2();
  2108. init_esm_shims2();
  2109. init_esm_shims2();
  2110. init_esm_shims2();
  2111. init_esm_shims2();
  2112. init_esm_shims2();
  2113. init_esm_shims2();
  2114. init_esm_shims2();
  2115. function getComponentTypeName(options) {
  2116. var _a25;
  2117. const name = options.name || options._componentTag || options.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ || options.__name;
  2118. if (name === "index" && ((_a25 = options.__file) == null ? void 0 : _a25.endsWith("index.vue"))) {
  2119. return "";
  2120. }
  2121. return name;
  2122. }
  2123. function getComponentFileName(options) {
  2124. const file = options.__file;
  2125. if (file)
  2126. return classify(basename(file, ".vue"));
  2127. }
  2128. function saveComponentGussedName(instance, name) {
  2129. instance.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ = name;
  2130. return name;
  2131. }
  2132. function getAppRecord(instance) {
  2133. if (instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__)
  2134. return instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
  2135. else if (instance.root)
  2136. return instance.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
  2137. }
  2138. function isFragment(instance) {
  2139. var _a25, _b25;
  2140. const subTreeType = (_a25 = instance.subTree) == null ? void 0 : _a25.type;
  2141. const appRecord = getAppRecord(instance);
  2142. if (appRecord) {
  2143. return ((_b25 = appRecord == null ? void 0 : appRecord.types) == null ? void 0 : _b25.Fragment) === subTreeType;
  2144. }
  2145. return false;
  2146. }
  2147. function getInstanceName(instance) {
  2148. var _a25, _b25, _c;
  2149. const name = getComponentTypeName((instance == null ? void 0 : instance.type) || {});
  2150. if (name)
  2151. return name;
  2152. if ((instance == null ? void 0 : instance.root) === instance)
  2153. return "Root";
  2154. for (const key in (_b25 = (_a25 = instance.parent) == null ? void 0 : _a25.type) == null ? void 0 : _b25.components) {
  2155. if (instance.parent.type.components[key] === (instance == null ? void 0 : instance.type))
  2156. return saveComponentGussedName(instance, key);
  2157. }
  2158. for (const key in (_c = instance.appContext) == null ? void 0 : _c.components) {
  2159. if (instance.appContext.components[key] === (instance == null ? void 0 : instance.type))
  2160. return saveComponentGussedName(instance, key);
  2161. }
  2162. const fileName = getComponentFileName((instance == null ? void 0 : instance.type) || {});
  2163. if (fileName)
  2164. return fileName;
  2165. return "Anonymous Component";
  2166. }
  2167. function getUniqueComponentId(instance) {
  2168. var _a25, _b25, _c;
  2169. const appId = (_c = (_b25 = (_a25 = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a25.app) == null ? void 0 : _b25.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__) != null ? _c : 0;
  2170. const instanceId = instance === (instance == null ? void 0 : instance.root) ? "root" : instance.uid;
  2171. return `${appId}:${instanceId}`;
  2172. }
  2173. function getComponentInstance(appRecord, instanceId) {
  2174. instanceId = instanceId || `${appRecord.id}:root`;
  2175. const instance = appRecord.instanceMap.get(instanceId);
  2176. return instance || appRecord.instanceMap.get(":root");
  2177. }
  2178. function createRect() {
  2179. const rect = {
  2180. top: 0,
  2181. bottom: 0,
  2182. left: 0,
  2183. right: 0,
  2184. get width() {
  2185. return rect.right - rect.left;
  2186. },
  2187. get height() {
  2188. return rect.bottom - rect.top;
  2189. }
  2190. };
  2191. return rect;
  2192. }
  2193. var range;
  2194. function getTextRect(node) {
  2195. if (!range)
  2196. range = document.createRange();
  2197. range.selectNode(node);
  2198. return range.getBoundingClientRect();
  2199. }
  2200. function getFragmentRect(vnode) {
  2201. const rect = createRect();
  2202. if (!vnode.children)
  2203. return rect;
  2204. for (let i = 0, l = vnode.children.length; i < l; i++) {
  2205. const childVnode = vnode.children[i];
  2206. let childRect;
  2207. if (childVnode.component) {
  2208. childRect = getComponentBoundingRect(childVnode.component);
  2209. } else if (childVnode.el) {
  2210. const el = childVnode.el;
  2211. if (el.nodeType === 1 || el.getBoundingClientRect)
  2212. childRect = el.getBoundingClientRect();
  2213. else if (el.nodeType === 3 && el.data.trim())
  2214. childRect = getTextRect(el);
  2215. }
  2216. if (childRect)
  2217. mergeRects(rect, childRect);
  2218. }
  2219. return rect;
  2220. }
  2221. function mergeRects(a, b) {
  2222. if (!a.top || b.top < a.top)
  2223. a.top = b.top;
  2224. if (!a.bottom || b.bottom > a.bottom)
  2225. a.bottom = b.bottom;
  2226. if (!a.left || b.left < a.left)
  2227. a.left = b.left;
  2228. if (!a.right || b.right > a.right)
  2229. a.right = b.right;
  2230. return a;
  2231. }
  2232. var DEFAULT_RECT = {
  2233. top: 0,
  2234. left: 0,
  2235. right: 0,
  2236. bottom: 0,
  2237. width: 0,
  2238. height: 0
  2239. };
  2240. function getComponentBoundingRect(instance) {
  2241. const el = instance.subTree.el;
  2242. if (typeof window === "undefined") {
  2243. return DEFAULT_RECT;
  2244. }
  2245. if (isFragment(instance))
  2246. return getFragmentRect(instance.subTree);
  2247. else if ((el == null ? void 0 : el.nodeType) === 1)
  2248. return el == null ? void 0 : el.getBoundingClientRect();
  2249. else if (instance.subTree.component)
  2250. return getComponentBoundingRect(instance.subTree.component);
  2251. else
  2252. return DEFAULT_RECT;
  2253. }
  2254. init_esm_shims2();
  2255. function getRootElementsFromComponentInstance(instance) {
  2256. if (isFragment(instance))
  2257. return getFragmentRootElements(instance.subTree);
  2258. if (!instance.subTree)
  2259. return [];
  2260. return [instance.subTree.el];
  2261. }
  2262. function getFragmentRootElements(vnode) {
  2263. if (!vnode.children)
  2264. return [];
  2265. const list = [];
  2266. vnode.children.forEach((childVnode) => {
  2267. if (childVnode.component)
  2268. list.push(...getRootElementsFromComponentInstance(childVnode.component));
  2269. else if (childVnode == null ? void 0 : childVnode.el)
  2270. list.push(childVnode.el);
  2271. });
  2272. return list;
  2273. }
  2274. var CONTAINER_ELEMENT_ID = "__vue-devtools-component-inspector__";
  2275. var CARD_ELEMENT_ID = "__vue-devtools-component-inspector__card__";
  2276. var COMPONENT_NAME_ELEMENT_ID = "__vue-devtools-component-inspector__name__";
  2277. var INDICATOR_ELEMENT_ID = "__vue-devtools-component-inspector__indicator__";
  2278. var containerStyles = {
  2279. display: "block",
  2280. zIndex: 2147483640,
  2281. position: "fixed",
  2282. backgroundColor: "#42b88325",
  2283. border: "1px solid #42b88350",
  2284. borderRadius: "5px",
  2285. transition: "all 0.1s ease-in",
  2286. pointerEvents: "none"
  2287. };
  2288. var cardStyles = {
  2289. fontFamily: "Arial, Helvetica, sans-serif",
  2290. padding: "5px 8px",
  2291. borderRadius: "4px",
  2292. textAlign: "left",
  2293. position: "absolute",
  2294. left: 0,
  2295. color: "#e9e9e9",
  2296. fontSize: "14px",
  2297. fontWeight: 600,
  2298. lineHeight: "24px",
  2299. backgroundColor: "#42b883",
  2300. boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"
  2301. };
  2302. var indicatorStyles = {
  2303. display: "inline-block",
  2304. fontWeight: 400,
  2305. fontStyle: "normal",
  2306. fontSize: "12px",
  2307. opacity: 0.7
  2308. };
  2309. function getContainerElement() {
  2310. return document.getElementById(CONTAINER_ELEMENT_ID);
  2311. }
  2312. function getCardElement() {
  2313. return document.getElementById(CARD_ELEMENT_ID);
  2314. }
  2315. function getIndicatorElement() {
  2316. return document.getElementById(INDICATOR_ELEMENT_ID);
  2317. }
  2318. function getNameElement() {
  2319. return document.getElementById(COMPONENT_NAME_ELEMENT_ID);
  2320. }
  2321. function getStyles(bounds) {
  2322. return {
  2323. left: `${Math.round(bounds.left * 100) / 100}px`,
  2324. top: `${Math.round(bounds.top * 100) / 100}px`,
  2325. width: `${Math.round(bounds.width * 100) / 100}px`,
  2326. height: `${Math.round(bounds.height * 100) / 100}px`
  2327. };
  2328. }
  2329. function create(options) {
  2330. var _a25;
  2331. const containerEl = document.createElement("div");
  2332. containerEl.id = (_a25 = options.elementId) != null ? _a25 : CONTAINER_ELEMENT_ID;
  2333. Object.assign(containerEl.style, {
  2334. ...containerStyles,
  2335. ...getStyles(options.bounds),
  2336. ...options.style
  2337. });
  2338. const cardEl = document.createElement("span");
  2339. cardEl.id = CARD_ELEMENT_ID;
  2340. Object.assign(cardEl.style, {
  2341. ...cardStyles,
  2342. top: options.bounds.top < 35 ? 0 : "-35px"
  2343. });
  2344. const nameEl = document.createElement("span");
  2345. nameEl.id = COMPONENT_NAME_ELEMENT_ID;
  2346. nameEl.innerHTML = `&lt;${options.name}&gt;&nbsp;&nbsp;`;
  2347. const indicatorEl = document.createElement("i");
  2348. indicatorEl.id = INDICATOR_ELEMENT_ID;
  2349. indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;
  2350. Object.assign(indicatorEl.style, indicatorStyles);
  2351. cardEl.appendChild(nameEl);
  2352. cardEl.appendChild(indicatorEl);
  2353. containerEl.appendChild(cardEl);
  2354. document.body.appendChild(containerEl);
  2355. return containerEl;
  2356. }
  2357. function update(options) {
  2358. const containerEl = getContainerElement();
  2359. const cardEl = getCardElement();
  2360. const nameEl = getNameElement();
  2361. const indicatorEl = getIndicatorElement();
  2362. if (containerEl) {
  2363. Object.assign(containerEl.style, {
  2364. ...containerStyles,
  2365. ...getStyles(options.bounds)
  2366. });
  2367. Object.assign(cardEl.style, {
  2368. top: options.bounds.top < 35 ? 0 : "-35px"
  2369. });
  2370. nameEl.innerHTML = `&lt;${options.name}&gt;&nbsp;&nbsp;`;
  2371. indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;
  2372. }
  2373. }
  2374. function highlight(instance) {
  2375. const bounds = getComponentBoundingRect(instance);
  2376. if (!bounds.width && !bounds.height)
  2377. return;
  2378. const name = getInstanceName(instance);
  2379. const container = getContainerElement();
  2380. container ? update({ bounds, name }) : create({ bounds, name });
  2381. }
  2382. function unhighlight() {
  2383. const el = getContainerElement();
  2384. if (el)
  2385. el.style.display = "none";
  2386. }
  2387. var inspectInstance = null;
  2388. function inspectFn(e) {
  2389. const target22 = e.target;
  2390. if (target22) {
  2391. const instance = target22.__vueParentComponent;
  2392. if (instance) {
  2393. inspectInstance = instance;
  2394. const el = instance.vnode.el;
  2395. if (el) {
  2396. const bounds = getComponentBoundingRect(instance);
  2397. const name = getInstanceName(instance);
  2398. const container = getContainerElement();
  2399. container ? update({ bounds, name }) : create({ bounds, name });
  2400. }
  2401. }
  2402. }
  2403. }
  2404. function selectComponentFn(e, cb) {
  2405. e.preventDefault();
  2406. e.stopPropagation();
  2407. if (inspectInstance) {
  2408. const uniqueComponentId = getUniqueComponentId(inspectInstance);
  2409. cb(uniqueComponentId);
  2410. }
  2411. }
  2412. var inspectComponentHighLighterSelectFn = null;
  2413. function cancelInspectComponentHighLighter() {
  2414. unhighlight();
  2415. window.removeEventListener("mouseover", inspectFn);
  2416. window.removeEventListener("click", inspectComponentHighLighterSelectFn, true);
  2417. inspectComponentHighLighterSelectFn = null;
  2418. }
  2419. function inspectComponentHighLighter() {
  2420. window.addEventListener("mouseover", inspectFn);
  2421. return new Promise((resolve) => {
  2422. function onSelect(e) {
  2423. e.preventDefault();
  2424. e.stopPropagation();
  2425. selectComponentFn(e, (id) => {
  2426. window.removeEventListener("click", onSelect, true);
  2427. inspectComponentHighLighterSelectFn = null;
  2428. window.removeEventListener("mouseover", inspectFn);
  2429. const el = getContainerElement();
  2430. if (el)
  2431. el.style.display = "none";
  2432. resolve(JSON.stringify({ id }));
  2433. });
  2434. }
  2435. inspectComponentHighLighterSelectFn = onSelect;
  2436. window.addEventListener("click", onSelect, true);
  2437. });
  2438. }
  2439. function scrollToComponent(options) {
  2440. const instance = getComponentInstance(activeAppRecord.value, options.id);
  2441. if (instance) {
  2442. const [el] = getRootElementsFromComponentInstance(instance);
  2443. if (typeof el.scrollIntoView === "function") {
  2444. el.scrollIntoView({
  2445. behavior: "smooth"
  2446. });
  2447. } else {
  2448. const bounds = getComponentBoundingRect(instance);
  2449. const scrollTarget = document.createElement("div");
  2450. const styles = {
  2451. ...getStyles(bounds),
  2452. position: "absolute"
  2453. };
  2454. Object.assign(scrollTarget.style, styles);
  2455. document.body.appendChild(scrollTarget);
  2456. scrollTarget.scrollIntoView({
  2457. behavior: "smooth"
  2458. });
  2459. setTimeout(() => {
  2460. document.body.removeChild(scrollTarget);
  2461. }, 2e3);
  2462. }
  2463. setTimeout(() => {
  2464. const bounds = getComponentBoundingRect(instance);
  2465. if (bounds.width || bounds.height) {
  2466. const name = getInstanceName(instance);
  2467. const el2 = getContainerElement();
  2468. el2 ? update({ ...options, name, bounds }) : create({ ...options, name, bounds });
  2469. setTimeout(() => {
  2470. if (el2)
  2471. el2.style.display = "none";
  2472. }, 1500);
  2473. }
  2474. }, 1200);
  2475. }
  2476. }
  2477. init_esm_shims2();
  2478. var _a2;
  2479. var _b;
  2480. (_b = (_a2 = target).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__) != null ? _b : _a2.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true;
  2481. function waitForInspectorInit(cb) {
  2482. let total = 0;
  2483. const timer = setInterval(() => {
  2484. if (target.__VUE_INSPECTOR__) {
  2485. clearInterval(timer);
  2486. total += 30;
  2487. cb();
  2488. }
  2489. if (total >= /* 5s */
  2490. 5e3)
  2491. clearInterval(timer);
  2492. }, 30);
  2493. }
  2494. function setupInspector() {
  2495. const inspector = target.__VUE_INSPECTOR__;
  2496. const _openInEditor = inspector.openInEditor;
  2497. inspector.openInEditor = async (...params) => {
  2498. inspector.disable();
  2499. _openInEditor(...params);
  2500. };
  2501. }
  2502. function getComponentInspector() {
  2503. return new Promise((resolve) => {
  2504. function setup() {
  2505. setupInspector();
  2506. resolve(target.__VUE_INSPECTOR__);
  2507. }
  2508. if (!target.__VUE_INSPECTOR__) {
  2509. waitForInspectorInit(() => {
  2510. setup();
  2511. });
  2512. } else {
  2513. setup();
  2514. }
  2515. });
  2516. }
  2517. init_esm_shims2();
  2518. init_esm_shims2();
  2519. function isReadonly(value) {
  2520. return !!(value && value[
  2521. "__v_isReadonly"
  2522. /* IS_READONLY */
  2523. ]);
  2524. }
  2525. function isReactive2(value) {
  2526. if (isReadonly(value)) {
  2527. return isReactive2(value[
  2528. "__v_raw"
  2529. /* RAW */
  2530. ]);
  2531. }
  2532. return !!(value && value[
  2533. "__v_isReactive"
  2534. /* IS_REACTIVE */
  2535. ]);
  2536. }
  2537. function isRef2(r) {
  2538. return !!(r && r.__v_isRef === true);
  2539. }
  2540. function toRaw2(observed) {
  2541. const raw = observed && observed[
  2542. "__v_raw"
  2543. /* RAW */
  2544. ];
  2545. return raw ? toRaw2(raw) : observed;
  2546. }
  2547. var Fragment = Symbol.for("v-fgt");
  2548. var StateEditor = class {
  2549. constructor() {
  2550. this.refEditor = new RefStateEditor();
  2551. }
  2552. set(object, path, value, cb) {
  2553. const sections = Array.isArray(path) ? path : path.split(".");
  2554. const markRef = false;
  2555. while (sections.length > 1) {
  2556. const section = sections.shift();
  2557. if (object instanceof Map)
  2558. object = object.get(section);
  2559. else if (object instanceof Set)
  2560. object = Array.from(object.values())[section];
  2561. else object = object[section];
  2562. if (this.refEditor.isRef(object))
  2563. object = this.refEditor.get(object);
  2564. }
  2565. const field = sections[0];
  2566. const item = this.refEditor.get(object)[field];
  2567. if (cb) {
  2568. cb(object, field, value);
  2569. } else {
  2570. if (this.refEditor.isRef(item))
  2571. this.refEditor.set(item, value);
  2572. else if (markRef)
  2573. object[field] = value;
  2574. else
  2575. object[field] = value;
  2576. }
  2577. }
  2578. get(object, path) {
  2579. const sections = Array.isArray(path) ? path : path.split(".");
  2580. for (let i = 0; i < sections.length; i++) {
  2581. if (object instanceof Map)
  2582. object = object.get(sections[i]);
  2583. else
  2584. object = object[sections[i]];
  2585. if (this.refEditor.isRef(object))
  2586. object = this.refEditor.get(object);
  2587. if (!object)
  2588. return void 0;
  2589. }
  2590. return object;
  2591. }
  2592. has(object, path, parent = false) {
  2593. if (typeof object === "undefined")
  2594. return false;
  2595. const sections = Array.isArray(path) ? path.slice() : path.split(".");
  2596. const size = !parent ? 1 : 2;
  2597. while (object && sections.length > size) {
  2598. const section = sections.shift();
  2599. object = object[section];
  2600. if (this.refEditor.isRef(object))
  2601. object = this.refEditor.get(object);
  2602. }
  2603. return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
  2604. }
  2605. createDefaultSetCallback(state) {
  2606. return (object, field, value) => {
  2607. if (state.remove || state.newKey) {
  2608. if (Array.isArray(object))
  2609. object.splice(field, 1);
  2610. else if (toRaw2(object) instanceof Map)
  2611. object.delete(field);
  2612. else if (toRaw2(object) instanceof Set)
  2613. object.delete(Array.from(object.values())[field]);
  2614. else Reflect.deleteProperty(object, field);
  2615. }
  2616. if (!state.remove) {
  2617. const target22 = object[state.newKey || field];
  2618. if (this.refEditor.isRef(target22))
  2619. this.refEditor.set(target22, value);
  2620. else if (toRaw2(object) instanceof Map)
  2621. object.set(state.newKey || field, value);
  2622. else if (toRaw2(object) instanceof Set)
  2623. object.add(value);
  2624. else
  2625. object[state.newKey || field] = value;
  2626. }
  2627. };
  2628. }
  2629. };
  2630. var RefStateEditor = class {
  2631. set(ref2, value) {
  2632. if (isRef2(ref2)) {
  2633. ref2.value = value;
  2634. } else {
  2635. if (ref2 instanceof Set && Array.isArray(value)) {
  2636. ref2.clear();
  2637. value.forEach((v) => ref2.add(v));
  2638. return;
  2639. }
  2640. const currentKeys = Object.keys(value);
  2641. if (ref2 instanceof Map) {
  2642. const previousKeysSet2 = new Set(ref2.keys());
  2643. currentKeys.forEach((key) => {
  2644. ref2.set(key, Reflect.get(value, key));
  2645. previousKeysSet2.delete(key);
  2646. });
  2647. previousKeysSet2.forEach((key) => ref2.delete(key));
  2648. return;
  2649. }
  2650. const previousKeysSet = new Set(Object.keys(ref2));
  2651. currentKeys.forEach((key) => {
  2652. Reflect.set(ref2, key, Reflect.get(value, key));
  2653. previousKeysSet.delete(key);
  2654. });
  2655. previousKeysSet.forEach((key) => Reflect.deleteProperty(ref2, key));
  2656. }
  2657. }
  2658. get(ref2) {
  2659. return isRef2(ref2) ? ref2.value : ref2;
  2660. }
  2661. isRef(ref2) {
  2662. return isRef2(ref2) || isReactive2(ref2);
  2663. }
  2664. };
  2665. var stateEditor = new StateEditor();
  2666. init_esm_shims2();
  2667. init_esm_shims2();
  2668. init_esm_shims2();
  2669. var TIMELINE_LAYERS_STATE_STORAGE_ID = "__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";
  2670. function getTimelineLayersStateFromStorage() {
  2671. if (!isBrowser || typeof localStorage === "undefined" || localStorage === null) {
  2672. return {
  2673. recordingState: false,
  2674. mouseEventEnabled: false,
  2675. keyboardEventEnabled: false,
  2676. componentEventEnabled: false,
  2677. performanceEventEnabled: false,
  2678. selected: ""
  2679. };
  2680. }
  2681. const state = localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID);
  2682. return state ? JSON.parse(state) : {
  2683. recordingState: false,
  2684. mouseEventEnabled: false,
  2685. keyboardEventEnabled: false,
  2686. componentEventEnabled: false,
  2687. performanceEventEnabled: false,
  2688. selected: ""
  2689. };
  2690. }
  2691. init_esm_shims2();
  2692. init_esm_shims2();
  2693. init_esm_shims2();
  2694. var _a22;
  2695. var _b2;
  2696. (_b2 = (_a22 = target).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS) != null ? _b2 : _a22.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS = [];
  2697. var devtoolsTimelineLayers = new Proxy(target.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS, {
  2698. get(target22, prop, receiver) {
  2699. return Reflect.get(target22, prop, receiver);
  2700. }
  2701. });
  2702. function addTimelineLayer(options, descriptor) {
  2703. devtoolsState.timelineLayersState[descriptor.id] = false;
  2704. devtoolsTimelineLayers.push({
  2705. ...options,
  2706. descriptorId: descriptor.id,
  2707. appRecord: getAppRecord(descriptor.app)
  2708. });
  2709. }
  2710. var _a3;
  2711. var _b3;
  2712. (_b3 = (_a3 = target).__VUE_DEVTOOLS_KIT_INSPECTOR__) != null ? _b3 : _a3.__VUE_DEVTOOLS_KIT_INSPECTOR__ = [];
  2713. var devtoolsInspector = new Proxy(target.__VUE_DEVTOOLS_KIT_INSPECTOR__, {
  2714. get(target22, prop, receiver) {
  2715. return Reflect.get(target22, prop, receiver);
  2716. }
  2717. });
  2718. var callInspectorUpdatedHook = debounce(() => {
  2719. devtoolsContext.hooks.callHook("sendInspectorToClient", getActiveInspectors());
  2720. });
  2721. function addInspector(inspector, descriptor) {
  2722. var _a25, _b25;
  2723. devtoolsInspector.push({
  2724. options: inspector,
  2725. descriptor,
  2726. treeFilterPlaceholder: (_a25 = inspector.treeFilterPlaceholder) != null ? _a25 : "Search tree...",
  2727. stateFilterPlaceholder: (_b25 = inspector.stateFilterPlaceholder) != null ? _b25 : "Search state...",
  2728. treeFilter: "",
  2729. selectedNodeId: "",
  2730. appRecord: getAppRecord(descriptor.app)
  2731. });
  2732. callInspectorUpdatedHook();
  2733. }
  2734. function getActiveInspectors() {
  2735. return devtoolsInspector.filter((inspector) => inspector.descriptor.app === activeAppRecord.value.app).filter((inspector) => inspector.descriptor.id !== "components").map((inspector) => {
  2736. var _a25;
  2737. const descriptor = inspector.descriptor;
  2738. const options = inspector.options;
  2739. return {
  2740. id: options.id,
  2741. label: options.label,
  2742. logo: descriptor.logo,
  2743. icon: `custom-ic-baseline-${(_a25 = options == null ? void 0 : options.icon) == null ? void 0 : _a25.replace(/_/g, "-")}`,
  2744. packageName: descriptor.packageName,
  2745. homepage: descriptor.homepage,
  2746. pluginId: descriptor.id
  2747. };
  2748. });
  2749. }
  2750. function getInspector(id, app) {
  2751. return devtoolsInspector.find((inspector) => inspector.options.id === id && (app ? inspector.descriptor.app === app : true));
  2752. }
  2753. var DevToolsV6PluginAPIHookKeys = ((DevToolsV6PluginAPIHookKeys2) => {
  2754. DevToolsV6PluginAPIHookKeys2["VISIT_COMPONENT_TREE"] = "visitComponentTree";
  2755. DevToolsV6PluginAPIHookKeys2["INSPECT_COMPONENT"] = "inspectComponent";
  2756. DevToolsV6PluginAPIHookKeys2["EDIT_COMPONENT_STATE"] = "editComponentState";
  2757. DevToolsV6PluginAPIHookKeys2["GET_INSPECTOR_TREE"] = "getInspectorTree";
  2758. DevToolsV6PluginAPIHookKeys2["GET_INSPECTOR_STATE"] = "getInspectorState";
  2759. DevToolsV6PluginAPIHookKeys2["EDIT_INSPECTOR_STATE"] = "editInspectorState";
  2760. DevToolsV6PluginAPIHookKeys2["INSPECT_TIMELINE_EVENT"] = "inspectTimelineEvent";
  2761. DevToolsV6PluginAPIHookKeys2["TIMELINE_CLEARED"] = "timelineCleared";
  2762. DevToolsV6PluginAPIHookKeys2["SET_PLUGIN_SETTINGS"] = "setPluginSettings";
  2763. return DevToolsV6PluginAPIHookKeys2;
  2764. })(DevToolsV6PluginAPIHookKeys || {});
  2765. var DevToolsContextHookKeys = ((DevToolsContextHookKeys2) => {
  2766. DevToolsContextHookKeys2["ADD_INSPECTOR"] = "addInspector";
  2767. DevToolsContextHookKeys2["SEND_INSPECTOR_TREE"] = "sendInspectorTree";
  2768. DevToolsContextHookKeys2["SEND_INSPECTOR_STATE"] = "sendInspectorState";
  2769. DevToolsContextHookKeys2["CUSTOM_INSPECTOR_SELECT_NODE"] = "customInspectorSelectNode";
  2770. DevToolsContextHookKeys2["TIMELINE_LAYER_ADDED"] = "timelineLayerAdded";
  2771. DevToolsContextHookKeys2["TIMELINE_EVENT_ADDED"] = "timelineEventAdded";
  2772. DevToolsContextHookKeys2["GET_COMPONENT_INSTANCES"] = "getComponentInstances";
  2773. DevToolsContextHookKeys2["GET_COMPONENT_BOUNDS"] = "getComponentBounds";
  2774. DevToolsContextHookKeys2["GET_COMPONENT_NAME"] = "getComponentName";
  2775. DevToolsContextHookKeys2["COMPONENT_HIGHLIGHT"] = "componentHighlight";
  2776. DevToolsContextHookKeys2["COMPONENT_UNHIGHLIGHT"] = "componentUnhighlight";
  2777. return DevToolsContextHookKeys2;
  2778. })(DevToolsContextHookKeys || {});
  2779. var DevToolsMessagingHookKeys = ((DevToolsMessagingHookKeys2) => {
  2780. DevToolsMessagingHookKeys2["SEND_INSPECTOR_TREE_TO_CLIENT"] = "sendInspectorTreeToClient";
  2781. DevToolsMessagingHookKeys2["SEND_INSPECTOR_STATE_TO_CLIENT"] = "sendInspectorStateToClient";
  2782. DevToolsMessagingHookKeys2["SEND_TIMELINE_EVENT_TO_CLIENT"] = "sendTimelineEventToClient";
  2783. DevToolsMessagingHookKeys2["SEND_INSPECTOR_TO_CLIENT"] = "sendInspectorToClient";
  2784. DevToolsMessagingHookKeys2["SEND_ACTIVE_APP_UNMOUNTED_TO_CLIENT"] = "sendActiveAppUpdatedToClient";
  2785. DevToolsMessagingHookKeys2["DEVTOOLS_STATE_UPDATED"] = "devtoolsStateUpdated";
  2786. DevToolsMessagingHookKeys2["DEVTOOLS_CONNECTED_UPDATED"] = "devtoolsConnectedUpdated";
  2787. DevToolsMessagingHookKeys2["ROUTER_INFO_UPDATED"] = "routerInfoUpdated";
  2788. return DevToolsMessagingHookKeys2;
  2789. })(DevToolsMessagingHookKeys || {});
  2790. function createDevToolsCtxHooks() {
  2791. const hooks2 = createHooks();
  2792. hooks2.hook("addInspector", ({ inspector, plugin }) => {
  2793. addInspector(inspector, plugin.descriptor);
  2794. });
  2795. const debounceSendInspectorTree = debounce(async ({ inspectorId, plugin }) => {
  2796. var _a25;
  2797. if (!inspectorId || !((_a25 = plugin == null ? void 0 : plugin.descriptor) == null ? void 0 : _a25.app) || devtoolsState.highPerfModeEnabled)
  2798. return;
  2799. const inspector = getInspector(inspectorId, plugin.descriptor.app);
  2800. const _payload = {
  2801. app: plugin.descriptor.app,
  2802. inspectorId,
  2803. filter: (inspector == null ? void 0 : inspector.treeFilter) || "",
  2804. rootNodes: []
  2805. };
  2806. await new Promise((resolve) => {
  2807. hooks2.callHookWith(
  2808. async (callbacks) => {
  2809. await Promise.all(callbacks.map((cb) => cb(_payload)));
  2810. resolve();
  2811. },
  2812. "getInspectorTree"
  2813. /* GET_INSPECTOR_TREE */
  2814. );
  2815. });
  2816. hooks2.callHookWith(
  2817. async (callbacks) => {
  2818. await Promise.all(callbacks.map((cb) => cb({
  2819. inspectorId,
  2820. rootNodes: _payload.rootNodes
  2821. })));
  2822. },
  2823. "sendInspectorTreeToClient"
  2824. /* SEND_INSPECTOR_TREE_TO_CLIENT */
  2825. );
  2826. }, 120);
  2827. hooks2.hook("sendInspectorTree", debounceSendInspectorTree);
  2828. const debounceSendInspectorState = debounce(async ({ inspectorId, plugin }) => {
  2829. var _a25;
  2830. if (!inspectorId || !((_a25 = plugin == null ? void 0 : plugin.descriptor) == null ? void 0 : _a25.app) || devtoolsState.highPerfModeEnabled)
  2831. return;
  2832. const inspector = getInspector(inspectorId, plugin.descriptor.app);
  2833. const _payload = {
  2834. app: plugin.descriptor.app,
  2835. inspectorId,
  2836. nodeId: (inspector == null ? void 0 : inspector.selectedNodeId) || "",
  2837. state: null
  2838. };
  2839. const ctx = {
  2840. currentTab: `custom-inspector:${inspectorId}`
  2841. };
  2842. if (_payload.nodeId) {
  2843. await new Promise((resolve) => {
  2844. hooks2.callHookWith(
  2845. async (callbacks) => {
  2846. await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));
  2847. resolve();
  2848. },
  2849. "getInspectorState"
  2850. /* GET_INSPECTOR_STATE */
  2851. );
  2852. });
  2853. }
  2854. hooks2.callHookWith(
  2855. async (callbacks) => {
  2856. await Promise.all(callbacks.map((cb) => cb({
  2857. inspectorId,
  2858. nodeId: _payload.nodeId,
  2859. state: _payload.state
  2860. })));
  2861. },
  2862. "sendInspectorStateToClient"
  2863. /* SEND_INSPECTOR_STATE_TO_CLIENT */
  2864. );
  2865. }, 120);
  2866. hooks2.hook("sendInspectorState", debounceSendInspectorState);
  2867. hooks2.hook("customInspectorSelectNode", ({ inspectorId, nodeId, plugin }) => {
  2868. const inspector = getInspector(inspectorId, plugin.descriptor.app);
  2869. if (!inspector)
  2870. return;
  2871. inspector.selectedNodeId = nodeId;
  2872. });
  2873. hooks2.hook("timelineLayerAdded", ({ options, plugin }) => {
  2874. addTimelineLayer(options, plugin.descriptor);
  2875. });
  2876. hooks2.hook("timelineEventAdded", ({ options, plugin }) => {
  2877. var _a25;
  2878. const internalLayerIds = ["performance", "component-event", "keyboard", "mouse"];
  2879. if (devtoolsState.highPerfModeEnabled || !((_a25 = devtoolsState.timelineLayersState) == null ? void 0 : _a25[plugin.descriptor.id]) && !internalLayerIds.includes(options.layerId))
  2880. return;
  2881. hooks2.callHookWith(
  2882. async (callbacks) => {
  2883. await Promise.all(callbacks.map((cb) => cb(options)));
  2884. },
  2885. "sendTimelineEventToClient"
  2886. /* SEND_TIMELINE_EVENT_TO_CLIENT */
  2887. );
  2888. });
  2889. hooks2.hook("getComponentInstances", async ({ app }) => {
  2890. const appRecord = app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
  2891. if (!appRecord)
  2892. return null;
  2893. const appId = appRecord.id.toString();
  2894. const instances = [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
  2895. return instances;
  2896. });
  2897. hooks2.hook("getComponentBounds", async ({ instance }) => {
  2898. const bounds = getComponentBoundingRect(instance);
  2899. return bounds;
  2900. });
  2901. hooks2.hook("getComponentName", ({ instance }) => {
  2902. const name = getInstanceName(instance);
  2903. return name;
  2904. });
  2905. hooks2.hook("componentHighlight", ({ uid }) => {
  2906. const instance = activeAppRecord.value.instanceMap.get(uid);
  2907. if (instance) {
  2908. highlight(instance);
  2909. }
  2910. });
  2911. hooks2.hook("componentUnhighlight", () => {
  2912. unhighlight();
  2913. });
  2914. return hooks2;
  2915. }
  2916. var _a4;
  2917. var _b4;
  2918. (_b4 = (_a4 = target).__VUE_DEVTOOLS_KIT_APP_RECORDS__) != null ? _b4 : _a4.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [];
  2919. var _a5;
  2920. var _b5;
  2921. (_b5 = (_a5 = target).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__) != null ? _b5 : _a5.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = {};
  2922. var _a6;
  2923. var _b6;
  2924. (_b6 = (_a6 = target).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__) != null ? _b6 : _a6.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = "";
  2925. var _a7;
  2926. var _b7;
  2927. (_b7 = (_a7 = target).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__) != null ? _b7 : _a7.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ = [];
  2928. var _a8;
  2929. var _b8;
  2930. (_b8 = (_a8 = target).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__) != null ? _b8 : _a8.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ = [];
  2931. var STATE_KEY = "__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";
  2932. function initStateFactory() {
  2933. return {
  2934. connected: false,
  2935. clientConnected: false,
  2936. vitePluginDetected: true,
  2937. appRecords: [],
  2938. activeAppRecordId: "",
  2939. tabs: [],
  2940. commands: [],
  2941. highPerfModeEnabled: true,
  2942. devtoolsClientDetected: {},
  2943. perfUniqueGroupId: 0,
  2944. timelineLayersState: getTimelineLayersStateFromStorage()
  2945. };
  2946. }
  2947. var _a9;
  2948. var _b9;
  2949. (_b9 = (_a9 = target)[STATE_KEY]) != null ? _b9 : _a9[STATE_KEY] = initStateFactory();
  2950. var callStateUpdatedHook = debounce((state) => {
  2951. devtoolsContext.hooks.callHook("devtoolsStateUpdated", { state });
  2952. });
  2953. var callConnectedUpdatedHook = debounce((state, oldState) => {
  2954. devtoolsContext.hooks.callHook("devtoolsConnectedUpdated", { state, oldState });
  2955. });
  2956. var devtoolsAppRecords = new Proxy(target.__VUE_DEVTOOLS_KIT_APP_RECORDS__, {
  2957. get(_target, prop, receiver) {
  2958. if (prop === "value")
  2959. return target.__VUE_DEVTOOLS_KIT_APP_RECORDS__;
  2960. return target.__VUE_DEVTOOLS_KIT_APP_RECORDS__[prop];
  2961. }
  2962. });
  2963. var activeAppRecord = new Proxy(target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__, {
  2964. get(_target, prop, receiver) {
  2965. if (prop === "value")
  2966. return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__;
  2967. else if (prop === "id")
  2968. return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__;
  2969. return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[prop];
  2970. }
  2971. });
  2972. function updateAllStates() {
  2973. callStateUpdatedHook({
  2974. ...target[STATE_KEY],
  2975. appRecords: devtoolsAppRecords.value,
  2976. activeAppRecordId: activeAppRecord.id,
  2977. tabs: target.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,
  2978. commands: target.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__
  2979. });
  2980. }
  2981. function setActiveAppRecord(app) {
  2982. target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = app;
  2983. updateAllStates();
  2984. }
  2985. function setActiveAppRecordId(id) {
  2986. target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = id;
  2987. updateAllStates();
  2988. }
  2989. var devtoolsState = new Proxy(target[STATE_KEY], {
  2990. get(target22, property) {
  2991. if (property === "appRecords") {
  2992. return devtoolsAppRecords;
  2993. } else if (property === "activeAppRecordId") {
  2994. return activeAppRecord.id;
  2995. } else if (property === "tabs") {
  2996. return target.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
  2997. } else if (property === "commands") {
  2998. return target.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
  2999. }
  3000. return target[STATE_KEY][property];
  3001. },
  3002. deleteProperty(target22, property) {
  3003. delete target22[property];
  3004. return true;
  3005. },
  3006. set(target22, property, value) {
  3007. const oldState = { ...target[STATE_KEY] };
  3008. target22[property] = value;
  3009. target[STATE_KEY][property] = value;
  3010. return true;
  3011. }
  3012. });
  3013. function openInEditor(options = {}) {
  3014. var _a25, _b25, _c;
  3015. const { file, host, baseUrl = window.location.origin, line = 0, column = 0 } = options;
  3016. if (file) {
  3017. if (host === "chrome-extension") {
  3018. const fileName = file.replace(/\\/g, "\\\\");
  3019. const _baseUrl = (_b25 = (_a25 = window.VUE_DEVTOOLS_CONFIG) == null ? void 0 : _a25.openInEditorHost) != null ? _b25 : "/";
  3020. fetch(`${_baseUrl}__open-in-editor?file=${encodeURI(file)}`).then((response) => {
  3021. if (!response.ok) {
  3022. const msg = `Opening component ${fileName} failed`;
  3023. console.log(`%c${msg}`, "color:red");
  3024. }
  3025. });
  3026. } else if (devtoolsState.vitePluginDetected) {
  3027. const _baseUrl = (_c = target.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__) != null ? _c : baseUrl;
  3028. target.__VUE_INSPECTOR__.openInEditor(_baseUrl, file, line, column);
  3029. }
  3030. }
  3031. }
  3032. init_esm_shims2();
  3033. init_esm_shims2();
  3034. init_esm_shims2();
  3035. init_esm_shims2();
  3036. init_esm_shims2();
  3037. var _a10;
  3038. var _b10;
  3039. (_b10 = (_a10 = target).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__) != null ? _b10 : _a10.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ = [];
  3040. var devtoolsPluginBuffer = new Proxy(target.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__, {
  3041. get(target22, prop, receiver) {
  3042. return Reflect.get(target22, prop, receiver);
  3043. }
  3044. });
  3045. function _getSettings(settings) {
  3046. const _settings = {};
  3047. Object.keys(settings).forEach((key) => {
  3048. _settings[key] = settings[key].defaultValue;
  3049. });
  3050. return _settings;
  3051. }
  3052. function getPluginLocalKey(pluginId) {
  3053. return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;
  3054. }
  3055. function getPluginSettingsOptions(pluginId) {
  3056. var _a25, _b25, _c;
  3057. const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => {
  3058. var _a26;
  3059. return item2[0].id === pluginId && !!((_a26 = item2[0]) == null ? void 0 : _a26.settings);
  3060. })) == null ? void 0 : _a25[0]) != null ? _b25 : null;
  3061. return (_c = item == null ? void 0 : item.settings) != null ? _c : null;
  3062. }
  3063. function getPluginSettings(pluginId, fallbackValue) {
  3064. var _a25, _b25, _c;
  3065. const localKey = getPluginLocalKey(pluginId);
  3066. if (localKey) {
  3067. const localSettings = localStorage.getItem(localKey);
  3068. if (localSettings) {
  3069. return JSON.parse(localSettings);
  3070. }
  3071. }
  3072. if (pluginId) {
  3073. const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => item2[0].id === pluginId)) == null ? void 0 : _a25[0]) != null ? _b25 : null;
  3074. return _getSettings((_c = item == null ? void 0 : item.settings) != null ? _c : {});
  3075. }
  3076. return _getSettings(fallbackValue);
  3077. }
  3078. function initPluginSettings(pluginId, settings) {
  3079. const localKey = getPluginLocalKey(pluginId);
  3080. const localSettings = localStorage.getItem(localKey);
  3081. if (!localSettings) {
  3082. localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
  3083. }
  3084. }
  3085. function setPluginSettings(pluginId, key, value) {
  3086. const localKey = getPluginLocalKey(pluginId);
  3087. const localSettings = localStorage.getItem(localKey);
  3088. const parsedLocalSettings = JSON.parse(localSettings || "{}");
  3089. const updated = {
  3090. ...parsedLocalSettings,
  3091. [key]: value
  3092. };
  3093. localStorage.setItem(localKey, JSON.stringify(updated));
  3094. devtoolsContext.hooks.callHookWith(
  3095. (callbacks) => {
  3096. callbacks.forEach((cb) => cb({
  3097. pluginId,
  3098. key,
  3099. oldValue: parsedLocalSettings[key],
  3100. newValue: value,
  3101. settings: updated
  3102. }));
  3103. },
  3104. "setPluginSettings"
  3105. /* SET_PLUGIN_SETTINGS */
  3106. );
  3107. }
  3108. init_esm_shims2();
  3109. init_esm_shims2();
  3110. init_esm_shims2();
  3111. init_esm_shims2();
  3112. init_esm_shims2();
  3113. init_esm_shims2();
  3114. init_esm_shims2();
  3115. init_esm_shims2();
  3116. init_esm_shims2();
  3117. init_esm_shims2();
  3118. init_esm_shims2();
  3119. var _a11;
  3120. var _b11;
  3121. var devtoolsHooks = (_b11 = (_a11 = target).__VUE_DEVTOOLS_HOOK) != null ? _b11 : _a11.__VUE_DEVTOOLS_HOOK = createHooks();
  3122. var on = {
  3123. vueAppInit(fn) {
  3124. devtoolsHooks.hook("app:init", fn);
  3125. },
  3126. vueAppUnmount(fn) {
  3127. devtoolsHooks.hook("app:unmount", fn);
  3128. },
  3129. vueAppConnected(fn) {
  3130. devtoolsHooks.hook("app:connected", fn);
  3131. },
  3132. componentAdded(fn) {
  3133. return devtoolsHooks.hook("component:added", fn);
  3134. },
  3135. componentEmit(fn) {
  3136. return devtoolsHooks.hook("component:emit", fn);
  3137. },
  3138. componentUpdated(fn) {
  3139. return devtoolsHooks.hook("component:updated", fn);
  3140. },
  3141. componentRemoved(fn) {
  3142. return devtoolsHooks.hook("component:removed", fn);
  3143. },
  3144. setupDevtoolsPlugin(fn) {
  3145. devtoolsHooks.hook("devtools-plugin:setup", fn);
  3146. },
  3147. perfStart(fn) {
  3148. return devtoolsHooks.hook("perf:start", fn);
  3149. },
  3150. perfEnd(fn) {
  3151. return devtoolsHooks.hook("perf:end", fn);
  3152. }
  3153. };
  3154. var hook = {
  3155. on,
  3156. setupDevToolsPlugin(pluginDescriptor, setupFn) {
  3157. return devtoolsHooks.callHook("devtools-plugin:setup", pluginDescriptor, setupFn);
  3158. }
  3159. };
  3160. var DevToolsV6PluginAPI = class {
  3161. constructor({ plugin, ctx }) {
  3162. this.hooks = ctx.hooks;
  3163. this.plugin = plugin;
  3164. }
  3165. get on() {
  3166. return {
  3167. // component inspector
  3168. visitComponentTree: (handler) => {
  3169. this.hooks.hook("visitComponentTree", handler);
  3170. },
  3171. inspectComponent: (handler) => {
  3172. this.hooks.hook("inspectComponent", handler);
  3173. },
  3174. editComponentState: (handler) => {
  3175. this.hooks.hook("editComponentState", handler);
  3176. },
  3177. // custom inspector
  3178. getInspectorTree: (handler) => {
  3179. this.hooks.hook("getInspectorTree", handler);
  3180. },
  3181. getInspectorState: (handler) => {
  3182. this.hooks.hook("getInspectorState", handler);
  3183. },
  3184. editInspectorState: (handler) => {
  3185. this.hooks.hook("editInspectorState", handler);
  3186. },
  3187. // timeline
  3188. inspectTimelineEvent: (handler) => {
  3189. this.hooks.hook("inspectTimelineEvent", handler);
  3190. },
  3191. timelineCleared: (handler) => {
  3192. this.hooks.hook("timelineCleared", handler);
  3193. },
  3194. // settings
  3195. setPluginSettings: (handler) => {
  3196. this.hooks.hook("setPluginSettings", handler);
  3197. }
  3198. };
  3199. }
  3200. // component inspector
  3201. notifyComponentUpdate(instance) {
  3202. var _a25;
  3203. if (devtoolsState.highPerfModeEnabled) {
  3204. return;
  3205. }
  3206. const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);
  3207. if (inspector == null ? void 0 : inspector.id) {
  3208. if (instance) {
  3209. const args = [
  3210. instance.appContext.app,
  3211. instance.uid,
  3212. (_a25 = instance.parent) == null ? void 0 : _a25.uid,
  3213. instance
  3214. ];
  3215. devtoolsHooks.callHook("component:updated", ...args);
  3216. } else {
  3217. devtoolsHooks.callHook(
  3218. "component:updated"
  3219. /* COMPONENT_UPDATED */
  3220. );
  3221. }
  3222. this.hooks.callHook("sendInspectorState", { inspectorId: inspector.id, plugin: this.plugin });
  3223. }
  3224. }
  3225. // custom inspector
  3226. addInspector(options) {
  3227. this.hooks.callHook("addInspector", { inspector: options, plugin: this.plugin });
  3228. if (this.plugin.descriptor.settings) {
  3229. initPluginSettings(options.id, this.plugin.descriptor.settings);
  3230. }
  3231. }
  3232. sendInspectorTree(inspectorId) {
  3233. if (devtoolsState.highPerfModeEnabled) {
  3234. return;
  3235. }
  3236. this.hooks.callHook("sendInspectorTree", { inspectorId, plugin: this.plugin });
  3237. }
  3238. sendInspectorState(inspectorId) {
  3239. if (devtoolsState.highPerfModeEnabled) {
  3240. return;
  3241. }
  3242. this.hooks.callHook("sendInspectorState", { inspectorId, plugin: this.plugin });
  3243. }
  3244. selectInspectorNode(inspectorId, nodeId) {
  3245. this.hooks.callHook("customInspectorSelectNode", { inspectorId, nodeId, plugin: this.plugin });
  3246. }
  3247. visitComponentTree(payload) {
  3248. return this.hooks.callHook("visitComponentTree", payload);
  3249. }
  3250. // timeline
  3251. now() {
  3252. if (devtoolsState.highPerfModeEnabled) {
  3253. return 0;
  3254. }
  3255. return Date.now();
  3256. }
  3257. addTimelineLayer(options) {
  3258. this.hooks.callHook("timelineLayerAdded", { options, plugin: this.plugin });
  3259. }
  3260. addTimelineEvent(options) {
  3261. if (devtoolsState.highPerfModeEnabled) {
  3262. return;
  3263. }
  3264. this.hooks.callHook("timelineEventAdded", { options, plugin: this.plugin });
  3265. }
  3266. // settings
  3267. getSettings(pluginId) {
  3268. return getPluginSettings(pluginId != null ? pluginId : this.plugin.descriptor.id, this.plugin.descriptor.settings);
  3269. }
  3270. // utilities
  3271. getComponentInstances(app) {
  3272. return this.hooks.callHook("getComponentInstances", { app });
  3273. }
  3274. getComponentBounds(instance) {
  3275. return this.hooks.callHook("getComponentBounds", { instance });
  3276. }
  3277. getComponentName(instance) {
  3278. return this.hooks.callHook("getComponentName", { instance });
  3279. }
  3280. highlightElement(instance) {
  3281. const uid = instance.__VUE_DEVTOOLS_NEXT_UID__;
  3282. return this.hooks.callHook("componentHighlight", { uid });
  3283. }
  3284. unhighlightElement() {
  3285. return this.hooks.callHook(
  3286. "componentUnhighlight"
  3287. /* COMPONENT_UNHIGHLIGHT */
  3288. );
  3289. }
  3290. };
  3291. var DevToolsPluginAPI = DevToolsV6PluginAPI;
  3292. init_esm_shims2();
  3293. init_esm_shims2();
  3294. init_esm_shims2();
  3295. init_esm_shims2();
  3296. var UNDEFINED = "__vue_devtool_undefined__";
  3297. var INFINITY = "__vue_devtool_infinity__";
  3298. var NEGATIVE_INFINITY = "__vue_devtool_negative_infinity__";
  3299. var NAN = "__vue_devtool_nan__";
  3300. init_esm_shims2();
  3301. init_esm_shims2();
  3302. var tokenMap = {
  3303. [UNDEFINED]: "undefined",
  3304. [NAN]: "NaN",
  3305. [INFINITY]: "Infinity",
  3306. [NEGATIVE_INFINITY]: "-Infinity"
  3307. };
  3308. var reversedTokenMap = Object.entries(tokenMap).reduce((acc, [key, value]) => {
  3309. acc[value] = key;
  3310. return acc;
  3311. }, {});
  3312. init_esm_shims2();
  3313. init_esm_shims2();
  3314. init_esm_shims2();
  3315. init_esm_shims2();
  3316. init_esm_shims2();
  3317. var _a12;
  3318. var _b12;
  3319. (_b12 = (_a12 = target).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__) != null ? _b12 : _a12.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ = /* @__PURE__ */ new Set();
  3320. function setupDevToolsPlugin(pluginDescriptor, setupFn) {
  3321. return hook.setupDevToolsPlugin(pluginDescriptor, setupFn);
  3322. }
  3323. function callDevToolsPluginSetupFn(plugin, app) {
  3324. const [pluginDescriptor, setupFn] = plugin;
  3325. if (pluginDescriptor.app !== app)
  3326. return;
  3327. const api = new DevToolsPluginAPI({
  3328. plugin: {
  3329. setupFn,
  3330. descriptor: pluginDescriptor
  3331. },
  3332. ctx: devtoolsContext
  3333. });
  3334. if (pluginDescriptor.packageName === "vuex") {
  3335. api.on.editInspectorState((payload) => {
  3336. api.sendInspectorState(payload.inspectorId);
  3337. });
  3338. }
  3339. setupFn(api);
  3340. }
  3341. function registerDevToolsPlugin(app, options) {
  3342. if (target.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(app)) {
  3343. return;
  3344. }
  3345. if (devtoolsState.highPerfModeEnabled && !(options == null ? void 0 : options.inspectingComponent)) {
  3346. return;
  3347. }
  3348. target.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(app);
  3349. devtoolsPluginBuffer.forEach((plugin) => {
  3350. callDevToolsPluginSetupFn(plugin, app);
  3351. });
  3352. }
  3353. init_esm_shims2();
  3354. init_esm_shims2();
  3355. var ROUTER_KEY = "__VUE_DEVTOOLS_ROUTER__";
  3356. var ROUTER_INFO_KEY = "__VUE_DEVTOOLS_ROUTER_INFO__";
  3357. var _a13;
  3358. var _b13;
  3359. (_b13 = (_a13 = target)[ROUTER_INFO_KEY]) != null ? _b13 : _a13[ROUTER_INFO_KEY] = {
  3360. currentRoute: null,
  3361. routes: []
  3362. };
  3363. var _a14;
  3364. var _b14;
  3365. (_b14 = (_a14 = target)[ROUTER_KEY]) != null ? _b14 : _a14[ROUTER_KEY] = {};
  3366. var devtoolsRouterInfo = new Proxy(target[ROUTER_INFO_KEY], {
  3367. get(target22, property) {
  3368. return target[ROUTER_INFO_KEY][property];
  3369. }
  3370. });
  3371. var devtoolsRouter = new Proxy(target[ROUTER_KEY], {
  3372. get(target22, property) {
  3373. if (property === "value") {
  3374. return target[ROUTER_KEY];
  3375. }
  3376. }
  3377. });
  3378. function getRoutes(router) {
  3379. const routesMap = /* @__PURE__ */ new Map();
  3380. return ((router == null ? void 0 : router.getRoutes()) || []).filter((i) => !routesMap.has(i.path) && routesMap.set(i.path, 1));
  3381. }
  3382. function filterRoutes(routes) {
  3383. return routes.map((item) => {
  3384. let { path, name, children, meta } = item;
  3385. if (children == null ? void 0 : children.length)
  3386. children = filterRoutes(children);
  3387. return {
  3388. path,
  3389. name,
  3390. children,
  3391. meta
  3392. };
  3393. });
  3394. }
  3395. function filterCurrentRoute(route) {
  3396. if (route) {
  3397. const { fullPath, hash, href, path, name, matched, params, query } = route;
  3398. return {
  3399. fullPath,
  3400. hash,
  3401. href,
  3402. path,
  3403. name,
  3404. params,
  3405. query,
  3406. matched: filterRoutes(matched)
  3407. };
  3408. }
  3409. return route;
  3410. }
  3411. function normalizeRouterInfo(appRecord, activeAppRecord2) {
  3412. function init() {
  3413. var _a25;
  3414. const router = (_a25 = appRecord.app) == null ? void 0 : _a25.config.globalProperties.$router;
  3415. const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);
  3416. const routes = filterRoutes(getRoutes(router));
  3417. const c = console.warn;
  3418. console.warn = () => {
  3419. };
  3420. target[ROUTER_INFO_KEY] = {
  3421. currentRoute: currentRoute ? deepClone(currentRoute) : {},
  3422. routes: deepClone(routes)
  3423. };
  3424. target[ROUTER_KEY] = router;
  3425. console.warn = c;
  3426. }
  3427. init();
  3428. hook.on.componentUpdated(debounce(() => {
  3429. var _a25;
  3430. if (((_a25 = activeAppRecord2.value) == null ? void 0 : _a25.app) !== appRecord.app)
  3431. return;
  3432. init();
  3433. if (devtoolsState.highPerfModeEnabled)
  3434. return;
  3435. devtoolsContext.hooks.callHook("routerInfoUpdated", { state: target[ROUTER_INFO_KEY] });
  3436. }, 200));
  3437. }
  3438. function createDevToolsApi(hooks2) {
  3439. return {
  3440. // get inspector tree
  3441. async getInspectorTree(payload) {
  3442. const _payload = {
  3443. ...payload,
  3444. app: activeAppRecord.value.app,
  3445. rootNodes: []
  3446. };
  3447. await new Promise((resolve) => {
  3448. hooks2.callHookWith(
  3449. async (callbacks) => {
  3450. await Promise.all(callbacks.map((cb) => cb(_payload)));
  3451. resolve();
  3452. },
  3453. "getInspectorTree"
  3454. /* GET_INSPECTOR_TREE */
  3455. );
  3456. });
  3457. return _payload.rootNodes;
  3458. },
  3459. // get inspector state
  3460. async getInspectorState(payload) {
  3461. const _payload = {
  3462. ...payload,
  3463. app: activeAppRecord.value.app,
  3464. state: null
  3465. };
  3466. const ctx = {
  3467. currentTab: `custom-inspector:${payload.inspectorId}`
  3468. };
  3469. await new Promise((resolve) => {
  3470. hooks2.callHookWith(
  3471. async (callbacks) => {
  3472. await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));
  3473. resolve();
  3474. },
  3475. "getInspectorState"
  3476. /* GET_INSPECTOR_STATE */
  3477. );
  3478. });
  3479. return _payload.state;
  3480. },
  3481. // edit inspector state
  3482. editInspectorState(payload) {
  3483. const stateEditor2 = new StateEditor();
  3484. const _payload = {
  3485. ...payload,
  3486. app: activeAppRecord.value.app,
  3487. set: (obj, path = payload.path, value = payload.state.value, cb) => {
  3488. stateEditor2.set(obj, path, value, cb || stateEditor2.createDefaultSetCallback(payload.state));
  3489. }
  3490. };
  3491. hooks2.callHookWith(
  3492. (callbacks) => {
  3493. callbacks.forEach((cb) => cb(_payload));
  3494. },
  3495. "editInspectorState"
  3496. /* EDIT_INSPECTOR_STATE */
  3497. );
  3498. },
  3499. // send inspector state
  3500. sendInspectorState(inspectorId) {
  3501. const inspector = getInspector(inspectorId);
  3502. hooks2.callHook("sendInspectorState", { inspectorId, plugin: {
  3503. descriptor: inspector.descriptor,
  3504. setupFn: () => ({})
  3505. } });
  3506. },
  3507. // inspect component inspector
  3508. inspectComponentInspector() {
  3509. return inspectComponentHighLighter();
  3510. },
  3511. // cancel inspect component inspector
  3512. cancelInspectComponentInspector() {
  3513. return cancelInspectComponentHighLighter();
  3514. },
  3515. // get component render code
  3516. getComponentRenderCode(id) {
  3517. const instance = getComponentInstance(activeAppRecord.value, id);
  3518. if (instance)
  3519. return !(typeof (instance == null ? void 0 : instance.type) === "function") ? instance.render.toString() : instance.type.toString();
  3520. },
  3521. // scroll to component
  3522. scrollToComponent(id) {
  3523. return scrollToComponent({ id });
  3524. },
  3525. // open in editor
  3526. openInEditor,
  3527. // get vue inspector
  3528. getVueInspector: getComponentInspector,
  3529. // toggle app
  3530. toggleApp(id, options) {
  3531. const appRecord = devtoolsAppRecords.value.find((record) => record.id === id);
  3532. if (appRecord) {
  3533. setActiveAppRecordId(id);
  3534. setActiveAppRecord(appRecord);
  3535. normalizeRouterInfo(appRecord, activeAppRecord);
  3536. callInspectorUpdatedHook();
  3537. registerDevToolsPlugin(appRecord.app, options);
  3538. }
  3539. },
  3540. // inspect dom
  3541. inspectDOM(instanceId) {
  3542. const instance = getComponentInstance(activeAppRecord.value, instanceId);
  3543. if (instance) {
  3544. const [el] = getRootElementsFromComponentInstance(instance);
  3545. if (el) {
  3546. target.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__ = el;
  3547. }
  3548. }
  3549. },
  3550. updatePluginSettings(pluginId, key, value) {
  3551. setPluginSettings(pluginId, key, value);
  3552. },
  3553. getPluginSettings(pluginId) {
  3554. return {
  3555. options: getPluginSettingsOptions(pluginId),
  3556. values: getPluginSettings(pluginId)
  3557. };
  3558. }
  3559. };
  3560. }
  3561. init_esm_shims2();
  3562. var _a15;
  3563. var _b15;
  3564. (_b15 = (_a15 = target).__VUE_DEVTOOLS_ENV__) != null ? _b15 : _a15.__VUE_DEVTOOLS_ENV__ = {
  3565. vitePluginDetected: false
  3566. };
  3567. var hooks = createDevToolsCtxHooks();
  3568. var _a16;
  3569. var _b16;
  3570. (_b16 = (_a16 = target).__VUE_DEVTOOLS_KIT_CONTEXT__) != null ? _b16 : _a16.__VUE_DEVTOOLS_KIT_CONTEXT__ = {
  3571. hooks,
  3572. get state() {
  3573. return {
  3574. ...devtoolsState,
  3575. activeAppRecordId: activeAppRecord.id,
  3576. activeAppRecord: activeAppRecord.value,
  3577. appRecords: devtoolsAppRecords.value
  3578. };
  3579. },
  3580. api: createDevToolsApi(hooks)
  3581. };
  3582. var devtoolsContext = target.__VUE_DEVTOOLS_KIT_CONTEXT__;
  3583. init_esm_shims2();
  3584. var import_speakingurl = __toESM2(require_speakingurl2(), 1);
  3585. var _a17;
  3586. var _b17;
  3587. var appRecordInfo = (_b17 = (_a17 = target).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__) != null ? _b17 : _a17.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ = {
  3588. id: 0,
  3589. appIds: /* @__PURE__ */ new Set()
  3590. };
  3591. init_esm_shims2();
  3592. init_esm_shims2();
  3593. function toggleHighPerfMode(state) {
  3594. devtoolsState.highPerfModeEnabled = state != null ? state : !devtoolsState.highPerfModeEnabled;
  3595. if (!state && activeAppRecord.value) {
  3596. registerDevToolsPlugin(activeAppRecord.value.app);
  3597. }
  3598. }
  3599. init_esm_shims2();
  3600. init_esm_shims2();
  3601. init_esm_shims2();
  3602. function updateDevToolsClientDetected(params) {
  3603. devtoolsState.devtoolsClientDetected = {
  3604. ...devtoolsState.devtoolsClientDetected,
  3605. ...params
  3606. };
  3607. const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
  3608. toggleHighPerfMode(!devtoolsClientVisible);
  3609. }
  3610. var _a18;
  3611. var _b18;
  3612. (_b18 = (_a18 = target).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__) != null ? _b18 : _a18.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ = updateDevToolsClientDetected;
  3613. init_esm_shims2();
  3614. init_esm_shims2();
  3615. init_esm_shims2();
  3616. init_esm_shims2();
  3617. init_esm_shims2();
  3618. init_esm_shims2();
  3619. init_esm_shims2();
  3620. var DoubleIndexedKV = class {
  3621. constructor() {
  3622. this.keyToValue = /* @__PURE__ */ new Map();
  3623. this.valueToKey = /* @__PURE__ */ new Map();
  3624. }
  3625. set(key, value) {
  3626. this.keyToValue.set(key, value);
  3627. this.valueToKey.set(value, key);
  3628. }
  3629. getByKey(key) {
  3630. return this.keyToValue.get(key);
  3631. }
  3632. getByValue(value) {
  3633. return this.valueToKey.get(value);
  3634. }
  3635. clear() {
  3636. this.keyToValue.clear();
  3637. this.valueToKey.clear();
  3638. }
  3639. };
  3640. var Registry = class {
  3641. constructor(generateIdentifier) {
  3642. this.generateIdentifier = generateIdentifier;
  3643. this.kv = new DoubleIndexedKV();
  3644. }
  3645. register(value, identifier) {
  3646. if (this.kv.getByValue(value)) {
  3647. return;
  3648. }
  3649. if (!identifier) {
  3650. identifier = this.generateIdentifier(value);
  3651. }
  3652. this.kv.set(identifier, value);
  3653. }
  3654. clear() {
  3655. this.kv.clear();
  3656. }
  3657. getIdentifier(value) {
  3658. return this.kv.getByValue(value);
  3659. }
  3660. getValue(identifier) {
  3661. return this.kv.getByKey(identifier);
  3662. }
  3663. };
  3664. var ClassRegistry = class extends Registry {
  3665. constructor() {
  3666. super((c) => c.name);
  3667. this.classToAllowedProps = /* @__PURE__ */ new Map();
  3668. }
  3669. register(value, options) {
  3670. if (typeof options === "object") {
  3671. if (options.allowProps) {
  3672. this.classToAllowedProps.set(value, options.allowProps);
  3673. }
  3674. super.register(value, options.identifier);
  3675. } else {
  3676. super.register(value, options);
  3677. }
  3678. }
  3679. getAllowedProps(value) {
  3680. return this.classToAllowedProps.get(value);
  3681. }
  3682. };
  3683. init_esm_shims2();
  3684. init_esm_shims2();
  3685. function valuesOfObj(record) {
  3686. if ("values" in Object) {
  3687. return Object.values(record);
  3688. }
  3689. const values = [];
  3690. for (const key in record) {
  3691. if (record.hasOwnProperty(key)) {
  3692. values.push(record[key]);
  3693. }
  3694. }
  3695. return values;
  3696. }
  3697. function find(record, predicate) {
  3698. const values = valuesOfObj(record);
  3699. if ("find" in values) {
  3700. return values.find(predicate);
  3701. }
  3702. const valuesNotNever = values;
  3703. for (let i = 0; i < valuesNotNever.length; i++) {
  3704. const value = valuesNotNever[i];
  3705. if (predicate(value)) {
  3706. return value;
  3707. }
  3708. }
  3709. return void 0;
  3710. }
  3711. function forEach(record, run) {
  3712. Object.entries(record).forEach(([key, value]) => run(value, key));
  3713. }
  3714. function includes(arr, value) {
  3715. return arr.indexOf(value) !== -1;
  3716. }
  3717. function findArr(record, predicate) {
  3718. for (let i = 0; i < record.length; i++) {
  3719. const value = record[i];
  3720. if (predicate(value)) {
  3721. return value;
  3722. }
  3723. }
  3724. return void 0;
  3725. }
  3726. var CustomTransformerRegistry = class {
  3727. constructor() {
  3728. this.transfomers = {};
  3729. }
  3730. register(transformer) {
  3731. this.transfomers[transformer.name] = transformer;
  3732. }
  3733. findApplicable(v) {
  3734. return find(this.transfomers, (transformer) => transformer.isApplicable(v));
  3735. }
  3736. findByName(name) {
  3737. return this.transfomers[name];
  3738. }
  3739. };
  3740. init_esm_shims2();
  3741. init_esm_shims2();
  3742. var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
  3743. var isUndefined = (payload) => typeof payload === "undefined";
  3744. var isNull = (payload) => payload === null;
  3745. var isPlainObject2 = (payload) => {
  3746. if (typeof payload !== "object" || payload === null)
  3747. return false;
  3748. if (payload === Object.prototype)
  3749. return false;
  3750. if (Object.getPrototypeOf(payload) === null)
  3751. return true;
  3752. return Object.getPrototypeOf(payload) === Object.prototype;
  3753. };
  3754. var isEmptyObject = (payload) => isPlainObject2(payload) && Object.keys(payload).length === 0;
  3755. var isArray = (payload) => Array.isArray(payload);
  3756. var isString = (payload) => typeof payload === "string";
  3757. var isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
  3758. var isBoolean = (payload) => typeof payload === "boolean";
  3759. var isRegExp = (payload) => payload instanceof RegExp;
  3760. var isMap = (payload) => payload instanceof Map;
  3761. var isSet = (payload) => payload instanceof Set;
  3762. var isSymbol = (payload) => getType(payload) === "Symbol";
  3763. var isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
  3764. var isError = (payload) => payload instanceof Error;
  3765. var isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
  3766. var isPrimitive2 = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
  3767. var isBigint = (payload) => typeof payload === "bigint";
  3768. var isInfinite = (payload) => payload === Infinity || payload === -Infinity;
  3769. var isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
  3770. var isURL = (payload) => payload instanceof URL;
  3771. init_esm_shims2();
  3772. var escapeKey = (key) => key.replace(/\./g, "\\.");
  3773. var stringifyPath = (path) => path.map(String).map(escapeKey).join(".");
  3774. var parsePath = (string) => {
  3775. const result = [];
  3776. let segment = "";
  3777. for (let i = 0; i < string.length; i++) {
  3778. let char = string.charAt(i);
  3779. const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
  3780. if (isEscapedDot) {
  3781. segment += ".";
  3782. i++;
  3783. continue;
  3784. }
  3785. const isEndOfSegment = char === ".";
  3786. if (isEndOfSegment) {
  3787. result.push(segment);
  3788. segment = "";
  3789. continue;
  3790. }
  3791. segment += char;
  3792. }
  3793. const lastSegment = segment;
  3794. result.push(lastSegment);
  3795. return result;
  3796. };
  3797. init_esm_shims2();
  3798. function simpleTransformation(isApplicable, annotation, transform, untransform) {
  3799. return {
  3800. isApplicable,
  3801. annotation,
  3802. transform,
  3803. untransform
  3804. };
  3805. }
  3806. var simpleRules = [
  3807. simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
  3808. simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
  3809. if (typeof BigInt !== "undefined") {
  3810. return BigInt(v);
  3811. }
  3812. console.error("Please add a BigInt polyfill.");
  3813. return v;
  3814. }),
  3815. simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
  3816. simpleTransformation(isError, "Error", (v, superJson) => {
  3817. const baseError = {
  3818. name: v.name,
  3819. message: v.message
  3820. };
  3821. superJson.allowedErrorProps.forEach((prop) => {
  3822. baseError[prop] = v[prop];
  3823. });
  3824. return baseError;
  3825. }, (v, superJson) => {
  3826. const e = new Error(v.message);
  3827. e.name = v.name;
  3828. e.stack = v.stack;
  3829. superJson.allowedErrorProps.forEach((prop) => {
  3830. e[prop] = v[prop];
  3831. });
  3832. return e;
  3833. }),
  3834. simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
  3835. const body = regex.slice(1, regex.lastIndexOf("/"));
  3836. const flags = regex.slice(regex.lastIndexOf("/") + 1);
  3837. return new RegExp(body, flags);
  3838. }),
  3839. simpleTransformation(
  3840. isSet,
  3841. "set",
  3842. // (sets only exist in es6+)
  3843. // eslint-disable-next-line es5/no-es6-methods
  3844. (v) => [...v.values()],
  3845. (v) => new Set(v)
  3846. ),
  3847. simpleTransformation(isMap, "map", (v) => [...v.entries()], (v) => new Map(v)),
  3848. simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
  3849. if (isNaNValue(v)) {
  3850. return "NaN";
  3851. }
  3852. if (v > 0) {
  3853. return "Infinity";
  3854. } else {
  3855. return "-Infinity";
  3856. }
  3857. }, Number),
  3858. simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
  3859. return "-0";
  3860. }, Number),
  3861. simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
  3862. ];
  3863. function compositeTransformation(isApplicable, annotation, transform, untransform) {
  3864. return {
  3865. isApplicable,
  3866. annotation,
  3867. transform,
  3868. untransform
  3869. };
  3870. }
  3871. var symbolRule = compositeTransformation((s, superJson) => {
  3872. if (isSymbol(s)) {
  3873. const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
  3874. return isRegistered;
  3875. }
  3876. return false;
  3877. }, (s, superJson) => {
  3878. const identifier = superJson.symbolRegistry.getIdentifier(s);
  3879. return ["symbol", identifier];
  3880. }, (v) => v.description, (_, a, superJson) => {
  3881. const value = superJson.symbolRegistry.getValue(a[1]);
  3882. if (!value) {
  3883. throw new Error("Trying to deserialize unknown symbol");
  3884. }
  3885. return value;
  3886. });
  3887. var constructorToName = [
  3888. Int8Array,
  3889. Uint8Array,
  3890. Int16Array,
  3891. Uint16Array,
  3892. Int32Array,
  3893. Uint32Array,
  3894. Float32Array,
  3895. Float64Array,
  3896. Uint8ClampedArray
  3897. ].reduce((obj, ctor) => {
  3898. obj[ctor.name] = ctor;
  3899. return obj;
  3900. }, {});
  3901. var typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
  3902. const ctor = constructorToName[a[1]];
  3903. if (!ctor) {
  3904. throw new Error("Trying to deserialize unknown typed array");
  3905. }
  3906. return new ctor(v);
  3907. });
  3908. function isInstanceOfRegisteredClass(potentialClass, superJson) {
  3909. if (potentialClass == null ? void 0 : potentialClass.constructor) {
  3910. const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
  3911. return isRegistered;
  3912. }
  3913. return false;
  3914. }
  3915. var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
  3916. const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
  3917. return ["class", identifier];
  3918. }, (clazz, superJson) => {
  3919. const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
  3920. if (!allowedProps) {
  3921. return { ...clazz };
  3922. }
  3923. const result = {};
  3924. allowedProps.forEach((prop) => {
  3925. result[prop] = clazz[prop];
  3926. });
  3927. return result;
  3928. }, (v, a, superJson) => {
  3929. const clazz = superJson.classRegistry.getValue(a[1]);
  3930. if (!clazz) {
  3931. throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
  3932. }
  3933. return Object.assign(Object.create(clazz.prototype), v);
  3934. });
  3935. var customRule = compositeTransformation((value, superJson) => {
  3936. return !!superJson.customTransformerRegistry.findApplicable(value);
  3937. }, (value, superJson) => {
  3938. const transformer = superJson.customTransformerRegistry.findApplicable(value);
  3939. return ["custom", transformer.name];
  3940. }, (value, superJson) => {
  3941. const transformer = superJson.customTransformerRegistry.findApplicable(value);
  3942. return transformer.serialize(value);
  3943. }, (v, a, superJson) => {
  3944. const transformer = superJson.customTransformerRegistry.findByName(a[1]);
  3945. if (!transformer) {
  3946. throw new Error("Trying to deserialize unknown custom value");
  3947. }
  3948. return transformer.deserialize(v);
  3949. });
  3950. var compositeRules = [classRule, symbolRule, customRule, typedArrayRule];
  3951. var transformValue = (value, superJson) => {
  3952. const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
  3953. if (applicableCompositeRule) {
  3954. return {
  3955. value: applicableCompositeRule.transform(value, superJson),
  3956. type: applicableCompositeRule.annotation(value, superJson)
  3957. };
  3958. }
  3959. const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
  3960. if (applicableSimpleRule) {
  3961. return {
  3962. value: applicableSimpleRule.transform(value, superJson),
  3963. type: applicableSimpleRule.annotation
  3964. };
  3965. }
  3966. return void 0;
  3967. };
  3968. var simpleRulesByAnnotation = {};
  3969. simpleRules.forEach((rule) => {
  3970. simpleRulesByAnnotation[rule.annotation] = rule;
  3971. });
  3972. var untransformValue = (json, type, superJson) => {
  3973. if (isArray(type)) {
  3974. switch (type[0]) {
  3975. case "symbol":
  3976. return symbolRule.untransform(json, type, superJson);
  3977. case "class":
  3978. return classRule.untransform(json, type, superJson);
  3979. case "custom":
  3980. return customRule.untransform(json, type, superJson);
  3981. case "typed-array":
  3982. return typedArrayRule.untransform(json, type, superJson);
  3983. default:
  3984. throw new Error("Unknown transformation: " + type);
  3985. }
  3986. } else {
  3987. const transformation = simpleRulesByAnnotation[type];
  3988. if (!transformation) {
  3989. throw new Error("Unknown transformation: " + type);
  3990. }
  3991. return transformation.untransform(json, superJson);
  3992. }
  3993. };
  3994. init_esm_shims2();
  3995. var getNthKey = (value, n) => {
  3996. if (n > value.size)
  3997. throw new Error("index out of bounds");
  3998. const keys = value.keys();
  3999. while (n > 0) {
  4000. keys.next();
  4001. n--;
  4002. }
  4003. return keys.next().value;
  4004. };
  4005. function validatePath(path) {
  4006. if (includes(path, "__proto__")) {
  4007. throw new Error("__proto__ is not allowed as a property");
  4008. }
  4009. if (includes(path, "prototype")) {
  4010. throw new Error("prototype is not allowed as a property");
  4011. }
  4012. if (includes(path, "constructor")) {
  4013. throw new Error("constructor is not allowed as a property");
  4014. }
  4015. }
  4016. var getDeep = (object, path) => {
  4017. validatePath(path);
  4018. for (let i = 0; i < path.length; i++) {
  4019. const key = path[i];
  4020. if (isSet(object)) {
  4021. object = getNthKey(object, +key);
  4022. } else if (isMap(object)) {
  4023. const row = +key;
  4024. const type = +path[++i] === 0 ? "key" : "value";
  4025. const keyOfRow = getNthKey(object, row);
  4026. switch (type) {
  4027. case "key":
  4028. object = keyOfRow;
  4029. break;
  4030. case "value":
  4031. object = object.get(keyOfRow);
  4032. break;
  4033. }
  4034. } else {
  4035. object = object[key];
  4036. }
  4037. }
  4038. return object;
  4039. };
  4040. var setDeep = (object, path, mapper) => {
  4041. validatePath(path);
  4042. if (path.length === 0) {
  4043. return mapper(object);
  4044. }
  4045. let parent = object;
  4046. for (let i = 0; i < path.length - 1; i++) {
  4047. const key = path[i];
  4048. if (isArray(parent)) {
  4049. const index = +key;
  4050. parent = parent[index];
  4051. } else if (isPlainObject2(parent)) {
  4052. parent = parent[key];
  4053. } else if (isSet(parent)) {
  4054. const row = +key;
  4055. parent = getNthKey(parent, row);
  4056. } else if (isMap(parent)) {
  4057. const isEnd = i === path.length - 2;
  4058. if (isEnd) {
  4059. break;
  4060. }
  4061. const row = +key;
  4062. const type = +path[++i] === 0 ? "key" : "value";
  4063. const keyOfRow = getNthKey(parent, row);
  4064. switch (type) {
  4065. case "key":
  4066. parent = keyOfRow;
  4067. break;
  4068. case "value":
  4069. parent = parent.get(keyOfRow);
  4070. break;
  4071. }
  4072. }
  4073. }
  4074. const lastKey = path[path.length - 1];
  4075. if (isArray(parent)) {
  4076. parent[+lastKey] = mapper(parent[+lastKey]);
  4077. } else if (isPlainObject2(parent)) {
  4078. parent[lastKey] = mapper(parent[lastKey]);
  4079. }
  4080. if (isSet(parent)) {
  4081. const oldValue = getNthKey(parent, +lastKey);
  4082. const newValue = mapper(oldValue);
  4083. if (oldValue !== newValue) {
  4084. parent.delete(oldValue);
  4085. parent.add(newValue);
  4086. }
  4087. }
  4088. if (isMap(parent)) {
  4089. const row = +path[path.length - 2];
  4090. const keyToRow = getNthKey(parent, row);
  4091. const type = +lastKey === 0 ? "key" : "value";
  4092. switch (type) {
  4093. case "key": {
  4094. const newKey = mapper(keyToRow);
  4095. parent.set(newKey, parent.get(keyToRow));
  4096. if (newKey !== keyToRow) {
  4097. parent.delete(keyToRow);
  4098. }
  4099. break;
  4100. }
  4101. case "value": {
  4102. parent.set(keyToRow, mapper(parent.get(keyToRow)));
  4103. break;
  4104. }
  4105. }
  4106. }
  4107. return object;
  4108. };
  4109. function traverse(tree, walker2, origin = []) {
  4110. if (!tree) {
  4111. return;
  4112. }
  4113. if (!isArray(tree)) {
  4114. forEach(tree, (subtree, key) => traverse(subtree, walker2, [...origin, ...parsePath(key)]));
  4115. return;
  4116. }
  4117. const [nodeValue, children] = tree;
  4118. if (children) {
  4119. forEach(children, (child, key) => {
  4120. traverse(child, walker2, [...origin, ...parsePath(key)]);
  4121. });
  4122. }
  4123. walker2(nodeValue, origin);
  4124. }
  4125. function applyValueAnnotations(plain, annotations, superJson) {
  4126. traverse(annotations, (type, path) => {
  4127. plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
  4128. });
  4129. return plain;
  4130. }
  4131. function applyReferentialEqualityAnnotations(plain, annotations) {
  4132. function apply(identicalPaths, path) {
  4133. const object = getDeep(plain, parsePath(path));
  4134. identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
  4135. plain = setDeep(plain, identicalObjectPath, () => object);
  4136. });
  4137. }
  4138. if (isArray(annotations)) {
  4139. const [root, other] = annotations;
  4140. root.forEach((identicalPath) => {
  4141. plain = setDeep(plain, parsePath(identicalPath), () => plain);
  4142. });
  4143. if (other) {
  4144. forEach(other, apply);
  4145. }
  4146. } else {
  4147. forEach(annotations, apply);
  4148. }
  4149. return plain;
  4150. }
  4151. var isDeep = (object, superJson) => isPlainObject2(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
  4152. function addIdentity(object, path, identities) {
  4153. const existingSet = identities.get(object);
  4154. if (existingSet) {
  4155. existingSet.push(path);
  4156. } else {
  4157. identities.set(object, [path]);
  4158. }
  4159. }
  4160. function generateReferentialEqualityAnnotations(identitites, dedupe) {
  4161. const result = {};
  4162. let rootEqualityPaths = void 0;
  4163. identitites.forEach((paths) => {
  4164. if (paths.length <= 1) {
  4165. return;
  4166. }
  4167. if (!dedupe) {
  4168. paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length);
  4169. }
  4170. const [representativePath, ...identicalPaths] = paths;
  4171. if (representativePath.length === 0) {
  4172. rootEqualityPaths = identicalPaths.map(stringifyPath);
  4173. } else {
  4174. result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
  4175. }
  4176. });
  4177. if (rootEqualityPaths) {
  4178. if (isEmptyObject(result)) {
  4179. return [rootEqualityPaths];
  4180. } else {
  4181. return [rootEqualityPaths, result];
  4182. }
  4183. } else {
  4184. return isEmptyObject(result) ? void 0 : result;
  4185. }
  4186. }
  4187. var walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
  4188. var _a25;
  4189. const primitive = isPrimitive2(object);
  4190. if (!primitive) {
  4191. addIdentity(object, path, identities);
  4192. const seen = seenObjects.get(object);
  4193. if (seen) {
  4194. return dedupe ? {
  4195. transformedValue: null
  4196. } : seen;
  4197. }
  4198. }
  4199. if (!isDeep(object, superJson)) {
  4200. const transformed2 = transformValue(object, superJson);
  4201. const result2 = transformed2 ? {
  4202. transformedValue: transformed2.value,
  4203. annotations: [transformed2.type]
  4204. } : {
  4205. transformedValue: object
  4206. };
  4207. if (!primitive) {
  4208. seenObjects.set(object, result2);
  4209. }
  4210. return result2;
  4211. }
  4212. if (includes(objectsInThisPath, object)) {
  4213. return {
  4214. transformedValue: null
  4215. };
  4216. }
  4217. const transformationResult = transformValue(object, superJson);
  4218. const transformed = (_a25 = transformationResult == null ? void 0 : transformationResult.value) != null ? _a25 : object;
  4219. const transformedValue = isArray(transformed) ? [] : {};
  4220. const innerAnnotations = {};
  4221. forEach(transformed, (value, index) => {
  4222. if (index === "__proto__" || index === "constructor" || index === "prototype") {
  4223. throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
  4224. }
  4225. const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
  4226. transformedValue[index] = recursiveResult.transformedValue;
  4227. if (isArray(recursiveResult.annotations)) {
  4228. innerAnnotations[index] = recursiveResult.annotations;
  4229. } else if (isPlainObject2(recursiveResult.annotations)) {
  4230. forEach(recursiveResult.annotations, (tree, key) => {
  4231. innerAnnotations[escapeKey(index) + "." + key] = tree;
  4232. });
  4233. }
  4234. });
  4235. const result = isEmptyObject(innerAnnotations) ? {
  4236. transformedValue,
  4237. annotations: !!transformationResult ? [transformationResult.type] : void 0
  4238. } : {
  4239. transformedValue,
  4240. annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
  4241. };
  4242. if (!primitive) {
  4243. seenObjects.set(object, result);
  4244. }
  4245. return result;
  4246. };
  4247. init_esm_shims2();
  4248. init_esm_shims2();
  4249. function getType2(payload) {
  4250. return Object.prototype.toString.call(payload).slice(8, -1);
  4251. }
  4252. function isArray2(payload) {
  4253. return getType2(payload) === "Array";
  4254. }
  4255. function isPlainObject3(payload) {
  4256. if (getType2(payload) !== "Object")
  4257. return false;
  4258. const prototype = Object.getPrototypeOf(payload);
  4259. return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
  4260. }
  4261. function isNull2(payload) {
  4262. return getType2(payload) === "Null";
  4263. }
  4264. function isOneOf(a, b, c, d, e) {
  4265. return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);
  4266. }
  4267. function isUndefined2(payload) {
  4268. return getType2(payload) === "Undefined";
  4269. }
  4270. var isNullOrUndefined = isOneOf(isNull2, isUndefined2);
  4271. function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
  4272. const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
  4273. if (propType === "enumerable")
  4274. carry[key] = newVal;
  4275. if (includeNonenumerable && propType === "nonenumerable") {
  4276. Object.defineProperty(carry, key, {
  4277. value: newVal,
  4278. enumerable: false,
  4279. writable: true,
  4280. configurable: true
  4281. });
  4282. }
  4283. }
  4284. function copy(target22, options = {}) {
  4285. if (isArray2(target22)) {
  4286. return target22.map((item) => copy(item, options));
  4287. }
  4288. if (!isPlainObject3(target22)) {
  4289. return target22;
  4290. }
  4291. const props = Object.getOwnPropertyNames(target22);
  4292. const symbols = Object.getOwnPropertySymbols(target22);
  4293. return [...props, ...symbols].reduce((carry, key) => {
  4294. if (isArray2(options.props) && !options.props.includes(key)) {
  4295. return carry;
  4296. }
  4297. const val = target22[key];
  4298. const newVal = copy(val, options);
  4299. assignProp(carry, key, newVal, target22, options.nonenumerable);
  4300. return carry;
  4301. }, {});
  4302. }
  4303. var SuperJSON = class {
  4304. /**
  4305. * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
  4306. */
  4307. constructor({ dedupe = false } = {}) {
  4308. this.classRegistry = new ClassRegistry();
  4309. this.symbolRegistry = new Registry((s) => {
  4310. var _a25;
  4311. return (_a25 = s.description) != null ? _a25 : "";
  4312. });
  4313. this.customTransformerRegistry = new CustomTransformerRegistry();
  4314. this.allowedErrorProps = [];
  4315. this.dedupe = dedupe;
  4316. }
  4317. serialize(object) {
  4318. const identities = /* @__PURE__ */ new Map();
  4319. const output = walker(object, identities, this, this.dedupe);
  4320. const res = {
  4321. json: output.transformedValue
  4322. };
  4323. if (output.annotations) {
  4324. res.meta = {
  4325. ...res.meta,
  4326. values: output.annotations
  4327. };
  4328. }
  4329. const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
  4330. if (equalityAnnotations) {
  4331. res.meta = {
  4332. ...res.meta,
  4333. referentialEqualities: equalityAnnotations
  4334. };
  4335. }
  4336. return res;
  4337. }
  4338. deserialize(payload) {
  4339. const { json, meta } = payload;
  4340. let result = copy(json);
  4341. if (meta == null ? void 0 : meta.values) {
  4342. result = applyValueAnnotations(result, meta.values, this);
  4343. }
  4344. if (meta == null ? void 0 : meta.referentialEqualities) {
  4345. result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
  4346. }
  4347. return result;
  4348. }
  4349. stringify(object) {
  4350. return JSON.stringify(this.serialize(object));
  4351. }
  4352. parse(string) {
  4353. return this.deserialize(JSON.parse(string));
  4354. }
  4355. registerClass(v, options) {
  4356. this.classRegistry.register(v, options);
  4357. }
  4358. registerSymbol(v, identifier) {
  4359. this.symbolRegistry.register(v, identifier);
  4360. }
  4361. registerCustom(transformer, name) {
  4362. this.customTransformerRegistry.register({
  4363. name,
  4364. ...transformer
  4365. });
  4366. }
  4367. allowErrorProps(...props) {
  4368. this.allowedErrorProps.push(...props);
  4369. }
  4370. };
  4371. SuperJSON.defaultInstance = new SuperJSON();
  4372. SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
  4373. SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
  4374. SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
  4375. SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
  4376. SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
  4377. SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
  4378. SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
  4379. SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
  4380. var serialize = SuperJSON.serialize;
  4381. var deserialize = SuperJSON.deserialize;
  4382. var stringify = SuperJSON.stringify;
  4383. var parse = SuperJSON.parse;
  4384. var registerClass = SuperJSON.registerClass;
  4385. var registerCustom = SuperJSON.registerCustom;
  4386. var registerSymbol = SuperJSON.registerSymbol;
  4387. var allowErrorProps = SuperJSON.allowErrorProps;
  4388. init_esm_shims2();
  4389. init_esm_shims2();
  4390. init_esm_shims2();
  4391. init_esm_shims2();
  4392. init_esm_shims2();
  4393. init_esm_shims2();
  4394. init_esm_shims2();
  4395. init_esm_shims2();
  4396. init_esm_shims2();
  4397. init_esm_shims2();
  4398. init_esm_shims2();
  4399. init_esm_shims2();
  4400. init_esm_shims2();
  4401. init_esm_shims2();
  4402. init_esm_shims2();
  4403. init_esm_shims2();
  4404. init_esm_shims2();
  4405. init_esm_shims2();
  4406. init_esm_shims2();
  4407. init_esm_shims2();
  4408. init_esm_shims2();
  4409. init_esm_shims2();
  4410. init_esm_shims2();
  4411. var _a19;
  4412. var _b19;
  4413. (_b19 = (_a19 = target).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__) != null ? _b19 : _a19.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ = [];
  4414. var _a20;
  4415. var _b20;
  4416. (_b20 = (_a20 = target).__VUE_DEVTOOLS_KIT_RPC_CLIENT__) != null ? _b20 : _a20.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = null;
  4417. var _a21;
  4418. var _b21;
  4419. (_b21 = (_a21 = target).__VUE_DEVTOOLS_KIT_RPC_SERVER__) != null ? _b21 : _a21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = null;
  4420. var _a222;
  4421. var _b22;
  4422. (_b22 = (_a222 = target).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__) != null ? _b22 : _a222.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = null;
  4423. var _a23;
  4424. var _b23;
  4425. (_b23 = (_a23 = target).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__) != null ? _b23 : _a23.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = null;
  4426. var _a24;
  4427. var _b24;
  4428. (_b24 = (_a24 = target).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__) != null ? _b24 : _a24.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ = null;
  4429. init_esm_shims2();
  4430. init_esm_shims2();
  4431. init_esm_shims2();
  4432. init_esm_shims2();
  4433. init_esm_shims2();
  4434. init_esm_shims2();
  4435. init_esm_shims2();
  4436. var MAX_SERIALIZED_SIZE = 2 * 1024 * 1024;
  4437. // node_modules/pinia/dist/pinia.mjs
  4438. var activePinia;
  4439. var setActivePinia = (pinia) => activePinia = pinia;
  4440. var getActivePinia = () => hasInjectionContext() && inject(piniaSymbol) || activePinia;
  4441. var piniaSymbol = true ? Symbol("pinia") : (
  4442. /* istanbul ignore next */
  4443. Symbol()
  4444. );
  4445. function isPlainObject(o) {
  4446. return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
  4447. }
  4448. var MutationType;
  4449. (function(MutationType2) {
  4450. MutationType2["direct"] = "direct";
  4451. MutationType2["patchObject"] = "patch object";
  4452. MutationType2["patchFunction"] = "patch function";
  4453. })(MutationType || (MutationType = {}));
  4454. var IS_CLIENT = typeof window !== "undefined";
  4455. var _global = (() => typeof window === "object" && window.window === window ? window : typeof self === "object" && self.self === self ? self : typeof global === "object" && global.global === global ? global : typeof globalThis === "object" ? globalThis : { HTMLElement: null })();
  4456. function bom(blob, { autoBom = false } = {}) {
  4457. if (autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
  4458. return new Blob([String.fromCharCode(65279), blob], { type: blob.type });
  4459. }
  4460. return blob;
  4461. }
  4462. function download(url, name, opts) {
  4463. const xhr = new XMLHttpRequest();
  4464. xhr.open("GET", url);
  4465. xhr.responseType = "blob";
  4466. xhr.onload = function() {
  4467. saveAs(xhr.response, name, opts);
  4468. };
  4469. xhr.onerror = function() {
  4470. console.error("could not download file");
  4471. };
  4472. xhr.send();
  4473. }
  4474. function corsEnabled(url) {
  4475. const xhr = new XMLHttpRequest();
  4476. xhr.open("HEAD", url, false);
  4477. try {
  4478. xhr.send();
  4479. } catch (e) {
  4480. }
  4481. return xhr.status >= 200 && xhr.status <= 299;
  4482. }
  4483. function click(node) {
  4484. try {
  4485. node.dispatchEvent(new MouseEvent("click"));
  4486. } catch (e) {
  4487. const evt = new MouseEvent("click", {
  4488. bubbles: true,
  4489. cancelable: true,
  4490. view: window,
  4491. detail: 0,
  4492. screenX: 80,
  4493. screenY: 20,
  4494. clientX: 80,
  4495. clientY: 20,
  4496. ctrlKey: false,
  4497. altKey: false,
  4498. shiftKey: false,
  4499. metaKey: false,
  4500. button: 0,
  4501. relatedTarget: null
  4502. });
  4503. node.dispatchEvent(evt);
  4504. }
  4505. }
  4506. var _navigator = typeof navigator === "object" ? navigator : { userAgent: "" };
  4507. var isMacOSWebView = (() => /Macintosh/.test(_navigator.userAgent) && /AppleWebKit/.test(_navigator.userAgent) && !/Safari/.test(_navigator.userAgent))();
  4508. var saveAs = !IS_CLIENT ? () => {
  4509. } : (
  4510. // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
  4511. typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype && !isMacOSWebView ? downloadSaveAs : (
  4512. // Use msSaveOrOpenBlob as a second approach
  4513. "msSaveOrOpenBlob" in _navigator ? msSaveAs : (
  4514. // Fallback to using FileReader and a popup
  4515. fileSaverSaveAs
  4516. )
  4517. )
  4518. );
  4519. function downloadSaveAs(blob, name = "download", opts) {
  4520. const a = document.createElement("a");
  4521. a.download = name;
  4522. a.rel = "noopener";
  4523. if (typeof blob === "string") {
  4524. a.href = blob;
  4525. if (a.origin !== location.origin) {
  4526. if (corsEnabled(a.href)) {
  4527. download(blob, name, opts);
  4528. } else {
  4529. a.target = "_blank";
  4530. click(a);
  4531. }
  4532. } else {
  4533. click(a);
  4534. }
  4535. } else {
  4536. a.href = URL.createObjectURL(blob);
  4537. setTimeout(function() {
  4538. URL.revokeObjectURL(a.href);
  4539. }, 4e4);
  4540. setTimeout(function() {
  4541. click(a);
  4542. }, 0);
  4543. }
  4544. }
  4545. function msSaveAs(blob, name = "download", opts) {
  4546. if (typeof blob === "string") {
  4547. if (corsEnabled(blob)) {
  4548. download(blob, name, opts);
  4549. } else {
  4550. const a = document.createElement("a");
  4551. a.href = blob;
  4552. a.target = "_blank";
  4553. setTimeout(function() {
  4554. click(a);
  4555. });
  4556. }
  4557. } else {
  4558. navigator.msSaveOrOpenBlob(bom(blob, opts), name);
  4559. }
  4560. }
  4561. function fileSaverSaveAs(blob, name, opts, popup) {
  4562. popup = popup || open("", "_blank");
  4563. if (popup) {
  4564. popup.document.title = popup.document.body.innerText = "downloading...";
  4565. }
  4566. if (typeof blob === "string")
  4567. return download(blob, name, opts);
  4568. const force = blob.type === "application/octet-stream";
  4569. const isSafari = /constructor/i.test(String(_global.HTMLElement)) || "safari" in _global;
  4570. const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);
  4571. if ((isChromeIOS || force && isSafari || isMacOSWebView) && typeof FileReader !== "undefined") {
  4572. const reader = new FileReader();
  4573. reader.onloadend = function() {
  4574. let url = reader.result;
  4575. if (typeof url !== "string") {
  4576. popup = null;
  4577. throw new Error("Wrong reader.result type");
  4578. }
  4579. url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, "data:attachment/file;");
  4580. if (popup) {
  4581. popup.location.href = url;
  4582. } else {
  4583. location.assign(url);
  4584. }
  4585. popup = null;
  4586. };
  4587. reader.readAsDataURL(blob);
  4588. } else {
  4589. const url = URL.createObjectURL(blob);
  4590. if (popup)
  4591. popup.location.assign(url);
  4592. else
  4593. location.href = url;
  4594. popup = null;
  4595. setTimeout(function() {
  4596. URL.revokeObjectURL(url);
  4597. }, 4e4);
  4598. }
  4599. }
  4600. function toastMessage(message, type) {
  4601. const piniaMessage = "🍍 " + message;
  4602. if (typeof __VUE_DEVTOOLS_TOAST__ === "function") {
  4603. __VUE_DEVTOOLS_TOAST__(piniaMessage, type);
  4604. } else if (type === "error") {
  4605. console.error(piniaMessage);
  4606. } else if (type === "warn") {
  4607. console.warn(piniaMessage);
  4608. } else {
  4609. console.log(piniaMessage);
  4610. }
  4611. }
  4612. function isPinia(o) {
  4613. return "_a" in o && "install" in o;
  4614. }
  4615. function checkClipboardAccess() {
  4616. if (!("clipboard" in navigator)) {
  4617. toastMessage(`Your browser doesn't support the Clipboard API`, "error");
  4618. return true;
  4619. }
  4620. }
  4621. function checkNotFocusedError(error) {
  4622. if (error instanceof Error && error.message.toLowerCase().includes("document is not focused")) {
  4623. toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn");
  4624. return true;
  4625. }
  4626. return false;
  4627. }
  4628. async function actionGlobalCopyState(pinia) {
  4629. if (checkClipboardAccess())
  4630. return;
  4631. try {
  4632. await navigator.clipboard.writeText(JSON.stringify(pinia.state.value));
  4633. toastMessage("Global state copied to clipboard.");
  4634. } catch (error) {
  4635. if (checkNotFocusedError(error))
  4636. return;
  4637. toastMessage(`Failed to serialize the state. Check the console for more details.`, "error");
  4638. console.error(error);
  4639. }
  4640. }
  4641. async function actionGlobalPasteState(pinia) {
  4642. if (checkClipboardAccess())
  4643. return;
  4644. try {
  4645. loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText()));
  4646. toastMessage("Global state pasted from clipboard.");
  4647. } catch (error) {
  4648. if (checkNotFocusedError(error))
  4649. return;
  4650. toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, "error");
  4651. console.error(error);
  4652. }
  4653. }
  4654. async function actionGlobalSaveState(pinia) {
  4655. try {
  4656. saveAs(new Blob([JSON.stringify(pinia.state.value)], {
  4657. type: "text/plain;charset=utf-8"
  4658. }), "pinia-state.json");
  4659. } catch (error) {
  4660. toastMessage(`Failed to export the state as JSON. Check the console for more details.`, "error");
  4661. console.error(error);
  4662. }
  4663. }
  4664. var fileInput;
  4665. function getFileOpener() {
  4666. if (!fileInput) {
  4667. fileInput = document.createElement("input");
  4668. fileInput.type = "file";
  4669. fileInput.accept = ".json";
  4670. }
  4671. function openFile() {
  4672. return new Promise((resolve, reject) => {
  4673. fileInput.onchange = async () => {
  4674. const files = fileInput.files;
  4675. if (!files)
  4676. return resolve(null);
  4677. const file = files.item(0);
  4678. if (!file)
  4679. return resolve(null);
  4680. return resolve({ text: await file.text(), file });
  4681. };
  4682. fileInput.oncancel = () => resolve(null);
  4683. fileInput.onerror = reject;
  4684. fileInput.click();
  4685. });
  4686. }
  4687. return openFile;
  4688. }
  4689. async function actionGlobalOpenStateFile(pinia) {
  4690. try {
  4691. const open2 = getFileOpener();
  4692. const result = await open2();
  4693. if (!result)
  4694. return;
  4695. const { text, file } = result;
  4696. loadStoresState(pinia, JSON.parse(text));
  4697. toastMessage(`Global state imported from "${file.name}".`);
  4698. } catch (error) {
  4699. toastMessage(`Failed to import the state from JSON. Check the console for more details.`, "error");
  4700. console.error(error);
  4701. }
  4702. }
  4703. function loadStoresState(pinia, state) {
  4704. for (const key in state) {
  4705. const storeState = pinia.state.value[key];
  4706. if (storeState) {
  4707. Object.assign(storeState, state[key]);
  4708. } else {
  4709. pinia.state.value[key] = state[key];
  4710. }
  4711. }
  4712. }
  4713. function formatDisplay(display) {
  4714. return {
  4715. _custom: {
  4716. display
  4717. }
  4718. };
  4719. }
  4720. var PINIA_ROOT_LABEL = "🍍 Pinia (root)";
  4721. var PINIA_ROOT_ID = "_root";
  4722. function formatStoreForInspectorTree(store) {
  4723. return isPinia(store) ? {
  4724. id: PINIA_ROOT_ID,
  4725. label: PINIA_ROOT_LABEL
  4726. } : {
  4727. id: store.$id,
  4728. label: store.$id
  4729. };
  4730. }
  4731. function formatStoreForInspectorState(store) {
  4732. if (isPinia(store)) {
  4733. const storeNames = Array.from(store._s.keys());
  4734. const storeMap = store._s;
  4735. const state2 = {
  4736. state: storeNames.map((storeId) => ({
  4737. editable: true,
  4738. key: storeId,
  4739. value: store.state.value[storeId]
  4740. })),
  4741. getters: storeNames.filter((id) => storeMap.get(id)._getters).map((id) => {
  4742. const store2 = storeMap.get(id);
  4743. return {
  4744. editable: false,
  4745. key: id,
  4746. value: store2._getters.reduce((getters, key) => {
  4747. getters[key] = store2[key];
  4748. return getters;
  4749. }, {})
  4750. };
  4751. })
  4752. };
  4753. return state2;
  4754. }
  4755. const state = {
  4756. state: Object.keys(store.$state).map((key) => ({
  4757. editable: true,
  4758. key,
  4759. value: store.$state[key]
  4760. }))
  4761. };
  4762. if (store._getters && store._getters.length) {
  4763. state.getters = store._getters.map((getterName) => ({
  4764. editable: false,
  4765. key: getterName,
  4766. value: store[getterName]
  4767. }));
  4768. }
  4769. if (store._customProperties.size) {
  4770. state.customProperties = Array.from(store._customProperties).map((key) => ({
  4771. editable: true,
  4772. key,
  4773. value: store[key]
  4774. }));
  4775. }
  4776. return state;
  4777. }
  4778. function formatEventData(events) {
  4779. if (!events)
  4780. return {};
  4781. if (Array.isArray(events)) {
  4782. return events.reduce((data, event) => {
  4783. data.keys.push(event.key);
  4784. data.operations.push(event.type);
  4785. data.oldValue[event.key] = event.oldValue;
  4786. data.newValue[event.key] = event.newValue;
  4787. return data;
  4788. }, {
  4789. oldValue: {},
  4790. keys: [],
  4791. operations: [],
  4792. newValue: {}
  4793. });
  4794. } else {
  4795. return {
  4796. operation: formatDisplay(events.type),
  4797. key: formatDisplay(events.key),
  4798. oldValue: events.oldValue,
  4799. newValue: events.newValue
  4800. };
  4801. }
  4802. }
  4803. function formatMutationType(type) {
  4804. switch (type) {
  4805. case MutationType.direct:
  4806. return "mutation";
  4807. case MutationType.patchFunction:
  4808. return "$patch";
  4809. case MutationType.patchObject:
  4810. return "$patch";
  4811. default:
  4812. return "unknown";
  4813. }
  4814. }
  4815. var isTimelineActive = true;
  4816. var componentStateTypes = [];
  4817. var MUTATIONS_LAYER_ID = "pinia:mutations";
  4818. var INSPECTOR_ID = "pinia";
  4819. var { assign: assign$1 } = Object;
  4820. var getStoreType = (id) => "🍍 " + id;
  4821. function registerPiniaDevtools(app, pinia) {
  4822. setupDevToolsPlugin({
  4823. id: "dev.esm.pinia",
  4824. label: "Pinia 🍍",
  4825. logo: "https://pinia.vuejs.org/logo.svg",
  4826. packageName: "pinia",
  4827. homepage: "https://pinia.vuejs.org",
  4828. componentStateTypes,
  4829. app
  4830. }, (api) => {
  4831. if (typeof api.now !== "function") {
  4832. toastMessage("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.");
  4833. }
  4834. api.addTimelineLayer({
  4835. id: MUTATIONS_LAYER_ID,
  4836. label: `Pinia 🍍`,
  4837. color: 15064968
  4838. });
  4839. api.addInspector({
  4840. id: INSPECTOR_ID,
  4841. label: "Pinia 🍍",
  4842. icon: "storage",
  4843. treeFilterPlaceholder: "Search stores",
  4844. actions: [
  4845. {
  4846. icon: "content_copy",
  4847. action: () => {
  4848. actionGlobalCopyState(pinia);
  4849. },
  4850. tooltip: "Serialize and copy the state"
  4851. },
  4852. {
  4853. icon: "content_paste",
  4854. action: async () => {
  4855. await actionGlobalPasteState(pinia);
  4856. api.sendInspectorTree(INSPECTOR_ID);
  4857. api.sendInspectorState(INSPECTOR_ID);
  4858. },
  4859. tooltip: "Replace the state with the content of your clipboard"
  4860. },
  4861. {
  4862. icon: "save",
  4863. action: () => {
  4864. actionGlobalSaveState(pinia);
  4865. },
  4866. tooltip: "Save the state as a JSON file"
  4867. },
  4868. {
  4869. icon: "folder_open",
  4870. action: async () => {
  4871. await actionGlobalOpenStateFile(pinia);
  4872. api.sendInspectorTree(INSPECTOR_ID);
  4873. api.sendInspectorState(INSPECTOR_ID);
  4874. },
  4875. tooltip: "Import the state from a JSON file"
  4876. }
  4877. ],
  4878. nodeActions: [
  4879. {
  4880. icon: "restore",
  4881. tooltip: 'Reset the state (with "$reset")',
  4882. action: (nodeId) => {
  4883. const store = pinia._s.get(nodeId);
  4884. if (!store) {
  4885. toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, "warn");
  4886. } else if (typeof store.$reset !== "function") {
  4887. toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, "warn");
  4888. } else {
  4889. store.$reset();
  4890. toastMessage(`Store "${nodeId}" reset.`);
  4891. }
  4892. }
  4893. }
  4894. ]
  4895. });
  4896. api.on.inspectComponent((payload) => {
  4897. const proxy = payload.componentInstance && payload.componentInstance.proxy;
  4898. if (proxy && proxy._pStores) {
  4899. const piniaStores = payload.componentInstance.proxy._pStores;
  4900. Object.values(piniaStores).forEach((store) => {
  4901. payload.instanceData.state.push({
  4902. type: getStoreType(store.$id),
  4903. key: "state",
  4904. editable: true,
  4905. value: store._isOptionsAPI ? {
  4906. _custom: {
  4907. value: toRaw(store.$state),
  4908. actions: [
  4909. {
  4910. icon: "restore",
  4911. tooltip: "Reset the state of this store",
  4912. action: () => store.$reset()
  4913. }
  4914. ]
  4915. }
  4916. } : (
  4917. // NOTE: workaround to unwrap transferred refs
  4918. Object.keys(store.$state).reduce((state, key) => {
  4919. state[key] = store.$state[key];
  4920. return state;
  4921. }, {})
  4922. )
  4923. });
  4924. if (store._getters && store._getters.length) {
  4925. payload.instanceData.state.push({
  4926. type: getStoreType(store.$id),
  4927. key: "getters",
  4928. editable: false,
  4929. value: store._getters.reduce((getters, key) => {
  4930. try {
  4931. getters[key] = store[key];
  4932. } catch (error) {
  4933. getters[key] = error;
  4934. }
  4935. return getters;
  4936. }, {})
  4937. });
  4938. }
  4939. });
  4940. }
  4941. });
  4942. api.on.getInspectorTree((payload) => {
  4943. if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
  4944. let stores = [pinia];
  4945. stores = stores.concat(Array.from(pinia._s.values()));
  4946. payload.rootNodes = (payload.filter ? stores.filter((store) => "$id" in store ? store.$id.toLowerCase().includes(payload.filter.toLowerCase()) : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) : stores).map(formatStoreForInspectorTree);
  4947. }
  4948. });
  4949. globalThis.$pinia = pinia;
  4950. api.on.getInspectorState((payload) => {
  4951. if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
  4952. const inspectedStore = payload.nodeId === PINIA_ROOT_ID ? pinia : pinia._s.get(payload.nodeId);
  4953. if (!inspectedStore) {
  4954. return;
  4955. }
  4956. if (inspectedStore) {
  4957. if (payload.nodeId !== PINIA_ROOT_ID)
  4958. globalThis.$store = toRaw(inspectedStore);
  4959. payload.state = formatStoreForInspectorState(inspectedStore);
  4960. }
  4961. }
  4962. });
  4963. api.on.editInspectorState((payload) => {
  4964. if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
  4965. const inspectedStore = payload.nodeId === PINIA_ROOT_ID ? pinia : pinia._s.get(payload.nodeId);
  4966. if (!inspectedStore) {
  4967. return toastMessage(`store "${payload.nodeId}" not found`, "error");
  4968. }
  4969. const { path } = payload;
  4970. if (!isPinia(inspectedStore)) {
  4971. if (path.length !== 1 || !inspectedStore._customProperties.has(path[0]) || path[0] in inspectedStore.$state) {
  4972. path.unshift("$state");
  4973. }
  4974. } else {
  4975. path.unshift("state");
  4976. }
  4977. isTimelineActive = false;
  4978. payload.set(inspectedStore, path, payload.state.value);
  4979. isTimelineActive = true;
  4980. }
  4981. });
  4982. api.on.editComponentState((payload) => {
  4983. if (payload.type.startsWith("🍍")) {
  4984. const storeId = payload.type.replace(/^🍍\s*/, "");
  4985. const store = pinia._s.get(storeId);
  4986. if (!store) {
  4987. return toastMessage(`store "${storeId}" not found`, "error");
  4988. }
  4989. const { path } = payload;
  4990. if (path[0] !== "state") {
  4991. return toastMessage(`Invalid path for store "${storeId}":
  4992. ${path}
  4993. Only state can be modified.`);
  4994. }
  4995. path[0] = "$state";
  4996. isTimelineActive = false;
  4997. payload.set(store, path, payload.state.value);
  4998. isTimelineActive = true;
  4999. }
  5000. });
  5001. });
  5002. }
  5003. function addStoreToDevtools(app, store) {
  5004. if (!componentStateTypes.includes(getStoreType(store.$id))) {
  5005. componentStateTypes.push(getStoreType(store.$id));
  5006. }
  5007. setupDevToolsPlugin({
  5008. id: "dev.esm.pinia",
  5009. label: "Pinia 🍍",
  5010. logo: "https://pinia.vuejs.org/logo.svg",
  5011. packageName: "pinia",
  5012. homepage: "https://pinia.vuejs.org",
  5013. componentStateTypes,
  5014. app,
  5015. settings: {
  5016. logStoreChanges: {
  5017. label: "Notify about new/deleted stores",
  5018. type: "boolean",
  5019. defaultValue: true
  5020. }
  5021. // useEmojis: {
  5022. // label: 'Use emojis in messages ⚡️',
  5023. // type: 'boolean',
  5024. // defaultValue: true,
  5025. // },
  5026. }
  5027. }, (api) => {
  5028. const now = typeof api.now === "function" ? api.now.bind(api) : Date.now;
  5029. store.$onAction(({ after, onError, name, args }) => {
  5030. const groupId = runningActionId++;
  5031. api.addTimelineEvent({
  5032. layerId: MUTATIONS_LAYER_ID,
  5033. event: {
  5034. time: now(),
  5035. title: "🛫 " + name,
  5036. subtitle: "start",
  5037. data: {
  5038. store: formatDisplay(store.$id),
  5039. action: formatDisplay(name),
  5040. args
  5041. },
  5042. groupId
  5043. }
  5044. });
  5045. after((result) => {
  5046. activeAction = void 0;
  5047. api.addTimelineEvent({
  5048. layerId: MUTATIONS_LAYER_ID,
  5049. event: {
  5050. time: now(),
  5051. title: "🛬 " + name,
  5052. subtitle: "end",
  5053. data: {
  5054. store: formatDisplay(store.$id),
  5055. action: formatDisplay(name),
  5056. args,
  5057. result
  5058. },
  5059. groupId
  5060. }
  5061. });
  5062. });
  5063. onError((error) => {
  5064. activeAction = void 0;
  5065. api.addTimelineEvent({
  5066. layerId: MUTATIONS_LAYER_ID,
  5067. event: {
  5068. time: now(),
  5069. logType: "error",
  5070. title: "💥 " + name,
  5071. subtitle: "end",
  5072. data: {
  5073. store: formatDisplay(store.$id),
  5074. action: formatDisplay(name),
  5075. args,
  5076. error
  5077. },
  5078. groupId
  5079. }
  5080. });
  5081. });
  5082. }, true);
  5083. store._customProperties.forEach((name) => {
  5084. watch(() => unref(store[name]), (newValue, oldValue) => {
  5085. api.notifyComponentUpdate();
  5086. api.sendInspectorState(INSPECTOR_ID);
  5087. if (isTimelineActive) {
  5088. api.addTimelineEvent({
  5089. layerId: MUTATIONS_LAYER_ID,
  5090. event: {
  5091. time: now(),
  5092. title: "Change",
  5093. subtitle: name,
  5094. data: {
  5095. newValue,
  5096. oldValue
  5097. },
  5098. groupId: activeAction
  5099. }
  5100. });
  5101. }
  5102. }, { deep: true });
  5103. });
  5104. store.$subscribe(({ events, type }, state) => {
  5105. api.notifyComponentUpdate();
  5106. api.sendInspectorState(INSPECTOR_ID);
  5107. if (!isTimelineActive)
  5108. return;
  5109. const eventData = {
  5110. time: now(),
  5111. title: formatMutationType(type),
  5112. data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)),
  5113. groupId: activeAction
  5114. };
  5115. if (type === MutationType.patchFunction) {
  5116. eventData.subtitle = "⤵️";
  5117. } else if (type === MutationType.patchObject) {
  5118. eventData.subtitle = "🧩";
  5119. } else if (events && !Array.isArray(events)) {
  5120. eventData.subtitle = events.type;
  5121. }
  5122. if (events) {
  5123. eventData.data["rawEvent(s)"] = {
  5124. _custom: {
  5125. display: "DebuggerEvent",
  5126. type: "object",
  5127. tooltip: "raw DebuggerEvent[]",
  5128. value: events
  5129. }
  5130. };
  5131. }
  5132. api.addTimelineEvent({
  5133. layerId: MUTATIONS_LAYER_ID,
  5134. event: eventData
  5135. });
  5136. }, { detached: true, flush: "sync" });
  5137. const hotUpdate = store._hotUpdate;
  5138. store._hotUpdate = markRaw((newStore) => {
  5139. hotUpdate(newStore);
  5140. api.addTimelineEvent({
  5141. layerId: MUTATIONS_LAYER_ID,
  5142. event: {
  5143. time: now(),
  5144. title: "🔥 " + store.$id,
  5145. subtitle: "HMR update",
  5146. data: {
  5147. store: formatDisplay(store.$id),
  5148. info: formatDisplay(`HMR update`)
  5149. }
  5150. }
  5151. });
  5152. api.notifyComponentUpdate();
  5153. api.sendInspectorTree(INSPECTOR_ID);
  5154. api.sendInspectorState(INSPECTOR_ID);
  5155. });
  5156. const { $dispose } = store;
  5157. store.$dispose = () => {
  5158. $dispose();
  5159. api.notifyComponentUpdate();
  5160. api.sendInspectorTree(INSPECTOR_ID);
  5161. api.sendInspectorState(INSPECTOR_ID);
  5162. api.getSettings().logStoreChanges && toastMessage(`Disposed "${store.$id}" store 🗑`);
  5163. };
  5164. api.notifyComponentUpdate();
  5165. api.sendInspectorTree(INSPECTOR_ID);
  5166. api.sendInspectorState(INSPECTOR_ID);
  5167. api.getSettings().logStoreChanges && toastMessage(`"${store.$id}" store installed 🆕`);
  5168. });
  5169. }
  5170. var runningActionId = 0;
  5171. var activeAction;
  5172. function patchActionForGrouping(store, actionNames, wrapWithProxy) {
  5173. const actions = actionNames.reduce((storeActions, actionName) => {
  5174. storeActions[actionName] = toRaw(store)[actionName];
  5175. return storeActions;
  5176. }, {});
  5177. for (const actionName in actions) {
  5178. store[actionName] = function() {
  5179. const _actionId = runningActionId;
  5180. const trackedStore = wrapWithProxy ? new Proxy(store, {
  5181. get(...args) {
  5182. activeAction = _actionId;
  5183. return Reflect.get(...args);
  5184. },
  5185. set(...args) {
  5186. activeAction = _actionId;
  5187. return Reflect.set(...args);
  5188. }
  5189. }) : store;
  5190. activeAction = _actionId;
  5191. const retValue = actions[actionName].apply(trackedStore, arguments);
  5192. activeAction = void 0;
  5193. return retValue;
  5194. };
  5195. }
  5196. }
  5197. function devtoolsPlugin({ app, store, options }) {
  5198. if (store.$id.startsWith("__hot:")) {
  5199. return;
  5200. }
  5201. store._isOptionsAPI = !!options.state;
  5202. if (!store._p._testing) {
  5203. patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI);
  5204. const originalHotUpdate = store._hotUpdate;
  5205. toRaw(store)._hotUpdate = function(newStore) {
  5206. originalHotUpdate.apply(this, arguments);
  5207. patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);
  5208. };
  5209. }
  5210. addStoreToDevtools(
  5211. app,
  5212. // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
  5213. store
  5214. );
  5215. }
  5216. function createPinia() {
  5217. const scope = effectScope(true);
  5218. const state = scope.run(() => ref({}));
  5219. let _p = [];
  5220. let toBeInstalled = [];
  5221. const pinia = markRaw({
  5222. install(app) {
  5223. setActivePinia(pinia);
  5224. pinia._a = app;
  5225. app.provide(piniaSymbol, pinia);
  5226. app.config.globalProperties.$pinia = pinia;
  5227. if (IS_CLIENT) {
  5228. registerPiniaDevtools(app, pinia);
  5229. }
  5230. toBeInstalled.forEach((plugin) => _p.push(plugin));
  5231. toBeInstalled = [];
  5232. },
  5233. use(plugin) {
  5234. if (!this._a) {
  5235. toBeInstalled.push(plugin);
  5236. } else {
  5237. _p.push(plugin);
  5238. }
  5239. return this;
  5240. },
  5241. _p,
  5242. // it's actually undefined here
  5243. // @ts-expect-error
  5244. _a: null,
  5245. _e: scope,
  5246. _s: /* @__PURE__ */ new Map(),
  5247. state
  5248. });
  5249. if (IS_CLIENT && typeof Proxy !== "undefined") {
  5250. pinia.use(devtoolsPlugin);
  5251. }
  5252. return pinia;
  5253. }
  5254. function disposePinia(pinia) {
  5255. pinia._e.stop();
  5256. pinia._s.clear();
  5257. pinia._p.splice(0);
  5258. pinia.state.value = {};
  5259. pinia._a = null;
  5260. }
  5261. var isUseStore = (fn) => {
  5262. return typeof fn === "function" && typeof fn.$id === "string";
  5263. };
  5264. function patchObject(newState, oldState) {
  5265. for (const key in oldState) {
  5266. const subPatch = oldState[key];
  5267. if (!(key in newState)) {
  5268. continue;
  5269. }
  5270. const targetValue = newState[key];
  5271. if (isPlainObject(targetValue) && isPlainObject(subPatch) && !isRef(subPatch) && !isReactive(subPatch)) {
  5272. newState[key] = patchObject(targetValue, subPatch);
  5273. } else {
  5274. newState[key] = subPatch;
  5275. }
  5276. }
  5277. return newState;
  5278. }
  5279. function acceptHMRUpdate(initialUseStore, hot) {
  5280. if (false) {
  5281. return () => {
  5282. };
  5283. }
  5284. return (newModule) => {
  5285. const pinia = hot.data.pinia || initialUseStore._pinia;
  5286. if (!pinia) {
  5287. return;
  5288. }
  5289. hot.data.pinia = pinia;
  5290. for (const exportName in newModule) {
  5291. const useStore = newModule[exportName];
  5292. if (isUseStore(useStore) && pinia._s.has(useStore.$id)) {
  5293. const id = useStore.$id;
  5294. if (id !== initialUseStore.$id) {
  5295. console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id}". Reloading.`);
  5296. return hot.invalidate();
  5297. }
  5298. const existingStore = pinia._s.get(id);
  5299. if (!existingStore) {
  5300. console.log(`[Pinia]: skipping hmr because store doesn't exist yet`);
  5301. return;
  5302. }
  5303. useStore(pinia, existingStore);
  5304. }
  5305. }
  5306. };
  5307. }
  5308. var noop = () => {
  5309. };
  5310. function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
  5311. subscriptions.push(callback);
  5312. const removeSubscription = () => {
  5313. const idx = subscriptions.indexOf(callback);
  5314. if (idx > -1) {
  5315. subscriptions.splice(idx, 1);
  5316. onCleanup();
  5317. }
  5318. };
  5319. if (!detached && getCurrentScope()) {
  5320. onScopeDispose(removeSubscription);
  5321. }
  5322. return removeSubscription;
  5323. }
  5324. function triggerSubscriptions(subscriptions, ...args) {
  5325. subscriptions.slice().forEach((callback) => {
  5326. callback(...args);
  5327. });
  5328. }
  5329. var fallbackRunWithContext = (fn) => fn();
  5330. var ACTION_MARKER = Symbol();
  5331. var ACTION_NAME = Symbol();
  5332. function mergeReactiveObjects(target2, patchToApply) {
  5333. if (target2 instanceof Map && patchToApply instanceof Map) {
  5334. patchToApply.forEach((value, key) => target2.set(key, value));
  5335. } else if (target2 instanceof Set && patchToApply instanceof Set) {
  5336. patchToApply.forEach(target2.add, target2);
  5337. }
  5338. for (const key in patchToApply) {
  5339. if (!patchToApply.hasOwnProperty(key))
  5340. continue;
  5341. const subPatch = patchToApply[key];
  5342. const targetValue = target2[key];
  5343. if (isPlainObject(targetValue) && isPlainObject(subPatch) && target2.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) {
  5344. target2[key] = mergeReactiveObjects(targetValue, subPatch);
  5345. } else {
  5346. target2[key] = subPatch;
  5347. }
  5348. }
  5349. return target2;
  5350. }
  5351. var skipHydrateSymbol = true ? Symbol("pinia:skipHydration") : (
  5352. /* istanbul ignore next */
  5353. Symbol()
  5354. );
  5355. function skipHydrate(obj) {
  5356. return Object.defineProperty(obj, skipHydrateSymbol, {});
  5357. }
  5358. function shouldHydrate(obj) {
  5359. return !isPlainObject(obj) || !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol);
  5360. }
  5361. var { assign } = Object;
  5362. function isComputed(o) {
  5363. return !!(isRef(o) && o.effect);
  5364. }
  5365. function createOptionsStore(id, options, pinia, hot) {
  5366. const { state, actions, getters } = options;
  5367. const initialState = pinia.state.value[id];
  5368. let store;
  5369. function setup() {
  5370. if (!initialState && !hot) {
  5371. pinia.state.value[id] = state ? state() : {};
  5372. }
  5373. const localState = hot ? (
  5374. // use ref() to unwrap refs inside state TODO: check if this is still necessary
  5375. toRefs(ref(state ? state() : {}).value)
  5376. ) : toRefs(pinia.state.value[id]);
  5377. return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
  5378. if (name in localState) {
  5379. console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`);
  5380. }
  5381. computedGetters[name] = markRaw(computed(() => {
  5382. setActivePinia(pinia);
  5383. const store2 = pinia._s.get(id);
  5384. return getters[name].call(store2, store2);
  5385. }));
  5386. return computedGetters;
  5387. }, {}));
  5388. }
  5389. store = createSetupStore(id, setup, options, pinia, hot, true);
  5390. return store;
  5391. }
  5392. function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
  5393. let scope;
  5394. const optionsForPlugin = assign({ actions: {} }, options);
  5395. if (!pinia._e.active) {
  5396. throw new Error("Pinia destroyed");
  5397. }
  5398. const $subscribeOptions = { deep: true };
  5399. if (true) {
  5400. $subscribeOptions.onTrigger = (event) => {
  5401. if (isListening) {
  5402. debuggerEvents = event;
  5403. } else if (isListening == false && !store._hotUpdating) {
  5404. if (Array.isArray(debuggerEvents)) {
  5405. debuggerEvents.push(event);
  5406. } else {
  5407. console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.");
  5408. }
  5409. }
  5410. };
  5411. }
  5412. let isListening;
  5413. let isSyncListening;
  5414. let subscriptions = [];
  5415. let actionSubscriptions = [];
  5416. let debuggerEvents;
  5417. const initialState = pinia.state.value[$id];
  5418. if (!isOptionsStore && !initialState && !hot) {
  5419. pinia.state.value[$id] = {};
  5420. }
  5421. const hotState = ref({});
  5422. let activeListener;
  5423. function $patch(partialStateOrMutator) {
  5424. let subscriptionMutation;
  5425. isListening = isSyncListening = false;
  5426. if (true) {
  5427. debuggerEvents = [];
  5428. }
  5429. if (typeof partialStateOrMutator === "function") {
  5430. partialStateOrMutator(pinia.state.value[$id]);
  5431. subscriptionMutation = {
  5432. type: MutationType.patchFunction,
  5433. storeId: $id,
  5434. events: debuggerEvents
  5435. };
  5436. } else {
  5437. mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
  5438. subscriptionMutation = {
  5439. type: MutationType.patchObject,
  5440. payload: partialStateOrMutator,
  5441. storeId: $id,
  5442. events: debuggerEvents
  5443. };
  5444. }
  5445. const myListenerId = activeListener = Symbol();
  5446. nextTick().then(() => {
  5447. if (activeListener === myListenerId) {
  5448. isListening = true;
  5449. }
  5450. });
  5451. isSyncListening = true;
  5452. triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
  5453. }
  5454. const $reset = isOptionsStore ? function $reset2() {
  5455. const { state } = options;
  5456. const newState = state ? state() : {};
  5457. this.$patch(($state) => {
  5458. assign($state, newState);
  5459. });
  5460. } : (
  5461. /* istanbul ignore next */
  5462. true ? () => {
  5463. throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
  5464. } : noop
  5465. );
  5466. function $dispose() {
  5467. scope.stop();
  5468. subscriptions = [];
  5469. actionSubscriptions = [];
  5470. pinia._s.delete($id);
  5471. }
  5472. const action = (fn, name = "") => {
  5473. if (ACTION_MARKER in fn) {
  5474. fn[ACTION_NAME] = name;
  5475. return fn;
  5476. }
  5477. const wrappedAction = function() {
  5478. setActivePinia(pinia);
  5479. const args = Array.from(arguments);
  5480. const afterCallbackList = [];
  5481. const onErrorCallbackList = [];
  5482. function after(callback) {
  5483. afterCallbackList.push(callback);
  5484. }
  5485. function onError(callback) {
  5486. onErrorCallbackList.push(callback);
  5487. }
  5488. triggerSubscriptions(actionSubscriptions, {
  5489. args,
  5490. name: wrappedAction[ACTION_NAME],
  5491. store,
  5492. after,
  5493. onError
  5494. });
  5495. let ret;
  5496. try {
  5497. ret = fn.apply(this && this.$id === $id ? this : store, args);
  5498. } catch (error) {
  5499. triggerSubscriptions(onErrorCallbackList, error);
  5500. throw error;
  5501. }
  5502. if (ret instanceof Promise) {
  5503. return ret.then((value) => {
  5504. triggerSubscriptions(afterCallbackList, value);
  5505. return value;
  5506. }).catch((error) => {
  5507. triggerSubscriptions(onErrorCallbackList, error);
  5508. return Promise.reject(error);
  5509. });
  5510. }
  5511. triggerSubscriptions(afterCallbackList, ret);
  5512. return ret;
  5513. };
  5514. wrappedAction[ACTION_MARKER] = true;
  5515. wrappedAction[ACTION_NAME] = name;
  5516. return wrappedAction;
  5517. };
  5518. const _hmrPayload = markRaw({
  5519. actions: {},
  5520. getters: {},
  5521. state: [],
  5522. hotState
  5523. });
  5524. const partialStore = {
  5525. _p: pinia,
  5526. // _s: scope,
  5527. $id,
  5528. $onAction: addSubscription.bind(null, actionSubscriptions),
  5529. $patch,
  5530. $reset,
  5531. $subscribe(callback, options2 = {}) {
  5532. const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
  5533. const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {
  5534. if (options2.flush === "sync" ? isSyncListening : isListening) {
  5535. callback({
  5536. storeId: $id,
  5537. type: MutationType.direct,
  5538. events: debuggerEvents
  5539. }, state);
  5540. }
  5541. }, assign({}, $subscribeOptions, options2)));
  5542. return removeSubscription;
  5543. },
  5544. $dispose
  5545. };
  5546. const store = reactive(true ? assign(
  5547. {
  5548. _hmrPayload,
  5549. _customProperties: markRaw(/* @__PURE__ */ new Set())
  5550. // devtools custom properties
  5551. },
  5552. partialStore
  5553. // must be added later
  5554. // setupStore
  5555. ) : partialStore);
  5556. pinia._s.set($id, store);
  5557. const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext;
  5558. const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action }))));
  5559. for (const key in setupStore) {
  5560. const prop = setupStore[key];
  5561. if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
  5562. if (hot) {
  5563. hotState.value[key] = toRef(setupStore, key);
  5564. } else if (!isOptionsStore) {
  5565. if (initialState && shouldHydrate(prop)) {
  5566. if (isRef(prop)) {
  5567. prop.value = initialState[key];
  5568. } else {
  5569. mergeReactiveObjects(prop, initialState[key]);
  5570. }
  5571. }
  5572. pinia.state.value[$id][key] = prop;
  5573. }
  5574. if (true) {
  5575. _hmrPayload.state.push(key);
  5576. }
  5577. } else if (typeof prop === "function") {
  5578. const actionValue = hot ? prop : action(prop, key);
  5579. setupStore[key] = actionValue;
  5580. if (true) {
  5581. _hmrPayload.actions[key] = prop;
  5582. }
  5583. optionsForPlugin.actions[key] = prop;
  5584. } else if (true) {
  5585. if (isComputed(prop)) {
  5586. _hmrPayload.getters[key] = isOptionsStore ? (
  5587. // @ts-expect-error
  5588. options.getters[key]
  5589. ) : prop;
  5590. if (IS_CLIENT) {
  5591. const getters = setupStore._getters || // @ts-expect-error: same
  5592. (setupStore._getters = markRaw([]));
  5593. getters.push(key);
  5594. }
  5595. }
  5596. }
  5597. }
  5598. assign(store, setupStore);
  5599. assign(toRaw(store), setupStore);
  5600. Object.defineProperty(store, "$state", {
  5601. get: () => hot ? hotState.value : pinia.state.value[$id],
  5602. set: (state) => {
  5603. if (hot) {
  5604. throw new Error("cannot set hotState");
  5605. }
  5606. $patch(($state) => {
  5607. assign($state, state);
  5608. });
  5609. }
  5610. });
  5611. if (true) {
  5612. store._hotUpdate = markRaw((newStore) => {
  5613. store._hotUpdating = true;
  5614. newStore._hmrPayload.state.forEach((stateKey) => {
  5615. if (stateKey in store.$state) {
  5616. const newStateTarget = newStore.$state[stateKey];
  5617. const oldStateSource = store.$state[stateKey];
  5618. if (typeof newStateTarget === "object" && isPlainObject(newStateTarget) && isPlainObject(oldStateSource)) {
  5619. patchObject(newStateTarget, oldStateSource);
  5620. } else {
  5621. newStore.$state[stateKey] = oldStateSource;
  5622. }
  5623. }
  5624. store[stateKey] = toRef(newStore.$state, stateKey);
  5625. });
  5626. Object.keys(store.$state).forEach((stateKey) => {
  5627. if (!(stateKey in newStore.$state)) {
  5628. delete store[stateKey];
  5629. }
  5630. });
  5631. isListening = false;
  5632. isSyncListening = false;
  5633. pinia.state.value[$id] = toRef(newStore._hmrPayload, "hotState");
  5634. isSyncListening = true;
  5635. nextTick().then(() => {
  5636. isListening = true;
  5637. });
  5638. for (const actionName in newStore._hmrPayload.actions) {
  5639. const actionFn = newStore[actionName];
  5640. store[actionName] = //
  5641. action(actionFn, actionName);
  5642. }
  5643. for (const getterName in newStore._hmrPayload.getters) {
  5644. const getter = newStore._hmrPayload.getters[getterName];
  5645. const getterValue = isOptionsStore ? (
  5646. // special handling of options api
  5647. computed(() => {
  5648. setActivePinia(pinia);
  5649. return getter.call(store, store);
  5650. })
  5651. ) : getter;
  5652. store[getterName] = //
  5653. getterValue;
  5654. }
  5655. Object.keys(store._hmrPayload.getters).forEach((key) => {
  5656. if (!(key in newStore._hmrPayload.getters)) {
  5657. delete store[key];
  5658. }
  5659. });
  5660. Object.keys(store._hmrPayload.actions).forEach((key) => {
  5661. if (!(key in newStore._hmrPayload.actions)) {
  5662. delete store[key];
  5663. }
  5664. });
  5665. store._hmrPayload = newStore._hmrPayload;
  5666. store._getters = newStore._getters;
  5667. store._hotUpdating = false;
  5668. });
  5669. }
  5670. if (IS_CLIENT) {
  5671. const nonEnumerable = {
  5672. writable: true,
  5673. configurable: true,
  5674. // avoid warning on devtools trying to display this property
  5675. enumerable: false
  5676. };
  5677. ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p) => {
  5678. Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable));
  5679. });
  5680. }
  5681. pinia._p.forEach((extender) => {
  5682. if (IS_CLIENT) {
  5683. const extensions = scope.run(() => extender({
  5684. store,
  5685. app: pinia._a,
  5686. pinia,
  5687. options: optionsForPlugin
  5688. }));
  5689. Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));
  5690. assign(store, extensions);
  5691. } else {
  5692. assign(store, scope.run(() => extender({
  5693. store,
  5694. app: pinia._a,
  5695. pinia,
  5696. options: optionsForPlugin
  5697. })));
  5698. }
  5699. });
  5700. if (store.$state && typeof store.$state === "object" && typeof store.$state.constructor === "function" && !store.$state.constructor.toString().includes("[native code]")) {
  5701. console.warn(`[🍍]: The "state" must be a plain object. It cannot be
  5702. state: () => new MyClass()
  5703. Found in store "${store.$id}".`);
  5704. }
  5705. if (initialState && isOptionsStore && options.hydrate) {
  5706. options.hydrate(store.$state, initialState);
  5707. }
  5708. isListening = true;
  5709. isSyncListening = true;
  5710. return store;
  5711. }
  5712. function defineStore(id, setup, setupOptions) {
  5713. let options;
  5714. const isSetupStore = typeof setup === "function";
  5715. options = isSetupStore ? setupOptions : setup;
  5716. function useStore(pinia, hot) {
  5717. const hasContext = hasInjectionContext();
  5718. pinia = // in test mode, ignore the argument provided as we can always retrieve a
  5719. // pinia instance with getActivePinia()
  5720. (false ? null : pinia) || (hasContext ? inject(piniaSymbol, null) : null);
  5721. if (pinia)
  5722. setActivePinia(pinia);
  5723. if (!activePinia) {
  5724. throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
  5725. See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
  5726. This will fail in production.`);
  5727. }
  5728. pinia = activePinia;
  5729. if (!pinia._s.has(id)) {
  5730. if (isSetupStore) {
  5731. createSetupStore(id, setup, options, pinia);
  5732. } else {
  5733. createOptionsStore(id, options, pinia);
  5734. }
  5735. if (true) {
  5736. useStore._pinia = pinia;
  5737. }
  5738. }
  5739. const store = pinia._s.get(id);
  5740. if (hot) {
  5741. const hotId = "__hot:" + id;
  5742. const newStore = isSetupStore ? createSetupStore(hotId, setup, options, pinia, true) : createOptionsStore(hotId, assign({}, options), pinia, true);
  5743. hot._hotUpdate(newStore);
  5744. delete pinia.state.value[hotId];
  5745. pinia._s.delete(hotId);
  5746. }
  5747. if (IS_CLIENT) {
  5748. const currentInstance = getCurrentInstance();
  5749. if (currentInstance && currentInstance.proxy && // avoid adding stores that are just built for hot module replacement
  5750. !hot) {
  5751. const vm = currentInstance.proxy;
  5752. const cache = "_pStores" in vm ? vm._pStores : vm._pStores = {};
  5753. cache[id] = store;
  5754. }
  5755. }
  5756. return store;
  5757. }
  5758. useStore.$id = id;
  5759. return useStore;
  5760. }
  5761. var mapStoreSuffix = "Store";
  5762. function setMapStoreSuffix(suffix) {
  5763. mapStoreSuffix = suffix;
  5764. }
  5765. function mapStores(...stores) {
  5766. if (Array.isArray(stores[0])) {
  5767. console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:
  5768. Replace
  5769. mapStores([useAuthStore, useCartStore])
  5770. with
  5771. mapStores(useAuthStore, useCartStore)
  5772. This will fail in production if not fixed.`);
  5773. stores = stores[0];
  5774. }
  5775. return stores.reduce((reduced, useStore) => {
  5776. reduced[useStore.$id + mapStoreSuffix] = function() {
  5777. return useStore(this.$pinia);
  5778. };
  5779. return reduced;
  5780. }, {});
  5781. }
  5782. function mapState(useStore, keysOrMapper) {
  5783. return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
  5784. reduced[key] = function() {
  5785. return useStore(this.$pinia)[key];
  5786. };
  5787. return reduced;
  5788. }, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
  5789. reduced[key] = function() {
  5790. const store = useStore(this.$pinia);
  5791. const storeKey = keysOrMapper[key];
  5792. return typeof storeKey === "function" ? storeKey.call(this, store) : (
  5793. // @ts-expect-error: FIXME: should work?
  5794. store[storeKey]
  5795. );
  5796. };
  5797. return reduced;
  5798. }, {});
  5799. }
  5800. var mapGetters = mapState;
  5801. function mapActions(useStore, keysOrMapper) {
  5802. return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
  5803. reduced[key] = function(...args) {
  5804. return useStore(this.$pinia)[key](...args);
  5805. };
  5806. return reduced;
  5807. }, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
  5808. reduced[key] = function(...args) {
  5809. return useStore(this.$pinia)[keysOrMapper[key]](...args);
  5810. };
  5811. return reduced;
  5812. }, {});
  5813. }
  5814. function mapWritableState(useStore, keysOrMapper) {
  5815. return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
  5816. reduced[key] = {
  5817. get() {
  5818. return useStore(this.$pinia)[key];
  5819. },
  5820. set(value) {
  5821. return useStore(this.$pinia)[key] = value;
  5822. }
  5823. };
  5824. return reduced;
  5825. }, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
  5826. reduced[key] = {
  5827. get() {
  5828. return useStore(this.$pinia)[keysOrMapper[key]];
  5829. },
  5830. set(value) {
  5831. return useStore(this.$pinia)[keysOrMapper[key]] = value;
  5832. }
  5833. };
  5834. return reduced;
  5835. }, {});
  5836. }
  5837. function storeToRefs(store) {
  5838. const rawStore = toRaw(store);
  5839. const refs = {};
  5840. for (const key in rawStore) {
  5841. const value = rawStore[key];
  5842. if (value.effect) {
  5843. refs[key] = // ...
  5844. computed({
  5845. get: () => store[key],
  5846. set(value2) {
  5847. store[key] = value2;
  5848. }
  5849. });
  5850. } else if (isRef(value) || isReactive(value)) {
  5851. refs[key] = // ---
  5852. toRef(store, key);
  5853. }
  5854. }
  5855. return refs;
  5856. }
  5857. export {
  5858. MutationType,
  5859. acceptHMRUpdate,
  5860. createPinia,
  5861. defineStore,
  5862. disposePinia,
  5863. getActivePinia,
  5864. mapActions,
  5865. mapGetters,
  5866. mapState,
  5867. mapStores,
  5868. mapWritableState,
  5869. setActivePinia,
  5870. setMapStoreSuffix,
  5871. shouldHydrate,
  5872. skipHydrate,
  5873. storeToRefs
  5874. };
  5875. /*! Bundled license information:
  5876. pinia/dist/pinia.mjs:
  5877. (*!
  5878. * pinia v3.0.3
  5879. * (c) 2025 Eduardo San Martin Morote
  5880. * @license MIT
  5881. *)
  5882. (*! #__NO_SIDE_EFFECTS__ *)
  5883. */
  5884. //# sourceMappingURL=pinia.js.map