Packages
live_svelte
0.3.2
0.18.0
0.18.0-rc0
0.17.4
0.17.3
0.17.2
0.17.1
0.17.0
0.16.0
0.15.0
0.15.0-rc.6
0.15.0-rc.5
0.15.0-rc.4
0.15.0-rc.3
0.15.0-rc.2
0.15.0-rc.1
0.14.1
0.14.0
0.13.3
0.13.3-rc.1
0.13.2
0.13.1
0.13.0
0.12.0
0.11.0
0.10.2
0.10.1
0.10.0
0.9.0
0.9.0-rc2
0.9.0-rc1
0.9.0-rc0
0.8.0
0.7.1
0.7.0
0.6.0
0.5.1
0.5.0
0.5.0-rc0
0.4.2
0.4.2-rc0
0.4.1
0.4.1-rc0
0.4.0
0.3.5
0.3.5-rc1
0.3.5-rc0
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.3.0-rc1
0.3.0-rc0
0.2.0
0.2.0-rc1
0.2.0-rc0
0.1.0
0.1.0-rc5
0.1.0-rc4
0.1.0-rc3
0.1.0-rc2
0.1.0-rc1
0.1.0-rc0
E2E reactivity for Svelte and LiveView
Current section
Files
Jump to
Current section
Files
priv/static/live_svelte.min.js
var LiveSvelte=(()=>{var a=Object.defineProperty,M=Object.defineProperties,D=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var b=(t,e,n)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,w=(t,e)=>{for(var n in e||(e={}))$.call(e,n)&&b(t,n,e[n]);if(g)for(var n of g(e))j.call(e,n)&&b(t,n,e[n]);return t},F=(t,e)=>M(t,T(e));var v=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,n)=>(typeof require!="undefined"?require:e)[n]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var P=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},q=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of N(e))!$.call(t,o)&&o!==n&&a(t,o,{get:()=>e[o],enumerable:!(i=D(e,o))||i.enumerable});return t};var R=t=>q(a({},"__esModule",{value:!0}),t);var U={};P(U,{exportSvelteComponents:()=>f,getHooks:()=>C,getRender:()=>x});function x(t){function e(n,i={},o=null){let d=v(t)[n].default,l=Object.fromEntries(Object.entries(o).map(([u,s])=>[u,()=>s]))||{};return d.render(i,{$$slots:l,context:new Map})}return e}function c(){}function S(t){return t()}function O(t){t.forEach(S)}function E(t){return typeof t=="function"}function L(t){return Object.keys(t).length===0}function _(t,e,n){t.insertBefore(e,n||null)}function h(t){t.parentNode&&t.parentNode.removeChild(t)}var k=[];function I(t){let e=[],n=[];k.forEach(i=>t.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),k=e}var K=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var B=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],Q=new Set([...B]);function H(t,e){let n=t.$$;n.fragment!==null&&(I(n.after_update),O(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}var z;typeof HTMLElement=="function"&&(z=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(S).filter(E);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){O(this.$$.on_disconnect)}$destroy(){H(this,1),this.$destroy=c}$on(t,e){if(!E(e))return c;let n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{let i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!L(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});function f(t){let{default:e,filenames:n}=t;return n=n.map(i=>i.replace("../svelte/","")).map(i=>i.replace(".svelte","")),Object.assign({},...e.map((i,o)=>({[n[o]]:i.default})))}function G(t){let e=document.createElement("div");return e.innerHTML=atob(t).trim(),e}function p(t,e){let n=e.getAttribute(t);return n?JSON.parse(n):{}}function W(t,e){let n=(o,d)=>{let l,u,s;return()=>({getElement(){return G(p("data-slots",d.el)[o])},update(){let r=this.getElement();h(s),_(l,r,u),s=r},c,m(r,m){let y=this.getElement();l=r,u=m,s=y,_(r,y,m)},d(r){r&&h(s)},l:c})},i={};for(let o in t)i[o]=[n(o,e)];return i}function A(t){return F(w({},p("data-props",t.el)),{pushEvent:(e,n,i)=>t.pushEvent(e,n,i),$$slots:W(p("data-slots",t.el),t),$$scope:{}})}function J(t){return t.$$.ctx.find(e=>e==null?void 0:e.default)}function C(t){let e=f(t);return{SvelteHook:{mounted(){let i=this.el.getAttribute("data-name");if(!i)throw new Error("Component name must be provided");let o=e[i];if(!o)throw new Error(`Unable to find ${i} component.`);this._instance=new o({target:this.el,props:A(this),hydrate:!0})},updated(){this._instance.$set(A(this));let i=J(this._instance);for(let o in i)i[o][0]().update()},destroyed(){var i;(i=this._instance)==null||i.$destroy()}}}}return R(U);})();