73 lines
2.7 KiB
JavaScript
73 lines
2.7 KiB
JavaScript
/**
|
|||
|
|
* vue v3.6.0-rc.10
|
||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
|
|
* @license MIT
|
||
|
|
**/
|
||
|
|
Object.defineProperties(exports, {
|
||
|
|
__esModule: { value: true },
|
||
|
|
[Symbol.toStringTag]: { value: "Module" }
|
||
|
|
});
|
||
|
|
//#region \0rolldown/runtime.js
|
||
|
|
var __create = Object.create;
|
||
|
|
var __defProp = Object.defineProperty;
|
||
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||
|
|
var __getProtoOf = Object.getPrototypeOf;
|
||
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||
|
|
var __copyProps = (to, from, except, desc) => {
|
||
|
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
||
|
|
key = keys[i];
|
||
|
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
||
|
|
get: ((k) => from[k]).bind(null, key),
|
||
|
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
||
|
|
});
|
||
|
|
}
|
||
|
|
return to;
|
||
|
|
};
|
||
|
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
||
|
|
value: mod,
|
||
|
|
enumerable: true
|
||
|
|
}) : target, mod));
|
||
|
|
//#endregion
|
||
|
|
let _vue_runtime_dom = require("@vue/runtime-dom");
|
||
|
|
_vue_runtime_dom = __toESM(_vue_runtime_dom);
|
||
|
|
let _vue_compiler_dom = require("@vue/compiler-dom");
|
||
|
|
let _vue_shared = require("@vue/shared");
|
||
|
|
//#region packages/vue/src/index.ts
|
||
|
|
const compileCache = Object.create(null);
|
||
|
|
function compileToFunction(template, options) {
|
||
|
|
if (!(0, _vue_shared.isString)(template)) {
|
||
|
|
if (template.nodeType) template = template.innerHTML;
|
||
|
|
else return _vue_shared.NOOP;
|
||
|
|
}
|
||
|
|
const key = (0, _vue_shared.genCacheKey)(template, options);
|
||
|
|
const cached = compileCache[key];
|
||
|
|
if (cached) return cached;
|
||
|
|
if (template[0] === "#") {
|
||
|
|
const el = document.querySelector(template);
|
||
|
|
template = el ? el.innerHTML : ``;
|
||
|
|
}
|
||
|
|
const opts = (0, _vue_shared.extend)({
|
||
|
|
hoistStatic: true,
|
||
|
|
onError: void 0,
|
||
|
|
onWarn: _vue_shared.NOOP
|
||
|
|
}, options);
|
||
|
|
if (!opts.isCustomElement && typeof customElements !== "undefined") opts.isCustomElement = (tag) => !!customElements.get(tag);
|
||
|
|
const { code } = (0, _vue_compiler_dom.compile)(template, opts);
|
||
|
|
const render = new Function("Vue", code)(_vue_runtime_dom);
|
||
|
|
render._rc = true;
|
||
|
|
return compileCache[key] = render;
|
||
|
|
}
|
||
|
|
(0, _vue_runtime_dom.registerRuntimeCompiler)(compileToFunction);
|
||
|
|
//#endregion
|
||
|
|
exports.compile = compileToFunction;
|
||
|
|
exports.defineVaporAsyncComponent = _vue_runtime_dom.defineAsyncComponent;
|
||
|
|
Object.keys(_vue_runtime_dom).forEach(function(k) {
|
||
|
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return _vue_runtime_dom[k];
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|