From 2e8fbfb7777a02f2ae383ae3b0e35cbe8adb9c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Wed, 23 Oct 2019 18:18:59 +0200 Subject: [PATCH] bugfix for selector --- dist/css/demo-386.css | 2 +- dist/js/demo-386.js | 2 +- package.json | 2 +- src/TinyOnePage.riot | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/css/demo-386.css b/dist/css/demo-386.css index c9ee960..906cb52 100644 --- a/dist/css/demo-386.css +++ b/dist/css/demo-386.css @@ -1 +1 @@ -@font-face{font-family:PxPlus IBM VGA8;src:url(/fonts/PxPlus_IBM_VGA8.eot?6487324f1ac4377e882c9af6ce96da0f);src:url(/fonts/PxPlus_IBM_VGA8.eot?6487324f1ac4377e882c9af6ce96da0f?#iefix) format("embedded-opentype"),url(/fonts/PxPlus_IBM_VGA8.woff2?28087632ed5e0851a1ec27def2b1e73f) format("woff2"),url(/fonts/PxPlus_IBM_VGA8.woff?5f9b12f2cef3f405002438fafa0e41a6) format("woff"),url(/fonts/PxPlus_IBM_VGA8.ttf?8fa23fdc4e2cff030f42999bc1ede4b2) format("truetype"),url(/fonts/PxPlus_IBM_VGA8.svg?3000c157212c66cf53ad18f0d7b7a12f#PxPlus_IBM_VGA8) format("svg");font-weight:400;font-style:normal}body{color:#fff;background-color:#000084;font-family:PxPlus IBM VGA8,sans-serif;font-style:normal;font-size:1.2rem;line-height:1.3}a{text-decoration:none}a:focus{outline:none}h1,h2,h3,h4,h5,h6{font-size:18px;font-weight:400;text-transform:uppercase}.site-header{padding:20px;margin:20px 0;color:#000;background:#0aa}.site-header h1,.site-header h2,.site-header h3,.site-header h4,.site-header h5,.site-header h6{margin:0}main{margin:50px 0}.navbar{padding:10px;background-color:#bbb}@media (min-width:768px){.navbar{padding:0}}.navbar ul{list-style:none;padding:10px;margin:0;border:1px solid #000}@media (min-width:768px){.navbar ul{margin:0 0 0 10px;padding:0;border:none}}.navbar ul li{display:block;line-height:20px}@media (min-width:768px){.navbar ul li{display:inline-block}}.navbar ul li a{display:block;padding:4px 10px;color:#fff}@media (min-width:768px){.navbar ul li a{display:inline-block}}.navbar ul li.current a,.navbar ul li a:hover{color:#fff;background-color:#000}footer{text-align:center;font-size:3rem;width:100%;background:#000;padding:.8em 0}footer i{color:#fff!important}[class*=" icon-tiny"],[class^=icon-tiny]{font-family:PxPlus IBM VGA8,sans-serif!important;font-style:normal;color:#fefe5b}.icon-tiny-one-page-open:after{content:"\2630"}.icon-tiny-one-page-close:after{content:"\2A2F"}.tiny-one-page__modal{position:fixed;top:0;left:0;width:100%;z-index:99;height:auto;max-height:0;overflow:hidden;transition:max-height .2s}@media (min-width:768px){.tiny-one-page__modal{max-height:none!important}}.tiny-one-page__button{position:fixed;top:0;right:0;font-size:1.8rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;padding:.7em .8em;z-index:100}.tiny-one-page__button:focus,.tiny-one-page__button:hover{outline:none}.tiny-one-page__button:hover{cursor:pointer}@media (min-width:768px){.tiny-one-page__button{display:none}} \ No newline at end of file +@font-face{font-family:PxPlus IBM VGA8;src:url(/fonts/PxPlus_IBM_VGA8.eot?6487324f1ac4377e882c9af6ce96da0f);src:url(/fonts/PxPlus_IBM_VGA8.eot?6487324f1ac4377e882c9af6ce96da0f?#iefix) format("embedded-opentype"),url(/fonts/PxPlus_IBM_VGA8.woff2?28087632ed5e0851a1ec27def2b1e73f) format("woff2"),url(/fonts/PxPlus_IBM_VGA8.woff?5f9b12f2cef3f405002438fafa0e41a6) format("woff"),url(/fonts/PxPlus_IBM_VGA8.ttf?8fa23fdc4e2cff030f42999bc1ede4b2) format("truetype"),url(/fonts/PxPlus_IBM_VGA8.svg?3000c157212c66cf53ad18f0d7b7a12f#PxPlus_IBM_VGA8) format("svg");font-weight:400;font-style:normal}body{color:#fff;background-color:#000084;font-family:PxPlus IBM VGA8,sans-serif;font-style:normal;font-size:1.2rem;line-height:1.3}a{text-decoration:none}a:focus{outline:none}h1,h2,h3,h4,h5,h6{font-size:18px;font-weight:400;text-transform:uppercase}.site-header{padding:20px;margin:20px 0;color:#000;background:#0aa}.site-header h1,.site-header h2,.site-header h3,.site-header h4,.site-header h5,.site-header h6{margin:0}main{margin:50px 0}.navbar{padding:10px;background-color:#bbb}@media (min-width:768px){.navbar{padding:0}}.navbar ul{list-style:none;padding:10px;margin:0;border:1px solid #000}@media (min-width:768px){.navbar ul{margin:0 0 0 10px;padding:0;border:none}}.navbar ul li{display:block;line-height:20px}@media (min-width:768px){.navbar ul li{display:inline-block}}.navbar ul li a{display:block;padding:4px 10px;color:#fff}@media (min-width:768px){.navbar ul li a{display:inline-block}}.navbar ul li.current a,.navbar ul li a:hover{color:#fff;background-color:#000}footer{text-align:center;font-size:3rem;width:100%;background:#000;padding:.8em 0}footer i{color:#fff!important}[class*=" icon-tiny"],[class^=icon-tiny]{font-family:PxPlus IBM VGA8,sans-serif!important;font-style:normal;color:#fefe5b}.icon-tiny-one-page-open:after{content:"\2630"}.icon-tiny-one-page-close:after{content:"\2A2F"}.tiny-one-page__modal{position:fixed;top:0;left:0;width:100%;z-index:99;height:auto;max-height:0;overflow:hidden;-webkit-transition:max-height .2s;transition:max-height .2s}@media (min-width:768px){.tiny-one-page__modal{max-height:none!important}}.tiny-one-page__button{position:fixed;top:0;right:0;font-size:1.8rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;padding:.7em .8em;z-index:100}.tiny-one-page__button:focus,.tiny-one-page__button:hover{outline:none}.tiny-one-page__button:hover{cursor:pointer}@media (min-width:768px){.tiny-one-page__button{display:none}} \ No newline at end of file diff --git a/dist/js/demo-386.js b/dist/js/demo-386.js index 8d3fba8..ba526d5 100644 --- a/dist/js/demo-386.js +++ b/dist/js/demo-386.js @@ -1 +1 @@ -!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=1)}([function(e,t,n){(function(n){var o,r;window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),o=this;do{for(t=n.length;0<=--t&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,window.CustomEvent=e)}(),function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;nb.durationMax?b.durationMax:b.durationMin&&v=A)return d.cancelScroll(!0),a=n,u=p,0===(r=o)&&document.body.focus(),u||(r.focus(),document.activeElement!==r&&(r.setAttribute("tabindex","-1"),r.focus(),r.style.outline="none"),e.scrollTo(0,a)),i("scrollStop",l,o,s),!(h=y=null)}(w,M)||(h=e.requestAnimationFrame(j),y=t)};0===e.pageYOffset&&e.scrollTo(0,0),E=o,T=l,p||history.pushState&&T.updateURL&&history.pushState({smoothScroll:JSON.stringify(T),anchor:E.id},document.title,E===document.documentElement?"#top":"#"+E.id),"matchMedia"in e&&e.matchMedia("(prefers-reduced-motion)").matches?e.scrollTo(0,Math.floor(M)):(i("scrollStart",l,o,s),d.cancelScroll(!0),e.requestAnimationFrame(j))}}},p=function(t){if(!t.defaultPrevented&&!(0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)&&"closest"in t.target&&(l=t.target.closest(s))&&"a"===l.tagName.toLowerCase()&&!t.target.closest(u.ignore)&&l.hostname===e.location.hostname&&l.pathname===e.location.pathname&&/#/.test(l.href)){var n,r=o(l.hash);if("#"===r){if(!u.topOnEmptyHash)return;n=document.documentElement}else n=document.querySelector(r);(n=n||"#top"!==r?n:document.documentElement)&&(t.preventDefault(),function(t){if(history.replaceState&&t.updateURL&&!history.state){var n=e.location.hash;n=n||"",history.replaceState({smoothScroll:JSON.stringify(t),anchor:n||e.pageYOffset},document.title,n||e.location.href)}}(u),d.animateScroll(n,l))}},f=function(e){if(null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(u)){var t=history.state.anchor;"string"==typeof t&&t&&!(t=document.querySelector(o(history.state.anchor)))||d.animateScroll(t,null,{updateURL:!1})}};return d.destroy=function(){u&&(document.removeEventListener("click",p,!1),e.removeEventListener("popstate",f,!1),d.cancelScroll(),h=c=l=u=null)},function(){if(!("querySelector"in document&&"addEventListener"in e&&"requestAnimationFrame"in e&&"closest"in e.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";d.destroy(),u=n(t,a||{}),c=u.header?document.querySelector(u.header):null,document.addEventListener("click",p,!1),u.updateURL&&u.popstate&&e.addEventListener("popstate",f,!1)}(),d}}(r)}.apply(t,[]))||(e.exports=o)}).call(this,n(2))},function(e,t,n){n(3),e.exports=n(4)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t);const o=new Map,r=Symbol("riot-component"),i=new Set,s="is",a="value",u=Symbol("attributes"),l=Symbol("template");var c=Object.freeze({COMPONENTS_IMPLEMENTATION_MAP:o,DOM_COMPONENT_INSTANCE_PROPERTY:r,PLUGINS_SET:i,IS_DIRECTIVE:s,VALUE_ATTRIBUTE:a,ATTRIBUTES_KEY_SYMBOL:u,TEMPLATE_KEY_SYMBOL:l});function h(e){Array.from(e).forEach(e=>e.parentNode&&e.parentNode.removeChild(e))}const d=2;var p={EACH:0,IF:1,SIMPLE:d,TAG:3,SLOT:4};const{indexOf:f}=[],m=(e,t,n,o,r,i)=>{const s="selectedIndex"in t;let a=s;for(;oe==t,b=e=>e,v=(e,t,n,o,r,i,s)=>{const a=i-r;if(a<1)return-1;for(;n-t>=a;){let a=t,u=r;for(;an{if(r-o<2)t.removeChild(e(n[o],-1));else{const i=t.ownerDocument.createRange();i.setStartBefore(e(n[o],-1)),i.setEndAfter(e(n[r-1],-1)),i.deleteContents()}},w=(e,t,n)=>{let o=1,r=t;for(;o>>0;n{((e,t,n,o,r,i,s,a,u)=>{const l=new Map,c=e.length;let h=s,d=0;for(;d{const a=n+i,u=[];let l,c,h,d,p,f,m;e:for(l=0;l<=a;l++){if(l>50)return null;for(m=l-1,p=l?u[l-1]:[0,0],f=u[l]=[],c=-l;c<=l;c+=2){for(h=(d=c===-l||c!==l&&p[m+c-1]=0;l--){for(;d>0&&h>0&&s(o[r+d-1],e[t+h-1]);)g[b--]=0,d--,h--;if(!l)break;m=l-1,p=l?u[l-1]:[0,0],(c=d-h)===-l||c!==l&&p[m+c-1]{let u=0,l=os;)--u;l=a+o-u;const p=Array(l);let f=c[u];for(--n;f;){const{newi:e,oldi:t}=f;for(;n>e;)p[--l]=1,--n;for(;s>t;)p[--l]=-1,--s;p[--l]=0,--n,--s,f=f.prev}for(;n>=t;)p[--l]=1,--n;for(;s>=i;)p[--l]=-1,--s;return p})(n,o,r,i,s,a,u,l),e,t,n,o,s,a,c,d)};function T(e){return null==e}function S(e){return!T(e.content)}const M=Object.seal({childrenMap:null,node:null,root:null,condition:null,evaluate:null,template:null,isTemplateTag:!1,nodes:[],getKey:null,indexName:null,itemName:null,afterPlaceholder:null,placeholder:null,mount(e,t){return this.update(e,t)},update(e,t){const{placeholder:n}=this,o=this.evaluate(e),r=o?Array.from(o):[],i=n.parentNode,{newChildrenMap:s,batches:a,futureNodes:u}=function(e,t,n,o){const{condition:r,template:i,childrenMap:s,itemName:a,getKey:u,indexName:l,root:c,isTemplateTag:h}=o,d=new Map,p=[],f=[];return e.forEach((e,o)=>{const m=function(e,t){let{itemName:n,indexName:o,index:r,item:i}=t;e[n]=i,o&&(e[o]=r);return e}(Object.create(t),{itemName:a,indexName:l,index:o,item:e}),g=u?u(m):o,b=s.get(g);if(function(e,t){return!!e&&!1===Boolean(e(t))}(r,m))return;const v=b?b.template:i.clone(),y=b?v.el:c.cloneNode(),O=!b,w=h&&O?function(e){const t=e.dom.cloneNode(!0);return{avoidDOMInjection:!0,fragment:t,children:Array.from(t.childNodes)}}(v):{};O?p.push(()=>v.mount(y,m,n,w)):v.update(m,n),h?f.push(...w.children||v.children):f.push(y),s.delete(g),d.set(g,{template:v,context:m,index:o})}),{newChildrenMap:d,batches:p,futureNodes:f}}(r,e,t,this);return u.length?((e,t,n,o)=>{o||(o={});const r=o.compare||g,i=o.node||b,s=null==o.before?null:i(o.before,0),a=t.length;let u=a,l=0,c=n.length,h=0;for(;l{for(;oe()),this.childrenMap=s,this.nodes=u,this},unmount(e,t){return A(this.childrenMap,t),this.childrenMap=new Map,this.nodes=[],this}});function C(e,t){return(n,o)=>{if(o<0){const{template:n,context:o}=e.pop();n.unmount(o,t,null)}return n}}function A(e,t){return Array.from(e.values()).map(e=>{let{template:n,context:o}=e;return n.unmount(o,t,!0)})}const x=Object.seal({node:null,evaluate:null,parent:null,isTemplateTag:!1,placeholder:null,template:null,mount(e,t){return this.parent.insertBefore(this.placeholder,this.node),this.parent.removeChild(this.node),this.update(e,t)},update(e,t){const n=!!this.evaluate(e),o=!this.value&&n,r=this.value&&!n,i=()=>{const n=this.node.cloneNode();this.parent.insertBefore(n,this.placeholder),this.template=this.template.clone(),this.template.mount(n,e,t)};switch(!0){case o:i();break;case r:this.unmount(e);break;default:n&&this.template.update(e,t)}return this.value=n,this},unmount(e,t){return this.template.unmount(e,t,!0),this}});const N=0;var j={ATTRIBUTE:N,EVENT:1,TEXT:2,VALUE:3};function _(e){return"object"==typeof e}const I="removeAttribute",L="setAttribute";function P(e,t,n,o){let{name:r}=t;r?((function(e){return"boolean"==typeof e}(n)||_(n))&&(e[r]=n),e[function(e){return T(e)||!1===e||""===e||_(e)?I:L}(n)](r,function(e,t){return!0===t?e:t}(r,n))):n?function(e,t){Object.entries(t).forEach(t=>{let[n,o]=t;return P(e,{name:n},o)})}(e,n):o&&function(e,t){Object.keys(t).forEach(t=>e.removeAttribute(t))}(e,o)}const k=/^on/;function U(e){return T(e)?"":e}var B={[N]:P,1:function(e,t,n,o){let{name:r}=t;const i=r.replace(k,"");return o&&e.removeEventListener(i,o),n&&e.addEventListener(i,n,!1),n},2:function(e,t,n){let{childNodeIndex:o}=t;const r=e.childNodes[o],i=U(n);if(r.nodeType===Node.COMMENT_NODE){const t=document.createTextNode(i);e.replaceChild(t,r)}else r.data=U(i)},3:function(e,t,n){e.value=n}};const D=Object.seal({node:null,value:null,mount(e){return this.value=this.evaluate(e),q(this,this.value),this},update(e){const t=this.evaluate(e);return this.value!==t&&(q(this,t),this.value=t),this},unmount(){return 1===this.type&&q(this,null),this}});function q(e,t){return B[e.type](e.node,e,t,e.value)}function H(e,t){return Object.assign({},D,{},t,{node:e})}const R=Object.seal({node:null,name:null,template:null,mount(e,t){const n=!!e.slots&&e.slots.find(e=>{let{id:t}=e;return t===this.name}),{parentNode:o}=this.node;return this.template=n&&G(n.html,n.bindings).createDOM(o),this.template&&(this.template.mount(this.node,t),function e(t){t.firstChild&&(t.parentNode.insertBefore(t.firstChild,t),e(t))}(this.node)),o.removeChild(this.node),this},update(e,t){return this.template&&t&&this.template.update(t),this},unmount(e,t,n){return this.template&&this.template.unmount(t,null,n),this}});function $(e){return e.reduce((e,t)=>{let{bindings:n}=t;return e.concat(n)},[])}const F=Object.seal({node:null,evaluate:null,name:null,slots:null,tag:null,attributes:null,getComponent:null,mount(e){return this.update(e)},update(e,t){const n=this.evaluate(e);return n===this.name?this.tag.update(e):(this.unmount(e,t,!0),this.name=n,this.tag=function(e,t,n){return void 0===t&&(t=[]),void 0===n&&(n=[]),e?e({slots:t,attributes:n}):G(function(e){return e.reduce((e,t)=>e+t.html,"")}(t),[...$(t),{expressions:n.map(e=>Object.assign({type:N},e))}])}(this.getComponent(n),this.slots,this.attributes),this.tag.mount(this.node,e)),this},unmount(e,t,n){return this.tag&&this.tag.unmount(n),this}});var Y={1:function(e,t){let{evaluate:n,template:o}=t;return Object.assign({},x,{node:e,evaluate:n,parent:e.parentNode,placeholder:document.createTextNode(""),template:o.createDOM(e)})},[d]:function(e,t){let{expressions:n}=t;return Object.assign({},(o=n.map(t=>H(e,t)),["mount","update","unmount"].reduce((e,t)=>Object.assign({},e,{[t]:e=>o.map(n=>n[t](e))&&r}),{})));var o,r},0:function(e,t){let{evaluate:n,condition:o,itemName:r,indexName:i,getKey:s,template:a}=t;const u=document.createTextNode(""),l=e.parentNode,c=e.cloneNode();return l.insertBefore(u,e),l.removeChild(e),Object.assign({},M,{childrenMap:new Map,node:e,root:c,condition:o,evaluate:n,isTemplateTag:S(c),template:a.createDOM(e),getKey:s,indexName:i,itemName:r,placeholder:u})},3:function(e,t){let{evaluate:n,getComponent:o,slots:r,attributes:i}=t;return Object.assign({},F,{node:e,evaluate:n,slots:r,attributes:i,getComponent:o})},4:function(e,t){let{name:n}=t;return Object.assign({},R,{node:e,name:n})}};function K(e){const t=e.ownerSVGElement;return!!t||null===t}function Q(e,t){return K(e)?function(e,t){return t.ownerDocument.importNode((new window.DOMParser).parseFromString(`${e}`,"application/xml").documentElement,!0)}(t,e):function(e,t){const n=S(t)?t:document.createElement("template");return n.innerHTML=e,n.content}(t,e)}function z(e,t){switch(!0){case K(e):!function e(t,n){t.firstChild&&(n.appendChild(t.firstChild),e(t,n))}(t,e);break;case S(e):e.parentNode.replaceChild(t,e);break;default:e.appendChild(t)}}const V=Object.freeze({bindings:null,bindingsData:null,html:null,isTemplateTag:!1,fragment:null,children:null,dom:null,el:null,createDOM(e){return this.dom=this.dom||function(e,t){return t&&("string"==typeof t?Q(e,t):t)}(e,this.html),this},mount(e,t,n,o){if(void 0===o&&(o={}),!e)throw new Error("Please provide DOM node to mount properly your template");this.el&&this.unmount(t);const{fragment:r,children:i,avoidDOMInjection:s}=o,{parentNode:a}=i?i[0]:e;return this.isTemplateTag=S(e),this.createDOM(e),this.dom&&(this.fragment=r||this.dom.cloneNode(!0)),this.el=this.isTemplateTag?a:e,this.children=this.isTemplateTag?i||Array.from(this.fragment.childNodes):null,!s&&this.fragment&&z(e,this.fragment),this.bindings=this.bindingsData.map(e=>(function(e,t){const{selector:n,type:o,redundantAttribute:r,expressions:i}=t,s=n?e.querySelector(n):e;return r&&s.removeAttribute(r),(Y[o]||Y[d])(s,Object.assign({},t,{expressions:i||[]}))})(this.el,e)),this.bindings.forEach(e=>e.mount(t,n)),this},update(e,t){return this.bindings.forEach(n=>n.update(e,t)),this},unmount(e,t,n){if(this.el){switch(this.bindings.forEach(o=>o.unmount(e,t,n)),!0){case!0===this.isTemplateTag&&null!==n:h(this.children);break;case!0===n&&null!==this.el.parentNode:this.el.parentNode.removeChild(this.el);break;case null!==n:h(this.el.childNodes)}this.el=null}return this},clone(){return Object.assign({},this,{el:null})}});function G(e,t){return void 0===t&&(t=[]),Object.assign({},V,{html:e,bindingsData:t})}function J(e){return typeof e==="function"}function X(e){throw new Error(e)}function Z(e){return J(e)?e.prototype&&e.prototype.constructor?new e:e():e}function W(e){return e.replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function ee(){return this}function te(e,t,n,o){return void 0===o&&(o={}),Object.defineProperty(e,t,Object.assign({value:n,enumerable:!1,writable:!1,configurable:!0},o)),e}function ne(e,t,n){return Object.entries(t).forEach(t=>{let[o,r]=t;te(e,o,r,n)}),e}function oe(e){return Array.isArray(e)?e:/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e))&&"number"==typeof e.length?Array.from(e):[e]}const re=e=>1===e.length?e[0]:e;function ie(e,t,n){const o="object"==typeof t?t:{[t]:n},r=Object.keys(o);return oe(e).forEach(e=>{r.forEach(t=>e.setAttribute(t,o[t]))}),e}function se(e,t){return function(e,t,n){const o="string"==typeof t?[t]:t;return re(oe(e).map(e=>re(o.map(t=>e[n](t)))))}(e,t,"getAttribute")}function ae(e){return se(e,s)||e.tagName.toLowerCase()}function ue(e,t){return oe("string"==typeof e?(t||document).querySelectorAll(e):e)}const le=new Map,ce=(e=>()=>e||(ie(e=ue("style[riot]")[0]||document.createElement("style"),"type","text/css"),e.parentNode||document.head.appendChild(e),e))();var he={CSS_BY_NAME:le,add(e,t){return le.has(e)||(le.set(e,t),this.inject()),this},inject(){return ce().innerHTML=[...le.values()].join("\n"),this},remove(e){return le.has(e)&&(le.delete(e),this.inject()),this}};const de=Object.freeze({$(e){return ue(e,this.root)[0]},$$(e){return ue(e,this.root)}}),pe=Object.freeze({shouldUpdate:ee,onBeforeMount:ee,onMounted:ee,onBeforeUpdate:ee,onUpdated:ee,onBeforeUnmount:ee,onUnmounted:ee}),fe={update:ee,mount:ee,unmount:ee,clone:ee,createDOM:ee};function me(e){let{css:t,template:n,exports:r,name:i}=e;const s=n?function(e,t){return e(G,j,p,e=>t[e]||o.get(e))}(n,r?function(e){void 0===e&&(e={});return Object.entries(Z(e)).reduce((e,t)=>{let[n,o]=t;return e[function(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}(n)]=me(o),e},{})}(r.components):{}):fe;return e=>{let{slots:n,attributes:o,props:a}=e;const u=Z(r)||{},l=ge({css:t,template:s,componentAPI:u,name:i})({slots:n,attributes:o,props:a});return{mount:(e,t,n)=>l.mount(e,n,t),update:(e,t)=>l.update(t,e),unmount:e=>l.unmount(e)}}}function ge(e){let{css:t,template:n,componentAPI:o,name:r}=e;return t&&r&&he.add(r,t),function e(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r{let[t,n]=e;i[t]||(i[t]=n)}),i),Object.assign({slots:null,root:null},de,{name:r,css:t,template:n})));var i,s}function be(e,t){return void 0===t&&(t=[]),Object.assign({},function(e){return Array.from(e.attributes).reduce((e,t)=>(e[W(t.name)]=t.value,e),{})}(e),{},t.reduce((e,t)=>{const{value:n,type:o}=t;switch(!0){case!t.name&&o===j.ATTRIBUTE:return Object.assign({},e,{},n);case o===j.VALUE:e[a]=t.value;break;default:e[W(t.name)]=t.value}return e},{}))}function ve(e,t){return Object.assign({},e,{},Z(t))}function ye(e,t){let{slots:n,attributes:o,props:s}=t;const a=Z(s);return c=function(e){return[...i].reduce((e,t)=>t(e)||e,e)}(ne(Object.create(e),{mount(t,i,s){return void 0===i&&(i={}),this[u]=function(e,t){void 0===t&&(t=[]);const n=t.map(t=>H(e,t)),o={},r=e=>t=>(n.forEach(n=>n[e](t)),o);return Object.assign(o,{expressions:n,mount:r("mount"),update:r("update"),unmount:r("unmount")})}(t,o).mount(s),this.props=Object.freeze(Object.assign({},a,{},be(t,this[u].expressions))),this.state=ve(this.state,i),this[l]=this.template.createDOM(t).clone(),t[r]=this,e.name&&function(e,t){ae(e)!==t&&ie(e,"is",t)}(t,e.name),te(this,"root",t),te(this,"slots",n),this.onBeforeMount(this.props,this.state),this[l].mount(t,this,s),this.onMounted(this.props,this.state),this},update(e,t){void 0===e&&(e={}),t&&this[u].update(t);const n=be(this.root,this[u].expressions);if(!1!==this.shouldUpdate(n,this.props))return this.props=Object.freeze(Object.assign({},a,{},n)),this.state=ve(this.state,e),this.onBeforeUpdate(this.props,this.state),this[l].update(this,t),this.onUpdated(this.props,this.state),this},unmount(e){return this.onBeforeUnmount(this.props,this.state),this[u].unmount(),this[l].unmount(this,{},null===e?null:!e),this.onUnmounted(this.props,this.state),this}})),Object.keys(e).filter(t=>J(e[t])).forEach(e=>{c[e]=c[e].bind(c)}),c;var c}const{DOM_COMPONENT_INSTANCE_PROPERTY:Oe,COMPONENTS_IMPLEMENTATION_MAP:we,PLUGINS_SET:Ee}=c;var Te=n(0),Se=n.n(Te);function Me(e,t,n,o){var r,i=!1,s=0;function a(){r&&clearTimeout(r)}function u(){var u=this,l=Date.now()-s,c=arguments;function h(){s=Date.now(),n.apply(u,c)}i||(o&&!r&&h(),a(),void 0===o&&l>e?h():!0!==t&&(r=setTimeout(o?function(){r=void 0}:h,void 0===o?e-l:e)))}return"boolean"!=typeof t&&(o=n,n=t,t=void 0),u.cancel=function(){a(),i=!0},u}var Ce={css:null,exports:{state:{isOpen:!1,animate:null,namespace:"tiny-one-page",options:{offset:0}},onBeforeMount(){this.state.animate=this.props.animate,this.state.animate.setComponent(this),this.props.options&&(this.state.options=Object.assign(this.state.options,this.props.options)),this.content=this.root.innerHTML,this.root.innerHTML=""},onBeforeUnmount(){document.addEventListener("click",this.handleClick.bind(this)),this.$("."+this.state.namespace+"__inner a").removeEventListener("click",this.handleClose.bind(this))},onMounted(){if(this.$("."+this.state.namespace+"__inner").innerHTML=this.content,this.scroll=new Se.a("."+this.state.namespace+'__inner a[href*="#"]',this.state.options),window.addEventListener("scroll",Me(300,this.handleScroll.bind(this)),!1),window.location.hash)this.$("."+this.state.namespace+"__inner a[href$='"+window.location.hash+"']").click();else{const e=this.$$("."+this.state.namespace+"__inner a")[0];document.querySelector(e.hash)&&this.addClass(e)}document.addEventListener("click",this.handleClick.bind(this)),this.$$(".tiny-one-page__inner a").forEach(e=>{e.addEventListener("click",this.handleClose.bind(this))})},addClass(e){e.parentElement.classList.add("current")},removeClass(e){e.parentElement.classList.remove("current")},getStyles(){return this.state.animate.getStyles()},getIconClasses(){return this.state.isOpen?"icon icon-"+this.state.namespace+"-close":"icon icon-"+this.state.namespace+"-open"},getModalClasses(){return this.state.isOpen?this.state.namespace+"__modal "+this.state.namespace+"__modal--open":this.state.namespace+"__modal "+this.state.namespace+"__modal--closed"},handleClick(e){this.root.contains(e.target)||this.handleClose()},handleOpen(){this.state.animate.prepareOpen(),this.state.isOpen=!0,this.update()},handleClose(){this.state.animate.prepareClose(),this.state.isOpen=!1,this.update()},handleToggle(){!0===this.state.isOpen?this.handleClose():this.handleOpen()},handleScroll(e){const t=this.$$("."+this.state.namespace+"__inner a");let n=25;n="function"==typeof this.state.options.offset?this.state.options.offset()-n:this.state.options.offset-n;let o=void 0;window.pageYOffset>n?document.querySelector("body").classList.add("has-scrolled"):document.querySelector("body").classList.remove("has-scrolled"),t.forEach(function(e,r){let i=document.querySelector(e.hash),s=void 0,a=i.getBoundingClientRect().top+window.pageYOffset;t[r+1]&&(s=document.querySelector(t[r+1].hash)),!o&&a-window.innerHeight/2<=window.pageYOffset+n&&a+i.offsetHeight-window.innerHeight/2>window.pageYOffset&&(o=i),this.removeClass(e)}.bind(this)),o&&this.addClass(this.$("."+this.state.namespace+"__inner a[href$='"+o.id+"']"))}},template:function(e,t,n,o){return e('
',[{redundantAttribute:"expr0",selector:"[expr0]",expressions:[{type:t.ATTRIBUTE,name:"style",evaluate:function(e){return e.getStyles()}},{type:t.ATTRIBUTE,name:"class",evaluate:function(e){return e.getModalClasses()}}]},{redundantAttribute:"expr1",selector:"[expr1]",expressions:[{type:t.EVENT,name:"onclick",evaluate:function(e){return e.handleToggle}}]},{redundantAttribute:"expr2",selector:"[expr2]",expressions:[{type:t.ATTRIBUTE,name:"class",evaluate:function(e){return e.getIconClasses()}}]}])},name:"tiny-one-page"};function Ae(e,t){for(var n=0;n(function(e,t,n){const r=n||ae(e);return o.has(r)||X(`The component named "${r}" was never registered`),o.get(r)({props:t}).mount(e)})(e,Pe,ke))},function(e,t){}]); \ No newline at end of file +!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=1)}([function(t,e,n){(function(n){var o,r;window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(t){var e,n=(this.document||this.ownerDocument).querySelectorAll(t),o=this;do{for(e=n.length;0<=--e&&n.item(e)!==o;);}while(e<0&&(o=o.parentElement));return o}),function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}"function"!=typeof window.CustomEvent&&(t.prototype=window.Event.prototype,window.CustomEvent=t)}(),function(){for(var t=0,e=["ms","moz","webkit","o"],n=0;nb.durationMax?b.durationMax:b.durationMin&&v=j)return d.cancelScroll(!0),a=n,u=p,0===(r=o)&&document.body.focus(),u||(r.focus(),document.activeElement!==r&&(r.setAttribute("tabindex","-1"),r.focus(),r.style.outline="none"),t.scrollTo(0,a)),i("scrollStop",c,o,s),!(h=y=null)}(w,M)||(h=t.requestAnimationFrame(N),y=e)};0===t.pageYOffset&&t.scrollTo(0,0),E=o,S=c,p||history.pushState&&S.updateURL&&history.pushState({smoothScroll:JSON.stringify(S),anchor:E.id},document.title,E===document.documentElement?"#top":"#"+E.id),"matchMedia"in t&&t.matchMedia("(prefers-reduced-motion)").matches?t.scrollTo(0,Math.floor(M)):(i("scrollStart",c,o,s),d.cancelScroll(!0),t.requestAnimationFrame(N))}}},p=function(e){if(!e.defaultPrevented&&!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)&&"closest"in e.target&&(c=e.target.closest(s))&&"a"===c.tagName.toLowerCase()&&!e.target.closest(u.ignore)&&c.hostname===t.location.hostname&&c.pathname===t.location.pathname&&/#/.test(c.href)){var n,r=o(c.hash);if("#"===r){if(!u.topOnEmptyHash)return;n=document.documentElement}else n=document.querySelector(r);(n=n||"#top"!==r?n:document.documentElement)&&(e.preventDefault(),function(e){if(history.replaceState&&e.updateURL&&!history.state){var n=t.location.hash;n=n||"",history.replaceState({smoothScroll:JSON.stringify(e),anchor:n||t.pageYOffset},document.title,n||t.location.href)}}(u),d.animateScroll(n,c))}},f=function(t){if(null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(u)){var e=history.state.anchor;"string"==typeof e&&e&&!(e=document.querySelector(o(history.state.anchor)))||d.animateScroll(e,null,{updateURL:!1})}};return d.destroy=function(){u&&(document.removeEventListener("click",p,!1),t.removeEventListener("popstate",f,!1),d.cancelScroll(),h=l=c=u=null)},function(){if(!("querySelector"in document&&"addEventListener"in t&&"requestAnimationFrame"in t&&"closest"in t.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";d.destroy(),u=n(e,a||{}),l=u.header?document.querySelector(u.header):null,document.addEventListener("click",p,!1),u.updateURL&&u.popstate&&t.addEventListener("popstate",f,!1)}(),d}}(r)}.apply(e,[]))||(t.exports=o)}).call(this,n(2))},function(t,e,n){n(3),t.exports=n(4)},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e);const o=new Map,r=Symbol("riot-component"),i=new Set,s="is",a=Symbol("parent"),u=Symbol("attributes"),c=Symbol("template");var l=Object.freeze({__proto__:null,COMPONENTS_IMPLEMENTATION_MAP:o,DOM_COMPONENT_INSTANCE_PROPERTY:r,PLUGINS_SET:i,IS_DIRECTIVE:s,VALUE_ATTRIBUTE:"value",PARENT_KEY_SYMBOL:a,ATTRIBUTES_KEY_SYMBOL:u,TEMPLATE_KEY_SYMBOL:c});function h(t){return typeof t==="function"}function d(){return this}function p(t){return h(t)?t.prototype&&t.prototype.constructor?new t:t():t}function f(t){Array.from(t).forEach(t=>t.parentNode&&t.parentNode.removeChild(t))}const m=2;var g={EACH:0,IF:1,SIMPLE:m,TAG:3,SLOT:4};const b=0,v=2,y=3;var O={ATTRIBUTE:b,EVENT:1,TEXT:v,VALUE:y};const{indexOf:w}=[],E=(t,e,n,o,r,i)=>{const s="selectedIndex"in e;let a=s;for(;ot==e,T=t=>t,M=(t,e,n,o,r,i,s)=>{const a=i-r;if(a<1)return-1;for(;n-e>=a;){let a=e,u=r;for(;an{for(;o{let o=1,r=e;for(;o>>0;n{((t,e,n,o,r,i,s,a,u)=>{const c=new Map,l=t.length;let h=s,d=0;for(;d{const a=n+i,u=[];let c,l,h,d,p,f,m;t:for(c=0;c<=a;c++){if(c>50)return null;for(m=c-1,p=c?u[c-1]:[0,0],f=u[c]=[],l=-c;l<=c;l+=2){for(h=(d=l===-c||l!==c&&p[m+l-1]=0;c--){for(;d>0&&h>0&&s(o[r+d-1],t[e+h-1]);)g[b--]=0,d--,h--;if(!c)break;m=c-1,p=c?u[c-1]:[0,0],(l=d-h)===-c||l!==c&&p[m+l-1]{let u=0,c=os;)--u;c=a+o-u;const p=Array(c);let f=l[u];for(--n;f;){const{newi:t,oldi:e}=f;for(;n>t;)p[--c]=1,--n;for(;s>e;)p[--c]=-1,--s;p[--c]=0,--n,--s,f=f.prev}for(;n>=e;)p[--c]=1,--n;for(;s>=i;)p[--c]=-1,--s;return p})(n,o,r,i,s,a,u,c),t,e,n,o,s,a,l,d)};let N=(t,e)=>{(N="remove"in t?t=>{t.remove()}:(t,e)=>{t.parentNode===e&&e.removeChild(t)})(t,e)};function _(t,e){return typeof t===e}function I(t){const e=t.ownerSVGElement;return!!e||null===e}function L(t){return!P(t.content)}function k(t){return!P(t)&&_(t,"object")}function P(t){return null==t}const U=Object.seal({nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n}=this,o=this.evaluate(t),r=o?Array.from(o):[],i=n.parentNode,{newChildrenMap:s,batches:a,futureNodes:u}=function(t,e,n,o){const{condition:r,template:i,childrenMap:s,itemName:a,getKey:u,indexName:c,root:l,isTemplateTag:h}=o,d=new Map,p=[],f=[];return t.forEach((t,o)=>{const m=function(t,e){let{itemName:n,indexName:o,index:r,item:i}=e;t[n]=i,o&&(t[o]=r);return t}(Object.create(e),{itemName:a,indexName:c,index:o,item:t}),g=u?u(m):o,b=s.get(g);if(function(t,e){return!!t&&!1===Boolean(t(e))}(r,m))return;const v=b?b.template:i.clone(),y=b?v.el:l.cloneNode(),O=!b,w=h&&O?function(t){const e=t.dom.cloneNode(!0);return{avoidDOMInjection:!0,fragment:e,children:Array.from(e.childNodes)}}(v):{};O?p.push(()=>v.mount(y,m,n,w)):v.update(m,n),h?f.push(...w.children||v.children):f.push(y),s.delete(g),d.set(g,{template:v,context:m,index:o})}),{newChildrenMap:d,batches:p,futureNodes:f}}(r,t,e,this);return u.length?((t,e,n,o)=>{o||(o={});const r=o.compare||S,i=o.node||T,s=null==o.before?null:i(o.before,0),a=e.length;let u=a,c=0,l=n.length,h=0;for(;c{for(;ot()),this.childrenMap=s,this.nodes=u,this},unmount(t,e){return D(this.childrenMap,e),this.childrenMap=new Map,this.nodes=[],this}});function B(t,e){return(n,o)=>{if(o<0){const{template:n,context:o}=t.pop();n.unmount(o,e,null)}return n}}function D(t,e){return Array.from(t.values()).map(t=>{let{template:n,context:o}=t;return n.unmount(o,e,!0)})}const q=Object.seal({mount(t,e){return this.parent.insertBefore(this.placeholder,this.node),this.parent.removeChild(this.node),this.update(t,e)},update(t,e){const n=!!this.evaluate(t),o=!this.value&&n,r=this.value&&!n,i=()=>{const n=this.node.cloneNode();this.parent.insertBefore(n,this.placeholder),this.template=this.template.clone(),this.template.mount(n,t,e)};switch(!0){case o:i();break;case r:this.unmount(t);break;default:n&&this.template.update(t,e)}return this.value=n,this},unmount(t,e){return this.template.unmount(t,e,!0),this}});const H="removeAttribute",R="setAttribute";function $(t,e,n,o){let{name:r}=e;r?((function(t){return _(t,"boolean")}(n)||k(n))&&(t[r]=n),t[function(t){return P(t)||!1===t||""===t||k(t)?H:R}(n)](r,function(t,e){return!0===e?t:e}(r,n))):n?function(t,e){Object.entries(e).forEach(e=>{let[n,o]=e;return $(t,{name:n},o)})}(t,n):o&&function(t,e){Object.keys(e).forEach(e=>t.removeAttribute(e))}(t,o)}const F=/^on/;const Y=(t,e)=>{const n=t.childNodes[e];if(n.nodeType===Node.COMMENT_NODE){const e=document.createTextNode("");return t.replaceChild(e,n),e}return n};var K={[b]:$,1:function(t,e,n,o){let{name:r}=e;const i=r.replace(F,"");o&&t.removeEventListener(i,o),n&&t.addEventListener(i,n,!1)},[v]:function(t,e,n){t.data=function(t){return P(t)?"":t}(n)},[y]:function(t,e,n){t.value=n}};const Q=Object.seal({mount(t){return this.value=this.evaluate(t),z(this,this.value),this},update(t){const e=this.evaluate(t);return this.value!==e&&(z(this,e),this.value=e),this},unmount(){return 1===this.type&&z(this,null),this}});function z(t,e){return K[t.type](t.node,t,e,t.value)}function V(t,e){return Object.assign({},Q,{},e,{node:e.type===v?Y(t,e.childNodeIndex):t})}function G(t,e,n){if(!t||!t.length)return n;const o=t.map(t=>Object.assign({},t,{value:t.evaluate(e)}));return Object.assign(Object.create(n||null),function(t){return t.reduce((t,e)=>{const{value:n,type:o}=e;switch(!0){case!e.name&&o===b:return Object.assign({},t,{},n);case o===y:t.value=e.value;break;default:t[function(t){return t.replace(/-(\w)/g,(t,e)=>e.toUpperCase())}(e.name)]=e.value}return t},{})}(o))}const J=Object.seal({attributes:[],getTemplateScope(t,e){return G(this.attributes,t,e)},mount(t,e){const n=!!t.slots&&t.slots.find(t=>{let{id:e}=t;return e===this.name}),{parentNode:o}=this.node;return this.template=n&&rt(n.html,n.bindings).createDOM(o),this.template&&(this.template.mount(this.node,this.getTemplateScope(t,e)),this.template.children=function t(e,n){void 0===n&&(n=[]);const o=e.firstChild;if(o)return e.parentNode.insertBefore(o,e),[o,...t(e)];return n}(this.node)),o.removeChild(this.node),this},update(t,e){return this.template&&this.template.update(this.getTemplateScope(t,e)),this},unmount(t,e,n){return this.template&&this.template.unmount(this.getTemplateScope(t,e),null,n),this}});function X(t){return t.reduce((t,e)=>{let{bindings:n}=e;return t.concat(n)},[])}const Z=Object.seal({mount(t){return this.update(t)},update(t,e){const n=this.evaluate(t);return n===this.name?this.tag.update(t):(this.unmount(t,e,!0),this.name=n,this.tag=function(t,e,n){return void 0===e&&(e=[]),void 0===n&&(n=[]),t?t({slots:e,attributes:n}):rt(function(t){return t.reduce((t,e)=>t+e.html,"")}(e),[...X(e),{expressions:n.map(t=>Object.assign({type:b},t))}])}(this.getComponent(n),this.slots,this.attributes),this.tag.mount(this.node,t)),this},unmount(t,e,n){return this.tag&&this.tag.unmount(n),this}});var W={1:function(t,e){let{evaluate:n,template:o}=e;return Object.assign({},q,{node:t,evaluate:n,parent:t.parentNode,placeholder:document.createTextNode(""),template:o.createDOM(t)})},[m]:function(t,e){let{expressions:n}=e;return Object.assign({},(o=n.map(e=>V(t,e)),["mount","update","unmount"].reduce((t,e)=>Object.assign({},t,{[e]:t=>o.map(n=>n[e](t))&&r}),{})));var o,r},0:function(t,e){let{evaluate:n,condition:o,itemName:r,indexName:i,getKey:s,template:a}=e;const u=document.createTextNode(""),c=t.parentNode,l=t.cloneNode();return c.insertBefore(u,t),c.removeChild(t),Object.assign({},U,{childrenMap:new Map,node:t,root:l,condition:o,evaluate:n,isTemplateTag:L(l),template:a.createDOM(t),getKey:s,indexName:i,itemName:r,placeholder:u})},3:function(t,e){let{evaluate:n,getComponent:o,slots:r,attributes:i}=e;return Object.assign({},Z,{node:t,evaluate:n,slots:r,attributes:i,getComponent:o})},4:function(t,e){let{name:n,attributes:o}=e;return Object.assign({},J,{attributes:o,node:t,name:n})}};function tt(t,e){return t.map(t=>t.type===v?Object.assign({},t,{childNodeIndex:t.childNodeIndex+e}):t)}function et(t,e){return I(t)?function(t,e){return e.ownerDocument.importNode((new window.DOMParser).parseFromString(`${t}`,"application/xml").documentElement,!0)}(e,t):function(t,e){const n=L(e)?e:document.createElement("template");return n.innerHTML=t,n.content}(e,t)}function nt(t,e){switch(!0){case I(t):!function t(e,n){e.firstChild&&(n.appendChild(e.firstChild),t(e,n))}(e,t);break;case L(t):t.parentNode.replaceChild(e,t);break;default:t.appendChild(e)}}const ot=Object.freeze({createDOM(t){return this.dom=this.dom||function(t,e){return e&&("string"==typeof e?et(t,e):e)}(t,this.html),this},mount(t,e,n,o){if(void 0===o&&(o={}),!t)throw new Error("Please provide DOM node to mount properly your template");this.el&&this.unmount(e);const{fragment:r,children:i,avoidDOMInjection:s}=o,{parentNode:a}=i?i[0]:t,u=L(t),c=u?Math.max(Array.from(a.children).indexOf(t),0):null;return this.isTemplateTag=u,this.createDOM(t),this.dom&&(this.fragment=r||this.dom.cloneNode(!0)),this.el=this.isTemplateTag?a:t,this.children=this.isTemplateTag?i||Array.from(this.fragment.childNodes):null,!s&&this.fragment&&nt(t,this.fragment),this.bindings=this.bindingsData.map(t=>(function(t,e,n){const{selector:o,type:r,redundantAttribute:i,expressions:s}=e,a=o?t.querySelector(o):t;i&&a.removeAttribute(i);const u=s||[];return(W[r]||W[m])(a,Object.assign({},e,{expressions:n&&!o?tt(u,n):u}))})(this.el,t,c)),this.bindings.forEach(t=>t.mount(e,n)),this},update(t,e){return this.bindings.forEach(n=>n.update(t,e)),this},unmount(t,e,n){if(this.el){switch(this.bindings.forEach(o=>o.unmount(t,e,n)),!0){case this.children&&null!==n:f(this.children);break;case!0===n&&null!==this.el.parentNode:this.el.parentNode.removeChild(this.el);break;case null!==n:f(this.el.childNodes)}this.el=null}return this},clone(){return Object.assign({},this,{el:null})}});function rt(t,e){return void 0===e&&(e=[]),Object.assign({},ot,{html:t,bindingsData:e})}function it(t,e,n,o){return void 0===o&&(o={}),Object.defineProperty(t,e,Object.assign({value:n,enumerable:!1,writable:!1,configurable:!0},o)),t}function st(t,e,n){return Object.entries(e).forEach(e=>{let[o,r]=e;it(t,o,r,n)}),t}const at=0,ut=3;function ct(t){return t.replace(/-(\w)/g,(t,e)=>e.toUpperCase())}function lt(t){throw new Error(t)}function ht(t){return Array.isArray(t)?t:/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(t))&&"number"==typeof t.length?Array.from(t):[t]}function dt(t,e){return ht("string"==typeof t?(e||document).querySelectorAll(t):t)}const pt=t=>1===t.length?t[0]:t;function ft(t,e,n){const o="object"==typeof e?e:{[e]:n},r=Object.keys(o);return ht(t).forEach(t=>{r.forEach(e=>t.setAttribute(e,o[e]))}),t}function mt(t,e){return function(t,e,n){const o="string"==typeof e?[e]:e;return pt(ht(t).map(t=>pt(o.map(e=>t[n](e)))))}(t,e,"getAttribute")}const gt=new Map,bt=(t=>()=>t||(ft(t=dt("style[riot]")[0]||document.createElement("style"),"type","text/css"),t.parentNode||document.head.appendChild(t),t))();var vt={CSS_BY_NAME:gt,add(t,e){return gt.has(t)||(gt.set(t,e),this.inject()),this},inject(){return bt().innerHTML=[...gt.values()].join("\n"),this},remove(t){return gt.has(t)&&(gt.delete(t),this.inject()),this}};function yt(t){return mt(t,s)||t.tagName.toLowerCase()}const Ot=Object.freeze({$(t){return dt(t,this.root)[0]},$$(t){return dt(t,this.root)}}),wt=Object.freeze({shouldUpdate:d,onBeforeMount:d,onMounted:d,onBeforeUpdate:d,onUpdated:d,onBeforeUnmount:d,onUnmounted:d}),Et={update:d,mount:d,unmount:d,clone:d,createDOM:d};function St(t){let{css:e,template:n,exports:r,name:i}=t;const s=n?function(t,e){return t(rt,O,g,t=>e[t]||o.get(t))}(n,r?function(t){void 0===t&&(t={});return Object.entries(p(t)).reduce((t,e)=>{let[n,o]=e;return t[function(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}(n)]=St(o),t},{})}(r.components):{}):Et;return t=>{let{slots:n,attributes:o,props:a}=t;const u=p(r)||{},c=Tt({css:e,template:s,componentAPI:u,name:i})({slots:n,attributes:o,props:a});return{mount:(t,e,n)=>c.mount(t,n,e),update:(t,e)=>c.update(e,t),unmount:t=>c.unmount(t)}}}function Tt(t){let{css:e,template:n,componentAPI:o,name:r}=t;return e&&r&&vt.add(r,e),function t(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r{let[e,n]=t;i[e]||(i[e]=n)}),i),Object.assign({slots:null,root:null},Ot,{name:r,css:e,template:n})));var i,s}function Mt(t,e){return void 0===e&&(e=[]),Object.assign({},function(t){return Array.from(t.attributes).reduce((t,e)=>(t[ct(e.name)]=e.value,t),{})}(t),{},e.reduce((t,e)=>{const{value:n,type:o}=e;switch(!0){case!e.name&&o===at:return Object.assign({},t,{},n);case o===ut:t.value=e.value;break;default:t[ct(e.name)]=e.value}return t},{}))}function Ct(t,e){return Object.assign({},t,{},p(e))}function jt(t,e){let{slots:n,attributes:o,props:s}=e;const l=p(s);return d=function(t){return[...i].reduce((t,e)=>e(t)||t,t)}(st(Object.create(t),{mount(e,i,s){return void 0===i&&(i={}),this[u]=function(t,e){void 0===e&&(e=[]);const n=e.map(e=>V(t,e)),o={},r=t=>e=>(n.forEach(n=>n[t](e)),o);return Object.assign(o,{expressions:n,mount:r("mount"),update:r("update"),unmount:r("unmount")})}(e,o).mount(s),this.props=Object.freeze(Object.assign({},l,{},Mt(e,this[u].expressions))),this.state=Ct(this.state,i),this[c]=this.template.createDOM(e).clone(),e[r]=this,t.name&&function(t,e){yt(t)!==e&&ft(t,"is",e)}(e,t.name),it(this,"root",e),it(this,"slots",n),this.onBeforeMount(this.props,this.state),this[c].mount(e,this,s),this[a]=s,this.onMounted(this.props,this.state),this},update(t,e){void 0===t&&(t={}),e&&this[u].update(e);const n=Mt(this.root,this[u].expressions);if(!1!==this.shouldUpdate(n,this.props))return this.props=Object.freeze(Object.assign({},l,{},n)),this.state=Ct(this.state,t),this.onBeforeUpdate(this.props,this.state),this[c].update(this,this[a]),this.onUpdated(this.props,this.state),this},unmount(t){return this.onBeforeUnmount(this.props,this.state),this[u].unmount(),this[c].unmount(this,this[a],null===t?null:!t),this.onUnmounted(this.props,this.state),this}})),Object.keys(t).filter(e=>h(t[e])).forEach(t=>{d[t]=d[t].bind(d)}),d;var d}const{DOM_COMPONENT_INSTANCE_PROPERTY:xt,COMPONENTS_IMPLEMENTATION_MAP:At,PLUGINS_SET:Nt}=l;var _t=n(0),It=n.n(_t);function Lt(t,e,n,o){var r,i=!1,s=0;function a(){r&&clearTimeout(r)}function u(){var u=this,c=Date.now()-s,l=arguments;function h(){s=Date.now(),n.apply(u,l)}i||(o&&!r&&h(),a(),void 0===o&&c>t?h():!0!==e&&(r=setTimeout(o?function(){r=void 0}:h,void 0===o?t-c:t)))}return"boolean"!=typeof e&&(o=n,n=e,e=void 0),u.cancel=function(){a(),i=!0},u}var kt={css:null,exports:{state:{isOpen:!1,animate:null,namespace:"tiny-one-page",options:{offset:0}},onBeforeMount(){this.state.animate=this.props.animate,this.state.animate.setComponent(this),this.props.options&&(this.state.options=Object.assign(this.state.options,this.props.options)),this.content=this.root.innerHTML,this.root.innerHTML=""},onBeforeUnmount(){document.addEventListener("click",this.handleClick.bind(this)),this.$("."+this.state.namespace+"__inner a").removeEventListener("click",this.handleClose.bind(this))},onMounted(){if(this.$("."+this.state.namespace+"__inner").innerHTML=this.content,this.scroll=new It.a("."+this.state.namespace+'__inner a[href*="#"]',this.state.options),window.addEventListener("scroll",Lt(300,this.handleScroll.bind(this)),!1),window.location.hash)this.$("."+this.state.namespace+"__inner a[href$='"+window.location.hash+"']").click();else{const t=this.$$("."+this.state.namespace+"__inner a")[0];document.querySelector(t.hash)&&this.addClass(t)}document.addEventListener("click",this.handleClick.bind(this)),this.$$(".tiny-one-page__inner a").forEach(t=>{t.addEventListener("click",this.handleClose.bind(this))})},addClass(t){t.parentElement.classList.add("current")},removeClass(t){t.parentElement.classList.remove("current")},getStyles(){return this.state.animate.getStyles()},getIconClasses(){return this.state.isOpen?"icon icon-"+this.state.namespace+"-close":"icon icon-"+this.state.namespace+"-open"},getModalClasses(){return this.state.isOpen?this.state.namespace+"__modal "+this.state.namespace+"__modal--open":this.state.namespace+"__modal "+this.state.namespace+"__modal--closed"},handleClick(t){this.root.contains(t.target)||this.handleClose()},handleOpen(){this.state.animate.prepareOpen(),this.state.isOpen=!0,this.update()},handleClose(){this.state.animate.prepareClose(),this.state.isOpen=!1,this.update()},handleToggle(){!0===this.state.isOpen?this.handleClose():this.handleOpen()},handleScroll(t){const e=this.$$("."+this.state.namespace+'__inner a[href*="#"]');let n=25;n="function"==typeof this.state.options.offset?this.state.options.offset()-n:this.state.options.offset-n;let o=void 0;window.pageYOffset>n?document.querySelector("body").classList.add("has-scrolled"):document.querySelector("body").classList.remove("has-scrolled"),e.forEach(function(t,r){let i=document.querySelector(t.hash),s=void 0,a=i.getBoundingClientRect().top+window.pageYOffset;e[r+1]&&(s=document.querySelector(e[r+1].hash)),!o&&a-window.innerHeight/2<=window.pageYOffset+n&&a+i.offsetHeight-window.innerHeight/2>window.pageYOffset&&(o=i),this.removeClass(t)}.bind(this)),o&&this.addClass(this.$("."+this.state.namespace+"__inner a[href$='"+o.id+"']"))}},template:function(t,e,n,o){return t('
',[{redundantAttribute:"expr0",selector:"[expr0]",expressions:[{type:e.ATTRIBUTE,name:"style",evaluate:function(t){return t.getStyles()}},{type:e.ATTRIBUTE,name:"class",evaluate:function(t){return t.getModalClasses()}}]},{redundantAttribute:"expr1",selector:"[expr1]",expressions:[{type:e.EVENT,name:"onclick",evaluate:function(t){return t.handleToggle}}]},{redundantAttribute:"expr2",selector:"[expr2]",expressions:[{type:e.ATTRIBUTE,name:"class",evaluate:function(t){return t.getIconClasses()}}]}])},name:"tiny-one-page"};function Pt(t,e){for(var n=0;n(function(t,e,n){const r=n||yt(t);return o.has(r)||lt(`The component named "${r}" was never registered`),o.get(r)({props:e}).mount(t)})(t,$t,Ft))},function(t,e){}]); \ No newline at end of file diff --git a/package.json b/package.json index 80edcde..8f18d9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tiny-one-page", - "version": "1.0.4", + "version": "1.0.5", "description": "One Page Menu with RiotJS, part of Tiny-Components", "scripts": { "dev": "npm run development", diff --git a/src/TinyOnePage.riot b/src/TinyOnePage.riot index 16288f8..76824a6 100644 --- a/src/TinyOnePage.riot +++ b/src/TinyOnePage.riot @@ -229,7 +229,7 @@ handleScroll(event) { // get elements - const elements = this.$$('.' + this.state.namespace + '__inner a'); + const elements = this.$$('.' + this.state.namespace + '__inner a[href*="#"]'); // @TODO check offset let offset = 25;