text: const address={licenses:["http://localhost:5001/frame-25f3b/us-central1/framefe/public/license.json"],pictureCredits:["http://localhost:5001/frame-25f3b/us-central1/framefe/public/picture-credit.json"]},handleError=e=>{console.error(e)};function apiCall(s,l,c){return new Promise((a,e)=>{const n=new XMLHttpRequest;n.onreadystatechange=t=>{if(4===t.target.readyState)if(200===t.target.status){let e;t.target.responseText&&(e=n.getResponseHeader("content-type").startsWith("application/json")?JSON.parse(t.target.responseText):t.target.responseText),a(e)}else e()},n.open(l,s,!0),n.withCredentials=!0,n.setRequestHeader("Content-type","application/x-www-form-urlencoded");const t=document.querySelector('meta[name="csrf-token"]');var r;!t||(r=t.getAttribute("content"))&&n.setRequestHeader("CSRF-Token",r),c?(r=Object.keys(c).map(e=>e+"="+c[e]).join("&"),n.send(r)):n.send()})}const addNewElement=e=>{const{attributes:t,classes:a,parent:n,elementName:r,innerHtml:s,innerText:l}=e,c=document.createElement(r);return t&&t.forEach(e=>{var{name:t,value:e}=e;c.setAttribute(t,e)}),a&&a.forEach(e=>c.classList.add(e)),s&&(c.innerHTML=s),!l&&0!==l||(c.innerText=l),n.appendChild(c),c},addDivElement=e=>{const t=e;return t.elementName="div",addNewElement(t)},addSelectElement=e=>{const{parent:t,labelAttributes:a=[],id:n,label:r,selectAttributes:s=[],options:l}=e;e=a;a.push({name:"for",value:n});e=addNewElement({parent:t,elementName:"label",attributes:e,innerText:r});const c=s;c.push({name:"id",value:n}),c.push({name:"name",value:n});const i=addNewElement({parent:t,elementName:"select",attributes:c});return l&&l.forEach(({name:e,value:t,selected:a})=>{const n=[{name:"value",value:t}];a&&n.push({name:"selected",value:"selected"}),addNewElement({parent:i,elementName:"option",innerText:e,attributes:n})}),{labelElement:e,selectElement:i}},addSubmitElement=e=>{var{attributes:t=[],parent:a,value:e}=e;const n=t;return n.push({name:"type",value:"submit"}),n.push({name:"value",value:e}),addNewElement({parent:a,elementName:"input",attributes:n})},formValidation=(n,...e)=>{let r=!0;return e.forEach(e=>{const t=n.querySelector(e),a=n.querySelector(e+"Error");t&&a&&t.checkValidity()?(a.innerText=null,t.classList.remove("error")):(r=!1,a&&(a.innerText=t.validationMessage),t&&t.classList.add("error"))}),r},loadLicenses=async()=>{const s=document.getElementById("licenses");if(s){var e=address.licenses.map(e=>apiCall(e,"GET"));const t=await Promise.all(e),l={};t.forEach(e=>{e.forEach(({name:e,licenseType:t,link:a,installedVersion:n})=>{let r=!1;l[e]?l[e].includes(n)||(l[e].push(n),r=!0):(l[e]=[n],r=!0),r&&(a=a.replace(/^(git\+?)/i,"").replace(/^(:)/i,"https:"),addNewElement({parent:s,elementName:"a",innerText:e+` ${n} (${t})`,attributes:[{name:"href",value:a}]}))})})}};document.getElementById("id_c29b58e4b3ab492692b4bd06dc90aeb5")&&loadLicenses().catch(handleError);const loadPictureCredits=async()=>{const r=document.getElementById("pictures");if(r){var e=address.pictureCredits.map(e=>apiCall(e,"GET"));const t=await Promise.all(e);t.forEach((e,t)=>{const n=address.pictureCredits[t].substr(0,address.pictureCredits[t].lastIndexOf("/"));e&&e.forEach&&e.forEach(({name:e,author:t})=>{var a=addDivElement({parent:r,classes:["grid-col-2"]});addNewElement({parent:a,elementName:"img",attributes:[{name:"src",value:n+"/"+e},{name:"alt",value:e},{name:"width",value:150},{name:"height",value:50}]}),addDivElement({parent:a,innerText:e+" - "+t})})})}};document.getElementById("id_ca156b87aaaf42fd9ff1ccecda7828c2")&&loadPictureCredits().catch(handleError);const frameReplaceElements=async()=>{const a="frame-request-by",n=window.location.href.split("framefe")[0]+"framefe";document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll(`[${a}]`);e&&e.forEach&&e.forEach(e=>{var t=e.getAttribute(a);e.removeAttribute(a),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}))})})};frameReplaceElements().catch(handleError);