diff --git a/.prettierrc b/.prettierrc
index d43e959..4316bb4 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,5 +1,5 @@
{
- "printWidth": 200,
+ "printWidth": 300,
"semi": true,
"singleQuote": false,
"tabWidth": 2
diff --git a/package.json b/package.json
index a77aae4..653905f 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "soma3",
"version": "0.0.1",
"scripts": {
- "serve": "esr --serve src/index.ts",
+ "serve": "esr --serve src/demo.ts",
"build": "esr --build src/index.ts",
"build:watch": "esr --build --watch src/index.ts",
"run": "esr --run src/index.ts",
diff --git a/public/demo.js b/public/demo.js
new file mode 100755
index 0000000..9944b60
--- /dev/null
+++ b/public/demo.js
@@ -0,0 +1,1285 @@
+// src/util.ts
+function stringToElement(template) {
+ const parser = new DOMParser();
+ const doc = parser.parseFromString(template, "text/html");
+ return doc.body.firstChild;
+}
+var isText = (node) => {
+ return node.nodeType === Node.TEXT_NODE;
+};
+var isTemplate = (node) => {
+ return node.nodeName === "TEMPLATE";
+};
+var isElement = (node) => {
+ return node.nodeType === Node.ELEMENT_NODE;
+};
+function isObject(value) {
+ return value !== null && typeof value === "object";
+}
+function isArray(value) {
+ return Array.isArray(value);
+}
+function checkAndRemoveAttribute(el, attrName) {
+ const attributeValue = el.getAttribute(attrName);
+ if (attributeValue !== null) {
+ el.removeAttribute(attrName);
+ }
+ return attributeValue;
+}
+function findSlotNodes(element) {
+ const slots = [];
+ const findSlots = (node) => {
+ Array.from(node.childNodes).forEach((node2) => {
+ if (isElement(node2)) {
+ if (node2.nodeName === "SLOT") {
+ slots.push({ node: node2, name: node2.getAttribute("name") || "default" });
+ }
+ if (node2.hasChildNodes()) {
+ findSlots(node2);
+ }
+ }
+ });
+ };
+ findSlots(element);
+ return slots;
+}
+function findTemplateNodes(element) {
+ const templates = [];
+ const findTemplates = (element2) => {
+ let defaultContentNodes = [];
+ Array.from(element2.childNodes).forEach((node) => {
+ if (isElement(node) || isText(node)) {
+ if (isElement(node) && node.nodeName === "TEMPLATE" && isTemplate(node)) {
+ templates.push({ targetSlotName: node.getAttribute("slot") || "", node });
+ } else {
+ defaultContentNodes.push(node);
+ }
+ }
+ });
+ if (defaultContentNodes.length > 0) {
+ const defaultTemplate = document.createElement("template");
+ defaultTemplate.setAttribute("slot", "default");
+ defaultContentNodes.forEach((node) => {
+ defaultTemplate.content.appendChild(node);
+ });
+ templates.push({ targetSlotName: "default", node: defaultTemplate });
+ }
+ };
+ findTemplates(element);
+ return templates;
+}
+var nextTick = async (f) => {
+ await new Promise(
+ (r) => setTimeout(
+ (_) => requestAnimationFrame((_2) => {
+ f && f();
+ r();
+ })
+ )
+ );
+};
+function html(strings, ...values) {
+ const selfClosingTags = ["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"];
+ let result = strings.reduce((acc, str, i) => acc + str + (values[i] || ""), "");
+ result = result.replace(/<([a-zA-Z][^\s/>]*)\s*([^>]*?)\/>/g, (match, tagName, attributes) => {
+ if (selfClosingTags.includes(tagName.toLowerCase())) {
+ return match;
+ }
+ return `<${tagName} ${attributes}>${tagName}>`;
+ });
+ return result;
+}
+function toDisplayString(value) {
+ return value == null ? "" : isObject(value) ? JSON.stringify(value, null, 2) : String(value);
+}
+function insertAfter(newNode, existingNode) {
+ if (existingNode.nextSibling) {
+ existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);
+ } else {
+ existingNode?.parentNode?.appendChild(newNode);
+ }
+}
+function isPropAttribute(attrName) {
+ if (attrName.startsWith(".")) {
+ return true;
+ }
+ if (attrName.startsWith("{") && attrName.endsWith("}")) {
+ return true;
+ }
+ return false;
+}
+function isSpreadProp(attr) {
+ return attr.startsWith("...");
+}
+function isMirrorProp(attr) {
+ return attr.startsWith("{") && attr.endsWith("}");
+}
+function isRegularProp(attr) {
+ return attr.startsWith(".");
+}
+function isEventAttribute(attrName) {
+ return attrName.startsWith("@");
+}
+function componentHasPropByName(name, component) {
+ return Object.keys(component?.props ?? {}).some((prop) => prop === name);
+}
+function extractAttributeName(attrName) {
+ return attrName.replace(/^\.\.\./, "").replace(/^\./, "").replace(/^{/, "").replace(/}$/, "").replace(/:bind$/, "");
+}
+function dashToCamel(str) {
+ return str.toLowerCase().replace(/-([a-z])/g, (g) => g[1].toUpperCase());
+}
+function extractPropName(attrName) {
+ return dashToCamel(extractAttributeName(attrName));
+}
+function classNames(_) {
+ const classes = [];
+ for (let i = 0; i < arguments.length; i++) {
+ const arg = arguments[i];
+ if (!arg) continue;
+ const argType = typeof arg;
+ if (argType === "string" || argType === "number") {
+ classes.push(arg);
+ } else if (Array.isArray(arg)) {
+ if (arg.length) {
+ const inner = classNames.apply(null, arg);
+ if (inner) {
+ classes.push(inner);
+ }
+ }
+ } else if (argType === "object") {
+ if (arg.toString === Object.prototype.toString) {
+ for (let key in arg) {
+ if (Object.hasOwnProperty.call(arg, key) && arg[key]) {
+ classes.push(key);
+ }
+ }
+ } else {
+ classes.push(arg.toString());
+ }
+ }
+ }
+ return classes.join(" ");
+}
+
+// src/directives/attribute.ts
+var AttributeDirective = class {
+ element;
+ context;
+ expression;
+ attr;
+ extractedAttributeName;
+ previousClasses = [];
+ previousStyles = {};
+ is = {
+ sameNameProperty: false,
+ bound: false,
+ spread: false,
+ componentProp: false
+ };
+ constructor({ element, context, attr }) {
+ this.element = element;
+ this.context = context;
+ this.expression = attr.value;
+ this.attr = attr;
+ this.extractedAttributeName = extractAttributeName(attr.name);
+ this.is = {
+ sameNameProperty: attr.name.startsWith("{") && attr.name.endsWith("}"),
+ bound: attr.name.includes(":bind"),
+ spread: attr.name.startsWith("..."),
+ componentProp: false
+ };
+ if (this.is.sameNameProperty) {
+ this.expression = this.extractedAttributeName;
+ }
+ if (this.is.spread) {
+ this.expression = this.extractedAttributeName;
+ }
+ element.removeAttribute(attr.name);
+ if (this.is.bound) {
+ context.effect(this.update.bind(this));
+ } else {
+ this.update();
+ }
+ }
+ update() {
+ let value = evalGet(this.context.scope, this.expression);
+ if (this.is.spread && typeof value === "object") {
+ for (const [key, val] of Object.entries(value)) {
+ this.element.setAttribute(key, String(val));
+ }
+ } else if ((typeof value === "object" || Array.isArray(value)) && this.extractedAttributeName === "class") {
+ value = classNames(value);
+ const next = value.split(" ");
+ const diff = next.filter((c) => !this.previousClasses.includes(c)).filter(Boolean);
+ const rm = this.previousClasses.filter((c) => !next.includes(c));
+ diff.forEach((c) => {
+ this.previousClasses.push(c);
+ this.element.classList.add(c);
+ });
+ rm.forEach((c) => {
+ this.previousClasses = this.previousClasses.filter((addedClass) => addedClass !== c);
+ this.element.classList.remove(c);
+ });
+ } else if (typeof value === "object" && this.extractedAttributeName === "style") {
+ console.log("value is object", value);
+ const next = Object.keys(value);
+ const rm = Object.keys(this.previousStyles).filter((style) => !next.includes(style));
+ next.forEach((style) => {
+ this.previousStyles[style] = value[style];
+ this.element.style[style] = value[style];
+ });
+ rm.forEach((style) => {
+ this.previousStyles[style] = "";
+ this.element.style[style] = "";
+ });
+ this.previousStyles = value;
+ } else {
+ this.element.setAttribute(this.extractedAttributeName, value);
+ }
+ }
+};
+
+// src/directives/event.ts
+var EventDirective = class {
+ element;
+ context;
+ expression;
+ attr;
+ eventCount = 0;
+ constructor({ element, context, attr }) {
+ this.element = element;
+ this.context = context;
+ this.expression = attr.value;
+ this.attr = attr;
+ const eventName = attr.name.replace(/^@/, "");
+ const parts = eventName.split(".");
+ this.element.addEventListener(parts[0], (event) => {
+ if (parts.includes("prevent")) event.preventDefault();
+ if (parts.includes("stop")) event.stopPropagation();
+ if (parts.includes("once") && this.eventCount > 0) return;
+ this.eventCount++;
+ const handler = evalGet(context.scope, attr.value);
+ if (typeof handler === "function") {
+ handler(event);
+ }
+ });
+ element.removeAttribute(attr.name);
+ }
+};
+
+// src/directives/for.ts
+var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
+var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
+var stripParensRE = /^\(|\)$/g;
+var destructureRE = /^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/;
+var _for = (el, exp, ctx, component, componentProps, allProps) => {
+ const inMatch = exp.match(forAliasRE);
+ if (!inMatch) {
+ console.warn(`invalid :for expression: ${exp}`);
+ return;
+ }
+ const nextNode = el.nextSibling;
+ const parent = el.parentElement;
+ const anchor = new Text("");
+ parent.insertBefore(anchor, el);
+ parent.removeChild(el);
+ const sourceExp = inMatch[2].trim();
+ let valueExp = inMatch[1].trim().replace(stripParensRE, "").trim();
+ let destructureBindings;
+ let isArrayDestructure = false;
+ let indexExp;
+ let objIndexExp;
+ let keyAttr = "key";
+ let keyExp = el.getAttribute(keyAttr) || el.getAttribute(keyAttr = ":key") || el.getAttribute(keyAttr = ":key:bind");
+ if (keyExp) {
+ el.removeAttribute(keyAttr);
+ if (keyAttr === "key") keyExp = JSON.stringify(keyExp);
+ }
+ let match;
+ if (match = valueExp.match(forIteratorRE)) {
+ valueExp = valueExp.replace(forIteratorRE, "").trim();
+ indexExp = match[1].trim();
+ if (match[2]) {
+ objIndexExp = match[2].trim();
+ }
+ }
+ if (match = valueExp.match(destructureRE)) {
+ destructureBindings = match[1].split(",").map((s) => s.trim());
+ isArrayDestructure = valueExp[0] === "[";
+ }
+ let mounted = false;
+ let blocks;
+ let childCtxs;
+ let keyToIndexMap;
+ const createChildContexts = (source) => {
+ const map = /* @__PURE__ */ new Map();
+ const ctxs = [];
+ if (isArray(source)) {
+ for (let i = 0; i < source.length; i++) {
+ ctxs.push(createChildContext(map, source[i], i));
+ }
+ } else if (typeof source === "number") {
+ for (let i = 0; i < source; i++) {
+ ctxs.push(createChildContext(map, i + 1, i));
+ }
+ } else if (isObject(source)) {
+ let i = 0;
+ for (const key in source) {
+ ctxs.push(createChildContext(map, source[key], i++, key));
+ }
+ }
+ return [ctxs, map];
+ };
+ const createChildContext = (map, value, index, objKey) => {
+ const data = {};
+ if (destructureBindings) {
+ destructureBindings.forEach((b, i) => data[b] = value[isArrayDestructure ? i : b]);
+ } else {
+ data[valueExp] = value;
+ }
+ if (objKey) {
+ indexExp && (data[indexExp] = objKey);
+ objIndexExp && (data[objIndexExp] = index);
+ } else {
+ indexExp && (data[indexExp] = index);
+ }
+ const childCtx = createScopedContext(ctx, data);
+ const key = keyExp ? evalGet(childCtx.scope, keyExp) : index;
+ map.set(key, index);
+ childCtx.key = key;
+ return childCtx;
+ };
+ const mountBlock = (ctx2, ref2) => {
+ const block = new Block({ element: el, parentContext: ctx2, replacementType: "replace", component, componentProps, allProps });
+ block.key = ctx2.key;
+ block.insert(parent, ref2);
+ return block;
+ };
+ ctx.effect(() => {
+ const source = evalGet(ctx.scope, sourceExp);
+ const prevKeyToIndexMap = keyToIndexMap;
+ [childCtxs, keyToIndexMap] = createChildContexts(source);
+ if (!mounted) {
+ blocks = childCtxs.map((s) => mountBlock(s, anchor));
+ mounted = true;
+ } else {
+ for (let i2 = 0; i2 < blocks.length; i2++) {
+ if (!keyToIndexMap.has(blocks[i2].key)) {
+ blocks[i2].remove();
+ }
+ }
+ const nextBlocks = [];
+ let i = childCtxs.length;
+ let nextBlock;
+ let prevMovedBlock;
+ while (i--) {
+ const childCtx = childCtxs[i];
+ const oldIndex = prevKeyToIndexMap.get(childCtx.key);
+ let block;
+ if (oldIndex == null) {
+ block = mountBlock(childCtx, nextBlock ? nextBlock.element : anchor);
+ } else {
+ block = blocks[oldIndex];
+ Object.assign(block.context.scope, childCtx.scope);
+ if (oldIndex !== i) {
+ if (blocks[oldIndex + 1] !== nextBlock || // If the next has moved, it must move too
+ prevMovedBlock === nextBlock) {
+ prevMovedBlock = block;
+ block.insert(parent, nextBlock ? nextBlock.element : anchor);
+ }
+ }
+ }
+ nextBlocks.unshift(nextBlock = block);
+ }
+ blocks = nextBlocks;
+ }
+ });
+ return nextNode;
+};
+
+// src/directives/if.ts
+function _if(el, exp, ctx, component, componentProps, allProps) {
+ const parent = el.parentElement;
+ const anchor = new Comment(":if");
+ parent.insertBefore(anchor, el);
+ const branches = [{ exp, el }];
+ let elseEl;
+ let elseExp;
+ while (elseEl = el.nextElementSibling) {
+ elseExp = null;
+ if (checkAndRemoveAttribute(elseEl, ":else") === "" || (elseExp = checkAndRemoveAttribute(elseEl, ":else-if"))) {
+ parent.removeChild(elseEl);
+ branches.push({ exp: elseExp, el: elseEl });
+ } else {
+ break;
+ }
+ }
+ const nextNode = el.nextSibling;
+ parent.removeChild(el);
+ let block;
+ let activeBranchIndex = -1;
+ const removeActiveBlock = () => {
+ if (block) {
+ parent.insertBefore(anchor, block.element);
+ block.remove();
+ block = void 0;
+ }
+ };
+ ctx.effect(() => {
+ for (let i = 0; i < branches.length; i++) {
+ const { exp: exp2, el: el2 } = branches[i];
+ if (!exp2 || evalGet(ctx.scope, exp2)) {
+ if (i !== activeBranchIndex) {
+ removeActiveBlock();
+ block = new Block({ element: el2, parentContext: ctx, replacementType: "replace", component, componentProps, allProps });
+ block.insert(parent, anchor);
+ parent.removeChild(anchor);
+ activeBranchIndex = i;
+ }
+ return;
+ }
+ }
+ activeBranchIndex = -1;
+ removeActiveBlock();
+ });
+ return nextNode;
+}
+
+// src/directives/interpolation.ts
+var delims = /{{\s?(.*?)\s?}}/g;
+var InterpolationDirective = class {
+ element;
+ context;
+ textNodes = /* @__PURE__ */ new Map();
+ constructor({ element, context }) {
+ this.element = element;
+ this.context = context;
+ this.findNodes();
+ this.textNodes.forEach((nodes, expression) => {
+ const trimmedExpression = expression.slice(2, -2).trim();
+ nodes.forEach((node) => {
+ const getter = (exp = trimmedExpression) => evalGet(this.context.scope, exp, node);
+ context.effect(() => {
+ node.textContent = toDisplayString(getter());
+ });
+ });
+ });
+ }
+ findNodes() {
+ const textContent = this.element.textContent.trim();
+ if (textContent?.match(delims)) {
+ const textNodes = textContent.split(/(\{\{\s?[^}]+\s?\}\})/g).filter(Boolean);
+ if (textNodes) {
+ let previousNode = this.element;
+ for (let i = 0; i < textNodes.length; i++) {
+ const textNode = textNodes[i];
+ if (textNode.match(/\{\{\s?.+\s?\}\}/)) {
+ const newNode = document.createTextNode(textNode);
+ if (i === 0) {
+ this.element.replaceWith(newNode);
+ } else {
+ insertAfter(newNode, previousNode);
+ }
+ previousNode = newNode;
+ if (this.textNodes.has(textNode)) {
+ this.textNodes.get(textNode).push(newNode);
+ } else {
+ this.textNodes.set(textNode, [newNode]);
+ }
+ } else {
+ const newNode = document.createTextNode(textNodes[i]);
+ if (i === 0) {
+ this.element.replaceWith(newNode);
+ } else {
+ insertAfter(newNode, previousNode);
+ }
+ previousNode = newNode;
+ }
+ }
+ }
+ }
+ }
+ update() {
+ }
+};
+
+// src/directives/show.ts
+var ShowDirective = class {
+ element;
+ context;
+ expression;
+ originalDisplay;
+ constructor({ element, context, expression }) {
+ this.element = element;
+ this.context = context;
+ this.expression = expression;
+ this.originalDisplay = getComputedStyle(this.element).display;
+ context.effect(this.update.bind(this));
+ }
+ update() {
+ const shouldShow = Boolean(evalGet(this.context.scope, this.expression));
+ this.element.style.display = shouldShow ? this.originalDisplay : "none";
+ }
+};
+
+// src/directives/teleport.ts
+function _teleport(el, exp, ctx) {
+ const anchor = new Comment(":teleport");
+ el.replaceWith(anchor);
+ const target = document.querySelector(exp);
+ if (!target) {
+ console.warn(`teleport target not found: ${exp}`);
+ return;
+ }
+ nextTick(() => {
+ target.appendChild(el);
+ const observer = new MutationObserver((mutationsList) => {
+ mutationsList.forEach((mutation) => {
+ mutation.removedNodes.forEach((removedNode) => {
+ if (removedNode.contains(anchor)) {
+ el.remove();
+ observer.disconnect();
+ }
+ });
+ });
+ });
+ observer.observe(document.body, { childList: true, subtree: true });
+ new Block({
+ element: el,
+ parentContext: ctx
+ });
+ });
+ return anchor;
+}
+
+// src/directives/value.ts
+function isInput(element) {
+ return element instanceof HTMLInputElement;
+}
+function isTextarea(element) {
+ return element instanceof HTMLTextAreaElement;
+}
+function isSelect(element) {
+ return element instanceof HTMLSelectElement;
+}
+var ValueDirective = class {
+ element;
+ context;
+ expression;
+ inputType;
+ constructor({ element, context, expression }) {
+ this.element = element;
+ this.context = context;
+ this.expression = expression;
+ this.inputType = element.getAttribute("type");
+ if (isInput(element)) {
+ switch (this.inputType) {
+ case "text":
+ case "password":
+ case "number":
+ case "color":
+ element.addEventListener("input", () => {
+ const value = this.inputType === "number" ? element.value ? parseFloat(element.value) : 0 : element.value;
+ evalSet(this.context.scope, expression, value);
+ });
+ break;
+ case "checkbox":
+ element.addEventListener("change", (e) => {
+ evalSet(this.context.scope, expression, !!e.currentTarget.checked);
+ });
+ break;
+ case "radio":
+ element.addEventListener("change", (e) => {
+ if (e.currentTarget.checked) {
+ evalSet(this.context.scope, expression, element.getAttribute("value"));
+ }
+ });
+ break;
+ default:
+ break;
+ }
+ }
+ if (isTextarea(element)) {
+ element.addEventListener("input", () => {
+ evalSet(this.context.scope, expression, element.value);
+ });
+ }
+ if (isSelect(element)) {
+ element.addEventListener("change", () => {
+ evalSet(this.context.scope, expression, element.value);
+ });
+ }
+ context.effect(this.updateElementValue.bind(this));
+ }
+ updateElementValue() {
+ const value = evalGet(this.context.scope, this.expression, this.element);
+ if (isInput(this.element)) {
+ switch (this.inputType) {
+ case "text":
+ case "password":
+ case "number":
+ case "color":
+ this.element.value = value;
+ break;
+ case "checkbox":
+ this.element.checked = !!value;
+ break;
+ case "radio":
+ this.element.checked = this.element.value === value;
+ break;
+ default:
+ break;
+ }
+ }
+ if (isTextarea(this.element)) {
+ this.element.value = value;
+ }
+ if (isSelect(this.element)) {
+ this.element.value = value;
+ }
+ }
+};
+
+// src/reactivity/effect.ts
+var targetMap = /* @__PURE__ */ new WeakMap();
+var effectStack = [];
+function track(target, key) {
+ const activeEffect = effectStack[effectStack.length - 1];
+ if (!activeEffect) return;
+ let effectsMap = targetMap.get(target);
+ if (!effectsMap)
+ targetMap.set(target, effectsMap = /* @__PURE__ */ new Map());
+ let effects = effectsMap.get(key);
+ if (!effects) effectsMap.set(key, effects = /* @__PURE__ */ new Set());
+ if (!effects.has(activeEffect)) {
+ effects.add(activeEffect);
+ activeEffect.refs.push(effects);
+ }
+}
+function trigger(target, key) {
+ const effectsMap = targetMap.get(target);
+ if (!effectsMap) return;
+ const scheduled = /* @__PURE__ */ new Set();
+ effectsMap.get(key)?.forEach((effect2) => {
+ scheduled.add(effect2);
+ });
+ scheduled.forEach(run);
+}
+function stop2(effect2) {
+ if (effect2.active) cleanup(effect2);
+ effect2.active = false;
+}
+function start(effect2) {
+ if (!effect2.active) {
+ effect2.active = true;
+ run(effect2);
+ }
+}
+function run(effect2) {
+ if (!effect2.active) return;
+ if (effectStack.includes(effect2)) return;
+ cleanup(effect2);
+ let val;
+ try {
+ effectStack.push(effect2);
+ val = effect2.handler();
+ } finally {
+ effectStack.pop();
+ }
+ return val;
+}
+function cleanup(effect2) {
+ const { refs } = effect2;
+ if (refs.length) {
+ for (const ref2 of refs) {
+ ref2.delete(effect2);
+ }
+ }
+ refs.length = 0;
+}
+function effect(handler, opts = {}) {
+ const { lazy } = opts;
+ const newEffect = {
+ active: !lazy,
+ handler,
+ refs: []
+ };
+ run(newEffect);
+ return {
+ start: () => {
+ start(newEffect);
+ },
+ stop: () => {
+ stop2(newEffect);
+ },
+ toggle: () => {
+ if (newEffect.active) {
+ stop2(newEffect);
+ } else {
+ start(newEffect);
+ }
+ return newEffect.active;
+ }
+ };
+}
+
+// src/reactivity/computed.ts
+var $computed = Symbol("computed");
+function isComputed(value) {
+ return isObject(value) && value[$computed];
+}
+
+// src/reactivity/ref.ts
+var $ref = Symbol("ref");
+function isRef(value) {
+ return isObject(value) && !!value[$ref];
+}
+function ref(value = null) {
+ if (isObject(value)) {
+ return isRef(value) ? value : reactive(value);
+ }
+ const result = { value, [$ref]: true };
+ return new Proxy(result, {
+ get(target, key, receiver) {
+ const val = Reflect.get(target, key, receiver);
+ track(result, "value");
+ return val;
+ },
+ set(target, key, value2) {
+ const oldValue = target[key];
+ if (oldValue !== value2) {
+ const success = Reflect.set(target, key, value2);
+ if (success) {
+ trigger(result, "value");
+ }
+ }
+ return true;
+ }
+ });
+}
+
+// src/reactivity/reactive.ts
+var $reactive = Symbol("reactive");
+function reactive(value) {
+ if (!isObject(value)) return ref(value);
+ if (value[$reactive]) return value;
+ value[$reactive] = true;
+ Object.keys(value).forEach((key) => {
+ if (isObject(value[key])) {
+ value[key] = reactive(value[key]);
+ }
+ });
+ return new Proxy(value, reactiveProxyHandler());
+}
+function reactiveProxyHandler() {
+ return {
+ deleteProperty(target, key) {
+ const had = Reflect.has(target, key);
+ const result = Reflect.deleteProperty(target, key);
+ if (had) trigger(target, key);
+ return result;
+ },
+ get(target, key) {
+ track(target, key);
+ return Reflect.get(target, key);
+ },
+ set(target, key, value) {
+ if (target[key] === value) return true;
+ let newObj = false;
+ if (isObject(value) && !isObject(target[key])) {
+ newObj = true;
+ }
+ if (Reflect.set(target, key, value)) {
+ trigger(target, key);
+ }
+ if (newObj) {
+ target[key] = reactive(target[key]);
+ }
+ return true;
+ }
+ };
+}
+
+// src/reactivity/unwrap.ts
+function unwrap(value) {
+ if (isRef(value) || isComputed(value)) {
+ return value.value;
+ }
+ if (typeof value === "function") {
+ return value();
+ }
+ return value;
+}
+
+// src/plugins/router/plugin.ts
+var activeRouters = /* @__PURE__ */ new Set();
+var link = {
+ template: html`
+
+ LINK
+
+ `,
+ props: { href: { default: "#" } },
+ main({ href }) {
+ const go = (e) => {
+ e.preventDefault();
+ activeRouters.forEach((router) => {
+ router.doRouteChange(unwrap(href));
+ });
+ };
+ const classes = reactive({ "router-link": true });
+ return { go, classes, href };
+ }
+};
+
+// src/index.ts
+var App2 = class {
+ rootBlock;
+ registry = /* @__PURE__ */ new Map();
+ plugins = /* @__PURE__ */ new Set();
+ register(name, component) {
+ this.registry.set(name, component);
+ }
+ use(plugin, ...config) {
+ this.plugins.add(plugin);
+ plugin.use(this, ...config);
+ }
+ getComponent(tag) {
+ return this.registry.get(tag);
+ }
+ mount(component, target = "body", props = {}) {
+ const root = typeof target === "string" ? document.querySelector(target) : target;
+ const display = root.style.display;
+ root.style.display = "none";
+ this.rootBlock = this._mount(component, root, props, true);
+ root.style.display = display;
+ return this.rootBlock;
+ }
+ _mount(component, target, props, isRoot = false) {
+ const parentContext = createContext({ app: this });
+ if (props) {
+ parentContext.scope = reactive(props);
+ bindContextMethods(parentContext.scope);
+ }
+ parentContext.scope.$isRef = isRef;
+ parentContext.scope.$isComputed = isComputed;
+ const block = new Block({
+ element: target,
+ parentContext,
+ component,
+ isRoot,
+ componentProps: props,
+ replacementType: "replaceChildren"
+ });
+ return block;
+ }
+ unmount() {
+ this.rootBlock.teardown();
+ }
+};
+function createContext({ parentContext, app: app2 }) {
+ const context = {
+ app: app2 ? app2 : parentContext && parentContext.app ? parentContext.app : null,
+ // scope: parentContext ? parentContext.scope : reactive({}),
+ scope: reactive({}),
+ blocks: [],
+ effects: [],
+ slots: [],
+ templates: parentContext ? parentContext.templates : [],
+ effect: (handler) => {
+ const e = effect(handler);
+ context.effects.push(e);
+ return e;
+ }
+ };
+ return context;
+}
+var createScopedContext = (ctx, data = {}) => {
+ const parentScope = ctx.scope;
+ const mergedScope = Object.create(parentScope);
+ Object.defineProperties(mergedScope, Object.getOwnPropertyDescriptors(data));
+ let proxy;
+ proxy = reactive(
+ new Proxy(mergedScope, {
+ set(target, key, val, receiver) {
+ if (receiver === proxy && !target.hasOwnProperty(key)) {
+ return Reflect.set(parentScope, key, val);
+ }
+ return Reflect.set(target, key, val, receiver);
+ }
+ })
+ );
+ bindContextMethods(proxy);
+ const out = {
+ ...ctx,
+ scope: {
+ ...ctx.scope,
+ ...proxy
+ }
+ };
+ return out;
+};
+function bindContextMethods(scope) {
+ for (const key of Object.keys(scope)) {
+ if (typeof scope[key] === "function") {
+ scope[key] = scope[key].bind(scope);
+ }
+ }
+}
+function mergeProps(props, defaultProps) {
+ const merged = {};
+ Object.keys(defaultProps).forEach((defaultProp) => {
+ const propValue = props.hasOwnProperty(defaultProp) ? props[defaultProp] : defaultProps[defaultProp]?.default;
+ merged[defaultProp] = reactive(typeof propValue === "function" ? propValue() : propValue);
+ });
+ return merged;
+}
+var current = { componentBlock: void 0 };
+var Block = class {
+ element;
+ context;
+ parentContext;
+ component;
+ provides = /* @__PURE__ */ new Map();
+ parentComponentBlock;
+ componentProps;
+ allProps;
+ isFragment;
+ start;
+ end;
+ key;
+ constructor(opts) {
+ this.isFragment = opts.element instanceof HTMLTemplateElement;
+ this.parentComponentBlock = opts.parentComponentBlock;
+ if (opts.component) {
+ current.componentBlock = this;
+ this.element = stringToElement(opts.component.template);
+ } else {
+ if (this.isFragment) {
+ this.element = opts.element.content.cloneNode(true);
+ } else if (typeof opts.element === "string") {
+ this.element = stringToElement(opts.element);
+ } else {
+ this.element = opts.element.cloneNode(true);
+ opts.element.replaceWith(this.element);
+ }
+ }
+ if (opts.isRoot) {
+ this.context = opts.parentContext;
+ } else {
+ this.parentContext = opts.parentContext ? opts.parentContext : createContext({});
+ this.parentContext.blocks.push(this);
+ this.context = createContext({ parentContext: opts.parentContext });
+ }
+ if (opts.component) {
+ this.componentProps = mergeProps(opts.componentProps ?? {}, opts.component.props ?? {});
+ if (opts.component.main) {
+ this.context.scope = {
+ ...opts.component.main(this.componentProps) || {}
+ };
+ }
+ }
+ opts.allProps?.forEach((prop) => {
+ if (prop.isBind) {
+ this.context.effect(() => {
+ let newValue;
+ if (prop.isSpread) {
+ const spreadProps = evalGet(this.parentContext.scope, prop.extractedName);
+ if (isObject(spreadProps)) {
+ Object.keys(spreadProps).forEach((key) => {
+ newValue = spreadProps[key];
+ this.setProp(key, newValue);
+ });
+ }
+ } else {
+ newValue = prop.isMirror ? evalGet(this.parentContext.scope, prop.extractedName) : evalGet(this.parentContext.scope, prop.exp);
+ this.setProp(prop.extractedName, newValue);
+ }
+ });
+ }
+ });
+ this.context.slots = findSlotNodes(this.element);
+ this.context.templates = opts.templates ?? [];
+ this.context.slots.forEach((slot) => {
+ const template = this.context.templates.find((t) => t.targetSlotName === slot.name);
+ if (template) {
+ const templateContents = template.node.content.cloneNode(true);
+ slot.node.replaceWith(templateContents);
+ }
+ });
+ this.context.scope.$isRef = isRef;
+ this.context.scope.$isComputed = isComputed;
+ walk(this.element, this.context);
+ if (opts.component) {
+ if (opts.replacementType === "replace") {
+ if (opts.element instanceof HTMLElement) {
+ opts.element.replaceWith(this.element);
+ }
+ } else {
+ if (opts.element instanceof HTMLElement) {
+ opts.element.replaceChildren(this.element);
+ }
+ }
+ }
+ }
+ setProp(name, value) {
+ if (isRef(this.componentProps[name])) {
+ this.componentProps[name].value = value;
+ } else {
+ this.componentProps[name] = value;
+ }
+ }
+ insert(parent, anchor = null) {
+ if (this.isFragment) {
+ if (this.start) {
+ let node = this.start;
+ let next;
+ while (node) {
+ next = node.nextSibling;
+ parent.insertBefore(node, anchor);
+ if (node === this.end) {
+ break;
+ }
+ node = next;
+ }
+ } else {
+ this.start = new Text("");
+ this.end = new Text("");
+ parent.insertBefore(this.end, anchor);
+ parent.insertBefore(this.start, this.end);
+ parent.insertBefore(this.element, this.end);
+ }
+ } else {
+ parent.insertBefore(this.element, anchor);
+ }
+ }
+ remove() {
+ if (this.parentContext) {
+ const i = this.parentContext.blocks.indexOf(this);
+ if (i > -1) {
+ this.parentContext.blocks.splice(i, 1);
+ }
+ }
+ if (this.start) {
+ const parent = this.start.parentNode;
+ let node = this.start;
+ let next;
+ while (node) {
+ next = node.nextSibling;
+ parent.removeChild(node);
+ if (node === this.end) {
+ break;
+ }
+ node = next;
+ }
+ } else {
+ this.element.remove();
+ }
+ this.teardown();
+ }
+ teardown() {
+ this.context.blocks.forEach((block) => {
+ block.teardown();
+ });
+ this.context.effects.forEach(stop);
+ }
+};
+function isComponent(element, context) {
+ return !!context.app.getComponent(element.tagName.toLowerCase());
+}
+function warnInvalidDirectives(node, directives) {
+ if (directives.every((d) => node.hasAttribute(d))) {
+ console.warn(`These directives cannot be used together on the same node:`, directives);
+ console.warn("Node ignored:", node);
+ return true;
+ }
+ return false;
+}
+function walk(node, context) {
+ if (isText(node)) {
+ new InterpolationDirective({ element: node, context });
+ return;
+ }
+ if (isElement(node)) {
+ let exp;
+ const handleDirectives = (node2, context2, component, componentProps, allProps) => {
+ if (warnInvalidDirectives(node2, [":if", ":for"])) return;
+ if (warnInvalidDirectives(node2, [":if", ":teleport"])) return;
+ if (warnInvalidDirectives(node2, [":for", ":teleport"])) return;
+ if (exp = checkAndRemoveAttribute(node2, ":scope")) {
+ const scope = evalGet(context2.scope, exp);
+ if (typeof scope === "object") {
+ Object.assign(context2.scope, scope);
+ }
+ }
+ if (exp = checkAndRemoveAttribute(node2, ":teleport")) {
+ return _teleport(node2, exp, context2);
+ }
+ if (exp = checkAndRemoveAttribute(node2, ":if")) {
+ return _if(node2, exp, context2, component, componentProps, allProps);
+ }
+ if (exp = checkAndRemoveAttribute(node2, ":for")) {
+ return _for(node2, exp, context2, component, componentProps, allProps);
+ }
+ if (exp = checkAndRemoveAttribute(node2, ":show")) {
+ new ShowDirective({ element: node2, context: context2, expression: exp });
+ }
+ if (exp = checkAndRemoveAttribute(node2, ":ref")) {
+ context2.scope[exp].value = node2;
+ }
+ if (exp = checkAndRemoveAttribute(node2, ":value")) {
+ new ValueDirective({ element: node2, context: context2, expression: exp });
+ }
+ if (exp = checkAndRemoveAttribute(node2, ":html")) {
+ context2.effect(() => {
+ const result = evalGet(context2.scope, exp);
+ if (result instanceof Element) {
+ node2.replaceChildren();
+ node2.append(result);
+ } else {
+ node2.innerHTML = result;
+ }
+ });
+ }
+ if (exp = checkAndRemoveAttribute(node2, ":text")) {
+ context2.effect(() => {
+ node2.textContent = toDisplayString(evalGet(context2.scope, exp));
+ });
+ }
+ };
+ const processAttributes = (node2, component) => {
+ return Array.from(node2.attributes).filter((attr) => isSpreadProp(attr.name) || isMirrorProp(attr.name) || isRegularProp(attr.name) && componentHasPropByName(extractPropName(attr.name), component)).map((attr) => ({
+ isMirror: isMirrorProp(attr.name),
+ isSpread: isSpreadProp(attr.name),
+ isBind: attr.name.includes("bind"),
+ originalName: attr.name,
+ extractedName: extractPropName(attr.name),
+ exp: attr.value,
+ value: isMirrorProp(attr.name) ? evalGet(context.scope, extractPropName(attr.name)) : attr.value ? evalGet(context.scope, attr.value) : void 0
+ }));
+ };
+ if (isComponent(node, context)) {
+ const component = context.app.getComponent(node.tagName.toLowerCase());
+ const allProps = processAttributes(node, component);
+ const componentProps = allProps.reduce((acc, { isSpread, isMirror, extractedName, value }) => {
+ if (isSpread) {
+ const spread = evalGet(context.scope, extractedName);
+ if (isObject(spread)) Object.assign(acc, spread);
+ } else if (isMirror) {
+ acc[extractedName] = evalGet(context.scope, extractedName);
+ } else {
+ acc[extractedName] = value;
+ }
+ return acc;
+ }, {});
+ const next2 = handleDirectives(node, context, component, componentProps, allProps);
+ if (next2) return next2;
+ const templates = findTemplateNodes(node);
+ return new Block({
+ element: node,
+ parentContext: context,
+ component,
+ replacementType: "replace",
+ parentComponentBlock: current.componentBlock,
+ templates,
+ componentProps,
+ allProps
+ }).element;
+ }
+ const next = handleDirectives(node, context);
+ if (next) return next;
+ Array.from(node.attributes).forEach((attr) => {
+ if (isPropAttribute(attr.name)) {
+ new AttributeDirective({ element: node, context, attr });
+ }
+ if (isEventAttribute(attr.name)) {
+ new EventDirective({ element: node, context, attr });
+ }
+ });
+ walkChildren(node, context);
+ }
+}
+function walkChildren(node, context) {
+ let child2 = node.firstChild;
+ while (child2) {
+ child2 = walk(child2, context) || child2.nextSibling;
+ }
+}
+var evalFuncCache = {};
+function evalGet(scope, exp, el) {
+ if (!exp.trim()) return void 0;
+ return execute(scope, `const ___value = (${exp.trim()}); return ___value;`, el);
+}
+function evalSet(scope, exp, value) {
+ value = typeof value === "string" ? `"${value}"` : value;
+ return execute(scope, `const ___target = (${exp.trim()}); return $isRef(___target) ? ___target.value = ${value} : ___target = ${value};`, null, false);
+}
+function execute(scope, exp, el, flatRefs = true) {
+ const newScope = flatRefs ? flattenRefs(scope) : scope;
+ const fn = evalFuncCache[exp] || (evalFuncCache[exp] = toFunction(exp));
+ try {
+ return fn(newScope, el);
+ } catch (e) {
+ console.warn(`Error evaluating expression: "${exp}":`);
+ console.error(e);
+ }
+}
+function toFunction(exp) {
+ try {
+ return new Function("$data", "$el", `with($data){${exp}}`);
+ } catch (e) {
+ console.error(`${e.message} in expression: ${exp}`);
+ return () => {
+ };
+ }
+}
+function flattenRefs(scope) {
+ const mapped = {};
+ for (const key in scope) {
+ if (scope.hasOwnProperty(key)) {
+ if (isRef(scope[key])) {
+ mapped[key] = scope[key].value;
+ } else {
+ mapped[key] = scope[key];
+ }
+ }
+ }
+ return mapped;
+}
+
+// src/demo.ts
+var child = {
+ template: html`
+
+ hello from child, food: "{{food}}" (does not inherit)
+
+
+
+
+ `,
+ main() {
+ const food = ref("\u{1F354}");
+ return { food };
+ }
+};
+var main = {
+ template: html`
+
+
+
+
Scoped data: {{food}}
+
Child slot, food: {{food}}
+
No pizza 😢
+
Pizza!
+
+
+ `,
+ main() {
+ return { food: ref("nothing") };
+ }
+};
+var app = new App2();
+app.register("child", child);
+app.mount(main, "#app");
+//# sourceMappingURL=demo.js.map
diff --git a/public/demo.js.map b/public/demo.js.map
new file mode 100755
index 0000000..ad6aef0
--- /dev/null
+++ b/public/demo.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../src/util.ts", "../src/directives/attribute.ts", "../src/directives/event.ts", "../src/directives/for.ts", "../src/directives/if.ts", "../src/directives/interpolation.ts", "../src/directives/show.ts", "../src/directives/teleport.ts", "../src/directives/value.ts", "../src/reactivity/effect.ts", "../src/reactivity/computed.ts", "../src/reactivity/ref.ts", "../src/reactivity/reactive.ts", "../src/reactivity/unwrap.ts", "../src/plugins/router/plugin.ts", "../src/index.ts", "../src/demo.ts"],
+ "sourcesContent": ["import { Component } from \".\";\n\nexport function stringToElement(template: string): Element {\n const parser = new DOMParser();\n const doc = parser.parseFromString(template, \"text/html\");\n return doc.body.firstChild as Element;\n}\n\nexport const isText = (node: Node): node is Text => {\n return node.nodeType === Node.TEXT_NODE;\n};\n\nexport const isTemplate = (node: Node): node is HTMLTemplateElement => {\n return node.nodeName === \"TEMPLATE\";\n};\n\nexport const isElement = (node: Node): node is Element => {\n return node.nodeType === Node.ELEMENT_NODE;\n};\n\nexport function isObject(value: any): value is object {\n return value !== null && typeof value === \"object\";\n}\n\nexport function isArray(value: any): value is any[] {\n return Array.isArray(value);\n}\n\nexport function checkAndRemoveAttribute(el: Element, attrName: string): string | null {\n // Attempt to get the attribute value\n const attributeValue = el.getAttribute(attrName);\n\n // If attribute exists, remove it from the element\n if (attributeValue !== null) {\n el.removeAttribute(attrName);\n }\n\n // Return the value of the attribute or null if not present\n return attributeValue;\n}\n\nexport interface Slot {\n node: Element;\n name: string;\n}\n\nexport interface Template {\n targetSlotName: string;\n node: HTMLTemplateElement;\n}\n\nexport function findSlotNodes(element: Element): Slot[] {\n const slots: Slot[] = [];\n\n const findSlots = (node: Element) => {\n Array.from(node.childNodes).forEach((node) => {\n if (isElement(node)) {\n if (node.nodeName === \"SLOT\") {\n slots.push({ node, name: node.getAttribute(\"name\") || \"default\" });\n }\n\n if (node.hasChildNodes()) {\n findSlots(node);\n }\n }\n });\n };\n\n findSlots(element);\n\n return slots;\n}\n\nexport function findTemplateNodes(element: Element) {\n const templates: Template[] = [];\n\n const findTemplates = (element: Element) => {\n let defaultContentNodes: Node[] = [];\n\n Array.from(element.childNodes).forEach((node) => {\n if (isElement(node) || isText(node)) {\n if (isElement(node) && node.nodeName === \"TEMPLATE\" && isTemplate(node)) {\n templates.push({ targetSlotName: node.getAttribute(\"slot\") || \"\", node });\n } else {\n // Capture non-template top-level nodes and text nodes for default slot\n defaultContentNodes.push(node);\n }\n }\n });\n\n if (defaultContentNodes.length > 0) {\n // Create a template element with a default slot\n const defaultTemplate = document.createElement(\"template\");\n defaultTemplate.setAttribute(\"slot\", \"default\");\n\n defaultContentNodes.forEach((node) => {\n defaultTemplate.content.appendChild(node);\n });\n\n templates.push({ targetSlotName: \"default\", node: defaultTemplate });\n }\n };\n\n findTemplates(element);\n\n return templates;\n}\n\nexport const nextTick = async (f?: Function) => {\n await new Promise((r) =>\n setTimeout((_) =>\n requestAnimationFrame((_) => {\n f && f();\n r();\n }),\n ),\n );\n};\n\nexport function html(strings: TemplateStringsArray, ...values: any[]): string {\n // List of valid self-closing tags in HTML\n const selfClosingTags = [\"area\", \"base\", \"br\", \"col\", \"embed\", \"hr\", \"img\", \"input\", \"link\", \"meta\", \"param\", \"source\", \"track\", \"wbr\"];\n\n // Join the strings and values into a single template\n let result = strings.reduce((acc, str, i) => acc + str + (values[i] || \"\"), \"\");\n\n // Match non-HTML valid self-closing tags\n result = result.replace(/<([a-zA-Z][^\\s/>]*)\\s*([^>]*?)\\/>/g, (match, tagName, attributes) => {\n // If the tag is a valid self-closing tag, return it as is\n if (selfClosingTags.includes(tagName.toLowerCase())) {\n return match;\n }\n\n // Return the tag as an open/close tag preserving attributes\n return `<${tagName} ${attributes}>${tagName}>`;\n });\n\n return result;\n}\n\nexport function toDisplayString(value: unknown) {\n return value == null ? \"\" : isObject(value) ? JSON.stringify(value, null, 2) : String(value);\n}\n\nexport function insertAfter(newNode: Node, existingNode: Node) {\n if (existingNode.nextSibling) {\n existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);\n } else {\n existingNode?.parentNode?.appendChild(newNode);\n }\n}\n\nexport function isPropAttribute(attrName: string) {\n if (attrName.startsWith(\".\")) {\n return true;\n }\n\n if (attrName.startsWith(\"{\") && attrName.endsWith(\"}\")) {\n return true;\n }\n\n return false;\n}\n\nexport function isSpreadProp(attr: string) {\n return attr.startsWith(\"...\");\n}\n\nexport function isMirrorProp(attr: string) {\n return attr.startsWith(\"{\") && attr.endsWith(\"}\");\n}\n\nexport function isRegularProp(attr: string) {\n return attr.startsWith(\".\");\n}\n\nexport function isEventAttribute(attrName: string) {\n return attrName.startsWith(\"@\");\n}\n\nexport function componentHasPropByName(name: string, component: Component) {\n return Object.keys(component?.props ?? {}).some((prop) => prop === name);\n}\n\nexport function extractAttributeName(attrName: string) {\n return attrName\n .replace(/^\\.\\.\\./, \"\")\n .replace(/^\\./, \"\")\n .replace(/^{/, \"\")\n .replace(/}$/, \"\")\n .replace(/:bind$/, \"\");\n}\n\nfunction dashToCamel(str: string) {\n return str.toLowerCase().replace(/-([a-z])/g, (g) => g[1].toUpperCase());\n}\n\nexport function extractPropName(attrName: string) {\n return dashToCamel(extractAttributeName(attrName));\n}\n\nexport function classNames(_: any) {\n const classes = [];\n for (let i = 0; i < arguments.length; i++) {\n const arg = arguments[i];\n if (!arg) continue;\n const argType = typeof arg;\n if (argType === \"string\" || argType === \"number\") {\n classes.push(arg);\n } else if (Array.isArray(arg)) {\n if (arg.length) {\n const inner = classNames.apply(null, arg);\n if (inner) {\n classes.push(inner);\n }\n }\n } else if (argType === \"object\") {\n if (arg.toString === Object.prototype.toString) {\n for (let key in arg) {\n if (Object.hasOwnProperty.call(arg, key) && arg[key]) {\n classes.push(key);\n }\n }\n } else {\n classes.push(arg.toString());\n }\n }\n }\n return classes.join(\" \");\n}\n", "import { Context, evalGet } from \"..\";\nimport { classNames, extractAttributeName } from \"../util\";\n\ninterface AttributeDirectiveOptions {\n element: Element;\n context: Context;\n attr: Attr;\n}\n\ninterface Is {\n sameNameProperty: boolean;\n bound: boolean;\n spread: boolean;\n componentProp: boolean;\n}\n\nexport class AttributeDirective {\n element: Element;\n context: Context;\n expression: string;\n attr: Attr;\n extractedAttributeName: string;\n\n previousClasses: string[] = [];\n previousStyles: { [key: string]: string } = {};\n\n is: Is = {\n sameNameProperty: false,\n bound: false,\n spread: false,\n componentProp: false,\n };\n\n constructor({ element, context, attr }: AttributeDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = attr.value;\n this.attr = attr;\n this.extractedAttributeName = extractAttributeName(attr.name);\n\n this.is = {\n sameNameProperty: attr.name.startsWith(\"{\") && attr.name.endsWith(\"}\"),\n bound: attr.name.includes(\":bind\"),\n spread: attr.name.startsWith(\"...\"),\n componentProp: false,\n };\n\n if (this.is.sameNameProperty) {\n this.expression = this.extractedAttributeName;\n }\n\n if (this.is.spread) {\n this.expression = this.extractedAttributeName;\n }\n\n element.removeAttribute(attr.name);\n\n if (this.is.bound) {\n context.effect(this.update.bind(this));\n } else {\n this.update();\n }\n }\n\n update() {\n let value = evalGet(this.context.scope, this.expression);\n\n if (this.is.spread && typeof value === \"object\") {\n for (const [key, val] of Object.entries(value)) {\n this.element.setAttribute(key, String(val));\n }\n } else if ((typeof value === \"object\" || Array.isArray(value)) && this.extractedAttributeName === \"class\") {\n value = classNames(value);\n const next = value.split(\" \");\n\n // If we now have classes that are not already on the element, add them now.\n // Remove classes that are no longer on the element.\n const diff = next.filter((c: string) => !this.previousClasses.includes(c)).filter(Boolean);\n const rm = this.previousClasses.filter((c) => !next.includes(c));\n\n diff.forEach((c: string) => {\n this.previousClasses.push(c);\n this.element.classList.add(c);\n });\n\n rm.forEach((c) => {\n this.previousClasses = this.previousClasses.filter((addedClass) => addedClass !== c);\n this.element.classList.remove(c);\n });\n } else if (typeof value === \"object\" && this.extractedAttributeName === \"style\") {\n console.log(\"value is object\", value)\n const next = Object.keys(value);\n const rm = Object.keys(this.previousStyles).filter((style) => !next.includes(style));\n\n next.forEach((style) => {\n this.previousStyles[style] = value[style];\n // @ts-ignore\n this.element.style[style] = value[style];\n });\n\n rm.forEach((style) => {\n this.previousStyles[style] = \"\";\n // @ts-ignore\n this.element.style[style] = \"\";\n });\n\n this.previousStyles = value;\n } else {\n this.element.setAttribute(this.extractedAttributeName, value);\n }\n }\n}\n", "import { Context, evalGet } from \"..\";\n\ninterface EventDirectiveOptions {\n element: Element;\n context: Context;\n attr: Attr;\n}\n\nexport class EventDirective {\n element: Element;\n context: Context;\n expression: string;\n attr: Attr;\n eventCount = 0;\n\n constructor({ element, context, attr }: EventDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = attr.value;\n this.attr = attr;\n\n const eventName = attr.name.replace(/^@/, \"\");\n const parts = eventName.split(\".\");\n\n this.element.addEventListener(parts[0], (event) => {\n if (parts.includes(\"prevent\")) event.preventDefault();\n if (parts.includes(\"stop\")) event.stopPropagation();\n if (parts.includes(\"once\") && this.eventCount > 0) return;\n\n this.eventCount++;\n\n const handler = evalGet(context.scope, attr.value);\n if (typeof handler === \"function\") {\n handler(event);\n }\n });\n\n element.removeAttribute(attr.name);\n }\n}\n", "import { Block, Component, Context, createScopedContext, evalGet } from \"..\";\nimport { isArray, isObject } from \"../util\";\n\nconst forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/;\nconst forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\nconst stripParensRE = /^\\(|\\)$/g;\nconst destructureRE = /^[{[]\\s*((?:[\\w_$]+\\s*,?\\s*)+)[\\]}]$/;\n\ntype KeyToIndexMap = Map;\n\nexport const _for = (el: Element, exp: string, ctx: Context, component?: Component, componentProps?: Record, allProps?: Record) => {\n const inMatch = exp.match(forAliasRE);\n if (!inMatch) {\n console.warn(`invalid :for expression: ${exp}`);\n return;\n }\n\n const nextNode = el.nextSibling;\n\n const parent = el.parentElement!;\n const anchor = new Text(\"\");\n parent.insertBefore(anchor, el);\n parent.removeChild(el);\n\n const sourceExp = inMatch[2].trim();\n let valueExp = inMatch[1].trim().replace(stripParensRE, \"\").trim();\n let destructureBindings: string[] | undefined;\n let isArrayDestructure = false;\n let indexExp: string | undefined;\n let objIndexExp: string | undefined;\n\n let keyAttr = \"key\";\n let keyExp = el.getAttribute(keyAttr) || el.getAttribute((keyAttr = \":key\")) || el.getAttribute((keyAttr = \":key:bind\"));\n if (keyExp) {\n el.removeAttribute(keyAttr);\n if (keyAttr === \"key\") keyExp = JSON.stringify(keyExp);\n }\n\n let match: any;\n if ((match = valueExp.match(forIteratorRE))) {\n valueExp = valueExp.replace(forIteratorRE, \"\").trim();\n indexExp = match[1].trim();\n if (match[2]) {\n objIndexExp = match[2].trim();\n }\n }\n\n if ((match = valueExp.match(destructureRE))) {\n destructureBindings = match[1].split(\",\").map((s: string) => s.trim());\n isArrayDestructure = valueExp[0] === \"[\";\n }\n\n let mounted = false;\n let blocks: Block[];\n let childCtxs: Context[];\n let keyToIndexMap: Map;\n\n const createChildContexts = (source: unknown): [Context[], KeyToIndexMap] => {\n const map: KeyToIndexMap = new Map();\n const ctxs: Context[] = [];\n\n if (isArray(source)) {\n for (let i = 0; i < source.length; i++) {\n ctxs.push(createChildContext(map, source[i], i));\n }\n } else if (typeof source === \"number\") {\n for (let i = 0; i < source; i++) {\n ctxs.push(createChildContext(map, i + 1, i));\n }\n } else if (isObject(source)) {\n let i = 0;\n for (const key in source) {\n ctxs.push(createChildContext(map, source[key], i++, key));\n }\n }\n\n return [ctxs, map];\n };\n\n const createChildContext = (map: KeyToIndexMap, value: any, index: number, objKey?: string): Context => {\n const data: any = {};\n if (destructureBindings) {\n destructureBindings.forEach((b, i) => (data[b] = value[isArrayDestructure ? i : b]));\n } else {\n data[valueExp] = value;\n }\n if (objKey) {\n indexExp && (data[indexExp] = objKey);\n objIndexExp && (data[objIndexExp] = index);\n } else {\n indexExp && (data[indexExp] = index);\n }\n\n const childCtx = createScopedContext(ctx, data);\n const key = keyExp ? evalGet(childCtx.scope, keyExp) : index;\n map.set(key, index);\n childCtx.key = key;\n return childCtx;\n };\n\n const mountBlock = (ctx: Context, ref: Node) => {\n const block = new Block({ element: el, parentContext: ctx, replacementType: \"replace\", component, componentProps, allProps });\n block.key = ctx.key;\n block.insert(parent, ref);\n return block;\n };\n\n ctx.effect(() => {\n const source = evalGet(ctx.scope, sourceExp);\n const prevKeyToIndexMap = keyToIndexMap;\n [childCtxs, keyToIndexMap] = createChildContexts(source);\n if (!mounted) {\n blocks = childCtxs.map((s) => mountBlock(s, anchor));\n mounted = true;\n } else {\n for (let i = 0; i < blocks.length; i++) {\n if (!keyToIndexMap.has(blocks[i].key)) {\n blocks[i].remove();\n }\n }\n\n const nextBlocks: Block[] = [];\n let i = childCtxs.length;\n let nextBlock: Block | undefined;\n let prevMovedBlock: Block | undefined;\n while (i--) {\n const childCtx = childCtxs[i];\n const oldIndex = prevKeyToIndexMap.get(childCtx.key);\n let block: Block;\n if (oldIndex == null) {\n // new\n block = mountBlock(childCtx, nextBlock ? nextBlock.element : anchor);\n } else {\n // update\n block = blocks[oldIndex];\n Object.assign(block.context.scope, childCtx.scope);\n if (oldIndex !== i) {\n // moved\n if (\n blocks[oldIndex + 1] !== nextBlock ||\n // If the next has moved, it must move too\n prevMovedBlock === nextBlock\n ) {\n prevMovedBlock = block;\n block.insert(parent, nextBlock ? nextBlock.element : anchor);\n }\n }\n }\n nextBlocks.unshift((nextBlock = block));\n }\n blocks = nextBlocks;\n }\n });\n\n return nextNode;\n};\n", "import { Block, Component, Context, evalGet } from \"..\";\nimport { checkAndRemoveAttribute } from \"../util\";\n\ninterface Branch {\n exp?: string | null;\n el: Element;\n}\n\nexport function _if(el: Element, exp: string, ctx: Context, component?: Component, componentProps?: Record, allProps?: Record) {\n const parent = el.parentElement!;\n const anchor = new Comment(\":if\");\n\n parent.insertBefore(anchor, el);\n\n const branches: Branch[] = [{ exp, el }];\n\n let elseEl: Element | null;\n let elseExp: string | null;\n\n while ((elseEl = el.nextElementSibling)) {\n elseExp = null;\n\n if (checkAndRemoveAttribute(elseEl, \":else\") === \"\" || (elseExp = checkAndRemoveAttribute(elseEl, \":else-if\"))) {\n parent.removeChild(elseEl);\n branches.push({ exp: elseExp, el: elseEl });\n } else {\n break;\n }\n }\n\n const nextNode = el.nextSibling;\n parent.removeChild(el);\n\n let block: Block | undefined;\n let activeBranchIndex = -1;\n\n const removeActiveBlock = () => {\n if (block) {\n parent.insertBefore(anchor, block.element);\n block.remove();\n block = undefined;\n }\n };\n\n ctx.effect(() => {\n for (let i = 0; i < branches.length; i++) {\n const { exp, el } = branches[i];\n\n if (!exp || evalGet(ctx.scope, exp)) {\n if (i !== activeBranchIndex) {\n removeActiveBlock();\n block = new Block({ element: el, parentContext: ctx, replacementType: \"replace\", component, componentProps, allProps });\n block.insert(parent, anchor);\n parent.removeChild(anchor);\n activeBranchIndex = i;\n }\n\n return;\n }\n }\n\n activeBranchIndex = -1;\n removeActiveBlock();\n });\n\n return nextNode;\n}\n", "import { Context, evalGet } from \"../\";\nimport { insertAfter, toDisplayString } from \"../util\";\n\ninterface InterpolationDirectiveOptions {\n element: Text;\n context: Context;\n}\n\nconst delims = /{{\\s?(.*?)\\s?}}/g;\n\nexport class InterpolationDirective {\n element: Text;\n context: Context;\n textNodes: Map = new Map();\n\n constructor({ element, context }: InterpolationDirectiveOptions) {\n this.element = element;\n this.context = context;\n\n this.findNodes();\n\n this.textNodes.forEach((nodes, expression) => {\n const trimmedExpression = expression.slice(2, -2).trim();\n\n nodes.forEach((node) => {\n const getter = (exp = trimmedExpression) => evalGet(this.context.scope, exp, node);\n\n context.effect(() => {\n node.textContent = toDisplayString(getter());\n });\n });\n });\n }\n\n findNodes() {\n const textContent = this.element.textContent.trim();\n if (textContent?.match(delims)) {\n const textNodes = textContent.split(/(\\{\\{\\s?[^}]+\\s?\\}\\})/g).filter(Boolean);\n if (textNodes) {\n let previousNode = this.element;\n\n for (let i = 0; i < textNodes.length; i++) {\n const textNode = textNodes[i];\n\n if (textNode.match(/\\{\\{\\s?.+\\s?\\}\\}/)) {\n const newNode = document.createTextNode(textNode);\n\n if (i === 0) {\n this.element.replaceWith(newNode);\n } else {\n insertAfter(newNode, previousNode);\n }\n\n previousNode = newNode;\n\n if (this.textNodes.has(textNode)) {\n this.textNodes.get(textNode).push(newNode);\n } else {\n this.textNodes.set(textNode, [newNode]);\n }\n } else {\n const newNode = document.createTextNode(textNodes[i]);\n\n if (i === 0) {\n this.element.replaceWith(newNode);\n } else {\n insertAfter(newNode, previousNode);\n }\n\n previousNode = newNode;\n }\n }\n }\n }\n }\n\n update() {}\n}\n", "import { Context, evalGet } from \"..\";\n\ninterface ShowDirectiveOptions {\n element: Element;\n context: Context;\n expression: string;\n}\n\nexport class ShowDirective {\n element: Element;\n context: Context;\n expression: string;\n originalDisplay: string;\n\n constructor({ element, context, expression }: ShowDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = expression;\n this.originalDisplay = getComputedStyle(this.element).display;\n\n context.effect(this.update.bind(this));\n }\n\n update() {\n const shouldShow = Boolean(evalGet(this.context.scope, this.expression));\n // @ts-ignore\n this.element.style.display = shouldShow ? this.originalDisplay : \"none\";\n }\n}\n", "import { Block, Context } from \"..\";\nimport { nextTick } from \"../util\";\n\nexport function _teleport(el: Element, exp: string, ctx: Context) {\n const anchor = new Comment(\":teleport\");\n el.replaceWith(anchor);\n\n const target = document.querySelector(exp);\n if (!target) {\n console.warn(`teleport target not found: ${exp}`);\n return;\n }\n\n nextTick(() => {\n target.appendChild(el);\n\n const observer = new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n mutation.removedNodes.forEach((removedNode) => {\n if (removedNode.contains(anchor)) {\n el.remove();\n observer.disconnect();\n }\n });\n });\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n\n // Walks the tree of this teleported element.\n new Block({\n element: el,\n parentContext: ctx,\n });\n });\n\n // Return the anchor so walk continues down the tree in the right order.\n return anchor;\n}\n", "import { Context, evalGet, evalSet } from \"..\";\n\ninterface ValueDirectiveOptions {\n element: Element;\n context: Context;\n expression: string;\n}\n\ntype SupportedModelType = \"text\" | \"checkbox\" | \"radio\" | \"number\" | \"password\" | \"color\";\n\nfunction isInput(element: Element): element is HTMLInputElement {\n return element instanceof HTMLInputElement;\n}\n\nfunction isTextarea(element: Element): element is HTMLTextAreaElement {\n return element instanceof HTMLTextAreaElement;\n}\n\nfunction isSelect(element: Element): element is HTMLSelectElement {\n return element instanceof HTMLSelectElement;\n}\n\nexport class ValueDirective {\n element: Element;\n context: Context;\n expression: string;\n inputType: SupportedModelType;\n\n constructor({ element, context, expression }: ValueDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = expression;\n this.inputType = element.getAttribute(\"type\") as SupportedModelType;\n\n // Element -> Context\n if (isInput(element)) {\n switch (this.inputType) {\n case \"text\":\n case \"password\":\n case \"number\":\n case \"color\":\n element.addEventListener(\"input\", () => {\n const value = this.inputType === \"number\" ? (element.value ? parseFloat(element.value) : 0) : element.value;\n evalSet(this.context.scope, expression, value);\n });\n break;\n\n case \"checkbox\":\n element.addEventListener(\"change\", (e: any) => {\n evalSet(this.context.scope, expression, !!e.currentTarget.checked);\n });\n break;\n case \"radio\":\n element.addEventListener(\"change\", (e: any) => {\n if (e.currentTarget.checked) {\n evalSet(this.context.scope, expression, element.getAttribute(\"value\"));\n }\n });\n break;\n default:\n break;\n }\n }\n\n if (isTextarea(element)) {\n element.addEventListener(\"input\", () => {\n evalSet(this.context.scope, expression, element.value);\n });\n }\n\n if (isSelect(element)) {\n element.addEventListener(\"change\", () => {\n evalSet(this.context.scope, expression, element.value);\n });\n }\n\n // Context -> Element\n context.effect(this.updateElementValue.bind(this));\n }\n\n updateElementValue() {\n const value = evalGet(this.context.scope, this.expression, this.element);\n\n if (isInput(this.element)) {\n switch (this.inputType) {\n case \"text\":\n case \"password\":\n case \"number\":\n case \"color\":\n this.element.value = value;\n break;\n case \"checkbox\":\n this.element.checked = !!value;\n break;\n case \"radio\":\n this.element.checked = this.element.value === value;\n break;\n default:\n break;\n }\n }\n\n if (isTextarea(this.element)) {\n this.element.value = value;\n }\n\n if (isSelect(this.element)) {\n this.element.value = value;\n }\n }\n}\n", "interface EffectOptions {\n lazy?: boolean;\n}\n\ninterface EffectFunction {\n active: boolean;\n handler: () => void;\n refs: Set[];\n}\n\ntype Effects = Set;\ntype EffectsMap = Map;\ntype TargetMap = WeakMap;\n\nconst targetMap: TargetMap = new WeakMap();\nconst effectStack: (EffectFunction | undefined)[] = [];\n\nexport function track(target: T, key: PropertyKey) {\n const activeEffect = effectStack[effectStack.length - 1];\n\n if (!activeEffect) return;\n\n let effectsMap = targetMap.get(target);\n if (!effectsMap)\n targetMap.set(target, (effectsMap = new Map() as EffectsMap));\n\n let effects = effectsMap.get(key);\n if (!effects) effectsMap.set(key, (effects = new Set()));\n\n if (!effects.has(activeEffect)) {\n effects.add(activeEffect);\n activeEffect.refs.push(effects);\n }\n}\n\nexport function trigger(target: any, key: PropertyKey) {\n const effectsMap = targetMap.get(target);\n if (!effectsMap) return;\n\n const scheduled = new Set();\n\n effectsMap.get(key)?.forEach((effect) => {\n scheduled.add(effect);\n });\n\n scheduled.forEach(run);\n}\n\nfunction stop(effect: EffectFunction) {\n if (effect.active) cleanup(effect);\n effect.active = false;\n}\n\nfunction start(effect: EffectFunction) {\n if (!effect.active) {\n effect.active = true;\n run(effect);\n }\n}\n\nfunction run(effect: EffectFunction): unknown {\n if (!effect.active) return;\n\n if (effectStack.includes(effect)) return;\n\n cleanup(effect);\n\n let val: unknown;\n\n try {\n effectStack.push(effect);\n val = effect.handler();\n } finally {\n effectStack.pop();\n }\n\n return val;\n}\n\nfunction cleanup(effect: EffectFunction) {\n const { refs } = effect;\n\n if (refs.length) {\n for (const ref of refs) {\n ref.delete(effect);\n }\n }\n\n refs.length = 0;\n}\n\nexport function effect(handler: () => void, opts: EffectOptions = {}) {\n const { lazy } = opts;\n const newEffect: EffectFunction = {\n active: !lazy,\n handler,\n refs: [],\n };\n\n run(newEffect);\n\n return {\n start: () => {\n start(newEffect);\n },\n stop: () => {\n stop(newEffect);\n },\n toggle: () => {\n if (newEffect.active) {\n stop(newEffect);\n } else {\n start(newEffect);\n }\n return newEffect.active;\n },\n };\n}\n", "import { isObject } from \"../util\";\nimport { effect } from \"./effect\";\n\nconst $computed = Symbol(\"computed\");\n\nexport type Computed = {\n readonly value: T;\n readonly [$computed]: true;\n};\n\nexport function isComputed(value: unknown): value is Computed {\n return isObject(value) && value[$computed];\n}\n\nexport function computed(getter: () => T): Computed {\n const ref = {\n get value(): T {\n return getter();\n },\n [$computed]: true,\n } as const;\n\n effect(() => {\n getter();\n });\n\n return ref;\n}\n", "import { isObject } from \"../util\";\nimport { track, trigger } from \"./effect\";\nimport { Reactive, reactive } from \"./reactive\";\n\nexport const $ref = Symbol(\"ref\");\n\nexport type Ref = {\n value: T;\n [$ref]: true;\n};\n\nexport function isRef(value: unknown): value is Ref {\n return isObject(value) && !!value[$ref];\n}\n\nexport function ref(value: T = null as unknown as T): Ref {\n if (isObject(value)) {\n // @ts-ignore\n return isRef(value) ? (value as Ref) : (reactive(value) as Reactive);\n }\n\n const result = { value, [$ref]: true };\n\n return new Proxy(result, {\n get(target: object, key: string | symbol, receiver: any) {\n const val = Reflect.get(target, key, receiver);\n track(result, \"value\");\n return val;\n },\n set(target: object, key: string | symbol, value: unknown) {\n const oldValue = target[key];\n if (oldValue !== value) {\n const success = Reflect.set(target, key, value);\n if (success) {\n trigger(result, \"value\");\n }\n }\n return true;\n },\n }) as Ref;\n}\n", "import { isObject } from \"../util\";\nimport { track, trigger } from \"./effect\";\nimport { ref } from \"./ref\";\n\nconst $reactive = Symbol(\"reactive\");\n\nexport type Reactive = T & { [$reactive]: true };\n\nexport function isReactive(\n value: unknown,\n): value is Reactive {\n return isObject(value) && !!value[$reactive];\n}\n\nexport function reactive(value: T): Reactive {\n // @ts-ignore\n if (!isObject(value)) return ref(value) as Reactive;\n if (value[$reactive]) return value as Reactive;\n\n value[$reactive] = true;\n\n Object.keys(value).forEach((key) => {\n if (isObject(value[key])) {\n value[key] = reactive(value[key]);\n }\n });\n\n return new Proxy(value, reactiveProxyHandler()) as Reactive;\n}\n\nfunction reactiveProxyHandler() {\n return {\n deleteProperty(target: object, key: string | symbol) {\n const had = Reflect.has(target, key);\n const result = Reflect.deleteProperty(target, key);\n if (had) trigger(target, key);\n return result;\n },\n get(target: object, key: string | symbol) {\n track(target, key);\n return Reflect.get(target, key);\n },\n set(target: object, key: string | symbol, value: unknown) {\n if (target[key] === value) return true;\n let newObj = false;\n\n if (isObject(value) && !isObject(target[key])) {\n newObj = true;\n }\n\n if (Reflect.set(target, key, value)) {\n trigger(target, key);\n }\n\n if (newObj) {\n target[key] = reactive(target[key]);\n }\n\n return true;\n },\n };\n}\n", "import { isComputed } from \"./computed\";\nimport { isRef } from \"./ref\";\n\nexport function unwrap(value: unknown) {\n if (isRef(value) || isComputed(value)) {\n return value.value;\n }\n\n if (typeof value === \"function\") {\n return value();\n }\n\n return value;\n}\n", "import { pathToRegexp } from \"path-to-regexp\";\nimport { Route, RouteExpression, RouteMatch } from \".\";\nimport { Plugin } from \"..\";\nimport { App, Block, Component, current } from \"../..\";\nimport { reactive } from \"../../reactivity/reactive\";\nimport { unwrap } from \"../../reactivity/unwrap\";\nimport { html } from \"../../util\";\n\nconst activeRouters = new Set();\n\nconst link = {\n template: html`\n \n LINK \n \n `,\n props: { href: { default: \"#\" } },\n main({ href }: { href: string }) {\n const go = (e: Event) => {\n e.preventDefault();\n\n activeRouters.forEach((router) => {\n router.doRouteChange(unwrap(href as unknown) as string);\n });\n };\n\n const classes = reactive({ \"router-link\": true });\n\n return { go, classes, href };\n },\n};\n\nasync function runEnterTransition(enter: () => boolean | Promise): Promise {\n return await enter();\n}\n\nconst canEnterRoute = async (route: Route) => {\n if (route.beforeEnter) {\n return await runEnterTransition(route.beforeEnter);\n }\n return true;\n};\n\nconst maybeRedirectRoute = (route: Route) => {\n if (route.redirectTo) {\n activeRouters.forEach((plugin) => plugin.doRouteChange(route.redirectTo));\n }\n};\n\nexport class RouterPlugin implements Plugin {\n app: App;\n routes: Route[] = [];\n pathExpressions = new Map();\n lastPath = \"/\";\n knownRouterViews = new Map();\n knownRouterViewNames = new Map();\n populatedRouterViews = new Map();\n\n constructor(routes: Route[] = []) {\n this.routes = routes;\n }\n\n use(app: App, ...config: any[]) {\n this.app = app;\n this.app.register(\"router-link\", link);\n\n window.addEventListener(\"popstate\", this.onHistoryEvent.bind(this));\n window.addEventListener(\"pushstate\", this.onHistoryEvent.bind(this));\n window.addEventListener(\"load\", this.onHistoryEvent.bind(this));\n\n for (const route of this.routes) {\n this.cacheRouteExpression(route);\n }\n\n this.lastPath = `${location.pathname}${location.search}`;\n window.history.replaceState({}, \"\", this.lastPath);\n\n activeRouters.add(this);\n }\n\n compile(element: Element) {\n if (element.nodeType === Node.ELEMENT_NODE && element.nodeName === \"ROUTER-VIEW\" && !this.knownRouterViews.has(element) && current.componentBlock) {\n this.knownRouterViews.set(element, current.componentBlock);\n this.knownRouterViewNames.set(element.getAttribute(\"name\")?.trim() || \"\", element);\n }\n }\n\n onHistoryEvent(e: PopStateEvent | Event) {\n e.preventDefault();\n e.stopImmediatePropagation();\n\n // @ts-ignore\n const path = new URL(e.currentTarget.location.href).pathname;\n\n if (e.type === \"load\") {\n window.history.replaceState({}, \"\", this.lastPath);\n } else if (e.type === \"pushstate\") {\n window.history.replaceState({}, \"\", path);\n } else if (e.type === \"popstate\") {\n window.history.replaceState({}, \"\", path);\n }\n\n this.lastPath = path;\n\n const matches = this.getMatchesForURL(path);\n this.applyMatches(matches);\n }\n\n doRouteChange(to: string) {\n window.history.pushState({}, \"\", to);\n const matches = this.getMatchesForURL(`${location.pathname}${location.search}`);\n this.applyMatches(matches);\n }\n\n getMatchesForURL(url: string): RouteMatch[] {\n let matches: RouteMatch[] = [];\n\n const matchRoutes = (routes: Route[], parentPath: string = \"\", previousParents = []): RouteMatch[] => {\n let parents = [];\n\n for (const route of routes) {\n parents.push(route);\n const path = `${parentPath}${route.path}`.replace(/\\/\\//g, \"/\");\n const match = this.getPathMatch(path, url);\n if (match) matches.push({ match, parents: [...previousParents, ...parents] });\n if (route.children?.length) {\n matchRoutes(route.children, path, [...previousParents, ...parents]);\n parents = [];\n }\n }\n\n return matches;\n };\n matches = matchRoutes(this.routes);\n return matches;\n }\n\n /**\n * getRouteExpression takes a path like \"/users/:id\" and returns a regex\n * and an array of params that match the path.\n * \"/users/:id\" => { regex: /^\\/users\\/([^\\/]+)\\?jwt=(\\w)$/, params: [\"id\"], query: [\"jwt\"] }\n */\n getRouteExpression(path: string, route: Route): RouteExpression {\n if (this.pathExpressions.has(path)) return this.pathExpressions.get(path);\n\n const params = [];\n const regex = pathToRegexp(path, params, { strict: false, sensitive: false, end: true });\n const expression = { regex, params, path, route };\n this.pathExpressions.set(path, expression);\n return expression;\n }\n\n /**\n *\n * @param path A path like /foo/bar/:id\n * @param url A url like /foo/bar/1234\n * @returns A RouteExpression if the URL matches the regex cached for @param path, null otherwise.\n */\n getPathMatch(path: string, url: string): RouteExpression | null {\n if (this.pathExpressions.get(path)) {\n const match = this.pathExpressions.get(path).regex.exec(url);\n if (match) {\n return this.pathExpressions.get(path);\n }\n }\n\n return null;\n }\n\n async applyMatches(matches: RouteMatch[] | null) {\n if (!matches) return;\n\n const usedRouterViews = new Set();\n\n const renderRoutes = async (routeChain: Route[], rootNode?: Element) => {\n for (const route of routeChain) {\n if (route.view) {\n const viewNode = this.knownRouterViewNames.get(route.view);\n if (viewNode && (await canEnterAndRenderRoute(viewNode, route))) {\n continue;\n }\n } else if (rootNode && (await canEnterAndRenderRoute(rootNode, route))) {\n continue;\n }\n }\n };\n\n const canEnterAndRenderRoute = async (node: Element, route: Route) => {\n const canEnter = await canEnterRoute(route);\n if (canEnter) {\n renderRouteAtNode(node, route);\n return true;\n } else {\n if (route.componentFallback) {\n renderRouteAtNode(node, route, route.componentFallback);\n } else {\n maybeRedirectRoute(route);\n }\n\n return false;\n }\n };\n\n const renderRouteAtNode = (node: Element, route: Route, component?: Component) => {\n if (!usedRouterViews.has(node) || this.populatedRouterViews.get(node)?.route !== route) {\n const div = document.createElement(\"div\");\n node.replaceChildren(div);\n\n const target = div.parentElement;\n\n const block = new Block({\n element: div,\n component: component ? component : route.component,\n replacementType: \"replaceChildren\",\n parentContext: current.componentBlock.context,\n });\n\n target.replaceChild(block.element, div);\n\n this.populatedRouterViews.set(node, { block, route });\n\n usedRouterViews.add(node);\n }\n };\n\n for (const match of matches) {\n const routeChain = [...match.parents, match.match.route];\n const uniqueRouteChain = routeChain.filter((route, index, self) => index === self.findIndex((r) => r.path === route.path));\n const rootNode = this.knownRouterViewNames.get(\"\") ?? null;\n await renderRoutes(uniqueRouteChain, rootNode);\n }\n\n // Clean up stale views\n for (const node of this.knownRouterViews.keys()) {\n if (!usedRouterViews.has(node) && this.populatedRouterViews.has(node)) {\n const entry = this.populatedRouterViews.get(node);\n if (entry) {\n entry.block.teardown();\n this.populatedRouterViews.delete(node);\n }\n }\n }\n }\n\n cacheRouteExpression(route: Route, parentPath: string = \"\") {\n const path = `${parentPath}${route.path}`.replace(/\\/\\//g, \"/\");\n this.getRouteExpression(path, route);\n if (route.children?.length) {\n route.children.forEach((child) => {\n this.cacheRouteExpression(child, path);\n });\n }\n }\n\n destroy() {\n window.removeEventListener(\"popstate\", this.onHistoryEvent.bind(this));\n window.removeEventListener(\"pushstate\", this.onHistoryEvent.bind(this));\n window.removeEventListener(\"load\", this.onHistoryEvent.bind(this));\n }\n}\n", "import { AttributeDirective } from \"./directives/attribute\";\nimport { EventDirective } from \"./directives/event\";\nimport { _for } from \"./directives/for\";\nimport { _if } from \"./directives/if\";\nimport { InterpolationDirective } from \"./directives/interpolation\";\nimport { ShowDirective } from \"./directives/show\";\nimport { _teleport } from \"./directives/teleport\";\nimport { ValueDirective } from \"./directives/value\";\nimport { Plugin } from \"./plugins\";\nimport { isComputed } from \"./reactivity/computed\";\nimport { effect as _effect } from \"./reactivity/effect\";\nimport { reactive } from \"./reactivity/reactive\";\nimport { isRef } from \"./reactivity/ref\";\nimport { checkAndRemoveAttribute, componentHasPropByName, extractPropName, findSlotNodes, findTemplateNodes, isElement, isEventAttribute, isMirrorProp, isObject, isPropAttribute, isRegularProp, isSpreadProp, isText, Slot, stringToElement, Template, toDisplayString } from \"./util\";\n\nexport * from \"./plugins\";\nexport * from \"./plugins/router\";\n\nexport function provide(key: string, value: unknown) {\n if (!current.componentBlock) {\n console.warn(\"Can't provide: no current component block\");\n }\n\n current.componentBlock.provides.set(key, value);\n}\n\nexport function inject(key: string) {\n if (!current.componentBlock) {\n console.warn(\"Can't inject: no current component block\");\n }\n\n let c = current.componentBlock;\n\n while (c) {\n if (c.provides.has(key)) {\n return c.provides.get(key);\n }\n\n c = c.parentComponentBlock;\n }\n\n return undefined;\n}\n\nexport class App {\n rootBlock: Block;\n registry = new Map();\n plugins = new Set();\n\n register(name: string, component: Component) {\n this.registry.set(name, component);\n }\n\n use(plugin: Plugin, ...config: any[]) {\n this.plugins.add(plugin);\n plugin.use(this, ...config);\n }\n\n getComponent(tag: string) {\n return this.registry.get(tag);\n }\n\n mount(component: Component, target: string | HTMLElement = \"body\", props: Record = {}) {\n const root = typeof target === \"string\" ? (document.querySelector(target) as HTMLElement) : target;\n const display = root.style.display;\n root.style.display = \"none\";\n this.rootBlock = this._mount(component, root, props, true);\n root.style.display = display;\n return this.rootBlock;\n }\n\n private _mount(component: Component, target: HTMLElement, props: Record, isRoot = false) {\n const parentContext = createContext({ app: this });\n\n if (props) {\n parentContext.scope = reactive(props);\n bindContextMethods(parentContext.scope);\n }\n\n parentContext.scope.$isRef = isRef;\n parentContext.scope.$isComputed = isComputed;\n\n const block = new Block({\n element: target,\n parentContext,\n component,\n isRoot,\n componentProps: props,\n replacementType: \"replaceChildren\",\n });\n\n return block;\n }\n\n unmount() {\n this.rootBlock.teardown();\n }\n}\n\nexport interface Context {\n key?: any;\n app: App;\n scope: Record;\n blocks: Block[];\n effects: Array>;\n effect: typeof _effect;\n slots: Slot[];\n templates: Template[];\n}\n\ninterface CreateContextOptions {\n parentContext?: Context;\n app?: App;\n}\n\nexport function createContext({ parentContext, app }: CreateContextOptions): Context {\n const context: Context = {\n app: app ? app : parentContext && parentContext.app ? parentContext.app : null,\n // scope: parentContext ? parentContext.scope : reactive({}),\n scope: reactive({}),\n blocks: [],\n effects: [],\n slots: [],\n templates: parentContext ? parentContext.templates : [],\n effect: (handler: () => void) => {\n const e = _effect(handler);\n context.effects.push(e);\n return e;\n },\n };\n\n return context;\n}\n\nexport const createScopedContext = (ctx: Context, data = {}): Context => {\n const parentScope = ctx.scope;\n const mergedScope = Object.create(parentScope);\n Object.defineProperties(mergedScope, Object.getOwnPropertyDescriptors(data));\n let proxy: any;\n proxy = reactive(\n new Proxy(mergedScope, {\n set(target, key, val, receiver) {\n // when setting a property that doesn't exist on current scope,\n // do not create it on the current scope and fallback to parent scope.\n if (receiver === proxy && !target.hasOwnProperty(key)) {\n return Reflect.set(parentScope, key, val);\n }\n return Reflect.set(target, key, val, receiver);\n },\n }),\n );\n\n bindContextMethods(proxy);\n\n const out: Context = {\n ...ctx,\n scope: {\n ...ctx.scope,\n ...proxy,\n },\n };\n\n return out;\n};\n\nfunction bindContextMethods(scope: Record) {\n for (const key of Object.keys(scope)) {\n if (typeof scope[key] === \"function\") {\n scope[key] = scope[key].bind(scope);\n }\n }\n}\n\nfunction mergeProps(props: Record, defaultProps: Record) {\n const merged = {};\n\n Object.keys(defaultProps).forEach((defaultProp) => {\n const propValue = props.hasOwnProperty(defaultProp) ? props[defaultProp] : defaultProps[defaultProp]?.default;\n\n merged[defaultProp] = reactive(typeof propValue === \"function\" ? propValue() : propValue);\n });\n\n return merged;\n}\n\nexport interface Component {\n template: string;\n props?: Record;\n main?: (props?: Record) => Record | void;\n}\n\ninterface Current {\n componentBlock?: Block;\n}\n\nexport const current: Current = { componentBlock: undefined };\n\ninterface BlockOptions {\n element: Element;\n isRoot?: boolean;\n replacementType?: \"replace\" | \"replaceChildren\";\n componentProps?: Record;\n allProps?: Record;\n parentContext?: Context;\n component?: Component;\n parentComponentBlock?: Block;\n templates?: Template[];\n}\n\nexport class Block {\n element: Element;\n context: Context;\n parentContext: Context;\n component: Component;\n provides = new Map();\n parentComponentBlock: Block | undefined;\n componentProps: Record;\n allProps: Record;\n\n isFragment: boolean;\n start?: Text;\n end?: Text;\n key?: any;\n\n constructor(opts: BlockOptions) {\n this.isFragment = opts.element instanceof HTMLTemplateElement;\n this.parentComponentBlock = opts.parentComponentBlock;\n\n if (opts.component) {\n current.componentBlock = this;\n this.element = stringToElement(opts.component.template);\n } else {\n if (this.isFragment) {\n this.element = (opts.element as HTMLTemplateElement).content.cloneNode(true) as Element;\n } else if (typeof opts.element === \"string\") {\n this.element = stringToElement(opts.element);\n } else {\n this.element = opts.element.cloneNode(true) as Element;\n opts.element.replaceWith(this.element);\n }\n }\n\n if (opts.isRoot) {\n this.context = opts.parentContext;\n } else {\n this.parentContext = opts.parentContext ? opts.parentContext : createContext({});\n this.parentContext.blocks.push(this);\n this.context = createContext({ parentContext: opts.parentContext });\n }\n\n if (opts.component) {\n this.componentProps = mergeProps(opts.componentProps ?? {}, opts.component.props ?? {});\n\n if (opts.component.main) {\n this.context.scope = {\n ...(opts.component.main(this.componentProps) || {}),\n };\n }\n }\n\n opts.allProps?.forEach((prop) => {\n if (prop.isBind) {\n this.context.effect(() => {\n let newValue: unknown;\n\n if (prop.isSpread) {\n const spreadProps = evalGet(this.parentContext.scope, prop.extractedName);\n if (isObject(spreadProps)) {\n Object.keys(spreadProps).forEach((key) => {\n newValue = spreadProps[key];\n this.setProp(key, newValue);\n });\n }\n } else {\n newValue = prop.isMirror ? evalGet(this.parentContext.scope, prop.extractedName) : evalGet(this.parentContext.scope, prop.exp);\n this.setProp(prop.extractedName, newValue);\n }\n });\n }\n });\n\n // Capture slots\n this.context.slots = findSlotNodes(this.element);\n this.context.templates = opts.templates ?? [];\n\n // Put templates into slots\n this.context.slots.forEach((slot) => {\n const template = this.context.templates.find((t) => t.targetSlotName === slot.name);\n\n if (template) {\n const templateContents = template.node.content.cloneNode(true);\n slot.node.replaceWith(templateContents);\n }\n });\n\n this.context.scope.$isRef = isRef;\n this.context.scope.$isComputed = isComputed;\n\n walk(this.element, this.context);\n\n if (opts.component) {\n if (opts.replacementType === \"replace\") {\n if (opts.element instanceof HTMLElement) {\n opts.element.replaceWith(this.element);\n }\n } else {\n if (opts.element instanceof HTMLElement) {\n opts.element.replaceChildren(this.element);\n }\n }\n }\n }\n\n setProp(name: string, value: unknown) {\n if (isRef(this.componentProps[name])) {\n this.componentProps[name].value = value;\n } else {\n this.componentProps[name] = value;\n }\n }\n\n insert(parent: Element, anchor: Node | null = null) {\n if (this.isFragment) {\n if (this.start) {\n // Already inserted, moving\n let node: Node | null = this.start;\n let next: Node | null;\n\n while (node) {\n next = node.nextSibling;\n parent.insertBefore(node, anchor);\n\n if (node === this.end) {\n break;\n }\n\n node = next;\n }\n } else {\n this.start = new Text(\"\");\n this.end = new Text(\"\");\n\n parent.insertBefore(this.end, anchor);\n parent.insertBefore(this.start, this.end);\n parent.insertBefore(this.element, this.end);\n }\n } else {\n parent.insertBefore(this.element, anchor);\n }\n }\n\n remove() {\n if (this.parentContext) {\n const i = this.parentContext.blocks.indexOf(this);\n\n if (i > -1) {\n this.parentContext.blocks.splice(i, 1);\n }\n }\n\n if (this.start) {\n const parent = this.start.parentNode!;\n let node: Node | null = this.start;\n let next: Node | null;\n\n while (node) {\n next = node.nextSibling;\n parent.removeChild(node);\n\n if (node === this.end) {\n break;\n }\n\n node = next;\n }\n } else {\n // this.element.parentNode!.removeChild(this.element);\n this.element.remove();\n }\n\n this.teardown();\n }\n\n teardown() {\n this.context.blocks.forEach((block) => {\n block.teardown();\n });\n\n this.context.effects.forEach(stop);\n }\n}\n\nfunction isComponent(element: Element, context: Context) {\n return !!context.app.getComponent(element.tagName.toLowerCase());\n}\n\nfunction warnInvalidDirectives(node: Element, directives: string[]): boolean {\n if (directives.every((d) => node.hasAttribute(d))) {\n console.warn(`These directives cannot be used together on the same node:`, directives);\n console.warn(\"Node ignored:\", node);\n return true;\n }\n\n return false;\n}\n\nfunction walk(node: Node, context: Context) {\n if (isText(node)) {\n new InterpolationDirective({ element: node, context });\n return;\n }\n\n if (isElement(node)) {\n let exp: string | null;\n\n const handleDirectives = (node: Element, context: Context, component?: Component, componentProps?: Record, allProps?: any[]) => {\n if (warnInvalidDirectives(node, [\":if\", \":for\"])) return;\n if (warnInvalidDirectives(node, [\":if\", \":teleport\"])) return;\n if (warnInvalidDirectives(node, [\":for\", \":teleport\"])) return;\n\n // e.g.
\n // In this case, the scope is merged into context.scope and will overwrite\n // anything returned from `main`.\n if ((exp = checkAndRemoveAttribute(node, \":scope\"))) {\n const scope = evalGet(context.scope, exp);\n if (typeof scope === \"object\") {\n Object.assign(context.scope, scope);\n // context = createScopedContext(context, scope);\n }\n }\n\n if ((exp = checkAndRemoveAttribute(node, \":teleport\"))) {\n return _teleport(node, exp, context);\n }\n if ((exp = checkAndRemoveAttribute(node, \":if\"))) {\n return _if(node, exp, context, component, componentProps, allProps);\n }\n if ((exp = checkAndRemoveAttribute(node, \":for\"))) {\n return _for(node, exp, context, component, componentProps, allProps);\n }\n if ((exp = checkAndRemoveAttribute(node, \":show\"))) {\n new ShowDirective({ element: node, context, expression: exp });\n }\n if ((exp = checkAndRemoveAttribute(node, \":ref\"))) {\n context.scope[exp].value = node;\n }\n if ((exp = checkAndRemoveAttribute(node, \":value\"))) {\n new ValueDirective({ element: node, context, expression: exp });\n }\n if ((exp = checkAndRemoveAttribute(node, \":html\"))) {\n context.effect(() => {\n const result = evalGet(context.scope, exp);\n if (result instanceof Element) {\n node.replaceChildren();\n node.append(result);\n } else {\n node.innerHTML = result;\n }\n });\n }\n if ((exp = checkAndRemoveAttribute(node, \":text\"))) {\n context.effect(() => {\n node.textContent = toDisplayString(evalGet(context.scope, exp));\n });\n }\n };\n\n const processAttributes = (node: Element, component?: Component) => {\n return Array.from(node.attributes)\n .filter((attr) => isSpreadProp(attr.name) || isMirrorProp(attr.name) || (isRegularProp(attr.name) && componentHasPropByName(extractPropName(attr.name), component)))\n .map((attr) => ({\n isMirror: isMirrorProp(attr.name),\n isSpread: isSpreadProp(attr.name),\n isBind: attr.name.includes(\"bind\"),\n originalName: attr.name,\n extractedName: extractPropName(attr.name),\n exp: attr.value,\n value: isMirrorProp(attr.name) ? evalGet(context.scope, extractPropName(attr.name)) : attr.value ? evalGet(context.scope, attr.value) : undefined,\n }));\n };\n\n if (isComponent(node, context)) {\n const component = context.app.getComponent(node.tagName.toLowerCase());\n const allProps = processAttributes(node, component);\n\n const componentProps = allProps.reduce((acc, { isSpread, isMirror, extractedName, value }) => {\n if (isSpread) {\n const spread = evalGet(context.scope, extractedName);\n if (isObject(spread)) Object.assign(acc, spread);\n } else if (isMirror) {\n acc[extractedName] = evalGet(context.scope, extractedName);\n } else {\n acc[extractedName] = value;\n }\n return acc;\n }, {});\n\n const next = handleDirectives(node, context, component, componentProps, allProps);\n if (next) return next;\n\n const templates = findTemplateNodes(node);\n\n return new Block({\n element: node,\n parentContext: context,\n component,\n replacementType: \"replace\",\n parentComponentBlock: current.componentBlock,\n templates,\n componentProps,\n allProps,\n }).element;\n }\n\n const next = handleDirectives(node, context);\n if (next) return next;\n\n Array.from(node.attributes).forEach((attr) => {\n if (isPropAttribute(attr.name)) {\n new AttributeDirective({ element: node, context, attr });\n }\n\n if (isEventAttribute(attr.name)) {\n new EventDirective({ element: node, context, attr });\n }\n });\n\n walkChildren(node, context);\n }\n}\n\nfunction walkChildren(node: Node, context: Context) {\n let child = node.firstChild;\n\n while (child) {\n child = walk(child, context) || child.nextSibling;\n }\n}\n\nconst evalFuncCache: Record = {};\n\nexport function evalGet(scope: any, exp: string, el?: Node) {\n if (!exp.trim()) return undefined;\n return execute(scope, `const ___value = (${exp.trim()}); return ___value;`, el);\n}\n\nexport function evalSet(scope: any, exp: string, value: unknown) {\n value = typeof value === \"string\" ? `\"${value}\"` : value;\n return execute(scope, `const ___target = (${exp.trim()}); return $isRef(___target) ? ___target.value = ${value} : ___target = ${value};`, null, false);\n}\n\nfunction execute(scope: any, exp: string, el?: Node, flatRefs = true) {\n const newScope = flatRefs ? flattenRefs(scope) : scope;\n const fn = evalFuncCache[exp] || (evalFuncCache[exp] = toFunction(exp));\n\n try {\n return fn(newScope, el);\n } catch (e) {\n console.warn(`Error evaluating expression: \"${exp}\":`);\n console.error(e);\n }\n}\n\n// Function to convert expression strings to functions\nfunction toFunction(exp: string) {\n try {\n return new Function(\"$data\", \"$el\", `with($data){${exp}}`);\n } catch (e) {\n console.error(`${(e as Error).message} in expression: ${exp}`);\n return () => {};\n }\n}\n\n// Map all ref properties in scope to their `.value`\nfunction flattenRefs(scope: any): any {\n const mapped = {};\n\n for (const key in scope) {\n if (scope.hasOwnProperty(key)) {\n // Check if the value is a Ref\n if (isRef(scope[key])) {\n mapped[key] = scope[key].value;\n } else {\n mapped[key] = scope[key];\n }\n }\n }\n return mapped;\n}\n", "import { App } from \".\";\nimport { ref } from \"./reactivity/ref\";\nimport { html } from \"./util\";\n\n// ------------------------------------------------\n// Slots, multiple default and named, :if and :for\n// const card = {\n// template: html`\n//
\n// \n// `,\n// };\n\n// const main = {\n// template: html`\n// \n//
card below \n// \n// card title\n// Card body content \n// \n// \n// `,\n// };\n\n// const app = new App();\n// app.register(\"card\", card);\n// app.mount(main, \"#app\");\n\n// ------------------------------------------------\n// Slots, multiple default and named, :if and :for\n// const app = new App();\n\n// const parent = {\n// template: html`\n// \n//
parent \n//
\n// \n// \n// content 1 always shown\n// \n// content 2, animals:\n//
animal: {{animal}}
\n//
\n\n// \n// card body from parent \n// \n//
\n// `,\n// main() {\n// const bool = ref(true);\n// const animals = reactive([\"dog\", \"cat\", \"bear\"]);\n\n// setInterval(() => {\n// bool.value = !bool.value;\n// }, 2000);\n\n// return { bool, animals };\n// },\n// };\n// const card = {\n// template: html`\n//
card \n// \n// \n// `,\n// };\n// app.register(\"card\", card);\n// const parentBlock = app.mount(parent, \"body\");\n// const cardBlock = parentBlock.context.blocks[0];\n\n// ------------------------------------------------\n// Component pros, mirror and spread, bind and no bind\n// const child = {\n// template: html`Animal: {{animal}} {{index}}
`,\n// props: { animal: { default: \"cat\" }, index: { default: 0 } },\n// main({ animal, index }) {\n// return { animal, index };\n// },\n// };\n\n// const parent = {\n// template: html`\n// \n//
\n// mirror, no bind:\n//
\n//
\n// mirror, bind:\n//
\n//
\n// spread, no bind:\n//
\n//
\n// spread, bind:\n//
\n//
\n// regular prop:\n//
\n//
\n// regular prop, bind:\n//
\n//
\n//
div has \"id\" set to animal.value
\n//
\n//
div has \"id\" set and bound to animal.value
\n//
\n//
div has \"animal\" set to animal.value
\n//
\n//
div has \"animal\" set and bound to animal.value
\n//
\n//
div has \"animal\" spread
\n//
\n//
div has \"animal\" spread and bound
\n//
\n//
\n//
\n//
\n// if bool, mirror, no bind:\n//
\n// if bool, mirror, bind:\n//
\n//
\n// for list, mirror, no bind:\n//
\n//
\n// for list, mirror, bind:\n//
\n// if bool, for list, mirror, no bind: these have the value \"DOG!\" because by the time for :for directive is evaluated, animal.value is \"DOG!\", and no longer \"dog\".\n//
\n// \n//
\n//
\n// `,\n// main() {\n// const bool = ref(false);\n// const animal = ref(\"dog\");\n// const spread = reactive({ animal: \"panther\" });\n// const list = reactive([1, 2, 3]);\n\n// setTimeout(() => {\n// spread.animal = \"PANTHER!\";\n// animal.value = \"DOG!\";\n// bool.value = true;\n// }, 500);\n\n// setTimeout(() => {\n// animal.value = \"DOG!!!!!\";\n// }, 1000);\n\n// return { animal, spread, bool, list };\n// },\n// };\n\n// const app = new App();\n// app.register(\"child\", child);\n// app.mount(parent, \"#app\");\n\n// ------------------------------------------------\n// Event directive\n// const counter = {\n// template: html`\n// \n//
true
\n//
Count: {{count}}{{count >= 2 ? '!!!' : ''}} \n//
+ \n//
- \n//
\n// `,\n// main() {\n// const count = ref(0);\n// const style = reactive({ color: \"gray\" });\n// const increment = () => count.value++;\n// const decrement = () => count.value--;\n\n// setInterval(() => {\n// style.color = style.color === \"gray\" ? \"white\" : \"gray\";\n// }, 500);\n\n// return { count, increment, decrement, style };\n// },\n// };\n\n// const app = new App();\n// app.mount(counter, \"#app\");\n\n// ------------------------------------------------\n// Template\n// const main = {\n// template: html`\n// \n// `,\n// main() {\n// const items = reactive([1, 2, 3, 4, 5]);\n// const bool = ref(true);\n// setInterval(() => (bool.value = !bool.value), 250);\n// return { items, bool };\n// },\n// };\n\n// const app = new App();\n// app.mount(main, \"#app\");\n\n// ------------------------------------------------\n// :html\n// const main = {\n// template: html`
`,\n// main() {\n// const html = ref(\"hello \");\n\n// setTimeout(() => {\n// if (html.value === \"hello \") {\n// html.value = \"world \";\n// }\n// }, 1000);\n\n// return { html };\n// },\n// };\n\n// const app = new App();\n// app.mount(main, \"#app\");\n\n// ------------------------------------------------\n// Colors from css framework\n// const main = {\n// template: html`\n// \n//
Colors \n//
\n// \n//
\n//
{{variant}}-{{rank}}
\n//
\n//
\n// \n//
\n// `,\n// main() {\n// const ranks = reactive([\"5\", \"10\", \"20\", \"30\", \"40\", \"50\", \"60\", \"70\", \"80\", \"90\"]);\n// const basesReverse = computed(() => Array.from(ranks).reverse());\n// const bg = (variant: string, rank: string, index: number) => ({ backgroundColor: `var(--${variant}-${rank})`, color: `var(--${variant}-${basesReverse.value[index]})` });\n\n// return { ranks, bg };\n// },\n// };\n\n// const app = new App();\n// app.mount(main, \"#app\");\n\n// ------------------------------------------------\n// :scope\nconst child = {\n template: html`\n \n hello from child, food: \"{{food}}\" (does not inherit)\n
\n \n
\n
\n `,\n main() {\n const food = ref(\"\uD83C\uDF54\");\n return { food };\n },\n};\n\nconst main = {\n template: html`\n \n
\n \n
Scoped data: {{food}}
\n
Child slot, food: {{food}} \n
No pizza \uD83D\uDE22
\n
Pizza!
\n
\n
\n `,\n main() {\n return { food: ref(\"nothing\") };\n },\n};\n\nconst app = new App();\napp.register(\"child\", child);\napp.mount(main, \"#app\");\n"],
+ "mappings": ";AAEO,SAAS,gBAAgB,UAA2B;AACzD,QAAM,SAAS,IAAI,UAAU;AAC7B,QAAM,MAAM,OAAO,gBAAgB,UAAU,WAAW;AACxD,SAAO,IAAI,KAAK;AAClB;AAEO,IAAM,SAAS,CAAC,SAA6B;AAClD,SAAO,KAAK,aAAa,KAAK;AAChC;AAEO,IAAM,aAAa,CAAC,SAA4C;AACrE,SAAO,KAAK,aAAa;AAC3B;AAEO,IAAM,YAAY,CAAC,SAAgC;AACxD,SAAO,KAAK,aAAa,KAAK;AAChC;AAEO,SAAS,SAAS,OAA6B;AACpD,SAAO,UAAU,QAAQ,OAAO,UAAU;AAC5C;AAEO,SAAS,QAAQ,OAA4B;AAClD,SAAO,MAAM,QAAQ,KAAK;AAC5B;AAEO,SAAS,wBAAwB,IAAa,UAAiC;AAE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,MAAM,MAAM,MAAM;",
+ "names": ["node", "element", "_", "ctx", "ref", "i", "exp", "el", "effect", "stop", "ref", "value", "App", "app", "node", "context", "next", "child", "App"]
+}
diff --git a/public/index.css b/public/index.css
new file mode 100644
index 0000000..fb6e027
--- /dev/null
+++ b/public/index.css
@@ -0,0 +1 @@
+:root{--amber-5:oklch(.99 .02 78);--amber-10:oklch(.97 .06 78);--amber-20:oklch(.94 .11 78);--amber-30:oklch(.91 .16 78);--amber-40:oklch(.86 .2 78);--amber-50:oklch(.79 .23 78);--amber-60:oklch(.72 .21 78);--amber-70:oklch(.62 .19 78);--amber-80:oklch(.51 .17 78);--amber-90:oklch(.38 .15 78);--amber-95:oklch(.23 .13 78);--blue-5:oklch(.99 .02 260);--blue-10:oklch(.92 .06 260);--blue-20:oklch(.85 .11 260);--blue-30:oklch(.78 .16 260);--blue-40:oklch(.71 .2 260);--blue-50:oklch(.64 .23 260);--blue-60:oklch(.56 .21 260);--blue-70:oklch(.48 .19 260);--blue-80:oklch(.40 .17 260);--blue-90:oklch(.32 .15 260);--blue-95:oklch(.24 .13 260);--cyan-5:oklch(.99 .02 205);--cyan-10:oklch(.94 .06 205);--cyan-20:oklch(.89 .11 205);--cyan-30:oklch(.83 .16 205);--cyan-40:oklch(.77 .2 205);--cyan-50:oklch(.70 .23 205);--cyan-60:oklch(.62 .21 205);--cyan-70:oklch(.54 .19 205);--cyan-80:oklch(.45 .17 205);--cyan-90:oklch(.34 .15 205);--cyan-95:oklch(.23 .13 205);--emerald-5:oklch(.99 .02 169);--emerald-10:oklch(.95 .06 169);--emerald-20:oklch(.91 .11 169);--emerald-30:oklch(.86 .16 169);--emerald-40:oklch(.81 .2 169);--emerald-50:oklch(.74 .23 169);--emerald-60:oklch(.66 .21 169);--emerald-70:oklch(.57 .19 169);--emerald-80:oklch(.47 .17 169);--emerald-90:oklch(.36 .15 169);--emerald-95:oklch(.23 .13 169);--fuchsia-5:oklch(.99 .02 322);--fuchsia-10:oklch(.93 .06 322);--fuchsia-20:oklch(.87 .11 322);--fuchsia-30:oklch(.80 .16 322);--fuchsia-40:oklch(.73 .2 322);--fuchsia-50:oklch(.66 .23 322);--fuchsia-60:oklch(.59 .21 322);--fuchsia-70:oklch(.51 .19 322);--fuchsia-80:oklch(.42 .17 322);--fuchsia-90:oklch(.33 .15 322);--fuchsia-95:oklch(.24 .13 322);--green-5:oklch(.99 .02 150);--green-10:oklch(.96 .06 150);--green-20:oklch(.93 .11 150);--green-30:oklch(.88 .16 150);--green-40:oklch(.83 .2 150);--green-50:oklch(.76 .23 150);--green-60:oklch(.68 .21 150);--green-70:oklch(.59 .19 150);--green-80:oklch(.49 .17 150);--green-90:oklch(.37 .15 150);--green-95:oklch(.23 .13 150);--indigo-5:oklch(.99 .02 275);--indigo-10:oklch(.92 .06 275);--indigo-20:oklch(.84 .11 275);--indigo-30:oklch(.77 .16 275);--indigo-40:oklch(.69 .2 275);--indigo-50:oklch(.62 .23 275);--indigo-60:oklch(.54 .21 275);--indigo-70:oklch(.47 .19 275);--indigo-80:oklch(.39 .17 275);--indigo-90:oklch(.32 .15 275);--indigo-95:oklch(.24 .13 275);--lavender-5:oklch(.99 .02 285);--lavender-10:oklch(.92 .06 285);--lavender-20:oklch(.84 .11 285);--lavender-30:oklch(.77 .16 285);--lavender-40:oklch(.69 .2 285);--lavender-50:oklch(.62 .23 285);--lavender-60:oklch(.54 .21 285);--lavender-70:oklch(.47 .19 285);--lavender-80:oklch(.39 .17 285);--lavender-90:oklch(.32 .15 285);--lavender-95:oklch(.24 .13 285);--lime-5:oklch(.99 .02 127);--lime-10:oklch(.97 .06 127);--lime-20:oklch(.94 .11 127);--lime-30:oklch(.90 .16 127);--lime-40:oklch(.85 .2 127);--lime-50:oklch(.79 .23 127);--lime-60:oklch(.71 .21 127);--lime-70:oklch(.62 .19 127);--lime-80:oklch(.50 .17 127);--lime-90:oklch(.38 .15 127);--lime-95:oklch(.23 .13 127);--orange-5:oklch(.99 .02 55);--orange-10:oklch(.96 .06 55);--orange-20:oklch(.93 .11 55);--orange-30:oklch(.89 .16 55);--orange-40:oklch(.83 .2 55);--orange-50:oklch(.77 .23 55);--orange-60:oklch(.69 .21 55);--orange-70:oklch(.60 .19 55);--orange-80:oklch(.49 .17 55);--orange-90:oklch(.37 .15 55);--orange-95:oklch(.23 .13 55);--peach-5:oklch(.99 .02 35);--peach-10:oklch(.96 .06 35);--peach-20:oklch(.92 .11 35);--peach-30:oklch(.87 .16 35);--peach-40:oklch(.81 .2 35);--peach-50:oklch(.75 .23 35);--peach-60:oklch(.67 .21 35);--peach-70:oklch(.58 .19 35);--peach-80:oklch(.48 .17 35);--peach-90:oklch(.36 .15 35);--peach-95:oklch(.23 .13 35);--pink-5:oklch(.99 .02 354);--pink-10:oklch(.94 .06 354);--pink-20:oklch(.89 .11 354);--pink-30:oklch(.83 .16 354);--pink-40:oklch(.77 .2 354);--pink-50:oklch(.70 .23 354);--pink-60:oklch(.62 .21 354);--pink-70:oklch(.54 .19 354);--pink-80:oklch(.44 .17 354);--pink-90:oklch(.34 .15 354);--pink-95:oklch(.23 .13 354);--plum-5:oklch(.99 .02 310);--plum-10:oklch(.93 .06 310);--plum-20:oklch(.86 .11 310);--plum-30:oklch(.79 .16 310);--plum-40:oklch(.72 .2 310);--plum-50:oklch(.65 .23 310);--plum-60:oklch(.57 .21 310);--plum-70:oklch(.49 .19 310);--plum-80:oklch(.41 .17 310);--plum-90:oklch(.33 .15 310);--plum-95:oklch(.24 .13 310);--purple-5:oklch(.99 .02 304);--purple-10:oklch(.92 .06 304);--purple-20:oklch(.86 .11 304);--purple-30:oklch(.79 .16 304);--purple-40:oklch(.71 .2 304);--purple-50:oklch(.64 .23 304);--purple-60:oklch(.57 .21 304);--purple-70:oklch(.49 .19 304);--purple-80:oklch(.41 .17 304);--purple-90:oklch(.32 .15 304);--purple-95:oklch(.24 .13 304);--red-5:oklch(.99 .02 25);--red-10:oklch(.95 .06 25);--red-20:oklch(.91 .11 25);--red-30:oklch(.86 .16 25);--red-40:oklch(.80 .2 25);--red-50:oklch(.73 .23 25);--red-60:oklch(.66 .21 25);--red-70:oklch(.57 .19 25);--red-80:oklch(.47 .17 25);--red-90:oklch(.36 .15 25);--red-95:oklch(.23 .13 25);--rose-5:oklch(.99 .02 17);--rose-10:oklch(.95 .06 17);--rose-20:oklch(.90 .11 17);--rose-30:oklch(.85 .16 17);--rose-40:oklch(.79 .2 17);--rose-50:oklch(.72 .23 17);--rose-60:oklch(.65 .21 17);--rose-70:oklch(.56 .19 17);--rose-80:oklch(.46 .17 17);--rose-90:oklch(.35 .15 17);--rose-95:oklch(.23 .13 17);--sky-5:oklch(.99 .02 225);--sky-10:oklch(.93 .06 225);--sky-20:oklch(.88 .11 225);--sky-30:oklch(.81 .16 225);--sky-40:oklch(.75 .2 225);--sky-50:oklch(.68 .23 225);--sky-60:oklch(.60 .21 225);--sky-70:oklch(.52 .19 225);--sky-80:oklch(.43 .17 225);--sky-90:oklch(.34 .15 225);--sky-95:oklch(.24 .13 225);--teal-5:oklch(.99 .02 185);--teal-10:oklch(.95 .06 185);--teal-20:oklch(.90 .11 185);--teal-30:oklch(.85 .16 185);--teal-40:oklch(.79 .2 185);--teal-50:oklch(.72 .23 185);--teal-60:oklch(.65 .21 185);--teal-70:oklch(.56 .19 185);--teal-80:oklch(.46 .17 185);--teal-90:oklch(.35 .15 185);--teal-95:oklch(.23 .13 185);--violet-5:oklch(.99 .02 293);--violet-10:oklch(.92 .06 293);--violet-20:oklch(.85 .11 293);--violet-30:oklch(.78 .16 293);--violet-40:oklch(.70 .2 293);--violet-50:oklch(.63 .23 293);--violet-60:oklch(.55 .21 293);--violet-70:oklch(.48 .19 293);--violet-80:oklch(.40 .17 293);--violet-90:oklch(.32 .15 293);--violet-95:oklch(.24 .13 293);--yellow-5:oklch(.99 .02 98);--yellow-10:oklch(.98 .06 98);--yellow-20:oklch(.96 .11 98);--yellow-30:oklch(.93 .16 98);--yellow-40:oklch(.88 .2 98);--yellow-50:oklch(.82 .23 98);--yellow-60:oklch(.74 .21 98);--yellow-70:oklch(.64 .19 98);--yellow-80:oklch(.52 .17 98);--yellow-90:oklch(.39 .15 98);--yellow-95:oklch(.23 .13 98)}.border-color-5{border-color:light-dark(var( --base-90 ),var( --base-5 ))}.border-color-10{border-color:light-dark(var( --base-80 ),var( --base-10 ))}.border-color-20{border-color:light-dark(var( --base-70 ),var( --base-20 ))}.border-color-30{border-color:light-dark(var( --base-60 ),var( --base-30 ))}.border-color-40{border-color:light-dark(var( --base-50 ),var( --base-40 ))}.border-color-50{border-color:light-dark(var( --base-40 ),var( --base-50 ))}.border-color-60{border-color:light-dark(var( --base-30 ),var( --base-60 ))}.border-color-70{border-color:light-dark(var( --base-20 ),var( --base-70 ))}.border-color-80{border-color:light-dark(var( --base-10 ),var( --base-80 ))}.border-color-90{border-color:light-dark(var( --base-5 ),var( --base-90 ))}.border-1px{border-width:1px}.border-2px{border-width:2px}.border-3px{border-width:3px}.border-4px{border-width:4px}.border-5px{border-width:5px}.border-radius-0{border-radius:0}.border-radius-0_125{border-radius:.125rem}.border-radius-0_25{border-radius:.25rem}.border-radius-0_5{border-radius:.5rem}.border-radius-0_625{border-radius:.625rem}.border-radius-0_75{border-radius:.75rem}.border-radius-1{border-radius:1rem}.border-radius-full{border-radius:100%}.border-top-left-radius-0{border-top-left-radius:0}.border-top-left-radius-0_125{border-top-left-radius:.125rem}.border-top-left-radius-0_25{border-top-left-radius:.25rem}.border-top-left-radius-0_5{border-top-left-radius:.5rem}.border-top-left-radius-0_625{border-top-left-radius:.625rem}.border-top-left-radius-0_75{border-top-left-radius:.75rem}.border-top-left-radius-1{border-top-left-radius:1rem}.border-top-left-radius-full{border-top-left-radius:100%}.border-top-right-radius-0{border-top-right-radius:0}.border-top-right-radius-0_125{border-top-right-radius:.125rem}.border-top-right-radius-0_25{border-top-right-radius:.25rem}.border-top-right-radius-0_5{border-top-right-radius:.5rem}.border-top-right-radius-0_625{border-top-right-radius:.625rem}.border-top-right-radius-0_75{border-top-right-radius:.75rem}.border-top-right-radius-1{border-top-right-radius:1rem}.border-top-right-radius-full{border-top-right-radius:100%}.border-bottom-left-radius-0{border-bottom-left-radius:0}.border-bottom-left-radius-0_125{border-bottom-left-radius:.125rem}.border-bottom-left-radius-0_25{border-bottom-left-radius:.25rem}.border-bottom-left-radius-0_5{border-bottom-left-radius:.5rem}.border-bottom-left-radius-0_625{border-bottom-left-radius:.625rem}.border-bottom-left-radius-0_75{border-bottom-left-radius:.75rem}.border-bottom-left-radius-1{border-bottom-left-radius:1rem}.border-bottom-left-radius-full{border-bottom-left-radius:100%}.border-bottom-right-radius-0{border-bottom-right-radius:0}.border-bottom-right-radius-0_125{border-bottom-right-radius:.125rem}.border-bottom-right-radius-0_25{border-bottom-right-radius:.25rem}.border-bottom-right-radius-0_5{border-bottom-right-radius:.5rem}.border-bottom-right-radius-0_625{border-bottom-right-radius:.625rem}.border-bottom-right-radius-0_75{border-bottom-right-radius:.75rem}.border-bottom-right-radius-1{border-bottom-right-radius:1rem}.border-bottom-right-radius-full{border-bottom-right-radius:100%}.border-top-radius-0{border-top-left-radius:0;border-top-right-radius:0}.border-top-radius-0_125{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.border-top-radius-0_25{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border-top-radius-0_625{border-top-left-radius:.625rem;border-top-right-radius:.625rem}.border-top-radius-0_5{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border-top-radius-0_75{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border-top-radius-1{border-top-left-radius:1rem;border-top-right-radius:1rem}.border-top-radius-full{border-top-left-radius:100%;border-top-right-radius:100%}.border-right-radius-0{border-bottom-right-radius:0;border-top-right-radius:0}.border-right-radius-0_125{border-bottom-right-radius:.125rem;border-top-right-radius:.125rem}.border-right-radius-0_25{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.border-right-radius-0_625{border-bottom-right-radius:.625rem;border-top-right-radius:.625rem}.border-right-radius-0_5{border-bottom-right-radius:.5rem;border-top-right-radius:.5rem}.border-right-radius-0_75{border-bottom-right-radius:.75rem;border-top-right-radius:.75rem}.border-right-radius-1{border-bottom-right-radius:1rem;border-top-right-radius:1rem}.border-right-radius-full{border-bottom-right-radius:100%;border-top-right-radius:100%}.border-bottom-radius-0{border-bottom-left-radius:0;border-bottom-right-radius:0}.border-bottom-radius-0_125{border-bottom-left-radius:.125rem;border-bottom-right-radius:.125rem}.border-bottom-radius-0_25{border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.border-bottom-radius-0_5{border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}.border-bottom-radius-0_625{border-bottom-left-radius:.625rem;border-bottom-right-radius:.625rem}.border-bottom-radius-0_75{border-bottom-left-radius:.75rem;border-bottom-right-radius:.75rem}.border-bottom-radius-1{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}.border-bottom-radius-full{border-bottom-left-radius:100%;border-bottom-right-radius:100%}.border-left-radius-0{border-bottom-left-radius:0;border-top-left-radius:0}.border-left-radius-0_125{border-bottom-left-radius:.125rem;border-top-left-radius:.125rem}.border-left-radius-0_25{border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.border-left-radius-0_5{border-bottom-left-radius:.5rem;border-top-left-radius:.5rem}.border-left-radius-0_625{border-bottom-left-radius:.625rem;border-top-left-radius:.625rem}.border-left-radius-0_75{border-bottom-left-radius:.75rem;border-top-left-radius:.75rem}.border-left-radius-1{border-bottom-left-radius:1rem;border-top-left-radius:1rem}.border-left-radius-full{border-bottom-left-radius:100%;border-top-left-radius:100%}.border-radius-1px{border-radius:1px}.border-radius-2px{border-radius:2px}.border-radius-3px{border-radius:3px}.border-radius-4px{border-radius:4px}.border-radius-5px{border-radius:5px}.border-radius-6px{border-radius:6px}.border-radius-7px{border-radius:7px}.border-radius-8px{border-radius:8px}.border-radius-9px{border-radius:9px}.border-radius-10px{border-radius:10px}.border-radius-11px{border-radius:11px}.border-radius-12px{border-radius:12px}.border-radius-13px{border-radius:13px}.border-radius-14px{border-radius:14px}.border-radius-15px{border-radius:15px}.border-radius-16px{border-radius:16px}.border-radius-17px{border-radius:17px}.border-radius-18px{border-radius:18px}.border-radius-19px{border-radius:19px}.border-radius-20px{border-radius:20px}.border-top-left-radius-1px{border-top-left-radius:1px}.border-top-left-radius-2px{border-top-left-radius:2px}.border-top-left-radius-3px{border-top-left-radius:3px}.border-top-left-radius-4px{border-top-left-radius:4px}.border-top-left-radius-5px{border-top-left-radius:5px}.border-top-left-radius-6px{border-top-left-radius:6px}.border-top-left-radius-7px{border-top-left-radius:7px}.border-top-left-radius-8px{border-top-left-radius:8px}.border-top-left-radius-9px{border-top-left-radius:9px}.border-top-left-radius-10px{border-top-left-radius:10px}.border-top-left-radius-11px{border-top-left-radius:11px}.border-top-left-radius-12px{border-top-left-radius:12px}.border-top-left-radius-13px{border-top-left-radius:13px}.border-top-left-radius-14px{border-top-left-radius:14px}.border-top-left-radius-15px{border-top-left-radius:15px}.border-top-left-radius-16px{border-top-left-radius:16px}.border-top-left-radius-17px{border-top-left-radius:17px}.border-top-left-radius-18px{border-top-left-radius:18px}.border-top-left-radius-19px{border-top-left-radius:19px}.border-top-left-radius-20px{border-top-left-radius:20px}.border-top-right-radius-1px{border-top-right-radius:1px}.border-top-right-radius-2px{border-top-right-radius:2px}.border-top-right-radius-3px{border-top-right-radius:3px}.border-top-right-radius-4px{border-top-right-radius:4px}.border-top-right-radius-5px{border-top-right-radius:5px}.border-top-right-radius-6px{border-top-right-radius:6px}.border-top-right-radius-7px{border-top-right-radius:7px}.border-top-right-radius-8px{border-top-right-radius:8px}.border-top-right-radius-9px{border-top-right-radius:9px}.border-top-right-radius-10px{border-top-right-radius:10px}.border-top-right-radius-11px{border-top-right-radius:11px}.border-top-right-radius-12px{border-top-right-radius:12px}.border-top-right-radius-13px{border-top-right-radius:13px}.border-top-right-radius-14px{border-top-right-radius:14px}.border-top-right-radius-15px{border-top-right-radius:15px}.border-top-right-radius-16px{border-top-right-radius:16px}.border-top-right-radius-17px{border-top-right-radius:17px}.border-top-right-radius-18px{border-top-right-radius:18px}.border-top-right-radius-19px{border-top-right-radius:19px}.border-top-right-radius-20px{border-top-right-radius:20px}.border-bottom-left-radius-1px{border-bottom-left-radius:1px}.border-bottom-left-radius-2px{border-bottom-left-radius:2px}.border-bottom-left-radius-3px{border-bottom-left-radius:3px}.border-bottom-left-radius-4px{border-bottom-left-radius:4px}.border-bottom-left-radius-5px{border-bottom-left-radius:5px}.border-bottom-left-radius-6px{border-bottom-left-radius:6px}.border-bottom-left-radius-7px{border-bottom-left-radius:7px}.border-bottom-left-radius-8px{border-bottom-left-radius:8px}.border-bottom-left-radius-9px{border-bottom-left-radius:9px}.border-bottom-left-radius-10px{border-bottom-left-radius:10px}.border-bottom-left-radius-11px{border-bottom-left-radius:11px}.border-bottom-left-radius-12px{border-bottom-left-radius:12px}.border-bottom-left-radius-13px{border-bottom-left-radius:13px}.border-bottom-left-radius-14px{border-bottom-left-radius:14px}.border-bottom-left-radius-15px{border-bottom-left-radius:15px}.border-bottom-left-radius-16px{border-bottom-left-radius:16px}.border-bottom-left-radius-17px{border-bottom-left-radius:17px}.border-bottom-left-radius-18px{border-bottom-left-radius:18px}.border-bottom-left-radius-19px{border-bottom-left-radius:19px}.border-bottom-left-radius-20px{border-bottom-left-radius:20px}.border-bottom-right-radius-1px{border-bottom-right-radius:1px}.border-bottom-right-radius-2px{border-bottom-right-radius:2px}.border-bottom-right-radius-3px{border-bottom-right-radius:3px}.border-bottom-right-radius-4px{border-bottom-right-radius:4px}.border-bottom-right-radius-5px{border-bottom-right-radius:5px}.border-bottom-right-radius-6px{border-bottom-right-radius:6px}.border-bottom-right-radius-7px{border-bottom-right-radius:7px}.border-bottom-right-radius-8px{border-bottom-right-radius:8px}.border-bottom-right-radius-9px{border-bottom-right-radius:9px}.border-bottom-right-radius-10px{border-bottom-right-radius:10px}.border-bottom-right-radius-11px{border-bottom-right-radius:11px}.border-bottom-right-radius-12px{border-bottom-right-radius:12px}.border-bottom-right-radius-13px{border-bottom-right-radius:13px}.border-bottom-right-radius-14px{border-bottom-right-radius:14px}.border-bottom-right-radius-15px{border-bottom-right-radius:15px}.border-bottom-right-radius-16px{border-bottom-right-radius:16px}.border-bottom-right-radius-17px{border-bottom-right-radius:17px}.border-bottom-right-radius-18px{border-bottom-right-radius:18px}.border-bottom-right-radius-19px{border-bottom-right-radius:19px}.border-bottom-right-radius-20px{border-bottom-right-radius:20px}.border-top-radius-1px{border-top-left-radius:1px;border-top-right-radius:1px}.border-top-radius-2px{border-top-left-radius:2px;border-top-right-radius:2px}.border-top-radius-3px{border-top-left-radius:3px;border-top-right-radius:3px}.border-top-radius-4px{border-top-left-radius:4px;border-top-right-radius:4px}.border-top-radius-5px{border-top-left-radius:5px;border-top-right-radius:5px}.border-top-radius-6px{border-top-left-radius:6px;border-top-right-radius:6px}.border-top-radius-7px{border-top-left-radius:7px;border-top-right-radius:7px}.border-top-radius-8px{border-top-left-radius:8px;border-top-right-radius:8px}.border-top-radius-9px{border-top-left-radius:9px;border-top-right-radius:9px}.border-top-radius-10px{border-top-left-radius:10px;border-top-right-radius:10px}.border-top-radius-11px{border-top-left-radius:11px;border-top-right-radius:11px}.border-top-radius-12px{border-top-left-radius:12px;border-top-right-radius:12px}.border-top-radius-13px{border-top-left-radius:13px;border-top-right-radius:13px}.border-top-radius-14px{border-top-left-radius:14px;border-top-right-radius:14px}.border-top-radius-15px{border-top-left-radius:15px;border-top-right-radius:15px}.border-top-radius-16px{border-top-left-radius:16px;border-top-right-radius:16px}.border-top-radius-17px{border-top-left-radius:17px;border-top-right-radius:17px}.border-top-radius-18px{border-top-left-radius:18px;border-top-right-radius:18px}.border-top-radius-19px{border-top-left-radius:19px;border-top-right-radius:19px}.border-top-radius-20px{border-top-left-radius:20px;border-top-right-radius:20px}.border-right-radius-1px{border-bottom-right-radius:1px;border-top-right-radius:1px}.border-right-radius-2px{border-bottom-right-radius:2px;border-top-right-radius:2px}.border-right-radius-3px{border-bottom-right-radius:3px;border-top-right-radius:3px}.border-right-radius-4px{border-bottom-right-radius:4px;border-top-right-radius:4px}.border-right-radius-5px{border-bottom-right-radius:5px;border-top-right-radius:5px}.border-right-radius-6px{border-bottom-right-radius:6px;border-top-right-radius:6px}.border-right-radius-7px{border-bottom-right-radius:7px;border-top-right-radius:7px}.border-right-radius-8px{border-bottom-right-radius:8px;border-top-right-radius:8px}.border-right-radius-9px{border-bottom-right-radius:9px;border-top-right-radius:9px}.border-right-radius-10px{border-bottom-right-radius:10px;border-top-right-radius:10px}.border-right-radius-11px{border-bottom-right-radius:11px;border-top-right-radius:11px}.border-right-radius-12px{border-bottom-right-radius:12px;border-top-right-radius:12px}.border-right-radius-13px{border-bottom-right-radius:13px;border-top-right-radius:13px}.border-right-radius-14px{border-bottom-right-radius:14px;border-top-right-radius:14px}.border-right-radius-15px{border-bottom-right-radius:15px;border-top-right-radius:15px}.border-right-radius-16px{border-bottom-right-radius:16px;border-top-right-radius:16px}.border-right-radius-17px{border-bottom-right-radius:17px;border-top-right-radius:17px}.border-right-radius-18px{border-bottom-right-radius:18px;border-top-right-radius:18px}.border-right-radius-19px{border-bottom-right-radius:19px;border-top-right-radius:19px}.border-right-radius-20px{border-bottom-right-radius:20px;border-top-right-radius:20px}.border-bottom-radius-1px{border-bottom-left-radius:1px;border-bottom-right-radius:1px}.border-bottom-radius-2px{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.border-bottom-radius-3px{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.border-bottom-radius-4px{border-bottom-left-radius:4px;border-bottom-right-radius:4px}.border-bottom-radius-5px{border-bottom-left-radius:5px;border-bottom-right-radius:5px}.border-bottom-radius-6px{border-bottom-left-radius:6px;border-bottom-right-radius:6px}.border-bottom-radius-7px{border-bottom-left-radius:7px;border-bottom-right-radius:7px}.border-bottom-radius-8px{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.border-bottom-radius-9px{border-bottom-left-radius:9px;border-bottom-right-radius:9px}.border-bottom-radius-10px{border-bottom-left-radius:10px;border-bottom-right-radius:10px}.border-bottom-radius-11px{border-bottom-left-radius:11px;border-bottom-right-radius:11px}.border-bottom-radius-12px{border-bottom-left-radius:12px;border-bottom-right-radius:12px}.border-bottom-radius-13px{border-bottom-left-radius:13px;border-bottom-right-radius:13px}.border-bottom-radius-14px{border-bottom-left-radius:14px;border-bottom-right-radius:14px}.border-bottom-radius-15px{border-bottom-left-radius:15px;border-bottom-right-radius:15px}.border-bottom-radius-16px{border-bottom-left-radius:16px;border-bottom-right-radius:16px}.border-bottom-radius-17px{border-bottom-left-radius:17px;border-bottom-right-radius:17px}.border-bottom-radius-18px{border-bottom-left-radius:18px;border-bottom-right-radius:18px}.border-bottom-radius-19px{border-bottom-left-radius:19px;border-bottom-right-radius:19px}.border-bottom-radius-20px{border-bottom-left-radius:20px;border-bottom-right-radius:20px}.border-left-radius-1px{border-bottom-left-radius:1px;border-top-left-radius:1px}.border-left-radius-2px{border-bottom-left-radius:2px;border-top-left-radius:2px}.border-left-radius-3px{border-bottom-left-radius:3px;border-top-left-radius:3px}.border-left-radius-4px{border-bottom-left-radius:4px;border-top-left-radius:4px}.border-left-radius-5px{border-bottom-left-radius:5px;border-top-left-radius:5px}.border-left-radius-6px{border-bottom-left-radius:6px;border-top-left-radius:6px}.border-left-radius-7px{border-bottom-left-radius:7px;border-top-left-radius:7px}.border-left-radius-8px{border-bottom-left-radius:8px;border-top-left-radius:8px}.border-left-radius-9px{border-bottom-left-radius:9px;border-top-left-radius:9px}.border-left-radius-10px{border-bottom-left-radius:10px;border-top-left-radius:10px}.border-left-radius-11px{border-bottom-left-radius:11px;border-top-left-radius:11px}.border-left-radius-12px{border-bottom-left-radius:12px;border-top-left-radius:12px}.border-left-radius-13px{border-bottom-left-radius:13px;border-top-left-radius:13px}.border-left-radius-14px{border-bottom-left-radius:14px;border-top-left-radius:14px}.border-left-radius-15px{border-bottom-left-radius:15px;border-top-left-radius:15px}.border-left-radius-16px{border-bottom-left-radius:16px;border-top-left-radius:16px}.border-left-radius-17px{border-bottom-left-radius:17px;border-top-left-radius:17px}.border-left-radius-18px{border-bottom-left-radius:18px;border-top-left-radius:18px}.border-left-radius-19px{border-bottom-left-radius:19px;border-top-left-radius:19px}.border-left-radius-20px{border-bottom-left-radius:20px;border-top-left-radius:20px}.container{margin:0 auto;max-width:90rem;padding:0 1rem;width:100%}.hero{align-content:center;min-height:100vh;text-align:center}.debug *{outline:1px solid gold}.display-none{display:none}.display-inline{display:inline}.display-block{display:block}.display-inline-block{display:inline-block}.display-inline-table{display:inline-table}.display-table{display:table}.display-table-cell{display:table-cell}.display-table-row{display:table-row}.display-table-row-group{display:table-row-group}.display-table-column{display:table-column}.display-table-column-group{display:table-column-group}.table-layout-fixed{table-layout:fixed;width:100%}.display-flex{display:flex}.display-inline-flex{display:inline-flex}.flex-direction-row{flex-direction:row}.flex-direction-row-reverse{flex-direction:row-reverse}.flex-direction-column{flex-direction:column}.flex-direction-column-reverse{flex-direction:column-reverse}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto;min-height:0;min-width:0}.flex-initial{flex:0 1 auto}.flex-none{flex:none}.flex-wrap-wrap{flex-wrap:wrap}.flex-wrap-nowrap{flex-wrap:nowrap}.flex-wrap-wrap-reverse{flex-wrap:wrap-reverse}.align-items-flex-start{align-items:flex-start}.align-items-flex-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.align-self-flex-start{align-self:flex-start}.align-self-flex-end{align-self:flex-end}.align-self-center{align-self:center}.align-self-baseline{align-self:baseline}.align-self-stretch{align-self:stretch}.justify-content-flex-start{justify-content:flex-start}.justify-content-flex-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-space-between{justify-content:space-between}.justify-content-space-around{justify-content:space-around}.align-content-flex-start{align-content:flex-start}.align-content-flex-end{align-content:flex-end}.align-content-center{align-content:center}.align-content-space-between{align-content:space-between}.align-content-space-around{align-content:space-around}.align-content-stretch{align-content:stretch}.flex-grow-1{flex-grow:1}.flex-grow-0{flex-grow:0}.sans-serif{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.serif{font-family:georgia,times,serif}.font-weight-1{font-weight:100}.font-weight-2{font-weight:200}.font-weight-3{font-weight:300}.font-weight-4{font-weight:400}.font-weight-5{font-weight:500}.font-weight-6{font-weight:600}.font-weight-7{font-weight:700}.font-weight-8{font-weight:800}.font-weight-9{font-weight:900}.font-weight-b{font-weight:700}.line-height-1{line-height:1}.line-height-1_25{line-height:1.25}.line-height-1_5{line-height:1.5}.line-height-1_75{line-height:1.75}.line-height-2{line-height:2}.line-height-2_25{line-height:2.25}.line-height-2_5{line-height:2.5}.line-height-2_75{line-height:2.75}.line-height-3{line-height:3}.copy{line-height:1.5}.list-style-type-none{list-style-type:none}.list-style-type-disc{list-style-type:disc}.list-style-type-decimal{list-style-type:decimal}.list-style-type-lower-roman{list-style-type:lower-roman}.list-style-type-upper-roman{list-style-type:upper-roman}.list-style-type-lower-alpha{list-style-type:lower-alpha}.list-style-type-upper-alpha{list-style-type:upper-alpha}.list-style-type-circle{list-style-type:circle}.margin-1px{margin:1px}.margin-2px{margin:2px}.margin-3px{margin:3px}.margin-4px{margin:4px}.margin-5px{margin:5px}.margin-6px{margin:6px}.margin-7px{margin:7px}.margin-8px{margin:8px}.margin-9px{margin:9px}.margin-10px{margin:10px}.margin-0{margin:0}.margin-0_25{margin:.25rem}.margin-0_5{margin:.5rem}.margin-0_75{margin:.75rem}.margin-1{margin:1rem}.margin-1_25{margin:1.25rem}.margin-1_5{margin:1.5rem}.margin-1_75{margin:1.75rem}.margin-2{margin:2rem}.margin-2_25{margin:2.25rem}.margin-2_5{margin:2.5rem}.margin-2_75{margin:2.75rem}.margin-3{margin:3rem}.margin-3_25{margin:3.25rem}.margin-3_5{margin:3.5rem}.margin-3_75{margin:3.75rem}.margin-4{margin:4rem}.margin-4_25{margin:4.25rem}.margin-4_5{margin:4.5rem}.margin-4_75{margin:4.75rem}.margin-5{margin:5rem}.margin-5_25{margin:5.25rem}.margin-5_5{margin:5.5rem}.margin-5_75{margin:5.75rem}.margin-6{margin:6rem}.margin-6_25{margin:6.25rem}.margin-6_5{margin:6.5rem}.margin-6_75{margin:6.75rem}.margin-7{margin:7rem}.margin-7_25{margin:7.25rem}.margin-7_5{margin:7.5rem}.margin-7_75{margin:7.75rem}.margin-8{margin:8rem}.margin-8_25{margin:8.25rem}.margin-8_5{margin:8.5rem}.margin-8_75{margin:8.75rem}.margin-9{margin:9rem}.margin-9_25{margin:9.25rem}.margin-9_5{margin:9.5rem}.margin-9_75{margin:9.75rem}.margin-10{margin:10rem}.margin-10_25{margin:10.25rem}.margin-10_5{margin:10.5rem}.margin-10_75{margin:10.75rem}.margin-11{margin:11rem}.margin-11_25{margin:11.25rem}.margin-11_5{margin:11.5rem}.margin-11_75{margin:11.75rem}.margin-12{margin:12rem}.margin-12_25{margin:12.25rem}.margin-12_5{margin:12.5rem}.margin-12_75{margin:12.75rem}.margin-13{margin:13rem}.margin-13_25{margin:13.25rem}.margin-13_5{margin:13.5rem}.margin-13_75{margin:13.75rem}.margin-14{margin:14rem}.margin-14_25{margin:14.25rem}.margin-14_5{margin:14.5rem}.margin-14_75{margin:14.75rem}.margin-15{margin:15rem}.margin-15_25{margin:15.25rem}.margin-15_5{margin:15.5rem}.margin-15_75{margin:15.75rem}.margin-16{margin:16rem}.margin-16_25{margin:16.25rem}.margin-16_5{margin:16.5rem}.margin-16_75{margin:16.75rem}.margin-17{margin:17rem}.margin-17_25{margin:17.25rem}.margin-17_5{margin:17.5rem}.margin-17_75{margin:17.75rem}.margin-18{margin:18rem}.margin-18_25{margin:18.25rem}.margin-18_5{margin:18.5rem}.margin-18_75{margin:18.75rem}.margin-19{margin:19rem}.margin-19_25{margin:19.25rem}.margin-19_5{margin:19.5rem}.margin-19_75{margin:19.75rem}.margin-20{margin:20rem}.margin-auto{margin:auto}.margin-top-1px{margin-top:1px}.margin-top-2px{margin-top:2px}.margin-top-3px{margin-top:3px}.margin-top-4px{margin-top:4px}.margin-top-5px{margin-top:5px}.margin-top-6px{margin-top:6px}.margin-top-7px{margin-top:7px}.margin-top-8px{margin-top:8px}.margin-top-9px{margin-top:9px}.margin-top-10px{margin-top:10px}.margin-top-0{margin-top:0}.margin-top-0_25{margin-top:.25rem}.margin-top-0_5{margin-top:.5rem}.margin-top-0_75{margin-top:.75rem}.margin-top-1{margin-top:1rem}.margin-top-1_25{margin-top:1.25rem}.margin-top-1_5{margin-top:1.5rem}.margin-top-1_75{margin-top:1.75rem}.margin-top-2{margin-top:2rem}.margin-top-2_25{margin-top:2.25rem}.margin-top-2_5{margin-top:2.5rem}.margin-top-2_75{margin-top:2.75rem}.margin-top-3{margin-top:3rem}.margin-top-3_25{margin-top:3.25rem}.margin-top-3_5{margin-top:3.5rem}.margin-top-3_75{margin-top:3.75rem}.margin-top-4{margin-top:4rem}.margin-top-4_25{margin-top:4.25rem}.margin-top-4_5{margin-top:4.5rem}.margin-top-4_75{margin-top:4.75rem}.margin-top-5{margin-top:5rem}.margin-top-5_25{margin-top:5.25rem}.margin-top-5_5{margin-top:5.5rem}.margin-top-5_75{margin-top:5.75rem}.margin-top-6{margin-top:6rem}.margin-top-6_25{margin-top:6.25rem}.margin-top-6_5{margin-top:6.5rem}.margin-top-6_75{margin-top:6.75rem}.margin-top-7{margin-top:7rem}.margin-top-7_25{margin-top:7.25rem}.margin-top-7_5{margin-top:7.5rem}.margin-top-7_75{margin-top:7.75rem}.margin-top-8{margin-top:8rem}.margin-top-8_25{margin-top:8.25rem}.margin-top-8_5{margin-top:8.5rem}.margin-top-8_75{margin-top:8.75rem}.margin-top-9{margin-top:9rem}.margin-top-9_25{margin-top:9.25rem}.margin-top-9_5{margin-top:9.5rem}.margin-top-9_75{margin-top:9.75rem}.margin-top-10{margin-top:10rem}.margin-top-10_25{margin-top:10.25rem}.margin-top-10_5{margin-top:10.5rem}.margin-top-10_75{margin-top:10.75rem}.margin-top-11{margin-top:11rem}.margin-top-11_25{margin-top:11.25rem}.margin-top-11_5{margin-top:11.5rem}.margin-top-11_75{margin-top:11.75rem}.margin-top-12{margin-top:12rem}.margin-top-12_25{margin-top:12.25rem}.margin-top-12_5{margin-top:12.5rem}.margin-top-12_75{margin-top:12.75rem}.margin-top-13{margin-top:13rem}.margin-top-13_25{margin-top:13.25rem}.margin-top-13_5{margin-top:13.5rem}.margin-top-13_75{margin-top:13.75rem}.margin-top-14{margin-top:14rem}.margin-top-14_25{margin-top:14.25rem}.margin-top-14_5{margin-top:14.5rem}.margin-top-14_75{margin-top:14.75rem}.margin-top-15{margin-top:15rem}.margin-top-15_25{margin-top:15.25rem}.margin-top-15_5{margin-top:15.5rem}.margin-top-15_75{margin-top:15.75rem}.margin-top-16{margin-top:16rem}.margin-top-16_25{margin-top:16.25rem}.margin-top-16_5{margin-top:16.5rem}.margin-top-16_75{margin-top:16.75rem}.margin-top-17{margin-top:17rem}.margin-top-17_25{margin-top:17.25rem}.margin-top-17_5{margin-top:17.5rem}.margin-top-17_75{margin-top:17.75rem}.margin-top-18{margin-top:18rem}.margin-top-18_25{margin-top:18.25rem}.margin-top-18_5{margin-top:18.5rem}.margin-top-18_75{margin-top:18.75rem}.margin-top-19{margin-top:19rem}.margin-top-19_25{margin-top:19.25rem}.margin-top-19_5{margin-top:19.5rem}.margin-top-19_75{margin-top:19.75rem}.margin-top-20{margin-top:20rem}.margin-top-auto{margin-top:auto}.margin-right-1px{margin-right:1px}.margin-right-2px{margin-right:2px}.margin-right-3px{margin-right:3px}.margin-right-4px{margin-right:4px}.margin-right-5px{margin-right:5px}.margin-right-6px{margin-right:6px}.margin-right-7px{margin-right:7px}.margin-right-8px{margin-right:8px}.margin-right-9px{margin-right:9px}.margin-right-10px{margin-right:10px}.margin-right-0{margin-right:0}.margin-right-0_25{margin-right:.25rem}.margin-right-0_5{margin-right:.5rem}.margin-right-0_75{margin-right:.75rem}.margin-right-1{margin-right:1rem}.margin-right-1_25{margin-right:1.25rem}.margin-right-1_5{margin-right:1.5rem}.margin-right-1_75{margin-right:1.75rem}.margin-right-2{margin-right:2rem}.margin-right-2_25{margin-right:2.25rem}.margin-right-2_5{margin-right:2.5rem}.margin-right-2_75{margin-right:2.75rem}.margin-right-3{margin-right:3rem}.margin-right-3_25{margin-right:3.25rem}.margin-right-3_5{margin-right:3.5rem}.margin-right-3_75{margin-right:3.75rem}.margin-right-4{margin-right:4rem}.margin-right-4_25{margin-right:4.25rem}.margin-right-4_5{margin-right:4.5rem}.margin-right-4_75{margin-right:4.75rem}.margin-right-5{margin-right:5rem}.margin-right-5_25{margin-right:5.25rem}.margin-right-5_5{margin-right:5.5rem}.margin-right-5_75{margin-right:5.75rem}.margin-right-6{margin-right:6rem}.margin-right-6_25{margin-right:6.25rem}.margin-right-6_5{margin-right:6.5rem}.margin-right-6_75{margin-right:6.75rem}.margin-right-7{margin-right:7rem}.margin-right-7_25{margin-right:7.25rem}.margin-right-7_5{margin-right:7.5rem}.margin-right-7_75{margin-right:7.75rem}.margin-right-8{margin-right:8rem}.margin-right-8_25{margin-right:8.25rem}.margin-right-8_5{margin-right:8.5rem}.margin-right-8_75{margin-right:8.75rem}.margin-right-9{margin-right:9rem}.margin-right-9_25{margin-right:9.25rem}.margin-right-9_5{margin-right:9.5rem}.margin-right-9_75{margin-right:9.75rem}.margin-right-10{margin-right:10rem}.margin-right-10_25{margin-right:10.25rem}.margin-right-10_5{margin-right:10.5rem}.margin-right-10_75{margin-right:10.75rem}.margin-right-11{margin-right:11rem}.margin-right-11_25{margin-right:11.25rem}.margin-right-11_5{margin-right:11.5rem}.margin-right-11_75{margin-right:11.75rem}.margin-right-12{margin-right:12rem}.margin-right-12_25{margin-right:12.25rem}.margin-right-12_5{margin-right:12.5rem}.margin-right-12_75{margin-right:12.75rem}.margin-right-13{margin-right:13rem}.margin-right-13_25{margin-right:13.25rem}.margin-right-13_5{margin-right:13.5rem}.margin-right-13_75{margin-right:13.75rem}.margin-right-14{margin-right:14rem}.margin-right-14_25{margin-right:14.25rem}.margin-right-14_5{margin-right:14.5rem}.margin-right-14_75{margin-right:14.75rem}.margin-right-15{margin-right:15rem}.margin-right-15_25{margin-right:15.25rem}.margin-right-15_5{margin-right:15.5rem}.margin-right-15_75{margin-right:15.75rem}.margin-right-16{margin-right:16rem}.margin-right-16_25{margin-right:16.25rem}.margin-right-16_5{margin-right:16.5rem}.margin-right-16_75{margin-right:16.75rem}.margin-right-17{margin-right:17rem}.margin-right-17_25{margin-right:17.25rem}.margin-right-17_5{margin-right:17.5rem}.margin-right-17_75{margin-right:17.75rem}.margin-right-18{margin-right:18rem}.margin-right-18_25{margin-right:18.25rem}.margin-right-18_5{margin-right:18.5rem}.margin-right-18_75{margin-right:18.75rem}.margin-right-19{margin-right:19rem}.margin-right-19_25{margin-right:19.25rem}.margin-right-19_5{margin-right:19.5rem}.margin-right-19_75{margin-right:19.75rem}.margin-right-20{margin-right:20rem}.margin-right-auto{margin-right:auto}.margin-bottom-1px{margin-bottom:1px}.margin-bottom-2px{margin-bottom:2px}.margin-bottom-3px{margin-bottom:3px}.margin-bottom-4px{margin-bottom:4px}.margin-bottom-5px{margin-bottom:5px}.margin-bottom-6px{margin-bottom:6px}.margin-bottom-7px{margin-bottom:7px}.margin-bottom-8px{margin-bottom:8px}.margin-bottom-9px{margin-bottom:9px}.margin-bottom-10px{margin-bottom:10px}.margin-bottom-0{margin-bottom:0}.margin-bottom-0_25{margin-bottom:.25rem}.margin-bottom-0_5{margin-bottom:.5rem}.margin-bottom-0_75{margin-bottom:.75rem}.margin-bottom-1{margin-bottom:1rem}.margin-bottom-1_25{margin-bottom:1.25rem}.margin-bottom-1_5{margin-bottom:1.5rem}.margin-bottom-1_75{margin-bottom:1.75rem}.margin-bottom-2{margin-bottom:2rem}.margin-bottom-2_25{margin-bottom:2.25rem}.margin-bottom-2_5{margin-bottom:2.5rem}.margin-bottom-2_75{margin-bottom:2.75rem}.margin-bottom-3{margin-bottom:3rem}.margin-bottom-3_25{margin-bottom:3.25rem}.margin-bottom-3_5{margin-bottom:3.5rem}.margin-bottom-3_75{margin-bottom:3.75rem}.margin-bottom-4{margin-bottom:4rem}.margin-bottom-4_25{margin-bottom:4.25rem}.margin-bottom-4_5{margin-bottom:4.5rem}.margin-bottom-4_75{margin-bottom:4.75rem}.margin-bottom-5{margin-bottom:5rem}.margin-bottom-5_25{margin-bottom:5.25rem}.margin-bottom-5_5{margin-bottom:5.5rem}.margin-bottom-5_75{margin-bottom:5.75rem}.margin-bottom-6{margin-bottom:6rem}.margin-bottom-6_25{margin-bottom:6.25rem}.margin-bottom-6_5{margin-bottom:6.5rem}.margin-bottom-6_75{margin-bottom:6.75rem}.margin-bottom-7{margin-bottom:7rem}.margin-bottom-7_25{margin-bottom:7.25rem}.margin-bottom-7_5{margin-bottom:7.5rem}.margin-bottom-7_75{margin-bottom:7.75rem}.margin-bottom-8{margin-bottom:8rem}.margin-bottom-8_25{margin-bottom:8.25rem}.margin-bottom-8_5{margin-bottom:8.5rem}.margin-bottom-8_75{margin-bottom:8.75rem}.margin-bottom-9{margin-bottom:9rem}.margin-bottom-9_25{margin-bottom:9.25rem}.margin-bottom-9_5{margin-bottom:9.5rem}.margin-bottom-9_75{margin-bottom:9.75rem}.margin-bottom-10{margin-bottom:10rem}.margin-bottom-10_25{margin-bottom:10.25rem}.margin-bottom-10_5{margin-bottom:10.5rem}.margin-bottom-10_75{margin-bottom:10.75rem}.margin-bottom-11{margin-bottom:11rem}.margin-bottom-11_25{margin-bottom:11.25rem}.margin-bottom-11_5{margin-bottom:11.5rem}.margin-bottom-11_75{margin-bottom:11.75rem}.margin-bottom-12{margin-bottom:12rem}.margin-bottom-12_25{margin-bottom:12.25rem}.margin-bottom-12_5{margin-bottom:12.5rem}.margin-bottom-12_75{margin-bottom:12.75rem}.margin-bottom-13{margin-bottom:13rem}.margin-bottom-13_25{margin-bottom:13.25rem}.margin-bottom-13_5{margin-bottom:13.5rem}.margin-bottom-13_75{margin-bottom:13.75rem}.margin-bottom-14{margin-bottom:14rem}.margin-bottom-14_25{margin-bottom:14.25rem}.margin-bottom-14_5{margin-bottom:14.5rem}.margin-bottom-14_75{margin-bottom:14.75rem}.margin-bottom-15{margin-bottom:15rem}.margin-bottom-15_25{margin-bottom:15.25rem}.margin-bottom-15_5{margin-bottom:15.5rem}.margin-bottom-15_75{margin-bottom:15.75rem}.margin-bottom-16{margin-bottom:16rem}.margin-bottom-16_25{margin-bottom:16.25rem}.margin-bottom-16_5{margin-bottom:16.5rem}.margin-bottom-16_75{margin-bottom:16.75rem}.margin-bottom-17{margin-bottom:17rem}.margin-bottom-17_25{margin-bottom:17.25rem}.margin-bottom-17_5{margin-bottom:17.5rem}.margin-bottom-17_75{margin-bottom:17.75rem}.margin-bottom-18{margin-bottom:18rem}.margin-bottom-18_25{margin-bottom:18.25rem}.margin-bottom-18_5{margin-bottom:18.5rem}.margin-bottom-18_75{margin-bottom:18.75rem}.margin-bottom-19{margin-bottom:19rem}.margin-bottom-19_25{margin-bottom:19.25rem}.margin-bottom-19_5{margin-bottom:19.5rem}.margin-bottom-19_75{margin-bottom:19.75rem}.margin-bottom-20{margin-bottom:20rem}.margin-bottom-auto{margin-bottom:auto}.margin-left-1px{margin-left:1px}.margin-left-2px{margin-left:2px}.margin-left-3px{margin-left:3px}.margin-left-4px{margin-left:4px}.margin-left-5px{margin-left:5px}.margin-left-6px{margin-left:6px}.margin-left-7px{margin-left:7px}.margin-left-8px{margin-left:8px}.margin-left-9px{margin-left:9px}.margin-left-10px{margin-left:10px}.margin-left-0{margin-left:0}.margin-left-0_25{margin-left:.25rem}.margin-left-0_5{margin-left:.5rem}.margin-left-0_75{margin-left:.75rem}.margin-left-1{margin-left:1rem}.margin-left-1_25{margin-left:1.25rem}.margin-left-1_5{margin-left:1.5rem}.margin-left-1_75{margin-left:1.75rem}.margin-left-2{margin-left:2rem}.margin-left-2_25{margin-left:2.25rem}.margin-left-2_5{margin-left:2.5rem}.margin-left-2_75{margin-left:2.75rem}.margin-left-3{margin-left:3rem}.margin-left-3_25{margin-left:3.25rem}.margin-left-3_5{margin-left:3.5rem}.margin-left-3_75{margin-left:3.75rem}.margin-left-4{margin-left:4rem}.margin-left-4_25{margin-left:4.25rem}.margin-left-4_5{margin-left:4.5rem}.margin-left-4_75{margin-left:4.75rem}.margin-left-5{margin-left:5rem}.margin-left-5_25{margin-left:5.25rem}.margin-left-5_5{margin-left:5.5rem}.margin-left-5_75{margin-left:5.75rem}.margin-left-6{margin-left:6rem}.margin-left-6_25{margin-left:6.25rem}.margin-left-6_5{margin-left:6.5rem}.margin-left-6_75{margin-left:6.75rem}.margin-left-7{margin-left:7rem}.margin-left-7_25{margin-left:7.25rem}.margin-left-7_5{margin-left:7.5rem}.margin-left-7_75{margin-left:7.75rem}.margin-left-8{margin-left:8rem}.margin-left-8_25{margin-left:8.25rem}.margin-left-8_5{margin-left:8.5rem}.margin-left-8_75{margin-left:8.75rem}.margin-left-9{margin-left:9rem}.margin-left-9_25{margin-left:9.25rem}.margin-left-9_5{margin-left:9.5rem}.margin-left-9_75{margin-left:9.75rem}.margin-left-10{margin-left:10rem}.margin-left-10_25{margin-left:10.25rem}.margin-left-10_5{margin-left:10.5rem}.margin-left-10_75{margin-left:10.75rem}.margin-left-11{margin-left:11rem}.margin-left-11_25{margin-left:11.25rem}.margin-left-11_5{margin-left:11.5rem}.margin-left-11_75{margin-left:11.75rem}.margin-left-12{margin-left:12rem}.margin-left-12_25{margin-left:12.25rem}.margin-left-12_5{margin-left:12.5rem}.margin-left-12_75{margin-left:12.75rem}.margin-left-13{margin-left:13rem}.margin-left-13_25{margin-left:13.25rem}.margin-left-13_5{margin-left:13.5rem}.margin-left-13_75{margin-left:13.75rem}.margin-left-14{margin-left:14rem}.margin-left-14_25{margin-left:14.25rem}.margin-left-14_5{margin-left:14.5rem}.margin-left-14_75{margin-left:14.75rem}.margin-left-15{margin-left:15rem}.margin-left-15_25{margin-left:15.25rem}.margin-left-15_5{margin-left:15.5rem}.margin-left-15_75{margin-left:15.75rem}.margin-left-16{margin-left:16rem}.margin-left-16_25{margin-left:16.25rem}.margin-left-16_5{margin-left:16.5rem}.margin-left-16_75{margin-left:16.75rem}.margin-left-17{margin-left:17rem}.margin-left-17_25{margin-left:17.25rem}.margin-left-17_5{margin-left:17.5rem}.margin-left-17_75{margin-left:17.75rem}.margin-left-18{margin-left:18rem}.margin-left-18_25{margin-left:18.25rem}.margin-left-18_5{margin-left:18.5rem}.margin-left-18_75{margin-left:18.75rem}.margin-left-19{margin-left:19rem}.margin-left-19_25{margin-left:19.25rem}.margin-left-19_5{margin-left:19.5rem}.margin-left-19_75{margin-left:19.75rem}.margin-left-20{margin-left:20rem}.margin-left-auto{margin-left:auto}.margin-x-1px{margin-left:1px;margin-right:1px}.margin-x-2px{margin-left:2px;margin-right:2px}.margin-x-3px{margin-left:3px;margin-right:3px}.margin-x-4px{margin-left:4px;margin-right:4px}.margin-x-5px{margin-left:5px;margin-right:5px}.margin-x-6px{margin-left:6px;margin-right:6px}.margin-x-7px{margin-left:7px;margin-right:7px}.margin-x-8px{margin-left:8px;margin-right:8px}.margin-x-9px{margin-left:9px;margin-right:9px}.margin-x-10px{margin-left:10px;margin-right:10px}.margin-x-0{margin-left:0;margin-right:0}.margin-x-0_25{margin-left:.25rem;margin-right:.25rem}.margin-x-0_5{margin-left:.5rem;margin-right:.5rem}.margin-x-0_75{margin-left:.75rem;margin-right:.75rem}.margin-x-1{margin-left:1rem;margin-right:1rem}.margin-x-1_25{margin-left:1.25rem;margin-right:1.25rem}.margin-x-1_5{margin-left:1.5rem;margin-right:1.5rem}.margin-x-1_75{margin-left:1.75rem;margin-right:1.75rem}.margin-x-2{margin-left:2rem;margin-right:2rem}.margin-x-2_25{margin-left:2.25rem;margin-right:2.25rem}.margin-x-2_5{margin-left:2.5rem;margin-right:2.5rem}.margin-x-2_75{margin-left:2.75rem;margin-right:2.75rem}.margin-x-3{margin-left:3rem;margin-right:3rem}.margin-x-3_25{margin-left:3.25rem;margin-right:3.25rem}.margin-x-3_5{margin-left:3.5rem;margin-right:3.5rem}.margin-x-3_75{margin-left:3.75rem;margin-right:3.75rem}.margin-x-4{margin-left:4rem;margin-right:4rem}.margin-x-4_25{margin-left:4.25rem;margin-right:4.25rem}.margin-x-4_5{margin-left:4.5rem;margin-right:4.5rem}.margin-x-4_75{margin-left:4.75rem;margin-right:4.75rem}.margin-x-5{margin-left:5rem;margin-right:5rem}.margin-x-5_25{margin-left:5.25rem;margin-right:5.25rem}.margin-x-5_5{margin-left:5.5rem;margin-right:5.5rem}.margin-x-5_75{margin-left:5.75rem;margin-right:5.75rem}.margin-x-6{margin-left:6rem;margin-right:6rem}.margin-x-6_25{margin-left:6.25rem;margin-right:6.25rem}.margin-x-6_5{margin-left:6.5rem;margin-right:6.5rem}.margin-x-6_75{margin-left:6.75rem;margin-right:6.75rem}.margin-x-7{margin-left:7rem;margin-right:7rem}.margin-x-7_25{margin-left:7.25rem;margin-right:7.25rem}.margin-x-7_5{margin-left:7.5rem;margin-right:7.5rem}.margin-x-7_75{margin-left:7.75rem;margin-right:7.75rem}.margin-x-8{margin-left:8rem;margin-right:8rem}.margin-x-8_25{margin-left:8.25rem;margin-right:8.25rem}.margin-x-8_5{margin-left:8.5rem;margin-right:8.5rem}.margin-x-8_75{margin-left:8.75rem;margin-right:8.75rem}.margin-x-9{margin-left:9rem;margin-right:9rem}.margin-x-9_25{margin-left:9.25rem;margin-right:9.25rem}.margin-x-9_5{margin-left:9.5rem;margin-right:9.5rem}.margin-x-9_75{margin-left:9.75rem;margin-right:9.75rem}.margin-x-10{margin-left:10rem;margin-right:10rem}.margin-x-10_25{margin-left:10.25rem;margin-right:10.25rem}.margin-x-10_5{margin-left:10.5rem;margin-right:10.5rem}.margin-x-10_75{margin-left:10.75rem;margin-right:10.75rem}.margin-x-11{margin-left:11rem;margin-right:11rem}.margin-x-11_25{margin-left:11.25rem;margin-right:11.25rem}.margin-x-11_5{margin-left:11.5rem;margin-right:11.5rem}.margin-x-11_75{margin-left:11.75rem;margin-right:11.75rem}.margin-x-12{margin-left:12rem;margin-right:12rem}.margin-x-12_25{margin-left:12.25rem;margin-right:12.25rem}.margin-x-12_5{margin-left:12.5rem;margin-right:12.5rem}.margin-x-12_75{margin-left:12.75rem;margin-right:12.75rem}.margin-x-13{margin-left:13rem;margin-right:13rem}.margin-x-13_25{margin-left:13.25rem;margin-right:13.25rem}.margin-x-13_5{margin-left:13.5rem;margin-right:13.5rem}.margin-x-13_75{margin-left:13.75rem;margin-right:13.75rem}.margin-x-14{margin-left:14rem;margin-right:14rem}.margin-x-14_25{margin-left:14.25rem;margin-right:14.25rem}.margin-x-14_5{margin-left:14.5rem;margin-right:14.5rem}.margin-x-14_75{margin-left:14.75rem;margin-right:14.75rem}.margin-x-15{margin-left:15rem;margin-right:15rem}.margin-x-15_25{margin-left:15.25rem;margin-right:15.25rem}.margin-x-15_5{margin-left:15.5rem;margin-right:15.5rem}.margin-x-15_75{margin-left:15.75rem;margin-right:15.75rem}.margin-x-16{margin-left:16rem;margin-right:16rem}.margin-x-16_25{margin-left:16.25rem;margin-right:16.25rem}.margin-x-16_5{margin-left:16.5rem;margin-right:16.5rem}.margin-x-16_75{margin-left:16.75rem;margin-right:16.75rem}.margin-x-17{margin-left:17rem;margin-right:17rem}.margin-x-17_25{margin-left:17.25rem;margin-right:17.25rem}.margin-x-17_5{margin-left:17.5rem;margin-right:17.5rem}.margin-x-17_75{margin-left:17.75rem;margin-right:17.75rem}.margin-x-18{margin-left:18rem;margin-right:18rem}.margin-x-18_25{margin-left:18.25rem;margin-right:18.25rem}.margin-x-18_5{margin-left:18.5rem;margin-right:18.5rem}.margin-x-18_75{margin-left:18.75rem;margin-right:18.75rem}.margin-x-19{margin-left:19rem;margin-right:19rem}.margin-x-19_25{margin-left:19.25rem;margin-right:19.25rem}.margin-x-19_5{margin-left:19.5rem;margin-right:19.5rem}.margin-x-19_75{margin-left:19.75rem;margin-right:19.75rem}.margin-x-20{margin-left:20rem;margin-right:20rem}.margin-x-auto{margin-left:auto;margin-right:auto}.margin-y-1px{margin-bottom:1px;margin-top:1px}.margin-y-2px{margin-bottom:2px;margin-top:2px}.margin-y-3px{margin-bottom:3px;margin-top:3px}.margin-y-4px{margin-bottom:4px;margin-top:4px}.margin-y-5px{margin-bottom:5px;margin-top:5px}.margin-y-6px{margin-bottom:6px;margin-top:6px}.margin-y-7px{margin-bottom:7px;margin-top:7px}.margin-y-8px{margin-bottom:8px;margin-top:8px}.margin-y-9px{margin-bottom:9px;margin-top:9px}.margin-y-10px{margin-bottom:10px;margin-top:10px}.margin-y-0{margin-bottom:0;margin-top:0}.margin-y-0_25{margin-bottom:.25rem;margin-top:.25rem}.margin-y-0_5{margin-bottom:.5rem;margin-top:.5rem}.margin-y-0_75{margin-bottom:.75rem;margin-top:.75rem}.margin-y-1{margin-bottom:1rem;margin-top:1rem}.margin-y-1_25{margin-bottom:1.25rem;margin-top:1.25rem}.margin-y-1_5{margin-bottom:1.5rem;margin-top:1.5rem}.margin-y-1_75{margin-bottom:1.75rem;margin-top:1.75rem}.margin-y-2{margin-bottom:2rem;margin-top:2rem}.margin-y-2_25{margin-bottom:2.25rem;margin-top:2.25rem}.margin-y-2_5{margin-bottom:2.5rem;margin-top:2.5rem}.margin-y-2_75{margin-bottom:2.75rem;margin-top:2.75rem}.margin-y-3{margin-bottom:3rem;margin-top:3rem}.margin-y-3_25{margin-bottom:3.25rem;margin-top:3.25rem}.margin-y-3_5{margin-bottom:3.5rem;margin-top:3.5rem}.margin-y-3_75{margin-bottom:3.75rem;margin-top:3.75rem}.margin-y-4{margin-bottom:4rem;margin-top:4rem}.margin-y-4_25{margin-bottom:4.25rem;margin-top:4.25rem}.margin-y-4_5{margin-bottom:4.5rem;margin-top:4.5rem}.margin-y-4_75{margin-bottom:4.75rem;margin-top:4.75rem}.margin-y-5{margin-bottom:5rem;margin-top:5rem}.margin-y-5_25{margin-bottom:5.25rem;margin-top:5.25rem}.margin-y-5_5{margin-bottom:5.5rem;margin-top:5.5rem}.margin-y-5_75{margin-bottom:5.75rem;margin-top:5.75rem}.margin-y-6{margin-bottom:6rem;margin-top:6rem}.margin-y-6_25{margin-bottom:6.25rem;margin-top:6.25rem}.margin-y-6_5{margin-bottom:6.5rem;margin-top:6.5rem}.margin-y-6_75{margin-bottom:6.75rem;margin-top:6.75rem}.margin-y-7{margin-bottom:7rem;margin-top:7rem}.margin-y-7_25{margin-bottom:7.25rem;margin-top:7.25rem}.margin-y-7_5{margin-bottom:7.5rem;margin-top:7.5rem}.margin-y-7_75{margin-bottom:7.75rem;margin-top:7.75rem}.margin-y-8{margin-bottom:8rem;margin-top:8rem}.margin-y-8_25{margin-bottom:8.25rem;margin-top:8.25rem}.margin-y-8_5{margin-bottom:8.5rem;margin-top:8.5rem}.margin-y-8_75{margin-bottom:8.75rem;margin-top:8.75rem}.margin-y-9{margin-bottom:9rem;margin-top:9rem}.margin-y-9_25{margin-bottom:9.25rem;margin-top:9.25rem}.margin-y-9_5{margin-bottom:9.5rem;margin-top:9.5rem}.margin-y-9_75{margin-bottom:9.75rem;margin-top:9.75rem}.margin-y-10{margin-bottom:10rem;margin-top:10rem}.margin-y-10_25{margin-bottom:10.25rem;margin-top:10.25rem}.margin-y-10_5{margin-bottom:10.5rem;margin-top:10.5rem}.margin-y-10_75{margin-bottom:10.75rem;margin-top:10.75rem}.margin-y-11{margin-bottom:11rem;margin-top:11rem}.margin-y-11_25{margin-bottom:11.25rem;margin-top:11.25rem}.margin-y-11_5{margin-bottom:11.5rem;margin-top:11.5rem}.margin-y-11_75{margin-bottom:11.75rem;margin-top:11.75rem}.margin-y-12{margin-bottom:12rem;margin-top:12rem}.margin-y-12_25{margin-bottom:12.25rem;margin-top:12.25rem}.margin-y-12_5{margin-bottom:12.5rem;margin-top:12.5rem}.margin-y-12_75{margin-bottom:12.75rem;margin-top:12.75rem}.margin-y-13{margin-bottom:13rem;margin-top:13rem}.margin-y-13_25{margin-bottom:13.25rem;margin-top:13.25rem}.margin-y-13_5{margin-bottom:13.5rem;margin-top:13.5rem}.margin-y-13_75{margin-bottom:13.75rem;margin-top:13.75rem}.margin-y-14{margin-bottom:14rem;margin-top:14rem}.margin-y-14_25{margin-bottom:14.25rem;margin-top:14.25rem}.margin-y-14_5{margin-bottom:14.5rem;margin-top:14.5rem}.margin-y-14_75{margin-bottom:14.75rem;margin-top:14.75rem}.margin-y-15{margin-bottom:15rem;margin-top:15rem}.margin-y-15_25{margin-bottom:15.25rem;margin-top:15.25rem}.margin-y-15_5{margin-bottom:15.5rem;margin-top:15.5rem}.margin-y-15_75{margin-bottom:15.75rem;margin-top:15.75rem}.margin-y-16{margin-bottom:16rem;margin-top:16rem}.margin-y-16_25{margin-bottom:16.25rem;margin-top:16.25rem}.margin-y-16_5{margin-bottom:16.5rem;margin-top:16.5rem}.margin-y-16_75{margin-bottom:16.75rem;margin-top:16.75rem}.margin-y-17{margin-bottom:17rem;margin-top:17rem}.margin-y-17_25{margin-bottom:17.25rem;margin-top:17.25rem}.margin-y-17_5{margin-bottom:17.5rem;margin-top:17.5rem}.margin-y-17_75{margin-bottom:17.75rem;margin-top:17.75rem}.margin-y-18{margin-bottom:18rem;margin-top:18rem}.margin-y-18_25{margin-bottom:18.25rem;margin-top:18.25rem}.margin-y-18_5{margin-bottom:18.5rem;margin-top:18.5rem}.margin-y-18_75{margin-bottom:18.75rem;margin-top:18.75rem}.margin-y-19{margin-bottom:19rem;margin-top:19rem}.margin-y-19_25{margin-bottom:19.25rem;margin-top:19.25rem}.margin-y-19_5{margin-bottom:19.5rem;margin-top:19.5rem}.margin-y-19_75{margin-bottom:19.75rem;margin-top:19.75rem}.margin-y-20{margin-bottom:20rem;margin-top:20rem}.margin-y-auto{margin-bottom:auto;margin-top:auto}.max-width-1{max-width:1rem}.max-width-2{max-width:2rem}.max-width-3{max-width:3rem}.max-width-4{max-width:4rem}.max-width-5{max-width:5rem}.max-width-6{max-width:6rem}.max-width-7{max-width:7rem}.max-width-8{max-width:8rem}.max-width-9{max-width:9rem}.max-width-10{max-width:10rem}.max-width-11{max-width:11rem}.max-width-12{max-width:12rem}.max-width-13{max-width:13rem}.max-width-14{max-width:14rem}.max-width-15{max-width:15rem}.max-width-16{max-width:16rem}.max-width-17{max-width:17rem}.max-width-18{max-width:18rem}.max-width-19{max-width:19rem}.max-width-20{max-width:20rem}.max-width-21{max-width:21rem}.max-width-22{max-width:22rem}.max-width-23{max-width:23rem}.max-width-24{max-width:24rem}.max-width-25{max-width:25rem}.max-width-26{max-width:26rem}.max-width-27{max-width:27rem}.max-width-28{max-width:28rem}.max-width-29{max-width:29rem}.max-width-30{max-width:30rem}.max-width-31{max-width:31rem}.max-width-32{max-width:32rem}.max-width-33{max-width:33rem}.max-width-34{max-width:34rem}.max-width-35{max-width:35rem}.max-width-36{max-width:36rem}.max-width-37{max-width:37rem}.max-width-38{max-width:38rem}.max-width-39{max-width:39rem}.max-width-40{max-width:40rem}.max-width-41{max-width:41rem}.max-width-42{max-width:42rem}.max-width-43{max-width:43rem}.max-width-44{max-width:44rem}.max-width-45{max-width:45rem}.max-width-46{max-width:46rem}.max-width-47{max-width:47rem}.max-width-48{max-width:48rem}.max-width-49{max-width:49rem}.max-width-50{max-width:50rem}.max-width-51{max-width:51rem}.max-width-52{max-width:52rem}.max-width-53{max-width:53rem}.max-width-54{max-width:54rem}.max-width-55{max-width:55rem}.max-width-56{max-width:56rem}.max-width-57{max-width:57rem}.max-width-58{max-width:58rem}.max-width-59{max-width:59rem}.max-width-60{max-width:60rem}.max-width-61{max-width:61rem}.max-width-62{max-width:62rem}.max-width-63{max-width:63rem}.max-width-64{max-width:64rem}.max-width-1p{max-width:1%}.max-width-2p{max-width:2%}.max-width-3p{max-width:3%}.max-width-4p{max-width:4%}.max-width-5p{max-width:5%}.max-width-6p{max-width:6%}.max-width-7p{max-width:7%}.max-width-8p{max-width:8%}.max-width-9p{max-width:9%}.max-width-10p{max-width:10%}.max-width-11p{max-width:11%}.max-width-12p{max-width:12%}.max-width-13p{max-width:13%}.max-width-14p{max-width:14%}.max-width-15p{max-width:15%}.max-width-16p{max-width:16%}.max-width-17p{max-width:17%}.max-width-18p{max-width:18%}.max-width-19p{max-width:19%}.max-width-20p{max-width:20%}.max-width-21p{max-width:21%}.max-width-22p{max-width:22%}.max-width-23p{max-width:23%}.max-width-24p{max-width:24%}.max-width-25p{max-width:25%}.max-width-26p{max-width:26%}.max-width-27p{max-width:27%}.max-width-28p{max-width:28%}.max-width-29p{max-width:29%}.max-width-30p{max-width:30%}.max-width-31p{max-width:31%}.max-width-32p{max-width:32%}.max-width-33p{max-width:33%}.max-width-34p{max-width:34%}.max-width-35p{max-width:35%}.max-width-36p{max-width:36%}.max-width-37p{max-width:37%}.max-width-38p{max-width:38%}.max-width-39p{max-width:39%}.max-width-40p{max-width:40%}.max-width-41p{max-width:41%}.max-width-42p{max-width:42%}.max-width-43p{max-width:43%}.max-width-44p{max-width:44%}.max-width-45p{max-width:45%}.max-width-46p{max-width:46%}.max-width-47p{max-width:47%}.max-width-48p{max-width:48%}.max-width-49p{max-width:49%}.max-width-50p{max-width:50%}.max-width-51p{max-width:51%}.max-width-52p{max-width:52%}.max-width-53p{max-width:53%}.max-width-54p{max-width:54%}.max-width-55p{max-width:55%}.max-width-56p{max-width:56%}.max-width-57p{max-width:57%}.max-width-58p{max-width:58%}.max-width-59p{max-width:59%}.max-width-60p{max-width:60%}.max-width-61p{max-width:61%}.max-width-62p{max-width:62%}.max-width-63p{max-width:63%}.max-width-64p{max-width:64%}.max-width-65p{max-width:65%}.max-width-66p{max-width:66%}.max-width-67p{max-width:67%}.max-width-68p{max-width:68%}.max-width-69p{max-width:69%}.max-width-70p{max-width:70%}.max-width-71p{max-width:71%}.max-width-72p{max-width:72%}.max-width-73p{max-width:73%}.max-width-74p{max-width:74%}.max-width-75p{max-width:75%}.max-width-76p{max-width:76%}.max-width-77p{max-width:77%}.max-width-78p{max-width:78%}.max-width-79p{max-width:79%}.max-width-80p{max-width:80%}.max-width-81p{max-width:81%}.max-width-82p{max-width:82%}.max-width-83p{max-width:83%}.max-width-84p{max-width:84%}.max-width-85p{max-width:85%}.max-width-86p{max-width:86%}.max-width-87p{max-width:87%}.max-width-88p{max-width:88%}.max-width-89p{max-width:89%}.max-width-90p{max-width:90%}.max-width-91p{max-width:91%}.max-width-92p{max-width:92%}.max-width-93p{max-width:93%}.max-width-94p{max-width:94%}.max-width-95p{max-width:95%}.max-width-96p{max-width:96%}.max-width-97p{max-width:97%}.max-width-98p{max-width:98%}.max-width-99p{max-width:99%}.max-width-100p,.max-width-full{max-width:100%}.max-width-auto{max-width:auto}.max-width-third{max-width:33.33333%}.max-width-two-thirds{max-width:66.66667%}.overflow-visible{overflow:visible}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-auto{overflow:auto}.overflow-x-visible{overflow-x:visible}.overflow-x-hidden{overflow-x:hidden}.overflow-x-scroll{overflow-x:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-visible{overflow-y:visible}.overflow-y-hidden{overflow-y:hidden}.overflow-y-scroll{overflow-y:scroll}.overflow-y-auto{overflow-y:auto}.padding-1px{padding:1px}.padding-2px{padding:2px}.padding-3px{padding:3px}.padding-4px{padding:4px}.padding-5px{padding:5px}.padding-6px{padding:6px}.padding-7px{padding:7px}.padding-8px{padding:8px}.padding-9px{padding:9px}.padding-10px{padding:10px}.padding-0{padding:0}.padding-0_25{padding:.25rem}.padding-0_5{padding:.5rem}.padding-0_75{padding:.75rem}.padding-1{padding:1rem}.padding-1_25{padding:1.25rem}.padding-1_5{padding:1.5rem}.padding-1_75{padding:1.75rem}.padding-2{padding:2rem}.padding-2_25{padding:2.25rem}.padding-2_5{padding:2.5rem}.padding-2_75{padding:2.75rem}.padding-3{padding:3rem}.padding-3_25{padding:3.25rem}.padding-3_5{padding:3.5rem}.padding-3_75{padding:3.75rem}.padding-4{padding:4rem}.padding-4_25{padding:4.25rem}.padding-4_5{padding:4.5rem}.padding-4_75{padding:4.75rem}.padding-5{padding:5rem}.padding-5_25{padding:5.25rem}.padding-5_5{padding:5.5rem}.padding-5_75{padding:5.75rem}.padding-6{padding:6rem}.padding-6_25{padding:6.25rem}.padding-6_5{padding:6.5rem}.padding-6_75{padding:6.75rem}.padding-7{padding:7rem}.padding-7_25{padding:7.25rem}.padding-7_5{padding:7.5rem}.padding-7_75{padding:7.75rem}.padding-8{padding:8rem}.padding-8_25{padding:8.25rem}.padding-8_5{padding:8.5rem}.padding-8_75{padding:8.75rem}.padding-9{padding:9rem}.padding-9_25{padding:9.25rem}.padding-9_5{padding:9.5rem}.padding-9_75{padding:9.75rem}.padding-10{padding:10rem}.padding-10_25{padding:10.25rem}.padding-10_5{padding:10.5rem}.padding-10_75{padding:10.75rem}.padding-11{padding:11rem}.padding-11_25{padding:11.25rem}.padding-11_5{padding:11.5rem}.padding-11_75{padding:11.75rem}.padding-12{padding:12rem}.padding-12_25{padding:12.25rem}.padding-12_5{padding:12.5rem}.padding-12_75{padding:12.75rem}.padding-13{padding:13rem}.padding-13_25{padding:13.25rem}.padding-13_5{padding:13.5rem}.padding-13_75{padding:13.75rem}.padding-14{padding:14rem}.padding-14_25{padding:14.25rem}.padding-14_5{padding:14.5rem}.padding-14_75{padding:14.75rem}.padding-15{padding:15rem}.padding-15_25{padding:15.25rem}.padding-15_5{padding:15.5rem}.padding-15_75{padding:15.75rem}.padding-16{padding:16rem}.padding-16_25{padding:16.25rem}.padding-16_5{padding:16.5rem}.padding-16_75{padding:16.75rem}.padding-17{padding:17rem}.padding-17_25{padding:17.25rem}.padding-17_5{padding:17.5rem}.padding-17_75{padding:17.75rem}.padding-18{padding:18rem}.padding-18_25{padding:18.25rem}.padding-18_5{padding:18.5rem}.padding-18_75{padding:18.75rem}.padding-19{padding:19rem}.padding-19_25{padding:19.25rem}.padding-19_5{padding:19.5rem}.padding-19_75{padding:19.75rem}.padding-20{padding:20rem}.padding-auto{padding:auto}.padding-top-1px{padding-top:1px}.padding-top-2px{padding-top:2px}.padding-top-3px{padding-top:3px}.padding-top-4px{padding-top:4px}.padding-top-5px{padding-top:5px}.padding-top-6px{padding-top:6px}.padding-top-7px{padding-top:7px}.padding-top-8px{padding-top:8px}.padding-top-9px{padding-top:9px}.padding-top-10px{padding-top:10px}.padding-top-0{padding-top:0}.padding-top-0_25{padding-top:.25rem}.padding-top-0_5{padding-top:.5rem}.padding-top-0_75{padding-top:.75rem}.padding-top-1{padding-top:1rem}.padding-top-1_25{padding-top:1.25rem}.padding-top-1_5{padding-top:1.5rem}.padding-top-1_75{padding-top:1.75rem}.padding-top-2{padding-top:2rem}.padding-top-2_25{padding-top:2.25rem}.padding-top-2_5{padding-top:2.5rem}.padding-top-2_75{padding-top:2.75rem}.padding-top-3{padding-top:3rem}.padding-top-3_25{padding-top:3.25rem}.padding-top-3_5{padding-top:3.5rem}.padding-top-3_75{padding-top:3.75rem}.padding-top-4{padding-top:4rem}.padding-top-4_25{padding-top:4.25rem}.padding-top-4_5{padding-top:4.5rem}.padding-top-4_75{padding-top:4.75rem}.padding-top-5{padding-top:5rem}.padding-top-5_25{padding-top:5.25rem}.padding-top-5_5{padding-top:5.5rem}.padding-top-5_75{padding-top:5.75rem}.padding-top-6{padding-top:6rem}.padding-top-6_25{padding-top:6.25rem}.padding-top-6_5{padding-top:6.5rem}.padding-top-6_75{padding-top:6.75rem}.padding-top-7{padding-top:7rem}.padding-top-7_25{padding-top:7.25rem}.padding-top-7_5{padding-top:7.5rem}.padding-top-7_75{padding-top:7.75rem}.padding-top-8{padding-top:8rem}.padding-top-8_25{padding-top:8.25rem}.padding-top-8_5{padding-top:8.5rem}.padding-top-8_75{padding-top:8.75rem}.padding-top-9{padding-top:9rem}.padding-top-9_25{padding-top:9.25rem}.padding-top-9_5{padding-top:9.5rem}.padding-top-9_75{padding-top:9.75rem}.padding-top-10{padding-top:10rem}.padding-top-10_25{padding-top:10.25rem}.padding-top-10_5{padding-top:10.5rem}.padding-top-10_75{padding-top:10.75rem}.padding-top-11{padding-top:11rem}.padding-top-11_25{padding-top:11.25rem}.padding-top-11_5{padding-top:11.5rem}.padding-top-11_75{padding-top:11.75rem}.padding-top-12{padding-top:12rem}.padding-top-12_25{padding-top:12.25rem}.padding-top-12_5{padding-top:12.5rem}.padding-top-12_75{padding-top:12.75rem}.padding-top-13{padding-top:13rem}.padding-top-13_25{padding-top:13.25rem}.padding-top-13_5{padding-top:13.5rem}.padding-top-13_75{padding-top:13.75rem}.padding-top-14{padding-top:14rem}.padding-top-14_25{padding-top:14.25rem}.padding-top-14_5{padding-top:14.5rem}.padding-top-14_75{padding-top:14.75rem}.padding-top-15{padding-top:15rem}.padding-top-15_25{padding-top:15.25rem}.padding-top-15_5{padding-top:15.5rem}.padding-top-15_75{padding-top:15.75rem}.padding-top-16{padding-top:16rem}.padding-top-16_25{padding-top:16.25rem}.padding-top-16_5{padding-top:16.5rem}.padding-top-16_75{padding-top:16.75rem}.padding-top-17{padding-top:17rem}.padding-top-17_25{padding-top:17.25rem}.padding-top-17_5{padding-top:17.5rem}.padding-top-17_75{padding-top:17.75rem}.padding-top-18{padding-top:18rem}.padding-top-18_25{padding-top:18.25rem}.padding-top-18_5{padding-top:18.5rem}.padding-top-18_75{padding-top:18.75rem}.padding-top-19{padding-top:19rem}.padding-top-19_25{padding-top:19.25rem}.padding-top-19_5{padding-top:19.5rem}.padding-top-19_75{padding-top:19.75rem}.padding-top-20{padding-top:20rem}.padding-top-auto{padding-top:auto}.padding-right-1px{padding-right:1px}.padding-right-2px{padding-right:2px}.padding-right-3px{padding-right:3px}.padding-right-4px{padding-right:4px}.padding-right-5px{padding-right:5px}.padding-right-6px{padding-right:6px}.padding-right-7px{padding-right:7px}.padding-right-8px{padding-right:8px}.padding-right-9px{padding-right:9px}.padding-right-10px{padding-right:10px}.padding-right-0{padding-right:0}.padding-right-0_25{padding-right:.25rem}.padding-right-0_5{padding-right:.5rem}.padding-right-0_75{padding-right:.75rem}.padding-right-1{padding-right:1rem}.padding-right-1_25{padding-right:1.25rem}.padding-right-1_5{padding-right:1.5rem}.padding-right-1_75{padding-right:1.75rem}.padding-right-2{padding-right:2rem}.padding-right-2_25{padding-right:2.25rem}.padding-right-2_5{padding-right:2.5rem}.padding-right-2_75{padding-right:2.75rem}.padding-right-3{padding-right:3rem}.padding-right-3_25{padding-right:3.25rem}.padding-right-3_5{padding-right:3.5rem}.padding-right-3_75{padding-right:3.75rem}.padding-right-4{padding-right:4rem}.padding-right-4_25{padding-right:4.25rem}.padding-right-4_5{padding-right:4.5rem}.padding-right-4_75{padding-right:4.75rem}.padding-right-5{padding-right:5rem}.padding-right-5_25{padding-right:5.25rem}.padding-right-5_5{padding-right:5.5rem}.padding-right-5_75{padding-right:5.75rem}.padding-right-6{padding-right:6rem}.padding-right-6_25{padding-right:6.25rem}.padding-right-6_5{padding-right:6.5rem}.padding-right-6_75{padding-right:6.75rem}.padding-right-7{padding-right:7rem}.padding-right-7_25{padding-right:7.25rem}.padding-right-7_5{padding-right:7.5rem}.padding-right-7_75{padding-right:7.75rem}.padding-right-8{padding-right:8rem}.padding-right-8_25{padding-right:8.25rem}.padding-right-8_5{padding-right:8.5rem}.padding-right-8_75{padding-right:8.75rem}.padding-right-9{padding-right:9rem}.padding-right-9_25{padding-right:9.25rem}.padding-right-9_5{padding-right:9.5rem}.padding-right-9_75{padding-right:9.75rem}.padding-right-10{padding-right:10rem}.padding-right-10_25{padding-right:10.25rem}.padding-right-10_5{padding-right:10.5rem}.padding-right-10_75{padding-right:10.75rem}.padding-right-11{padding-right:11rem}.padding-right-11_25{padding-right:11.25rem}.padding-right-11_5{padding-right:11.5rem}.padding-right-11_75{padding-right:11.75rem}.padding-right-12{padding-right:12rem}.padding-right-12_25{padding-right:12.25rem}.padding-right-12_5{padding-right:12.5rem}.padding-right-12_75{padding-right:12.75rem}.padding-right-13{padding-right:13rem}.padding-right-13_25{padding-right:13.25rem}.padding-right-13_5{padding-right:13.5rem}.padding-right-13_75{padding-right:13.75rem}.padding-right-14{padding-right:14rem}.padding-right-14_25{padding-right:14.25rem}.padding-right-14_5{padding-right:14.5rem}.padding-right-14_75{padding-right:14.75rem}.padding-right-15{padding-right:15rem}.padding-right-15_25{padding-right:15.25rem}.padding-right-15_5{padding-right:15.5rem}.padding-right-15_75{padding-right:15.75rem}.padding-right-16{padding-right:16rem}.padding-right-16_25{padding-right:16.25rem}.padding-right-16_5{padding-right:16.5rem}.padding-right-16_75{padding-right:16.75rem}.padding-right-17{padding-right:17rem}.padding-right-17_25{padding-right:17.25rem}.padding-right-17_5{padding-right:17.5rem}.padding-right-17_75{padding-right:17.75rem}.padding-right-18{padding-right:18rem}.padding-right-18_25{padding-right:18.25rem}.padding-right-18_5{padding-right:18.5rem}.padding-right-18_75{padding-right:18.75rem}.padding-right-19{padding-right:19rem}.padding-right-19_25{padding-right:19.25rem}.padding-right-19_5{padding-right:19.5rem}.padding-right-19_75{padding-right:19.75rem}.padding-right-20{padding-right:20rem}.padding-right-auto{padding-right:auto}.padding-bottom-1px{padding-bottom:1px}.padding-bottom-2px{padding-bottom:2px}.padding-bottom-3px{padding-bottom:3px}.padding-bottom-4px{padding-bottom:4px}.padding-bottom-5px{padding-bottom:5px}.padding-bottom-6px{padding-bottom:6px}.padding-bottom-7px{padding-bottom:7px}.padding-bottom-8px{padding-bottom:8px}.padding-bottom-9px{padding-bottom:9px}.padding-bottom-10px{padding-bottom:10px}.padding-bottom-0{padding-bottom:0}.padding-bottom-0_25{padding-bottom:.25rem}.padding-bottom-0_5{padding-bottom:.5rem}.padding-bottom-0_75{padding-bottom:.75rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1_25{padding-bottom:1.25rem}.padding-bottom-1_5{padding-bottom:1.5rem}.padding-bottom-1_75{padding-bottom:1.75rem}.padding-bottom-2{padding-bottom:2rem}.padding-bottom-2_25{padding-bottom:2.25rem}.padding-bottom-2_5{padding-bottom:2.5rem}.padding-bottom-2_75{padding-bottom:2.75rem}.padding-bottom-3{padding-bottom:3rem}.padding-bottom-3_25{padding-bottom:3.25rem}.padding-bottom-3_5{padding-bottom:3.5rem}.padding-bottom-3_75{padding-bottom:3.75rem}.padding-bottom-4{padding-bottom:4rem}.padding-bottom-4_25{padding-bottom:4.25rem}.padding-bottom-4_5{padding-bottom:4.5rem}.padding-bottom-4_75{padding-bottom:4.75rem}.padding-bottom-5{padding-bottom:5rem}.padding-bottom-5_25{padding-bottom:5.25rem}.padding-bottom-5_5{padding-bottom:5.5rem}.padding-bottom-5_75{padding-bottom:5.75rem}.padding-bottom-6{padding-bottom:6rem}.padding-bottom-6_25{padding-bottom:6.25rem}.padding-bottom-6_5{padding-bottom:6.5rem}.padding-bottom-6_75{padding-bottom:6.75rem}.padding-bottom-7{padding-bottom:7rem}.padding-bottom-7_25{padding-bottom:7.25rem}.padding-bottom-7_5{padding-bottom:7.5rem}.padding-bottom-7_75{padding-bottom:7.75rem}.padding-bottom-8{padding-bottom:8rem}.padding-bottom-8_25{padding-bottom:8.25rem}.padding-bottom-8_5{padding-bottom:8.5rem}.padding-bottom-8_75{padding-bottom:8.75rem}.padding-bottom-9{padding-bottom:9rem}.padding-bottom-9_25{padding-bottom:9.25rem}.padding-bottom-9_5{padding-bottom:9.5rem}.padding-bottom-9_75{padding-bottom:9.75rem}.padding-bottom-10{padding-bottom:10rem}.padding-bottom-10_25{padding-bottom:10.25rem}.padding-bottom-10_5{padding-bottom:10.5rem}.padding-bottom-10_75{padding-bottom:10.75rem}.padding-bottom-11{padding-bottom:11rem}.padding-bottom-11_25{padding-bottom:11.25rem}.padding-bottom-11_5{padding-bottom:11.5rem}.padding-bottom-11_75{padding-bottom:11.75rem}.padding-bottom-12{padding-bottom:12rem}.padding-bottom-12_25{padding-bottom:12.25rem}.padding-bottom-12_5{padding-bottom:12.5rem}.padding-bottom-12_75{padding-bottom:12.75rem}.padding-bottom-13{padding-bottom:13rem}.padding-bottom-13_25{padding-bottom:13.25rem}.padding-bottom-13_5{padding-bottom:13.5rem}.padding-bottom-13_75{padding-bottom:13.75rem}.padding-bottom-14{padding-bottom:14rem}.padding-bottom-14_25{padding-bottom:14.25rem}.padding-bottom-14_5{padding-bottom:14.5rem}.padding-bottom-14_75{padding-bottom:14.75rem}.padding-bottom-15{padding-bottom:15rem}.padding-bottom-15_25{padding-bottom:15.25rem}.padding-bottom-15_5{padding-bottom:15.5rem}.padding-bottom-15_75{padding-bottom:15.75rem}.padding-bottom-16{padding-bottom:16rem}.padding-bottom-16_25{padding-bottom:16.25rem}.padding-bottom-16_5{padding-bottom:16.5rem}.padding-bottom-16_75{padding-bottom:16.75rem}.padding-bottom-17{padding-bottom:17rem}.padding-bottom-17_25{padding-bottom:17.25rem}.padding-bottom-17_5{padding-bottom:17.5rem}.padding-bottom-17_75{padding-bottom:17.75rem}.padding-bottom-18{padding-bottom:18rem}.padding-bottom-18_25{padding-bottom:18.25rem}.padding-bottom-18_5{padding-bottom:18.5rem}.padding-bottom-18_75{padding-bottom:18.75rem}.padding-bottom-19{padding-bottom:19rem}.padding-bottom-19_25{padding-bottom:19.25rem}.padding-bottom-19_5{padding-bottom:19.5rem}.padding-bottom-19_75{padding-bottom:19.75rem}.padding-bottom-20{padding-bottom:20rem}.padding-bottom-auto{padding-bottom:auto}.padding-left-1px{padding-left:1px}.padding-left-2px{padding-left:2px}.padding-left-3px{padding-left:3px}.padding-left-4px{padding-left:4px}.padding-left-5px{padding-left:5px}.padding-left-6px{padding-left:6px}.padding-left-7px{padding-left:7px}.padding-left-8px{padding-left:8px}.padding-left-9px{padding-left:9px}.padding-left-10px{padding-left:10px}.padding-left-0{padding-left:0}.padding-left-0_25{padding-left:.25rem}.padding-left-0_5{padding-left:.5rem}.padding-left-0_75{padding-left:.75rem}.padding-left-1{padding-left:1rem}.padding-left-1_25{padding-left:1.25rem}.padding-left-1_5{padding-left:1.5rem}.padding-left-1_75{padding-left:1.75rem}.padding-left-2{padding-left:2rem}.padding-left-2_25{padding-left:2.25rem}.padding-left-2_5{padding-left:2.5rem}.padding-left-2_75{padding-left:2.75rem}.padding-left-3{padding-left:3rem}.padding-left-3_25{padding-left:3.25rem}.padding-left-3_5{padding-left:3.5rem}.padding-left-3_75{padding-left:3.75rem}.padding-left-4{padding-left:4rem}.padding-left-4_25{padding-left:4.25rem}.padding-left-4_5{padding-left:4.5rem}.padding-left-4_75{padding-left:4.75rem}.padding-left-5{padding-left:5rem}.padding-left-5_25{padding-left:5.25rem}.padding-left-5_5{padding-left:5.5rem}.padding-left-5_75{padding-left:5.75rem}.padding-left-6{padding-left:6rem}.padding-left-6_25{padding-left:6.25rem}.padding-left-6_5{padding-left:6.5rem}.padding-left-6_75{padding-left:6.75rem}.padding-left-7{padding-left:7rem}.padding-left-7_25{padding-left:7.25rem}.padding-left-7_5{padding-left:7.5rem}.padding-left-7_75{padding-left:7.75rem}.padding-left-8{padding-left:8rem}.padding-left-8_25{padding-left:8.25rem}.padding-left-8_5{padding-left:8.5rem}.padding-left-8_75{padding-left:8.75rem}.padding-left-9{padding-left:9rem}.padding-left-9_25{padding-left:9.25rem}.padding-left-9_5{padding-left:9.5rem}.padding-left-9_75{padding-left:9.75rem}.padding-left-10{padding-left:10rem}.padding-left-10_25{padding-left:10.25rem}.padding-left-10_5{padding-left:10.5rem}.padding-left-10_75{padding-left:10.75rem}.padding-left-11{padding-left:11rem}.padding-left-11_25{padding-left:11.25rem}.padding-left-11_5{padding-left:11.5rem}.padding-left-11_75{padding-left:11.75rem}.padding-left-12{padding-left:12rem}.padding-left-12_25{padding-left:12.25rem}.padding-left-12_5{padding-left:12.5rem}.padding-left-12_75{padding-left:12.75rem}.padding-left-13{padding-left:13rem}.padding-left-13_25{padding-left:13.25rem}.padding-left-13_5{padding-left:13.5rem}.padding-left-13_75{padding-left:13.75rem}.padding-left-14{padding-left:14rem}.padding-left-14_25{padding-left:14.25rem}.padding-left-14_5{padding-left:14.5rem}.padding-left-14_75{padding-left:14.75rem}.padding-left-15{padding-left:15rem}.padding-left-15_25{padding-left:15.25rem}.padding-left-15_5{padding-left:15.5rem}.padding-left-15_75{padding-left:15.75rem}.padding-left-16{padding-left:16rem}.padding-left-16_25{padding-left:16.25rem}.padding-left-16_5{padding-left:16.5rem}.padding-left-16_75{padding-left:16.75rem}.padding-left-17{padding-left:17rem}.padding-left-17_25{padding-left:17.25rem}.padding-left-17_5{padding-left:17.5rem}.padding-left-17_75{padding-left:17.75rem}.padding-left-18{padding-left:18rem}.padding-left-18_25{padding-left:18.25rem}.padding-left-18_5{padding-left:18.5rem}.padding-left-18_75{padding-left:18.75rem}.padding-left-19{padding-left:19rem}.padding-left-19_25{padding-left:19.25rem}.padding-left-19_5{padding-left:19.5rem}.padding-left-19_75{padding-left:19.75rem}.padding-left-20{padding-left:20rem}.padding-left-auto{padding-left:auto}.padding-x-1px{padding-left:1px;padding-right:1px}.padding-x-2px{padding-left:2px;padding-right:2px}.padding-x-3px{padding-left:3px;padding-right:3px}.padding-x-4px{padding-left:4px;padding-right:4px}.padding-x-5px{padding-left:5px;padding-right:5px}.padding-x-6px{padding-left:6px;padding-right:6px}.padding-x-7px{padding-left:7px;padding-right:7px}.padding-x-8px{padding-left:8px;padding-right:8px}.padding-x-9px{padding-left:9px;padding-right:9px}.padding-x-10px{padding-left:10px;padding-right:10px}.padding-x-0{padding-left:0;padding-right:0}.padding-x-0_25{padding-left:.25rem;padding-right:.25rem}.padding-x-0_5{padding-left:.5rem;padding-right:.5rem}.padding-x-0_75{padding-left:.75rem;padding-right:.75rem}.padding-x-1{padding-left:1rem;padding-right:1rem}.padding-x-1_25{padding-left:1.25rem;padding-right:1.25rem}.padding-x-1_5{padding-left:1.5rem;padding-right:1.5rem}.padding-x-1_75{padding-left:1.75rem;padding-right:1.75rem}.padding-x-2{padding-left:2rem;padding-right:2rem}.padding-x-2_25{padding-left:2.25rem;padding-right:2.25rem}.padding-x-2_5{padding-left:2.5rem;padding-right:2.5rem}.padding-x-2_75{padding-left:2.75rem;padding-right:2.75rem}.padding-x-3{padding-left:3rem;padding-right:3rem}.padding-x-3_25{padding-left:3.25rem;padding-right:3.25rem}.padding-x-3_5{padding-left:3.5rem;padding-right:3.5rem}.padding-x-3_75{padding-left:3.75rem;padding-right:3.75rem}.padding-x-4{padding-left:4rem;padding-right:4rem}.padding-x-4_25{padding-left:4.25rem;padding-right:4.25rem}.padding-x-4_5{padding-left:4.5rem;padding-right:4.5rem}.padding-x-4_75{padding-left:4.75rem;padding-right:4.75rem}.padding-x-5{padding-left:5rem;padding-right:5rem}.padding-x-5_25{padding-left:5.25rem;padding-right:5.25rem}.padding-x-5_5{padding-left:5.5rem;padding-right:5.5rem}.padding-x-5_75{padding-left:5.75rem;padding-right:5.75rem}.padding-x-6{padding-left:6rem;padding-right:6rem}.padding-x-6_25{padding-left:6.25rem;padding-right:6.25rem}.padding-x-6_5{padding-left:6.5rem;padding-right:6.5rem}.padding-x-6_75{padding-left:6.75rem;padding-right:6.75rem}.padding-x-7{padding-left:7rem;padding-right:7rem}.padding-x-7_25{padding-left:7.25rem;padding-right:7.25rem}.padding-x-7_5{padding-left:7.5rem;padding-right:7.5rem}.padding-x-7_75{padding-left:7.75rem;padding-right:7.75rem}.padding-x-8{padding-left:8rem;padding-right:8rem}.padding-x-8_25{padding-left:8.25rem;padding-right:8.25rem}.padding-x-8_5{padding-left:8.5rem;padding-right:8.5rem}.padding-x-8_75{padding-left:8.75rem;padding-right:8.75rem}.padding-x-9{padding-left:9rem;padding-right:9rem}.padding-x-9_25{padding-left:9.25rem;padding-right:9.25rem}.padding-x-9_5{padding-left:9.5rem;padding-right:9.5rem}.padding-x-9_75{padding-left:9.75rem;padding-right:9.75rem}.padding-x-10{padding-left:10rem;padding-right:10rem}.padding-x-10_25{padding-left:10.25rem;padding-right:10.25rem}.padding-x-10_5{padding-left:10.5rem;padding-right:10.5rem}.padding-x-10_75{padding-left:10.75rem;padding-right:10.75rem}.padding-x-11{padding-left:11rem;padding-right:11rem}.padding-x-11_25{padding-left:11.25rem;padding-right:11.25rem}.padding-x-11_5{padding-left:11.5rem;padding-right:11.5rem}.padding-x-11_75{padding-left:11.75rem;padding-right:11.75rem}.padding-x-12{padding-left:12rem;padding-right:12rem}.padding-x-12_25{padding-left:12.25rem;padding-right:12.25rem}.padding-x-12_5{padding-left:12.5rem;padding-right:12.5rem}.padding-x-12_75{padding-left:12.75rem;padding-right:12.75rem}.padding-x-13{padding-left:13rem;padding-right:13rem}.padding-x-13_25{padding-left:13.25rem;padding-right:13.25rem}.padding-x-13_5{padding-left:13.5rem;padding-right:13.5rem}.padding-x-13_75{padding-left:13.75rem;padding-right:13.75rem}.padding-x-14{padding-left:14rem;padding-right:14rem}.padding-x-14_25{padding-left:14.25rem;padding-right:14.25rem}.padding-x-14_5{padding-left:14.5rem;padding-right:14.5rem}.padding-x-14_75{padding-left:14.75rem;padding-right:14.75rem}.padding-x-15{padding-left:15rem;padding-right:15rem}.padding-x-15_25{padding-left:15.25rem;padding-right:15.25rem}.padding-x-15_5{padding-left:15.5rem;padding-right:15.5rem}.padding-x-15_75{padding-left:15.75rem;padding-right:15.75rem}.padding-x-16{padding-left:16rem;padding-right:16rem}.padding-x-16_25{padding-left:16.25rem;padding-right:16.25rem}.padding-x-16_5{padding-left:16.5rem;padding-right:16.5rem}.padding-x-16_75{padding-left:16.75rem;padding-right:16.75rem}.padding-x-17{padding-left:17rem;padding-right:17rem}.padding-x-17_25{padding-left:17.25rem;padding-right:17.25rem}.padding-x-17_5{padding-left:17.5rem;padding-right:17.5rem}.padding-x-17_75{padding-left:17.75rem;padding-right:17.75rem}.padding-x-18{padding-left:18rem;padding-right:18rem}.padding-x-18_25{padding-left:18.25rem;padding-right:18.25rem}.padding-x-18_5{padding-left:18.5rem;padding-right:18.5rem}.padding-x-18_75{padding-left:18.75rem;padding-right:18.75rem}.padding-x-19{padding-left:19rem;padding-right:19rem}.padding-x-19_25{padding-left:19.25rem;padding-right:19.25rem}.padding-x-19_5{padding-left:19.5rem;padding-right:19.5rem}.padding-x-19_75{padding-left:19.75rem;padding-right:19.75rem}.padding-x-20{padding-left:20rem;padding-right:20rem}.padding-x-auto{padding-left:auto;padding-right:auto}.padding-y-1px{padding-bottom:1px;padding-top:1px}.padding-y-2px{padding-bottom:2px;padding-top:2px}.padding-y-3px{padding-bottom:3px;padding-top:3px}.padding-y-4px{padding-bottom:4px;padding-top:4px}.padding-y-5px{padding-bottom:5px;padding-top:5px}.padding-y-6px{padding-bottom:6px;padding-top:6px}.padding-y-7px{padding-bottom:7px;padding-top:7px}.padding-y-8px{padding-bottom:8px;padding-top:8px}.padding-y-9px{padding-bottom:9px;padding-top:9px}.padding-y-10px{padding-bottom:10px;padding-top:10px}.padding-y-0{padding-bottom:0;padding-top:0}.padding-y-0_25{padding-bottom:.25rem;padding-top:.25rem}.padding-y-0_5{padding-bottom:.5rem;padding-top:.5rem}.padding-y-0_75{padding-bottom:.75rem;padding-top:.75rem}.padding-y-1{padding-bottom:1rem;padding-top:1rem}.padding-y-1_25{padding-bottom:1.25rem;padding-top:1.25rem}.padding-y-1_5{padding-bottom:1.5rem;padding-top:1.5rem}.padding-y-1_75{padding-bottom:1.75rem;padding-top:1.75rem}.padding-y-2{padding-bottom:2rem;padding-top:2rem}.padding-y-2_25{padding-bottom:2.25rem;padding-top:2.25rem}.padding-y-2_5{padding-bottom:2.5rem;padding-top:2.5rem}.padding-y-2_75{padding-bottom:2.75rem;padding-top:2.75rem}.padding-y-3{padding-bottom:3rem;padding-top:3rem}.padding-y-3_25{padding-bottom:3.25rem;padding-top:3.25rem}.padding-y-3_5{padding-bottom:3.5rem;padding-top:3.5rem}.padding-y-3_75{padding-bottom:3.75rem;padding-top:3.75rem}.padding-y-4{padding-bottom:4rem;padding-top:4rem}.padding-y-4_25{padding-bottom:4.25rem;padding-top:4.25rem}.padding-y-4_5{padding-bottom:4.5rem;padding-top:4.5rem}.padding-y-4_75{padding-bottom:4.75rem;padding-top:4.75rem}.padding-y-5{padding-bottom:5rem;padding-top:5rem}.padding-y-5_25{padding-bottom:5.25rem;padding-top:5.25rem}.padding-y-5_5{padding-bottom:5.5rem;padding-top:5.5rem}.padding-y-5_75{padding-bottom:5.75rem;padding-top:5.75rem}.padding-y-6{padding-bottom:6rem;padding-top:6rem}.padding-y-6_25{padding-bottom:6.25rem;padding-top:6.25rem}.padding-y-6_5{padding-bottom:6.5rem;padding-top:6.5rem}.padding-y-6_75{padding-bottom:6.75rem;padding-top:6.75rem}.padding-y-7{padding-bottom:7rem;padding-top:7rem}.padding-y-7_25{padding-bottom:7.25rem;padding-top:7.25rem}.padding-y-7_5{padding-bottom:7.5rem;padding-top:7.5rem}.padding-y-7_75{padding-bottom:7.75rem;padding-top:7.75rem}.padding-y-8{padding-bottom:8rem;padding-top:8rem}.padding-y-8_25{padding-bottom:8.25rem;padding-top:8.25rem}.padding-y-8_5{padding-bottom:8.5rem;padding-top:8.5rem}.padding-y-8_75{padding-bottom:8.75rem;padding-top:8.75rem}.padding-y-9{padding-bottom:9rem;padding-top:9rem}.padding-y-9_25{padding-bottom:9.25rem;padding-top:9.25rem}.padding-y-9_5{padding-bottom:9.5rem;padding-top:9.5rem}.padding-y-9_75{padding-bottom:9.75rem;padding-top:9.75rem}.padding-y-10{padding-bottom:10rem;padding-top:10rem}.padding-y-10_25{padding-bottom:10.25rem;padding-top:10.25rem}.padding-y-10_5{padding-bottom:10.5rem;padding-top:10.5rem}.padding-y-10_75{padding-bottom:10.75rem;padding-top:10.75rem}.padding-y-11{padding-bottom:11rem;padding-top:11rem}.padding-y-11_25{padding-bottom:11.25rem;padding-top:11.25rem}.padding-y-11_5{padding-bottom:11.5rem;padding-top:11.5rem}.padding-y-11_75{padding-bottom:11.75rem;padding-top:11.75rem}.padding-y-12{padding-bottom:12rem;padding-top:12rem}.padding-y-12_25{padding-bottom:12.25rem;padding-top:12.25rem}.padding-y-12_5{padding-bottom:12.5rem;padding-top:12.5rem}.padding-y-12_75{padding-bottom:12.75rem;padding-top:12.75rem}.padding-y-13{padding-bottom:13rem;padding-top:13rem}.padding-y-13_25{padding-bottom:13.25rem;padding-top:13.25rem}.padding-y-13_5{padding-bottom:13.5rem;padding-top:13.5rem}.padding-y-13_75{padding-bottom:13.75rem;padding-top:13.75rem}.padding-y-14{padding-bottom:14rem;padding-top:14rem}.padding-y-14_25{padding-bottom:14.25rem;padding-top:14.25rem}.padding-y-14_5{padding-bottom:14.5rem;padding-top:14.5rem}.padding-y-14_75{padding-bottom:14.75rem;padding-top:14.75rem}.padding-y-15{padding-bottom:15rem;padding-top:15rem}.padding-y-15_25{padding-bottom:15.25rem;padding-top:15.25rem}.padding-y-15_5{padding-bottom:15.5rem;padding-top:15.5rem}.padding-y-15_75{padding-bottom:15.75rem;padding-top:15.75rem}.padding-y-16{padding-bottom:16rem;padding-top:16rem}.padding-y-16_25{padding-bottom:16.25rem;padding-top:16.25rem}.padding-y-16_5{padding-bottom:16.5rem;padding-top:16.5rem}.padding-y-16_75{padding-bottom:16.75rem;padding-top:16.75rem}.padding-y-17{padding-bottom:17rem;padding-top:17rem}.padding-y-17_25{padding-bottom:17.25rem;padding-top:17.25rem}.padding-y-17_5{padding-bottom:17.5rem;padding-top:17.5rem}.padding-y-17_75{padding-bottom:17.75rem;padding-top:17.75rem}.padding-y-18{padding-bottom:18rem;padding-top:18rem}.padding-y-18_25{padding-bottom:18.25rem;padding-top:18.25rem}.padding-y-18_5{padding-bottom:18.5rem;padding-top:18.5rem}.padding-y-18_75{padding-bottom:18.75rem;padding-top:18.75rem}.padding-y-19{padding-bottom:19rem;padding-top:19rem}.padding-y-19_25{padding-bottom:19.25rem;padding-top:19.25rem}.padding-y-19_5{padding-bottom:19.5rem;padding-top:19.5rem}.padding-y-19_75{padding-bottom:19.75rem;padding-top:19.75rem}.padding-y-20{padding-bottom:20rem;padding-top:20rem}.padding-y-auto{padding-bottom:auto;padding-top:auto}.top-0{top:0}.top-1{top:1rem}.top-2{top:2rem}.top-3{top:3rem}.top-4{top:4rem}.top-5{top:5rem}.top-6{top:6rem}.top-7{top:7rem}.top-8{top:8rem}.top-9{top:9rem}.top-10{top:10rem}.top-11{top:11rem}.top-12{top:12rem}.top-13{top:13rem}.top-14{top:14rem}.top-15{top:15rem}.top-16{top:16rem}.top-17{top:17rem}.top-18{top:18rem}.top-19{top:19rem}.top-20{top:20rem}.top--1{top:-1rem}.top--2{top:-2rem}.top--3{top:-3rem}.top--4{top:-4rem}.top--5{top:-5rem}.top--6{top:-6rem}.top--7{top:-7rem}.top--8{top:-8rem}.top--9{top:-9rem}.top--10{top:-10rem}.top--11{top:-11rem}.top--12{top:-12rem}.top--13{top:-13rem}.top--14{top:-14rem}.top--15{top:-15rem}.top--16{top:-16rem}.top--17{top:-17rem}.top--18{top:-18rem}.top--19{top:-19rem}.top--20{top:-20rem}.right-0{right:0}.right-1{right:1rem}.right-2{right:2rem}.right-3{right:3rem}.right-4{right:4rem}.right-5{right:5rem}.right-6{right:6rem}.right-7{right:7rem}.right-8{right:8rem}.right-9{right:9rem}.right-10{right:10rem}.right-11{right:11rem}.right-12{right:12rem}.right-13{right:13rem}.right-14{right:14rem}.right-15{right:15rem}.right-16{right:16rem}.right-17{right:17rem}.right-18{right:18rem}.right-19{right:19rem}.right-20{right:20rem}.right--1{right:-1rem}.right--2{right:-2rem}.right--3{right:-3rem}.right--4{right:-4rem}.right--5{right:-5rem}.right--6{right:-6rem}.right--7{right:-7rem}.right--8{right:-8rem}.right--9{right:-9rem}.right--10{right:-10rem}.right--11{right:-11rem}.right--12{right:-12rem}.right--13{right:-13rem}.right--14{right:-14rem}.right--15{right:-15rem}.right--16{right:-16rem}.right--17{right:-17rem}.right--18{right:-18rem}.right--19{right:-19rem}.right--20{right:-20rem}.bottom-0{bottom:0}.bottom-1{bottom:1rem}.bottom-2{bottom:2rem}.bottom-3{bottom:3rem}.bottom-4{bottom:4rem}.bottom-5{bottom:5rem}.bottom-6{bottom:6rem}.bottom-7{bottom:7rem}.bottom-8{bottom:8rem}.bottom-9{bottom:9rem}.bottom-10{bottom:10rem}.bottom-11{bottom:11rem}.bottom-12{bottom:12rem}.bottom-13{bottom:13rem}.bottom-14{bottom:14rem}.bottom-15{bottom:15rem}.bottom-16{bottom:16rem}.bottom-17{bottom:17rem}.bottom-18{bottom:18rem}.bottom-19{bottom:19rem}.bottom-20{bottom:20rem}.bottom--1{bottom:-1rem}.bottom--2{bottom:-2rem}.bottom--3{bottom:-3rem}.bottom--4{bottom:-4rem}.bottom--5{bottom:-5rem}.bottom--6{bottom:-6rem}.bottom--7{bottom:-7rem}.bottom--8{bottom:-8rem}.bottom--9{bottom:-9rem}.bottom--10{bottom:-10rem}.bottom--11{bottom:-11rem}.bottom--12{bottom:-12rem}.bottom--13{bottom:-13rem}.bottom--14{bottom:-14rem}.bottom--15{bottom:-15rem}.bottom--16{bottom:-16rem}.bottom--17{bottom:-17rem}.bottom--18{bottom:-18rem}.bottom--19{bottom:-19rem}.bottom--20{bottom:-20rem}.left-0{left:0}.left-1{left:1rem}.left-2{left:2rem}.left-3{left:3rem}.left-4{left:4rem}.left-5{left:5rem}.left-6{left:6rem}.left-7{left:7rem}.left-8{left:8rem}.left-9{left:9rem}.left-10{left:10rem}.left-11{left:11rem}.left-12{left:12rem}.left-13{left:13rem}.left-14{left:14rem}.left-15{left:15rem}.left-16{left:16rem}.left-17{left:17rem}.left-18{left:18rem}.left-19{left:19rem}.left-20{left:20rem}.left--1{left:-1rem}.left--2{left:-2rem}.left--3{left:-3rem}.left--4{left:-4rem}.left--5{left:-5rem}.left--6{left:-6rem}.left--7{left:-7rem}.left--8{left:-8rem}.left--9{left:-9rem}.left--10{left:-10rem}.left--11{left:-11rem}.left--12{left:-12rem}.left--13{left:-13rem}.left--14{left:-14rem}.left--15{left:-15rem}.left--16{left:-16rem}.left--17{left:-17rem}.left--18{left:-18rem}.left--19{left:-19rem}.left--20{left:-20rem}.rotate-45{transform:rotate(45deg)}.rotate-90{transform:rotate(90deg)}.rotate-135{transform:rotate(135deg)}.rotate-180{transform:rotate(180deg)}.rotate-225{transform:rotate(225deg)}.rotate-270{transform:rotate(270deg)}.rotate-315{transform:rotate(315deg)}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.color-5{color:light-dark(var( --base-90 ),var( --base-5 ))}.color-10{color:light-dark(var( --base-80 ),var( --base-10 ))}.color-20{color:light-dark(var( --base-70 ),var( --base-20 ))}.color-30{color:light-dark(var( --base-60 ),var( --base-30 ))}.color-40{color:light-dark(var( --base-50 ),var( --base-40 ))}.color-50{color:light-dark(var( --base-40 ),var( --base-50 ))}.color-60{color:light-dark(var( --base-30 ),var( --base-60 ))}.color-70{color:light-dark(var( --base-20 ),var( --base-70 ))}.color-80{color:light-dark(var( --base-10 ),var( --base-80 ))}.color-90{color:light-dark(var( --base-5 ),var( --base-90 ))}.background-color-5{background-color:light-dark(var( --base-90 ),var( --base-5 ))}.background-color-10{background-color:light-dark(var( --base-80 ),var( --base-10 ))}.background-color-20{background-color:light-dark(var( --base-70 ),var( --base-20 ))}.background-color-30{background-color:light-dark(var( --base-60 ),var( --base-30 ))}.background-color-40{background-color:light-dark(var( --base-50 ),var( --base-40 ))}.background-color-50{background-color:light-dark(var( --base-40 ),var( --base-50 ))}.background-color-60{background-color:light-dark(var( --base-30 ),var( --base-60 ))}.background-color-70{background-color:light-dark(var( --base-20 ),var( --base-70 ))}.background-color-80{background-color:light-dark(var( --base-10 ),var( --base-80 ))}.background-color-90{background-color:light-dark(var( --base-5 ),var( --base-90 ))}.measure{max-width:30em}.measure-tight{max-width:20em}.measure-loose{max-width:36em}.text-align-left{text-align:left}.text-align-right{text-align:right}.text-align-center{text-align:center}.text-align-justify{text-align:justify}.text-transform-capitalize{text-transform:capitalize}.text-transform-uppercase{text-transform:uppercase}.text-transform-lowercase{text-transform:lowercase}.text-transform-none{text-transform:none}.text-decoration-underline{text-decoration:underline}.text-decoration-strike{text-decoration:line-through}.text-decoration-none{text-decoration:none}.vertical-align-baseline{vertical-align:baseline}.vertical-align-top{vertical-align:top}.vertical-align-middle{vertical-align:middle}.vertical-align-bottom{vertical-align:bottom}.font-style-italic{font-style:italic}.font-style-normal{font-style:normal}.letter-spacing-0{letter-spacing:0}.letter-spacing-1{letter-spacing:.1em}.letter-spacing-2{letter-spacing:.2em}.letter-spacing-3{letter-spacing:.3em}.letter-spacing--1{letter-spacing:-.1em}.letter-spacing--2{letter-spacing:-.2em}.letter-spacing--3{letter-spacing:-.3em}.font-size-0_75{font-size:.75rem}.font-size-1{font-size:1rem}.font-size-1_25{font-size:1.25rem}.font-size-1_5{font-size:1.5rem}.font-size-1_75{font-size:1.75rem}.font-size-2{font-size:2rem}.font-size-2_25{font-size:2.25rem}.font-size-2_5{font-size:2.5rem}.font-size-2_75{font-size:2.75rem}.f1,.font-size-3{font-size:3rem}.f2{font-size:2.25rem}.f3{font-size:1.5rem}.f4{font-size:1.25rem}.f5{font-size:1rem}.f6{font-size:.875rem}.white-space-nowrap{white-space:nowrap}.white-space-pre{white-space:pre}.white-space-pre-line{white-space:pre-line}.white-space-pre-wrap{white-space:pre-wrap}.white-space-normal{white-space:normal}.width-1{width:1rem}.width-2{width:2rem}.width-3{width:3rem}.width-4{width:4rem}.width-5{width:5rem}.width-6{width:6rem}.width-7{width:7rem}.width-8{width:8rem}.width-9{width:9rem}.width-10{width:10rem}.width-11{width:11rem}.width-12{width:12rem}.width-13{width:13rem}.width-14{width:14rem}.width-15{width:15rem}.width-16{width:16rem}.width-17{width:17rem}.width-18{width:18rem}.width-19{width:19rem}.width-20{width:20rem}.width-21{width:21rem}.width-22{width:22rem}.width-23{width:23rem}.width-24{width:24rem}.width-25{width:25rem}.width-26{width:26rem}.width-27{width:27rem}.width-28{width:28rem}.width-29{width:29rem}.width-30{width:30rem}.width-31{width:31rem}.width-32{width:32rem}.width-33{width:33rem}.width-34{width:34rem}.width-35{width:35rem}.width-36{width:36rem}.width-37{width:37rem}.width-38{width:38rem}.width-39{width:39rem}.width-40{width:40rem}.width-41{width:41rem}.width-42{width:42rem}.width-43{width:43rem}.width-44{width:44rem}.width-45{width:45rem}.width-46{width:46rem}.width-47{width:47rem}.width-48{width:48rem}.width-49{width:49rem}.width-50{width:50rem}.width-51{width:51rem}.width-52{width:52rem}.width-53{width:53rem}.width-54{width:54rem}.width-55{width:55rem}.width-56{width:56rem}.width-57{width:57rem}.width-58{width:58rem}.width-59{width:59rem}.width-60{width:60rem}.width-61{width:61rem}.width-62{width:62rem}.width-63{width:63rem}.width-64{width:64rem}.width-65{width:65rem}.width-66{width:66rem}.width-67{width:67rem}.width-68{width:68rem}.width-69{width:69rem}.width-70{width:70rem}.width-71{width:71rem}.width-72{width:72rem}.width-73{width:73rem}.width-74{width:74rem}.width-75{width:75rem}.width-76{width:76rem}.width-77{width:77rem}.width-78{width:78rem}.width-79{width:79rem}.width-80{width:80rem}.width-81{width:81rem}.width-82{width:82rem}.width-83{width:83rem}.width-84{width:84rem}.width-85{width:85rem}.width-86{width:86rem}.width-87{width:87rem}.width-88{width:88rem}.width-89{width:89rem}.width-90{width:90rem}.width-91{width:91rem}.width-92{width:92rem}.width-93{width:93rem}.width-94{width:94rem}.width-95{width:95rem}.width-96{width:96rem}.width-97{width:97rem}.width-98{width:98rem}.width-99{width:99rem}.width-100{width:100rem}.width-1p{width:1%}.width-2p{width:2%}.width-3p{width:3%}.width-4p{width:4%}.width-5p{width:5%}.width-6p{width:6%}.width-7p{width:7%}.width-8p{width:8%}.width-9p{width:9%}.width-10p{width:10%}.width-11p{width:11%}.width-12p{width:12%}.width-13p{width:13%}.width-14p{width:14%}.width-15p{width:15%}.width-16p{width:16%}.width-17p{width:17%}.width-18p{width:18%}.width-19p{width:19%}.width-20p{width:20%}.width-21p{width:21%}.width-22p{width:22%}.width-23p{width:23%}.width-24p{width:24%}.width-25p{width:25%}.width-26p{width:26%}.width-27p{width:27%}.width-28p{width:28%}.width-29p{width:29%}.width-30p{width:30%}.width-31p{width:31%}.width-32p{width:32%}.width-33p{width:33%}.width-34p{width:34%}.width-35p{width:35%}.width-36p{width:36%}.width-37p{width:37%}.width-38p{width:38%}.width-39p{width:39%}.width-40p{width:40%}.width-41p{width:41%}.width-42p{width:42%}.width-43p{width:43%}.width-44p{width:44%}.width-45p{width:45%}.width-46p{width:46%}.width-47p{width:47%}.width-48p{width:48%}.width-49p{width:49%}.width-50p{width:50%}.width-51p{width:51%}.width-52p{width:52%}.width-53p{width:53%}.width-54p{width:54%}.width-55p{width:55%}.width-56p{width:56%}.width-57p{width:57%}.width-58p{width:58%}.width-59p{width:59%}.width-60p{width:60%}.width-61p{width:61%}.width-62p{width:62%}.width-63p{width:63%}.width-64p{width:64%}.width-65p{width:65%}.width-66p{width:66%}.width-67p{width:67%}.width-68p{width:68%}.width-69p{width:69%}.width-70p{width:70%}.width-71p{width:71%}.width-72p{width:72%}.width-73p{width:73%}.width-74p{width:74%}.width-75p{width:75%}.width-76p{width:76%}.width-77p{width:77%}.width-78p{width:78%}.width-79p{width:79%}.width-80p{width:80%}.width-81p{width:81%}.width-82p{width:82%}.width-83p{width:83%}.width-84p{width:84%}.width-85p{width:85%}.width-86p{width:86%}.width-87p{width:87%}.width-88p{width:88%}.width-89p{width:89%}.width-90p{width:90%}.width-91p{width:91%}.width-92p{width:92%}.width-93p{width:93%}.width-94p{width:94%}.width-95p{width:95%}.width-96p{width:96%}.width-97p{width:97%}.width-98p{width:98%}.width-99p{width:99%}.width-100p,.width-full{width:100%}.width-auto{width:auto}.width-third{width:33.33333%}.width-two-thirds{width:66.66667%}:root{--column-gap:.25rem;--row-gap:.25rem;--base:oklch(.55 .04 240);--light-start:.92;--light-end:.13;--chroma-start:.001;--chroma-end:.01;--accent-5:var( --emerald-5 );--accent-10:var( --emerald-10 );--accent-20:var( --emerald-20 );--accent-30:var( --emerald-30 );--accent-40:var( --emerald-40 );--accent-50:var( --emerald-50 );--accent-60:var( --emerald-60 );--accent-70:var( --emerald-70 );--accent-80:var( --emerald-80 );--accent-90:var( --emerald-90 );--accent-95:var( --emerald-95 );--accent:var( --accent-50 );--light-avg:calc((var( --light-start ) + var( --light-end ))/2);--chroma-avg:calc((var( --chroma-start ) + var( --chroma-end ))/2);--chroma-med:calc((var( --chroma-avg ) + var( --chroma-end ))/1.5);--base-5:oklch(from var( --base ) calc(var( --light-start )*0.97 + var( --light-avg )*0.15) calc(var( --chroma-start )*0.99 + var( --chroma-med )*0.1) h/alpha);--base-10:oklch(from var( --base ) calc(var( --light-start )*0.95 + var( --light-avg )*0.05) calc(var( --chroma-start )*0.86 + var( --chroma-med )*0.14) h/alpha);--base-20:oklch(from var( --base ) calc(var( --light-start )*0.86 + var( --light-avg )*0.14) calc(var( --chroma-start )*0.71 + var( --chroma-med )*0.29) h/alpha);--base-30:oklch(from var( --base ) calc(var( --light-start )*0.73 + var( --light-avg )*0.27) calc(var( --chroma-start )*0.51 + var( --chroma-med )*0.49) h/alpha);--base-40:oklch(from var( --base ) calc(var( --light-start )*0.39 + var( --light-avg )*0.61) calc(var( --chroma-start )*0.29 + var( --chroma-med )*0.71) h/alpha);--base-50:oklch(from var( --base ) var( --light-avg ) var( --chroma-med ) h/alpha);--base-60:oklch(from var( --base ) calc(var( --light-end )*0.28 + var( --light-avg )*0.72) calc(var( --chroma-end )*0.29 + var( --chroma-med )*0.71) h/alpha);--base-70:oklch(from var( --base ) calc(var( --light-end )*0.45 + var( --light-avg )*0.55) calc(var( --chroma-end )*0.51 + var( --chroma-med )*0.49) h/alpha);--base-80:oklch(from var( --base ) calc(var( --light-end )*0.68 + var( --light-avg )*0.32) calc(var( --chroma-end )*0.71 + var( --chroma-med )*0.29) h/alpha);--base-90:oklch(from var( --base ) calc(var( --light-end )*0.83 + var( --light-avg )*0.17) calc(var( --chroma-end )*0.86 + var( --chroma-med )*0.14) h/alpha);--base-95:oklch(from var( --base ) calc(var( --light-end )*0.85 + var( --light-avg )*0.13) calc(var( --chroma-end )*0.95 + var( --chroma-med )*0.15) h/alpha);--background:light-dark(#fff,var( --base-90 ));--foreground:light-dark(var( --base-90 ),var( --base-5 ));--heading-foreground:light-dark(var( --base-90 ),var( --base-20 ));--accent-background:light-dark(var( --accent ),oklch(from var( --accent ) calc(var( --light-avg ) - 0.1) c h/alpha));--accent-foreground:light-dark(var( --base-5 ),var( --base-10 ));--border:1px solid light-dark(var( --base-20 ),var( --base-70 ))}body,html{height:100%;width:100%}*,::backdrop,::file-selector-button,:after,:before{border:0 solid;box-sizing:border-box;caret-color:var( --foreground );font-family:inherit;margin:0;padding:0}::-moz-selection{background-color:var( --accent-background );color:var( --accent-foreground )}::selection{background-color:var( --accent-background );color:var( --accent-foreground )}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}:host,html{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;background-color:var( --background );color:var( --foreground );color-scheme:light dark}hr{border-block-start:var( --border );color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{inset-block-end:-.25em}sup{inset-block-start:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0;width:100%;thead{border-block-end:var( --border );th{color:var( --heading-foreground );font-weight:600}}tbody{tr{border-block-end:var( --border );&:last-of-type{border:0}}}tfoot{border-block-start:var( --border )}td,th{padding:var( --size-2 );text-align:start;&:first-of-type{padding-inline-start:0}&:last-of-type{padding-inline-end:0}}}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block}img,video{height:auto;max-width:100%}[hidden]{display:none!important}select[multiple],textarea{resize:vertical}h1,h2,h3,h4,h5,h6{color:var( --heading-foreground );font-weight:500;word-break:break-word;a{color:var( --heading-foreground );text-decoration:none}}h1{text-wrap:balance}grid{display:grid;--grid-tc:repeat(6,1fr);grid-template-columns:var( --grid-tc );--grid-cs:1;--grid-ce:-1;grid-column-gap:var( --column-gap );grid-row-gap:var( --row-gap )}grid>c{-moz-appearance:none;appearance:none;-webkit-appearance:none;display:block}grid[columns="1"]{--grid-tc:repeat(1,1fr)}grid[columns="2"]{--grid-tc:repeat(2,1fr)}grid[columns="3"]{--grid-tc:repeat(3,1fr)}grid[columns="4"]{--grid-tc:repeat(4,1fr)}grid[columns="5"]{--grid-tc:repeat(5,1fr)}grid[columns="6"]{--grid-tc:repeat(6,1fr)}grid[columns="7"]{--grid-tc:repeat(7,1fr)}grid[columns="8"]{--grid-tc:repeat(8,1fr)}grid[columns="9"]{--grid-tc:repeat(9,1fr)}grid[columns="10"]{--grid-tc:repeat(10,1fr)}grid[columns="11"]{--grid-tc:repeat(11,1fr)}grid[columns="12"]{--grid-tc:repeat(12,1fr)}grid>c[span^="1"]{--grid-cs:1}grid>c[span^="2"]{--grid-cs:2}grid>c[span^="3"]{--grid-cs:3}grid>c[span^="4"]{--grid-cs:4}grid>c[span^="5"]{--grid-cs:5}grid>c[span^="6"]{--grid-cs:6}grid>c[span^="7"]{--grid-cs:7}grid>c[span^="8"]{--grid-cs:8}grid>c[span^="9"]{--grid-cs:9}grid>c[span^="10"]{--grid-cs:10}grid>c[span^="11"]{--grid-cs:11}grid>c[span^="12"]{--grid-cs:12}grid>c[span$="+1"],grid>c[span="1"]{--grid-ce:1}grid>c[span$="+2"],grid>c[span$="-1"],grid>c[span="2"]{--grid-ce:2}grid>c[span$="+3"],grid>c[span$="-2"],grid>c[span="3"]{--grid-ce:3}grid>c[span$="+4"],grid>c[span$="-3"],grid>c[span="4"]{--grid-ce:4}grid>c[span$="+5"],grid>c[span$="-4"],grid>c[span="5"]{--grid-ce:5}grid>c[span$="+6"],grid>c[span$="-5"],grid>c[span="6"]{--grid-ce:6}grid>c[span$="+7"],grid>c[span$="-6"],grid>c[span="7"]{--grid-ce:7}grid>c[span$="+8"],grid>c[span$="-7"],grid>c[span="8"]{--grid-ce:8}grid>c[span$="+9"],grid>c[span$="-8"],grid>c[span="9"]{--grid-ce:9}grid>c[span$="+10"],grid>c[span$="-9"],grid>c[span="10"]{--grid-ce:10}grid>c[span$="+11"],grid>c[span$="-10"],grid>c[span="11"]{--grid-ce:11}grid>c[span$="+12"],grid>c[span$="-11"],grid>c[span="12"]{--grid-ce:12}grid>c[span$="-12"]{--grid-ce:13}grid>c[span]{grid-column-end:span var( --grid-ce )}grid>c[span*="+"],grid>c[span*="-"],grid>c[span*=".."]{grid-column-start:var( --grid-cs )}grid>c[span*="-"],grid>c[span*=".."]{grid-column-end:var( --grid-ce )}grid>c[span=row]{grid-column:1/-1}grid.debug>*{--color:hsla(7,92%,66%,.3);background-image:linear-gradient(to bottom,var( --color ) 0,var( --color ) 100%)}grid.debug>:nth-child(6n+2){--color:rgba(103,126,208,.3)}grid.debug>:nth-child(6n+3){--color:rgba(224,174,72,.3)}grid.debug>:nth-child(6n+4){--color:rgba(77,214,115,.3)}grid.debug>:nth-child(6n+5){--color:rgba(217,103,219,.3)}grid.debug>:nth-child(6n+6){--color:rgba(94,204,211,.3)}grid.debug>:nth-child(6n+7){--color:hsla(7,92%,66%,.3)}@media screen and (min-width:30em){.container{padding:0 1.5rem}.line-height-1-ns{line-height:1}.line-height-1_25-ns{line-height:1.25}.line-height-1_5-ns{line-height:1.5}.line-height-1_75-ns{line-height:1.75}.line-height-2-ns{line-height:2}.line-height-2_25-ns{line-height:2.25}.line-height-2_5-ns{line-height:2.5}.line-height-2_75-ns{line-height:2.75}.line-height-3-ns{line-height:3}}@media screen and (min-width:30em) and (max-width:60em){.container{padding:0 2rem}.line-height-1-m{line-height:1}.line-height-1_25-m{line-height:1.25}.line-height-1_5-m{line-height:1.5}.line-height-1_75-m{line-height:1.75}.line-height-2-m{line-height:2}.line-height-2_25-m{line-height:2.25}.line-height-2_5-m{line-height:2.5}.line-height-2_75-m{line-height:2.75}.line-height-3-m{line-height:3}}@media screen and (min-width:60em){.container{padding:0 3rem}.line-height-1-l{line-height:1}.line-height-1_25-l{line-height:1.25}.line-height-1_5-l{line-height:1.5}.line-height-1_75-l{line-height:1.75}.line-height-2-l{line-height:2}.line-height-2_25-l{line-height:2.25}.line-height-2_5-l{line-height:2.5}.line-height-2_75-l{line-height:2.75}.line-height-3-l{line-height:3}}@media (max-width:48.74em){grid[columns-s="1"]{--grid-tc:repeat(1,1fr)}grid[columns-s="2"]{--grid-tc:repeat(2,1fr)}grid[columns-s="3"]{--grid-tc:repeat(3,1fr)}grid[columns-s="4"]{--grid-tc:repeat(4,1fr)}grid[columns-s="5"]{--grid-tc:repeat(5,1fr)}grid[columns-s="6"]{--grid-tc:repeat(6,1fr)}grid[columns-s="7"]{--grid-tc:repeat(7,1fr)}grid[columns-s="8"]{--grid-tc:repeat(8,1fr)}grid[columns-s="9"]{--grid-tc:repeat(9,1fr)}grid[columns-s="10"]{--grid-tc:repeat(10,1fr)}grid[columns-s="11"]{--grid-tc:repeat(11,1fr)}grid[columns-s="12"]{--grid-tc:repeat(12,1fr)}grid>c[span-s^="1"]{--grid-cs:1}grid>c[span-s^="2"]{--grid-cs:2}grid>c[span-s^="3"]{--grid-cs:3}grid>c[span-s^="4"]{--grid-cs:4}grid>c[span-s^="5"]{--grid-cs:5}grid>c[span-s^="6"]{--grid-cs:6}grid>c[span-s^="7"]{--grid-cs:7}grid>c[span-s^="8"]{--grid-cs:8}grid>c[span-s^="9"]{--grid-cs:9}grid>c[span-s^="10"]{--grid-cs:10}grid>c[span-s^="11"]{--grid-cs:11}grid>c[span-s^="12"]{--grid-cs:12}grid>c[span-s$="+1"],grid>c[span-s="1"]{--grid-ce:1}grid>c[span-s$="+2"],grid>c[span-s$="-1"],grid>c[span-s="2"]{--grid-ce:2}grid>c[span-s$="+3"],grid>c[span-s$="-2"],grid>c[span-s="3"]{--grid-ce:3}grid>c[span-s$="+4"],grid>c[span-s$="-3"],grid>c[span-s="4"]{--grid-ce:4}grid>c[span-s$="+5"],grid>c[span-s$="-4"],grid>c[span-s="5"]{--grid-ce:5}grid>c[span-s$="+6"],grid>c[span-s$="-5"],grid>c[span-s="6"]{--grid-ce:6}grid>c[span-s$="+7"],grid>c[span-s$="-6"],grid>c[span-s="7"]{--grid-ce:7}grid>c[span-s$="+8"],grid>c[span-s$="-7"],grid>c[span-s="8"]{--grid-ce:8}grid>c[span-s$="+9"],grid>c[span-s$="-8"],grid>c[span-s="9"]{--grid-ce:9}grid>c[span-s$="+10"],grid>c[span-s$="-9"],grid>c[span-s="10"]{--grid-ce:10}grid>c[span-s$="+11"],grid>c[span-s$="-10"],grid>c[span-s="11"]{--grid-ce:11}grid>c[span-s$="+12"],grid>c[span-s$="-11"],grid>c[span-s="12"]{--grid-ce:12}grid>c[span-s$="-12"]{--grid-ce:13}grid>c[span-s]{grid-column-end:span var( --grid-ce )}grid>c[span-s*="+"],grid>c[span-s*="-"],grid>c[span-s*=".."]{grid-column-start:var( --grid-cs )}grid>c[span-s*="-"],grid>c[span-s*=".."]{grid-column-end:var( --grid-ce )}grid>c[span-s=row]{grid-column:1/-1}}@media (min-width:100em){grid[columns-l="1"]{--grid-tc:repeat(1,1fr)}grid[columns-l="2"]{--grid-tc:repeat(2,1fr)}grid[columns-l="3"]{--grid-tc:repeat(3,1fr)}grid[columns-l="4"]{--grid-tc:repeat(4,1fr)}grid[columns-l="5"]{--grid-tc:repeat(5,1fr)}grid[columns-l="6"]{--grid-tc:repeat(6,1fr)}grid[columns-l="7"]{--grid-tc:repeat(7,1fr)}grid[columns-l="8"]{--grid-tc:repeat(8,1fr)}grid[columns-l="9"]{--grid-tc:repeat(9,1fr)}grid[columns-l="10"]{--grid-tc:repeat(10,1fr)}grid[columns-l="11"]{--grid-tc:repeat(11,1fr)}grid[columns-l="12"]{--grid-tc:repeat(12,1fr)}grid>c[span-l^="1"]{--grid-cs:1}grid>c[span-l^="2"]{--grid-cs:2}grid>c[span-l^="3"]{--grid-cs:3}grid>c[span-l^="4"]{--grid-cs:4}grid>c[span-l^="5"]{--grid-cs:5}grid>c[span-l^="6"]{--grid-cs:6}grid>c[span-l^="7"]{--grid-cs:7}grid>c[span-l^="8"]{--grid-cs:8}grid>c[span-l^="9"]{--grid-cs:9}grid>c[span-l^="10"]{--grid-cs:10}grid>c[span-l^="11"]{--grid-cs:11}grid>c[span-l^="12"]{--grid-cs:12}grid>c[span-l$="+1"],grid>c[span-l="1"]{--grid-ce:1}grid>c[span-l$="+2"],grid>c[span-l$="-1"],grid>c[span-l="2"]{--grid-ce:2}grid>c[span-l$="+3"],grid>c[span-l$="-2"],grid>c[span-l="3"]{--grid-ce:3}grid>c[span-l$="+4"],grid>c[span-l$="-3"],grid>c[span-l="4"]{--grid-ce:4}grid>c[span-l$="+5"],grid>c[span-l$="-4"],grid>c[span-l="5"]{--grid-ce:5}grid>c[span-l$="+6"],grid>c[span-l$="-5"],grid>c[span-l="6"]{--grid-ce:6}grid>c[span-l$="+7"],grid>c[span-l$="-6"],grid>c[span-l="7"]{--grid-ce:7}grid>c[span-l$="+8"],grid>c[span-l$="-7"],grid>c[span-l="8"]{--grid-ce:8}grid>c[span-l$="+9"],grid>c[span-l$="-8"],grid>c[span-l="9"]{--grid-ce:9}grid>c[span-l$="+10"],grid>c[span-l$="-9"],grid>c[span-l="10"]{--grid-ce:10}grid>c[span-l$="+11"],grid>c[span-l$="-10"],grid>c[span-l="11"]{--grid-ce:11}grid>c[span-l$="+12"],grid>c[span-l$="-11"],grid>c[span-l="12"]{--grid-ce:12}grid>c[span-l$="-12"]{--grid-ce:13}grid>c[span-l]{grid-column-end:span var( --grid-ce )}grid>c[span-l*="+"],grid>c[span-l*="-"],grid>c[span-l*=".."]{grid-column-start:var( --grid-cs )}grid>c[span-l*="-"],grid>c[span-l*=".."]{grid-column-end:var( --grid-ce )}grid>c[span-l=row]{grid-column:1/-1}}
diff --git a/public/index.html b/public/index.html
index bf784d4..719c231 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,15 +1,23 @@
-
+
-
-
-
-
- Application
- {{ css }}
-
-
-
- {{ livereload }}
- {{ js }}
-
+
+
+
+
+
+
+ Application
+ {{ css }}
+
+
+
+ {{ livereload }} {{ js }}
+
diff --git a/public/index.js b/public/index.js
index bbf3033..c6c882c 100755
--- a/public/index.js
+++ b/public/index.js
@@ -1,1302 +1,5 @@
-// src/util.ts
-function stringToElement(template) {
- const parser = new DOMParser();
- const doc = parser.parseFromString(template, "text/html");
- return doc.body.firstChild;
-}
-var isText = (node) => {
- return node.nodeType === Node.TEXT_NODE;
-};
-var isTemplate = (node) => {
- return node.nodeName === "TEMPLATE";
-};
-var isElement = (node) => {
- return node.nodeType === Node.ELEMENT_NODE;
-};
-function isObject(value) {
- return value !== null && typeof value === "object";
-}
-function isArray(value) {
- return Array.isArray(value);
-}
-function checkAndRemoveAttribute(el, attrName) {
- const attributeValue = el.getAttribute(attrName);
- if (attributeValue !== null) {
- el.removeAttribute(attrName);
- }
- return attributeValue;
-}
-function findSlotNodes(element) {
- const slots = [];
- const findSlots = (node) => {
- Array.from(node.childNodes).forEach((node2) => {
- if (isElement(node2)) {
- if (node2.nodeName === "SLOT") {
- slots.push({ node: node2, name: node2.getAttribute("name") || "default" });
- }
- if (node2.hasChildNodes()) {
- findSlots(node2);
- }
- }
- });
- };
- findSlots(element);
- return slots;
-}
-function findTemplateNodes(element) {
- const templates = [];
- const findTemplates = (element2) => {
- let defaultContentNodes = [];
- Array.from(element2.childNodes).forEach((node) => {
- if (isElement(node) || isText(node)) {
- if (isElement(node) && node.nodeName === "TEMPLATE" && isTemplate(node)) {
- templates.push({ targetSlotName: node.getAttribute("slot") || "", node });
- } else {
- defaultContentNodes.push(node);
- }
- }
- });
- if (defaultContentNodes.length > 0) {
- const defaultTemplate = document.createElement("template");
- defaultTemplate.setAttribute("slot", "default");
- defaultContentNodes.forEach((node) => {
- defaultTemplate.content.appendChild(node);
- });
- templates.push({ targetSlotName: "default", node: defaultTemplate });
- }
- };
- findTemplates(element);
- return templates;
-}
-var nextTick = async (f) => {
- await new Promise(
- (r) => setTimeout(
- (_) => requestAnimationFrame((_2) => {
- f && f();
- r();
- })
- )
- );
-};
-function html(strings, ...values) {
- const selfClosingTags = ["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"];
- let result = strings.reduce((acc, str, i) => acc + str + (values[i] || ""), "");
- result = result.replace(/<([a-zA-Z][^\s/>]*)\s*([^>]*?)\/>/g, (match, tagName, attributes) => {
- if (selfClosingTags.includes(tagName.toLowerCase())) {
- return match;
- }
- return `<${tagName} ${attributes}>${tagName}>`;
- });
- return result;
-}
-function toDisplayString(value) {
- return value == null ? "" : isObject(value) ? JSON.stringify(value, null, 2) : String(value);
-}
-function insertAfter(newNode, existingNode) {
- if (existingNode.nextSibling) {
- existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);
- } else {
- existingNode?.parentNode?.appendChild(newNode);
- }
-}
-function isPropAttribute(attrName) {
- if (attrName.startsWith(".")) {
- return true;
- }
- if (attrName.startsWith("{") && attrName.endsWith("}")) {
- return true;
- }
- return false;
-}
-function isSpreadProp(attr) {
- return attr.startsWith("...");
-}
-function isMirrorProp(attr) {
- return attr.startsWith("{") && attr.endsWith("}");
-}
-function isRegularProp(attr) {
- return attr.startsWith(".");
-}
-function isEventAttribute(attrName) {
- return attrName.startsWith("@");
-}
-function componentHasPropByName(name, component) {
- return Object.keys(component?.props ?? {}).some((prop) => prop === name);
-}
-function extractAttributeName(attrName) {
- return attrName.replace(/^\.\.\./, "").replace(/^\./, "").replace(/^{/, "").replace(/}$/, "").replace(/:bind$/, "");
-}
-function dashToCamel(str) {
- return str.toLowerCase().replace(/-([a-z])/g, (g) => g[1].toUpperCase());
-}
-function extractPropName(attrName) {
- return dashToCamel(extractAttributeName(attrName));
-}
-function classNames(_) {
- const classes = [];
- for (let i = 0; i < arguments.length; i++) {
- const arg = arguments[i];
- if (!arg) continue;
- const argType = typeof arg;
- if (argType === "string" || argType === "number") {
- classes.push(arg);
- } else if (Array.isArray(arg)) {
- if (arg.length) {
- const inner = classNames.apply(null, arg);
- if (inner) {
- classes.push(inner);
- }
- }
- } else if (argType === "object") {
- if (arg.toString === Object.prototype.toString) {
- for (let key in arg) {
- if (Object.hasOwnProperty.call(arg, key) && arg[key]) {
- classes.push(key);
- }
- }
- } else {
- classes.push(arg.toString());
- }
- }
- }
- return classes.join(" ");
-}
-
-// src/directives/attribute.ts
-var AttributeDirective = class {
- element;
- context;
- expression;
- attr;
- extractedAttributeName;
- previousClasses = [];
- previousStyles = {};
- is = {
- sameNameProperty: false,
- bound: false,
- spread: false,
- componentProp: false
- };
- constructor({ element, context, attr }) {
- this.element = element;
- this.context = context;
- this.expression = attr.value;
- this.attr = attr;
- this.extractedAttributeName = extractAttributeName(attr.name);
- this.is = {
- sameNameProperty: attr.name.startsWith("{") && attr.name.endsWith("}"),
- bound: attr.name.includes(":bind"),
- spread: attr.name.startsWith("..."),
- componentProp: false
- };
- if (this.is.sameNameProperty) {
- this.expression = this.extractedAttributeName;
- }
- if (this.is.spread) {
- this.expression = this.extractedAttributeName;
- }
- element.removeAttribute(attr.name);
- if (this.is.bound) {
- context.effect(this.update.bind(this));
- } else {
- this.update();
- }
- }
- update() {
- let value = evalGet(this.context.scope, this.expression);
- if (this.is.spread && typeof value === "object") {
- for (const [key, val] of Object.entries(value)) {
- this.element.setAttribute(key, String(val));
- }
- } else if ((typeof value === "object" || Array.isArray(value)) && this.extractedAttributeName === "class") {
- value = classNames(value);
- const next = value.split(" ");
- const diff = next.filter((c) => !this.previousClasses.includes(c)).filter(Boolean);
- const rm = this.previousClasses.filter((c) => !next.includes(c));
- diff.forEach((c) => {
- this.previousClasses.push(c);
- this.element.classList.add(c);
- });
- rm.forEach((c) => {
- this.previousClasses = this.previousClasses.filter((addedClass) => addedClass !== c);
- this.element.classList.remove(c);
- });
- } else if (typeof value === "object" && this.extractedAttributeName === "style") {
- const next = Object.keys(value);
- const rm = Object.keys(this.previousStyles).filter((style) => !next.includes(style));
- next.forEach((style) => {
- this.previousStyles[style] = value[style];
- this.element.style[style] = value[style];
- });
- rm.forEach((style) => {
- this.previousStyles[style] = "";
- this.element.style[style] = "";
- });
- this.previousStyles = value;
- } else {
- this.element.setAttribute(this.extractedAttributeName, value);
- }
- }
-};
-
-// src/directives/event.ts
-var EventDirective = class {
- element;
- context;
- expression;
- attr;
- eventCount = 0;
- constructor({ element, context, attr }) {
- this.element = element;
- this.context = context;
- this.expression = attr.value;
- this.attr = attr;
- const eventName = attr.name.replace(/^@/, "");
- const parts = eventName.split(".");
- this.element.addEventListener(parts[0], (event) => {
- if (parts.includes("prevent")) event.preventDefault();
- if (parts.includes("stop")) event.stopPropagation();
- if (parts.includes("once") && this.eventCount > 0) return;
- this.eventCount++;
- const handler = evalGet(context.scope, attr.value);
- if (typeof handler === "function") {
- handler(event);
- }
- });
- element.removeAttribute(attr.name);
- }
-};
-
-// src/directives/for.ts
-var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
-var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
-var stripParensRE = /^\(|\)$/g;
-var destructureRE = /^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/;
-var _for = (el, exp, ctx, component, componentProps, allProps) => {
- const inMatch = exp.match(forAliasRE);
- if (!inMatch) {
- console.warn(`invalid :for expression: ${exp}`);
- return;
- }
- const nextNode = el.nextSibling;
- const parent2 = el.parentElement;
- const anchor = new Text("");
- parent2.insertBefore(anchor, el);
- parent2.removeChild(el);
- const sourceExp = inMatch[2].trim();
- let valueExp = inMatch[1].trim().replace(stripParensRE, "").trim();
- let destructureBindings;
- let isArrayDestructure = false;
- let indexExp;
- let objIndexExp;
- let keyAttr = "key";
- let keyExp = el.getAttribute(keyAttr) || el.getAttribute(keyAttr = ":key") || el.getAttribute(keyAttr = ":key:bind");
- if (keyExp) {
- el.removeAttribute(keyAttr);
- if (keyAttr === "key") keyExp = JSON.stringify(keyExp);
- }
- let match;
- if (match = valueExp.match(forIteratorRE)) {
- valueExp = valueExp.replace(forIteratorRE, "").trim();
- indexExp = match[1].trim();
- if (match[2]) {
- objIndexExp = match[2].trim();
- }
- }
- if (match = valueExp.match(destructureRE)) {
- destructureBindings = match[1].split(",").map((s) => s.trim());
- isArrayDestructure = valueExp[0] === "[";
- }
- let mounted = false;
- let blocks;
- let childCtxs;
- let keyToIndexMap;
- const createChildContexts = (source) => {
- const map = /* @__PURE__ */ new Map();
- const ctxs = [];
- if (isArray(source)) {
- for (let i = 0; i < source.length; i++) {
- ctxs.push(createChildContext(map, source[i], i));
- }
- } else if (typeof source === "number") {
- for (let i = 0; i < source; i++) {
- ctxs.push(createChildContext(map, i + 1, i));
- }
- } else if (isObject(source)) {
- let i = 0;
- for (const key in source) {
- ctxs.push(createChildContext(map, source[key], i++, key));
- }
- }
- return [ctxs, map];
- };
- const createChildContext = (map, value, index, objKey) => {
- const data = {};
- if (destructureBindings) {
- destructureBindings.forEach((b, i) => data[b] = value[isArrayDestructure ? i : b]);
- } else {
- data[valueExp] = value;
- }
- if (objKey) {
- indexExp && (data[indexExp] = objKey);
- objIndexExp && (data[objIndexExp] = index);
- } else {
- indexExp && (data[indexExp] = index);
- }
- const childCtx = createScopedContext(ctx, data);
- const key = keyExp ? evalGet(childCtx.scope, keyExp) : index;
- map.set(key, index);
- childCtx.key = key;
- return childCtx;
- };
- const mountBlock = (ctx2, ref2) => {
- const block = new Block({ element: el, parentContext: ctx2, replacementType: "replace", component, componentProps, allProps });
- block.key = ctx2.key;
- block.insert(parent2, ref2);
- return block;
- };
- ctx.effect(() => {
- const source = evalGet(ctx.scope, sourceExp);
- const prevKeyToIndexMap = keyToIndexMap;
- [childCtxs, keyToIndexMap] = createChildContexts(source);
- if (!mounted) {
- blocks = childCtxs.map((s) => mountBlock(s, anchor));
- mounted = true;
- } else {
- for (let i2 = 0; i2 < blocks.length; i2++) {
- if (!keyToIndexMap.has(blocks[i2].key)) {
- blocks[i2].remove();
- }
- }
- const nextBlocks = [];
- let i = childCtxs.length;
- let nextBlock;
- let prevMovedBlock;
- while (i--) {
- const childCtx = childCtxs[i];
- const oldIndex = prevKeyToIndexMap.get(childCtx.key);
- let block;
- if (oldIndex == null) {
- block = mountBlock(childCtx, nextBlock ? nextBlock.element : anchor);
- } else {
- block = blocks[oldIndex];
- Object.assign(block.context.scope, childCtx.scope);
- if (oldIndex !== i) {
- if (blocks[oldIndex + 1] !== nextBlock || // If the next has moved, it must move too
- prevMovedBlock === nextBlock) {
- prevMovedBlock = block;
- block.insert(parent2, nextBlock ? nextBlock.element : anchor);
- }
- }
- }
- nextBlocks.unshift(nextBlock = block);
- }
- blocks = nextBlocks;
- }
- });
- return nextNode;
-};
-
-// src/directives/if.ts
-function _if(el, exp, ctx, component, componentProps, allProps) {
- const parent2 = el.parentElement;
- const anchor = new Comment(":if");
- parent2.insertBefore(anchor, el);
- const branches = [{ exp, el }];
- let elseEl;
- let elseExp;
- while (elseEl = el.nextElementSibling) {
- elseExp = null;
- if (checkAndRemoveAttribute(elseEl, ":else") === "" || (elseExp = checkAndRemoveAttribute(elseEl, ":else-if"))) {
- parent2.removeChild(elseEl);
- branches.push({ exp: elseExp, el: elseEl });
- } else {
- break;
- }
- }
- const nextNode = el.nextSibling;
- parent2.removeChild(el);
- let block;
- let activeBranchIndex = -1;
- const removeActiveBlock = () => {
- if (block) {
- parent2.insertBefore(anchor, block.element);
- block.remove();
- block = void 0;
- }
- };
- ctx.effect(() => {
- for (let i = 0; i < branches.length; i++) {
- const { exp: exp2, el: el2 } = branches[i];
- if (!exp2 || evalGet(ctx.scope, exp2)) {
- if (i !== activeBranchIndex) {
- removeActiveBlock();
- block = new Block({ element: el2, parentContext: ctx, replacementType: "replace", component, componentProps, allProps });
- block.insert(parent2, anchor);
- parent2.removeChild(anchor);
- activeBranchIndex = i;
- }
- return;
- }
- }
- activeBranchIndex = -1;
- removeActiveBlock();
- });
- return nextNode;
-}
-
-// src/directives/interpolation.ts
-var delims = /{{\s?(.*?)\s?}}/g;
-var InterpolationDirective = class {
- element;
- context;
- textNodes = /* @__PURE__ */ new Map();
- constructor({ element, context }) {
- this.element = element;
- this.context = context;
- this.findNodes();
- this.textNodes.forEach((nodes, expression) => {
- const trimmedExpression = expression.slice(2, -2).trim();
- nodes.forEach((node) => {
- const getter = (exp = trimmedExpression) => evalGet(this.context.scope, exp, node);
- context.effect(() => {
- node.textContent = toDisplayString(getter());
- });
- });
- });
- }
- findNodes() {
- const textContent = this.element.textContent.trim();
- if (textContent?.match(delims)) {
- const textNodes = textContent.split(/(\{\{\s?[^}]+\s?\}\})/g).filter(Boolean);
- if (textNodes) {
- let previousNode = this.element;
- for (let i = 0; i < textNodes.length; i++) {
- const textNode = textNodes[i];
- if (textNode.match(/\{\{\s?.+\s?\}\}/)) {
- const newNode = document.createTextNode(textNode);
- if (i === 0) {
- this.element.replaceWith(newNode);
- } else {
- insertAfter(newNode, previousNode);
- }
- previousNode = newNode;
- if (this.textNodes.has(textNode)) {
- this.textNodes.get(textNode).push(newNode);
- } else {
- this.textNodes.set(textNode, [newNode]);
- }
- } else {
- const newNode = document.createTextNode(textNodes[i]);
- if (i === 0) {
- this.element.replaceWith(newNode);
- } else {
- insertAfter(newNode, previousNode);
- }
- previousNode = newNode;
- }
- }
- }
- }
- }
- update() {
- }
-};
-
-// src/directives/show.ts
-var ShowDirective = class {
- element;
- context;
- expression;
- originalDisplay;
- constructor({ element, context, expression }) {
- this.element = element;
- this.context = context;
- this.expression = expression;
- this.originalDisplay = getComputedStyle(this.element).display;
- context.effect(this.update.bind(this));
- }
- update() {
- const shouldShow = Boolean(evalGet(this.context.scope, this.expression));
- this.element.style.display = shouldShow ? this.originalDisplay : "none";
- }
-};
-
-// src/directives/teleport.ts
-function _teleport(el, exp, ctx) {
- const anchor = new Comment(":teleport");
- el.replaceWith(anchor);
- const target = document.querySelector(exp);
- if (!target) {
- console.warn(`teleport target not found: ${exp}`);
- return;
- }
- nextTick(() => {
- target.appendChild(el);
- const observer = new MutationObserver((mutationsList) => {
- mutationsList.forEach((mutation) => {
- mutation.removedNodes.forEach((removedNode) => {
- if (removedNode.contains(anchor)) {
- el.remove();
- observer.disconnect();
- }
- });
- });
- });
- observer.observe(document.body, { childList: true, subtree: true });
- new Block({
- element: el,
- parentContext: ctx
- });
- });
- return anchor;
-}
-
-// src/directives/value.ts
-function isInput(element) {
- return element instanceof HTMLInputElement;
-}
-function isTextarea(element) {
- return element instanceof HTMLTextAreaElement;
-}
-function isSelect(element) {
- return element instanceof HTMLSelectElement;
-}
-var ValueDirective = class {
- element;
- context;
- expression;
- inputType;
- constructor({ element, context, expression }) {
- this.element = element;
- this.context = context;
- this.expression = expression;
- this.inputType = element.getAttribute("type");
- if (isInput(element)) {
- switch (this.inputType) {
- case "text":
- case "password":
- case "number":
- case "color":
- element.addEventListener("input", () => {
- const value = this.inputType === "number" ? element.value ? parseFloat(element.value) : 0 : element.value;
- evalSet(this.context.scope, expression, value);
- });
- break;
- case "checkbox":
- element.addEventListener("change", (e) => {
- evalSet(this.context.scope, expression, !!e.currentTarget.checked);
- });
- break;
- case "radio":
- element.addEventListener("change", (e) => {
- if (e.currentTarget.checked) {
- evalSet(this.context.scope, expression, element.getAttribute("value"));
- }
- });
- break;
- default:
- break;
- }
- }
- if (isTextarea(element)) {
- element.addEventListener("input", () => {
- evalSet(this.context.scope, expression, element.value);
- });
- }
- if (isSelect(element)) {
- element.addEventListener("change", () => {
- evalSet(this.context.scope, expression, element.value);
- });
- }
- context.effect(this.updateElementValue.bind(this));
- }
- updateElementValue() {
- const value = evalGet(this.context.scope, this.expression, this.element);
- if (isInput(this.element)) {
- switch (this.inputType) {
- case "text":
- case "password":
- case "number":
- case "color":
- this.element.value = value;
- break;
- case "checkbox":
- this.element.checked = !!value;
- break;
- case "radio":
- this.element.checked = this.element.value === value;
- break;
- default:
- break;
- }
- }
- if (isTextarea(this.element)) {
- this.element.value = value;
- }
- if (isSelect(this.element)) {
- this.element.value = value;
- }
- }
-};
-
-// src/reactivity/effect.ts
-var targetMap = /* @__PURE__ */ new WeakMap();
-var effectStack = [];
-function track(target, key) {
- const activeEffect = effectStack[effectStack.length - 1];
- if (!activeEffect) return;
- let effectsMap = targetMap.get(target);
- if (!effectsMap)
- targetMap.set(target, effectsMap = /* @__PURE__ */ new Map());
- let effects = effectsMap.get(key);
- if (!effects) effectsMap.set(key, effects = /* @__PURE__ */ new Set());
- if (!effects.has(activeEffect)) {
- effects.add(activeEffect);
- activeEffect.refs.push(effects);
- }
-}
-function trigger(target, key) {
- const effectsMap = targetMap.get(target);
- if (!effectsMap) return;
- const scheduled = /* @__PURE__ */ new Set();
- effectsMap.get(key)?.forEach((effect2) => {
- scheduled.add(effect2);
- });
- scheduled.forEach(run);
-}
-function stop2(effect2) {
- if (effect2.active) cleanup(effect2);
- effect2.active = false;
-}
-function start(effect2) {
- if (!effect2.active) {
- effect2.active = true;
- run(effect2);
- }
-}
-function run(effect2) {
- if (!effect2.active) return;
- if (effectStack.includes(effect2)) return;
- cleanup(effect2);
- let val;
- try {
- effectStack.push(effect2);
- val = effect2.handler();
- } finally {
- effectStack.pop();
- }
- return val;
-}
-function cleanup(effect2) {
- const { refs } = effect2;
- if (refs.length) {
- for (const ref2 of refs) {
- ref2.delete(effect2);
- }
- }
- refs.length = 0;
-}
-function effect(handler, opts = {}) {
- const { lazy } = opts;
- const newEffect = {
- active: !lazy,
- handler,
- refs: []
- };
- run(newEffect);
- return {
- start: () => {
- start(newEffect);
- },
- stop: () => {
- stop2(newEffect);
- },
- toggle: () => {
- if (newEffect.active) {
- stop2(newEffect);
- } else {
- start(newEffect);
- }
- return newEffect.active;
- }
- };
-}
-
-// src/reactivity/computed.ts
-var $computed = Symbol("computed");
-function isComputed(value) {
- return isObject(value) && value[$computed];
-}
-
-// src/reactivity/ref.ts
-var $ref = Symbol("ref");
-function isRef(value) {
- return isObject(value) && !!value[$ref];
-}
-function ref(value = null) {
- if (isObject(value)) {
- return isRef(value) ? value : reactive(value);
- }
- const result = { value, [$ref]: true };
- return new Proxy(result, {
- get(target, key, receiver) {
- const val = Reflect.get(target, key, receiver);
- track(result, "value");
- return val;
- },
- set(target, key, value2) {
- const oldValue = target[key];
- if (oldValue !== value2) {
- const success = Reflect.set(target, key, value2);
- if (success) {
- trigger(result, "value");
- }
- }
- return true;
- }
- });
-}
-
-// src/reactivity/reactive.ts
-var $reactive = Symbol("reactive");
-function reactive(value) {
- if (!isObject(value)) return ref(value);
- if (value[$reactive]) return value;
- value[$reactive] = true;
- Object.keys(value).forEach((key) => {
- if (isObject(value[key])) {
- value[key] = reactive(value[key]);
- }
- });
- return new Proxy(value, reactiveProxyHandler());
-}
-function reactiveProxyHandler() {
- return {
- deleteProperty(target, key) {
- const had = Reflect.has(target, key);
- const result = Reflect.deleteProperty(target, key);
- if (had) trigger(target, key);
- return result;
- },
- get(target, key) {
- track(target, key);
- return Reflect.get(target, key);
- },
- set(target, key, value) {
- if (target[key] === value) return true;
- let newObj = false;
- if (isObject(value) && !isObject(target[key])) {
- newObj = true;
- }
- if (Reflect.set(target, key, value)) {
- trigger(target, key);
- }
- if (newObj) {
- target[key] = reactive(target[key]);
- }
- return true;
- }
- };
-}
-
-// src/index.ts
-function provide(key, value) {
- if (!current.componentBlock) {
- console.warn("Can't provide: no current component block");
- }
- current.componentBlock.provides.set(key, value);
-}
-function inject(key) {
- if (!current.componentBlock) {
- console.warn("Can't inject: no current component block");
- }
- let c = current.componentBlock;
- while (c) {
- if (c.provides.has(key)) {
- return c.provides.get(key);
- }
- c = c.parentComponentBlock;
- }
- return void 0;
-}
-var App = class {
- rootBlock;
- registry = /* @__PURE__ */ new Map();
- plugins = /* @__PURE__ */ new Set();
- register(name, component) {
- this.registry.set(name, component);
- }
- use(plugin, ...config) {
- this.plugins.add(plugin);
- plugin.use(this, ...config);
- }
- getComponent(tag) {
- return this.registry.get(tag);
- }
- mount(component, target = "body", props = {}) {
- const root = typeof target === "string" ? document.querySelector(target) : target;
- const display = root.style.display;
- root.style.display = "none";
- this.rootBlock = this._mount(component, root, props, true);
- root.style.display = display;
- return this.rootBlock;
- }
- _mount(component, target, props, isRoot = false) {
- const parentContext = createContext({ app: this });
- if (props) {
- parentContext.scope = reactive(props);
- bindContextMethods(parentContext.scope);
- }
- parentContext.scope.$isRef = isRef;
- parentContext.scope.$isComputed = isComputed;
- const block = new Block({
- element: target,
- parentContext,
- component,
- isRoot,
- componentProps: props,
- replacementType: "replaceChildren"
- });
- return block;
- }
- unmount() {
- this.rootBlock.teardown();
- }
-};
-function createContext({ parentContext, app: app2 }) {
- const context = {
- app: app2 ? app2 : parentContext && parentContext.app ? parentContext.app : null,
- scope: parentContext ? parentContext.scope : reactive({}),
- blocks: [],
- effects: [],
- slots: [],
- templates: parentContext ? parentContext.templates : [],
- effect: (handler) => {
- const e = effect(handler);
- context.effects.push(e);
- return e;
- }
- };
- return context;
-}
-var createScopedContext = (ctx, data = {}) => {
- const parentScope = ctx.scope;
- const mergedScope = Object.create(parentScope);
- Object.defineProperties(mergedScope, Object.getOwnPropertyDescriptors(data));
- let proxy;
- proxy = reactive(
- new Proxy(mergedScope, {
- set(target, key, val, receiver) {
- if (receiver === proxy && !target.hasOwnProperty(key)) {
- return Reflect.set(parentScope, key, val);
- }
- return Reflect.set(target, key, val, receiver);
- }
- })
- );
- bindContextMethods(proxy);
- const out = {
- ...ctx,
- scope: {
- ...ctx.scope,
- ...proxy
- }
- };
- return out;
-};
-function bindContextMethods(scope) {
- for (const key of Object.keys(scope)) {
- if (typeof scope[key] === "function") {
- scope[key] = scope[key].bind(scope);
- }
- }
-}
-function mergeProps(props, defaultProps) {
- const merged = {};
- Object.keys(defaultProps).forEach((defaultProp) => {
- const propValue = props.hasOwnProperty(defaultProp) ? props[defaultProp] : defaultProps[defaultProp]?.default;
- merged[defaultProp] = reactive(typeof propValue === "function" ? propValue() : propValue);
- });
- return merged;
-}
-var current = { componentBlock: void 0 };
-var Block = class {
- element;
- context;
- parentContext;
- component;
- provides = /* @__PURE__ */ new Map();
- parentComponentBlock;
- componentProps;
- allProps;
- isFragment;
- start;
- end;
- key;
- constructor(opts) {
- this.isFragment = opts.element instanceof HTMLTemplateElement;
- this.parentComponentBlock = opts.parentComponentBlock;
- if (opts.component) {
- current.componentBlock = this;
- this.element = stringToElement(opts.component.template);
- } else {
- if (this.isFragment) {
- this.element = opts.element.content.cloneNode(true);
- } else if (typeof opts.element === "string") {
- this.element = stringToElement(opts.element);
- } else {
- this.element = opts.element.cloneNode(true);
- opts.element.replaceWith(this.element);
- }
- }
- if (opts.isRoot) {
- this.context = opts.parentContext;
- } else {
- this.parentContext = opts.parentContext ? opts.parentContext : createContext({});
- this.parentContext.blocks.push(this);
- this.context = createContext({ parentContext: opts.parentContext });
- }
- if (opts.component) {
- this.componentProps = mergeProps(opts.componentProps ?? {}, opts.component.props ?? {});
- if (opts.component.main) {
- this.context.scope = {
- ...opts.component.main(this.componentProps) || {}
- };
- }
- }
- opts.allProps?.forEach((prop) => {
- if (prop.isBind) {
- this.context.effect(() => {
- let newValue;
- if (prop.isSpread) {
- const spreadProps = evalGet(this.parentContext.scope, prop.extractedName);
- if (isObject(spreadProps)) {
- Object.keys(spreadProps).forEach((key) => {
- newValue = spreadProps[key];
- this.setProp(key, newValue);
- });
- }
- } else {
- newValue = prop.isMirror ? evalGet(this.parentContext.scope, prop.extractedName) : evalGet(this.parentContext.scope, prop.exp);
- this.setProp(prop.extractedName, newValue);
- }
- });
- }
- });
- this.context.slots = findSlotNodes(this.element);
- this.context.templates = opts.templates ?? [];
- this.context.slots.forEach((slot) => {
- const template = this.context.templates.find((t) => t.targetSlotName === slot.name);
- if (template) {
- const templateContents = template.node.content.cloneNode(true);
- slot.node.replaceWith(templateContents);
- }
- });
- this.context.scope.$isRef = isRef;
- this.context.scope.$isComputed = isComputed;
- walk(this.element, this.context);
- if (opts.component) {
- if (opts.replacementType === "replace") {
- if (opts.element instanceof HTMLElement) {
- opts.element.replaceWith(this.element);
- }
- } else {
- if (opts.element instanceof HTMLElement) {
- opts.element.replaceChildren(this.element);
- }
- }
- }
- }
- setProp(name, value) {
- if (isRef(this.componentProps[name])) {
- this.componentProps[name].value = value;
- } else {
- this.componentProps[name] = value;
- }
- }
- insert(parent2, anchor = null) {
- if (this.isFragment) {
- if (this.start) {
- let node = this.start;
- let next;
- while (node) {
- next = node.nextSibling;
- parent2.insertBefore(node, anchor);
- if (node === this.end) {
- break;
- }
- node = next;
- }
- } else {
- this.start = new Text("");
- this.end = new Text("");
- parent2.insertBefore(this.end, anchor);
- parent2.insertBefore(this.start, this.end);
- parent2.insertBefore(this.element, this.end);
- }
- } else {
- parent2.insertBefore(this.element, anchor);
- }
- }
- remove() {
- if (this.parentContext) {
- const i = this.parentContext.blocks.indexOf(this);
- if (i > -1) {
- this.parentContext.blocks.splice(i, 1);
- }
- }
- if (this.start) {
- const parent2 = this.start.parentNode;
- let node = this.start;
- let next;
- while (node) {
- next = node.nextSibling;
- parent2.removeChild(node);
- if (node === this.end) {
- break;
- }
- node = next;
- }
- } else {
- this.element.remove();
- }
- this.teardown();
- }
- teardown() {
- this.context.blocks.forEach((block) => {
- block.teardown();
- });
- this.context.effects.forEach(stop);
- }
-};
-function isComponent(element, context) {
- return !!context.app.getComponent(element.tagName.toLowerCase());
-}
-function walk(node, context) {
- if (isText(node)) {
- new InterpolationDirective({ element: node, context });
- return;
- }
- if (isElement(node)) {
- let exp;
- const handleDirectives = (node2, context2, component, componentProps, allProps) => {
- if (exp = checkAndRemoveAttribute(node2, ":teleport")) {
- return _teleport(node2, exp, context2);
- }
- if (exp = checkAndRemoveAttribute(node2, ":if")) {
- return _if(node2, exp, context2, component, componentProps, allProps);
- }
- if (exp = checkAndRemoveAttribute(node2, ":for")) {
- return _for(node2, exp, context2, component, componentProps, allProps);
- }
- if (exp = checkAndRemoveAttribute(node2, ":show")) {
- new ShowDirective({ element: node2, context: context2, expression: exp });
- }
- if (exp = checkAndRemoveAttribute(node2, ":ref")) {
- context2.scope[exp].value = node2;
- }
- if (exp = checkAndRemoveAttribute(node2, ":value")) {
- new ValueDirective({ element: node2, context: context2, expression: exp });
- }
- if (exp = checkAndRemoveAttribute(node2, ":html")) {
- context2.effect(() => {
- const result = evalGet(context2.scope, exp);
- if (result instanceof Element) {
- node2.replaceChildren();
- node2.append(result);
- } else {
- node2.innerHTML = result;
- }
- });
- }
- };
- const processAttributes = (node2, component) => {
- return Array.from(node2.attributes).filter((attr) => isSpreadProp(attr.name) || isMirrorProp(attr.name) || isRegularProp(attr.name) && componentHasPropByName(extractPropName(attr.name), component)).map((attr) => ({
- isMirror: isMirrorProp(attr.name),
- isSpread: isSpreadProp(attr.name),
- isBind: attr.name.includes("bind"),
- originalName: attr.name,
- extractedName: extractPropName(attr.name),
- exp: attr.value,
- value: isMirrorProp(attr.name) ? evalGet(context.scope, extractPropName(attr.name)) : attr.value ? evalGet(context.scope, attr.value) : void 0
- }));
- };
- if (isComponent(node, context)) {
- const component = context.app.getComponent(node.tagName.toLowerCase());
- const allProps = processAttributes(node, component);
- const componentProps = allProps.reduce((acc, { isSpread, isMirror, extractedName, value }) => {
- if (isSpread) {
- const spread = evalGet(context.scope, extractedName);
- if (isObject(spread)) Object.assign(acc, spread);
- } else if (isMirror) {
- acc[extractedName] = evalGet(context.scope, extractedName);
- } else {
- acc[extractedName] = value;
- }
- return acc;
- }, {});
- const next2 = handleDirectives(node, context, component, componentProps, allProps);
- if (next2) return next2;
- const templates = findTemplateNodes(node);
- return new Block({
- element: node,
- parentContext: context,
- component,
- replacementType: "replace",
- parentComponentBlock: current.componentBlock,
- templates,
- componentProps,
- allProps
- }).element;
- }
- const next = handleDirectives(node, context);
- if (next) return next;
- Array.from(node.attributes).forEach((attr) => {
- if (isPropAttribute(attr.name)) {
- new AttributeDirective({ element: node, context, attr });
- }
- if (isEventAttribute(attr.name)) {
- new EventDirective({ element: node, context, attr });
- }
- });
- walkChildren(node, context);
- }
-}
-function walkChildren(node, context) {
- let child2 = node.firstChild;
- while (child2) {
- child2 = walk(child2, context) || child2.nextSibling;
- }
-}
-var evalFuncCache = {};
-function evalGet(scope, exp, el) {
- if (!exp.trim()) return void 0;
- return execute(scope, `const ___value = (${exp.trim()}); return ___value;`, el);
-}
-function evalSet(scope, exp, value) {
- value = typeof value === "string" ? `"${value}"` : value;
- return execute(scope, `const ___target = (${exp.trim()}); return $isRef(___target) ? ___target.value = ${value} : ___target = ${value};`, null, false);
-}
-function execute(scope, exp, el, flatRefs = true) {
- const newScope = flatRefs ? flattenRefs(scope) : scope;
- const fn = evalFuncCache[exp] || (evalFuncCache[exp] = toFunction(exp));
- try {
- return fn(newScope, el);
- } catch (e) {
- console.warn(`Error evaluating expression: "${exp}":`);
- console.error(e);
- }
-}
-function toFunction(exp) {
- try {
- return new Function("$data", "$el", `with($data){${exp}}`);
- } catch (e) {
- console.error(`${e.message} in expression: ${exp}`);
- return () => {
- };
- }
-}
-function flattenRefs(scope) {
- const mapped = {};
- for (const key in scope) {
- if (scope.hasOwnProperty(key)) {
- if (isRef(scope[key])) {
- mapped[key] = scope[key].value;
- } else {
- mapped[key] = scope[key];
- }
- }
- }
- return mapped;
-}
-var child = {
- template: html`Animal: {{animal}} {{index}}
`,
- props: { animal: { default: "cat" }, index: { default: 0 } },
- main({ animal, index }) {
- return { animal, index };
- }
-};
-var parent = {
- template: html`
-
- mirror, no bind:
-
-
- mirror, bind:
-
-
- spread, no bind:
-
-
- spread, bind:
-
-
- regular prop:
-
-
- regular prop, bind:
-
-
-
div has "id" set to animal.value
-
-
div has "id" set and bound to animal.value
-
-
div has "animal" set to animal.value
-
-
div has "animal" set and bound to animal.value
-
-
div has "animal" spread
-
-
div has "animal" spread and bound
-
-
-
-
- if bool, mirror, no bind:
-
- if bool, mirror, bind:
-
-
- for list, mirror, no bind:
-
-
- for list, mirror, bind:
-
- if bool, for list, mirror, no bind: these have the value "DOG!" because by the time for :for directive is evaluated, animal.value is "DOG!", and no longer "dog".
-
-
-
-
- `,
- main() {
- const bool = ref(false);
- const animal = ref("dog");
- const spread = reactive({ animal: "panther" });
- const list = reactive([1, 2, 3]);
- setTimeout(() => {
- spread.animal = "PANTHER!";
- animal.value = "DOG!";
- bool.value = true;
- }, 500);
- setTimeout(() => {
- animal.value = "DOG!!!!!";
- }, 1e3);
- return { animal, spread, bool, list };
- }
-};
-var app = new App();
-app.register("child", child);
-app.mount(parent, "#app");
-export {
- App,
- Block,
- createContext,
- createScopedContext,
- current,
- evalGet,
- evalSet,
- inject,
- provide
-};
-//# sourceMappingURL=index.js.map
+function re(t){return new DOMParser().parseFromString(t,"text/html").body.firstChild}var oe=t=>t.nodeType===Node.TEXT_NODE,qe=t=>t.nodeName==="TEMPLATE",W=t=>t.nodeType===Node.ELEMENT_NODE;function R(t){return t!==null&&typeof t=="object"}function ge(t){return Array.isArray(t)}function N(t,e){let n=t.getAttribute(e);return n!==null&&t.removeAttribute(e),n}function ye(t){let e=[],n=r=>{Array.from(r.childNodes).forEach(o=>{W(o)&&(o.nodeName==="SLOT"&&e.push({node:o,name:o.getAttribute("name")||"default"}),o.hasChildNodes()&&n(o))})};return n(t),e}function ve(t){let e=[];return(r=>{let o=[];if(Array.from(r.childNodes).forEach(s=>{(W(s)||oe(s))&&(W(s)&&s.nodeName==="TEMPLATE"&&qe(s)?e.push({targetSlotName:s.getAttribute("slot")||"",node:s}):o.push(s))}),o.length>0){let s=document.createElement("template");s.setAttribute("slot","default"),o.forEach(i=>{s.content.appendChild(i)}),e.push({targetSlotName:"default",node:s})}})(t),e}var Ee=async t=>{await new Promise(e=>setTimeout(n=>requestAnimationFrame(r=>{t&&t(),e()})))};function be(t,...e){let n=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],r=t.reduce((o,s,i)=>o+s+(e[i]||""),"");return r=r.replace(/<([a-zA-Z][^\s/>]*)\s*([^>]*?)\/>/g,(o,s,i)=>n.includes(s.toLowerCase())?o:`<${s} ${i}>${s}>`),r}function z(t){return t==null?"":R(t)?JSON.stringify(t,null,2):String(t)}function ie(t,e){e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e?.parentNode?.appendChild(t)}function we(t){return!!(t.startsWith(".")||t.startsWith("{")&&t.endsWith("}"))}function se(t){return t.startsWith("...")}function J(t){return t.startsWith("{")&&t.endsWith("}")}function Ce(t){return t.startsWith(".")}function Re(t){return t.startsWith("@")}function Te(t,e){return Object.keys(e?.props??{}).some(n=>n===t)}function ae(t){return t.replace(/^\.\.\./,"").replace(/^\./,"").replace(/^{/,"").replace(/}$/,"").replace(/:bind$/,"")}function ze(t){return t.toLowerCase().replace(/-([a-z])/g,e=>e[1].toUpperCase())}function X(t){return ze(ae(t))}function ce(t){let e=[];for(let n=0;n!this.previousClasses.includes(s)).filter(Boolean),o=this.previousClasses.filter(s=>!n.includes(s));r.forEach(s=>{this.previousClasses.push(s),this.element.classList.add(s)}),o.forEach(s=>{this.previousClasses=this.previousClasses.filter(i=>i!==s),this.element.classList.remove(s)})}else if(typeof e=="object"&&this.extractedAttributeName==="style"){console.log("value is object",e);let n=Object.keys(e),r=Object.keys(this.previousStyles).filter(o=>!n.includes(o));n.forEach(o=>{this.previousStyles[o]=e[o],this.element.style[o]=e[o]}),r.forEach(o=>{this.previousStyles[o]="",this.element.style[o]=""}),this.previousStyles=e}else this.element.setAttribute(this.extractedAttributeName,e)}};var Q=class{element;context;expression;attr;eventCount=0;constructor({element:e,context:n,attr:r}){this.element=e,this.context=n,this.expression=r.value,this.attr=r;let s=r.name.replace(/^@/,"").split(".");this.element.addEventListener(s[0],i=>{if(s.includes("prevent")&&i.preventDefault(),s.includes("stop")&&i.stopPropagation(),s.includes("once")&&this.eventCount>0)return;this.eventCount++;let a=m(n.scope,r.value);typeof a=="function"&&a(i)}),e.removeAttribute(r.name)}};var Je=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,ke=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Xe=/^\(|\)$/g,Ze=/^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/,Ne=(t,e,n,r,o,s)=>{let i=e.match(Je);if(!i){console.warn(`invalid :for expression: ${e}`);return}let a=t.nextSibling,c=t.parentElement,l=new Text("");c.insertBefore(l,t),c.removeChild(t);let f=i[2].trim(),u=i[1].trim().replace(Xe,"").trim(),d,h=!1,x,E,p="key",w=t.getAttribute(p)||t.getAttribute(p=":key")||t.getAttribute(p=":key:bind");w&&(t.removeAttribute(p),p==="key"&&(w=JSON.stringify(w)));let T;(T=u.match(ke))&&(u=u.replace(ke,"").trim(),x=T[1].trim(),T[2]&&(E=T[2].trim())),(T=u.match(Ze))&&(d=T[1].split(",").map(g=>g.trim()),h=u[0]==="[");let _=!1,C,O,k,j=g=>{let S=new Map,y=[];if(ge(g))for(let v=0;v{let b={};d?d.forEach((D,L)=>b[D]=S[h?L:D]):b[u]=S,v?(x&&(b[x]=v),E&&(b[E]=y)):x&&(b[x]=y);let H=Ae(n,b),M=w?m(H.scope,w):y;return g.set(M,y),H.key=M,H},q=(g,S)=>{let y=new A({element:t,parentContext:g,replacementType:"replace",component:r,componentProps:o,allProps:s});return y.key=g.key,y.insert(c,S),y};return n.effect(()=>{let g=m(n.scope,f),S=k;if([O,k]=j(g),!_)C=O.map(y=>q(y,l)),_=!0;else{for(let M=0;M{d&&(i.insertBefore(a,d.element),d.remove(),d=void 0)};return n.effect(()=>{for(let E=0;E{let s=o.slice(2,-2).trim();r.forEach(i=>{let a=(c=s)=>m(this.context.scope,c,i);n.effect(()=>{i.textContent=z(a())})})})}findNodes(){let e=this.element.textContent.trim();if(e?.match(Qe)){let n=e.split(/(\{\{\s?[^}]+\s?\}\})/g).filter(Boolean);if(n){let r=this.element;for(let o=0;o{o.appendChild(t);let s=new MutationObserver(i=>{i.forEach(a=>{a.removedNodes.forEach(c=>{c.contains(r)&&(t.remove(),s.disconnect())})})});s.observe(document.body,{childList:!0,subtree:!0}),new A({element:t,parentContext:n})}),r}function Pe(t){return t instanceof HTMLInputElement}function Be(t){return t instanceof HTMLTextAreaElement}function Oe(t){return t instanceof HTMLSelectElement}var te=class{element;context;expression;inputType;constructor({element:e,context:n,expression:r}){if(this.element=e,this.context=n,this.expression=r,this.inputType=e.getAttribute("type"),Pe(e))switch(this.inputType){case"text":case"password":case"number":case"color":e.addEventListener("input",()=>{let o=this.inputType==="number"?e.value?parseFloat(e.value):0:e.value;I(this.context.scope,r,o)});break;case"checkbox":e.addEventListener("change",o=>{I(this.context.scope,r,!!o.currentTarget.checked)});break;case"radio":e.addEventListener("change",o=>{o.currentTarget.checked&&I(this.context.scope,r,e.getAttribute("value"))});break;default:break}Be(e)&&e.addEventListener("input",()=>{I(this.context.scope,r,e.value)}),Oe(e)&&e.addEventListener("change",()=>{I(this.context.scope,r,e.value)}),n.effect(this.updateElementValue.bind(this))}updateElementValue(){let e=m(this.context.scope,this.expression,this.element);if(Pe(this.element))switch(this.inputType){case"text":case"password":case"number":case"color":this.element.value=e;break;case"checkbox":this.element.checked=!!e;break;case"radio":this.element.checked=this.element.value===e;break;default:break}Be(this.element)&&(this.element.value=e),Oe(this.element)&&(this.element.value=e)}};var le=new WeakMap,G=[];function ne(t,e){let n=G[G.length-1];if(!n)return;let r=le.get(t);r||le.set(t,r=new Map);let o=r.get(e);o||r.set(e,o=new Set),o.has(n)||(o.add(n),n.refs.push(o))}function K(t,e){let n=le.get(t);if(!n)return;let r=new Set;n.get(e)?.forEach(o=>{r.add(o)}),r.forEach(pe)}function Le(t){t.active&&_e(t),t.active=!1}function $e(t){t.active||(t.active=!0,pe(t))}function pe(t){if(!t.active||G.includes(t))return;_e(t);let e;try{G.push(t),e=t.handler()}finally{G.pop()}return e}function _e(t){let{refs:e}=t;if(e.length)for(let n of e)n.delete(t);e.length=0}function fe(t,e={}){let{lazy:n}=e,r={active:!n,handler:t,refs:[]};return pe(r),{start:()=>{$e(r)},stop:()=>{Le(r)},toggle:()=>(r.active?Le(r):$e(r),r.active)}}var Ye=Symbol("computed");function U(t){return R(t)&&t[Ye]}var je=Symbol("ref");function $(t){return R(t)&&!!t[je]}function De(t=null){if(R(t))return $(t)?t:P(t);let e={value:t,[je]:!0};return new Proxy(e,{get(n,r,o){let s=Reflect.get(n,r,o);return ne(e,"value"),s},set(n,r,o){return n[r]!==o&&Reflect.set(n,r,o)&&K(e,"value"),!0}})}var Fe=Symbol("reactive");function P(t){return R(t)?t[Fe]?t:(t[Fe]=!0,Object.keys(t).forEach(e=>{R(t[e])&&(t[e]=P(t[e]))}),new Proxy(t,et())):De(t)}function et(){return{deleteProperty(t,e){let n=Reflect.has(t,e),r=Reflect.deleteProperty(t,e);return n&&K(t,e),r},get(t,e){return ne(t,e),Reflect.get(t,e)},set(t,e,n){if(t[e]===n)return!0;let r=!1;return R(n)&&!R(t[e])&&(r=!0),Reflect.set(t,e,n)&&K(t,e),r&&(t[e]=P(t[e])),!0}}}function tt(t){for(var e=[],n=0;n=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||i===95){o+=t[s++];continue}break}if(!o)throw new TypeError("Missing parameter name at "+n);e.push({type:"NAME",index:n,value:o}),n=s;continue}if(r==="("){var a=1,c="",s=n+1;if(t[s]==="?")throw new TypeError('Pattern cannot start with "?" at '+s);for(;s)?(?!\?)/g,r=0,o=n.exec(t.source);o;)e.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(t.source);return t}function ot(t,e,n){var r=t.map(function(o){return ue(o,e,n).source});return new RegExp("(?:"+r.join("|")+")",He(n))}function it(t,e,n){return st(nt(t,n),e,n)}function st(t,e,n){n===void 0&&(n={});for(var r=n.strict,o=r===void 0?!1:r,s=n.start,i=s===void 0?!0:s,a=n.end,c=a===void 0?!0:a,l=n.encode,f=l===void 0?function(k){return k}:l,u="["+V(n.endsWith||"")+"]|$",d="["+V(n.delimiter||"/#?")+"]",h=i?"^":"",x=0,E=t;x-1:C===void 0;o||(h+="(?:"+d+"(?="+u+"))?"),O||(h+="(?="+d+"|"+u+")")}return new RegExp(h,He(n))}function ue(t,e,n){return t instanceof RegExp?rt(t,e):Array.isArray(t)?ot(t,e,n):it(t,e,n)}function Ie(t){return $(t)||U(t)?t.value:typeof t=="function"?t():t}var he=new Set,at={template:be`
+
+ LINK
+
+ `,props:{href:{default:"#"}},main({href:t}){let e=r=>{r.preventDefault(),he.forEach(o=>{o.doRouteChange(Ie(t))})},n=P({"router-link":!0});return{go:e,classes:n,href:t}}};async function ct(t){return await t()}var lt=async t=>t.beforeEnter?await ct(t.beforeEnter):!0,pt=t=>{t.redirectTo&&he.forEach(e=>e.doRouteChange(t.redirectTo))},me=class{app;routes=[];pathExpressions=new Map;lastPath="/";knownRouterViews=new Map;knownRouterViewNames=new Map;populatedRouterViews=new Map;constructor(e=[]){this.routes=e}use(e,...n){this.app=e,this.app.register("router-link",at),window.addEventListener("popstate",this.onHistoryEvent.bind(this)),window.addEventListener("pushstate",this.onHistoryEvent.bind(this)),window.addEventListener("load",this.onHistoryEvent.bind(this));for(let r of this.routes)this.cacheRouteExpression(r);this.lastPath=`${location.pathname}${location.search}`,window.history.replaceState({},"",this.lastPath),he.add(this)}compile(e){e.nodeType===Node.ELEMENT_NODE&&e.nodeName==="ROUTER-VIEW"&&!this.knownRouterViews.has(e)&&B.componentBlock&&(this.knownRouterViews.set(e,B.componentBlock),this.knownRouterViewNames.set(e.getAttribute("name")?.trim()||"",e))}onHistoryEvent(e){e.preventDefault(),e.stopImmediatePropagation();let n=new URL(e.currentTarget.location.href).pathname;e.type==="load"?window.history.replaceState({},"",this.lastPath):e.type==="pushstate"?window.history.replaceState({},"",n):e.type==="popstate"&&window.history.replaceState({},"",n),this.lastPath=n;let r=this.getMatchesForURL(n);this.applyMatches(r)}doRouteChange(e){window.history.pushState({},"",e);let n=this.getMatchesForURL(`${location.pathname}${location.search}`);this.applyMatches(n)}getMatchesForURL(e){let n=[],r=(o,s="",i=[])=>{let a=[];for(let c of o){a.push(c);let l=`${s}${c.path}`.replace(/\/\//g,"/"),f=this.getPathMatch(l,e);f&&n.push({match:f,parents:[...i,...a]}),c.children?.length&&(r(c.children,l,[...i,...a]),a=[])}return n};return n=r(this.routes),n}getRouteExpression(e,n){if(this.pathExpressions.has(e))return this.pathExpressions.get(e);let r=[],s={regex:ue(e,r,{strict:!1,sensitive:!1,end:!0}),params:r,path:e,route:n};return this.pathExpressions.set(e,s),s}getPathMatch(e,n){return this.pathExpressions.get(e)&&this.pathExpressions.get(e).regex.exec(n)?this.pathExpressions.get(e):null}async applyMatches(e){if(!e)return;let n=new Set,r=async(i,a)=>{for(let c of i)if(c.view){let l=this.knownRouterViewNames.get(c.view);if(l&&await o(l,c))continue}else if(a&&await o(a,c))continue},o=async(i,a)=>await lt(a)?(s(i,a),!0):(a.componentFallback?s(i,a,a.componentFallback):pt(a),!1),s=(i,a,c)=>{if(!n.has(i)||this.populatedRouterViews.get(i)?.route!==a){let l=document.createElement("div");i.replaceChildren(l);let f=l.parentElement,u=new A({element:l,component:c||a.component,replacementType:"replaceChildren",parentContext:B.componentBlock.context});f.replaceChild(u.element,l),this.populatedRouterViews.set(i,{block:u,route:a}),n.add(i)}};for(let i of e){let c=[...i.parents,i.match.route].filter((f,u,d)=>u===d.findIndex(h=>h.path===f.path)),l=this.knownRouterViewNames.get("")??null;await r(c,l)}for(let i of this.knownRouterViews.keys())if(!n.has(i)&&this.populatedRouterViews.has(i)){let a=this.populatedRouterViews.get(i);a&&(a.block.teardown(),this.populatedRouterViews.delete(i))}}cacheRouteExpression(e,n=""){let r=`${n}${e.path}`.replace(/\/\//g,"/");this.getRouteExpression(r,e),e.children?.length&&e.children.forEach(o=>{this.cacheRouteExpression(o,r)})}destroy(){window.removeEventListener("popstate",this.onHistoryEvent.bind(this)),window.removeEventListener("pushstate",this.onHistoryEvent.bind(this)),window.removeEventListener("load",this.onHistoryEvent.bind(this))}};function Fn(t,e){B.componentBlock||console.warn("Can't provide: no current component block"),B.componentBlock.provides.set(t,e)}function Hn(t){B.componentBlock||console.warn("Can't inject: no current component block");let e=B.componentBlock;for(;e;){if(e.provides.has(t))return e.provides.get(t);e=e.parentComponentBlock}}var Ve=class{rootBlock;registry=new Map;plugins=new Set;register(e,n){this.registry.set(e,n)}use(e,...n){this.plugins.add(e),e.use(this,...n)}getComponent(e){return this.registry.get(e)}mount(e,n="body",r={}){let o=typeof n=="string"?document.querySelector(n):n,s=o.style.display;return o.style.display="none",this.rootBlock=this._mount(e,o,r,!0),o.style.display=s,this.rootBlock}_mount(e,n,r,o=!1){let s=xe({app:this});return r&&(s.scope=P(r),Ge(s.scope)),s.scope.$isRef=$,s.scope.$isComputed=U,new A({element:n,parentContext:s,component:e,isRoot:o,componentProps:r,replacementType:"replaceChildren"})}unmount(){this.rootBlock.teardown()}};function xe({parentContext:t,app:e}){let n={app:e||(t&&t.app?t.app:null),scope:P({}),blocks:[],effects:[],slots:[],templates:t?t.templates:[],effect:r=>{let o=fe(r);return n.effects.push(o),o}};return n}var Ae=(t,e={})=>{let n=t.scope,r=Object.create(n);Object.defineProperties(r,Object.getOwnPropertyDescriptors(e));let o;return o=P(new Proxy(r,{set(i,a,c,l){return l===o&&!i.hasOwnProperty(a)?Reflect.set(n,a,c):Reflect.set(i,a,c,l)}})),Ge(o),{...t,scope:{...t.scope,...o}}};function Ge(t){for(let e of Object.keys(t))typeof t[e]=="function"&&(t[e]=t[e].bind(t))}function ft(t,e){let n={};return Object.keys(e).forEach(r=>{let o=t.hasOwnProperty(r)?t[r]:e[r]?.default;n[r]=P(typeof o=="function"?o():o)}),n}var B={componentBlock:void 0},A=class{element;context;parentContext;component;provides=new Map;parentComponentBlock;componentProps;allProps;isFragment;start;end;key;constructor(e){this.isFragment=e.element instanceof HTMLTemplateElement,this.parentComponentBlock=e.parentComponentBlock,e.component?(B.componentBlock=this,this.element=re(e.component.template)):this.isFragment?this.element=e.element.content.cloneNode(!0):typeof e.element=="string"?this.element=re(e.element):(this.element=e.element.cloneNode(!0),e.element.replaceWith(this.element)),e.isRoot?this.context=e.parentContext:(this.parentContext=e.parentContext?e.parentContext:xe({}),this.parentContext.blocks.push(this),this.context=xe({parentContext:e.parentContext})),e.component&&(this.componentProps=ft(e.componentProps??{},e.component.props??{}),e.component.main&&(this.context.scope={...e.component.main(this.componentProps)||{}})),e.allProps?.forEach(n=>{n.isBind&&this.context.effect(()=>{let r;if(n.isSpread){let o=m(this.parentContext.scope,n.extractedName);R(o)&&Object.keys(o).forEach(s=>{r=o[s],this.setProp(s,r)})}else r=n.isMirror?m(this.parentContext.scope,n.extractedName):m(this.parentContext.scope,n.exp),this.setProp(n.extractedName,r)})}),this.context.slots=ye(this.element),this.context.templates=e.templates??[],this.context.slots.forEach(n=>{let r=this.context.templates.find(o=>o.targetSlotName===n.name);if(r){let o=r.node.content.cloneNode(!0);n.node.replaceWith(o)}}),this.context.scope.$isRef=$,this.context.scope.$isComputed=U,Ke(this.element,this.context),e.component&&(e.replacementType==="replace"?e.element instanceof HTMLElement&&e.element.replaceWith(this.element):e.element instanceof HTMLElement&&e.element.replaceChildren(this.element))}setProp(e,n){$(this.componentProps[e])?this.componentProps[e].value=n:this.componentProps[e]=n}insert(e,n=null){if(this.isFragment)if(this.start){let r=this.start,o;for(;r&&(o=r.nextSibling,e.insertBefore(r,n),r!==this.end);)r=o}else this.start=new Text(""),this.end=new Text(""),e.insertBefore(this.end,n),e.insertBefore(this.start,this.end),e.insertBefore(this.element,this.end);else e.insertBefore(this.element,n)}remove(){if(this.parentContext){let e=this.parentContext.blocks.indexOf(this);e>-1&&this.parentContext.blocks.splice(e,1)}if(this.start){let e=this.start.parentNode,n=this.start,r;for(;n&&(r=n.nextSibling,e.removeChild(n),n!==this.end);)n=r}else this.element.remove();this.teardown()}teardown(){this.context.blocks.forEach(e=>{e.teardown()}),this.context.effects.forEach(stop)}};function ut(t,e){return!!e.app.getComponent(t.tagName.toLowerCase())}function de(t,e){return e.every(n=>t.hasAttribute(n))?(console.warn("These directives cannot be used together on the same node:",e),console.warn("Node ignored:",t),!0):!1}function Ke(t,e){if(oe(t)){new Y({element:t,context:e});return}if(W(t)){let n,r=(i,a,c,l,f)=>{if(!de(i,[":if",":for"])&&!de(i,[":if",":teleport"])&&!de(i,[":for",":teleport"])){if(n=N(i,":scope")){let u=m(a.scope,n);typeof u=="object"&&Object.assign(a.scope,u)}if(n=N(i,":teleport"))return Me(i,n,a);if(n=N(i,":if"))return Se(i,n,a,c,l,f);if(n=N(i,":for"))return Ne(i,n,a,c,l,f);(n=N(i,":show"))&&new ee({element:i,context:a,expression:n}),(n=N(i,":ref"))&&(a.scope[n].value=i),(n=N(i,":value"))&&new te({element:i,context:a,expression:n}),(n=N(i,":html"))&&a.effect(()=>{let u=m(a.scope,n);u instanceof Element?(i.replaceChildren(),i.append(u)):i.innerHTML=u}),(n=N(i,":text"))&&a.effect(()=>{i.textContent=z(m(a.scope,n))})}},o=(i,a)=>Array.from(i.attributes).filter(c=>se(c.name)||J(c.name)||Ce(c.name)&&Te(X(c.name),a)).map(c=>({isMirror:J(c.name),isSpread:se(c.name),isBind:c.name.includes("bind"),originalName:c.name,extractedName:X(c.name),exp:c.value,value:J(c.name)?m(e.scope,X(c.name)):c.value?m(e.scope,c.value):void 0}));if(ut(t,e)){let i=e.app.getComponent(t.tagName.toLowerCase()),a=o(t,i),c=a.reduce((u,{isSpread:d,isMirror:h,extractedName:x,value:E})=>{if(d){let p=m(e.scope,x);R(p)&&Object.assign(u,p)}else h?u[x]=m(e.scope,x):u[x]=E;return u},{}),l=r(t,e,i,c,a);if(l)return l;let f=ve(t);return new A({element:t,parentContext:e,component:i,replacementType:"replace",parentComponentBlock:B.componentBlock,templates:f,componentProps:c,allProps:a}).element}let s=r(t,e);if(s)return s;Array.from(t.attributes).forEach(i=>{we(i.name)&&new Z({element:t,context:e,attr:i}),Re(i.name)&&new Q({element:t,context:e,attr:i})}),mt(t,e)}}function mt(t,e){let n=t.firstChild;for(;n;)n=Ke(n,e)||n.nextSibling}var We={};function m(t,e,n){if(e.trim())return Ue(t,`const ___value = (${e.trim()}); return ___value;`,n)}function I(t,e,n){return n=typeof n=="string"?`"${n}"`:n,Ue(t,`const ___target = (${e.trim()}); return $isRef(___target) ? ___target.value = ${n} : ___target = ${n};`,null,!1)}function Ue(t,e,n,r=!0){let o=r?dt(t):t,s=We[e]||(We[e]=ht(e));try{return s(o,n)}catch(i){console.warn(`Error evaluating expression: "${e}":`),console.error(i)}}function ht(t){try{return new Function("$data","$el",`with($data){${t}}`)}catch(e){return console.error(`${e.message} in expression: ${t}`),()=>{}}}function dt(t){let e={};for(let n in t)t.hasOwnProperty(n)&&($(t[n])?e[n]=t[n].value:e[n]=t[n]);return e}export{Ve as App,A as Block,me as RouterPlugin,xe as createContext,Ae as createScopedContext,B as current,m as evalGet,I as evalSet,Hn as inject,Fn as provide};
diff --git a/public/index.js.map b/public/index.js.map
index 48754b4..c6a992c 100755
--- a/public/index.js.map
+++ b/public/index.js.map
@@ -1,7 +1,7 @@
{
"version": 3,
"sources": ["../src/util.ts", "../src/directives/attribute.ts", "../src/directives/event.ts", "../src/directives/for.ts", "../src/directives/if.ts", "../src/directives/interpolation.ts", "../src/directives/show.ts", "../src/directives/teleport.ts", "../src/directives/value.ts", "../src/reactivity/effect.ts", "../src/reactivity/computed.ts", "../src/reactivity/ref.ts", "../src/reactivity/reactive.ts", "../src/index.ts"],
- "sourcesContent": ["import { Component } from \".\";\n\nexport function stringToElement(template: string): Element {\n const parser = new DOMParser();\n const doc = parser.parseFromString(template, \"text/html\");\n return doc.body.firstChild as Element;\n}\n\nexport const isText = (node: Node): node is Text => {\n return node.nodeType === Node.TEXT_NODE;\n};\n\nexport const isTemplate = (node: Node): node is HTMLTemplateElement => {\n return node.nodeName === \"TEMPLATE\";\n};\n\nexport const isElement = (node: Node): node is Element => {\n return node.nodeType === Node.ELEMENT_NODE;\n};\n\nexport function isObject(value: any): value is object {\n return value !== null && typeof value === \"object\";\n}\n\nexport function isArray(value: any): value is any[] {\n return Array.isArray(value);\n}\n\nexport function checkAndRemoveAttribute(el: Element, attrName: string): string | null {\n // Attempt to get the attribute value\n const attributeValue = el.getAttribute(attrName);\n\n // If attribute exists, remove it from the element\n if (attributeValue !== null) {\n el.removeAttribute(attrName);\n }\n\n // Return the value of the attribute or null if not present\n return attributeValue;\n}\n\nexport interface Slot {\n node: Element;\n name: string;\n}\n\nexport interface Template {\n targetSlotName: string;\n node: HTMLTemplateElement;\n}\n\nexport function findSlotNodes(element: Element): Slot[] {\n const slots: Slot[] = [];\n\n const findSlots = (node: Element) => {\n Array.from(node.childNodes).forEach((node) => {\n if (isElement(node)) {\n if (node.nodeName === \"SLOT\") {\n slots.push({ node, name: node.getAttribute(\"name\") || \"default\" });\n }\n\n if (node.hasChildNodes()) {\n findSlots(node);\n }\n }\n });\n };\n\n findSlots(element);\n\n return slots;\n}\n\nexport function findTemplateNodes(element: Element) {\n const templates: Template[] = [];\n\n const findTemplates = (element: Element) => {\n let defaultContentNodes: Node[] = [];\n\n Array.from(element.childNodes).forEach((node) => {\n if (isElement(node) || isText(node)) {\n if (isElement(node) && node.nodeName === \"TEMPLATE\" && isTemplate(node)) {\n templates.push({ targetSlotName: node.getAttribute(\"slot\") || \"\", node });\n } else {\n // Capture non-template top-level nodes and text nodes for default slot\n defaultContentNodes.push(node);\n }\n }\n });\n\n if (defaultContentNodes.length > 0) {\n // Create a template element with a default slot\n const defaultTemplate = document.createElement(\"template\");\n defaultTemplate.setAttribute(\"slot\", \"default\");\n\n defaultContentNodes.forEach((node) => {\n defaultTemplate.content.appendChild(node);\n });\n\n templates.push({ targetSlotName: \"default\", node: defaultTemplate });\n }\n };\n\n findTemplates(element);\n\n return templates;\n}\n\nexport const nextTick = async (f?: Function) => {\n await new Promise((r) =>\n setTimeout((_) =>\n requestAnimationFrame((_) => {\n f && f();\n r();\n }),\n ),\n );\n};\n\nexport function html(strings: TemplateStringsArray, ...values: any[]): string {\n // List of valid self-closing tags in HTML\n const selfClosingTags = [\"area\", \"base\", \"br\", \"col\", \"embed\", \"hr\", \"img\", \"input\", \"link\", \"meta\", \"param\", \"source\", \"track\", \"wbr\"];\n\n // Join the strings and values into a single template\n let result = strings.reduce((acc, str, i) => acc + str + (values[i] || \"\"), \"\");\n\n // Match non-HTML valid self-closing tags\n result = result.replace(/<([a-zA-Z][^\\s/>]*)\\s*([^>]*?)\\/>/g, (match, tagName, attributes) => {\n // If the tag is a valid self-closing tag, return it as is\n if (selfClosingTags.includes(tagName.toLowerCase())) {\n return match;\n }\n\n // Return the tag as an open/close tag preserving attributes\n return `<${tagName} ${attributes}>${tagName}>`;\n });\n\n return result;\n}\n\nexport function toDisplayString(value: unknown) {\n return value == null ? \"\" : isObject(value) ? JSON.stringify(value, null, 2) : String(value);\n}\n\nexport function insertAfter(newNode: Node, existingNode: Node) {\n if (existingNode.nextSibling) {\n existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);\n } else {\n existingNode?.parentNode?.appendChild(newNode);\n }\n}\n\nexport function isPropAttribute(attrName: string) {\n if (attrName.startsWith(\".\")) {\n return true;\n }\n\n if (attrName.startsWith(\"{\") && attrName.endsWith(\"}\")) {\n return true;\n }\n\n return false;\n}\n\nexport function isSpreadProp(attr: string) {\n return attr.startsWith(\"...\");\n}\n\nexport function isMirrorProp(attr: string) {\n return attr.startsWith(\"{\") && attr.endsWith(\"}\");\n}\n\nexport function isRegularProp(attr: string) {\n return attr.startsWith(\".\");\n}\n\nexport function isEventAttribute(attrName: string) {\n return attrName.startsWith(\"@\");\n}\n\nexport function componentHasPropByName(name: string, component: Component) {\n return Object.keys(component?.props ?? {}).some((prop) => prop === name);\n}\n\nexport function extractAttributeName(attrName: string) {\n return attrName\n .replace(/^\\.\\.\\./, \"\")\n .replace(/^\\./, \"\")\n .replace(/^{/, \"\")\n .replace(/}$/, \"\")\n .replace(/:bind$/, \"\");\n}\n\nfunction dashToCamel(str: string) {\n return str.toLowerCase().replace(/-([a-z])/g, (g) => g[1].toUpperCase());\n}\n\nexport function extractPropName(attrName: string) {\n return dashToCamel(extractAttributeName(attrName));\n}\n\nexport function classNames(_: any) {\n const classes = [];\n for (let i = 0; i < arguments.length; i++) {\n const arg = arguments[i];\n if (!arg) continue;\n const argType = typeof arg;\n if (argType === \"string\" || argType === \"number\") {\n classes.push(arg);\n } else if (Array.isArray(arg)) {\n if (arg.length) {\n const inner = classNames.apply(null, arg);\n if (inner) {\n classes.push(inner);\n }\n }\n } else if (argType === \"object\") {\n if (arg.toString === Object.prototype.toString) {\n for (let key in arg) {\n if (Object.hasOwnProperty.call(arg, key) && arg[key]) {\n classes.push(key);\n }\n }\n } else {\n classes.push(arg.toString());\n }\n }\n }\n return classes.join(\" \");\n}\n", "import { Context, evalGet } from \"..\";\nimport { classNames, extractAttributeName } from \"../util\";\n\ninterface AttributeDirectiveOptions {\n element: Element;\n context: Context;\n attr: Attr;\n}\n\ninterface Is {\n sameNameProperty: boolean;\n bound: boolean;\n spread: boolean;\n componentProp: boolean;\n}\n\nexport class AttributeDirective {\n element: Element;\n context: Context;\n expression: string;\n attr: Attr;\n extractedAttributeName: string;\n\n previousClasses: string[] = [];\n previousStyles: { [key: string]: string } = {};\n\n is: Is = {\n sameNameProperty: false,\n bound: false,\n spread: false,\n componentProp: false,\n };\n\n constructor({ element, context, attr }: AttributeDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = attr.value;\n this.attr = attr;\n this.extractedAttributeName = extractAttributeName(attr.name);\n\n this.is = {\n sameNameProperty: attr.name.startsWith(\"{\") && attr.name.endsWith(\"}\"),\n bound: attr.name.includes(\":bind\"),\n spread: attr.name.startsWith(\"...\"),\n componentProp: false,\n };\n\n if (this.is.sameNameProperty) {\n this.expression = this.extractedAttributeName;\n }\n\n if (this.is.spread) {\n this.expression = this.extractedAttributeName;\n }\n\n element.removeAttribute(attr.name);\n\n if (this.is.bound) {\n context.effect(this.update.bind(this));\n } else {\n this.update();\n }\n }\n\n update() {\n let value = evalGet(this.context.scope, this.expression);\n\n if (this.is.spread && typeof value === \"object\") {\n for (const [key, val] of Object.entries(value)) {\n this.element.setAttribute(key, String(val));\n }\n } else if ((typeof value === \"object\" || Array.isArray(value)) && this.extractedAttributeName === \"class\") {\n value = classNames(value);\n const next = value.split(\" \");\n\n // If we now have classes that are not already on the element, add them now.\n // Remove classes that are no longer on the element.\n const diff = next.filter((c: string) => !this.previousClasses.includes(c)).filter(Boolean);\n const rm = this.previousClasses.filter((c) => !next.includes(c));\n\n diff.forEach((c: string) => {\n this.previousClasses.push(c);\n this.element.classList.add(c);\n });\n\n rm.forEach((c) => {\n this.previousClasses = this.previousClasses.filter((addedClass) => addedClass !== c);\n this.element.classList.remove(c);\n });\n } else if (typeof value === \"object\" && this.extractedAttributeName === \"style\") {\n const next = Object.keys(value);\n const rm = Object.keys(this.previousStyles).filter((style) => !next.includes(style));\n\n next.forEach((style) => {\n this.previousStyles[style] = value[style];\n // @ts-ignore\n this.element.style[style] = value[style];\n });\n\n rm.forEach((style) => {\n this.previousStyles[style] = \"\";\n // @ts-ignore\n this.element.style[style] = \"\";\n });\n\n this.previousStyles = value;\n } else {\n this.element.setAttribute(this.extractedAttributeName, value);\n }\n }\n}\n", "import { Context, evalGet } from \"..\";\n\ninterface EventDirectiveOptions {\n element: Element;\n context: Context;\n attr: Attr;\n}\n\nexport class EventDirective {\n element: Element;\n context: Context;\n expression: string;\n attr: Attr;\n eventCount = 0;\n\n constructor({ element, context, attr }: EventDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = attr.value;\n this.attr = attr;\n\n const eventName = attr.name.replace(/^@/, \"\");\n const parts = eventName.split(\".\");\n\n this.element.addEventListener(parts[0], (event) => {\n if (parts.includes(\"prevent\")) event.preventDefault();\n if (parts.includes(\"stop\")) event.stopPropagation();\n if (parts.includes(\"once\") && this.eventCount > 0) return;\n\n this.eventCount++;\n\n const handler = evalGet(context.scope, attr.value);\n if (typeof handler === \"function\") {\n handler(event);\n }\n });\n\n element.removeAttribute(attr.name);\n }\n}\n", "import { Block, Component, Context, createScopedContext, evalGet } from \"..\";\nimport { isArray, isObject } from \"../util\";\n\nconst forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/;\nconst forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\nconst stripParensRE = /^\\(|\\)$/g;\nconst destructureRE = /^[{[]\\s*((?:[\\w_$]+\\s*,?\\s*)+)[\\]}]$/;\n\ntype KeyToIndexMap = Map;\n\nexport const _for = (el: Element, exp: string, ctx: Context, component?: Component, componentProps?: Record, allProps?: Record) => {\n const inMatch = exp.match(forAliasRE);\n if (!inMatch) {\n console.warn(`invalid :for expression: ${exp}`);\n return;\n }\n\n const nextNode = el.nextSibling;\n\n const parent = el.parentElement!;\n const anchor = new Text(\"\");\n parent.insertBefore(anchor, el);\n parent.removeChild(el);\n\n const sourceExp = inMatch[2].trim();\n let valueExp = inMatch[1].trim().replace(stripParensRE, \"\").trim();\n let destructureBindings: string[] | undefined;\n let isArrayDestructure = false;\n let indexExp: string | undefined;\n let objIndexExp: string | undefined;\n\n let keyAttr = \"key\";\n let keyExp = el.getAttribute(keyAttr) || el.getAttribute((keyAttr = \":key\")) || el.getAttribute((keyAttr = \":key:bind\"));\n if (keyExp) {\n el.removeAttribute(keyAttr);\n if (keyAttr === \"key\") keyExp = JSON.stringify(keyExp);\n }\n\n let match: any;\n if ((match = valueExp.match(forIteratorRE))) {\n valueExp = valueExp.replace(forIteratorRE, \"\").trim();\n indexExp = match[1].trim();\n if (match[2]) {\n objIndexExp = match[2].trim();\n }\n }\n\n if ((match = valueExp.match(destructureRE))) {\n destructureBindings = match[1].split(\",\").map((s: string) => s.trim());\n isArrayDestructure = valueExp[0] === \"[\";\n }\n\n let mounted = false;\n let blocks: Block[];\n let childCtxs: Context[];\n let keyToIndexMap: Map;\n\n const createChildContexts = (source: unknown): [Context[], KeyToIndexMap] => {\n const map: KeyToIndexMap = new Map();\n const ctxs: Context[] = [];\n\n if (isArray(source)) {\n for (let i = 0; i < source.length; i++) {\n ctxs.push(createChildContext(map, source[i], i));\n }\n } else if (typeof source === \"number\") {\n for (let i = 0; i < source; i++) {\n ctxs.push(createChildContext(map, i + 1, i));\n }\n } else if (isObject(source)) {\n let i = 0;\n for (const key in source) {\n ctxs.push(createChildContext(map, source[key], i++, key));\n }\n }\n\n return [ctxs, map];\n };\n\n const createChildContext = (map: KeyToIndexMap, value: any, index: number, objKey?: string): Context => {\n const data: any = {};\n if (destructureBindings) {\n destructureBindings.forEach((b, i) => (data[b] = value[isArrayDestructure ? i : b]));\n } else {\n data[valueExp] = value;\n }\n if (objKey) {\n indexExp && (data[indexExp] = objKey);\n objIndexExp && (data[objIndexExp] = index);\n } else {\n indexExp && (data[indexExp] = index);\n }\n\n const childCtx = createScopedContext(ctx, data);\n const key = keyExp ? evalGet(childCtx.scope, keyExp) : index;\n map.set(key, index);\n childCtx.key = key;\n return childCtx;\n };\n\n const mountBlock = (ctx: Context, ref: Node) => {\n const block = new Block({ element: el, parentContext: ctx, replacementType: \"replace\", component, componentProps, allProps });\n block.key = ctx.key;\n block.insert(parent, ref);\n return block;\n };\n\n ctx.effect(() => {\n const source = evalGet(ctx.scope, sourceExp);\n const prevKeyToIndexMap = keyToIndexMap;\n [childCtxs, keyToIndexMap] = createChildContexts(source);\n if (!mounted) {\n blocks = childCtxs.map((s) => mountBlock(s, anchor));\n mounted = true;\n } else {\n for (let i = 0; i < blocks.length; i++) {\n if (!keyToIndexMap.has(blocks[i].key)) {\n blocks[i].remove();\n }\n }\n\n const nextBlocks: Block[] = [];\n let i = childCtxs.length;\n let nextBlock: Block | undefined;\n let prevMovedBlock: Block | undefined;\n while (i--) {\n const childCtx = childCtxs[i];\n const oldIndex = prevKeyToIndexMap.get(childCtx.key);\n let block: Block;\n if (oldIndex == null) {\n // new\n block = mountBlock(childCtx, nextBlock ? nextBlock.element : anchor);\n } else {\n // update\n block = blocks[oldIndex];\n Object.assign(block.context.scope, childCtx.scope);\n if (oldIndex !== i) {\n // moved\n if (\n blocks[oldIndex + 1] !== nextBlock ||\n // If the next has moved, it must move too\n prevMovedBlock === nextBlock\n ) {\n prevMovedBlock = block;\n block.insert(parent, nextBlock ? nextBlock.element : anchor);\n }\n }\n }\n nextBlocks.unshift((nextBlock = block));\n }\n blocks = nextBlocks;\n }\n });\n\n return nextNode;\n};\n", "import { Block, Component, Context, evalGet } from \"..\";\nimport { checkAndRemoveAttribute } from \"../util\";\n\ninterface Branch {\n exp?: string | null;\n el: Element;\n}\n\nexport function _if(el: Element, exp: string, ctx: Context, component?: Component, componentProps?: Record, allProps?: Record) {\n const parent = el.parentElement!;\n const anchor = new Comment(\":if\");\n\n parent.insertBefore(anchor, el);\n\n const branches: Branch[] = [{ exp, el }];\n\n let elseEl: Element | null;\n let elseExp: string | null;\n\n while ((elseEl = el.nextElementSibling)) {\n elseExp = null;\n\n if (checkAndRemoveAttribute(elseEl, \":else\") === \"\" || (elseExp = checkAndRemoveAttribute(elseEl, \":else-if\"))) {\n parent.removeChild(elseEl);\n branches.push({ exp: elseExp, el: elseEl });\n } else {\n break;\n }\n }\n\n const nextNode = el.nextSibling;\n parent.removeChild(el);\n\n let block: Block | undefined;\n let activeBranchIndex = -1;\n\n const removeActiveBlock = () => {\n if (block) {\n parent.insertBefore(anchor, block.element);\n block.remove();\n block = undefined;\n }\n };\n\n ctx.effect(() => {\n for (let i = 0; i < branches.length; i++) {\n const { exp, el } = branches[i];\n\n if (!exp || evalGet(ctx.scope, exp)) {\n if (i !== activeBranchIndex) {\n removeActiveBlock();\n block = new Block({ element: el, parentContext: ctx, replacementType: \"replace\", component, componentProps, allProps });\n block.insert(parent, anchor);\n parent.removeChild(anchor);\n activeBranchIndex = i;\n }\n\n return;\n }\n }\n\n activeBranchIndex = -1;\n removeActiveBlock();\n });\n\n return nextNode;\n}\n", "import { Context, evalGet } from \"../\";\nimport { insertAfter, toDisplayString } from \"../util\";\n\ninterface InterpolationDirectiveOptions {\n element: Text;\n context: Context;\n}\n\nconst delims = /{{\\s?(.*?)\\s?}}/g;\n\nexport class InterpolationDirective {\n element: Text;\n context: Context;\n textNodes: Map = new Map();\n\n constructor({ element, context }: InterpolationDirectiveOptions) {\n this.element = element;\n this.context = context;\n\n this.findNodes();\n\n this.textNodes.forEach((nodes, expression) => {\n const trimmedExpression = expression.slice(2, -2).trim();\n\n nodes.forEach((node) => {\n const getter = (exp = trimmedExpression) => evalGet(this.context.scope, exp, node);\n\n context.effect(() => {\n node.textContent = toDisplayString(getter());\n });\n });\n });\n }\n\n findNodes() {\n const textContent = this.element.textContent.trim();\n if (textContent?.match(delims)) {\n const textNodes = textContent.split(/(\\{\\{\\s?[^}]+\\s?\\}\\})/g).filter(Boolean);\n if (textNodes) {\n let previousNode = this.element;\n\n for (let i = 0; i < textNodes.length; i++) {\n const textNode = textNodes[i];\n\n if (textNode.match(/\\{\\{\\s?.+\\s?\\}\\}/)) {\n const newNode = document.createTextNode(textNode);\n\n if (i === 0) {\n this.element.replaceWith(newNode);\n } else {\n insertAfter(newNode, previousNode);\n }\n\n previousNode = newNode;\n\n if (this.textNodes.has(textNode)) {\n this.textNodes.get(textNode).push(newNode);\n } else {\n this.textNodes.set(textNode, [newNode]);\n }\n } else {\n const newNode = document.createTextNode(textNodes[i]);\n\n if (i === 0) {\n this.element.replaceWith(newNode);\n } else {\n insertAfter(newNode, previousNode);\n }\n\n previousNode = newNode;\n }\n }\n }\n }\n }\n\n update() {}\n}\n", "import { Context, evalGet } from \"..\";\n\ninterface ShowDirectiveOptions {\n element: Element;\n context: Context;\n expression: string;\n}\n\nexport class ShowDirective {\n element: Element;\n context: Context;\n expression: string;\n originalDisplay: string;\n\n constructor({ element, context, expression }: ShowDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = expression;\n this.originalDisplay = getComputedStyle(this.element).display;\n\n context.effect(this.update.bind(this));\n }\n\n update() {\n const shouldShow = Boolean(evalGet(this.context.scope, this.expression));\n // @ts-ignore\n this.element.style.display = shouldShow ? this.originalDisplay : \"none\";\n }\n}\n", "import { Block, Context } from \"..\";\nimport { nextTick } from \"../util\";\n\nexport function _teleport(el: Element, exp: string, ctx: Context) {\n const anchor = new Comment(\":teleport\");\n el.replaceWith(anchor);\n\n const target = document.querySelector(exp);\n if (!target) {\n console.warn(`teleport target not found: ${exp}`);\n return;\n }\n\n nextTick(() => {\n target.appendChild(el);\n\n const observer = new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n mutation.removedNodes.forEach((removedNode) => {\n if (removedNode.contains(anchor)) {\n el.remove();\n observer.disconnect();\n }\n });\n });\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n\n // Walks the tree of this teleported element.\n new Block({\n element: el,\n parentContext: ctx,\n });\n });\n\n // Return the anchor so walk continues down the tree in the right order.\n return anchor;\n}\n", "import { Context, evalGet, evalSet } from \"..\";\n\ninterface ValueDirectiveOptions {\n element: Element;\n context: Context;\n expression: string;\n}\n\ntype SupportedModelType = \"text\" | \"checkbox\" | \"radio\" | \"number\" | \"password\" | \"color\";\n\nfunction isInput(element: Element): element is HTMLInputElement {\n return element instanceof HTMLInputElement;\n}\n\nfunction isTextarea(element: Element): element is HTMLTextAreaElement {\n return element instanceof HTMLTextAreaElement;\n}\n\nfunction isSelect(element: Element): element is HTMLSelectElement {\n return element instanceof HTMLSelectElement;\n}\n\nexport class ValueDirective {\n element: Element;\n context: Context;\n expression: string;\n inputType: SupportedModelType;\n\n constructor({ element, context, expression }: ValueDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = expression;\n this.inputType = element.getAttribute(\"type\") as SupportedModelType;\n\n // Element -> Context\n if (isInput(element)) {\n switch (this.inputType) {\n case \"text\":\n case \"password\":\n case \"number\":\n case \"color\":\n element.addEventListener(\"input\", () => {\n const value = this.inputType === \"number\" ? (element.value ? parseFloat(element.value) : 0) : element.value;\n evalSet(this.context.scope, expression, value);\n });\n break;\n\n case \"checkbox\":\n element.addEventListener(\"change\", (e: any) => {\n evalSet(this.context.scope, expression, !!e.currentTarget.checked);\n });\n break;\n case \"radio\":\n element.addEventListener(\"change\", (e: any) => {\n if (e.currentTarget.checked) {\n evalSet(this.context.scope, expression, element.getAttribute(\"value\"));\n }\n });\n break;\n default:\n break;\n }\n }\n\n if (isTextarea(element)) {\n element.addEventListener(\"input\", () => {\n evalSet(this.context.scope, expression, element.value);\n });\n }\n\n if (isSelect(element)) {\n element.addEventListener(\"change\", () => {\n evalSet(this.context.scope, expression, element.value);\n });\n }\n\n // Context -> Element\n context.effect(this.updateElementValue.bind(this));\n }\n\n updateElementValue() {\n const value = evalGet(this.context.scope, this.expression, this.element);\n\n if (isInput(this.element)) {\n switch (this.inputType) {\n case \"text\":\n case \"password\":\n case \"number\":\n case \"color\":\n this.element.value = value;\n break;\n case \"checkbox\":\n this.element.checked = !!value;\n break;\n case \"radio\":\n this.element.checked = this.element.value === value;\n break;\n default:\n break;\n }\n }\n\n if (isTextarea(this.element)) {\n this.element.value = value;\n }\n\n if (isSelect(this.element)) {\n this.element.value = value;\n }\n }\n}\n", "interface EffectOptions {\n lazy?: boolean;\n}\n\ninterface EffectFunction {\n active: boolean;\n handler: () => void;\n refs: Set[];\n}\n\ntype Effects = Set;\ntype EffectsMap = Map;\ntype TargetMap = WeakMap;\n\nconst targetMap: TargetMap = new WeakMap();\nconst effectStack: (EffectFunction | undefined)[] = [];\n\nexport function track(target: T, key: PropertyKey) {\n const activeEffect = effectStack[effectStack.length - 1];\n\n if (!activeEffect) return;\n\n let effectsMap = targetMap.get(target);\n if (!effectsMap)\n targetMap.set(target, (effectsMap = new Map() as EffectsMap));\n\n let effects = effectsMap.get(key);\n if (!effects) effectsMap.set(key, (effects = new Set()));\n\n if (!effects.has(activeEffect)) {\n effects.add(activeEffect);\n activeEffect.refs.push(effects);\n }\n}\n\nexport function trigger(target: any, key: PropertyKey) {\n const effectsMap = targetMap.get(target);\n if (!effectsMap) return;\n\n const scheduled = new Set();\n\n effectsMap.get(key)?.forEach((effect) => {\n scheduled.add(effect);\n });\n\n scheduled.forEach(run);\n}\n\nfunction stop(effect: EffectFunction) {\n if (effect.active) cleanup(effect);\n effect.active = false;\n}\n\nfunction start(effect: EffectFunction) {\n if (!effect.active) {\n effect.active = true;\n run(effect);\n }\n}\n\nfunction run(effect: EffectFunction): unknown {\n if (!effect.active) return;\n\n if (effectStack.includes(effect)) return;\n\n cleanup(effect);\n\n let val: unknown;\n\n try {\n effectStack.push(effect);\n val = effect.handler();\n } finally {\n effectStack.pop();\n }\n\n return val;\n}\n\nfunction cleanup(effect: EffectFunction) {\n const { refs } = effect;\n\n if (refs.length) {\n for (const ref of refs) {\n ref.delete(effect);\n }\n }\n\n refs.length = 0;\n}\n\nexport function effect(handler: () => void, opts: EffectOptions = {}) {\n const { lazy } = opts;\n const newEffect: EffectFunction = {\n active: !lazy,\n handler,\n refs: [],\n };\n\n run(newEffect);\n\n return {\n start: () => {\n start(newEffect);\n },\n stop: () => {\n stop(newEffect);\n },\n toggle: () => {\n if (newEffect.active) {\n stop(newEffect);\n } else {\n start(newEffect);\n }\n return newEffect.active;\n },\n };\n}\n", "import { isObject } from \"../util\";\nimport { effect } from \"./effect\";\n\nconst $computed = Symbol(\"computed\");\n\nexport type Computed = {\n readonly value: T;\n readonly [$computed]: true;\n};\n\nexport function isComputed(value: unknown): value is Computed {\n return isObject(value) && value[$computed];\n}\n\nexport function computed(getter: () => T): Computed {\n const ref = {\n get value(): T {\n return getter();\n },\n [$computed]: true,\n } as const;\n\n effect(() => {\n getter();\n });\n\n return ref;\n}\n", "import { isObject } from \"../util\";\nimport { track, trigger } from \"./effect\";\nimport { Reactive, reactive } from \"./reactive\";\n\nexport const $ref = Symbol(\"ref\");\n\nexport type Ref = {\n value: T;\n [$ref]: true;\n};\n\nexport function isRef(value: unknown): value is Ref {\n return isObject(value) && !!value[$ref];\n}\n\nexport function ref(value: T = null as unknown as T): Ref {\n if (isObject(value)) {\n // @ts-ignore\n return isRef(value) ? (value as Ref) : (reactive(value) as Reactive);\n }\n\n const result = { value, [$ref]: true };\n\n return new Proxy(result, {\n get(target: object, key: string | symbol, receiver: any) {\n const val = Reflect.get(target, key, receiver);\n track(result, \"value\");\n return val;\n },\n set(target: object, key: string | symbol, value: unknown) {\n const oldValue = target[key];\n if (oldValue !== value) {\n const success = Reflect.set(target, key, value);\n if (success) {\n trigger(result, \"value\");\n }\n }\n return true;\n },\n }) as Ref;\n}\n", "import { isObject } from \"../util\";\nimport { track, trigger } from \"./effect\";\nimport { ref } from \"./ref\";\n\nconst $reactive = Symbol(\"reactive\");\n\nexport type Reactive = T & { [$reactive]: true };\n\nexport function isReactive(\n value: unknown,\n): value is Reactive {\n return isObject(value) && !!value[$reactive];\n}\n\nexport function reactive(value: T): Reactive {\n // @ts-ignore\n if (!isObject(value)) return ref(value) as Reactive;\n if (value[$reactive]) return value as Reactive;\n\n value[$reactive] = true;\n\n Object.keys(value).forEach((key) => {\n if (isObject(value[key])) {\n value[key] = reactive(value[key]);\n }\n });\n\n return new Proxy(value, reactiveProxyHandler()) as Reactive;\n}\n\nfunction reactiveProxyHandler() {\n return {\n deleteProperty(target: object, key: string | symbol) {\n const had = Reflect.has(target, key);\n const result = Reflect.deleteProperty(target, key);\n if (had) trigger(target, key);\n return result;\n },\n get(target: object, key: string | symbol) {\n track(target, key);\n return Reflect.get(target, key);\n },\n set(target: object, key: string | symbol, value: unknown) {\n if (target[key] === value) return true;\n let newObj = false;\n\n if (isObject(value) && !isObject(target[key])) {\n newObj = true;\n }\n\n if (Reflect.set(target, key, value)) {\n trigger(target, key);\n }\n\n if (newObj) {\n target[key] = reactive(target[key]);\n }\n\n return true;\n },\n };\n}\n", "import { AttributeDirective } from \"./directives/attribute\";\nimport { EventDirective } from \"./directives/event\";\nimport { _for } from \"./directives/for\";\nimport { _if } from \"./directives/if\";\nimport { InterpolationDirective } from \"./directives/interpolation\";\nimport { ShowDirective } from \"./directives/show\";\nimport { _teleport } from \"./directives/teleport\";\nimport { ValueDirective } from \"./directives/value\";\nimport { Plugin } from \"./plugins\";\nimport { isComputed } from \"./reactivity/computed\";\nimport { effect as _effect } from \"./reactivity/effect\";\nimport { reactive } from \"./reactivity/reactive\";\nimport { isRef, ref } from \"./reactivity/ref\";\nimport {\n checkAndRemoveAttribute,\n componentHasPropByName,\n extractPropName,\n findSlotNodes,\n findTemplateNodes,\n html,\n isElement,\n isEventAttribute,\n isMirrorProp,\n isObject,\n isPropAttribute,\n isRegularProp,\n isSpreadProp,\n isText,\n Slot,\n stringToElement,\n Template,\n} from \"./util\";\n\nexport function provide(key: string, value: unknown) {\n if (!current.componentBlock) {\n console.warn(\"Can't provide: no current component block\");\n }\n\n current.componentBlock.provides.set(key, value);\n}\n\nexport function inject(key: string) {\n if (!current.componentBlock) {\n console.warn(\"Can't inject: no current component block\");\n }\n\n let c = current.componentBlock;\n\n while (c) {\n if (c.provides.has(key)) {\n return c.provides.get(key);\n }\n\n c = c.parentComponentBlock;\n }\n\n return undefined;\n}\n\nexport class App {\n rootBlock: Block;\n registry = new Map();\n plugins = new Set();\n\n register(name: string, component: Component) {\n this.registry.set(name, component);\n }\n\n use(plugin: Plugin, ...config: any[]) {\n this.plugins.add(plugin);\n plugin.use(this, ...config);\n }\n\n getComponent(tag: string) {\n return this.registry.get(tag);\n }\n\n mount(component: Component, target: string | HTMLElement = \"body\", props: Record = {}) {\n const root = typeof target === \"string\" ? (document.querySelector(target) as HTMLElement) : target;\n const display = root.style.display;\n root.style.display = \"none\";\n this.rootBlock = this._mount(component, root, props, true);\n root.style.display = display;\n return this.rootBlock;\n }\n\n private _mount(component: Component, target: HTMLElement, props: Record, isRoot = false) {\n const parentContext = createContext({ app: this });\n\n if (props) {\n parentContext.scope = reactive(props);\n bindContextMethods(parentContext.scope);\n }\n\n parentContext.scope.$isRef = isRef;\n parentContext.scope.$isComputed = isComputed;\n\n const block = new Block({\n element: target,\n parentContext,\n component,\n isRoot,\n componentProps: props,\n replacementType: \"replaceChildren\",\n });\n\n return block;\n }\n\n unmount() {\n this.rootBlock.teardown();\n }\n}\n\nexport interface Context {\n key?: any;\n app: App;\n scope: Record;\n blocks: Block[];\n effects: Array>;\n effect: typeof _effect;\n slots: Slot[];\n templates: Template[];\n}\n\ninterface CreateContextOptions {\n parentContext?: Context;\n app?: App;\n}\n\nexport function createContext({ parentContext, app }: CreateContextOptions): Context {\n const context: Context = {\n app: app ? app : parentContext && parentContext.app ? parentContext.app : null,\n scope: parentContext ? parentContext.scope : reactive({}),\n blocks: [],\n effects: [],\n slots: [],\n templates: parentContext ? parentContext.templates : [],\n effect: (handler: () => void) => {\n const e = _effect(handler);\n context.effects.push(e);\n return e;\n },\n };\n\n return context;\n}\n\nexport const createScopedContext = (ctx: Context, data = {}): Context => {\n const parentScope = ctx.scope;\n const mergedScope = Object.create(parentScope);\n Object.defineProperties(mergedScope, Object.getOwnPropertyDescriptors(data));\n let proxy: any;\n proxy = reactive(\n new Proxy(mergedScope, {\n set(target, key, val, receiver) {\n // when setting a property that doesn't exist on current scope,\n // do not create it on the current scope and fallback to parent scope.\n if (receiver === proxy && !target.hasOwnProperty(key)) {\n return Reflect.set(parentScope, key, val);\n }\n return Reflect.set(target, key, val, receiver);\n },\n }),\n );\n\n bindContextMethods(proxy);\n\n const out: Context = {\n ...ctx,\n scope: {\n ...ctx.scope,\n ...proxy,\n },\n };\n\n return out;\n};\n\nfunction bindContextMethods(scope: Record) {\n for (const key of Object.keys(scope)) {\n if (typeof scope[key] === \"function\") {\n scope[key] = scope[key].bind(scope);\n }\n }\n}\n\nfunction mergeProps(props: Record, defaultProps: Record) {\n const merged = {};\n\n Object.keys(defaultProps).forEach((defaultProp) => {\n const propValue = props.hasOwnProperty(defaultProp) ? props[defaultProp] : defaultProps[defaultProp]?.default;\n\n merged[defaultProp] = reactive(typeof propValue === \"function\" ? propValue() : propValue);\n });\n\n return merged;\n}\n\nexport interface Component {\n template: string;\n props?: Record;\n main?: (props?: Record) => Record | void;\n}\n\ninterface Current {\n componentBlock?: Block;\n}\n\nexport const current: Current = { componentBlock: undefined };\n\ninterface BlockOptions {\n element: Element;\n isRoot?: boolean;\n replacementType?: \"replace\" | \"replaceChildren\";\n componentProps?: Record;\n allProps?: Record;\n parentContext?: Context;\n component?: Component;\n parentComponentBlock?: Block;\n templates?: Template[];\n}\n\nexport class Block {\n element: Element;\n context: Context;\n parentContext: Context;\n component: Component;\n provides = new Map();\n parentComponentBlock: Block | undefined;\n componentProps: Record;\n allProps: Record;\n\n isFragment: boolean;\n start?: Text;\n end?: Text;\n key?: any;\n\n constructor(opts: BlockOptions) {\n this.isFragment = opts.element instanceof HTMLTemplateElement;\n this.parentComponentBlock = opts.parentComponentBlock;\n\n if (opts.component) {\n current.componentBlock = this;\n this.element = stringToElement(opts.component.template);\n } else {\n if (this.isFragment) {\n this.element = (opts.element as HTMLTemplateElement).content.cloneNode(true) as Element;\n } else if (typeof opts.element === \"string\") {\n this.element = stringToElement(opts.element);\n } else {\n this.element = opts.element.cloneNode(true) as Element;\n opts.element.replaceWith(this.element);\n }\n }\n\n if (opts.isRoot) {\n this.context = opts.parentContext;\n } else {\n this.parentContext = opts.parentContext ? opts.parentContext : createContext({});\n this.parentContext.blocks.push(this);\n this.context = createContext({ parentContext: opts.parentContext });\n }\n\n if (opts.component) {\n this.componentProps = mergeProps(opts.componentProps ?? {}, opts.component.props ?? {});\n\n if (opts.component.main) {\n this.context.scope = {\n ...(opts.component.main(this.componentProps) || {}),\n };\n }\n }\n\n opts.allProps?.forEach((prop) => {\n if (prop.isBind) {\n this.context.effect(() => {\n let newValue: unknown;\n\n if (prop.isSpread) {\n const spreadProps = evalGet(this.parentContext.scope, prop.extractedName);\n if (isObject(spreadProps)) {\n Object.keys(spreadProps).forEach((key) => {\n newValue = spreadProps[key];\n this.setProp(key, newValue);\n });\n }\n } else {\n newValue = prop.isMirror ? evalGet(this.parentContext.scope, prop.extractedName) : evalGet(this.parentContext.scope, prop.exp);\n this.setProp(prop.extractedName, newValue);\n }\n });\n }\n });\n\n // Capture slots\n this.context.slots = findSlotNodes(this.element);\n this.context.templates = opts.templates ?? [];\n\n // Put templates into slots\n this.context.slots.forEach((slot) => {\n const template = this.context.templates.find((t) => t.targetSlotName === slot.name);\n\n if (template) {\n const templateContents = template.node.content.cloneNode(true);\n slot.node.replaceWith(templateContents);\n }\n });\n\n this.context.scope.$isRef = isRef;\n this.context.scope.$isComputed = isComputed;\n\n walk(this.element, this.context);\n\n if (opts.component) {\n if (opts.replacementType === \"replace\") {\n if (opts.element instanceof HTMLElement) {\n opts.element.replaceWith(this.element);\n }\n } else {\n if (opts.element instanceof HTMLElement) {\n opts.element.replaceChildren(this.element);\n }\n }\n }\n }\n\n setProp(name: string, value: unknown) {\n if (isRef(this.componentProps[name])) {\n this.componentProps[name].value = value;\n } else {\n this.componentProps[name] = value;\n }\n }\n\n insert(parent: Element, anchor: Node | null = null) {\n if (this.isFragment) {\n if (this.start) {\n // Already inserted, moving\n let node: Node | null = this.start;\n let next: Node | null;\n\n while (node) {\n next = node.nextSibling;\n parent.insertBefore(node, anchor);\n\n if (node === this.end) {\n break;\n }\n\n node = next;\n }\n } else {\n this.start = new Text(\"\");\n this.end = new Text(\"\");\n\n parent.insertBefore(this.end, anchor);\n parent.insertBefore(this.start, this.end);\n parent.insertBefore(this.element, this.end);\n }\n } else {\n parent.insertBefore(this.element, anchor);\n }\n }\n\n remove() {\n if (this.parentContext) {\n const i = this.parentContext.blocks.indexOf(this);\n\n if (i > -1) {\n this.parentContext.blocks.splice(i, 1);\n }\n }\n\n if (this.start) {\n const parent = this.start.parentNode!;\n let node: Node | null = this.start;\n let next: Node | null;\n\n while (node) {\n next = node.nextSibling;\n parent.removeChild(node);\n\n if (node === this.end) {\n break;\n }\n\n node = next;\n }\n } else {\n // this.element.parentNode!.removeChild(this.element);\n this.element.remove();\n }\n\n this.teardown();\n }\n\n teardown() {\n this.context.blocks.forEach((block) => {\n block.teardown();\n });\n\n this.context.effects.forEach(stop);\n }\n}\n\nfunction isComponent(element: Element, context: Context) {\n return !!context.app.getComponent(element.tagName.toLowerCase());\n}\n\nfunction walk(node: Node, context: Context) {\n if (isText(node)) {\n new InterpolationDirective({ element: node, context });\n return;\n }\n\n if (isElement(node)) {\n let exp: string | null;\n\n const handleDirectives = (node: Element, context: Context, component?: Component, componentProps?: Record, allProps?: any[]) => {\n if ((exp = checkAndRemoveAttribute(node, \":teleport\"))) {\n return _teleport(node, exp, context);\n }\n if ((exp = checkAndRemoveAttribute(node, \":if\"))) {\n return _if(node, exp, context, component, componentProps, allProps);\n }\n if ((exp = checkAndRemoveAttribute(node, \":for\"))) {\n return _for(node, exp, context, component, componentProps, allProps);\n }\n if ((exp = checkAndRemoveAttribute(node, \":show\"))) {\n new ShowDirective({ element: node, context, expression: exp });\n }\n if ((exp = checkAndRemoveAttribute(node, \":ref\"))) {\n context.scope[exp].value = node;\n }\n if ((exp = checkAndRemoveAttribute(node, \":value\"))) {\n new ValueDirective({ element: node, context, expression: exp });\n }\n if ((exp = checkAndRemoveAttribute(node, \":html\"))) {\n context.effect(() => {\n const result = evalGet(context.scope, exp);\n if (result instanceof Element) {\n node.replaceChildren();\n node.append(result);\n } else {\n node.innerHTML = result;\n }\n });\n }\n };\n\n const processAttributes = (node: Element, component?: Component) => {\n return Array.from(node.attributes)\n .filter((attr) => isSpreadProp(attr.name) || isMirrorProp(attr.name) || (isRegularProp(attr.name) && componentHasPropByName(extractPropName(attr.name), component)))\n .map((attr) => ({\n isMirror: isMirrorProp(attr.name),\n isSpread: isSpreadProp(attr.name),\n isBind: attr.name.includes(\"bind\"),\n originalName: attr.name,\n extractedName: extractPropName(attr.name),\n exp: attr.value,\n value: isMirrorProp(attr.name) ? evalGet(context.scope, extractPropName(attr.name)) : attr.value ? evalGet(context.scope, attr.value) : undefined,\n }));\n };\n\n if (isComponent(node, context)) {\n const component = context.app.getComponent(node.tagName.toLowerCase());\n const allProps = processAttributes(node, component);\n\n const componentProps = allProps.reduce((acc, { isSpread, isMirror, extractedName, value }) => {\n if (isSpread) {\n const spread = evalGet(context.scope, extractedName);\n if (isObject(spread)) Object.assign(acc, spread);\n } else if (isMirror) {\n acc[extractedName] = evalGet(context.scope, extractedName);\n } else {\n acc[extractedName] = value;\n }\n return acc;\n }, {});\n\n const next = handleDirectives(node, context, component, componentProps, allProps);\n if (next) return next;\n\n const templates = findTemplateNodes(node);\n\n return new Block({\n element: node,\n parentContext: context,\n component,\n replacementType: \"replace\",\n parentComponentBlock: current.componentBlock,\n templates,\n componentProps,\n allProps,\n }).element;\n }\n\n const next = handleDirectives(node, context);\n if (next) return next;\n\n Array.from(node.attributes).forEach((attr) => {\n if (isPropAttribute(attr.name)) {\n new AttributeDirective({ element: node, context, attr });\n }\n\n if (isEventAttribute(attr.name)) {\n new EventDirective({ element: node, context, attr });\n }\n });\n\n walkChildren(node, context);\n }\n}\n\nfunction walkChildren(node: Node, context: Context) {\n let child = node.firstChild;\n\n while (child) {\n child = walk(child, context) || child.nextSibling;\n }\n}\n\nconst evalFuncCache: Record = {};\n\nexport function evalGet(scope: any, exp: string, el?: Node) {\n if (!exp.trim()) return undefined;\n return execute(scope, `const ___value = (${exp.trim()}); return ___value;`, el);\n}\n\nexport function evalSet(scope: any, exp: string, value: unknown) {\n value = typeof value === \"string\" ? `\"${value}\"` : value;\n return execute(scope, `const ___target = (${exp.trim()}); return $isRef(___target) ? ___target.value = ${value} : ___target = ${value};`, null, false);\n}\n\nfunction execute(scope: any, exp: string, el?: Node, flatRefs = true) {\n const newScope = flatRefs ? flattenRefs(scope) : scope;\n const fn = evalFuncCache[exp] || (evalFuncCache[exp] = toFunction(exp));\n\n try {\n return fn(newScope, el);\n } catch (e) {\n console.warn(`Error evaluating expression: \"${exp}\":`);\n console.error(e);\n }\n}\n\n// Function to convert expression strings to functions\nfunction toFunction(exp: string) {\n try {\n return new Function(\"$data\", \"$el\", `with($data){${exp}}`);\n } catch (e) {\n console.error(`${(e as Error).message} in expression: ${exp}`);\n return () => {};\n }\n}\n\n// Map all ref properties in scope to their `.value`\nfunction flattenRefs(scope: any): any {\n const mapped = {};\n\n for (const key in scope) {\n if (scope.hasOwnProperty(key)) {\n // Check if the value is a Ref\n if (isRef(scope[key])) {\n mapped[key] = scope[key].value;\n } else {\n mapped[key] = scope[key];\n }\n }\n }\n return mapped;\n}\n\n// ------------------------------------------------\n// Slots, multiple default and named, :if and :for\n// const card = {\n// template: html`\n//
\n// \n// `,\n// };\n\n// const main = {\n// template: html`\n// \n//
card below \n// \n// card title\n// Card body content \n// \n// \n// `,\n// };\n\n// const app = new App();\n// app.register(\"card\", card);\n// app.mount(main, \"#app\");\n\n// ------------------------------------------------\n// Slots, multiple default and named, :if and :for\n// const app = new App();\n\n// const parent = {\n// template: html`\n// \n//
parent \n//
\n// \n// \n// content 1 always shown\n// \n// content 2, animals:\n//
animal: {{animal}}
\n//
\n\n// \n// card body from parent \n// \n//
\n// `,\n// main() {\n// const bool = ref(true);\n// const animals = reactive([\"dog\", \"cat\", \"bear\"]);\n\n// setInterval(() => {\n// bool.value = !bool.value;\n// }, 2000);\n\n// return { bool, animals };\n// },\n// };\n// const card = {\n// template: html`\n//
card \n// \n// \n// `,\n// };\n// app.register(\"card\", card);\n// const parentBlock = app.mount(parent, \"body\");\n// const cardBlock = parentBlock.context.blocks[0];\n\n// ------------------------------------------------\n// Component pros, mirror and spread, bind and no bind\nconst child = {\n template: html`Animal: {{animal}} {{index}}
`,\n props: { animal: { default: \"cat\" }, index: { default: 0 } },\n main({ animal, index }) {\n return { animal, index };\n },\n};\n\nconst parent = {\n template: html`\n \n mirror, no bind:\n
\n
\n mirror, bind:\n
\n
\n spread, no bind:\n
\n
\n spread, bind:\n
\n
\n regular prop:\n
\n
\n regular prop, bind:\n
\n
\n
div has \"id\" set to animal.value
\n
\n
div has \"id\" set and bound to animal.value
\n
\n
div has \"animal\" set to animal.value
\n
\n
div has \"animal\" set and bound to animal.value
\n
\n
div has \"animal\" spread
\n
\n
div has \"animal\" spread and bound
\n
\n
\n
\n
\n if bool, mirror, no bind:\n
\n if bool, mirror, bind:\n
\n
\n for list, mirror, no bind:\n
\n
\n for list, mirror, bind:\n
\n if bool, for list, mirror, no bind: these have the value \"DOG!\" because by the time for :for directive is evaluated, animal.value is \"DOG!\", and no longer \"dog\".\n
\n \n
\n
\n `,\n main() {\n const bool = ref(false);\n const animal = ref(\"dog\");\n const spread = reactive({ animal: \"panther\" });\n const list = reactive([1, 2, 3]);\n\n setTimeout(() => {\n spread.animal = \"PANTHER!\";\n animal.value = \"DOG!\";\n bool.value = true;\n }, 500);\n\n setTimeout(() => {\n animal.value = \"DOG!!!!!\";\n }, 1000);\n\n return { animal, spread, bool, list };\n },\n};\n\nconst app = new App();\napp.register(\"child\", child);\napp.mount(parent, \"#app\");\n\n// ------------------------------------------------\n// Event directive\n// const counter = {\n// template: html`\n// \n//
true
\n//
Count: {{count}}{{count >= 2 ? '!!!' : ''}} \n//
+ \n//
- \n//
\n// `,\n// main() {\n// const count = ref(0);\n// const style = reactive({ color: \"gray\" });\n// const increment = () => count.value++;\n// const decrement = () => count.value--;\n\n// setInterval(() => {\n// style.color = style.color === \"gray\" ? \"white\" : \"gray\";\n// }, 500);\n\n// return { count, increment, decrement, style };\n// },\n// };\n\n// const app = new App();\n// app.mount(counter, \"#app\");\n\n// ------------------------------------------------\n// Template\n// const main = {\n// template: html`\n// \n// `,\n// main() {\n// const items = reactive([1, 2, 3, 4, 5]);\n// const bool = ref(true);\n// setInterval(() => (bool.value = !bool.value), 250);\n// return { items, bool };\n// },\n// };\n\n// const app = new App();\n// app.mount(main, \"#app\");\n\n// ------------------------------------------------\n// :html\n// const main = {\n// template: html`
`,\n// main() {\n// const html = ref(\"hello \");\n\n// setTimeout(() => {\n// if (html.value === \"hello \") {\n// html.value = \"world \";\n// }\n// }, 1000);\n\n// return { html };\n// },\n// };\n\n// const app = new App();\n// app.mount(main, \"#app\");\n"],
- "mappings": ";AAEO,SAAS,gBAAgB,UAA2B;AACzD,QAAM,SAAS,IAAI,UAAU;AAC7B,QAAM,MAAM,OAAO,gBAAgB,UAAU,WAAW;AACxD,SAAO,IAAI,KAAK;AAClB;AAEO,IAAM,SAAS,CAAC,SAA6B;AAClD,SAAO,KAAK,aAAa,KAAK;AAChC;AAEO,IAAM,aAAa,CAAC,SAA4C;AACrE,SAAO,KAAK,aAAa;AAC3B;AAEO,IAAM,YAAY,CAAC,SAAgC;AACxD,SAAO,KAAK,aAAa,KAAK;AAChC;AAEO,SAAS,SAAS,OAA6B;AACpD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", "node", "context", "next", "child"]
+ "sourcesContent": ["import { Component } from \".\";\n\nexport function stringToElement(template: string): Element {\n const parser = new DOMParser();\n const doc = parser.parseFromString(template, \"text/html\");\n return doc.body.firstChild as Element;\n}\n\nexport const isText = (node: Node): node is Text => {\n return node.nodeType === Node.TEXT_NODE;\n};\n\nexport const isTemplate = (node: Node): node is HTMLTemplateElement => {\n return node.nodeName === \"TEMPLATE\";\n};\n\nexport const isElement = (node: Node): node is Element => {\n return node.nodeType === Node.ELEMENT_NODE;\n};\n\nexport function isObject(value: any): value is object {\n return value !== null && typeof value === \"object\";\n}\n\nexport function isArray(value: any): value is any[] {\n return Array.isArray(value);\n}\n\nexport function checkAndRemoveAttribute(el: Element, attrName: string): string | null {\n // Attempt to get the attribute value\n const attributeValue = el.getAttribute(attrName);\n\n // If attribute exists, remove it from the element\n if (attributeValue !== null) {\n el.removeAttribute(attrName);\n }\n\n // Return the value of the attribute or null if not present\n return attributeValue;\n}\n\nexport interface Slot {\n node: Element;\n name: string;\n}\n\nexport interface Template {\n targetSlotName: string;\n node: HTMLTemplateElement;\n}\n\nexport function findSlotNodes(element: Element): Slot[] {\n const slots: Slot[] = [];\n\n const findSlots = (node: Element) => {\n Array.from(node.childNodes).forEach((node) => {\n if (isElement(node)) {\n if (node.nodeName === \"SLOT\") {\n slots.push({ node, name: node.getAttribute(\"name\") || \"default\" });\n }\n\n if (node.hasChildNodes()) {\n findSlots(node);\n }\n }\n });\n };\n\n findSlots(element);\n\n return slots;\n}\n\nexport function findTemplateNodes(element: Element) {\n const templates: Template[] = [];\n\n const findTemplates = (element: Element) => {\n let defaultContentNodes: Node[] = [];\n\n Array.from(element.childNodes).forEach((node) => {\n if (isElement(node) || isText(node)) {\n if (isElement(node) && node.nodeName === \"TEMPLATE\" && isTemplate(node)) {\n templates.push({ targetSlotName: node.getAttribute(\"slot\") || \"\", node });\n } else {\n // Capture non-template top-level nodes and text nodes for default slot\n defaultContentNodes.push(node);\n }\n }\n });\n\n if (defaultContentNodes.length > 0) {\n // Create a template element with a default slot\n const defaultTemplate = document.createElement(\"template\");\n defaultTemplate.setAttribute(\"slot\", \"default\");\n\n defaultContentNodes.forEach((node) => {\n defaultTemplate.content.appendChild(node);\n });\n\n templates.push({ targetSlotName: \"default\", node: defaultTemplate });\n }\n };\n\n findTemplates(element);\n\n return templates;\n}\n\nexport const nextTick = async (f?: Function) => {\n await new Promise((r) =>\n setTimeout((_) =>\n requestAnimationFrame((_) => {\n f && f();\n r();\n }),\n ),\n );\n};\n\nexport function html(strings: TemplateStringsArray, ...values: any[]): string {\n // List of valid self-closing tags in HTML\n const selfClosingTags = [\"area\", \"base\", \"br\", \"col\", \"embed\", \"hr\", \"img\", \"input\", \"link\", \"meta\", \"param\", \"source\", \"track\", \"wbr\"];\n\n // Join the strings and values into a single template\n let result = strings.reduce((acc, str, i) => acc + str + (values[i] || \"\"), \"\");\n\n // Match non-HTML valid self-closing tags\n result = result.replace(/<([a-zA-Z][^\\s/>]*)\\s*([^>]*?)\\/>/g, (match, tagName, attributes) => {\n // If the tag is a valid self-closing tag, return it as is\n if (selfClosingTags.includes(tagName.toLowerCase())) {\n return match;\n }\n\n // Return the tag as an open/close tag preserving attributes\n return `<${tagName} ${attributes}>${tagName}>`;\n });\n\n return result;\n}\n\nexport function toDisplayString(value: unknown) {\n return value == null ? \"\" : isObject(value) ? JSON.stringify(value, null, 2) : String(value);\n}\n\nexport function insertAfter(newNode: Node, existingNode: Node) {\n if (existingNode.nextSibling) {\n existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);\n } else {\n existingNode?.parentNode?.appendChild(newNode);\n }\n}\n\nexport function isPropAttribute(attrName: string) {\n if (attrName.startsWith(\".\")) {\n return true;\n }\n\n if (attrName.startsWith(\"{\") && attrName.endsWith(\"}\")) {\n return true;\n }\n\n return false;\n}\n\nexport function isSpreadProp(attr: string) {\n return attr.startsWith(\"...\");\n}\n\nexport function isMirrorProp(attr: string) {\n return attr.startsWith(\"{\") && attr.endsWith(\"}\");\n}\n\nexport function isRegularProp(attr: string) {\n return attr.startsWith(\".\");\n}\n\nexport function isEventAttribute(attrName: string) {\n return attrName.startsWith(\"@\");\n}\n\nexport function componentHasPropByName(name: string, component: Component) {\n return Object.keys(component?.props ?? {}).some((prop) => prop === name);\n}\n\nexport function extractAttributeName(attrName: string) {\n return attrName\n .replace(/^\\.\\.\\./, \"\")\n .replace(/^\\./, \"\")\n .replace(/^{/, \"\")\n .replace(/}$/, \"\")\n .replace(/:bind$/, \"\");\n}\n\nfunction dashToCamel(str: string) {\n return str.toLowerCase().replace(/-([a-z])/g, (g) => g[1].toUpperCase());\n}\n\nexport function extractPropName(attrName: string) {\n return dashToCamel(extractAttributeName(attrName));\n}\n\nexport function classNames(_: any) {\n const classes = [];\n for (let i = 0; i < arguments.length; i++) {\n const arg = arguments[i];\n if (!arg) continue;\n const argType = typeof arg;\n if (argType === \"string\" || argType === \"number\") {\n classes.push(arg);\n } else if (Array.isArray(arg)) {\n if (arg.length) {\n const inner = classNames.apply(null, arg);\n if (inner) {\n classes.push(inner);\n }\n }\n } else if (argType === \"object\") {\n if (arg.toString === Object.prototype.toString) {\n for (let key in arg) {\n if (Object.hasOwnProperty.call(arg, key) && arg[key]) {\n classes.push(key);\n }\n }\n } else {\n classes.push(arg.toString());\n }\n }\n }\n return classes.join(\" \");\n}\n", "import { Context, evalGet } from \"..\";\nimport { classNames, extractAttributeName } from \"../util\";\n\ninterface AttributeDirectiveOptions {\n element: Element;\n context: Context;\n attr: Attr;\n}\n\ninterface Is {\n sameNameProperty: boolean;\n bound: boolean;\n spread: boolean;\n componentProp: boolean;\n}\n\nexport class AttributeDirective {\n element: Element;\n context: Context;\n expression: string;\n attr: Attr;\n extractedAttributeName: string;\n\n previousClasses: string[] = [];\n previousStyles: { [key: string]: string } = {};\n\n is: Is = {\n sameNameProperty: false,\n bound: false,\n spread: false,\n componentProp: false,\n };\n\n constructor({ element, context, attr }: AttributeDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = attr.value;\n this.attr = attr;\n this.extractedAttributeName = extractAttributeName(attr.name);\n\n this.is = {\n sameNameProperty: attr.name.startsWith(\"{\") && attr.name.endsWith(\"}\"),\n bound: attr.name.includes(\":bind\"),\n spread: attr.name.startsWith(\"...\"),\n componentProp: false,\n };\n\n if (this.is.sameNameProperty) {\n this.expression = this.extractedAttributeName;\n }\n\n if (this.is.spread) {\n this.expression = this.extractedAttributeName;\n }\n\n element.removeAttribute(attr.name);\n\n if (this.is.bound) {\n context.effect(this.update.bind(this));\n } else {\n this.update();\n }\n }\n\n update() {\n let value = evalGet(this.context.scope, this.expression);\n\n if (this.is.spread && typeof value === \"object\") {\n for (const [key, val] of Object.entries(value)) {\n this.element.setAttribute(key, String(val));\n }\n } else if ((typeof value === \"object\" || Array.isArray(value)) && this.extractedAttributeName === \"class\") {\n value = classNames(value);\n const next = value.split(\" \");\n\n // If we now have classes that are not already on the element, add them now.\n // Remove classes that are no longer on the element.\n const diff = next.filter((c: string) => !this.previousClasses.includes(c)).filter(Boolean);\n const rm = this.previousClasses.filter((c) => !next.includes(c));\n\n diff.forEach((c: string) => {\n this.previousClasses.push(c);\n this.element.classList.add(c);\n });\n\n rm.forEach((c) => {\n this.previousClasses = this.previousClasses.filter((addedClass) => addedClass !== c);\n this.element.classList.remove(c);\n });\n } else if (typeof value === \"object\" && this.extractedAttributeName === \"style\") {\n console.log(\"value is object\", value)\n const next = Object.keys(value);\n const rm = Object.keys(this.previousStyles).filter((style) => !next.includes(style));\n\n next.forEach((style) => {\n this.previousStyles[style] = value[style];\n // @ts-ignore\n this.element.style[style] = value[style];\n });\n\n rm.forEach((style) => {\n this.previousStyles[style] = \"\";\n // @ts-ignore\n this.element.style[style] = \"\";\n });\n\n this.previousStyles = value;\n } else {\n this.element.setAttribute(this.extractedAttributeName, value);\n }\n }\n}\n", "import { Context, evalGet } from \"..\";\n\ninterface EventDirectiveOptions {\n element: Element;\n context: Context;\n attr: Attr;\n}\n\nexport class EventDirective {\n element: Element;\n context: Context;\n expression: string;\n attr: Attr;\n eventCount = 0;\n\n constructor({ element, context, attr }: EventDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = attr.value;\n this.attr = attr;\n\n const eventName = attr.name.replace(/^@/, \"\");\n const parts = eventName.split(\".\");\n\n this.element.addEventListener(parts[0], (event) => {\n if (parts.includes(\"prevent\")) event.preventDefault();\n if (parts.includes(\"stop\")) event.stopPropagation();\n if (parts.includes(\"once\") && this.eventCount > 0) return;\n\n this.eventCount++;\n\n const handler = evalGet(context.scope, attr.value);\n if (typeof handler === \"function\") {\n handler(event);\n }\n });\n\n element.removeAttribute(attr.name);\n }\n}\n", "import { Block, Component, Context, createScopedContext, evalGet } from \"..\";\nimport { isArray, isObject } from \"../util\";\n\nconst forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/;\nconst forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\nconst stripParensRE = /^\\(|\\)$/g;\nconst destructureRE = /^[{[]\\s*((?:[\\w_$]+\\s*,?\\s*)+)[\\]}]$/;\n\ntype KeyToIndexMap = Map;\n\nexport const _for = (el: Element, exp: string, ctx: Context, component?: Component, componentProps?: Record, allProps?: Record) => {\n const inMatch = exp.match(forAliasRE);\n if (!inMatch) {\n console.warn(`invalid :for expression: ${exp}`);\n return;\n }\n\n const nextNode = el.nextSibling;\n\n const parent = el.parentElement!;\n const anchor = new Text(\"\");\n parent.insertBefore(anchor, el);\n parent.removeChild(el);\n\n const sourceExp = inMatch[2].trim();\n let valueExp = inMatch[1].trim().replace(stripParensRE, \"\").trim();\n let destructureBindings: string[] | undefined;\n let isArrayDestructure = false;\n let indexExp: string | undefined;\n let objIndexExp: string | undefined;\n\n let keyAttr = \"key\";\n let keyExp = el.getAttribute(keyAttr) || el.getAttribute((keyAttr = \":key\")) || el.getAttribute((keyAttr = \":key:bind\"));\n if (keyExp) {\n el.removeAttribute(keyAttr);\n if (keyAttr === \"key\") keyExp = JSON.stringify(keyExp);\n }\n\n let match: any;\n if ((match = valueExp.match(forIteratorRE))) {\n valueExp = valueExp.replace(forIteratorRE, \"\").trim();\n indexExp = match[1].trim();\n if (match[2]) {\n objIndexExp = match[2].trim();\n }\n }\n\n if ((match = valueExp.match(destructureRE))) {\n destructureBindings = match[1].split(\",\").map((s: string) => s.trim());\n isArrayDestructure = valueExp[0] === \"[\";\n }\n\n let mounted = false;\n let blocks: Block[];\n let childCtxs: Context[];\n let keyToIndexMap: Map;\n\n const createChildContexts = (source: unknown): [Context[], KeyToIndexMap] => {\n const map: KeyToIndexMap = new Map();\n const ctxs: Context[] = [];\n\n if (isArray(source)) {\n for (let i = 0; i < source.length; i++) {\n ctxs.push(createChildContext(map, source[i], i));\n }\n } else if (typeof source === \"number\") {\n for (let i = 0; i < source; i++) {\n ctxs.push(createChildContext(map, i + 1, i));\n }\n } else if (isObject(source)) {\n let i = 0;\n for (const key in source) {\n ctxs.push(createChildContext(map, source[key], i++, key));\n }\n }\n\n return [ctxs, map];\n };\n\n const createChildContext = (map: KeyToIndexMap, value: any, index: number, objKey?: string): Context => {\n const data: any = {};\n if (destructureBindings) {\n destructureBindings.forEach((b, i) => (data[b] = value[isArrayDestructure ? i : b]));\n } else {\n data[valueExp] = value;\n }\n if (objKey) {\n indexExp && (data[indexExp] = objKey);\n objIndexExp && (data[objIndexExp] = index);\n } else {\n indexExp && (data[indexExp] = index);\n }\n\n const childCtx = createScopedContext(ctx, data);\n const key = keyExp ? evalGet(childCtx.scope, keyExp) : index;\n map.set(key, index);\n childCtx.key = key;\n return childCtx;\n };\n\n const mountBlock = (ctx: Context, ref: Node) => {\n const block = new Block({ element: el, parentContext: ctx, replacementType: \"replace\", component, componentProps, allProps });\n block.key = ctx.key;\n block.insert(parent, ref);\n return block;\n };\n\n ctx.effect(() => {\n const source = evalGet(ctx.scope, sourceExp);\n const prevKeyToIndexMap = keyToIndexMap;\n [childCtxs, keyToIndexMap] = createChildContexts(source);\n if (!mounted) {\n blocks = childCtxs.map((s) => mountBlock(s, anchor));\n mounted = true;\n } else {\n for (let i = 0; i < blocks.length; i++) {\n if (!keyToIndexMap.has(blocks[i].key)) {\n blocks[i].remove();\n }\n }\n\n const nextBlocks: Block[] = [];\n let i = childCtxs.length;\n let nextBlock: Block | undefined;\n let prevMovedBlock: Block | undefined;\n while (i--) {\n const childCtx = childCtxs[i];\n const oldIndex = prevKeyToIndexMap.get(childCtx.key);\n let block: Block;\n if (oldIndex == null) {\n // new\n block = mountBlock(childCtx, nextBlock ? nextBlock.element : anchor);\n } else {\n // update\n block = blocks[oldIndex];\n Object.assign(block.context.scope, childCtx.scope);\n if (oldIndex !== i) {\n // moved\n if (\n blocks[oldIndex + 1] !== nextBlock ||\n // If the next has moved, it must move too\n prevMovedBlock === nextBlock\n ) {\n prevMovedBlock = block;\n block.insert(parent, nextBlock ? nextBlock.element : anchor);\n }\n }\n }\n nextBlocks.unshift((nextBlock = block));\n }\n blocks = nextBlocks;\n }\n });\n\n return nextNode;\n};\n", "import { Block, Component, Context, evalGet } from \"..\";\nimport { checkAndRemoveAttribute } from \"../util\";\n\ninterface Branch {\n exp?: string | null;\n el: Element;\n}\n\nexport function _if(el: Element, exp: string, ctx: Context, component?: Component, componentProps?: Record, allProps?: Record) {\n const parent = el.parentElement!;\n const anchor = new Comment(\":if\");\n\n parent.insertBefore(anchor, el);\n\n const branches: Branch[] = [{ exp, el }];\n\n let elseEl: Element | null;\n let elseExp: string | null;\n\n while ((elseEl = el.nextElementSibling)) {\n elseExp = null;\n\n if (checkAndRemoveAttribute(elseEl, \":else\") === \"\" || (elseExp = checkAndRemoveAttribute(elseEl, \":else-if\"))) {\n parent.removeChild(elseEl);\n branches.push({ exp: elseExp, el: elseEl });\n } else {\n break;\n }\n }\n\n const nextNode = el.nextSibling;\n parent.removeChild(el);\n\n let block: Block | undefined;\n let activeBranchIndex = -1;\n\n const removeActiveBlock = () => {\n if (block) {\n parent.insertBefore(anchor, block.element);\n block.remove();\n block = undefined;\n }\n };\n\n ctx.effect(() => {\n for (let i = 0; i < branches.length; i++) {\n const { exp, el } = branches[i];\n\n if (!exp || evalGet(ctx.scope, exp)) {\n if (i !== activeBranchIndex) {\n removeActiveBlock();\n block = new Block({ element: el, parentContext: ctx, replacementType: \"replace\", component, componentProps, allProps });\n block.insert(parent, anchor);\n parent.removeChild(anchor);\n activeBranchIndex = i;\n }\n\n return;\n }\n }\n\n activeBranchIndex = -1;\n removeActiveBlock();\n });\n\n return nextNode;\n}\n", "import { Context, evalGet } from \"../\";\nimport { insertAfter, toDisplayString } from \"../util\";\n\ninterface InterpolationDirectiveOptions {\n element: Text;\n context: Context;\n}\n\nconst delims = /{{\\s?(.*?)\\s?}}/g;\n\nexport class InterpolationDirective {\n element: Text;\n context: Context;\n textNodes: Map = new Map();\n\n constructor({ element, context }: InterpolationDirectiveOptions) {\n this.element = element;\n this.context = context;\n\n this.findNodes();\n\n this.textNodes.forEach((nodes, expression) => {\n const trimmedExpression = expression.slice(2, -2).trim();\n\n nodes.forEach((node) => {\n const getter = (exp = trimmedExpression) => evalGet(this.context.scope, exp, node);\n\n context.effect(() => {\n node.textContent = toDisplayString(getter());\n });\n });\n });\n }\n\n findNodes() {\n const textContent = this.element.textContent.trim();\n if (textContent?.match(delims)) {\n const textNodes = textContent.split(/(\\{\\{\\s?[^}]+\\s?\\}\\})/g).filter(Boolean);\n if (textNodes) {\n let previousNode = this.element;\n\n for (let i = 0; i < textNodes.length; i++) {\n const textNode = textNodes[i];\n\n if (textNode.match(/\\{\\{\\s?.+\\s?\\}\\}/)) {\n const newNode = document.createTextNode(textNode);\n\n if (i === 0) {\n this.element.replaceWith(newNode);\n } else {\n insertAfter(newNode, previousNode);\n }\n\n previousNode = newNode;\n\n if (this.textNodes.has(textNode)) {\n this.textNodes.get(textNode).push(newNode);\n } else {\n this.textNodes.set(textNode, [newNode]);\n }\n } else {\n const newNode = document.createTextNode(textNodes[i]);\n\n if (i === 0) {\n this.element.replaceWith(newNode);\n } else {\n insertAfter(newNode, previousNode);\n }\n\n previousNode = newNode;\n }\n }\n }\n }\n }\n\n update() {}\n}\n", "import { Context, evalGet } from \"..\";\n\ninterface ShowDirectiveOptions {\n element: Element;\n context: Context;\n expression: string;\n}\n\nexport class ShowDirective {\n element: Element;\n context: Context;\n expression: string;\n originalDisplay: string;\n\n constructor({ element, context, expression }: ShowDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = expression;\n this.originalDisplay = getComputedStyle(this.element).display;\n\n context.effect(this.update.bind(this));\n }\n\n update() {\n const shouldShow = Boolean(evalGet(this.context.scope, this.expression));\n // @ts-ignore\n this.element.style.display = shouldShow ? this.originalDisplay : \"none\";\n }\n}\n", "import { Block, Context } from \"..\";\nimport { nextTick } from \"../util\";\n\nexport function _teleport(el: Element, exp: string, ctx: Context) {\n const anchor = new Comment(\":teleport\");\n el.replaceWith(anchor);\n\n const target = document.querySelector(exp);\n if (!target) {\n console.warn(`teleport target not found: ${exp}`);\n return;\n }\n\n nextTick(() => {\n target.appendChild(el);\n\n const observer = new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n mutation.removedNodes.forEach((removedNode) => {\n if (removedNode.contains(anchor)) {\n el.remove();\n observer.disconnect();\n }\n });\n });\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n\n // Walks the tree of this teleported element.\n new Block({\n element: el,\n parentContext: ctx,\n });\n });\n\n // Return the anchor so walk continues down the tree in the right order.\n return anchor;\n}\n", "import { Context, evalGet, evalSet } from \"..\";\n\ninterface ValueDirectiveOptions {\n element: Element;\n context: Context;\n expression: string;\n}\n\ntype SupportedModelType = \"text\" | \"checkbox\" | \"radio\" | \"number\" | \"password\" | \"color\";\n\nfunction isInput(element: Element): element is HTMLInputElement {\n return element instanceof HTMLInputElement;\n}\n\nfunction isTextarea(element: Element): element is HTMLTextAreaElement {\n return element instanceof HTMLTextAreaElement;\n}\n\nfunction isSelect(element: Element): element is HTMLSelectElement {\n return element instanceof HTMLSelectElement;\n}\n\nexport class ValueDirective {\n element: Element;\n context: Context;\n expression: string;\n inputType: SupportedModelType;\n\n constructor({ element, context, expression }: ValueDirectiveOptions) {\n this.element = element;\n this.context = context;\n this.expression = expression;\n this.inputType = element.getAttribute(\"type\") as SupportedModelType;\n\n // Element -> Context\n if (isInput(element)) {\n switch (this.inputType) {\n case \"text\":\n case \"password\":\n case \"number\":\n case \"color\":\n element.addEventListener(\"input\", () => {\n const value = this.inputType === \"number\" ? (element.value ? parseFloat(element.value) : 0) : element.value;\n evalSet(this.context.scope, expression, value);\n });\n break;\n\n case \"checkbox\":\n element.addEventListener(\"change\", (e: any) => {\n evalSet(this.context.scope, expression, !!e.currentTarget.checked);\n });\n break;\n case \"radio\":\n element.addEventListener(\"change\", (e: any) => {\n if (e.currentTarget.checked) {\n evalSet(this.context.scope, expression, element.getAttribute(\"value\"));\n }\n });\n break;\n default:\n break;\n }\n }\n\n if (isTextarea(element)) {\n element.addEventListener(\"input\", () => {\n evalSet(this.context.scope, expression, element.value);\n });\n }\n\n if (isSelect(element)) {\n element.addEventListener(\"change\", () => {\n evalSet(this.context.scope, expression, element.value);\n });\n }\n\n // Context -> Element\n context.effect(this.updateElementValue.bind(this));\n }\n\n updateElementValue() {\n const value = evalGet(this.context.scope, this.expression, this.element);\n\n if (isInput(this.element)) {\n switch (this.inputType) {\n case \"text\":\n case \"password\":\n case \"number\":\n case \"color\":\n this.element.value = value;\n break;\n case \"checkbox\":\n this.element.checked = !!value;\n break;\n case \"radio\":\n this.element.checked = this.element.value === value;\n break;\n default:\n break;\n }\n }\n\n if (isTextarea(this.element)) {\n this.element.value = value;\n }\n\n if (isSelect(this.element)) {\n this.element.value = value;\n }\n }\n}\n", "interface EffectOptions {\n lazy?: boolean;\n}\n\ninterface EffectFunction {\n active: boolean;\n handler: () => void;\n refs: Set[];\n}\n\ntype Effects = Set;\ntype EffectsMap = Map;\ntype TargetMap = WeakMap;\n\nconst targetMap: TargetMap = new WeakMap();\nconst effectStack: (EffectFunction | undefined)[] = [];\n\nexport function track(target: T, key: PropertyKey) {\n const activeEffect = effectStack[effectStack.length - 1];\n\n if (!activeEffect) return;\n\n let effectsMap = targetMap.get(target);\n if (!effectsMap)\n targetMap.set(target, (effectsMap = new Map() as EffectsMap));\n\n let effects = effectsMap.get(key);\n if (!effects) effectsMap.set(key, (effects = new Set()));\n\n if (!effects.has(activeEffect)) {\n effects.add(activeEffect);\n activeEffect.refs.push(effects);\n }\n}\n\nexport function trigger(target: any, key: PropertyKey) {\n const effectsMap = targetMap.get(target);\n if (!effectsMap) return;\n\n const scheduled = new Set();\n\n effectsMap.get(key)?.forEach((effect) => {\n scheduled.add(effect);\n });\n\n scheduled.forEach(run);\n}\n\nfunction stop(effect: EffectFunction) {\n if (effect.active) cleanup(effect);\n effect.active = false;\n}\n\nfunction start(effect: EffectFunction) {\n if (!effect.active) {\n effect.active = true;\n run(effect);\n }\n}\n\nfunction run(effect: EffectFunction): unknown {\n if (!effect.active) return;\n\n if (effectStack.includes(effect)) return;\n\n cleanup(effect);\n\n let val: unknown;\n\n try {\n effectStack.push(effect);\n val = effect.handler();\n } finally {\n effectStack.pop();\n }\n\n return val;\n}\n\nfunction cleanup(effect: EffectFunction) {\n const { refs } = effect;\n\n if (refs.length) {\n for (const ref of refs) {\n ref.delete(effect);\n }\n }\n\n refs.length = 0;\n}\n\nexport function effect(handler: () => void, opts: EffectOptions = {}) {\n const { lazy } = opts;\n const newEffect: EffectFunction = {\n active: !lazy,\n handler,\n refs: [],\n };\n\n run(newEffect);\n\n return {\n start: () => {\n start(newEffect);\n },\n stop: () => {\n stop(newEffect);\n },\n toggle: () => {\n if (newEffect.active) {\n stop(newEffect);\n } else {\n start(newEffect);\n }\n return newEffect.active;\n },\n };\n}\n", "import { isObject } from \"../util\";\nimport { effect } from \"./effect\";\n\nconst $computed = Symbol(\"computed\");\n\nexport type Computed = {\n readonly value: T;\n readonly [$computed]: true;\n};\n\nexport function isComputed(value: unknown): value is Computed {\n return isObject(value) && value[$computed];\n}\n\nexport function computed(getter: () => T): Computed {\n const ref = {\n get value(): T {\n return getter();\n },\n [$computed]: true,\n } as const;\n\n effect(() => {\n getter();\n });\n\n return ref;\n}\n", "import { isObject } from \"../util\";\nimport { track, trigger } from \"./effect\";\nimport { Reactive, reactive } from \"./reactive\";\n\nexport const $ref = Symbol(\"ref\");\n\nexport type Ref = {\n value: T;\n [$ref]: true;\n};\n\nexport function isRef(value: unknown): value is Ref {\n return isObject(value) && !!value[$ref];\n}\n\nexport function ref(value: T = null as unknown as T): Ref {\n if (isObject(value)) {\n // @ts-ignore\n return isRef(value) ? (value as Ref) : (reactive(value) as Reactive);\n }\n\n const result = { value, [$ref]: true };\n\n return new Proxy(result, {\n get(target: object, key: string | symbol, receiver: any) {\n const val = Reflect.get(target, key, receiver);\n track(result, \"value\");\n return val;\n },\n set(target: object, key: string | symbol, value: unknown) {\n const oldValue = target[key];\n if (oldValue !== value) {\n const success = Reflect.set(target, key, value);\n if (success) {\n trigger(result, \"value\");\n }\n }\n return true;\n },\n }) as Ref;\n}\n", "import { isObject } from \"../util\";\nimport { track, trigger } from \"./effect\";\nimport { ref } from \"./ref\";\n\nconst $reactive = Symbol(\"reactive\");\n\nexport type Reactive = T & { [$reactive]: true };\n\nexport function isReactive(\n value: unknown,\n): value is Reactive {\n return isObject(value) && !!value[$reactive];\n}\n\nexport function reactive(value: T): Reactive {\n // @ts-ignore\n if (!isObject(value)) return ref(value) as Reactive;\n if (value[$reactive]) return value as Reactive;\n\n value[$reactive] = true;\n\n Object.keys(value).forEach((key) => {\n if (isObject(value[key])) {\n value[key] = reactive(value[key]);\n }\n });\n\n return new Proxy(value, reactiveProxyHandler()) as Reactive;\n}\n\nfunction reactiveProxyHandler() {\n return {\n deleteProperty(target: object, key: string | symbol) {\n const had = Reflect.has(target, key);\n const result = Reflect.deleteProperty(target, key);\n if (had) trigger(target, key);\n return result;\n },\n get(target: object, key: string | symbol) {\n track(target, key);\n return Reflect.get(target, key);\n },\n set(target: object, key: string | symbol, value: unknown) {\n if (target[key] === value) return true;\n let newObj = false;\n\n if (isObject(value) && !isObject(target[key])) {\n newObj = true;\n }\n\n if (Reflect.set(target, key, value)) {\n trigger(target, key);\n }\n\n if (newObj) {\n target[key] = reactive(target[key]);\n }\n\n return true;\n },\n };\n}\n", "import { AttributeDirective } from \"./directives/attribute\";\nimport { EventDirective } from \"./directives/event\";\nimport { _for } from \"./directives/for\";\nimport { _if } from \"./directives/if\";\nimport { InterpolationDirective } from \"./directives/interpolation\";\nimport { ShowDirective } from \"./directives/show\";\nimport { _teleport } from \"./directives/teleport\";\nimport { ValueDirective } from \"./directives/value\";\nimport { Plugin } from \"./plugins\";\nimport { isComputed } from \"./reactivity/computed\";\nimport { effect as _effect } from \"./reactivity/effect\";\nimport { reactive } from \"./reactivity/reactive\";\nimport { isRef, ref } from \"./reactivity/ref\";\nimport { checkAndRemoveAttribute, componentHasPropByName, extractPropName, findSlotNodes, findTemplateNodes, html, isElement, isEventAttribute, isMirrorProp, isObject, isPropAttribute, isRegularProp, isSpreadProp, isText, Slot, stringToElement, Template, toDisplayString } from \"./util\";\n\nexport function provide(key: string, value: unknown) {\n if (!current.componentBlock) {\n console.warn(\"Can't provide: no current component block\");\n }\n\n current.componentBlock.provides.set(key, value);\n}\n\nexport function inject(key: string) {\n if (!current.componentBlock) {\n console.warn(\"Can't inject: no current component block\");\n }\n\n let c = current.componentBlock;\n\n while (c) {\n if (c.provides.has(key)) {\n return c.provides.get(key);\n }\n\n c = c.parentComponentBlock;\n }\n\n return undefined;\n}\n\nexport class App {\n rootBlock: Block;\n registry = new Map();\n plugins = new Set();\n\n register(name: string, component: Component) {\n this.registry.set(name, component);\n }\n\n use(plugin: Plugin, ...config: any[]) {\n this.plugins.add(plugin);\n plugin.use(this, ...config);\n }\n\n getComponent(tag: string) {\n return this.registry.get(tag);\n }\n\n mount(component: Component, target: string | HTMLElement = \"body\", props: Record = {}) {\n const root = typeof target === \"string\" ? (document.querySelector(target) as HTMLElement) : target;\n const display = root.style.display;\n root.style.display = \"none\";\n this.rootBlock = this._mount(component, root, props, true);\n root.style.display = display;\n return this.rootBlock;\n }\n\n private _mount(component: Component, target: HTMLElement, props: Record, isRoot = false) {\n const parentContext = createContext({ app: this });\n\n if (props) {\n parentContext.scope = reactive(props);\n bindContextMethods(parentContext.scope);\n }\n\n parentContext.scope.$isRef = isRef;\n parentContext.scope.$isComputed = isComputed;\n\n const block = new Block({\n element: target,\n parentContext,\n component,\n isRoot,\n componentProps: props,\n replacementType: \"replaceChildren\",\n });\n\n return block;\n }\n\n unmount() {\n this.rootBlock.teardown();\n }\n}\n\nexport interface Context {\n key?: any;\n app: App;\n scope: Record;\n blocks: Block[];\n effects: Array>;\n effect: typeof _effect;\n slots: Slot[];\n templates: Template[];\n}\n\ninterface CreateContextOptions {\n parentContext?: Context;\n app?: App;\n}\n\nexport function createContext({ parentContext, app }: CreateContextOptions): Context {\n const context: Context = {\n app: app ? app : parentContext && parentContext.app ? parentContext.app : null,\n // scope: parentContext ? parentContext.scope : reactive({}),\n scope: reactive({}),\n blocks: [],\n effects: [],\n slots: [],\n templates: parentContext ? parentContext.templates : [],\n effect: (handler: () => void) => {\n const e = _effect(handler);\n context.effects.push(e);\n return e;\n },\n };\n\n return context;\n}\n\nexport const createScopedContext = (ctx: Context, data = {}): Context => {\n const parentScope = ctx.scope;\n const mergedScope = Object.create(parentScope);\n Object.defineProperties(mergedScope, Object.getOwnPropertyDescriptors(data));\n let proxy: any;\n proxy = reactive(\n new Proxy(mergedScope, {\n set(target, key, val, receiver) {\n // when setting a property that doesn't exist on current scope,\n // do not create it on the current scope and fallback to parent scope.\n if (receiver === proxy && !target.hasOwnProperty(key)) {\n return Reflect.set(parentScope, key, val);\n }\n return Reflect.set(target, key, val, receiver);\n },\n }),\n );\n\n bindContextMethods(proxy);\n\n const out: Context = {\n ...ctx,\n scope: {\n ...ctx.scope,\n ...proxy,\n },\n };\n\n return out;\n};\n\nfunction bindContextMethods(scope: Record) {\n for (const key of Object.keys(scope)) {\n if (typeof scope[key] === \"function\") {\n scope[key] = scope[key].bind(scope);\n }\n }\n}\n\nfunction mergeProps(props: Record, defaultProps: Record) {\n const merged = {};\n\n Object.keys(defaultProps).forEach((defaultProp) => {\n const propValue = props.hasOwnProperty(defaultProp) ? props[defaultProp] : defaultProps[defaultProp]?.default;\n\n merged[defaultProp] = reactive(typeof propValue === \"function\" ? propValue() : propValue);\n });\n\n return merged;\n}\n\nexport interface Component {\n template: string;\n props?: Record;\n main?: (props?: Record) => Record | void;\n}\n\ninterface Current {\n componentBlock?: Block;\n}\n\nexport const current: Current = { componentBlock: undefined };\n\ninterface BlockOptions {\n element: Element;\n isRoot?: boolean;\n replacementType?: \"replace\" | \"replaceChildren\";\n componentProps?: Record;\n allProps?: Record;\n parentContext?: Context;\n component?: Component;\n parentComponentBlock?: Block;\n templates?: Template[];\n}\n\nexport class Block {\n element: Element;\n context: Context;\n parentContext: Context;\n component: Component;\n provides = new Map();\n parentComponentBlock: Block | undefined;\n componentProps: Record;\n allProps: Record;\n\n isFragment: boolean;\n start?: Text;\n end?: Text;\n key?: any;\n\n constructor(opts: BlockOptions) {\n this.isFragment = opts.element instanceof HTMLTemplateElement;\n this.parentComponentBlock = opts.parentComponentBlock;\n\n if (opts.component) {\n current.componentBlock = this;\n this.element = stringToElement(opts.component.template);\n } else {\n if (this.isFragment) {\n this.element = (opts.element as HTMLTemplateElement).content.cloneNode(true) as Element;\n } else if (typeof opts.element === \"string\") {\n this.element = stringToElement(opts.element);\n } else {\n this.element = opts.element.cloneNode(true) as Element;\n opts.element.replaceWith(this.element);\n }\n }\n\n if (opts.isRoot) {\n this.context = opts.parentContext;\n } else {\n this.parentContext = opts.parentContext ? opts.parentContext : createContext({});\n this.parentContext.blocks.push(this);\n this.context = createContext({ parentContext: opts.parentContext });\n }\n\n if (opts.component) {\n this.componentProps = mergeProps(opts.componentProps ?? {}, opts.component.props ?? {});\n\n if (opts.component.main) {\n this.context.scope = {\n ...(opts.component.main(this.componentProps) || {}),\n };\n }\n }\n\n opts.allProps?.forEach((prop) => {\n if (prop.isBind) {\n this.context.effect(() => {\n let newValue: unknown;\n\n if (prop.isSpread) {\n const spreadProps = evalGet(this.parentContext.scope, prop.extractedName);\n if (isObject(spreadProps)) {\n Object.keys(spreadProps).forEach((key) => {\n newValue = spreadProps[key];\n this.setProp(key, newValue);\n });\n }\n } else {\n newValue = prop.isMirror ? evalGet(this.parentContext.scope, prop.extractedName) : evalGet(this.parentContext.scope, prop.exp);\n this.setProp(prop.extractedName, newValue);\n }\n });\n }\n });\n\n // Capture slots\n this.context.slots = findSlotNodes(this.element);\n this.context.templates = opts.templates ?? [];\n\n // Put templates into slots\n this.context.slots.forEach((slot) => {\n const template = this.context.templates.find((t) => t.targetSlotName === slot.name);\n\n if (template) {\n const templateContents = template.node.content.cloneNode(true);\n slot.node.replaceWith(templateContents);\n }\n });\n\n this.context.scope.$isRef = isRef;\n this.context.scope.$isComputed = isComputed;\n\n walk(this.element, this.context);\n\n if (opts.component) {\n if (opts.replacementType === \"replace\") {\n if (opts.element instanceof HTMLElement) {\n opts.element.replaceWith(this.element);\n }\n } else {\n if (opts.element instanceof HTMLElement) {\n opts.element.replaceChildren(this.element);\n }\n }\n }\n }\n\n setProp(name: string, value: unknown) {\n if (isRef(this.componentProps[name])) {\n this.componentProps[name].value = value;\n } else {\n this.componentProps[name] = value;\n }\n }\n\n insert(parent: Element, anchor: Node | null = null) {\n if (this.isFragment) {\n if (this.start) {\n // Already inserted, moving\n let node: Node | null = this.start;\n let next: Node | null;\n\n while (node) {\n next = node.nextSibling;\n parent.insertBefore(node, anchor);\n\n if (node === this.end) {\n break;\n }\n\n node = next;\n }\n } else {\n this.start = new Text(\"\");\n this.end = new Text(\"\");\n\n parent.insertBefore(this.end, anchor);\n parent.insertBefore(this.start, this.end);\n parent.insertBefore(this.element, this.end);\n }\n } else {\n parent.insertBefore(this.element, anchor);\n }\n }\n\n remove() {\n if (this.parentContext) {\n const i = this.parentContext.blocks.indexOf(this);\n\n if (i > -1) {\n this.parentContext.blocks.splice(i, 1);\n }\n }\n\n if (this.start) {\n const parent = this.start.parentNode!;\n let node: Node | null = this.start;\n let next: Node | null;\n\n while (node) {\n next = node.nextSibling;\n parent.removeChild(node);\n\n if (node === this.end) {\n break;\n }\n\n node = next;\n }\n } else {\n // this.element.parentNode!.removeChild(this.element);\n this.element.remove();\n }\n\n this.teardown();\n }\n\n teardown() {\n this.context.blocks.forEach((block) => {\n block.teardown();\n });\n\n this.context.effects.forEach(stop);\n }\n}\n\nfunction isComponent(element: Element, context: Context) {\n return !!context.app.getComponent(element.tagName.toLowerCase());\n}\n\nfunction warnInvalidDirectives(node: Element, directives: string[]): boolean {\n if (directives.every((d) => node.hasAttribute(d))) {\n console.warn(`These directives cannot be used together on the same node:`, directives);\n console.warn(\"Node ignored:\", node);\n return true;\n }\n\n return false;\n}\n\nfunction walk(node: Node, context: Context) {\n if (isText(node)) {\n new InterpolationDirective({ element: node, context });\n return;\n }\n\n if (isElement(node)) {\n let exp: string | null;\n\n const handleDirectives = (node: Element, context: Context, component?: Component, componentProps?: Record, allProps?: any[]) => {\n if (warnInvalidDirectives(node, [\":if\", \":for\"])) return;\n if (warnInvalidDirectives(node, [\":if\", \":teleport\"])) return;\n if (warnInvalidDirectives(node, [\":for\", \":teleport\"])) return;\n\n // e.g.
\n // In this case, the scope is merged into context.scope and will overwrite\n // anything returned from `main`.\n if ((exp = checkAndRemoveAttribute(node, \":scope\"))) {\n const scope = evalGet(context.scope, exp);\n if (typeof scope === \"object\") {\n Object.assign(context.scope, scope);\n // context = createScopedContext(context, scope);\n }\n }\n\n if ((exp = checkAndRemoveAttribute(node, \":teleport\"))) {\n return _teleport(node, exp, context);\n }\n if ((exp = checkAndRemoveAttribute(node, \":if\"))) {\n return _if(node, exp, context, component, componentProps, allProps);\n }\n if ((exp = checkAndRemoveAttribute(node, \":for\"))) {\n return _for(node, exp, context, component, componentProps, allProps);\n }\n if ((exp = checkAndRemoveAttribute(node, \":show\"))) {\n new ShowDirective({ element: node, context, expression: exp });\n }\n if ((exp = checkAndRemoveAttribute(node, \":ref\"))) {\n context.scope[exp].value = node;\n }\n if ((exp = checkAndRemoveAttribute(node, \":value\"))) {\n new ValueDirective({ element: node, context, expression: exp });\n }\n if ((exp = checkAndRemoveAttribute(node, \":html\"))) {\n context.effect(() => {\n const result = evalGet(context.scope, exp);\n if (result instanceof Element) {\n node.replaceChildren();\n node.append(result);\n } else {\n node.innerHTML = result;\n }\n });\n }\n if ((exp = checkAndRemoveAttribute(node, \":text\"))) {\n context.effect(() => {\n node.textContent = toDisplayString(evalGet(context.scope, exp));\n });\n }\n };\n\n const processAttributes = (node: Element, component?: Component) => {\n return Array.from(node.attributes)\n .filter((attr) => isSpreadProp(attr.name) || isMirrorProp(attr.name) || (isRegularProp(attr.name) && componentHasPropByName(extractPropName(attr.name), component)))\n .map((attr) => ({\n isMirror: isMirrorProp(attr.name),\n isSpread: isSpreadProp(attr.name),\n isBind: attr.name.includes(\"bind\"),\n originalName: attr.name,\n extractedName: extractPropName(attr.name),\n exp: attr.value,\n value: isMirrorProp(attr.name) ? evalGet(context.scope, extractPropName(attr.name)) : attr.value ? evalGet(context.scope, attr.value) : undefined,\n }));\n };\n\n if (isComponent(node, context)) {\n const component = context.app.getComponent(node.tagName.toLowerCase());\n const allProps = processAttributes(node, component);\n\n const componentProps = allProps.reduce((acc, { isSpread, isMirror, extractedName, value }) => {\n if (isSpread) {\n const spread = evalGet(context.scope, extractedName);\n if (isObject(spread)) Object.assign(acc, spread);\n } else if (isMirror) {\n acc[extractedName] = evalGet(context.scope, extractedName);\n } else {\n acc[extractedName] = value;\n }\n return acc;\n }, {});\n\n const next = handleDirectives(node, context, component, componentProps, allProps);\n if (next) return next;\n\n const templates = findTemplateNodes(node);\n\n return new Block({\n element: node,\n parentContext: context,\n component,\n replacementType: \"replace\",\n parentComponentBlock: current.componentBlock,\n templates,\n componentProps,\n allProps,\n }).element;\n }\n\n const next = handleDirectives(node, context);\n if (next) return next;\n\n Array.from(node.attributes).forEach((attr) => {\n if (isPropAttribute(attr.name)) {\n new AttributeDirective({ element: node, context, attr });\n }\n\n if (isEventAttribute(attr.name)) {\n new EventDirective({ element: node, context, attr });\n }\n });\n\n walkChildren(node, context);\n }\n}\n\nfunction walkChildren(node: Node, context: Context) {\n let child = node.firstChild;\n\n while (child) {\n child = walk(child, context) || child.nextSibling;\n }\n}\n\nconst evalFuncCache: Record = {};\n\nexport function evalGet(scope: any, exp: string, el?: Node) {\n if (!exp.trim()) return undefined;\n return execute(scope, `const ___value = (${exp.trim()}); return ___value;`, el);\n}\n\nexport function evalSet(scope: any, exp: string, value: unknown) {\n value = typeof value === \"string\" ? `\"${value}\"` : value;\n return execute(scope, `const ___target = (${exp.trim()}); return $isRef(___target) ? ___target.value = ${value} : ___target = ${value};`, null, false);\n}\n\nfunction execute(scope: any, exp: string, el?: Node, flatRefs = true) {\n const newScope = flatRefs ? flattenRefs(scope) : scope;\n const fn = evalFuncCache[exp] || (evalFuncCache[exp] = toFunction(exp));\n\n try {\n return fn(newScope, el);\n } catch (e) {\n console.warn(`Error evaluating expression: \"${exp}\":`);\n console.error(e);\n }\n}\n\n// Function to convert expression strings to functions\nfunction toFunction(exp: string) {\n try {\n return new Function(\"$data\", \"$el\", `with($data){${exp}}`);\n } catch (e) {\n console.error(`${(e as Error).message} in expression: ${exp}`);\n return () => {};\n }\n}\n\n// Map all ref properties in scope to their `.value`\nfunction flattenRefs(scope: any): any {\n const mapped = {};\n\n for (const key in scope) {\n if (scope.hasOwnProperty(key)) {\n // Check if the value is a Ref\n if (isRef(scope[key])) {\n mapped[key] = scope[key].value;\n } else {\n mapped[key] = scope[key];\n }\n }\n }\n return mapped;\n}\n\n// ------------------------------------------------\n// Slots, multiple default and named, :if and :for\n// const card = {\n// template: html`\n//
\n// \n// `,\n// };\n\n// const main = {\n// template: html`\n// \n//
card below \n// \n// card title\n// Card body content \n// \n// \n// `,\n// };\n\n// const app = new App();\n// app.register(\"card\", card);\n// app.mount(main, \"#app\");\n\n// ------------------------------------------------\n// Slots, multiple default and named, :if and :for\n// const app = new App();\n\n// const parent = {\n// template: html`\n// \n//
parent \n//
\n// \n// \n// content 1 always shown\n// \n// content 2, animals:\n//
animal: {{animal}}
\n//
\n\n// \n// card body from parent \n// \n//
\n// `,\n// main() {\n// const bool = ref(true);\n// const animals = reactive([\"dog\", \"cat\", \"bear\"]);\n\n// setInterval(() => {\n// bool.value = !bool.value;\n// }, 2000);\n\n// return { bool, animals };\n// },\n// };\n// const card = {\n// template: html`\n//
card \n// \n// \n// `,\n// };\n// app.register(\"card\", card);\n// const parentBlock = app.mount(parent, \"body\");\n// const cardBlock = parentBlock.context.blocks[0];\n\n// ------------------------------------------------\n// Component pros, mirror and spread, bind and no bind\n// const child = {\n// template: html`Animal: {{animal}} {{index}}
`,\n// props: { animal: { default: \"cat\" }, index: { default: 0 } },\n// main({ animal, index }) {\n// return { animal, index };\n// },\n// };\n\n// const parent = {\n// template: html`\n// \n//
\n// mirror, no bind:\n//
\n//
\n// mirror, bind:\n//
\n//
\n// spread, no bind:\n//
\n//
\n// spread, bind:\n//
\n//
\n// regular prop:\n//
\n//
\n// regular prop, bind:\n//
\n//
\n//
div has \"id\" set to animal.value
\n//
\n//
div has \"id\" set and bound to animal.value
\n//
\n//
div has \"animal\" set to animal.value
\n//
\n//
div has \"animal\" set and bound to animal.value
\n//
\n//
div has \"animal\" spread
\n//
\n//
div has \"animal\" spread and bound
\n//
\n//
\n//
\n//
\n// if bool, mirror, no bind:\n//
\n// if bool, mirror, bind:\n//
\n//
\n// for list, mirror, no bind:\n//
\n//
\n// for list, mirror, bind:\n//
\n// if bool, for list, mirror, no bind: these have the value \"DOG!\" because by the time for :for directive is evaluated, animal.value is \"DOG!\", and no longer \"dog\".\n//
\n// \n//
\n//
\n// `,\n// main() {\n// const bool = ref(false);\n// const animal = ref(\"dog\");\n// const spread = reactive({ animal: \"panther\" });\n// const list = reactive([1, 2, 3]);\n\n// setTimeout(() => {\n// spread.animal = \"PANTHER!\";\n// animal.value = \"DOG!\";\n// bool.value = true;\n// }, 500);\n\n// setTimeout(() => {\n// animal.value = \"DOG!!!!!\";\n// }, 1000);\n\n// return { animal, spread, bool, list };\n// },\n// };\n\n// const app = new App();\n// app.register(\"child\", child);\n// app.mount(parent, \"#app\");\n\n// ------------------------------------------------\n// Event directive\n// const counter = {\n// template: html`\n// \n//
true
\n//
Count: {{count}}{{count >= 2 ? '!!!' : ''}} \n//
+ \n//
- \n//
\n// `,\n// main() {\n// const count = ref(0);\n// const style = reactive({ color: \"gray\" });\n// const increment = () => count.value++;\n// const decrement = () => count.value--;\n\n// setInterval(() => {\n// style.color = style.color === \"gray\" ? \"white\" : \"gray\";\n// }, 500);\n\n// return { count, increment, decrement, style };\n// },\n// };\n\n// const app = new App();\n// app.mount(counter, \"#app\");\n\n// ------------------------------------------------\n// Template\n// const main = {\n// template: html`\n// \n// `,\n// main() {\n// const items = reactive([1, 2, 3, 4, 5]);\n// const bool = ref(true);\n// setInterval(() => (bool.value = !bool.value), 250);\n// return { items, bool };\n// },\n// };\n\n// const app = new App();\n// app.mount(main, \"#app\");\n\n// ------------------------------------------------\n// :html\n// const main = {\n// template: html`
`,\n// main() {\n// const html = ref(\"hello \");\n\n// setTimeout(() => {\n// if (html.value === \"hello \") {\n// html.value = \"world \";\n// }\n// }, 1000);\n\n// return { html };\n// },\n// };\n\n// const app = new App();\n// app.mount(main, \"#app\");\n\n// ------------------------------------------------\n// Colors from css framework\n// const main = {\n// template: html`\n// \n//
Colors \n//
\n// \n//
\n//
{{variant}}-{{rank}}
\n//
\n//
\n// \n//
\n// `,\n// main() {\n// const ranks = reactive([\"5\", \"10\", \"20\", \"30\", \"40\", \"50\", \"60\", \"70\", \"80\", \"90\"]);\n// const basesReverse = computed(() => Array.from(ranks).reverse());\n// const bg = (variant: string, rank: string, index: number) => ({ backgroundColor: `var(--${variant}-${rank})`, color: `var(--${variant}-${basesReverse.value[index]})` });\n\n// return { ranks, bg };\n// },\n// };\n\n// const app = new App();\n// app.mount(main, \"#app\");\n\n// ------------------------------------------------\n// :scope\nconst child = {\n template: html`\n \n hello from child, food: \"{{food}}\" (does not inherit)\n
\n \n
\n
\n `,\n // main() {\n // const food = ref(\"\uD83C\uDF54\");\n // return { food };\n // }\n};\n\nconst main = {\n template: html`\n \n
\n \n
Scoped data: {{food}}
\n
Child slot, food: {{food}} \n
No pizza \uD83D\uDE22
\n
Pizza!
\n
\n
\n `,\n main() {\n return { food: ref(\"nothing\") };\n },\n};\n\nconst app = new App();\napp.register(\"child\", child);\napp.mount(main, \"#app\");\n"],
+ "mappings": ";AAEO,SAAS,gBAAgB,UAA2B;AACzD,QAAM,SAAS,IAAI,UAAU;AAC7B,QAAM,MAAM,OAAO,gBAAgB,UAAU,WAAW;AACxD,SAAO,IAAI,KAAK;AAClB;AAEO,IAAM,SAAS,CAAC,SAA6B;AAClD,SAAO,KAAK,aAAa,KAAK;AAChC;AAEO,IAAM,aAAa,CAAC,SAA4C;AACrE,SAAO,KAAK,aAAa;AAC3B;AAEO,IAAM,YAAY,CAAC,SAAgC;AACxD,SAAO,KAAK,aAAa,KAAK;AAChC;AAEO,SAAS,SAAS,OAA6B;AACpD,SAAO,UAAU,QAAQ,OAAO,UAAU;AAC5C;AAEO,SAAS,QAAQ,OAA4B;AAClD,SAAO,MAAM,QAAQ,KAAK;AAC5B;AAEO,SAAS,wBAAwB,IAAa,UAAiC;AAEpF,QAAM,iBAAiB,GAAG,aAAa,QAAQ;AAG/C,MAAI,mBAAmB,MAAM;AAC3B,OAAG,gBAAgB,QAAQ;AAAA,EAC7B;AAGA,SAAO;AACT;AAYO,SAAS,cAAc,SAA0B;AACtD,QAAM,QAAgB,CAAC;AAEvB,QAAM,YAAY,CAAC,SAAkB;AACnC,UAAM,KAAK,KAAK,UAAU,EAAE,QAAQ,CAACA,UAAS;AAC5C,UAAI,UAAUA,KAAI,GAAG;AACnB,YAAIA,MAAK,aAAa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,EAChB;AACF;AAGA,SAAS,YAAY,OAAiB;AACpC,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,OAAO;AACvB,QAAI,MAAM,eAAe,GAAG,GAAG;AAE7B,UAAI,MAAM,MAAM,GAAG,CAAC,GAAG;AACrB,eAAO,GAAG,IAAI,MAAM,GAAG,EAAE;AAAA,MAC3B,OAAO;AACL,eAAO,GAAG,IAAI,MAAM,GAAG;AAAA,MACzB;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAsQA,IAAM,QAAQ;AAAA,EACZ,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYZ;AAEA,IAAM,OAAO;AAAA,EACX,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWV,OAAO;AACL,WAAO,EAAE,MAAM,IAAI,SAAS,EAAE;AAAA,EAChC;AACF;AAEA,IAAM,MAAM,IAAI,IAAI;AACpB,IAAI,SAAS,SAAS,KAAK;AAC3B,IAAI,MAAM,MAAM,MAAM;",
+ "names": ["node", "element", "_", "ctx", "ref", "i", "exp", "el", "effect", "stop", "ref", "value", "app", "node", "context", "next", "child"]
}
diff --git a/src/demo.ts b/src/demo.ts
new file mode 100644
index 0000000..d575e30
--- /dev/null
+++ b/src/demo.ts
@@ -0,0 +1,299 @@
+import { App } from ".";
+import { ref } from "./reactivity/ref";
+import { html } from "./util";
+
+// ------------------------------------------------
+// Slots, multiple default and named, :if and :for
+// const card = {
+// template: html`
+//
+//
+// `,
+// };
+
+// const main = {
+// template: html`
+//
+//
card below
+//
+// card title
+// Card body content
+//
+//
+// `,
+// };
+
+// const app = new App();
+// app.register("card", card);
+// app.mount(main, "#app");
+
+// ------------------------------------------------
+// Slots, multiple default and named, :if and :for
+// const app = new App();
+
+// const parent = {
+// template: html`
+//
+//
parent
+//
+//
+//
+// content 1 always shown
+//
+// content 2, animals:
+//
animal: {{animal}}
+//
+
+//
+// card body from parent
+//
+//
+// `,
+// main() {
+// const bool = ref(true);
+// const animals = reactive(["dog", "cat", "bear"]);
+
+// setInterval(() => {
+// bool.value = !bool.value;
+// }, 2000);
+
+// return { bool, animals };
+// },
+// };
+// const card = {
+// template: html`
+//
card
+//
+//
+// `,
+// };
+// app.register("card", card);
+// const parentBlock = app.mount(parent, "body");
+// const cardBlock = parentBlock.context.blocks[0];
+
+// ------------------------------------------------
+// Component pros, mirror and spread, bind and no bind
+// const child = {
+// template: html`Animal: {{animal}} {{index}}
`,
+// props: { animal: { default: "cat" }, index: { default: 0 } },
+// main({ animal, index }) {
+// return { animal, index };
+// },
+// };
+
+// const parent = {
+// template: html`
+//
+//
+// mirror, no bind:
+//
+//
+// mirror, bind:
+//
+//
+// spread, no bind:
+//
+//
+// spread, bind:
+//
+//
+// regular prop:
+//
+//
+// regular prop, bind:
+//
+//
+//
div has "id" set to animal.value
+//
+//
div has "id" set and bound to animal.value
+//
+//
div has "animal" set to animal.value
+//
+//
div has "animal" set and bound to animal.value
+//
+//
div has "animal" spread
+//
+//
div has "animal" spread and bound
+//
+//
+//
+//
+// if bool, mirror, no bind:
+//
+// if bool, mirror, bind:
+//
+//
+// for list, mirror, no bind:
+//
+//
+// for list, mirror, bind:
+//
+// if bool, for list, mirror, no bind: these have the value "DOG!" because by the time for :for directive is evaluated, animal.value is "DOG!", and no longer "dog".
+//
+//
+//
+//
+// `,
+// main() {
+// const bool = ref(false);
+// const animal = ref("dog");
+// const spread = reactive({ animal: "panther" });
+// const list = reactive([1, 2, 3]);
+
+// setTimeout(() => {
+// spread.animal = "PANTHER!";
+// animal.value = "DOG!";
+// bool.value = true;
+// }, 500);
+
+// setTimeout(() => {
+// animal.value = "DOG!!!!!";
+// }, 1000);
+
+// return { animal, spread, bool, list };
+// },
+// };
+
+// const app = new App();
+// app.register("child", child);
+// app.mount(parent, "#app");
+
+// ------------------------------------------------
+// Event directive
+// const counter = {
+// template: html`
+//
+//
true
+//
Count: {{count}}{{count >= 2 ? '!!!' : ''}}
+//
+
+//
-
+//
+// `,
+// main() {
+// const count = ref(0);
+// const style = reactive({ color: "gray" });
+// const increment = () => count.value++;
+// const decrement = () => count.value--;
+
+// setInterval(() => {
+// style.color = style.color === "gray" ? "white" : "gray";
+// }, 500);
+
+// return { count, increment, decrement, style };
+// },
+// };
+
+// const app = new App();
+// app.mount(counter, "#app");
+
+// ------------------------------------------------
+// Template
+// const main = {
+// template: html`
+//
+// `,
+// main() {
+// const items = reactive([1, 2, 3, 4, 5]);
+// const bool = ref(true);
+// setInterval(() => (bool.value = !bool.value), 250);
+// return { items, bool };
+// },
+// };
+
+// const app = new App();
+// app.mount(main, "#app");
+
+// ------------------------------------------------
+// :html
+// const main = {
+// template: html`
`,
+// main() {
+// const html = ref("hello ");
+
+// setTimeout(() => {
+// if (html.value === "hello ") {
+// html.value = "world ";
+// }
+// }, 1000);
+
+// return { html };
+// },
+// };
+
+// const app = new App();
+// app.mount(main, "#app");
+
+// ------------------------------------------------
+// Colors from css framework
+// const main = {
+// template: html`
+//
+//
Colors
+//
+//
+//
+//
{{variant}}-{{rank}}
+//
+//
+//
+//
+// `,
+// main() {
+// const ranks = reactive(["5", "10", "20", "30", "40", "50", "60", "70", "80", "90"]);
+// const basesReverse = computed(() => Array.from(ranks).reverse());
+// const bg = (variant: string, rank: string, index: number) => ({ backgroundColor: `var(--${variant}-${rank})`, color: `var(--${variant}-${basesReverse.value[index]})` });
+
+// return { ranks, bg };
+// },
+// };
+
+// const app = new App();
+// app.mount(main, "#app");
+
+// ------------------------------------------------
+// :scope
+const child = {
+ template: html`
+
+ hello from child, food: "{{food}}" (does not inherit)
+
+
+
+
+ `,
+ main() {
+ const food = ref("🍔");
+ return { food };
+ },
+};
+
+const main = {
+ template: html`
+
+
+
+
Scoped data: {{food}}
+
Child slot, food: {{food}}
+
No pizza 😢
+
Pizza!
+
+
+ `,
+ main() {
+ return { food: ref("nothing") };
+ },
+};
+
+const app = new App();
+app.register("child", child);
+app.mount(main, "#app");
diff --git a/src/directives/attribute.ts b/src/directives/attribute.ts
index ea7abdf..752c3ca 100644
--- a/src/directives/attribute.ts
+++ b/src/directives/attribute.ts
@@ -88,6 +88,7 @@ export class AttributeDirective {
this.element.classList.remove(c);
});
} else if (typeof value === "object" && this.extractedAttributeName === "style") {
+ console.log("value is object", value)
const next = Object.keys(value);
const rm = Object.keys(this.previousStyles).filter((style) => !next.includes(style));
diff --git a/src/index.ts b/src/index.ts
index b477ea4..f9536b9 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -10,26 +10,11 @@ import { Plugin } from "./plugins";
import { isComputed } from "./reactivity/computed";
import { effect as _effect } from "./reactivity/effect";
import { reactive } from "./reactivity/reactive";
-import { isRef, ref } from "./reactivity/ref";
-import {
- checkAndRemoveAttribute,
- componentHasPropByName,
- extractPropName,
- findSlotNodes,
- findTemplateNodes,
- html,
- isElement,
- isEventAttribute,
- isMirrorProp,
- isObject,
- isPropAttribute,
- isRegularProp,
- isSpreadProp,
- isText,
- Slot,
- stringToElement,
- Template,
-} from "./util";
+import { isRef } from "./reactivity/ref";
+import { checkAndRemoveAttribute, componentHasPropByName, extractPropName, findSlotNodes, findTemplateNodes, isElement, isEventAttribute, isMirrorProp, isObject, isPropAttribute, isRegularProp, isSpreadProp, isText, Slot, stringToElement, Template, toDisplayString } from "./util";
+
+export * from "./plugins";
+export * from "./plugins/router";
export function provide(key: string, value: unknown) {
if (!current.componentBlock) {
@@ -131,7 +116,8 @@ interface CreateContextOptions {
export function createContext({ parentContext, app }: CreateContextOptions): Context {
const context: Context = {
app: app ? app : parentContext && parentContext.app ? parentContext.app : null,
- scope: parentContext ? parentContext.scope : reactive({}),
+ // scope: parentContext ? parentContext.scope : reactive({}),
+ scope: reactive({}),
blocks: [],
effects: [],
slots: [],
@@ -408,6 +394,16 @@ function isComponent(element: Element, context: Context) {
return !!context.app.getComponent(element.tagName.toLowerCase());
}
+function warnInvalidDirectives(node: Element, directives: string[]): boolean {
+ if (directives.every((d) => node.hasAttribute(d))) {
+ console.warn(`These directives cannot be used together on the same node:`, directives);
+ console.warn("Node ignored:", node);
+ return true;
+ }
+
+ return false;
+}
+
function walk(node: Node, context: Context) {
if (isText(node)) {
new InterpolationDirective({ element: node, context });
@@ -418,6 +414,21 @@ function walk(node: Node, context: Context) {
let exp: string | null;
const handleDirectives = (node: Element, context: Context, component?: Component, componentProps?: Record, allProps?: any[]) => {
+ if (warnInvalidDirectives(node, [":if", ":for"])) return;
+ if (warnInvalidDirectives(node, [":if", ":teleport"])) return;
+ if (warnInvalidDirectives(node, [":for", ":teleport"])) return;
+
+ // e.g.
+ // In this case, the scope is merged into context.scope and will overwrite
+ // anything returned from `main`.
+ if ((exp = checkAndRemoveAttribute(node, ":scope"))) {
+ const scope = evalGet(context.scope, exp);
+ if (typeof scope === "object") {
+ Object.assign(context.scope, scope);
+ // context = createScopedContext(context, scope);
+ }
+ }
+
if ((exp = checkAndRemoveAttribute(node, ":teleport"))) {
return _teleport(node, exp, context);
}
@@ -447,6 +458,11 @@ function walk(node: Node, context: Context) {
}
});
}
+ if ((exp = checkAndRemoveAttribute(node, ":text"))) {
+ context.effect(() => {
+ node.textContent = toDisplayString(evalGet(context.scope, exp));
+ });
+ }
};
const processAttributes = (node: Element, component?: Component) => {
@@ -571,233 +587,3 @@ function flattenRefs(scope: any): any {
}
return mapped;
}
-
-// ------------------------------------------------
-// Slots, multiple default and named, :if and :for
-// const card = {
-// template: html`
-//
-//
-// `,
-// };
-
-// const main = {
-// template: html`
-//
-//
card below
-//
-// card title
-// Card body content
-//
-//
-// `,
-// };
-
-// const app = new App();
-// app.register("card", card);
-// app.mount(main, "#app");
-
-// ------------------------------------------------
-// Slots, multiple default and named, :if and :for
-// const app = new App();
-
-// const parent = {
-// template: html`
-//
-//
parent
-//
-//
-//
-// content 1 always shown
-//
-// content 2, animals:
-//
animal: {{animal}}
-//
-
-//
-// card body from parent
-//
-//
-// `,
-// main() {
-// const bool = ref(true);
-// const animals = reactive(["dog", "cat", "bear"]);
-
-// setInterval(() => {
-// bool.value = !bool.value;
-// }, 2000);
-
-// return { bool, animals };
-// },
-// };
-// const card = {
-// template: html`
-//
card
-//
-//
-// `,
-// };
-// app.register("card", card);
-// const parentBlock = app.mount(parent, "body");
-// const cardBlock = parentBlock.context.blocks[0];
-
-// ------------------------------------------------
-// Component pros, mirror and spread, bind and no bind
-const child = {
- template: html`Animal: {{animal}} {{index}}
`,
- props: { animal: { default: "cat" }, index: { default: 0 } },
- main({ animal, index }) {
- return { animal, index };
- },
-};
-
-const parent = {
- template: html`
-
- mirror, no bind:
-
-
- mirror, bind:
-
-
- spread, no bind:
-
-
- spread, bind:
-
-
- regular prop:
-
-
- regular prop, bind:
-
-
-
div has "id" set to animal.value
-
-
div has "id" set and bound to animal.value
-
-
div has "animal" set to animal.value
-
-
div has "animal" set and bound to animal.value
-
-
div has "animal" spread
-
-
div has "animal" spread and bound
-
-
-
-
- if bool, mirror, no bind:
-
- if bool, mirror, bind:
-
-
- for list, mirror, no bind:
-
-
- for list, mirror, bind:
-
- if bool, for list, mirror, no bind: these have the value "DOG!" because by the time for :for directive is evaluated, animal.value is "DOG!", and no longer "dog".
-
-
-
-
- `,
- main() {
- const bool = ref(false);
- const animal = ref("dog");
- const spread = reactive({ animal: "panther" });
- const list = reactive([1, 2, 3]);
-
- setTimeout(() => {
- spread.animal = "PANTHER!";
- animal.value = "DOG!";
- bool.value = true;
- }, 500);
-
- setTimeout(() => {
- animal.value = "DOG!!!!!";
- }, 1000);
-
- return { animal, spread, bool, list };
- },
-};
-
-const app = new App();
-app.register("child", child);
-app.mount(parent, "#app");
-
-// ------------------------------------------------
-// Event directive
-// const counter = {
-// template: html`
-//
-//
true
-//
Count: {{count}}{{count >= 2 ? '!!!' : ''}}
-//
+
-//
-
-//
-// `,
-// main() {
-// const count = ref(0);
-// const style = reactive({ color: "gray" });
-// const increment = () => count.value++;
-// const decrement = () => count.value--;
-
-// setInterval(() => {
-// style.color = style.color === "gray" ? "white" : "gray";
-// }, 500);
-
-// return { count, increment, decrement, style };
-// },
-// };
-
-// const app = new App();
-// app.mount(counter, "#app");
-
-// ------------------------------------------------
-// Template
-// const main = {
-// template: html`
-//
-// `,
-// main() {
-// const items = reactive([1, 2, 3, 4, 5]);
-// const bool = ref(true);
-// setInterval(() => (bool.value = !bool.value), 250);
-// return { items, bool };
-// },
-// };
-
-// const app = new App();
-// app.mount(main, "#app");
-
-// ------------------------------------------------
-// :html
-// const main = {
-// template: html`
`,
-// main() {
-// const html = ref("hello ");
-
-// setTimeout(() => {
-// if (html.value === "hello ") {
-// html.value = "world ";
-// }
-// }, 1000);
-
-// return { html };
-// },
-// };
-
-// const app = new App();
-// app.mount(main, "#app");
diff --git a/src/plugins/router/index.ts b/src/plugins/router/index.ts
index 105169b..4c4aade 100644
--- a/src/plugins/router/index.ts
+++ b/src/plugins/router/index.ts
@@ -23,3 +23,5 @@ export type RouteMatch = {
match: RouteExpression;
parents: Route[];
};
+
+export { RouterPlugin } from "./plugin";