runtime-dom.esm-bundler.js 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892
  1. /**
  2. * @vue/runtime-dom v3.5.22
  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(el);
  216. addTransitionClass(el, leaveActiveClass);
  217. } else {
  218. addTransitionClass(el, leaveActiveClass);
  219. forceReflow(el);
  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(el) {
  366. const targetDocument = el ? el.ownerDocument : document;
  367. return targetDocument.body.offsetHeight;
  368. }
  369. function patchClass(el, value, isSVG) {
  370. const transitionClasses = el[vtcKey];
  371. if (transitionClasses) {
  372. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  373. }
  374. if (value == null) {
  375. el.removeAttribute("class");
  376. } else if (isSVG) {
  377. el.setAttribute("class", value);
  378. } else {
  379. el.className = value;
  380. }
  381. }
  382. const vShowOriginalDisplay = Symbol("_vod");
  383. const vShowHidden = Symbol("_vsh");
  384. const vShow = {
  385. // used for prop mismatch check during hydration
  386. name: "show",
  387. beforeMount(el, { value }, { transition }) {
  388. el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
  389. if (transition && value) {
  390. transition.beforeEnter(el);
  391. } else {
  392. setDisplay(el, value);
  393. }
  394. },
  395. mounted(el, { value }, { transition }) {
  396. if (transition && value) {
  397. transition.enter(el);
  398. }
  399. },
  400. updated(el, { value, oldValue }, { transition }) {
  401. if (!value === !oldValue) return;
  402. if (transition) {
  403. if (value) {
  404. transition.beforeEnter(el);
  405. setDisplay(el, true);
  406. transition.enter(el);
  407. } else {
  408. transition.leave(el, () => {
  409. setDisplay(el, false);
  410. });
  411. }
  412. } else {
  413. setDisplay(el, value);
  414. }
  415. },
  416. beforeUnmount(el, { value }) {
  417. setDisplay(el, value);
  418. }
  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. function defineCustomElement(options, extraOptions, _createApp) {
  823. let Comp = defineComponent(options, extraOptions);
  824. if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
  825. class VueCustomElement extends VueElement {
  826. constructor(initialProps) {
  827. super(Comp, initialProps, _createApp);
  828. }
  829. }
  830. VueCustomElement.def = Comp;
  831. return VueCustomElement;
  832. }
  833. const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
  834. return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
  835. });
  836. const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
  837. };
  838. class VueElement extends BaseClass {
  839. constructor(_def, _props = {}, _createApp = createApp) {
  840. super();
  841. this._def = _def;
  842. this._props = _props;
  843. this._createApp = _createApp;
  844. this._isVueCE = true;
  845. /**
  846. * @internal
  847. */
  848. this._instance = null;
  849. /**
  850. * @internal
  851. */
  852. this._app = null;
  853. /**
  854. * @internal
  855. */
  856. this._nonce = this._def.nonce;
  857. this._connected = false;
  858. this._resolved = false;
  859. this._numberProps = null;
  860. this._styleChildren = /* @__PURE__ */ new WeakSet();
  861. this._ob = null;
  862. if (this.shadowRoot && _createApp !== createApp) {
  863. this._root = this.shadowRoot;
  864. } else {
  865. if (!!(process.env.NODE_ENV !== "production") && this.shadowRoot) {
  866. warn(
  867. `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
  868. );
  869. }
  870. if (_def.shadowRoot !== false) {
  871. this.attachShadow(
  872. extend({}, _def.shadowRootOptions, {
  873. mode: "open"
  874. })
  875. );
  876. this._root = this.shadowRoot;
  877. } else {
  878. this._root = this;
  879. }
  880. }
  881. }
  882. connectedCallback() {
  883. if (!this.isConnected) return;
  884. if (!this.shadowRoot && !this._resolved) {
  885. this._parseSlots();
  886. }
  887. this._connected = true;
  888. let parent = this;
  889. while (parent = parent && (parent.parentNode || parent.host)) {
  890. if (parent instanceof VueElement) {
  891. this._parent = parent;
  892. break;
  893. }
  894. }
  895. if (!this._instance) {
  896. if (this._resolved) {
  897. this._mount(this._def);
  898. } else {
  899. if (parent && parent._pendingResolve) {
  900. this._pendingResolve = parent._pendingResolve.then(() => {
  901. this._pendingResolve = void 0;
  902. this._resolveDef();
  903. });
  904. } else {
  905. this._resolveDef();
  906. }
  907. }
  908. }
  909. }
  910. _setParent(parent = this._parent) {
  911. if (parent) {
  912. this._instance.parent = parent._instance;
  913. this._inheritParentContext(parent);
  914. }
  915. }
  916. _inheritParentContext(parent = this._parent) {
  917. if (parent && this._app) {
  918. Object.setPrototypeOf(
  919. this._app._context.provides,
  920. parent._instance.provides
  921. );
  922. }
  923. }
  924. disconnectedCallback() {
  925. this._connected = false;
  926. nextTick(() => {
  927. if (!this._connected) {
  928. if (this._ob) {
  929. this._ob.disconnect();
  930. this._ob = null;
  931. }
  932. this._app && this._app.unmount();
  933. if (this._instance) this._instance.ce = void 0;
  934. this._app = this._instance = null;
  935. if (this._teleportTargets) {
  936. this._teleportTargets.clear();
  937. this._teleportTargets = void 0;
  938. }
  939. }
  940. });
  941. }
  942. _processMutations(mutations) {
  943. for (const m of mutations) {
  944. this._setAttr(m.attributeName);
  945. }
  946. }
  947. /**
  948. * resolve inner component definition (handle possible async component)
  949. */
  950. _resolveDef() {
  951. if (this._pendingResolve) {
  952. return;
  953. }
  954. for (let i = 0; i < this.attributes.length; i++) {
  955. this._setAttr(this.attributes[i].name);
  956. }
  957. this._ob = new MutationObserver(this._processMutations.bind(this));
  958. this._ob.observe(this, { attributes: true });
  959. const resolve = (def, isAsync = false) => {
  960. this._resolved = true;
  961. this._pendingResolve = void 0;
  962. const { props, styles } = def;
  963. let numberProps;
  964. if (props && !isArray(props)) {
  965. for (const key in props) {
  966. const opt = props[key];
  967. if (opt === Number || opt && opt.type === Number) {
  968. if (key in this._props) {
  969. this._props[key] = toNumber(this._props[key]);
  970. }
  971. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize$1(key)] = true;
  972. }
  973. }
  974. }
  975. this._numberProps = numberProps;
  976. this._resolveProps(def);
  977. if (this.shadowRoot) {
  978. this._applyStyles(styles);
  979. } else if (!!(process.env.NODE_ENV !== "production") && styles) {
  980. warn(
  981. "Custom element style injection is not supported when using shadowRoot: false"
  982. );
  983. }
  984. this._mount(def);
  985. };
  986. const asyncDef = this._def.__asyncLoader;
  987. if (asyncDef) {
  988. this._pendingResolve = asyncDef().then((def) => {
  989. def.configureApp = this._def.configureApp;
  990. resolve(this._def = def, true);
  991. });
  992. } else {
  993. resolve(this._def);
  994. }
  995. }
  996. _mount(def) {
  997. if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) && !def.name) {
  998. def.name = "VueElement";
  999. }
  1000. this._app = this._createApp(def);
  1001. this._inheritParentContext();
  1002. if (def.configureApp) {
  1003. def.configureApp(this._app);
  1004. }
  1005. this._app._ceVNode = this._createVNode();
  1006. this._app.mount(this._root);
  1007. const exposed = this._instance && this._instance.exposed;
  1008. if (!exposed) return;
  1009. for (const key in exposed) {
  1010. if (!hasOwn(this, key)) {
  1011. Object.defineProperty(this, key, {
  1012. // unwrap ref to be consistent with public instance behavior
  1013. get: () => unref(exposed[key])
  1014. });
  1015. } else if (!!(process.env.NODE_ENV !== "production")) {
  1016. warn(`Exposed property "${key}" already exists on custom element.`);
  1017. }
  1018. }
  1019. }
  1020. _resolveProps(def) {
  1021. const { props } = def;
  1022. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  1023. for (const key of Object.keys(this)) {
  1024. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  1025. this._setProp(key, this[key]);
  1026. }
  1027. }
  1028. for (const key of declaredPropKeys.map(camelize$1)) {
  1029. Object.defineProperty(this, key, {
  1030. get() {
  1031. return this._getProp(key);
  1032. },
  1033. set(val) {
  1034. this._setProp(key, val, true, true);
  1035. }
  1036. });
  1037. }
  1038. }
  1039. _setAttr(key) {
  1040. if (key.startsWith("data-v-")) return;
  1041. const has = this.hasAttribute(key);
  1042. let value = has ? this.getAttribute(key) : REMOVAL;
  1043. const camelKey = camelize$1(key);
  1044. if (has && this._numberProps && this._numberProps[camelKey]) {
  1045. value = toNumber(value);
  1046. }
  1047. this._setProp(camelKey, value, false, true);
  1048. }
  1049. /**
  1050. * @internal
  1051. */
  1052. _getProp(key) {
  1053. return this._props[key];
  1054. }
  1055. /**
  1056. * @internal
  1057. */
  1058. _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
  1059. if (val !== this._props[key]) {
  1060. if (val === REMOVAL) {
  1061. delete this._props[key];
  1062. } else {
  1063. this._props[key] = val;
  1064. if (key === "key" && this._app) {
  1065. this._app._ceVNode.key = val;
  1066. }
  1067. }
  1068. if (shouldUpdate && this._instance) {
  1069. this._update();
  1070. }
  1071. if (shouldReflect) {
  1072. const ob = this._ob;
  1073. if (ob) {
  1074. this._processMutations(ob.takeRecords());
  1075. ob.disconnect();
  1076. }
  1077. if (val === true) {
  1078. this.setAttribute(hyphenate(key), "");
  1079. } else if (typeof val === "string" || typeof val === "number") {
  1080. this.setAttribute(hyphenate(key), val + "");
  1081. } else if (!val) {
  1082. this.removeAttribute(hyphenate(key));
  1083. }
  1084. ob && ob.observe(this, { attributes: true });
  1085. }
  1086. }
  1087. }
  1088. _update() {
  1089. const vnode = this._createVNode();
  1090. if (this._app) vnode.appContext = this._app._context;
  1091. render(vnode, this._root);
  1092. }
  1093. _createVNode() {
  1094. const baseProps = {};
  1095. if (!this.shadowRoot) {
  1096. baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
  1097. }
  1098. const vnode = createVNode(this._def, extend(baseProps, this._props));
  1099. if (!this._instance) {
  1100. vnode.ce = (instance) => {
  1101. this._instance = instance;
  1102. instance.ce = this;
  1103. instance.isCE = true;
  1104. if (!!(process.env.NODE_ENV !== "production")) {
  1105. instance.ceReload = (newStyles) => {
  1106. if (this._styles) {
  1107. this._styles.forEach((s) => this._root.removeChild(s));
  1108. this._styles.length = 0;
  1109. }
  1110. this._applyStyles(newStyles);
  1111. this._instance = null;
  1112. this._update();
  1113. };
  1114. }
  1115. const dispatch = (event, args) => {
  1116. this.dispatchEvent(
  1117. new CustomEvent(
  1118. event,
  1119. isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
  1120. )
  1121. );
  1122. };
  1123. instance.emit = (event, ...args) => {
  1124. dispatch(event, args);
  1125. if (hyphenate(event) !== event) {
  1126. dispatch(hyphenate(event), args);
  1127. }
  1128. };
  1129. this._setParent();
  1130. };
  1131. }
  1132. return vnode;
  1133. }
  1134. _applyStyles(styles, owner) {
  1135. if (!styles) return;
  1136. if (owner) {
  1137. if (owner === this._def || this._styleChildren.has(owner)) {
  1138. return;
  1139. }
  1140. this._styleChildren.add(owner);
  1141. }
  1142. const nonce = this._nonce;
  1143. for (let i = styles.length - 1; i >= 0; i--) {
  1144. const s = document.createElement("style");
  1145. if (nonce) s.setAttribute("nonce", nonce);
  1146. s.textContent = styles[i];
  1147. this.shadowRoot.prepend(s);
  1148. if (!!(process.env.NODE_ENV !== "production")) {
  1149. if (owner) {
  1150. if (owner.__hmrId) {
  1151. if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
  1152. let entry = this._childStyles.get(owner.__hmrId);
  1153. if (!entry) {
  1154. this._childStyles.set(owner.__hmrId, entry = []);
  1155. }
  1156. entry.push(s);
  1157. }
  1158. } else {
  1159. (this._styles || (this._styles = [])).push(s);
  1160. }
  1161. }
  1162. }
  1163. }
  1164. /**
  1165. * Only called when shadowRoot is false
  1166. */
  1167. _parseSlots() {
  1168. const slots = this._slots = {};
  1169. let n;
  1170. while (n = this.firstChild) {
  1171. const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
  1172. (slots[slotName] || (slots[slotName] = [])).push(n);
  1173. this.removeChild(n);
  1174. }
  1175. }
  1176. /**
  1177. * Only called when shadowRoot is false
  1178. */
  1179. _renderSlots() {
  1180. const outlets = this._getSlots();
  1181. const scopeId = this._instance.type.__scopeId;
  1182. for (let i = 0; i < outlets.length; i++) {
  1183. const o = outlets[i];
  1184. const slotName = o.getAttribute("name") || "default";
  1185. const content = this._slots[slotName];
  1186. const parent = o.parentNode;
  1187. if (content) {
  1188. for (const n of content) {
  1189. if (scopeId && n.nodeType === 1) {
  1190. const id = scopeId + "-s";
  1191. const walker = document.createTreeWalker(n, 1);
  1192. n.setAttribute(id, "");
  1193. let child;
  1194. while (child = walker.nextNode()) {
  1195. child.setAttribute(id, "");
  1196. }
  1197. }
  1198. parent.insertBefore(n, o);
  1199. }
  1200. } else {
  1201. while (o.firstChild) parent.insertBefore(o.firstChild, o);
  1202. }
  1203. parent.removeChild(o);
  1204. }
  1205. }
  1206. /**
  1207. * @internal
  1208. */
  1209. _getSlots() {
  1210. const roots = [this];
  1211. if (this._teleportTargets) {
  1212. roots.push(...this._teleportTargets);
  1213. }
  1214. return roots.reduce((res, i) => {
  1215. res.push(...Array.from(i.querySelectorAll("slot")));
  1216. return res;
  1217. }, []);
  1218. }
  1219. /**
  1220. * @internal
  1221. */
  1222. _injectChildStyle(comp) {
  1223. this._applyStyles(comp.styles, comp);
  1224. }
  1225. /**
  1226. * @internal
  1227. */
  1228. _removeChildStyle(comp) {
  1229. if (!!(process.env.NODE_ENV !== "production")) {
  1230. this._styleChildren.delete(comp);
  1231. if (this._childStyles && comp.__hmrId) {
  1232. const oldStyles = this._childStyles.get(comp.__hmrId);
  1233. if (oldStyles) {
  1234. oldStyles.forEach((s) => this._root.removeChild(s));
  1235. oldStyles.length = 0;
  1236. }
  1237. }
  1238. }
  1239. }
  1240. }
  1241. function useHost(caller) {
  1242. const instance = getCurrentInstance();
  1243. const el = instance && instance.ce;
  1244. if (el) {
  1245. return el;
  1246. } else if (!!(process.env.NODE_ENV !== "production")) {
  1247. if (!instance) {
  1248. warn(
  1249. `${caller || "useHost"} called without an active component instance.`
  1250. );
  1251. } else {
  1252. warn(
  1253. `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
  1254. );
  1255. }
  1256. }
  1257. return null;
  1258. }
  1259. function useShadowRoot() {
  1260. const el = !!(process.env.NODE_ENV !== "production") ? useHost("useShadowRoot") : useHost();
  1261. return el && el.shadowRoot;
  1262. }
  1263. function useCssModule(name = "$style") {
  1264. {
  1265. const instance = getCurrentInstance();
  1266. if (!instance) {
  1267. !!(process.env.NODE_ENV !== "production") && warn(`useCssModule must be called inside setup()`);
  1268. return EMPTY_OBJ;
  1269. }
  1270. const modules = instance.type.__cssModules;
  1271. if (!modules) {
  1272. !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS modules injected.`);
  1273. return EMPTY_OBJ;
  1274. }
  1275. const mod = modules[name];
  1276. if (!mod) {
  1277. !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS module named "${name}".`);
  1278. return EMPTY_OBJ;
  1279. }
  1280. return mod;
  1281. }
  1282. }
  1283. const positionMap = /* @__PURE__ */ new WeakMap();
  1284. const newPositionMap = /* @__PURE__ */ new WeakMap();
  1285. const moveCbKey = Symbol("_moveCb");
  1286. const enterCbKey = Symbol("_enterCb");
  1287. const decorate = (t) => {
  1288. delete t.props.mode;
  1289. return t;
  1290. };
  1291. const TransitionGroupImpl = /* @__PURE__ */ decorate({
  1292. name: "TransitionGroup",
  1293. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  1294. tag: String,
  1295. moveClass: String
  1296. }),
  1297. setup(props, { slots }) {
  1298. const instance = getCurrentInstance();
  1299. const state = useTransitionState();
  1300. let prevChildren;
  1301. let children;
  1302. onUpdated(() => {
  1303. if (!prevChildren.length) {
  1304. return;
  1305. }
  1306. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  1307. if (!hasCSSTransform(
  1308. prevChildren[0].el,
  1309. instance.vnode.el,
  1310. moveClass
  1311. )) {
  1312. prevChildren = [];
  1313. return;
  1314. }
  1315. prevChildren.forEach(callPendingCbs);
  1316. prevChildren.forEach(recordPosition);
  1317. const movedChildren = prevChildren.filter(applyTranslation);
  1318. forceReflow(instance.vnode.el);
  1319. movedChildren.forEach((c) => {
  1320. const el = c.el;
  1321. const style = el.style;
  1322. addTransitionClass(el, moveClass);
  1323. style.transform = style.webkitTransform = style.transitionDuration = "";
  1324. const cb = el[moveCbKey] = (e) => {
  1325. if (e && e.target !== el) {
  1326. return;
  1327. }
  1328. if (!e || e.propertyName.endsWith("transform")) {
  1329. el.removeEventListener("transitionend", cb);
  1330. el[moveCbKey] = null;
  1331. removeTransitionClass(el, moveClass);
  1332. }
  1333. };
  1334. el.addEventListener("transitionend", cb);
  1335. });
  1336. prevChildren = [];
  1337. });
  1338. return () => {
  1339. const rawProps = toRaw(props);
  1340. const cssTransitionProps = resolveTransitionProps(rawProps);
  1341. let tag = rawProps.tag || Fragment;
  1342. prevChildren = [];
  1343. if (children) {
  1344. for (let i = 0; i < children.length; i++) {
  1345. const child = children[i];
  1346. if (child.el && child.el instanceof Element) {
  1347. prevChildren.push(child);
  1348. setTransitionHooks(
  1349. child,
  1350. resolveTransitionHooks(
  1351. child,
  1352. cssTransitionProps,
  1353. state,
  1354. instance
  1355. )
  1356. );
  1357. positionMap.set(
  1358. child,
  1359. child.el.getBoundingClientRect()
  1360. );
  1361. }
  1362. }
  1363. }
  1364. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  1365. for (let i = 0; i < children.length; i++) {
  1366. const child = children[i];
  1367. if (child.key != null) {
  1368. setTransitionHooks(
  1369. child,
  1370. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  1371. );
  1372. } else if (!!(process.env.NODE_ENV !== "production") && child.type !== Text) {
  1373. warn(`<TransitionGroup> children must be keyed.`);
  1374. }
  1375. }
  1376. return createVNode(tag, null, children);
  1377. };
  1378. }
  1379. });
  1380. const TransitionGroup = TransitionGroupImpl;
  1381. function callPendingCbs(c) {
  1382. const el = c.el;
  1383. if (el[moveCbKey]) {
  1384. el[moveCbKey]();
  1385. }
  1386. if (el[enterCbKey]) {
  1387. el[enterCbKey]();
  1388. }
  1389. }
  1390. function recordPosition(c) {
  1391. newPositionMap.set(c, c.el.getBoundingClientRect());
  1392. }
  1393. function applyTranslation(c) {
  1394. const oldPos = positionMap.get(c);
  1395. const newPos = newPositionMap.get(c);
  1396. const dx = oldPos.left - newPos.left;
  1397. const dy = oldPos.top - newPos.top;
  1398. if (dx || dy) {
  1399. const s = c.el.style;
  1400. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  1401. s.transitionDuration = "0s";
  1402. return c;
  1403. }
  1404. }
  1405. function hasCSSTransform(el, root, moveClass) {
  1406. const clone = el.cloneNode();
  1407. const _vtc = el[vtcKey];
  1408. if (_vtc) {
  1409. _vtc.forEach((cls) => {
  1410. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  1411. });
  1412. }
  1413. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  1414. clone.style.display = "none";
  1415. const container = root.nodeType === 1 ? root : root.parentNode;
  1416. container.appendChild(clone);
  1417. const { hasTransform } = getTransitionInfo(clone);
  1418. container.removeChild(clone);
  1419. return hasTransform;
  1420. }
  1421. const getModelAssigner = (vnode) => {
  1422. const fn = vnode.props["onUpdate:modelValue"] || false;
  1423. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  1424. };
  1425. function onCompositionStart(e) {
  1426. e.target.composing = true;
  1427. }
  1428. function onCompositionEnd(e) {
  1429. const target = e.target;
  1430. if (target.composing) {
  1431. target.composing = false;
  1432. target.dispatchEvent(new Event("input"));
  1433. }
  1434. }
  1435. const assignKey = Symbol("_assign");
  1436. const vModelText = {
  1437. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  1438. el[assignKey] = getModelAssigner(vnode);
  1439. const castToNumber = number || vnode.props && vnode.props.type === "number";
  1440. addEventListener(el, lazy ? "change" : "input", (e) => {
  1441. if (e.target.composing) return;
  1442. let domValue = el.value;
  1443. if (trim) {
  1444. domValue = domValue.trim();
  1445. }
  1446. if (castToNumber) {
  1447. domValue = looseToNumber(domValue);
  1448. }
  1449. el[assignKey](domValue);
  1450. });
  1451. if (trim) {
  1452. addEventListener(el, "change", () => {
  1453. el.value = el.value.trim();
  1454. });
  1455. }
  1456. if (!lazy) {
  1457. addEventListener(el, "compositionstart", onCompositionStart);
  1458. addEventListener(el, "compositionend", onCompositionEnd);
  1459. addEventListener(el, "change", onCompositionEnd);
  1460. }
  1461. },
  1462. // set value on mounted so it's after min/max for type="range"
  1463. mounted(el, { value }) {
  1464. el.value = value == null ? "" : value;
  1465. },
  1466. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  1467. el[assignKey] = getModelAssigner(vnode);
  1468. if (el.composing) return;
  1469. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  1470. const newValue = value == null ? "" : value;
  1471. if (elValue === newValue) {
  1472. return;
  1473. }
  1474. if (document.activeElement === el && el.type !== "range") {
  1475. if (lazy && value === oldValue) {
  1476. return;
  1477. }
  1478. if (trim && el.value.trim() === newValue) {
  1479. return;
  1480. }
  1481. }
  1482. el.value = newValue;
  1483. }
  1484. };
  1485. const vModelCheckbox = {
  1486. // #4096 array checkboxes need to be deep traversed
  1487. deep: true,
  1488. created(el, _, vnode) {
  1489. el[assignKey] = getModelAssigner(vnode);
  1490. addEventListener(el, "change", () => {
  1491. const modelValue = el._modelValue;
  1492. const elementValue = getValue(el);
  1493. const checked = el.checked;
  1494. const assign = el[assignKey];
  1495. if (isArray(modelValue)) {
  1496. const index = looseIndexOf(modelValue, elementValue);
  1497. const found = index !== -1;
  1498. if (checked && !found) {
  1499. assign(modelValue.concat(elementValue));
  1500. } else if (!checked && found) {
  1501. const filtered = [...modelValue];
  1502. filtered.splice(index, 1);
  1503. assign(filtered);
  1504. }
  1505. } else if (isSet(modelValue)) {
  1506. const cloned = new Set(modelValue);
  1507. if (checked) {
  1508. cloned.add(elementValue);
  1509. } else {
  1510. cloned.delete(elementValue);
  1511. }
  1512. assign(cloned);
  1513. } else {
  1514. assign(getCheckboxValue(el, checked));
  1515. }
  1516. });
  1517. },
  1518. // set initial checked on mount to wait for true-value/false-value
  1519. mounted: setChecked,
  1520. beforeUpdate(el, binding, vnode) {
  1521. el[assignKey] = getModelAssigner(vnode);
  1522. setChecked(el, binding, vnode);
  1523. }
  1524. };
  1525. function setChecked(el, { value, oldValue }, vnode) {
  1526. el._modelValue = value;
  1527. let checked;
  1528. if (isArray(value)) {
  1529. checked = looseIndexOf(value, vnode.props.value) > -1;
  1530. } else if (isSet(value)) {
  1531. checked = value.has(vnode.props.value);
  1532. } else {
  1533. if (value === oldValue) return;
  1534. checked = looseEqual(value, getCheckboxValue(el, true));
  1535. }
  1536. if (el.checked !== checked) {
  1537. el.checked = checked;
  1538. }
  1539. }
  1540. const vModelRadio = {
  1541. created(el, { value }, vnode) {
  1542. el.checked = looseEqual(value, vnode.props.value);
  1543. el[assignKey] = getModelAssigner(vnode);
  1544. addEventListener(el, "change", () => {
  1545. el[assignKey](getValue(el));
  1546. });
  1547. },
  1548. beforeUpdate(el, { value, oldValue }, vnode) {
  1549. el[assignKey] = getModelAssigner(vnode);
  1550. if (value !== oldValue) {
  1551. el.checked = looseEqual(value, vnode.props.value);
  1552. }
  1553. }
  1554. };
  1555. const vModelSelect = {
  1556. // <select multiple> value need to be deep traversed
  1557. deep: true,
  1558. created(el, { value, modifiers: { number } }, vnode) {
  1559. const isSetModel = isSet(value);
  1560. addEventListener(el, "change", () => {
  1561. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  1562. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  1563. );
  1564. el[assignKey](
  1565. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  1566. );
  1567. el._assigning = true;
  1568. nextTick(() => {
  1569. el._assigning = false;
  1570. });
  1571. });
  1572. el[assignKey] = getModelAssigner(vnode);
  1573. },
  1574. // set value in mounted & updated because <select> relies on its children
  1575. // <option>s.
  1576. mounted(el, { value }) {
  1577. setSelected(el, value);
  1578. },
  1579. beforeUpdate(el, _binding, vnode) {
  1580. el[assignKey] = getModelAssigner(vnode);
  1581. },
  1582. updated(el, { value }) {
  1583. if (!el._assigning) {
  1584. setSelected(el, value);
  1585. }
  1586. }
  1587. };
  1588. function setSelected(el, value) {
  1589. const isMultiple = el.multiple;
  1590. const isArrayValue = isArray(value);
  1591. if (isMultiple && !isArrayValue && !isSet(value)) {
  1592. !!(process.env.NODE_ENV !== "production") && warn(
  1593. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  1594. );
  1595. return;
  1596. }
  1597. for (let i = 0, l = el.options.length; i < l; i++) {
  1598. const option = el.options[i];
  1599. const optionValue = getValue(option);
  1600. if (isMultiple) {
  1601. if (isArrayValue) {
  1602. const optionType = typeof optionValue;
  1603. if (optionType === "string" || optionType === "number") {
  1604. option.selected = value.some((v) => String(v) === String(optionValue));
  1605. } else {
  1606. option.selected = looseIndexOf(value, optionValue) > -1;
  1607. }
  1608. } else {
  1609. option.selected = value.has(optionValue);
  1610. }
  1611. } else if (looseEqual(getValue(option), value)) {
  1612. if (el.selectedIndex !== i) el.selectedIndex = i;
  1613. return;
  1614. }
  1615. }
  1616. if (!isMultiple && el.selectedIndex !== -1) {
  1617. el.selectedIndex = -1;
  1618. }
  1619. }
  1620. function getValue(el) {
  1621. return "_value" in el ? el._value : el.value;
  1622. }
  1623. function getCheckboxValue(el, checked) {
  1624. const key = checked ? "_trueValue" : "_falseValue";
  1625. return key in el ? el[key] : checked;
  1626. }
  1627. const vModelDynamic = {
  1628. created(el, binding, vnode) {
  1629. callModelHook(el, binding, vnode, null, "created");
  1630. },
  1631. mounted(el, binding, vnode) {
  1632. callModelHook(el, binding, vnode, null, "mounted");
  1633. },
  1634. beforeUpdate(el, binding, vnode, prevVNode) {
  1635. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  1636. },
  1637. updated(el, binding, vnode, prevVNode) {
  1638. callModelHook(el, binding, vnode, prevVNode, "updated");
  1639. }
  1640. };
  1641. function resolveDynamicModel(tagName, type) {
  1642. switch (tagName) {
  1643. case "SELECT":
  1644. return vModelSelect;
  1645. case "TEXTAREA":
  1646. return vModelText;
  1647. default:
  1648. switch (type) {
  1649. case "checkbox":
  1650. return vModelCheckbox;
  1651. case "radio":
  1652. return vModelRadio;
  1653. default:
  1654. return vModelText;
  1655. }
  1656. }
  1657. }
  1658. function callModelHook(el, binding, vnode, prevVNode, hook) {
  1659. const modelToUse = resolveDynamicModel(
  1660. el.tagName,
  1661. vnode.props && vnode.props.type
  1662. );
  1663. const fn = modelToUse[hook];
  1664. fn && fn(el, binding, vnode, prevVNode);
  1665. }
  1666. function initVModelForSSR() {
  1667. vModelText.getSSRProps = ({ value }) => ({ value });
  1668. vModelRadio.getSSRProps = ({ value }, vnode) => {
  1669. if (vnode.props && looseEqual(vnode.props.value, value)) {
  1670. return { checked: true };
  1671. }
  1672. };
  1673. vModelCheckbox.getSSRProps = ({ value }, vnode) => {
  1674. if (isArray(value)) {
  1675. if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) {
  1676. return { checked: true };
  1677. }
  1678. } else if (isSet(value)) {
  1679. if (vnode.props && value.has(vnode.props.value)) {
  1680. return { checked: true };
  1681. }
  1682. } else if (value) {
  1683. return { checked: true };
  1684. }
  1685. };
  1686. vModelDynamic.getSSRProps = (binding, vnode) => {
  1687. if (typeof vnode.type !== "string") {
  1688. return;
  1689. }
  1690. const modelToUse = resolveDynamicModel(
  1691. // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
  1692. vnode.type.toUpperCase(),
  1693. vnode.props && vnode.props.type
  1694. );
  1695. if (modelToUse.getSSRProps) {
  1696. return modelToUse.getSSRProps(binding, vnode);
  1697. }
  1698. };
  1699. }
  1700. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  1701. const modifierGuards = {
  1702. stop: (e) => e.stopPropagation(),
  1703. prevent: (e) => e.preventDefault(),
  1704. self: (e) => e.target !== e.currentTarget,
  1705. ctrl: (e) => !e.ctrlKey,
  1706. shift: (e) => !e.shiftKey,
  1707. alt: (e) => !e.altKey,
  1708. meta: (e) => !e.metaKey,
  1709. left: (e) => "button" in e && e.button !== 0,
  1710. middle: (e) => "button" in e && e.button !== 1,
  1711. right: (e) => "button" in e && e.button !== 2,
  1712. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  1713. };
  1714. const withModifiers = (fn, modifiers) => {
  1715. const cache = fn._withMods || (fn._withMods = {});
  1716. const cacheKey = modifiers.join(".");
  1717. return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
  1718. for (let i = 0; i < modifiers.length; i++) {
  1719. const guard = modifierGuards[modifiers[i]];
  1720. if (guard && guard(event, modifiers)) return;
  1721. }
  1722. return fn(event, ...args);
  1723. }));
  1724. };
  1725. const keyNames = {
  1726. esc: "escape",
  1727. space: " ",
  1728. up: "arrow-up",
  1729. left: "arrow-left",
  1730. right: "arrow-right",
  1731. down: "arrow-down",
  1732. delete: "backspace"
  1733. };
  1734. const withKeys = (fn, modifiers) => {
  1735. const cache = fn._withKeys || (fn._withKeys = {});
  1736. const cacheKey = modifiers.join(".");
  1737. return cache[cacheKey] || (cache[cacheKey] = ((event) => {
  1738. if (!("key" in event)) {
  1739. return;
  1740. }
  1741. const eventKey = hyphenate(event.key);
  1742. if (modifiers.some(
  1743. (k) => k === eventKey || keyNames[k] === eventKey
  1744. )) {
  1745. return fn(event);
  1746. }
  1747. }));
  1748. };
  1749. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  1750. let renderer;
  1751. let enabledHydration = false;
  1752. function ensureRenderer() {
  1753. return renderer || (renderer = createRenderer(rendererOptions));
  1754. }
  1755. function ensureHydrationRenderer() {
  1756. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  1757. enabledHydration = true;
  1758. return renderer;
  1759. }
  1760. const render = ((...args) => {
  1761. ensureRenderer().render(...args);
  1762. });
  1763. const hydrate = ((...args) => {
  1764. ensureHydrationRenderer().hydrate(...args);
  1765. });
  1766. const createApp = ((...args) => {
  1767. const app = ensureRenderer().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) return;
  1776. const component = app._component;
  1777. if (!isFunction(component) && !component.render && !component.template) {
  1778. component.template = container.innerHTML;
  1779. }
  1780. if (container.nodeType === 1) {
  1781. container.textContent = "";
  1782. }
  1783. const proxy = mount(container, false, resolveRootNamespace(container));
  1784. if (container instanceof Element) {
  1785. container.removeAttribute("v-cloak");
  1786. container.setAttribute("data-v-app", "");
  1787. }
  1788. return proxy;
  1789. };
  1790. return app;
  1791. });
  1792. const createSSRApp = ((...args) => {
  1793. const app = ensureHydrationRenderer().createApp(...args);
  1794. if (!!(process.env.NODE_ENV !== "production")) {
  1795. injectNativeTagCheck(app);
  1796. injectCompilerOptionsCheck(app);
  1797. }
  1798. const { mount } = app;
  1799. app.mount = (containerOrSelector) => {
  1800. const container = normalizeContainer(containerOrSelector);
  1801. if (container) {
  1802. return mount(container, true, resolveRootNamespace(container));
  1803. }
  1804. };
  1805. return app;
  1806. });
  1807. function resolveRootNamespace(container) {
  1808. if (container instanceof SVGElement) {
  1809. return "svg";
  1810. }
  1811. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  1812. return "mathml";
  1813. }
  1814. }
  1815. function injectNativeTagCheck(app) {
  1816. Object.defineProperty(app.config, "isNativeTag", {
  1817. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  1818. writable: false
  1819. });
  1820. }
  1821. function injectCompilerOptionsCheck(app) {
  1822. if (isRuntimeOnly()) {
  1823. const isCustomElement = app.config.isCustomElement;
  1824. Object.defineProperty(app.config, "isCustomElement", {
  1825. get() {
  1826. return isCustomElement;
  1827. },
  1828. set() {
  1829. warn(
  1830. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  1831. );
  1832. }
  1833. });
  1834. const compilerOptions = app.config.compilerOptions;
  1835. 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.
  1836. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  1837. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  1838. - 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`;
  1839. Object.defineProperty(app.config, "compilerOptions", {
  1840. get() {
  1841. warn(msg);
  1842. return compilerOptions;
  1843. },
  1844. set() {
  1845. warn(msg);
  1846. }
  1847. });
  1848. }
  1849. }
  1850. function normalizeContainer(container) {
  1851. if (isString(container)) {
  1852. const res = document.querySelector(container);
  1853. if (!!(process.env.NODE_ENV !== "production") && !res) {
  1854. warn(
  1855. `Failed to mount app: mount target selector "${container}" returned null.`
  1856. );
  1857. }
  1858. return res;
  1859. }
  1860. if (!!(process.env.NODE_ENV !== "production") && window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  1861. warn(
  1862. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  1863. );
  1864. }
  1865. return container;
  1866. }
  1867. let ssrDirectiveInitialized = false;
  1868. const initDirectivesForSSR = () => {
  1869. if (!ssrDirectiveInitialized) {
  1870. ssrDirectiveInitialized = true;
  1871. initVModelForSSR();
  1872. initVShowForSSR();
  1873. }
  1874. } ;
  1875. export { Transition, TransitionGroup, VueElement, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, hydrate, initDirectivesForSSR, render, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, withKeys, withModifiers };