site-libsoc/Server/public/js/components/manifesto-component.js

2 lines
9.2 KiB
JavaScript

import{S as t,i as e,a as n,b as l,s as o,e as i,n as r,d as s,g as c,h as a,o as u,t as d,c as f,w as m,f as h,m as p,p as g,j as b,r as w,x as y,H as x}from"./index-95aedb1a.js";import{getData as v}from"../../../../../../../../../js/libraries/serverTools.js";function k(t,e,n){const l=t.slice();return l[22]=e[n],l[23]=e,l[24]=n,l}function I(t,e,n){const l=t.slice();return l[25]=e[n],l}function L(t,e,n){const l=t.slice();return l[25]=e[n],l}function T(t,e,n){const l=t.slice();return l[30]=e[n],l[31]=e,l[32]=n,l}function j(t,e,n){const l=t.slice();return l[33]=e[n],l[34]=e,l[35]=n,l}function z(t){let e,n,o,r,u,m,h=t[30].name+"",p=t[30];const b=()=>t[15](n,p),w=()=>t[15](null,p);function y(){return t[16](t[30])}return{c(){e=i("div"),n=i("button"),o=d(h),r=f(),s(n,"class","level0 heading-button"),s(e,"class","heading-button-wrapper")},m(t,i){l(t,e,i),c(e,n),c(n,o),b(),c(e,r),u||(m=g(n,"click",y),u=!0)},p(e,n){p!==(t=e)[30]&&(w(),p=t[30],b())},d(t){t&&a(e),w(),u=!1,m()}}}function A(t){let e,n=t[30],o=[];for(let e=0;e<n.length;e+=1)o[e]=H(j(t,n,e));return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=m()},m(t,n){for(let e=0;e<o.length;e+=1)o[e].m(t,n);l(t,e,n)},p(t,l){if(784&l[0]){let i;for(n=t[30],i=0;i<n.length;i+=1){const r=j(t,n,i);o[i]?o[i].p(r,l):(o[i]=H(r),o[i].c(),o[i].m(e.parentNode,e))}for(;i<o.length;i+=1)o[i].d(1);o.length=n.length}},d(t){b(o,t),t&&a(e)}}}function H(t){let e,n,o,r,u,m,h=t[33].name+"",p=t[33];const b=()=>t[13](n,p),w=()=>t[13](null,p);function y(){return t[14](t[33])}return{c(){e=i("div"),n=i("button"),o=d(h),r=f(),s(n,"class","level1 heading-button"),s(e,"class","heading-button-wrapper")},m(t,i){l(t,e,i),c(e,n),c(n,o),b(),c(e,r),u||(m=g(n,"click",y),u=!0)},p(e,n){p!==(t=e)[33]&&(w(),p=t[33],b())},d(t){t&&a(e),w(),u=!1,m()}}}function M(t){let e;let n=function(t,e){return Array.isArray(t[30])?A:z}(t),o=n(t);return{c(){o.c(),e=m()},m(t,n){o.m(t,n),l(t,e,n)},p(t,e){o.p(t,e)},d(t){o.d(t),t&&a(e)}}}function S(t){let e,n,o,u=t[22]+"";return{c(){e=i("p"),n=new x(!1),o=f(),n.a=o,s(e,"class","margin-end")},m(t,i){l(t,e,i),n.m(u,e),c(e,o)},p:r,d(t){t&&a(e)}}}function V(t){let e,n=t[22].slice(2,t[22].length)+"";return{c(){e=i("h1")},m(t,o){l(t,e,o),e.innerHTML=n},p:r,d(t){t&&a(e)}}}function C(t){let e,n,o,r,u,d=t[22].line+"",m=t[22];const h=()=>t[20](n,m),b=()=>t[20](null,m);return{c(){e=i("button"),n=i("h2"),o=f(),s(n,"id",t[22].id),p(e,"display","block"),p(e,"width","100%")},m(i,s){l(i,e,s),c(e,n),n.innerHTML=d,h(),c(e,o),r||(u=g(e,"click",(function(){y(t[6].scrollIntoView({block:"start"},!0))&&t[6].scrollIntoView({block:"start"},!0).apply(this,arguments)})),r=!0)},p(e,n){m!==(t=e)[22]&&(b(),m=t[22],h())},d(t){t&&a(e),b(),r=!1,u()}}}function E(t){let e,n,o,r,u,d=t[22].line+"",m=t[22];const h=()=>t[19](n,m),b=()=>t[19](null,m);return{c(){e=i("button"),n=i("h3"),o=f(),s(n,"id",t[22].id),p(e,"display","block")},m(i,s){l(i,e,s),c(e,n),n.innerHTML=d,h(),c(e,o),r||(u=g(e,"click",(function(){y(t[6].scrollIntoView({block:"start"},!0))&&t[6].scrollIntoView({block:"start"},!0).apply(this,arguments)})),r=!0)},p(e,n){m!==(t=e)[22]&&(b(),m=t[22],h())},d(t){t&&a(e),b(),r=!1,u()}}}function N(t){let e,n,o=t[22].ol,r=[];for(let e=0;e<o.length;e+=1)r[e]=R(I(t,o,e));return{c(){e=i("ol");for(let t=0;t<r.length;t+=1)r[t].c();n=f()},m(t,o){l(t,e,o);for(let t=0;t<r.length;t+=1)r[t].m(e,null);c(e,n)},p(t,l){if(128&l[0]){let i;for(o=t[22].ol,i=0;i<o.length;i+=1){const s=I(t,o,i);r[i]?r[i].p(s,l):(r[i]=R(s),r[i].c(),r[i].m(e,n))}for(;i<r.length;i+=1)r[i].d(1);r.length=o.length}},d(t){t&&a(e),b(r,t)}}}function O(t){let e,n,o=t[22].ul,r=[];for(let e=0;e<o.length;e+=1)r[e]=Y(L(t,o,e));return{c(){e=i("ul");for(let t=0;t<r.length;t+=1)r[t].c();n=f()},m(t,o){l(t,e,o);for(let t=0;t<r.length;t+=1)r[t].m(e,null);c(e,n)},p(t,l){if(128&l[0]){let i;for(o=t[22].ul,i=0;i<o.length;i+=1){const s=L(t,o,i);r[i]?r[i].p(s,l):(r[i]=Y(s),r[i].c(),r[i].m(e,n))}for(;i<r.length;i+=1)r[i].d(1);r.length=o.length}},d(t){t&&a(e),b(r,t)}}}function R(t){let e,n=t[25]+"";return{c(){e=i("li")},m(t,o){l(t,e,o),e.innerHTML=n},p:r,d(t){t&&a(e)}}}function Y(t){let e,n,o=t[25]+"";return{c(){e=i("li"),n=d(o)},m(t,o){l(t,e,o),c(e,n)},p:r,d(t){t&&a(e)}}}function _(t){let e,n=""!==t[22]&&function(t){let e,n=function(t,e){return t[22],"ul"==Object.keys(t[22])[0]?O:(t[22],"ol"==Object.keys(t[22])[0]?N:(t[22],"h3"==t[22].type?E:(t[22],"h2"==t[22].type?C:"#"==t[22][0]?V:S)))}(t),o=n(t);return{c(){o.c(),e=m()},m(t,n){o.m(t,n),l(t,e,n)},p(t,e){o.p(t,e)},d(t){o.d(t),t&&a(e)}}}(t);return{c(){n&&n.c(),e=m()},m(t,o){n&&n.m(t,o),l(t,e,o)},p(t,e){""!==t[22]&&n.p(t,e)},d(t){n&&n.d(t),t&&a(e)}}}function B(t){let e,n,o,r,u,w,y,x,v,I,L,j=t[8],z=[];for(let e=0;e<j.length;e+=1)z[e]=M(T(t,j,e));let A=t[7],H=[];for(let e=0;e<A.length;e+=1)H[e]=_(k(t,A,e));return{c(){e=i("div"),n=i("button"),o=d("TABLE OF CONTENTS\r\n "),r=i("img"),w=f(),y=i("div");for(let t=0;t<z.length;t+=1)z[t].c();x=f();for(let t=0;t<H.length;t+=1)H[t].c();v=m(),h(r.src,u="../assets/arrow_down.svg")||s(r,"src","../assets/arrow_down.svg"),s(r,"alt","arrow down"),p(r,"transform","scaleY(-1)"),s(n,"id","toggle-content"),s(y,"class","module"),p(y,"display","initial"),s(e,"id","table-content")},m(i,s){l(i,e,s),c(e,n),c(n,o),c(n,r),t[10](r),t[11](n),c(e,w),c(e,y);for(let t=0;t<z.length;t+=1)z[t].m(y,null);t[17](y),t[18](e),l(i,x,s);for(let t=0;t<H.length;t+=1)H[t].m(i,s);l(i,v,s),I||(L=g(n,"click",t[12]),I=!0)},p(t,e){if(784&e[0]){let n;for(j=t[8],n=0;n<j.length;n+=1){const l=T(t,j,n);z[n]?z[n].p(l,e):(z[n]=M(l),z[n].c(),z[n].m(y,null))}for(;n<z.length;n+=1)z[n].d(1);z.length=j.length}if(224&e[0]){let n;for(A=t[7],n=0;n<A.length;n+=1){const l=k(t,A,n);H[n]?H[n].p(l,e):(H[n]=_(l),H[n].c(),H[n].m(v.parentNode,v))}for(;n<H.length;n+=1)H[n].d(1);H.length=A.length}},d(n){n&&a(e),t[10](null),t[11](null),b(z,n),t[17](null),t[18](null),n&&a(x),b(H,n),n&&a(v),I=!1,L()}}}function F(t){let e,n,u=t[0],d=B(t);return{c(){e=i("div"),n=i("div"),d.c(),this.c=r,s(n,"id","text-container"),s(e,"id","container")},m(t,o){l(t,e,o),c(e,n),d.m(n,null)},p(t,e){1&e[0]&&o(u,u=t[0])?(d.d(1),d=B(t),d.c(),d.m(n,null)):d.p(t,e)},i:r,o:r,d(t){t&&a(e),d.d(t)}}}function q(t,e){"none"==e.style.display||""==e.style.display?(e.style.display="initial",t.style.transform="scaleY(-1)",localStorage.setItem("manifesto-hide-content","false")):(e.style.display="none",t.style.transform="",localStorage.setItem("manifesto-hide-content","true"))}function D(t,e,n){let l,o,i,r,s,c=[],a=[],d={},f=[];const m=["ul","ol"];function h(t){d[t].scrollIntoView({block:"start"},!0)}v("/assets/manifesto.txt",(function(t){let e,o=t.split(/\r?\n/),i=0;for(let t=0;t<o.length;t++){let n=o[t],l=m.map((t=>n.includes("<"+t+">"))).findIndex((t=>t));if(-1!=l){let e=m[l],i={};i[e]=[];let r="</"+e+">";for(;;){if(t+=1,n=o[t],n.includes(r)){c.push(i);break}i[e].push(n)}}else if("###"==n.slice(0,3)){let t=n.slice(4,n.length),l=t.toLowerCase().trim().replaceAll(" ","-");e.push({id:l,name:t,index:i}),i+=1,c.push({type:"h3",id:l,line:t,index:i})}else if("##"==n.slice(0,2)){let t=n.slice(3,n.length),l=t.toLowerCase().trim().replaceAll(" ","-");f.push({id:t.toLowerCase().trim().replaceAll(" ","-"),name:t,index:i}),i+=1,e=[],f.push(e),c.push({type:"h2",id:l,line:t,index:i})}else c.push(n)}n(0,l+=1)})),u((()=>{let t=localStorage.getItem("manifesto-hide-content");null!=t&&null!=t&&"true"==t&&q(i,r)}));return[l,o,i,r,a,d,s,c,f,h,function(t){w[t?"unshift":"push"]((()=>{i=t,n(2,i)}))},function(t){w[t?"unshift":"push"]((()=>{o=t,n(1,o)}))},()=>q(i,r),function(t,e){w[t?"unshift":"push"]((()=>{a[e.index]=t,n(4,a)}))},t=>h(t.id),function(t,e){w[t?"unshift":"push"]((()=>{a[e.index]=t,n(4,a)}))},t=>h(t.id),function(t){w[t?"unshift":"push"]((()=>{r=t,n(3,r)}))},function(t){w[t?"unshift":"push"]((()=>{s=t,n(6,s)}))},function(t,e){w[t?"unshift":"push"]((()=>{d[e.id]=t,n(5,d)}))},function(t,e){w[t?"unshift":"push"]((()=>{d[e.id]=t,n(5,d)}))}]}class G extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#table-content{border:#a9a9a9 0.1rem solid;border-radius:1rem;padding:2rem;padding-bottom:1.5rem;margin-bottom:2rem}#toggle-content{position:relative;width:100%;font-size:1.3rem;font-family:var(--sans-serif,sans-serif);text-align:left;margin-bottom:1rem;font-weight:bold}#toggle-content img{position:absolute;top:0rem;right:0rem;width:1.5rem}.module{display:flex;flex-direction:column;width:100%}.heading-button-wrapper{position:relative}.heading-button{color:black;height:auto;width:100%;padding-top:0.5rem;padding-bottom:0.5rem;text-align:left;font-family:var(--sans-serif,sans-serif);font-size:1.3rem}.level0{position:relative;padding-left:0.5rem;z-index:1}.level1{position:relative;padding-left:1.5rem;z-index:1}.heading-button:hover{background-color:hsla(344, 73%, 57%, 0.12)}.heading-button:active{background-color:hsla(344, 73%, 57%, 0.5)}h1{margin-bottom:1rem;font-size:2.5rem;text-align:center}h2{margin-bottom:1rem;text-align:center}h3{margin-bottom:1rem}#text-container{max-width:calc(100vw - 4rem);margin:auto}#container{margin:auto;max-width:1200px;margin-top:1rem;margin-bottom:4rem}#container>div>p{margin-bottom:1rem}#container p{font-size:1.2rem;text-align:justify}</style>",e(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},D,F,o,{},null,[-1,-1]),t&&t.target&&l(t.target,this,t.anchor)}}customElements.define("manifesto-component",G);export{G as default};