"use strict";const dark=matchMedia("(prefers-color-scheme: dark)").matches,suffix=5,settings={get pivot(){return localStorage.getItem("pivot")},get workdir(){return`https://${this.pivot}.sender.services:3110/c/5/`}},fetch_init=Object.freeze({cache:"force-cache",headers:{"X-Skip-Proxy":"7"},credentials:"omit",referrerPolicy:"no-referrer"});async function Script(e){const t=document.createElement("script"),{promise:r,resolve:n}=Promise.withResolvers();return t.src=e,t.defer=!0,t.addEventListener("load",e=>n(e)),document.head.append(t),t.remove(),r}async function Init(e){e.settings&&Object.assign(settings,e.settings),$("<link>").attr({rel:"stylesheet",href:settings.workdir+e.style+".css"}).appendTo(document.head),e.icon&&$("#favicon").attr("href",e.icon),await fetch(settings.workdir+e.template+".vue",fetch_init).then(e=>200===e.status?e.text():null).then(function(e){if(null===e)throw"";$("#template").html(e)}).catch(function(e){document.title="🤧 Error happened",$(document.body).html(`<div class="d-flex align-items-center justify-content-center vh-100">\n<div class="alert alert-danger fs-2">${document.title}</div>\n</div>`),console.error(e)}),await Script(settings.workdir+"common.js"),await Script(settings.workdir+e.script+".js")}("1"===localStorage.getItem("dark")||dark)&&document.documentElement.setAttribute("data-bs-theme","dark");
