{"version":3,"sources":["../src/index.js","../src/store.js","../src/DLNode.js","../src/HTMLNode.js","../src/CompNode.js","../src/EnvNode.js","../src/TextNode.js","../src/PropView.js","../src/SnippetNode.js","../src/MutableNode/MutableNode.js","../src/MutableNode/ForNode.js","../src/MutableNode/FlatNode.js","../src/MutableNode/ExpNode.js","../src/MutableNode/CondNode.js","../src/MutableNode/TryNode.js"],"sourcesContent":["import { DLNode } from \"./DLNode\"\nimport { insertNode } from \"./HTMLNode\"\n\nexport * from \"./HTMLNode\"\nexport * from \"./CompNode\"\nexport * from \"./EnvNode\"\nexport * from \"./TextNode\"\nexport * from \"./PropView\"\nexport * from \"./SnippetNode\"\nexport * from \"./MutableNode/ForNode\"\nexport * from \"./MutableNode/ExpNode\"\nexport * from \"./MutableNode/CondNode\"\nexport * from \"./MutableNode/TryNode\"\n\nimport { DLStore } from \"./store\"\nexport { setGlobal, setDocument } from \"./store\"\n\nfunction initStore() {\n  // Declare a global variable to store willUnmount functions\n  DLStore.global.WillUnmountStore = []\n  // Declare a global variable to store didUnmount functions\n  DLStore.global.DidUnmountStore = []\n}\n\nexport function render(idOrEl, DL) {\n  let el = idOrEl\n  if (typeof idOrEl === \"string\") {\n    const elFound = DLStore.document.getElementById(idOrEl)\n    if (elFound) el = elFound\n    else {\n      throw new Error(`DLight: Element with id ${idOrEl} not found`)\n    }\n  }\n  initStore()\n  el.innerHTML = \"\"\n  const dlNode = new DL()\n  dlNode._$init()\n  insertNode(el, dlNode, 0)\n  DLNode.runDidMount()\n}\n\nexport function manual(callback, _deps) {\n  return callback()\n}\nexport function escape(arg) {\n  return arg\n}\n\nexport const $ = escape\nexport const required = null\n\nexport function use() {\n  console.error(\n    \"DLight: use() is not supported be called directly. You can only assign `use(model)` to a dlight class property. Any other expressions are not allowed.\"\n  )\n}\n","import { Store } from \"@dlightjs/store\"\n\n// ---- Using external Store to store global and document\n//      Because Store is a singleton, it is safe to use it as a global variable\n//      If created in DLight package, different package versions will introduce\n//      multiple Store instances.\n\nif (!(\"global\" in Store)) {\n  if (typeof window !== \"undefined\") {\n    Store.global = window\n  } else if (typeof global !== \"undefined\") {\n    Store.global = global\n  } else {\n    Store.global = {}\n  }\n}\nif (!(\"document\" in Store)) {\n  if (typeof document !== \"undefined\") {\n    Store.document = document\n  }\n}\n\nexport const DLStore = { ...Store, delegatedEvents: new Set() }\n\nexport function setGlobal(globalObj) {\n  DLStore.global = globalObj\n}\n\nexport function setDocument(customDocument) {\n  DLStore.document = customDocument\n}\n\n/**\n * @brief Compare the deps with the previous deps\n * @param deps\n * @param prevDeps\n * @returns\n */\nexport function cached(deps, prevDeps) {\n  if (!prevDeps || deps.length !== prevDeps.length) return false\n  return deps.every((dep, i) => !(dep instanceof Object) && prevDeps[i] === dep)\n}\n","import { DLStore } from \"./store\"\n\nexport const DLNodeType = {\n  Comp: 0,\n  For: 1,\n  Cond: 2,\n  Env: 3,\n  Exp: 4,\n  Snippet: 5,\n  Try: 6,\n}\n\nexport class DLNode {\n  /**\n   * @brief Node type: HTML, Text, Custom, For, If, Env, Expression\n   */\n  _$dlNodeType\n\n  /**\n   * @brief Constructor\n   * @param nodeType\n   */\n  constructor(nodeType) {\n    this._$dlNodeType = nodeType\n  }\n\n  /**\n   * @brief Node element\n   *  Either one real element for HTMLNode and TextNode\n   *  Or an array of DLNode for CustomNode, ForNode, IfNode, EnvNode, ExpNode\n   */\n  get _$el() {\n    return DLNode.toEls(this._$nodes)\n  }\n\n  /**\n   * @brief Loop all child DLNodes to get all the child elements\n   * @param nodes\n   * @returns HTMLElement[]\n   */\n  static toEls(nodes) {\n    const els = []\n    this.loopShallowEls(nodes, el => {\n      els.push(el)\n    })\n    return els\n  }\n\n  // ---- Loop nodes ----\n  /**\n   * @brief Loop all elements shallowly,\n   *  i.e., don't loop the child nodes of dom elements and only call runFunc on dom elements\n   * @param nodes\n   * @param runFunc\n   */\n  static loopShallowEls(nodes, runFunc) {\n    const stack = [...nodes].reverse()\n    while (stack.length > 0) {\n      const node = stack.pop()\n      if (!(\"_$dlNodeType\" in node)) runFunc(node)\n      else node._$nodes && stack.push(...[...node._$nodes].reverse())\n    }\n  }\n\n  /**\n   * @brief Add parentEl to all nodes until the first element\n   * @param nodes\n   * @param parentEl\n   */\n  static addParentEl(nodes, parentEl) {\n    nodes.forEach(node => {\n      if (\"_$dlNodeType\" in node) {\n        node._$parentEl = parentEl\n        node._$nodes && DLNode.addParentEl(node._$nodes, parentEl)\n      }\n    })\n  }\n\n  // ---- Flow index and add child elements ----\n  /**\n   * @brief Get the total count of dom elements before the stop node\n   * @param nodes\n   * @param stopNode\n   * @returns total count of dom elements\n   */\n  static getFlowIndexFromNodes(nodes, stopNode) {\n    let index = 0\n    const stack = [...nodes].reverse()\n    while (stack.length > 0) {\n      const node = stack.pop()\n      if (node === stopNode) break\n      if (\"_$dlNodeType\" in node) {\n        node._$nodes && stack.push(...[...node._$nodes].reverse())\n      } else {\n        index++\n      }\n    }\n    return index\n  }\n\n  /**\n   * @brief Given an array of nodes, append them to the parentEl\n   *  1. If nextSibling is provided, insert the nodes before the nextSibling\n   *  2. If nextSibling is not provided, append the nodes to the parentEl\n   * @param nodes\n   * @param parentEl\n   * @param nextSibling\n   * @returns Added element count\n   */\n  static appendNodesWithSibling(nodes, parentEl, nextSibling) {\n    if (nextSibling) return this.insertNodesBefore(nodes, parentEl, nextSibling)\n    return this.appendNodes(nodes, parentEl)\n  }\n\n  /**\n   * @brief Given an array of nodes, append them to the parentEl using the index\n   *  1. If the index is the same as the length of the parentEl.childNodes, append the nodes to the parentEl\n   *  2. If the index is not the same as the length of the parentEl.childNodes, insert the nodes before the node at the index\n   * @param nodes\n   * @param parentEl\n   * @param index\n   * @param length\n   * @returns Added element count\n   */\n  static appendNodesWithIndex(nodes, parentEl, index, length) {\n    length = length ?? parentEl.childNodes.length\n    if (length !== index)\n      return this.insertNodesBefore(nodes, parentEl, parentEl.childNodes[index])\n    return this.appendNodes(nodes, parentEl)\n  }\n\n  /**\n   * @brief Insert nodes before the nextSibling\n   * @param nodes\n   * @param parentEl\n   * @param nextSibling\n   * @returns Added element count\n   */\n  static insertNodesBefore(nodes, parentEl, nextSibling) {\n    let count = 0\n    this.loopShallowEls(nodes, el => {\n      parentEl.insertBefore(el, nextSibling)\n      count++\n    })\n    return count\n  }\n\n  /**\n   * @brief Append nodes to the parentEl\n   * @param nodes\n   * @param parentEl\n   * @returns Added element count\n   */\n  static appendNodes(nodes, parentEl) {\n    let count = 0\n    this.loopShallowEls(nodes, el => {\n      parentEl.appendChild(el)\n      count++\n    })\n    return count\n  }\n\n  // ---- Lifecycle ----\n  /**\n   * @brief Add willUnmount function to node\n   * @param node\n   * @param func\n   */\n  static addWillUnmount(node, func) {\n    const willUnmountStore = DLStore.global.WillUnmountStore\n    const currentStore = willUnmountStore[willUnmountStore.length - 1]\n    // ---- If the current store is empty, it means this node is not mutable\n    if (!currentStore) return\n    currentStore.push(func.bind(null, node))\n  }\n\n  /**\n   * @brief Add didUnmount function to node\n   * @param node\n   * @param func\n   */\n  static addDidUnmount(node, func) {\n    const didUnmountStore = DLStore.global.DidUnmountStore\n    const currentStore = didUnmountStore[didUnmountStore.length - 1]\n    // ---- If the current store is empty, it means this node is not mutable\n    if (!currentStore) return\n    currentStore.push(func.bind(null, node))\n  }\n\n  /**\n   * @brief Add didUnmount function to global store\n   * @param func\n   */\n  static addDidMount(node, func) {\n    if (!DLStore.global.DidMountStore) DLStore.global.DidMountStore = []\n    DLStore.global.DidMountStore.push(func.bind(null, node))\n  }\n\n  /**\n   * @brief Run all didMount functions and reset the global store\n   */\n  static runDidMount() {\n    const didMountStore = DLStore.global.DidMountStore\n    if (!didMountStore || didMountStore.length === 0) return\n    for (let i = didMountStore.length - 1; i >= 0; i--) {\n      didMountStore[i]()\n    }\n    DLStore.global.DidMountStore = []\n  }\n}\n","import { DLNode } from \"./DLNode\"\nimport { DLStore, cached } from \"./store\"\n\nfunction cache(el, key, deps) {\n  if (deps.length === 0) return false\n  const cacheKey = `$${key}`\n  if (cached(deps, el[cacheKey])) return true\n  el[cacheKey] = deps\n  return false\n}\n\n/**\n * @brief Plainly set style\n * @param el\n * @param value\n */\nexport function setStyle(el, value) {\n  Object.entries(value).forEach(([key, value]) => {\n    if (key.startsWith(\"--\")) {\n      el.style.setProperty(key, value)\n    } else {\n      el.style[key] = value\n    }\n  })\n}\n\n/**\n * @brief Plainly set dataset\n * @param el\n * @param value\n */\nexport function setDataset(el, value) {\n  Object.assign(el.dataset, value)\n}\n\n/**\n * @brief Set HTML property with checking value equality first\n * @param el\n * @param key\n * @param value\n */\nexport function setHTMLProp(el, key, valueFunc, deps) {\n  // ---- Comparing deps, same value won't trigger\n  //      will lead to a bug if the value is set outside of the DLNode\n  //      e.g. setHTMLProp(el, \"textContent\", \"value\", [])\n  //       =>  el.textContent = \"other\"\n  //       =>  setHTMLProp(el, \"textContent\", \"value\", [])\n  //       The value will be set to \"other\" instead of \"value\"\n  if (cache(el, key, deps)) return\n  el[key] = valueFunc()\n}\n\n/**\n * @brief Plainly set HTML properties\n * @param el\n * @param value\n */\nexport function setHTMLProps(el, value) {\n  Object.entries(value).forEach(([key, v]) => {\n    if (key === \"style\") return setStyle(el, v)\n    if (key === \"dataset\") return setDataset(el, v)\n    setHTMLProp(el, key, () => v, [])\n  })\n}\n\n/**\n * @brief Set HTML attribute with checking value equality first\n * @param el\n * @param key\n * @param value\n */\nexport function setHTMLAttr(el, key, valueFunc, deps) {\n  if (cache(el, key, deps)) return\n  el.setAttribute(key, valueFunc())\n}\n\n/**\n * @brief Plainly set HTML attributes\n * @param el\n * @param value\n */\nexport function setHTMLAttrs(el, value) {\n  Object.entries(value).forEach(([key, v]) => {\n    setHTMLAttr(el, key, () => v, [])\n  })\n}\n\n/**\n * @brief Set memorized event, store the previous event in el[`$on${key}`], if it exists, remove it first\n * @param el\n * @param key\n * @param value\n */\nexport function setEvent(el, key, value) {\n  const prevEvent = el[`$on${key}`]\n  if (prevEvent) el.removeEventListener(key, prevEvent)\n  el.addEventListener(key, value)\n  el[`$on${key}`] = value\n}\n\nfunction eventHandler(e) {\n  const key = `$$${e.type}`\n  for (const node of e.composedPath()) {\n    if (node[key]) node[key](e)\n    if (e.cancelBubble) return\n  }\n}\n\nexport function delegateEvent(el, key, value) {\n  if (el[`$$${key}`] === value) return\n  el[`$$${key}`] = value\n  if (!DLStore.delegatedEvents.has(key)) {\n    DLStore.delegatedEvents.add(key)\n    DLStore.document.addEventListener(key, eventHandler)\n  }\n}\n/**\n * @brief Shortcut for document.createElement\n * @param tag\n * @returns HTMLElement\n */\nexport function createElement(tag) {\n  return DLStore.document.createElement(tag)\n}\n\n/**\n * @brief Insert any DLNode into an element, set the _$nodes and append the element to the element's children\n * @param el\n * @param node\n * @param position\n */\nexport function insertNode(el, node, position) {\n  // ---- Set _$nodes\n  if (!el._$nodes) el._$nodes = Array.from(el.childNodes)\n  el._$nodes.splice(position, 0, node)\n\n  // ---- Insert nodes' elements\n  const flowIdx = DLNode.getFlowIndexFromNodes(el._$nodes, node)\n  DLNode.appendNodesWithIndex([node], el, flowIdx)\n  // ---- Set parentEl\n  DLNode.addParentEl([node], el)\n}\n\n/**\n * @brief An inclusive assign prop function that accepts any type of prop\n * @param el\n * @param key\n * @param value\n */\nexport function forwardHTMLProp(el, key, valueFunc, deps) {\n  if (key === \"style\") return setStyle(el, valueFunc())\n  if (key === \"dataset\") return setDataset(el, valueFunc())\n  if (key === \"element\") return\n  if (key === \"prop\") return setHTMLProps(el, valueFunc())\n  if (key === \"attr\") return setHTMLAttrs(el, valueFunc())\n  if (key === \"innerHTML\") return setHTMLProp(el, \"innerHTML\", valueFunc, deps)\n  if (key === \"textContent\")\n    return setHTMLProp(el, \"textContent\", valueFunc, deps)\n  if (key === \"forwardProp\") return\n  if (key.startsWith(\"on\")) {\n    return setEvent(el, key.slice(2).toLowerCase(), valueFunc())\n  }\n  setHTMLAttr(el, key, valueFunc, deps)\n}\n","import { DLNode, DLNodeType } from \"./DLNode\"\nimport { forwardHTMLProp } from \"./HTMLNode\"\nimport { DLStore, cached } from \"./store\"\n\nexport class CompNode extends DLNode {\n  /**\n   * @brief Constructor, Comp type\n   * @internal\n   *  * key - private property key\n   *  * $$key - dependency number, e.g. 0b1, 0b10, 0b100\n   *  * $s$key - set of properties that depend on this property\n   *  * $p$key - exist if this property is a prop\n   *  * $e$key - exist if this property is an env\n   *  * $en$key - exist if this property is an env, and it's the innermost env that contains this env\n   *  * $w$key - exist if this property is a watcher\n   *  * $f$key - a function that returns the value of this property, called when the property's dependencies change\n   *  * _$children - children nodes of type PropView\n   *  * _$contentKey - the key key of the content prop\n   *  * _$forwardProps - exist if this node is forwarding props\n   *  * _$forwardPropsId - the keys of the props that this node is forwarding, collected in _$setForwardProp\n   *  * _$forwardPropsSet - contain all the nodes that are forwarding props to this node, collected with _$addForwardProps\n   */\n  constructor() {\n    super(DLNodeType.Comp)\n  }\n\n  /**\n   * @brief Init function, called explicitly in the subclass's constructor\n   * @param props - Object containing properties\n   * @param content - Content to be used\n   * @param children - Child nodes\n   * @param forwardPropsScope - Scope for forwarding properties\n   */\n  _$init(props, content, children, forwardPropsScope) {\n    this._$notInitd = true\n\n    // ---- Forward props first to allow internal props to override forwarded props\n    if (forwardPropsScope) forwardPropsScope._$addForwardProps(this)\n    if (content) this._$setContent(() => content[0], content[1])\n    if (props)\n      props.forEach(([key, value, deps]) => {\n        if (key === \"props\") return this._$setProps(() => value, deps)\n        this._$setProp(key, () => value, deps)\n      })\n    if (children) this._$children = children\n\n    // ---- Add envs\n    DLStore.global.DLEnvStore &&\n      Object.entries(DLStore.global.DLEnvStore.envs).forEach(\n        ([key, [value, envNode]]) => {\n          if (key === \"_$catchable\") {\n            this._$catchable = value\n            return\n          }\n          if (!(`$e$${key}` in this)) return\n          envNode.addNode(this)\n          this._$initEnv(key, value, envNode)\n        }\n      )\n\n    const willCall = () => {\n      this._$callUpdatesBeforeInit()\n      this.didMount && DLNode.addDidMount(this, this.didMount.bind(this))\n      this.willUnmount &&\n        DLNode.addWillUnmount(this, this.willUnmount.bind(this))\n      DLNode.addDidUnmount(this, this._$setUnmounted.bind(this))\n      this.didUnmount && DLNode.addDidUnmount(this, this.didUnmount.bind(this))\n      this.willMount?.()\n      this._$nodes = this.Body?.() ?? []\n    }\n\n    if (this._$catchable) {\n      this._$catchable(willCall)()\n      if (this._$update)\n        this._$update = this._$catchable(this._$update.bind(this))\n      this._$updateDerived = this._$catchable(this._$updateDerived.bind(this))\n      delete this._$catchable\n    } else {\n      willCall()\n    }\n  }\n\n  _$setUnmounted() {\n    this._$unmounted = true\n  }\n\n  /**\n   * @brief Call updates manually before the node is mounted\n   */\n  _$callUpdatesBeforeInit() {\n    const protoProps = Object.getOwnPropertyNames(Object.getPrototypeOf(this))\n    const ownProps = Object.getOwnPropertyNames(this)\n    const allProps = [...protoProps, ...ownProps]\n    allProps.forEach(key => {\n      // ---- Run watcher\n      if (key.startsWith(\"$w$\")) return this[key.slice(3)]()\n      // ---- Run model update\n      if (key.startsWith(\"$md$\")) {\n        const realKey = key.slice(4)\n        this[realKey] = this[realKey]()\n        return\n      }\n      // ---- Run derived value\n      if (key.startsWith(\"$f$\")) {\n        const realKey = key.slice(3)\n        this[realKey] = this[key]\n        this._$updateDerived(realKey)\n      }\n    })\n    delete this._$notInitd\n  }\n\n  /**\n   * @brief Set all the props to forward\n   * @param key\n   * @param value\n   * @param deps\n   */\n  _$setPropToForward(key, value, deps) {\n    this._$forwardPropsSet.forEach(node => {\n      const isContent = key === \"_$content\"\n      if (node._$dlNodeType === DLNodeType.Comp) {\n        if (isContent) node._$setContent(() => value, deps)\n        else node._$setProp(key, () => value, deps)\n        return\n      }\n      if (node instanceof HTMLElement) {\n        if (isContent) key = \"textContent\"\n        forwardHTMLProp(node, key, () => value, deps)\n      }\n    })\n  }\n\n  /**\n   * @brief Define forward props\n   * @param key\n   * @param value\n   */\n  _$setForwardProp(key, valueFunc, deps) {\n    const notInitd = \"_$notInitd\" in this\n    if (!notInitd && this._$cache(key, deps)) return\n    const value = valueFunc()\n    if (key === \"_$content\" && this._$contentKey) {\n      this[this._$contentKey] = value\n      this._$updateDerived(this._$contentKey)\n    }\n    this[key] = value\n    this._$updateDerived(key)\n    if (notInitd) this._$forwardPropsId.push(key)\n    else this._$setPropToForward(key, value, deps)\n  }\n\n  /**\n   * @brief Add a node to the set of nodes that are forwarding props to this node and init these props\n   * @param node\n   */\n  _$addForwardProps(node) {\n    this._$forwardPropsSet.add(node)\n    this._$forwardPropsId.forEach(key => {\n      this._$setPropToForward(key, this[key], [])\n    })\n    DLNode.addWillUnmount(\n      node,\n      this._$forwardPropsSet.delete.bind(this._$forwardPropsSet, node)\n    )\n  }\n\n  /**\n   * @brief Cache the deps and return true if the deps are the same as the previous deps\n   * @param key\n   * @param deps\n   * @returns\n   */\n  _$cache(key, deps) {\n    if (!deps || !deps.length) return false\n    const cacheKey = `$cc$${key}`\n    if (cached(deps, this[cacheKey])) return true\n    this[cacheKey] = deps\n    return false\n  }\n\n  /**\n   * @brief Set the content prop, the key is stored in _$contentKey\n   * @param value\n   */\n  _$setContent(valueFunc, deps) {\n    if (\"_$forwardProps\" in this)\n      return this._$setForwardProp(\"_$content\", valueFunc, deps)\n    const contentKey = this._$contentKey\n    if (!contentKey) return\n    if (this._$cache(contentKey, deps)) return\n    this[contentKey] = valueFunc()\n    this._$updateDerived(contentKey)\n  }\n\n  /**\n   * @brief Set a prop directly, if this is a forwarded prop, go and init forwarded props\n   * @param key\n   * @param value\n   * @param deps\n   */\n  _$setProp(key, valueFunc, deps) {\n    if (\"_$forwardProps\" in this)\n      return this._$setForwardProp(key, valueFunc, deps)\n    if (!(`$p$${key}` in this)) {\n      console.warn(`[${key}] is not a prop in ${this.constructor.name}`)\n      return\n    }\n    if (this._$cache(key, deps)) return\n    this[key] = valueFunc()\n    this._$updateDerived(key)\n  }\n\n  _$setProps(valueFunc, deps) {\n    if (this._$cache(\"props\", deps)) return\n    const props = valueFunc()\n    if (!props) return\n    Object.entries(props).forEach(([key, value]) => {\n      this._$setProp(key, () => value, [])\n    })\n  }\n\n  /**\n   * @brief Init an env, put the corresponding innermost envNode in $en$key\n   * @param key\n   * @param value\n   * @param envNode\n   */\n  _$initEnv(key, value, envNode) {\n    this[key] = value\n    this[`$en$${key}`] = envNode\n  }\n\n  // ---- Update functions\n  /**\n   * @brief Update an env, called in EnvNode._$update\n   * @param key\n   * @param value\n   * @param envNode\n   */\n  _$updateEnv(key, value, envNode) {\n    if (!(`$e$${key}` in this)) return\n    if (envNode !== this[`$en$${key}`]) return\n    this[key] = value\n    this._$updateDerived(key)\n  }\n\n  /**\n   * @brief Update a prop\n   */\n  _$ud(exp, key) {\n    this._$updateDerived(key)\n    return exp\n  }\n\n  /**\n   * @brief Update properties that depend on this property\n   * @param key\n   */\n  _$updateDerived(key) {\n    if (\"_$notInitd\" in this) return\n\n    this[`$s$${key}`]?.forEach(k => {\n      if (`$w$${k}` in this) {\n        // ---- Watcher\n        this[k](key)\n      } else if (`$md$${k}` in this) {\n        this[k]._$update()\n      } else {\n        // ---- Regular derived value\n        this[k] = this[`$f$${k}`]\n      }\n    })\n\n    // ---- \"trigger-view\"\n    this._$updateView(key)\n  }\n\n  _$updateView(key) {\n    if (this._$modelCallee) return this._$updateModelCallee()\n    if (!(\"_$update\" in this)) return\n    const depNum = this[`$$${key}`]\n    if (!depNum) return\n    // ---- Collect all depNums that need to be updated\n    if (\"_$depNumsToUpdate\" in this) {\n      this._$depNumsToUpdate.push(depNum)\n    } else {\n      this._$depNumsToUpdate = [depNum]\n      // ---- Update in the next microtask\n      Promise.resolve().then(() => {\n        // ---- Abort if unmounted\n        if (this._$unmounted) return\n        const depNums = this._$depNumsToUpdate\n        if (depNums.length > 0) {\n          const depNum = depNums.reduce((acc, cur) => acc | cur, 0)\n          this._$update(depNum)\n        }\n        delete this._$depNumsToUpdate\n      })\n    }\n  }\n\n  _$updateModelCallee() {\n    if (\"_$depNumsToUpdate\" in this) return\n    this._$depNumsToUpdate = true\n    // ---- Update in the next microtask\n    Promise.resolve().then(() => {\n      // ---- Abort if unmounted\n      if (this._$unmounted) return\n      this._$modelCallee._$updateDerived(this._$modelKey)\n      delete this._$depNumsToUpdate\n    })\n  }\n  /**\n   * @brief Update all props and content of the model\n   */\n  static _$updateModel(model, propsFunc, contentFunc) {\n    // ---- Suppress update because top level update will be performed\n    //      directly by the state variable in the model callee, which will\n    //      trigger the update of the model\n    const props = propsFunc() ?? {}\n    const collectedProps = props.s ?? []\n    props.m?.forEach(([props, deps]) => {\n      Object.entries(props).forEach(([key, value]) => {\n        collectedProps.push([key, value, deps])\n      })\n    })\n    collectedProps.forEach(([key, value, deps]) => {\n      model._$setProp(key, () => value, deps)\n    })\n    const content = contentFunc()\n    if (content) model._$setContent(() => content[0], content[1])\n  }\n\n  static _$releaseModel() {\n    delete this._$modelCallee\n  }\n\n  /**\n   * @brief Inject Dlight model in to a property\n   * @param ModelCls\n   * @param props { m: [props, deps], s: [key, value, deps] }\n   * @param content\n   * @param key\n   * @returns\n   */\n  _$injectModel(ModelCls, propsFunc, contentFunc, key) {\n    const props = propsFunc() ?? {}\n    const collectedProps = props.s ?? []\n    props.m?.forEach(([props, deps]) => {\n      Object.entries(props).forEach(([key, value]) => {\n        collectedProps.push([key, value, deps])\n      })\n    })\n    const model = new ModelCls()\n    model._$init(collectedProps, contentFunc(), null, null)\n    model._$modelCallee = this\n    model._$modelKey = key\n    model._$update = CompNode._$updateModel.bind(\n      null,\n      model,\n      propsFunc,\n      contentFunc\n    )\n\n    return model\n  }\n}\n\n// ---- @View -> class Comp extends View\nexport const View = CompNode\nexport const Model = CompNode\n\n/**\n * @brief Run all update functions given the key\n * @param dlNode\n * @param key\n */\nexport function update(dlNode, key) {\n  dlNode._$updateDerived(key)\n}\n","import { DLNode, DLNodeType } from \"./DLNode\"\nimport { DLStore, cached } from \"./store\"\n\nexport class EnvStoreClass {\n  constructor() {\n    this.envs = {}\n    this.currentEnvNodes = []\n  }\n\n  /**\n   * @brief Add a node to the current env and merge envs\n   * @param node - The node to add\n   */\n  addEnvNode(node) {\n    this.currentEnvNodes.push(node)\n    this.mergeEnvs()\n  }\n\n  /**\n   * @brief Replace the current env with the given nodes and merge envs\n   * @param nodes - The nodes to replace the current environment with\n   */\n  replaceEnvNodes(nodes) {\n    this.currentEnvNodes = nodes\n    this.mergeEnvs()\n  }\n\n  /**\n   * @brief Remove the last node from the current env and merge envs\n   */\n  removeEnvNode() {\n    this.currentEnvNodes.pop()\n    this.mergeEnvs()\n  }\n\n  /**\n   * @brief Merge all the envs in currentEnvNodes, inner envs override outer envs\n   */\n  mergeEnvs() {\n    this.envs = {}\n    this.currentEnvNodes.forEach(envNode => {\n      Object.entries(envNode.envs).forEach(([key, value]) => {\n        this.envs[key] = [value, envNode]\n      })\n    })\n  }\n}\n\nexport class EnvNode extends DLNode {\n  constructor(envs, depsArr) {\n    super(DLNodeType.Env)\n    // Declare a global variable to store the environment variables\n    if (!(\"DLEnvStore\" in DLStore.global))\n      DLStore.global.DLEnvStore = new EnvStoreClass()\n\n    this.envs = envs\n    this.depsArr = depsArr\n    this.updateNodes = new Set()\n\n    DLStore.global.DLEnvStore.addEnvNode(this)\n  }\n\n  cached(deps, name) {\n    if (!deps || !deps.length) return false\n    if (cached(deps, this.depsArr[name])) return true\n    this.depsArr[name] = deps\n    return false\n  }\n\n  /**\n   * @brief Update a specific env, and update all the comp nodes that depend on this env\n   * @param name - The name of the environment variable to update\n   * @param value - The new value of the environment variable\n   */\n  updateEnv(name, valueFunc, deps) {\n    if (this.cached(deps, name)) return\n    const value = valueFunc()\n    this.envs[name] = value\n    if (DLStore.global.DLEnvStore.currentEnvNodes.includes(this)) {\n      DLStore.global.DLEnvStore.mergeEnvs()\n    }\n    this.updateNodes.forEach(node => {\n      node._$updateEnv(name, value, this)\n    })\n  }\n\n  /**\n   * @brief Add a node to this.updateNodes, delete the node from this.updateNodes when it unmounts\n   * @param node - The node to add\n   */\n  addNode(node) {\n    this.updateNodes.add(node)\n    DLNode.addWillUnmount(\n      node,\n      this.updateNodes.delete.bind(this.updateNodes, node)\n    )\n  }\n\n  /**\n   * @brief Set this._$nodes, and exit the current env\n   * @param nodes - The nodes to set\n   */\n  initNodes(nodes) {\n    this._$nodes = nodes\n    DLStore.global.DLEnvStore.removeEnvNode()\n  }\n}\n","import { DLStore, cached } from \"./store\"\n\n/**\n * @brief Shorten document.createTextNode\n * @param value\n * @returns Text\n */\nexport function createTextNode(value, deps) {\n  const node = DLStore.document.createTextNode(value)\n  node.$$deps = deps\n  return node\n}\n\n/**\n * @brief Update text node and check if the value is changed\n * @param node\n * @param value\n */\nexport function updateText(node, valueFunc, deps) {\n  if (cached(deps, node.$$deps)) return\n  const value = valueFunc()\n  node.textContent = value\n  node.$$deps = deps\n}\n","import { DLNode } from \"./DLNode\"\nimport { insertNode } from \"./HTMLNode\"\nexport class PropView {\n  propViewFunc\n  dlUpdateFunc = new Set()\n\n  /**\n   * @brief PropView constructor, accept a function that returns a list of DLNode\n   * @param propViewFunc - A function that when called, collects and returns an array of DLNode instances\n   */\n  constructor(propViewFunc) {\n    this.propViewFunc = propViewFunc\n  }\n\n  /**\n   * @brief Build the prop view by calling the propViewFunc and add every single instance of the returned DLNode to dlUpdateNodes\n   * @returns An array of DLNode instances returned by propViewFunc\n   */\n  build() {\n    let update\n    const addUpdate = updateFunc => {\n      update = updateFunc\n      this.dlUpdateFunc.add(updateFunc)\n    }\n    const newNodes = this.propViewFunc(addUpdate)\n    if (newNodes.length === 0) return []\n    if (update) {\n      // Remove the updateNode from dlUpdateNodes when it unmounts\n      DLNode.addWillUnmount(\n        newNodes[0],\n        this.dlUpdateFunc.delete.bind(this.dlUpdateFunc, update)\n      )\n    }\n\n    return newNodes\n  }\n\n  /**\n   * @brief Update every node in dlUpdateNodes\n   * @param changed - A parameter indicating what changed to trigger the update\n   */\n  update(...args) {\n    this.dlUpdateFunc.forEach(update => {\n      update(...args)\n    })\n  }\n}\n\nexport function insertChildren(el, propView) {\n  insertNode(el, { _$nodes: propView.build(), _$dlNodeType: 7 }, 0)\n}\n","import { DLNode, DLNodeType } from \"./DLNode\"\nimport { cached } from \"./store\"\n\nexport class SnippetNode extends DLNode {\n  constructor(depsArr) {\n    super(DLNodeType.Snippet)\n    this.depsArr = depsArr\n  }\n\n  cached(deps, changed) {\n    if (!deps || !deps.length) return false\n    const idx = Math.log2(changed)\n    const prevDeps = this.depsArr[idx]\n    if (cached(deps, prevDeps)) return true\n    this.depsArr[idx] = deps\n    return false\n  }\n}\n","import { DLNode } from \"../DLNode\"\nimport { DLStore } from \"../store\"\n\nexport class MutableNode extends DLNode {\n  /**\n   * @brief Mutable node is a node that this._$nodes can be changed, things need to pay attention:\n   *  1. The environment of the new nodes should be the same as the old nodes\n   *  2. The new nodes should be added to the parentEl\n   *  3. The old nodes should be removed from the parentEl\n   * @param type\n   */\n  constructor(type) {\n    super(type)\n    // ---- Save the current environment nodes, must be a new reference\n    if (\n      DLStore.global.DLEnvStore &&\n      DLStore.global.DLEnvStore.currentEnvNodes.length > 0\n    ) {\n      this.savedEnvNodes = [...DLStore.global.DLEnvStore.currentEnvNodes]\n    }\n  }\n\n  /**\n   * @brief Initialize the new nodes, add parentEl to all nodes\n   * @param nodes\n   */\n  initNewNodes(nodes) {\n    // ---- Add parentEl to all nodes\n    DLNode.addParentEl(nodes, this._$parentEl)\n  }\n\n  /**\n   * @brief Generate new nodes in the saved environment\n   * @param newNodesFunc\n   * @returns\n   */\n  geneNewNodesInEnv(newNodesFunc) {\n    if (!this.savedEnvNodes) {\n      // ---- No saved environment, just generate new nodes\n      const newNodes = newNodesFunc()\n      // ---- Only for IfNode's same condition return\n      // ---- Initialize the new nodes\n      this.initNewNodes(newNodes)\n      return newNodes\n    }\n    // ---- Save the current environment nodes\n    const currentEnvNodes = DLStore.global.DLEnvStore.currentEnvNodes\n    // ---- Replace the saved environment nodes\n    DLStore.global.DLEnvStore.replaceEnvNodes(this.savedEnvNodes)\n    const newNodes = newNodesFunc()\n    // ---- Retrieve the current environment nodes\n    DLStore.global.DLEnvStore.replaceEnvNodes(currentEnvNodes)\n    // ---- Only for IfNode's same condition return\n    // ---- Initialize the new nodes\n    this.initNewNodes(newNodes)\n    return newNodes\n  }\n\n  initUnmountStore() {\n    DLStore.global.WillUnmountStore.push([])\n    DLStore.global.DidUnmountStore.push([])\n  }\n\n  /**\n   * @brief Remove nodes from parentEl and run willUnmount and didUnmount\n   * @param nodes\n   * @param removeEl Only remove outermost element\n   */\n  removeNodes(nodes) {\n    DLNode.loopShallowEls(nodes, node => {\n      this._$parentEl.removeChild(node)\n    })\n  }\n}\n","import { DLNodeType } from \"../DLNode\"\nimport { DLStore } from \"../store\"\nimport { MutableNode } from \"./MutableNode\"\n\nexport class ForNode extends MutableNode {\n  array\n  nodeFunc\n  depNum\n\n  nodesMap = new Map()\n  updateArr = []\n\n  /**\n   * @brief Getter for nodes\n   */\n  get _$nodes() {\n    const nodes = []\n    for (let idx = 0; idx < this.array.length; idx++) {\n      nodes.push(...this.nodesMap.get(this.keys?.[idx] ?? idx))\n    }\n    return nodes\n  }\n\n  /**\n   * @brief Constructor, For type\n   * @param array\n   * @param nodeFunc\n   * @param keys\n   */\n  constructor(array, depNum, keys, nodeFunc) {\n    super(DLNodeType.For)\n    this.array = [...array]\n    this.keys = keys\n    this.depNum = depNum\n    this.addNodeFunc(nodeFunc)\n  }\n\n  /**\n   * @brief To be called immediately after the constructor\n   * @param nodeFunc\n   */\n  addNodeFunc(nodeFunc) {\n    this.nodeFunc = nodeFunc\n    this.array.forEach((item, idx) => {\n      this.initUnmountStore()\n      const key = this.keys?.[idx] ?? idx\n      const nodes = nodeFunc(item, this.updateArr, idx)\n      this.nodesMap.set(key, nodes)\n      this.setUnmountMap(key)\n    })\n    // ---- For nested ForNode, the whole strategy is just like EnvStore\n    //      we use array of function array to create \"environment\", popping and pushing\n    ForNode.addWillUnmount(this, this.runAllWillUnmount.bind(this))\n    ForNode.addDidUnmount(this, this.runAllDidUnmount.bind(this))\n  }\n\n  /**\n   * @brief Update the view related to one item in the array\n   * @param nodes\n   * @param item\n   */\n  updateItem(idx, array, changed) {\n    // ---- The update function of ForNode's childNodes is stored in the first child node\n    this.updateArr[idx]?.(changed ?? this.depNum, array[idx])\n  }\n\n  updateItems(changed) {\n    for (let idx = 0; idx < this.array.length; idx++) {\n      this.updateItem(idx, this.array, changed)\n    }\n  }\n\n  /**\n   * @brief Non-array update function\n   * @param changed\n   */\n  update(changed) {\n    // ---- e.g. this.depNum -> 1110 changed-> 1010\n    //      ~this.depNum & changed -> ~1110 & 1010 -> 0000\n    //      no update because depNum contains all the changed\n    // ---- e.g. this.depNum -> 1110 changed-> 1101\n    //      ~this.depNum & changed -> ~1110 & 1101 -> 0001\n    //      update because depNum doesn't contain all the changed\n    if (!(~this.depNum & changed)) return\n    this.updateItems(changed)\n  }\n\n  /**\n   * @brief Array-related update function\n   * @param newArray\n   * @param newKeys\n   */\n  updateArray(newArray, newKeys) {\n    if (newKeys) {\n      this.updateWithKey(newArray, newKeys)\n      return\n    }\n    this.updateWithOutKey(newArray)\n  }\n\n  /**\n   * @brief Shortcut to generate new nodes with idx and key\n   */\n  getNewNodes(idx, key, array, updateArr) {\n    this.initUnmountStore()\n    const nodes = this.geneNewNodesInEnv(() =>\n      this.nodeFunc(array[idx], updateArr ?? this.updateArr, idx)\n    )\n    this.setUnmountMap(key)\n    this.nodesMap.set(key, nodes)\n    return nodes\n  }\n\n  /**\n   * @brief Set the unmount map by getting the last unmount map from the global store\n   * @param key\n   */\n  setUnmountMap(key) {\n    const willUnmountMap = DLStore.global.WillUnmountStore.pop()\n    if (willUnmountMap && willUnmountMap.length > 0) {\n      if (!this.willUnmountMap) this.willUnmountMap = new Map()\n      this.willUnmountMap.set(key, willUnmountMap)\n    }\n    const didUnmountMap = DLStore.global.DidUnmountStore.pop()\n    if (didUnmountMap && didUnmountMap.length > 0) {\n      if (!this.didUnmountMap) this.didUnmountMap = new Map()\n      this.didUnmountMap.set(key, didUnmountMap)\n    }\n  }\n\n  /**\n   * @brief Run all the unmount functions and clear the unmount map\n   */\n  runAllWillUnmount() {\n    if (!this.willUnmountMap || this.willUnmountMap.size === 0) return\n    this.willUnmountMap.forEach(funcs => {\n      for (let i = 0; i < funcs.length; i++) funcs[i]?.()\n    })\n    this.willUnmountMap.clear()\n  }\n\n  /**\n   * @brief Run all the unmount functions and clear the unmount map\n   */\n  runAllDidUnmount() {\n    if (!this.didUnmountMap || this.didUnmountMap.size === 0) return\n    this.didUnmountMap.forEach(funcs => {\n      for (let i = funcs.length - 1; i >= 0; i--) funcs[i]?.()\n    })\n    this.didUnmountMap.clear()\n  }\n\n  /**\n   * @brief Run the unmount functions of the given key\n   * @param key\n   */\n  runWillUnmount(key) {\n    if (!this.willUnmountMap || this.willUnmountMap.size === 0) return\n    const funcs = this.willUnmountMap.get(key)\n    if (!funcs) return\n    for (let i = 0; i < funcs.length; i++) funcs[i]?.()\n    this.willUnmountMap.delete(key)\n  }\n\n  /**\n   * @brief Run the unmount functions of the given key\n   */\n  runDidUnmount(key) {\n    if (!this.didUnmountMap || this.didUnmountMap.size === 0) return\n    const funcs = this.didUnmountMap.get(key)\n    if (!funcs) return\n    for (let i = funcs.length - 1; i >= 0; i--) funcs[i]?.()\n    this.didUnmountMap.delete(key)\n  }\n\n  /**\n   * @brief Remove nodes from parentEl and run willUnmount and didUnmount\n   * @param nodes\n   * @param key\n   */\n  removeNodes(nodes, key) {\n    this.runWillUnmount(key)\n    super.removeNodes(nodes)\n    this.runDidUnmount(key)\n    this.nodesMap.delete(key)\n  }\n\n  /**\n   * @brief Update the nodes without keys\n   * @param newArray\n   */\n  updateWithOutKey(newArray) {\n    const preLength = this.array.length\n    const currLength = newArray.length\n\n    if (preLength === currLength) {\n      // ---- If the length is the same, we only need to update the nodes\n      for (let idx = 0; idx < this.array.length; idx++) {\n        this.updateItem(idx, newArray)\n      }\n      this.array = [...newArray]\n      return\n    }\n    const parentEl = this._$parentEl\n    // ---- If the new array is longer, add new nodes directly\n    if (preLength < currLength) {\n      let flowIndex = ForNode.getFlowIndexFromNodes(parentEl._$nodes, this)\n      // ---- Calling parentEl.childNodes.length is time-consuming,\n      //      so we use a length variable to store the length\n      const length = parentEl.childNodes.length\n      for (let idx = 0; idx < currLength; idx++) {\n        if (idx < preLength) {\n          flowIndex += ForNode.getFlowIndexFromNodes(this.nodesMap.get(idx))\n          this.updateItem(idx, newArray)\n          continue\n        }\n        const newNodes = this.getNewNodes(idx, idx, newArray)\n        ForNode.appendNodesWithIndex(newNodes, parentEl, flowIndex, length)\n      }\n      ForNode.runDidMount()\n      this.array = [...newArray]\n      return\n    }\n\n    // ---- Update the nodes first\n    for (let idx = 0; idx < currLength; idx++) {\n      this.updateItem(idx, newArray)\n    }\n    // ---- If the new array is shorter, remove the extra nodes\n    for (let idx = currLength; idx < preLength; idx++) {\n      const nodes = this.nodesMap.get(idx)\n      this.removeNodes(nodes, idx)\n    }\n    this.updateArr.splice(currLength, preLength - currLength)\n    this.array = [...newArray]\n  }\n\n  /**\n   * @brief Update the nodes with keys\n   * @param newArray\n   * @param newKeys\n   */\n  updateWithKey(newArray, newKeys) {\n    if (newKeys.length !== new Set(newKeys).size) {\n      throw new Error(\"DLight: Duplicate keys in for loop are not allowed\")\n    }\n    const prevKeys = this.keys\n    this.keys = newKeys\n\n    if (ForNode.arrayEqual(prevKeys, this.keys)) {\n      // ---- If the keys are the same, we only need to update the nodes\n      for (let idx = 0; idx < newArray.length; idx++) {\n        this.updateItem(idx, newArray)\n      }\n      this.array = [...newArray]\n      return\n    }\n\n    const parentEl = this._$parentEl\n\n    // ---- No nodes after, delete all nodes\n    if (this.keys.length === 0) {\n      const parentNodes = parentEl._$nodes ?? []\n      if (parentNodes.length === 1 && parentNodes[0] === this) {\n        // ---- ForNode is the only node in the parent node\n        //      Frequently used in real life scenarios because we tend to always wrap for with a div element,\n        //      so we optimize it here\n        this.runAllWillUnmount()\n        parentEl.innerHTML = \"\"\n        this.runAllDidUnmount()\n      } else {\n        for (let prevIdx = 0; prevIdx < prevKeys.length; prevIdx++) {\n          const prevKey = prevKeys[prevIdx]\n          this.removeNodes(this.nodesMap.get(prevKey), prevKey)\n        }\n      }\n      this.nodesMap.clear()\n      this.updateArr = []\n      this.array = []\n      return\n    }\n\n    // ---- Record how many nodes are before this ForNode with the same parentNode\n    const flowIndex = ForNode.getFlowIndexFromNodes(parentEl._$nodes, this)\n\n    // ---- No nodes before, append all nodes\n    if (prevKeys.length === 0) {\n      const nextSibling = parentEl.childNodes[flowIndex]\n      for (let idx = 0; idx < this.keys.length; idx++) {\n        const newNodes = this.getNewNodes(idx, this.keys[idx], newArray)\n        ForNode.appendNodesWithSibling(newNodes, parentEl, nextSibling)\n      }\n      ForNode.runDidMount()\n      this.array = [...newArray]\n      return\n    }\n\n    const shuffleKeys = []\n    const newUpdateArr = []\n\n    // ---- 1. Delete the nodes that are no longer in the array\n    for (let prevIdx = 0; prevIdx < prevKeys.length; prevIdx++) {\n      const prevKey = prevKeys[prevIdx]\n      if (this.keys.includes(prevKey)) {\n        shuffleKeys.push(prevKey)\n        newUpdateArr.push(this.updateArr[prevIdx])\n        continue\n      }\n      this.removeNodes(this.nodesMap.get(prevKey), prevKey)\n    }\n\n    // ---- 2. Add the nodes that are not in the array but in the new array\n    // ---- Calling parentEl.childNodes.length is time-consuming,\n    //      so we use a length variable to store the length\n    let length = parentEl.childNodes.length\n    let newFlowIndex = flowIndex\n    for (let idx = 0; idx < this.keys.length; idx++) {\n      const key = this.keys[idx]\n      const prevIdx = shuffleKeys.indexOf(key)\n      if (prevIdx !== -1) {\n        // ---- These nodes are already in the parentEl,\n        //      and we need to keep track of their flowIndex\n        newFlowIndex += ForNode.getFlowIndexFromNodes(this.nodesMap.get(key))\n        newUpdateArr[prevIdx]?.(this.depNum, newArray[idx])\n        continue\n      }\n      // ---- Insert updateArr first because in getNewNode the updateFunc will replace this null\n      newUpdateArr.splice(idx, 0, null)\n      const newNodes = this.getNewNodes(idx, key, newArray, newUpdateArr)\n      // ---- Add the new nodes\n      shuffleKeys.splice(idx, 0, key)\n\n      const count = ForNode.appendNodesWithIndex(\n        newNodes,\n        parentEl,\n        newFlowIndex,\n        length\n      )\n      newFlowIndex += count\n      length += count\n    }\n    ForNode.runDidMount()\n\n    // ---- After adding and deleting, the only thing left is to reorder the nodes,\n    //      but if the keys are the same, we don't need to reorder\n    if (ForNode.arrayEqual(this.keys, shuffleKeys)) {\n      this.array = [...newArray]\n      this.updateArr = newUpdateArr\n      return\n    }\n\n    newFlowIndex = flowIndex\n    const bufferNodes = new Map()\n    // ---- 3. Replace the nodes in the same position using Fisher-Yates shuffle algorithm\n    for (let idx = 0; idx < this.keys.length; idx++) {\n      const key = this.keys[idx]\n      const prevIdx = shuffleKeys.indexOf(key)\n\n      const bufferedNode = bufferNodes.get(key)\n      if (bufferedNode) {\n        // ---- We need to add the flowIndex of the bufferedNode,\n        //      because the bufferedNode is in the parentEl and the new position is ahead of the previous position\n        const bufferedFlowIndex = ForNode.getFlowIndexFromNodes(bufferedNode)\n        const lastEl = ForNode.toEls(bufferedNode).pop()\n        const nextSibling =\n          parentEl.childNodes[newFlowIndex + bufferedFlowIndex]\n        if (lastEl !== nextSibling && lastEl.nextSibling !== nextSibling) {\n          // ---- If the node is buffered, we need to add it to the parentEl\n          ForNode.insertNodesBefore(bufferedNode, parentEl, nextSibling)\n        }\n        // ---- So the added length is the length of the bufferedNode\n        newFlowIndex += bufferedFlowIndex\n        delete bufferNodes[idx]\n      } else if (prevIdx === idx) {\n        // ---- If the node is in the same position, we don't need to do anything\n        newFlowIndex += ForNode.getFlowIndexFromNodes(this.nodesMap.get(key))\n        continue\n      } else {\n        // ---- If the node is not in the same position, we need to buffer it\n        //      We buffer the node of the previous position, and then replace it with the node of the current position\n        const prevKey = shuffleKeys[idx]\n        bufferNodes.set(prevKey, this.nodesMap.get(prevKey))\n        // ---- Length would never change, and the last will always be in the same position,\n        //      so it'll always be insertBefore instead of appendChild\n        const childNodes = this.nodesMap.get(key)\n        const lastEl = ForNode.toEls(childNodes).pop()\n        const nextSibling = parentEl.childNodes[newFlowIndex]\n        if (lastEl !== nextSibling && lastEl.nextSibling !== nextSibling) {\n          newFlowIndex += ForNode.insertNodesBefore(\n            childNodes,\n            parentEl,\n            nextSibling\n          )\n        }\n      }\n      // ---- Swap the keys\n      const tempKey = shuffleKeys[idx]\n      shuffleKeys[idx] = shuffleKeys[prevIdx]\n      shuffleKeys[prevIdx] = tempKey\n      const tempUpdateFunc = newUpdateArr[idx]\n      newUpdateArr[idx] = newUpdateArr[prevIdx]\n      newUpdateArr[prevIdx] = tempUpdateFunc\n    }\n    this.array = [...newArray]\n    this.updateArr = newUpdateArr\n  }\n\n  /**\n   * @brief Compare two arrays\n   * @param arr1\n   * @param arr2\n   * @returns\n   */\n  static arrayEqual(arr1, arr2) {\n    if (arr1.length !== arr2.length) return false\n    return arr1.every((item, idx) => item === arr2[idx])\n  }\n}\n","import { DLStore } from \"../store\"\nimport { MutableNode } from \"./MutableNode\"\n\nexport class FlatNode extends MutableNode {\n  willUnmountFuncs = []\n  didUnmountFuncs = []\n\n  setUnmountFuncs() {\n    this.willUnmountFuncs = DLStore.global.WillUnmountStore.pop()\n    this.didUnmountFuncs = DLStore.global.DidUnmountStore.pop()\n  }\n\n  runWillUnmount() {\n    for (let i = 0; i < this.willUnmountFuncs.length; i++)\n      this.willUnmountFuncs[i]()\n  }\n\n  runDidUnmount() {\n    for (let i = this.didUnmountFuncs.length - 1; i >= 0; i--)\n      this.didUnmountFuncs[i]()\n  }\n\n  removeNodes(nodes) {\n    this.runWillUnmount()\n    super.removeNodes(nodes)\n    this.runDidUnmount()\n  }\n\n  geneNewNodesInEnv(newNodesFunc) {\n    this.initUnmountStore()\n    const nodes = super.geneNewNodesInEnv(newNodesFunc)\n    this.setUnmountFuncs()\n    return nodes\n  }\n}\n","import { DLNodeType } from \"../DLNode\"\nimport { FlatNode } from \"./FlatNode\"\nimport { DLStore, cached } from \"../store\"\n\nexport class ExpNode extends FlatNode {\n  /**\n   * @brief Constructor, Exp type, accept a function that returns a list of nodes\n   * @param nodesFunc\n   */\n  constructor(value, deps) {\n    super(DLNodeType.Exp)\n    this.initUnmountStore()\n    this._$nodes = ExpNode.formatNodes(value)\n    this.setUnmountFuncs()\n    this.deps = this.parseDeps(deps)\n    // ---- Add to the global UnmountStore\n    ExpNode.addWillUnmount(this, this.runWillUnmount.bind(this))\n    ExpNode.addDidUnmount(this, this.runDidUnmount.bind(this))\n  }\n\n  parseDeps(deps) {\n    return deps.map(dep => {\n      // ---- CompNode\n      if (dep?.prototype?._$init) return dep.toString()\n      // ---- SnippetNode\n      if (dep?.propViewFunc) return dep.propViewFunc.toString()\n      return dep\n    })\n  }\n\n  cache(deps) {\n    if (!deps || !deps.length) return false\n    deps = this.parseDeps(deps)\n    if (cached(deps, this.deps)) return true\n    this.deps = deps\n    return false\n  }\n  /**\n   * @brief Generate new nodes and replace the old nodes\n   */\n  update(valueFunc, deps) {\n    if (this.cache(deps)) return\n    this.removeNodes(this._$nodes)\n    const newNodes = this.geneNewNodesInEnv(() =>\n      ExpNode.formatNodes(valueFunc())\n    )\n    if (newNodes.length === 0) {\n      this._$nodes = []\n      return\n    }\n\n    // ---- Add new nodes\n    const parentEl = this._$parentEl\n    const flowIndex = ExpNode.getFlowIndexFromNodes(parentEl._$nodes, this)\n    const nextSibling = parentEl.childNodes[flowIndex]\n    ExpNode.appendNodesWithSibling(newNodes, parentEl, nextSibling)\n    ExpNode.runDidMount()\n\n    this._$nodes = newNodes\n  }\n\n  /**\n   * @brief Format the nodes\n   * @param nodes\n   * @returns New nodes\n   */\n  static formatNodes(nodes) {\n    if (!Array.isArray(nodes)) nodes = [nodes]\n    return (\n      nodes\n        // ---- Flatten the nodes\n        .flat(1)\n        // ---- Filter out empty nodes\n        .filter(\n          node =>\n            node !== undefined && node !== null && typeof node !== \"boolean\"\n        )\n        .map(node => {\n          // ---- If the node is a string, number or bigint, convert it to a text node\n          if (\n            typeof node === \"string\" ||\n            typeof node === \"number\" ||\n            typeof node === \"bigint\"\n          ) {\n            return DLStore.document.createTextNode(`${node}`)\n          }\n          // ---- If the node has PropView, call it to get the view\n          if (\"propViewFunc\" in node) return node.build()\n          return node\n        })\n        // ---- Flatten the nodes again\n        .flat(1)\n    )\n  }\n}\n","import { DLNodeType } from \"../DLNode\"\nimport { FlatNode } from \"./FlatNode\"\n\nexport class CondNode extends FlatNode {\n  /**\n   * @brief Constructor, If type, accept a function that returns a list of nodes\n   * @param caseFunc\n   */\n  constructor(depNum, condFunc) {\n    super(DLNodeType.Cond)\n    this.depNum = depNum\n    this.cond = -1\n    this.condFunc = condFunc\n    this.initUnmountStore()\n    this._$nodes = this.condFunc(this)\n    this.setUnmountFuncs()\n\n    // ---- Add to the global UnmountStore\n    CondNode.addWillUnmount(this, this.runWillUnmount.bind(this))\n    CondNode.addDidUnmount(this, this.runDidUnmount.bind(this))\n  }\n\n  /**\n   * @brief Update the nodes in the environment\n   */\n  updateCond(key) {\n    // ---- Need to save prev unmount funcs because we can't put removeNodes before geneNewNodesInEnv\n    //      The reason is that if it didn't change, we don't need to unmount or remove the nodes\n    const prevFuncs = [this.willUnmountFuncs, this.didUnmountFuncs]\n    const newNodes = this.geneNewNodesInEnv(() => this.condFunc(this))\n\n    // ---- If the new nodes are the same as the old nodes, we only need to update  children\n    if (this.didntChange) {\n      ;[this.willUnmountFuncs, this.didUnmountFuncs] = prevFuncs\n      this.didntChange = false\n      this.updateFunc?.(this.depNum, key)\n      return\n    }\n    // ---- Remove old nodes\n    const newFuncs = [this.willUnmountFuncs, this.didUnmountFuncs]\n    ;[this.willUnmountFuncs, this.didUnmountFuncs] = prevFuncs\n    this._$nodes && this._$nodes.length > 0 && this.removeNodes(this._$nodes)\n    ;[this.willUnmountFuncs, this.didUnmountFuncs] = newFuncs\n\n    if (newNodes.length === 0) {\n      // ---- No branch has been taken\n      this._$nodes = []\n      return\n    }\n    // ---- Add new nodes\n    const parentEl = this._$parentEl\n    // ---- Faster append with nextSibling rather than flowIndex\n    const flowIndex = CondNode.getFlowIndexFromNodes(parentEl._$nodes, this)\n\n    const nextSibling = parentEl.childNodes[flowIndex]\n    CondNode.appendNodesWithSibling(newNodes, parentEl, nextSibling)\n    CondNode.runDidMount()\n    this._$nodes = newNodes\n  }\n\n  /**\n   * @brief The update function of IfNode's childNodes is stored in the first child node\n   * @param changed\n   */\n  update(changed) {\n    if (!(~this.depNum & changed)) return\n    this.updateFunc?.(changed)\n  }\n}\n","import { DLNodeType } from \"../DLNode\"\nimport { FlatNode } from \"./FlatNode\"\nimport { EnvNode } from \"../EnvNode\"\n\nexport class TryNode extends FlatNode {\n  constructor(tryFunc, catchFunc) {\n    super(DLNodeType.Try)\n    this.tryFunc = tryFunc\n    const catchable = this.getCatchable(catchFunc)\n    this.envNode = new EnvNode({ _$catchable: catchable })\n    const nodes = tryFunc(this.setUpdateFunc.bind(this), catchable) ?? []\n    this.envNode.initNodes(nodes)\n    this._$nodes = nodes\n  }\n\n  update(changed) {\n    this.updateFunc?.(changed)\n  }\n\n  setUpdateFunc(updateFunc) {\n    this.updateFunc = updateFunc\n  }\n\n  getCatchable(catchFunc) {\n    return callback =>\n      (...args) => {\n        try {\n          return callback(...args)\n        } catch (e) {\n          // ---- Run it in next tick to make sure when error occurs before\n          //      didMount, this._$parentEl is not null\n          Promise.resolve().then(() => {\n            const nodes = this.geneNewNodesInEnv(() =>\n              catchFunc(this.setUpdateFunc.bind(this), e)\n            )\n            this._$nodes && this.removeNodes(this._$nodes)\n            const parentEl = this._$parentEl\n            const flowIndex = FlatNode.getFlowIndexFromNodes(\n              parentEl._$nodes,\n              this\n            )\n            const nextSibling = parentEl.childNodes[flowIndex]\n            FlatNode.appendNodesWithSibling(nodes, parentEl, nextSibling)\n            FlatNode.runDidMount()\n            this._$nodes = nodes\n          })\n        }\n      }\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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