You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 lines
17 KiB

3 years ago
(()=>{"use strict";var t={962:()=>{function t(t){return t.replace(/-(\w)/g,((t,e)=>e.toUpperCase()))}function e(t,n){t.firstChild&&(n.appendChild(t.firstChild),e(t,n))}function n(t){Array.from(t).forEach(r)}const r=t=>t&&t.parentNode&&t.parentNode.removeChild(t),s=(t,e)=>e&&e.parentNode&&e.parentNode.insertBefore(t,e),i=new Map,o=Symbol("riot-component"),a=new Set,u="is",c="mount",l="update",h="unmount",p="shouldUpdate",d="onBeforeMount",m="onMounted",f="onBeforeUpdate",b="onUpdated",O="onBeforeUnmount",g="onUnmounted",E="props",v="state",N="slots",T="root",y=Symbol.for("pure"),_=Symbol("parent"),M=Symbol("attributes"),j=Symbol("template");var x=Object.freeze({__proto__:null,COMPONENTS_IMPLEMENTATION_MAP:i,DOM_COMPONENT_INSTANCE_PROPERTY:o,PLUGINS_SET:a,IS_DIRECTIVE:u,VALUE_ATTRIBUTE:"value",MOUNT_METHOD_KEY:c,UPDATE_METHOD_KEY:l,UNMOUNT_METHOD_KEY:h,SHOULD_UPDATE_KEY:p,ON_BEFORE_MOUNT_KEY:d,ON_MOUNTED_KEY:m,ON_BEFORE_UPDATE_KEY:f,ON_UPDATED_KEY:b,ON_BEFORE_UNMOUNT_KEY:O,ON_UNMOUNTED_KEY:g,PROPS_KEY:E,STATE_KEY:v,SLOTS_KEY:N,ROOT_KEY:T,IS_PURE_SYMBOL:y,PARENT_KEY_SYMBOL:_,ATTRIBUTES_KEY_SYMBOL:M,TEMPLATE_KEY_SYMBOL:j});var w={EACH:0,IF:1,SIMPLE:2,TAG:3,SLOT:4};var A={ATTRIBUTE:0,EVENT:1,TEXT:2,VALUE:3};function S(t,e){return typeof t===e}function C(t){const e=t.ownerSVGElement;return!!e||null===e}function U(t){return!D(t.content)}function P(t){return S(t,"function")}function L(t){return!D(t)&&S(t,"object")}function D(t){return null==t}const I=Symbol("unmount"),k={nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n,nodes:i,childrenMap:o}=this,a=t===I?null:this.evaluate(t),u=a?Array.from(a):[],{newChildrenMap:c,batches:l,futureNodes:h}=(n.parentNode,function(t,e,n,r){const{condition:s,template:i,childrenMap:o,itemName:a,getKey:u,indexName:c,root:l,isTemplateTag:h}=r,p=new Map,d=[],m=[];return t.forEach(((t,r)=>{const f=function(t,e){let{itemName:n,indexName:r,index:s,item:i}=e;t[n]=i,r&&(t[r]=s);return t}(Object.create(e),{itemName:a,indexName:c,index:r,item:t}),b=u?u(f):r,O=o.get(b);if(function(t,e){return!!t&&!1===Boolean(t(e))}(s,f))return;const g=O?O.template:i.clone(),E=O?g.el:l.cloneNode(),v=!O,N=h&&v?function(t){const e=t.dom.cloneNode(!0);return{avoidDOMInjection:!0,fragment:e,children:Array.from(e.childNodes)}}(g):{};if(v?d.push((()=>g.mount(E,f,n,N))):d.push((()=>g.update(f,n))),h){const t=N.children||g.children;m.push(...t)}else m.push(E);o.delete(b),p.set(b,{template:g,context:f,index:r})})),{newChildrenMap:p,batches:d,futureNodes:m}}(u,t,e,this));return((t,e,n,i,o)=>{const a=n.length;let u=e.length,c=a,l=0,h=0,p=null;for(;l<u||h<c;)if(u===l){const t=c<a?h?i(n[h-1],-0).nextSibling:i(n[c-h],0):o;for(;h<c;)s(i(n[h++],1),t)}else if(c===h)for(;l<u;)p&&p.has(e[l])||r(i(e[l],-1)),l++;else if(e[l]===n[h])l++,h++;else if(e[u-1]===n[c-1])u--,c--;else if(e[l]===n[c-1]&&n[h]===e[u-1]){const t=i(e[--u],-1).nextSibling;s(i(n[h++],1),i(e[l++],-1).nextSibling),s(i(n[--c],1),t),e[u]=n[c]}else{if(!p){p=new Map;let t=h;for(;t<c;)p.set(n[t],t++)}if(p.has(e[l])){const t=p.get(e[l]);if(h<t&&t<c){let r=l,o=1;for(;++r<u&&r<c&&p.get(e[r])===t+o;)o++;if(o>t-h){const r=i(e[l],0);for(;h<t;)s(i(n[h++],1),r)}else d=i(n[h++],1),(m=i(e[l++],-1))&&m.parentNode&&m.parentNode.replaceChild(d,m)}else l++}else r(i(e[l++],-1))}var d,m})(0,i,h,function(t,e){return(n,r)=>{if(r<0){const n=t.pop();if(n){const{template:t,context:r}=n;t.unmount(r,e,null)}}return n}}(Array.from(o.values()),e),n),l.forEach((t=>t())),this.childrenMap=c,this.nodes=h,this},unmount(t,e){return this.update(I,e),this}};const Y={mount(t,e){return this.update(t,e)},update(t,e){const n=!!this.evaluate(t),r=!this.value&&n,i=this.value&&!n,o=()=>{const n=this.node.cloneNode();s(n,this.placeholder),this.template=this.template.clone(),this.template.mount(n,t,e)};switch(!0){case r:o();break;case i: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}};function B(t){throw new Error(t)}function K(e){return e.reduce(((e,n)=>{const{value:r,type:s}=n;switch(!0){case!n.name&&0===s:
/* Riot v5.1.2, @license MIT */
var s;return t[(s=n,s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=It(r),t}),{})}(r.components):{}):Ut;return t=>{let{slots:i,attributes:a,props:u}=t;if(r&&r[y])return function(t,e){let{slots:n,attributes:r,props:s,css:i,template:o}=e;o&&B("Pure components can not have html"),i&&B("Pure components do not have css");const a=Ot(t({slots:n,attributes:r,props:s}),St);return Dt((t=>function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(t===c){const[t]=n;t[y]=!0,Lt(t,a)}return a[t](...n),a}))}(r,{slots:i,attributes:a,props:u,css:e,template:n});const l=mt(r)||{},h=kt({css:e,template:o,componentAPI:l,name:s})({slots:i,attributes:a,props:u});return{mount:(t,e,n)=>h.mount(t,n,e),update:(t,e)=>h.update(e,t),unmount:t=>h.unmount(t)}}}function kt(t){let{css:e,template:n,componentAPI:r,name:s}=t;return e&&s&&jt.add(s,e),xt(Bt)(bt(Ot(r,Object.assign({},Ct,{[v]:{}})),Object.assign({[N]:null,[T]:null},At,{name:s,css:e,template:n})))}function Yt(t,e){return Object.assign({},t,mt(e))}function Bt(t,e){let{slots:n,attributes:r,props:s}=e;return i=function(t){return[...a].reduce(((t,e)=>e(t)||t),t)}(bt(Object.create(t),{mount(e,i,o){return void 0===i&&(i={}),this[M]=function(t,e){void 0===e&&(e=[]);const n=e.map((e=>tt(t,e))),r={};return Object.assign(r,Object.assign({expressions:n},Dt((t=>e=>(n.forEach((n=>n[t](e))),r)))))}(e,r).mount(o),ft(this,E,Object.freeze(Object.assign({},Pt(e,s),K(this[M].expressions)))),this.state=Yt(this.state,i),this[j]=this.template.createDOM(e).clone(),Lt(e,this),t.name&&function(t,e){wt(t)!==e&&Nt(t,u,e)}(e,t.name),ft(this,T,e),ft(this,N,n),this.onBeforeMount(this.props,this.state),this[_]=o,this[j].mount(e,this,o),this.onMounted(this.props,this.state),this},update(t,e){void 0===t&&(t={}),e&&(this[_]=e,this[M].update(e));const n=K(this[M].expressions);if(!1!==this.shouldUpdate(n,this.props))return ft(this,E,Object.freeze(Object.assign({},this.props,n))),this.state=Yt(this.state,t),this.onBeforeUpdate(this.props,this.state),this[j].update(this,this[_]),this.onUpdated(this.props,this.state),this},unmount(t){return this.onBeforeUnmount(this.props,this.state),this[M].unmount(),this[j].unmount(this,this[_],null===t?null:!t),this.onUnmounted(this.props,this.state),this}})),Object.keys(t).filter((e=>P(t[e]))).forEach((t=>{i[t]=i[t].bind(i)})),i;var i}const{DOM_COMPONENT_INSTANCE_PROPERTY:Kt,COMPONENTS_IMPLEMENTATION_MAP:Rt,PLUGINS_SET:Ht}=x;var $t,zt;!function(t,e){let{css:n,template:r,exports:s}=e;Rt.has(t)&&B(`The component "${t}" was already registered`),Rt.set(t,It({name:t,css:n,template:r,exports:s}))}("tiny-accordion",{css:null,exports:{state:{items:[],index:0},onBeforeMount(){this.content=this.root.innerHTML,this.root.innerHTML=""},onMounted(t,e){const n=this.$(".tiny-accordion__header");e.wrapper=document.createElement("div"),e.wrapper.innerHTML=this.content,n.after(e.wrapper);for(let t=0;t<e.wrapper.children.length;t++)e.items.push(e.wrapper.children[t].title),e.wrapper.children[t].classList.add("tiny-accordion__item"),0===t&&e.wrapper.children[t].classList.add("tiny-accordion__item--active");this.update()},handleClick(t,e){for(let t=0;t<this.state.wrapper.children.length;t++)this.state.wrapper.children[t].classList.remove("tiny-accordion__item--active"),t===e&&(this.state.wrapper.children[t].classList.add("tiny-accordion__item--active"),this.state.index=t);this.update()},getCurrentClass(t){let e=[];return t===this.state.index&&e.push("active"),e.join(" ")}},template:function(t,e,n,r){return t('<div class="tiny-accordion"><div class="tiny-accordion__header"><ul><li expr0="expr0"></li></ul></div></div>',[{type:n.EACH,getKey:null,condition:null,template:t(" ",[{expressions:[{type:e.TEXT,childNodeIndex:0,evaluate:function(t){return[t.item].join("")}},{type:e.ATTRIBUTE,name:"class",evaluate:function(t){return t.getCurrentClass(t.index)}},{type:e.EVENT,name:"onclick",evaluate:function(t){return()=>t.handleClick(t.event,t.index)}}]}]),redundantAttribute:"expr0",selector:"[expr0]",itemName:"item",indexName:"index",evaluate:function(t){return t.state.items}}])},name:"tiny-accordio