From c6ccec9cca075458a59af6829565812329e5d97b Mon Sep 17 00:00:00 2001 From: Thorsten Kober Date: Thu, 5 Oct 2023 09:53:05 -0400 Subject: [PATCH] rebuild complex svelte --- .../svelte-complex/dist/app.js | 2 +- .../svelte-complex/dist/app.js.map | 2 +- .../svelte-complex/package-lock.json | 743 ------------------ .../architecture-examples/svelte/package.json | 2 +- 4 files changed, 3 insertions(+), 746 deletions(-) diff --git a/resources/todomvc/architecture-examples/svelte-complex/dist/app.js b/resources/todomvc/architecture-examples/svelte-complex/dist/app.js index 3e2256369..675a5e89a 100644 --- a/resources/todomvc/architecture-examples/svelte-complex/dist/app.js +++ b/resources/todomvc/architecture-examples/svelte-complex/dist/app.js @@ -1,2 +1,2 @@ -var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function c(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e){t.appendChild(e)}function i(t,e,n){t.insertBefore(e,n||null)}function s(t){t.parentNode&&t.parentNode.removeChild(t)}function u(t){return document.createElement(t)}function a(t){return document.createTextNode(t)}function d(){return a(" ")}function f(){return a("")}function p(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function h(t,e){e=""+e,t.data!==e&&(t.data=e)}let $;function g(t){$=t}function x(){const t=function(){if(!$)throw new Error("Function called outside component initialization");return $}();return(e,n,{cancelable:o=!1}={})=>{const c=t.$$.callbacks[e];if(c){const r=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const c=document.createEvent("CustomEvent");return c.initCustomEvent(t,n,o,e),c}(e,n,{cancelable:o});return c.slice().forEach((e=>{e.call(t,r)})),!r.defaultPrevented}return!0}}const y=[],v=[];let b=[];const k=[],w=Promise.resolve();let _=!1;function E(){_||(_=!0,w.then(I))}function C(t){b.push(t)}const A=new Set;let F=0;function I(){if(0!==F)return;const t=$;do{try{for(;F{S.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}function P(t,e){q(t,1,1,(()=>{e.delete(t.key)}))}function T(t){t&&t.c()}function z(t,n,r,l){const{fragment:i,after_update:s}=t.$$;i&&i.m(n,r),l||C((()=>{const n=t.$$.on_mount.map(e).filter(c);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),s.forEach(C)}function B(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];b.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),b=e}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function W(e,c,r,l,i,u,a,d=[-1]){const f=$;g(e);const p=e.$$={fragment:null,ctx:[],props:u,update:t,not_equal:i,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(c.context||(f?f.$$.context:[])),callbacks:n(),dirty:d,skip_bound:!1,root:c.target||f.$$.root};a&&a(p.root);let m=!1;if(p.ctx=r?r(e,c.props||{},((t,n,...o)=>{const c=o.length?o[0]:n;return p.ctx&&i(p.ctx[t],p.ctx[t]=c)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](c),m&&function(t,e){-1===t.$$.dirty[0]&&(y.push(t),E(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function G(e){let n,o,c,r,a,f;return{c(){n=u("header"),o=u("h1"),o.textContent="todos",c=d(),r=u("input"),m(r,"class","new-todo"),m(r,"placeholder","What needs to be done?"),r.autofocus=!0,m(n,"class","header")},m(t,s){i(t,n,s),l(n,o),l(n,c),l(n,r),r.focus(),a||(f=p(r,"keydown",e[0]),a=!0)},p:t,i:t,o:t,d(t){t&&s(n),a=!1,f()}}}function H(t){const e=x();return[function(t){"Enter"===t.key&&(e("addItem",{text:t.target.value}),t.target.value="")}]}class J extends D{constructor(t){super(),W(this,t,H,G,r,{})}}function K(e){let n,o,c;return{c(){n=u("button"),n.textContent="Clear completed",m(n,"class","clear-completed")},m(t,r){i(t,n,r),o||(c=p(n,"click",e[3]),o=!0)},p:t,d(t){t&&s(n),o=!1,c()}}}function Q(e){let n,o,c,r,f,p,$,g,x,y,v,b,k,w,_,E,C,A,F,I,M,S,N,O,j=1===e[0]?"item":"items",L=e[2]&&K(e);return{c(){n=u("footer"),o=u("span"),c=u("strong"),r=a(e[0]),f=d(),p=a(j),$=a(" left"),g=d(),x=u("ul"),y=u("li"),v=u("a"),b=a("All"),w=d(),_=u("li"),E=u("a"),C=a("Active"),F=d(),I=u("li"),M=u("a"),S=a("Completed"),O=d(),L&&L.c(),m(o,"class","todo-count"),m(v,"class",k="all"===e[1]?"selected":""),m(v,"href","#/"),m(E,"class",A="active"===e[1]?"selected":""),m(E,"href","#/active"),m(M,"class",N="completed"===e[1]?"selected":""),m(M,"href","#/completed"),m(x,"class","filters"),m(n,"class","footer")},m(t,e){i(t,n,e),l(n,o),l(o,c),l(c,r),l(o,f),l(o,p),l(o,$),l(n,g),l(n,x),l(x,y),l(y,v),l(v,b),l(x,w),l(x,_),l(_,E),l(E,C),l(x,F),l(x,I),l(I,M),l(M,S),l(n,O),L&&L.m(n,null)},p(t,[e]){1&e&&h(r,t[0]),1&e&&j!==(j=1===t[0]?"item":"items")&&h(p,j),2&e&&k!==(k="all"===t[1]?"selected":"")&&m(v,"class",k),2&e&&A!==(A="active"===t[1]?"selected":"")&&m(E,"class",A),2&e&&N!==(N="completed"===t[1]?"selected":"")&&m(M,"class",N),t[2]?L?L.p(t,e):(L=K(t),L.c(),L.m(n,null)):L&&(L.d(1),L=null)},i:t,o:t,d(t){t&&s(n),L&&L.d()}}}function R(t,e,n){let{numActive:o}=e,{currentFilter:c}=e,{numCompleted:r}=e;const l=x();return t.$$set=t=>{"numActive"in t&&n(0,o=t.numActive),"currentFilter"in t&&n(1,c=t.currentFilter),"numCompleted"in t&&n(2,r=t.numCompleted)},[o,c,r,function(t){l("removeCompletedItems")}]}class U extends D{constructor(t){super(),W(this,t,R,Q,r,{numActive:0,currentFilter:1,numCompleted:2})}}function V(e){let n,r,a,f,h,$,g;return{c(){n=u("div"),r=u("input"),f=d(),h=u("label"),h.textContent="Edit Todo Input",r.value=a=e[0].description,m(r,"id","edit-todo-input"),m(r,"class","edit"),m(h,"class","visually-hidden"),m(h,"for","edit-todo-input"),m(n,"class","input-container")},m(o,s){var u;i(o,n,s),l(n,r),l(n,f),l(n,h),$||(g=[p(r,"keydown",e[5]),p(r,"blur",e[6]),(u=e[7].call(null,r),u&&c(u.destroy)?u.destroy:t)],$=!0)},p(t,e){1&e&&a!==(a=t[0].description)&&r.value!==a&&(r.value=a)},d(t){t&&s(n),$=!1,o(g)}}}function X(e){let n,c,r,f,$,g,x,y,v,b,k,w,_,E,C=e[0].description+"",A=e[2]&&V(e);return{c(){n=u("li"),c=u("div"),r=u("input"),$=d(),g=u("label"),x=a(C),y=d(),v=u("button"),b=d(),A&&A.c(),m(r,"class","toggle"),m(r,"type","checkbox"),r.checked=f=e[0].completed,m(v,"class","destroy"),m(c,"class","view"),m(n,"class",k=(e[0].completed?" completed":"")+(e[2]?" editing":"")),m(n,"data-priority",w=4-e[1]%5)},m(t,o){i(t,n,o),l(n,c),l(c,r),l(c,$),l(c,g),l(g,x),l(c,y),l(c,v),l(n,b),A&&A.m(n,null),_||(E=[p(r,"change",e[8]),p(g,"dblclick",e[4]),p(v,"click",e[3])],_=!0)},p(t,[e]){1&e&&f!==(f=t[0].completed)&&(r.checked=f),1&e&&C!==(C=t[0].description+"")&&h(x,C),t[2]?A?A.p(t,e):(A=V(t),A.c(),A.m(n,null)):A&&(A.d(1),A=null),5&e&&k!==(k=(t[0].completed?" completed":"")+(t[2]?" editing":""))&&m(n,"class",k),2&e&&w!==(w=4-t[1]%5)&&m(n,"data-priority",w)},i:t,o:t,d(t){t&&s(n),A&&A.d(),_=!1,o(E)}}}function Y(t,e,n){let{item:o}=e,{index:c}=e,r=!1;const l=x();function i(){l("removeItem")}return t.$$set=t=>{"item"in t&&n(0,o=t.item),"index"in t&&n(1,c=t.index)},[o,c,r,i,function(){n(2,r=!0)},function(t){"Enter"===t.key?t.target.blur():"Escape"===t.key&&n(2,r=!1)},function(t){if(!r)return;const{value:e}=t.target;e.length?n(0,o.description=e,o):i(),n(2,r=!1)},async function(t){await(E(),w),t.focus()},t=>n(0,o.completed=t.target.checked,o)]}class Z extends D{constructor(t){super(),W(this,t,Y,X,r,{item:0,index:1})}}function tt(t,e,n){const o=t.slice();return o[11]=e[n],o[12]=e,o[13]=n,o}function et(t){let e,n,c,r,a,f,h,$,g,x,y,v,b,k=[],w=new Map,_=t[4];const E=t=>t[11].id;for(let e=0;e<_.length;e+=1){let n=tt(t,_,e),o=E(n);w.set(o,k[e]=nt(o,n))}return x=new U({props:{numActive:t[3],currentFilter:t[0],numCompleted:t[2]}}),x.$on("removeCompletedItems",t[8]),{c(){e=u("main"),n=u("div"),c=u("input"),a=d(),f=u("label"),f.textContent="Mark all as complete",h=d(),$=u("ul");for(let t=0;ts.p(t,e))):(s=a(o,t),s.c()),x.set(o,g[h]=s),o in $&&y.set(o,Math.abs(h-$[o]))}const b=new Set,k=new Set;function w(t){L(t,1),t.m(s,d),i.set(t.key,t),d=t.first,m--}for(;p&&m;){const e=g[m-1],n=t[p-1],o=e.key,c=n.key;e===n?(d=e.first,p--,m--):x.has(c)?!i.has(o)||b.has(o)?w(e):k.has(c)?p--:y.get(o)>y.get(c)?(k.add(o),w(e)):(b.add(c),p--):(u(n,i),p--)}for(;p--;){const e=t[p];x.has(e.key)||u(e,i)}for(;m;)w(g[m-1]);return o(v),g}(k,e,E,1,t,_,w,$,P,nt,null,tt),j());const n={};8&e&&(n.numActive=t[3]),1&e&&(n.currentFilter=t[0]),4&e&&(n.numCompleted=t[2]),x.$set(n)},i(t){if(!y){for(let t=0;t<_.length;t+=1)L(k[t]);L(x.$$.fragment,t),y=!0}},o(t){for(let t=0;tfunction(t,e,n){const o=t.$$.props[e];void 0!==o&&(t.$$.bound[o]=n,n(t.$$.ctx[o]))}(o,"item",l))),o.$on("removeItem",(function(){return e[10](e[13])})),{key:t,first:null,c(){n=f(),T(o.$$.fragment),this.first=n},m(t,e){i(t,n,e),z(o,t,e),r=!0},p(t,n){e=t;const r={};var l;16&n&&(r.index=e[13]),!c&&16&n&&(c=!0,r.item=e[11],l=()=>c=!1,k.push(l)),o.$set(r)},i(t){r||(L(o.$$.fragment,t),r=!0)},o(t){q(o.$$.fragment,t),r=!1},d(t){t&&s(n),B(o,t)}}}function ot(t){let e,n,o,c;e=new J({}),e.$on("addItem",t[5]);let r=t[1].length>0&&et(t);return{c(){T(e.$$.fragment),n=d(),r&&r.c(),o=f()},m(t,l){z(e,t,l),i(t,n,l),r&&r.m(t,l),i(t,o,l),c=!0},p(t,[e]){t[1].length>0?r?(r.p(t,e),2&e&&L(r,1)):(r=et(t),r.c(),L(r,1),r.m(o.parentNode,o)):r&&(O(),q(r,1,1,(()=>{r=null})),j())},i(t){c||(L(e.$$.fragment,t),L(r),c=!0)},o(t){q(e.$$.fragment,t),q(r),c=!1},d(t){B(e,t),t&&s(n),r&&r.d(t),t&&s(o)}}}let ct=null;function rt(t,e,n){let o,c,r,l="all",i=[];function s(t){i.splice(t,1),n(1,i)}(function(t){let e="all";function n(){switch(window.location.hash){case"#/active":e="active";break;case"#/completed":e="completed";break;default:e="all"}t(e)}return{init:function(){window.addEventListener("hashchange",n)}}})((t=>n(0,l=t))).init();return t.$$.update=()=>{3&t.$$.dirty&&n(4,o="all"===l?i:"completed"===l?i.filter((t=>t.completed)):i.filter((t=>!t.completed))),2&t.$$.dirty&&n(3,c=i.filter((t=>!t.completed)).length),2&t.$$.dirty&&n(2,r=i.filter((t=>t.completed)).length)},[l,i,r,c,o,function(t){i.push({id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})),description:t.detail.text,completed:!1}),n(1,i)},s,function(t){const e=t.target.checked;n(1,i=i.map((t=>({...t,completed:e}))))},function(){n(1,i=i.filter((t=>!t.completed)))},function(t,e,c,r){c[r]=t,n(4,o),n(0,l),n(1,i)},t=>s(t)]}return new class extends D{constructor(t){super(),W(this,t,rt,ot,r,{})}}({target:document.querySelector(".todoapp")})}(); +var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function c(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e){t.appendChild(e)}function i(t,e,n){t.insertBefore(e,n||null)}function u(t){t.parentNode&&t.parentNode.removeChild(t)}function s(t){return document.createElement(t)}function a(t){return document.createTextNode(t)}function d(){return a(" ")}function f(){return a("")}function p(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function h(t,e){e=""+e,t.data!==e&&(t.data=e)}function $(t,e,n){t.classList[n?"add":"remove"](e)}let g;function x(t){g=t}function y(){if(!g)throw new Error("Function called outside component initialization");return g}function v(){const t=y();return(e,n,{cancelable:o=!1}={})=>{const c=t.$$.callbacks[e];if(c){const r=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const c=document.createEvent("CustomEvent");return c.initCustomEvent(t,n,o,e),c}(e,n,{cancelable:o});return c.slice().forEach((e=>{e.call(t,r)})),!r.defaultPrevented}return!0}}const b=[],k=[];let w=[];const _=[],C=Promise.resolve();let E=!1;function A(){E||(E=!0,C.then(S))}function F(t){w.push(t)}const I=new Set;let M=0;function S(){if(0!==M)return;const t=g;do{try{for(;M{L.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}function z(t,e){T(t,1,1,(()=>{e.delete(t.key)}))}function B(t){t&&t.c()}function W(t,n,r,l){const{fragment:i,after_update:u}=t.$$;i&&i.m(n,r),l||F((()=>{const n=t.$$.on_mount.map(e).filter(c);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),u.forEach(F)}function D(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];w.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),w=e}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function G(e,c,r,l,i,s,a,d=[-1]){const f=g;x(e);const p=e.$$={fragment:null,ctx:[],props:s,update:t,not_equal:i,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(c.context||(f?f.$$.context:[])),callbacks:n(),dirty:d,skip_bound:!1,root:c.target||f.$$.root};a&&a(p.root);let m=!1;if(p.ctx=r?r(e,c.props||{},((t,n,...o)=>{const c=o.length?o[0]:n;return p.ctx&&i(p.ctx[t],p.ctx[t]=c)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](c),m&&function(t,e){-1===t.$$.dirty[0]&&(b.push(t),A(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function J(e){let n,o,c,r,a,f;return{c(){n=s("header"),o=s("h1"),o.textContent="todos",c=d(),r=s("input"),m(r,"class","new-todo"),m(r,"placeholder","What needs to be done?"),r.autofocus=!0,m(n,"class","header")},m(t,u){i(t,n,u),l(n,o),l(n,c),l(n,r),r.focus(),a||(f=p(r,"keydown",e[0]),a=!0)},p:t,i:t,o:t,d(t){t&&u(n),a=!1,f()}}}function K(t){const e=v();return[function(t){"Enter"===t.key&&(e("addItem",{text:t.target.value}),t.target.value="")}]}class Q extends H{constructor(t){super(),G(this,t,K,J,r,{})}}function R(e){let n,o,c;return{c(){n=s("button"),n.textContent="Clear completed",m(n,"class","clear-completed")},m(t,r){i(t,n,r),o||(c=p(n,"click",e[3]),o=!0)},p:t,d(t){t&&u(n),o=!1,c()}}}function U(e){let n,o,c,r,f,p,g,x,y,v,b,k,w,_,C,E,A,F,I=1===e[0]?"item":"items",M=e[2]&&R(e);return{c(){n=s("footer"),o=s("span"),c=s("strong"),r=a(e[0]),f=d(),p=a(I),g=a(" left"),x=d(),y=s("ul"),v=s("li"),b=s("a"),b.textContent="All",k=d(),w=s("li"),_=s("a"),_.textContent="Active",C=d(),E=s("li"),A=s("a"),A.textContent="Completed",F=d(),M&&M.c(),m(o,"class","todo-count"),m(b,"href","#/"),$(b,"selected","all"===e[1]),m(_,"href","#/active"),$(_,"selected","active"===e[1]),m(A,"href","#/completed"),$(A,"selected","completed"===e[1]),m(y,"class","filters"),m(n,"class","footer")},m(t,e){i(t,n,e),l(n,o),l(o,c),l(c,r),l(o,f),l(o,p),l(o,g),l(n,x),l(n,y),l(y,v),l(v,b),l(y,k),l(y,w),l(w,_),l(y,C),l(y,E),l(E,A),l(n,F),M&&M.m(n,null)},p(t,[e]){1&e&&h(r,t[0]),1&e&&I!==(I=1===t[0]?"item":"items")&&h(p,I),2&e&&$(b,"selected","all"===t[1]),2&e&&$(_,"selected","active"===t[1]),2&e&&$(A,"selected","completed"===t[1]),t[2]?M?M.p(t,e):(M=R(t),M.c(),M.m(n,null)):M&&(M.d(1),M=null)},i:t,o:t,d(t){t&&u(n),M&&M.d()}}}function V(t,e,n){let{numActive:o}=e,{currentFilter:c}=e,{numCompleted:r}=e;const l=v();return t.$$set=t=>{"numActive"in t&&n(0,o=t.numActive),"currentFilter"in t&&n(1,c=t.currentFilter),"numCompleted"in t&&n(2,r=t.numCompleted)},[o,c,r,function(t){l("removeCompletedItems")}]}class X extends H{constructor(t){super(),G(this,t,V,U,r,{numActive:0,currentFilter:1,numCompleted:2})}}function Y(e){let n,r,a,f,h,$,g;return{c(){n=s("div"),r=s("input"),f=d(),h=s("label"),h.textContent="Edit Todo Input",r.value=a=e[0].description,m(r,"id","edit-todo-input"),m(r,"class","edit"),m(h,"class","visually-hidden"),m(h,"for","edit-todo-input"),m(n,"class","input-container")},m(o,u){var s;i(o,n,u),l(n,r),l(n,f),l(n,h),$||(g=[p(r,"keydown",e[5]),p(r,"blur",e[6]),(s=e[7].call(null,r),s&&c(s.destroy)?s.destroy:t)],$=!0)},p(t,e){1&e&&a!==(a=t[0].description)&&r.value!==a&&(r.value=a)},d(t){t&&u(n),$=!1,o(g)}}}function Z(e){let n,c,r,f,g,x,y,v,b,k,w,_,C,E=e[0].description+"",A=e[2]&&Y(e);return{c(){n=s("li"),c=s("div"),r=s("input"),g=d(),x=s("label"),y=a(E),v=d(),b=s("button"),k=d(),A&&A.c(),m(r,"class","toggle"),m(r,"type","checkbox"),r.checked=f=e[0].completed,m(b,"class","destroy"),m(c,"class","view"),m(n,"data-priority",w=4-e[1]%5),$(n,"completed",e[0].completed),$(n,"editing",e[2])},m(t,o){i(t,n,o),l(n,c),l(c,r),l(c,g),l(c,x),l(x,y),l(c,v),l(c,b),l(n,k),A&&A.m(n,null),_||(C=[p(r,"change",e[8]),p(x,"dblclick",e[4]),p(b,"click",e[3])],_=!0)},p(t,[e]){1&e&&f!==(f=t[0].completed)&&(r.checked=f),1&e&&E!==(E=t[0].description+"")&&h(y,E),t[2]?A?A.p(t,e):(A=Y(t),A.c(),A.m(n,null)):A&&(A.d(1),A=null),2&e&&w!==(w=4-t[1]%5)&&m(n,"data-priority",w),1&e&&$(n,"completed",t[0].completed),4&e&&$(n,"editing",t[2])},i:t,o:t,d(t){t&&u(n),A&&A.d(),_=!1,o(C)}}}function tt(t,e,n){let{item:o}=e,{index:c}=e;const r=v();let l=!1;function i(){r("removeItem")}return t.$$set=t=>{"item"in t&&n(0,o=t.item),"index"in t&&n(1,c=t.index)},[o,c,l,i,function(){n(2,l=!0)},function(t){"Enter"===t.key?t.target.blur():"Escape"===t.key&&n(2,l=!1)},function(t){if(!l)return;const{value:e}=t.target;e.length?n(0,o.description=e,o):i(),n(2,l=!1)},async function(t){await(A(),C),t.focus()},t=>n(0,o.completed=t.target.checked,o)]}class et extends H{constructor(t){super(),G(this,t,tt,Z,r,{item:0,index:1})}}function nt(t,e,n){const o=t.slice();return o[11]=e[n],o[12]=e,o[13]=n,o}function ot(t){let e,n,c,r,a,f,h,$,g,x,y,v,b,k=[],w=new Map,_=t[4];const C=t=>t[11].id;for(let e=0;e<_.length;e+=1){let n=nt(t,_,e),o=C(n);w.set(o,k[e]=ct(o,n))}return x=new X({props:{numActive:t[3],currentFilter:t[0],numCompleted:t[2]}}),x.$on("removeCompletedItems",t[8]),{c(){e=s("main"),n=s("div"),c=s("input"),a=d(),f=s("label"),f.textContent="Mark all as complete",h=d(),$=s("ul");for(let t=0;tu.p(t,e))):(u=a(o,t),u.c()),x.set(o,g[h]=u),o in $&&y.set(o,Math.abs(h-$[o]))}const b=new Set,k=new Set;function w(t){P(t,1),t.m(u,d),i.set(t.key,t),d=t.first,m--}for(;p&&m;){const e=g[m-1],n=t[p-1],o=e.key,c=n.key;e===n?(d=e.first,p--,m--):x.has(c)?!i.has(o)||b.has(o)?w(e):k.has(c)?p--:y.get(o)>y.get(c)?(k.add(o),w(e)):(b.add(c),p--):(s(n,i),p--)}for(;p--;){const e=t[p];x.has(e.key)||s(e,i)}for(;m;)w(g[m-1]);return o(v),g}(k,e,C,1,t,_,w,$,z,ct,null,nt),q());const n={};8&e&&(n.numActive=t[3]),1&e&&(n.currentFilter=t[0]),4&e&&(n.numCompleted=t[2]),x.$set(n)},i(t){if(!y){for(let t=0;t<_.length;t+=1)P(k[t]);P(x.$$.fragment,t),y=!0}},o(t){for(let t=0;tfunction(t,e,n){const o=t.$$.props[e];void 0!==o&&(t.$$.bound[o]=n,n(t.$$.ctx[o]))}(o,"item",l))),o.$on("removeItem",(function(){return e[10](e[13])})),{key:t,first:null,c(){n=f(),B(o.$$.fragment),this.first=n},m(t,e){i(t,n,e),W(o,t,e),r=!0},p(t,n){e=t;const r={};var l;16&n&&(r.index=e[13]),!c&&16&n&&(c=!0,r.item=e[11],l=()=>c=!1,_.push(l)),o.$set(r)},i(t){r||(P(o.$$.fragment,t),r=!0)},o(t){T(o.$$.fragment,t),r=!1},d(t){t&&u(n),D(o,t)}}}function rt(t){let e,n,o,c;e=new Q({}),e.$on("addItem",t[5]);let r=t[1].length>0&&ot(t);return{c(){B(e.$$.fragment),n=d(),r&&r.c(),o=f()},m(t,l){W(e,t,l),i(t,n,l),r&&r.m(t,l),i(t,o,l),c=!0},p(t,[e]){t[1].length>0?r?(r.p(t,e),2&e&&P(r,1)):(r=ot(t),r.c(),P(r,1),r.m(o.parentNode,o)):r&&(j(),T(r,1,1,(()=>{r=null})),q())},i(t){c||(P(e.$$.fragment,t),P(r),c=!0)},o(t){T(e.$$.fragment,t),T(r),c=!1},d(t){D(e,t),t&&u(n),r&&r.d(t),t&&u(o)}}}function lt(t,e,n){let o,c,r,l="all",i=[];function u(t){i.splice(t,1),n(1,i)}var s;s=()=>{(function(t){let e="all";function n(){switch(window.location.hash){case"#/active":e="active";break;case"#/completed":e="completed";break;default:e="all"}t(e)}return{init:function(){window.addEventListener("hashchange",n)}}})((t=>n(0,l=t))).init()},y().$$.on_mount.push(s);return t.$$.update=()=>{3&t.$$.dirty&&n(4,o="all"===l?i:"completed"===l?i.filter((t=>t.completed)):i.filter((t=>!t.completed))),2&t.$$.dirty&&n(3,c=i.filter((t=>!t.completed)).length),2&t.$$.dirty&&n(2,r=i.filter((t=>t.completed)).length)},[l,i,r,c,o,function(t){i.push({id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})),description:t.detail.text,completed:!1}),n(1,i)},u,function(t){const e=t.target.checked;n(1,i=i.map((t=>({...t,completed:e}))))},function(){n(1,i=i.filter((t=>!t.completed)))},function(t,e,c,r){c[r]=t,n(4,o),n(0,l),n(1,i)},t=>u(t)]}return new class extends H{constructor(t){super(),G(this,t,lt,rt,r,{})}}({target:document.querySelector(".todoapp")})}(); //# sourceMappingURL=app.js.map diff --git a/resources/todomvc/architecture-examples/svelte-complex/dist/app.js.map b/resources/todomvc/architecture-examples/svelte-complex/dist/app.js.map index 749199311..0074b2b0d 100644 --- a/resources/todomvc/architecture-examples/svelte-complex/dist/app.js.map +++ b/resources/todomvc/architecture-examples/svelte-complex/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sources":["../node_modules/svelte/internal/index.mjs","../src/Header.svelte","../src/Footer.svelte","../src/Item.svelte","../src/App.svelte","../src/router.js","../src/utils.js","../src/index.js"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\nfunction is_promise(value) {\n return !!value && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nlet src_url_equal_anchor;\nfunction src_url_equal(element_src, url) {\n if (!src_url_equal_anchor) {\n src_url_equal_anchor = document.createElement('a');\n }\n src_url_equal_anchor.href = url;\n return element_src === src_url_equal_anchor.href;\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\nfunction get_all_dirty_from_scope($$scope) {\n if ($$scope.ctx.length > 32) {\n const dirty = [];\n const length = $$scope.ctx.length / 32;\n for (let i = 0; i < length; i++) {\n dirty[i] = -1;\n }\n return dirty;\n }\n return -1;\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\nfunction split_css_unit(value) {\n const split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n return split ? [parseFloat(split[1]), split[2] || 'px'] : [value, 'px'];\n}\nconst contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\nfunction start_hydrating() {\n is_hydrating = true;\n}\nfunction end_hydrating() {\n is_hydrating = false;\n}\nfunction upper_bound(low, high, key, value) {\n // Return first index of value larger than input value in the range [low, high)\n while (low < high) {\n const mid = low + ((high - low) >> 1);\n if (key(mid) <= value) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n return low;\n}\nfunction init_hydrate(target) {\n if (target.hydrate_init)\n return;\n target.hydrate_init = true;\n // We know that all children have claim_order values since the unclaimed have been detached if target is not \n let children = target.childNodes;\n // If target is , there may be children without claim_order\n if (target.nodeName === 'HEAD') {\n const myChildren = [];\n for (let i = 0; i < children.length; i++) {\n const node = children[i];\n if (node.claim_order !== undefined) {\n myChildren.push(node);\n }\n }\n children = myChildren;\n }\n /*\n * Reorder claimed children optimally.\n * We can reorder claimed children optimally by finding the longest subsequence of\n * nodes that are already claimed in order and only moving the rest. The longest\n * subsequence of nodes that are claimed in order can be found by\n * computing the longest increasing subsequence of .claim_order values.\n *\n * This algorithm is optimal in generating the least amount of reorder operations\n * possible.\n *\n * Proof:\n * We know that, given a set of reordering operations, the nodes that do not move\n * always form an increasing subsequence, since they do not move among each other\n * meaning that they must be already ordered among each other. Thus, the maximal\n * set of nodes that do not move form a longest increasing subsequence.\n */\n // Compute longest increasing subsequence\n // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n const m = new Int32Array(children.length + 1);\n // Predecessor indices + 1\n const p = new Int32Array(children.length);\n m[0] = -1;\n let longest = 0;\n for (let i = 0; i < children.length; i++) {\n const current = children[i].claim_order;\n // Find the largest subsequence length such that it ends in a value less than our current value\n // upper_bound returns first greater value, so we subtract one\n // with fast path for when we are on the current longest subsequence\n const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;\n p[i] = m[seqLen] + 1;\n const newLen = seqLen + 1;\n // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n m[newLen] = i;\n longest = Math.max(newLen, longest);\n }\n // The longest increasing subsequence of nodes (initially reversed)\n const lis = [];\n // The rest of the nodes, nodes that will be moved\n const toMove = [];\n let last = children.length - 1;\n for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n lis.push(children[cur - 1]);\n for (; last >= cur; last--) {\n toMove.push(children[last]);\n }\n last--;\n }\n for (; last >= 0; last--) {\n toMove.push(children[last]);\n }\n lis.reverse();\n // We sort the nodes being moved to guarantee that their insertion order matches the claim order\n toMove.sort((a, b) => a.claim_order - b.claim_order);\n // Finally, we move the nodes\n for (let i = 0, j = 0; i < toMove.length; i++) {\n while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {\n j++;\n }\n const anchor = j < lis.length ? lis[j] : null;\n target.insertBefore(toMove[i], anchor);\n }\n}\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction append_styles(target, style_sheet_id, styles) {\n const append_styles_to = get_root_for_style(target);\n if (!append_styles_to.getElementById(style_sheet_id)) {\n const style = element('style');\n style.id = style_sheet_id;\n style.textContent = styles;\n append_stylesheet(append_styles_to, style);\n }\n}\nfunction get_root_for_style(node) {\n if (!node)\n return document;\n const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n if (root && root.host) {\n return root;\n }\n return node.ownerDocument;\n}\nfunction append_empty_stylesheet(node) {\n const style_element = element('style');\n append_stylesheet(get_root_for_style(node), style_element);\n return style_element.sheet;\n}\nfunction append_stylesheet(node, style) {\n append(node.head || node, style);\n return style.sheet;\n}\nfunction append_hydration(target, node) {\n if (is_hydrating) {\n init_hydrate(target);\n if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) {\n target.actual_end_child = target.firstChild;\n }\n // Skip nodes of undefined ordering\n while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {\n target.actual_end_child = target.actual_end_child.nextSibling;\n }\n if (node !== target.actual_end_child) {\n // We only insert if the ordering of this node should be modified or the parent node is not target\n if (node.claim_order !== undefined || node.parentNode !== target) {\n target.insertBefore(node, target.actual_end_child);\n }\n }\n else {\n target.actual_end_child = node.nextSibling;\n }\n }\n else if (node.parentNode !== target || node.nextSibling !== null) {\n target.appendChild(node);\n }\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction insert_hydration(target, node, anchor) {\n if (is_hydrating && !anchor) {\n append_hydration(target, node);\n }\n else if (node.parentNode !== target || node.nextSibling != anchor) {\n target.insertBefore(node, anchor || null);\n }\n}\nfunction detach(node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction comment(content) {\n return document.createComment(content);\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_immediate_propagation(fn) {\n return function (event) {\n event.stopImmediatePropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction trusted(fn) {\n return function (event) {\n // @ts-ignore\n if (event.isTrusted)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data_map(node, data_map) {\n Object.keys(data_map).forEach((key) => {\n set_custom_element_data(node, key, data_map[key]);\n });\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction set_dynamic_element_data(tag) {\n return (/-/.test(tag)) ? set_custom_element_data_map : set_attributes;\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction init_binding_group(group) {\n let _inputs;\n return {\n /* push */ p(...inputs) {\n _inputs = inputs;\n _inputs.forEach(input => group.push(input));\n },\n /* remove */ r() {\n _inputs.forEach(input => group.splice(group.indexOf(input), 1));\n }\n };\n}\nfunction init_binding_group_dynamic(group, indexes) {\n let _group = get_binding_group(group);\n let _inputs;\n function get_binding_group(group) {\n for (let i = 0; i < indexes.length; i++) {\n group = group[indexes[i]] = group[indexes[i]] || [];\n }\n return group;\n }\n function push() {\n _inputs.forEach(input => _group.push(input));\n }\n function remove() {\n _inputs.forEach(input => _group.splice(_group.indexOf(input), 1));\n }\n return {\n /* update */ u(new_indexes) {\n indexes = new_indexes;\n const new_group = get_binding_group(group);\n if (new_group !== _group) {\n remove();\n _group = new_group;\n push();\n }\n },\n /* push */ p(...inputs) {\n _inputs = inputs;\n push();\n },\n /* remove */ r: remove\n };\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction init_claim_info(nodes) {\n if (nodes.claim_info === undefined) {\n nodes.claim_info = { last_index: 0, total_claimed: 0 };\n }\n}\nfunction claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {\n // Try to find nodes in an order such that we lengthen the longest increasing subsequence\n init_claim_info(nodes);\n const resultNode = (() => {\n // We first try to find an element after the previous one\n for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n return node;\n }\n }\n // Otherwise, we try to find one before\n // We iterate in reverse so that we don't go too far back\n for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n else if (replacement === undefined) {\n // Since we spliced before the last_index, we decrease it\n nodes.claim_info.last_index--;\n }\n return node;\n }\n }\n // If we can't find any matching node, we create a new one\n return createNode();\n })();\n resultNode.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n return resultNode;\n}\nfunction claim_element_base(nodes, name, attributes, create_element) {\n return claim_node(nodes, (node) => node.nodeName === name, (node) => {\n const remove = [];\n for (let j = 0; j < node.attributes.length; j++) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n remove.forEach(v => node.removeAttribute(v));\n return undefined;\n }, () => create_element(name));\n}\nfunction claim_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, element);\n}\nfunction claim_svg_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, svg_element);\n}\nfunction claim_text(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 3, (node) => {\n const dataStr = '' + data;\n if (node.data.startsWith(dataStr)) {\n if (node.data.length !== dataStr.length) {\n return node.splitText(dataStr.length);\n }\n }\n else {\n node.data = dataStr;\n }\n }, () => text(data), true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n );\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction claim_comment(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 8, (node) => {\n node.data = '' + data;\n return undefined;\n }, () => comment(data), true);\n}\nfunction find_comment(nodes, text, start) {\n for (let i = start; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n return i;\n }\n }\n return nodes.length;\n}\nfunction claim_html_tag(nodes, is_svg) {\n // find html opening tag\n const start_index = find_comment(nodes, 'HTML_TAG_START', 0);\n const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);\n if (start_index === end_index) {\n return new HtmlTagHydration(undefined, is_svg);\n }\n init_claim_info(nodes);\n const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n detach(html_tag_nodes[0]);\n detach(html_tag_nodes[html_tag_nodes.length - 1]);\n const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n for (const n of claimed_nodes) {\n n.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n }\n return new HtmlTagHydration(claimed_nodes, is_svg);\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n text.data = data;\n}\nfunction set_data_contenteditable(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n text.data = data;\n}\nfunction set_data_maybe_contenteditable(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable(text, data);\n }\n else {\n set_data(text, data);\n }\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n if (value === null) {\n node.style.removeProperty(key);\n }\n else {\n node.style.setProperty(key, value, important ? 'important' : '');\n }\n}\nfunction select_option(select, value, mounting) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n if (!mounting || value !== undefined) {\n select.selectedIndex = -1; // no option should be selected\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked');\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n // make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n // see https://github.com/sveltejs/svelte/issues/4233\n fn();\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, bubbles, cancelable, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nfunction head_selector(nodeId, head) {\n const result = [];\n let started = 0;\n for (const node of head.childNodes) {\n if (node.nodeType === 8 /* comment node */) {\n const comment = node.textContent.trim();\n if (comment === `HEAD_${nodeId}_END`) {\n started -= 1;\n result.push(node);\n }\n else if (comment === `HEAD_${nodeId}_START`) {\n started += 1;\n result.push(node);\n }\n }\n else if (started > 0) {\n result.push(node);\n }\n }\n return result;\n}\nclass HtmlTag {\n constructor(is_svg = false) {\n this.is_svg = false;\n this.is_svg = is_svg;\n this.e = this.n = null;\n }\n c(html) {\n this.h(html);\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n if (this.is_svg)\n this.e = svg_element(target.nodeName);\n /** #7364 target for