yrv
Version:
Your routing bro!
2 lines (1 loc) • 25.2 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var n=require("svelte/internal"),t=require("svelte/store"),e=require("svelte"),r=new RegExp("%[a-f0-9]{2}","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function i(n,t){try{return decodeURIComponent(n.join(""))}catch(n){}if(1===n.length)return n;t=t||1;var e=n.slice(0,t),r=n.slice(t);return Array.prototype.concat.call([],i(e),i(r))}function c(n){try{return decodeURIComponent(n)}catch(o){for(var t=n.match(r),e=1;e<t.length;e++)t=(n=i(t,e).join("")).match(r);return n}}var a=function(n){if("string"!=typeof n)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof n+"`");try{return n=n.replace(/\+/g," "),decodeURIComponent(n)}catch(t){return function(n){for(var t={"%FE%FF":"��","%FF%FE":"��"},e=o.exec(n);e;){try{t[e[0]]=decodeURIComponent(e[0])}catch(n){var r=c(e[0]);r!==e[0]&&(t[e[0]]=r)}e=o.exec(n)}t["%C2"]="�";for(var i=Object.keys(t),a=0;a<i.length;a++){var u=i[a];n=n.replace(new RegExp(u,"g"),t[u])}return n}(n)}},u=function(n,t){if("string"!=typeof n||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[n];var e=n.indexOf(t);return-1===e?[n]:[n.slice(0,e),n.slice(e+t.length)]};function s(n,t){return t.encode?t.strict?encodeURIComponent(n).replace(/[!'()*]/g,(function(n){return"%"+n.charCodeAt(0).toString(16).toUpperCase()})):encodeURIComponent(n):n}function l(n,t){return t.decode?a(n):n}function f(n){var t=n.indexOf("#");return-1!==t&&(n=n.slice(0,t)),n}function p(n){var t=(n=f(n)).indexOf("?");return-1===t?"":n.slice(t+1)}function d(n,t){return t.parseNumbers&&!Number.isNaN(Number(n))&&"string"==typeof n&&""!==n.trim()?n=Number(n):!t.parseBooleans||null===n||"true"!==n.toLowerCase()&&"false"!==n.toLowerCase()||(n="true"===n.toLowerCase()),n}function v(n,t){var e=function(n){var t;switch(n.arrayFormat){case"index":return function(n,e,r){t=/\[(\d*)\]$/.exec(n),n=n.replace(/\[\d*\]$/,""),t?(void 0===r[n]&&(r[n]={}),r[n][t[1]]=e):r[n]=e};case"bracket":return function(n,e,r){t=/(\[\])$/.exec(n),n=n.replace(/\[\]$/,""),t?void 0!==r[n]?r[n]=[].concat(r[n],e):r[n]=[e]:r[n]=e};case"comma":return function(n,t,e){var r="string"==typeof t&&t.split("").indexOf(",")>-1?t.split(","):t;e[n]=r};default:return function(n,t,e){void 0!==e[n]?e[n]=[].concat(e[n],t):e[n]=t}}}(t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",parseNumbers:!1,parseBooleans:!1},t)),r=Object.create(null);if("string"!=typeof n)return r;if(!(n=n.trim().replace(/^[?#&]/,"")))return r;for(var o=0,i=n.split("&");o<i.length;o+=1){var c=i[o],a=u(c.replace(/\+/g," "),"="),s=a[0],f=a[1];f=void 0===f?null:l(f,t),e(l(s,t),f,r)}for(var p=0,v=Object.keys(r);p<v.length;p+=1){var h=v[p],m=r[h];if("object"==typeof m&&null!==m)for(var g=0,_=Object.keys(m);g<_.length;g+=1){var y=_[g];m[y]=d(m[y],t)}else r[h]=d(m,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((function(n,t){var e=r[t];return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)?n[t]=function n(t){return Array.isArray(t)?t.sort():"object"==typeof t?n(Object.keys(t)).sort((function(n,t){return Number(n)-Number(t)})).map((function(n){return t[n]})):t}(e):n[t]=e,n}),Object.create(null))}var h={extract:p,parse:v,stringify:function(n,t){if(!n)return"";var e=function(n){switch(n.arrayFormat){case"index":return function(t){return function(e,r){var o=e.length;return void 0===r?e:null===r?e.concat([[s(t,n),"[",o,"]"].join("")]):e.concat([[s(t,n),"[",s(o,n),"]=",s(r,n)].join("")])}};case"bracket":return function(t){return function(e,r){return void 0===r?e:null===r?e.concat([[s(t,n),"[]"].join("")]):e.concat([[s(t,n),"[]=",s(r,n)].join("")])}};case"comma":return function(t){return function(e,r,o){return null==r||0===r.length?e:0===o?[[s(t,n),"=",s(r,n)].join("")]:[[e,s(r,n)].join(",")]}};default:return function(t){return function(e,r){return void 0===r?e:null===r?e.concat([s(t,n)]):e.concat([[s(t,n),"=",s(r,n)].join("")])}}}}(t=Object.assign({encode:!0,strict:!0,arrayFormat:"none"},t)),r=Object.keys(n);return!1!==t.sort&&r.sort(t.sort),r.map((function(r){var o=n[r];return void 0===o?"":null===o?s(r,t):Array.isArray(o)?o.reduce(e(r),[]).join("&"):s(r,t)+"="+s(o,t)})).filter((function(n){return n.length>0})).join("&")},parseUrl:function(n,t){return{url:f(n).split("?")[0]||"",query:v(p(n),t)}}},m=function(n){function t(t,e){var r="Unreachable '"+t+"', segment '"+e+"' is not defined";n.call(this,r),this.message=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error);function g(n,t){var e,r,o=-100,i=[];e=n.replace(/[-$.]/g,"\\$&").replace(/\(/g,"(?:").replace(/\)/g,")?").replace(/([:*]\w+)(?:<([^<>]+?)>)?/g,(function(n,t,e){return i.push(t.substr(1)),":"===t.charAt()?(o+=100,"((?!#)"+(e||"[^#/]+?")+")"):(r=!0,o+=500,"((?!#)"+(e||"[^#]+?")+")")}));try{e=new RegExp("^"+e+"$")}catch(n){throw new TypeError("Invalid route expression, given '"+t+"'")}var c=n.includes("#")?.5:1,a=n.length*o*c;return{keys:i,regex:e,_depth:a,_isSplat:r}}var _=function(n,t){var e=g(n,t),r=e.keys,o=e.regex,i=e._depth;return{_isSplat:e._isSplat,_depth:i,match:function(n){var t=n.match(o);if(t)return r.reduce((function(n,e,r){return n[e]="string"==typeof t[r+1]?decodeURIComponent(t[r+1]):null,n}),{})}}};function y(n,t){return""+(t&&"/"!==t?t:"")+(n||"")}function b(n,t){var e=n.match(/<[^<>]*\/[^<>]*>/);if(e)throw new TypeError("RegExp cannot contain slashes, given '"+e+"'");var r=n.split(/(?=\/|#)/),o=[];"/"!==r[0]&&r.unshift("/"),r.some((function(n,e){var i=o.slice(1).concat(n).join("")||null,c=r.slice(e+1).join("")||null,a=t(n,i,c?""+("/"!==n?n:"")+c:null);return o.push(n),a}))}function w(n,t,e){var r,o={},i=[];return b(n,(function(c,a,u){var s;if(!t.keys)throw new m(n,c);if(t.keys.some((function(n){if(e.includes(n))return!1;var l=t[n].pattern,f=l.match,p=l._isSplat,d=f(p&&u||c);if(d){if(Object.assign(o,d),t[n].route){var v=Object.assign({},t[n].info),h=!1;h=v.exact?null===u:!(c&&null===a)||c===a||p||!u,v.matches=h,v.params=Object.assign({},o),v.route=t[n].route,v.path=p&&u||a||c,i.push(v)}return null===u&&!t[n].keys||("/"!==n&&e.push(n),r=p,t=t[n],s=!0,!0)}return!1})),!s&&!t.keys.some((function(n){return t[n].pattern.match(c)})))throw new m(n,c);return r||!s})),i}function k(n,t,e){for(var r=w.bind(null,n,t),o=[];e>0;){e-=1;try{return r(o)}catch(n){if(e>0)return r(o);throw n}}}_.push=function(n,t,e,r){var o=t[n]||(t[n]={});return o.pattern||(o.pattern=new _(n,r),o.route=(e||"").replace(/\/$/,"")||"/"),t.keys=t.keys||[],t.keys.includes(n)||(t.keys.push(n),_.sort(t)),o},_.sort=function(n){n.keys.sort((function(t,e){return n[t].pattern._depth-n[e].pattern._depth}))};var $=function(){var n={},t=[];return{resolve:function(t,e){var r=t.split("?")[0],o=[];b(r,(function(t,r,i){try{e(null,k(r,n,1).filter((function(n){return!o.includes(n.route)&&(o.push(n.route),!0)})))}catch(n){e(n,[])}}))},mount:function(n,e){"/"!==n&&t.push(n),e(),t.pop()},find:function(t,e){return k(t,n,!0===e?2:e||1)},add:function(e,r){return function(n,t,e,r){var o,i=y(n,e),c=t;return r&&!0!==r.nested&&(o=r.key,delete r.key),b(i,(function(n,t){c=_.push(n,c,t,i),"/"!==n&&(c.info=c.info||Object.assign({},r))})),c.info=c.info||Object.assign({},r),o&&(c.info.key=o),i}(e,n,t.join(""),r)},rm:function(e){return function(n,t,e){var r=y(n,e),o=t,i=null,c=null;if(b(r,(function(t){if(!o)return i=null,!0;if(!o.keys)throw new m(n,t);i=o,o=o[c=t]})),!i||!c)throw new m(n,c);if(i===t&&(i=t["/"]),i.route!==c){var a=i.keys.indexOf(c);if(-1===a)throw new m(n,c);i.keys.splice(a,1),_.sort(i),delete i[c]}o.route===i.route&&delete i.info}(e,n,t.join(""))}}};$.matches=function(n,t){return g(n,t).regex.test(t)};var x={},j=document.getElementsByTagName("base"),O=(j[0]&&j[0].href.replace(/\/$/,"")||"/").replace(window.location.origin,""),E=t.writable({path:"/",query:{},params:{}}),N={},C={},A="null"===window.location.origin;function R(n){return"boolean"==typeof n&&(A=!!n),A}function I(n,t){var e=R()?window.location.hash.replace("#",""):window.location.pathname;"/"!==n.charAt()&&(n=e+n),e+window.location.hash+window.location.search!==n&&t(n)}function T(n,t){var e=t||{},r=e.reload,o=e.replace,i=e.params,c=e.queryParams;if(!n||"string"!=typeof n||"/"!==n[0]&&"#"!==n[0])throw new Error("Expecting '/"+n+"' or '#"+n+"', given '"+n+"'");if(i&&(n=n.replace(/:([a-zA-Z][a-zA-Z0-9_-]*)/g,(function(n,t){return i[t]}))),"/"!==O&&0!==n.indexOf(O)&&(n=O+n),c){var a=h.stringify(c);a&&(n+="?"+a)}R()?window.location.hash=n.replace(/^#/,""):!r&&window.history.pushState&&window.dispatchEvent?I(n,(function(n){window.history[o?"replaceState":"pushState"](null,"",n),window.dispatchEvent(new Event("popstate"))})):window.location.href=n}function S(n,t){var e=n.props,r=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&-1===t.indexOf(r)&&(e[r]=n[r]);return e}(n,["props"]);return(t=Array.isArray(t)?t:Object.keys(t)).forEach((function(n){delete r[n]})),Object.assign({},e,r)}function U(n,t,e){return x[[n,t,e]]||(!0!==e&&0===t.indexOf(n)?x[[n,t,e]]=/^[#/?]?$/.test(t.substr(n.length,1)):n.includes("*")||n.includes(":")?x[[n,t,e]]=$.matches(n,t):x[[n,t,e]]=t===n),x[[n,t,e]]}var q,z=new $,F=t.writable({}),P={},L={},B=[],M=0;function D(n,t){F.update((function(e){var r;return Object.assign({},e,((r={})[t]=Object.assign({},L.router,{failure:n}),r))}))}function Z(){var n,t=R()?window.location.hash||"/":window.location.href.replace(window.location.origin,"");"/"!==O&&(t=t.replace(O,""));var e=t.replace("/#","#").replace(/^#\//,"/").split("?"),r=e[0],o=e[1],i=h.parse(o),c={},a=[];F.set({}),E.set({query:i,params:c,path:r}),z.resolve(r,(function(t,e){t?n=t:a.push.apply(a,function(n,t){var e=[];return n.some((function(n){if(n.key&&n.matches&&!n.fallback&&!L.routeInfo[n.key]){if(n.redirect&&(null===n.condition||!0!==n.condition(L.router)))return(!n.exact||L.router.path===n.path)&&(T(n.redirect),!0);n.exact&&e.push(n.key),Object.assign(t,n.params),F.update((function(t){var e;return Object.assign({},t,((e={})[n.key]=Object.assign({},L.router,n),e))}))}return!1})),e}(e,c))}));var u,s={};n&&a.reduce((function(n,t){return n[t]=null,n}),s),B.forEach((function(n){return n()})),B=[];try{z.find(r).forEach((function(n){n.exact&&!n.matches&&(s[n.key]=null)}))}catch(n){}F.update((function(n){return Object.assign({},n,s)})),Object.keys(P).forEach((function(t){if(U(t,r,!1)){var e=P[t].callback;e(n),B.push(e)}!u&&P[t].fallback&&(u=P[t].fallback)})),n&&u&&D(n,u)}function G(){clearTimeout(q),q=setTimeout(Z)}function H(n,t,e){return M||window.addEventListener("popstate",G,!1),P[n]={fallback:t,callback:e},M+=1,function(){delete P[n],(M-=1)||window.removeEventListener("popstate",G,!1)}}function J(t){var e,r=t[15].default,o=n.create_slot(r,t,t[14],null);return{c:function(){o&&o.c()},m:function(n,t){o&&o.m(n,t),e=!0},p:function(t,e){o&&o.p&&16384&e&&o.p(n.get_slot_context(r,t,t[14],null),n.get_slot_changes(r,t[14],e,null))},i:function(t){e||(n.transition_in(o,t),e=!0)},o:function(t){n.transition_out(o,t),e=!1},d:function(n){o&&o.d(n)}}}function K(t){var e,r,o,i,c,a,u;return{c:function(){e=n.element("fieldset"),r=n.element("legend"),o=n.text("Router failure: "),i=n.text(t[1]),c=n.space(),a=n.element("pre"),u=n.text(t[3]),n.attr(e,"data-failure",""),n.attr(e,"class","svelte-kx2cky")},m:function(t,s){n.insert(t,e,s),n.append(e,r),n.append(r,o),n.append(r,i),n.append(e,c),n.append(e,a),n.append(a,u)},p:function(t,e){2&e&&n.set_data(i,t[1]),8&e&&n.set_data(u,t[3])},d:function(t){t&&n.detach(e)}}}function Q(t){var e,r,o,i=!t[0]&&J(t),c=t[3]&&!t[4]&&!t[2]&&K(t);return{c:function(){i&&i.c(),e=n.space(),c&&c.c(),r=n.empty()},m:function(t,a){i&&i.m(t,a),n.insert(t,e,a),c&&c.m(t,a),n.insert(t,r,a),o=!0},p:function(t,o){var a=o[0];t[0]?i&&(n.group_outros(),n.transition_out(i,1,1,(function(){i=null})),n.check_outros()):i?(i.p(t,a),n.transition_in(i,1)):((i=J(t)).c(),n.transition_in(i,1),i.m(e.parentNode,e)),!t[3]||t[4]||t[2]?c&&(c.d(1),c=null):c?c.p(t,a):((c=K(t)).c(),c.m(r.parentNode,r))},i:function(t){o||(n.transition_in(i),o=!0)},o:function(t){n.transition_out(i),o=!1},d:function(t){i&&i.d(t),t&&n.detach(e),c&&c.d(t),t&&n.detach(r)}}}function V(n){z.rm(n),G()}function W(r,o,i){var c,a,u,s,l;n.component_subscribe(r,E,(function(n){return i(9,a=n)}));var f=o.path;void 0===f&&(f="/");var p=o.disabled;void 0===p&&(p=!1);var d=o.condition;void 0===d&&(d=null);var v=o.nofallback;void 0===v&&(v=!1);var h=e.getContext(N),m=h?h.basePath:t.writable(f);n.component_subscribe(r,m,(function(n){return i(8,c=n)}));var g=c!==f&&"/"!==c?""+c+("/"!==f?f:""):f;try{if(null!==d&&"function"!=typeof d)throw new TypeError("Expecting condition to be a function, given '"+d+"'");if("#"!==f.charAt()&&"/"!==f.charAt())throw new TypeError("Expecting a leading slash or hash, given '"+f+"'")}catch(n){s=n}function _(n,t,e){n=n||Math.random().toString(36).substr(2);var r,o=!t.substr(1).includes("/"),c=Object.assign({},{key:n,nested:o},e);return z.mount(g,(function(){r=z.add(t,c),i(4,l=c.fallback&&n||l)})),G(),[n,r]}function y(n){i(3,s=n),s&&l&&D(s,l)}e.onMount((function(){u=H(g,l,y)})),e.onDestroy((function(){u&&u()})),e.setContext(N,{basePath:m,assignRoute:_,unassignRoute:V});var b=o.$$slots;void 0===b&&(b={});var w=o.$$scope;return r.$set=function(n){"path"in n&&i(1,f=n.path),"disabled"in n&&i(0,p=n.disabled),"condition"in n&&i(6,d=n.condition),"nofallback"in n&&i(2,v=n.nofallback),"$$scope"in n&&i(14,w=n.$$scope)},r.$$.update=function(){576&r.$$.dirty&&d&&i(0,p=!d(a))},[p,f,v,s,l,m,d,u,c,a,h,g,_,y,w,b]}E.subscribe((function(n){L.router=n})),F.subscribe((function(n){L.routeInfo=n}));var X=function(t){function e(e){var r;t.call(this),document.getElementById("svelte-kx2cky-style")||((r=n.element("style")).id="svelte-kx2cky-style",r.textContent="[data-failure].svelte-kx2cky{border:1px dashed silver}",n.append(document.head,r)),n.init(this,e,W,Q,n.safe_not_equal,{path:1,disabled:0,condition:6,nofallback:2})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(n.SvelteComponent);var Y=function(n){return{router:8&n,props:16&n}},nn=function(n){return{router:n[3],props:n[4]}};function tn(t){var e,r;return{c:function(){e=n.element("p"),r=n.text(t[5]),n.attr(e,"data-failure",""),n.attr(e,"class","svelte-7lze0z")},m:function(t,o){n.insert(t,e,o),n.append(e,r)},p:function(t,e){32&e&&n.set_data(r,t[5])},d:function(t){t&&n.detach(e)}}}function en(t){var e,r,o,i,c=[cn,on,rn],a=[];function u(n,t){return n[0]?0:n[2]?1:2}return e=u(t),r=a[e]=c[e](t),{c:function(){r.c(),o=n.empty()},m:function(t,r){a[e].m(t,r),n.insert(t,o,r),i=!0},p:function(t,i){var s=e;(e=u(t))===s?a[e].p(t,i):(n.group_outros(),n.transition_out(a[s],1,1,(function(){a[s]=null})),n.check_outros(),(r=a[e])||(r=a[e]=c[e](t)).c(),n.transition_in(r,1),r.m(o.parentNode,o))},i:function(t){i||(n.transition_in(r),i=!0)},o:function(t){n.transition_out(r),i=!1},d:function(t){a[e].d(t),t&&n.detach(o)}}}function rn(t){var e,r=t[24].default,o=n.create_slot(r,t,t[23],nn);return{c:function(){o&&o.c()},m:function(n,t){o&&o.m(n,t),e=!0},p:function(t,e){o&&o.p&&8388632&e&&o.p(n.get_slot_context(r,t,t[23],nn),n.get_slot_changes(r,t[23],e,Y))},i:function(t){e||(n.transition_in(o,t),e=!0)},o:function(t){n.transition_out(o,t),e=!1},d:function(n){o&&o.d(n)}}}function on(t){var e,r,o=[{router:t[3]},t[4]],i=t[2];function c(t){for(var e={},r=0;r<o.length;r+=1)e=n.assign(e,o[r]);return{props:e}}if(i)var a=new i(c());return{c:function(){a&&n.create_component(a.$$.fragment),e=n.empty()},m:function(t,o){a&&n.mount_component(a,t,o),n.insert(t,e,o),r=!0},p:function(t,r){var u=24&r?n.get_spread_update(o,[8&r&&{router:t[3]},16&r&&n.get_spread_object(t[4])]):{};if(i!==(i=t[2])){if(a){n.group_outros();var s=a;n.transition_out(s.$$.fragment,1,0,(function(){n.destroy_component(s,1)})),n.check_outros()}i?(a=new i(c()),n.create_component(a.$$.fragment),n.transition_in(a.$$.fragment,1),n.mount_component(a,e.parentNode,e)):a=null}else i&&a.$set(u)},i:function(t){r||(a&&n.transition_in(a.$$.fragment,t),r=!0)},o:function(t){a&&n.transition_out(a.$$.fragment,t),r=!1},d:function(t){t&&n.detach(e),a&&n.destroy_component(a,t)}}}function cn(t){var e,r,o,i={ctx:t,current:null,token:null,pending:sn,then:un,catch:an,value:25,blocks:[,,,]};return n.handle_promise(r=t[0],i),{c:function(){e=n.empty(),i.block.c()},m:function(t,r){n.insert(t,e,r),i.block.m(t,i.anchor=r),i.mount=function(){return e.parentNode},i.anchor=e,o=!0},p:function(e,o){if(t=e,i.ctx=t,1&o&&r!==(r=t[0])&&n.handle_promise(r,i));else{var c=t.slice();c[25]=i.resolved,i.block.p(c,o)}},i:function(t){o||(n.transition_in(i.block),o=!0)},o:function(t){for(var e=0;e<3;e+=1){var r=i.blocks[e];n.transition_out(r)}o=!1},d:function(t){t&&n.detach(e),i.block.d(t),i.token=null,i=null}}}function an(t){return{c:n.noop,m:n.noop,p:n.noop,i:n.noop,o:n.noop,d:n.noop}}function un(t){var e,r,o=[{router:t[3]},t[4]],i=t[25].default;function c(t){for(var e={},r=0;r<o.length;r+=1)e=n.assign(e,o[r]);return{props:e}}if(i)var a=new i(c());return{c:function(){a&&n.create_component(a.$$.fragment),e=n.empty()},m:function(t,o){a&&n.mount_component(a,t,o),n.insert(t,e,o),r=!0},p:function(t,r){var u=24&r?n.get_spread_update(o,[8&r&&{router:t[3]},16&r&&n.get_spread_object(t[4])]):{};if(i!==(i=t[25].default)){if(a){n.group_outros();var s=a;n.transition_out(s.$$.fragment,1,0,(function(){n.destroy_component(s,1)})),n.check_outros()}i?(a=new i(c()),n.create_component(a.$$.fragment),n.transition_in(a.$$.fragment,1),n.mount_component(a,e.parentNode,e)):a=null}else i&&a.$set(u)},i:function(t){r||(a&&n.transition_in(a.$$.fragment,t),r=!0)},o:function(t){a&&n.transition_out(a.$$.fragment,t),r=!1},d:function(t){t&&n.detach(e),a&&n.destroy_component(a,t)}}}function sn(t){var e,r=t[1]&&ln(t);return{c:function(){r&&r.c(),e=n.empty()},m:function(t,o){r&&r.m(t,o),n.insert(t,e,o)},p:function(n,t){n[1]?r?r.p(n,t):((r=ln(n)).c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i:n.noop,o:n.noop,d:function(t){r&&r.d(t),t&&n.detach(e)}}}function ln(t){var e;return{c:function(){e=n.text(t[1])},m:function(t,r){n.insert(t,e,r)},p:function(t,r){2&r&&n.set_data(e,t[1])},d:function(t){t&&n.detach(e)}}}function fn(t){var e,r,o,i=t[5]&&tn(t),c=t[3]&&en(t);return{c:function(){i&&i.c(),e=n.space(),c&&c.c(),r=n.empty()},m:function(t,a){i&&i.m(t,a),n.insert(t,e,a),c&&c.m(t,a),n.insert(t,r,a),o=!0},p:function(t,o){var a=o[0];t[5]?i?i.p(t,a):((i=tn(t)).c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),t[3]?c?(c.p(t,a),n.transition_in(c,1)):((c=en(t)).c(),n.transition_in(c,1),c.m(r.parentNode,r)):c&&(n.group_outros(),n.transition_out(c,1,1,(function(){c=null})),n.check_outros())},i:function(t){o||(n.transition_in(c),o=!0)},o:function(t){n.transition_out(c),o=!1},d:function(t){i&&i.d(t),t&&n.detach(e),c&&c.d(t),t&&n.detach(r)}}}function pn(r,o,i){var c,a,u,s=arguments;n.component_subscribe(r,F,(function(n){return i(16,u=n)}));var l=o.key;void 0===l&&(l=null);var f=o.path;void 0===f&&(f="/");var p=o.exact;void 0===p&&(p=null);var d=o.dynamic;void 0===d&&(d=null);var v=o.pending;void 0===v&&(v=null);var h=o.disabled;void 0===h&&(h=!1);var m=o.fallback;void 0===m&&(m=null);var g=o.component;void 0===g&&(g=null);var _=o.condition;void 0===_&&(_=null);var y=o.redirect;void 0===y&&(y=null);var b=e.getContext(C),w=e.getContext(N),k=w||{},$=k.assignRoute,x=k.unassignRoute,j=b?b.routePath:t.writable(f);n.component_subscribe(r,j,(function(n){return i(15,a=n)}));var O,E,A=null,R={},I=a!==f&&"/"!==a?""+a+("/"!==f?f:""):f;try{if(null!==y&&!/^(?:\w+:\/\/|\/)/.test(y))throw new TypeError("Expecting valid URL to redirect, given '"+y+"'");if(null!==_&&"function"!=typeof _)throw new TypeError("Expecting condition to be a function, given '"+_+"'");if("#"!==f.charAt()&&"/"!==f.charAt())throw new TypeError("Expecting a leading slash or hash, given '"+f+"'");if(!$)throw new TypeError("Missing top-level <Router>, given route: "+f);c=$(l,I,{condition:_,redirect:y,fallback:m,exact:p}),l=c[0],O=c[1]}catch(n){E=n}e.onDestroy((function(){x&&x(O)})),e.setContext(C,{routePath:j});var T=o.$$slots;void 0===T&&(T={});var U=o.$$scope;return r.$set=function(t){i(22,o=n.assign(n.assign({},o),n.exclude_internal_props(t))),"key"in t&&i(7,l=t.key),"path"in t&&i(8,f=t.path),"exact"in t&&i(9,p=t.exact),"dynamic"in t&&i(0,d=t.dynamic),"pending"in t&&i(1,v=t.pending),"disabled"in t&&i(10,h=t.disabled),"fallback"in t&&i(11,m=t.fallback),"component"in t&&i(2,g=t.component),"condition"in t&&i(12,_=t.condition),"redirect"in t&&i(13,y=t.redirect),"$$scope"in t&&i(23,U=t.$$scope)},r.$$.update=function(){l&&(i(3,A=!h&&u[l]),i(4,R=S(o,s[0].$$.props)))},o=n.exclude_internal_props(o),[d,v,g,A,R,E,j,l,f,p,h,m,_,y,O,a,u,b,w,$,x,I,o,U,T]}var dn=function(t){function e(e){var r;t.call(this),document.getElementById("svelte-7lze0z-style")||((r=n.element("style")).id="svelte-7lze0z-style",r.textContent="[data-failure].svelte-7lze0z{color:red}",n.append(document.head,r)),n.init(this,e,pn,fn,n.safe_not_equal,{key:7,path:8,exact:9,dynamic:0,pending:1,disabled:10,fallback:11,component:2,condition:12,redirect:13})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(n.SvelteComponent);function vn(t){for(var e,r,o,i=t[18].default,c=n.create_slot(i,t,t[17],null),a=[t[5],{href:t[4]},{class:t[0]},{title:t[1]}],u={},s=0;s<a.length;s+=1)u=n.assign(u,a[s]);return{c:function(){e=n.element("a"),c&&c.c(),n.set_attributes(e,u)},m:function(i,a){n.insert(i,e,a),c&&c.m(e,null),t[20](e),r=!0,o=n.listen(e,"click",n.prevent_default(t[6]))},p:function(t,r){c&&c.p&&131072&r&&c.p(n.get_slot_context(i,t,t[17],null),n.get_slot_changes(i,t[17],r,null)),n.set_attributes(e,n.get_spread_update(a,[32&r&&t[5],16&r&&{href:t[4]},1&r&&{class:t[0]},2&r&&{title:t[1]}]))},i:function(t){r||(n.transition_in(c,t),r=!0)},o:function(t){n.transition_out(c,t),r=!1},d:function(r){r&&n.detach(e),c&&c.d(r),t[20](null),o()}}}function hn(t){for(var e,r,o,i=t[18].default,c=n.create_slot(i,t,t[17],null),a=[t[5],{class:t[0]},{title:t[1]}],u={},s=0;s<a.length;s+=1)u=n.assign(u,a[s]);return{c:function(){e=n.element("button"),c&&c.c(),n.set_attributes(e,u)},m:function(i,a){n.insert(i,e,a),c&&c.m(e,null),t[19](e),r=!0,o=n.listen(e,"click",n.prevent_default(t[6]))},p:function(t,r){c&&c.p&&131072&r&&c.p(n.get_slot_context(i,t,t[17],null),n.get_slot_changes(i,t[17],r,null)),n.set_attributes(e,n.get_spread_update(a,[32&r&&t[5],1&r&&{class:t[0]},2&r&&{title:t[1]}]))},i:function(t){r||(n.transition_in(c,t),r=!0)},o:function(t){n.transition_out(c,t),r=!1},d:function(r){r&&n.detach(e),c&&c.d(r),t[19](null),o()}}}function mn(t){var e,r,o,i,c=[hn,vn],a=[];function u(n,t){return n[2]?0:1}return e=u(t),r=a[e]=c[e](t),{c:function(){r.c(),o=n.empty()},m:function(t,r){a[e].m(t,r),n.insert(t,o,r),i=!0},p:function(t,i){var s=i[0],l=e;(e=u(t))===l?a[e].p(t,s):(n.group_outros(),n.transition_out(a[l],1,1,(function(){a[l]=null})),n.check_outros(),(r=a[e])||(r=a[e]=c[e](t)).c(),n.transition_in(r,1),r.m(o.parentNode,o))},i:function(t){i||(n.transition_in(r),i=!0)},o:function(t){n.transition_out(r),i=!1},d:function(t){a[e].d(t),t&&n.detach(o)}}}function gn(t,r,o){var i,c,a,u=arguments;n.component_subscribe(t,E,(function(n){return o(14,i=n)}));var s=r.class;void 0===s&&(s="");var l=null,f=r.go;void 0===f&&(f=null);var p=r.href;void 0===p&&(p="/");var d=r.title;void 0===d&&(d="");var v=r.button;void 0===v&&(v=!1);var h=r.exact;void 0===h&&(h=!1);var m=r.reload;void 0===m&&(m=!1);var g=r.replace;void 0===g&&(g=!1);var _=r.className;void 0===_&&(_=""),e.onMount((function(){o(0,_=_||s)}));var y=e.createEventDispatcher();function b(n){"string"==typeof f&&window.history.length>1?"back"===f?window.history.back():"fwd"===f?window.history.forward():window.history.go(parseInt(f,10)):I(p,(function(t){T(t,{reload:m,replace:g}),y("click",n)}))}var w=r.$$slots;void 0===w&&(w={});var k,$=r.$$scope;function x(t){n.binding_callbacks[t?"unshift":"push"]((function(){o(3,c=t)}))}function j(t){n.binding_callbacks[t?"unshift":"push"]((function(){o(3,c=t)}))}return t.$set=function(t){o(16,r=n.assign(n.assign({},r),n.exclude_internal_props(t))),"class"in t&&o(7,s=t.class),"go"in t&&o(8,f=t.go),"href"in t&&o(9,p=t.href),"title"in t&&o(1,d=t.title),"button"in t&&o(2,v=t.button),"exact"in t&&o(10,h=t.exact),"reload"in t&&o(11,m=t.reload),"replace"in t&&o(12,g=t.replace),"className"in t&&o(0,_=t.className),"$$scope"in t&&o(17,$=t.$$scope)},t.$$.update=function(){512&t.$$.dirty&&o(4,l="/"!==O?O+p:p),26124&t.$$.dirty&&c&&i.path&&(U(p,i.path,h)?a||(o(13,a=!0),c.setAttribute("aria-current","page"),v&&c.setAttribute("disabled",!0)):a&&(o(13,a=!1),c.removeAttribute("disabled"),c.removeAttribute("aria-current"))),o(5,k=S(r,u[0].$$.props))},r=n.exclude_internal_props(r),[_,d,v,c,l,k,b,s,f,p,h,m,g,a,i,y,r,$,w,x,j]}var _n=function(t){function e(e){t.call(this),n.init(this,e,gn,mn,n.safe_not_equal,{class:7,go:8,href:9,title:1,button:2,exact:10,reload:11,replace:12,className:0})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(n.SvelteComponent);Object.defineProperty(X,"hashchange",{set:function(n){return R(n)},get:function(){return R()},configurable:!1,enumerable:!1}),exports.Link=_n,exports.Route=dn,exports.Router=X,exports.navigateTo=T,exports.router=E;