runtime-dom.esm-bundler.js 57 KB

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