051459d08557eafac37ddff8db438116723e433bdf4e4e27574a8cb804db1339551bb0036b2e46b72239282b3737170092263382f20b1aba664ca8f072f7f7 57 KB

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