or --> TEXT)\n if (morphedNodeType === ELEMENT_NODE) {\n if (toNodeType === ELEMENT_NODE) {\n if (!compareNodeNames(fromNode, toNode)) {\n onNodeDiscarded(fromNode);\n morphedNode = moveChildren(fromNode, createElementNS(toNode.nodeName, toNode.namespaceURI));\n }\n } else {\n // Going from an element node to a text node\n morphedNode = toNode;\n }\n } else if (morphedNodeType === TEXT_NODE || morphedNodeType === COMMENT_NODE) { // Text or comment node\n if (toNodeType === morphedNodeType) {\n if (morphedNode.nodeValue !== toNode.nodeValue) {\n morphedNode.nodeValue = toNode.nodeValue;\n }\n\n return morphedNode;\n } else {\n // Text node to something else\n morphedNode = toNode;\n }\n }\n }\n\n if (morphedNode === toNode) {\n // The \"to node\" was not compatible with the \"from node\" so we had to\n // toss out the \"from node\" and use the \"to node\"\n onNodeDiscarded(fromNode);\n } else {\n if (toNode.isSameNode && toNode.isSameNode(morphedNode)) {\n return;\n }\n\n morphEl(morphedNode, toNode, childrenOnly);\n\n // We now need to loop over any keyed nodes that might need to be\n // removed. We only do the removal if we know that the keyed node\n // never found a match. When a keyed node is matched up we remove\n // it out of fromNodesLookup and we use fromNodesLookup to determine\n // if a keyed node has been matched up or not\n if (keyedRemovalList) {\n for (var i=0, len=keyedRemovalList.length; i {\n if(activeElement && activeElement.isSameNode(fromEl) && DOM.isFormInput(fromEl)){\n DOM.mergeFocusedInput(fromEl, toEl)\n return false\n }\n }\n })\n }\n\n constructor(view, container, id, html, streams, targetCID){\n this.view = view\n this.liveSocket = view.liveSocket\n this.container = container\n this.id = id\n this.rootID = view.root.id\n this.html = html\n this.streams = streams\n this.streamInserts = {}\n this.targetCID = targetCID\n this.cidPatch = isCid(this.targetCID)\n this.pendingRemoves = []\n this.phxRemove = this.liveSocket.binding(\"remove\")\n this.callbacks = {\n beforeadded: [], beforeupdated: [], beforephxChildAdded: [],\n afteradded: [], afterupdated: [], afterdiscarded: [], afterphxChildAdded: [],\n aftertransitionsDiscarded: []\n }\n }\n\n before(kind, callback){ this.callbacks[`before${kind}`].push(callback) }\n after(kind, callback){ this.callbacks[`after${kind}`].push(callback) }\n\n trackBefore(kind, ...args){\n this.callbacks[`before${kind}`].forEach(callback => callback(...args))\n }\n\n trackAfter(kind, ...args){\n this.callbacks[`after${kind}`].forEach(callback => callback(...args))\n }\n\n markPrunableContentForRemoval(){\n let phxUpdate = this.liveSocket.binding(PHX_UPDATE)\n DOM.all(this.container, `[${phxUpdate}=${PHX_STREAM}]`, el => el.innerHTML = \"\")\n DOM.all(this.container, `[${phxUpdate}=append] > *, [${phxUpdate}=prepend] > *`, el => {\n el.setAttribute(PHX_PRUNE, \"\")\n })\n }\n\n perform(){\n let {view, liveSocket, container, html} = this\n let targetContainer = this.isCIDPatch() ? this.targetCIDContainer(html) : container\n if(this.isCIDPatch() && !targetContainer){ return }\n\n let focused = liveSocket.getActiveElement()\n let {selectionStart, selectionEnd} = focused && DOM.hasSelectionRange(focused) ? focused : {}\n let phxUpdate = liveSocket.binding(PHX_UPDATE)\n let phxFeedbackFor = liveSocket.binding(PHX_FEEDBACK_FOR)\n let disableWith = liveSocket.binding(PHX_DISABLE_WITH)\n let phxViewportTop = liveSocket.binding(PHX_VIEWPORT_TOP)\n let phxViewportBottom = liveSocket.binding(PHX_VIEWPORT_BOTTOM)\n let phxTriggerExternal = liveSocket.binding(PHX_TRIGGER_ACTION)\n let added = []\n let trackedInputs = []\n let updates = []\n let appendPrependUpdates = []\n\n let externalFormTriggered = null\n\n let diffHTML = liveSocket.time(\"premorph container prep\", () => {\n return this.buildDiffHTML(container, html, phxUpdate, targetContainer)\n })\n\n this.trackBefore(\"added\", container)\n this.trackBefore(\"updated\", container, container)\n\n liveSocket.time(\"morphdom\", () => {\n this.streams.forEach(([ref, inserts, deleteIds, reset]) => {\n Object.entries(inserts).forEach(([key, [streamAt, limit]]) => {\n this.streamInserts[key] = {ref, streamAt, limit}\n })\n if(reset !== undefined){\n DOM.all(container, `[${PHX_STREAM_REF}=\"${ref}\"]`, child => {\n if(!inserts[child.id]){\n this.removeStreamChildElement(child)\n }\n })\n }\n deleteIds.forEach(id => {\n let child = container.querySelector(`[id=\"${id}\"]`)\n if(child){ this.removeStreamChildElement(child) }\n })\n })\n\n morphdom(targetContainer, diffHTML, {\n childrenOnly: targetContainer.getAttribute(PHX_COMPONENT) === null,\n getNodeKey: (node) => {\n return DOM.isPhxDestroyed(node) ? null : node.id\n },\n // skip indexing from children when container is stream\n skipFromChildren: (from) => { return from.getAttribute(phxUpdate) === PHX_STREAM },\n // tell morphdom how to add a child\n addChild: (parent, child) => {\n let {ref, streamAt, limit} = this.getStreamInsert(child)\n if(ref === undefined) { return parent.appendChild(child) }\n\n DOM.putSticky(child, PHX_STREAM_REF, el => el.setAttribute(PHX_STREAM_REF, ref))\n\n // streaming\n if(streamAt === 0){\n parent.insertAdjacentElement(\"afterbegin\", child)\n } else if(streamAt === -1){\n parent.appendChild(child)\n } else if(streamAt > 0){\n let sibling = Array.from(parent.children)[streamAt]\n parent.insertBefore(child, sibling)\n }\n let children = limit !== null && Array.from(parent.children)\n let childrenToRemove = []\n if(limit && limit < 0 && children.length > limit * -1){\n childrenToRemove = children.slice(0, children.length + limit)\n } else if(limit && limit >= 0 && children.length > limit){\n childrenToRemove = children.slice(limit)\n }\n childrenToRemove.forEach(removeChild => {\n // do not remove child as part of limit if we are re-adding it\n if(!this.streamInserts[removeChild.id]){\n this.removeStreamChildElement(removeChild)\n }\n })\n },\n onBeforeNodeAdded: (el) => {\n DOM.maybeAddPrivateHooks(el, phxViewportTop, phxViewportBottom)\n this.trackBefore(\"added\", el)\n return el\n },\n onNodeAdded: (el) => {\n if(el.getAttribute){ this.maybeReOrderStream(el) }\n\n // hack to fix Safari handling of img srcset and video tags\n if(el instanceof HTMLImageElement && el.srcset){\n el.srcset = el.srcset\n } else if(el instanceof HTMLVideoElement && el.autoplay){\n el.play()\n }\n if(DOM.isNowTriggerFormExternal(el, phxTriggerExternal)){\n externalFormTriggered = el\n }\n\n if(el.getAttribute && el.getAttribute(\"name\") && DOM.isFormInput(el)){\n trackedInputs.push(el)\n }\n // nested view handling\n if((DOM.isPhxChild(el) && view.ownsElement(el)) || DOM.isPhxSticky(el) && view.ownsElement(el.parentNode)){\n this.trackAfter(\"phxChildAdded\", el)\n }\n added.push(el)\n },\n onNodeDiscarded: (el) => this.onNodeDiscarded(el),\n onBeforeNodeDiscarded: (el) => {\n if(el.getAttribute && el.getAttribute(PHX_PRUNE) !== null){ return true }\n if(el.parentElement !== null && el.id &&\n DOM.isPhxUpdate(el.parentElement, phxUpdate, [PHX_STREAM, \"append\", \"prepend\"])){\n return false\n }\n if(this.maybePendingRemove(el)){ return false }\n if(this.skipCIDSibling(el)){ return false }\n\n return true\n },\n onElUpdated: (el) => {\n if(DOM.isNowTriggerFormExternal(el, phxTriggerExternal)){\n externalFormTriggered = el\n }\n updates.push(el)\n this.maybeReOrderStream(el)\n },\n onBeforeElUpdated: (fromEl, toEl) => {\n DOM.maybeAddPrivateHooks(toEl, phxViewportTop, phxViewportBottom)\n DOM.cleanChildNodes(toEl, phxUpdate)\n if(this.skipCIDSibling(toEl)){ return false }\n if(DOM.isPhxSticky(fromEl)){ return false }\n if(DOM.isIgnored(fromEl, phxUpdate) || (fromEl.form && fromEl.form.isSameNode(externalFormTriggered))){\n this.trackBefore(\"updated\", fromEl, toEl)\n DOM.mergeAttrs(fromEl, toEl, {isIgnored: true})\n updates.push(fromEl)\n DOM.applyStickyOperations(fromEl)\n return false\n }\n if(fromEl.type === \"number\" && (fromEl.validity && fromEl.validity.badInput)){ return false }\n if(!DOM.syncPendingRef(fromEl, toEl, disableWith)){\n if(DOM.isUploadInput(fromEl)){\n this.trackBefore(\"updated\", fromEl, toEl)\n updates.push(fromEl)\n }\n DOM.applyStickyOperations(fromEl)\n return false\n }\n\n // nested view handling\n if(DOM.isPhxChild(toEl)){\n let prevSession = fromEl.getAttribute(PHX_SESSION)\n DOM.mergeAttrs(fromEl, toEl, {exclude: [PHX_STATIC]})\n if(prevSession !== \"\"){ fromEl.setAttribute(PHX_SESSION, prevSession) }\n fromEl.setAttribute(PHX_ROOT_ID, this.rootID)\n DOM.applyStickyOperations(fromEl)\n return false\n }\n\n // input handling\n DOM.copyPrivates(toEl, fromEl)\n\n let isFocusedFormEl = focused && fromEl.isSameNode(focused) && DOM.isFormInput(fromEl)\n if(isFocusedFormEl && fromEl.type !== \"hidden\"){\n this.trackBefore(\"updated\", fromEl, toEl)\n DOM.mergeFocusedInput(fromEl, toEl)\n DOM.syncAttrsToProps(fromEl)\n updates.push(fromEl)\n DOM.applyStickyOperations(fromEl)\n trackedInputs.push(fromEl)\n return false\n } else {\n if(DOM.isPhxUpdate(toEl, phxUpdate, [\"append\", \"prepend\"])){\n appendPrependUpdates.push(new DOMPostMorphRestorer(fromEl, toEl, toEl.getAttribute(phxUpdate)))\n }\n\n DOM.syncAttrsToProps(toEl)\n DOM.applyStickyOperations(toEl)\n if(toEl.getAttribute(\"name\") && DOM.isFormInput(toEl)){\n trackedInputs.push(toEl)\n }\n this.trackBefore(\"updated\", fromEl, toEl)\n return true\n }\n }\n })\n })\n\n if(liveSocket.isDebugEnabled()){ detectDuplicateIds() }\n\n if(appendPrependUpdates.length > 0){\n liveSocket.time(\"post-morph append/prepend restoration\", () => {\n appendPrependUpdates.forEach(update => update.perform())\n })\n }\n\n trackedInputs.forEach(input => {\n DOM.maybeHideFeedback(targetContainer, input, phxFeedbackFor)\n })\n\n liveSocket.silenceEvents(() => DOM.restoreFocus(focused, selectionStart, selectionEnd))\n DOM.dispatchEvent(document, \"phx:update\")\n added.forEach(el => this.trackAfter(\"added\", el))\n updates.forEach(el => this.trackAfter(\"updated\", el))\n\n this.transitionPendingRemoves()\n\n if(externalFormTriggered){\n liveSocket.unload()\n // use prototype's submit in case there's a form control with name or id of \"submit\"\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n Object.getPrototypeOf(externalFormTriggered).submit.call(externalFormTriggered)\n }\n return true\n }\n\n onNodeDiscarded(el){\n // nested view handling\n if(DOM.isPhxChild(el) || DOM.isPhxSticky(el)){ this.liveSocket.destroyViewByEl(el) }\n this.trackAfter(\"discarded\", el)\n }\n\n maybePendingRemove(node){\n if(node.getAttribute && node.getAttribute(this.phxRemove) !== null){\n this.pendingRemoves.push(node)\n return true\n } else {\n return false\n }\n }\n\n removeStreamChildElement(child){\n if(!this.maybePendingRemove(child)){\n child.remove()\n this.onNodeDiscarded(child)\n }\n }\n\n getStreamInsert(el){\n let insert = el.id ? this.streamInserts[el.id] : {}\n return insert || {}\n }\n\n maybeReOrderStream(el){\n let {ref, streamAt, limit} = this.getStreamInsert(el)\n if(streamAt === undefined){ return }\n\n // we need to the PHX_STREAM_REF here as well as addChild is invoked only for parents\n DOM.putSticky(el, PHX_STREAM_REF, el => el.setAttribute(PHX_STREAM_REF, ref))\n\n if(streamAt === 0){\n el.parentElement.insertBefore(el, el.parentElement.firstElementChild)\n } else if(streamAt > 0){\n let children = Array.from(el.parentElement.children)\n let oldIndex = children.indexOf(el)\n if(streamAt >= children.length - 1){\n el.parentElement.appendChild(el)\n } else {\n let sibling = children[streamAt]\n if(oldIndex > streamAt){\n el.parentElement.insertBefore(el, sibling)\n } else {\n el.parentElement.insertBefore(el, sibling.nextElementSibling)\n }\n }\n }\n }\n\n transitionPendingRemoves(){\n let {pendingRemoves, liveSocket} = this\n if(pendingRemoves.length > 0){\n liveSocket.transitionRemoves(pendingRemoves)\n liveSocket.requestDOMUpdate(() => {\n pendingRemoves.forEach(el => {\n let child = DOM.firstPhxChild(el)\n if(child){ liveSocket.destroyViewByEl(child) }\n el.remove()\n })\n this.trackAfter(\"transitionsDiscarded\", pendingRemoves)\n })\n }\n }\n\n isCIDPatch(){ return this.cidPatch }\n\n skipCIDSibling(el){\n return el.nodeType === Node.ELEMENT_NODE && el.getAttribute(PHX_SKIP) !== null\n }\n\n targetCIDContainer(html){\n if(!this.isCIDPatch()){ return }\n let [first, ...rest] = DOM.findComponentNodeList(this.container, this.targetCID)\n if(rest.length === 0 && DOM.childNodeLength(html) === 1){\n return first\n } else {\n return first && first.parentNode\n }\n }\n\n // builds HTML for morphdom patch\n // - for full patches of LiveView or a component with a single\n // root node, simply returns the HTML\n // - for patches of a component with multiple root nodes, the\n // parent node becomes the target container and non-component\n // siblings are marked as skip.\n buildDiffHTML(container, html, phxUpdate, targetContainer){\n let isCIDPatch = this.isCIDPatch()\n let isCIDWithSingleRoot = isCIDPatch && targetContainer.getAttribute(PHX_COMPONENT) === this.targetCID.toString()\n if(!isCIDPatch || isCIDWithSingleRoot){\n return html\n } else {\n // component patch with multiple CID roots\n let diffContainer = null\n let template = document.createElement(\"template\")\n diffContainer = DOM.cloneNode(targetContainer)\n let [firstComponent, ...rest] = DOM.findComponentNodeList(diffContainer, this.targetCID)\n template.innerHTML = html\n rest.forEach(el => el.remove())\n Array.from(diffContainer.childNodes).forEach(child => {\n // we can only skip trackable nodes with an ID\n if(child.id && child.nodeType === Node.ELEMENT_NODE && child.getAttribute(PHX_COMPONENT) !== this.targetCID.toString()){\n child.setAttribute(PHX_SKIP, \"\")\n child.innerHTML = \"\"\n }\n })\n Array.from(template.content.childNodes).forEach(el => diffContainer.insertBefore(el, firstComponent))\n firstComponent.remove()\n return diffContainer.outerHTML\n }\n }\n\n indexOf(parent, child){ return Array.from(parent.children).indexOf(child) }\n}\n", "import {\n COMPONENTS,\n DYNAMICS,\n TEMPLATES,\n EVENTS,\n PHX_COMPONENT,\n PHX_SKIP,\n REPLY,\n STATIC,\n TITLE,\n STREAM,\n} from \"./constants\"\n\nimport {\n isObject,\n logError,\n isCid,\n} from \"./utils\"\n\nexport default class Rendered {\n static extract(diff){\n let {[REPLY]: reply, [EVENTS]: events, [TITLE]: title} = diff\n delete diff[REPLY]\n delete diff[EVENTS]\n delete diff[TITLE]\n return {diff, title, reply: reply || null, events: events || []}\n }\n\n constructor(viewId, rendered){\n this.viewId = viewId\n this.rendered = {}\n this.mergeDiff(rendered)\n }\n\n parentViewId(){ return this.viewId }\n\n toString(onlyCids){\n let [str, streams] = this.recursiveToString(this.rendered, this.rendered[COMPONENTS], onlyCids)\n return [str, streams]\n }\n\n recursiveToString(rendered, components = rendered[COMPONENTS], onlyCids){\n onlyCids = onlyCids ? new Set(onlyCids) : null\n let output = {buffer: \"\", components: components, onlyCids: onlyCids, streams: new Set()}\n this.toOutputBuffer(rendered, null, output)\n return [output.buffer, output.streams]\n }\n\n componentCIDs(diff){ return Object.keys(diff[COMPONENTS] || {}).map(i => parseInt(i)) }\n\n isComponentOnlyDiff(diff){\n if(!diff[COMPONENTS]){ return false }\n return Object.keys(diff).length === 1\n }\n\n getComponent(diff, cid){ return diff[COMPONENTS][cid] }\n\n mergeDiff(diff){\n let newc = diff[COMPONENTS]\n let cache = {}\n delete diff[COMPONENTS]\n this.rendered = this.mutableMerge(this.rendered, diff)\n this.rendered[COMPONENTS] = this.rendered[COMPONENTS] || {}\n\n if(newc){\n let oldc = this.rendered[COMPONENTS]\n\n for(let cid in newc){\n newc[cid] = this.cachedFindComponent(cid, newc[cid], oldc, newc, cache)\n }\n\n for(let cid in newc){ oldc[cid] = newc[cid] }\n diff[COMPONENTS] = newc\n }\n }\n\n cachedFindComponent(cid, cdiff, oldc, newc, cache){\n if(cache[cid]){\n return cache[cid]\n } else {\n let ndiff, stat, scid = cdiff[STATIC]\n\n if(isCid(scid)){\n let tdiff\n\n if(scid > 0){\n tdiff = this.cachedFindComponent(scid, newc[scid], oldc, newc, cache)\n } else {\n tdiff = oldc[-scid]\n }\n\n stat = tdiff[STATIC]\n ndiff = this.cloneMerge(tdiff, cdiff)\n ndiff[STATIC] = stat\n } else {\n ndiff = cdiff[STATIC] !== undefined ? cdiff : this.cloneMerge(oldc[cid] || {}, cdiff)\n }\n\n cache[cid] = ndiff\n return ndiff\n }\n }\n\n mutableMerge(target, source){\n if(source[STATIC] !== undefined){\n return source\n } else {\n this.doMutableMerge(target, source)\n return target\n }\n }\n\n doMutableMerge(target, source){\n for(let key in source){\n let val = source[key]\n let targetVal = target[key]\n let isObjVal = isObject(val)\n if(isObjVal && val[STATIC] === undefined && isObject(targetVal)){\n this.doMutableMerge(targetVal, val)\n } else {\n target[key] = val\n }\n }\n }\n\n cloneMerge(target, source){\n let merged = {...target, ...source}\n for(let key in merged){\n let val = source[key]\n let targetVal = target[key]\n if(isObject(val) && val[STATIC] === undefined && isObject(targetVal)){\n merged[key] = this.cloneMerge(targetVal, val)\n }\n }\n return merged\n }\n\n componentToString(cid){\n let [str, streams] = this.recursiveCIDToString(this.rendered[COMPONENTS], cid, null, false)\n return [str, streams]\n }\n\n pruneCIDs(cids){\n cids.forEach(cid => delete this.rendered[COMPONENTS][cid])\n }\n\n // private\n\n get(){ return this.rendered }\n\n isNewFingerprint(diff = {}){ return !!diff[STATIC] }\n\n templateStatic(part, templates){\n if(typeof (part) === \"number\") {\n return templates[part]\n } else {\n return part\n }\n }\n\n toOutputBuffer(rendered, templates, output){\n if(rendered[DYNAMICS]){ return this.comprehensionToBuffer(rendered, templates, output) }\n let {[STATIC]: statics} = rendered\n statics = this.templateStatic(statics, templates)\n\n output.buffer += statics[0]\n for(let i = 1; i < statics.length; i++){\n this.dynamicToBuffer(rendered[i - 1], templates, output)\n output.buffer += statics[i]\n }\n }\n\n comprehensionToBuffer(rendered, templates, output){\n let {[DYNAMICS]: dynamics, [STATIC]: statics, [STREAM]: stream} = rendered\n let [_ref, _inserts, deleteIds, reset] = stream || [null, {}, [], null]\n statics = this.templateStatic(statics, templates)\n let compTemplates = templates || rendered[TEMPLATES]\n for(let d = 0; d < dynamics.length; d++){\n let dynamic = dynamics[d]\n output.buffer += statics[0]\n for(let i = 1; i < statics.length; i++){\n this.dynamicToBuffer(dynamic[i - 1], compTemplates, output)\n output.buffer += statics[i]\n }\n }\n\n if(stream !== undefined && (rendered[DYNAMICS].length > 0 || deleteIds.length > 0 || reset)){\n delete rendered[STREAM]\n rendered[DYNAMICS] = []\n output.streams.add(stream)\n }\n }\n\n dynamicToBuffer(rendered, templates, output){\n if(typeof (rendered) === \"number\"){\n let [str, streams] = this.recursiveCIDToString(output.components, rendered, output.onlyCids)\n output.buffer += str\n output.streams = new Set([...output.streams, ...streams])\n } else if(isObject(rendered)){\n this.toOutputBuffer(rendered, templates, output)\n } else {\n output.buffer += rendered\n }\n }\n\n recursiveCIDToString(components, cid, onlyCids, allowRootComments = true){\n let component = components[cid] || logError(`no component for CID ${cid}`, components)\n let template = document.createElement(\"template\")\n let [html, streams] = this.recursiveToString(component, components, onlyCids)\n template.innerHTML = html\n let container = template.content\n let skip = onlyCids && !onlyCids.has(cid)\n\n let [hasChildNodes, hasChildComponents] =\n Array.from(container.childNodes).reduce(([hasNodes, hasComponents], child, i) => {\n if(child.nodeType === Node.ELEMENT_NODE){\n if(child.getAttribute(PHX_COMPONENT)){\n return [hasNodes, true]\n }\n child.setAttribute(PHX_COMPONENT, cid)\n if(!child.id){ child.id = `${this.parentViewId()}-${cid}-${i}` }\n if(skip){\n child.setAttribute(PHX_SKIP, \"\")\n child.innerHTML = \"\"\n }\n return [true, hasComponents]\n } else if(child.nodeType === Node.COMMENT_NODE){\n // we have to strip root comments when rendering a component directly\n // for patching because the morphdom target must be exactly the root entrypoint\n if(!allowRootComments){ child.remove() }\n return [hasNodes, hasComponents]\n } else {\n if(child.nodeValue.trim() !== \"\"){\n logError(\"only HTML element tags are allowed at the root of components.\\n\\n\" +\n `got: \"${child.nodeValue.trim()}\"\\n\\n` +\n \"within:\\n\", template.innerHTML.trim())\n child.replaceWith(this.createSpan(child.nodeValue, cid))\n return [true, hasComponents]\n } else {\n child.remove()\n return [hasNodes, hasComponents]\n }\n }\n }, [false, false])\n\n if(!hasChildNodes && !hasChildComponents){\n logError(\"expected at least one HTML element tag inside a component, but the component is empty:\\n\",\n template.innerHTML.trim())\n return [this.createSpan(\"\", cid).outerHTML, streams]\n } else if(!hasChildNodes && hasChildComponents){\n logError(\"expected at least one HTML element tag directly inside a component, but only subcomponents were found. A component must render at least one HTML tag directly inside itself.\",\n template.innerHTML.trim())\n return [template.innerHTML, streams]\n } else {\n return [template.innerHTML, streams]\n }\n }\n\n createSpan(text, cid){\n let span = document.createElement(\"span\")\n span.innerText = text\n span.setAttribute(PHX_COMPONENT, cid)\n return span\n }\n}", "let viewHookID = 1\nexport default class ViewHook {\n static makeID(){ return viewHookID++ }\n static elementID(el){ return el.phxHookId }\n\n constructor(view, el, callbacks){\n this.__view = view\n this.liveSocket = view.liveSocket\n this.__callbacks = callbacks\n this.__listeners = new Set()\n this.__isDisconnected = false\n this.el = el\n this.el.phxHookId = this.constructor.makeID()\n for(let key in this.__callbacks){ this[key] = this.__callbacks[key] }\n }\n\n __mounted(){ this.mounted && this.mounted() }\n __updated(){ this.updated && this.updated() }\n __beforeUpdate(){ this.beforeUpdate && this.beforeUpdate() }\n __destroyed(){ this.destroyed && this.destroyed() }\n __reconnected(){\n if(this.__isDisconnected){\n this.__isDisconnected = false\n this.reconnected && this.reconnected()\n }\n }\n __disconnected(){\n this.__isDisconnected = true\n this.disconnected && this.disconnected()\n }\n\n pushEvent(event, payload = {}, onReply = function (){ }){\n return this.__view.pushHookEvent(this.el, null, event, payload, onReply)\n }\n\n pushEventTo(phxTarget, event, payload = {}, onReply = function (){ }){\n return this.__view.withinTargets(phxTarget, (view, targetCtx) => {\n return view.pushHookEvent(this.el, targetCtx, event, payload, onReply)\n })\n }\n\n handleEvent(event, callback){\n let callbackRef = (customEvent, bypass) => bypass ? event : callback(customEvent.detail)\n window.addEventListener(`phx:${event}`, callbackRef)\n this.__listeners.add(callbackRef)\n return callbackRef\n }\n\n removeHandleEvent(callbackRef){\n let event = callbackRef(null, true)\n window.removeEventListener(`phx:${event}`, callbackRef)\n this.__listeners.delete(callbackRef)\n }\n\n upload(name, files){\n return this.__view.dispatchUploads(null, name, files)\n }\n\n uploadTo(phxTarget, name, files){\n return this.__view.withinTargets(phxTarget, (view, targetCtx) => {\n view.dispatchUploads(targetCtx, name, files)\n })\n }\n\n __cleanup__(){\n this.__listeners.forEach(callbackRef => this.removeHandleEvent(callbackRef))\n }\n}\n", "import DOM from \"./dom\"\nimport ARIA from \"./aria\"\n\nlet focusStack = null\n\nlet JS = {\n exec(eventType, phxEvent, view, sourceEl, defaults){\n let [defaultKind, defaultArgs] = defaults || [null, {callback: defaults && defaults.callback}]\n let commands = phxEvent.charAt(0) === \"[\" ?\n JSON.parse(phxEvent) : [[defaultKind, defaultArgs]]\n\n\n\n commands.forEach(([kind, args]) => {\n if(kind === defaultKind && defaultArgs.data){\n args.data = Object.assign(args.data || {}, defaultArgs.data)\n args.callback = args.callback || defaultArgs.callback\n }\n this.filterToEls(sourceEl, args).forEach(el => {\n this[`exec_${kind}`](eventType, phxEvent, view, sourceEl, el, args)\n })\n })\n },\n\n isVisible(el){\n return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length > 0)\n },\n\n // private\n\n // commands\n\n exec_exec(eventType, phxEvent, view, sourceEl, el, [attr, to]){\n let nodes = to ? DOM.all(document, to) : [sourceEl]\n nodes.forEach(node => {\n let encodedJS = node.getAttribute(attr)\n if(!encodedJS){ throw new Error(`expected ${attr} to contain JS command on \"${to}\"`) }\n view.liveSocket.execJS(node, encodedJS, eventType)\n })\n },\n\n exec_dispatch(eventType, phxEvent, view, sourceEl, el, {to, event, detail, bubbles}){\n detail = detail || {}\n detail.dispatcher = sourceEl\n DOM.dispatchEvent(el, event, {detail, bubbles})\n },\n\n exec_push(eventType, phxEvent, view, sourceEl, el, args){\n if(!view.isConnected()){ return }\n\n let {event, data, target, page_loading, loading, value, dispatcher, callback} = args\n let pushOpts = {loading, value, target, page_loading: !!page_loading}\n let targetSrc = eventType === \"change\" && dispatcher ? dispatcher : sourceEl\n let phxTarget = target || targetSrc.getAttribute(view.binding(\"target\")) || targetSrc\n view.withinTargets(phxTarget, (targetView, targetCtx) => {\n if(eventType === \"change\"){\n let {newCid, _target} = args\n _target = _target || (DOM.isFormInput(sourceEl) ? sourceEl.name : undefined)\n if(_target){ pushOpts._target = _target }\n targetView.pushInput(sourceEl, targetCtx, newCid, event || phxEvent, pushOpts, callback)\n } else if(eventType === \"submit\"){\n let {submitter} = args\n targetView.submitForm(sourceEl, targetCtx, event || phxEvent, submitter, pushOpts, callback)\n } else {\n targetView.pushEvent(eventType, sourceEl, targetCtx, event || phxEvent, data, pushOpts, callback)\n }\n })\n },\n\n exec_navigate(eventType, phxEvent, view, sourceEl, el, {href, replace}){\n view.liveSocket.historyRedirect(href, replace ? \"replace\" : \"push\")\n },\n\n exec_patch(eventType, phxEvent, view, sourceEl, el, {href, replace}){\n view.liveSocket.pushHistoryPatch(href, replace ? \"replace\" : \"push\", sourceEl)\n },\n\n exec_focus(eventType, phxEvent, view, sourceEl, el){\n window.requestAnimationFrame(() => ARIA.attemptFocus(el))\n },\n\n exec_focus_first(eventType, phxEvent, view, sourceEl, el){\n window.requestAnimationFrame(() => ARIA.focusFirstInteractive(el) || ARIA.focusFirst(el))\n },\n\n exec_push_focus(eventType, phxEvent, view, sourceEl, el){\n window.requestAnimationFrame(() => focusStack = el || sourceEl)\n },\n\n exec_pop_focus(eventType, phxEvent, view, sourceEl, el){\n window.requestAnimationFrame(() => {\n if(focusStack){ focusStack.focus() }\n focusStack = null\n })\n },\n\n exec_add_class(eventType, phxEvent, view, sourceEl, el, {names, transition, time}){\n this.addOrRemoveClasses(el, names, [], transition, time, view)\n },\n\n exec_remove_class(eventType, phxEvent, view, sourceEl, el, {names, transition, time}){\n this.addOrRemoveClasses(el, [], names, transition, time, view)\n },\n\n exec_transition(eventType, phxEvent, view, sourceEl, el, {time, transition}){\n this.addOrRemoveClasses(el, [], [], transition, time, view)\n },\n\n exec_toggle(eventType, phxEvent, view, sourceEl, el, {display, ins, outs, time}){\n this.toggle(eventType, view, el, display, ins, outs, time)\n },\n\n exec_show(eventType, phxEvent, view, sourceEl, el, {display, transition, time}){\n this.show(eventType, view, el, display, transition, time)\n },\n\n exec_hide(eventType, phxEvent, view, sourceEl, el, {display, transition, time}){\n this.hide(eventType, view, el, display, transition, time)\n },\n\n exec_set_attr(eventType, phxEvent, view, sourceEl, el, {attr: [attr, val]}){\n this.setOrRemoveAttrs(el, [[attr, val]], [])\n },\n\n exec_remove_attr(eventType, phxEvent, view, sourceEl, el, {attr}){\n this.setOrRemoveAttrs(el, [], [attr])\n },\n\n // utils for commands\n\n show(eventType, view, el, display, transition, time){\n if(!this.isVisible(el)){\n this.toggle(eventType, view, el, display, transition, null, time)\n }\n },\n\n hide(eventType, view, el, display, transition, time){\n if(this.isVisible(el)){\n this.toggle(eventType, view, el, display, null, transition, time)\n }\n },\n\n toggle(eventType, view, el, display, ins, outs, time){\n let [inClasses, inStartClasses, inEndClasses] = ins || [[], [], []]\n let [outClasses, outStartClasses, outEndClasses] = outs || [[], [], []]\n if(inClasses.length > 0 || outClasses.length > 0){\n if(this.isVisible(el)){\n let onStart = () => {\n this.addOrRemoveClasses(el, outStartClasses, inClasses.concat(inStartClasses).concat(inEndClasses))\n window.requestAnimationFrame(() => {\n this.addOrRemoveClasses(el, outClasses, [])\n window.requestAnimationFrame(() => this.addOrRemoveClasses(el, outEndClasses, outStartClasses))\n })\n }\n el.dispatchEvent(new Event(\"phx:hide-start\"))\n view.transition(time, onStart, () => {\n this.addOrRemoveClasses(el, [], outClasses.concat(outEndClasses))\n DOM.putSticky(el, \"toggle\", currentEl => currentEl.style.display = \"none\")\n el.dispatchEvent(new Event(\"phx:hide-end\"))\n })\n } else {\n if(eventType === \"remove\"){ return }\n let onStart = () => {\n this.addOrRemoveClasses(el, inStartClasses, outClasses.concat(outStartClasses).concat(outEndClasses))\n let stickyDisplay = display || this.defaultDisplay(el)\n DOM.putSticky(el, \"toggle\", currentEl => currentEl.style.display = stickyDisplay)\n window.requestAnimationFrame(() => {\n this.addOrRemoveClasses(el, inClasses, [])\n window.requestAnimationFrame(() => this.addOrRemoveClasses(el, inEndClasses, inStartClasses))\n })\n }\n el.dispatchEvent(new Event(\"phx:show-start\"))\n view.transition(time, onStart, () => {\n this.addOrRemoveClasses(el, [], inClasses.concat(inEndClasses))\n el.dispatchEvent(new Event(\"phx:show-end\"))\n })\n }\n } else {\n if(this.isVisible(el)){\n window.requestAnimationFrame(() => {\n el.dispatchEvent(new Event(\"phx:hide-start\"))\n DOM.putSticky(el, \"toggle\", currentEl => currentEl.style.display = \"none\")\n el.dispatchEvent(new Event(\"phx:hide-end\"))\n })\n } else {\n window.requestAnimationFrame(() => {\n el.dispatchEvent(new Event(\"phx:show-start\"))\n let stickyDisplay = display || this.defaultDisplay(el)\n DOM.putSticky(el, \"toggle\", currentEl => currentEl.style.display = stickyDisplay)\n el.dispatchEvent(new Event(\"phx:show-end\"))\n })\n }\n }\n },\n\n addOrRemoveClasses(el, adds, removes, transition, time, view){\n let [transitionRun, transitionStart, transitionEnd] = transition || [[], [], []]\n if(transitionRun.length > 0){\n let onStart = () => {\n this.addOrRemoveClasses(el, transitionStart, [].concat(transitionRun).concat(transitionEnd))\n window.requestAnimationFrame(() => {\n this.addOrRemoveClasses(el, transitionRun, [])\n window.requestAnimationFrame(() => this.addOrRemoveClasses(el, transitionEnd, transitionStart))\n })\n }\n let onDone = () => this.addOrRemoveClasses(el, adds.concat(transitionEnd), removes.concat(transitionRun).concat(transitionStart))\n return view.transition(time, onStart, onDone)\n }\n\n window.requestAnimationFrame(() => {\n let [prevAdds, prevRemoves] = DOM.getSticky(el, \"classes\", [[], []])\n let keepAdds = adds.filter(name => prevAdds.indexOf(name) < 0 && !el.classList.contains(name))\n let keepRemoves = removes.filter(name => prevRemoves.indexOf(name) < 0 && el.classList.contains(name))\n let newAdds = prevAdds.filter(name => removes.indexOf(name) < 0).concat(keepAdds)\n let newRemoves = prevRemoves.filter(name => adds.indexOf(name) < 0).concat(keepRemoves)\n\n DOM.putSticky(el, \"classes\", currentEl => {\n currentEl.classList.remove(...newRemoves)\n currentEl.classList.add(...newAdds)\n return [newAdds, newRemoves]\n })\n })\n },\n\n setOrRemoveAttrs(el, sets, removes){\n let [prevSets, prevRemoves] = DOM.getSticky(el, \"attrs\", [[], []])\n\n let alteredAttrs = sets.map(([attr, _val]) => attr).concat(removes);\n let newSets = prevSets.filter(([attr, _val]) => !alteredAttrs.includes(attr)).concat(sets);\n let newRemoves = prevRemoves.filter((attr) => !alteredAttrs.includes(attr)).concat(removes);\n\n DOM.putSticky(el, \"attrs\", currentEl => {\n newRemoves.forEach(attr => currentEl.removeAttribute(attr))\n newSets.forEach(([attr, val]) => currentEl.setAttribute(attr, val))\n return [newSets, newRemoves]\n })\n },\n\n hasAllClasses(el, classes){ return classes.every(name => el.classList.contains(name)) },\n\n isToggledOut(el, outClasses){\n return !this.isVisible(el) || this.hasAllClasses(el, outClasses)\n },\n\n filterToEls(sourceEl, {to}){\n return to ? DOM.all(document, to) : [sourceEl]\n },\n\n defaultDisplay(el){\n return {tr: \"table-row\", td: \"table-cell\"}[el.tagName.toLowerCase()] || \"block\"\n }\n}\n\nexport default JS", "import {\n BEFORE_UNLOAD_LOADER_TIMEOUT,\n CHECKABLE_INPUTS,\n CONSECUTIVE_RELOADS,\n PHX_AUTO_RECOVER,\n PHX_COMPONENT,\n PHX_CONNECTED_CLASS,\n PHX_DISABLE_WITH,\n PHX_DISABLE_WITH_RESTORE,\n PHX_DISABLED,\n PHX_LOADING_CLASS,\n PHX_EVENT_CLASSES,\n PHX_ERROR_CLASS,\n PHX_CLIENT_ERROR_CLASS,\n PHX_SERVER_ERROR_CLASS,\n PHX_FEEDBACK_FOR,\n PHX_HAS_SUBMITTED,\n PHX_HOOK,\n PHX_PAGE_LOADING,\n PHX_PARENT_ID,\n PHX_PROGRESS,\n PHX_READONLY,\n PHX_REF,\n PHX_REF_SRC,\n PHX_ROOT_ID,\n PHX_SESSION,\n PHX_STATIC,\n PHX_TRACK_STATIC,\n PHX_TRACK_UPLOADS,\n PHX_UPDATE,\n PHX_UPLOAD_REF,\n PHX_VIEW_SELECTOR,\n PHX_MAIN,\n PHX_MOUNTED,\n PUSH_TIMEOUT,\n PHX_VIEWPORT_TOP,\n PHX_VIEWPORT_BOTTOM,\n} from \"./constants\"\n\nimport {\n clone,\n closestPhxBinding,\n isEmpty,\n isEqualObj,\n logError,\n maybe,\n isCid,\n} from \"./utils\"\n\nimport Browser from \"./browser\"\nimport DOM from \"./dom\"\nimport DOMPatch from \"./dom_patch\"\nimport LiveUploader from \"./live_uploader\"\nimport Rendered from \"./rendered\"\nimport ViewHook from \"./view_hook\"\nimport JS from \"./js\"\n\nlet serializeForm = (form, metadata, onlyNames = []) => {\n let {submitter, ...meta} = metadata\n\n // TODO: Replace with `new FormData(form, submitter)` when supported by latest browsers,\n // and mention `formdata-submitter-polyfill` in the docs.\n let formData = new FormData(form)\n\n // TODO: Remove when FormData constructor supports the submitter argument.\n if(submitter && submitter.hasAttribute(\"name\") && submitter.form && submitter.form === form){\n formData.append(submitter.name, submitter.value)\n }\n\n let toRemove = []\n\n formData.forEach((val, key, _index) => {\n if(val instanceof File){ toRemove.push(key) }\n })\n\n // Cleanup after building fileData\n toRemove.forEach(key => formData.delete(key))\n\n let params = new URLSearchParams()\n for(let [key, val] of formData.entries()){\n if(onlyNames.length === 0 || onlyNames.indexOf(key) >= 0){\n params.append(key, val)\n }\n }\n for(let metaKey in meta){ params.append(metaKey, meta[metaKey]) }\n\n return params.toString()\n}\n\nexport default class View {\n constructor(el, liveSocket, parentView, flash, liveReferer){\n this.isDead = false\n this.liveSocket = liveSocket\n this.flash = flash\n this.parent = parentView\n this.root = parentView ? parentView.root : this\n this.el = el\n this.id = this.el.id\n this.ref = 0\n this.childJoins = 0\n this.loaderTimer = null\n this.pendingDiffs = []\n this.pruningCIDs = []\n this.redirect = false\n this.href = null\n this.joinCount = this.parent ? this.parent.joinCount - 1 : 0\n this.joinPending = true\n this.destroyed = false\n this.joinCallback = function(onDone){ onDone && onDone() }\n this.stopCallback = function(){ }\n this.pendingJoinOps = this.parent ? null : []\n this.viewHooks = {}\n this.uploaders = {}\n this.formSubmits = []\n this.children = this.parent ? null : {}\n this.root.children[this.id] = {}\n this.channel = this.liveSocket.channel(`lv:${this.id}`, () => {\n let url = this.href && this.expandURL(this.href)\n return {\n redirect: this.redirect ? url : undefined,\n url: this.redirect ? undefined : url || undefined,\n params: this.connectParams(liveReferer),\n session: this.getSession(),\n static: this.getStatic(),\n flash: this.flash,\n }\n })\n }\n\n setHref(href){ this.href = href }\n\n setRedirect(href){\n this.redirect = true\n this.href = href\n }\n\n isMain(){ return this.el.hasAttribute(PHX_MAIN) }\n\n connectParams(liveReferer){\n let params = this.liveSocket.params(this.el)\n let manifest =\n DOM.all(document, `[${this.binding(PHX_TRACK_STATIC)}]`)\n .map(node => node.src || node.href).filter(url => typeof (url) === \"string\")\n\n if(manifest.length > 0){ params[\"_track_static\"] = manifest }\n params[\"_mounts\"] = this.joinCount\n params[\"_live_referer\"] = liveReferer\n\n return params\n }\n\n isConnected(){ return this.channel.canPush() }\n\n getSession(){ return this.el.getAttribute(PHX_SESSION) }\n\n getStatic(){\n let val = this.el.getAttribute(PHX_STATIC)\n return val === \"\" ? null : val\n }\n\n destroy(callback = function (){ }){\n this.destroyAllChildren()\n this.destroyed = true\n delete this.root.children[this.id]\n if(this.parent){ delete this.root.children[this.parent.id][this.id] }\n clearTimeout(this.loaderTimer)\n let onFinished = () => {\n callback()\n for(let id in this.viewHooks){\n this.destroyHook(this.viewHooks[id])\n }\n }\n\n DOM.markPhxChildDestroyed(this.el)\n\n this.log(\"destroyed\", () => [\"the child has been removed from the parent\"])\n this.channel.leave()\n .receive(\"ok\", onFinished)\n .receive(\"error\", onFinished)\n .receive(\"timeout\", onFinished)\n }\n\n setContainerClasses(...classes){\n this.el.classList.remove(\n PHX_CONNECTED_CLASS,\n PHX_LOADING_CLASS,\n PHX_ERROR_CLASS,\n PHX_CLIENT_ERROR_CLASS,\n PHX_SERVER_ERROR_CLASS\n )\n this.el.classList.add(...classes)\n }\n\n showLoader(timeout){\n clearTimeout(this.loaderTimer)\n if(timeout){\n this.loaderTimer = setTimeout(() => this.showLoader(), timeout)\n } else {\n for(let id in this.viewHooks){ this.viewHooks[id].__disconnected() }\n this.setContainerClasses(PHX_LOADING_CLASS)\n }\n }\n\n execAll(binding){\n DOM.all(this.el, `[${binding}]`, el => this.liveSocket.execJS(el, el.getAttribute(binding)))\n }\n\n hideLoader(){\n clearTimeout(this.loaderTimer)\n this.setContainerClasses(PHX_CONNECTED_CLASS)\n this.execAll(this.binding(\"connected\"))\n }\n\n triggerReconnected(){\n for(let id in this.viewHooks){ this.viewHooks[id].__reconnected() }\n }\n\n log(kind, msgCallback){\n this.liveSocket.log(this, kind, msgCallback)\n }\n\n transition(time, onStart, onDone = function(){}){\n this.liveSocket.transition(time, onStart, onDone)\n }\n\n withinTargets(phxTarget, callback){\n if(phxTarget instanceof HTMLElement || phxTarget instanceof SVGElement){\n return this.liveSocket.owner(phxTarget, view => callback(view, phxTarget))\n }\n\n if(isCid(phxTarget)){\n let targets = DOM.findComponentNodeList(this.el, phxTarget)\n if(targets.length === 0){\n logError(`no component found matching phx-target of ${phxTarget}`)\n } else {\n callback(this, parseInt(phxTarget))\n }\n } else {\n let targets = Array.from(document.querySelectorAll(phxTarget))\n if(targets.length === 0){ logError(`nothing found matching the phx-target selector \"${phxTarget}\"`) }\n targets.forEach(target => this.liveSocket.owner(target, view => callback(view, target)))\n }\n }\n\n applyDiff(type, rawDiff, callback){\n this.log(type, () => [\"\", clone(rawDiff)])\n let {diff, reply, events, title} = Rendered.extract(rawDiff)\n callback({diff, reply, events})\n if(title){ window.requestAnimationFrame(() => DOM.putTitle(title)) }\n }\n\n onJoin(resp){\n let {rendered, container} = resp\n if(container){\n let [tag, attrs] = container\n this.el = DOM.replaceRootContainer(this.el, tag, attrs)\n }\n this.childJoins = 0\n this.joinPending = true\n this.flash = null\n\n Browser.dropLocal(this.liveSocket.localStorage, window.location.pathname, CONSECUTIVE_RELOADS)\n this.applyDiff(\"mount\", rendered, ({diff, events}) => {\n this.rendered = new Rendered(this.id, diff)\n let [html, streams] = this.renderContainer(null, \"join\")\n this.dropPendingRefs()\n let forms = this.formsForRecovery(html)\n this.joinCount++\n\n if(forms.length > 0){\n forms.forEach(([form, newForm, newCid], i) => {\n this.pushFormRecovery(form, newCid, resp => {\n if(i === forms.length - 1){\n this.onJoinComplete(resp, html, streams, events)\n }\n })\n })\n } else {\n this.onJoinComplete(resp, html, streams, events)\n }\n })\n }\n\n dropPendingRefs(){\n DOM.all(document, `[${PHX_REF_SRC}=\"${this.id}\"][${PHX_REF}]`, el => {\n el.removeAttribute(PHX_REF)\n el.removeAttribute(PHX_REF_SRC)\n })\n }\n\n onJoinComplete({live_patch}, html, streams, events){\n // In order to provide a better experience, we want to join\n // all LiveViews first and only then apply their patches.\n if(this.joinCount > 1 || (this.parent && !this.parent.isJoinPending())){\n return this.applyJoinPatch(live_patch, html, streams, events)\n }\n\n // One downside of this approach is that we need to find phxChildren\n // in the html fragment, instead of directly on the DOM. The fragment\n // also does not include PHX_STATIC, so we need to copy it over from\n // the DOM.\n let newChildren = DOM.findPhxChildrenInFragment(html, this.id).filter(toEl => {\n let fromEl = toEl.id && this.el.querySelector(`[id=\"${toEl.id}\"]`)\n let phxStatic = fromEl && fromEl.getAttribute(PHX_STATIC)\n if(phxStatic){ toEl.setAttribute(PHX_STATIC, phxStatic) }\n return this.joinChild(toEl)\n })\n\n if(newChildren.length === 0){\n if(this.parent){\n this.root.pendingJoinOps.push([this, () => this.applyJoinPatch(live_patch, html, streams, events)])\n this.parent.ackJoin(this)\n } else {\n this.onAllChildJoinsComplete()\n this.applyJoinPatch(live_patch, html, streams, events)\n }\n } else {\n this.root.pendingJoinOps.push([this, () => this.applyJoinPatch(live_patch, html, streams, events)])\n }\n }\n\n attachTrueDocEl(){\n this.el = DOM.byId(this.id)\n this.el.setAttribute(PHX_ROOT_ID, this.root.id)\n }\n\n execNewMounted(){\n let phxViewportTop = this.binding(PHX_VIEWPORT_TOP)\n let phxViewportBottom = this.binding(PHX_VIEWPORT_BOTTOM)\n DOM.all(this.el, `[${phxViewportTop}], [${phxViewportBottom}]`, hookEl => {\n DOM.maybeAddPrivateHooks(hookEl, phxViewportTop, phxViewportBottom)\n this.maybeAddNewHook(hookEl)\n })\n DOM.all(this.el, `[${this.binding(PHX_HOOK)}], [data-phx-${PHX_HOOK}]`, hookEl => {\n this.maybeAddNewHook(hookEl)\n })\n DOM.all(this.el, `[${this.binding(PHX_MOUNTED)}]`, el => this.maybeMounted(el))\n }\n\n applyJoinPatch(live_patch, html, streams, events){\n this.attachTrueDocEl()\n let patch = new DOMPatch(this, this.el, this.id, html, streams, null)\n patch.markPrunableContentForRemoval()\n this.performPatch(patch, false)\n this.joinNewChildren()\n this.execNewMounted()\n\n this.joinPending = false\n this.liveSocket.dispatchEvents(events)\n this.applyPendingUpdates()\n\n if(live_patch){\n let {kind, to} = live_patch\n this.liveSocket.historyPatch(to, kind)\n }\n this.hideLoader()\n if(this.joinCount > 1){ this.triggerReconnected() }\n this.stopCallback()\n }\n\n triggerBeforeUpdateHook(fromEl, toEl){\n this.liveSocket.triggerDOM(\"onBeforeElUpdated\", [fromEl, toEl])\n let hook = this.getHook(fromEl)\n let isIgnored = hook && DOM.isIgnored(fromEl, this.binding(PHX_UPDATE))\n if(hook && !fromEl.isEqualNode(toEl) && !(isIgnored && isEqualObj(fromEl.dataset, toEl.dataset))){\n hook.__beforeUpdate()\n return hook\n }\n }\n\n maybeMounted(el){\n let phxMounted = el.getAttribute(this.binding(PHX_MOUNTED))\n let hasBeenInvoked = phxMounted && DOM.private(el, \"mounted\")\n if(phxMounted && !hasBeenInvoked){\n this.liveSocket.execJS(el, phxMounted)\n DOM.putPrivate(el, \"mounted\", true)\n }\n }\n\n maybeAddNewHook(el, force){\n let newHook = this.addHook(el)\n if(newHook){ newHook.__mounted() }\n }\n\n performPatch(patch, pruneCids){\n let removedEls = []\n let phxChildrenAdded = false\n let updatedHookIds = new Set()\n\n patch.after(\"added\", el => {\n this.liveSocket.triggerDOM(\"onNodeAdded\", [el])\n this.maybeAddNewHook(el)\n if(el.getAttribute){ this.maybeMounted(el) }\n })\n\n patch.after(\"phxChildAdded\", el => {\n if(DOM.isPhxSticky(el)){\n this.liveSocket.joinRootViews()\n } else {\n phxChildrenAdded = true\n }\n })\n\n patch.before(\"updated\", (fromEl, toEl) => {\n let hook = this.triggerBeforeUpdateHook(fromEl, toEl)\n if(hook){ updatedHookIds.add(fromEl.id) }\n })\n\n patch.after(\"updated\", el => {\n if(updatedHookIds.has(el.id)){ this.getHook(el).__updated() }\n })\n\n patch.after(\"discarded\", (el) => {\n if(el.nodeType === Node.ELEMENT_NODE){ removedEls.push(el) }\n })\n\n patch.after(\"transitionsDiscarded\", els => this.afterElementsRemoved(els, pruneCids))\n patch.perform()\n this.afterElementsRemoved(removedEls, pruneCids)\n\n return phxChildrenAdded\n }\n\n afterElementsRemoved(elements, pruneCids){\n let destroyedCIDs = []\n elements.forEach(parent => {\n let components = DOM.all(parent, `[${PHX_COMPONENT}]`)\n let hooks = DOM.all(parent, `[${this.binding(PHX_HOOK)}]`)\n components.concat(parent).forEach(el => {\n let cid = this.componentID(el)\n if(isCid(cid) && destroyedCIDs.indexOf(cid) === -1){ destroyedCIDs.push(cid) }\n })\n hooks.concat(parent).forEach(hookEl => {\n let hook = this.getHook(hookEl)\n hook && this.destroyHook(hook)\n })\n })\n // We should not pruneCids on joins. Otherwise, in case of\n // rejoins, we may notify cids that no longer belong to the\n // current LiveView to be removed.\n if(pruneCids){\n this.maybePushComponentsDestroyed(destroyedCIDs)\n }\n }\n\n joinNewChildren(){\n DOM.findPhxChildren(this.el, this.id).forEach(el => this.joinChild(el))\n }\n\n getChildById(id){ return this.root.children[this.id][id] }\n\n getDescendentByEl(el){\n if(el.id === this.id){\n return this\n } else {\n return this.children[el.getAttribute(PHX_PARENT_ID)][el.id]\n }\n }\n\n destroyDescendent(id){\n for(let parentId in this.root.children){\n for(let childId in this.root.children[parentId]){\n if(childId === id){ return this.root.children[parentId][childId].destroy() }\n }\n }\n }\n\n joinChild(el){\n let child = this.getChildById(el.id)\n if(!child){\n let view = new View(el, this.liveSocket, this)\n this.root.children[this.id][view.id] = view\n view.join()\n this.childJoins++\n return true\n }\n }\n\n isJoinPending(){ return this.joinPending }\n\n ackJoin(_child){\n this.childJoins--\n\n if(this.childJoins === 0){\n if(this.parent){\n this.parent.ackJoin(this)\n } else {\n this.onAllChildJoinsComplete()\n }\n }\n }\n\n onAllChildJoinsComplete(){\n this.joinCallback(() => {\n this.pendingJoinOps.forEach(([view, op]) => {\n if(!view.isDestroyed()){ op() }\n })\n this.pendingJoinOps = []\n })\n }\n\n update(diff, events){\n if(this.isJoinPending() || (this.liveSocket.hasPendingLink() && this.root.isMain())){\n return this.pendingDiffs.push({diff, events})\n }\n\n this.rendered.mergeDiff(diff)\n let phxChildrenAdded = false\n\n // When the diff only contains component diffs, then walk components\n // and patch only the parent component containers found in the diff.\n // Otherwise, patch entire LV container.\n if(this.rendered.isComponentOnlyDiff(diff)){\n this.liveSocket.time(\"component patch complete\", () => {\n let parentCids = DOM.findParentCIDs(this.el, this.rendered.componentCIDs(diff))\n parentCids.forEach(parentCID => {\n if(this.componentPatch(this.rendered.getComponent(diff, parentCID), parentCID)){ phxChildrenAdded = true }\n })\n })\n } else if(!isEmpty(diff)){\n this.liveSocket.time(\"full patch complete\", () => {\n let [html, streams] = this.renderContainer(diff, \"update\")\n let patch = new DOMPatch(this, this.el, this.id, html, streams, null)\n phxChildrenAdded = this.performPatch(patch, true)\n })\n }\n\n this.liveSocket.dispatchEvents(events)\n if(phxChildrenAdded){ this.joinNewChildren() }\n }\n\n renderContainer(diff, kind){\n return this.liveSocket.time(`toString diff (${kind})`, () => {\n let tag = this.el.tagName\n // Don't skip any component in the diff nor any marked as pruned\n // (as they may have been added back)\n let cids = diff ? this.rendered.componentCIDs(diff).concat(this.pruningCIDs) : null\n let [html, streams] = this.rendered.toString(cids)\n return [`<${tag}>${html}${tag}>`, streams]\n })\n }\n\n componentPatch(diff, cid){\n if(isEmpty(diff)) return false\n let [html, streams] = this.rendered.componentToString(cid)\n let patch = new DOMPatch(this, this.el, this.id, html, streams, cid)\n let childrenAdded = this.performPatch(patch, true)\n return childrenAdded\n }\n\n getHook(el){ return this.viewHooks[ViewHook.elementID(el)] }\n\n addHook(el){\n if(ViewHook.elementID(el) || !el.getAttribute){ return }\n let hookName = el.getAttribute(`data-phx-${PHX_HOOK}`) || el.getAttribute(this.binding(PHX_HOOK))\n if(hookName && !this.ownsElement(el)){ return }\n let callbacks = this.liveSocket.getHookCallbacks(hookName)\n\n if(callbacks){\n if(!el.id){ logError(`no DOM ID for hook \"${hookName}\". Hooks require a unique ID on each element.`, el) }\n let hook = new ViewHook(this, el, callbacks)\n this.viewHooks[ViewHook.elementID(hook.el)] = hook\n return hook\n } else if(hookName !== null){\n logError(`unknown hook found for \"${hookName}\"`, el)\n }\n }\n\n destroyHook(hook){\n hook.__destroyed()\n hook.__cleanup__()\n delete this.viewHooks[ViewHook.elementID(hook.el)]\n }\n\n applyPendingUpdates(){\n this.pendingDiffs.forEach(({diff, events}) => this.update(diff, events))\n this.pendingDiffs = []\n this.eachChild(child => child.applyPendingUpdates())\n }\n\n eachChild(callback){\n let children = this.root.children[this.id] || {}\n for(let id in children){ callback(this.getChildById(id)) }\n }\n\n onChannel(event, cb){\n this.liveSocket.onChannel(this.channel, event, resp => {\n if(this.isJoinPending()){\n this.root.pendingJoinOps.push([this, () => cb(resp)])\n } else {\n this.liveSocket.requestDOMUpdate(() => cb(resp))\n }\n })\n }\n\n bindChannel(){\n // The diff event should be handled by the regular update operations.\n // All other operations are queued to be applied only after join.\n this.liveSocket.onChannel(this.channel, \"diff\", (rawDiff) => {\n this.liveSocket.requestDOMUpdate(() => {\n this.applyDiff(\"update\", rawDiff, ({diff, events}) => this.update(diff, events))\n })\n })\n this.onChannel(\"redirect\", ({to, flash}) => this.onRedirect({to, flash}))\n this.onChannel(\"live_patch\", (redir) => this.onLivePatch(redir))\n this.onChannel(\"live_redirect\", (redir) => this.onLiveRedirect(redir))\n this.channel.onError(reason => this.onError(reason))\n this.channel.onClose(reason => this.onClose(reason))\n }\n\n destroyAllChildren(){ this.eachChild(child => child.destroy()) }\n\n onLiveRedirect(redir){\n let {to, kind, flash} = redir\n let url = this.expandURL(to)\n this.liveSocket.historyRedirect(url, kind, flash)\n }\n\n onLivePatch(redir){\n let {to, kind} = redir\n this.href = this.expandURL(to)\n this.liveSocket.historyPatch(to, kind)\n }\n\n expandURL(to){\n return to.startsWith(\"/\") ? `${window.location.protocol}//${window.location.host}${to}` : to\n }\n\n onRedirect({to, flash}){ this.liveSocket.redirect(to, flash) }\n\n isDestroyed(){ return this.destroyed }\n\n joinDead(){ this.isDead = true }\n\n join(callback){\n this.showLoader(this.liveSocket.loaderTimeout)\n this.bindChannel()\n if(this.isMain()){\n this.stopCallback = this.liveSocket.withPageLoading({to: this.href, kind: \"initial\"})\n }\n this.joinCallback = (onDone) => {\n onDone = onDone || function(){}\n callback ? callback(this.joinCount, onDone) : onDone()\n }\n this.liveSocket.wrapPush(this, {timeout: false}, () => {\n return this.channel.join()\n .receive(\"ok\", data => {\n if(!this.isDestroyed()){\n this.liveSocket.requestDOMUpdate(() => this.onJoin(data))\n }\n })\n .receive(\"error\", resp => !this.isDestroyed() && this.onJoinError(resp))\n .receive(\"timeout\", () => !this.isDestroyed() && this.onJoinError({reason: \"timeout\"}))\n })\n }\n\n onJoinError(resp){\n if(resp.reason === \"reload\"){\n this.log(\"error\", () => [`failed mount with ${resp.status}. Falling back to page request`, resp])\n if(this.isMain()){ this.onRedirect({to: this.href}) }\n return\n } else if(resp.reason === \"unauthorized\" || resp.reason === \"stale\"){\n this.log(\"error\", () => [\"unauthorized live_redirect. Falling back to page request\", resp])\n if(this.isMain()){ this.onRedirect({to: this.href}) }\n return\n }\n if(resp.redirect || resp.live_redirect){\n this.joinPending = false\n this.channel.leave()\n }\n if(resp.redirect){ return this.onRedirect(resp.redirect) }\n if(resp.live_redirect){ return this.onLiveRedirect(resp.live_redirect) }\n this.displayError([PHX_LOADING_CLASS, PHX_ERROR_CLASS, PHX_SERVER_ERROR_CLASS])\n this.log(\"error\", () => [\"unable to join\", resp])\n if(this.liveSocket.isConnected()){ this.liveSocket.reloadWithJitter(this) }\n }\n\n onClose(reason){\n if(this.isDestroyed()){ return }\n if(this.liveSocket.hasPendingLink() && reason !== \"leave\"){\n return this.liveSocket.reloadWithJitter(this)\n }\n this.destroyAllChildren()\n this.liveSocket.dropActiveElement(this)\n // document.activeElement can be null in Internet Explorer 11\n if(document.activeElement){ document.activeElement.blur() }\n if(this.liveSocket.isUnloaded()){\n this.showLoader(BEFORE_UNLOAD_LOADER_TIMEOUT)\n }\n }\n\n onError(reason){\n this.onClose(reason)\n if(this.liveSocket.isConnected()){ this.log(\"error\", () => [\"view crashed\", reason]) }\n if(!this.liveSocket.isUnloaded()){\n if(this.liveSocket.isConnected()){\n this.displayError([PHX_LOADING_CLASS, PHX_ERROR_CLASS, PHX_SERVER_ERROR_CLASS])\n } else {\n this.displayError([PHX_LOADING_CLASS, PHX_ERROR_CLASS, PHX_CLIENT_ERROR_CLASS])\n }\n }\n }\n\n displayError(classes){\n if(this.isMain()){ DOM.dispatchEvent(window, \"phx:page-loading-start\", {detail: {to: this.href, kind: \"error\"}}) }\n this.showLoader()\n this.setContainerClasses(...classes)\n this.execAll(this.binding(\"disconnected\"))\n }\n\n pushWithReply(refGenerator, event, payload, onReply = function (){ }){\n if(!this.isConnected()){ return }\n\n let [ref, [el], opts] = refGenerator ? refGenerator() : [null, [], {}]\n let onLoadingDone = function(){ }\n if(opts.page_loading || (el && (el.getAttribute(this.binding(PHX_PAGE_LOADING)) !== null))){\n onLoadingDone = this.liveSocket.withPageLoading({kind: \"element\", target: el})\n }\n\n if(typeof (payload.cid) !== \"number\"){ delete payload.cid }\n return (\n this.liveSocket.wrapPush(this, {timeout: true}, () => {\n return this.channel.push(event, payload, PUSH_TIMEOUT).receive(\"ok\", resp => {\n let finish = (hookReply) => {\n if(resp.redirect){ this.onRedirect(resp.redirect) }\n if(resp.live_patch){ this.onLivePatch(resp.live_patch) }\n if(resp.live_redirect){ this.onLiveRedirect(resp.live_redirect) }\n onLoadingDone()\n onReply(resp, hookReply)\n }\n if(resp.diff){\n this.liveSocket.requestDOMUpdate(() => {\n this.applyDiff(\"update\", resp.diff, ({diff, reply, events}) => {\n if(ref !== null){ this.undoRefs(ref) }\n this.update(diff, events)\n finish(reply)\n })\n })\n } else {\n if(ref !== null){ this.undoRefs(ref) }\n finish(null)\n }\n })\n })\n )\n }\n\n undoRefs(ref){\n if(!this.isConnected()){ return } // exit if external form triggered\n\n DOM.all(document, `[${PHX_REF_SRC}=\"${this.id}\"][${PHX_REF}=\"${ref}\"]`, el => {\n let disabledVal = el.getAttribute(PHX_DISABLED)\n // remove refs\n el.removeAttribute(PHX_REF)\n el.removeAttribute(PHX_REF_SRC)\n // restore inputs\n if(el.getAttribute(PHX_READONLY) !== null){\n el.readOnly = false\n el.removeAttribute(PHX_READONLY)\n }\n if(disabledVal !== null){\n el.disabled = disabledVal === \"true\" ? true : false\n el.removeAttribute(PHX_DISABLED)\n }\n // remove classes\n PHX_EVENT_CLASSES.forEach(className => DOM.removeClass(el, className))\n // restore disables\n let disableRestore = el.getAttribute(PHX_DISABLE_WITH_RESTORE)\n if(disableRestore !== null){\n el.innerText = disableRestore\n el.removeAttribute(PHX_DISABLE_WITH_RESTORE)\n }\n let toEl = DOM.private(el, PHX_REF)\n if(toEl){\n let hook = this.triggerBeforeUpdateHook(el, toEl)\n DOMPatch.patchEl(el, toEl, this.liveSocket.getActiveElement())\n if(hook){ hook.__updated() }\n DOM.deletePrivate(el, PHX_REF)\n }\n })\n }\n\n putRef(elements, event, opts = {}){\n let newRef = this.ref++\n let disableWith = this.binding(PHX_DISABLE_WITH)\n if(opts.loading){ elements = elements.concat(DOM.all(document, opts.loading))}\n\n elements.forEach(el => {\n el.classList.add(`phx-${event}-loading`)\n el.setAttribute(PHX_REF, newRef)\n el.setAttribute(PHX_REF_SRC, this.el.id)\n let disableText = el.getAttribute(disableWith)\n if(disableText !== null){\n if(!el.getAttribute(PHX_DISABLE_WITH_RESTORE)){\n el.setAttribute(PHX_DISABLE_WITH_RESTORE, el.innerText)\n }\n if(disableText !== \"\"){ el.innerText = disableText }\n el.setAttribute(\"disabled\", \"\")\n }\n })\n return [newRef, elements, opts]\n }\n\n componentID(el){\n let cid = el.getAttribute && el.getAttribute(PHX_COMPONENT)\n return cid ? parseInt(cid) : null\n }\n\n targetComponentID(target, targetCtx, opts = {}){\n if(isCid(targetCtx)){ return targetCtx }\n\n let cidOrSelector = target.getAttribute(this.binding(\"target\"))\n if(isCid(cidOrSelector)){\n return parseInt(cidOrSelector)\n } else if(targetCtx && (cidOrSelector !== null || opts.target)){\n return this.closestComponentID(targetCtx)\n } else {\n return null\n }\n }\n\n closestComponentID(targetCtx){\n if(isCid(targetCtx)){\n return targetCtx\n } else if(targetCtx){\n return maybe(targetCtx.closest(`[${PHX_COMPONENT}]`), el => this.ownsElement(el) && this.componentID(el))\n } else {\n return null\n }\n }\n\n pushHookEvent(el, targetCtx, event, payload, onReply){\n if(!this.isConnected()){\n this.log(\"hook\", () => [\"unable to push hook event. LiveView not connected\", event, payload])\n return false\n }\n let [ref, els, opts] = this.putRef([el], \"hook\")\n this.pushWithReply(() => [ref, els, opts], \"event\", {\n type: \"hook\",\n event: event,\n value: payload,\n cid: this.closestComponentID(targetCtx)\n }, (resp, reply) => onReply(reply, ref))\n\n return ref\n }\n\n extractMeta(el, meta, value){\n let prefix = this.binding(\"value-\")\n for(let i = 0; i < el.attributes.length; i++){\n if(!meta){ meta = {} }\n let name = el.attributes[i].name\n if(name.startsWith(prefix)){ meta[name.replace(prefix, \"\")] = el.getAttribute(name) }\n }\n if(el.value !== undefined && !(el instanceof HTMLFormElement)){\n if(!meta){ meta = {} }\n meta.value = el.value\n\n if(el.tagName === \"INPUT\" && CHECKABLE_INPUTS.indexOf(el.type) >= 0 && !el.checked){\n delete meta.value\n }\n }\n if(value){\n if(!meta){ meta = {} }\n for(let key in value){ meta[key] = value[key] }\n }\n return meta\n }\n\n\n pushEvent(type, el, targetCtx, phxEvent, meta, opts = {}, onReply){\n this.pushWithReply(() => this.putRef([el], type, opts), \"event\", {\n type: type,\n event: phxEvent,\n value: this.extractMeta(el, meta, opts.value),\n cid: this.targetComponentID(el, targetCtx, opts)\n }, (resp, reply) => onReply && onReply(reply))\n }\n\n pushFileProgress(fileEl, entryRef, progress, onReply = function (){ }){\n this.liveSocket.withinOwners(fileEl.form, (view, targetCtx) => {\n view.pushWithReply(null, \"progress\", {\n event: fileEl.getAttribute(view.binding(PHX_PROGRESS)),\n ref: fileEl.getAttribute(PHX_UPLOAD_REF),\n entry_ref: entryRef,\n progress: progress,\n cid: view.targetComponentID(fileEl.form, targetCtx)\n }, onReply)\n })\n }\n\n pushInput(inputEl, targetCtx, forceCid, phxEvent, opts, callback){\n let uploads\n let cid = isCid(forceCid) ? forceCid : this.targetComponentID(inputEl.form, targetCtx)\n let refGenerator = () => this.putRef([inputEl, inputEl.form], \"change\", opts)\n let formData\n let meta = this.extractMeta(inputEl.form)\n if(inputEl.getAttribute(this.binding(\"change\"))){\n formData = serializeForm(inputEl.form, {_target: opts._target, ...meta}, [inputEl.name])\n } else {\n formData = serializeForm(inputEl.form, {_target: opts._target, ...meta})\n }\n if(DOM.isUploadInput(inputEl) && inputEl.files && inputEl.files.length > 0){\n LiveUploader.trackFiles(inputEl, Array.from(inputEl.files))\n }\n uploads = LiveUploader.serializeUploads(inputEl)\n\n let event = {\n type: \"form\",\n event: phxEvent,\n value: formData,\n uploads: uploads,\n cid: cid\n }\n this.pushWithReply(refGenerator, \"event\", event, resp => {\n DOM.showError(inputEl, this.liveSocket.binding(PHX_FEEDBACK_FOR))\n if(DOM.isUploadInput(inputEl) && DOM.isAutoUpload(inputEl)){\n if(LiveUploader.filesAwaitingPreflight(inputEl).length > 0){\n let [ref, _els] = refGenerator()\n this.uploadFiles(inputEl.form, targetCtx, ref, cid, (_uploads) => {\n callback && callback(resp)\n this.triggerAwaitingSubmit(inputEl.form)\n })\n }\n } else {\n callback && callback(resp)\n }\n })\n }\n\n triggerAwaitingSubmit(formEl){\n let awaitingSubmit = this.getScheduledSubmit(formEl)\n if(awaitingSubmit){\n let [_el, _ref, _opts, callback] = awaitingSubmit\n this.cancelSubmit(formEl)\n callback()\n }\n }\n\n getScheduledSubmit(formEl){\n return this.formSubmits.find(([el, _ref, _opts, _callback]) => el.isSameNode(formEl))\n }\n\n scheduleSubmit(formEl, ref, opts, callback){\n if(this.getScheduledSubmit(formEl)){ return true }\n this.formSubmits.push([formEl, ref, opts, callback])\n }\n\n cancelSubmit(formEl){\n this.formSubmits = this.formSubmits.filter(([el, ref, _callback]) => {\n if(el.isSameNode(formEl)){\n this.undoRefs(ref)\n return false\n } else {\n return true\n }\n })\n }\n\n disableForm(formEl, opts = {}){\n let filterIgnored = el => {\n let userIgnored = closestPhxBinding(el, `${this.binding(PHX_UPDATE)}=ignore`, el.form)\n return !(userIgnored || closestPhxBinding(el, \"data-phx-update=ignore\", el.form))\n }\n let filterDisables = el => {\n return el.hasAttribute(this.binding(PHX_DISABLE_WITH))\n }\n let filterButton = el => el.tagName == \"BUTTON\"\n\n let filterInput = el => [\"INPUT\", \"TEXTAREA\", \"SELECT\"].includes(el.tagName)\n\n let formElements = Array.from(formEl.elements)\n let disables = formElements.filter(filterDisables)\n let buttons = formElements.filter(filterButton).filter(filterIgnored)\n let inputs = formElements.filter(filterInput).filter(filterIgnored)\n\n buttons.forEach(button => {\n button.setAttribute(PHX_DISABLED, button.disabled)\n button.disabled = true\n })\n inputs.forEach(input => {\n input.setAttribute(PHX_READONLY, input.readOnly)\n input.readOnly = true\n if(input.files){\n input.setAttribute(PHX_DISABLED, input.disabled)\n input.disabled = true\n }\n })\n formEl.setAttribute(this.binding(PHX_PAGE_LOADING), \"\")\n return this.putRef([formEl].concat(disables).concat(buttons).concat(inputs), \"submit\", opts)\n }\n\n pushFormSubmit(formEl, targetCtx, phxEvent, submitter, opts, onReply){\n let refGenerator = () => this.disableForm(formEl, opts)\n let cid = this.targetComponentID(formEl, targetCtx)\n if(LiveUploader.hasUploadsInProgress(formEl)){\n let [ref, _els] = refGenerator()\n let push = () => this.pushFormSubmit(formEl, submitter, targetCtx, phxEvent, opts, onReply)\n return this.scheduleSubmit(formEl, ref, opts, push)\n } else if(LiveUploader.inputsAwaitingPreflight(formEl).length > 0){\n let [ref, els] = refGenerator()\n let proxyRefGen = () => [ref, els, opts]\n this.uploadFiles(formEl, targetCtx, ref, cid, (_uploads) => {\n let meta = this.extractMeta(formEl)\n let formData = serializeForm(formEl, {submitter, ...meta})\n this.pushWithReply(proxyRefGen, \"event\", {\n type: \"form\",\n event: phxEvent,\n value: formData,\n cid: cid\n }, onReply)\n })\n } else if(!(formEl.hasAttribute(PHX_REF) && formEl.classList.contains(\"phx-submit-loading\"))){\n let meta = this.extractMeta(formEl)\n let formData = serializeForm(formEl, {submitter, ...meta})\n this.pushWithReply(refGenerator, \"event\", {\n type: \"form\",\n event: phxEvent,\n value: formData,\n cid: cid\n }, onReply)\n }\n }\n\n uploadFiles(formEl, targetCtx, ref, cid, onComplete){\n let joinCountAtUpload = this.joinCount\n let inputEls = LiveUploader.activeFileInputs(formEl)\n let numFileInputsInProgress = inputEls.length\n\n // get each file input\n inputEls.forEach(inputEl => {\n let uploader = new LiveUploader(inputEl, this, () => {\n numFileInputsInProgress--\n if(numFileInputsInProgress === 0){ onComplete() }\n });\n\n this.uploaders[inputEl] = uploader\n let entries = uploader.entries().map(entry => entry.toPreflightPayload())\n\n let payload = {\n ref: inputEl.getAttribute(PHX_UPLOAD_REF),\n entries: entries,\n cid: this.targetComponentID(inputEl.form, targetCtx)\n }\n\n this.log(\"upload\", () => [\"sending preflight request\", payload])\n\n this.pushWithReply(null, \"allow_upload\", payload, resp => {\n this.log(\"upload\", () => [\"got preflight response\", resp])\n if(resp.error){\n this.undoRefs(ref)\n let [entry_ref, reason] = resp.error\n this.log(\"upload\", () => [`error for entry ${entry_ref}`, reason])\n } else {\n let onError = (callback) => {\n this.channel.onError(() => {\n if(this.joinCount === joinCountAtUpload){ callback() }\n })\n }\n uploader.initAdapterUpload(resp, onError, this.liveSocket)\n }\n })\n })\n }\n\n dispatchUploads(targetCtx, name, filesOrBlobs){\n let targetElement = this.targetCtxElement(targetCtx) || this.el;\n let inputs = DOM.findUploadInputs(targetElement).filter(el => el.name === name)\n if(inputs.length === 0){ logError(`no live file inputs found matching the name \"${name}\"`) }\n else if(inputs.length > 1){ logError(`duplicate live file inputs found matching the name \"${name}\"`) }\n else { DOM.dispatchEvent(inputs[0], PHX_TRACK_UPLOADS, {detail: {files: filesOrBlobs}}) }\n }\n\n targetCtxElement(targetCtx) {\n if(isCid(targetCtx)){\n let [target] = DOM.findComponentNodeList(this.el, targetCtx)\n return target\n } else if(targetCtx) {\n return targetCtx\n } else {\n return null\n }\n }\n\n pushFormRecovery(form, newCid, callback){\n this.liveSocket.withinOwners(form, (view, targetCtx) => {\n let phxChange = this.binding(\"change\")\n let inputs = Array.from(form.elements).filter(el => DOM.isFormInput(el) && el.name && !el.hasAttribute(phxChange))\n if(inputs.length === 0){ return }\n\n // we must clear tracked uploads before recovery as they no longer have valid refs\n inputs.forEach(input => input.hasAttribute(PHX_UPLOAD_REF) && LiveUploader.clearFiles(input))\n let input = inputs.find(el => el.type !== \"hidden\") || inputs[0]\n\n let phxEvent = form.getAttribute(this.binding(PHX_AUTO_RECOVER)) || form.getAttribute(this.binding(\"change\"))\n JS.exec(\"change\", phxEvent, view, input, [\"push\", {_target: input.name, newCid: newCid, callback: callback}])\n })\n }\n\n pushLinkPatch(href, targetEl, callback){\n let linkRef = this.liveSocket.setPendingLink(href)\n let refGen = targetEl ? () => this.putRef([targetEl], \"click\") : null\n let fallback = () => this.liveSocket.redirect(window.location.href)\n let url = href.startsWith(\"/\") ? `${location.protocol}//${location.host}${href}` : href\n\n let push = this.pushWithReply(refGen, \"live_patch\", {url}, resp => {\n this.liveSocket.requestDOMUpdate(() => {\n if(resp.link_redirect){\n this.liveSocket.replaceMain(href, null, callback, linkRef)\n } else {\n if(this.liveSocket.commitPendingLink(linkRef)){\n this.href = href\n }\n this.applyPendingUpdates()\n callback && callback(linkRef)\n }\n })\n })\n\n if(push){\n push.receive(\"timeout\", fallback)\n } else {\n fallback()\n }\n }\n\n formsForRecovery(html){\n if(this.joinCount === 0){ return [] }\n\n let phxChange = this.binding(\"change\")\n let template = document.createElement(\"template\")\n template.innerHTML = html\n\n return (\n DOM.all(this.el, `form[${phxChange}]`)\n .filter(form => form.id && this.ownsElement(form))\n .filter(form => form.elements.length > 0)\n .filter(form => form.getAttribute(this.binding(PHX_AUTO_RECOVER)) !== \"ignore\")\n .map(form => {\n // attribute given via JS module needs to be escaped as it contains the symbols []\",\n // which result in an invalid css selector otherwise.\n const phxChangeValue = form.getAttribute(phxChange).replaceAll(/([\\[\\]\"])/g, '\\\\$1')\n let newForm = template.content.querySelector(`form[id=\"${form.id}\"][${phxChange}=\"${phxChangeValue}\"]`)\n if(newForm){\n return [form, newForm, this.targetComponentID(newForm)]\n } else {\n return [form, form, this.targetComponentID(form)]\n }\n })\n .filter(([form, newForm, newCid]) => newForm)\n )\n }\n\n maybePushComponentsDestroyed(destroyedCIDs){\n let willDestroyCIDs = destroyedCIDs.filter(cid => {\n return DOM.findComponentNodeList(this.el, cid).length === 0\n })\n if(willDestroyCIDs.length > 0){\n this.pruningCIDs.push(...willDestroyCIDs)\n\n this.pushWithReply(null, \"cids_will_destroy\", {cids: willDestroyCIDs}, () => {\n // The cids are either back on the page or they will be fully removed,\n // so we can remove them from the pruningCIDs.\n this.pruningCIDs = this.pruningCIDs.filter(cid => willDestroyCIDs.indexOf(cid) !== -1)\n\n // See if any of the cids we wanted to destroy were added back,\n // if they were added back, we don't actually destroy them.\n let completelyDestroyCIDs = willDestroyCIDs.filter(cid => {\n return DOM.findComponentNodeList(this.el, cid).length === 0\n })\n\n if(completelyDestroyCIDs.length > 0){\n this.pushWithReply(null, \"cids_destroyed\", {cids: completelyDestroyCIDs}, (resp) => {\n this.rendered.pruneCIDs(resp.cids)\n })\n }\n })\n }\n }\n\n ownsElement(el){\n let parentViewEl = el.closest(PHX_VIEW_SELECTOR)\n return el.getAttribute(PHX_PARENT_ID) === this.id ||\n (parentViewEl && parentViewEl.id === this.id) ||\n (!parentViewEl && this.isDead)\n }\n\n submitForm(form, targetCtx, phxEvent, submitter, opts = {}){\n DOM.putPrivate(form, PHX_HAS_SUBMITTED, true)\n let phxFeedback = this.liveSocket.binding(PHX_FEEDBACK_FOR)\n let inputs = Array.from(form.elements)\n inputs.forEach(input => DOM.putPrivate(input, PHX_HAS_SUBMITTED, true))\n this.liveSocket.blurActiveElement(this)\n this.pushFormSubmit(form, targetCtx, phxEvent, submitter, opts, () => {\n inputs.forEach(input => DOM.showError(input, phxFeedback))\n this.liveSocket.restorePreviouslyActiveFocus()\n })\n }\n\n binding(kind){ return this.liveSocket.binding(kind) }\n}\n", "/** Initializes the LiveSocket\n *\n *\n * @param {string} endPoint - The string WebSocket endpoint, ie, `\"wss://example.com/live\"`,\n * `\"/live\"` (inherited host & protocol)\n * @param {Phoenix.Socket} socket - the required Phoenix Socket class imported from \"phoenix\". For example:\n *\n * import {Socket} from \"phoenix\"\n * import {LiveSocket} from \"phoenix_live_view\"\n * let liveSocket = new LiveSocket(\"/live\", Socket, {...})\n *\n * @param {Object} [opts] - Optional configuration. Outside of keys listed below, all\n * configuration is passed directly to the Phoenix Socket constructor.\n * @param {Object} [opts.defaults] - The optional defaults to use for various bindings,\n * such as `phx-debounce`. Supports the following keys:\n *\n * - debounce - the millisecond phx-debounce time. Defaults 300\n * - throttle - the millisecond phx-throttle time. Defaults 300\n *\n * @param {Function} [opts.params] - The optional function for passing connect params.\n * The function receives the element associated with a given LiveView. For example:\n *\n * (el) => {view: el.getAttribute(\"data-my-view-name\", token: window.myToken}\n *\n * @param {string} [opts.bindingPrefix] - The optional prefix to use for all phx DOM annotations.\n * Defaults to \"phx-\".\n * @param {Object} [opts.hooks] - The optional object for referencing LiveView hook callbacks.\n * @param {Object} [opts.uploaders] - The optional object for referencing LiveView uploader callbacks.\n * @param {integer} [opts.loaderTimeout] - The optional delay in milliseconds to wait before apply\n * loading states.\n * @param {integer} [opts.maxReloads] - The maximum reloads before entering failsafe mode.\n * @param {integer} [opts.reloadJitterMin] - The minimum time between normal reload attempts.\n * @param {integer} [opts.reloadJitterMax] - The maximum time between normal reload attempts.\n * @param {integer} [opts.failsafeJitter] - The time between reload attempts in failsafe mode.\n * @param {Function} [opts.viewLogger] - The optional function to log debug information. For example:\n *\n * (view, kind, msg, obj) => console.log(`${view.id} ${kind}: ${msg} - `, obj)\n *\n * @param {Object} [opts.metadata] - The optional object mapping event names to functions for\n * populating event metadata. For example:\n *\n * metadata: {\n * click: (e, el) => {\n * return {\n * ctrlKey: e.ctrlKey,\n * metaKey: e.metaKey,\n * detail: e.detail || 1,\n * }\n * },\n * keydown: (e, el) => {\n * return {\n * key: e.key,\n * ctrlKey: e.ctrlKey,\n * metaKey: e.metaKey,\n * shiftKey: e.shiftKey\n * }\n * }\n * }\n * @param {Object} [opts.sessionStorage] - An optional Storage compatible object\n * Useful when LiveView won't have access to `sessionStorage`. For example, This could\n * happen if a site loads a cross-domain LiveView in an iframe. Example usage:\n *\n * class InMemoryStorage {\n * constructor() { this.storage = {} }\n * getItem(keyName) { return this.storage[keyName] || null }\n * removeItem(keyName) { delete this.storage[keyName] }\n * setItem(keyName, keyValue) { this.storage[keyName] = keyValue }\n * }\n *\n * @param {Object} [opts.localStorage] - An optional Storage compatible object\n * Useful for when LiveView won't have access to `localStorage`.\n * See `opts.sessionStorage` for examples.\n*/\n\nimport {\n BINDING_PREFIX,\n CONSECUTIVE_RELOADS,\n DEFAULTS,\n FAILSAFE_JITTER,\n LOADER_TIMEOUT,\n MAX_RELOADS,\n PHX_DEBOUNCE,\n PHX_DROP_TARGET,\n PHX_HAS_FOCUSED,\n PHX_KEY,\n PHX_LINK_STATE,\n PHX_LIVE_LINK,\n PHX_LV_DEBUG,\n PHX_LV_LATENCY_SIM,\n PHX_LV_PROFILE,\n PHX_MAIN,\n PHX_PARENT_ID,\n PHX_VIEW_SELECTOR,\n PHX_ROOT_ID,\n PHX_THROTTLE,\n PHX_TRACK_UPLOADS,\n PHX_SESSION,\n PHX_FEEDBACK_FOR,\n RELOAD_JITTER_MIN,\n RELOAD_JITTER_MAX,\n PHX_REF,\n} from \"./constants\"\n\nimport {\n clone,\n closestPhxBinding,\n closure,\n debug,\n isObject,\n maybe\n} from \"./utils\"\n\nimport Browser from \"./browser\"\nimport DOM from \"./dom\"\nimport Hooks from \"./hooks\"\nimport LiveUploader from \"./live_uploader\"\nimport View from \"./view\"\nimport JS from \"./js\"\n\nexport default class LiveSocket {\n constructor(url, phxSocket, opts = {}){\n this.unloaded = false\n if(!phxSocket || phxSocket.constructor.name === \"Object\"){\n throw new Error(`\n a phoenix Socket must be provided as the second argument to the LiveSocket constructor. For example:\n\n import {Socket} from \"phoenix\"\n import {LiveSocket} from \"phoenix_live_view\"\n let liveSocket = new LiveSocket(\"/live\", Socket, {...})\n `)\n }\n this.socket = new phxSocket(url, opts)\n this.bindingPrefix = opts.bindingPrefix || BINDING_PREFIX\n this.opts = opts\n this.params = closure(opts.params || {})\n this.viewLogger = opts.viewLogger\n this.metadataCallbacks = opts.metadata || {}\n this.defaults = Object.assign(clone(DEFAULTS), opts.defaults || {})\n this.activeElement = null\n this.prevActive = null\n this.silenced = false\n this.main = null\n this.outgoingMainEl = null\n this.clickStartedAtTarget = null\n this.linkRef = 1\n this.roots = {}\n this.href = window.location.href\n this.pendingLink = null\n this.currentLocation = clone(window.location)\n this.hooks = opts.hooks || {}\n this.uploaders = opts.uploaders || {}\n this.loaderTimeout = opts.loaderTimeout || LOADER_TIMEOUT\n this.reloadWithJitterTimer = null\n this.maxReloads = opts.maxReloads || MAX_RELOADS\n this.reloadJitterMin = opts.reloadJitterMin || RELOAD_JITTER_MIN\n this.reloadJitterMax = opts.reloadJitterMax || RELOAD_JITTER_MAX\n this.failsafeJitter = opts.failsafeJitter || FAILSAFE_JITTER\n this.localStorage = opts.localStorage || window.localStorage\n this.sessionStorage = opts.sessionStorage || window.sessionStorage\n this.boundTopLevelEvents = false\n this.domCallbacks = Object.assign({onNodeAdded: closure(), onBeforeElUpdated: closure()}, opts.dom || {})\n this.transitions = new TransitionSet()\n window.addEventListener(\"pagehide\", _e => {\n this.unloaded = true\n })\n this.socket.onOpen(() => {\n if(this.isUnloaded()){\n // reload page if being restored from back/forward cache and browser does not emit \"pageshow\"\n window.location.reload()\n }\n })\n }\n\n // public\n\n isProfileEnabled(){ return this.sessionStorage.getItem(PHX_LV_PROFILE) === \"true\" }\n\n isDebugEnabled(){ return this.sessionStorage.getItem(PHX_LV_DEBUG) === \"true\" }\n\n isDebugDisabled(){ return this.sessionStorage.getItem(PHX_LV_DEBUG) === \"false\" }\n\n enableDebug(){ this.sessionStorage.setItem(PHX_LV_DEBUG, \"true\") }\n\n enableProfiling(){ this.sessionStorage.setItem(PHX_LV_PROFILE, \"true\") }\n\n disableDebug(){ this.sessionStorage.setItem(PHX_LV_DEBUG, \"false\") }\n\n disableProfiling(){ this.sessionStorage.removeItem(PHX_LV_PROFILE) }\n\n enableLatencySim(upperBoundMs){\n this.enableDebug()\n console.log(\"latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable\")\n this.sessionStorage.setItem(PHX_LV_LATENCY_SIM, upperBoundMs)\n }\n\n disableLatencySim(){ this.sessionStorage.removeItem(PHX_LV_LATENCY_SIM) }\n\n getLatencySim(){\n let str = this.sessionStorage.getItem(PHX_LV_LATENCY_SIM)\n return str ? parseInt(str) : null\n }\n\n getSocket(){ return this.socket }\n\n connect(){\n // enable debug by default if on localhost and not explicitly disabled\n if(window.location.hostname === \"localhost\" && !this.isDebugDisabled()){ this.enableDebug() }\n let doConnect = () => {\n if(this.joinRootViews()){\n this.bindTopLevelEvents()\n this.socket.connect()\n } else if(this.main){\n this.socket.connect()\n } else {\n this.bindTopLevelEvents({dead: true})\n }\n this.joinDeadView()\n }\n if([\"complete\", \"loaded\", \"interactive\"].indexOf(document.readyState) >= 0){\n doConnect()\n } else {\n document.addEventListener(\"DOMContentLoaded\", () => doConnect())\n }\n }\n\n disconnect(callback){\n clearTimeout(this.reloadWithJitterTimer)\n this.socket.disconnect(callback)\n }\n\n replaceTransport(transport){\n clearTimeout(this.reloadWithJitterTimer)\n this.socket.replaceTransport(transport)\n this.connect()\n }\n\n execJS(el, encodedJS, eventType = null){\n this.owner(el, view => JS.exec(eventType, encodedJS, view, el))\n }\n\n // private\n\n execJSHookPush(el, phxEvent, data, callback){\n this.withinOwners(el, view => {\n JS.exec(\"hook\", phxEvent, view, el, [\"push\", {data, callback}])\n })\n }\n\n unload(){\n if(this.unloaded){ return }\n if(this.main && this.isConnected()){ this.log(this.main, \"socket\", () => [\"disconnect for page nav\"]) }\n this.unloaded = true\n this.destroyAllViews()\n this.disconnect()\n }\n\n triggerDOM(kind, args){ this.domCallbacks[kind](...args) }\n\n time(name, func){\n if(!this.isProfileEnabled() || !console.time){ return func() }\n console.time(name)\n let result = func()\n console.timeEnd(name)\n return result\n }\n\n log(view, kind, msgCallback){\n if(this.viewLogger){\n let [msg, obj] = msgCallback()\n this.viewLogger(view, kind, msg, obj)\n } else if(this.isDebugEnabled()){\n let [msg, obj] = msgCallback()\n debug(view, kind, msg, obj)\n }\n }\n\n requestDOMUpdate(callback){\n this.transitions.after(callback)\n }\n\n transition(time, onStart, onDone = function(){}){\n this.transitions.addTransition(time, onStart, onDone)\n }\n\n onChannel(channel, event, cb){\n channel.on(event, data => {\n let latency = this.getLatencySim()\n if(!latency){\n cb(data)\n } else {\n setTimeout(() => cb(data), latency)\n }\n })\n }\n\n wrapPush(view, opts, push){\n let latency = this.getLatencySim()\n let oldJoinCount = view.joinCount\n if(!latency){\n if(this.isConnected() && opts.timeout){\n return push().receive(\"timeout\", () => {\n if(view.joinCount === oldJoinCount && !view.isDestroyed()){\n this.reloadWithJitter(view, () => {\n this.log(view, \"timeout\", () => [\"received timeout while communicating with server. Falling back to hard refresh for recovery\"])\n })\n }\n })\n } else {\n return push()\n }\n }\n\n let fakePush = {\n receives: [],\n receive(kind, cb){ this.receives.push([kind, cb]) }\n }\n setTimeout(() => {\n if(view.isDestroyed()){ return }\n fakePush.receives.reduce((acc, [kind, cb]) => acc.receive(kind, cb), push())\n }, latency)\n return fakePush\n }\n\n reloadWithJitter(view, log){\n clearTimeout(this.reloadWithJitterTimer)\n this.disconnect()\n let minMs = this.reloadJitterMin\n let maxMs = this.reloadJitterMax\n let afterMs = Math.floor(Math.random() * (maxMs - minMs + 1)) + minMs\n let tries = Browser.updateLocal(this.localStorage, window.location.pathname, CONSECUTIVE_RELOADS, 0, count => count + 1)\n if(tries > this.maxReloads){\n afterMs = this.failsafeJitter\n }\n this.reloadWithJitterTimer = setTimeout(() => {\n // if view has recovered, such as transport replaced, then cancel\n if(view.isDestroyed() || view.isConnected()){ return }\n view.destroy()\n log ? log() : this.log(view, \"join\", () => [`encountered ${tries} consecutive reloads`])\n if(tries > this.maxReloads){\n this.log(view, \"join\", () => [`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`])\n }\n if(this.hasPendingLink()){\n window.location = this.pendingLink\n } else {\n window.location.reload()\n }\n }, afterMs)\n }\n\n getHookCallbacks(name){\n return name && name.startsWith(\"Phoenix.\") ? Hooks[name.split(\".\")[1]] : this.hooks[name]\n }\n\n isUnloaded(){ return this.unloaded }\n\n isConnected(){ return this.socket.isConnected() }\n\n getBindingPrefix(){ return this.bindingPrefix }\n\n binding(kind){ return `${this.getBindingPrefix()}${kind}` }\n\n channel(topic, params){ return this.socket.channel(topic, params) }\n\n joinDeadView(){\n let body = document.body\n if(body && !this.isPhxView(body) && !this.isPhxView(document.firstElementChild)){\n let view = this.newRootView(body)\n view.setHref(this.getHref())\n view.joinDead()\n if(!this.main){ this.main = view }\n window.requestAnimationFrame(() => view.execNewMounted())\n }\n }\n\n joinRootViews(){\n let rootsFound = false\n DOM.all(document, `${PHX_VIEW_SELECTOR}:not([${PHX_PARENT_ID}])`, rootEl => {\n if(!this.getRootById(rootEl.id)){\n let view = this.newRootView(rootEl)\n view.setHref(this.getHref())\n view.join()\n if(rootEl.hasAttribute(PHX_MAIN)){ this.main = view }\n }\n rootsFound = true\n })\n return rootsFound\n }\n\n redirect(to, flash){\n this.unload()\n Browser.redirect(to, flash)\n }\n\n replaceMain(href, flash, callback = null, linkRef = this.setPendingLink(href)){\n let liveReferer = this.currentLocation.href\n this.outgoingMainEl = this.outgoingMainEl || this.main.el\n let newMainEl = DOM.cloneNode(this.outgoingMainEl, \"\")\n this.main.showLoader(this.loaderTimeout)\n this.main.destroy()\n\n this.main = this.newRootView(newMainEl, flash, liveReferer)\n this.main.setRedirect(href)\n this.transitionRemoves()\n this.main.join((joinCount, onDone) => {\n if(joinCount === 1 && this.commitPendingLink(linkRef)){\n this.requestDOMUpdate(() => {\n DOM.findPhxSticky(document).forEach(el => newMainEl.appendChild(el))\n this.outgoingMainEl.replaceWith(newMainEl)\n this.outgoingMainEl = null\n callback && requestAnimationFrame(() => callback(linkRef))\n onDone()\n })\n }\n })\n }\n\n transitionRemoves(elements){\n let removeAttr = this.binding(\"remove\")\n elements = elements || DOM.all(document, `[${removeAttr}]`)\n elements.forEach(el => {\n this.execJS(el, el.getAttribute(removeAttr), \"remove\")\n })\n }\n\n isPhxView(el){ return el.getAttribute && el.getAttribute(PHX_SESSION) !== null }\n\n newRootView(el, flash, liveReferer){\n let view = new View(el, this, null, flash, liveReferer)\n this.roots[view.id] = view\n return view\n }\n\n owner(childEl, callback){\n let view = maybe(childEl.closest(PHX_VIEW_SELECTOR), el => this.getViewByEl(el)) || this.main\n if(view){ callback(view) }\n }\n\n withinOwners(childEl, callback){\n this.owner(childEl, view => callback(view, childEl))\n }\n\n getViewByEl(el){\n let rootId = el.getAttribute(PHX_ROOT_ID)\n return maybe(this.getRootById(rootId), root => root.getDescendentByEl(el))\n }\n\n getRootById(id){ return this.roots[id] }\n\n destroyAllViews(){\n for(let id in this.roots){\n this.roots[id].destroy()\n delete this.roots[id]\n }\n this.main = null\n }\n\n destroyViewByEl(el){\n let root = this.getRootById(el.getAttribute(PHX_ROOT_ID))\n if(root && root.id === el.id){\n root.destroy()\n delete this.roots[root.id]\n } else if(root){\n root.destroyDescendent(el.id)\n }\n }\n\n setActiveElement(target){\n if(this.activeElement === target){ return }\n this.activeElement = target\n let cancel = () => {\n if(target === this.activeElement){ this.activeElement = null }\n target.removeEventListener(\"mouseup\", this)\n target.removeEventListener(\"touchend\", this)\n }\n target.addEventListener(\"mouseup\", cancel)\n target.addEventListener(\"touchend\", cancel)\n }\n\n getActiveElement(){\n if(document.activeElement === document.body){\n return this.activeElement || document.activeElement\n } else {\n // document.activeElement can be null in Internet Explorer 11\n return document.activeElement || document.body\n }\n }\n\n dropActiveElement(view){\n if(this.prevActive && view.ownsElement(this.prevActive)){\n this.prevActive = null\n }\n }\n\n restorePreviouslyActiveFocus(){\n if(this.prevActive && this.prevActive !== document.body){\n this.prevActive.focus()\n }\n }\n\n blurActiveElement(){\n this.prevActive = this.getActiveElement()\n if(this.prevActive !== document.body){ this.prevActive.blur() }\n }\n\n bindTopLevelEvents({dead} = {}){\n if(this.boundTopLevelEvents){ return }\n\n this.boundTopLevelEvents = true\n // enter failsafe reload if server has gone away intentionally, such as \"disconnect\" broadcast\n this.socket.onClose(event => {\n // failsafe reload if normal closure and we still have a main LV\n if(event && event.code === 1000 && this.main){ return this.reloadWithJitter(this.main) }\n })\n document.body.addEventListener(\"click\", function (){ }) // ensure all click events bubble for mobile Safari\n window.addEventListener(\"pageshow\", e => {\n if(e.persisted){ // reload page if being restored from back/forward cache\n this.getSocket().disconnect()\n this.withPageLoading({to: window.location.href, kind: \"redirect\"})\n window.location.reload()\n }\n }, true)\n if(!dead){ this.bindNav() }\n this.bindClicks()\n if(!dead){ this.bindForms() }\n this.bind({keyup: \"keyup\", keydown: \"keydown\"}, (e, type, view, targetEl, phxEvent, eventTarget) => {\n let matchKey = targetEl.getAttribute(this.binding(PHX_KEY))\n let pressedKey = e.key && e.key.toLowerCase() // chrome clicked autocompletes send a keydown without key\n if(matchKey && matchKey.toLowerCase() !== pressedKey){ return }\n\n let data = {key: e.key, ...this.eventMeta(type, e, targetEl)}\n JS.exec(type, phxEvent, view, targetEl, [\"push\", {data}])\n })\n this.bind({blur: \"focusout\", focus: \"focusin\"}, (e, type, view, targetEl, phxEvent, eventTarget) => {\n if(!eventTarget){\n let data = {key: e.key, ...this.eventMeta(type, e, targetEl)}\n JS.exec(type, phxEvent, view, targetEl, [\"push\", {data}])\n }\n })\n this.bind({blur: \"blur\", focus: \"focus\"}, (e, type, view, targetEl, targetCtx, phxEvent, phxTarget) => {\n // blur and focus are triggered on document and window. Discard one to avoid dups\n if(phxTarget === \"window\"){\n let data = this.eventMeta(type, e, targetEl)\n JS.exec(type, phxEvent, view, targetEl, [\"push\", {data}])\n }\n })\n window.addEventListener(\"dragover\", e => e.preventDefault())\n window.addEventListener(\"drop\", e => {\n e.preventDefault()\n let dropTargetId = maybe(closestPhxBinding(e.target, this.binding(PHX_DROP_TARGET)), trueTarget => {\n return trueTarget.getAttribute(this.binding(PHX_DROP_TARGET))\n })\n let dropTarget = dropTargetId && document.getElementById(dropTargetId)\n let files = Array.from(e.dataTransfer.files || [])\n if(!dropTarget || dropTarget.disabled || files.length === 0 || !(dropTarget.files instanceof FileList)){ return }\n\n LiveUploader.trackFiles(dropTarget, files, e.dataTransfer)\n dropTarget.dispatchEvent(new Event(\"input\", {bubbles: true}))\n })\n this.on(PHX_TRACK_UPLOADS, e => {\n let uploadTarget = e.target\n if(!DOM.isUploadInput(uploadTarget)){ return }\n let files = Array.from(e.detail.files || []).filter(f => f instanceof File || f instanceof Blob)\n LiveUploader.trackFiles(uploadTarget, files)\n uploadTarget.dispatchEvent(new Event(\"input\", {bubbles: true}))\n })\n }\n\n eventMeta(eventName, e, targetEl){\n let callback = this.metadataCallbacks[eventName]\n return callback ? callback(e, targetEl) : {}\n }\n\n setPendingLink(href){\n this.linkRef++\n this.pendingLink = href\n return this.linkRef\n }\n\n commitPendingLink(linkRef){\n if(this.linkRef !== linkRef){\n return false\n } else {\n this.href = this.pendingLink\n this.pendingLink = null\n return true\n }\n }\n\n getHref(){ return this.href }\n\n hasPendingLink(){ return !!this.pendingLink }\n\n bind(events, callback){\n for(let event in events){\n let browserEventName = events[event]\n\n this.on(browserEventName, e => {\n let binding = this.binding(event)\n let windowBinding = this.binding(`window-${event}`)\n let targetPhxEvent = e.target.getAttribute && e.target.getAttribute(binding)\n if(targetPhxEvent){\n this.debounce(e.target, e, browserEventName, () => {\n this.withinOwners(e.target, view => {\n callback(e, event, view, e.target, targetPhxEvent, null)\n })\n })\n } else {\n DOM.all(document, `[${windowBinding}]`, el => {\n let phxEvent = el.getAttribute(windowBinding)\n this.debounce(el, e, browserEventName, () => {\n this.withinOwners(el, view => {\n callback(e, event, view, el, phxEvent, \"window\")\n })\n })\n })\n }\n })\n }\n }\n\n bindClicks(){\n window.addEventListener(\"click\", e => this.clickStartedAtTarget = e.target)\n this.bindClick(\"click\", \"click\", false)\n this.bindClick(\"mousedown\", \"capture-click\", true)\n }\n\n bindClick(eventName, bindingName, capture){\n let click = this.binding(bindingName)\n window.addEventListener(eventName, e => {\n let target = null\n if(capture){\n target = e.target.matches(`[${click}]`) ? e.target : e.target.querySelector(`[${click}]`)\n } else {\n let clickStartedAtTarget = this.clickStartedAtTarget || e.target\n target = closestPhxBinding(clickStartedAtTarget, click)\n this.dispatchClickAway(e, clickStartedAtTarget)\n this.clickStartedAtTarget = null\n }\n let phxEvent = target && target.getAttribute(click)\n if(!phxEvent){\n if(!capture && DOM.isNewPageClick(e, window.location)){ this.unload() }\n return\n }\n\n if(target.getAttribute(\"href\") === \"#\"){ e.preventDefault() }\n\n // noop if we are in the middle of awaiting an ack for this el already\n if(target.hasAttribute(PHX_REF)){ return }\n\n this.debounce(target, e, \"click\", () => {\n this.withinOwners(target, view => {\n JS.exec(\"click\", phxEvent, view, target, [\"push\", {data: this.eventMeta(\"click\", e, target)}])\n })\n })\n }, capture)\n }\n\n dispatchClickAway(e, clickStartedAt){\n let phxClickAway = this.binding(\"click-away\")\n DOM.all(document, `[${phxClickAway}]`, el => {\n if(!(el.isSameNode(clickStartedAt) || el.contains(clickStartedAt))){\n this.withinOwners(e.target, view => {\n let phxEvent = el.getAttribute(phxClickAway)\n if(JS.isVisible(el)){\n JS.exec(\"click\", phxEvent, view, el, [\"push\", {data: this.eventMeta(\"click\", e, e.target)}])\n }\n })\n }\n })\n }\n\n bindNav(){\n if(!Browser.canPushState()){ return }\n if(history.scrollRestoration){ history.scrollRestoration = \"manual\" }\n let scrollTimer = null\n window.addEventListener(\"scroll\", _e => {\n clearTimeout(scrollTimer)\n scrollTimer = setTimeout(() => {\n Browser.updateCurrentState(state => Object.assign(state, {scroll: window.scrollY}))\n }, 100)\n })\n window.addEventListener(\"popstate\", event => {\n if(!this.registerNewLocation(window.location)){ return }\n let {type, id, root, scroll} = event.state || {}\n let href = window.location.href\n\n DOM.dispatchEvent(window, \"phx:navigate\", {detail: {href, patch: type === \"patch\", pop: true}})\n this.requestDOMUpdate(() => {\n if(this.main.isConnected() && (type === \"patch\" && id === this.main.id)){\n this.main.pushLinkPatch(href, null, () => {\n this.maybeScroll(scroll)\n })\n } else {\n this.replaceMain(href, null, () => {\n if(root){ this.replaceRootHistory() }\n this.maybeScroll(scroll)\n })\n }\n })\n }, false)\n window.addEventListener(\"click\", e => {\n let target = closestPhxBinding(e.target, PHX_LIVE_LINK)\n let type = target && target.getAttribute(PHX_LIVE_LINK)\n if(!type || !this.isConnected() || !this.main || DOM.wantsNewTab(e)){ return }\n\n let href = target.href\n let linkState = target.getAttribute(PHX_LINK_STATE)\n e.preventDefault()\n e.stopImmediatePropagation() // do not bubble click to regular phx-click bindings\n if(this.pendingLink === href){ return }\n\n this.requestDOMUpdate(() => {\n if(type === \"patch\"){\n this.pushHistoryPatch(href, linkState, target)\n } else if(type === \"redirect\"){\n this.historyRedirect(href, linkState)\n } else {\n throw new Error(`expected ${PHX_LIVE_LINK} to be \"patch\" or \"redirect\", got: ${type}`)\n }\n let phxClick = target.getAttribute(this.binding(\"click\"))\n if(phxClick){\n this.requestDOMUpdate(() => this.execJS(target, phxClick, \"click\"))\n }\n })\n }, false)\n }\n\n maybeScroll(scroll) {\n if(typeof(scroll) === \"number\"){\n requestAnimationFrame(() => {\n window.scrollTo(0, scroll)\n }) // the body needs to render before we scroll.\n }\n }\n\n dispatchEvent(event, payload = {}){\n DOM.dispatchEvent(window, `phx:${event}`, {detail: payload})\n }\n\n dispatchEvents(events){\n events.forEach(([event, payload]) => this.dispatchEvent(event, payload))\n }\n\n withPageLoading(info, callback){\n DOM.dispatchEvent(window, \"phx:page-loading-start\", {detail: info})\n let done = () => DOM.dispatchEvent(window, \"phx:page-loading-stop\", {detail: info})\n return callback ? callback(done) : done\n }\n\n pushHistoryPatch(href, linkState, targetEl){\n if(!this.isConnected()){ return Browser.redirect(href) }\n\n this.withPageLoading({to: href, kind: \"patch\"}, done => {\n this.main.pushLinkPatch(href, targetEl, linkRef => {\n this.historyPatch(href, linkState, linkRef)\n done()\n })\n })\n }\n\n historyPatch(href, linkState, linkRef = this.setPendingLink(href)){\n if(!this.commitPendingLink(linkRef)){ return }\n\n Browser.pushState(linkState, {type: \"patch\", id: this.main.id}, href)\n DOM.dispatchEvent(window, \"phx:navigate\", {detail: {patch: true, href, pop: false}})\n this.registerNewLocation(window.location)\n }\n\n historyRedirect(href, linkState, flash){\n // convert to full href if only path prefix\n if(!this.isConnected()){ return Browser.redirect(href, flash) }\n if(/^\\/$|^\\/[^\\/]+.*$/.test(href)){\n let {protocol, host} = window.location\n href = `${protocol}//${host}${href}`\n }\n let scroll = window.scrollY\n this.withPageLoading({to: href, kind: \"redirect\"}, done => {\n this.replaceMain(href, flash, (linkRef) => {\n if(linkRef === this.linkRef){\n Browser.pushState(linkState, {type: \"redirect\", id: this.main.id, scroll: scroll}, href)\n DOM.dispatchEvent(window, \"phx:navigate\", {detail: {href, patch: false, pop: false}})\n this.registerNewLocation(window.location)\n }\n done()\n })\n })\n }\n\n replaceRootHistory(){\n Browser.pushState(\"replace\", {root: true, type: \"patch\", id: this.main.id})\n }\n\n registerNewLocation(newLocation){\n let {pathname, search} = this.currentLocation\n if(pathname + search === newLocation.pathname + newLocation.search){\n return false\n } else {\n this.currentLocation = clone(newLocation)\n return true\n }\n }\n\n bindForms(){\n let iterations = 0\n let externalFormSubmitted = false\n\n // disable forms on submit that track phx-change but perform external submit\n this.on(\"submit\", e => {\n let phxSubmit = e.target.getAttribute(this.binding(\"submit\"))\n let phxChange = e.target.getAttribute(this.binding(\"change\"))\n if(!externalFormSubmitted && phxChange && !phxSubmit){\n externalFormSubmitted = true\n e.preventDefault()\n this.withinOwners(e.target, view => {\n view.disableForm(e.target)\n // safari needs next tick\n window.requestAnimationFrame(() => {\n if(DOM.isUnloadableFormSubmit(e)){ this.unload() }\n e.target.submit()\n })\n })\n }\n }, true)\n\n this.on(\"submit\", e => {\n let phxEvent = e.target.getAttribute(this.binding(\"submit\"))\n if(!phxEvent){\n if(DOM.isUnloadableFormSubmit(e)){ this.unload() }\n return\n }\n e.preventDefault()\n e.target.disabled = true\n this.withinOwners(e.target, view => {\n JS.exec(\"submit\", phxEvent, view, e.target, [\"push\", {submitter: e.submitter}])\n })\n }, false)\n\n for(let type of [\"change\", \"input\"]){\n this.on(type, e => {\n let phxChange = this.binding(\"change\")\n let input = e.target\n let inputEvent = input.getAttribute(phxChange)\n let formEvent = input.form && input.form.getAttribute(phxChange)\n let phxEvent = inputEvent || formEvent\n if(!phxEvent){ return }\n if(input.type === \"number\" && input.validity && input.validity.badInput){ return }\n\n let dispatcher = inputEvent ? input : input.form\n let currentIterations = iterations\n iterations++\n let {at: at, type: lastType} = DOM.private(input, \"prev-iteration\") || {}\n // Browsers should always fire at least one \"input\" event before every \"change\"\n // Ignore \"change\" events, unless there was no prior \"input\" event.\n // This could happen if user code triggers a \"change\" event, or if the browser is non-conforming.\n if(at === currentIterations - 1 && type === \"change\" && lastType === \"input\"){ return }\n\n DOM.putPrivate(input, \"prev-iteration\", {at: currentIterations, type: type})\n\n this.debounce(input, e, type, () => {\n this.withinOwners(dispatcher, view => {\n DOM.putPrivate(input, PHX_HAS_FOCUSED, true)\n if(!DOM.isTextualInput(input)){\n this.setActiveElement(input)\n }\n JS.exec(\"change\", phxEvent, view, input, [\"push\", {_target: e.target.name, dispatcher: dispatcher}])\n })\n })\n }, false)\n }\n this.on(\"reset\", (e) => {\n let form = e.target\n DOM.resetForm(form, this.binding(PHX_FEEDBACK_FOR))\n let input = Array.from(form.elements).find(el => el.type === \"reset\")\n // wait until next tick to get updated input value\n window.requestAnimationFrame(() => {\n input.dispatchEvent(new Event(\"input\", {bubbles: true, cancelable: false}))\n })\n })\n }\n\n debounce(el, event, eventType, callback){\n if(eventType === \"blur\" || eventType === \"focusout\"){ return callback() }\n\n let phxDebounce = this.binding(PHX_DEBOUNCE)\n let phxThrottle = this.binding(PHX_THROTTLE)\n let defaultDebounce = this.defaults.debounce.toString()\n let defaultThrottle = this.defaults.throttle.toString()\n\n this.withinOwners(el, view => {\n let asyncFilter = () => !view.isDestroyed() && document.body.contains(el)\n DOM.debounce(el, event, phxDebounce, defaultDebounce, phxThrottle, defaultThrottle, asyncFilter, () => {\n callback()\n })\n })\n }\n\n silenceEvents(callback){\n this.silenced = true\n callback()\n this.silenced = false\n }\n\n on(event, callback){\n window.addEventListener(event, e => {\n if(!this.silenced){ callback(e) }\n })\n }\n}\n\nclass TransitionSet {\n constructor(){\n this.transitions = new Set()\n this.pendingOps = []\n }\n\n reset(){\n this.transitions.forEach(timer => {\n clearTimeout(timer)\n this.transitions.delete(timer)\n })\n this.flushPendingOps()\n }\n\n after(callback){\n if(this.size() === 0){\n callback()\n } else {\n this.pushPendingOp(callback)\n }\n }\n\n addTransition(time, onStart, onDone){\n onStart()\n let timer = setTimeout(() => {\n this.transitions.delete(timer)\n onDone()\n this.flushPendingOps()\n }, time)\n this.transitions.add(timer)\n }\n\n pushPendingOp(op){ this.pendingOps.push(op) }\n\n size(){ return this.transitions.size }\n\n flushPendingOps(){\n if(this.size() > 0){ return }\n let op = this.pendingOps.shift()\n if(op){\n op()\n this.flushPendingOps()\n }\n }\n}\n"],
- "mappings": ";AAAO,IAAM,sBAAsB;AAC5B,IAAM,cAAc;AACpB,IAAM,oBAAoB;AAC1B,IAAM,oBAAoB;AAC1B,IAAM,kBAAkB;AACxB,IAAM,oBAAoB;AAAA,EAC/B;AAAA,EAAqB;AAAA,EAAsB;AAAA,EAC3C;AAAA,EAAuB;AAAA,EAAqB;AAAA,EAAoB;AAAA;AAE3D,IAAM,gBAAgB;AACtB,IAAM,gBAAgB;AACtB,IAAM,mBAAmB;AACzB,IAAM,iBAAiB;AACvB,IAAM,UAAU;AAChB,IAAM,cAAc;AACpB,IAAM,oBAAoB;AAC1B,IAAM,iBAAiB;AACvB,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AACxB,IAAM,wBAAwB;AAC9B,IAAM,wBAAwB;AAC9B,IAAM,WAAW;AACjB,IAAM,YAAY;AAClB,IAAM,mBAAmB;AACzB,IAAM,sBAAsB;AAC5B,IAAM,oBAAoB;AAC1B,IAAM,wBAAwB;AAC9B,IAAM,kBAAkB;AACxB,IAAM,yBAAyB;AAC/B,IAAM,yBAAyB;AAC/B,IAAM,gBAAgB;AACtB,IAAM,WAAW;AACjB,IAAM,cAAc;AACpB,IAAM,mBAAmB;AACzB,IAAM,sBAAsB;AAC5B,IAAM,qBAAqB;AAC3B,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;AACxB,IAAM,mBAAmB,CAAC,QAAQ,YAAY,UAAU,SAAS,YAAY,UAAU,OAAO,OAAO,QAAQ,QAAQ,kBAAkB,SAAS;AAChJ,IAAM,mBAAmB,CAAC,YAAY;AACtC,IAAM,oBAAoB;AAC1B,IAAM,cAAc;AACpB,I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AAa,iBAAiB,aAAa,iBAAiB,aAAa,MAAM;AACrG;AAAA;AAAA;AAAA;AAAA,EAKN,cAAc,UAAS;AACrB,SAAK,WAAW;AAChB;AACA,SAAK,WAAW;AAAA;AAAA,EAGlB,GAAG,OAAO,UAAS;AACjB,WAAO,iBAAiB,OAAO,OAAK;AAClC,UAAG,CAAC,KAAK,UAAS;AAAE,iBAAS;AAAA;AAAA;AAAA;AAAA;AAKnC,0BAAoB;AAAA,EAClB,cAAa;AACX,SAAK,cAAc,IAAI;AACvB,SAAK,aAAa;AAAA;AAAA,EAGpB,QAAO;AACL,SAAK,YAAY,QAAQ,WAAS;AAChC,mBAAa;AACb,WAAK,YAAY,OAAO;AAAA;AAE1B,SAAK;AAAA;AAAA,EAGP,MAAM,UAAS;AACb,QAAG,KAAK,WAAW,GAAE;AACnB;AAAA,WACK;AACL,WAAK,cAAc;AAAA;AAAA;AAAA,EAIvB,cAAc,MAAM,SAAS,QAAO;AAClC;AACA,QAAI,QAAQ,WAAW,MAAM;AAC3B,WAAK,YAAY,OAAO;AACxB;AACA,WAAK;AAAA,OACJ;AACH,SAAK,YAAY,IAAI;AAAA;AAAA,EAGvB,cAAc,IAAG;AAAE,SAAK,WAAW,KAAK;AAAA;AAAA,EAExC,OAAM;AAAE,WAAO,KAAK,YAAY;AAAA;AAAA,EAEhC,kBAAiB;AACf,QAAG,KAAK,SAAS,GAAE;AAAE;AAAA;AACrB,QAAI,KAAK,KAAK,WAAW;AACzB,QAAG,IAAG;AACJ;AACA,WAAK;AAAA;AAAA;AAAA;",
- "names": []
-}
diff --git a/priv/static/phoenix_live_view.js b/priv/static/phoenix_live_view.js
index 1eb25c5d87..326daa3d47 100644
--- a/priv/static/phoenix_live_view.js
+++ b/priv/static/phoenix_live_view.js
@@ -69,6 +69,7 @@ var LiveView = (() => {
var PHX_ACTIVE_ENTRY_REFS = "data-phx-active-refs";
var PHX_LIVE_FILE_UPDATED = "phx:live-file:updated";
var PHX_SKIP = "data-phx-skip";
+ var PHX_MAGIC_ID = "data-phx-id";
var PHX_PRUNE = "data-phx-prune";
var PHX_PAGE_LOADING = "page-loading";
var PHX_CONNECTED_CLASS = "phx-connected";
@@ -123,6 +124,7 @@ var LiveView = (() => {
};
var DYNAMICS = "d";
var STATIC = "s";
+ var ROOT = "r";
var COMPONENTS = "c";
var EVENTS = "e";
var REPLY = "r";
@@ -1804,9 +1806,6 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
let updates = [];
let appendPrependUpdates = [];
let externalFormTriggered = null;
- let diffHTML = liveSocket.time("premorph container prep", () => {
- return this.buildDiffHTML(container, html, phxUpdate, targetContainer);
- });
this.trackBefore("added", container);
this.trackBefore("updated", container, container);
liveSocket.time("morphdom", () => {
@@ -1828,10 +1827,13 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
}
});
});
- morphdom_esm_default(targetContainer, diffHTML, {
+ morphdom_esm_default(targetContainer, html, {
childrenOnly: targetContainer.getAttribute(PHX_COMPONENT) === null,
getNodeKey: (node) => {
- return dom_default.isPhxDestroyed(node) ? null : node.id;
+ if (dom_default.isPhxDestroyed(node)) {
+ return null;
+ }
+ return node.getAttribute && node.getAttribute(PHX_MAGIC_ID) || node.id;
},
skipFromChildren: (from) => {
return from.getAttribute(phxUpdate) === PHX_STREAM;
@@ -2062,7 +2064,7 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
return this.cidPatch;
}
skipCIDSibling(el) {
- return el.nodeType === Node.ELEMENT_NODE && el.getAttribute(PHX_SKIP) !== null;
+ return el.nodeType === Node.ELEMENT_NODE && el.hasAttribute(PHX_SKIP);
}
targetCIDContainer(html) {
if (!this.isCIDPatch()) {
@@ -2075,35 +2077,99 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
return first && first.parentNode;
}
}
- buildDiffHTML(container, html, phxUpdate, targetContainer) {
- let isCIDPatch = this.isCIDPatch();
- let isCIDWithSingleRoot = isCIDPatch && targetContainer.getAttribute(PHX_COMPONENT) === this.targetCID.toString();
- if (!isCIDPatch || isCIDWithSingleRoot) {
- return html;
- } else {
- let diffContainer = null;
- let template = document.createElement("template");
- diffContainer = dom_default.cloneNode(targetContainer);
- let [firstComponent, ...rest] = dom_default.findComponentNodeList(diffContainer, this.targetCID);
- template.innerHTML = html;
- rest.forEach((el) => el.remove());
- Array.from(diffContainer.childNodes).forEach((child) => {
- if (child.id && child.nodeType === Node.ELEMENT_NODE && child.getAttribute(PHX_COMPONENT) !== this.targetCID.toString()) {
- child.setAttribute(PHX_SKIP, "");
- child.innerHTML = "";
- }
- });
- Array.from(template.content.childNodes).forEach((el) => diffContainer.insertBefore(el, firstComponent));
- firstComponent.remove();
- return diffContainer.outerHTML;
- }
- }
indexOf(parent, child) {
return Array.from(parent.children).indexOf(child);
}
};
// js/phoenix_live_view/rendered.js
+ var VOID_TAGS = new Set([
+ "area",
+ "base",
+ "br",
+ "col",
+ "command",
+ "embed",
+ "hr",
+ "img",
+ "input",
+ "keygen",
+ "link",
+ "meta",
+ "param",
+ "source",
+ "track",
+ "wbr"
+ ]);
+ var endingTagNameChars = new Set([">", "/", " ", "\n", " ", "\r"]);
+ var modifyRoot = (html, attrs, clearInnerHTML) => {
+ let i = 0;
+ let insideComment = false;
+ let beforeTag, afterTag, tag, tagNameEndsAt, newHTML;
+ while (i < html.length) {
+ let char = html.charAt(i);
+ if (insideComment) {
+ if (char === "-" && html.slice(i, i + 3) === "-->") {
+ insideComment = false;
+ i += 3;
+ } else {
+ i++;
+ }
+ } else if (char === "<" && html.slice(i, i + 4) === "