@dcloudio/uni-cli-shared 3.0.0-alpha-4070720250804001 → 3.0.0-alpha-4070620250731002

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.
Files changed (163) hide show
  1. package/dist/easycom.d.ts +0 -1
  2. package/dist/easycom.js +13 -17
  3. package/dist/hbx/alias.js +10 -43
  4. package/dist/hbx/index.js +0 -10
  5. package/dist/hbx/log.js +1 -23
  6. package/dist/index.d.ts +1 -2
  7. package/dist/index.js +1 -3
  8. package/dist/json/index.d.ts +1 -1
  9. package/dist/json/index.js +1 -2
  10. package/dist/json/manifest.d.ts +0 -1
  11. package/dist/json/manifest.js +1 -11
  12. package/dist/json/mp/jsonFile.js +2 -4
  13. package/dist/json/mp/pages.js +0 -1
  14. package/dist/json/mp/types.d.ts +1 -4
  15. package/dist/json/uni-x/manifest.d.ts +0 -1
  16. package/dist/json/uni-x/manifest.js +1 -5
  17. package/dist/messages/zh_CN.js +0 -1
  18. package/dist/uni_modules.cloud.d.ts +4 -10
  19. package/dist/uni_modules.cloud.js +19 -58
  20. package/dist/uni_modules.d.ts +0 -2
  21. package/dist/uni_modules.js +2 -81
  22. package/dist/uts.js +0 -16
  23. package/dist/vite/autoImport.js +0 -2
  24. package/dist/vite/cloud.js +5 -51
  25. package/dist/vite/plugins/index.d.ts +0 -1
  26. package/dist/vite/plugins/index.js +1 -3
  27. package/dist/vite/plugins/inject.js +1 -3
  28. package/dist/vite/plugins/uts/uni_modules.d.ts +0 -1
  29. package/dist/vite/plugins/uts/uni_modules.js +14 -63
  30. package/dist/vite/plugins/uts/uvue.js +3 -17
  31. package/dist/vite/plugins/vitejs/plugins/css.js +5 -40
  32. package/dist/vue/transforms/transformUTSComponent.js +3 -8
  33. package/package.json +38 -38
  34. package/dist/vite/plugins/stats.d.ts +0 -2
  35. package/dist/vite/plugins/stats.js +0 -42
  36. package/dist/workers.d.ts +0 -14
  37. package/dist/workers.js +0 -187
  38. package/lib/vapor/@vitejs/plugin-vue/LICENSE +0 -21
  39. package/lib/vapor/@vitejs/plugin-vue/README.md +0 -278
  40. package/lib/vapor/@vitejs/plugin-vue/dist/index.cjs +0 -3105
  41. package/lib/vapor/@vitejs/plugin-vue/dist/index.d.cts +0 -113
  42. package/lib/vapor/@vitejs/plugin-vue/dist/index.d.mts +0 -111
  43. package/lib/vapor/@vitejs/plugin-vue/dist/index.d.ts +0 -113
  44. package/lib/vapor/@vitejs/plugin-vue/dist/index.mjs +0 -3090
  45. package/lib/vapor/@vitejs/plugin-vue/package.json +0 -50
  46. package/lib/vapor/@vue/compiler-core/LICENSE +0 -21
  47. package/lib/vapor/@vue/compiler-core/README.md +0 -1
  48. package/lib/vapor/@vue/compiler-core/dist/compiler-core.cjs.js +0 -6902
  49. package/lib/vapor/@vue/compiler-core/dist/compiler-core.cjs.prod.js +0 -6779
  50. package/lib/vapor/@vue/compiler-core/dist/compiler-core.esm-bundler.js +0 -5870
  51. package/lib/vapor/@vue/compiler-core/index.js +0 -7
  52. package/lib/vapor/@vue/compiler-core/package.json +0 -58
  53. package/lib/vapor/@vue/compiler-dom/LICENSE +0 -21
  54. package/lib/vapor/@vue/compiler-dom/README.md +0 -1
  55. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.cjs.js +0 -936
  56. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +0 -856
  57. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +0 -6682
  58. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +0 -14
  59. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +0 -693
  60. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.global.js +0 -6855
  61. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.global.prod.js +0 -14
  62. package/lib/vapor/@vue/compiler-dom/index.js +0 -7
  63. package/lib/vapor/@vue/compiler-dom/package.json +0 -57
  64. package/lib/vapor/@vue/compiler-sfc/LICENSE +0 -21
  65. package/lib/vapor/@vue/compiler-sfc/README.md +0 -80
  66. package/lib/vapor/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -21682
  67. package/lib/vapor/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +0 -66272
  68. package/lib/vapor/@vue/compiler-sfc/package.json +0 -68
  69. package/lib/vapor/@vue/compiler-ssr/LICENSE +0 -21
  70. package/lib/vapor/@vue/compiler-ssr/README.md +0 -1
  71. package/lib/vapor/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +0 -1402
  72. package/lib/vapor/@vue/compiler-ssr/package.json +0 -34
  73. package/lib/vapor/@vue/compiler-vapor/LICENSE +0 -21
  74. package/lib/vapor/@vue/compiler-vapor/README.md +0 -1
  75. package/lib/vapor/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +0 -4540
  76. package/lib/vapor/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +0 -37020
  77. package/lib/vapor/@vue/compiler-vapor/package.json +0 -49
  78. package/lib/vapor/@vue/reactivity/LICENSE +0 -21
  79. package/lib/vapor/@vue/reactivity/README.md +0 -19
  80. package/lib/vapor/@vue/reactivity/dist/reactivity.cjs.js +0 -2033
  81. package/lib/vapor/@vue/reactivity/dist/reactivity.cjs.prod.js +0 -1841
  82. package/lib/vapor/@vue/reactivity/dist/reactivity.esm-browser.js +0 -2023
  83. package/lib/vapor/@vue/reactivity/dist/reactivity.esm-browser.prod.js +0 -5
  84. package/lib/vapor/@vue/reactivity/dist/reactivity.esm-bundler.js +0 -1992
  85. package/lib/vapor/@vue/reactivity/dist/reactivity.global.js +0 -2082
  86. package/lib/vapor/@vue/reactivity/dist/reactivity.global.prod.js +0 -5
  87. package/lib/vapor/@vue/reactivity/index.js +0 -7
  88. package/lib/vapor/@vue/reactivity/package.json +0 -55
  89. package/lib/vapor/@vue/runtime-core/LICENSE +0 -21
  90. package/lib/vapor/@vue/runtime-core/README.md +0 -28
  91. package/lib/vapor/@vue/runtime-core/dist/runtime-core.cjs.js +0 -8972
  92. package/lib/vapor/@vue/runtime-core/dist/runtime-core.cjs.prod.js +0 -7088
  93. package/lib/vapor/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -8913
  94. package/lib/vapor/@vue/runtime-core/index.js +0 -7
  95. package/lib/vapor/@vue/runtime-core/package.json +0 -54
  96. package/lib/vapor/@vue/runtime-dom/LICENSE +0 -21
  97. package/lib/vapor/@vue/runtime-dom/README.md +0 -13
  98. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.cjs.js +0 -1797
  99. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +0 -1646
  100. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.esm-browser.js +0 -12929
  101. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.esm-browser.prod.js +0 -6
  102. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1838
  103. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.global.js +0 -13086
  104. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.global.prod.js +0 -6
  105. package/lib/vapor/@vue/runtime-dom/index.js +0 -7
  106. package/lib/vapor/@vue/runtime-dom/package.json +0 -60
  107. package/lib/vapor/@vue/runtime-vapor/LICENSE +0 -21
  108. package/lib/vapor/@vue/runtime-vapor/README.md +0 -8
  109. package/lib/vapor/@vue/runtime-vapor/dist/runtime-vapor.esm-bundler.js +0 -3242
  110. package/lib/vapor/@vue/runtime-vapor/package.json +0 -47
  111. package/lib/vapor/@vue/server-renderer/LICENSE +0 -21
  112. package/lib/vapor/@vue/server-renderer/README.md +0 -178
  113. package/lib/vapor/@vue/server-renderer/dist/server-renderer.cjs.js +0 -1144
  114. package/lib/vapor/@vue/server-renderer/dist/server-renderer.cjs.prod.js +0 -871
  115. package/lib/vapor/@vue/server-renderer/dist/server-renderer.esm-browser.js +0 -8756
  116. package/lib/vapor/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js +0 -5
  117. package/lib/vapor/@vue/server-renderer/dist/server-renderer.esm-bundler.js +0 -1366
  118. package/lib/vapor/@vue/server-renderer/index.js +0 -7
  119. package/lib/vapor/@vue/server-renderer/package.json +0 -55
  120. package/lib/vapor/@vue/shared/LICENSE +0 -21
  121. package/lib/vapor/@vue/shared/README.md +0 -3
  122. package/lib/vapor/@vue/shared/dist/shared.cjs.js +0 -698
  123. package/lib/vapor/@vue/shared/dist/shared.cjs.prod.js +0 -690
  124. package/lib/vapor/@vue/shared/dist/shared.esm-bundler.js +0 -616
  125. package/lib/vapor/@vue/shared/index.js +0 -7
  126. package/lib/vapor/@vue/shared/package.json +0 -47
  127. package/lib/vapor/@vue/vue/LICENSE +0 -21
  128. package/lib/vapor/@vue/vue/README.md +0 -62
  129. package/lib/vapor/@vue/vue/compiler-sfc/index.browser.js +0 -1
  130. package/lib/vapor/@vue/vue/compiler-sfc/index.browser.mjs +0 -1
  131. package/lib/vapor/@vue/vue/compiler-sfc/index.d.mts +0 -1
  132. package/lib/vapor/@vue/vue/compiler-sfc/index.d.ts +0 -1
  133. package/lib/vapor/@vue/vue/compiler-sfc/index.js +0 -3
  134. package/lib/vapor/@vue/vue/compiler-sfc/index.mjs +0 -3
  135. package/lib/vapor/@vue/vue/compiler-sfc/package.json +0 -4
  136. package/lib/vapor/@vue/vue/compiler-sfc/register-ts.js +0 -3
  137. package/lib/vapor/@vue/vue/dist/vue.cjs.js +0 -80
  138. package/lib/vapor/@vue/vue/dist/vue.cjs.prod.js +0 -66
  139. package/lib/vapor/@vue/vue/dist/vue.esm-browser.js +0 -18840
  140. package/lib/vapor/@vue/vue/dist/vue.esm-browser.prod.js +0 -12
  141. package/lib/vapor/@vue/vue/dist/vue.esm-bundler.js +0 -72
  142. package/lib/vapor/@vue/vue/dist/vue.global.js +0 -18820
  143. package/lib/vapor/@vue/vue/dist/vue.global.prod.js +0 -12
  144. package/lib/vapor/@vue/vue/dist/vue.runtime-with-vapor.esm-browser.js +0 -15648
  145. package/lib/vapor/@vue/vue/dist/vue.runtime-with-vapor.esm-browser.prod.js +0 -9
  146. package/lib/vapor/@vue/vue/dist/vue.runtime.esm-browser.js +0 -12953
  147. package/lib/vapor/@vue/vue/dist/vue.runtime.esm-browser.prod.js +0 -6
  148. package/lib/vapor/@vue/vue/dist/vue.runtime.esm-bundler.js +0 -29
  149. package/lib/vapor/@vue/vue/dist/vue.runtime.global.js +0 -13111
  150. package/lib/vapor/@vue/vue/dist/vue.runtime.global.prod.js +0 -6
  151. package/lib/vapor/@vue/vue/index.js +0 -7
  152. package/lib/vapor/@vue/vue/index.mjs +0 -1
  153. package/lib/vapor/@vue/vue/jsx-runtime/index.d.ts +0 -25
  154. package/lib/vapor/@vue/vue/jsx-runtime/index.js +0 -15
  155. package/lib/vapor/@vue/vue/jsx-runtime/index.mjs +0 -12
  156. package/lib/vapor/@vue/vue/jsx-runtime/package.json +0 -5
  157. package/lib/vapor/@vue/vue/jsx.d.ts +0 -22
  158. package/lib/vapor/@vue/vue/package.json +0 -114
  159. package/lib/vapor/@vue/vue/server-renderer/index.d.mts +0 -1
  160. package/lib/vapor/@vue/vue/server-renderer/index.d.ts +0 -1
  161. package/lib/vapor/@vue/vue/server-renderer/index.js +0 -1
  162. package/lib/vapor/@vue/vue/server-renderer/index.mjs +0 -1
  163. package/lib/vapor/@vue/vue/server-renderer/package.json +0 -4
@@ -1,1797 +0,0 @@
1
- /**
2
- * @vue/runtime-dom v3.6.0-alpha.2
3
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
- * @license MIT
5
- **/
6
- 'use strict';
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
- var runtimeCore = require('@vue/runtime-core');
11
- var shared = require('@vue/shared');
12
-
13
- let policy = void 0;
14
- const tt = typeof window !== "undefined" && window.trustedTypes;
15
- if (tt) {
16
- try {
17
- policy = /* @__PURE__ */ tt.createPolicy("vue", {
18
- createHTML: (val) => val
19
- });
20
- } catch (e) {
21
- runtimeCore.warn(`Error creating trusted types policy: ${e}`);
22
- }
23
- }
24
- const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
25
- const svgNS = "http://www.w3.org/2000/svg";
26
- const mathmlNS = "http://www.w3.org/1998/Math/MathML";
27
- const doc = typeof document !== "undefined" ? document : null;
28
- const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
29
- const nodeOps = {
30
- insert: (child, parent, anchor) => {
31
- parent.insertBefore(child, anchor || null);
32
- },
33
- remove: (child) => {
34
- const parent = child.parentNode;
35
- if (parent) {
36
- parent.removeChild(child);
37
- }
38
- },
39
- // @ts-expect-error fixed by xxxxxx
40
- createElement: (tag, namespace, is, props) => {
41
- const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
42
- if (tag === "select" && props && props.multiple != null) {
43
- el.setAttribute("multiple", props.multiple);
44
- }
45
- return el;
46
- },
47
- createText: (text) => doc.createTextNode(text),
48
- createComment: (text) => doc.createComment(text),
49
- setText: (node, text) => {
50
- node.nodeValue = text;
51
- },
52
- setElementText: (el, text) => {
53
- el.textContent = text;
54
- },
55
- parentNode: (node) => node.parentNode,
56
- nextSibling: (node) => node.nextSibling,
57
- querySelector: (selector) => doc.querySelector(selector),
58
- setScopeId(el, id) {
59
- el.setAttribute(id, "");
60
- },
61
- // __UNSAFE__
62
- // Reason: innerHTML.
63
- // Static content here can only come from compiled templates.
64
- // As long as the user only uses trusted templates, this is safe.
65
- insertStaticContent(content, parent, anchor, namespace, start, end) {
66
- const before = anchor ? anchor.previousSibling : parent.lastChild;
67
- if (start && (start === end || start.nextSibling)) {
68
- while (true) {
69
- parent.insertBefore(start.cloneNode(true), anchor);
70
- if (start === end || !(start = start.nextSibling)) break;
71
- }
72
- } else {
73
- templateContainer.innerHTML = unsafeToTrustedHTML(
74
- namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
75
- );
76
- const template = templateContainer.content;
77
- if (namespace === "svg" || namespace === "mathml") {
78
- const wrapper = template.firstChild;
79
- while (wrapper.firstChild) {
80
- template.appendChild(wrapper.firstChild);
81
- }
82
- template.removeChild(wrapper);
83
- }
84
- parent.insertBefore(template, anchor);
85
- }
86
- return [
87
- // first
88
- before ? before.nextSibling : parent.firstChild,
89
- // last
90
- anchor ? anchor.previousSibling : parent.lastChild
91
- ];
92
- }
93
- };
94
-
95
- const TRANSITION = "transition";
96
- const ANIMATION = "animation";
97
- const vtcKey = Symbol("_vtc");
98
- const DOMTransitionPropsValidators = {
99
- name: String,
100
- type: String,
101
- css: {
102
- type: Boolean,
103
- default: true
104
- },
105
- duration: [String, Number, Object],
106
- enterFromClass: String,
107
- enterActiveClass: String,
108
- enterToClass: String,
109
- appearFromClass: String,
110
- appearActiveClass: String,
111
- appearToClass: String,
112
- leaveFromClass: String,
113
- leaveActiveClass: String,
114
- leaveToClass: String
115
- };
116
- const TransitionPropsValidators = /* @__PURE__ */ shared.extend(
117
- {},
118
- runtimeCore.BaseTransitionPropsValidators,
119
- DOMTransitionPropsValidators
120
- );
121
- const decorate$1 = (t) => {
122
- t.displayName = "Transition";
123
- t.props = TransitionPropsValidators;
124
- return t;
125
- };
126
- const Transition = /* @__PURE__ */ decorate$1(
127
- (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots)
128
- );
129
- const callHook = (hook, args = []) => {
130
- if (shared.isArray(hook)) {
131
- hook.forEach((h2) => h2(...args));
132
- } else if (hook) {
133
- hook(...args);
134
- }
135
- };
136
- const hasExplicitCallback = (hook) => {
137
- return hook ? shared.isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
138
- };
139
- function resolveTransitionProps(rawProps) {
140
- const baseProps = {};
141
- for (const key in rawProps) {
142
- if (!(key in DOMTransitionPropsValidators)) {
143
- baseProps[key] = rawProps[key];
144
- }
145
- }
146
- if (rawProps.css === false) {
147
- return baseProps;
148
- }
149
- const {
150
- name = "v",
151
- type,
152
- duration,
153
- enterFromClass = `${name}-enter-from`,
154
- enterActiveClass = `${name}-enter-active`,
155
- enterToClass = `${name}-enter-to`,
156
- appearFromClass = enterFromClass,
157
- appearActiveClass = enterActiveClass,
158
- appearToClass = enterToClass,
159
- leaveFromClass = `${name}-leave-from`,
160
- leaveActiveClass = `${name}-leave-active`,
161
- leaveToClass = `${name}-leave-to`
162
- } = rawProps;
163
- const durations = normalizeDuration(duration);
164
- const enterDuration = durations && durations[0];
165
- const leaveDuration = durations && durations[1];
166
- const {
167
- onBeforeEnter,
168
- onEnter,
169
- onEnterCancelled,
170
- onLeave,
171
- onLeaveCancelled,
172
- onBeforeAppear = onBeforeEnter,
173
- onAppear = onEnter,
174
- onAppearCancelled = onEnterCancelled
175
- } = baseProps;
176
- const finishEnter = (el, isAppear, done, isCancelled) => {
177
- el._enterCancelled = isCancelled;
178
- removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
179
- removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
180
- done && done();
181
- };
182
- const finishLeave = (el, done) => {
183
- el._isLeaving = false;
184
- removeTransitionClass(el, leaveFromClass);
185
- removeTransitionClass(el, leaveToClass);
186
- removeTransitionClass(el, leaveActiveClass);
187
- done && done();
188
- };
189
- const makeEnterHook = (isAppear) => {
190
- return (el, done) => {
191
- const hook = isAppear ? onAppear : onEnter;
192
- const resolve = () => finishEnter(el, isAppear, done);
193
- callHook(hook, [el, resolve]);
194
- nextFrame(() => {
195
- removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
196
- addTransitionClass(el, isAppear ? appearToClass : enterToClass);
197
- if (!hasExplicitCallback(hook)) {
198
- whenTransitionEnds(el, type, enterDuration, resolve);
199
- }
200
- });
201
- };
202
- };
203
- return shared.extend(baseProps, {
204
- onBeforeEnter(el) {
205
- callHook(onBeforeEnter, [el]);
206
- addTransitionClass(el, enterFromClass);
207
- addTransitionClass(el, enterActiveClass);
208
- },
209
- onBeforeAppear(el) {
210
- callHook(onBeforeAppear, [el]);
211
- addTransitionClass(el, appearFromClass);
212
- addTransitionClass(el, appearActiveClass);
213
- },
214
- onEnter: makeEnterHook(false),
215
- onAppear: makeEnterHook(true),
216
- onLeave(el, done) {
217
- el._isLeaving = true;
218
- const resolve = () => finishLeave(el, done);
219
- addTransitionClass(el, leaveFromClass);
220
- if (!el._enterCancelled) {
221
- forceReflow();
222
- addTransitionClass(el, leaveActiveClass);
223
- } else {
224
- addTransitionClass(el, leaveActiveClass);
225
- forceReflow();
226
- }
227
- nextFrame(() => {
228
- if (!el._isLeaving) {
229
- return;
230
- }
231
- removeTransitionClass(el, leaveFromClass);
232
- addTransitionClass(el, leaveToClass);
233
- if (!hasExplicitCallback(onLeave)) {
234
- whenTransitionEnds(el, type, leaveDuration, resolve);
235
- }
236
- });
237
- callHook(onLeave, [el, resolve]);
238
- },
239
- onEnterCancelled(el) {
240
- finishEnter(el, false, void 0, true);
241
- callHook(onEnterCancelled, [el]);
242
- },
243
- onAppearCancelled(el) {
244
- finishEnter(el, true, void 0, true);
245
- callHook(onAppearCancelled, [el]);
246
- },
247
- onLeaveCancelled(el) {
248
- finishLeave(el);
249
- callHook(onLeaveCancelled, [el]);
250
- }
251
- });
252
- }
253
- function normalizeDuration(duration) {
254
- if (duration == null) {
255
- return null;
256
- } else if (shared.isObject(duration)) {
257
- return [NumberOf(duration.enter), NumberOf(duration.leave)];
258
- } else {
259
- const n = NumberOf(duration);
260
- return [n, n];
261
- }
262
- }
263
- function NumberOf(val) {
264
- const res = shared.toNumber(val);
265
- {
266
- runtimeCore.assertNumber(res, "<transition> explicit duration");
267
- }
268
- return res;
269
- }
270
- function addTransitionClass(el, cls) {
271
- cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
272
- (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
273
- }
274
- function removeTransitionClass(el, cls) {
275
- cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
276
- const _vtc = el[vtcKey];
277
- if (_vtc) {
278
- _vtc.delete(cls);
279
- if (!_vtc.size) {
280
- el[vtcKey] = void 0;
281
- }
282
- }
283
- }
284
- function nextFrame(cb) {
285
- requestAnimationFrame(() => {
286
- requestAnimationFrame(cb);
287
- });
288
- }
289
- let endId = 0;
290
- function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
291
- const id = el._endId = ++endId;
292
- const resolveIfNotStale = () => {
293
- if (id === el._endId) {
294
- resolve();
295
- }
296
- };
297
- if (explicitTimeout != null) {
298
- return setTimeout(resolveIfNotStale, explicitTimeout);
299
- }
300
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
301
- if (!type) {
302
- return resolve();
303
- }
304
- const endEvent = type + "end";
305
- let ended = 0;
306
- const end = () => {
307
- el.removeEventListener(endEvent, onEnd);
308
- resolveIfNotStale();
309
- };
310
- const onEnd = (e) => {
311
- if (e.target === el && ++ended >= propCount) {
312
- end();
313
- }
314
- };
315
- setTimeout(() => {
316
- if (ended < propCount) {
317
- end();
318
- }
319
- }, timeout + 1);
320
- el.addEventListener(endEvent, onEnd);
321
- }
322
- function getTransitionInfo(el, expectedType) {
323
- const styles = window.getComputedStyle(el);
324
- const getStyleProperties = (key) => (styles[key] || "").split(", ");
325
- const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
326
- const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
327
- const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
328
- const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
329
- const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
330
- const animationTimeout = getTimeout(animationDelays, animationDurations);
331
- let type = null;
332
- let timeout = 0;
333
- let propCount = 0;
334
- if (expectedType === TRANSITION) {
335
- if (transitionTimeout > 0) {
336
- type = TRANSITION;
337
- timeout = transitionTimeout;
338
- propCount = transitionDurations.length;
339
- }
340
- } else if (expectedType === ANIMATION) {
341
- if (animationTimeout > 0) {
342
- type = ANIMATION;
343
- timeout = animationTimeout;
344
- propCount = animationDurations.length;
345
- }
346
- } else {
347
- timeout = Math.max(transitionTimeout, animationTimeout);
348
- type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
349
- propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
350
- }
351
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
352
- getStyleProperties(`${TRANSITION}Property`).toString()
353
- );
354
- return {
355
- type,
356
- timeout,
357
- propCount,
358
- hasTransform
359
- };
360
- }
361
- function getTimeout(delays, durations) {
362
- while (delays.length < durations.length) {
363
- delays = delays.concat(delays);
364
- }
365
- return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
366
- }
367
- function toMs(s) {
368
- if (s === "auto") return 0;
369
- return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
370
- }
371
- function forceReflow() {
372
- return document.body.offsetHeight;
373
- }
374
-
375
- function patchClass(el, value, isSVG) {
376
- const transitionClasses = el[vtcKey];
377
- if (transitionClasses) {
378
- value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
379
- }
380
- if (value == null) {
381
- el.removeAttribute("class");
382
- } else if (isSVG) {
383
- el.setAttribute("class", value);
384
- } else {
385
- el.className = value;
386
- }
387
- }
388
-
389
- const vShowOriginalDisplay = Symbol("_vod");
390
- const vShowHidden = Symbol("_vsh");
391
- const vShow = {
392
- beforeMount(el, { value }, { transition }) {
393
- el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
394
- if (transition && value) {
395
- transition.beforeEnter(el);
396
- } else {
397
- setDisplay(el, value);
398
- }
399
- },
400
- mounted(el, { value }, { transition }) {
401
- if (transition && value) {
402
- transition.enter(el);
403
- }
404
- },
405
- updated(el, { value, oldValue }, { transition }) {
406
- if (!value === !oldValue) return;
407
- if (transition) {
408
- if (value) {
409
- transition.beforeEnter(el);
410
- setDisplay(el, true);
411
- transition.enter(el);
412
- } else {
413
- transition.leave(el, () => {
414
- setDisplay(el, false);
415
- });
416
- }
417
- } else {
418
- setDisplay(el, value);
419
- }
420
- },
421
- beforeUnmount(el, { value }) {
422
- setDisplay(el, value);
423
- }
424
- };
425
- {
426
- vShow.name = "show";
427
- }
428
- function setDisplay(el, value) {
429
- el.style.display = value ? el[vShowOriginalDisplay] : "none";
430
- el[vShowHidden] = !value;
431
- }
432
-
433
- const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
434
- function useCssVars(getter) {
435
- return;
436
- }
437
-
438
- const displayRE = /(^|;)\s*display\s*:/;
439
- function patchStyle(el, prev, next) {
440
- const style = el.style;
441
- const isCssString = shared.isString(next);
442
- let hasControlledDisplay = false;
443
- if (next && !isCssString) {
444
- if (prev) {
445
- if (!shared.isString(prev)) {
446
- for (const key in prev) {
447
- if (next[key] == null) {
448
- setStyle(style, key, "");
449
- }
450
- }
451
- } else {
452
- for (const prevStyle of prev.split(";")) {
453
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
454
- if (next[key] == null) {
455
- setStyle(style, key, "");
456
- }
457
- }
458
- }
459
- }
460
- for (const key in next) {
461
- if (key === "display") {
462
- hasControlledDisplay = true;
463
- }
464
- setStyle(style, key, next[key]);
465
- }
466
- } else {
467
- if (isCssString) {
468
- if (prev !== next) {
469
- const cssVarText = style[CSS_VAR_TEXT];
470
- if (cssVarText) {
471
- next += ";" + cssVarText;
472
- }
473
- style.cssText = next;
474
- hasControlledDisplay = displayRE.test(next);
475
- }
476
- } else if (prev) {
477
- el.removeAttribute("style");
478
- }
479
- }
480
- if (vShowOriginalDisplay in el) {
481
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
482
- if (el[vShowHidden]) {
483
- style.display = "none";
484
- }
485
- }
486
- }
487
- const semicolonRE = /[^\\];\s*$/;
488
- const importantRE = /\s*!important$/;
489
- function setStyle(style, name, rawVal) {
490
- if (shared.isArray(rawVal)) {
491
- rawVal.forEach((v) => setStyle(style, name, v));
492
- } else {
493
- const val = rawVal == null ? "" : String(rawVal);
494
- {
495
- if (semicolonRE.test(val)) {
496
- runtimeCore.warn(
497
- `Unexpected semicolon at the end of '${name}' style value: '${val}'`
498
- );
499
- }
500
- }
501
- if (name.startsWith("--")) {
502
- style.setProperty(name, val);
503
- } else {
504
- const prefixed = autoPrefix(style, name);
505
- if (importantRE.test(val)) {
506
- style.setProperty(
507
- shared.hyphenate(prefixed),
508
- val.replace(importantRE, ""),
509
- "important"
510
- );
511
- } else {
512
- style[prefixed] = val;
513
- }
514
- }
515
- }
516
- }
517
- const prefixes = ["Webkit", "Moz", "ms"];
518
- const prefixCache = {};
519
- function autoPrefix(style, rawName) {
520
- const cached = prefixCache[rawName];
521
- if (cached) {
522
- return cached;
523
- }
524
- let name = runtimeCore.camelize(rawName);
525
- if (name !== "filter" && name in style) {
526
- return prefixCache[rawName] = name;
527
- }
528
- name = shared.capitalize(name);
529
- for (let i = 0; i < prefixes.length; i++) {
530
- const prefixed = prefixes[i] + name;
531
- if (prefixed in style) {
532
- return prefixCache[rawName] = prefixed;
533
- }
534
- }
535
- return rawName;
536
- }
537
-
538
- const xlinkNS = "http://www.w3.org/1999/xlink";
539
- function patchAttr(el, key, value, isSVG, instance, isBoolean = shared.isSpecialBooleanAttr(key)) {
540
- if (isSVG && key.startsWith("xlink:")) {
541
- if (value == null) {
542
- el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
543
- } else {
544
- el.setAttributeNS(xlinkNS, key, value);
545
- }
546
- } else {
547
- if (value == null || isBoolean && !shared.includeBooleanAttr(value)) {
548
- el.removeAttribute(key);
549
- } else {
550
- el.setAttribute(
551
- key,
552
- isBoolean ? "" : shared.isSymbol(value) ? String(value) : value
553
- );
554
- }
555
- }
556
- }
557
-
558
- function patchDOMProp(el, key, value, parentComponent, attrName) {
559
- if (key === "innerHTML" || key === "textContent") {
560
- if (value != null) {
561
- el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
562
- }
563
- return;
564
- }
565
- const tag = el.tagName;
566
- if (key === "value" && shared.canSetValueDirectly(tag)) {
567
- const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
568
- const newValue = value == null ? (
569
- // #11647: value should be set as empty string for null and undefined,
570
- // but <input type="checkbox"> should be set as 'on'.
571
- el.type === "checkbox" ? "on" : ""
572
- ) : String(value);
573
- if (oldValue !== newValue || !("_value" in el)) {
574
- el.value = newValue;
575
- }
576
- if (value == null) {
577
- el.removeAttribute(key);
578
- }
579
- el._value = value;
580
- return;
581
- }
582
- let needRemove = false;
583
- if (value === "" || value == null) {
584
- const type = typeof el[key];
585
- if (type === "boolean") {
586
- value = shared.includeBooleanAttr(value);
587
- } else if (value == null && type === "string") {
588
- value = "";
589
- needRemove = true;
590
- } else if (type === "number") {
591
- value = 0;
592
- needRemove = true;
593
- }
594
- }
595
- try {
596
- el[key] = value;
597
- } catch (e) {
598
- if (!needRemove) {
599
- runtimeCore.warn(
600
- `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
601
- e
602
- );
603
- }
604
- }
605
- needRemove && el.removeAttribute(attrName || key);
606
- }
607
-
608
- function addEventListener(el, event, handler, options) {
609
- el.addEventListener(event, handler, options);
610
- }
611
- function removeEventListener(el, event, handler, options) {
612
- el.removeEventListener(event, handler, options);
613
- }
614
- const veiKey = Symbol("_vei");
615
- function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
616
- const invokers = el[veiKey] || (el[veiKey] = {});
617
- const existingInvoker = invokers[rawName];
618
- if (nextValue && existingInvoker) {
619
- existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
620
- } else {
621
- const [name, options] = parseName(rawName);
622
- if (nextValue) {
623
- const invoker = invokers[rawName] = createInvoker(
624
- sanitizeEventValue(nextValue, rawName) ,
625
- instance
626
- );
627
- addEventListener(el, name, invoker, options);
628
- } else if (existingInvoker) {
629
- removeEventListener(el, name, existingInvoker, options);
630
- invokers[rawName] = void 0;
631
- }
632
- }
633
- }
634
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
635
- function parseName(name) {
636
- let options;
637
- if (optionsModifierRE.test(name)) {
638
- options = {};
639
- let m;
640
- while (m = name.match(optionsModifierRE)) {
641
- name = name.slice(0, name.length - m[0].length);
642
- options[m[0].toLowerCase()] = true;
643
- }
644
- }
645
- const event = name[2] === ":" ? name.slice(3) : shared.hyphenate(name.slice(2));
646
- return [event, options];
647
- }
648
- let cachedNow = 0;
649
- const p = /* @__PURE__ */ Promise.resolve();
650
- const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
651
- function createInvoker(initialValue, instance) {
652
- const invoker = (e) => {
653
- if (!e._vts) {
654
- e._vts = Date.now();
655
- } else if (e._vts <= invoker.attached) {
656
- return;
657
- }
658
- runtimeCore.callWithAsyncErrorHandling(
659
- patchStopImmediatePropagation(e, invoker.value),
660
- instance,
661
- 5,
662
- [e]
663
- );
664
- };
665
- invoker.value = initialValue;
666
- invoker.attached = getNow();
667
- return invoker;
668
- }
669
- function sanitizeEventValue(value, propName) {
670
- if (shared.isFunction(value) || shared.isArray(value)) {
671
- return value;
672
- }
673
- runtimeCore.warn(
674
- `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
675
- Expected function or array of functions, received type ${typeof value}.`
676
- );
677
- return shared.NOOP;
678
- }
679
- function patchStopImmediatePropagation(e, value) {
680
- if (shared.isArray(value)) {
681
- const originalStop = e.stopImmediatePropagation;
682
- e.stopImmediatePropagation = () => {
683
- originalStop.call(e);
684
- e._stopped = true;
685
- };
686
- return value.map(
687
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
688
- );
689
- } else {
690
- return value;
691
- }
692
- }
693
-
694
- const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
695
- const isSVG = namespace === "svg";
696
- if (key === "class") {
697
- patchClass(el, nextValue, isSVG);
698
- } else if (key === "style") {
699
- patchStyle(el, prevValue, nextValue);
700
- } else if (shared.isOn(key)) {
701
- if (!shared.isModelListener(key)) {
702
- patchEvent(el, key, prevValue, nextValue, parentComponent);
703
- }
704
- } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
705
- patchDOMProp(el, key, nextValue);
706
- if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
707
- patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
708
- }
709
- } else if (
710
- // #11081 force set props for possible async custom element
711
- el._isVueCE && (/[A-Z]/.test(key) || !shared.isString(nextValue))
712
- ) {
713
- patchDOMProp(el, shared.camelize(key), nextValue, parentComponent, key);
714
- } else {
715
- if (key === "true-value") {
716
- el._trueValue = nextValue;
717
- } else if (key === "false-value") {
718
- el._falseValue = nextValue;
719
- }
720
- patchAttr(el, key, nextValue, isSVG);
721
- }
722
- };
723
- function shouldSetAsProp(el, key, value, isSVG) {
724
- if (isSVG) {
725
- if (key === "innerHTML" || key === "textContent") {
726
- return true;
727
- }
728
- if (key in el && shared.isNativeOn(key) && shared.isFunction(value)) {
729
- return true;
730
- }
731
- return false;
732
- }
733
- if (shared.shouldSetAsAttr(el.tagName, key)) {
734
- return false;
735
- }
736
- if (shared.isNativeOn(key) && shared.isString(value)) {
737
- return false;
738
- }
739
- return key in el;
740
- }
741
-
742
- const REMOVAL = {};
743
- /*! #__NO_SIDE_EFFECTS__ */
744
- // @__NO_SIDE_EFFECTS__
745
- function defineCustomElement(options, extraOptions, _createApp) {
746
- const Comp = runtimeCore.defineComponent(options, extraOptions);
747
- if (shared.isPlainObject(Comp)) shared.extend(Comp, extraOptions);
748
- class VueCustomElement extends VueElement {
749
- constructor(initialProps) {
750
- super(Comp, initialProps, _createApp);
751
- }
752
- }
753
- VueCustomElement.def = Comp;
754
- return VueCustomElement;
755
- }
756
- /*! #__NO_SIDE_EFFECTS__ */
757
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
758
- return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
759
- };
760
- const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
761
- };
762
- class VueElement extends BaseClass {
763
- constructor(_def, _props = {}, _createApp = createApp) {
764
- super();
765
- this._def = _def;
766
- this._props = _props;
767
- this._createApp = _createApp;
768
- this._isVueCE = true;
769
- /**
770
- * @internal
771
- */
772
- this._instance = null;
773
- /**
774
- * @internal
775
- */
776
- this._app = null;
777
- /**
778
- * @internal
779
- */
780
- this._nonce = this._def.nonce;
781
- this._connected = false;
782
- this._resolved = false;
783
- this._numberProps = null;
784
- this._styleChildren = /* @__PURE__ */ new WeakSet();
785
- this._ob = null;
786
- if (this.shadowRoot && _createApp !== createApp) {
787
- this._root = this.shadowRoot;
788
- } else {
789
- if (this.shadowRoot) {
790
- runtimeCore.warn(
791
- `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
792
- );
793
- }
794
- if (_def.shadowRoot !== false) {
795
- this.attachShadow({ mode: "open" });
796
- this._root = this.shadowRoot;
797
- } else {
798
- this._root = this;
799
- }
800
- }
801
- }
802
- connectedCallback() {
803
- if (!this.isConnected) return;
804
- if (!this.shadowRoot && !this._resolved) {
805
- this._parseSlots();
806
- }
807
- this._connected = true;
808
- let parent = this;
809
- while (parent = parent && (parent.parentNode || parent.host)) {
810
- if (parent instanceof VueElement) {
811
- this._parent = parent;
812
- break;
813
- }
814
- }
815
- if (!this._instance) {
816
- if (this._resolved) {
817
- this._mount(this._def);
818
- } else {
819
- if (parent && parent._pendingResolve) {
820
- this._pendingResolve = parent._pendingResolve.then(() => {
821
- this._pendingResolve = void 0;
822
- this._resolveDef();
823
- });
824
- } else {
825
- this._resolveDef();
826
- }
827
- }
828
- }
829
- }
830
- _setParent(parent = this._parent) {
831
- if (parent) {
832
- this._instance.parent = parent._instance;
833
- this._inheritParentContext(parent);
834
- }
835
- }
836
- _inheritParentContext(parent = this._parent) {
837
- if (parent && this._app) {
838
- Object.setPrototypeOf(
839
- this._app._context.provides,
840
- parent._instance.provides
841
- );
842
- }
843
- }
844
- disconnectedCallback() {
845
- this._connected = false;
846
- runtimeCore.nextTick(() => {
847
- if (!this._connected) {
848
- if (this._ob) {
849
- this._ob.disconnect();
850
- this._ob = null;
851
- }
852
- this._app && this._app.unmount();
853
- if (this._instance) this._instance.ce = void 0;
854
- this._app = this._instance = null;
855
- }
856
- });
857
- }
858
- /**
859
- * resolve inner component definition (handle possible async component)
860
- */
861
- _resolveDef() {
862
- if (this._pendingResolve) {
863
- return;
864
- }
865
- for (let i = 0; i < this.attributes.length; i++) {
866
- this._setAttr(this.attributes[i].name);
867
- }
868
- this._ob = new MutationObserver((mutations) => {
869
- for (const m of mutations) {
870
- this._setAttr(m.attributeName);
871
- }
872
- });
873
- this._ob.observe(this, { attributes: true });
874
- const resolve = (def, isAsync = false) => {
875
- this._resolved = true;
876
- this._pendingResolve = void 0;
877
- const { props, styles } = def;
878
- let numberProps;
879
- if (props && !shared.isArray(props)) {
880
- for (const key in props) {
881
- const opt = props[key];
882
- if (opt === Number || opt && opt.type === Number) {
883
- if (key in this._props) {
884
- this._props[key] = shared.toNumber(this._props[key]);
885
- }
886
- (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[shared.camelize(key)] = true;
887
- }
888
- }
889
- }
890
- this._numberProps = numberProps;
891
- this._resolveProps(def);
892
- if (this.shadowRoot) {
893
- this._applyStyles(styles);
894
- } else if (styles) {
895
- runtimeCore.warn(
896
- "Custom element style injection is not supported when using shadowRoot: false"
897
- );
898
- }
899
- this._mount(def);
900
- };
901
- const asyncDef = this._def.__asyncLoader;
902
- if (asyncDef) {
903
- this._pendingResolve = asyncDef().then((def) => {
904
- def.configureApp = this._def.configureApp;
905
- resolve(this._def = def, true);
906
- });
907
- } else {
908
- resolve(this._def);
909
- }
910
- }
911
- _mount(def) {
912
- if (!def.name) {
913
- def.name = "VueElement";
914
- }
915
- this._app = this._createApp(def);
916
- this._inheritParentContext();
917
- if (def.configureApp) {
918
- def.configureApp(this._app);
919
- }
920
- this._app._ceVNode = this._createVNode();
921
- this._app.mount(this._root);
922
- const exposed = this._instance && this._instance.exposed;
923
- if (!exposed) return;
924
- for (const key in exposed) {
925
- if (!shared.hasOwn(this, key)) {
926
- Object.defineProperty(this, key, {
927
- // unwrap ref to be consistent with public instance behavior
928
- get: () => runtimeCore.unref(exposed[key])
929
- });
930
- } else {
931
- runtimeCore.warn(`Exposed property "${key}" already exists on custom element.`);
932
- }
933
- }
934
- }
935
- _resolveProps(def) {
936
- const { props } = def;
937
- const declaredPropKeys = shared.isArray(props) ? props : Object.keys(props || {});
938
- for (const key of Object.keys(this)) {
939
- if (key[0] !== "_" && declaredPropKeys.includes(key)) {
940
- this._setProp(key, this[key]);
941
- }
942
- }
943
- for (const key of declaredPropKeys.map(shared.camelize)) {
944
- Object.defineProperty(this, key, {
945
- get() {
946
- return this._getProp(key);
947
- },
948
- set(val) {
949
- this._setProp(key, val, true, true);
950
- }
951
- });
952
- }
953
- }
954
- _setAttr(key) {
955
- if (key.startsWith("data-v-")) return;
956
- const has = this.hasAttribute(key);
957
- let value = has ? this.getAttribute(key) : REMOVAL;
958
- const camelKey = shared.camelize(key);
959
- if (has && this._numberProps && this._numberProps[camelKey]) {
960
- value = shared.toNumber(value);
961
- }
962
- this._setProp(camelKey, value, false, true);
963
- }
964
- /**
965
- * @internal
966
- */
967
- _getProp(key) {
968
- return this._props[key];
969
- }
970
- /**
971
- * @internal
972
- */
973
- _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
974
- if (val !== this._props[key]) {
975
- if (val === REMOVAL) {
976
- delete this._props[key];
977
- } else {
978
- this._props[key] = val;
979
- if (key === "key" && this._app) {
980
- this._app._ceVNode.key = val;
981
- }
982
- }
983
- if (shouldUpdate && this._instance) {
984
- this._update();
985
- }
986
- if (shouldReflect) {
987
- const ob = this._ob;
988
- ob && ob.disconnect();
989
- if (val === true) {
990
- this.setAttribute(shared.hyphenate(key), "");
991
- } else if (typeof val === "string" || typeof val === "number") {
992
- this.setAttribute(shared.hyphenate(key), val + "");
993
- } else if (!val) {
994
- this.removeAttribute(shared.hyphenate(key));
995
- }
996
- ob && ob.observe(this, { attributes: true });
997
- }
998
- }
999
- }
1000
- _update() {
1001
- const vnode = this._createVNode();
1002
- if (this._app) vnode.appContext = this._app._context;
1003
- render(vnode, this._root);
1004
- }
1005
- _createVNode() {
1006
- const baseProps = {};
1007
- if (!this.shadowRoot) {
1008
- baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
1009
- }
1010
- const vnode = runtimeCore.createVNode(this._def, shared.extend(baseProps, this._props));
1011
- if (!this._instance) {
1012
- vnode.ce = (instance) => {
1013
- this._instance = instance;
1014
- instance.ce = this;
1015
- instance.isCE = true;
1016
- {
1017
- instance.ceReload = (newStyles) => {
1018
- if (this._styles) {
1019
- this._styles.forEach((s) => this._root.removeChild(s));
1020
- this._styles.length = 0;
1021
- }
1022
- this._applyStyles(newStyles);
1023
- this._instance = null;
1024
- this._update();
1025
- };
1026
- }
1027
- const dispatch = (event, args) => {
1028
- this.dispatchEvent(
1029
- new CustomEvent(
1030
- event,
1031
- shared.isPlainObject(args[0]) ? shared.extend({ detail: args }, args[0]) : { detail: args }
1032
- )
1033
- );
1034
- };
1035
- instance.emit = (event, ...args) => {
1036
- dispatch(event, args);
1037
- if (shared.hyphenate(event) !== event) {
1038
- dispatch(shared.hyphenate(event), args);
1039
- }
1040
- };
1041
- this._setParent();
1042
- };
1043
- }
1044
- return vnode;
1045
- }
1046
- _applyStyles(styles, owner) {
1047
- if (!styles) return;
1048
- if (owner) {
1049
- if (owner === this._def || this._styleChildren.has(owner)) {
1050
- return;
1051
- }
1052
- this._styleChildren.add(owner);
1053
- }
1054
- const nonce = this._nonce;
1055
- for (let i = styles.length - 1; i >= 0; i--) {
1056
- const s = document.createElement("style");
1057
- if (nonce) s.setAttribute("nonce", nonce);
1058
- s.textContent = styles[i];
1059
- this.shadowRoot.prepend(s);
1060
- {
1061
- if (owner) {
1062
- if (owner.__hmrId) {
1063
- if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
1064
- let entry = this._childStyles.get(owner.__hmrId);
1065
- if (!entry) {
1066
- this._childStyles.set(owner.__hmrId, entry = []);
1067
- }
1068
- entry.push(s);
1069
- }
1070
- } else {
1071
- (this._styles || (this._styles = [])).push(s);
1072
- }
1073
- }
1074
- }
1075
- }
1076
- /**
1077
- * Only called when shadowRoot is false
1078
- */
1079
- _parseSlots() {
1080
- const slots = this._slots = {};
1081
- let n;
1082
- while (n = this.firstChild) {
1083
- const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
1084
- (slots[slotName] || (slots[slotName] = [])).push(n);
1085
- this.removeChild(n);
1086
- }
1087
- }
1088
- /**
1089
- * Only called when shadowRoot is false
1090
- */
1091
- _renderSlots() {
1092
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
1093
- const scopeId = this._instance.type.__scopeId;
1094
- for (let i = 0; i < outlets.length; i++) {
1095
- const o = outlets[i];
1096
- const slotName = o.getAttribute("name") || "default";
1097
- const content = this._slots[slotName];
1098
- const parent = o.parentNode;
1099
- if (content) {
1100
- for (const n of content) {
1101
- if (scopeId && n.nodeType === 1) {
1102
- const id = scopeId + "-s";
1103
- const walker = document.createTreeWalker(n, 1);
1104
- n.setAttribute(id, "");
1105
- let child;
1106
- while (child = walker.nextNode()) {
1107
- child.setAttribute(id, "");
1108
- }
1109
- }
1110
- parent.insertBefore(n, o);
1111
- }
1112
- } else {
1113
- while (o.firstChild) parent.insertBefore(o.firstChild, o);
1114
- }
1115
- parent.removeChild(o);
1116
- }
1117
- }
1118
- /**
1119
- * @internal
1120
- */
1121
- _injectChildStyle(comp) {
1122
- this._applyStyles(comp.styles, comp);
1123
- }
1124
- /**
1125
- * @internal
1126
- */
1127
- _removeChildStyle(comp) {
1128
- {
1129
- this._styleChildren.delete(comp);
1130
- if (this._childStyles && comp.__hmrId) {
1131
- const oldStyles = this._childStyles.get(comp.__hmrId);
1132
- if (oldStyles) {
1133
- oldStyles.forEach((s) => this._root.removeChild(s));
1134
- oldStyles.length = 0;
1135
- }
1136
- }
1137
- }
1138
- }
1139
- }
1140
- function useHost(caller) {
1141
- const instance = runtimeCore.getCurrentInstance();
1142
- const el = instance && instance.ce;
1143
- if (el) {
1144
- return el;
1145
- } else {
1146
- if (!instance) {
1147
- runtimeCore.warn(
1148
- `${caller || "useHost"} called without an active component instance.`
1149
- );
1150
- } else {
1151
- runtimeCore.warn(
1152
- `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
1153
- );
1154
- }
1155
- }
1156
- return null;
1157
- }
1158
- function useShadowRoot() {
1159
- const el = useHost("useShadowRoot") ;
1160
- return el && el.shadowRoot;
1161
- }
1162
-
1163
- function useCssModule(name = "$style") {
1164
- {
1165
- const instance = runtimeCore.getCurrentInstance();
1166
- if (!instance) {
1167
- runtimeCore.warn(`useCssModule must be called inside setup()`);
1168
- return shared.EMPTY_OBJ;
1169
- }
1170
- const modules = instance.type.__cssModules;
1171
- if (!modules) {
1172
- runtimeCore.warn(`Current instance does not have CSS modules injected.`);
1173
- return shared.EMPTY_OBJ;
1174
- }
1175
- const mod = modules[name];
1176
- if (!mod) {
1177
- runtimeCore.warn(`Current instance does not have CSS module named "${name}".`);
1178
- return shared.EMPTY_OBJ;
1179
- }
1180
- return mod;
1181
- }
1182
- }
1183
-
1184
- const positionMap = /* @__PURE__ */ new WeakMap();
1185
- const newPositionMap = /* @__PURE__ */ new WeakMap();
1186
- const moveCbKey = Symbol("_moveCb");
1187
- const enterCbKey = Symbol("_enterCb");
1188
- const decorate = (t) => {
1189
- delete t.props.mode;
1190
- return t;
1191
- };
1192
- const TransitionGroupImpl = /* @__PURE__ */ decorate({
1193
- name: "TransitionGroup",
1194
- props: /* @__PURE__ */ shared.extend({}, TransitionPropsValidators, {
1195
- tag: String,
1196
- moveClass: String
1197
- }),
1198
- setup(props, { slots }) {
1199
- const instance = runtimeCore.getCurrentInstance();
1200
- const state = runtimeCore.useTransitionState();
1201
- let prevChildren;
1202
- let children;
1203
- runtimeCore.onUpdated(() => {
1204
- if (!prevChildren.length) {
1205
- return;
1206
- }
1207
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
1208
- if (!hasCSSTransform(
1209
- prevChildren[0].el,
1210
- instance.vnode.el,
1211
- moveClass
1212
- )) {
1213
- prevChildren = [];
1214
- return;
1215
- }
1216
- prevChildren.forEach(callPendingCbs);
1217
- prevChildren.forEach(recordPosition);
1218
- const movedChildren = prevChildren.filter(applyTranslation);
1219
- forceReflow();
1220
- movedChildren.forEach((c) => {
1221
- const el = c.el;
1222
- const style = el.style;
1223
- addTransitionClass(el, moveClass);
1224
- style.transform = style.webkitTransform = style.transitionDuration = "";
1225
- const cb = el[moveCbKey] = (e) => {
1226
- if (e && e.target !== el) {
1227
- return;
1228
- }
1229
- if (!e || /transform$/.test(e.propertyName)) {
1230
- el.removeEventListener("transitionend", cb);
1231
- el[moveCbKey] = null;
1232
- removeTransitionClass(el, moveClass);
1233
- }
1234
- };
1235
- el.addEventListener("transitionend", cb);
1236
- });
1237
- prevChildren = [];
1238
- });
1239
- return () => {
1240
- const rawProps = runtimeCore.toRaw(props);
1241
- const cssTransitionProps = resolveTransitionProps(rawProps);
1242
- let tag = rawProps.tag || runtimeCore.Fragment;
1243
- prevChildren = [];
1244
- if (children) {
1245
- for (let i = 0; i < children.length; i++) {
1246
- const child = children[i];
1247
- if (child.el && child.el instanceof Element) {
1248
- prevChildren.push(child);
1249
- runtimeCore.setTransitionHooks(
1250
- child,
1251
- runtimeCore.resolveTransitionHooks(
1252
- child,
1253
- cssTransitionProps,
1254
- state,
1255
- instance
1256
- )
1257
- );
1258
- positionMap.set(
1259
- child,
1260
- child.el.getBoundingClientRect()
1261
- );
1262
- }
1263
- }
1264
- }
1265
- children = slots.default ? runtimeCore.getTransitionRawChildren(slots.default()) : [];
1266
- for (let i = 0; i < children.length; i++) {
1267
- const child = children[i];
1268
- if (child.key != null) {
1269
- runtimeCore.setTransitionHooks(
1270
- child,
1271
- runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance)
1272
- );
1273
- } else if (child.type !== runtimeCore.Text) {
1274
- runtimeCore.warn(`<TransitionGroup> children must be keyed.`);
1275
- }
1276
- }
1277
- return runtimeCore.createVNode(tag, null, children);
1278
- };
1279
- }
1280
- });
1281
- const TransitionGroup = TransitionGroupImpl;
1282
- function callPendingCbs(c) {
1283
- const el = c.el;
1284
- if (el[moveCbKey]) {
1285
- el[moveCbKey]();
1286
- }
1287
- if (el[enterCbKey]) {
1288
- el[enterCbKey]();
1289
- }
1290
- }
1291
- function recordPosition(c) {
1292
- newPositionMap.set(c, c.el.getBoundingClientRect());
1293
- }
1294
- function applyTranslation(c) {
1295
- const oldPos = positionMap.get(c);
1296
- const newPos = newPositionMap.get(c);
1297
- const dx = oldPos.left - newPos.left;
1298
- const dy = oldPos.top - newPos.top;
1299
- if (dx || dy) {
1300
- const s = c.el.style;
1301
- s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
1302
- s.transitionDuration = "0s";
1303
- return c;
1304
- }
1305
- }
1306
- function hasCSSTransform(el, root, moveClass) {
1307
- const clone = el.cloneNode();
1308
- const _vtc = el[vtcKey];
1309
- if (_vtc) {
1310
- _vtc.forEach((cls) => {
1311
- cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
1312
- });
1313
- }
1314
- moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
1315
- clone.style.display = "none";
1316
- const container = root.nodeType === 1 ? root : root.parentNode;
1317
- container.appendChild(clone);
1318
- const { hasTransform } = getTransitionInfo(clone);
1319
- container.removeChild(clone);
1320
- return hasTransform;
1321
- }
1322
-
1323
- const getModelAssigner = (vnode) => {
1324
- const fn = vnode.props["onUpdate:modelValue"] || false;
1325
- return shared.isArray(fn) ? (value) => shared.invokeArrayFns(fn, value) : fn;
1326
- };
1327
- function onCompositionStart(e) {
1328
- e.target.composing = true;
1329
- }
1330
- function onCompositionEnd(e) {
1331
- const target = e.target;
1332
- if (target.composing) {
1333
- target.composing = false;
1334
- target.dispatchEvent(new Event("input"));
1335
- }
1336
- }
1337
- const assignKey = Symbol("_assign");
1338
- const vModelText = {
1339
- created(el, { modifiers: { lazy, trim, number } }, vnode) {
1340
- el[assignKey] = getModelAssigner(vnode);
1341
- vModelTextInit(
1342
- el,
1343
- trim,
1344
- number || !!(vnode.props && vnode.props.type === "number"),
1345
- lazy
1346
- );
1347
- },
1348
- // set value on mounted so it's after min/max for type="range"
1349
- mounted(el, { value }) {
1350
- el.value = value == null ? "" : value;
1351
- },
1352
- beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
1353
- el[assignKey] = getModelAssigner(vnode);
1354
- vModelTextUpdate(el, oldValue, value, trim, number, lazy);
1355
- }
1356
- };
1357
- const vModelTextInit = (el, trim, number, lazy, set) => {
1358
- addEventListener(el, lazy ? "change" : "input", (e) => {
1359
- if (e.target.composing) return;
1360
- let domValue = el.value;
1361
- if (trim) {
1362
- domValue = domValue.trim();
1363
- }
1364
- if (number || el.type === "number") {
1365
- domValue = shared.looseToNumber(domValue);
1366
- }
1367
- (0, el[assignKey])(domValue);
1368
- });
1369
- if (trim) {
1370
- addEventListener(el, "change", () => {
1371
- el.value = el.value.trim();
1372
- });
1373
- }
1374
- if (!lazy) {
1375
- addEventListener(el, "compositionstart", onCompositionStart);
1376
- addEventListener(el, "compositionend", onCompositionEnd);
1377
- addEventListener(el, "change", onCompositionEnd);
1378
- }
1379
- };
1380
- const vModelTextUpdate = (el, oldValue, value, trim, number, lazy) => {
1381
- if (el.composing) return;
1382
- const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? shared.looseToNumber(el.value) : el.value;
1383
- const newValue = value == null ? "" : value;
1384
- if (elValue === newValue) {
1385
- return;
1386
- }
1387
- if (document.activeElement === el && el.type !== "range") {
1388
- if (lazy && value === oldValue) {
1389
- return;
1390
- }
1391
- if (trim && el.value.trim() === newValue) {
1392
- return;
1393
- }
1394
- }
1395
- el.value = newValue;
1396
- };
1397
- const vModelCheckbox = {
1398
- // #4096 array checkboxes need to be deep traversed
1399
- deep: true,
1400
- created(el, _, vnode) {
1401
- el[assignKey] = getModelAssigner(vnode);
1402
- vModelCheckboxInit(el);
1403
- },
1404
- // set initial checked on mount to wait for true-value/false-value
1405
- mounted(el, binding, vnode) {
1406
- vModelCheckboxUpdate(
1407
- el,
1408
- binding.oldValue,
1409
- binding.value,
1410
- vnode.props.value
1411
- );
1412
- },
1413
- beforeUpdate(el, binding, vnode) {
1414
- el[assignKey] = getModelAssigner(vnode);
1415
- vModelCheckboxUpdate(
1416
- el,
1417
- binding.oldValue,
1418
- binding.value,
1419
- vnode.props.value
1420
- );
1421
- }
1422
- };
1423
- const vModelCheckboxInit = (el, set) => {
1424
- addEventListener(el, "change", () => {
1425
- const assign = el[assignKey];
1426
- const modelValue = el._modelValue;
1427
- const elementValue = getValue(el);
1428
- const checked = el.checked;
1429
- if (shared.isArray(modelValue)) {
1430
- const index = shared.looseIndexOf(modelValue, elementValue);
1431
- const found = index !== -1;
1432
- if (checked && !found) {
1433
- assign(modelValue.concat(elementValue));
1434
- } else if (!checked && found) {
1435
- const filtered = [...modelValue];
1436
- filtered.splice(index, 1);
1437
- assign(filtered);
1438
- }
1439
- } else if (shared.isSet(modelValue)) {
1440
- const cloned = new Set(modelValue);
1441
- if (checked) {
1442
- cloned.add(elementValue);
1443
- } else {
1444
- cloned.delete(elementValue);
1445
- }
1446
- assign(cloned);
1447
- } else {
1448
- assign(getCheckboxValue(el, checked));
1449
- }
1450
- });
1451
- };
1452
- const vModelCheckboxUpdate = (el, oldValue, value, rawValue = getValue(el)) => {
1453
- el._modelValue = value;
1454
- let checked;
1455
- if (shared.isArray(value)) {
1456
- checked = shared.looseIndexOf(value, rawValue) > -1;
1457
- } else if (shared.isSet(value)) {
1458
- checked = value.has(rawValue);
1459
- } else {
1460
- if (value === oldValue) return;
1461
- checked = shared.looseEqual(value, getCheckboxValue(el, true));
1462
- }
1463
- if (el.checked !== checked) {
1464
- el.checked = checked;
1465
- }
1466
- };
1467
- const vModelRadio = {
1468
- created(el, { value }, vnode) {
1469
- el.checked = shared.looseEqual(value, vnode.props.value);
1470
- el[assignKey] = getModelAssigner(vnode);
1471
- addEventListener(el, "change", () => {
1472
- el[assignKey](getValue(el));
1473
- });
1474
- },
1475
- beforeUpdate(el, { value, oldValue }, vnode) {
1476
- el[assignKey] = getModelAssigner(vnode);
1477
- if (value !== oldValue) {
1478
- el.checked = shared.looseEqual(value, vnode.props.value);
1479
- }
1480
- }
1481
- };
1482
- const vModelSelect = {
1483
- // <select multiple> value need to be deep traversed
1484
- deep: true,
1485
- created(el, { value, modifiers: { number } }, vnode) {
1486
- vModelSelectInit(el, value, number);
1487
- el[assignKey] = getModelAssigner(vnode);
1488
- },
1489
- // set value in mounted & updated because <select> relies on its children
1490
- // <option>s.
1491
- mounted(el, { value }) {
1492
- vModelSetSelected(el, value);
1493
- },
1494
- beforeUpdate(el, _binding, vnode) {
1495
- el[assignKey] = getModelAssigner(vnode);
1496
- },
1497
- updated(el, { value }) {
1498
- vModelSetSelected(el, value);
1499
- }
1500
- };
1501
- const vModelSelectInit = (el, value, number, set) => {
1502
- const isSetModel = shared.isSet(value);
1503
- addEventListener(el, "change", () => {
1504
- const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
1505
- (o) => number ? shared.looseToNumber(getValue(o)) : getValue(o)
1506
- );
1507
- (0, el[assignKey])(
1508
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
1509
- );
1510
- el._assigning = true;
1511
- runtimeCore.nextTick(() => {
1512
- el._assigning = false;
1513
- });
1514
- });
1515
- };
1516
- const vModelSetSelected = (el, value) => {
1517
- if (el._assigning) return;
1518
- const isMultiple = el.multiple;
1519
- const isArrayValue = shared.isArray(value);
1520
- if (isMultiple && !isArrayValue && !shared.isSet(value)) {
1521
- runtimeCore.warn(
1522
- `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
1523
- );
1524
- return;
1525
- }
1526
- for (let i = 0, l = el.options.length; i < l; i++) {
1527
- const option = el.options[i];
1528
- const optionValue = getValue(option);
1529
- if (isMultiple) {
1530
- if (isArrayValue) {
1531
- const optionType = typeof optionValue;
1532
- if (optionType === "string" || optionType === "number") {
1533
- option.selected = value.some((v) => String(v) === String(optionValue));
1534
- } else {
1535
- option.selected = shared.looseIndexOf(value, optionValue) > -1;
1536
- }
1537
- } else {
1538
- option.selected = value.has(optionValue);
1539
- }
1540
- } else if (shared.looseEqual(getValue(option), value)) {
1541
- if (el.selectedIndex !== i) el.selectedIndex = i;
1542
- return;
1543
- }
1544
- }
1545
- if (!isMultiple && el.selectedIndex !== -1) {
1546
- el.selectedIndex = -1;
1547
- }
1548
- };
1549
- function getValue(el) {
1550
- return "_value" in el ? el._value : el.value;
1551
- }
1552
- function getCheckboxValue(el, checked) {
1553
- const key = checked ? "_trueValue" : "_falseValue";
1554
- if (key in el) {
1555
- return el[key];
1556
- }
1557
- const attr = checked ? "true-value" : "false-value";
1558
- if (el.hasAttribute(attr)) {
1559
- return el.getAttribute(attr);
1560
- }
1561
- return checked;
1562
- }
1563
- const vModelDynamic = {
1564
- created(el, binding, vnode) {
1565
- callModelHook(el, binding, vnode, null, "created");
1566
- },
1567
- mounted(el, binding, vnode) {
1568
- callModelHook(el, binding, vnode, null, "mounted");
1569
- },
1570
- beforeUpdate(el, binding, vnode, prevVNode) {
1571
- callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
1572
- },
1573
- updated(el, binding, vnode, prevVNode) {
1574
- callModelHook(el, binding, vnode, prevVNode, "updated");
1575
- }
1576
- };
1577
- function resolveDynamicModel(tagName, type) {
1578
- switch (tagName) {
1579
- case "SELECT":
1580
- return vModelSelect;
1581
- case "TEXTAREA":
1582
- return vModelText;
1583
- default:
1584
- switch (type) {
1585
- case "checkbox":
1586
- return vModelCheckbox;
1587
- case "radio":
1588
- return vModelRadio;
1589
- default:
1590
- return vModelText;
1591
- }
1592
- }
1593
- }
1594
- function callModelHook(el, binding, vnode, prevVNode, hook) {
1595
- const modelToUse = resolveDynamicModel(
1596
- el.tagName,
1597
- vnode.props && vnode.props.type
1598
- );
1599
- const fn = modelToUse[hook];
1600
- fn && fn(el, binding, vnode, prevVNode);
1601
- }
1602
-
1603
- const systemModifiers = ["ctrl", "shift", "alt", "meta"];
1604
- const modifierGuards = {
1605
- stop: (e) => e.stopPropagation(),
1606
- prevent: (e) => e.preventDefault(),
1607
- self: (e) => e.target !== e.currentTarget,
1608
- ctrl: (e) => !e.ctrlKey,
1609
- shift: (e) => !e.shiftKey,
1610
- alt: (e) => !e.altKey,
1611
- meta: (e) => !e.metaKey,
1612
- left: (e) => "button" in e && e.button !== 0,
1613
- middle: (e) => "button" in e && e.button !== 1,
1614
- right: (e) => "button" in e && e.button !== 2,
1615
- exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1616
- };
1617
- const withModifiers = (fn, modifiers) => {
1618
- const cache = fn._withMods || (fn._withMods = {});
1619
- const cacheKey = modifiers.join(".");
1620
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
1621
- for (let i = 0; i < modifiers.length; i++) {
1622
- const guard = modifierGuards[modifiers[i]];
1623
- if (guard && guard(event, modifiers)) return;
1624
- }
1625
- return fn(event, ...args);
1626
- });
1627
- };
1628
- const keyNames = {
1629
- esc: "escape",
1630
- space: " ",
1631
- up: "arrow-up",
1632
- left: "arrow-left",
1633
- right: "arrow-right",
1634
- down: "arrow-down",
1635
- delete: "backspace"
1636
- };
1637
- const withKeys = (fn, modifiers) => {
1638
- const cache = fn._withKeys || (fn._withKeys = {});
1639
- const cacheKey = modifiers.join(".");
1640
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
1641
- if (!("key" in event)) {
1642
- return;
1643
- }
1644
- const eventKey = shared.hyphenate(event.key);
1645
- if (modifiers.some(
1646
- (k) => k === eventKey || keyNames[k] === eventKey
1647
- )) {
1648
- return fn(event);
1649
- }
1650
- });
1651
- };
1652
-
1653
- const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps);
1654
- let renderer;
1655
- let enabledHydration = false;
1656
- function ensureRenderer() {
1657
- return renderer || (renderer = runtimeCore.createRenderer(rendererOptions));
1658
- }
1659
- function ensureHydrationRenderer() {
1660
- renderer = enabledHydration ? renderer : runtimeCore.createHydrationRenderer(rendererOptions);
1661
- enabledHydration = true;
1662
- return renderer;
1663
- }
1664
- const render = (...args) => {
1665
- ensureRenderer().render(...args);
1666
- };
1667
- const hydrate = (...args) => {
1668
- ensureHydrationRenderer().hydrate(...args);
1669
- };
1670
- const createApp = (...args) => {
1671
- const app = ensureRenderer().createApp(...args);
1672
- {
1673
- injectNativeTagCheck(app);
1674
- injectCompilerOptionsCheck(app);
1675
- }
1676
- const { mount } = app;
1677
- app.mount = (containerOrSelector) => {
1678
- const container = normalizeContainer(containerOrSelector);
1679
- if (!container) return;
1680
- const component = app._component;
1681
- if (!shared.isFunction(component) && !component.render && !component.template) {
1682
- component.template = container.innerHTML;
1683
- }
1684
- if (container.nodeType === 1) {
1685
- container.textContent = "";
1686
- }
1687
- const proxy = mount(container, false, resolveRootNamespace(container));
1688
- if (container instanceof Element) {
1689
- container.removeAttribute("v-cloak");
1690
- container.setAttribute("data-v-app", "");
1691
- }
1692
- return proxy;
1693
- };
1694
- return app;
1695
- };
1696
- const createSSRApp = (...args) => {
1697
- const app = ensureHydrationRenderer().createApp(...args);
1698
- {
1699
- injectNativeTagCheck(app);
1700
- injectCompilerOptionsCheck(app);
1701
- }
1702
- const { mount } = app;
1703
- app.mount = (containerOrSelector) => {
1704
- const container = normalizeContainer(containerOrSelector);
1705
- if (container) {
1706
- return mount(container, true, resolveRootNamespace(container));
1707
- }
1708
- };
1709
- return app;
1710
- };
1711
- function resolveRootNamespace(container) {
1712
- if (container instanceof SVGElement) {
1713
- return "svg";
1714
- }
1715
- if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
1716
- return "mathml";
1717
- }
1718
- }
1719
- function injectNativeTagCheck(app) {
1720
- Object.defineProperty(app.config, "isNativeTag", {
1721
- value: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag),
1722
- writable: false
1723
- });
1724
- }
1725
- function injectCompilerOptionsCheck(app) {
1726
- if (runtimeCore.isRuntimeOnly()) {
1727
- const isCustomElement = app.config.isCustomElement;
1728
- Object.defineProperty(app.config, "isCustomElement", {
1729
- get() {
1730
- return isCustomElement;
1731
- },
1732
- set() {
1733
- runtimeCore.warn(
1734
- `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
1735
- );
1736
- }
1737
- });
1738
- const compilerOptions = app.config.compilerOptions;
1739
- const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
1740
- - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
1741
- - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
1742
- - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
1743
- Object.defineProperty(app.config, "compilerOptions", {
1744
- get() {
1745
- runtimeCore.warn(msg);
1746
- return compilerOptions;
1747
- },
1748
- set() {
1749
- runtimeCore.warn(msg);
1750
- }
1751
- });
1752
- }
1753
- }
1754
- function normalizeContainer(container) {
1755
- if (shared.isString(container)) {
1756
- const res = document.querySelector(container);
1757
- if (!res) {
1758
- runtimeCore.warn(
1759
- `Failed to mount app: mount target selector "${container}" returned null.`
1760
- );
1761
- }
1762
- return res;
1763
- }
1764
- if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
1765
- runtimeCore.warn(
1766
- `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
1767
- );
1768
- }
1769
- return container;
1770
- }
1771
- const initDirectivesForSSR = shared.NOOP;
1772
-
1773
- exports.Transition = Transition;
1774
- exports.TransitionGroup = TransitionGroup;
1775
- exports.VueElement = VueElement;
1776
- exports.createApp = createApp;
1777
- exports.createSSRApp = createSSRApp;
1778
- exports.defineCustomElement = defineCustomElement;
1779
- exports.defineSSRCustomElement = defineSSRCustomElement;
1780
- exports.hydrate = hydrate;
1781
- exports.initDirectivesForSSR = initDirectivesForSSR;
1782
- exports.render = render;
1783
- exports.useCssModule = useCssModule;
1784
- exports.useCssVars = useCssVars;
1785
- exports.useHost = useHost;
1786
- exports.useShadowRoot = useShadowRoot;
1787
- exports.vModelCheckbox = vModelCheckbox;
1788
- exports.vModelDynamic = vModelDynamic;
1789
- exports.vModelRadio = vModelRadio;
1790
- exports.vModelSelect = vModelSelect;
1791
- exports.vModelText = vModelText;
1792
- exports.vShow = vShow;
1793
- exports.withKeys = withKeys;
1794
- exports.withModifiers = withModifiers;
1795
- Object.keys(runtimeCore).forEach(function (k) {
1796
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = runtimeCore[k];
1797
- });