@vue/devtools-kit 7.4.4 → 7.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target22) => (target22 = mod != null ? __create(
27
27
  mod
28
28
  ));
29
29
 
30
- // ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.0_@types+node@20.16.3__@swc+core@1.5.29_jiti@1.21.6__poim247rgdwcqyeqwscqjhxddq/node_modules/tsup/assets/esm_shims.js
30
+ // ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.0_@types+node@20.16.5__@swc+core@1.5.29_jiti@1.21.6__hrrjfaj2jdrhlrlzgjkczhq5ey/node_modules/tsup/assets/esm_shims.js
31
31
  var init_esm_shims = __esm({
32
- "../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.0_@types+node@20.16.3__@swc+core@1.5.29_jiti@1.21.6__poim247rgdwcqyeqwscqjhxddq/node_modules/tsup/assets/esm_shims.js"() {
32
+ "../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.0_@types+node@20.16.5__@swc+core@1.5.29_jiti@1.21.6__hrrjfaj2jdrhlrlzgjkczhq5ey/node_modules/tsup/assets/esm_shims.js"() {
33
33
  "use strict";
34
34
  }
35
35
  });
@@ -1579,55 +1579,33 @@ init_esm_shims();
1579
1579
  init_esm_shims();
1580
1580
  import { isNuxtApp, target as target13 } from "@vue/devtools-shared";
1581
1581
 
1582
- // src/hook/index.ts
1583
- init_esm_shims();
1584
- import { target as target10 } from "@vue/devtools-shared";
1585
- import { createHooks as createHooks2 } from "hookable";
1586
-
1587
- // src/types/index.ts
1588
- init_esm_shims();
1589
-
1590
- // src/types/inspector.ts
1591
- init_esm_shims();
1592
-
1593
- // src/types/plugin.ts
1594
- init_esm_shims();
1595
-
1596
- // src/types/app.ts
1597
- init_esm_shims();
1598
-
1599
- // src/types/timeline.ts
1600
- init_esm_shims();
1601
-
1602
- // src/types/component.ts
1603
- init_esm_shims();
1604
-
1605
- // src/types/hook.ts
1606
- init_esm_shims();
1607
-
1608
- // src/types/tab.ts
1609
- init_esm_shims();
1610
-
1611
- // src/types/command.ts
1612
- init_esm_shims();
1613
-
1614
- // src/types/router.ts
1582
+ // src/compat/index.ts
1615
1583
  init_esm_shims();
1584
+ import { target } from "@vue/devtools-shared";
1585
+ function onLegacyDevToolsPluginApiAvailable(cb) {
1586
+ if (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__) {
1587
+ cb();
1588
+ return;
1589
+ }
1590
+ Object.defineProperty(target, "__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__", {
1591
+ set(value) {
1592
+ if (value)
1593
+ cb();
1594
+ },
1595
+ configurable: true
1596
+ });
1597
+ }
1616
1598
 
1617
1599
  // src/ctx/index.ts
1618
1600
  init_esm_shims();
1619
- import { target as target9 } from "@vue/devtools-shared";
1620
-
1621
- // src/ctx/hook.ts
1622
- init_esm_shims();
1623
- import { createHooks } from "hookable";
1601
+ import { target as target11 } from "@vue/devtools-shared";
1624
1602
 
1625
- // src/core/component-highlighter/index.ts
1603
+ // src/ctx/api.ts
1626
1604
  init_esm_shims();
1605
+ import { target as target9 } from "@vue/devtools-shared";
1627
1606
 
1628
- // src/core/component/utils/index.ts
1607
+ // src/core/component/state/editor.ts
1629
1608
  init_esm_shims();
1630
- import { basename, classify } from "@vue/devtools-shared";
1631
1609
 
1632
1610
  // src/shared/stub-vue.ts
1633
1611
  init_esm_shims();
@@ -1650,6 +1628,8 @@ function toRaw(observed) {
1650
1628
  var Fragment = Symbol.for("v-fgt");
1651
1629
 
1652
1630
  // src/core/component/utils/index.ts
1631
+ init_esm_shims();
1632
+ import { basename, classify } from "@vue/devtools-shared";
1653
1633
  function getComponentTypeName(options) {
1654
1634
  return options.name || options._componentTag || options.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ || options.__name;
1655
1635
  }
@@ -1749,6 +1729,146 @@ function ensurePropertyExists(obj, key, skipObjCheck = false) {
1749
1729
  return skipObjCheck ? key in obj : typeof obj === "object" && obj !== null ? key in obj : false;
1750
1730
  }
1751
1731
 
1732
+ // src/core/component/state/editor.ts
1733
+ var StateEditor = class {
1734
+ constructor() {
1735
+ this.refEditor = new RefStateEditor();
1736
+ }
1737
+ set(object, path, value, cb) {
1738
+ const sections = Array.isArray(path) ? path : path.split(".");
1739
+ const markRef = false;
1740
+ while (sections.length > 1) {
1741
+ const section = sections.shift();
1742
+ if (object instanceof Map)
1743
+ object = object.get(section);
1744
+ if (object instanceof Set)
1745
+ object = Array.from(object.values())[section];
1746
+ else object = object[section];
1747
+ if (this.refEditor.isRef(object))
1748
+ object = this.refEditor.get(object);
1749
+ }
1750
+ const field = sections[0];
1751
+ const item = this.refEditor.get(object)[field];
1752
+ if (cb) {
1753
+ cb(object, field, value);
1754
+ } else {
1755
+ if (this.refEditor.isRef(item))
1756
+ this.refEditor.set(item, value);
1757
+ else if (markRef)
1758
+ object[field] = value;
1759
+ else
1760
+ object[field] = value;
1761
+ }
1762
+ }
1763
+ get(object, path) {
1764
+ const sections = Array.isArray(path) ? path : path.split(".");
1765
+ for (let i = 0; i < sections.length; i++) {
1766
+ if (object instanceof Map)
1767
+ object = object.get(sections[i]);
1768
+ else
1769
+ object = object[sections[i]];
1770
+ if (this.refEditor.isRef(object))
1771
+ object = this.refEditor.get(object);
1772
+ if (!object)
1773
+ return void 0;
1774
+ }
1775
+ return object;
1776
+ }
1777
+ has(object, path, parent = false) {
1778
+ if (typeof object === "undefined")
1779
+ return false;
1780
+ const sections = Array.isArray(path) ? path.slice() : path.split(".");
1781
+ const size = !parent ? 1 : 2;
1782
+ while (object && sections.length > size) {
1783
+ const section = sections.shift();
1784
+ object = object[section];
1785
+ if (this.refEditor.isRef(object))
1786
+ object = this.refEditor.get(object);
1787
+ }
1788
+ return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
1789
+ }
1790
+ createDefaultSetCallback(state) {
1791
+ return (object, field, value) => {
1792
+ if (state.remove || state.newKey) {
1793
+ if (Array.isArray(object))
1794
+ object.splice(field, 1);
1795
+ else if (toRaw(object) instanceof Map)
1796
+ object.delete(field);
1797
+ else if (toRaw(object) instanceof Set)
1798
+ object.delete(Array.from(object.values())[field]);
1799
+ else Reflect.deleteProperty(object, field);
1800
+ }
1801
+ if (!state.remove) {
1802
+ const target22 = object[state.newKey || field];
1803
+ if (this.refEditor.isRef(target22))
1804
+ this.refEditor.set(target22, value);
1805
+ else if (toRaw(object) instanceof Map)
1806
+ object.set(state.newKey || field, value);
1807
+ else if (toRaw(object) instanceof Set)
1808
+ object.add(value);
1809
+ else
1810
+ object[state.newKey || field] = value;
1811
+ }
1812
+ };
1813
+ }
1814
+ };
1815
+ var RefStateEditor = class {
1816
+ set(ref, value) {
1817
+ if (isRef(ref)) {
1818
+ ref.value = value;
1819
+ } else {
1820
+ if (ref instanceof Set && Array.isArray(value)) {
1821
+ ref.clear();
1822
+ value.forEach((v) => ref.add(v));
1823
+ return;
1824
+ }
1825
+ const currentKeys = Object.keys(value);
1826
+ if (ref instanceof Map) {
1827
+ const previousKeysSet2 = new Set(ref.keys());
1828
+ currentKeys.forEach((key) => {
1829
+ ref.set(key, Reflect.get(value, key));
1830
+ previousKeysSet2.delete(key);
1831
+ });
1832
+ previousKeysSet2.forEach((key) => ref.delete(key));
1833
+ return;
1834
+ }
1835
+ const previousKeysSet = new Set(Object.keys(ref));
1836
+ currentKeys.forEach((key) => {
1837
+ Reflect.set(ref, key, Reflect.get(value, key));
1838
+ previousKeysSet.delete(key);
1839
+ });
1840
+ previousKeysSet.forEach((key) => Reflect.deleteProperty(ref, key));
1841
+ }
1842
+ }
1843
+ get(ref) {
1844
+ return isRef(ref) ? ref.value : ref;
1845
+ }
1846
+ isRef(ref) {
1847
+ return isRef(ref) || isReactive(ref);
1848
+ }
1849
+ };
1850
+ async function editComponentState(payload, stateEditor2) {
1851
+ const { path, nodeId, state, type } = payload;
1852
+ const instance = getComponentInstance(activeAppRecord.value, nodeId);
1853
+ if (!instance)
1854
+ return;
1855
+ const targetPath = path.slice();
1856
+ let target22;
1857
+ if (instance.devtoolsRawSetupState && Object.keys(instance.devtoolsRawSetupState).includes(path[0]))
1858
+ target22 = instance.devtoolsRawSetupState;
1859
+ if (instance.data && Object.keys(instance.data).includes(path[0]))
1860
+ target22 = instance.data;
1861
+ if (target22 && targetPath) {
1862
+ if (state.type === "object" && type === "reactive") {
1863
+ }
1864
+ stateEditor2.set(target22, targetPath, state.value, stateEditor2.createDefaultSetCallback(state));
1865
+ }
1866
+ }
1867
+ var stateEditor = new StateEditor();
1868
+ async function editState(payload) {
1869
+ editComponentState(payload, stateEditor);
1870
+ }
1871
+
1752
1872
  // src/core/component/tree/el.ts
1753
1873
  init_esm_shims();
1754
1874
  function getRootElementsFromComponentInstance(instance) {
@@ -1771,6 +1891,9 @@ function getFragmentRootElements(vnode) {
1771
1891
  return list;
1772
1892
  }
1773
1893
 
1894
+ // src/core/component-highlighter/index.ts
1895
+ init_esm_shims();
1896
+
1774
1897
  // src/core/component/state/bounding-rect.ts
1775
1898
  init_esm_shims();
1776
1899
  function createRect() {
@@ -2060,194 +2183,75 @@ function scrollToComponent(options) {
2060
2183
  }
2061
2184
  }
2062
2185
 
2063
- // src/ctx/inspector.ts
2186
+ // src/core/component-inspector/index.ts
2064
2187
  init_esm_shims();
2065
2188
  import { target as target2 } from "@vue/devtools-shared";
2066
- import { debounce as debounce2 } from "perfect-debounce";
2189
+ var _a, _b;
2190
+ (_b = (_a = target2).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__) != null ? _b : _a.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true;
2191
+ function toggleComponentInspectorEnabled(enabled) {
2192
+ target2.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = enabled;
2193
+ }
2194
+ function waitForInspectorInit(cb) {
2195
+ let total = 0;
2196
+ const timer = setInterval(() => {
2197
+ if (target2.__VUE_INSPECTOR__) {
2198
+ clearInterval(timer);
2199
+ total += 30;
2200
+ cb();
2201
+ }
2202
+ if (total >= /* 5s */
2203
+ 5e3)
2204
+ clearInterval(timer);
2205
+ }, 30);
2206
+ }
2207
+ function setupInspector() {
2208
+ const inspector = target2.__VUE_INSPECTOR__;
2209
+ const _openInEditor = inspector.openInEditor;
2210
+ inspector.openInEditor = async (...params) => {
2211
+ inspector.disable();
2212
+ _openInEditor(...params);
2213
+ };
2214
+ }
2215
+ function getComponentInspector() {
2216
+ return new Promise((resolve) => {
2217
+ function setup() {
2218
+ setupInspector();
2219
+ resolve(target2.__VUE_INSPECTOR__);
2220
+ }
2221
+ if (!target2.__VUE_INSPECTOR__) {
2222
+ waitForInspectorInit(() => {
2223
+ setup();
2224
+ });
2225
+ } else {
2226
+ setup();
2227
+ }
2228
+ });
2229
+ }
2230
+
2231
+ // src/core/open-in-editor/index.ts
2232
+ init_esm_shims();
2233
+ import { target as target5 } from "@vue/devtools-shared";
2067
2234
 
2068
2235
  // src/ctx/state.ts
2069
2236
  init_esm_shims();
2070
2237
  import { target as global, isUrlString } from "@vue/devtools-shared";
2238
+ import { debounce as debounce2 } from "perfect-debounce";
2239
+
2240
+ // src/ctx/hook.ts
2241
+ init_esm_shims();
2242
+ import { createHooks } from "hookable";
2243
+
2244
+ // src/ctx/inspector.ts
2245
+ init_esm_shims();
2246
+ import { target as target4 } from "@vue/devtools-shared";
2071
2247
  import { debounce } from "perfect-debounce";
2072
- var _a, _b;
2073
- (_b = (_a = global).__VUE_DEVTOOLS_KIT_APP_RECORDS__) != null ? _b : _a.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [];
2074
- var _a2, _b2;
2075
- (_b2 = (_a2 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__) != null ? _b2 : _a2.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = {};
2076
- var _a3, _b3;
2077
- (_b3 = (_a3 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__) != null ? _b3 : _a3.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = "";
2078
- var _a4, _b4;
2079
- (_b4 = (_a4 = global).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__) != null ? _b4 : _a4.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ = [];
2080
- var _a5, _b5;
2081
- (_b5 = (_a5 = global).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__) != null ? _b5 : _a5.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ = [];
2082
- var STATE_KEY = "__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";
2083
- function initStateFactory() {
2084
- return {
2085
- connected: false,
2086
- clientConnected: false,
2087
- vitePluginDetected: true,
2088
- appRecords: [],
2089
- activeAppRecordId: "",
2090
- tabs: [],
2091
- commands: [],
2092
- highPerfModeEnabled: true,
2093
- devtoolsClientDetected: {}
2094
- };
2095
- }
2096
- var _a6, _b6;
2097
- (_b6 = (_a6 = global)[STATE_KEY]) != null ? _b6 : _a6[STATE_KEY] = initStateFactory();
2098
- var callStateUpdatedHook = debounce((state) => {
2099
- devtoolsContext.hooks.callHook("devtoolsStateUpdated" /* DEVTOOLS_STATE_UPDATED */, { state });
2100
- });
2101
- var callConnectedUpdatedHook = debounce((state, oldState) => {
2102
- devtoolsContext.hooks.callHook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, { state, oldState });
2103
- });
2104
- var devtoolsAppRecords = new Proxy(global.__VUE_DEVTOOLS_KIT_APP_RECORDS__, {
2105
- get(_target, prop, receiver) {
2106
- if (prop === "value")
2107
- return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__;
2108
- return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__[prop];
2109
- }
2110
- });
2111
- var addDevToolsAppRecord = (app) => {
2112
- global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [
2113
- ...global.__VUE_DEVTOOLS_KIT_APP_RECORDS__,
2114
- app
2115
- ];
2116
- };
2117
- var removeDevToolsAppRecord = (app) => {
2118
- global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = devtoolsAppRecords.value.filter((record) => record.app !== app);
2119
- };
2120
- var activeAppRecord = new Proxy(global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__, {
2121
- get(_target, prop, receiver) {
2122
- if (prop === "value")
2123
- return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__;
2124
- else if (prop === "id")
2125
- return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__;
2126
- return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[prop];
2127
- }
2128
- });
2129
- function updateAllStates() {
2130
- callStateUpdatedHook({
2131
- ...global[STATE_KEY],
2132
- appRecords: devtoolsAppRecords.value,
2133
- activeAppRecordId: activeAppRecord.id,
2134
- tabs: global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,
2135
- commands: global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__
2136
- });
2137
- }
2138
- function setActiveAppRecord(app) {
2139
- global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = app;
2140
- updateAllStates();
2141
- }
2142
- function setActiveAppRecordId(id) {
2143
- global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = id;
2144
- updateAllStates();
2145
- }
2146
- var devtoolsState = new Proxy(global[STATE_KEY], {
2147
- get(target22, property) {
2148
- if (property === "appRecords") {
2149
- return devtoolsAppRecords;
2150
- } else if (property === "activeAppRecordId") {
2151
- return activeAppRecord.id;
2152
- } else if (property === "tabs") {
2153
- return global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
2154
- } else if (property === "commands") {
2155
- return global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2156
- }
2157
- return global[STATE_KEY][property];
2158
- },
2159
- deleteProperty(target22, property) {
2160
- delete target22[property];
2161
- return true;
2162
- },
2163
- set(target22, property, value) {
2164
- const oldState = { ...global[STATE_KEY] };
2165
- target22[property] = value;
2166
- global[STATE_KEY][property] = value;
2167
- return true;
2168
- }
2169
- });
2170
- function resetDevToolsState() {
2171
- Object.assign(global[STATE_KEY], initStateFactory());
2172
- }
2173
- function updateDevToolsState(state) {
2174
- const oldState = {
2175
- ...global[STATE_KEY],
2176
- appRecords: devtoolsAppRecords.value,
2177
- activeAppRecordId: activeAppRecord.id
2178
- };
2179
- if (oldState.connected !== state.connected && state.connected || oldState.clientConnected !== state.clientConnected && state.clientConnected) {
2180
- callConnectedUpdatedHook(global[STATE_KEY], oldState);
2181
- }
2182
- Object.assign(global[STATE_KEY], state);
2183
- updateAllStates();
2184
- }
2185
- function onDevToolsConnected(fn) {
2186
- return new Promise((resolve) => {
2187
- if (devtoolsState.connected) {
2188
- fn();
2189
- resolve();
2190
- }
2191
- devtoolsContext.hooks.hook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, ({ state }) => {
2192
- if (state.connected) {
2193
- fn();
2194
- resolve();
2195
- }
2196
- });
2197
- });
2198
- }
2199
- var resolveIcon = (icon) => {
2200
- if (!icon)
2201
- return;
2202
- if (icon.startsWith("baseline-")) {
2203
- return `custom-ic-${icon}`;
2204
- }
2205
- if (icon.startsWith("i-") || isUrlString(icon))
2206
- return icon;
2207
- return `custom-ic-baseline-${icon}`;
2208
- };
2209
- function addCustomTab(tab) {
2210
- const tabs = global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
2211
- if (tabs.some((t) => t.name === tab.name))
2212
- return;
2213
- tabs.push({
2214
- ...tab,
2215
- icon: resolveIcon(tab.icon)
2216
- });
2217
- updateAllStates();
2218
- }
2219
- function addCustomCommand(action) {
2220
- const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2221
- if (commands.some((t) => t.id === action.id))
2222
- return;
2223
- commands.push({
2224
- ...action,
2225
- icon: resolveIcon(action.icon),
2226
- children: action.children ? action.children.map((child) => ({
2227
- ...child,
2228
- icon: resolveIcon(child.icon)
2229
- })) : void 0
2230
- });
2231
- updateAllStates();
2232
- }
2233
- function removeCustomCommand(actionId) {
2234
- const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2235
- const index = commands.findIndex((t) => t.id === actionId);
2236
- if (index === -1)
2237
- return;
2238
- commands.splice(index, 1);
2239
- updateAllStates();
2240
- }
2241
- function toggleClientConnected(state) {
2242
- updateDevToolsState({ clientConnected: state });
2243
- }
2244
2248
 
2245
2249
  // src/ctx/timeline.ts
2246
2250
  init_esm_shims();
2247
- import { target } from "@vue/devtools-shared";
2248
- var _a7, _b7;
2249
- (_b7 = (_a7 = target).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS) != null ? _b7 : _a7.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS = [];
2250
- var devtoolsTimelineLayers = new Proxy(target.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS, {
2251
+ import { target as target3 } from "@vue/devtools-shared";
2252
+ var _a2, _b2;
2253
+ (_b2 = (_a2 = target3).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS) != null ? _b2 : _a2.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS = [];
2254
+ var devtoolsTimelineLayers = new Proxy(target3.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS, {
2251
2255
  get(target22, prop, receiver) {
2252
2256
  return Reflect.get(target22, prop, receiver);
2253
2257
  }
@@ -2261,14 +2265,14 @@ function addTimelineLayer(options, descriptor) {
2261
2265
  }
2262
2266
 
2263
2267
  // src/ctx/inspector.ts
2264
- var _a8, _b8;
2265
- (_b8 = (_a8 = target2).__VUE_DEVTOOLS_KIT_INSPECTOR__) != null ? _b8 : _a8.__VUE_DEVTOOLS_KIT_INSPECTOR__ = [];
2266
- var devtoolsInspector = new Proxy(target2.__VUE_DEVTOOLS_KIT_INSPECTOR__, {
2268
+ var _a3, _b3;
2269
+ (_b3 = (_a3 = target4).__VUE_DEVTOOLS_KIT_INSPECTOR__) != null ? _b3 : _a3.__VUE_DEVTOOLS_KIT_INSPECTOR__ = [];
2270
+ var devtoolsInspector = new Proxy(target4.__VUE_DEVTOOLS_KIT_INSPECTOR__, {
2267
2271
  get(target22, prop, receiver) {
2268
2272
  return Reflect.get(target22, prop, receiver);
2269
2273
  }
2270
2274
  });
2271
- var callInspectorUpdatedHook = debounce2(() => {
2275
+ var callInspectorUpdatedHook = debounce(() => {
2272
2276
  devtoolsContext.hooks.callHook("sendInspectorToClient" /* SEND_INSPECTOR_TO_CLIENT */, getActiveInspectors());
2273
2277
  });
2274
2278
  function addInspector(inspector, descriptor) {
@@ -2467,156 +2471,183 @@ function createDevToolsCtxHooks() {
2467
2471
  return hooks2;
2468
2472
  }
2469
2473
 
2470
- // src/ctx/api.ts
2471
- init_esm_shims();
2472
- import { target as target7 } from "@vue/devtools-shared";
2473
-
2474
- // src/core/component/state/editor.ts
2475
- init_esm_shims();
2476
- var StateEditor = class {
2477
- constructor() {
2478
- this.refEditor = new RefStateEditor();
2474
+ // src/ctx/state.ts
2475
+ var _a4, _b4;
2476
+ (_b4 = (_a4 = global).__VUE_DEVTOOLS_KIT_APP_RECORDS__) != null ? _b4 : _a4.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [];
2477
+ var _a5, _b5;
2478
+ (_b5 = (_a5 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__) != null ? _b5 : _a5.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = {};
2479
+ var _a6, _b6;
2480
+ (_b6 = (_a6 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__) != null ? _b6 : _a6.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = "";
2481
+ var _a7, _b7;
2482
+ (_b7 = (_a7 = global).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__) != null ? _b7 : _a7.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ = [];
2483
+ var _a8, _b8;
2484
+ (_b8 = (_a8 = global).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__) != null ? _b8 : _a8.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ = [];
2485
+ var STATE_KEY = "__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";
2486
+ function initStateFactory() {
2487
+ return {
2488
+ connected: false,
2489
+ clientConnected: false,
2490
+ vitePluginDetected: true,
2491
+ appRecords: [],
2492
+ activeAppRecordId: "",
2493
+ tabs: [],
2494
+ commands: [],
2495
+ highPerfModeEnabled: true,
2496
+ devtoolsClientDetected: {}
2497
+ };
2498
+ }
2499
+ var _a9, _b9;
2500
+ (_b9 = (_a9 = global)[STATE_KEY]) != null ? _b9 : _a9[STATE_KEY] = initStateFactory();
2501
+ var callStateUpdatedHook = debounce2((state) => {
2502
+ devtoolsContext.hooks.callHook("devtoolsStateUpdated" /* DEVTOOLS_STATE_UPDATED */, { state });
2503
+ });
2504
+ var callConnectedUpdatedHook = debounce2((state, oldState) => {
2505
+ devtoolsContext.hooks.callHook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, { state, oldState });
2506
+ });
2507
+ var devtoolsAppRecords = new Proxy(global.__VUE_DEVTOOLS_KIT_APP_RECORDS__, {
2508
+ get(_target, prop, receiver) {
2509
+ if (prop === "value")
2510
+ return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__;
2511
+ return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__[prop];
2479
2512
  }
2480
- set(object, path, value, cb) {
2481
- const sections = Array.isArray(path) ? path : path.split(".");
2482
- const markRef = false;
2483
- while (sections.length > 1) {
2484
- const section = sections.shift();
2485
- if (object instanceof Map)
2486
- object = object.get(section);
2487
- if (object instanceof Set)
2488
- object = Array.from(object.values())[section];
2489
- else object = object[section];
2490
- if (this.refEditor.isRef(object))
2491
- object = this.refEditor.get(object);
2492
- }
2493
- const field = sections[0];
2494
- const item = this.refEditor.get(object)[field];
2495
- if (cb) {
2496
- cb(object, field, value);
2497
- } else {
2498
- if (this.refEditor.isRef(item))
2499
- this.refEditor.set(item, value);
2500
- else if (markRef)
2501
- object[field] = value;
2502
- else
2503
- object[field] = value;
2504
- }
2513
+ });
2514
+ var addDevToolsAppRecord = (app) => {
2515
+ global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [
2516
+ ...global.__VUE_DEVTOOLS_KIT_APP_RECORDS__,
2517
+ app
2518
+ ];
2519
+ };
2520
+ var removeDevToolsAppRecord = (app) => {
2521
+ global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = devtoolsAppRecords.value.filter((record) => record.app !== app);
2522
+ };
2523
+ var activeAppRecord = new Proxy(global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__, {
2524
+ get(_target, prop, receiver) {
2525
+ if (prop === "value")
2526
+ return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__;
2527
+ else if (prop === "id")
2528
+ return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__;
2529
+ return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[prop];
2505
2530
  }
2506
- get(object, path) {
2507
- const sections = Array.isArray(path) ? path : path.split(".");
2508
- for (let i = 0; i < sections.length; i++) {
2509
- if (object instanceof Map)
2510
- object = object.get(sections[i]);
2511
- else
2512
- object = object[sections[i]];
2513
- if (this.refEditor.isRef(object))
2514
- object = this.refEditor.get(object);
2515
- if (!object)
2516
- return void 0;
2517
- }
2518
- return object;
2519
- }
2520
- has(object, path, parent = false) {
2521
- if (typeof object === "undefined")
2522
- return false;
2523
- const sections = Array.isArray(path) ? path.slice() : path.split(".");
2524
- const size = !parent ? 1 : 2;
2525
- while (object && sections.length > size) {
2526
- const section = sections.shift();
2527
- object = object[section];
2528
- if (this.refEditor.isRef(object))
2529
- object = this.refEditor.get(object);
2531
+ });
2532
+ function updateAllStates() {
2533
+ callStateUpdatedHook({
2534
+ ...global[STATE_KEY],
2535
+ appRecords: devtoolsAppRecords.value,
2536
+ activeAppRecordId: activeAppRecord.id,
2537
+ tabs: global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,
2538
+ commands: global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__
2539
+ });
2540
+ }
2541
+ function setActiveAppRecord(app) {
2542
+ global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = app;
2543
+ updateAllStates();
2544
+ }
2545
+ function setActiveAppRecordId(id) {
2546
+ global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = id;
2547
+ updateAllStates();
2548
+ }
2549
+ var devtoolsState = new Proxy(global[STATE_KEY], {
2550
+ get(target22, property) {
2551
+ if (property === "appRecords") {
2552
+ return devtoolsAppRecords;
2553
+ } else if (property === "activeAppRecordId") {
2554
+ return activeAppRecord.id;
2555
+ } else if (property === "tabs") {
2556
+ return global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
2557
+ } else if (property === "commands") {
2558
+ return global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2530
2559
  }
2531
- return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
2560
+ return global[STATE_KEY][property];
2561
+ },
2562
+ deleteProperty(target22, property) {
2563
+ delete target22[property];
2564
+ return true;
2565
+ },
2566
+ set(target22, property, value) {
2567
+ const oldState = { ...global[STATE_KEY] };
2568
+ target22[property] = value;
2569
+ global[STATE_KEY][property] = value;
2570
+ return true;
2532
2571
  }
2533
- createDefaultSetCallback(state) {
2534
- return (object, field, value) => {
2535
- if (state.remove || state.newKey) {
2536
- if (Array.isArray(object))
2537
- object.splice(field, 1);
2538
- else if (toRaw(object) instanceof Map)
2539
- object.delete(field);
2540
- else if (toRaw(object) instanceof Set)
2541
- object.delete(Array.from(object.values())[field]);
2542
- else Reflect.deleteProperty(object, field);
2543
- }
2544
- if (!state.remove) {
2545
- const target22 = object[state.newKey || field];
2546
- if (this.refEditor.isRef(target22))
2547
- this.refEditor.set(target22, value);
2548
- else if (toRaw(object) instanceof Map)
2549
- object.set(state.newKey || field, value);
2550
- else if (toRaw(object) instanceof Set)
2551
- object.add(value);
2552
- else
2553
- object[state.newKey || field] = value;
2554
- }
2555
- };
2572
+ });
2573
+ function resetDevToolsState() {
2574
+ Object.assign(global[STATE_KEY], initStateFactory());
2575
+ }
2576
+ function updateDevToolsState(state) {
2577
+ const oldState = {
2578
+ ...global[STATE_KEY],
2579
+ appRecords: devtoolsAppRecords.value,
2580
+ activeAppRecordId: activeAppRecord.id
2581
+ };
2582
+ if (oldState.connected !== state.connected && state.connected || oldState.clientConnected !== state.clientConnected && state.clientConnected) {
2583
+ callConnectedUpdatedHook(global[STATE_KEY], oldState);
2556
2584
  }
2557
- };
2558
- var RefStateEditor = class {
2559
- set(ref, value) {
2560
- if (isRef(ref)) {
2561
- ref.value = value;
2562
- } else {
2563
- if (ref instanceof Set && Array.isArray(value)) {
2564
- ref.clear();
2565
- value.forEach((v) => ref.add(v));
2566
- return;
2567
- }
2568
- const currentKeys = Object.keys(value);
2569
- if (ref instanceof Map) {
2570
- const previousKeysSet2 = new Set(ref.keys());
2571
- currentKeys.forEach((key) => {
2572
- ref.set(key, Reflect.get(value, key));
2573
- previousKeysSet2.delete(key);
2574
- });
2575
- previousKeysSet2.forEach((key) => ref.delete(key));
2576
- return;
2577
- }
2578
- const previousKeysSet = new Set(Object.keys(ref));
2579
- currentKeys.forEach((key) => {
2580
- Reflect.set(ref, key, Reflect.get(value, key));
2581
- previousKeysSet.delete(key);
2582
- });
2583
- previousKeysSet.forEach((key) => Reflect.deleteProperty(ref, key));
2585
+ Object.assign(global[STATE_KEY], state);
2586
+ updateAllStates();
2587
+ }
2588
+ function onDevToolsConnected(fn) {
2589
+ return new Promise((resolve) => {
2590
+ if (devtoolsState.connected) {
2591
+ fn();
2592
+ resolve();
2584
2593
  }
2594
+ devtoolsContext.hooks.hook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, ({ state }) => {
2595
+ if (state.connected) {
2596
+ fn();
2597
+ resolve();
2598
+ }
2599
+ });
2600
+ });
2601
+ }
2602
+ var resolveIcon = (icon) => {
2603
+ if (!icon)
2604
+ return;
2605
+ if (icon.startsWith("baseline-")) {
2606
+ return `custom-ic-${icon}`;
2585
2607
  }
2586
- get(ref) {
2587
- return isRef(ref) ? ref.value : ref;
2588
- }
2589
- isRef(ref) {
2590
- return isRef(ref) || isReactive(ref);
2591
- }
2608
+ if (icon.startsWith("i-") || isUrlString(icon))
2609
+ return icon;
2610
+ return `custom-ic-baseline-${icon}`;
2592
2611
  };
2593
- async function editComponentState(payload, stateEditor2) {
2594
- const { path, nodeId, state, type } = payload;
2595
- const instance = getComponentInstance(activeAppRecord.value, nodeId);
2596
- if (!instance)
2612
+ function addCustomTab(tab) {
2613
+ const tabs = global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
2614
+ if (tabs.some((t) => t.name === tab.name))
2597
2615
  return;
2598
- const targetPath = path.slice();
2599
- let target22;
2600
- if (instance.devtoolsRawSetupState && Object.keys(instance.devtoolsRawSetupState).includes(path[0]))
2601
- target22 = instance.devtoolsRawSetupState;
2602
- if (instance.data && Object.keys(instance.data).includes(path[0]))
2603
- target22 = instance.data;
2604
- if (target22 && targetPath) {
2605
- if (state.type === "object" && type === "reactive") {
2606
- }
2607
- stateEditor2.set(target22, targetPath, state.value, stateEditor2.createDefaultSetCallback(state));
2608
- }
2616
+ tabs.push({
2617
+ ...tab,
2618
+ icon: resolveIcon(tab.icon)
2619
+ });
2620
+ updateAllStates();
2609
2621
  }
2610
- var stateEditor = new StateEditor();
2611
- async function editState(payload) {
2612
- editComponentState(payload, stateEditor);
2622
+ function addCustomCommand(action) {
2623
+ const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2624
+ if (commands.some((t) => t.id === action.id))
2625
+ return;
2626
+ commands.push({
2627
+ ...action,
2628
+ icon: resolveIcon(action.icon),
2629
+ children: action.children ? action.children.map((child) => ({
2630
+ ...child,
2631
+ icon: resolveIcon(child.icon)
2632
+ })) : void 0
2633
+ });
2634
+ updateAllStates();
2635
+ }
2636
+ function removeCustomCommand(actionId) {
2637
+ const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
2638
+ const index = commands.findIndex((t) => t.id === actionId);
2639
+ if (index === -1)
2640
+ return;
2641
+ commands.splice(index, 1);
2642
+ updateAllStates();
2643
+ }
2644
+ function toggleClientConnected(state) {
2645
+ updateDevToolsState({ clientConnected: state });
2613
2646
  }
2614
2647
 
2615
2648
  // src/core/open-in-editor/index.ts
2616
- init_esm_shims();
2617
- import { target as target3 } from "@vue/devtools-shared";
2618
2649
  function setOpenInEditorBaseUrl(url) {
2619
- target3.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__ = url;
2650
+ target5.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__ = url;
2620
2651
  }
2621
2652
  function openInEditor(options = {}) {
2622
2653
  var _a25, _b25, _c;
@@ -2632,150 +2663,15 @@ function openInEditor(options = {}) {
2632
2663
  }
2633
2664
  });
2634
2665
  } else if (devtoolsState.vitePluginDetected) {
2635
- const _baseUrl = (_c = target3.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__) != null ? _c : baseUrl;
2636
- target3.__VUE_INSPECTOR__.openInEditor(_baseUrl, file, line, column);
2666
+ const _baseUrl = (_c = target5.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__) != null ? _c : baseUrl;
2667
+ target5.__VUE_INSPECTOR__.openInEditor(_baseUrl, file, line, column);
2637
2668
  }
2638
2669
  }
2639
2670
  }
2640
2671
 
2641
- // src/core/router/index.ts
2642
- init_esm_shims();
2643
- import { deepClone, target as global3 } from "@vue/devtools-shared";
2644
- import { debounce as debounce3 } from "perfect-debounce";
2645
-
2646
- // src/ctx/router.ts
2647
- init_esm_shims();
2648
- import { target as global2 } from "@vue/devtools-shared";
2649
- var ROUTER_KEY = "__VUE_DEVTOOLS_ROUTER__";
2650
- var ROUTER_INFO_KEY = "__VUE_DEVTOOLS_ROUTER_INFO__";
2651
- var _a9, _b9;
2652
- (_b9 = (_a9 = global2)[ROUTER_INFO_KEY]) != null ? _b9 : _a9[ROUTER_INFO_KEY] = {
2653
- currentRoute: null,
2654
- routes: []
2655
- };
2656
- var _a10, _b10;
2657
- (_b10 = (_a10 = global2)[ROUTER_KEY]) != null ? _b10 : _a10[ROUTER_KEY] = {};
2658
- var devtoolsRouterInfo = new Proxy(global2[ROUTER_INFO_KEY], {
2659
- get(target22, property) {
2660
- return global2[ROUTER_INFO_KEY][property];
2661
- }
2662
- });
2663
- var devtoolsRouter = new Proxy(global2[ROUTER_KEY], {
2664
- get(target22, property) {
2665
- if (property === "value") {
2666
- return global2[ROUTER_KEY];
2667
- }
2668
- }
2669
- });
2670
-
2671
- // src/core/router/index.ts
2672
- function getRoutes(router) {
2673
- const routesMap = /* @__PURE__ */ new Map();
2674
- return ((router == null ? void 0 : router.getRoutes()) || []).filter((i) => !routesMap.has(i.path) && routesMap.set(i.path, 1));
2675
- }
2676
- function filterRoutes(routes) {
2677
- return routes.map((item) => {
2678
- let { path, name, children, meta } = item;
2679
- if (children == null ? void 0 : children.length)
2680
- children = filterRoutes(children);
2681
- return {
2682
- path,
2683
- name,
2684
- children,
2685
- meta
2686
- };
2687
- });
2688
- }
2689
- function filterCurrentRoute(route) {
2690
- if (route) {
2691
- const { fullPath, hash, href, path, name, matched, params, query } = route;
2692
- return {
2693
- fullPath,
2694
- hash,
2695
- href,
2696
- path,
2697
- name,
2698
- params,
2699
- query,
2700
- matched: filterRoutes(matched)
2701
- };
2702
- }
2703
- return route;
2704
- }
2705
- function normalizeRouterInfo(appRecord, activeAppRecord2) {
2706
- function init() {
2707
- var _a25;
2708
- const router = (_a25 = appRecord.app) == null ? void 0 : _a25.config.globalProperties.$router;
2709
- const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);
2710
- const routes = filterRoutes(getRoutes(router));
2711
- const c = console.warn;
2712
- console.warn = () => {
2713
- };
2714
- global3[ROUTER_INFO_KEY] = {
2715
- currentRoute: currentRoute ? deepClone(currentRoute) : {},
2716
- routes: deepClone(routes)
2717
- };
2718
- global3[ROUTER_KEY] = router;
2719
- console.warn = c;
2720
- }
2721
- init();
2722
- hook.on.componentUpdated(debounce3(() => {
2723
- var _a25;
2724
- if (((_a25 = activeAppRecord2.value) == null ? void 0 : _a25.app) !== appRecord.app)
2725
- return;
2726
- init();
2727
- devtoolsContext.hooks.callHook("routerInfoUpdated" /* ROUTER_INFO_UPDATED */, { state: global3[ROUTER_INFO_KEY] });
2728
- }, 200));
2729
- }
2730
-
2731
- // src/core/component-inspector/index.ts
2732
- init_esm_shims();
2733
- import { target as target4 } from "@vue/devtools-shared";
2734
- var _a11, _b11;
2735
- (_b11 = (_a11 = target4).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__) != null ? _b11 : _a11.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true;
2736
- function toggleComponentInspectorEnabled(enabled) {
2737
- target4.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = enabled;
2738
- }
2739
- function waitForInspectorInit(cb) {
2740
- let total = 0;
2741
- const timer = setInterval(() => {
2742
- if (target4.__VUE_INSPECTOR__) {
2743
- clearInterval(timer);
2744
- total += 30;
2745
- cb();
2746
- }
2747
- if (total >= /* 5s */
2748
- 5e3)
2749
- clearInterval(timer);
2750
- }, 30);
2751
- }
2752
- function setupInspector() {
2753
- const inspector = target4.__VUE_INSPECTOR__;
2754
- const _openInEditor = inspector.openInEditor;
2755
- inspector.openInEditor = async (...params) => {
2756
- inspector.disable();
2757
- _openInEditor(...params);
2758
- };
2759
- }
2760
- function getComponentInspector() {
2761
- return new Promise((resolve) => {
2762
- function setup() {
2763
- setupInspector();
2764
- resolve(target4.__VUE_INSPECTOR__);
2765
- }
2766
- if (!target4.__VUE_INSPECTOR__) {
2767
- waitForInspectorInit(() => {
2768
- setup();
2769
- });
2770
- } else {
2771
- setup();
2772
- }
2773
- });
2774
- }
2775
-
2776
2672
  // src/core/plugin/index.ts
2777
2673
  init_esm_shims();
2778
- import { target as target6 } from "@vue/devtools-shared";
2674
+ import { target as target8 } from "@vue/devtools-shared";
2779
2675
 
2780
2676
  // src/api/index.ts
2781
2677
  init_esm_shims();
@@ -2788,10 +2684,10 @@ init_esm_shims();
2788
2684
 
2789
2685
  // src/ctx/plugin.ts
2790
2686
  init_esm_shims();
2791
- import { target as target5 } from "@vue/devtools-shared";
2792
- var _a12, _b12;
2793
- (_b12 = (_a12 = target5).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__) != null ? _b12 : _a12.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ = [];
2794
- var devtoolsPluginBuffer = new Proxy(target5.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__, {
2687
+ import { target as target6 } from "@vue/devtools-shared";
2688
+ var _a10, _b10;
2689
+ (_b10 = (_a10 = target6).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__) != null ? _b10 : _a10.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ = [];
2690
+ var devtoolsPluginBuffer = new Proxy(target6.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__, {
2795
2691
  get(target22, prop, receiver) {
2796
2692
  return Reflect.get(target22, prop, receiver);
2797
2693
  }
@@ -2859,6 +2755,146 @@ function setPluginSettings(pluginId, key, value) {
2859
2755
  }, "setPluginSettings" /* SET_PLUGIN_SETTINGS */);
2860
2756
  }
2861
2757
 
2758
+ // src/hook/index.ts
2759
+ init_esm_shims();
2760
+ import { target as target7 } from "@vue/devtools-shared";
2761
+ import { createHooks as createHooks2 } from "hookable";
2762
+
2763
+ // src/types/index.ts
2764
+ init_esm_shims();
2765
+
2766
+ // src/types/app.ts
2767
+ init_esm_shims();
2768
+
2769
+ // src/types/command.ts
2770
+ init_esm_shims();
2771
+
2772
+ // src/types/component.ts
2773
+ init_esm_shims();
2774
+
2775
+ // src/types/hook.ts
2776
+ init_esm_shims();
2777
+
2778
+ // src/types/inspector.ts
2779
+ init_esm_shims();
2780
+
2781
+ // src/types/plugin.ts
2782
+ init_esm_shims();
2783
+
2784
+ // src/types/router.ts
2785
+ init_esm_shims();
2786
+
2787
+ // src/types/tab.ts
2788
+ init_esm_shims();
2789
+
2790
+ // src/types/timeline.ts
2791
+ init_esm_shims();
2792
+
2793
+ // src/hook/index.ts
2794
+ var _a11, _b11;
2795
+ var devtoolsHooks = (_b11 = (_a11 = target7).__VUE_DEVTOOLS_HOOK) != null ? _b11 : _a11.__VUE_DEVTOOLS_HOOK = createHooks2();
2796
+ var on = {
2797
+ vueAppInit(fn) {
2798
+ devtoolsHooks.hook("app:init" /* APP_INIT */, fn);
2799
+ },
2800
+ vueAppUnmount(fn) {
2801
+ devtoolsHooks.hook("app:unmount" /* APP_UNMOUNT */, fn);
2802
+ },
2803
+ vueAppConnected(fn) {
2804
+ devtoolsHooks.hook("app:connected" /* APP_CONNECTED */, fn);
2805
+ },
2806
+ componentAdded(fn) {
2807
+ return devtoolsHooks.hook("component:added" /* COMPONENT_ADDED */, fn);
2808
+ },
2809
+ componentUpdated(fn) {
2810
+ return devtoolsHooks.hook("component:updated" /* COMPONENT_UPDATED */, fn);
2811
+ },
2812
+ componentRemoved(fn) {
2813
+ return devtoolsHooks.hook("component:removed" /* COMPONENT_REMOVED */, fn);
2814
+ },
2815
+ setupDevtoolsPlugin(fn) {
2816
+ devtoolsHooks.hook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, fn);
2817
+ }
2818
+ };
2819
+ function createDevToolsHook() {
2820
+ return {
2821
+ id: "vue-devtools-next",
2822
+ devtoolsVersion: "7.0",
2823
+ enabled: false,
2824
+ appRecords: [],
2825
+ apps: [],
2826
+ events: /* @__PURE__ */ new Map(),
2827
+ on(event, fn) {
2828
+ var _a25;
2829
+ if (!this.events.has(event))
2830
+ this.events.set(event, []);
2831
+ (_a25 = this.events.get(event)) == null ? void 0 : _a25.push(fn);
2832
+ return () => this.off(event, fn);
2833
+ },
2834
+ once(event, fn) {
2835
+ const onceFn = (...args) => {
2836
+ this.off(event, onceFn);
2837
+ fn(...args);
2838
+ };
2839
+ this.on(event, onceFn);
2840
+ return [event, onceFn];
2841
+ },
2842
+ off(event, fn) {
2843
+ if (this.events.has(event)) {
2844
+ const eventCallbacks = this.events.get(event);
2845
+ const index = eventCallbacks.indexOf(fn);
2846
+ if (index !== -1)
2847
+ eventCallbacks.splice(index, 1);
2848
+ }
2849
+ },
2850
+ emit(event, ...payload) {
2851
+ if (this.events.has(event))
2852
+ this.events.get(event).forEach((fn) => fn(...payload));
2853
+ }
2854
+ };
2855
+ }
2856
+ function subscribeDevToolsHook() {
2857
+ const hook2 = target7.__VUE_DEVTOOLS_GLOBAL_HOOK__;
2858
+ hook2.on("app:init" /* APP_INIT */, (app, version) => {
2859
+ var _a25, _b25, _c;
2860
+ 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)
2861
+ return;
2862
+ devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version);
2863
+ });
2864
+ hook2.on("app:unmount" /* APP_UNMOUNT */, (app) => {
2865
+ devtoolsHooks.callHook("app:unmount" /* APP_UNMOUNT */, app);
2866
+ });
2867
+ hook2.on("component:added" /* COMPONENT_ADDED */, async (app, uid, parentUid, component) => {
2868
+ var _a25, _b25, _c;
2869
+ 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)
2870
+ return;
2871
+ if (!app || typeof uid !== "number" && !uid || !component)
2872
+ return;
2873
+ devtoolsHooks.callHook("component:added" /* COMPONENT_ADDED */, app, uid, parentUid, component);
2874
+ });
2875
+ hook2.on("component:updated" /* COMPONENT_UPDATED */, (app, uid, parentUid, component) => {
2876
+ if (!app || typeof uid !== "number" && !uid || !component || devtoolsState.highPerfModeEnabled)
2877
+ return;
2878
+ devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, app, uid, parentUid, component);
2879
+ });
2880
+ hook2.on("component:removed" /* COMPONENT_REMOVED */, async (app, uid, parentUid, component) => {
2881
+ if (!app || typeof uid !== "number" && !uid || !component || devtoolsState.highPerfModeEnabled)
2882
+ return;
2883
+ devtoolsHooks.callHook("component:removed" /* COMPONENT_REMOVED */, app, uid, parentUid, component);
2884
+ });
2885
+ hook2.on("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, (pluginDescriptor, setupFn, options) => {
2886
+ if ((options == null ? void 0 : options.target) === "legacy")
2887
+ return;
2888
+ devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
2889
+ });
2890
+ }
2891
+ var hook = {
2892
+ on,
2893
+ setupDevToolsPlugin(pluginDescriptor, setupFn) {
2894
+ return devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
2895
+ }
2896
+ };
2897
+
2862
2898
  // src/api/v6/index.ts
2863
2899
  var DevToolsV6PluginAPI = class {
2864
2900
  constructor({ plugin, ctx }) {
@@ -2940,259 +2976,42 @@ var DevToolsV6PluginAPI = class {
2940
2976
  return Date.now();
2941
2977
  }
2942
2978
  addTimelineLayer(options) {
2943
- this.hooks.callHook("timelineLayerAdded" /* TIMELINE_LAYER_ADDED */, { options, plugin: this.plugin });
2944
- }
2945
- addTimelineEvent(options) {
2946
- this.hooks.callHook("timelineEventAdded" /* TIMELINE_EVENT_ADDED */, { options, plugin: this.plugin });
2947
- }
2948
- // settings
2949
- getSettings(pluginId) {
2950
- const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);
2951
- return getPluginSettings(pluginId != null ? pluginId : inspector == null ? void 0 : inspector.id, this.plugin.descriptor.settings);
2952
- }
2953
- // utilities
2954
- getComponentInstances(app) {
2955
- return this.hooks.callHook("getComponentInstances" /* GET_COMPONENT_INSTANCES */, { app });
2956
- }
2957
- getComponentBounds(instance) {
2958
- return this.hooks.callHook("getComponentBounds" /* GET_COMPONENT_BOUNDS */, { instance });
2959
- }
2960
- getComponentName(instance) {
2961
- return this.hooks.callHook("getComponentName" /* GET_COMPONENT_NAME */, { instance });
2962
- }
2963
- highlightElement(instance) {
2964
- const uid = instance.__VUE_DEVTOOLS_NEXT_UID__;
2965
- return this.hooks.callHook("componentHighlight" /* COMPONENT_HIGHLIGHT */, { uid });
2966
- }
2967
- unhighlightElement() {
2968
- return this.hooks.callHook("componentUnhighlight" /* COMPONENT_UNHIGHLIGHT */);
2969
- }
2970
- };
2971
-
2972
- // src/api/index.ts
2973
- var DevToolsPluginAPI = DevToolsV6PluginAPI;
2974
-
2975
- // src/core/plugin/components.ts
2976
- init_esm_shims();
2977
- import { debounce as debounce4 } from "perfect-debounce";
2978
-
2979
- // src/core/component/tree/walker.ts
2980
- init_esm_shims();
2981
-
2982
- // src/core/component/tree/filter.ts
2983
- init_esm_shims();
2984
- import { classify as classify2, kebabize } from "@vue/devtools-shared";
2985
- var ComponentFilter = class {
2986
- constructor(filter) {
2987
- this.filter = filter || "";
2988
- }
2989
- /**
2990
- * Check if an instance is qualified.
2991
- *
2992
- * @param {Vue|Vnode} instance
2993
- * @return {boolean}
2994
- */
2995
- isQualified(instance) {
2996
- const name = getInstanceName(instance);
2997
- return classify2(name).toLowerCase().includes(this.filter) || kebabize(name).toLowerCase().includes(this.filter);
2998
- }
2999
- };
3000
- function createComponentFilter(filterText) {
3001
- return new ComponentFilter(filterText);
3002
- }
3003
-
3004
- // src/core/component/tree/walker.ts
3005
- var ComponentWalker = class {
3006
- constructor(options) {
3007
- // Dedupe instances (Some instances may be both on a component and on a child abstract/functional component)
3008
- this.captureIds = /* @__PURE__ */ new Map();
3009
- const { filterText = "", maxDepth, recursively } = options;
3010
- this.componentFilter = createComponentFilter(filterText);
3011
- this.maxDepth = maxDepth;
3012
- this.recursively = recursively;
3013
- }
3014
- getComponentTree(instance) {
3015
- this.captureIds = /* @__PURE__ */ new Map();
3016
- return this.findQualifiedChildren(instance, 0);
3017
- }
3018
- getComponentParents(instance) {
3019
- this.captureIds = /* @__PURE__ */ new Map();
3020
- const parents = [];
3021
- this.captureId(instance);
3022
- let parent = instance;
3023
- while (parent = parent.parent) {
3024
- this.captureId(parent);
3025
- parents.push(parent);
3026
- }
3027
- return parents;
3028
- }
3029
- captureId(instance) {
3030
- if (!instance)
3031
- return null;
3032
- const id = instance.__VUE_DEVTOOLS_NEXT_UID__ != null ? instance.__VUE_DEVTOOLS_NEXT_UID__ : getUniqueComponentId(instance);
3033
- instance.__VUE_DEVTOOLS_NEXT_UID__ = id;
3034
- if (this.captureIds.has(id))
3035
- return null;
3036
- else
3037
- this.captureIds.set(id, void 0);
3038
- this.mark(instance);
3039
- return id;
3040
- }
3041
- /**
3042
- * Capture the meta information of an instance. (recursive)
3043
- *
3044
- * @param {Vue} instance
3045
- * @return {object}
3046
- */
3047
- async capture(instance, depth) {
3048
- var _a25;
3049
- if (!instance)
3050
- return null;
3051
- const id = this.captureId(instance);
3052
- const name = getInstanceName(instance);
3053
- const children = this.getInternalInstanceChildren(instance.subTree).filter((child) => !isBeingDestroyed(child));
3054
- const parents = this.getComponentParents(instance) || [];
3055
- const inactive = !!instance.isDeactivated || parents.some((parent) => parent.isDeactivated);
3056
- const treeNode = {
3057
- uid: instance.uid,
3058
- id,
3059
- name,
3060
- renderKey: getRenderKey(instance.vnode ? instance.vnode.key : null),
3061
- inactive,
3062
- children: [],
3063
- isFragment: isFragment(instance),
3064
- tags: typeof instance.type !== "function" ? [] : [
3065
- {
3066
- label: "functional",
3067
- textColor: 5592405,
3068
- backgroundColor: 15658734
3069
- }
3070
- ],
3071
- autoOpen: this.recursively,
3072
- file: instance.type.__file || ""
3073
- };
3074
- if (depth < this.maxDepth || instance.type.__isKeepAlive || parents.some((parent) => parent.type.__isKeepAlive)) {
3075
- treeNode.children = await Promise.all(children.map((child) => this.capture(child, depth + 1)).filter(Boolean));
3076
- }
3077
- if (this.isKeepAlive(instance)) {
3078
- const cachedComponents = this.getKeepAliveCachedInstances(instance);
3079
- const childrenIds = children.map((child) => child.__VUE_DEVTOOLS_NEXT_UID__);
3080
- for (const cachedChild of cachedComponents) {
3081
- if (!childrenIds.includes(cachedChild.__VUE_DEVTOOLS_NEXT_UID__)) {
3082
- const node = await this.capture({ ...cachedChild, isDeactivated: true }, depth + 1);
3083
- if (node)
3084
- treeNode.children.push(node);
3085
- }
3086
- }
3087
- }
3088
- const rootElements = getRootElementsFromComponentInstance(instance);
3089
- const firstElement = rootElements[0];
3090
- if (firstElement == null ? void 0 : firstElement.parentElement) {
3091
- const parentInstance = instance.parent;
3092
- const parentRootElements = parentInstance ? getRootElementsFromComponentInstance(parentInstance) : [];
3093
- let el = firstElement;
3094
- const indexList = [];
3095
- do {
3096
- indexList.push(Array.from(el.parentElement.childNodes).indexOf(el));
3097
- el = el.parentElement;
3098
- } while (el.parentElement && parentRootElements.length && !parentRootElements.includes(el));
3099
- treeNode.domOrder = indexList.reverse();
3100
- } else {
3101
- treeNode.domOrder = [-1];
3102
- }
3103
- if ((_a25 = instance.suspense) == null ? void 0 : _a25.suspenseKey) {
3104
- treeNode.tags.push({
3105
- label: instance.suspense.suspenseKey,
3106
- backgroundColor: 14979812,
3107
- textColor: 16777215
3108
- });
3109
- this.mark(instance, true);
3110
- }
3111
- return treeNode;
3112
- }
3113
- /**
3114
- * Find qualified children from a single instance.
3115
- * If the instance itself is qualified, just return itself.
3116
- * This is ok because [].concat works in both cases.
3117
- *
3118
- * @param {Vue|Vnode} instance
3119
- * @return {Vue|Array}
3120
- */
3121
- async findQualifiedChildren(instance, depth) {
3122
- var _a25;
3123
- if (this.componentFilter.isQualified(instance) && !((_a25 = instance.type.devtools) == null ? void 0 : _a25.hide)) {
3124
- return [await this.capture(instance, depth)];
3125
- } else if (instance.subTree) {
3126
- const list = this.isKeepAlive(instance) ? this.getKeepAliveCachedInstances(instance) : this.getInternalInstanceChildren(instance.subTree);
3127
- return this.findQualifiedChildrenFromList(list, depth);
3128
- } else {
3129
- return [];
3130
- }
3131
- }
3132
- /**
3133
- * Iterate through an array of instances and flatten it into
3134
- * an array of qualified instances. This is a depth-first
3135
- * traversal - e.g. if an instance is not matched, we will
3136
- * recursively go deeper until a qualified child is found.
3137
- *
3138
- * @param {Array} instances
3139
- * @return {Array}
3140
- */
3141
- async findQualifiedChildrenFromList(instances, depth) {
3142
- instances = instances.filter((child) => {
3143
- var _a25;
3144
- return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);
3145
- });
3146
- if (!this.componentFilter.filter)
3147
- return Promise.all(instances.map((child) => this.capture(child, depth)));
3148
- else
3149
- return Array.prototype.concat.apply([], await Promise.all(instances.map((i) => this.findQualifiedChildren(i, depth))));
3150
- }
3151
- /**
3152
- * Get children from a component instance.
3153
- */
3154
- getInternalInstanceChildren(subTree, suspense = null) {
3155
- const list = [];
3156
- if (subTree) {
3157
- if (subTree.component) {
3158
- !suspense ? list.push(subTree.component) : list.push({ ...subTree.component, suspense });
3159
- } else if (subTree.suspense) {
3160
- const suspenseKey = !subTree.suspense.isInFallback ? "suspense default" : "suspense fallback";
3161
- list.push(...this.getInternalInstanceChildren(subTree.suspense.activeBranch, { ...subTree.suspense, suspenseKey }));
3162
- } else if (Array.isArray(subTree.children)) {
3163
- subTree.children.forEach((childSubTree) => {
3164
- if (childSubTree.component)
3165
- !suspense ? list.push(childSubTree.component) : list.push({ ...childSubTree.component, suspense });
3166
- else
3167
- list.push(...this.getInternalInstanceChildren(childSubTree, suspense));
3168
- });
3169
- }
3170
- }
3171
- return list.filter((child) => {
3172
- var _a25;
3173
- return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);
3174
- });
2979
+ this.hooks.callHook("timelineLayerAdded" /* TIMELINE_LAYER_ADDED */, { options, plugin: this.plugin });
3175
2980
  }
3176
- /**
3177
- * Mark an instance as captured and store it in the instance map.
3178
- *
3179
- * @param {Vue} instance
3180
- */
3181
- mark(instance, force = false) {
3182
- const instanceMap = getAppRecord(instance).instanceMap;
3183
- if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_NEXT_UID__)) {
3184
- instanceMap.set(instance.__VUE_DEVTOOLS_NEXT_UID__, instance);
3185
- activeAppRecord.value.instanceMap = instanceMap;
3186
- }
2981
+ addTimelineEvent(options) {
2982
+ this.hooks.callHook("timelineEventAdded" /* TIMELINE_EVENT_ADDED */, { options, plugin: this.plugin });
3187
2983
  }
3188
- isKeepAlive(instance) {
3189
- return instance.type.__isKeepAlive && instance.__v_cache;
2984
+ // settings
2985
+ getSettings(pluginId) {
2986
+ const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);
2987
+ return getPluginSettings(pluginId != null ? pluginId : inspector == null ? void 0 : inspector.id, this.plugin.descriptor.settings);
3190
2988
  }
3191
- getKeepAliveCachedInstances(instance) {
3192
- return Array.from(instance.__v_cache.values()).map((vnode) => vnode.component).filter(Boolean);
2989
+ // utilities
2990
+ getComponentInstances(app) {
2991
+ return this.hooks.callHook("getComponentInstances" /* GET_COMPONENT_INSTANCES */, { app });
2992
+ }
2993
+ getComponentBounds(instance) {
2994
+ return this.hooks.callHook("getComponentBounds" /* GET_COMPONENT_BOUNDS */, { instance });
2995
+ }
2996
+ getComponentName(instance) {
2997
+ return this.hooks.callHook("getComponentName" /* GET_COMPONENT_NAME */, { instance });
2998
+ }
2999
+ highlightElement(instance) {
3000
+ const uid = instance.__VUE_DEVTOOLS_NEXT_UID__;
3001
+ return this.hooks.callHook("componentHighlight" /* COMPONENT_HIGHLIGHT */, { uid });
3002
+ }
3003
+ unhighlightElement() {
3004
+ return this.hooks.callHook("componentUnhighlight" /* COMPONENT_UNHIGHLIGHT */);
3193
3005
  }
3194
3006
  };
3195
3007
 
3008
+ // src/api/index.ts
3009
+ var DevToolsPluginAPI = DevToolsV6PluginAPI;
3010
+
3011
+ // src/core/plugin/components.ts
3012
+ init_esm_shims();
3013
+ import { debounce as debounce3 } from "perfect-debounce";
3014
+
3196
3015
  // src/core/component/state/index.ts
3197
3016
  init_esm_shims();
3198
3017
 
@@ -3577,38 +3396,255 @@ function processEventListeners(instance) {
3577
3396
  });
3578
3397
  }
3579
3398
  }
3580
- return result;
3581
- }
3582
- function processInstanceState(instance) {
3583
- const mergedType = resolveMergedOptions(instance);
3584
- return processProps(instance).concat(
3585
- processState(instance),
3586
- processSetupState(instance),
3587
- processComputed(instance, mergedType),
3588
- processAttrs(instance),
3589
- processProvide(instance),
3590
- processInject(instance, mergedType),
3591
- processRefs(instance),
3592
- processEventListeners(instance)
3593
- );
3594
- }
3595
-
3596
- // src/core/component/state/index.ts
3597
- function getInstanceState(params) {
3598
- var _a25;
3599
- const instance = getComponentInstance(activeAppRecord.value, params.instanceId);
3600
- const id = getUniqueComponentId(instance);
3601
- const name = getInstanceName(instance);
3602
- const file = (_a25 = instance == null ? void 0 : instance.type) == null ? void 0 : _a25.__file;
3603
- const state = processInstanceState(instance);
3604
- return {
3605
- id,
3606
- name,
3607
- file,
3608
- state,
3609
- instance
3610
- };
3611
- }
3399
+ return result;
3400
+ }
3401
+ function processInstanceState(instance) {
3402
+ const mergedType = resolveMergedOptions(instance);
3403
+ return processProps(instance).concat(
3404
+ processState(instance),
3405
+ processSetupState(instance),
3406
+ processComputed(instance, mergedType),
3407
+ processAttrs(instance),
3408
+ processProvide(instance),
3409
+ processInject(instance, mergedType),
3410
+ processRefs(instance),
3411
+ processEventListeners(instance)
3412
+ );
3413
+ }
3414
+
3415
+ // src/core/component/state/index.ts
3416
+ function getInstanceState(params) {
3417
+ var _a25;
3418
+ const instance = getComponentInstance(activeAppRecord.value, params.instanceId);
3419
+ const id = getUniqueComponentId(instance);
3420
+ const name = getInstanceName(instance);
3421
+ const file = (_a25 = instance == null ? void 0 : instance.type) == null ? void 0 : _a25.__file;
3422
+ const state = processInstanceState(instance);
3423
+ return {
3424
+ id,
3425
+ name,
3426
+ file,
3427
+ state,
3428
+ instance
3429
+ };
3430
+ }
3431
+
3432
+ // src/core/component/tree/walker.ts
3433
+ init_esm_shims();
3434
+
3435
+ // src/core/component/tree/filter.ts
3436
+ init_esm_shims();
3437
+ import { classify as classify2, kebabize } from "@vue/devtools-shared";
3438
+ var ComponentFilter = class {
3439
+ constructor(filter) {
3440
+ this.filter = filter || "";
3441
+ }
3442
+ /**
3443
+ * Check if an instance is qualified.
3444
+ *
3445
+ * @param {Vue|Vnode} instance
3446
+ * @return {boolean}
3447
+ */
3448
+ isQualified(instance) {
3449
+ const name = getInstanceName(instance);
3450
+ return classify2(name).toLowerCase().includes(this.filter) || kebabize(name).toLowerCase().includes(this.filter);
3451
+ }
3452
+ };
3453
+ function createComponentFilter(filterText) {
3454
+ return new ComponentFilter(filterText);
3455
+ }
3456
+
3457
+ // src/core/component/tree/walker.ts
3458
+ var ComponentWalker = class {
3459
+ constructor(options) {
3460
+ // Dedupe instances (Some instances may be both on a component and on a child abstract/functional component)
3461
+ this.captureIds = /* @__PURE__ */ new Map();
3462
+ const { filterText = "", maxDepth, recursively } = options;
3463
+ this.componentFilter = createComponentFilter(filterText);
3464
+ this.maxDepth = maxDepth;
3465
+ this.recursively = recursively;
3466
+ }
3467
+ getComponentTree(instance) {
3468
+ this.captureIds = /* @__PURE__ */ new Map();
3469
+ return this.findQualifiedChildren(instance, 0);
3470
+ }
3471
+ getComponentParents(instance) {
3472
+ this.captureIds = /* @__PURE__ */ new Map();
3473
+ const parents = [];
3474
+ this.captureId(instance);
3475
+ let parent = instance;
3476
+ while (parent = parent.parent) {
3477
+ this.captureId(parent);
3478
+ parents.push(parent);
3479
+ }
3480
+ return parents;
3481
+ }
3482
+ captureId(instance) {
3483
+ if (!instance)
3484
+ return null;
3485
+ const id = instance.__VUE_DEVTOOLS_NEXT_UID__ != null ? instance.__VUE_DEVTOOLS_NEXT_UID__ : getUniqueComponentId(instance);
3486
+ instance.__VUE_DEVTOOLS_NEXT_UID__ = id;
3487
+ if (this.captureIds.has(id))
3488
+ return null;
3489
+ else
3490
+ this.captureIds.set(id, void 0);
3491
+ this.mark(instance);
3492
+ return id;
3493
+ }
3494
+ /**
3495
+ * Capture the meta information of an instance. (recursive)
3496
+ *
3497
+ * @param {Vue} instance
3498
+ * @return {object}
3499
+ */
3500
+ async capture(instance, depth) {
3501
+ var _a25;
3502
+ if (!instance)
3503
+ return null;
3504
+ const id = this.captureId(instance);
3505
+ const name = getInstanceName(instance);
3506
+ const children = this.getInternalInstanceChildren(instance.subTree).filter((child) => !isBeingDestroyed(child));
3507
+ const parents = this.getComponentParents(instance) || [];
3508
+ const inactive = !!instance.isDeactivated || parents.some((parent) => parent.isDeactivated);
3509
+ const treeNode = {
3510
+ uid: instance.uid,
3511
+ id,
3512
+ name,
3513
+ renderKey: getRenderKey(instance.vnode ? instance.vnode.key : null),
3514
+ inactive,
3515
+ children: [],
3516
+ isFragment: isFragment(instance),
3517
+ tags: typeof instance.type !== "function" ? [] : [
3518
+ {
3519
+ label: "functional",
3520
+ textColor: 5592405,
3521
+ backgroundColor: 15658734
3522
+ }
3523
+ ],
3524
+ autoOpen: this.recursively,
3525
+ file: instance.type.__file || ""
3526
+ };
3527
+ if (depth < this.maxDepth || instance.type.__isKeepAlive || parents.some((parent) => parent.type.__isKeepAlive)) {
3528
+ treeNode.children = await Promise.all(children.map((child) => this.capture(child, depth + 1)).filter(Boolean));
3529
+ }
3530
+ if (this.isKeepAlive(instance)) {
3531
+ const cachedComponents = this.getKeepAliveCachedInstances(instance);
3532
+ const childrenIds = children.map((child) => child.__VUE_DEVTOOLS_NEXT_UID__);
3533
+ for (const cachedChild of cachedComponents) {
3534
+ if (!childrenIds.includes(cachedChild.__VUE_DEVTOOLS_NEXT_UID__)) {
3535
+ const node = await this.capture({ ...cachedChild, isDeactivated: true }, depth + 1);
3536
+ if (node)
3537
+ treeNode.children.push(node);
3538
+ }
3539
+ }
3540
+ }
3541
+ const rootElements = getRootElementsFromComponentInstance(instance);
3542
+ const firstElement = rootElements[0];
3543
+ if (firstElement == null ? void 0 : firstElement.parentElement) {
3544
+ const parentInstance = instance.parent;
3545
+ const parentRootElements = parentInstance ? getRootElementsFromComponentInstance(parentInstance) : [];
3546
+ let el = firstElement;
3547
+ const indexList = [];
3548
+ do {
3549
+ indexList.push(Array.from(el.parentElement.childNodes).indexOf(el));
3550
+ el = el.parentElement;
3551
+ } while (el.parentElement && parentRootElements.length && !parentRootElements.includes(el));
3552
+ treeNode.domOrder = indexList.reverse();
3553
+ } else {
3554
+ treeNode.domOrder = [-1];
3555
+ }
3556
+ if ((_a25 = instance.suspense) == null ? void 0 : _a25.suspenseKey) {
3557
+ treeNode.tags.push({
3558
+ label: instance.suspense.suspenseKey,
3559
+ backgroundColor: 14979812,
3560
+ textColor: 16777215
3561
+ });
3562
+ this.mark(instance, true);
3563
+ }
3564
+ return treeNode;
3565
+ }
3566
+ /**
3567
+ * Find qualified children from a single instance.
3568
+ * If the instance itself is qualified, just return itself.
3569
+ * This is ok because [].concat works in both cases.
3570
+ *
3571
+ * @param {Vue|Vnode} instance
3572
+ * @return {Vue|Array}
3573
+ */
3574
+ async findQualifiedChildren(instance, depth) {
3575
+ var _a25;
3576
+ if (this.componentFilter.isQualified(instance) && !((_a25 = instance.type.devtools) == null ? void 0 : _a25.hide)) {
3577
+ return [await this.capture(instance, depth)];
3578
+ } else if (instance.subTree) {
3579
+ const list = this.isKeepAlive(instance) ? this.getKeepAliveCachedInstances(instance) : this.getInternalInstanceChildren(instance.subTree);
3580
+ return this.findQualifiedChildrenFromList(list, depth);
3581
+ } else {
3582
+ return [];
3583
+ }
3584
+ }
3585
+ /**
3586
+ * Iterate through an array of instances and flatten it into
3587
+ * an array of qualified instances. This is a depth-first
3588
+ * traversal - e.g. if an instance is not matched, we will
3589
+ * recursively go deeper until a qualified child is found.
3590
+ *
3591
+ * @param {Array} instances
3592
+ * @return {Array}
3593
+ */
3594
+ async findQualifiedChildrenFromList(instances, depth) {
3595
+ instances = instances.filter((child) => {
3596
+ var _a25;
3597
+ return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);
3598
+ });
3599
+ if (!this.componentFilter.filter)
3600
+ return Promise.all(instances.map((child) => this.capture(child, depth)));
3601
+ else
3602
+ return Array.prototype.concat.apply([], await Promise.all(instances.map((i) => this.findQualifiedChildren(i, depth))));
3603
+ }
3604
+ /**
3605
+ * Get children from a component instance.
3606
+ */
3607
+ getInternalInstanceChildren(subTree, suspense = null) {
3608
+ const list = [];
3609
+ if (subTree) {
3610
+ if (subTree.component) {
3611
+ !suspense ? list.push(subTree.component) : list.push({ ...subTree.component, suspense });
3612
+ } else if (subTree.suspense) {
3613
+ const suspenseKey = !subTree.suspense.isInFallback ? "suspense default" : "suspense fallback";
3614
+ list.push(...this.getInternalInstanceChildren(subTree.suspense.activeBranch, { ...subTree.suspense, suspenseKey }));
3615
+ } else if (Array.isArray(subTree.children)) {
3616
+ subTree.children.forEach((childSubTree) => {
3617
+ if (childSubTree.component)
3618
+ !suspense ? list.push(childSubTree.component) : list.push({ ...childSubTree.component, suspense });
3619
+ else
3620
+ list.push(...this.getInternalInstanceChildren(childSubTree, suspense));
3621
+ });
3622
+ }
3623
+ }
3624
+ return list.filter((child) => {
3625
+ var _a25;
3626
+ return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);
3627
+ });
3628
+ }
3629
+ /**
3630
+ * Mark an instance as captured and store it in the instance map.
3631
+ *
3632
+ * @param {Vue} instance
3633
+ */
3634
+ mark(instance, force = false) {
3635
+ const instanceMap = getAppRecord(instance).instanceMap;
3636
+ if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_NEXT_UID__)) {
3637
+ instanceMap.set(instance.__VUE_DEVTOOLS_NEXT_UID__, instance);
3638
+ activeAppRecord.value.instanceMap = instanceMap;
3639
+ }
3640
+ }
3641
+ isKeepAlive(instance) {
3642
+ return instance.type.__isKeepAlive && instance.__v_cache;
3643
+ }
3644
+ getKeepAliveCachedInstances(instance) {
3645
+ return Array.from(instance.__v_cache.values()).map((vnode) => vnode.component).filter(Boolean);
3646
+ }
3647
+ };
3612
3648
 
3613
3649
  // src/core/vm/index.ts
3614
3650
  init_esm_shims();
@@ -3686,10 +3722,10 @@ function createComponentsDevToolsPlugin(app) {
3686
3722
  await api.sendInspectorState("components");
3687
3723
  }
3688
3724
  });
3689
- const debounceSendInspectorTree = debounce4(() => {
3725
+ const debounceSendInspectorTree = debounce3(() => {
3690
3726
  api.sendInspectorTree(INSPECTOR_ID);
3691
3727
  }, 120);
3692
- const debounceSendInspectorState = debounce4(() => {
3728
+ const debounceSendInspectorState = debounce3(() => {
3693
3729
  api.sendInspectorState(INSPECTOR_ID);
3694
3730
  }, 120);
3695
3731
  const componentAddedCleanup = hook.on.componentAdded(async (app2, uid, parentUid, component) => {
@@ -3773,8 +3809,8 @@ function createComponentsDevToolsPlugin(app) {
3773
3809
  }
3774
3810
 
3775
3811
  // src/core/plugin/index.ts
3776
- var _a13, _b13;
3777
- (_b13 = (_a13 = target6).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__) != null ? _b13 : _a13.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ = /* @__PURE__ */ new Set();
3812
+ var _a12, _b12;
3813
+ (_b12 = (_a12 = target8).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__) != null ? _b12 : _a12.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ = /* @__PURE__ */ new Set();
3778
3814
  function setupDevToolsPlugin(pluginDescriptor, setupFn) {
3779
3815
  return hook.setupDevToolsPlugin(pluginDescriptor, setupFn);
3780
3816
  }
@@ -3804,17 +3840,107 @@ function callDevToolsPluginSetupFn(plugin, app) {
3804
3840
  }
3805
3841
  }
3806
3842
  function removeRegisteredPluginApp(app) {
3807
- target6.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.delete(app);
3843
+ target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.delete(app);
3808
3844
  }
3809
3845
  function registerDevToolsPlugin(app) {
3810
- if (target6.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(app))
3846
+ if (target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(app))
3811
3847
  return;
3812
- target6.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(app);
3848
+ target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(app);
3813
3849
  devtoolsPluginBuffer.forEach((plugin) => {
3814
3850
  callDevToolsPluginSetupFn(plugin, app);
3815
3851
  });
3816
3852
  }
3817
3853
 
3854
+ // src/core/router/index.ts
3855
+ init_esm_shims();
3856
+ import { deepClone, target as global3 } from "@vue/devtools-shared";
3857
+ import { debounce as debounce4 } from "perfect-debounce";
3858
+
3859
+ // src/ctx/router.ts
3860
+ init_esm_shims();
3861
+ import { target as global2 } from "@vue/devtools-shared";
3862
+ var ROUTER_KEY = "__VUE_DEVTOOLS_ROUTER__";
3863
+ var ROUTER_INFO_KEY = "__VUE_DEVTOOLS_ROUTER_INFO__";
3864
+ var _a13, _b13;
3865
+ (_b13 = (_a13 = global2)[ROUTER_INFO_KEY]) != null ? _b13 : _a13[ROUTER_INFO_KEY] = {
3866
+ currentRoute: null,
3867
+ routes: []
3868
+ };
3869
+ var _a14, _b14;
3870
+ (_b14 = (_a14 = global2)[ROUTER_KEY]) != null ? _b14 : _a14[ROUTER_KEY] = {};
3871
+ var devtoolsRouterInfo = new Proxy(global2[ROUTER_INFO_KEY], {
3872
+ get(target22, property) {
3873
+ return global2[ROUTER_INFO_KEY][property];
3874
+ }
3875
+ });
3876
+ var devtoolsRouter = new Proxy(global2[ROUTER_KEY], {
3877
+ get(target22, property) {
3878
+ if (property === "value") {
3879
+ return global2[ROUTER_KEY];
3880
+ }
3881
+ }
3882
+ });
3883
+
3884
+ // src/core/router/index.ts
3885
+ function getRoutes(router) {
3886
+ const routesMap = /* @__PURE__ */ new Map();
3887
+ return ((router == null ? void 0 : router.getRoutes()) || []).filter((i) => !routesMap.has(i.path) && routesMap.set(i.path, 1));
3888
+ }
3889
+ function filterRoutes(routes) {
3890
+ return routes.map((item) => {
3891
+ let { path, name, children, meta } = item;
3892
+ if (children == null ? void 0 : children.length)
3893
+ children = filterRoutes(children);
3894
+ return {
3895
+ path,
3896
+ name,
3897
+ children,
3898
+ meta
3899
+ };
3900
+ });
3901
+ }
3902
+ function filterCurrentRoute(route) {
3903
+ if (route) {
3904
+ const { fullPath, hash, href, path, name, matched, params, query } = route;
3905
+ return {
3906
+ fullPath,
3907
+ hash,
3908
+ href,
3909
+ path,
3910
+ name,
3911
+ params,
3912
+ query,
3913
+ matched: filterRoutes(matched)
3914
+ };
3915
+ }
3916
+ return route;
3917
+ }
3918
+ function normalizeRouterInfo(appRecord, activeAppRecord2) {
3919
+ function init() {
3920
+ var _a25;
3921
+ const router = (_a25 = appRecord.app) == null ? void 0 : _a25.config.globalProperties.$router;
3922
+ const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);
3923
+ const routes = filterRoutes(getRoutes(router));
3924
+ const c = console.warn;
3925
+ console.warn = () => {
3926
+ };
3927
+ global3[ROUTER_INFO_KEY] = {
3928
+ currentRoute: currentRoute ? deepClone(currentRoute) : {},
3929
+ routes: deepClone(routes)
3930
+ };
3931
+ global3[ROUTER_KEY] = router;
3932
+ console.warn = c;
3933
+ }
3934
+ init();
3935
+ hook.on.componentUpdated(debounce4(() => {
3936
+ var _a25;
3937
+ if (((_a25 = activeAppRecord2.value) == null ? void 0 : _a25.app) !== appRecord.app)
3938
+ return;
3939
+ init();
3940
+ devtoolsContext.hooks.callHook("routerInfoUpdated" /* ROUTER_INFO_UPDATED */, { state: global3[ROUTER_INFO_KEY] });
3941
+ }, 200));
3942
+ }
3943
+
3818
3944
  // src/ctx/api.ts
3819
3945
  function createDevToolsApi(hooks2) {
3820
3946
  return {
@@ -3912,178 +4038,56 @@ function createDevToolsApi(hooks2) {
3912
4038
  if (instance) {
3913
4039
  const [el] = getRootElementsFromComponentInstance(instance);
3914
4040
  if (el) {
3915
- target7.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__ = el;
3916
- }
3917
- }
3918
- },
3919
- updatePluginSettings(pluginId, key, value) {
3920
- setPluginSettings(pluginId, key, value);
3921
- },
3922
- getPluginSettings(pluginId) {
3923
- return {
3924
- options: getPluginSettingsOptions(pluginId),
3925
- values: getPluginSettings(pluginId)
3926
- };
3927
- }
3928
- };
3929
- }
3930
-
3931
- // src/ctx/env.ts
3932
- init_esm_shims();
3933
- import { target as target8 } from "@vue/devtools-shared";
3934
- var _a14, _b14;
3935
- (_b14 = (_a14 = target8).__VUE_DEVTOOLS_ENV__) != null ? _b14 : _a14.__VUE_DEVTOOLS_ENV__ = {
3936
- vitePluginDetected: false
3937
- };
3938
- function getDevToolsEnv() {
3939
- return target8.__VUE_DEVTOOLS_ENV__;
3940
- }
3941
- function setDevToolsEnv(env) {
3942
- target8.__VUE_DEVTOOLS_ENV__ = {
3943
- ...target8.__VUE_DEVTOOLS_ENV__,
3944
- ...env
3945
- };
3946
- }
3947
-
3948
- // src/ctx/index.ts
3949
- var hooks = createDevToolsCtxHooks();
3950
- var _a15, _b15;
3951
- (_b15 = (_a15 = target9).__VUE_DEVTOOLS_KIT_CONTEXT__) != null ? _b15 : _a15.__VUE_DEVTOOLS_KIT_CONTEXT__ = {
3952
- hooks,
3953
- get state() {
3954
- return {
3955
- ...devtoolsState,
3956
- activeAppRecordId: activeAppRecord.id,
3957
- activeAppRecord: activeAppRecord.value,
3958
- appRecords: devtoolsAppRecords.value
3959
- };
3960
- },
3961
- api: createDevToolsApi(hooks)
3962
- };
3963
- var devtoolsContext = target9.__VUE_DEVTOOLS_KIT_CONTEXT__;
3964
-
3965
- // src/hook/index.ts
3966
- var _a16, _b16;
3967
- var devtoolsHooks = (_b16 = (_a16 = target10).__VUE_DEVTOOLS_HOOK) != null ? _b16 : _a16.__VUE_DEVTOOLS_HOOK = createHooks2();
3968
- var on = {
3969
- vueAppInit(fn) {
3970
- devtoolsHooks.hook("app:init" /* APP_INIT */, fn);
3971
- },
3972
- vueAppUnmount(fn) {
3973
- devtoolsHooks.hook("app:unmount" /* APP_UNMOUNT */, fn);
3974
- },
3975
- vueAppConnected(fn) {
3976
- devtoolsHooks.hook("app:connected" /* APP_CONNECTED */, fn);
3977
- },
3978
- componentAdded(fn) {
3979
- return devtoolsHooks.hook("component:added" /* COMPONENT_ADDED */, fn);
3980
- },
3981
- componentUpdated(fn) {
3982
- return devtoolsHooks.hook("component:updated" /* COMPONENT_UPDATED */, fn);
3983
- },
3984
- componentRemoved(fn) {
3985
- return devtoolsHooks.hook("component:removed" /* COMPONENT_REMOVED */, fn);
3986
- },
3987
- setupDevtoolsPlugin(fn) {
3988
- devtoolsHooks.hook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, fn);
3989
- }
3990
- };
3991
- function createDevToolsHook() {
3992
- return {
3993
- id: "vue-devtools-next",
3994
- devtoolsVersion: "7.0",
3995
- enabled: false,
3996
- appRecords: [],
3997
- apps: [],
3998
- events: /* @__PURE__ */ new Map(),
3999
- on(event, fn) {
4000
- var _a25;
4001
- if (!this.events.has(event))
4002
- this.events.set(event, []);
4003
- (_a25 = this.events.get(event)) == null ? void 0 : _a25.push(fn);
4004
- return () => this.off(event, fn);
4005
- },
4006
- once(event, fn) {
4007
- const onceFn = (...args) => {
4008
- this.off(event, onceFn);
4009
- fn(...args);
4010
- };
4011
- this.on(event, onceFn);
4012
- return [event, onceFn];
4013
- },
4014
- off(event, fn) {
4015
- if (this.events.has(event)) {
4016
- const eventCallbacks = this.events.get(event);
4017
- const index = eventCallbacks.indexOf(fn);
4018
- if (index !== -1)
4019
- eventCallbacks.splice(index, 1);
4041
+ target9.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__ = el;
4042
+ }
4020
4043
  }
4021
4044
  },
4022
- emit(event, ...payload) {
4023
- if (this.events.has(event))
4024
- this.events.get(event).forEach((fn) => fn(...payload));
4045
+ updatePluginSettings(pluginId, key, value) {
4046
+ setPluginSettings(pluginId, key, value);
4047
+ },
4048
+ getPluginSettings(pluginId) {
4049
+ return {
4050
+ options: getPluginSettingsOptions(pluginId),
4051
+ values: getPluginSettings(pluginId)
4052
+ };
4025
4053
  }
4026
4054
  };
4027
4055
  }
4028
- function subscribeDevToolsHook() {
4029
- const hook2 = target10.__VUE_DEVTOOLS_GLOBAL_HOOK__;
4030
- hook2.on("app:init" /* APP_INIT */, (app, version) => {
4031
- var _a25, _b25, _c;
4032
- 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)
4033
- return;
4034
- devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version);
4035
- });
4036
- hook2.on("app:unmount" /* APP_UNMOUNT */, (app) => {
4037
- devtoolsHooks.callHook("app:unmount" /* APP_UNMOUNT */, app);
4038
- });
4039
- hook2.on("component:added" /* COMPONENT_ADDED */, async (app, uid, parentUid, component) => {
4040
- var _a25, _b25, _c;
4041
- 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)
4042
- return;
4043
- if (!app || typeof uid !== "number" && !uid || !component)
4044
- return;
4045
- devtoolsHooks.callHook("component:added" /* COMPONENT_ADDED */, app, uid, parentUid, component);
4046
- });
4047
- hook2.on("component:updated" /* COMPONENT_UPDATED */, (app, uid, parentUid, component) => {
4048
- if (!app || typeof uid !== "number" && !uid || !component || devtoolsState.highPerfModeEnabled)
4049
- return;
4050
- devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, app, uid, parentUid, component);
4051
- });
4052
- hook2.on("component:removed" /* COMPONENT_REMOVED */, async (app, uid, parentUid, component) => {
4053
- if (!app || typeof uid !== "number" && !uid || !component || devtoolsState.highPerfModeEnabled)
4054
- return;
4055
- devtoolsHooks.callHook("component:removed" /* COMPONENT_REMOVED */, app, uid, parentUid, component);
4056
- });
4057
- hook2.on("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, (pluginDescriptor, setupFn, options) => {
4058
- if ((options == null ? void 0 : options.target) === "legacy")
4059
- return;
4060
- devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
4061
- });
4062
- }
4063
- var hook = {
4064
- on,
4065
- setupDevToolsPlugin(pluginDescriptor, setupFn) {
4066
- return devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
4067
- }
4068
- };
4069
4056
 
4070
- // src/compat/index.ts
4057
+ // src/ctx/env.ts
4071
4058
  init_esm_shims();
4072
- import { target as target11 } from "@vue/devtools-shared";
4073
- function onLegacyDevToolsPluginApiAvailable(cb) {
4074
- if (target11.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__) {
4075
- cb();
4076
- return;
4077
- }
4078
- Object.defineProperty(target11, "__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__", {
4079
- set(value) {
4080
- if (value)
4081
- cb();
4082
- },
4083
- configurable: true
4084
- });
4059
+ import { target as target10 } from "@vue/devtools-shared";
4060
+ var _a15, _b15;
4061
+ (_b15 = (_a15 = target10).__VUE_DEVTOOLS_ENV__) != null ? _b15 : _a15.__VUE_DEVTOOLS_ENV__ = {
4062
+ vitePluginDetected: false
4063
+ };
4064
+ function getDevToolsEnv() {
4065
+ return target10.__VUE_DEVTOOLS_ENV__;
4066
+ }
4067
+ function setDevToolsEnv(env) {
4068
+ target10.__VUE_DEVTOOLS_ENV__ = {
4069
+ ...target10.__VUE_DEVTOOLS_ENV__,
4070
+ ...env
4071
+ };
4085
4072
  }
4086
4073
 
4074
+ // src/ctx/index.ts
4075
+ var hooks = createDevToolsCtxHooks();
4076
+ var _a16, _b16;
4077
+ (_b16 = (_a16 = target11).__VUE_DEVTOOLS_KIT_CONTEXT__) != null ? _b16 : _a16.__VUE_DEVTOOLS_KIT_CONTEXT__ = {
4078
+ hooks,
4079
+ get state() {
4080
+ return {
4081
+ ...devtoolsState,
4082
+ activeAppRecordId: activeAppRecord.id,
4083
+ activeAppRecord: activeAppRecord.value,
4084
+ appRecords: devtoolsAppRecords.value
4085
+ };
4086
+ },
4087
+ api: createDevToolsApi(hooks)
4088
+ };
4089
+ var devtoolsContext = target11.__VUE_DEVTOOLS_KIT_CONTEXT__;
4090
+
4087
4091
  // src/core/app/index.ts
4088
4092
  init_esm_shims();
4089
4093
  var import_speakingurl = __toESM(require_speakingurl2(), 1);
@@ -4163,6 +4167,14 @@ function initDevTools() {
4163
4167
  Object.assign(__VUE_DEVTOOLS_GLOBAL_HOOK__, createDevToolsHook());
4164
4168
  }
4165
4169
  }
4170
+ target13.__VUE_DEVTOOLS_GLOBAL_HOOK__.once("init", (Vue) => {
4171
+ console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 700; font-size: 20px;");
4172
+ console.log("%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.", "font-bold: 700; font-size: 16px;");
4173
+ const url = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
4174
+ console.log(`%cThe legacy version that supports both Vue 2 and Vue 3 has been moved to %c ${url}`, "font-size: 16px;", "text-decoration: underline; cursor: pointer;font-size: 16px;");
4175
+ console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 700; font-size: 16px;");
4176
+ console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 700; font-size: 20px;");
4177
+ });
4166
4178
  hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {
4167
4179
  var _a26;
4168
4180
  addDevToolsPluginToBuffer(pluginDescriptor, setupFn);
@@ -4237,20 +4249,186 @@ function toggleHighPerfMode(state) {
4237
4249
  devtoolsState.highPerfModeEnabled = state != null ? state : !devtoolsState.highPerfModeEnabled;
4238
4250
  }
4239
4251
 
4252
+ // src/core/component/state/format.ts
4253
+ init_esm_shims();
4254
+
4255
+ // src/core/component/state/reviver.ts
4256
+ init_esm_shims();
4257
+ import { target as target14 } from "@vue/devtools-shared";
4258
+ function reviveSet(val) {
4259
+ const result = /* @__PURE__ */ new Set();
4260
+ const list = val._custom.value;
4261
+ for (let i = 0; i < list.length; i++) {
4262
+ const value = list[i];
4263
+ result.add(revive(value));
4264
+ }
4265
+ return result;
4266
+ }
4267
+ function reviveMap(val) {
4268
+ const result = /* @__PURE__ */ new Map();
4269
+ const list = val._custom.value;
4270
+ for (let i = 0; i < list.length; i++) {
4271
+ const { key, value } = list[i];
4272
+ result.set(key, revive(value));
4273
+ }
4274
+ return result;
4275
+ }
4276
+ function revive(val) {
4277
+ if (val === UNDEFINED) {
4278
+ return void 0;
4279
+ } else if (val === INFINITY) {
4280
+ return Number.POSITIVE_INFINITY;
4281
+ } else if (val === NEGATIVE_INFINITY) {
4282
+ return Number.NEGATIVE_INFINITY;
4283
+ } else if (val === NAN) {
4284
+ return Number.NaN;
4285
+ } else if (val && val._custom) {
4286
+ const { _custom: custom } = val;
4287
+ if (custom.type === "component")
4288
+ return activeAppRecord.value.instanceMap.get(custom.id);
4289
+ else if (custom.type === "map")
4290
+ return reviveMap(val);
4291
+ else if (custom.type === "set")
4292
+ return reviveSet(val);
4293
+ else if (custom.type === "bigint")
4294
+ return BigInt(custom.value);
4295
+ else
4296
+ return revive(custom.value);
4297
+ } else if (symbolRE.test(val)) {
4298
+ const [, string] = symbolRE.exec(val);
4299
+ return Symbol.for(string);
4300
+ } else if (specialTypeRE.test(val)) {
4301
+ const [, type, string, , details] = specialTypeRE.exec(val);
4302
+ const result = new target14[type](string);
4303
+ if (type === "Error" && details)
4304
+ result.stack = details;
4305
+ return result;
4306
+ } else {
4307
+ return val;
4308
+ }
4309
+ }
4310
+ function reviver(key, value) {
4311
+ return revive(value);
4312
+ }
4313
+
4314
+ // src/core/component/state/format.ts
4315
+ function getInspectorStateValueType(value, raw = true) {
4316
+ const type = typeof value;
4317
+ if (value == null || value === UNDEFINED || value === "undefined") {
4318
+ return "null";
4319
+ } else if (type === "boolean" || type === "number" || value === INFINITY || value === NEGATIVE_INFINITY || value === NAN) {
4320
+ return "literal";
4321
+ } else if (value == null ? void 0 : value._custom) {
4322
+ if (raw || value._custom.display != null || value._custom.displayText != null)
4323
+ return "custom";
4324
+ else
4325
+ return getInspectorStateValueType(value._custom.value);
4326
+ } else if (typeof value === "string") {
4327
+ const typeMatch = specialTypeRE.exec(value);
4328
+ if (typeMatch) {
4329
+ const [, type2] = typeMatch;
4330
+ return `native ${type2}`;
4331
+ } else {
4332
+ return "string";
4333
+ }
4334
+ } else if (Array.isArray(value) || (value == null ? void 0 : value._isArray)) {
4335
+ return "array";
4336
+ } else if (isPlainObject(value)) {
4337
+ return "plain-object";
4338
+ } else {
4339
+ return "unknown";
4340
+ }
4341
+ }
4342
+ function formatInspectorStateValue(value, quotes = false, options) {
4343
+ var _a25, _b25, _c;
4344
+ const { customClass } = options != null ? options : {};
4345
+ let result;
4346
+ const type = getInspectorStateValueType(value, false);
4347
+ if (type !== "custom" && (value == null ? void 0 : value._custom))
4348
+ value = value._custom.value;
4349
+ if (result = internalStateTokenToString(value)) {
4350
+ return result;
4351
+ } else if (type === "custom") {
4352
+ const nestedName = ((_a25 = value._custom.value) == null ? void 0 : _a25._custom) && formatInspectorStateValue(value._custom.value, quotes, options);
4353
+ return nestedName || value._custom.displayText || value._custom.display;
4354
+ } else if (type === "array") {
4355
+ return `Array[${value.length}]`;
4356
+ } else if (type === "plain-object") {
4357
+ return `Object${Object.keys(value).length ? "" : " (empty)"}`;
4358
+ } else if (type == null ? void 0 : type.includes("native")) {
4359
+ return escape((_b25 = specialTypeRE.exec(value)) == null ? void 0 : _b25[2]);
4360
+ } else if (typeof value === "string") {
4361
+ const typeMatch = value.match(rawTypeRE);
4362
+ if (typeMatch) {
4363
+ value = escapeString(typeMatch[1]);
4364
+ } else if (quotes) {
4365
+ value = `<span>"</span>${(customClass == null ? void 0 : customClass.string) ? `<span class=${customClass.string}>${escapeString(value)}</span>` : escapeString(value)}<span>"</span>`;
4366
+ } else {
4367
+ value = (customClass == null ? void 0 : customClass.string) ? `<span class="${(_c = customClass == null ? void 0 : customClass.string) != null ? _c : ""}">${escapeString(value)}</span>` : escapeString(value);
4368
+ }
4369
+ }
4370
+ return value;
4371
+ }
4372
+ function escapeString(value) {
4373
+ return escape(value).replace(/ /g, "&nbsp;").replace(/\n/g, "<span>\\n</span>");
4374
+ }
4375
+ function getRaw(value) {
4376
+ var _a25, _b25, _c;
4377
+ let customType;
4378
+ const isCustom = getInspectorStateValueType(value) === "custom";
4379
+ let inherit = {};
4380
+ if (isCustom) {
4381
+ const data = value;
4382
+ const customValue = (_a25 = data._custom) == null ? void 0 : _a25.value;
4383
+ const currentCustomType = (_b25 = data._custom) == null ? void 0 : _b25.type;
4384
+ const nestedCustom = typeof customValue === "object" && customValue !== null && "_custom" in customValue ? getRaw(customValue) : { inherit: void 0, value: void 0, customType: void 0 };
4385
+ inherit = nestedCustom.inherit || ((_c = data._custom) == null ? void 0 : _c.fields) || {};
4386
+ value = nestedCustom.value || customValue;
4387
+ customType = nestedCustom.customType || currentCustomType;
4388
+ }
4389
+ if (value && value._isArray)
4390
+ value = value.items;
4391
+ return { value, inherit, customType };
4392
+ }
4393
+ function toEdit(value, customType) {
4394
+ if (customType === "bigint")
4395
+ return value;
4396
+ if (customType === "date")
4397
+ return value;
4398
+ return replaceTokenToString(JSON.stringify(value));
4399
+ }
4400
+ function toSubmit(value, customType) {
4401
+ if (customType === "bigint")
4402
+ return BigInt(value);
4403
+ if (customType === "date")
4404
+ return new Date(value);
4405
+ return JSON.parse(replaceStringToToken(value), reviver);
4406
+ }
4407
+
4408
+ // src/core/devtools-client/detected.ts
4409
+ init_esm_shims();
4410
+ import { target as target15 } from "@vue/devtools-shared";
4411
+ function updateDevToolsClientDetected(params) {
4412
+ devtoolsState.devtoolsClientDetected = {
4413
+ ...devtoolsState.devtoolsClientDetected,
4414
+ ...params
4415
+ };
4416
+ const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
4417
+ toggleHighPerfMode(!devtoolsClientVisible);
4418
+ }
4419
+ var _a18, _b18;
4420
+ (_b18 = (_a18 = target15).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__) != null ? _b18 : _a18.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ = updateDevToolsClientDetected;
4421
+
4240
4422
  // src/messaging/index.ts
4241
4423
  init_esm_shims();
4424
+ import { target as target21 } from "@vue/devtools-shared";
4242
4425
  import { createBirpc, createBirpcGroup } from "birpc";
4243
- import { target as target19 } from "@vue/devtools-shared";
4244
4426
 
4245
4427
  // src/messaging/presets/index.ts
4246
4428
  init_esm_shims();
4247
4429
 
4248
- // src/messaging/presets/iframe/index.ts
4249
- init_esm_shims();
4250
-
4251
- // src/messaging/presets/iframe/client.ts
4430
+ // src/messaging/presets/broadcast-channel/index.ts
4252
4431
  init_esm_shims();
4253
- import { isBrowser } from "@vue/devtools-shared";
4254
4432
 
4255
4433
  // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/index.js
4256
4434
  init_esm_shims();
@@ -5060,84 +5238,6 @@ var registerCustom = SuperJSON.registerCustom;
5060
5238
  var registerSymbol = SuperJSON.registerSymbol;
5061
5239
  var allowErrorProps = SuperJSON.allowErrorProps;
5062
5240
 
5063
- // src/messaging/presets/iframe/context.ts
5064
- init_esm_shims();
5065
- import { target as target14 } from "@vue/devtools-shared";
5066
- var __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY = "__devtools-kit-iframe-messaging-event-key__";
5067
- var __IFRAME_SERVER_CONTEXT__ = "iframe:server-context";
5068
- function getIframeServerContext() {
5069
- return target14[__IFRAME_SERVER_CONTEXT__];
5070
- }
5071
- function setIframeServerContext(context) {
5072
- target14[__IFRAME_SERVER_CONTEXT__] = context;
5073
- }
5074
-
5075
- // src/messaging/presets/iframe/client.ts
5076
- function createIframeClientChannel() {
5077
- if (!isBrowser) {
5078
- return {
5079
- post: (data) => {
5080
- },
5081
- on: (handler) => {
5082
- }
5083
- };
5084
- }
5085
- return {
5086
- post: (data) => window.parent.postMessage(SuperJSON.stringify({
5087
- event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5088
- data
5089
- }), "*"),
5090
- on: (handler) => window.addEventListener("message", (event) => {
5091
- try {
5092
- const parsed = SuperJSON.parse(event.data);
5093
- if (event.source === window.parent && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {
5094
- handler(parsed.data);
5095
- }
5096
- } catch (e) {
5097
- }
5098
- })
5099
- };
5100
- }
5101
-
5102
- // src/messaging/presets/iframe/server.ts
5103
- init_esm_shims();
5104
- import { isBrowser as isBrowser2 } from "@vue/devtools-shared";
5105
- function createIframeServerChannel() {
5106
- if (!isBrowser2) {
5107
- return {
5108
- post: (data) => {
5109
- },
5110
- on: (handler) => {
5111
- }
5112
- };
5113
- }
5114
- return {
5115
- post: (data) => {
5116
- var _a25;
5117
- const iframe = getIframeServerContext();
5118
- (_a25 = iframe == null ? void 0 : iframe.contentWindow) == null ? void 0 : _a25.postMessage(SuperJSON.stringify({
5119
- event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5120
- data
5121
- }), "*");
5122
- },
5123
- on: (handler) => {
5124
- window.addEventListener("message", (event) => {
5125
- const iframe = getIframeServerContext();
5126
- try {
5127
- const parsed = SuperJSON.parse(event.data);
5128
- if (event.source === (iframe == null ? void 0 : iframe.contentWindow) && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {
5129
- handler(parsed.data);
5130
- }
5131
- } catch (e) {
5132
- }
5133
- });
5134
- }
5135
- };
5136
- }
5137
-
5138
- // src/messaging/presets/broadcast-channel/index.ts
5139
- init_esm_shims();
5140
-
5141
5241
  // src/messaging/presets/broadcast-channel/context.ts
5142
5242
  init_esm_shims();
5143
5243
  var __DEVTOOLS_KIT_BROADCAST_MESSAGING_EVENT_KEY = "__devtools-kit-broadcast-messaging-event-key__";
@@ -5164,79 +5264,15 @@ function createBroadcastChannel() {
5164
5264
  };
5165
5265
  }
5166
5266
 
5167
- // src/messaging/presets/vite/index.ts
5168
- init_esm_shims();
5169
-
5170
- // src/messaging/presets/vite/client.ts
5171
- init_esm_shims();
5172
-
5173
- // src/messaging/presets/vite/context.ts
5174
- init_esm_shims();
5175
- import { target as target15 } from "@vue/devtools-shared";
5176
- var __DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY = "__devtools-kit-vite-messaging-event-key__";
5177
- var __VITE_CLIENT_CONTEXT__ = "vite:client-context";
5178
- var __VITE_SERVER_CONTEXT__ = "vite:server-context";
5179
- function getViteClientContext() {
5180
- return target15[__VITE_CLIENT_CONTEXT__];
5181
- }
5182
- function setViteClientContext(context) {
5183
- target15[__VITE_CLIENT_CONTEXT__] = context;
5184
- }
5185
- function getViteServerContext() {
5186
- return target15[__VITE_SERVER_CONTEXT__];
5187
- }
5188
- function setViteServerContext(context) {
5189
- target15[__VITE_SERVER_CONTEXT__] = context;
5190
- }
5191
-
5192
- // src/messaging/presets/vite/client.ts
5193
- function createViteClientChannel() {
5194
- const client = getViteClientContext();
5195
- return {
5196
- post: (data) => {
5197
- client == null ? void 0 : client.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data));
5198
- },
5199
- on: (handler) => {
5200
- client == null ? void 0 : client.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {
5201
- handler(SuperJSON.parse(event));
5202
- });
5203
- }
5204
- };
5205
- }
5206
-
5207
- // src/messaging/presets/vite/server.ts
5208
- init_esm_shims();
5209
- function createViteServerChannel() {
5210
- var _a25;
5211
- const viteServer = getViteServerContext();
5212
- const ws = (_a25 = viteServer.hot) != null ? _a25 : viteServer.ws;
5213
- return {
5214
- post: (data) => ws == null ? void 0 : ws.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data)),
5215
- on: (handler) => ws == null ? void 0 : ws.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {
5216
- handler(SuperJSON.parse(event));
5217
- })
5218
- };
5219
- }
5220
-
5221
- // src/messaging/presets/ws/index.ts
5222
- init_esm_shims();
5223
-
5224
- // src/messaging/presets/ws/client.ts
5225
- init_esm_shims();
5226
-
5227
- // src/messaging/presets/ws/context.ts
5228
- init_esm_shims();
5229
- import { target as target16 } from "@vue/devtools-shared";
5230
-
5231
- // src/messaging/presets/ws/server.ts
5267
+ // src/messaging/presets/electron/index.ts
5232
5268
  init_esm_shims();
5233
5269
 
5234
- // src/messaging/presets/electron/index.ts
5270
+ // src/messaging/presets/electron/client.ts
5235
5271
  init_esm_shims();
5236
5272
 
5237
5273
  // src/messaging/presets/electron/context.ts
5238
5274
  init_esm_shims();
5239
- import { target as target17 } from "@vue/devtools-shared";
5275
+ import { target as target16 } from "@vue/devtools-shared";
5240
5276
  var __ELECTRON_CLIENT_CONTEXT__ = "electron:client-context";
5241
5277
  var __ELECTRON_RPOXY_CONTEXT__ = "electron:proxy-context";
5242
5278
  var __ELECTRON_SERVER_CONTEXT__ = "electron:server-context";
@@ -5254,26 +5290,25 @@ var __DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__ = {
5254
5290
  // on: proxy->server
5255
5291
  };
5256
5292
  function getElectronClientContext() {
5257
- return target17[__ELECTRON_CLIENT_CONTEXT__];
5293
+ return target16[__ELECTRON_CLIENT_CONTEXT__];
5258
5294
  }
5259
5295
  function setElectronClientContext(context) {
5260
- target17[__ELECTRON_CLIENT_CONTEXT__] = context;
5296
+ target16[__ELECTRON_CLIENT_CONTEXT__] = context;
5261
5297
  }
5262
5298
  function getElectronProxyContext() {
5263
- return target17[__ELECTRON_RPOXY_CONTEXT__];
5299
+ return target16[__ELECTRON_RPOXY_CONTEXT__];
5264
5300
  }
5265
5301
  function setElectronProxyContext(context) {
5266
- target17[__ELECTRON_RPOXY_CONTEXT__] = context;
5302
+ target16[__ELECTRON_RPOXY_CONTEXT__] = context;
5267
5303
  }
5268
5304
  function getElectronServerContext() {
5269
- return target17[__ELECTRON_SERVER_CONTEXT__];
5305
+ return target16[__ELECTRON_SERVER_CONTEXT__];
5270
5306
  }
5271
5307
  function setElectronServerContext(context) {
5272
- target17[__ELECTRON_SERVER_CONTEXT__] = context;
5308
+ target16[__ELECTRON_SERVER_CONTEXT__] = context;
5273
5309
  }
5274
5310
 
5275
5311
  // src/messaging/presets/electron/client.ts
5276
- init_esm_shims();
5277
5312
  function createElectronClientChannel() {
5278
5313
  const socket = getElectronClientContext();
5279
5314
  return {
@@ -5325,9 +5360,12 @@ function createElectronServerChannel() {
5325
5360
  // src/messaging/presets/extension/index.ts
5326
5361
  init_esm_shims();
5327
5362
 
5363
+ // src/messaging/presets/extension/client.ts
5364
+ init_esm_shims();
5365
+
5328
5366
  // src/messaging/presets/extension/context.ts
5329
5367
  init_esm_shims();
5330
- import { target as target18 } from "@vue/devtools-shared";
5368
+ import { target as target17 } from "@vue/devtools-shared";
5331
5369
  var __EXTENSION_CLIENT_CONTEXT__ = "electron:client-context";
5332
5370
  var __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__ = {
5333
5371
  // client
@@ -5343,14 +5381,13 @@ var __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__ = {
5343
5381
  // on: proxy->server
5344
5382
  };
5345
5383
  function getExtensionClientContext() {
5346
- return target18[__EXTENSION_CLIENT_CONTEXT__];
5384
+ return target17[__EXTENSION_CLIENT_CONTEXT__];
5347
5385
  }
5348
5386
  function setExtensionClientContext(context) {
5349
- target18[__EXTENSION_CLIENT_CONTEXT__] = context;
5387
+ target17[__EXTENSION_CLIENT_CONTEXT__] = context;
5350
5388
  }
5351
5389
 
5352
5390
  // src/messaging/presets/extension/client.ts
5353
- init_esm_shims();
5354
5391
  function createExtensionClientChannel() {
5355
5392
  let disconnected = false;
5356
5393
  let port = null;
@@ -5433,66 +5470,215 @@ function createExtensionProxyChannel() {
5433
5470
  };
5434
5471
  }
5435
5472
 
5436
- // src/messaging/presets/extension/server.ts
5473
+ // src/messaging/presets/extension/server.ts
5474
+ init_esm_shims();
5475
+ function createExtensionServerChannel() {
5476
+ return {
5477
+ post: (data) => {
5478
+ window.postMessage({
5479
+ source: __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY,
5480
+ payload: SuperJSON.stringify(data)
5481
+ }, "*");
5482
+ },
5483
+ on: (handler) => {
5484
+ const listener = (event) => {
5485
+ if (event.data.source === __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER && event.data.payload) {
5486
+ handler(SuperJSON.parse(event.data.payload));
5487
+ }
5488
+ };
5489
+ window.addEventListener("message", listener);
5490
+ return () => {
5491
+ window.removeEventListener("message", listener);
5492
+ };
5493
+ }
5494
+ };
5495
+ }
5496
+
5497
+ // src/messaging/presets/iframe/index.ts
5498
+ init_esm_shims();
5499
+
5500
+ // src/messaging/presets/iframe/client.ts
5501
+ init_esm_shims();
5502
+ import { isBrowser } from "@vue/devtools-shared";
5503
+
5504
+ // src/messaging/presets/iframe/context.ts
5505
+ init_esm_shims();
5506
+ import { target as target18 } from "@vue/devtools-shared";
5507
+ var __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY = "__devtools-kit-iframe-messaging-event-key__";
5508
+ var __IFRAME_SERVER_CONTEXT__ = "iframe:server-context";
5509
+ function getIframeServerContext() {
5510
+ return target18[__IFRAME_SERVER_CONTEXT__];
5511
+ }
5512
+ function setIframeServerContext(context) {
5513
+ target18[__IFRAME_SERVER_CONTEXT__] = context;
5514
+ }
5515
+
5516
+ // src/messaging/presets/iframe/client.ts
5517
+ function createIframeClientChannel() {
5518
+ if (!isBrowser) {
5519
+ return {
5520
+ post: (data) => {
5521
+ },
5522
+ on: (handler) => {
5523
+ }
5524
+ };
5525
+ }
5526
+ return {
5527
+ post: (data) => window.parent.postMessage(SuperJSON.stringify({
5528
+ event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5529
+ data
5530
+ }), "*"),
5531
+ on: (handler) => window.addEventListener("message", (event) => {
5532
+ try {
5533
+ const parsed = SuperJSON.parse(event.data);
5534
+ if (event.source === window.parent && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {
5535
+ handler(parsed.data);
5536
+ }
5537
+ } catch (e) {
5538
+ }
5539
+ })
5540
+ };
5541
+ }
5542
+
5543
+ // src/messaging/presets/iframe/server.ts
5544
+ init_esm_shims();
5545
+ import { isBrowser as isBrowser2 } from "@vue/devtools-shared";
5546
+ function createIframeServerChannel() {
5547
+ if (!isBrowser2) {
5548
+ return {
5549
+ post: (data) => {
5550
+ },
5551
+ on: (handler) => {
5552
+ }
5553
+ };
5554
+ }
5555
+ return {
5556
+ post: (data) => {
5557
+ var _a25;
5558
+ const iframe = getIframeServerContext();
5559
+ (_a25 = iframe == null ? void 0 : iframe.contentWindow) == null ? void 0 : _a25.postMessage(SuperJSON.stringify({
5560
+ event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5561
+ data
5562
+ }), "*");
5563
+ },
5564
+ on: (handler) => {
5565
+ window.addEventListener("message", (event) => {
5566
+ const iframe = getIframeServerContext();
5567
+ try {
5568
+ const parsed = SuperJSON.parse(event.data);
5569
+ if (event.source === (iframe == null ? void 0 : iframe.contentWindow) && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {
5570
+ handler(parsed.data);
5571
+ }
5572
+ } catch (e) {
5573
+ }
5574
+ });
5575
+ }
5576
+ };
5577
+ }
5578
+
5579
+ // src/messaging/presets/vite/index.ts
5437
5580
  init_esm_shims();
5438
- function createExtensionServerChannel() {
5581
+
5582
+ // src/messaging/presets/vite/client.ts
5583
+ init_esm_shims();
5584
+
5585
+ // src/messaging/presets/vite/context.ts
5586
+ init_esm_shims();
5587
+ import { target as target19 } from "@vue/devtools-shared";
5588
+ var __DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY = "__devtools-kit-vite-messaging-event-key__";
5589
+ var __VITE_CLIENT_CONTEXT__ = "vite:client-context";
5590
+ var __VITE_SERVER_CONTEXT__ = "vite:server-context";
5591
+ function getViteClientContext() {
5592
+ return target19[__VITE_CLIENT_CONTEXT__];
5593
+ }
5594
+ function setViteClientContext(context) {
5595
+ target19[__VITE_CLIENT_CONTEXT__] = context;
5596
+ }
5597
+ function getViteServerContext() {
5598
+ return target19[__VITE_SERVER_CONTEXT__];
5599
+ }
5600
+ function setViteServerContext(context) {
5601
+ target19[__VITE_SERVER_CONTEXT__] = context;
5602
+ }
5603
+
5604
+ // src/messaging/presets/vite/client.ts
5605
+ function createViteClientChannel() {
5606
+ const client = getViteClientContext();
5439
5607
  return {
5440
5608
  post: (data) => {
5441
- window.postMessage({
5442
- source: __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY,
5443
- payload: SuperJSON.stringify(data)
5444
- }, "*");
5609
+ client == null ? void 0 : client.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data));
5445
5610
  },
5446
5611
  on: (handler) => {
5447
- const listener = (event) => {
5448
- if (event.data.source === __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER && event.data.payload) {
5449
- handler(SuperJSON.parse(event.data.payload));
5450
- }
5451
- };
5452
- window.addEventListener("message", listener);
5453
- return () => {
5454
- window.removeEventListener("message", listener);
5455
- };
5612
+ client == null ? void 0 : client.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {
5613
+ handler(SuperJSON.parse(event));
5614
+ });
5456
5615
  }
5457
5616
  };
5458
5617
  }
5459
5618
 
5619
+ // src/messaging/presets/vite/server.ts
5620
+ init_esm_shims();
5621
+ function createViteServerChannel() {
5622
+ var _a25;
5623
+ const viteServer = getViteServerContext();
5624
+ const ws = (_a25 = viteServer.hot) != null ? _a25 : viteServer.ws;
5625
+ return {
5626
+ post: (data) => ws == null ? void 0 : ws.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data)),
5627
+ on: (handler) => ws == null ? void 0 : ws.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {
5628
+ handler(SuperJSON.parse(event));
5629
+ })
5630
+ };
5631
+ }
5632
+
5633
+ // src/messaging/presets/ws/index.ts
5634
+ init_esm_shims();
5635
+
5636
+ // src/messaging/presets/ws/client.ts
5637
+ init_esm_shims();
5638
+
5639
+ // src/messaging/presets/ws/context.ts
5640
+ init_esm_shims();
5641
+ import { target as target20 } from "@vue/devtools-shared";
5642
+
5643
+ // src/messaging/presets/ws/server.ts
5644
+ init_esm_shims();
5645
+
5460
5646
  // src/messaging/index.ts
5461
- var _a18, _b18;
5462
- (_b18 = (_a18 = target19).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__) != null ? _b18 : _a18.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ = [];
5463
5647
  var _a19, _b19;
5464
- (_b19 = (_a19 = target19).__VUE_DEVTOOLS_KIT_RPC_CLIENT__) != null ? _b19 : _a19.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = null;
5648
+ (_b19 = (_a19 = target21).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__) != null ? _b19 : _a19.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ = [];
5465
5649
  var _a20, _b20;
5466
- (_b20 = (_a20 = target19).__VUE_DEVTOOLS_KIT_RPC_SERVER__) != null ? _b20 : _a20.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = null;
5650
+ (_b20 = (_a20 = target21).__VUE_DEVTOOLS_KIT_RPC_CLIENT__) != null ? _b20 : _a20.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = null;
5467
5651
  var _a21, _b21;
5468
- (_b21 = (_a21 = target19).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__) != null ? _b21 : _a21.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = null;
5652
+ (_b21 = (_a21 = target21).__VUE_DEVTOOLS_KIT_RPC_SERVER__) != null ? _b21 : _a21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = null;
5469
5653
  var _a22, _b22;
5470
- (_b22 = (_a22 = target19).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__) != null ? _b22 : _a22.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = null;
5654
+ (_b22 = (_a22 = target21).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__) != null ? _b22 : _a22.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = null;
5471
5655
  var _a23, _b23;
5472
- (_b23 = (_a23 = target19).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__) != null ? _b23 : _a23.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ = null;
5656
+ (_b23 = (_a23 = target21).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__) != null ? _b23 : _a23.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = null;
5657
+ var _a24, _b24;
5658
+ (_b24 = (_a24 = target21).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__) != null ? _b24 : _a24.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ = null;
5473
5659
  function setRpcClientToGlobal(rpc) {
5474
- target19.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = rpc;
5660
+ target21.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = rpc;
5475
5661
  }
5476
5662
  function setRpcServerToGlobal(rpc) {
5477
- target19.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = rpc;
5663
+ target21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = rpc;
5478
5664
  }
5479
5665
  function getRpcClient() {
5480
- return target19.__VUE_DEVTOOLS_KIT_RPC_CLIENT__;
5666
+ return target21.__VUE_DEVTOOLS_KIT_RPC_CLIENT__;
5481
5667
  }
5482
5668
  function getRpcServer() {
5483
- return target19.__VUE_DEVTOOLS_KIT_RPC_SERVER__;
5669
+ return target21.__VUE_DEVTOOLS_KIT_RPC_SERVER__;
5484
5670
  }
5485
5671
  function setViteRpcClientToGlobal(rpc) {
5486
- target19.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = rpc;
5672
+ target21.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = rpc;
5487
5673
  }
5488
5674
  function setViteRpcServerToGlobal(rpc) {
5489
- target19.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = rpc;
5675
+ target21.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = rpc;
5490
5676
  }
5491
5677
  function getViteRpcClient() {
5492
- return target19.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__;
5678
+ return target21.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__;
5493
5679
  }
5494
5680
  function getViteRpcServer() {
5495
- return target19.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__;
5681
+ return target21.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__;
5496
5682
  }
5497
5683
  function getChannel(preset, host = "client") {
5498
5684
  const channel = {
@@ -5569,6 +5755,12 @@ function createRpcProxy(options = {}) {
5569
5755
  // src/shared/index.ts
5570
5756
  init_esm_shims();
5571
5757
 
5758
+ // src/shared/env.ts
5759
+ init_esm_shims();
5760
+
5761
+ // src/shared/time.ts
5762
+ init_esm_shims();
5763
+
5572
5764
  // src/shared/util.ts
5573
5765
  init_esm_shims();
5574
5766
 
@@ -5877,65 +6069,6 @@ function stringifyReplacer(key, _value, depth, seenInstance) {
5877
6069
  return sanitize(val);
5878
6070
  }
5879
6071
 
5880
- // src/core/component/state/reviver.ts
5881
- init_esm_shims();
5882
- import { target as target20 } from "@vue/devtools-shared";
5883
- function reviveSet(val) {
5884
- const result = /* @__PURE__ */ new Set();
5885
- const list = val._custom.value;
5886
- for (let i = 0; i < list.length; i++) {
5887
- const value = list[i];
5888
- result.add(revive(value));
5889
- }
5890
- return result;
5891
- }
5892
- function reviveMap(val) {
5893
- const result = /* @__PURE__ */ new Map();
5894
- const list = val._custom.value;
5895
- for (let i = 0; i < list.length; i++) {
5896
- const { key, value } = list[i];
5897
- result.set(key, revive(value));
5898
- }
5899
- return result;
5900
- }
5901
- function revive(val) {
5902
- if (val === UNDEFINED) {
5903
- return void 0;
5904
- } else if (val === INFINITY) {
5905
- return Number.POSITIVE_INFINITY;
5906
- } else if (val === NEGATIVE_INFINITY) {
5907
- return Number.NEGATIVE_INFINITY;
5908
- } else if (val === NAN) {
5909
- return Number.NaN;
5910
- } else if (val && val._custom) {
5911
- const { _custom: custom } = val;
5912
- if (custom.type === "component")
5913
- return activeAppRecord.value.instanceMap.get(custom.id);
5914
- else if (custom.type === "map")
5915
- return reviveMap(val);
5916
- else if (custom.type === "set")
5917
- return reviveSet(val);
5918
- else if (custom.type === "bigint")
5919
- return BigInt(custom.value);
5920
- else
5921
- return revive(custom.value);
5922
- } else if (symbolRE.test(val)) {
5923
- const [, string] = symbolRE.exec(val);
5924
- return Symbol.for(string);
5925
- } else if (specialTypeRE.test(val)) {
5926
- const [, type, string, , details] = specialTypeRE.exec(val);
5927
- const result = new target20[type](string);
5928
- if (type === "Error" && details)
5929
- result.stack = details;
5930
- return result;
5931
- } else {
5932
- return val;
5933
- }
5934
- }
5935
- function reviver(key, value) {
5936
- return revive(value);
5937
- }
5938
-
5939
6072
  // src/shared/transfer.ts
5940
6073
  init_esm_shims();
5941
6074
  var MAX_SERIALIZED_SIZE = 2 * 1024 * 1024;
@@ -6060,101 +6193,6 @@ function parseCircularAutoChunks(data, reviver2 = null) {
6060
6193
  }
6061
6194
  }
6062
6195
 
6063
- // src/core/component/state/format.ts
6064
- init_esm_shims();
6065
- function getInspectorStateValueType(value, raw = true) {
6066
- const type = typeof value;
6067
- if (value == null || value === UNDEFINED || value === "undefined") {
6068
- return "null";
6069
- } else if (type === "boolean" || type === "number" || value === INFINITY || value === NEGATIVE_INFINITY || value === NAN) {
6070
- return "literal";
6071
- } else if (value == null ? void 0 : value._custom) {
6072
- if (raw || value._custom.display != null || value._custom.displayText != null)
6073
- return "custom";
6074
- else
6075
- return getInspectorStateValueType(value._custom.value);
6076
- } else if (typeof value === "string") {
6077
- const typeMatch = specialTypeRE.exec(value);
6078
- if (typeMatch) {
6079
- const [, type2] = typeMatch;
6080
- return `native ${type2}`;
6081
- } else {
6082
- return "string";
6083
- }
6084
- } else if (Array.isArray(value) || (value == null ? void 0 : value._isArray)) {
6085
- return "array";
6086
- } else if (isPlainObject(value)) {
6087
- return "plain-object";
6088
- } else {
6089
- return "unknown";
6090
- }
6091
- }
6092
- function formatInspectorStateValue(value, quotes = false, options) {
6093
- var _a25, _b25, _c;
6094
- const { customClass } = options != null ? options : {};
6095
- let result;
6096
- const type = getInspectorStateValueType(value, false);
6097
- if (type !== "custom" && (value == null ? void 0 : value._custom))
6098
- value = value._custom.value;
6099
- if (result = internalStateTokenToString(value)) {
6100
- return result;
6101
- } else if (type === "custom") {
6102
- const nestedName = ((_a25 = value._custom.value) == null ? void 0 : _a25._custom) && formatInspectorStateValue(value._custom.value, quotes, options);
6103
- return nestedName || value._custom.displayText || value._custom.display;
6104
- } else if (type === "array") {
6105
- return `Array[${value.length}]`;
6106
- } else if (type === "plain-object") {
6107
- return `Object${Object.keys(value).length ? "" : " (empty)"}`;
6108
- } else if (type == null ? void 0 : type.includes("native")) {
6109
- return escape((_b25 = specialTypeRE.exec(value)) == null ? void 0 : _b25[2]);
6110
- } else if (typeof value === "string") {
6111
- const typeMatch = value.match(rawTypeRE);
6112
- if (typeMatch) {
6113
- value = escapeString(typeMatch[1]);
6114
- } else if (quotes) {
6115
- value = `<span>"</span>${(customClass == null ? void 0 : customClass.string) ? `<span class=${customClass.string}>${escapeString(value)}</span>` : escapeString(value)}<span>"</span>`;
6116
- } else {
6117
- value = (customClass == null ? void 0 : customClass.string) ? `<span class="${(_c = customClass == null ? void 0 : customClass.string) != null ? _c : ""}">${escapeString(value)}</span>` : escapeString(value);
6118
- }
6119
- }
6120
- return value;
6121
- }
6122
- function escapeString(value) {
6123
- return escape(value).replace(/ /g, "&nbsp;").replace(/\n/g, "<span>\\n</span>");
6124
- }
6125
- function getRaw(value) {
6126
- var _a25, _b25, _c;
6127
- let customType;
6128
- const isCustom = getInspectorStateValueType(value) === "custom";
6129
- let inherit = {};
6130
- if (isCustom) {
6131
- const data = value;
6132
- const customValue = (_a25 = data._custom) == null ? void 0 : _a25.value;
6133
- const currentCustomType = (_b25 = data._custom) == null ? void 0 : _b25.type;
6134
- const nestedCustom = typeof customValue === "object" && customValue !== null && "_custom" in customValue ? getRaw(customValue) : { inherit: void 0, value: void 0, customType: void 0 };
6135
- inherit = nestedCustom.inherit || ((_c = data._custom) == null ? void 0 : _c.fields) || {};
6136
- value = nestedCustom.value || customValue;
6137
- customType = nestedCustom.customType || currentCustomType;
6138
- }
6139
- if (value && value._isArray)
6140
- value = value.items;
6141
- return { value, inherit, customType };
6142
- }
6143
- function toEdit(value, customType) {
6144
- if (customType === "bigint")
6145
- return value;
6146
- if (customType === "date")
6147
- return value;
6148
- return replaceTokenToString(JSON.stringify(value));
6149
- }
6150
- function toSubmit(value, customType) {
6151
- if (customType === "bigint")
6152
- return BigInt(value);
6153
- if (customType === "date")
6154
- return new Date(value);
6155
- return JSON.parse(replaceStringToToken(value), reviver);
6156
- }
6157
-
6158
6196
  // src/shared/util.ts
6159
6197
  function stringify2(data) {
6160
6198
  return stringifyCircularAutoChunks(data, stringifyReplacer);
@@ -6165,26 +6203,6 @@ function parse2(data, revive2 = false) {
6165
6203
  return revive2 ? parseCircularAutoChunks(data, reviver) : parseCircularAutoChunks(data);
6166
6204
  }
6167
6205
 
6168
- // src/shared/time.ts
6169
- init_esm_shims();
6170
-
6171
- // src/shared/env.ts
6172
- init_esm_shims();
6173
-
6174
- // src/core/devtools-client/detected.ts
6175
- init_esm_shims();
6176
- import { target as target21 } from "@vue/devtools-shared";
6177
- function updateDevToolsClientDetected(params) {
6178
- devtoolsState.devtoolsClientDetected = {
6179
- ...devtoolsState.devtoolsClientDetected,
6180
- ...params
6181
- };
6182
- const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
6183
- toggleHighPerfMode(!devtoolsClientVisible);
6184
- }
6185
- var _a24, _b24;
6186
- (_b24 = (_a24 = target21).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__) != null ? _b24 : _a24.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ = updateDevToolsClientDetected;
6187
-
6188
6206
  // src/index.ts
6189
6207
  var devtools = {
6190
6208
  hook,