import{r as e,a as t,b as n,B as r,d as i,f as s}from"./util-2b4068db.js";var o=[function(e,t,n){return[".container",t," {box-sizing: border-box;width: 100%;}\n.webring",t,' {box-sizing: border-box;width: calc(100% - 0.3em);background-image: linear-gradient(45deg, #79589f, #009edb);font-size: 100%;font-family: "Courier New", Courier, serif;font-weight: bold;color: #f6f0e2;border: 2px solid;}\n.webring.light-mode',t," {box-shadow: 0.3em 0.3em 0 #1e1e60;border-color: #1e1e60;}\n.webring.dark-mode",t," {box-shadow: 0.3em 0.3em 0 #f6f0e2;border-color: #f6f0e2;}\n.webring",t," a",t," {color: #f6f0e2;text-decoration: none;}\n.webring",t," a:hover",t," {text-decoration: underline;}\n.webring",t," .error-message",t," a",t," {text-decoration: underline;}\n.webring",t," .description-container",t,",.webring",t," nav",t," {padding: 8px 12px;}\n.webring",t," .description-container",t," {margin: 0;background-color: rgba(0, 0, 0, 0.3);line-height: 1.3;}\n.webring",t," .description",t," {font-weight: normal;}\n.webring",t," .description",t," .description-text",t,':before {content: " / ";}\n.webring',t," nav",t," {box-sizing: border-box;display: flex;justify-content: space-between;align-items: center;line-height: 1;}\n.webring",t," nav",t," a",t," {display: flex;align-items: center;}\n.webring",t," nav",t," a.previous",t," svg",t," {margin-right: 0.5em;}\n.webring",t," nav",t," a.next",t," svg",t," {margin-left: 0.5em;}\n"].join("")}];function a(e,t,n,r){const{h:i,t:s,d:o,b:a}=e,{_m0:l,_m1:c}=r;return[i("div",{classMap:{container:!0},key:14},[i("div",{classMap:{webring:!0,"light-mode":!0},key:13},[i("div",{classMap:{"description-container":!0},key:5},[i("div",{classMap:{"error-message":!0},context:{lwc:{dom:"manual"}},key:0},[]),t.loading?i("div",{classMap:{loading:!0},key:1},[s("Loading...")]):null,i("div",{classMap:{description:!0},key:4},[t.name?i("span",{classMap:{home:!0},key:2},[o(t.name)]):null,t.description?i("span",{classMap:{"description-text":!0},key:3},[o(t.description)]):null])]),t.success?i("nav",{key:12},[i("a",{classMap:{previous:!0},attrs:{href:t.prevHref,target:t.target},key:8,on:{click:l||(r._m0=a(t.onLinkClick))}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"20",viewBox:"0 0 12 20"},key:7},[i("polyline",{attrs:{points:"9.96 2.15 2.04 10.06 9.96 17.86",fill:"none",stroke:"#f6f0e2","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},key:6},[])]),s("Previous")]),i("a",{classMap:{next:!0},attrs:{href:t.nextHref,target:t.target},key:11,on:{click:c||(r._m1=a(t.onLinkClick))}},[s("Next"),i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"20",viewBox:"0 0 12 20"},key:10},[i("polyline",{attrs:{points:"2.04 17.86 9.96 9.94 2.04 2.15",fill:"none",stroke:"#f6f0e2","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},key:9},[])])])]):null])])]}var l=e(a);a.stylesheets=[],o&&a.stylesheets.push.apply(a.stylesheets,o),a.stylesheetTokens={hostAttribute:"wck-webring_webring-host",shadowAttribute:"wck-webring_webring"};class c extends r{constructor(...e){super(...e),this.name=null,this.description=null,this.loading=!0,this.prevHref=null,this.nextHref=null,this.host=null,this.target=null,this._error=null}get success(){return!this.loading&&!this.error}get error(){return this._error}set error(e){this._error=e,this.template.querySelector(".error-message").innerHTML=e||""}connectedCallback(){this.fetchData()}async onLinkClick(e){const[t]=await i(this,`/webring?site=${e.target.getAttribute("href")}`);t&&(this.prevHref=t.prevWebsite,this.nextHref=t.nextWebsite)}async fetchData(){const[e,t]=await s(this,`/webring?site=${window.location.href}`);t?this.error=t:(this.name=e.name,this.description=e.description,this.prevHref=e.prevWebsite,this.nextHref=e.nextWebsite)}}t(c,{publicProps:{host:{config:0},target:{config:0}},fields:["name","description","loading","prevHref","nextHref","_error"]});var g=n(c,{tmpl:l});customElements.define("wck-webring",g.CustomElementConstructor);
