智慧水务管理系统 - 精河县供水工程综合管理平台

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