| 1 | (()=>{let e,t=0;function a(){t>0&&t--,0===t&&window.Alpine?.flushAndStopDeferringMutations&&window.Alpine.flushAndStopDeferringMutations()}htmx.registerExtension("alpine-compat",{init:t=>{e=t;let a=e.isSoftMatch;e.isSoftMatch=function(e,t){return e._x_bindings?.id&&t.matches?.("[\\:id], [x-bind\\:id]")?e instanceof Element&&e.tagName===t.tagName:a(e,t)}},htmx_before_swap:(e,a)=>{if(!window.Alpine?.closestDataStack||!window.Alpine?.cloneNode||!window.Alpine?.deferMutations)return;0===t&&window.Alpine.deferMutations(),t++;let{tasks:n}=a;for(let e of n)if("innerMorph"===e.swapSpec.style||"outerMorph"===e.swapSpec.style){if(!e.fragment||!e.target)continue;if(!("string"==typeof e.target?document.querySelector(e.target):e.target))continue}},htmx_before_morph_node:(t,a)=>{if(!window.Alpine?.closestDataStack||!window.Alpine?.cloneNode)return;let{oldNode:n,newNode:i}=a,o=window.Alpine.closestDataStack(n);if(i._x_dataStack=o,n.isConnected&&(window.Alpine.cloneNode(n,i),n._x_teleport&&i._x_teleport)){let t=document.createDocumentFragment();t.append(i._x_teleport),e.morph(n._x_teleport,t,!1)}},htmx_history_cache_before_save:(e,t)=>{window.Alpine?.destroyTree&&(t.target.querySelectorAll("[x-data]").forEach(e=>{e._x_dataStack&&e.setAttribute("data-alpine-state",JSON.stringify(e._x_dataStack[0]))}),window.Alpine.destroyTree(t.target))},htmx_history_cache_after_restore:(e,t)=>{window.Alpine&&document.querySelectorAll("[data-alpine-state]").forEach(e=>{let t=JSON.parse(e.getAttribute("data-alpine-state"));if(e.removeAttribute("data-alpine-state"),e._x_dataStack)for(let a in t)try{e._x_dataStack[0][a]=t[a]}catch{}})},htmx_after_swap:(e,t)=>{t.ctx._alpineFlushed=!0,a()},htmx_finally_request:(e,t)=>{t.ctx._alpineFlushed||a()}})})(); |