spikijs 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/spiki.esm.js +27 -23
- package/spiki.esm.min.js +1 -1
- package/spiki.js +27 -23
- package/spiki.min.js +1 -1
package/package.json
CHANGED
package/spiki.esm.js
CHANGED
|
@@ -196,9 +196,6 @@ var spiki = (() => {
|
|
|
196
196
|
? Number(key) < target.length
|
|
197
197
|
: Object.prototype.hasOwnProperty.call(target, key);
|
|
198
198
|
|
|
199
|
-
// PROTOTYPE WALKING (Scope Inheritance Support)
|
|
200
|
-
// If setting a property that doesn't exist on the child,
|
|
201
|
-
// check if it exists on the parent (prototype) to update it there.
|
|
202
199
|
if (!isArray && !hadKey) {
|
|
203
200
|
var cursor = Object.getPrototypeOf(target);
|
|
204
201
|
while (cursor && cursor !== Object.prototype) {
|
|
@@ -313,24 +310,26 @@ var spiki = (() => {
|
|
|
313
310
|
// --- Event Delegation ---
|
|
314
311
|
var handleEvent = (e) => {
|
|
315
312
|
var target = e.target;
|
|
316
|
-
// Bubble up from target to root
|
|
317
313
|
while (target && target !== rootElement.parentNode) {
|
|
318
|
-
var
|
|
314
|
+
var handlers = target.__handlers && target.__handlers[e.type];
|
|
319
315
|
|
|
320
|
-
if (
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
316
|
+
if (handlers) {
|
|
317
|
+
for (var i = 0; i < handlers.length; i++) {
|
|
318
|
+
var h = handlers[i];
|
|
319
|
+
// Case 1: s-model
|
|
320
|
+
if (h.isModel) {
|
|
321
|
+
var val = target.type === 'checkbox' ? target.checked : target.value;
|
|
322
|
+
var res = evaluatePath(target.__scope, h.path);
|
|
323
|
+
if (res.context) {
|
|
324
|
+
if (h.path.indexOf('.') === -1) res.context[h.path] = val;
|
|
325
|
+
else res.context[h.path.split('.').pop()] = val;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
// Case 2: Standard Event
|
|
329
|
+
else {
|
|
330
|
+
var res = evaluatePath(target.__scope, h.path);
|
|
331
|
+
if (typeof res.value === 'function') res.value.call(res.context, e);
|
|
328
332
|
}
|
|
329
|
-
}
|
|
330
|
-
// Case 2: Standard Event
|
|
331
|
-
else {
|
|
332
|
-
var res = evaluatePath(target.__scope, handlerInfo.path);
|
|
333
|
-
if (typeof res.value === 'function') res.value.call(res.context, e);
|
|
334
333
|
}
|
|
335
334
|
}
|
|
336
335
|
target = target.parentNode;
|
|
@@ -487,19 +486,20 @@ var spiki = (() => {
|
|
|
487
486
|
if (type === 'data') continue;
|
|
488
487
|
|
|
489
488
|
if (type in domOperations) {
|
|
490
|
-
// DOM Updaters (text, html, class)
|
|
491
489
|
bindings.push({ type: type, path: val });
|
|
492
490
|
}
|
|
493
491
|
else if (type === 'model') {
|
|
494
|
-
// Two-way binding setup
|
|
495
492
|
bindings.push({ type: 'value', path: val });
|
|
496
493
|
el.__modelPath = val;
|
|
497
494
|
el.__scope = currentScope;
|
|
498
|
-
if (!el.__handlers) el.__handlers = {};
|
|
495
|
+
if (!el.__handlers) el.__handlers = {}; // Object map
|
|
499
496
|
|
|
500
497
|
var evt = (el.type === 'checkbox' || el.type === 'radio' || el.tagName === 'SELECT')
|
|
501
498
|
? 'change' : 'input';
|
|
502
|
-
|
|
499
|
+
|
|
500
|
+
if (!el.__handlers[evt]) el.__handlers[evt] = [];
|
|
501
|
+
el.__handlers[evt].unshift({ isModel: true, path: val });
|
|
502
|
+
|
|
503
503
|
addListener(evt);
|
|
504
504
|
}
|
|
505
505
|
else if (type === 'ref') {
|
|
@@ -509,10 +509,14 @@ var spiki = (() => {
|
|
|
509
509
|
// Event Listeners
|
|
510
510
|
el.__scope = currentScope;
|
|
511
511
|
if (!el.__handlers) el.__handlers = {};
|
|
512
|
-
|
|
512
|
+
|
|
513
|
+
if (!el.__handlers[type]) el.__handlers[type] = [];
|
|
514
|
+
el.__handlers[type].push({ path: val });
|
|
515
|
+
|
|
513
516
|
addListener(type);
|
|
514
517
|
}
|
|
515
518
|
}
|
|
519
|
+
|
|
516
520
|
}
|
|
517
521
|
|
|
518
522
|
// Register Effects for Bindings
|
package/spiki.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var spiki=(()=>{var S=Object,L=Array,f=Reflect,e=Promise,a=Node,T=document,i=console,$="length",k="value",O="push",q="forEach",s="indexOf",C="split",M="slice",j="call",R="prototype",v="hasOwnProperty",
|
|
1
|
+
var spiki=(()=>{var S=Object,L=Array,f=Reflect,e=Promise,a=Node,T=document,i=console,$="length",k="value",O="push",q="forEach",s="indexOf",C="split",M="slice",j="call",R="prototype",v="hasOwnProperty",u="getPrototypeOf",n="defineProperty",B="create",D="isArray",F="getAttribute",H="removeAttribute",W="hasAttribute",z="tagName",G="type",I="name",l="checked",J="parentNode",K="nextSibling",t="textContent",o="innerHTML",Q="replaceWith",U="insertBefore",V="cloneNode",X="remove",Y="createTextNode",Z="checkbox",ee="function",re="object",te="unshift",ae="cleanups",ne="nodes",oe="context",p="scheduler",c="deps",d="className",m="destroy",g=S[B](null),h=[],_=!1,y=null,b=!0,r=e.resolve(),ie=/^\s*(.*?)\s+in\s+(.+)\s*$/,se=e=>{e._q||(e._q=!0,h[O](e),_||(_=!0,r.then(()=>{var e=h[M]();h[$]=0,_=!1;for(var r=0;r<e[$];r++)e[r]._q=!1,e[r]()})))},le=(e,r)=>{if(-1===r[s]("."))return{value:e[r],context:e};for(var t=r[C]("."),a=e,n=e,o=0;o<t[$];o++){if(null==a)return i.warn("Property undefined: "+r),{value:void 0,context:null};a=(n=a)[t[o]]}return{value:a,context:n}},x={};[O,"pop","shift",te,"splice","sort","reverse"][q](e=>{x[e]=function(){b=!1;try{return L[R][e].apply(this,arguments)}finally{b=!0,P(this,$)}}});var fe=(e,r)=>{var t;y&&((t=e._d)||(S[n](e,"_d",{value:S[B](null),writable:!0}),t=e._d),-1===(r=t[r]||(t[r]=[]))[s](y)&&(r[O](y),y[c][O](r)))},P=(e,r)=>{if(b&&e._d&&e._d[r])for(var t=e._d[r][M](),a=0;a<t[$];a++){var n=t[a];n[p]?n[p](n):n()}},A=e=>{if(e[c]){for(var r=0;r<e[c][$];r++){var t=e[c][r],a=t[s](e);-1!==a&&(t[a]=t[t[$]-1],t.pop())}e[c][$]=0}},ve=(r,e)=>{var t=()=>{A(t);var e=y;y=t;try{r()}finally{y=e}};return t[c]=[],t[p]=e,t(),()=>A(t)},ue=e=>{if(!e||typeof e!=re||e._y||e instanceof a)return e;if(e._p)return e._p;var r=new Proxy(e,{get:(e,r,t)=>"_r"===r?e:"_y"===r||("_d"===r?e._d:L[D](e)&&x[v](r)?x[r]:(fe(e,r),!(t=f.get(e,r,t))||typeof t!=re||t instanceof a?t:ue(t))),set:(e,r,t,a)=>{var n=e[r],o=L[D](e),i=o?Number(r)<e[$]:S[R][v][j](e,r);if(!o&&!i)for(var s=S[u](e);s&&s!==S[R];){if(S[R][v][j](s,r)){var l=f.set(s,r,t);return b&&t!==n&&P(e,r),l}s=S[u](s)}return l=f.set(e,r,t,a),b&&l&&(i&&t===n||(P(e,r),o&&P(e,$))),l},deleteProperty:(e,r)=>{var t=S[R][v][j](e,r),a=f.deleteProperty(e,r);return a&&t&&(P(e,r),L[D](e)&&P(e,$)),a}});return S[n](e,"_p",{value:r,enumerable:!1}),r},E=ue({}),pe={text:(e,r)=>{r=null==r?"":r,e[t]!==r&&(e[t]=r)},html:(e,r)=>{r=null==r?"":r,e[o]!==r&&(e[o]=r)},value:(e,r)=>{if(e[G]===Z)e[l]=!!r;else if("radio"===e[G])e[l]=e[k]==r;else if(r=null==r?"":r,e[k]!=r){var t=e.selectionStart,a=e.selectionEnd;if(e[k]=r,T.activeElement===e)try{e.setSelectionRange(t,a)}catch(e){}}},attr:(e,r,t)=>{null==r||!1===r?e[H](t):e.setAttribute(t,!0===r?"":r)},class:(e,r)=>{if("string"==typeof r)e[d]!==r&&(e[d]=r);else if(r)for(var t in r)e.classList.toggle(t,!!r[t])}},ce=(h,e)=>{if(!h._m){h._m=!0;var r=h[F]("s-data");if(r=g[r]){r=r(),e&&S.setPrototypeOf(r,e);var _=ue(r);_.$refs={},_.$root=h,_.$store=E,_.$parent=e;var t=[],a=S[B](null),n=e=>{for(var r=e.target;r&&r!==h[J];){var t=r._h&&r._h[e[G]];if(t)for(var a=0;a<t[$];a++){var n,o,i=t[a];i.isModel?(n=r[G]===Z?r[l]:r[k],(o=le(r._s,i.path))[oe]&&(-1===i.path[s](".")?o[oe][i.path]=n:o[oe][i.path[C](".").pop()]=n)):typeof(o=le(r._s,i.path))[k]==ee&&o[k][j](o[oe],e)}r=r[J]}},y=e=>{a[e]||(a[e]=!0,h.addEventListener(e,n))},w=(m,g,e)=>{if(1===m.nodeType&&!m[W]("s-ignore"))if(m!==h&&m[W]("s-data"))(c=ce(m,g))&&e[O](c.unmount);else{var r=m[F]("s-if"),t=!r&&"TEMPLATE"===m[z]&&m[F]("s-for");if(r){var b=T[Y]("");m[Q](b);var a=null,n=[];return e[O](()=>n[q](e=>e())),e[O](ve(()=>{le(g,r)[k]?a||((a=m[V](!0))[H]("s-if"),w(a,g,n),b[J][U](a,b)):a&&(n[q](e=>e()),n[$]=0,a[X](),a=null)},se))}if(t){var o=t.match(ie);if(o){var x=(t=o[1][C](",").map(e=>e.trim().replace(/[()]/g,"")))[0],P=t[1],A=o[2].trim(),E=m[F]("s-key"),b=T[Y]("");m[Q](b);var N=S[B](null);return e[O](()=>{for(var e in N)N[e][ae][q](e=>e())}),e[O](ve(()=>{var e=le(g,A)[k]||[];L[D](e)&&fe(e,$);for(var r,t=T.createDocumentFragment(),a=S[B](null),n=L[D](e),o=n?e:S.keys(e),i=(n?e:o)[$],s=b,l=0;l<i;l++){var f=n?l:o[l],v=n?e[l]:e[f],u=E&&v?v[E]:n?String(f)+"_"+(typeof v==re?"o":String(v)):f,p=N[u];if(p)p.scope[x]=v,P&&(p.scope[P]=f);else{var c=m.content[V](!0),d=ue(S[B](g));d[x]=v,P&&(d[P]=f);for(var h=[],_=L[R][M][j](c.childNodes),y=0;y<_[$];y++)w(_[y],d,h);p={nodes:_,scope:d,cleanups:h}}if(p[ne][0]!==s[K]){for(y=0;y<p[ne][$];y++)t.appendChild(p[ne][y]);s[J][U](t,s[K])}s=p[ne][p[ne][$]-1],a[u]=p,N[u]&&delete N[u]}for(r in N)for(N[r][ae][q](e=>e()),y=0;y<N[r][ne][$];y++)N[r][ne][y][X]();N=a},se))}}else{if(m.hasAttributes()){for(var i=[],s=m.attributes,l=s[$],f=0;f<l;f++){var v,u=s[f][I],p=s[f][k];":"===u[0]?i[O]({type:"attr",name:u[M](1),path:p}):"s"!==u[0]||"-"!==u[1]||"data"!==(v=u[M](2))&&(v in pe?i[O]({type:v,path:p}):"model"===v?(i[O]({type:k,path:p}),m._t=p,m._s=g,m._h||(m._h={}),u=m[G]===Z||"radio"===m[G]||"SELECT"===m[z]?"change":"input",m._h[u]||(m._h[u]=[]),m._h[u][te]({isModel:!0,path:p}),y(u)):"ref"===v?_.$refs[p]=m:(m._s=g,m._h||(m._h={}),m._h[v]||(m._h[v]=[]),m._h[v][O]({path:p}),y(v)))}i[$]&&e[O](ve(()=>{for(var e=0;e<i[$];e++){var r=i[e],t=(t=le(g,r.path))[k]&&typeof t[k]==ee?t[k][j](t[oe],m):t[k];"attr"===r[G]?"class"===r[I]?pe.class(m,t):pe.attr(m,t,r[I]):pe[r[G]](m,t)}},se))}for(var c=m.firstChild;c;){var d=c[K];w(c,g,e),c=d}}}};return w(h,_,t),_.init&&_.init(),{unmount:()=>{for(var e in _[m]&&_[m][j](_),t[q](e=>e()),a)h.removeEventListener(e,n);h._m=!1}}}}};return{data:(e,r)=>{g[e]=r},start:()=>{for(var e=T.querySelectorAll("[s-data]"),r=0;r<e[$];r++)ce(e[r])},store:(e,r)=>void 0===r?E[e]:E[e]=r,raw:e=>e&&e._r||e}})();export default spiki;
|
package/spiki.js
CHANGED
|
@@ -199,9 +199,6 @@ var spiki = (() => {
|
|
|
199
199
|
? Number(key) < target.length
|
|
200
200
|
: Object.prototype.hasOwnProperty.call(target, key);
|
|
201
201
|
|
|
202
|
-
// PROTOTYPE WALKING (Scope Inheritance Support)
|
|
203
|
-
// If setting a property that doesn't exist on the child,
|
|
204
|
-
// check if it exists on the parent (prototype) to update it there.
|
|
205
202
|
if (!isArray && !hadKey) {
|
|
206
203
|
var cursor = Object.getPrototypeOf(target);
|
|
207
204
|
while (cursor && cursor !== Object.prototype) {
|
|
@@ -316,24 +313,26 @@ var spiki = (() => {
|
|
|
316
313
|
// --- Event Delegation ---
|
|
317
314
|
var handleEvent = (e) => {
|
|
318
315
|
var target = e.target;
|
|
319
|
-
// Bubble up from target to root
|
|
320
316
|
while (target && target !== rootElement.parentNode) {
|
|
321
|
-
var
|
|
317
|
+
var handlers = target.__handlers && target.__handlers[e.type];
|
|
322
318
|
|
|
323
|
-
if (
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
319
|
+
if (handlers) {
|
|
320
|
+
for (var i = 0; i < handlers.length; i++) {
|
|
321
|
+
var h = handlers[i];
|
|
322
|
+
// Case 1: s-model
|
|
323
|
+
if (h.isModel) {
|
|
324
|
+
var val = target.type === 'checkbox' ? target.checked : target.value;
|
|
325
|
+
var res = evaluatePath(target.__scope, h.path);
|
|
326
|
+
if (res.context) {
|
|
327
|
+
if (h.path.indexOf('.') === -1) res.context[h.path] = val;
|
|
328
|
+
else res.context[h.path.split('.').pop()] = val;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
// Case 2: Standard Event
|
|
332
|
+
else {
|
|
333
|
+
var res = evaluatePath(target.__scope, h.path);
|
|
334
|
+
if (typeof res.value === 'function') res.value.call(res.context, e);
|
|
331
335
|
}
|
|
332
|
-
}
|
|
333
|
-
// Case 2: Standard Event
|
|
334
|
-
else {
|
|
335
|
-
var res = evaluatePath(target.__scope, handlerInfo.path);
|
|
336
|
-
if (typeof res.value === 'function') res.value.call(res.context, e);
|
|
337
336
|
}
|
|
338
337
|
}
|
|
339
338
|
target = target.parentNode;
|
|
@@ -490,19 +489,20 @@ var spiki = (() => {
|
|
|
490
489
|
if (type === 'data') continue;
|
|
491
490
|
|
|
492
491
|
if (type in domOperations) {
|
|
493
|
-
// DOM Updaters (text, html, class)
|
|
494
492
|
bindings.push({ type: type, path: val });
|
|
495
493
|
}
|
|
496
494
|
else if (type === 'model') {
|
|
497
|
-
// Two-way binding setup
|
|
498
495
|
bindings.push({ type: 'value', path: val });
|
|
499
496
|
el.__modelPath = val;
|
|
500
497
|
el.__scope = currentScope;
|
|
501
|
-
if (!el.__handlers) el.__handlers = {};
|
|
498
|
+
if (!el.__handlers) el.__handlers = {}; // Object map
|
|
502
499
|
|
|
503
500
|
var evt = (el.type === 'checkbox' || el.type === 'radio' || el.tagName === 'SELECT')
|
|
504
501
|
? 'change' : 'input';
|
|
505
|
-
|
|
502
|
+
|
|
503
|
+
if (!el.__handlers[evt]) el.__handlers[evt] = [];
|
|
504
|
+
el.__handlers[evt].unshift({ isModel: true, path: val });
|
|
505
|
+
|
|
506
506
|
addListener(evt);
|
|
507
507
|
}
|
|
508
508
|
else if (type === 'ref') {
|
|
@@ -512,10 +512,14 @@ var spiki = (() => {
|
|
|
512
512
|
// Event Listeners
|
|
513
513
|
el.__scope = currentScope;
|
|
514
514
|
if (!el.__handlers) el.__handlers = {};
|
|
515
|
-
|
|
515
|
+
|
|
516
|
+
if (!el.__handlers[type]) el.__handlers[type] = [];
|
|
517
|
+
el.__handlers[type].push({ path: val });
|
|
518
|
+
|
|
516
519
|
addListener(type);
|
|
517
520
|
}
|
|
518
521
|
}
|
|
522
|
+
|
|
519
523
|
}
|
|
520
524
|
|
|
521
525
|
// Register Effects for Bindings
|
package/spiki.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e=(()=>{var S=Object,L=Array,f=Reflect,e=Promise,a=Node,T=document,i=console,$="length",k="value",O="push",q="forEach",s="indexOf",C="split",M="slice",j="call",R="prototype",v="hasOwnProperty",
|
|
1
|
+
(()=>{"use strict";var e=(()=>{var S=Object,L=Array,f=Reflect,e=Promise,a=Node,T=document,i=console,$="length",k="value",O="push",q="forEach",s="indexOf",C="split",M="slice",j="call",R="prototype",v="hasOwnProperty",u="getPrototypeOf",n="defineProperty",B="create",D="isArray",F="getAttribute",H="removeAttribute",W="hasAttribute",z="tagName",G="type",I="name",l="checked",J="parentNode",K="nextSibling",t="textContent",o="innerHTML",Q="replaceWith",U="insertBefore",V="cloneNode",X="remove",Y="createTextNode",Z="checkbox",ee="function",re="object",te="unshift",ae="cleanups",ne="nodes",oe="context",p="scheduler",c="deps",d="className",m="destroy",g=S[B](null),h=[],_=!1,y=null,b=!0,r=e.resolve(),ie=/^\s*(.*?)\s+in\s+(.+)\s*$/,se=e=>{e._q||(e._q=!0,h[O](e),_||(_=!0,r.then(()=>{var e=h[M]();h[$]=0,_=!1;for(var r=0;r<e[$];r++)e[r]._q=!1,e[r]()})))},le=(e,r)=>{if(-1===r[s]("."))return{value:e[r],context:e};for(var t=r[C]("."),a=e,n=e,o=0;o<t[$];o++){if(null==a)return i.warn("Property undefined: "+r),{value:void 0,context:null};a=(n=a)[t[o]]}return{value:a,context:n}},x={};[O,"pop","shift",te,"splice","sort","reverse"][q](e=>{x[e]=function(){b=!1;try{return L[R][e].apply(this,arguments)}finally{b=!0,P(this,$)}}});var fe=(e,r)=>{var t;y&&((t=e._d)||(S[n](e,"_d",{value:S[B](null),writable:!0}),t=e._d),-1===(r=t[r]||(t[r]=[]))[s](y)&&(r[O](y),y[c][O](r)))},P=(e,r)=>{if(b&&e._d&&e._d[r])for(var t=e._d[r][M](),a=0;a<t[$];a++){var n=t[a];n[p]?n[p](n):n()}},A=e=>{if(e[c]){for(var r=0;r<e[c][$];r++){var t=e[c][r],a=t[s](e);-1!==a&&(t[a]=t[t[$]-1],t.pop())}e[c][$]=0}},ve=(r,e)=>{var t=()=>{A(t);var e=y;y=t;try{r()}finally{y=e}};return t[c]=[],t[p]=e,t(),()=>A(t)},ue=e=>{if(!e||typeof e!=re||e._y||e instanceof a)return e;if(e._p)return e._p;var r=new Proxy(e,{get:(e,r,t)=>"_r"===r?e:"_y"===r||("_d"===r?e._d:L[D](e)&&x[v](r)?x[r]:(fe(e,r),!(t=f.get(e,r,t))||typeof t!=re||t instanceof a?t:ue(t))),set:(e,r,t,a)=>{var n=e[r],o=L[D](e),i=o?Number(r)<e[$]:S[R][v][j](e,r);if(!o&&!i)for(var s=S[u](e);s&&s!==S[R];){if(S[R][v][j](s,r)){var l=f.set(s,r,t);return b&&t!==n&&P(e,r),l}s=S[u](s)}return l=f.set(e,r,t,a),b&&l&&(i&&t===n||(P(e,r),o&&P(e,$))),l},deleteProperty:(e,r)=>{var t=S[R][v][j](e,r),a=f.deleteProperty(e,r);return a&&t&&(P(e,r),L[D](e)&&P(e,$)),a}});return S[n](e,"_p",{value:r,enumerable:!1}),r},E=ue({}),pe={text:(e,r)=>{r=null==r?"":r,e[t]!==r&&(e[t]=r)},html:(e,r)=>{r=null==r?"":r,e[o]!==r&&(e[o]=r)},value:(e,r)=>{if(e[G]===Z)e[l]=!!r;else if("radio"===e[G])e[l]=e[k]==r;else if(r=null==r?"":r,e[k]!=r){var t=e.selectionStart,a=e.selectionEnd;if(e[k]=r,T.activeElement===e)try{e.setSelectionRange(t,a)}catch(e){}}},attr:(e,r,t)=>{null==r||!1===r?e[H](t):e.setAttribute(t,!0===r?"":r)},class:(e,r)=>{if("string"==typeof r)e[d]!==r&&(e[d]=r);else if(r)for(var t in r)e.classList.toggle(t,!!r[t])}},ce=(h,e)=>{if(!h._m){h._m=!0;var r=h[F]("s-data");if(r=g[r]){r=r(),e&&S.setPrototypeOf(r,e);var _=ue(r);_.$refs={},_.$root=h,_.$store=E,_.$parent=e;var t=[],a=S[B](null),n=e=>{for(var r=e.target;r&&r!==h[J];){var t=r._h&&r._h[e[G]];if(t)for(var a=0;a<t[$];a++){var n,o,i=t[a];i.isModel?(n=r[G]===Z?r[l]:r[k],(o=le(r._s,i.path))[oe]&&(-1===i.path[s](".")?o[oe][i.path]=n:o[oe][i.path[C](".").pop()]=n)):typeof(o=le(r._s,i.path))[k]==ee&&o[k][j](o[oe],e)}r=r[J]}},y=e=>{a[e]||(a[e]=!0,h.addEventListener(e,n))},w=(m,g,e)=>{if(1===m.nodeType&&!m[W]("s-ignore"))if(m!==h&&m[W]("s-data"))(c=ce(m,g))&&e[O](c.unmount);else{var r=m[F]("s-if"),t=!r&&"TEMPLATE"===m[z]&&m[F]("s-for");if(r){var b=T[Y]("");m[Q](b);var a=null,n=[];return e[O](()=>n[q](e=>e())),e[O](ve(()=>{le(g,r)[k]?a||((a=m[V](!0))[H]("s-if"),w(a,g,n),b[J][U](a,b)):a&&(n[q](e=>e()),n[$]=0,a[X](),a=null)},se))}if(t){var o=t.match(ie);if(o){var x=(t=o[1][C](",").map(e=>e.trim().replace(/[()]/g,"")))[0],P=t[1],A=o[2].trim(),E=m[F]("s-key"),b=T[Y]("");m[Q](b);var N=S[B](null);return e[O](()=>{for(var e in N)N[e][ae][q](e=>e())}),e[O](ve(()=>{var e=le(g,A)[k]||[];L[D](e)&&fe(e,$);for(var r,t=T.createDocumentFragment(),a=S[B](null),n=L[D](e),o=n?e:S.keys(e),i=(n?e:o)[$],s=b,l=0;l<i;l++){var f=n?l:o[l],v=n?e[l]:e[f],u=E&&v?v[E]:n?String(f)+"_"+(typeof v==re?"o":String(v)):f,p=N[u];if(p)p.scope[x]=v,P&&(p.scope[P]=f);else{var c=m.content[V](!0),d=ue(S[B](g));d[x]=v,P&&(d[P]=f);for(var h=[],_=L[R][M][j](c.childNodes),y=0;y<_[$];y++)w(_[y],d,h);p={nodes:_,scope:d,cleanups:h}}if(p[ne][0]!==s[K]){for(y=0;y<p[ne][$];y++)t.appendChild(p[ne][y]);s[J][U](t,s[K])}s=p[ne][p[ne][$]-1],a[u]=p,N[u]&&delete N[u]}for(r in N)for(N[r][ae][q](e=>e()),y=0;y<N[r][ne][$];y++)N[r][ne][y][X]();N=a},se))}}else{if(m.hasAttributes()){for(var i=[],s=m.attributes,l=s[$],f=0;f<l;f++){var v,u=s[f][I],p=s[f][k];":"===u[0]?i[O]({type:"attr",name:u[M](1),path:p}):"s"!==u[0]||"-"!==u[1]||"data"!==(v=u[M](2))&&(v in pe?i[O]({type:v,path:p}):"model"===v?(i[O]({type:k,path:p}),m._t=p,m._s=g,m._h||(m._h={}),u=m[G]===Z||"radio"===m[G]||"SELECT"===m[z]?"change":"input",m._h[u]||(m._h[u]=[]),m._h[u][te]({isModel:!0,path:p}),y(u)):"ref"===v?_.$refs[p]=m:(m._s=g,m._h||(m._h={}),m._h[v]||(m._h[v]=[]),m._h[v][O]({path:p}),y(v)))}i[$]&&e[O](ve(()=>{for(var e=0;e<i[$];e++){var r=i[e],t=(t=le(g,r.path))[k]&&typeof t[k]==ee?t[k][j](t[oe],m):t[k];"attr"===r[G]?"class"===r[I]?pe.class(m,t):pe.attr(m,t,r[I]):pe[r[G]](m,t)}},se))}for(var c=m.firstChild;c;){var d=c[K];w(c,g,e),c=d}}}};return w(h,_,t),_.init&&_.init(),{unmount:()=>{for(var e in _[m]&&_[m][j](_),t[q](e=>e()),a)h.removeEventListener(e,n);h._m=!1}}}}};return{data:(e,r)=>{g[e]=r},start:()=>{for(var e=T.querySelectorAll("[s-data]"),r=0;r<e[$];r++)ce(e[r])},store:(e,r)=>void 0===r?E[e]:E[e]=r,raw:e=>e&&e._r||e}})();window.spiki=e})();
|