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MJ,OAJE,EADE,aAAkB,MACb,EAAO,SAAS,GAEhB,EAAU,YAEZ,CACT,CACA,SAAS,6CACP,GAAI,QACF,OACF,SAAU,EACV,IAAI,EAAW,QAAQ,UAAU,aAC7B,EAAU,SAAS,cAAc,OACrC,QAAQ,UAAU,aAAe,SAAyB,EAAM,GAC9D,IAAK,EAAK,SAAS,KACjB,OAAO,EAAS,KAAK,KAAM,EAAM,GAEnC,IAAI,EAAe,EAAM,QAAQ,KAAM,SAAS,QAAQ,KAAM,UAC9D,EAAQ,UAAY,SAAS,MAAS,aACtC,IAAI,EAAO,EAAQ,kBAAkB,iBAAiB,GACtD,EAAQ,kBAAkB,oBAAoB,GAC9C,KAAK,iBAAiB,EACxB,CACF,CACA,SAAS,kBAAkB,EAAI,GAC7B,IAAI,EAAS,GAAQ,EAAK,aAAe,EAAK,YAAY,GACrD,GAEA,EAAG,eAER,EAAG,aAAa,KAAM,GACtB,EAAG,GAAK,EACV,CAGA,SAAS,YAAY,GACnB,EAAO,MAAQ,MACf,EAAO,aAAe,YACxB,CAGA,IAAI,eAAiB","file":"/npm/@alpinejs/morph@3.15.12/dist/module.cjs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@alpinejs/morph@3.15.12/dist/module.cjs.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n  for (var name in all)\n    __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n  if (from && typeof from === \"object\" || typeof from === \"function\") {\n    for (let key of __getOwnPropNames(from))\n      if (!__hasOwnProp.call(to, key) && key !== except)\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n  }\n  return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// packages/morph/builds/module.js\nvar module_exports = {};\n__export(module_exports, {\n  default: () => module_default,\n  morph: () => src_default\n});\nmodule.exports = __toCommonJS(module_exports);\n\n// packages/morph/src/morph.js\nfunction morph(from, toHtml, options) {\n  monkeyPatchDomSetAttributeToAllowAtSymbols();\n  let context = createMorphContext(options);\n  let toEl = typeof toHtml === \"string\" ? createElement(toHtml) : toHtml;\n  if (window.Alpine && window.Alpine.closestDataStack && !from._x_dataStack) {\n    toEl._x_dataStack = window.Alpine.closestDataStack(from);\n    toEl._x_dataStack && window.Alpine.cloneNode(from, toEl);\n  }\n  context.patch(from, toEl);\n  return from;\n}\nfunction morphBetween(startMarker, endMarker, toHtml, options = {}) {\n  monkeyPatchDomSetAttributeToAllowAtSymbols();\n  let context = createMorphContext(options);\n  let fromContainer = startMarker.parentNode;\n  let fromBlock = new Block(startMarker, endMarker);\n  let toContainer = typeof toHtml === \"string\" ? (() => {\n    let container = document.createElement(\"div\");\n    container.insertAdjacentHTML(\"beforeend\", toHtml);\n    return container;\n  })() : toHtml;\n  let toStartMarker = document.createComment(\"[morph-start]\");\n  let toEndMarker = document.createComment(\"[morph-end]\");\n  toContainer.insertBefore(toStartMarker, toContainer.firstChild);\n  toContainer.appendChild(toEndMarker);\n  let toBlock = new Block(toStartMarker, toEndMarker);\n  if (window.Alpine && window.Alpine.closestDataStack) {\n    toContainer._x_dataStack = window.Alpine.closestDataStack(fromContainer);\n    toContainer._x_dataStack && window.Alpine.cloneNode(fromContainer, toContainer);\n  }\n  context.patchChildren(fromBlock, toBlock);\n}\nfunction createMorphContext(options = {}) {\n  let defaultGetKey = (el) => el.getAttribute(\"key\");\n  let noop = () => {\n  };\n  let context = {\n    key: options.key || defaultGetKey,\n    lookahead: options.lookahead || false,\n    updating: options.updating || noop,\n    updated: options.updated || noop,\n    removing: options.removing || noop,\n    removed: options.removed || noop,\n    adding: options.adding || noop,\n    added: options.added || noop\n  };\n  context.patch = function(from, to) {\n    if (context.differentElementNamesTypesOrKeys(from, to)) {\n      return context.swapElements(from, to);\n    }\n    let updateChildrenOnly = false;\n    let skipChildren = false;\n    let skipUntil = (predicate) => context.skipUntilCondition = predicate;\n    if (shouldSkipChildren(context.updating, () => skipChildren = true, skipUntil, from, to, () => updateChildrenOnly = true))\n      return;\n    if (from.nodeType === 1 && window.Alpine) {\n      window.Alpine.cloneNode(from, to);\n      if (from._x_teleport && to._x_teleport) {\n        context.patch(from._x_teleport, to._x_teleport);\n      }\n    }\n    if (textOrComment(to)) {\n      context.patchNodeValue(from, to);\n      context.updated(from, to);\n      return;\n    }\n    if (!updateChildrenOnly) {\n      context.patchAttributes(from, to);\n    }\n    context.updated(from, to);\n    if (!skipChildren) {\n      context.patchChildren(from, to);\n    }\n  };\n  context.differentElementNamesTypesOrKeys = function(from, to) {\n    return from.nodeType != to.nodeType || from.nodeName != to.nodeName || context.getKey(from) != context.getKey(to);\n  };\n  context.swapElements = function(from, to) {\n    if (shouldSkip(context.removing, from))\n      return;\n    let toCloned = to.cloneNode(true);\n    if (shouldSkip(context.adding, toCloned))\n      return;\n    from.replaceWith(toCloned);\n    context.removed(from);\n    context.added(toCloned);\n  };\n  context.patchNodeValue = function(from, to) {\n    let value = to.nodeValue;\n    if (from.nodeValue !== value) {\n      from.nodeValue = value;\n    }\n  };\n  context.patchAttributes = function(from, to) {\n    if (from._x_transitioning)\n      return;\n    if (from._x_isShown && !to._x_isShown) {\n      return;\n    }\n    if (!from._x_isShown && to._x_isShown) {\n      return;\n    }\n    let domAttributes = Array.from(from.attributes);\n    let toAttributes = Array.from(to.attributes);\n    for (let i = domAttributes.length - 1; i >= 0; i--) {\n      let name = domAttributes[i].name;\n      if (!to.hasAttribute(name)) {\n        if (name === \"open\" && from.nodeName === \"DIALOG\" && from.open) {\n          from.close();\n        } else {\n          from.removeAttribute(name);\n        }\n      }\n    }\n    for (let i = toAttributes.length - 1; i >= 0; i--) {\n      let name = toAttributes[i].name;\n      let value = toAttributes[i].value;\n      if (from.getAttribute(name) !== value) {\n        from.setAttribute(name, value);\n      }\n    }\n  };\n  context.patchChildren = function(from, to) {\n    let fromKeys = context.keyToMap(from.children);\n    let fromKeyHoldovers = {};\n    let currentTo = getFirstNode(to);\n    let currentFrom = getFirstNode(from);\n    while (currentTo) {\n      seedingMatchingId(currentTo, currentFrom);\n      let toKey = context.getKey(currentTo);\n      let fromKey = context.getKey(currentFrom);\n      if (context.skipUntilCondition) {\n        let fromDone = !currentFrom || context.skipUntilCondition(currentFrom);\n        let toDone = !currentTo || context.skipUntilCondition(currentTo);\n        if (fromDone && toDone) {\n          context.skipUntilCondition = null;\n        } else {\n          if (!fromDone)\n            currentFrom = currentFrom && getNextSibling(from, currentFrom);\n          if (!toDone)\n            currentTo = currentTo && getNextSibling(to, currentTo);\n          continue;\n        }\n      }\n      if (!currentFrom) {\n        if (toKey && fromKeyHoldovers[toKey]) {\n          let holdover = fromKeyHoldovers[toKey];\n          from.appendChild(holdover);\n          currentFrom = holdover;\n          fromKey = context.getKey(currentFrom);\n        } else {\n          if (!shouldSkip(context.adding, currentTo)) {\n            let clone = currentTo.cloneNode(true);\n            from.appendChild(clone);\n            context.added(clone);\n          }\n          currentTo = getNextSibling(to, currentTo);\n          continue;\n        }\n      }\n      let isIf = (node) => node && node.nodeType === 8 && node.textContent === \"[if BLOCK]><![endif]\";\n      let isEnd = (node) => node && node.nodeType === 8 && node.textContent === \"[if ENDBLOCK]><![endif]\";\n      if (isIf(currentTo) && isIf(currentFrom)) {\n        let nestedIfCount = 0;\n        let fromBlockStart = currentFrom;\n        while (currentFrom) {\n          let next = getNextSibling(from, currentFrom);\n          if (isIf(next)) {\n            nestedIfCount++;\n          } else if (isEnd(next) && nestedIfCount > 0) {\n            nestedIfCount--;\n          } else if (isEnd(next) && nestedIfCount === 0) {\n            currentFrom = next;\n            break;\n          }\n          currentFrom = next;\n        }\n        let fromBlockEnd = currentFrom;\n        nestedIfCount = 0;\n        let toBlockStart = currentTo;\n        while (currentTo) {\n          let next = getNextSibling(to, currentTo);\n          if (isIf(next)) {\n            nestedIfCount++;\n          } else if (isEnd(next) && nestedIfCount > 0) {\n            nestedIfCount--;\n          } else if (isEnd(next) && nestedIfCount === 0) {\n            currentTo = next;\n            break;\n          }\n          currentTo = next;\n        }\n        let toBlockEnd = currentTo;\n        let fromBlock = new Block(fromBlockStart, fromBlockEnd);\n        let toBlock = new Block(toBlockStart, toBlockEnd);\n        context.patchChildren(fromBlock, toBlock);\n        continue;\n      }\n      if (currentFrom.nodeType === 1 && context.lookahead && !currentFrom.isEqualNode(currentTo)) {\n        let nextToElementSibling = getNextSibling(to, currentTo);\n        let found = false;\n        while (!found && nextToElementSibling) {\n          if (nextToElementSibling.nodeType === 1 && currentFrom.isEqualNode(nextToElementSibling)) {\n            found = true;\n            currentFrom = context.addNodeBefore(from, currentTo, currentFrom);\n            fromKey = context.getKey(currentFrom);\n          }\n          nextToElementSibling = getNextSibling(to, nextToElementSibling);\n        }\n      }\n      if (toKey !== fromKey) {\n        if (!toKey && fromKey) {\n          fromKeyHoldovers[fromKey] = currentFrom;\n          currentFrom = context.addNodeBefore(from, currentTo, currentFrom);\n          fromKeyHoldovers[fromKey].remove();\n          currentFrom = getNextSibling(from, currentFrom);\n          currentTo = getNextSibling(to, currentTo);\n          continue;\n        }\n        if (toKey && !fromKey) {\n          if (fromKeys[toKey]) {\n            currentFrom.replaceWith(fromKeys[toKey]);\n            currentFrom = fromKeys[toKey];\n            fromKey = context.getKey(currentFrom);\n          }\n        }\n        if (toKey && fromKey) {\n          let fromKeyNode = fromKeys[toKey];\n          if (fromKeyNode) {\n            fromKeyHoldovers[fromKey] = currentFrom;\n            currentFrom.replaceWith(fromKeyNode);\n            currentFrom = fromKeyNode;\n            fromKey = context.getKey(currentFrom);\n          } else {\n            fromKeyHoldovers[fromKey] = currentFrom;\n            currentFrom = context.addNodeBefore(from, currentTo, currentFrom);\n            fromKeyHoldovers[fromKey].remove();\n            currentFrom = getNextSibling(from, currentFrom);\n            currentTo = getNextSibling(to, currentTo);\n            continue;\n          }\n        }\n      }\n      let currentFromNext = currentFrom && getNextSibling(from, currentFrom);\n      context.patch(currentFrom, currentTo);\n      currentTo = currentTo && getNextSibling(to, currentTo);\n      currentFrom = currentFromNext;\n    }\n    let removals = [];\n    while (currentFrom) {\n      if (!shouldSkip(context.removing, currentFrom))\n        removals.push(currentFrom);\n      currentFrom = getNextSibling(from, currentFrom);\n    }\n    while (removals.length) {\n      let domForRemoval = removals.shift();\n      domForRemoval.remove();\n      context.removed(domForRemoval);\n    }\n  };\n  context.getKey = function(el) {\n    return el && el.nodeType === 1 && context.key(el);\n  };\n  context.keyToMap = function(els) {\n    let map = {};\n    for (let el of els) {\n      let theKey = context.getKey(el);\n      if (theKey) {\n        map[theKey] = el;\n      }\n    }\n    return map;\n  };\n  context.addNodeBefore = function(parent, node, beforeMe) {\n    if (!shouldSkip(context.adding, node)) {\n      let clone = node.cloneNode(true);\n      parent.insertBefore(clone, beforeMe);\n      context.added(clone);\n      return clone;\n    }\n    return node;\n  };\n  return context;\n}\nmorph.step = () => {\n};\nmorph.log = () => {\n};\nfunction shouldSkip(hook, ...args) {\n  let skip = false;\n  hook(...args, () => skip = true);\n  return skip;\n}\nfunction shouldSkipChildren(hook, skipChildren, skipUntil, ...args) {\n  let skip = false;\n  hook(...args, () => skip = true, skipChildren, skipUntil);\n  return skip;\n}\nvar patched = false;\nfunction createElement(html) {\n  const template = document.createElement(\"template\");\n  template.innerHTML = html;\n  return template.content.firstElementChild;\n}\nfunction textOrComment(el) {\n  return el.nodeType === 3 || el.nodeType === 8;\n}\nvar Block = class {\n  constructor(start, end) {\n    this.startComment = start;\n    this.endComment = end;\n  }\n  get children() {\n    let children = [];\n    let currentNode = this.startComment.nextSibling;\n    while (currentNode && currentNode !== this.endComment) {\n      children.push(currentNode);\n      currentNode = currentNode.nextSibling;\n    }\n    return children;\n  }\n  appendChild(child) {\n    this.endComment.before(child);\n  }\n  get firstChild() {\n    let first = this.startComment.nextSibling;\n    if (first === this.endComment)\n      return;\n    return first;\n  }\n  nextNode(reference) {\n    let next = reference.nextSibling;\n    if (next === this.endComment)\n      return;\n    return next;\n  }\n  insertBefore(newNode, reference) {\n    reference.before(newNode);\n    return newNode;\n  }\n};\nfunction getFirstNode(parent) {\n  return parent.firstChild;\n}\nfunction getNextSibling(parent, reference) {\n  let next;\n  if (parent instanceof Block) {\n    next = parent.nextNode(reference);\n  } else {\n    next = reference.nextSibling;\n  }\n  return next;\n}\nfunction monkeyPatchDomSetAttributeToAllowAtSymbols() {\n  if (patched)\n    return;\n  patched = true;\n  let original = Element.prototype.setAttribute;\n  let hostDiv = document.createElement(\"div\");\n  Element.prototype.setAttribute = function newSetAttribute(name, value) {\n    if (!name.includes(\"@\")) {\n      return original.call(this, name, value);\n    }\n    let escapedValue = value.replace(/&/g, \"&amp;\").replace(/\"/g, \"&quot;\");\n    hostDiv.innerHTML = `<span ${name}=\"${escapedValue}\"></span>`;\n    let attr = hostDiv.firstElementChild.getAttributeNode(name);\n    hostDiv.firstElementChild.removeAttributeNode(attr);\n    this.setAttributeNode(attr);\n  };\n}\nfunction seedingMatchingId(to, from) {\n  let fromId = from && from._x_bindings && from._x_bindings.id;\n  if (!fromId)\n    return;\n  if (!to.setAttribute)\n    return;\n  to.setAttribute(\"id\", fromId);\n  to.id = fromId;\n}\n\n// packages/morph/src/index.js\nfunction src_default(Alpine) {\n  Alpine.morph = morph;\n  Alpine.morphBetween = morphBetween;\n}\n\n// packages/morph/builds/module.js\nvar module_default = src_default;\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  morph\n});\n"]}