index.js 206 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757
  1. var __create = Object.create;
  2. var __defProp = Object.defineProperty;
  3. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  4. var __getOwnPropNames = Object.getOwnPropertyNames;
  5. var __getProtoOf = Object.getPrototypeOf;
  6. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7. var __esm = (fn, res) => function __init() {
  8. return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
  9. };
  10. var __commonJS = (cb, mod) => function __require() {
  11. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  12. };
  13. var __copyProps = (to, from, except, desc) => {
  14. if (from && typeof from === "object" || typeof from === "function") {
  15. for (let key of __getOwnPropNames(from))
  16. if (!__hasOwnProp.call(to, key) && key !== except)
  17. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  18. }
  19. return to;
  20. };
  21. var __toESM = (mod, isNodeMode, target22) => (target22 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  22. // If the importer is in node compatibility mode or this is not an ESM
  23. // file that has been converted to a CommonJS file using a Babel-
  24. // compatible transform (i.e. "__esModule" has not been set), then set
  25. // "default" to the CommonJS "module.exports" for node compatibility.
  26. isNodeMode || !mod || !mod.__esModule ? __defProp(target22, "default", { value: mod, enumerable: true }) : target22,
  27. mod
  28. ));
  29. // ../../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
  30. var init_esm_shims = __esm({
  31. "../../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"() {
  32. "use strict";
  33. }
  34. });
  35. // ../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js
  36. var require_speakingurl = __commonJS({
  37. "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(exports, module) {
  38. "use strict";
  39. init_esm_shims();
  40. (function(root) {
  41. "use strict";
  42. var charMap = {
  43. // latin
  44. "\xC0": "A",
  45. "\xC1": "A",
  46. "\xC2": "A",
  47. "\xC3": "A",
  48. "\xC4": "Ae",
  49. "\xC5": "A",
  50. "\xC6": "AE",
  51. "\xC7": "C",
  52. "\xC8": "E",
  53. "\xC9": "E",
  54. "\xCA": "E",
  55. "\xCB": "E",
  56. "\xCC": "I",
  57. "\xCD": "I",
  58. "\xCE": "I",
  59. "\xCF": "I",
  60. "\xD0": "D",
  61. "\xD1": "N",
  62. "\xD2": "O",
  63. "\xD3": "O",
  64. "\xD4": "O",
  65. "\xD5": "O",
  66. "\xD6": "Oe",
  67. "\u0150": "O",
  68. "\xD8": "O",
  69. "\xD9": "U",
  70. "\xDA": "U",
  71. "\xDB": "U",
  72. "\xDC": "Ue",
  73. "\u0170": "U",
  74. "\xDD": "Y",
  75. "\xDE": "TH",
  76. "\xDF": "ss",
  77. "\xE0": "a",
  78. "\xE1": "a",
  79. "\xE2": "a",
  80. "\xE3": "a",
  81. "\xE4": "ae",
  82. "\xE5": "a",
  83. "\xE6": "ae",
  84. "\xE7": "c",
  85. "\xE8": "e",
  86. "\xE9": "e",
  87. "\xEA": "e",
  88. "\xEB": "e",
  89. "\xEC": "i",
  90. "\xED": "i",
  91. "\xEE": "i",
  92. "\xEF": "i",
  93. "\xF0": "d",
  94. "\xF1": "n",
  95. "\xF2": "o",
  96. "\xF3": "o",
  97. "\xF4": "o",
  98. "\xF5": "o",
  99. "\xF6": "oe",
  100. "\u0151": "o",
  101. "\xF8": "o",
  102. "\xF9": "u",
  103. "\xFA": "u",
  104. "\xFB": "u",
  105. "\xFC": "ue",
  106. "\u0171": "u",
  107. "\xFD": "y",
  108. "\xFE": "th",
  109. "\xFF": "y",
  110. "\u1E9E": "SS",
  111. // language specific
  112. // Arabic
  113. "\u0627": "a",
  114. "\u0623": "a",
  115. "\u0625": "i",
  116. "\u0622": "aa",
  117. "\u0624": "u",
  118. "\u0626": "e",
  119. "\u0621": "a",
  120. "\u0628": "b",
  121. "\u062A": "t",
  122. "\u062B": "th",
  123. "\u062C": "j",
  124. "\u062D": "h",
  125. "\u062E": "kh",
  126. "\u062F": "d",
  127. "\u0630": "th",
  128. "\u0631": "r",
  129. "\u0632": "z",
  130. "\u0633": "s",
  131. "\u0634": "sh",
  132. "\u0635": "s",
  133. "\u0636": "dh",
  134. "\u0637": "t",
  135. "\u0638": "z",
  136. "\u0639": "a",
  137. "\u063A": "gh",
  138. "\u0641": "f",
  139. "\u0642": "q",
  140. "\u0643": "k",
  141. "\u0644": "l",
  142. "\u0645": "m",
  143. "\u0646": "n",
  144. "\u0647": "h",
  145. "\u0648": "w",
  146. "\u064A": "y",
  147. "\u0649": "a",
  148. "\u0629": "h",
  149. "\uFEFB": "la",
  150. "\uFEF7": "laa",
  151. "\uFEF9": "lai",
  152. "\uFEF5": "laa",
  153. // Persian additional characters than Arabic
  154. "\u06AF": "g",
  155. "\u0686": "ch",
  156. "\u067E": "p",
  157. "\u0698": "zh",
  158. "\u06A9": "k",
  159. "\u06CC": "y",
  160. // Arabic diactrics
  161. "\u064E": "a",
  162. "\u064B": "an",
  163. "\u0650": "e",
  164. "\u064D": "en",
  165. "\u064F": "u",
  166. "\u064C": "on",
  167. "\u0652": "",
  168. // Arabic numbers
  169. "\u0660": "0",
  170. "\u0661": "1",
  171. "\u0662": "2",
  172. "\u0663": "3",
  173. "\u0664": "4",
  174. "\u0665": "5",
  175. "\u0666": "6",
  176. "\u0667": "7",
  177. "\u0668": "8",
  178. "\u0669": "9",
  179. // Persian numbers
  180. "\u06F0": "0",
  181. "\u06F1": "1",
  182. "\u06F2": "2",
  183. "\u06F3": "3",
  184. "\u06F4": "4",
  185. "\u06F5": "5",
  186. "\u06F6": "6",
  187. "\u06F7": "7",
  188. "\u06F8": "8",
  189. "\u06F9": "9",
  190. // Burmese consonants
  191. "\u1000": "k",
  192. "\u1001": "kh",
  193. "\u1002": "g",
  194. "\u1003": "ga",
  195. "\u1004": "ng",
  196. "\u1005": "s",
  197. "\u1006": "sa",
  198. "\u1007": "z",
  199. "\u1005\u103B": "za",
  200. "\u100A": "ny",
  201. "\u100B": "t",
  202. "\u100C": "ta",
  203. "\u100D": "d",
  204. "\u100E": "da",
  205. "\u100F": "na",
  206. "\u1010": "t",
  207. "\u1011": "ta",
  208. "\u1012": "d",
  209. "\u1013": "da",
  210. "\u1014": "n",
  211. "\u1015": "p",
  212. "\u1016": "pa",
  213. "\u1017": "b",
  214. "\u1018": "ba",
  215. "\u1019": "m",
  216. "\u101A": "y",
  217. "\u101B": "ya",
  218. "\u101C": "l",
  219. "\u101D": "w",
  220. "\u101E": "th",
  221. "\u101F": "h",
  222. "\u1020": "la",
  223. "\u1021": "a",
  224. // consonant character combos
  225. "\u103C": "y",
  226. "\u103B": "ya",
  227. "\u103D": "w",
  228. "\u103C\u103D": "yw",
  229. "\u103B\u103D": "ywa",
  230. "\u103E": "h",
  231. // independent vowels
  232. "\u1027": "e",
  233. "\u104F": "-e",
  234. "\u1023": "i",
  235. "\u1024": "-i",
  236. "\u1009": "u",
  237. "\u1026": "-u",
  238. "\u1029": "aw",
  239. "\u101E\u103C\u1031\u102C": "aw",
  240. "\u102A": "aw",
  241. // numbers
  242. "\u1040": "0",
  243. "\u1041": "1",
  244. "\u1042": "2",
  245. "\u1043": "3",
  246. "\u1044": "4",
  247. "\u1045": "5",
  248. "\u1046": "6",
  249. "\u1047": "7",
  250. "\u1048": "8",
  251. "\u1049": "9",
  252. // virama and tone marks which are silent in transliteration
  253. "\u1039": "",
  254. "\u1037": "",
  255. "\u1038": "",
  256. // Czech
  257. "\u010D": "c",
  258. "\u010F": "d",
  259. "\u011B": "e",
  260. "\u0148": "n",
  261. "\u0159": "r",
  262. "\u0161": "s",
  263. "\u0165": "t",
  264. "\u016F": "u",
  265. "\u017E": "z",
  266. "\u010C": "C",
  267. "\u010E": "D",
  268. "\u011A": "E",
  269. "\u0147": "N",
  270. "\u0158": "R",
  271. "\u0160": "S",
  272. "\u0164": "T",
  273. "\u016E": "U",
  274. "\u017D": "Z",
  275. // Dhivehi
  276. "\u0780": "h",
  277. "\u0781": "sh",
  278. "\u0782": "n",
  279. "\u0783": "r",
  280. "\u0784": "b",
  281. "\u0785": "lh",
  282. "\u0786": "k",
  283. "\u0787": "a",
  284. "\u0788": "v",
  285. "\u0789": "m",
  286. "\u078A": "f",
  287. "\u078B": "dh",
  288. "\u078C": "th",
  289. "\u078D": "l",
  290. "\u078E": "g",
  291. "\u078F": "gn",
  292. "\u0790": "s",
  293. "\u0791": "d",
  294. "\u0792": "z",
  295. "\u0793": "t",
  296. "\u0794": "y",
  297. "\u0795": "p",
  298. "\u0796": "j",
  299. "\u0797": "ch",
  300. "\u0798": "tt",
  301. "\u0799": "hh",
  302. "\u079A": "kh",
  303. "\u079B": "th",
  304. "\u079C": "z",
  305. "\u079D": "sh",
  306. "\u079E": "s",
  307. "\u079F": "d",
  308. "\u07A0": "t",
  309. "\u07A1": "z",
  310. "\u07A2": "a",
  311. "\u07A3": "gh",
  312. "\u07A4": "q",
  313. "\u07A5": "w",
  314. "\u07A6": "a",
  315. "\u07A7": "aa",
  316. "\u07A8": "i",
  317. "\u07A9": "ee",
  318. "\u07AA": "u",
  319. "\u07AB": "oo",
  320. "\u07AC": "e",
  321. "\u07AD": "ey",
  322. "\u07AE": "o",
  323. "\u07AF": "oa",
  324. "\u07B0": "",
  325. // Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian
  326. // National system (2002)
  327. "\u10D0": "a",
  328. "\u10D1": "b",
  329. "\u10D2": "g",
  330. "\u10D3": "d",
  331. "\u10D4": "e",
  332. "\u10D5": "v",
  333. "\u10D6": "z",
  334. "\u10D7": "t",
  335. "\u10D8": "i",
  336. "\u10D9": "k",
  337. "\u10DA": "l",
  338. "\u10DB": "m",
  339. "\u10DC": "n",
  340. "\u10DD": "o",
  341. "\u10DE": "p",
  342. "\u10DF": "zh",
  343. "\u10E0": "r",
  344. "\u10E1": "s",
  345. "\u10E2": "t",
  346. "\u10E3": "u",
  347. "\u10E4": "p",
  348. "\u10E5": "k",
  349. "\u10E6": "gh",
  350. "\u10E7": "q",
  351. "\u10E8": "sh",
  352. "\u10E9": "ch",
  353. "\u10EA": "ts",
  354. "\u10EB": "dz",
  355. "\u10EC": "ts",
  356. "\u10ED": "ch",
  357. "\u10EE": "kh",
  358. "\u10EF": "j",
  359. "\u10F0": "h",
  360. // Greek
  361. "\u03B1": "a",
  362. "\u03B2": "v",
  363. "\u03B3": "g",
  364. "\u03B4": "d",
  365. "\u03B5": "e",
  366. "\u03B6": "z",
  367. "\u03B7": "i",
  368. "\u03B8": "th",
  369. "\u03B9": "i",
  370. "\u03BA": "k",
  371. "\u03BB": "l",
  372. "\u03BC": "m",
  373. "\u03BD": "n",
  374. "\u03BE": "ks",
  375. "\u03BF": "o",
  376. "\u03C0": "p",
  377. "\u03C1": "r",
  378. "\u03C3": "s",
  379. "\u03C4": "t",
  380. "\u03C5": "y",
  381. "\u03C6": "f",
  382. "\u03C7": "x",
  383. "\u03C8": "ps",
  384. "\u03C9": "o",
  385. "\u03AC": "a",
  386. "\u03AD": "e",
  387. "\u03AF": "i",
  388. "\u03CC": "o",
  389. "\u03CD": "y",
  390. "\u03AE": "i",
  391. "\u03CE": "o",
  392. "\u03C2": "s",
  393. "\u03CA": "i",
  394. "\u03B0": "y",
  395. "\u03CB": "y",
  396. "\u0390": "i",
  397. "\u0391": "A",
  398. "\u0392": "B",
  399. "\u0393": "G",
  400. "\u0394": "D",
  401. "\u0395": "E",
  402. "\u0396": "Z",
  403. "\u0397": "I",
  404. "\u0398": "TH",
  405. "\u0399": "I",
  406. "\u039A": "K",
  407. "\u039B": "L",
  408. "\u039C": "M",
  409. "\u039D": "N",
  410. "\u039E": "KS",
  411. "\u039F": "O",
  412. "\u03A0": "P",
  413. "\u03A1": "R",
  414. "\u03A3": "S",
  415. "\u03A4": "T",
  416. "\u03A5": "Y",
  417. "\u03A6": "F",
  418. "\u03A7": "X",
  419. "\u03A8": "PS",
  420. "\u03A9": "O",
  421. "\u0386": "A",
  422. "\u0388": "E",
  423. "\u038A": "I",
  424. "\u038C": "O",
  425. "\u038E": "Y",
  426. "\u0389": "I",
  427. "\u038F": "O",
  428. "\u03AA": "I",
  429. "\u03AB": "Y",
  430. // Latvian
  431. "\u0101": "a",
  432. // 'č': 'c', // duplicate
  433. "\u0113": "e",
  434. "\u0123": "g",
  435. "\u012B": "i",
  436. "\u0137": "k",
  437. "\u013C": "l",
  438. "\u0146": "n",
  439. // 'š': 's', // duplicate
  440. "\u016B": "u",
  441. // 'ž': 'z', // duplicate
  442. "\u0100": "A",
  443. // 'Č': 'C', // duplicate
  444. "\u0112": "E",
  445. "\u0122": "G",
  446. "\u012A": "I",
  447. "\u0136": "k",
  448. "\u013B": "L",
  449. "\u0145": "N",
  450. // 'Š': 'S', // duplicate
  451. "\u016A": "U",
  452. // 'Ž': 'Z', // duplicate
  453. // Macedonian
  454. "\u040C": "Kj",
  455. "\u045C": "kj",
  456. "\u0409": "Lj",
  457. "\u0459": "lj",
  458. "\u040A": "Nj",
  459. "\u045A": "nj",
  460. "\u0422\u0441": "Ts",
  461. "\u0442\u0441": "ts",
  462. // Polish
  463. "\u0105": "a",
  464. "\u0107": "c",
  465. "\u0119": "e",
  466. "\u0142": "l",
  467. "\u0144": "n",
  468. // 'ó': 'o', // duplicate
  469. "\u015B": "s",
  470. "\u017A": "z",
  471. "\u017C": "z",
  472. "\u0104": "A",
  473. "\u0106": "C",
  474. "\u0118": "E",
  475. "\u0141": "L",
  476. "\u0143": "N",
  477. "\u015A": "S",
  478. "\u0179": "Z",
  479. "\u017B": "Z",
  480. // Ukranian
  481. "\u0404": "Ye",
  482. "\u0406": "I",
  483. "\u0407": "Yi",
  484. "\u0490": "G",
  485. "\u0454": "ye",
  486. "\u0456": "i",
  487. "\u0457": "yi",
  488. "\u0491": "g",
  489. // Romanian
  490. "\u0103": "a",
  491. "\u0102": "A",
  492. "\u0219": "s",
  493. "\u0218": "S",
  494. // 'ş': 's', // duplicate
  495. // 'Ş': 'S', // duplicate
  496. "\u021B": "t",
  497. "\u021A": "T",
  498. "\u0163": "t",
  499. "\u0162": "T",
  500. // Russian https://en.wikipedia.org/wiki/Romanization_of_Russian
  501. // ICAO
  502. "\u0430": "a",
  503. "\u0431": "b",
  504. "\u0432": "v",
  505. "\u0433": "g",
  506. "\u0434": "d",
  507. "\u0435": "e",
  508. "\u0451": "yo",
  509. "\u0436": "zh",
  510. "\u0437": "z",
  511. "\u0438": "i",
  512. "\u0439": "i",
  513. "\u043A": "k",
  514. "\u043B": "l",
  515. "\u043C": "m",
  516. "\u043D": "n",
  517. "\u043E": "o",
  518. "\u043F": "p",
  519. "\u0440": "r",
  520. "\u0441": "s",
  521. "\u0442": "t",
  522. "\u0443": "u",
  523. "\u0444": "f",
  524. "\u0445": "kh",
  525. "\u0446": "c",
  526. "\u0447": "ch",
  527. "\u0448": "sh",
  528. "\u0449": "sh",
  529. "\u044A": "",
  530. "\u044B": "y",
  531. "\u044C": "",
  532. "\u044D": "e",
  533. "\u044E": "yu",
  534. "\u044F": "ya",
  535. "\u0410": "A",
  536. "\u0411": "B",
  537. "\u0412": "V",
  538. "\u0413": "G",
  539. "\u0414": "D",
  540. "\u0415": "E",
  541. "\u0401": "Yo",
  542. "\u0416": "Zh",
  543. "\u0417": "Z",
  544. "\u0418": "I",
  545. "\u0419": "I",
  546. "\u041A": "K",
  547. "\u041B": "L",
  548. "\u041C": "M",
  549. "\u041D": "N",
  550. "\u041E": "O",
  551. "\u041F": "P",
  552. "\u0420": "R",
  553. "\u0421": "S",
  554. "\u0422": "T",
  555. "\u0423": "U",
  556. "\u0424": "F",
  557. "\u0425": "Kh",
  558. "\u0426": "C",
  559. "\u0427": "Ch",
  560. "\u0428": "Sh",
  561. "\u0429": "Sh",
  562. "\u042A": "",
  563. "\u042B": "Y",
  564. "\u042C": "",
  565. "\u042D": "E",
  566. "\u042E": "Yu",
  567. "\u042F": "Ya",
  568. // Serbian
  569. "\u0452": "dj",
  570. "\u0458": "j",
  571. // 'љ': 'lj', // duplicate
  572. // 'њ': 'nj', // duplicate
  573. "\u045B": "c",
  574. "\u045F": "dz",
  575. "\u0402": "Dj",
  576. "\u0408": "j",
  577. // 'Љ': 'Lj', // duplicate
  578. // 'Њ': 'Nj', // duplicate
  579. "\u040B": "C",
  580. "\u040F": "Dz",
  581. // Slovak
  582. "\u013E": "l",
  583. "\u013A": "l",
  584. "\u0155": "r",
  585. "\u013D": "L",
  586. "\u0139": "L",
  587. "\u0154": "R",
  588. // Turkish
  589. "\u015F": "s",
  590. "\u015E": "S",
  591. "\u0131": "i",
  592. "\u0130": "I",
  593. // 'ç': 'c', // duplicate
  594. // 'Ç': 'C', // duplicate
  595. // 'ü': 'u', // duplicate, see langCharMap
  596. // 'Ü': 'U', // duplicate, see langCharMap
  597. // 'ö': 'o', // duplicate, see langCharMap
  598. // 'Ö': 'O', // duplicate, see langCharMap
  599. "\u011F": "g",
  600. "\u011E": "G",
  601. // Vietnamese
  602. "\u1EA3": "a",
  603. "\u1EA2": "A",
  604. "\u1EB3": "a",
  605. "\u1EB2": "A",
  606. "\u1EA9": "a",
  607. "\u1EA8": "A",
  608. "\u0111": "d",
  609. "\u0110": "D",
  610. "\u1EB9": "e",
  611. "\u1EB8": "E",
  612. "\u1EBD": "e",
  613. "\u1EBC": "E",
  614. "\u1EBB": "e",
  615. "\u1EBA": "E",
  616. "\u1EBF": "e",
  617. "\u1EBE": "E",
  618. "\u1EC1": "e",
  619. "\u1EC0": "E",
  620. "\u1EC7": "e",
  621. "\u1EC6": "E",
  622. "\u1EC5": "e",
  623. "\u1EC4": "E",
  624. "\u1EC3": "e",
  625. "\u1EC2": "E",
  626. "\u1ECF": "o",
  627. "\u1ECD": "o",
  628. "\u1ECC": "o",
  629. "\u1ED1": "o",
  630. "\u1ED0": "O",
  631. "\u1ED3": "o",
  632. "\u1ED2": "O",
  633. "\u1ED5": "o",
  634. "\u1ED4": "O",
  635. "\u1ED9": "o",
  636. "\u1ED8": "O",
  637. "\u1ED7": "o",
  638. "\u1ED6": "O",
  639. "\u01A1": "o",
  640. "\u01A0": "O",
  641. "\u1EDB": "o",
  642. "\u1EDA": "O",
  643. "\u1EDD": "o",
  644. "\u1EDC": "O",
  645. "\u1EE3": "o",
  646. "\u1EE2": "O",
  647. "\u1EE1": "o",
  648. "\u1EE0": "O",
  649. "\u1EDE": "o",
  650. "\u1EDF": "o",
  651. "\u1ECB": "i",
  652. "\u1ECA": "I",
  653. "\u0129": "i",
  654. "\u0128": "I",
  655. "\u1EC9": "i",
  656. "\u1EC8": "i",
  657. "\u1EE7": "u",
  658. "\u1EE6": "U",
  659. "\u1EE5": "u",
  660. "\u1EE4": "U",
  661. "\u0169": "u",
  662. "\u0168": "U",
  663. "\u01B0": "u",
  664. "\u01AF": "U",
  665. "\u1EE9": "u",
  666. "\u1EE8": "U",
  667. "\u1EEB": "u",
  668. "\u1EEA": "U",
  669. "\u1EF1": "u",
  670. "\u1EF0": "U",
  671. "\u1EEF": "u",
  672. "\u1EEE": "U",
  673. "\u1EED": "u",
  674. "\u1EEC": "\u01B0",
  675. "\u1EF7": "y",
  676. "\u1EF6": "y",
  677. "\u1EF3": "y",
  678. "\u1EF2": "Y",
  679. "\u1EF5": "y",
  680. "\u1EF4": "Y",
  681. "\u1EF9": "y",
  682. "\u1EF8": "Y",
  683. "\u1EA1": "a",
  684. "\u1EA0": "A",
  685. "\u1EA5": "a",
  686. "\u1EA4": "A",
  687. "\u1EA7": "a",
  688. "\u1EA6": "A",
  689. "\u1EAD": "a",
  690. "\u1EAC": "A",
  691. "\u1EAB": "a",
  692. "\u1EAA": "A",
  693. // 'ă': 'a', // duplicate
  694. // 'Ă': 'A', // duplicate
  695. "\u1EAF": "a",
  696. "\u1EAE": "A",
  697. "\u1EB1": "a",
  698. "\u1EB0": "A",
  699. "\u1EB7": "a",
  700. "\u1EB6": "A",
  701. "\u1EB5": "a",
  702. "\u1EB4": "A",
  703. "\u24EA": "0",
  704. "\u2460": "1",
  705. "\u2461": "2",
  706. "\u2462": "3",
  707. "\u2463": "4",
  708. "\u2464": "5",
  709. "\u2465": "6",
  710. "\u2466": "7",
  711. "\u2467": "8",
  712. "\u2468": "9",
  713. "\u2469": "10",
  714. "\u246A": "11",
  715. "\u246B": "12",
  716. "\u246C": "13",
  717. "\u246D": "14",
  718. "\u246E": "15",
  719. "\u246F": "16",
  720. "\u2470": "17",
  721. "\u2471": "18",
  722. "\u2472": "18",
  723. "\u2473": "18",
  724. "\u24F5": "1",
  725. "\u24F6": "2",
  726. "\u24F7": "3",
  727. "\u24F8": "4",
  728. "\u24F9": "5",
  729. "\u24FA": "6",
  730. "\u24FB": "7",
  731. "\u24FC": "8",
  732. "\u24FD": "9",
  733. "\u24FE": "10",
  734. "\u24FF": "0",
  735. "\u24EB": "11",
  736. "\u24EC": "12",
  737. "\u24ED": "13",
  738. "\u24EE": "14",
  739. "\u24EF": "15",
  740. "\u24F0": "16",
  741. "\u24F1": "17",
  742. "\u24F2": "18",
  743. "\u24F3": "19",
  744. "\u24F4": "20",
  745. "\u24B6": "A",
  746. "\u24B7": "B",
  747. "\u24B8": "C",
  748. "\u24B9": "D",
  749. "\u24BA": "E",
  750. "\u24BB": "F",
  751. "\u24BC": "G",
  752. "\u24BD": "H",
  753. "\u24BE": "I",
  754. "\u24BF": "J",
  755. "\u24C0": "K",
  756. "\u24C1": "L",
  757. "\u24C2": "M",
  758. "\u24C3": "N",
  759. "\u24C4": "O",
  760. "\u24C5": "P",
  761. "\u24C6": "Q",
  762. "\u24C7": "R",
  763. "\u24C8": "S",
  764. "\u24C9": "T",
  765. "\u24CA": "U",
  766. "\u24CB": "V",
  767. "\u24CC": "W",
  768. "\u24CD": "X",
  769. "\u24CE": "Y",
  770. "\u24CF": "Z",
  771. "\u24D0": "a",
  772. "\u24D1": "b",
  773. "\u24D2": "c",
  774. "\u24D3": "d",
  775. "\u24D4": "e",
  776. "\u24D5": "f",
  777. "\u24D6": "g",
  778. "\u24D7": "h",
  779. "\u24D8": "i",
  780. "\u24D9": "j",
  781. "\u24DA": "k",
  782. "\u24DB": "l",
  783. "\u24DC": "m",
  784. "\u24DD": "n",
  785. "\u24DE": "o",
  786. "\u24DF": "p",
  787. "\u24E0": "q",
  788. "\u24E1": "r",
  789. "\u24E2": "s",
  790. "\u24E3": "t",
  791. "\u24E4": "u",
  792. "\u24E6": "v",
  793. "\u24E5": "w",
  794. "\u24E7": "x",
  795. "\u24E8": "y",
  796. "\u24E9": "z",
  797. // symbols
  798. "\u201C": '"',
  799. "\u201D": '"',
  800. "\u2018": "'",
  801. "\u2019": "'",
  802. "\u2202": "d",
  803. "\u0192": "f",
  804. "\u2122": "(TM)",
  805. "\xA9": "(C)",
  806. "\u0153": "oe",
  807. "\u0152": "OE",
  808. "\xAE": "(R)",
  809. "\u2020": "+",
  810. "\u2120": "(SM)",
  811. "\u2026": "...",
  812. "\u02DA": "o",
  813. "\xBA": "o",
  814. "\xAA": "a",
  815. "\u2022": "*",
  816. "\u104A": ",",
  817. "\u104B": ".",
  818. // currency
  819. "$": "USD",
  820. "\u20AC": "EUR",
  821. "\u20A2": "BRN",
  822. "\u20A3": "FRF",
  823. "\xA3": "GBP",
  824. "\u20A4": "ITL",
  825. "\u20A6": "NGN",
  826. "\u20A7": "ESP",
  827. "\u20A9": "KRW",
  828. "\u20AA": "ILS",
  829. "\u20AB": "VND",
  830. "\u20AD": "LAK",
  831. "\u20AE": "MNT",
  832. "\u20AF": "GRD",
  833. "\u20B1": "ARS",
  834. "\u20B2": "PYG",
  835. "\u20B3": "ARA",
  836. "\u20B4": "UAH",
  837. "\u20B5": "GHS",
  838. "\xA2": "cent",
  839. "\xA5": "CNY",
  840. "\u5143": "CNY",
  841. "\u5186": "YEN",
  842. "\uFDFC": "IRR",
  843. "\u20A0": "EWE",
  844. "\u0E3F": "THB",
  845. "\u20A8": "INR",
  846. "\u20B9": "INR",
  847. "\u20B0": "PF",
  848. "\u20BA": "TRY",
  849. "\u060B": "AFN",
  850. "\u20BC": "AZN",
  851. "\u043B\u0432": "BGN",
  852. "\u17DB": "KHR",
  853. "\u20A1": "CRC",
  854. "\u20B8": "KZT",
  855. "\u0434\u0435\u043D": "MKD",
  856. "z\u0142": "PLN",
  857. "\u20BD": "RUB",
  858. "\u20BE": "GEL"
  859. };
  860. var lookAheadCharArray = [
  861. // burmese
  862. "\u103A",
  863. // Dhivehi
  864. "\u07B0"
  865. ];
  866. var diatricMap = {
  867. // Burmese
  868. // dependent vowels
  869. "\u102C": "a",
  870. "\u102B": "a",
  871. "\u1031": "e",
  872. "\u1032": "e",
  873. "\u102D": "i",
  874. "\u102E": "i",
  875. "\u102D\u102F": "o",
  876. "\u102F": "u",
  877. "\u1030": "u",
  878. "\u1031\u102B\u1004\u103A": "aung",
  879. "\u1031\u102C": "aw",
  880. "\u1031\u102C\u103A": "aw",
  881. "\u1031\u102B": "aw",
  882. "\u1031\u102B\u103A": "aw",
  883. "\u103A": "\u103A",
  884. // this is special case but the character will be converted to latin in the code
  885. "\u1000\u103A": "et",
  886. "\u102D\u102F\u1000\u103A": "aik",
  887. "\u1031\u102C\u1000\u103A": "auk",
  888. "\u1004\u103A": "in",
  889. "\u102D\u102F\u1004\u103A": "aing",
  890. "\u1031\u102C\u1004\u103A": "aung",
  891. "\u1005\u103A": "it",
  892. "\u100A\u103A": "i",
  893. "\u1010\u103A": "at",
  894. "\u102D\u1010\u103A": "eik",
  895. "\u102F\u1010\u103A": "ok",
  896. "\u103D\u1010\u103A": "ut",
  897. "\u1031\u1010\u103A": "it",
  898. "\u1012\u103A": "d",
  899. "\u102D\u102F\u1012\u103A": "ok",
  900. "\u102F\u1012\u103A": "ait",
  901. "\u1014\u103A": "an",
  902. "\u102C\u1014\u103A": "an",
  903. "\u102D\u1014\u103A": "ein",
  904. "\u102F\u1014\u103A": "on",
  905. "\u103D\u1014\u103A": "un",
  906. "\u1015\u103A": "at",
  907. "\u102D\u1015\u103A": "eik",
  908. "\u102F\u1015\u103A": "ok",
  909. "\u103D\u1015\u103A": "ut",
  910. "\u1014\u103A\u102F\u1015\u103A": "nub",
  911. "\u1019\u103A": "an",
  912. "\u102D\u1019\u103A": "ein",
  913. "\u102F\u1019\u103A": "on",
  914. "\u103D\u1019\u103A": "un",
  915. "\u101A\u103A": "e",
  916. "\u102D\u102F\u101C\u103A": "ol",
  917. "\u1009\u103A": "in",
  918. "\u1036": "an",
  919. "\u102D\u1036": "ein",
  920. "\u102F\u1036": "on",
  921. // Dhivehi
  922. "\u07A6\u0787\u07B0": "ah",
  923. "\u07A6\u0781\u07B0": "ah"
  924. };
  925. var langCharMap = {
  926. "en": {},
  927. // default language
  928. "az": {
  929. // Azerbaijani
  930. "\xE7": "c",
  931. "\u0259": "e",
  932. "\u011F": "g",
  933. "\u0131": "i",
  934. "\xF6": "o",
  935. "\u015F": "s",
  936. "\xFC": "u",
  937. "\xC7": "C",
  938. "\u018F": "E",
  939. "\u011E": "G",
  940. "\u0130": "I",
  941. "\xD6": "O",
  942. "\u015E": "S",
  943. "\xDC": "U"
  944. },
  945. "cs": {
  946. // Czech
  947. "\u010D": "c",
  948. "\u010F": "d",
  949. "\u011B": "e",
  950. "\u0148": "n",
  951. "\u0159": "r",
  952. "\u0161": "s",
  953. "\u0165": "t",
  954. "\u016F": "u",
  955. "\u017E": "z",
  956. "\u010C": "C",
  957. "\u010E": "D",
  958. "\u011A": "E",
  959. "\u0147": "N",
  960. "\u0158": "R",
  961. "\u0160": "S",
  962. "\u0164": "T",
  963. "\u016E": "U",
  964. "\u017D": "Z"
  965. },
  966. "fi": {
  967. // Finnish
  968. // 'å': 'a', duplicate see charMap/latin
  969. // 'Å': 'A', duplicate see charMap/latin
  970. "\xE4": "a",
  971. // ok
  972. "\xC4": "A",
  973. // ok
  974. "\xF6": "o",
  975. // ok
  976. "\xD6": "O"
  977. // ok
  978. },
  979. "hu": {
  980. // Hungarian
  981. "\xE4": "a",
  982. // ok
  983. "\xC4": "A",
  984. // ok
  985. // 'á': 'a', duplicate see charMap/latin
  986. // 'Á': 'A', duplicate see charMap/latin
  987. "\xF6": "o",
  988. // ok
  989. "\xD6": "O",
  990. // ok
  991. // 'ő': 'o', duplicate see charMap/latin
  992. // 'Ő': 'O', duplicate see charMap/latin
  993. "\xFC": "u",
  994. "\xDC": "U",
  995. "\u0171": "u",
  996. "\u0170": "U"
  997. },
  998. "lt": {
  999. // Lithuanian
  1000. "\u0105": "a",
  1001. "\u010D": "c",
  1002. "\u0119": "e",
  1003. "\u0117": "e",
  1004. "\u012F": "i",
  1005. "\u0161": "s",
  1006. "\u0173": "u",
  1007. "\u016B": "u",
  1008. "\u017E": "z",
  1009. "\u0104": "A",
  1010. "\u010C": "C",
  1011. "\u0118": "E",
  1012. "\u0116": "E",
  1013. "\u012E": "I",
  1014. "\u0160": "S",
  1015. "\u0172": "U",
  1016. "\u016A": "U"
  1017. },
  1018. "lv": {
  1019. // Latvian
  1020. "\u0101": "a",
  1021. "\u010D": "c",
  1022. "\u0113": "e",
  1023. "\u0123": "g",
  1024. "\u012B": "i",
  1025. "\u0137": "k",
  1026. "\u013C": "l",
  1027. "\u0146": "n",
  1028. "\u0161": "s",
  1029. "\u016B": "u",
  1030. "\u017E": "z",
  1031. "\u0100": "A",
  1032. "\u010C": "C",
  1033. "\u0112": "E",
  1034. "\u0122": "G",
  1035. "\u012A": "i",
  1036. "\u0136": "k",
  1037. "\u013B": "L",
  1038. "\u0145": "N",
  1039. "\u0160": "S",
  1040. "\u016A": "u",
  1041. "\u017D": "Z"
  1042. },
  1043. "pl": {
  1044. // Polish
  1045. "\u0105": "a",
  1046. "\u0107": "c",
  1047. "\u0119": "e",
  1048. "\u0142": "l",
  1049. "\u0144": "n",
  1050. "\xF3": "o",
  1051. "\u015B": "s",
  1052. "\u017A": "z",
  1053. "\u017C": "z",
  1054. "\u0104": "A",
  1055. "\u0106": "C",
  1056. "\u0118": "e",
  1057. "\u0141": "L",
  1058. "\u0143": "N",
  1059. "\xD3": "O",
  1060. "\u015A": "S",
  1061. "\u0179": "Z",
  1062. "\u017B": "Z"
  1063. },
  1064. "sv": {
  1065. // Swedish
  1066. // 'å': 'a', duplicate see charMap/latin
  1067. // 'Å': 'A', duplicate see charMap/latin
  1068. "\xE4": "a",
  1069. // ok
  1070. "\xC4": "A",
  1071. // ok
  1072. "\xF6": "o",
  1073. // ok
  1074. "\xD6": "O"
  1075. // ok
  1076. },
  1077. "sk": {
  1078. // Slovak
  1079. "\xE4": "a",
  1080. "\xC4": "A"
  1081. },
  1082. "sr": {
  1083. // Serbian
  1084. "\u0459": "lj",
  1085. "\u045A": "nj",
  1086. "\u0409": "Lj",
  1087. "\u040A": "Nj",
  1088. "\u0111": "dj",
  1089. "\u0110": "Dj"
  1090. },
  1091. "tr": {
  1092. // Turkish
  1093. "\xDC": "U",
  1094. "\xD6": "O",
  1095. "\xFC": "u",
  1096. "\xF6": "o"
  1097. }
  1098. };
  1099. var symbolMap = {
  1100. "ar": {
  1101. "\u2206": "delta",
  1102. "\u221E": "la-nihaya",
  1103. "\u2665": "hob",
  1104. "&": "wa",
  1105. "|": "aw",
  1106. "<": "aqal-men",
  1107. ">": "akbar-men",
  1108. "\u2211": "majmou",
  1109. "\xA4": "omla"
  1110. },
  1111. "az": {},
  1112. "ca": {
  1113. "\u2206": "delta",
  1114. "\u221E": "infinit",
  1115. "\u2665": "amor",
  1116. "&": "i",
  1117. "|": "o",
  1118. "<": "menys que",
  1119. ">": "mes que",
  1120. "\u2211": "suma dels",
  1121. "\xA4": "moneda"
  1122. },
  1123. "cs": {
  1124. "\u2206": "delta",
  1125. "\u221E": "nekonecno",
  1126. "\u2665": "laska",
  1127. "&": "a",
  1128. "|": "nebo",
  1129. "<": "mensi nez",
  1130. ">": "vetsi nez",
  1131. "\u2211": "soucet",
  1132. "\xA4": "mena"
  1133. },
  1134. "de": {
  1135. "\u2206": "delta",
  1136. "\u221E": "unendlich",
  1137. "\u2665": "Liebe",
  1138. "&": "und",
  1139. "|": "oder",
  1140. "<": "kleiner als",
  1141. ">": "groesser als",
  1142. "\u2211": "Summe von",
  1143. "\xA4": "Waehrung"
  1144. },
  1145. "dv": {
  1146. "\u2206": "delta",
  1147. "\u221E": "kolunulaa",
  1148. "\u2665": "loabi",
  1149. "&": "aai",
  1150. "|": "noonee",
  1151. "<": "ah vure kuda",
  1152. ">": "ah vure bodu",
  1153. "\u2211": "jumula",
  1154. "\xA4": "faisaa"
  1155. },
  1156. "en": {
  1157. "\u2206": "delta",
  1158. "\u221E": "infinity",
  1159. "\u2665": "love",
  1160. "&": "and",
  1161. "|": "or",
  1162. "<": "less than",
  1163. ">": "greater than",
  1164. "\u2211": "sum",
  1165. "\xA4": "currency"
  1166. },
  1167. "es": {
  1168. "\u2206": "delta",
  1169. "\u221E": "infinito",
  1170. "\u2665": "amor",
  1171. "&": "y",
  1172. "|": "u",
  1173. "<": "menos que",
  1174. ">": "mas que",
  1175. "\u2211": "suma de los",
  1176. "\xA4": "moneda"
  1177. },
  1178. "fa": {
  1179. "\u2206": "delta",
  1180. "\u221E": "bi-nahayat",
  1181. "\u2665": "eshgh",
  1182. "&": "va",
  1183. "|": "ya",
  1184. "<": "kamtar-az",
  1185. ">": "bishtar-az",
  1186. "\u2211": "majmooe",
  1187. "\xA4": "vahed"
  1188. },
  1189. "fi": {
  1190. "\u2206": "delta",
  1191. "\u221E": "aarettomyys",
  1192. "\u2665": "rakkaus",
  1193. "&": "ja",
  1194. "|": "tai",
  1195. "<": "pienempi kuin",
  1196. ">": "suurempi kuin",
  1197. "\u2211": "summa",
  1198. "\xA4": "valuutta"
  1199. },
  1200. "fr": {
  1201. "\u2206": "delta",
  1202. "\u221E": "infiniment",
  1203. "\u2665": "Amour",
  1204. "&": "et",
  1205. "|": "ou",
  1206. "<": "moins que",
  1207. ">": "superieure a",
  1208. "\u2211": "somme des",
  1209. "\xA4": "monnaie"
  1210. },
  1211. "ge": {
  1212. "\u2206": "delta",
  1213. "\u221E": "usasruloba",
  1214. "\u2665": "siqvaruli",
  1215. "&": "da",
  1216. "|": "an",
  1217. "<": "naklebi",
  1218. ">": "meti",
  1219. "\u2211": "jami",
  1220. "\xA4": "valuta"
  1221. },
  1222. "gr": {},
  1223. "hu": {
  1224. "\u2206": "delta",
  1225. "\u221E": "vegtelen",
  1226. "\u2665": "szerelem",
  1227. "&": "es",
  1228. "|": "vagy",
  1229. "<": "kisebb mint",
  1230. ">": "nagyobb mint",
  1231. "\u2211": "szumma",
  1232. "\xA4": "penznem"
  1233. },
  1234. "it": {
  1235. "\u2206": "delta",
  1236. "\u221E": "infinito",
  1237. "\u2665": "amore",
  1238. "&": "e",
  1239. "|": "o",
  1240. "<": "minore di",
  1241. ">": "maggiore di",
  1242. "\u2211": "somma",
  1243. "\xA4": "moneta"
  1244. },
  1245. "lt": {
  1246. "\u2206": "delta",
  1247. "\u221E": "begalybe",
  1248. "\u2665": "meile",
  1249. "&": "ir",
  1250. "|": "ar",
  1251. "<": "maziau nei",
  1252. ">": "daugiau nei",
  1253. "\u2211": "suma",
  1254. "\xA4": "valiuta"
  1255. },
  1256. "lv": {
  1257. "\u2206": "delta",
  1258. "\u221E": "bezgaliba",
  1259. "\u2665": "milestiba",
  1260. "&": "un",
  1261. "|": "vai",
  1262. "<": "mazak neka",
  1263. ">": "lielaks neka",
  1264. "\u2211": "summa",
  1265. "\xA4": "valuta"
  1266. },
  1267. "my": {
  1268. "\u2206": "kwahkhyaet",
  1269. "\u221E": "asaonasme",
  1270. "\u2665": "akhyait",
  1271. "&": "nhin",
  1272. "|": "tho",
  1273. "<": "ngethaw",
  1274. ">": "kyithaw",
  1275. "\u2211": "paungld",
  1276. "\xA4": "ngwekye"
  1277. },
  1278. "mk": {},
  1279. "nl": {
  1280. "\u2206": "delta",
  1281. "\u221E": "oneindig",
  1282. "\u2665": "liefde",
  1283. "&": "en",
  1284. "|": "of",
  1285. "<": "kleiner dan",
  1286. ">": "groter dan",
  1287. "\u2211": "som",
  1288. "\xA4": "valuta"
  1289. },
  1290. "pl": {
  1291. "\u2206": "delta",
  1292. "\u221E": "nieskonczonosc",
  1293. "\u2665": "milosc",
  1294. "&": "i",
  1295. "|": "lub",
  1296. "<": "mniejsze niz",
  1297. ">": "wieksze niz",
  1298. "\u2211": "suma",
  1299. "\xA4": "waluta"
  1300. },
  1301. "pt": {
  1302. "\u2206": "delta",
  1303. "\u221E": "infinito",
  1304. "\u2665": "amor",
  1305. "&": "e",
  1306. "|": "ou",
  1307. "<": "menor que",
  1308. ">": "maior que",
  1309. "\u2211": "soma",
  1310. "\xA4": "moeda"
  1311. },
  1312. "ro": {
  1313. "\u2206": "delta",
  1314. "\u221E": "infinit",
  1315. "\u2665": "dragoste",
  1316. "&": "si",
  1317. "|": "sau",
  1318. "<": "mai mic ca",
  1319. ">": "mai mare ca",
  1320. "\u2211": "suma",
  1321. "\xA4": "valuta"
  1322. },
  1323. "ru": {
  1324. "\u2206": "delta",
  1325. "\u221E": "beskonechno",
  1326. "\u2665": "lubov",
  1327. "&": "i",
  1328. "|": "ili",
  1329. "<": "menshe",
  1330. ">": "bolshe",
  1331. "\u2211": "summa",
  1332. "\xA4": "valjuta"
  1333. },
  1334. "sk": {
  1335. "\u2206": "delta",
  1336. "\u221E": "nekonecno",
  1337. "\u2665": "laska",
  1338. "&": "a",
  1339. "|": "alebo",
  1340. "<": "menej ako",
  1341. ">": "viac ako",
  1342. "\u2211": "sucet",
  1343. "\xA4": "mena"
  1344. },
  1345. "sr": {},
  1346. "tr": {
  1347. "\u2206": "delta",
  1348. "\u221E": "sonsuzluk",
  1349. "\u2665": "ask",
  1350. "&": "ve",
  1351. "|": "veya",
  1352. "<": "kucuktur",
  1353. ">": "buyuktur",
  1354. "\u2211": "toplam",
  1355. "\xA4": "para birimi"
  1356. },
  1357. "uk": {
  1358. "\u2206": "delta",
  1359. "\u221E": "bezkinechnist",
  1360. "\u2665": "lubov",
  1361. "&": "i",
  1362. "|": "abo",
  1363. "<": "menshe",
  1364. ">": "bilshe",
  1365. "\u2211": "suma",
  1366. "\xA4": "valjuta"
  1367. },
  1368. "vn": {
  1369. "\u2206": "delta",
  1370. "\u221E": "vo cuc",
  1371. "\u2665": "yeu",
  1372. "&": "va",
  1373. "|": "hoac",
  1374. "<": "nho hon",
  1375. ">": "lon hon",
  1376. "\u2211": "tong",
  1377. "\xA4": "tien te"
  1378. }
  1379. };
  1380. var uricChars = [";", "?", ":", "@", "&", "=", "+", "$", ",", "/"].join("");
  1381. var uricNoSlashChars = [";", "?", ":", "@", "&", "=", "+", "$", ","].join("");
  1382. var markChars = [".", "!", "~", "*", "'", "(", ")"].join("");
  1383. var getSlug = function getSlug2(input, opts) {
  1384. var separator = "-";
  1385. var result = "";
  1386. var diatricString = "";
  1387. var convertSymbols = true;
  1388. var customReplacements = {};
  1389. var maintainCase;
  1390. var titleCase;
  1391. var truncate;
  1392. var uricFlag;
  1393. var uricNoSlashFlag;
  1394. var markFlag;
  1395. var symbol;
  1396. var langChar;
  1397. var lucky;
  1398. var i;
  1399. var ch;
  1400. var l;
  1401. var lastCharWasSymbol;
  1402. var lastCharWasDiatric;
  1403. var allowedChars = "";
  1404. if (typeof input !== "string") {
  1405. return "";
  1406. }
  1407. if (typeof opts === "string") {
  1408. separator = opts;
  1409. }
  1410. symbol = symbolMap.en;
  1411. langChar = langCharMap.en;
  1412. if (typeof opts === "object") {
  1413. maintainCase = opts.maintainCase || false;
  1414. customReplacements = opts.custom && typeof opts.custom === "object" ? opts.custom : customReplacements;
  1415. truncate = +opts.truncate > 1 && opts.truncate || false;
  1416. uricFlag = opts.uric || false;
  1417. uricNoSlashFlag = opts.uricNoSlash || false;
  1418. markFlag = opts.mark || false;
  1419. convertSymbols = opts.symbols === false || opts.lang === false ? false : true;
  1420. separator = opts.separator || separator;
  1421. if (uricFlag) {
  1422. allowedChars += uricChars;
  1423. }
  1424. if (uricNoSlashFlag) {
  1425. allowedChars += uricNoSlashChars;
  1426. }
  1427. if (markFlag) {
  1428. allowedChars += markChars;
  1429. }
  1430. symbol = opts.lang && symbolMap[opts.lang] && convertSymbols ? symbolMap[opts.lang] : convertSymbols ? symbolMap.en : {};
  1431. langChar = opts.lang && langCharMap[opts.lang] ? langCharMap[opts.lang] : opts.lang === false || opts.lang === true ? {} : langCharMap.en;
  1432. if (opts.titleCase && typeof opts.titleCase.length === "number" && Array.prototype.toString.call(opts.titleCase)) {
  1433. opts.titleCase.forEach(function(v) {
  1434. customReplacements[v + ""] = v + "";
  1435. });
  1436. titleCase = true;
  1437. } else {
  1438. titleCase = !!opts.titleCase;
  1439. }
  1440. if (opts.custom && typeof opts.custom.length === "number" && Array.prototype.toString.call(opts.custom)) {
  1441. opts.custom.forEach(function(v) {
  1442. customReplacements[v + ""] = v + "";
  1443. });
  1444. }
  1445. Object.keys(customReplacements).forEach(function(v) {
  1446. var r;
  1447. if (v.length > 1) {
  1448. r = new RegExp("\\b" + escapeChars(v) + "\\b", "gi");
  1449. } else {
  1450. r = new RegExp(escapeChars(v), "gi");
  1451. }
  1452. input = input.replace(r, customReplacements[v]);
  1453. });
  1454. for (ch in customReplacements) {
  1455. allowedChars += ch;
  1456. }
  1457. }
  1458. allowedChars += separator;
  1459. allowedChars = escapeChars(allowedChars);
  1460. input = input.replace(/(^\s+|\s+$)/g, "");
  1461. lastCharWasSymbol = false;
  1462. lastCharWasDiatric = false;
  1463. for (i = 0, l = input.length; i < l; i++) {
  1464. ch = input[i];
  1465. if (isReplacedCustomChar(ch, customReplacements)) {
  1466. lastCharWasSymbol = false;
  1467. } else if (langChar[ch]) {
  1468. ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? " " + langChar[ch] : langChar[ch];
  1469. lastCharWasSymbol = false;
  1470. } else if (ch in charMap) {
  1471. if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {
  1472. diatricString += ch;
  1473. ch = "";
  1474. } else if (lastCharWasDiatric === true) {
  1475. ch = diatricMap[diatricString] + charMap[ch];
  1476. diatricString = "";
  1477. } else {
  1478. ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? " " + charMap[ch] : charMap[ch];
  1479. }
  1480. lastCharWasSymbol = false;
  1481. lastCharWasDiatric = false;
  1482. } else if (ch in diatricMap) {
  1483. diatricString += ch;
  1484. ch = "";
  1485. if (i === l - 1) {
  1486. ch = diatricMap[diatricString];
  1487. }
  1488. lastCharWasDiatric = true;
  1489. } else if (
  1490. // process symbol chars
  1491. symbol[ch] && !(uricFlag && uricChars.indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars.indexOf(ch) !== -1)
  1492. ) {
  1493. ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
  1494. ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : "";
  1495. lastCharWasSymbol = true;
  1496. } else {
  1497. if (lastCharWasDiatric === true) {
  1498. ch = diatricMap[diatricString] + ch;
  1499. diatricString = "";
  1500. lastCharWasDiatric = false;
  1501. } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) {
  1502. ch = " " + ch;
  1503. }
  1504. lastCharWasSymbol = false;
  1505. }
  1506. result += ch.replace(new RegExp("[^\\w\\s" + allowedChars + "_-]", "g"), separator);
  1507. }
  1508. if (titleCase) {
  1509. result = result.replace(/(\w)(\S*)/g, function(_, i2, r) {
  1510. var j = i2.toUpperCase() + (r !== null ? r : "");
  1511. return Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0 ? j : j.toLowerCase();
  1512. });
  1513. }
  1514. result = result.replace(/\s+/g, separator).replace(new RegExp("\\" + separator + "+", "g"), separator).replace(new RegExp("(^\\" + separator + "+|\\" + separator + "+$)", "g"), "");
  1515. if (truncate && result.length > truncate) {
  1516. lucky = result.charAt(truncate) === separator;
  1517. result = result.slice(0, truncate);
  1518. if (!lucky) {
  1519. result = result.slice(0, result.lastIndexOf(separator));
  1520. }
  1521. }
  1522. if (!maintainCase && !titleCase) {
  1523. result = result.toLowerCase();
  1524. }
  1525. return result;
  1526. };
  1527. var createSlug = function createSlug2(opts) {
  1528. return function getSlugWithConfig(input) {
  1529. return getSlug(input, opts);
  1530. };
  1531. };
  1532. var escapeChars = function escapeChars2(input) {
  1533. return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, "\\$&");
  1534. };
  1535. var isReplacedCustomChar = function(ch, customReplacements) {
  1536. for (var c in customReplacements) {
  1537. if (customReplacements[c] === ch) {
  1538. return true;
  1539. }
  1540. }
  1541. };
  1542. if (typeof module !== "undefined" && module.exports) {
  1543. module.exports = getSlug;
  1544. module.exports.createSlug = createSlug;
  1545. } else if (typeof define !== "undefined" && define.amd) {
  1546. define([], function() {
  1547. return getSlug;
  1548. });
  1549. } else {
  1550. try {
  1551. if (root.getSlug || root.createSlug) {
  1552. throw "speakingurl: globals exists /(getSlug|createSlug)/";
  1553. } else {
  1554. root.getSlug = getSlug;
  1555. root.createSlug = createSlug;
  1556. }
  1557. } catch (e) {
  1558. }
  1559. }
  1560. })(exports);
  1561. }
  1562. });
  1563. // ../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js
  1564. var require_speakingurl2 = __commonJS({
  1565. "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js"(exports, module) {
  1566. "use strict";
  1567. init_esm_shims();
  1568. module.exports = require_speakingurl();
  1569. }
  1570. });
  1571. // src/index.ts
  1572. init_esm_shims();
  1573. // src/core/index.ts
  1574. init_esm_shims();
  1575. import { isNuxtApp, target as target13 } from "@vue/devtools-shared";
  1576. // src/compat/index.ts
  1577. init_esm_shims();
  1578. import { target } from "@vue/devtools-shared";
  1579. function onLegacyDevToolsPluginApiAvailable(cb) {
  1580. if (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__) {
  1581. cb();
  1582. return;
  1583. }
  1584. Object.defineProperty(target, "__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__", {
  1585. set(value) {
  1586. if (value)
  1587. cb();
  1588. },
  1589. configurable: true
  1590. });
  1591. }
  1592. // src/ctx/index.ts
  1593. init_esm_shims();
  1594. import { target as target11 } from "@vue/devtools-shared";
  1595. // src/ctx/api.ts
  1596. init_esm_shims();
  1597. import { target as target9 } from "@vue/devtools-shared";
  1598. // src/core/component-highlighter/index.ts
  1599. init_esm_shims();
  1600. // src/core/component/state/bounding-rect.ts
  1601. init_esm_shims();
  1602. // src/core/component/utils/index.ts
  1603. init_esm_shims();
  1604. import { basename, classify } from "@vue/devtools-shared";
  1605. function getComponentTypeName(options) {
  1606. var _a25;
  1607. const name = options.name || options._componentTag || options.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ || options.__name;
  1608. if (name === "index" && ((_a25 = options.__file) == null ? void 0 : _a25.endsWith("index.vue"))) {
  1609. return "";
  1610. }
  1611. return name;
  1612. }
  1613. function getComponentFileName(options) {
  1614. const file = options.__file;
  1615. if (file)
  1616. return classify(basename(file, ".vue"));
  1617. }
  1618. function getComponentName(options) {
  1619. const name = options.displayName || options.name || options._componentTag;
  1620. if (name)
  1621. return name;
  1622. return getComponentFileName(options);
  1623. }
  1624. function saveComponentGussedName(instance, name) {
  1625. instance.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ = name;
  1626. return name;
  1627. }
  1628. function getAppRecord(instance) {
  1629. if (instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__)
  1630. return instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
  1631. else if (instance.root)
  1632. return instance.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
  1633. }
  1634. async function getComponentId(options) {
  1635. const { app, uid, instance } = options;
  1636. try {
  1637. if (instance.__VUE_DEVTOOLS_NEXT_UID__)
  1638. return instance.__VUE_DEVTOOLS_NEXT_UID__;
  1639. const appRecord = await getAppRecord(app);
  1640. if (!appRecord)
  1641. return null;
  1642. const isRoot = appRecord.rootInstance === instance;
  1643. return `${appRecord.id}:${isRoot ? "root" : uid}`;
  1644. } catch (e) {
  1645. }
  1646. }
  1647. function isFragment(instance) {
  1648. var _a25, _b25;
  1649. const subTreeType = (_a25 = instance.subTree) == null ? void 0 : _a25.type;
  1650. const appRecord = getAppRecord(instance);
  1651. if (appRecord) {
  1652. return ((_b25 = appRecord == null ? void 0 : appRecord.types) == null ? void 0 : _b25.Fragment) === subTreeType;
  1653. }
  1654. return false;
  1655. }
  1656. function isBeingDestroyed(instance) {
  1657. return instance._isBeingDestroyed || instance.isUnmounted;
  1658. }
  1659. function getInstanceName(instance) {
  1660. var _a25, _b25, _c;
  1661. const name = getComponentTypeName((instance == null ? void 0 : instance.type) || {});
  1662. if (name)
  1663. return name;
  1664. if ((instance == null ? void 0 : instance.root) === instance)
  1665. return "Root";
  1666. for (const key in (_b25 = (_a25 = instance.parent) == null ? void 0 : _a25.type) == null ? void 0 : _b25.components) {
  1667. if (instance.parent.type.components[key] === (instance == null ? void 0 : instance.type))
  1668. return saveComponentGussedName(instance, key);
  1669. }
  1670. for (const key in (_c = instance.appContext) == null ? void 0 : _c.components) {
  1671. if (instance.appContext.components[key] === (instance == null ? void 0 : instance.type))
  1672. return saveComponentGussedName(instance, key);
  1673. }
  1674. const fileName = getComponentFileName((instance == null ? void 0 : instance.type) || {});
  1675. if (fileName)
  1676. return fileName;
  1677. return "Anonymous Component";
  1678. }
  1679. function getUniqueComponentId(instance) {
  1680. var _a25, _b25, _c;
  1681. 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;
  1682. const instanceId = instance === (instance == null ? void 0 : instance.root) ? "root" : instance.uid;
  1683. return `${appId}:${instanceId}`;
  1684. }
  1685. function getRenderKey(value) {
  1686. if (value == null)
  1687. return "";
  1688. if (typeof value === "number")
  1689. return value;
  1690. else if (typeof value === "string")
  1691. return `'${value}'`;
  1692. else if (Array.isArray(value))
  1693. return "Array";
  1694. else
  1695. return "Object";
  1696. }
  1697. function returnError(cb) {
  1698. try {
  1699. return cb();
  1700. } catch (e) {
  1701. return e;
  1702. }
  1703. }
  1704. function getComponentInstance(appRecord, instanceId) {
  1705. instanceId = instanceId || `${appRecord.id}:root`;
  1706. const instance = appRecord.instanceMap.get(instanceId);
  1707. return instance || appRecord.instanceMap.get(":root");
  1708. }
  1709. function ensurePropertyExists(obj, key, skipObjCheck = false) {
  1710. return skipObjCheck ? key in obj : typeof obj === "object" && obj !== null ? key in obj : false;
  1711. }
  1712. // src/core/component/state/bounding-rect.ts
  1713. function createRect() {
  1714. const rect = {
  1715. top: 0,
  1716. bottom: 0,
  1717. left: 0,
  1718. right: 0,
  1719. get width() {
  1720. return rect.right - rect.left;
  1721. },
  1722. get height() {
  1723. return rect.bottom - rect.top;
  1724. }
  1725. };
  1726. return rect;
  1727. }
  1728. var range;
  1729. function getTextRect(node) {
  1730. if (!range)
  1731. range = document.createRange();
  1732. range.selectNode(node);
  1733. return range.getBoundingClientRect();
  1734. }
  1735. function getFragmentRect(vnode) {
  1736. const rect = createRect();
  1737. if (!vnode.children)
  1738. return rect;
  1739. for (let i = 0, l = vnode.children.length; i < l; i++) {
  1740. const childVnode = vnode.children[i];
  1741. let childRect;
  1742. if (childVnode.component) {
  1743. childRect = getComponentBoundingRect(childVnode.component);
  1744. } else if (childVnode.el) {
  1745. const el = childVnode.el;
  1746. if (el.nodeType === 1 || el.getBoundingClientRect)
  1747. childRect = el.getBoundingClientRect();
  1748. else if (el.nodeType === 3 && el.data.trim())
  1749. childRect = getTextRect(el);
  1750. }
  1751. if (childRect)
  1752. mergeRects(rect, childRect);
  1753. }
  1754. return rect;
  1755. }
  1756. function mergeRects(a, b) {
  1757. if (!a.top || b.top < a.top)
  1758. a.top = b.top;
  1759. if (!a.bottom || b.bottom > a.bottom)
  1760. a.bottom = b.bottom;
  1761. if (!a.left || b.left < a.left)
  1762. a.left = b.left;
  1763. if (!a.right || b.right > a.right)
  1764. a.right = b.right;
  1765. return a;
  1766. }
  1767. var DEFAULT_RECT = {
  1768. top: 0,
  1769. left: 0,
  1770. right: 0,
  1771. bottom: 0,
  1772. width: 0,
  1773. height: 0
  1774. };
  1775. function getComponentBoundingRect(instance) {
  1776. const el = instance.subTree.el;
  1777. if (typeof window === "undefined") {
  1778. return DEFAULT_RECT;
  1779. }
  1780. if (isFragment(instance))
  1781. return getFragmentRect(instance.subTree);
  1782. else if ((el == null ? void 0 : el.nodeType) === 1)
  1783. return el == null ? void 0 : el.getBoundingClientRect();
  1784. else if (instance.subTree.component)
  1785. return getComponentBoundingRect(instance.subTree.component);
  1786. else
  1787. return DEFAULT_RECT;
  1788. }
  1789. // src/core/component/tree/el.ts
  1790. init_esm_shims();
  1791. function getRootElementsFromComponentInstance(instance) {
  1792. if (isFragment(instance))
  1793. return getFragmentRootElements(instance.subTree);
  1794. if (!instance.subTree)
  1795. return [];
  1796. return [instance.subTree.el];
  1797. }
  1798. function getFragmentRootElements(vnode) {
  1799. if (!vnode.children)
  1800. return [];
  1801. const list = [];
  1802. vnode.children.forEach((childVnode) => {
  1803. if (childVnode.component)
  1804. list.push(...getRootElementsFromComponentInstance(childVnode.component));
  1805. else if (childVnode == null ? void 0 : childVnode.el)
  1806. list.push(childVnode.el);
  1807. });
  1808. return list;
  1809. }
  1810. // src/core/component-highlighter/index.ts
  1811. var CONTAINER_ELEMENT_ID = "__vue-devtools-component-inspector__";
  1812. var CARD_ELEMENT_ID = "__vue-devtools-component-inspector__card__";
  1813. var COMPONENT_NAME_ELEMENT_ID = "__vue-devtools-component-inspector__name__";
  1814. var INDICATOR_ELEMENT_ID = "__vue-devtools-component-inspector__indicator__";
  1815. var containerStyles = {
  1816. display: "block",
  1817. zIndex: 2147483640,
  1818. position: "fixed",
  1819. backgroundColor: "#42b88325",
  1820. border: "1px solid #42b88350",
  1821. borderRadius: "5px",
  1822. transition: "all 0.1s ease-in",
  1823. pointerEvents: "none"
  1824. };
  1825. var cardStyles = {
  1826. fontFamily: "Arial, Helvetica, sans-serif",
  1827. padding: "5px 8px",
  1828. borderRadius: "4px",
  1829. textAlign: "left",
  1830. position: "absolute",
  1831. left: 0,
  1832. color: "#e9e9e9",
  1833. fontSize: "14px",
  1834. fontWeight: 600,
  1835. lineHeight: "24px",
  1836. backgroundColor: "#42b883",
  1837. boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"
  1838. };
  1839. var indicatorStyles = {
  1840. display: "inline-block",
  1841. fontWeight: 400,
  1842. fontStyle: "normal",
  1843. fontSize: "12px",
  1844. opacity: 0.7
  1845. };
  1846. function getContainerElement() {
  1847. return document.getElementById(CONTAINER_ELEMENT_ID);
  1848. }
  1849. function getCardElement() {
  1850. return document.getElementById(CARD_ELEMENT_ID);
  1851. }
  1852. function getIndicatorElement() {
  1853. return document.getElementById(INDICATOR_ELEMENT_ID);
  1854. }
  1855. function getNameElement() {
  1856. return document.getElementById(COMPONENT_NAME_ELEMENT_ID);
  1857. }
  1858. function getStyles(bounds) {
  1859. return {
  1860. left: `${Math.round(bounds.left * 100) / 100}px`,
  1861. top: `${Math.round(bounds.top * 100) / 100}px`,
  1862. width: `${Math.round(bounds.width * 100) / 100}px`,
  1863. height: `${Math.round(bounds.height * 100) / 100}px`
  1864. };
  1865. }
  1866. function create(options) {
  1867. var _a25;
  1868. const containerEl = document.createElement("div");
  1869. containerEl.id = (_a25 = options.elementId) != null ? _a25 : CONTAINER_ELEMENT_ID;
  1870. Object.assign(containerEl.style, {
  1871. ...containerStyles,
  1872. ...getStyles(options.bounds),
  1873. ...options.style
  1874. });
  1875. const cardEl = document.createElement("span");
  1876. cardEl.id = CARD_ELEMENT_ID;
  1877. Object.assign(cardEl.style, {
  1878. ...cardStyles,
  1879. top: options.bounds.top < 35 ? 0 : "-35px"
  1880. });
  1881. const nameEl = document.createElement("span");
  1882. nameEl.id = COMPONENT_NAME_ELEMENT_ID;
  1883. nameEl.innerHTML = `&lt;${options.name}&gt;&nbsp;&nbsp;`;
  1884. const indicatorEl = document.createElement("i");
  1885. indicatorEl.id = INDICATOR_ELEMENT_ID;
  1886. indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;
  1887. Object.assign(indicatorEl.style, indicatorStyles);
  1888. cardEl.appendChild(nameEl);
  1889. cardEl.appendChild(indicatorEl);
  1890. containerEl.appendChild(cardEl);
  1891. document.body.appendChild(containerEl);
  1892. return containerEl;
  1893. }
  1894. function update(options) {
  1895. const containerEl = getContainerElement();
  1896. const cardEl = getCardElement();
  1897. const nameEl = getNameElement();
  1898. const indicatorEl = getIndicatorElement();
  1899. if (containerEl) {
  1900. Object.assign(containerEl.style, {
  1901. ...containerStyles,
  1902. ...getStyles(options.bounds)
  1903. });
  1904. Object.assign(cardEl.style, {
  1905. top: options.bounds.top < 35 ? 0 : "-35px"
  1906. });
  1907. nameEl.innerHTML = `&lt;${options.name}&gt;&nbsp;&nbsp;`;
  1908. indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;
  1909. }
  1910. }
  1911. function highlight(instance) {
  1912. const bounds = getComponentBoundingRect(instance);
  1913. if (!bounds.width && !bounds.height)
  1914. return;
  1915. const name = getInstanceName(instance);
  1916. const container = getContainerElement();
  1917. container ? update({ bounds, name }) : create({ bounds, name });
  1918. }
  1919. function unhighlight() {
  1920. const el = getContainerElement();
  1921. if (el)
  1922. el.style.display = "none";
  1923. }
  1924. var inspectInstance = null;
  1925. function inspectFn(e) {
  1926. const target22 = e.target;
  1927. if (target22) {
  1928. const instance = target22.__vueParentComponent;
  1929. if (instance) {
  1930. inspectInstance = instance;
  1931. const el = instance.vnode.el;
  1932. if (el) {
  1933. const bounds = getComponentBoundingRect(instance);
  1934. const name = getInstanceName(instance);
  1935. const container = getContainerElement();
  1936. container ? update({ bounds, name }) : create({ bounds, name });
  1937. }
  1938. }
  1939. }
  1940. }
  1941. function selectComponentFn(e, cb) {
  1942. e.preventDefault();
  1943. e.stopPropagation();
  1944. if (inspectInstance) {
  1945. const uniqueComponentId = getUniqueComponentId(inspectInstance);
  1946. cb(uniqueComponentId);
  1947. }
  1948. }
  1949. var inspectComponentHighLighterSelectFn = null;
  1950. function cancelInspectComponentHighLighter() {
  1951. unhighlight();
  1952. window.removeEventListener("mouseover", inspectFn);
  1953. window.removeEventListener("click", inspectComponentHighLighterSelectFn, true);
  1954. inspectComponentHighLighterSelectFn = null;
  1955. }
  1956. function inspectComponentHighLighter() {
  1957. window.addEventListener("mouseover", inspectFn);
  1958. return new Promise((resolve) => {
  1959. function onSelect(e) {
  1960. e.preventDefault();
  1961. e.stopPropagation();
  1962. selectComponentFn(e, (id) => {
  1963. window.removeEventListener("click", onSelect, true);
  1964. inspectComponentHighLighterSelectFn = null;
  1965. window.removeEventListener("mouseover", inspectFn);
  1966. const el = getContainerElement();
  1967. if (el)
  1968. el.style.display = "none";
  1969. resolve(JSON.stringify({ id }));
  1970. });
  1971. }
  1972. inspectComponentHighLighterSelectFn = onSelect;
  1973. window.addEventListener("click", onSelect, true);
  1974. });
  1975. }
  1976. function scrollToComponent(options) {
  1977. const instance = getComponentInstance(activeAppRecord.value, options.id);
  1978. if (instance) {
  1979. const [el] = getRootElementsFromComponentInstance(instance);
  1980. if (typeof el.scrollIntoView === "function") {
  1981. el.scrollIntoView({
  1982. behavior: "smooth"
  1983. });
  1984. } else {
  1985. const bounds = getComponentBoundingRect(instance);
  1986. const scrollTarget = document.createElement("div");
  1987. const styles = {
  1988. ...getStyles(bounds),
  1989. position: "absolute"
  1990. };
  1991. Object.assign(scrollTarget.style, styles);
  1992. document.body.appendChild(scrollTarget);
  1993. scrollTarget.scrollIntoView({
  1994. behavior: "smooth"
  1995. });
  1996. setTimeout(() => {
  1997. document.body.removeChild(scrollTarget);
  1998. }, 2e3);
  1999. }
  2000. setTimeout(() => {
  2001. const bounds = getComponentBoundingRect(instance);
  2002. if (bounds.width || bounds.height) {
  2003. const name = getInstanceName(instance);
  2004. const el2 = getContainerElement();
  2005. el2 ? update({ ...options, name, bounds }) : create({ ...options, name, bounds });
  2006. setTimeout(() => {
  2007. if (el2)
  2008. el2.style.display = "none";
  2009. }, 1500);
  2010. }
  2011. }, 1200);
  2012. }
  2013. }
  2014. // src/core/component-inspector/index.ts
  2015. init_esm_shims();
  2016. import { target as target2 } from "@vue/devtools-shared";
  2017. var _a, _b;
  2018. (_b = (_a = target2).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__) != null ? _b : _a.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true;
  2019. function toggleComponentInspectorEnabled(enabled) {
  2020. target2.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = enabled;
  2021. }
  2022. function waitForInspectorInit(cb) {
  2023. let total = 0;
  2024. const timer = setInterval(() => {
  2025. if (target2.__VUE_INSPECTOR__) {
  2026. clearInterval(timer);
  2027. total += 30;
  2028. cb();
  2029. }
  2030. if (total >= /* 5s */
  2031. 5e3)
  2032. clearInterval(timer);
  2033. }, 30);
  2034. }
  2035. function setupInspector() {
  2036. const inspector = target2.__VUE_INSPECTOR__;
  2037. const _openInEditor = inspector.openInEditor;
  2038. inspector.openInEditor = async (...params) => {
  2039. inspector.disable();
  2040. _openInEditor(...params);
  2041. };
  2042. }
  2043. function getComponentInspector() {
  2044. return new Promise((resolve) => {
  2045. function setup() {
  2046. setupInspector();
  2047. resolve(target2.__VUE_INSPECTOR__);
  2048. }
  2049. if (!target2.__VUE_INSPECTOR__) {
  2050. waitForInspectorInit(() => {
  2051. setup();
  2052. });
  2053. } else {
  2054. setup();
  2055. }
  2056. });
  2057. }
  2058. // src/core/component/state/editor.ts
  2059. init_esm_shims();
  2060. // src/shared/stub-vue.ts
  2061. init_esm_shims();
  2062. function isReadonly(value) {
  2063. return !!(value && value["__v_isReadonly" /* IS_READONLY */]);
  2064. }
  2065. function isReactive(value) {
  2066. if (isReadonly(value)) {
  2067. return isReactive(value["__v_raw" /* RAW */]);
  2068. }
  2069. return !!(value && value["__v_isReactive" /* IS_REACTIVE */]);
  2070. }
  2071. function isRef(r) {
  2072. return !!(r && r.__v_isRef === true);
  2073. }
  2074. function toRaw(observed) {
  2075. const raw = observed && observed["__v_raw" /* RAW */];
  2076. return raw ? toRaw(raw) : observed;
  2077. }
  2078. var Fragment = Symbol.for("v-fgt");
  2079. // src/core/component/state/editor.ts
  2080. var StateEditor = class {
  2081. constructor() {
  2082. this.refEditor = new RefStateEditor();
  2083. }
  2084. set(object, path, value, cb) {
  2085. const sections = Array.isArray(path) ? path : path.split(".");
  2086. const markRef = false;
  2087. while (sections.length > 1) {
  2088. const section = sections.shift();
  2089. if (object instanceof Map)
  2090. object = object.get(section);
  2091. else if (object instanceof Set)
  2092. object = Array.from(object.values())[section];
  2093. else object = object[section];
  2094. if (this.refEditor.isRef(object))
  2095. object = this.refEditor.get(object);
  2096. }
  2097. const field = sections[0];
  2098. const item = this.refEditor.get(object)[field];
  2099. if (cb) {
  2100. cb(object, field, value);
  2101. } else {
  2102. if (this.refEditor.isRef(item))
  2103. this.refEditor.set(item, value);
  2104. else if (markRef)
  2105. object[field] = value;
  2106. else
  2107. object[field] = value;
  2108. }
  2109. }
  2110. get(object, path) {
  2111. const sections = Array.isArray(path) ? path : path.split(".");
  2112. for (let i = 0; i < sections.length; i++) {
  2113. if (object instanceof Map)
  2114. object = object.get(sections[i]);
  2115. else
  2116. object = object[sections[i]];
  2117. if (this.refEditor.isRef(object))
  2118. object = this.refEditor.get(object);
  2119. if (!object)
  2120. return void 0;
  2121. }
  2122. return object;
  2123. }
  2124. has(object, path, parent = false) {
  2125. if (typeof object === "undefined")
  2126. return false;
  2127. const sections = Array.isArray(path) ? path.slice() : path.split(".");
  2128. const size = !parent ? 1 : 2;
  2129. while (object && sections.length > size) {
  2130. const section = sections.shift();
  2131. object = object[section];
  2132. if (this.refEditor.isRef(object))
  2133. object = this.refEditor.get(object);
  2134. }
  2135. return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
  2136. }
  2137. createDefaultSetCallback(state) {
  2138. return (object, field, value) => {
  2139. if (state.remove || state.newKey) {
  2140. if (Array.isArray(object))
  2141. object.splice(field, 1);
  2142. else if (toRaw(object) instanceof Map)
  2143. object.delete(field);
  2144. else if (toRaw(object) instanceof Set)
  2145. object.delete(Array.from(object.values())[field]);
  2146. else Reflect.deleteProperty(object, field);
  2147. }
  2148. if (!state.remove) {
  2149. const target22 = object[state.newKey || field];
  2150. if (this.refEditor.isRef(target22))
  2151. this.refEditor.set(target22, value);
  2152. else if (toRaw(object) instanceof Map)
  2153. object.set(state.newKey || field, value);
  2154. else if (toRaw(object) instanceof Set)
  2155. object.add(value);
  2156. else
  2157. object[state.newKey || field] = value;
  2158. }
  2159. };
  2160. }
  2161. };
  2162. var RefStateEditor = class {
  2163. set(ref, value) {
  2164. if (isRef(ref)) {
  2165. ref.value = value;
  2166. } else {
  2167. if (ref instanceof Set && Array.isArray(value)) {
  2168. ref.clear();
  2169. value.forEach((v) => ref.add(v));
  2170. return;
  2171. }
  2172. const currentKeys = Object.keys(value);
  2173. if (ref instanceof Map) {
  2174. const previousKeysSet2 = new Set(ref.keys());
  2175. currentKeys.forEach((key) => {
  2176. ref.set(key, Reflect.get(value, key));
  2177. previousKeysSet2.delete(key);
  2178. });
  2179. previousKeysSet2.forEach((key) => ref.delete(key));
  2180. return;
  2181. }
  2182. const previousKeysSet = new Set(Object.keys(ref));
  2183. currentKeys.forEach((key) => {
  2184. Reflect.set(ref, key, Reflect.get(value, key));
  2185. previousKeysSet.delete(key);
  2186. });
  2187. previousKeysSet.forEach((key) => Reflect.deleteProperty(ref, key));
  2188. }
  2189. }
  2190. get(ref) {
  2191. return isRef(ref) ? ref.value : ref;
  2192. }
  2193. isRef(ref) {
  2194. return isRef(ref) || isReactive(ref);
  2195. }
  2196. };
  2197. async function editComponentState(payload, stateEditor2) {
  2198. const { path, nodeId, state, type } = payload;
  2199. const instance = getComponentInstance(activeAppRecord.value, nodeId);
  2200. if (!instance)
  2201. return;
  2202. const targetPath = path.slice();
  2203. let target22;
  2204. if (Object.keys(instance.props).includes(path[0])) {
  2205. target22 = instance.props;
  2206. } else if (instance.devtoolsRawSetupState && Object.keys(instance.devtoolsRawSetupState).includes(path[0])) {
  2207. target22 = instance.devtoolsRawSetupState;
  2208. } else if (instance.data && Object.keys(instance.data).includes(path[0])) {
  2209. target22 = instance.data;
  2210. } else {
  2211. target22 = instance.proxy;
  2212. }
  2213. if (target22 && targetPath) {
  2214. if (state.type === "object" && type === "reactive") {
  2215. }
  2216. stateEditor2.set(target22, targetPath, state.value, stateEditor2.createDefaultSetCallback(state));
  2217. }
  2218. }
  2219. var stateEditor = new StateEditor();
  2220. async function editState(payload) {
  2221. editComponentState(payload, stateEditor);
  2222. }
  2223. // src/core/open-in-editor/index.ts
  2224. init_esm_shims();
  2225. import { target as target5 } from "@vue/devtools-shared";
  2226. // src/ctx/state.ts
  2227. init_esm_shims();
  2228. import { target as global, isUrlString } from "@vue/devtools-shared";
  2229. import { debounce as debounce3 } from "perfect-debounce";
  2230. // src/core/timeline/storage.ts
  2231. init_esm_shims();
  2232. import { isBrowser } from "@vue/devtools-shared";
  2233. var TIMELINE_LAYERS_STATE_STORAGE_ID = "__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";
  2234. function addTimelineLayersStateToStorage(state) {
  2235. if (!isBrowser || typeof localStorage === "undefined" || localStorage === null) {
  2236. return;
  2237. }
  2238. localStorage.setItem(TIMELINE_LAYERS_STATE_STORAGE_ID, JSON.stringify(state));
  2239. }
  2240. function getTimelineLayersStateFromStorage() {
  2241. if (!isBrowser || typeof localStorage === "undefined" || localStorage === null) {
  2242. return {
  2243. recordingState: false,
  2244. mouseEventEnabled: false,
  2245. keyboardEventEnabled: false,
  2246. componentEventEnabled: false,
  2247. performanceEventEnabled: false,
  2248. selected: ""
  2249. };
  2250. }
  2251. const state = localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID);
  2252. return state ? JSON.parse(state) : {
  2253. recordingState: false,
  2254. mouseEventEnabled: false,
  2255. keyboardEventEnabled: false,
  2256. componentEventEnabled: false,
  2257. performanceEventEnabled: false,
  2258. selected: ""
  2259. };
  2260. }
  2261. // src/ctx/hook.ts
  2262. init_esm_shims();
  2263. import { createHooks } from "hookable";
  2264. import { debounce as debounce2 } from "perfect-debounce";
  2265. // src/ctx/inspector.ts
  2266. init_esm_shims();
  2267. import { target as target4 } from "@vue/devtools-shared";
  2268. import { debounce } from "perfect-debounce";
  2269. // src/ctx/timeline.ts
  2270. init_esm_shims();
  2271. import { target as target3 } from "@vue/devtools-shared";
  2272. var _a2, _b2;
  2273. (_b2 = (_a2 = target3).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS) != null ? _b2 : _a2.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS = [];
  2274. var devtoolsTimelineLayers = new Proxy(target3.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS, {
  2275. get(target22, prop, receiver) {
  2276. return Reflect.get(target22, prop, receiver);
  2277. }
  2278. });
  2279. function addTimelineLayer(options, descriptor) {
  2280. devtoolsState.timelineLayersState[descriptor.id] = false;
  2281. devtoolsTimelineLayers.push({
  2282. ...options,
  2283. descriptorId: descriptor.id,
  2284. appRecord: getAppRecord(descriptor.app)
  2285. });
  2286. }
  2287. function updateTimelineLayersState(state) {
  2288. const updatedState = {
  2289. ...devtoolsState.timelineLayersState,
  2290. ...state
  2291. };
  2292. addTimelineLayersStateToStorage(updatedState);
  2293. updateDevToolsState({
  2294. timelineLayersState: updatedState
  2295. });
  2296. }
  2297. // src/ctx/inspector.ts
  2298. var _a3, _b3;
  2299. (_b3 = (_a3 = target4).__VUE_DEVTOOLS_KIT_INSPECTOR__) != null ? _b3 : _a3.__VUE_DEVTOOLS_KIT_INSPECTOR__ = [];
  2300. var devtoolsInspector = new Proxy(target4.__VUE_DEVTOOLS_KIT_INSPECTOR__, {
  2301. get(target22, prop, receiver) {
  2302. return Reflect.get(target22, prop, receiver);
  2303. }
  2304. });
  2305. var callInspectorUpdatedHook = debounce(() => {
  2306. devtoolsContext.hooks.callHook("sendInspectorToClient" /* SEND_INSPECTOR_TO_CLIENT */, getActiveInspectors());
  2307. });
  2308. function addInspector(inspector, descriptor) {
  2309. var _a25, _b25;
  2310. devtoolsInspector.push({
  2311. options: inspector,
  2312. descriptor,
  2313. treeFilterPlaceholder: (_a25 = inspector.treeFilterPlaceholder) != null ? _a25 : "Search tree...",
  2314. stateFilterPlaceholder: (_b25 = inspector.stateFilterPlaceholder) != null ? _b25 : "Search state...",
  2315. treeFilter: "",
  2316. selectedNodeId: "",
  2317. appRecord: getAppRecord(descriptor.app)
  2318. });
  2319. callInspectorUpdatedHook();
  2320. }
  2321. function getActiveInspectors() {
  2322. return devtoolsInspector.filter((inspector) => inspector.descriptor.app === activeAppRecord.value.app).filter((inspector) => inspector.descriptor.id !== "components").map((inspector) => {
  2323. var _a25;
  2324. const descriptor = inspector.descriptor;
  2325. const options = inspector.options;
  2326. return {
  2327. id: options.id,
  2328. label: options.label,
  2329. logo: descriptor.logo,
  2330. icon: `custom-ic-baseline-${(_a25 = options == null ? void 0 : options.icon) == null ? void 0 : _a25.replace(/_/g, "-")}`,
  2331. packageName: descriptor.packageName,
  2332. homepage: descriptor.homepage,
  2333. pluginId: descriptor.id
  2334. };
  2335. });
  2336. }
  2337. function getInspectorInfo(id) {
  2338. const inspector = getInspector(id, activeAppRecord.value.app);
  2339. if (!inspector)
  2340. return;
  2341. const descriptor = inspector.descriptor;
  2342. const options = inspector.options;
  2343. const timelineLayers = devtoolsTimelineLayers.filter((layer) => layer.descriptorId === descriptor.id).map((item) => ({
  2344. id: item.id,
  2345. label: item.label,
  2346. color: item.color
  2347. }));
  2348. return {
  2349. id: options.id,
  2350. label: options.label,
  2351. logo: descriptor.logo,
  2352. packageName: descriptor.packageName,
  2353. homepage: descriptor.homepage,
  2354. timelineLayers,
  2355. treeFilterPlaceholder: inspector.treeFilterPlaceholder,
  2356. stateFilterPlaceholder: inspector.stateFilterPlaceholder
  2357. };
  2358. }
  2359. function getInspector(id, app) {
  2360. return devtoolsInspector.find((inspector) => inspector.options.id === id && (app ? inspector.descriptor.app === app : true));
  2361. }
  2362. function getInspectorActions(id) {
  2363. const inspector = getInspector(id);
  2364. return inspector == null ? void 0 : inspector.options.actions;
  2365. }
  2366. function getInspectorNodeActions(id) {
  2367. const inspector = getInspector(id);
  2368. return inspector == null ? void 0 : inspector.options.nodeActions;
  2369. }
  2370. // src/ctx/hook.ts
  2371. var DevToolsV6PluginAPIHookKeys = /* @__PURE__ */ ((DevToolsV6PluginAPIHookKeys2) => {
  2372. DevToolsV6PluginAPIHookKeys2["VISIT_COMPONENT_TREE"] = "visitComponentTree";
  2373. DevToolsV6PluginAPIHookKeys2["INSPECT_COMPONENT"] = "inspectComponent";
  2374. DevToolsV6PluginAPIHookKeys2["EDIT_COMPONENT_STATE"] = "editComponentState";
  2375. DevToolsV6PluginAPIHookKeys2["GET_INSPECTOR_TREE"] = "getInspectorTree";
  2376. DevToolsV6PluginAPIHookKeys2["GET_INSPECTOR_STATE"] = "getInspectorState";
  2377. DevToolsV6PluginAPIHookKeys2["EDIT_INSPECTOR_STATE"] = "editInspectorState";
  2378. DevToolsV6PluginAPIHookKeys2["INSPECT_TIMELINE_EVENT"] = "inspectTimelineEvent";
  2379. DevToolsV6PluginAPIHookKeys2["TIMELINE_CLEARED"] = "timelineCleared";
  2380. DevToolsV6PluginAPIHookKeys2["SET_PLUGIN_SETTINGS"] = "setPluginSettings";
  2381. return DevToolsV6PluginAPIHookKeys2;
  2382. })(DevToolsV6PluginAPIHookKeys || {});
  2383. var DevToolsContextHookKeys = /* @__PURE__ */ ((DevToolsContextHookKeys2) => {
  2384. DevToolsContextHookKeys2["ADD_INSPECTOR"] = "addInspector";
  2385. DevToolsContextHookKeys2["SEND_INSPECTOR_TREE"] = "sendInspectorTree";
  2386. DevToolsContextHookKeys2["SEND_INSPECTOR_STATE"] = "sendInspectorState";
  2387. DevToolsContextHookKeys2["CUSTOM_INSPECTOR_SELECT_NODE"] = "customInspectorSelectNode";
  2388. DevToolsContextHookKeys2["TIMELINE_LAYER_ADDED"] = "timelineLayerAdded";
  2389. DevToolsContextHookKeys2["TIMELINE_EVENT_ADDED"] = "timelineEventAdded";
  2390. DevToolsContextHookKeys2["GET_COMPONENT_INSTANCES"] = "getComponentInstances";
  2391. DevToolsContextHookKeys2["GET_COMPONENT_BOUNDS"] = "getComponentBounds";
  2392. DevToolsContextHookKeys2["GET_COMPONENT_NAME"] = "getComponentName";
  2393. DevToolsContextHookKeys2["COMPONENT_HIGHLIGHT"] = "componentHighlight";
  2394. DevToolsContextHookKeys2["COMPONENT_UNHIGHLIGHT"] = "componentUnhighlight";
  2395. return DevToolsContextHookKeys2;
  2396. })(DevToolsContextHookKeys || {});
  2397. var DevToolsMessagingHookKeys = /* @__PURE__ */ ((DevToolsMessagingHookKeys2) => {
  2398. DevToolsMessagingHookKeys2["SEND_INSPECTOR_TREE_TO_CLIENT"] = "sendInspectorTreeToClient";
  2399. DevToolsMessagingHookKeys2["SEND_INSPECTOR_STATE_TO_CLIENT"] = "sendInspectorStateToClient";
  2400. DevToolsMessagingHookKeys2["SEND_TIMELINE_EVENT_TO_CLIENT"] = "sendTimelineEventToClient";
  2401. DevToolsMessagingHookKeys2["SEND_INSPECTOR_TO_CLIENT"] = "sendInspectorToClient";
  2402. DevToolsMessagingHookKeys2["SEND_ACTIVE_APP_UNMOUNTED_TO_CLIENT"] = "sendActiveAppUpdatedToClient";
  2403. DevToolsMessagingHookKeys2["DEVTOOLS_STATE_UPDATED"] = "devtoolsStateUpdated";
  2404. DevToolsMessagingHookKeys2["DEVTOOLS_CONNECTED_UPDATED"] = "devtoolsConnectedUpdated";
  2405. DevToolsMessagingHookKeys2["ROUTER_INFO_UPDATED"] = "routerInfoUpdated";
  2406. return DevToolsMessagingHookKeys2;
  2407. })(DevToolsMessagingHookKeys || {});
  2408. function createDevToolsCtxHooks() {
  2409. const hooks2 = createHooks();
  2410. hooks2.hook("addInspector" /* ADD_INSPECTOR */, ({ inspector, plugin }) => {
  2411. addInspector(inspector, plugin.descriptor);
  2412. });
  2413. const debounceSendInspectorTree = debounce2(async ({ inspectorId, plugin }) => {
  2414. var _a25;
  2415. if (!inspectorId || !((_a25 = plugin == null ? void 0 : plugin.descriptor) == null ? void 0 : _a25.app) || devtoolsState.highPerfModeEnabled)
  2416. return;
  2417. const inspector = getInspector(inspectorId, plugin.descriptor.app);
  2418. const _payload = {
  2419. app: plugin.descriptor.app,
  2420. inspectorId,
  2421. filter: (inspector == null ? void 0 : inspector.treeFilter) || "",
  2422. rootNodes: []
  2423. };
  2424. await new Promise((resolve) => {
  2425. hooks2.callHookWith(async (callbacks) => {
  2426. await Promise.all(callbacks.map((cb) => cb(_payload)));
  2427. resolve();
  2428. }, "getInspectorTree" /* GET_INSPECTOR_TREE */);
  2429. });
  2430. hooks2.callHookWith(async (callbacks) => {
  2431. await Promise.all(callbacks.map((cb) => cb({
  2432. inspectorId,
  2433. rootNodes: _payload.rootNodes
  2434. })));
  2435. }, "sendInspectorTreeToClient" /* SEND_INSPECTOR_TREE_TO_CLIENT */);
  2436. }, 120);
  2437. hooks2.hook("sendInspectorTree" /* SEND_INSPECTOR_TREE */, debounceSendInspectorTree);
  2438. const debounceSendInspectorState = debounce2(async ({ inspectorId, plugin }) => {
  2439. var _a25;
  2440. if (!inspectorId || !((_a25 = plugin == null ? void 0 : plugin.descriptor) == null ? void 0 : _a25.app) || devtoolsState.highPerfModeEnabled)
  2441. return;
  2442. const inspector = getInspector(inspectorId, plugin.descriptor.app);
  2443. const _payload = {
  2444. app: plugin.descriptor.app,
  2445. inspectorId,
  2446. nodeId: (inspector == null ? void 0 : inspector.selectedNodeId) || "",
  2447. state: null
  2448. };
  2449. const ctx = {
  2450. currentTab: `custom-inspector:${inspectorId}`
  2451. };
  2452. if (_payload.nodeId) {
  2453. await new Promise((resolve) => {
  2454. hooks2.callHookWith(async (callbacks) => {
  2455. await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));
  2456. resolve();
  2457. }, "getInspectorState" /* GET_INSPECTOR_STATE */);
  2458. });
  2459. }
  2460. hooks2.callHookWith(async (callbacks) => {
  2461. await Promise.all(callbacks.map((cb) => cb({
  2462. inspectorId,
  2463. nodeId: _payload.nodeId,
  2464. state: _payload.state
  2465. })));
  2466. }, "sendInspectorStateToClient" /* SEND_INSPECTOR_STATE_TO_CLIENT */);
  2467. }, 120);
  2468. hooks2.hook("sendInspectorState" /* SEND_INSPECTOR_STATE */, debounceSendInspectorState);
  2469. hooks2.hook("customInspectorSelectNode" /* CUSTOM_INSPECTOR_SELECT_NODE */, ({ inspectorId, nodeId, plugin }) => {
  2470. const inspector = getInspector(inspectorId, plugin.descriptor.app);
  2471. if (!inspector)
  2472. return;
  2473. inspector.selectedNodeId = nodeId;
  2474. });
  2475. hooks2.hook("timelineLayerAdded" /* TIMELINE_LAYER_ADDED */, ({ options, plugin }) => {
  2476. addTimelineLayer(options, plugin.descriptor);
  2477. });
  2478. hooks2.hook("timelineEventAdded" /* TIMELINE_EVENT_ADDED */, ({ options, plugin }) => {
  2479. var _a25;
  2480. const internalLayerIds = ["performance", "component-event", "keyboard", "mouse"];
  2481. if (devtoolsState.highPerfModeEnabled || !((_a25 = devtoolsState.timelineLayersState) == null ? void 0 : _a25[plugin.descriptor.id]) && !internalLayerIds.includes(options.layerId))
  2482. return;
  2483. hooks2.callHookWith(async (callbacks) => {
  2484. await Promise.all(callbacks.map((cb) => cb(options)));
  2485. }, "sendTimelineEventToClient" /* SEND_TIMELINE_EVENT_TO_CLIENT */);
  2486. });
  2487. hooks2.hook("getComponentInstances" /* GET_COMPONENT_INSTANCES */, async ({ app }) => {
  2488. const appRecord = app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
  2489. if (!appRecord)
  2490. return null;
  2491. const appId = appRecord.id.toString();
  2492. const instances = [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
  2493. return instances;
  2494. });
  2495. hooks2.hook("getComponentBounds" /* GET_COMPONENT_BOUNDS */, async ({ instance }) => {
  2496. const bounds = getComponentBoundingRect(instance);
  2497. return bounds;
  2498. });
  2499. hooks2.hook("getComponentName" /* GET_COMPONENT_NAME */, ({ instance }) => {
  2500. const name = getInstanceName(instance);
  2501. return name;
  2502. });
  2503. hooks2.hook("componentHighlight" /* COMPONENT_HIGHLIGHT */, ({ uid }) => {
  2504. const instance = activeAppRecord.value.instanceMap.get(uid);
  2505. if (instance) {
  2506. highlight(instance);
  2507. }
  2508. });
  2509. hooks2.hook("componentUnhighlight" /* COMPONENT_UNHIGHLIGHT */, () => {
  2510. unhighlight();
  2511. });
  2512. return hooks2;
  2513. }
  2514. // src/ctx/state.ts
  2515. var _a4, _b4;
  2516. (_b4 = (_a4 = global).__VUE_DEVTOOLS_KIT_APP_RECORDS__) != null ? _b4 : _a4.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [];
  2517. var _a5, _b5;
  2518. (_b5 = (_a5 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__) != null ? _b5 : _a5.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = {};
  2519. var _a6, _b6;
  2520. (_b6 = (_a6 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__) != null ? _b6 : _a6.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = "";
  2521. var _a7, _b7;
  2522. (_b7 = (_a7 = global).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__) != null ? _b7 : _a7.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ = [];
  2523. var _a8, _b8;
  2524. (_b8 = (_a8 = global).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__) != null ? _b8 : _a8.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ = [];
  2525. var STATE_KEY = "__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";
  2526. function initStateFactory() {
  2527. return {
  2528. connected: false,
  2529. clientConnected: false,
  2530. vitePluginDetected: true,
  2531. appRecords: [],
  2532. activeAppRecordId: "",
  2533. tabs: [],
  2534. commands: [],
  2535. highPerfModeEnabled: true,
  2536. devtoolsClientDetected: {},
  2537. perfUniqueGroupId: 0,
  2538. timelineLayersState: getTimelineLayersStateFromStorage()
  2539. };
  2540. }
  2541. var _a9, _b9;
  2542. (_b9 = (_a9 = global)[STATE_KEY]) != null ? _b9 : _a9[STATE_KEY] = initStateFactory();
  2543. var callStateUpdatedHook = debounce3((state) => {
  2544. devtoolsContext.hooks.callHook("devtoolsStateUpdated" /* DEVTOOLS_STATE_UPDATED */, { state });
  2545. });
  2546. var callConnectedUpdatedHook = debounce3((state, oldState) => {
  2547. devtoolsContext.hooks.callHook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, { state, oldState });
  2548. });
  2549. var devtoolsAppRecords = new Proxy(global.__VUE_DEVTOOLS_KIT_APP_RECORDS__, {
  2550. get(_target, prop, receiver) {
  2551. if (prop === "value")
  2552. return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__;
  2553. return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__[prop];
  2554. }
  2555. });
  2556. var addDevToolsAppRecord = (app) => {
  2557. global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [
  2558. ...global.__VUE_DEVTOOLS_KIT_APP_RECORDS__,
  2559. app
  2560. ];
  2561. };
  2562. var removeDevToolsAppRecord = (app) => {
  2563. global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = devtoolsAppRecords.value.filter((record) => record.app !== app);
  2564. };
  2565. var activeAppRecord = new Proxy(global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__, {
  2566. get(_target, prop, receiver) {
  2567. if (prop === "value")
  2568. return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__;
  2569. else if (prop === "id")
  2570. return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__;
  2571. return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[prop];
  2572. }
  2573. });
  2574. function updateAllStates() {
  2575. callStateUpdatedHook({
  2576. ...global[STATE_KEY],
  2577. appRecords: devtoolsAppRecords.value,
  2578. activeAppRecordId: activeAppRecord.id,
  2579. tabs: global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,
  2580. commands: global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__
  2581. });
  2582. }
  2583. function setActiveAppRecord(app) {
  2584. global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = app;
  2585. updateAllStates();
  2586. }
  2587. function setActiveAppRecordId(id) {
  2588. global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = id;
  2589. updateAllStates();
  2590. }
  2591. var devtoolsState = new Proxy(global[STATE_KEY], {
  2592. get(target22, property) {
  2593. if (property === "appRecords") {
  2594. return devtoolsAppRecords;
  2595. } else if (property === "activeAppRecordId") {
  2596. return activeAppRecord.id;
  2597. } else if (property === "tabs") {
  2598. return global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
  2599. } else if (property === "commands") {
  2600. return global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
  2601. }
  2602. return global[STATE_KEY][property];
  2603. },
  2604. deleteProperty(target22, property) {
  2605. delete target22[property];
  2606. return true;
  2607. },
  2608. set(target22, property, value) {
  2609. const oldState = { ...global[STATE_KEY] };
  2610. target22[property] = value;
  2611. global[STATE_KEY][property] = value;
  2612. return true;
  2613. }
  2614. });
  2615. function resetDevToolsState() {
  2616. Object.assign(global[STATE_KEY], initStateFactory());
  2617. }
  2618. function updateDevToolsState(state) {
  2619. const oldState = {
  2620. ...global[STATE_KEY],
  2621. appRecords: devtoolsAppRecords.value,
  2622. activeAppRecordId: activeAppRecord.id
  2623. };
  2624. if (oldState.connected !== state.connected && state.connected || oldState.clientConnected !== state.clientConnected && state.clientConnected) {
  2625. callConnectedUpdatedHook(global[STATE_KEY], oldState);
  2626. }
  2627. Object.assign(global[STATE_KEY], state);
  2628. updateAllStates();
  2629. }
  2630. function onDevToolsConnected(fn) {
  2631. return new Promise((resolve) => {
  2632. if (devtoolsState.connected) {
  2633. fn();
  2634. resolve();
  2635. }
  2636. devtoolsContext.hooks.hook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, ({ state }) => {
  2637. if (state.connected) {
  2638. fn();
  2639. resolve();
  2640. }
  2641. });
  2642. });
  2643. }
  2644. var resolveIcon = (icon) => {
  2645. if (!icon)
  2646. return;
  2647. if (icon.startsWith("baseline-")) {
  2648. return `custom-ic-${icon}`;
  2649. }
  2650. if (icon.startsWith("i-") || isUrlString(icon))
  2651. return icon;
  2652. return `custom-ic-baseline-${icon}`;
  2653. };
  2654. function addCustomTab(tab) {
  2655. const tabs = global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
  2656. if (tabs.some((t) => t.name === tab.name))
  2657. return;
  2658. tabs.push({
  2659. ...tab,
  2660. icon: resolveIcon(tab.icon)
  2661. });
  2662. updateAllStates();
  2663. }
  2664. function addCustomCommand(action) {
  2665. const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
  2666. if (commands.some((t) => t.id === action.id))
  2667. return;
  2668. commands.push({
  2669. ...action,
  2670. icon: resolveIcon(action.icon),
  2671. children: action.children ? action.children.map((child) => ({
  2672. ...child,
  2673. icon: resolveIcon(child.icon)
  2674. })) : void 0
  2675. });
  2676. updateAllStates();
  2677. }
  2678. function removeCustomCommand(actionId) {
  2679. const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
  2680. const index = commands.findIndex((t) => t.id === actionId);
  2681. if (index === -1)
  2682. return;
  2683. commands.splice(index, 1);
  2684. updateAllStates();
  2685. }
  2686. function toggleClientConnected(state) {
  2687. updateDevToolsState({ clientConnected: state });
  2688. }
  2689. // src/core/open-in-editor/index.ts
  2690. function setOpenInEditorBaseUrl(url) {
  2691. target5.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__ = url;
  2692. }
  2693. function openInEditor(options = {}) {
  2694. var _a25, _b25, _c;
  2695. const { file, host, baseUrl = window.location.origin, line = 0, column = 0 } = options;
  2696. if (file) {
  2697. if (host === "chrome-extension") {
  2698. const fileName = file.replace(/\\/g, "\\\\");
  2699. const _baseUrl = (_b25 = (_a25 = window.VUE_DEVTOOLS_CONFIG) == null ? void 0 : _a25.openInEditorHost) != null ? _b25 : "/";
  2700. fetch(`${_baseUrl}__open-in-editor?file=${encodeURI(file)}`).then((response) => {
  2701. if (!response.ok) {
  2702. const msg = `Opening component ${fileName} failed`;
  2703. console.log(`%c${msg}`, "color:red");
  2704. }
  2705. });
  2706. } else if (devtoolsState.vitePluginDetected) {
  2707. const _baseUrl = (_c = target5.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__) != null ? _c : baseUrl;
  2708. target5.__VUE_INSPECTOR__.openInEditor(_baseUrl, file, line, column);
  2709. }
  2710. }
  2711. }
  2712. // src/core/plugin/index.ts
  2713. init_esm_shims();
  2714. import { target as target8 } from "@vue/devtools-shared";
  2715. // src/api/index.ts
  2716. init_esm_shims();
  2717. // src/api/v6/index.ts
  2718. init_esm_shims();
  2719. // src/core/plugin/plugin-settings.ts
  2720. init_esm_shims();
  2721. // src/ctx/plugin.ts
  2722. init_esm_shims();
  2723. import { target as target6 } from "@vue/devtools-shared";
  2724. var _a10, _b10;
  2725. (_b10 = (_a10 = target6).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__) != null ? _b10 : _a10.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ = [];
  2726. var devtoolsPluginBuffer = new Proxy(target6.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__, {
  2727. get(target22, prop, receiver) {
  2728. return Reflect.get(target22, prop, receiver);
  2729. }
  2730. });
  2731. function addDevToolsPluginToBuffer(pluginDescriptor, setupFn) {
  2732. devtoolsPluginBuffer.push([pluginDescriptor, setupFn]);
  2733. }
  2734. // src/core/plugin/plugin-settings.ts
  2735. function _getSettings(settings) {
  2736. const _settings = {};
  2737. Object.keys(settings).forEach((key) => {
  2738. _settings[key] = settings[key].defaultValue;
  2739. });
  2740. return _settings;
  2741. }
  2742. function getPluginLocalKey(pluginId) {
  2743. return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;
  2744. }
  2745. function getPluginSettingsOptions(pluginId) {
  2746. var _a25, _b25, _c;
  2747. const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => {
  2748. var _a26;
  2749. return item2[0].id === pluginId && !!((_a26 = item2[0]) == null ? void 0 : _a26.settings);
  2750. })) == null ? void 0 : _a25[0]) != null ? _b25 : null;
  2751. return (_c = item == null ? void 0 : item.settings) != null ? _c : null;
  2752. }
  2753. function getPluginSettings(pluginId, fallbackValue) {
  2754. var _a25, _b25, _c;
  2755. const localKey = getPluginLocalKey(pluginId);
  2756. if (localKey) {
  2757. const localSettings = localStorage.getItem(localKey);
  2758. if (localSettings) {
  2759. return JSON.parse(localSettings);
  2760. }
  2761. }
  2762. if (pluginId) {
  2763. const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => item2[0].id === pluginId)) == null ? void 0 : _a25[0]) != null ? _b25 : null;
  2764. return _getSettings((_c = item == null ? void 0 : item.settings) != null ? _c : {});
  2765. }
  2766. return _getSettings(fallbackValue);
  2767. }
  2768. function initPluginSettings(pluginId, settings) {
  2769. const localKey = getPluginLocalKey(pluginId);
  2770. const localSettings = localStorage.getItem(localKey);
  2771. if (!localSettings) {
  2772. localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
  2773. }
  2774. }
  2775. function setPluginSettings(pluginId, key, value) {
  2776. const localKey = getPluginLocalKey(pluginId);
  2777. const localSettings = localStorage.getItem(localKey);
  2778. const parsedLocalSettings = JSON.parse(localSettings || "{}");
  2779. const updated = {
  2780. ...parsedLocalSettings,
  2781. [key]: value
  2782. };
  2783. localStorage.setItem(localKey, JSON.stringify(updated));
  2784. devtoolsContext.hooks.callHookWith((callbacks) => {
  2785. callbacks.forEach((cb) => cb({
  2786. pluginId,
  2787. key,
  2788. oldValue: parsedLocalSettings[key],
  2789. newValue: value,
  2790. settings: updated
  2791. }));
  2792. }, "setPluginSettings" /* SET_PLUGIN_SETTINGS */);
  2793. }
  2794. // src/hook/index.ts
  2795. init_esm_shims();
  2796. import { target as target7 } from "@vue/devtools-shared";
  2797. import { createHooks as createHooks2 } from "hookable";
  2798. // src/types/index.ts
  2799. init_esm_shims();
  2800. // src/types/app.ts
  2801. init_esm_shims();
  2802. // src/types/command.ts
  2803. init_esm_shims();
  2804. // src/types/component.ts
  2805. init_esm_shims();
  2806. // src/types/hook.ts
  2807. init_esm_shims();
  2808. // src/types/inspector.ts
  2809. init_esm_shims();
  2810. // src/types/plugin.ts
  2811. init_esm_shims();
  2812. // src/types/router.ts
  2813. init_esm_shims();
  2814. // src/types/tab.ts
  2815. init_esm_shims();
  2816. // src/types/timeline.ts
  2817. init_esm_shims();
  2818. // src/hook/index.ts
  2819. var _a11, _b11;
  2820. var devtoolsHooks = (_b11 = (_a11 = target7).__VUE_DEVTOOLS_HOOK) != null ? _b11 : _a11.__VUE_DEVTOOLS_HOOK = createHooks2();
  2821. var on = {
  2822. vueAppInit(fn) {
  2823. devtoolsHooks.hook("app:init" /* APP_INIT */, fn);
  2824. },
  2825. vueAppUnmount(fn) {
  2826. devtoolsHooks.hook("app:unmount" /* APP_UNMOUNT */, fn);
  2827. },
  2828. vueAppConnected(fn) {
  2829. devtoolsHooks.hook("app:connected" /* APP_CONNECTED */, fn);
  2830. },
  2831. componentAdded(fn) {
  2832. return devtoolsHooks.hook("component:added" /* COMPONENT_ADDED */, fn);
  2833. },
  2834. componentEmit(fn) {
  2835. return devtoolsHooks.hook("component:emit" /* COMPONENT_EMIT */, fn);
  2836. },
  2837. componentUpdated(fn) {
  2838. return devtoolsHooks.hook("component:updated" /* COMPONENT_UPDATED */, fn);
  2839. },
  2840. componentRemoved(fn) {
  2841. return devtoolsHooks.hook("component:removed" /* COMPONENT_REMOVED */, fn);
  2842. },
  2843. setupDevtoolsPlugin(fn) {
  2844. devtoolsHooks.hook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, fn);
  2845. },
  2846. perfStart(fn) {
  2847. return devtoolsHooks.hook("perf:start" /* PERFORMANCE_START */, fn);
  2848. },
  2849. perfEnd(fn) {
  2850. return devtoolsHooks.hook("perf:end" /* PERFORMANCE_END */, fn);
  2851. }
  2852. };
  2853. function createDevToolsHook() {
  2854. return {
  2855. id: "vue-devtools-next",
  2856. devtoolsVersion: "7.0",
  2857. enabled: false,
  2858. appRecords: [],
  2859. apps: [],
  2860. events: /* @__PURE__ */ new Map(),
  2861. on(event, fn) {
  2862. var _a25;
  2863. if (!this.events.has(event))
  2864. this.events.set(event, []);
  2865. (_a25 = this.events.get(event)) == null ? void 0 : _a25.push(fn);
  2866. return () => this.off(event, fn);
  2867. },
  2868. once(event, fn) {
  2869. const onceFn = (...args) => {
  2870. this.off(event, onceFn);
  2871. fn(...args);
  2872. };
  2873. this.on(event, onceFn);
  2874. return [event, onceFn];
  2875. },
  2876. off(event, fn) {
  2877. if (this.events.has(event)) {
  2878. const eventCallbacks = this.events.get(event);
  2879. const index = eventCallbacks.indexOf(fn);
  2880. if (index !== -1)
  2881. eventCallbacks.splice(index, 1);
  2882. }
  2883. },
  2884. emit(event, ...payload) {
  2885. if (this.events.has(event))
  2886. this.events.get(event).forEach((fn) => fn(...payload));
  2887. }
  2888. };
  2889. }
  2890. function subscribeDevToolsHook(hook2) {
  2891. hook2.on("app:init" /* APP_INIT */, (app, version, types) => {
  2892. var _a25, _b25, _c;
  2893. if ((_c = (_b25 = (_a25 = app == null ? void 0 : app._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)
  2894. return;
  2895. devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version, types);
  2896. });
  2897. hook2.on("app:unmount" /* APP_UNMOUNT */, (app) => {
  2898. devtoolsHooks.callHook("app:unmount" /* APP_UNMOUNT */, app);
  2899. });
  2900. hook2.on("component:added" /* COMPONENT_ADDED */, async (app, uid, parentUid, component) => {
  2901. var _a25, _b25, _c;
  2902. if (((_c = (_b25 = (_a25 = app == null ? void 0 : app._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide) || devtoolsState.highPerfModeEnabled)
  2903. return;
  2904. if (!app || typeof uid !== "number" && !uid || !component)
  2905. return;
  2906. devtoolsHooks.callHook("component:added" /* COMPONENT_ADDED */, app, uid, parentUid, component);
  2907. });
  2908. hook2.on("component:updated" /* COMPONENT_UPDATED */, (app, uid, parentUid, component) => {
  2909. if (!app || typeof uid !== "number" && !uid || !component || devtoolsState.highPerfModeEnabled)
  2910. return;
  2911. devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, app, uid, parentUid, component);
  2912. });
  2913. hook2.on("component:removed" /* COMPONENT_REMOVED */, async (app, uid, parentUid, component) => {
  2914. if (!app || typeof uid !== "number" && !uid || !component || devtoolsState.highPerfModeEnabled)
  2915. return;
  2916. devtoolsHooks.callHook("component:removed" /* COMPONENT_REMOVED */, app, uid, parentUid, component);
  2917. });
  2918. hook2.on("component:emit" /* COMPONENT_EMIT */, async (app, instance, event, params) => {
  2919. if (!app || !instance || devtoolsState.highPerfModeEnabled)
  2920. return;
  2921. devtoolsHooks.callHook("component:emit" /* COMPONENT_EMIT */, app, instance, event, params);
  2922. });
  2923. hook2.on("perf:start" /* PERFORMANCE_START */, (app, uid, vm, type, time) => {
  2924. if (!app || devtoolsState.highPerfModeEnabled)
  2925. return;
  2926. devtoolsHooks.callHook("perf:start" /* PERFORMANCE_START */, app, uid, vm, type, time);
  2927. });
  2928. hook2.on("perf:end" /* PERFORMANCE_END */, (app, uid, vm, type, time) => {
  2929. if (!app || devtoolsState.highPerfModeEnabled)
  2930. return;
  2931. devtoolsHooks.callHook("perf:end" /* PERFORMANCE_END */, app, uid, vm, type, time);
  2932. });
  2933. hook2.on("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, (pluginDescriptor, setupFn, options) => {
  2934. if ((options == null ? void 0 : options.target) === "legacy")
  2935. return;
  2936. devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
  2937. });
  2938. }
  2939. var hook = {
  2940. on,
  2941. setupDevToolsPlugin(pluginDescriptor, setupFn) {
  2942. return devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
  2943. }
  2944. };
  2945. // src/api/v6/index.ts
  2946. var DevToolsV6PluginAPI = class {
  2947. constructor({ plugin, ctx }) {
  2948. this.hooks = ctx.hooks;
  2949. this.plugin = plugin;
  2950. }
  2951. get on() {
  2952. return {
  2953. // component inspector
  2954. visitComponentTree: (handler) => {
  2955. this.hooks.hook("visitComponentTree" /* VISIT_COMPONENT_TREE */, handler);
  2956. },
  2957. inspectComponent: (handler) => {
  2958. this.hooks.hook("inspectComponent" /* INSPECT_COMPONENT */, handler);
  2959. },
  2960. editComponentState: (handler) => {
  2961. this.hooks.hook("editComponentState" /* EDIT_COMPONENT_STATE */, handler);
  2962. },
  2963. // custom inspector
  2964. getInspectorTree: (handler) => {
  2965. this.hooks.hook("getInspectorTree" /* GET_INSPECTOR_TREE */, handler);
  2966. },
  2967. getInspectorState: (handler) => {
  2968. this.hooks.hook("getInspectorState" /* GET_INSPECTOR_STATE */, handler);
  2969. },
  2970. editInspectorState: (handler) => {
  2971. this.hooks.hook("editInspectorState" /* EDIT_INSPECTOR_STATE */, handler);
  2972. },
  2973. // timeline
  2974. inspectTimelineEvent: (handler) => {
  2975. this.hooks.hook("inspectTimelineEvent" /* INSPECT_TIMELINE_EVENT */, handler);
  2976. },
  2977. timelineCleared: (handler) => {
  2978. this.hooks.hook("timelineCleared" /* TIMELINE_CLEARED */, handler);
  2979. },
  2980. // settings
  2981. setPluginSettings: (handler) => {
  2982. this.hooks.hook("setPluginSettings" /* SET_PLUGIN_SETTINGS */, handler);
  2983. }
  2984. };
  2985. }
  2986. // component inspector
  2987. notifyComponentUpdate(instance) {
  2988. var _a25;
  2989. if (devtoolsState.highPerfModeEnabled) {
  2990. return;
  2991. }
  2992. const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);
  2993. if (inspector == null ? void 0 : inspector.id) {
  2994. if (instance) {
  2995. const args = [
  2996. instance.appContext.app,
  2997. instance.uid,
  2998. (_a25 = instance.parent) == null ? void 0 : _a25.uid,
  2999. instance
  3000. ];
  3001. devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, ...args);
  3002. } else {
  3003. devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */);
  3004. }
  3005. this.hooks.callHook("sendInspectorState" /* SEND_INSPECTOR_STATE */, { inspectorId: inspector.id, plugin: this.plugin });
  3006. }
  3007. }
  3008. // custom inspector
  3009. addInspector(options) {
  3010. this.hooks.callHook("addInspector" /* ADD_INSPECTOR */, { inspector: options, plugin: this.plugin });
  3011. if (this.plugin.descriptor.settings) {
  3012. initPluginSettings(options.id, this.plugin.descriptor.settings);
  3013. }
  3014. }
  3015. sendInspectorTree(inspectorId) {
  3016. if (devtoolsState.highPerfModeEnabled) {
  3017. return;
  3018. }
  3019. this.hooks.callHook("sendInspectorTree" /* SEND_INSPECTOR_TREE */, { inspectorId, plugin: this.plugin });
  3020. }
  3021. sendInspectorState(inspectorId) {
  3022. if (devtoolsState.highPerfModeEnabled) {
  3023. return;
  3024. }
  3025. this.hooks.callHook("sendInspectorState" /* SEND_INSPECTOR_STATE */, { inspectorId, plugin: this.plugin });
  3026. }
  3027. selectInspectorNode(inspectorId, nodeId) {
  3028. this.hooks.callHook("customInspectorSelectNode" /* CUSTOM_INSPECTOR_SELECT_NODE */, { inspectorId, nodeId, plugin: this.plugin });
  3029. }
  3030. visitComponentTree(payload) {
  3031. return this.hooks.callHook("visitComponentTree" /* VISIT_COMPONENT_TREE */, payload);
  3032. }
  3033. // timeline
  3034. now() {
  3035. if (devtoolsState.highPerfModeEnabled) {
  3036. return 0;
  3037. }
  3038. return Date.now();
  3039. }
  3040. addTimelineLayer(options) {
  3041. this.hooks.callHook("timelineLayerAdded" /* TIMELINE_LAYER_ADDED */, { options, plugin: this.plugin });
  3042. }
  3043. addTimelineEvent(options) {
  3044. if (devtoolsState.highPerfModeEnabled) {
  3045. return;
  3046. }
  3047. this.hooks.callHook("timelineEventAdded" /* TIMELINE_EVENT_ADDED */, { options, plugin: this.plugin });
  3048. }
  3049. // settings
  3050. getSettings(pluginId) {
  3051. return getPluginSettings(pluginId != null ? pluginId : this.plugin.descriptor.id, this.plugin.descriptor.settings);
  3052. }
  3053. // utilities
  3054. getComponentInstances(app) {
  3055. return this.hooks.callHook("getComponentInstances" /* GET_COMPONENT_INSTANCES */, { app });
  3056. }
  3057. getComponentBounds(instance) {
  3058. return this.hooks.callHook("getComponentBounds" /* GET_COMPONENT_BOUNDS */, { instance });
  3059. }
  3060. getComponentName(instance) {
  3061. return this.hooks.callHook("getComponentName" /* GET_COMPONENT_NAME */, { instance });
  3062. }
  3063. highlightElement(instance) {
  3064. const uid = instance.__VUE_DEVTOOLS_NEXT_UID__;
  3065. return this.hooks.callHook("componentHighlight" /* COMPONENT_HIGHLIGHT */, { uid });
  3066. }
  3067. unhighlightElement() {
  3068. return this.hooks.callHook("componentUnhighlight" /* COMPONENT_UNHIGHLIGHT */);
  3069. }
  3070. };
  3071. // src/api/index.ts
  3072. var DevToolsPluginAPI = DevToolsV6PluginAPI;
  3073. // src/core/plugin/components.ts
  3074. init_esm_shims();
  3075. import { debounce as debounce4 } from "perfect-debounce";
  3076. // src/core/component/state/index.ts
  3077. init_esm_shims();
  3078. // src/core/component/state/process.ts
  3079. init_esm_shims();
  3080. import { camelize } from "@vue/devtools-shared";
  3081. // src/core/component/state/constants.ts
  3082. init_esm_shims();
  3083. var vueBuiltins = /* @__PURE__ */ new Set([
  3084. "nextTick",
  3085. "defineComponent",
  3086. "defineAsyncComponent",
  3087. "defineCustomElement",
  3088. "ref",
  3089. "computed",
  3090. "reactive",
  3091. "readonly",
  3092. "watchEffect",
  3093. "watchPostEffect",
  3094. "watchSyncEffect",
  3095. "watch",
  3096. "isRef",
  3097. "unref",
  3098. "toRef",
  3099. "toRefs",
  3100. "isProxy",
  3101. "isReactive",
  3102. "isReadonly",
  3103. "shallowRef",
  3104. "triggerRef",
  3105. "customRef",
  3106. "shallowReactive",
  3107. "shallowReadonly",
  3108. "toRaw",
  3109. "markRaw",
  3110. "effectScope",
  3111. "getCurrentScope",
  3112. "onScopeDispose",
  3113. "onMounted",
  3114. "onUpdated",
  3115. "onUnmounted",
  3116. "onBeforeMount",
  3117. "onBeforeUpdate",
  3118. "onBeforeUnmount",
  3119. "onErrorCaptured",
  3120. "onRenderTracked",
  3121. "onRenderTriggered",
  3122. "onActivated",
  3123. "onDeactivated",
  3124. "onServerPrefetch",
  3125. "provide",
  3126. "inject",
  3127. "h",
  3128. "mergeProps",
  3129. "cloneVNode",
  3130. "isVNode",
  3131. "resolveComponent",
  3132. "resolveDirective",
  3133. "withDirectives",
  3134. "withModifiers"
  3135. ]);
  3136. var symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/;
  3137. var rawTypeRE = /^\[object (\w+)\]$/;
  3138. var specialTypeRE = /^\[native (\w+) (.*?)(<>(([\s\S])*))?\]$/;
  3139. var fnTypeRE = /^(?:function|class) (\w+)/;
  3140. var MAX_STRING_SIZE = 1e4;
  3141. var MAX_ARRAY_SIZE = 5e3;
  3142. var UNDEFINED = "__vue_devtool_undefined__";
  3143. var INFINITY = "__vue_devtool_infinity__";
  3144. var NEGATIVE_INFINITY = "__vue_devtool_negative_infinity__";
  3145. var NAN = "__vue_devtool_nan__";
  3146. var ESC = {
  3147. "<": "&lt;",
  3148. ">": "&gt;",
  3149. '"': "&quot;",
  3150. "&": "&amp;"
  3151. };
  3152. // src/core/component/state/util.ts
  3153. init_esm_shims();
  3154. // src/core/component/state/is.ts
  3155. init_esm_shims();
  3156. function isVueInstance(value) {
  3157. if (!ensurePropertyExists(value, "_")) {
  3158. return false;
  3159. }
  3160. if (!isPlainObject(value._)) {
  3161. return false;
  3162. }
  3163. return Object.keys(value._).includes("vnode");
  3164. }
  3165. function isPlainObject(obj) {
  3166. return Object.prototype.toString.call(obj) === "[object Object]";
  3167. }
  3168. function isPrimitive(data) {
  3169. if (data == null)
  3170. return true;
  3171. const type = typeof data;
  3172. return type === "string" || type === "number" || type === "boolean";
  3173. }
  3174. function isRef2(raw) {
  3175. return !!raw.__v_isRef;
  3176. }
  3177. function isComputed(raw) {
  3178. return isRef2(raw) && !!raw.effect;
  3179. }
  3180. function isReactive2(raw) {
  3181. return !!raw.__v_isReactive;
  3182. }
  3183. function isReadOnly(raw) {
  3184. return !!raw.__v_isReadonly;
  3185. }
  3186. // src/core/component/state/util.ts
  3187. var tokenMap = {
  3188. [UNDEFINED]: "undefined",
  3189. [NAN]: "NaN",
  3190. [INFINITY]: "Infinity",
  3191. [NEGATIVE_INFINITY]: "-Infinity"
  3192. };
  3193. var reversedTokenMap = Object.entries(tokenMap).reduce((acc, [key, value]) => {
  3194. acc[value] = key;
  3195. return acc;
  3196. }, {});
  3197. function internalStateTokenToString(value) {
  3198. if (value === null)
  3199. return "null";
  3200. return typeof value === "string" && tokenMap[value] || false;
  3201. }
  3202. function replaceTokenToString(value) {
  3203. const replaceRegex = new RegExp(`"(${Object.keys(tokenMap).join("|")})"`, "g");
  3204. return value.replace(replaceRegex, (_, g1) => tokenMap[g1]);
  3205. }
  3206. function replaceStringToToken(value) {
  3207. const literalValue = reversedTokenMap[value.trim()];
  3208. if (literalValue)
  3209. return `"${literalValue}"`;
  3210. const replaceRegex = new RegExp(`:\\s*(${Object.keys(reversedTokenMap).join("|")})`, "g");
  3211. return value.replace(replaceRegex, (_, g1) => `:"${reversedTokenMap[g1]}"`);
  3212. }
  3213. function getPropType(type) {
  3214. if (Array.isArray(type))
  3215. return type.map((t) => getPropType(t)).join(" or ");
  3216. if (type == null)
  3217. return "null";
  3218. const match = type.toString().match(fnTypeRE);
  3219. return typeof type === "function" ? match && match[1] || "any" : "any";
  3220. }
  3221. function sanitize(data) {
  3222. if (!isPrimitive(data) && !Array.isArray(data) && !isPlainObject(data)) {
  3223. return Object.prototype.toString.call(data);
  3224. } else {
  3225. return data;
  3226. }
  3227. }
  3228. function getSetupStateType(raw) {
  3229. try {
  3230. return {
  3231. ref: isRef2(raw),
  3232. computed: isComputed(raw),
  3233. reactive: isReactive2(raw),
  3234. readonly: isReadOnly(raw)
  3235. };
  3236. } catch (e) {
  3237. return {
  3238. ref: false,
  3239. computed: false,
  3240. reactive: false,
  3241. readonly: false
  3242. };
  3243. }
  3244. }
  3245. function toRaw2(value) {
  3246. if (value == null ? void 0 : value.__v_raw)
  3247. return value.__v_raw;
  3248. return value;
  3249. }
  3250. function escape(s) {
  3251. return s.replace(/[<>"&]/g, (s2) => {
  3252. return ESC[s2] || s2;
  3253. });
  3254. }
  3255. // src/core/component/state/process.ts
  3256. function mergeOptions(to, from, instance) {
  3257. if (typeof from === "function")
  3258. from = from.options;
  3259. if (!from)
  3260. return to;
  3261. const { mixins, extends: extendsOptions } = from;
  3262. extendsOptions && mergeOptions(to, extendsOptions, instance);
  3263. mixins && mixins.forEach(
  3264. (m) => mergeOptions(to, m, instance)
  3265. );
  3266. for (const key of ["computed", "inject"]) {
  3267. if (Object.prototype.hasOwnProperty.call(from, key)) {
  3268. if (!to[key])
  3269. to[key] = from[key];
  3270. else
  3271. Object.assign(to[key], from[key]);
  3272. }
  3273. }
  3274. return to;
  3275. }
  3276. function resolveMergedOptions(instance) {
  3277. const raw = instance == null ? void 0 : instance.type;
  3278. if (!raw)
  3279. return {};
  3280. const { mixins, extends: extendsOptions } = raw;
  3281. const globalMixins = instance.appContext.mixins;
  3282. if (!globalMixins.length && !mixins && !extendsOptions)
  3283. return raw;
  3284. const options = {};
  3285. globalMixins.forEach((m) => mergeOptions(options, m, instance));
  3286. mergeOptions(options, raw, instance);
  3287. return options;
  3288. }
  3289. function processProps(instance) {
  3290. var _a25;
  3291. const props = [];
  3292. const propDefinitions = (_a25 = instance == null ? void 0 : instance.type) == null ? void 0 : _a25.props;
  3293. for (const key in instance == null ? void 0 : instance.props) {
  3294. const propDefinition = propDefinitions ? propDefinitions[key] : null;
  3295. const camelizeKey = camelize(key);
  3296. props.push({
  3297. type: "props",
  3298. key: camelizeKey,
  3299. value: returnError(() => instance.props[key]),
  3300. editable: true,
  3301. meta: propDefinition ? {
  3302. type: propDefinition.type ? getPropType(propDefinition.type) : "any",
  3303. required: !!propDefinition.required,
  3304. ...propDefinition.default ? {
  3305. default: propDefinition.default.toString()
  3306. } : {}
  3307. } : { type: "invalid" }
  3308. });
  3309. }
  3310. return props;
  3311. }
  3312. function processState(instance) {
  3313. const type = instance.type;
  3314. const props = type == null ? void 0 : type.props;
  3315. const getters = type.vuex && type.vuex.getters;
  3316. const computedDefs = type.computed;
  3317. const data = {
  3318. ...instance.data,
  3319. ...instance.renderContext
  3320. };
  3321. return Object.keys(data).filter((key) => !(props && key in props) && !(getters && key in getters) && !(computedDefs && key in computedDefs)).map((key) => ({
  3322. key,
  3323. type: "data",
  3324. value: returnError(() => data[key]),
  3325. editable: true
  3326. }));
  3327. }
  3328. function getStateTypeAndName(info) {
  3329. const stateType = info.computed ? "computed" : info.ref ? "ref" : info.reactive ? "reactive" : null;
  3330. const stateTypeName = stateType ? `${stateType.charAt(0).toUpperCase()}${stateType.slice(1)}` : null;
  3331. return {
  3332. stateType,
  3333. stateTypeName
  3334. };
  3335. }
  3336. function processSetupState(instance) {
  3337. const raw = instance.devtoolsRawSetupState || {};
  3338. return Object.keys(instance.setupState).filter((key) => !vueBuiltins.has(key) && key.split(/(?=[A-Z])/)[0] !== "use").map((key) => {
  3339. var _a25, _b25, _c, _d;
  3340. const value = returnError(() => toRaw2(instance.setupState[key]));
  3341. const accessError = value instanceof Error;
  3342. const rawData = raw[key];
  3343. let result;
  3344. let isOtherType = accessError || typeof value === "function" || ensurePropertyExists(value, "render") && typeof value.render === "function" || ensurePropertyExists(value, "__asyncLoader") && typeof value.__asyncLoader === "function" || typeof value === "object" && value && ("setup" in value || "props" in value) || /^v[A-Z]/.test(key);
  3345. if (rawData && !accessError) {
  3346. const info = getSetupStateType(rawData);
  3347. const { stateType, stateTypeName } = getStateTypeAndName(info);
  3348. const isState = info.ref || info.computed || info.reactive;
  3349. const raw2 = ensurePropertyExists(rawData, "effect") ? ((_b25 = (_a25 = rawData.effect) == null ? void 0 : _a25.raw) == null ? void 0 : _b25.toString()) || ((_d = (_c = rawData.effect) == null ? void 0 : _c.fn) == null ? void 0 : _d.toString()) : null;
  3350. if (stateType)
  3351. isOtherType = false;
  3352. result = {
  3353. ...stateType ? { stateType, stateTypeName } : {},
  3354. ...raw2 ? { raw: raw2 } : {},
  3355. editable: isState && !info.readonly
  3356. };
  3357. }
  3358. const type = isOtherType ? "setup (other)" : "setup";
  3359. return {
  3360. key,
  3361. value,
  3362. type,
  3363. // @ts-expect-error ignore
  3364. ...result
  3365. };
  3366. });
  3367. }
  3368. function processComputed(instance, mergedType) {
  3369. const type = mergedType;
  3370. const computed = [];
  3371. const defs = type.computed || {};
  3372. for (const key in defs) {
  3373. const def = defs[key];
  3374. const type2 = typeof def === "function" && def.vuex ? "vuex bindings" : "computed";
  3375. computed.push({
  3376. type: type2,
  3377. key,
  3378. value: returnError(() => {
  3379. var _a25;
  3380. return (_a25 = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a25[key];
  3381. }),
  3382. editable: typeof def.set === "function"
  3383. });
  3384. }
  3385. return computed;
  3386. }
  3387. function processAttrs(instance) {
  3388. return Object.keys(instance.attrs).map((key) => ({
  3389. type: "attrs",
  3390. key,
  3391. value: returnError(() => instance.attrs[key])
  3392. }));
  3393. }
  3394. function processProvide(instance) {
  3395. return Reflect.ownKeys(instance.provides).map((key) => ({
  3396. type: "provided",
  3397. key: key.toString(),
  3398. value: returnError(() => instance.provides[key])
  3399. }));
  3400. }
  3401. function processInject(instance, mergedType) {
  3402. if (!(mergedType == null ? void 0 : mergedType.inject))
  3403. return [];
  3404. let keys = [];
  3405. let defaultValue;
  3406. if (Array.isArray(mergedType.inject)) {
  3407. keys = mergedType.inject.map((key) => ({
  3408. key,
  3409. originalKey: key
  3410. }));
  3411. } else {
  3412. keys = Reflect.ownKeys(mergedType.inject).map((key) => {
  3413. const value = mergedType.inject[key];
  3414. let originalKey;
  3415. if (typeof value === "string" || typeof value === "symbol") {
  3416. originalKey = value;
  3417. } else {
  3418. originalKey = value.from;
  3419. defaultValue = value.default;
  3420. }
  3421. return {
  3422. key,
  3423. originalKey
  3424. };
  3425. });
  3426. }
  3427. return keys.map(({ key, originalKey }) => ({
  3428. type: "injected",
  3429. key: originalKey && key !== originalKey ? `${originalKey.toString()} \u279E ${key.toString()}` : key.toString(),
  3430. // eslint-disable-next-line no-prototype-builtins
  3431. value: returnError(() => instance.ctx.hasOwnProperty(key) ? instance.ctx[key] : instance.provides.hasOwnProperty(originalKey) ? instance.provides[originalKey] : defaultValue)
  3432. }));
  3433. }
  3434. function processRefs(instance) {
  3435. return Object.keys(instance.refs).map((key) => ({
  3436. type: "template refs",
  3437. key,
  3438. value: returnError(() => instance.refs[key])
  3439. }));
  3440. }
  3441. function processEventListeners(instance) {
  3442. var _a25, _b25;
  3443. const emitsDefinition = instance.type.emits;
  3444. const declaredEmits = Array.isArray(emitsDefinition) ? emitsDefinition : Object.keys(emitsDefinition != null ? emitsDefinition : {});
  3445. const keys = Object.keys((_b25 = (_a25 = instance == null ? void 0 : instance.vnode) == null ? void 0 : _a25.props) != null ? _b25 : {});
  3446. const result = [];
  3447. for (const key of keys) {
  3448. const [prefix, ...eventNameParts] = key.split(/(?=[A-Z])/);
  3449. if (prefix === "on") {
  3450. const eventName = eventNameParts.join("-").toLowerCase();
  3451. const isDeclared = declaredEmits.includes(eventName);
  3452. result.push({
  3453. type: "event listeners",
  3454. key: eventName,
  3455. value: {
  3456. _custom: {
  3457. displayText: isDeclared ? "\u2705 Declared" : "\u26A0\uFE0F Not declared",
  3458. key: isDeclared ? "\u2705 Declared" : "\u26A0\uFE0F Not declared",
  3459. value: isDeclared ? "\u2705 Declared" : "\u26A0\uFE0F Not declared",
  3460. tooltipText: !isDeclared ? `The event <code>${eventName}</code> is not declared in the <code>emits</code> option. It will leak into the component's attributes (<code>$attrs</code>).` : null
  3461. }
  3462. }
  3463. });
  3464. }
  3465. }
  3466. return result;
  3467. }
  3468. function processInstanceState(instance) {
  3469. const mergedType = resolveMergedOptions(instance);
  3470. return processProps(instance).concat(
  3471. processState(instance),
  3472. processSetupState(instance),
  3473. processComputed(instance, mergedType),
  3474. processAttrs(instance),
  3475. processProvide(instance),
  3476. processInject(instance, mergedType),
  3477. processRefs(instance),
  3478. processEventListeners(instance)
  3479. );
  3480. }
  3481. // src/core/component/state/index.ts
  3482. function getInstanceState(params) {
  3483. var _a25;
  3484. const instance = getComponentInstance(activeAppRecord.value, params.instanceId);
  3485. const id = getUniqueComponentId(instance);
  3486. const name = getInstanceName(instance);
  3487. const file = (_a25 = instance == null ? void 0 : instance.type) == null ? void 0 : _a25.__file;
  3488. const state = processInstanceState(instance);
  3489. return {
  3490. id,
  3491. name,
  3492. file,
  3493. state,
  3494. instance
  3495. };
  3496. }
  3497. // src/core/component/tree/walker.ts
  3498. init_esm_shims();
  3499. // src/core/component/tree/filter.ts
  3500. init_esm_shims();
  3501. import { classify as classify2, kebabize } from "@vue/devtools-shared";
  3502. var ComponentFilter = class {
  3503. constructor(filter) {
  3504. this.filter = filter || "";
  3505. }
  3506. /**
  3507. * Check if an instance is qualified.
  3508. *
  3509. * @param {Vue|Vnode} instance
  3510. * @return {boolean}
  3511. */
  3512. isQualified(instance) {
  3513. const name = getInstanceName(instance);
  3514. return classify2(name).toLowerCase().includes(this.filter) || kebabize(name).toLowerCase().includes(this.filter);
  3515. }
  3516. };
  3517. function createComponentFilter(filterText) {
  3518. return new ComponentFilter(filterText);
  3519. }
  3520. // src/core/component/tree/walker.ts
  3521. var ComponentWalker = class {
  3522. constructor(options) {
  3523. // Dedupe instances (Some instances may be both on a component and on a child abstract/functional component)
  3524. this.captureIds = /* @__PURE__ */ new Map();
  3525. const { filterText = "", maxDepth, recursively, api } = options;
  3526. this.componentFilter = createComponentFilter(filterText);
  3527. this.maxDepth = maxDepth;
  3528. this.recursively = recursively;
  3529. this.api = api;
  3530. }
  3531. getComponentTree(instance) {
  3532. this.captureIds = /* @__PURE__ */ new Map();
  3533. return this.findQualifiedChildren(instance, 0);
  3534. }
  3535. getComponentParents(instance) {
  3536. this.captureIds = /* @__PURE__ */ new Map();
  3537. const parents = [];
  3538. this.captureId(instance);
  3539. let parent = instance;
  3540. while (parent = parent.parent) {
  3541. this.captureId(parent);
  3542. parents.push(parent);
  3543. }
  3544. return parents;
  3545. }
  3546. captureId(instance) {
  3547. if (!instance)
  3548. return null;
  3549. const id = instance.__VUE_DEVTOOLS_NEXT_UID__ != null ? instance.__VUE_DEVTOOLS_NEXT_UID__ : getUniqueComponentId(instance);
  3550. instance.__VUE_DEVTOOLS_NEXT_UID__ = id;
  3551. if (this.captureIds.has(id))
  3552. return null;
  3553. else
  3554. this.captureIds.set(id, void 0);
  3555. this.mark(instance);
  3556. return id;
  3557. }
  3558. /**
  3559. * Capture the meta information of an instance. (recursive)
  3560. *
  3561. * @param {Vue} instance
  3562. * @return {object}
  3563. */
  3564. async capture(instance, depth) {
  3565. var _a25;
  3566. if (!instance)
  3567. return null;
  3568. const id = this.captureId(instance);
  3569. const name = getInstanceName(instance);
  3570. const children = this.getInternalInstanceChildren(instance.subTree).filter((child) => !isBeingDestroyed(child));
  3571. const parents = this.getComponentParents(instance) || [];
  3572. const inactive = !!instance.isDeactivated || parents.some((parent) => parent.isDeactivated);
  3573. const treeNode = {
  3574. uid: instance.uid,
  3575. id,
  3576. name,
  3577. renderKey: getRenderKey(instance.vnode ? instance.vnode.key : null),
  3578. inactive,
  3579. children: [],
  3580. isFragment: isFragment(instance),
  3581. tags: typeof instance.type !== "function" ? [] : [
  3582. {
  3583. label: "functional",
  3584. textColor: 5592405,
  3585. backgroundColor: 15658734
  3586. }
  3587. ],
  3588. autoOpen: this.recursively,
  3589. file: instance.type.__file || ""
  3590. };
  3591. if (depth < this.maxDepth || instance.type.__isKeepAlive || parents.some((parent) => parent.type.__isKeepAlive)) {
  3592. treeNode.children = await Promise.all(children.map((child) => this.capture(child, depth + 1)).filter(Boolean));
  3593. }
  3594. if (this.isKeepAlive(instance)) {
  3595. const cachedComponents = this.getKeepAliveCachedInstances(instance);
  3596. const childrenIds = children.map((child) => child.__VUE_DEVTOOLS_NEXT_UID__);
  3597. for (const cachedChild of cachedComponents) {
  3598. if (!childrenIds.includes(cachedChild.__VUE_DEVTOOLS_NEXT_UID__)) {
  3599. const node = await this.capture({ ...cachedChild, isDeactivated: true }, depth + 1);
  3600. if (node)
  3601. treeNode.children.push(node);
  3602. }
  3603. }
  3604. }
  3605. const rootElements = getRootElementsFromComponentInstance(instance);
  3606. const firstElement = rootElements[0];
  3607. if (firstElement == null ? void 0 : firstElement.parentElement) {
  3608. const parentInstance = instance.parent;
  3609. const parentRootElements = parentInstance ? getRootElementsFromComponentInstance(parentInstance) : [];
  3610. let el = firstElement;
  3611. const indexList = [];
  3612. do {
  3613. indexList.push(Array.from(el.parentElement.childNodes).indexOf(el));
  3614. el = el.parentElement;
  3615. } while (el.parentElement && parentRootElements.length && !parentRootElements.includes(el));
  3616. treeNode.domOrder = indexList.reverse();
  3617. } else {
  3618. treeNode.domOrder = [-1];
  3619. }
  3620. if ((_a25 = instance.suspense) == null ? void 0 : _a25.suspenseKey) {
  3621. treeNode.tags.push({
  3622. label: instance.suspense.suspenseKey,
  3623. backgroundColor: 14979812,
  3624. textColor: 16777215
  3625. });
  3626. this.mark(instance, true);
  3627. }
  3628. this.api.visitComponentTree({
  3629. treeNode,
  3630. componentInstance: instance,
  3631. app: instance.appContext.app,
  3632. filter: this.componentFilter.filter
  3633. });
  3634. return treeNode;
  3635. }
  3636. /**
  3637. * Find qualified children from a single instance.
  3638. * If the instance itself is qualified, just return itself.
  3639. * This is ok because [].concat works in both cases.
  3640. *
  3641. * @param {Vue|Vnode} instance
  3642. * @return {Vue|Array}
  3643. */
  3644. async findQualifiedChildren(instance, depth) {
  3645. var _a25;
  3646. if (this.componentFilter.isQualified(instance) && !((_a25 = instance.type.devtools) == null ? void 0 : _a25.hide)) {
  3647. return [await this.capture(instance, depth)];
  3648. } else if (instance.subTree) {
  3649. const list = this.isKeepAlive(instance) ? this.getKeepAliveCachedInstances(instance) : this.getInternalInstanceChildren(instance.subTree);
  3650. return this.findQualifiedChildrenFromList(list, depth);
  3651. } else {
  3652. return [];
  3653. }
  3654. }
  3655. /**
  3656. * Iterate through an array of instances and flatten it into
  3657. * an array of qualified instances. This is a depth-first
  3658. * traversal - e.g. if an instance is not matched, we will
  3659. * recursively go deeper until a qualified child is found.
  3660. *
  3661. * @param {Array} instances
  3662. * @return {Array}
  3663. */
  3664. async findQualifiedChildrenFromList(instances, depth) {
  3665. instances = instances.filter((child) => {
  3666. var _a25;
  3667. return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);
  3668. });
  3669. if (!this.componentFilter.filter)
  3670. return Promise.all(instances.map((child) => this.capture(child, depth)));
  3671. else
  3672. return Array.prototype.concat.apply([], await Promise.all(instances.map((i) => this.findQualifiedChildren(i, depth))));
  3673. }
  3674. /**
  3675. * Get children from a component instance.
  3676. */
  3677. getInternalInstanceChildren(subTree, suspense = null) {
  3678. const list = [];
  3679. if (subTree) {
  3680. if (subTree.component) {
  3681. !suspense ? list.push(subTree.component) : list.push({ ...subTree.component, suspense });
  3682. } else if (subTree.suspense) {
  3683. const suspenseKey = !subTree.suspense.isInFallback ? "suspense default" : "suspense fallback";
  3684. list.push(...this.getInternalInstanceChildren(subTree.suspense.activeBranch, { ...subTree.suspense, suspenseKey }));
  3685. } else if (Array.isArray(subTree.children)) {
  3686. subTree.children.forEach((childSubTree) => {
  3687. if (childSubTree.component)
  3688. !suspense ? list.push(childSubTree.component) : list.push({ ...childSubTree.component, suspense });
  3689. else
  3690. list.push(...this.getInternalInstanceChildren(childSubTree, suspense));
  3691. });
  3692. }
  3693. }
  3694. return list.filter((child) => {
  3695. var _a25;
  3696. return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);
  3697. });
  3698. }
  3699. /**
  3700. * Mark an instance as captured and store it in the instance map.
  3701. *
  3702. * @param {Vue} instance
  3703. */
  3704. mark(instance, force = false) {
  3705. const instanceMap = getAppRecord(instance).instanceMap;
  3706. if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_NEXT_UID__)) {
  3707. instanceMap.set(instance.__VUE_DEVTOOLS_NEXT_UID__, instance);
  3708. activeAppRecord.value.instanceMap = instanceMap;
  3709. }
  3710. }
  3711. isKeepAlive(instance) {
  3712. return instance.type.__isKeepAlive && instance.__v_cache;
  3713. }
  3714. getKeepAliveCachedInstances(instance) {
  3715. return Array.from(instance.__v_cache.values()).map((vnode) => vnode.component).filter(Boolean);
  3716. }
  3717. };
  3718. // src/core/timeline/index.ts
  3719. init_esm_shims();
  3720. import { isBrowser as isBrowser2 } from "@vue/devtools-shared";
  3721. // src/core/timeline/perf.ts
  3722. init_esm_shims();
  3723. var markEndQueue = /* @__PURE__ */ new Map();
  3724. var PERFORMANCE_EVENT_LAYER_ID = "performance";
  3725. async function performanceMarkStart(api, app, uid, vm, type, time) {
  3726. const appRecord = await getAppRecord(app);
  3727. if (!appRecord) {
  3728. return;
  3729. }
  3730. const componentName = getInstanceName(vm) || "Unknown Component";
  3731. const groupId = devtoolsState.perfUniqueGroupId++;
  3732. const groupKey = `${uid}-${type}`;
  3733. appRecord.perfGroupIds.set(groupKey, { groupId, time });
  3734. await api.addTimelineEvent({
  3735. layerId: PERFORMANCE_EVENT_LAYER_ID,
  3736. event: {
  3737. time: Date.now(),
  3738. data: {
  3739. component: componentName,
  3740. type,
  3741. measure: "start"
  3742. },
  3743. title: componentName,
  3744. subtitle: type,
  3745. groupId
  3746. }
  3747. });
  3748. if (markEndQueue.has(groupKey)) {
  3749. const {
  3750. app: app2,
  3751. uid: uid2,
  3752. instance,
  3753. type: type2,
  3754. time: time2
  3755. } = markEndQueue.get(groupKey);
  3756. markEndQueue.delete(groupKey);
  3757. await performanceMarkEnd(
  3758. api,
  3759. app2,
  3760. uid2,
  3761. instance,
  3762. type2,
  3763. time2
  3764. );
  3765. }
  3766. }
  3767. function performanceMarkEnd(api, app, uid, vm, type, time) {
  3768. const appRecord = getAppRecord(app);
  3769. if (!appRecord)
  3770. return;
  3771. const componentName = getInstanceName(vm) || "Unknown Component";
  3772. const groupKey = `${uid}-${type}`;
  3773. const groupInfo = appRecord.perfGroupIds.get(groupKey);
  3774. if (groupInfo) {
  3775. const groupId = groupInfo.groupId;
  3776. const startTime = groupInfo.time;
  3777. const duration = time - startTime;
  3778. api.addTimelineEvent({
  3779. layerId: PERFORMANCE_EVENT_LAYER_ID,
  3780. event: {
  3781. time: Date.now(),
  3782. data: {
  3783. component: componentName,
  3784. type,
  3785. measure: "end",
  3786. duration: {
  3787. _custom: {
  3788. type: "Duration",
  3789. value: duration,
  3790. display: `${duration} ms`
  3791. }
  3792. }
  3793. },
  3794. title: componentName,
  3795. subtitle: type,
  3796. groupId
  3797. }
  3798. });
  3799. } else {
  3800. markEndQueue.set(groupKey, { app, uid, instance: vm, type, time });
  3801. }
  3802. }
  3803. // src/core/timeline/index.ts
  3804. var COMPONENT_EVENT_LAYER_ID = "component-event";
  3805. function setupBuiltinTimelineLayers(api) {
  3806. if (!isBrowser2)
  3807. return;
  3808. api.addTimelineLayer({
  3809. id: "mouse",
  3810. label: "Mouse",
  3811. color: 10768815
  3812. });
  3813. ["mousedown", "mouseup", "click", "dblclick"].forEach((eventType) => {
  3814. if (!devtoolsState.timelineLayersState.recordingState || !devtoolsState.timelineLayersState.mouseEventEnabled)
  3815. return;
  3816. window.addEventListener(eventType, async (event) => {
  3817. await api.addTimelineEvent({
  3818. layerId: "mouse",
  3819. event: {
  3820. time: Date.now(),
  3821. data: {
  3822. type: eventType,
  3823. x: event.clientX,
  3824. y: event.clientY
  3825. },
  3826. title: eventType
  3827. }
  3828. });
  3829. }, {
  3830. capture: true,
  3831. passive: true
  3832. });
  3833. });
  3834. api.addTimelineLayer({
  3835. id: "keyboard",
  3836. label: "Keyboard",
  3837. color: 8475055
  3838. });
  3839. ["keyup", "keydown", "keypress"].forEach((eventType) => {
  3840. window.addEventListener(eventType, async (event) => {
  3841. if (!devtoolsState.timelineLayersState.recordingState || !devtoolsState.timelineLayersState.keyboardEventEnabled)
  3842. return;
  3843. await api.addTimelineEvent({
  3844. layerId: "keyboard",
  3845. event: {
  3846. time: Date.now(),
  3847. data: {
  3848. type: eventType,
  3849. key: event.key,
  3850. ctrlKey: event.ctrlKey,
  3851. shiftKey: event.shiftKey,
  3852. altKey: event.altKey,
  3853. metaKey: event.metaKey
  3854. },
  3855. title: event.key
  3856. }
  3857. });
  3858. }, {
  3859. capture: true,
  3860. passive: true
  3861. });
  3862. });
  3863. api.addTimelineLayer({
  3864. id: COMPONENT_EVENT_LAYER_ID,
  3865. label: "Component events",
  3866. color: 5226637
  3867. });
  3868. hook.on.componentEmit(async (app, instance, event, params) => {
  3869. if (!devtoolsState.timelineLayersState.recordingState || !devtoolsState.timelineLayersState.componentEventEnabled)
  3870. return;
  3871. const appRecord = await getAppRecord(app);
  3872. if (!appRecord)
  3873. return;
  3874. const componentId = `${appRecord.id}:${instance.uid}`;
  3875. const componentName = getInstanceName(instance) || "Unknown Component";
  3876. api.addTimelineEvent({
  3877. layerId: COMPONENT_EVENT_LAYER_ID,
  3878. event: {
  3879. time: Date.now(),
  3880. data: {
  3881. component: {
  3882. _custom: {
  3883. type: "component-definition",
  3884. display: componentName
  3885. }
  3886. },
  3887. event,
  3888. params
  3889. },
  3890. title: event,
  3891. subtitle: `by ${componentName}`,
  3892. meta: {
  3893. componentId
  3894. }
  3895. }
  3896. });
  3897. });
  3898. api.addTimelineLayer({
  3899. id: "performance",
  3900. label: PERFORMANCE_EVENT_LAYER_ID,
  3901. color: 4307050
  3902. });
  3903. hook.on.perfStart((app, uid, vm, type, time) => {
  3904. if (!devtoolsState.timelineLayersState.recordingState || !devtoolsState.timelineLayersState.performanceEventEnabled)
  3905. return;
  3906. performanceMarkStart(api, app, uid, vm, type, time);
  3907. });
  3908. hook.on.perfEnd((app, uid, vm, type, time) => {
  3909. if (!devtoolsState.timelineLayersState.recordingState || !devtoolsState.timelineLayersState.performanceEventEnabled)
  3910. return;
  3911. performanceMarkEnd(api, app, uid, vm, type, time);
  3912. });
  3913. }
  3914. // src/core/vm/index.ts
  3915. init_esm_shims();
  3916. var MAX_$VM = 10;
  3917. var $vmQueue = [];
  3918. function exposeInstanceToWindow(componentInstance) {
  3919. if (typeof window === "undefined")
  3920. return;
  3921. const win = window;
  3922. if (!componentInstance)
  3923. return;
  3924. win.$vm = componentInstance;
  3925. if ($vmQueue[0] !== componentInstance) {
  3926. if ($vmQueue.length >= MAX_$VM) {
  3927. $vmQueue.pop();
  3928. }
  3929. for (let i = $vmQueue.length; i > 0; i--) {
  3930. win[`$vm${i}`] = $vmQueue[i] = $vmQueue[i - 1];
  3931. }
  3932. win.$vm0 = $vmQueue[0] = componentInstance;
  3933. }
  3934. }
  3935. // src/core/plugin/components.ts
  3936. var INSPECTOR_ID = "components";
  3937. function createComponentsDevToolsPlugin(app) {
  3938. const descriptor = {
  3939. id: INSPECTOR_ID,
  3940. label: "Components",
  3941. app
  3942. };
  3943. const setupFn = (api) => {
  3944. api.addInspector({
  3945. id: INSPECTOR_ID,
  3946. label: "Components",
  3947. treeFilterPlaceholder: "Search components"
  3948. });
  3949. setupBuiltinTimelineLayers(api);
  3950. api.on.getInspectorTree(async (payload) => {
  3951. if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
  3952. const instance = getComponentInstance(activeAppRecord.value, payload.instanceId);
  3953. if (instance) {
  3954. const walker2 = new ComponentWalker({
  3955. filterText: payload.filter,
  3956. // @TODO: should make this configurable?
  3957. maxDepth: 100,
  3958. recursively: false,
  3959. api
  3960. });
  3961. payload.rootNodes = await walker2.getComponentTree(instance);
  3962. }
  3963. }
  3964. });
  3965. api.on.getInspectorState(async (payload) => {
  3966. var _a25;
  3967. if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
  3968. const result = getInstanceState({
  3969. instanceId: payload.nodeId
  3970. });
  3971. const componentInstance = result.instance;
  3972. const app2 = (_a25 = result.instance) == null ? void 0 : _a25.appContext.app;
  3973. const _payload = {
  3974. componentInstance,
  3975. app: app2,
  3976. instanceData: result
  3977. };
  3978. devtoolsContext.hooks.callHookWith((callbacks) => {
  3979. callbacks.forEach((cb) => cb(_payload));
  3980. }, "inspectComponent" /* INSPECT_COMPONENT */);
  3981. payload.state = result;
  3982. exposeInstanceToWindow(componentInstance);
  3983. }
  3984. });
  3985. api.on.editInspectorState(async (payload) => {
  3986. if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
  3987. editState(payload);
  3988. await api.sendInspectorState("components");
  3989. }
  3990. });
  3991. const debounceSendInspectorTree = debounce4(() => {
  3992. api.sendInspectorTree(INSPECTOR_ID);
  3993. }, 120);
  3994. const debounceSendInspectorState = debounce4(() => {
  3995. api.sendInspectorState(INSPECTOR_ID);
  3996. }, 120);
  3997. const componentAddedCleanup = hook.on.componentAdded(async (app2, uid, parentUid, component) => {
  3998. var _a25, _b25, _c;
  3999. if (devtoolsState.highPerfModeEnabled)
  4000. return;
  4001. if ((_c = (_b25 = (_a25 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)
  4002. return;
  4003. if (!app2 || typeof uid !== "number" && !uid || !component)
  4004. return;
  4005. const id = await getComponentId({
  4006. app: app2,
  4007. uid,
  4008. instance: component
  4009. });
  4010. const appRecord = await getAppRecord(app2);
  4011. if (component) {
  4012. if (component.__VUE_DEVTOOLS_NEXT_UID__ == null)
  4013. component.__VUE_DEVTOOLS_NEXT_UID__ = id;
  4014. if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id))) {
  4015. appRecord == null ? void 0 : appRecord.instanceMap.set(id, component);
  4016. if (activeAppRecord.value.id === (appRecord == null ? void 0 : appRecord.id))
  4017. activeAppRecord.value.instanceMap = appRecord.instanceMap;
  4018. }
  4019. }
  4020. if (!appRecord)
  4021. return;
  4022. debounceSendInspectorTree();
  4023. });
  4024. const componentUpdatedCleanup = hook.on.componentUpdated(async (app2, uid, parentUid, component) => {
  4025. var _a25, _b25, _c;
  4026. if (devtoolsState.highPerfModeEnabled)
  4027. return;
  4028. if ((_c = (_b25 = (_a25 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)
  4029. return;
  4030. if (!app2 || typeof uid !== "number" && !uid || !component)
  4031. return;
  4032. const id = await getComponentId({
  4033. app: app2,
  4034. uid,
  4035. instance: component
  4036. });
  4037. const appRecord = await getAppRecord(app2);
  4038. if (component) {
  4039. if (component.__VUE_DEVTOOLS_NEXT_UID__ == null)
  4040. component.__VUE_DEVTOOLS_NEXT_UID__ = id;
  4041. if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id))) {
  4042. appRecord == null ? void 0 : appRecord.instanceMap.set(id, component);
  4043. if (activeAppRecord.value.id === (appRecord == null ? void 0 : appRecord.id))
  4044. activeAppRecord.value.instanceMap = appRecord.instanceMap;
  4045. }
  4046. }
  4047. if (!appRecord)
  4048. return;
  4049. debounceSendInspectorTree();
  4050. debounceSendInspectorState();
  4051. });
  4052. const componentRemovedCleanup = hook.on.componentRemoved(async (app2, uid, parentUid, component) => {
  4053. var _a25, _b25, _c;
  4054. if (devtoolsState.highPerfModeEnabled)
  4055. return;
  4056. if ((_c = (_b25 = (_a25 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)
  4057. return;
  4058. if (!app2 || typeof uid !== "number" && !uid || !component)
  4059. return;
  4060. const appRecord = await getAppRecord(app2);
  4061. if (!appRecord)
  4062. return;
  4063. const id = await getComponentId({
  4064. app: app2,
  4065. uid,
  4066. instance: component
  4067. });
  4068. appRecord == null ? void 0 : appRecord.instanceMap.delete(id);
  4069. if (activeAppRecord.value.id === (appRecord == null ? void 0 : appRecord.id))
  4070. activeAppRecord.value.instanceMap = appRecord.instanceMap;
  4071. debounceSendInspectorTree();
  4072. });
  4073. };
  4074. return [descriptor, setupFn];
  4075. }
  4076. // src/core/plugin/index.ts
  4077. var _a12, _b12;
  4078. (_b12 = (_a12 = target8).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__) != null ? _b12 : _a12.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ = /* @__PURE__ */ new Set();
  4079. function setupDevToolsPlugin(pluginDescriptor, setupFn) {
  4080. return hook.setupDevToolsPlugin(pluginDescriptor, setupFn);
  4081. }
  4082. function callDevToolsPluginSetupFn(plugin, app) {
  4083. const [pluginDescriptor, setupFn] = plugin;
  4084. if (pluginDescriptor.app !== app)
  4085. return;
  4086. const api = new DevToolsPluginAPI({
  4087. plugin: {
  4088. setupFn,
  4089. descriptor: pluginDescriptor
  4090. },
  4091. ctx: devtoolsContext
  4092. });
  4093. if (pluginDescriptor.packageName === "vuex") {
  4094. api.on.editInspectorState((payload) => {
  4095. api.sendInspectorState(payload.inspectorId);
  4096. });
  4097. }
  4098. setupFn(api);
  4099. }
  4100. function removeRegisteredPluginApp(app) {
  4101. target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.delete(app);
  4102. }
  4103. function registerDevToolsPlugin(app, options) {
  4104. if (target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(app)) {
  4105. return;
  4106. }
  4107. if (devtoolsState.highPerfModeEnabled && !(options == null ? void 0 : options.inspectingComponent)) {
  4108. return;
  4109. }
  4110. target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(app);
  4111. devtoolsPluginBuffer.forEach((plugin) => {
  4112. callDevToolsPluginSetupFn(plugin, app);
  4113. });
  4114. }
  4115. // src/core/router/index.ts
  4116. init_esm_shims();
  4117. import { deepClone, target as global3 } from "@vue/devtools-shared";
  4118. import { debounce as debounce5 } from "perfect-debounce";
  4119. // src/ctx/router.ts
  4120. init_esm_shims();
  4121. import { target as global2 } from "@vue/devtools-shared";
  4122. var ROUTER_KEY = "__VUE_DEVTOOLS_ROUTER__";
  4123. var ROUTER_INFO_KEY = "__VUE_DEVTOOLS_ROUTER_INFO__";
  4124. var _a13, _b13;
  4125. (_b13 = (_a13 = global2)[ROUTER_INFO_KEY]) != null ? _b13 : _a13[ROUTER_INFO_KEY] = {
  4126. currentRoute: null,
  4127. routes: []
  4128. };
  4129. var _a14, _b14;
  4130. (_b14 = (_a14 = global2)[ROUTER_KEY]) != null ? _b14 : _a14[ROUTER_KEY] = {};
  4131. var devtoolsRouterInfo = new Proxy(global2[ROUTER_INFO_KEY], {
  4132. get(target22, property) {
  4133. return global2[ROUTER_INFO_KEY][property];
  4134. }
  4135. });
  4136. var devtoolsRouter = new Proxy(global2[ROUTER_KEY], {
  4137. get(target22, property) {
  4138. if (property === "value") {
  4139. return global2[ROUTER_KEY];
  4140. }
  4141. }
  4142. });
  4143. // src/core/router/index.ts
  4144. function getRoutes(router) {
  4145. const routesMap = /* @__PURE__ */ new Map();
  4146. return ((router == null ? void 0 : router.getRoutes()) || []).filter((i) => !routesMap.has(i.path) && routesMap.set(i.path, 1));
  4147. }
  4148. function filterRoutes(routes) {
  4149. return routes.map((item) => {
  4150. let { path, name, children, meta } = item;
  4151. if (children == null ? void 0 : children.length)
  4152. children = filterRoutes(children);
  4153. return {
  4154. path,
  4155. name,
  4156. children,
  4157. meta
  4158. };
  4159. });
  4160. }
  4161. function filterCurrentRoute(route) {
  4162. if (route) {
  4163. const { fullPath, hash, href, path, name, matched, params, query } = route;
  4164. return {
  4165. fullPath,
  4166. hash,
  4167. href,
  4168. path,
  4169. name,
  4170. params,
  4171. query,
  4172. matched: filterRoutes(matched)
  4173. };
  4174. }
  4175. return route;
  4176. }
  4177. function normalizeRouterInfo(appRecord, activeAppRecord2) {
  4178. function init() {
  4179. var _a25;
  4180. const router = (_a25 = appRecord.app) == null ? void 0 : _a25.config.globalProperties.$router;
  4181. const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);
  4182. const routes = filterRoutes(getRoutes(router));
  4183. const c = console.warn;
  4184. console.warn = () => {
  4185. };
  4186. global3[ROUTER_INFO_KEY] = {
  4187. currentRoute: currentRoute ? deepClone(currentRoute) : {},
  4188. routes: deepClone(routes)
  4189. };
  4190. global3[ROUTER_KEY] = router;
  4191. console.warn = c;
  4192. }
  4193. init();
  4194. hook.on.componentUpdated(debounce5(() => {
  4195. var _a25;
  4196. if (((_a25 = activeAppRecord2.value) == null ? void 0 : _a25.app) !== appRecord.app)
  4197. return;
  4198. init();
  4199. if (devtoolsState.highPerfModeEnabled)
  4200. return;
  4201. devtoolsContext.hooks.callHook("routerInfoUpdated" /* ROUTER_INFO_UPDATED */, { state: global3[ROUTER_INFO_KEY] });
  4202. }, 200));
  4203. }
  4204. // src/ctx/api.ts
  4205. function createDevToolsApi(hooks2) {
  4206. return {
  4207. // get inspector tree
  4208. async getInspectorTree(payload) {
  4209. const _payload = {
  4210. ...payload,
  4211. app: activeAppRecord.value.app,
  4212. rootNodes: []
  4213. };
  4214. await new Promise((resolve) => {
  4215. hooks2.callHookWith(async (callbacks) => {
  4216. await Promise.all(callbacks.map((cb) => cb(_payload)));
  4217. resolve();
  4218. }, "getInspectorTree" /* GET_INSPECTOR_TREE */);
  4219. });
  4220. return _payload.rootNodes;
  4221. },
  4222. // get inspector state
  4223. async getInspectorState(payload) {
  4224. const _payload = {
  4225. ...payload,
  4226. app: activeAppRecord.value.app,
  4227. state: null
  4228. };
  4229. const ctx = {
  4230. currentTab: `custom-inspector:${payload.inspectorId}`
  4231. };
  4232. await new Promise((resolve) => {
  4233. hooks2.callHookWith(async (callbacks) => {
  4234. await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));
  4235. resolve();
  4236. }, "getInspectorState" /* GET_INSPECTOR_STATE */);
  4237. });
  4238. return _payload.state;
  4239. },
  4240. // edit inspector state
  4241. editInspectorState(payload) {
  4242. const stateEditor2 = new StateEditor();
  4243. const _payload = {
  4244. ...payload,
  4245. app: activeAppRecord.value.app,
  4246. set: (obj, path = payload.path, value = payload.state.value, cb) => {
  4247. stateEditor2.set(obj, path, value, cb || stateEditor2.createDefaultSetCallback(payload.state));
  4248. }
  4249. };
  4250. hooks2.callHookWith((callbacks) => {
  4251. callbacks.forEach((cb) => cb(_payload));
  4252. }, "editInspectorState" /* EDIT_INSPECTOR_STATE */);
  4253. },
  4254. // send inspector state
  4255. sendInspectorState(inspectorId) {
  4256. const inspector = getInspector(inspectorId);
  4257. hooks2.callHook("sendInspectorState" /* SEND_INSPECTOR_STATE */, { inspectorId, plugin: {
  4258. descriptor: inspector.descriptor,
  4259. setupFn: () => ({})
  4260. } });
  4261. },
  4262. // inspect component inspector
  4263. inspectComponentInspector() {
  4264. return inspectComponentHighLighter();
  4265. },
  4266. // cancel inspect component inspector
  4267. cancelInspectComponentInspector() {
  4268. return cancelInspectComponentHighLighter();
  4269. },
  4270. // get component render code
  4271. getComponentRenderCode(id) {
  4272. const instance = getComponentInstance(activeAppRecord.value, id);
  4273. if (instance)
  4274. return !(typeof (instance == null ? void 0 : instance.type) === "function") ? instance.render.toString() : instance.type.toString();
  4275. },
  4276. // scroll to component
  4277. scrollToComponent(id) {
  4278. return scrollToComponent({ id });
  4279. },
  4280. // open in editor
  4281. openInEditor,
  4282. // get vue inspector
  4283. getVueInspector: getComponentInspector,
  4284. // toggle app
  4285. toggleApp(id, options) {
  4286. const appRecord = devtoolsAppRecords.value.find((record) => record.id === id);
  4287. if (appRecord) {
  4288. setActiveAppRecordId(id);
  4289. setActiveAppRecord(appRecord);
  4290. normalizeRouterInfo(appRecord, activeAppRecord);
  4291. callInspectorUpdatedHook();
  4292. registerDevToolsPlugin(appRecord.app, options);
  4293. }
  4294. },
  4295. // inspect dom
  4296. inspectDOM(instanceId) {
  4297. const instance = getComponentInstance(activeAppRecord.value, instanceId);
  4298. if (instance) {
  4299. const [el] = getRootElementsFromComponentInstance(instance);
  4300. if (el) {
  4301. target9.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__ = el;
  4302. }
  4303. }
  4304. },
  4305. updatePluginSettings(pluginId, key, value) {
  4306. setPluginSettings(pluginId, key, value);
  4307. },
  4308. getPluginSettings(pluginId) {
  4309. return {
  4310. options: getPluginSettingsOptions(pluginId),
  4311. values: getPluginSettings(pluginId)
  4312. };
  4313. }
  4314. };
  4315. }
  4316. // src/ctx/env.ts
  4317. init_esm_shims();
  4318. import { target as target10 } from "@vue/devtools-shared";
  4319. var _a15, _b15;
  4320. (_b15 = (_a15 = target10).__VUE_DEVTOOLS_ENV__) != null ? _b15 : _a15.__VUE_DEVTOOLS_ENV__ = {
  4321. vitePluginDetected: false
  4322. };
  4323. function getDevToolsEnv() {
  4324. return target10.__VUE_DEVTOOLS_ENV__;
  4325. }
  4326. function setDevToolsEnv(env) {
  4327. target10.__VUE_DEVTOOLS_ENV__ = {
  4328. ...target10.__VUE_DEVTOOLS_ENV__,
  4329. ...env
  4330. };
  4331. }
  4332. // src/ctx/index.ts
  4333. var hooks = createDevToolsCtxHooks();
  4334. var _a16, _b16;
  4335. (_b16 = (_a16 = target11).__VUE_DEVTOOLS_KIT_CONTEXT__) != null ? _b16 : _a16.__VUE_DEVTOOLS_KIT_CONTEXT__ = {
  4336. hooks,
  4337. get state() {
  4338. return {
  4339. ...devtoolsState,
  4340. activeAppRecordId: activeAppRecord.id,
  4341. activeAppRecord: activeAppRecord.value,
  4342. appRecords: devtoolsAppRecords.value
  4343. };
  4344. },
  4345. api: createDevToolsApi(hooks)
  4346. };
  4347. var devtoolsContext = target11.__VUE_DEVTOOLS_KIT_CONTEXT__;
  4348. // src/core/app/index.ts
  4349. init_esm_shims();
  4350. var import_speakingurl = __toESM(require_speakingurl2(), 1);
  4351. import { isBrowser as isBrowser3, target as target12 } from "@vue/devtools-shared";
  4352. var _a17, _b17;
  4353. var appRecordInfo = (_b17 = (_a17 = target12).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__) != null ? _b17 : _a17.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ = {
  4354. id: 0,
  4355. appIds: /* @__PURE__ */ new Set()
  4356. };
  4357. function getAppRecordName(app, fallbackName) {
  4358. var _a25;
  4359. return ((_a25 = app == null ? void 0 : app._component) == null ? void 0 : _a25.name) || `App ${fallbackName}`;
  4360. }
  4361. function getAppRootInstance(app) {
  4362. var _a25, _b25, _c, _d;
  4363. if (app._instance)
  4364. return app._instance;
  4365. else if ((_b25 = (_a25 = app._container) == null ? void 0 : _a25._vnode) == null ? void 0 : _b25.component)
  4366. return (_d = (_c = app._container) == null ? void 0 : _c._vnode) == null ? void 0 : _d.component;
  4367. }
  4368. function removeAppRecordId(app) {
  4369. const id = app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__;
  4370. if (id != null) {
  4371. appRecordInfo.appIds.delete(id);
  4372. appRecordInfo.id--;
  4373. }
  4374. }
  4375. function getAppRecordId(app, defaultId) {
  4376. if (app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ != null)
  4377. return app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__;
  4378. let id = defaultId != null ? defaultId : (appRecordInfo.id++).toString();
  4379. if (defaultId && appRecordInfo.appIds.has(id)) {
  4380. let count = 1;
  4381. while (appRecordInfo.appIds.has(`${defaultId}_${count}`))
  4382. count++;
  4383. id = `${defaultId}_${count}`;
  4384. }
  4385. appRecordInfo.appIds.add(id);
  4386. app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ = id;
  4387. return id;
  4388. }
  4389. function createAppRecord(app, types) {
  4390. var _a25, _b25;
  4391. const rootInstance = getAppRootInstance(app);
  4392. if (rootInstance) {
  4393. appRecordInfo.id++;
  4394. const name = getAppRecordName(app, appRecordInfo.id.toString());
  4395. const id = getAppRecordId(app, (0, import_speakingurl.default)(name));
  4396. const [el] = getRootElementsFromComponentInstance(rootInstance);
  4397. const record = {
  4398. id,
  4399. name,
  4400. types,
  4401. instanceMap: /* @__PURE__ */ new Map(),
  4402. perfGroupIds: /* @__PURE__ */ new Map(),
  4403. rootInstance,
  4404. iframe: isBrowser3 && document !== (el == null ? void 0 : el.ownerDocument) ? (_b25 = (_a25 = el == null ? void 0 : el.ownerDocument) == null ? void 0 : _a25.location) == null ? void 0 : _b25.pathname : void 0
  4405. };
  4406. app.__VUE_DEVTOOLS_NEXT_APP_RECORD__ = record;
  4407. const rootId = `${record.id}:root`;
  4408. record.instanceMap.set(rootId, record.rootInstance);
  4409. record.rootInstance.__VUE_DEVTOOLS_NEXT_UID__ = rootId;
  4410. return record;
  4411. } else {
  4412. return {};
  4413. }
  4414. }
  4415. // src/core/iframe/index.ts
  4416. init_esm_shims();
  4417. function detectIframeApp(target22, inIframe = false) {
  4418. if (inIframe) {
  4419. let sendEventToParent2 = function(cb) {
  4420. try {
  4421. const hook3 = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4422. if (hook3) {
  4423. cb(hook3);
  4424. }
  4425. } catch (e) {
  4426. }
  4427. };
  4428. var sendEventToParent = sendEventToParent2;
  4429. const hook2 = {
  4430. id: "vue-devtools-next",
  4431. devtoolsVersion: "7.0",
  4432. on: (event, cb) => {
  4433. sendEventToParent2((hook3) => {
  4434. hook3.on(event, cb);
  4435. });
  4436. },
  4437. once: (event, cb) => {
  4438. sendEventToParent2((hook3) => {
  4439. hook3.once(event, cb);
  4440. });
  4441. },
  4442. off: (event, cb) => {
  4443. sendEventToParent2((hook3) => {
  4444. hook3.off(event, cb);
  4445. });
  4446. },
  4447. emit: (event, ...payload) => {
  4448. sendEventToParent2((hook3) => {
  4449. hook3.emit(event, ...payload);
  4450. });
  4451. }
  4452. };
  4453. Object.defineProperty(target22, "__VUE_DEVTOOLS_GLOBAL_HOOK__", {
  4454. get() {
  4455. return hook2;
  4456. },
  4457. configurable: true
  4458. });
  4459. }
  4460. function injectVueHookToIframe(iframe) {
  4461. if (iframe.__vdevtools__injected) {
  4462. return;
  4463. }
  4464. try {
  4465. iframe.__vdevtools__injected = true;
  4466. const inject = () => {
  4467. try {
  4468. iframe.contentWindow.__VUE_DEVTOOLS_IFRAME__ = iframe;
  4469. const script = iframe.contentDocument.createElement("script");
  4470. script.textContent = `;(${detectIframeApp.toString()})(window, true)`;
  4471. iframe.contentDocument.documentElement.appendChild(script);
  4472. script.parentNode.removeChild(script);
  4473. } catch (e) {
  4474. }
  4475. };
  4476. inject();
  4477. iframe.addEventListener("load", () => inject());
  4478. } catch (e) {
  4479. }
  4480. }
  4481. function injectVueHookToIframes() {
  4482. if (typeof window === "undefined") {
  4483. return;
  4484. }
  4485. const iframes = Array.from(document.querySelectorAll("iframe:not([data-vue-devtools-ignore])"));
  4486. for (const iframe of iframes) {
  4487. injectVueHookToIframe(iframe);
  4488. }
  4489. }
  4490. injectVueHookToIframes();
  4491. let iframeAppChecks = 0;
  4492. const iframeAppCheckTimer = setInterval(() => {
  4493. injectVueHookToIframes();
  4494. iframeAppChecks++;
  4495. if (iframeAppChecks >= 5) {
  4496. clearInterval(iframeAppCheckTimer);
  4497. }
  4498. }, 1e3);
  4499. }
  4500. // src/core/index.ts
  4501. function initDevTools() {
  4502. var _a25;
  4503. detectIframeApp(target13);
  4504. updateDevToolsState({
  4505. vitePluginDetected: getDevToolsEnv().vitePluginDetected
  4506. });
  4507. const isDevToolsNext = ((_a25 = target13.__VUE_DEVTOOLS_GLOBAL_HOOK__) == null ? void 0 : _a25.id) === "vue-devtools-next";
  4508. if (target13.__VUE_DEVTOOLS_GLOBAL_HOOK__ && isDevToolsNext)
  4509. return;
  4510. const _devtoolsHook = createDevToolsHook();
  4511. if (target13.__VUE_DEVTOOLS_HOOK_REPLAY__) {
  4512. try {
  4513. target13.__VUE_DEVTOOLS_HOOK_REPLAY__.forEach((cb) => cb(_devtoolsHook));
  4514. target13.__VUE_DEVTOOLS_HOOK_REPLAY__ = [];
  4515. } catch (e) {
  4516. console.error("[vue-devtools] Error during hook replay", e);
  4517. }
  4518. }
  4519. _devtoolsHook.once("init", (Vue) => {
  4520. target13.__VUE_DEVTOOLS_VUE2_APP_DETECTED__ = true;
  4521. console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 600; font-size: 16px;");
  4522. console.log("%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.", "font-bold: 500; font-size: 14px;");
  4523. const legacyChromeUrl = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
  4524. const legacyFirefoxUrl = "https://addons.mozilla.org/firefox/addon/vue-js-devtools-v6-legacy";
  4525. console.log(`%cThe legacy version of chrome extension that supports both Vue 2 and Vue 3 has been moved to %c ${legacyChromeUrl}`, "font-size: 14px;", "text-decoration: underline; cursor: pointer;font-size: 14px;");
  4526. console.log(`%cThe legacy version of firefox extension that supports both Vue 2 and Vue 3 has been moved to %c ${legacyFirefoxUrl}`, "font-size: 14px;", "text-decoration: underline; cursor: pointer;font-size: 14px;");
  4527. console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 500; font-size: 14px;");
  4528. console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 600; font-size: 16px;");
  4529. });
  4530. hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {
  4531. var _a26;
  4532. addDevToolsPluginToBuffer(pluginDescriptor, setupFn);
  4533. const { app } = (_a26 = activeAppRecord) != null ? _a26 : {};
  4534. if (pluginDescriptor.settings) {
  4535. initPluginSettings(pluginDescriptor.id, pluginDescriptor.settings);
  4536. }
  4537. if (!app)
  4538. return;
  4539. callDevToolsPluginSetupFn([pluginDescriptor, setupFn], app);
  4540. });
  4541. onLegacyDevToolsPluginApiAvailable(() => {
  4542. const normalizedPluginBuffer = devtoolsPluginBuffer.filter(([item]) => item.id !== "components");
  4543. normalizedPluginBuffer.forEach(([pluginDescriptor, setupFn]) => {
  4544. _devtoolsHook.emit("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn, { target: "legacy" });
  4545. });
  4546. });
  4547. hook.on.vueAppInit(async (app, version, types) => {
  4548. const appRecord = createAppRecord(app, types);
  4549. const normalizedAppRecord = {
  4550. ...appRecord,
  4551. app,
  4552. version
  4553. };
  4554. addDevToolsAppRecord(normalizedAppRecord);
  4555. if (devtoolsAppRecords.value.length === 1) {
  4556. setActiveAppRecord(normalizedAppRecord);
  4557. setActiveAppRecordId(normalizedAppRecord.id);
  4558. normalizeRouterInfo(normalizedAppRecord, activeAppRecord);
  4559. registerDevToolsPlugin(normalizedAppRecord.app);
  4560. }
  4561. setupDevToolsPlugin(...createComponentsDevToolsPlugin(normalizedAppRecord.app));
  4562. updateDevToolsState({
  4563. connected: true
  4564. });
  4565. _devtoolsHook.apps.push(app);
  4566. });
  4567. hook.on.vueAppUnmount(async (app) => {
  4568. const activeRecords = devtoolsAppRecords.value.filter((appRecord) => appRecord.app !== app);
  4569. if (activeRecords.length === 0) {
  4570. updateDevToolsState({
  4571. connected: false
  4572. });
  4573. }
  4574. removeDevToolsAppRecord(app);
  4575. removeAppRecordId(app);
  4576. if (activeAppRecord.value.app === app) {
  4577. setActiveAppRecord(activeRecords[0]);
  4578. devtoolsContext.hooks.callHook("sendActiveAppUpdatedToClient" /* SEND_ACTIVE_APP_UNMOUNTED_TO_CLIENT */);
  4579. }
  4580. target13.__VUE_DEVTOOLS_GLOBAL_HOOK__.apps.splice(target13.__VUE_DEVTOOLS_GLOBAL_HOOK__.apps.indexOf(app), 1);
  4581. removeRegisteredPluginApp(app);
  4582. });
  4583. subscribeDevToolsHook(_devtoolsHook);
  4584. if (!target13.__VUE_DEVTOOLS_GLOBAL_HOOK__) {
  4585. Object.defineProperty(target13, "__VUE_DEVTOOLS_GLOBAL_HOOK__", {
  4586. get() {
  4587. return _devtoolsHook;
  4588. },
  4589. configurable: true
  4590. });
  4591. } else {
  4592. if (!isNuxtApp) {
  4593. Object.assign(__VUE_DEVTOOLS_GLOBAL_HOOK__, _devtoolsHook);
  4594. }
  4595. }
  4596. }
  4597. function onDevToolsClientConnected(fn) {
  4598. return new Promise((resolve) => {
  4599. if (devtoolsState.connected && devtoolsState.clientConnected) {
  4600. fn();
  4601. resolve();
  4602. return;
  4603. }
  4604. devtoolsContext.hooks.hook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, ({ state }) => {
  4605. if (state.connected && state.clientConnected) {
  4606. fn();
  4607. resolve();
  4608. }
  4609. });
  4610. });
  4611. }
  4612. // src/core/high-perf-mode/index.ts
  4613. init_esm_shims();
  4614. function toggleHighPerfMode(state) {
  4615. devtoolsState.highPerfModeEnabled = state != null ? state : !devtoolsState.highPerfModeEnabled;
  4616. if (!state && activeAppRecord.value) {
  4617. registerDevToolsPlugin(activeAppRecord.value.app);
  4618. }
  4619. }
  4620. // src/core/component/state/format.ts
  4621. init_esm_shims();
  4622. // src/core/component/state/reviver.ts
  4623. init_esm_shims();
  4624. import { target as target14 } from "@vue/devtools-shared";
  4625. function reviveSet(val) {
  4626. const result = /* @__PURE__ */ new Set();
  4627. const list = val._custom.value;
  4628. for (let i = 0; i < list.length; i++) {
  4629. const value = list[i];
  4630. result.add(revive(value));
  4631. }
  4632. return result;
  4633. }
  4634. function reviveMap(val) {
  4635. const result = /* @__PURE__ */ new Map();
  4636. const list = val._custom.value;
  4637. for (let i = 0; i < list.length; i++) {
  4638. const { key, value } = list[i];
  4639. result.set(key, revive(value));
  4640. }
  4641. return result;
  4642. }
  4643. function revive(val) {
  4644. if (val === UNDEFINED) {
  4645. return void 0;
  4646. } else if (val === INFINITY) {
  4647. return Number.POSITIVE_INFINITY;
  4648. } else if (val === NEGATIVE_INFINITY) {
  4649. return Number.NEGATIVE_INFINITY;
  4650. } else if (val === NAN) {
  4651. return Number.NaN;
  4652. } else if (val && val._custom) {
  4653. const { _custom: custom } = val;
  4654. if (custom.type === "component")
  4655. return activeAppRecord.value.instanceMap.get(custom.id);
  4656. else if (custom.type === "map")
  4657. return reviveMap(val);
  4658. else if (custom.type === "set")
  4659. return reviveSet(val);
  4660. else if (custom.type === "bigint")
  4661. return BigInt(custom.value);
  4662. else
  4663. return revive(custom.value);
  4664. } else if (symbolRE.test(val)) {
  4665. const [, string] = symbolRE.exec(val);
  4666. return Symbol.for(string);
  4667. } else if (specialTypeRE.test(val)) {
  4668. const [, type, string, , details] = specialTypeRE.exec(val);
  4669. const result = new target14[type](string);
  4670. if (type === "Error" && details)
  4671. result.stack = details;
  4672. return result;
  4673. } else {
  4674. return val;
  4675. }
  4676. }
  4677. function reviver(key, value) {
  4678. return revive(value);
  4679. }
  4680. // src/core/component/state/format.ts
  4681. function getInspectorStateValueType(value, raw = true) {
  4682. const type = typeof value;
  4683. if (value == null || value === UNDEFINED || value === "undefined") {
  4684. return "null";
  4685. } else if (type === "boolean" || type === "number" || value === INFINITY || value === NEGATIVE_INFINITY || value === NAN) {
  4686. return "literal";
  4687. } else if (value == null ? void 0 : value._custom) {
  4688. if (raw || value._custom.display != null || value._custom.displayText != null)
  4689. return "custom";
  4690. else
  4691. return getInspectorStateValueType(value._custom.value);
  4692. } else if (typeof value === "string") {
  4693. const typeMatch = specialTypeRE.exec(value);
  4694. if (typeMatch) {
  4695. const [, type2] = typeMatch;
  4696. return `native ${type2}`;
  4697. } else {
  4698. return "string";
  4699. }
  4700. } else if (Array.isArray(value) || (value == null ? void 0 : value._isArray)) {
  4701. return "array";
  4702. } else if (isPlainObject(value)) {
  4703. return "plain-object";
  4704. } else {
  4705. return "unknown";
  4706. }
  4707. }
  4708. function formatInspectorStateValue(value, quotes = false, options) {
  4709. var _a25, _b25, _c;
  4710. const { customClass } = options != null ? options : {};
  4711. let result;
  4712. const type = getInspectorStateValueType(value, false);
  4713. if (type !== "custom" && (value == null ? void 0 : value._custom))
  4714. value = value._custom.value;
  4715. if (result = internalStateTokenToString(value)) {
  4716. return result;
  4717. } else if (type === "custom") {
  4718. const nestedName = ((_a25 = value._custom.value) == null ? void 0 : _a25._custom) && formatInspectorStateValue(value._custom.value, quotes, options);
  4719. return nestedName || value._custom.displayText || value._custom.display;
  4720. } else if (type === "array") {
  4721. return `Array[${value.length}]`;
  4722. } else if (type === "plain-object") {
  4723. return `Object${Object.keys(value).length ? "" : " (empty)"}`;
  4724. } else if (type == null ? void 0 : type.includes("native")) {
  4725. return escape((_b25 = specialTypeRE.exec(value)) == null ? void 0 : _b25[2]);
  4726. } else if (typeof value === "string") {
  4727. const typeMatch = value.match(rawTypeRE);
  4728. if (typeMatch) {
  4729. value = escapeString(typeMatch[1]);
  4730. } else if (quotes) {
  4731. value = `<span>"</span>${(customClass == null ? void 0 : customClass.string) ? `<span class=${customClass.string}>${escapeString(value)}</span>` : escapeString(value)}<span>"</span>`;
  4732. } else {
  4733. value = (customClass == null ? void 0 : customClass.string) ? `<span class="${(_c = customClass == null ? void 0 : customClass.string) != null ? _c : ""}">${escapeString(value)}</span>` : escapeString(value);
  4734. }
  4735. }
  4736. return value;
  4737. }
  4738. function escapeString(value) {
  4739. return escape(value).replace(/ /g, "&nbsp;").replace(/\n/g, "<span>\\n</span>");
  4740. }
  4741. function getRaw(value) {
  4742. var _a25, _b25, _c;
  4743. let customType;
  4744. const isCustom = getInspectorStateValueType(value) === "custom";
  4745. let inherit = {};
  4746. if (isCustom) {
  4747. const data = value;
  4748. const customValue = (_a25 = data._custom) == null ? void 0 : _a25.value;
  4749. const currentCustomType = (_b25 = data._custom) == null ? void 0 : _b25.type;
  4750. const nestedCustom = typeof customValue === "object" && customValue !== null && "_custom" in customValue ? getRaw(customValue) : { inherit: void 0, value: void 0, customType: void 0 };
  4751. inherit = nestedCustom.inherit || ((_c = data._custom) == null ? void 0 : _c.fields) || {};
  4752. value = nestedCustom.value || customValue;
  4753. customType = nestedCustom.customType || currentCustomType;
  4754. }
  4755. if (value && value._isArray)
  4756. value = value.items;
  4757. return { value, inherit, customType };
  4758. }
  4759. function toEdit(value, customType) {
  4760. if (customType === "bigint")
  4761. return value;
  4762. if (customType === "date")
  4763. return value;
  4764. return replaceTokenToString(JSON.stringify(value));
  4765. }
  4766. function toSubmit(value, customType) {
  4767. if (customType === "bigint")
  4768. return BigInt(value);
  4769. if (customType === "date")
  4770. return new Date(value);
  4771. return JSON.parse(replaceStringToToken(value), reviver);
  4772. }
  4773. // src/core/devtools-client/detected.ts
  4774. init_esm_shims();
  4775. import { target as target15 } from "@vue/devtools-shared";
  4776. function updateDevToolsClientDetected(params) {
  4777. devtoolsState.devtoolsClientDetected = {
  4778. ...devtoolsState.devtoolsClientDetected,
  4779. ...params
  4780. };
  4781. const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
  4782. toggleHighPerfMode(!devtoolsClientVisible);
  4783. }
  4784. var _a18, _b18;
  4785. (_b18 = (_a18 = target15).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__) != null ? _b18 : _a18.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ = updateDevToolsClientDetected;
  4786. // src/messaging/index.ts
  4787. init_esm_shims();
  4788. import { target as target21 } from "@vue/devtools-shared";
  4789. import { createBirpc, createBirpcGroup } from "birpc";
  4790. // src/messaging/presets/index.ts
  4791. init_esm_shims();
  4792. // src/messaging/presets/broadcast-channel/index.ts
  4793. init_esm_shims();
  4794. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.js
  4795. init_esm_shims();
  4796. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.js
  4797. init_esm_shims();
  4798. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.js
  4799. init_esm_shims();
  4800. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.js
  4801. init_esm_shims();
  4802. var DoubleIndexedKV = class {
  4803. constructor() {
  4804. this.keyToValue = /* @__PURE__ */ new Map();
  4805. this.valueToKey = /* @__PURE__ */ new Map();
  4806. }
  4807. set(key, value) {
  4808. this.keyToValue.set(key, value);
  4809. this.valueToKey.set(value, key);
  4810. }
  4811. getByKey(key) {
  4812. return this.keyToValue.get(key);
  4813. }
  4814. getByValue(value) {
  4815. return this.valueToKey.get(value);
  4816. }
  4817. clear() {
  4818. this.keyToValue.clear();
  4819. this.valueToKey.clear();
  4820. }
  4821. };
  4822. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.js
  4823. var Registry = class {
  4824. constructor(generateIdentifier) {
  4825. this.generateIdentifier = generateIdentifier;
  4826. this.kv = new DoubleIndexedKV();
  4827. }
  4828. register(value, identifier) {
  4829. if (this.kv.getByValue(value)) {
  4830. return;
  4831. }
  4832. if (!identifier) {
  4833. identifier = this.generateIdentifier(value);
  4834. }
  4835. this.kv.set(identifier, value);
  4836. }
  4837. clear() {
  4838. this.kv.clear();
  4839. }
  4840. getIdentifier(value) {
  4841. return this.kv.getByValue(value);
  4842. }
  4843. getValue(identifier) {
  4844. return this.kv.getByKey(identifier);
  4845. }
  4846. };
  4847. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.js
  4848. var ClassRegistry = class extends Registry {
  4849. constructor() {
  4850. super((c) => c.name);
  4851. this.classToAllowedProps = /* @__PURE__ */ new Map();
  4852. }
  4853. register(value, options) {
  4854. if (typeof options === "object") {
  4855. if (options.allowProps) {
  4856. this.classToAllowedProps.set(value, options.allowProps);
  4857. }
  4858. super.register(value, options.identifier);
  4859. } else {
  4860. super.register(value, options);
  4861. }
  4862. }
  4863. getAllowedProps(value) {
  4864. return this.classToAllowedProps.get(value);
  4865. }
  4866. };
  4867. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.js
  4868. init_esm_shims();
  4869. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.js
  4870. init_esm_shims();
  4871. function valuesOfObj(record) {
  4872. if ("values" in Object) {
  4873. return Object.values(record);
  4874. }
  4875. const values = [];
  4876. for (const key in record) {
  4877. if (record.hasOwnProperty(key)) {
  4878. values.push(record[key]);
  4879. }
  4880. }
  4881. return values;
  4882. }
  4883. function find(record, predicate) {
  4884. const values = valuesOfObj(record);
  4885. if ("find" in values) {
  4886. return values.find(predicate);
  4887. }
  4888. const valuesNotNever = values;
  4889. for (let i = 0; i < valuesNotNever.length; i++) {
  4890. const value = valuesNotNever[i];
  4891. if (predicate(value)) {
  4892. return value;
  4893. }
  4894. }
  4895. return void 0;
  4896. }
  4897. function forEach(record, run) {
  4898. Object.entries(record).forEach(([key, value]) => run(value, key));
  4899. }
  4900. function includes(arr, value) {
  4901. return arr.indexOf(value) !== -1;
  4902. }
  4903. function findArr(record, predicate) {
  4904. for (let i = 0; i < record.length; i++) {
  4905. const value = record[i];
  4906. if (predicate(value)) {
  4907. return value;
  4908. }
  4909. }
  4910. return void 0;
  4911. }
  4912. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.js
  4913. var CustomTransformerRegistry = class {
  4914. constructor() {
  4915. this.transfomers = {};
  4916. }
  4917. register(transformer) {
  4918. this.transfomers[transformer.name] = transformer;
  4919. }
  4920. findApplicable(v) {
  4921. return find(this.transfomers, (transformer) => transformer.isApplicable(v));
  4922. }
  4923. findByName(name) {
  4924. return this.transfomers[name];
  4925. }
  4926. };
  4927. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.js
  4928. init_esm_shims();
  4929. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.js
  4930. init_esm_shims();
  4931. var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
  4932. var isUndefined = (payload) => typeof payload === "undefined";
  4933. var isNull = (payload) => payload === null;
  4934. var isPlainObject2 = (payload) => {
  4935. if (typeof payload !== "object" || payload === null)
  4936. return false;
  4937. if (payload === Object.prototype)
  4938. return false;
  4939. if (Object.getPrototypeOf(payload) === null)
  4940. return true;
  4941. return Object.getPrototypeOf(payload) === Object.prototype;
  4942. };
  4943. var isEmptyObject = (payload) => isPlainObject2(payload) && Object.keys(payload).length === 0;
  4944. var isArray = (payload) => Array.isArray(payload);
  4945. var isString = (payload) => typeof payload === "string";
  4946. var isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
  4947. var isBoolean = (payload) => typeof payload === "boolean";
  4948. var isRegExp = (payload) => payload instanceof RegExp;
  4949. var isMap = (payload) => payload instanceof Map;
  4950. var isSet = (payload) => payload instanceof Set;
  4951. var isSymbol = (payload) => getType(payload) === "Symbol";
  4952. var isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
  4953. var isError = (payload) => payload instanceof Error;
  4954. var isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
  4955. var isPrimitive2 = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
  4956. var isBigint = (payload) => typeof payload === "bigint";
  4957. var isInfinite = (payload) => payload === Infinity || payload === -Infinity;
  4958. var isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
  4959. var isURL = (payload) => payload instanceof URL;
  4960. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.js
  4961. init_esm_shims();
  4962. var escapeKey = (key) => key.replace(/\./g, "\\.");
  4963. var stringifyPath = (path) => path.map(String).map(escapeKey).join(".");
  4964. var parsePath = (string) => {
  4965. const result = [];
  4966. let segment = "";
  4967. for (let i = 0; i < string.length; i++) {
  4968. let char = string.charAt(i);
  4969. const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
  4970. if (isEscapedDot) {
  4971. segment += ".";
  4972. i++;
  4973. continue;
  4974. }
  4975. const isEndOfSegment = char === ".";
  4976. if (isEndOfSegment) {
  4977. result.push(segment);
  4978. segment = "";
  4979. continue;
  4980. }
  4981. segment += char;
  4982. }
  4983. const lastSegment = segment;
  4984. result.push(lastSegment);
  4985. return result;
  4986. };
  4987. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.js
  4988. init_esm_shims();
  4989. function simpleTransformation(isApplicable, annotation, transform, untransform) {
  4990. return {
  4991. isApplicable,
  4992. annotation,
  4993. transform,
  4994. untransform
  4995. };
  4996. }
  4997. var simpleRules = [
  4998. simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
  4999. simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
  5000. if (typeof BigInt !== "undefined") {
  5001. return BigInt(v);
  5002. }
  5003. console.error("Please add a BigInt polyfill.");
  5004. return v;
  5005. }),
  5006. simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
  5007. simpleTransformation(isError, "Error", (v, superJson) => {
  5008. const baseError = {
  5009. name: v.name,
  5010. message: v.message
  5011. };
  5012. superJson.allowedErrorProps.forEach((prop) => {
  5013. baseError[prop] = v[prop];
  5014. });
  5015. return baseError;
  5016. }, (v, superJson) => {
  5017. const e = new Error(v.message);
  5018. e.name = v.name;
  5019. e.stack = v.stack;
  5020. superJson.allowedErrorProps.forEach((prop) => {
  5021. e[prop] = v[prop];
  5022. });
  5023. return e;
  5024. }),
  5025. simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
  5026. const body = regex.slice(1, regex.lastIndexOf("/"));
  5027. const flags = regex.slice(regex.lastIndexOf("/") + 1);
  5028. return new RegExp(body, flags);
  5029. }),
  5030. simpleTransformation(
  5031. isSet,
  5032. "set",
  5033. // (sets only exist in es6+)
  5034. // eslint-disable-next-line es5/no-es6-methods
  5035. (v) => [...v.values()],
  5036. (v) => new Set(v)
  5037. ),
  5038. simpleTransformation(isMap, "map", (v) => [...v.entries()], (v) => new Map(v)),
  5039. simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
  5040. if (isNaNValue(v)) {
  5041. return "NaN";
  5042. }
  5043. if (v > 0) {
  5044. return "Infinity";
  5045. } else {
  5046. return "-Infinity";
  5047. }
  5048. }, Number),
  5049. simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
  5050. return "-0";
  5051. }, Number),
  5052. simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
  5053. ];
  5054. function compositeTransformation(isApplicable, annotation, transform, untransform) {
  5055. return {
  5056. isApplicable,
  5057. annotation,
  5058. transform,
  5059. untransform
  5060. };
  5061. }
  5062. var symbolRule = compositeTransformation((s, superJson) => {
  5063. if (isSymbol(s)) {
  5064. const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
  5065. return isRegistered;
  5066. }
  5067. return false;
  5068. }, (s, superJson) => {
  5069. const identifier = superJson.symbolRegistry.getIdentifier(s);
  5070. return ["symbol", identifier];
  5071. }, (v) => v.description, (_, a, superJson) => {
  5072. const value = superJson.symbolRegistry.getValue(a[1]);
  5073. if (!value) {
  5074. throw new Error("Trying to deserialize unknown symbol");
  5075. }
  5076. return value;
  5077. });
  5078. var constructorToName = [
  5079. Int8Array,
  5080. Uint8Array,
  5081. Int16Array,
  5082. Uint16Array,
  5083. Int32Array,
  5084. Uint32Array,
  5085. Float32Array,
  5086. Float64Array,
  5087. Uint8ClampedArray
  5088. ].reduce((obj, ctor) => {
  5089. obj[ctor.name] = ctor;
  5090. return obj;
  5091. }, {});
  5092. var typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
  5093. const ctor = constructorToName[a[1]];
  5094. if (!ctor) {
  5095. throw new Error("Trying to deserialize unknown typed array");
  5096. }
  5097. return new ctor(v);
  5098. });
  5099. function isInstanceOfRegisteredClass(potentialClass, superJson) {
  5100. if (potentialClass == null ? void 0 : potentialClass.constructor) {
  5101. const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
  5102. return isRegistered;
  5103. }
  5104. return false;
  5105. }
  5106. var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
  5107. const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
  5108. return ["class", identifier];
  5109. }, (clazz, superJson) => {
  5110. const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
  5111. if (!allowedProps) {
  5112. return { ...clazz };
  5113. }
  5114. const result = {};
  5115. allowedProps.forEach((prop) => {
  5116. result[prop] = clazz[prop];
  5117. });
  5118. return result;
  5119. }, (v, a, superJson) => {
  5120. const clazz = superJson.classRegistry.getValue(a[1]);
  5121. if (!clazz) {
  5122. throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
  5123. }
  5124. return Object.assign(Object.create(clazz.prototype), v);
  5125. });
  5126. var customRule = compositeTransformation((value, superJson) => {
  5127. return !!superJson.customTransformerRegistry.findApplicable(value);
  5128. }, (value, superJson) => {
  5129. const transformer = superJson.customTransformerRegistry.findApplicable(value);
  5130. return ["custom", transformer.name];
  5131. }, (value, superJson) => {
  5132. const transformer = superJson.customTransformerRegistry.findApplicable(value);
  5133. return transformer.serialize(value);
  5134. }, (v, a, superJson) => {
  5135. const transformer = superJson.customTransformerRegistry.findByName(a[1]);
  5136. if (!transformer) {
  5137. throw new Error("Trying to deserialize unknown custom value");
  5138. }
  5139. return transformer.deserialize(v);
  5140. });
  5141. var compositeRules = [classRule, symbolRule, customRule, typedArrayRule];
  5142. var transformValue = (value, superJson) => {
  5143. const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
  5144. if (applicableCompositeRule) {
  5145. return {
  5146. value: applicableCompositeRule.transform(value, superJson),
  5147. type: applicableCompositeRule.annotation(value, superJson)
  5148. };
  5149. }
  5150. const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
  5151. if (applicableSimpleRule) {
  5152. return {
  5153. value: applicableSimpleRule.transform(value, superJson),
  5154. type: applicableSimpleRule.annotation
  5155. };
  5156. }
  5157. return void 0;
  5158. };
  5159. var simpleRulesByAnnotation = {};
  5160. simpleRules.forEach((rule) => {
  5161. simpleRulesByAnnotation[rule.annotation] = rule;
  5162. });
  5163. var untransformValue = (json, type, superJson) => {
  5164. if (isArray(type)) {
  5165. switch (type[0]) {
  5166. case "symbol":
  5167. return symbolRule.untransform(json, type, superJson);
  5168. case "class":
  5169. return classRule.untransform(json, type, superJson);
  5170. case "custom":
  5171. return customRule.untransform(json, type, superJson);
  5172. case "typed-array":
  5173. return typedArrayRule.untransform(json, type, superJson);
  5174. default:
  5175. throw new Error("Unknown transformation: " + type);
  5176. }
  5177. } else {
  5178. const transformation = simpleRulesByAnnotation[type];
  5179. if (!transformation) {
  5180. throw new Error("Unknown transformation: " + type);
  5181. }
  5182. return transformation.untransform(json, superJson);
  5183. }
  5184. };
  5185. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.js
  5186. init_esm_shims();
  5187. var getNthKey = (value, n) => {
  5188. if (n > value.size)
  5189. throw new Error("index out of bounds");
  5190. const keys = value.keys();
  5191. while (n > 0) {
  5192. keys.next();
  5193. n--;
  5194. }
  5195. return keys.next().value;
  5196. };
  5197. function validatePath(path) {
  5198. if (includes(path, "__proto__")) {
  5199. throw new Error("__proto__ is not allowed as a property");
  5200. }
  5201. if (includes(path, "prototype")) {
  5202. throw new Error("prototype is not allowed as a property");
  5203. }
  5204. if (includes(path, "constructor")) {
  5205. throw new Error("constructor is not allowed as a property");
  5206. }
  5207. }
  5208. var getDeep = (object, path) => {
  5209. validatePath(path);
  5210. for (let i = 0; i < path.length; i++) {
  5211. const key = path[i];
  5212. if (isSet(object)) {
  5213. object = getNthKey(object, +key);
  5214. } else if (isMap(object)) {
  5215. const row = +key;
  5216. const type = +path[++i] === 0 ? "key" : "value";
  5217. const keyOfRow = getNthKey(object, row);
  5218. switch (type) {
  5219. case "key":
  5220. object = keyOfRow;
  5221. break;
  5222. case "value":
  5223. object = object.get(keyOfRow);
  5224. break;
  5225. }
  5226. } else {
  5227. object = object[key];
  5228. }
  5229. }
  5230. return object;
  5231. };
  5232. var setDeep = (object, path, mapper) => {
  5233. validatePath(path);
  5234. if (path.length === 0) {
  5235. return mapper(object);
  5236. }
  5237. let parent = object;
  5238. for (let i = 0; i < path.length - 1; i++) {
  5239. const key = path[i];
  5240. if (isArray(parent)) {
  5241. const index = +key;
  5242. parent = parent[index];
  5243. } else if (isPlainObject2(parent)) {
  5244. parent = parent[key];
  5245. } else if (isSet(parent)) {
  5246. const row = +key;
  5247. parent = getNthKey(parent, row);
  5248. } else if (isMap(parent)) {
  5249. const isEnd = i === path.length - 2;
  5250. if (isEnd) {
  5251. break;
  5252. }
  5253. const row = +key;
  5254. const type = +path[++i] === 0 ? "key" : "value";
  5255. const keyOfRow = getNthKey(parent, row);
  5256. switch (type) {
  5257. case "key":
  5258. parent = keyOfRow;
  5259. break;
  5260. case "value":
  5261. parent = parent.get(keyOfRow);
  5262. break;
  5263. }
  5264. }
  5265. }
  5266. const lastKey = path[path.length - 1];
  5267. if (isArray(parent)) {
  5268. parent[+lastKey] = mapper(parent[+lastKey]);
  5269. } else if (isPlainObject2(parent)) {
  5270. parent[lastKey] = mapper(parent[lastKey]);
  5271. }
  5272. if (isSet(parent)) {
  5273. const oldValue = getNthKey(parent, +lastKey);
  5274. const newValue = mapper(oldValue);
  5275. if (oldValue !== newValue) {
  5276. parent.delete(oldValue);
  5277. parent.add(newValue);
  5278. }
  5279. }
  5280. if (isMap(parent)) {
  5281. const row = +path[path.length - 2];
  5282. const keyToRow = getNthKey(parent, row);
  5283. const type = +lastKey === 0 ? "key" : "value";
  5284. switch (type) {
  5285. case "key": {
  5286. const newKey = mapper(keyToRow);
  5287. parent.set(newKey, parent.get(keyToRow));
  5288. if (newKey !== keyToRow) {
  5289. parent.delete(keyToRow);
  5290. }
  5291. break;
  5292. }
  5293. case "value": {
  5294. parent.set(keyToRow, mapper(parent.get(keyToRow)));
  5295. break;
  5296. }
  5297. }
  5298. }
  5299. return object;
  5300. };
  5301. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.js
  5302. function traverse(tree, walker2, origin = []) {
  5303. if (!tree) {
  5304. return;
  5305. }
  5306. if (!isArray(tree)) {
  5307. forEach(tree, (subtree, key) => traverse(subtree, walker2, [...origin, ...parsePath(key)]));
  5308. return;
  5309. }
  5310. const [nodeValue, children] = tree;
  5311. if (children) {
  5312. forEach(children, (child, key) => {
  5313. traverse(child, walker2, [...origin, ...parsePath(key)]);
  5314. });
  5315. }
  5316. walker2(nodeValue, origin);
  5317. }
  5318. function applyValueAnnotations(plain, annotations, superJson) {
  5319. traverse(annotations, (type, path) => {
  5320. plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
  5321. });
  5322. return plain;
  5323. }
  5324. function applyReferentialEqualityAnnotations(plain, annotations) {
  5325. function apply(identicalPaths, path) {
  5326. const object = getDeep(plain, parsePath(path));
  5327. identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
  5328. plain = setDeep(plain, identicalObjectPath, () => object);
  5329. });
  5330. }
  5331. if (isArray(annotations)) {
  5332. const [root, other] = annotations;
  5333. root.forEach((identicalPath) => {
  5334. plain = setDeep(plain, parsePath(identicalPath), () => plain);
  5335. });
  5336. if (other) {
  5337. forEach(other, apply);
  5338. }
  5339. } else {
  5340. forEach(annotations, apply);
  5341. }
  5342. return plain;
  5343. }
  5344. var isDeep = (object, superJson) => isPlainObject2(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
  5345. function addIdentity(object, path, identities) {
  5346. const existingSet = identities.get(object);
  5347. if (existingSet) {
  5348. existingSet.push(path);
  5349. } else {
  5350. identities.set(object, [path]);
  5351. }
  5352. }
  5353. function generateReferentialEqualityAnnotations(identitites, dedupe) {
  5354. const result = {};
  5355. let rootEqualityPaths = void 0;
  5356. identitites.forEach((paths) => {
  5357. if (paths.length <= 1) {
  5358. return;
  5359. }
  5360. if (!dedupe) {
  5361. paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length);
  5362. }
  5363. const [representativePath, ...identicalPaths] = paths;
  5364. if (representativePath.length === 0) {
  5365. rootEqualityPaths = identicalPaths.map(stringifyPath);
  5366. } else {
  5367. result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
  5368. }
  5369. });
  5370. if (rootEqualityPaths) {
  5371. if (isEmptyObject(result)) {
  5372. return [rootEqualityPaths];
  5373. } else {
  5374. return [rootEqualityPaths, result];
  5375. }
  5376. } else {
  5377. return isEmptyObject(result) ? void 0 : result;
  5378. }
  5379. }
  5380. var walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
  5381. var _a25;
  5382. const primitive = isPrimitive2(object);
  5383. if (!primitive) {
  5384. addIdentity(object, path, identities);
  5385. const seen = seenObjects.get(object);
  5386. if (seen) {
  5387. return dedupe ? {
  5388. transformedValue: null
  5389. } : seen;
  5390. }
  5391. }
  5392. if (!isDeep(object, superJson)) {
  5393. const transformed2 = transformValue(object, superJson);
  5394. const result2 = transformed2 ? {
  5395. transformedValue: transformed2.value,
  5396. annotations: [transformed2.type]
  5397. } : {
  5398. transformedValue: object
  5399. };
  5400. if (!primitive) {
  5401. seenObjects.set(object, result2);
  5402. }
  5403. return result2;
  5404. }
  5405. if (includes(objectsInThisPath, object)) {
  5406. return {
  5407. transformedValue: null
  5408. };
  5409. }
  5410. const transformationResult = transformValue(object, superJson);
  5411. const transformed = (_a25 = transformationResult == null ? void 0 : transformationResult.value) != null ? _a25 : object;
  5412. const transformedValue = isArray(transformed) ? [] : {};
  5413. const innerAnnotations = {};
  5414. forEach(transformed, (value, index) => {
  5415. if (index === "__proto__" || index === "constructor" || index === "prototype") {
  5416. throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
  5417. }
  5418. const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
  5419. transformedValue[index] = recursiveResult.transformedValue;
  5420. if (isArray(recursiveResult.annotations)) {
  5421. innerAnnotations[index] = recursiveResult.annotations;
  5422. } else if (isPlainObject2(recursiveResult.annotations)) {
  5423. forEach(recursiveResult.annotations, (tree, key) => {
  5424. innerAnnotations[escapeKey(index) + "." + key] = tree;
  5425. });
  5426. }
  5427. });
  5428. const result = isEmptyObject(innerAnnotations) ? {
  5429. transformedValue,
  5430. annotations: !!transformationResult ? [transformationResult.type] : void 0
  5431. } : {
  5432. transformedValue,
  5433. annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
  5434. };
  5435. if (!primitive) {
  5436. seenObjects.set(object, result);
  5437. }
  5438. return result;
  5439. };
  5440. // ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
  5441. init_esm_shims();
  5442. // ../../node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.js
  5443. init_esm_shims();
  5444. function getType2(payload) {
  5445. return Object.prototype.toString.call(payload).slice(8, -1);
  5446. }
  5447. function isArray2(payload) {
  5448. return getType2(payload) === "Array";
  5449. }
  5450. function isPlainObject3(payload) {
  5451. if (getType2(payload) !== "Object")
  5452. return false;
  5453. const prototype = Object.getPrototypeOf(payload);
  5454. return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
  5455. }
  5456. function isNull2(payload) {
  5457. return getType2(payload) === "Null";
  5458. }
  5459. function isOneOf(a, b, c, d, e) {
  5460. return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);
  5461. }
  5462. function isUndefined2(payload) {
  5463. return getType2(payload) === "Undefined";
  5464. }
  5465. var isNullOrUndefined = isOneOf(isNull2, isUndefined2);
  5466. // ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
  5467. function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
  5468. const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
  5469. if (propType === "enumerable")
  5470. carry[key] = newVal;
  5471. if (includeNonenumerable && propType === "nonenumerable") {
  5472. Object.defineProperty(carry, key, {
  5473. value: newVal,
  5474. enumerable: false,
  5475. writable: true,
  5476. configurable: true
  5477. });
  5478. }
  5479. }
  5480. function copy(target22, options = {}) {
  5481. if (isArray2(target22)) {
  5482. return target22.map((item) => copy(item, options));
  5483. }
  5484. if (!isPlainObject3(target22)) {
  5485. return target22;
  5486. }
  5487. const props = Object.getOwnPropertyNames(target22);
  5488. const symbols = Object.getOwnPropertySymbols(target22);
  5489. return [...props, ...symbols].reduce((carry, key) => {
  5490. if (isArray2(options.props) && !options.props.includes(key)) {
  5491. return carry;
  5492. }
  5493. const val = target22[key];
  5494. const newVal = copy(val, options);
  5495. assignProp(carry, key, newVal, target22, options.nonenumerable);
  5496. return carry;
  5497. }, {});
  5498. }
  5499. // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.js
  5500. var SuperJSON = class {
  5501. /**
  5502. * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
  5503. */
  5504. constructor({ dedupe = false } = {}) {
  5505. this.classRegistry = new ClassRegistry();
  5506. this.symbolRegistry = new Registry((s) => {
  5507. var _a25;
  5508. return (_a25 = s.description) != null ? _a25 : "";
  5509. });
  5510. this.customTransformerRegistry = new CustomTransformerRegistry();
  5511. this.allowedErrorProps = [];
  5512. this.dedupe = dedupe;
  5513. }
  5514. serialize(object) {
  5515. const identities = /* @__PURE__ */ new Map();
  5516. const output = walker(object, identities, this, this.dedupe);
  5517. const res = {
  5518. json: output.transformedValue
  5519. };
  5520. if (output.annotations) {
  5521. res.meta = {
  5522. ...res.meta,
  5523. values: output.annotations
  5524. };
  5525. }
  5526. const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
  5527. if (equalityAnnotations) {
  5528. res.meta = {
  5529. ...res.meta,
  5530. referentialEqualities: equalityAnnotations
  5531. };
  5532. }
  5533. return res;
  5534. }
  5535. deserialize(payload) {
  5536. const { json, meta } = payload;
  5537. let result = copy(json);
  5538. if (meta == null ? void 0 : meta.values) {
  5539. result = applyValueAnnotations(result, meta.values, this);
  5540. }
  5541. if (meta == null ? void 0 : meta.referentialEqualities) {
  5542. result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
  5543. }
  5544. return result;
  5545. }
  5546. stringify(object) {
  5547. return JSON.stringify(this.serialize(object));
  5548. }
  5549. parse(string) {
  5550. return this.deserialize(JSON.parse(string));
  5551. }
  5552. registerClass(v, options) {
  5553. this.classRegistry.register(v, options);
  5554. }
  5555. registerSymbol(v, identifier) {
  5556. this.symbolRegistry.register(v, identifier);
  5557. }
  5558. registerCustom(transformer, name) {
  5559. this.customTransformerRegistry.register({
  5560. name,
  5561. ...transformer
  5562. });
  5563. }
  5564. allowErrorProps(...props) {
  5565. this.allowedErrorProps.push(...props);
  5566. }
  5567. };
  5568. SuperJSON.defaultInstance = new SuperJSON();
  5569. SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
  5570. SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
  5571. SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
  5572. SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
  5573. SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
  5574. SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
  5575. SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
  5576. SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
  5577. var serialize = SuperJSON.serialize;
  5578. var deserialize = SuperJSON.deserialize;
  5579. var stringify = SuperJSON.stringify;
  5580. var parse = SuperJSON.parse;
  5581. var registerClass = SuperJSON.registerClass;
  5582. var registerCustom = SuperJSON.registerCustom;
  5583. var registerSymbol = SuperJSON.registerSymbol;
  5584. var allowErrorProps = SuperJSON.allowErrorProps;
  5585. // src/messaging/presets/broadcast-channel/context.ts
  5586. init_esm_shims();
  5587. var __DEVTOOLS_KIT_BROADCAST_MESSAGING_EVENT_KEY = "__devtools-kit-broadcast-messaging-event-key__";
  5588. // src/messaging/presets/broadcast-channel/index.ts
  5589. var BROADCAST_CHANNEL_NAME = "__devtools-kit:broadcast-channel__";
  5590. function createBroadcastChannel() {
  5591. const channel = new BroadcastChannel(BROADCAST_CHANNEL_NAME);
  5592. return {
  5593. post: (data) => {
  5594. channel.postMessage(SuperJSON.stringify({
  5595. event: __DEVTOOLS_KIT_BROADCAST_MESSAGING_EVENT_KEY,
  5596. data
  5597. }));
  5598. },
  5599. on: (handler) => {
  5600. channel.onmessage = (event) => {
  5601. const parsed = SuperJSON.parse(event.data);
  5602. if (parsed.event === __DEVTOOLS_KIT_BROADCAST_MESSAGING_EVENT_KEY) {
  5603. handler(parsed.data);
  5604. }
  5605. };
  5606. }
  5607. };
  5608. }
  5609. // src/messaging/presets/electron/index.ts
  5610. init_esm_shims();
  5611. // src/messaging/presets/electron/client.ts
  5612. init_esm_shims();
  5613. // src/messaging/presets/electron/context.ts
  5614. init_esm_shims();
  5615. import { target as target16 } from "@vue/devtools-shared";
  5616. var __ELECTRON_CLIENT_CONTEXT__ = "electron:client-context";
  5617. var __ELECTRON_RPOXY_CONTEXT__ = "electron:proxy-context";
  5618. var __ELECTRON_SERVER_CONTEXT__ = "electron:server-context";
  5619. var __DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__ = {
  5620. // client
  5621. CLIENT_TO_PROXY: "client->proxy",
  5622. // on: proxy->client
  5623. // proxy
  5624. PROXY_TO_CLIENT: "proxy->client",
  5625. // on: server->proxy
  5626. PROXY_TO_SERVER: "proxy->server",
  5627. // on: client->proxy
  5628. // server
  5629. SERVER_TO_PROXY: "server->proxy"
  5630. // on: proxy->server
  5631. };
  5632. function getElectronClientContext() {
  5633. return target16[__ELECTRON_CLIENT_CONTEXT__];
  5634. }
  5635. function setElectronClientContext(context) {
  5636. target16[__ELECTRON_CLIENT_CONTEXT__] = context;
  5637. }
  5638. function getElectronProxyContext() {
  5639. return target16[__ELECTRON_RPOXY_CONTEXT__];
  5640. }
  5641. function setElectronProxyContext(context) {
  5642. target16[__ELECTRON_RPOXY_CONTEXT__] = context;
  5643. }
  5644. function getElectronServerContext() {
  5645. return target16[__ELECTRON_SERVER_CONTEXT__];
  5646. }
  5647. function setElectronServerContext(context) {
  5648. target16[__ELECTRON_SERVER_CONTEXT__] = context;
  5649. }
  5650. // src/messaging/presets/electron/client.ts
  5651. function createElectronClientChannel() {
  5652. const socket = getElectronClientContext();
  5653. return {
  5654. post: (data) => {
  5655. socket.emit(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.CLIENT_TO_PROXY, SuperJSON.stringify(data));
  5656. },
  5657. on: (handler) => {
  5658. socket.on(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.PROXY_TO_CLIENT, (e) => {
  5659. handler(SuperJSON.parse(e));
  5660. });
  5661. }
  5662. };
  5663. }
  5664. // src/messaging/presets/electron/proxy.ts
  5665. init_esm_shims();
  5666. function createElectronProxyChannel() {
  5667. const socket = getElectronProxyContext();
  5668. return {
  5669. post: (data) => {
  5670. },
  5671. on: (handler) => {
  5672. socket.on(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY, (data) => {
  5673. socket.broadcast.emit(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.PROXY_TO_CLIENT, data);
  5674. });
  5675. socket.on(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.CLIENT_TO_PROXY, (data) => {
  5676. socket.broadcast.emit(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER, data);
  5677. });
  5678. }
  5679. };
  5680. }
  5681. // src/messaging/presets/electron/server.ts
  5682. init_esm_shims();
  5683. function createElectronServerChannel() {
  5684. const socket = getElectronServerContext();
  5685. return {
  5686. post: (data) => {
  5687. socket.emit(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY, SuperJSON.stringify(data));
  5688. },
  5689. on: (handler) => {
  5690. socket.on(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER, (data) => {
  5691. handler(SuperJSON.parse(data));
  5692. });
  5693. }
  5694. };
  5695. }
  5696. // src/messaging/presets/extension/index.ts
  5697. init_esm_shims();
  5698. // src/messaging/presets/extension/client.ts
  5699. init_esm_shims();
  5700. // src/messaging/presets/extension/context.ts
  5701. init_esm_shims();
  5702. import { target as target17 } from "@vue/devtools-shared";
  5703. var __EXTENSION_CLIENT_CONTEXT__ = "electron:client-context";
  5704. var __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__ = {
  5705. // client
  5706. CLIENT_TO_PROXY: "client->proxy",
  5707. // on: proxy->client
  5708. // proxy
  5709. PROXY_TO_CLIENT: "proxy->client",
  5710. // on: server->proxy
  5711. PROXY_TO_SERVER: "proxy->server",
  5712. // on: client->proxy
  5713. // server
  5714. SERVER_TO_PROXY: "server->proxy"
  5715. // on: proxy->server
  5716. };
  5717. function getExtensionClientContext() {
  5718. return target17[__EXTENSION_CLIENT_CONTEXT__];
  5719. }
  5720. function setExtensionClientContext(context) {
  5721. target17[__EXTENSION_CLIENT_CONTEXT__] = context;
  5722. }
  5723. // src/messaging/presets/extension/client.ts
  5724. function createExtensionClientChannel() {
  5725. let disconnected = false;
  5726. let port = null;
  5727. let reconnectTimer = null;
  5728. let onMessageHandler = null;
  5729. function connect() {
  5730. try {
  5731. clearTimeout(reconnectTimer);
  5732. port = chrome.runtime.connect({
  5733. name: `${chrome.devtools.inspectedWindow.tabId}`
  5734. });
  5735. setExtensionClientContext(port);
  5736. disconnected = false;
  5737. port == null ? void 0 : port.onMessage.addListener(onMessageHandler);
  5738. port.onDisconnect.addListener(() => {
  5739. disconnected = true;
  5740. port == null ? void 0 : port.onMessage.removeListener(onMessageHandler);
  5741. reconnectTimer = setTimeout(connect, 1e3);
  5742. });
  5743. } catch (e) {
  5744. disconnected = true;
  5745. }
  5746. }
  5747. connect();
  5748. return {
  5749. post: (data) => {
  5750. if (disconnected) {
  5751. return;
  5752. }
  5753. port == null ? void 0 : port.postMessage(SuperJSON.stringify(data));
  5754. },
  5755. on: (handler) => {
  5756. onMessageHandler = (data) => {
  5757. if (disconnected) {
  5758. return;
  5759. }
  5760. handler(SuperJSON.parse(data));
  5761. };
  5762. port == null ? void 0 : port.onMessage.addListener(onMessageHandler);
  5763. }
  5764. };
  5765. }
  5766. // src/messaging/presets/extension/proxy.ts
  5767. init_esm_shims();
  5768. function createExtensionProxyChannel() {
  5769. const port = chrome.runtime.connect({
  5770. name: "content-script"
  5771. });
  5772. function sendMessageToUserApp(payload) {
  5773. window.postMessage({
  5774. source: __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER,
  5775. payload
  5776. }, "*");
  5777. }
  5778. function sendMessageToDevToolsClient(e) {
  5779. if (e.data && e.data.source === __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY) {
  5780. try {
  5781. port.postMessage(e.data.payload);
  5782. } catch (e2) {
  5783. }
  5784. }
  5785. }
  5786. port.onMessage.addListener(sendMessageToUserApp);
  5787. window.addEventListener("message", sendMessageToDevToolsClient);
  5788. port.onDisconnect.addListener(() => {
  5789. window.removeEventListener("message", sendMessageToDevToolsClient);
  5790. sendMessageToUserApp(SuperJSON.stringify({
  5791. event: "shutdown"
  5792. }));
  5793. });
  5794. sendMessageToUserApp(SuperJSON.stringify({
  5795. event: "init"
  5796. }));
  5797. return {
  5798. post: (data) => {
  5799. },
  5800. on: (handler) => {
  5801. }
  5802. };
  5803. }
  5804. // src/messaging/presets/extension/server.ts
  5805. init_esm_shims();
  5806. function createExtensionServerChannel() {
  5807. return {
  5808. post: (data) => {
  5809. window.postMessage({
  5810. source: __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY,
  5811. payload: SuperJSON.stringify(data)
  5812. }, "*");
  5813. },
  5814. on: (handler) => {
  5815. const listener = (event) => {
  5816. if (event.data.source === __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER && event.data.payload) {
  5817. handler(SuperJSON.parse(event.data.payload));
  5818. }
  5819. };
  5820. window.addEventListener("message", listener);
  5821. return () => {
  5822. window.removeEventListener("message", listener);
  5823. };
  5824. }
  5825. };
  5826. }
  5827. // src/messaging/presets/iframe/index.ts
  5828. init_esm_shims();
  5829. // src/messaging/presets/iframe/client.ts
  5830. init_esm_shims();
  5831. import { isBrowser as isBrowser4 } from "@vue/devtools-shared";
  5832. // src/messaging/presets/iframe/context.ts
  5833. init_esm_shims();
  5834. import { target as target18 } from "@vue/devtools-shared";
  5835. var __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY = "__devtools-kit-iframe-messaging-event-key__";
  5836. var __IFRAME_SERVER_CONTEXT__ = "iframe:server-context";
  5837. function getIframeServerContext() {
  5838. return target18[__IFRAME_SERVER_CONTEXT__];
  5839. }
  5840. function setIframeServerContext(context) {
  5841. target18[__IFRAME_SERVER_CONTEXT__] = context;
  5842. }
  5843. // src/messaging/presets/iframe/client.ts
  5844. function createIframeClientChannel() {
  5845. if (!isBrowser4) {
  5846. return {
  5847. post: (data) => {
  5848. },
  5849. on: (handler) => {
  5850. }
  5851. };
  5852. }
  5853. return {
  5854. post: (data) => window.parent.postMessage(SuperJSON.stringify({
  5855. event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
  5856. data
  5857. }), "*"),
  5858. on: (handler) => window.addEventListener("message", (event) => {
  5859. try {
  5860. const parsed = SuperJSON.parse(event.data);
  5861. if (event.source === window.parent && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {
  5862. handler(parsed.data);
  5863. }
  5864. } catch (e) {
  5865. }
  5866. })
  5867. };
  5868. }
  5869. // src/messaging/presets/iframe/server.ts
  5870. init_esm_shims();
  5871. import { isBrowser as isBrowser5 } from "@vue/devtools-shared";
  5872. function createIframeServerChannel() {
  5873. if (!isBrowser5) {
  5874. return {
  5875. post: (data) => {
  5876. },
  5877. on: (handler) => {
  5878. }
  5879. };
  5880. }
  5881. return {
  5882. post: (data) => {
  5883. var _a25;
  5884. const iframe = getIframeServerContext();
  5885. (_a25 = iframe == null ? void 0 : iframe.contentWindow) == null ? void 0 : _a25.postMessage(SuperJSON.stringify({
  5886. event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
  5887. data
  5888. }), "*");
  5889. },
  5890. on: (handler) => {
  5891. window.addEventListener("message", (event) => {
  5892. const iframe = getIframeServerContext();
  5893. try {
  5894. const parsed = SuperJSON.parse(event.data);
  5895. if (event.source === (iframe == null ? void 0 : iframe.contentWindow) && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {
  5896. handler(parsed.data);
  5897. }
  5898. } catch (e) {
  5899. }
  5900. });
  5901. }
  5902. };
  5903. }
  5904. // src/messaging/presets/vite/index.ts
  5905. init_esm_shims();
  5906. // src/messaging/presets/vite/client.ts
  5907. init_esm_shims();
  5908. // src/messaging/presets/vite/context.ts
  5909. init_esm_shims();
  5910. import { target as target19 } from "@vue/devtools-shared";
  5911. var __DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY = "__devtools-kit-vite-messaging-event-key__";
  5912. var __VITE_CLIENT_CONTEXT__ = "vite:client-context";
  5913. var __VITE_SERVER_CONTEXT__ = "vite:server-context";
  5914. function getViteClientContext() {
  5915. return target19[__VITE_CLIENT_CONTEXT__];
  5916. }
  5917. function setViteClientContext(context) {
  5918. target19[__VITE_CLIENT_CONTEXT__] = context;
  5919. }
  5920. function getViteServerContext() {
  5921. return target19[__VITE_SERVER_CONTEXT__];
  5922. }
  5923. function setViteServerContext(context) {
  5924. target19[__VITE_SERVER_CONTEXT__] = context;
  5925. }
  5926. // src/messaging/presets/vite/client.ts
  5927. function createViteClientChannel() {
  5928. const client = getViteClientContext();
  5929. return {
  5930. post: (data) => {
  5931. client == null ? void 0 : client.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data));
  5932. },
  5933. on: (handler) => {
  5934. client == null ? void 0 : client.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {
  5935. handler(SuperJSON.parse(event));
  5936. });
  5937. }
  5938. };
  5939. }
  5940. // src/messaging/presets/vite/server.ts
  5941. init_esm_shims();
  5942. function createViteServerChannel() {
  5943. var _a25;
  5944. const viteServer = getViteServerContext();
  5945. const ws = (_a25 = viteServer.hot) != null ? _a25 : viteServer.ws;
  5946. return {
  5947. post: (data) => ws == null ? void 0 : ws.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data)),
  5948. on: (handler) => ws == null ? void 0 : ws.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {
  5949. handler(SuperJSON.parse(event));
  5950. })
  5951. };
  5952. }
  5953. // src/messaging/presets/ws/index.ts
  5954. init_esm_shims();
  5955. // src/messaging/presets/ws/client.ts
  5956. init_esm_shims();
  5957. // src/messaging/presets/ws/context.ts
  5958. init_esm_shims();
  5959. import { target as target20 } from "@vue/devtools-shared";
  5960. // src/messaging/presets/ws/server.ts
  5961. init_esm_shims();
  5962. // src/messaging/index.ts
  5963. var _a19, _b19;
  5964. (_b19 = (_a19 = target21).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__) != null ? _b19 : _a19.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ = [];
  5965. var _a20, _b20;
  5966. (_b20 = (_a20 = target21).__VUE_DEVTOOLS_KIT_RPC_CLIENT__) != null ? _b20 : _a20.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = null;
  5967. var _a21, _b21;
  5968. (_b21 = (_a21 = target21).__VUE_DEVTOOLS_KIT_RPC_SERVER__) != null ? _b21 : _a21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = null;
  5969. var _a22, _b22;
  5970. (_b22 = (_a22 = target21).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__) != null ? _b22 : _a22.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = null;
  5971. var _a23, _b23;
  5972. (_b23 = (_a23 = target21).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__) != null ? _b23 : _a23.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = null;
  5973. var _a24, _b24;
  5974. (_b24 = (_a24 = target21).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__) != null ? _b24 : _a24.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ = null;
  5975. function setRpcClientToGlobal(rpc) {
  5976. target21.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = rpc;
  5977. }
  5978. function setRpcServerToGlobal(rpc) {
  5979. target21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = rpc;
  5980. }
  5981. function getRpcClient() {
  5982. return target21.__VUE_DEVTOOLS_KIT_RPC_CLIENT__;
  5983. }
  5984. function getRpcServer() {
  5985. return target21.__VUE_DEVTOOLS_KIT_RPC_SERVER__;
  5986. }
  5987. function setViteRpcClientToGlobal(rpc) {
  5988. target21.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = rpc;
  5989. }
  5990. function setViteRpcServerToGlobal(rpc) {
  5991. target21.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = rpc;
  5992. }
  5993. function getViteRpcClient() {
  5994. return target21.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__;
  5995. }
  5996. function getViteRpcServer() {
  5997. return target21.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__;
  5998. }
  5999. function getChannel(preset, host = "client") {
  6000. const channel = {
  6001. iframe: {
  6002. client: createIframeClientChannel,
  6003. server: createIframeServerChannel
  6004. }[host],
  6005. electron: {
  6006. client: createElectronClientChannel,
  6007. proxy: createElectronProxyChannel,
  6008. server: createElectronServerChannel
  6009. }[host],
  6010. vite: {
  6011. client: createViteClientChannel,
  6012. server: createViteServerChannel
  6013. }[host],
  6014. broadcast: {
  6015. client: createBroadcastChannel,
  6016. server: createBroadcastChannel
  6017. }[host],
  6018. extension: {
  6019. client: createExtensionClientChannel,
  6020. proxy: createExtensionProxyChannel,
  6021. server: createExtensionServerChannel
  6022. }[host]
  6023. }[preset];
  6024. return channel();
  6025. }
  6026. function createRpcClient(functions, options = {}) {
  6027. const { channel: _channel, options: _options, preset } = options;
  6028. const channel = preset ? getChannel(preset) : _channel;
  6029. const rpc = createBirpc(functions, {
  6030. ..._options,
  6031. ...channel,
  6032. timeout: -1
  6033. });
  6034. if (preset === "vite") {
  6035. setViteRpcClientToGlobal(rpc);
  6036. return;
  6037. }
  6038. setRpcClientToGlobal(rpc);
  6039. return rpc;
  6040. }
  6041. function createRpcServer(functions, options = {}) {
  6042. const { channel: _channel, options: _options, preset } = options;
  6043. const channel = preset ? getChannel(preset, "server") : _channel;
  6044. const rpcServer = getRpcServer();
  6045. if (!rpcServer) {
  6046. const group = createBirpcGroup(functions, [channel], {
  6047. ..._options,
  6048. timeout: -1
  6049. });
  6050. if (preset === "vite") {
  6051. setViteRpcServerToGlobal(group);
  6052. return;
  6053. }
  6054. setRpcServerToGlobal(group);
  6055. } else {
  6056. rpcServer.updateChannels((channels) => {
  6057. channels.push(channel);
  6058. });
  6059. }
  6060. }
  6061. function createRpcProxy(options = {}) {
  6062. const { channel: _channel, options: _options, preset } = options;
  6063. const channel = preset ? getChannel(preset, "proxy") : _channel;
  6064. return createBirpc({}, {
  6065. ..._options,
  6066. ...channel,
  6067. timeout: -1
  6068. });
  6069. }
  6070. // src/shared/index.ts
  6071. init_esm_shims();
  6072. // src/shared/env.ts
  6073. init_esm_shims();
  6074. // src/shared/time.ts
  6075. init_esm_shims();
  6076. // src/shared/util.ts
  6077. init_esm_shims();
  6078. // src/core/component/state/replacer.ts
  6079. init_esm_shims();
  6080. // src/core/component/state/custom.ts
  6081. init_esm_shims();
  6082. function getFunctionDetails(func) {
  6083. let string = "";
  6084. let matches = null;
  6085. try {
  6086. string = Function.prototype.toString.call(func);
  6087. matches = String.prototype.match.call(string, /\([\s\S]*?\)/);
  6088. } catch (e) {
  6089. }
  6090. const match = matches && matches[0];
  6091. const args = typeof match === "string" ? match : "(?)";
  6092. const name = typeof func.name === "string" ? func.name : "";
  6093. return {
  6094. _custom: {
  6095. type: "function",
  6096. displayText: `<span style="opacity:.8;margin-right:5px;">function</span> <span style="white-space:nowrap;">${escape(name)}${args}</span>`,
  6097. tooltipText: string.trim() ? `<pre>${string}</pre>` : null
  6098. }
  6099. };
  6100. }
  6101. function getBigIntDetails(val) {
  6102. const stringifiedBigInt = BigInt.prototype.toString.call(val);
  6103. return {
  6104. _custom: {
  6105. type: "bigint",
  6106. displayText: `BigInt(${stringifiedBigInt})`,
  6107. value: stringifiedBigInt
  6108. }
  6109. };
  6110. }
  6111. function getDateDetails(val) {
  6112. const date = new Date(val.getTime());
  6113. date.setMinutes(date.getMinutes() - date.getTimezoneOffset());
  6114. return {
  6115. _custom: {
  6116. type: "date",
  6117. displayText: Date.prototype.toString.call(val),
  6118. value: date.toISOString().slice(0, -1)
  6119. }
  6120. };
  6121. }
  6122. function getMapDetails(val) {
  6123. const list = Object.fromEntries(val);
  6124. return {
  6125. _custom: {
  6126. type: "map",
  6127. displayText: "Map",
  6128. value: list,
  6129. readOnly: true,
  6130. fields: {
  6131. abstract: true
  6132. }
  6133. }
  6134. };
  6135. }
  6136. function getSetDetails(val) {
  6137. const list = Array.from(val);
  6138. return {
  6139. _custom: {
  6140. type: "set",
  6141. displayText: `Set[${list.length}]`,
  6142. value: list,
  6143. readOnly: true
  6144. }
  6145. };
  6146. }
  6147. function getCaughtGetters(store) {
  6148. const getters = {};
  6149. const origGetters = store.getters || {};
  6150. const keys = Object.keys(origGetters);
  6151. for (let i = 0; i < keys.length; i++) {
  6152. const key = keys[i];
  6153. Object.defineProperty(getters, key, {
  6154. enumerable: true,
  6155. get: () => {
  6156. try {
  6157. return origGetters[key];
  6158. } catch (e) {
  6159. return e;
  6160. }
  6161. }
  6162. });
  6163. }
  6164. return getters;
  6165. }
  6166. function reduceStateList(list) {
  6167. if (!list.length)
  6168. return void 0;
  6169. return list.reduce((map, item) => {
  6170. const key = item.type || "data";
  6171. const obj = map[key] = map[key] || {};
  6172. obj[item.key] = item.value;
  6173. return map;
  6174. }, {});
  6175. }
  6176. function namedNodeMapToObject(map) {
  6177. const result = {};
  6178. const l = map.length;
  6179. for (let i = 0; i < l; i++) {
  6180. const node = map.item(i);
  6181. result[node.name] = node.value;
  6182. }
  6183. return result;
  6184. }
  6185. function getStoreDetails(store) {
  6186. return {
  6187. _custom: {
  6188. type: "store",
  6189. displayText: "Store",
  6190. value: {
  6191. state: store.state,
  6192. getters: getCaughtGetters(store)
  6193. },
  6194. fields: {
  6195. abstract: true
  6196. }
  6197. }
  6198. };
  6199. }
  6200. function getRouterDetails(router) {
  6201. return {
  6202. _custom: {
  6203. type: "router",
  6204. displayText: "VueRouter",
  6205. value: {
  6206. options: router.options,
  6207. currentRoute: router.currentRoute
  6208. },
  6209. fields: {
  6210. abstract: true
  6211. }
  6212. }
  6213. };
  6214. }
  6215. function getInstanceDetails(instance) {
  6216. if (instance._)
  6217. instance = instance._;
  6218. const state = processInstanceState(instance);
  6219. return {
  6220. _custom: {
  6221. type: "component",
  6222. id: instance.__VUE_DEVTOOLS_NEXT_UID__,
  6223. displayText: getInstanceName(instance),
  6224. tooltipText: "Component instance",
  6225. value: reduceStateList(state),
  6226. fields: {
  6227. abstract: true
  6228. }
  6229. }
  6230. };
  6231. }
  6232. function getComponentDefinitionDetails(definition) {
  6233. let display = getComponentName(definition);
  6234. if (display) {
  6235. if (definition.name && definition.__file)
  6236. display += ` <span>(${definition.__file})</span>`;
  6237. } else {
  6238. display = "<i>Unknown Component</i>";
  6239. }
  6240. return {
  6241. _custom: {
  6242. type: "component-definition",
  6243. displayText: display,
  6244. tooltipText: "Component definition",
  6245. ...definition.__file ? {
  6246. file: definition.__file
  6247. } : {}
  6248. }
  6249. };
  6250. }
  6251. function getHTMLElementDetails(value) {
  6252. try {
  6253. return {
  6254. _custom: {
  6255. type: "HTMLElement",
  6256. displayText: `<span class="opacity-30">&lt;</span><span class="text-blue-500">${value.tagName.toLowerCase()}</span><span class="opacity-30">&gt;</span>`,
  6257. value: namedNodeMapToObject(value.attributes)
  6258. }
  6259. };
  6260. } catch (e) {
  6261. return {
  6262. _custom: {
  6263. type: "HTMLElement",
  6264. displayText: `<span class="text-blue-500">${String(value)}</span>`
  6265. }
  6266. };
  6267. }
  6268. }
  6269. function tryGetRefValue(ref) {
  6270. if (ensurePropertyExists(ref, "_value", true)) {
  6271. return ref._value;
  6272. }
  6273. if (ensurePropertyExists(ref, "value", true)) {
  6274. return ref.value;
  6275. }
  6276. }
  6277. function getObjectDetails(object) {
  6278. var _a25, _b25, _c, _d;
  6279. const info = getSetupStateType(object);
  6280. const isState = info.ref || info.computed || info.reactive;
  6281. if (isState) {
  6282. const stateTypeName = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
  6283. const value = toRaw2(info.reactive ? object : tryGetRefValue(object));
  6284. const raw = ensurePropertyExists(object, "effect") ? ((_b25 = (_a25 = object.effect) == null ? void 0 : _a25.raw) == null ? void 0 : _b25.toString()) || ((_d = (_c = object.effect) == null ? void 0 : _c.fn) == null ? void 0 : _d.toString()) : null;
  6285. return {
  6286. _custom: {
  6287. type: stateTypeName == null ? void 0 : stateTypeName.toLowerCase(),
  6288. stateTypeName,
  6289. value,
  6290. ...raw ? { tooltipText: `<span class="font-mono">${raw}</span>` } : {}
  6291. }
  6292. };
  6293. }
  6294. if (ensurePropertyExists(object, "__asyncLoader") && typeof object.__asyncLoader === "function") {
  6295. return {
  6296. _custom: {
  6297. type: "component-definition",
  6298. display: "Async component definition"
  6299. }
  6300. };
  6301. }
  6302. }
  6303. // src/core/component/state/replacer.ts
  6304. function stringifyReplacer(key, _value, depth, seenInstance) {
  6305. var _a25;
  6306. if (key === "compilerOptions")
  6307. return;
  6308. const val = this[key];
  6309. const type = typeof val;
  6310. if (Array.isArray(val)) {
  6311. const l = val.length;
  6312. if (l > MAX_ARRAY_SIZE) {
  6313. return {
  6314. _isArray: true,
  6315. length: l,
  6316. items: val.slice(0, MAX_ARRAY_SIZE)
  6317. };
  6318. }
  6319. return val;
  6320. } else if (typeof val === "string") {
  6321. if (val.length > MAX_STRING_SIZE)
  6322. return `${val.substring(0, MAX_STRING_SIZE)}... (${val.length} total length)`;
  6323. else
  6324. return val;
  6325. } else if (type === "undefined") {
  6326. return UNDEFINED;
  6327. } else if (val === Number.POSITIVE_INFINITY) {
  6328. return INFINITY;
  6329. } else if (val === Number.NEGATIVE_INFINITY) {
  6330. return NEGATIVE_INFINITY;
  6331. } else if (typeof val === "function") {
  6332. return getFunctionDetails(val);
  6333. } else if (type === "symbol") {
  6334. return `[native Symbol ${Symbol.prototype.toString.call(val)}]`;
  6335. } else if (typeof val === "bigint") {
  6336. return getBigIntDetails(val);
  6337. } else if (val !== null && typeof val === "object") {
  6338. const proto = Object.prototype.toString.call(val);
  6339. if (proto === "[object Map]") {
  6340. return getMapDetails(val);
  6341. } else if (proto === "[object Set]") {
  6342. return getSetDetails(val);
  6343. } else if (proto === "[object RegExp]") {
  6344. return `[native RegExp ${RegExp.prototype.toString.call(val)}]`;
  6345. } else if (proto === "[object Date]") {
  6346. return getDateDetails(val);
  6347. } else if (proto === "[object Error]") {
  6348. return `[native Error ${val.message}<>${val.stack}]`;
  6349. } else if (ensurePropertyExists(val, "state", true) && ensurePropertyExists(val, "_vm", true)) {
  6350. return getStoreDetails(val);
  6351. } else if (val.constructor && val.constructor.name === "VueRouter") {
  6352. return getRouterDetails(val);
  6353. } else if (isVueInstance(val)) {
  6354. const componentVal = getInstanceDetails(val);
  6355. const parentInstanceDepth = seenInstance == null ? void 0 : seenInstance.get(val);
  6356. if (parentInstanceDepth && parentInstanceDepth < depth) {
  6357. return `[[CircularRef]] <${componentVal._custom.displayText}>`;
  6358. }
  6359. seenInstance == null ? void 0 : seenInstance.set(val, depth);
  6360. return componentVal;
  6361. } else if (ensurePropertyExists(val, "render", true) && typeof val.render === "function") {
  6362. return getComponentDefinitionDetails(val);
  6363. } else if (val.constructor && val.constructor.name === "VNode") {
  6364. return `[native VNode <${val.tag}>]`;
  6365. } else if (typeof HTMLElement !== "undefined" && val instanceof HTMLElement) {
  6366. return getHTMLElementDetails(val);
  6367. } else if (((_a25 = val.constructor) == null ? void 0 : _a25.name) === "Store" && "_wrappedGetters" in val) {
  6368. return "[object Store]";
  6369. } else if (ensurePropertyExists(val, "currentRoute", true)) {
  6370. return "[object Router]";
  6371. }
  6372. const customDetails = getObjectDetails(val);
  6373. if (customDetails != null)
  6374. return customDetails;
  6375. } else if (Number.isNaN(val)) {
  6376. return NAN;
  6377. }
  6378. return sanitize(val);
  6379. }
  6380. // src/shared/transfer.ts
  6381. init_esm_shims();
  6382. var MAX_SERIALIZED_SIZE = 2 * 1024 * 1024;
  6383. function isObject(_data, proto) {
  6384. return proto === "[object Object]";
  6385. }
  6386. function isArray3(_data, proto) {
  6387. return proto === "[object Array]";
  6388. }
  6389. function isVueReactiveLinkNode(node) {
  6390. var _a25;
  6391. const constructorName = (_a25 = node == null ? void 0 : node.constructor) == null ? void 0 : _a25.name;
  6392. return constructorName === "Dep" && "activeLink" in node || constructorName === "Link" && "dep" in node;
  6393. }
  6394. function encode(data, replacer, list, seen, depth = 0, seenVueInstance = /* @__PURE__ */ new Map()) {
  6395. let stored;
  6396. let key;
  6397. let value;
  6398. let i;
  6399. let l;
  6400. const seenIndex = seen.get(data);
  6401. if (seenIndex != null)
  6402. return seenIndex;
  6403. const index = list.length;
  6404. const proto = Object.prototype.toString.call(data);
  6405. if (isObject(data, proto)) {
  6406. if (isVueReactiveLinkNode(data)) {
  6407. return index;
  6408. }
  6409. stored = {};
  6410. seen.set(data, index);
  6411. list.push(stored);
  6412. const keys = Object.keys(data);
  6413. for (i = 0, l = keys.length; i < l; i++) {
  6414. key = keys[i];
  6415. if (key === "compilerOptions")
  6416. return index;
  6417. value = data[key];
  6418. const isVm = value != null && isObject(value, Object.prototype.toString.call(data)) && isVueInstance(value);
  6419. try {
  6420. if (replacer) {
  6421. value = replacer.call(data, key, value, depth, seenVueInstance);
  6422. }
  6423. } catch (e) {
  6424. value = e;
  6425. }
  6426. stored[key] = encode(value, replacer, list, seen, depth + 1, seenVueInstance);
  6427. if (isVm) {
  6428. seenVueInstance.delete(value);
  6429. }
  6430. }
  6431. } else if (isArray3(data, proto)) {
  6432. stored = [];
  6433. seen.set(data, index);
  6434. list.push(stored);
  6435. for (i = 0, l = data.length; i < l; i++) {
  6436. try {
  6437. value = data[i];
  6438. if (replacer)
  6439. value = replacer.call(data, i, value, depth, seenVueInstance);
  6440. } catch (e) {
  6441. value = e;
  6442. }
  6443. stored[i] = encode(value, replacer, list, seen, depth + 1, seenVueInstance);
  6444. }
  6445. } else {
  6446. list.push(data);
  6447. }
  6448. return index;
  6449. }
  6450. function decode(list, reviver2 = null) {
  6451. let i = list.length;
  6452. let j, k, data, key, value, proto;
  6453. while (i--) {
  6454. data = list[i];
  6455. proto = Object.prototype.toString.call(data);
  6456. if (proto === "[object Object]") {
  6457. const keys = Object.keys(data);
  6458. for (j = 0, k = keys.length; j < k; j++) {
  6459. key = keys[j];
  6460. value = list[data[key]];
  6461. if (reviver2)
  6462. value = reviver2.call(data, key, value);
  6463. data[key] = value;
  6464. }
  6465. } else if (proto === "[object Array]") {
  6466. for (j = 0, k = data.length; j < k; j++) {
  6467. value = list[data[j]];
  6468. if (reviver2)
  6469. value = reviver2.call(data, j, value);
  6470. data[j] = value;
  6471. }
  6472. }
  6473. }
  6474. }
  6475. function stringifyCircularAutoChunks(data, replacer = null, space = null) {
  6476. let result;
  6477. try {
  6478. result = arguments.length === 1 ? JSON.stringify(data) : JSON.stringify(data, (k, v) => {
  6479. var _a25;
  6480. return (_a25 = replacer == null ? void 0 : replacer(k, v)) == null ? void 0 : _a25.call(this);
  6481. }, space);
  6482. } catch (e) {
  6483. result = stringifyStrictCircularAutoChunks(data, replacer, space);
  6484. }
  6485. if (result.length > MAX_SERIALIZED_SIZE) {
  6486. const chunkCount = Math.ceil(result.length / MAX_SERIALIZED_SIZE);
  6487. const chunks = [];
  6488. for (let i = 0; i < chunkCount; i++)
  6489. chunks.push(result.slice(i * MAX_SERIALIZED_SIZE, (i + 1) * MAX_SERIALIZED_SIZE));
  6490. return chunks;
  6491. }
  6492. return result;
  6493. }
  6494. function stringifyStrictCircularAutoChunks(data, replacer = null, space = null) {
  6495. const list = [];
  6496. encode(data, replacer, list, /* @__PURE__ */ new Map());
  6497. return space ? ` ${JSON.stringify(list, null, space)}` : ` ${JSON.stringify(list)}`;
  6498. }
  6499. function parseCircularAutoChunks(data, reviver2 = null) {
  6500. if (Array.isArray(data))
  6501. data = data.join("");
  6502. const hasCircular = /^\s/.test(data);
  6503. if (!hasCircular) {
  6504. return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver2);
  6505. } else {
  6506. const list = JSON.parse(data);
  6507. decode(list, reviver2);
  6508. return list[0];
  6509. }
  6510. }
  6511. // src/shared/util.ts
  6512. function stringify2(data) {
  6513. return stringifyCircularAutoChunks(data, stringifyReplacer);
  6514. }
  6515. function parse2(data, revive2 = false) {
  6516. if (data == void 0)
  6517. return {};
  6518. return revive2 ? parseCircularAutoChunks(data, reviver) : parseCircularAutoChunks(data);
  6519. }
  6520. // src/index.ts
  6521. var devtools = {
  6522. hook,
  6523. init: () => {
  6524. initDevTools();
  6525. },
  6526. get ctx() {
  6527. return devtoolsContext;
  6528. },
  6529. get api() {
  6530. return devtoolsContext.api;
  6531. }
  6532. };
  6533. export {
  6534. DevToolsContextHookKeys,
  6535. DevToolsMessagingHookKeys,
  6536. DevToolsV6PluginAPIHookKeys,
  6537. INFINITY,
  6538. NAN,
  6539. NEGATIVE_INFINITY,
  6540. ROUTER_INFO_KEY,
  6541. ROUTER_KEY,
  6542. UNDEFINED,
  6543. activeAppRecord,
  6544. addCustomCommand,
  6545. addCustomTab,
  6546. addDevToolsAppRecord,
  6547. addDevToolsPluginToBuffer,
  6548. addInspector,
  6549. callConnectedUpdatedHook,
  6550. callDevToolsPluginSetupFn,
  6551. callInspectorUpdatedHook,
  6552. callStateUpdatedHook,
  6553. createComponentsDevToolsPlugin,
  6554. createDevToolsApi,
  6555. createDevToolsCtxHooks,
  6556. createRpcClient,
  6557. createRpcProxy,
  6558. createRpcServer,
  6559. devtools,
  6560. devtoolsAppRecords,
  6561. devtoolsContext,
  6562. devtoolsInspector,
  6563. devtoolsPluginBuffer,
  6564. devtoolsRouter,
  6565. devtoolsRouterInfo,
  6566. devtoolsState,
  6567. escape,
  6568. formatInspectorStateValue,
  6569. getActiveInspectors,
  6570. getDevToolsEnv,
  6571. getExtensionClientContext,
  6572. getInspector,
  6573. getInspectorActions,
  6574. getInspectorInfo,
  6575. getInspectorNodeActions,
  6576. getInspectorStateValueType,
  6577. getRaw,
  6578. getRpcClient,
  6579. getRpcServer,
  6580. getViteRpcClient,
  6581. getViteRpcServer,
  6582. initDevTools,
  6583. isPlainObject,
  6584. onDevToolsClientConnected,
  6585. onDevToolsConnected,
  6586. parse2 as parse,
  6587. registerDevToolsPlugin,
  6588. removeCustomCommand,
  6589. removeDevToolsAppRecord,
  6590. removeRegisteredPluginApp,
  6591. resetDevToolsState,
  6592. setActiveAppRecord,
  6593. setActiveAppRecordId,
  6594. setDevToolsEnv,
  6595. setElectronClientContext,
  6596. setElectronProxyContext,
  6597. setElectronServerContext,
  6598. setExtensionClientContext,
  6599. setIframeServerContext,
  6600. setOpenInEditorBaseUrl,
  6601. setRpcServerToGlobal,
  6602. setViteClientContext,
  6603. setViteRpcClientToGlobal,
  6604. setViteRpcServerToGlobal,
  6605. setViteServerContext,
  6606. setupDevToolsPlugin,
  6607. stringify2 as stringify,
  6608. toEdit,
  6609. toSubmit,
  6610. toggleClientConnected,
  6611. toggleComponentInspectorEnabled,
  6612. toggleHighPerfMode,
  6613. updateDevToolsClientDetected,
  6614. updateDevToolsState,
  6615. updateTimelineLayersState
  6616. };