import{p as e,H as t,g as a,h as s,t as i}from"./p-CHfEnK-2.js";import{d as r}from"./p-CEVOFxfh.js";import{d as n}from"./p-O4tEZRTM.js";import{d as l}from"./p-B5hDbbCP.js";import{d as p}from"./p-BBqiisVg.js";import{d as c}from"./p-CUljqVvL.js";import{d as o}from"./p-DieIMUwV.js";import{d as m}from"./p-BIn8bQ5Y.js";import{d}from"./p-n3ZDkemz.js";const f=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}get el(){return this}tableTemplate=a("https://raw.githubusercontent.com/Infineon/public-assets/refs/heads/main/table_template.png");wizardTemplate=a("https://raw.githubusercontent.com/Infineon/public-assets/refs/heads/main/wizard_template.png");toggleTemplate(e){this.el.shadowRoot.querySelector(".templates__wrapper").querySelectorAll("ifx-template").forEach((t=>{t.toggleTemplate(e)}))}handleError(e){const t=this.el.shadowRoot.querySelector(".alert__wrapper");e.detail?t.classList.add("show"):t.classList.remove("show")}filterTemplates(e){const t=this.el.shadowRoot.querySelector(".templates__title"),a=this.el.shadowRoot.querySelector(".back__btn-wrapper");e.detail?(t.classList.add("hide"),"details"!==e.detail&&a.classList.add("show"),this.toggleTemplate(e.detail)):(t.classList.remove("hide"),a.classList.remove("show"),this.toggleTemplate(null))}closeAlert(){this.el.shadowRoot.querySelector(".alert__wrapper").classList.remove("show")}render(){return s("div",{key:"3ae6adab1629b5ccac588791ce2d309cacbebd9c",class:"templates__container"},s("div",{key:"67f33d446aebe5730b324eb0b8b0495e5c857252",class:"back__btn-wrapper"},s("ifx-icon-button",{key:"df2999672f040014da5015d53affad793c97ec50",onClick:()=>this.filterTemplates(!1),shape:"round",variant:"tertiary",icon:"arrow-left-16",target:"_blank",size:"m"}),s("div",{key:"e6ac0d1bbac185534fe9a1d3ce938dded2d963b4",class:"alert__wrapper"},s("ifx-alert",{key:"5d7017086dea0e7117d9d395b56f35eac880d7d4",onClick:()=>this.closeAlert(),"aria-live":"assertive",variant:"danger",icon:"c-info-16"},"All fields are mandatory"))),s("h2",{key:"df32be6104d3499874194d9f1d13a4fa894b2458",class:"templates__title"},"Choose your template"),s("div",{key:"3bad4733a12a1c1bbc79d5dcd1764770f31f9df5",class:"templates__wrapper"},s("ifx-template",{key:"e40c0cf0a6e215dd1a439f6d331d78b6c09245e2",name:"template-01",thumbnail:this.tableTemplate}),s("ifx-template",{key:"6dea865b691395ee513332687b9d33b8548435c9",name:"template-02",thumbnail:this.wizardTemplate})))}static get assetsDirs(){return["assets"]}static get style(){return"*{padding:0;margin:0}.templates__container{display:flex;flex-direction:column;align-items:center}.templates__container .back__btn-wrapper{display:none}.templates__container .back__btn-wrapper.show{display:flex;justify-content:space-between;width:100%}.templates__container .back__btn-wrapper .alert__wrapper{display:none}.templates__container .back__btn-wrapper .alert__wrapper.show{display:block}.templates__container .templates__wrapper{display:flex;padding:20px 0px;gap:20px;flex-wrap:wrap}.templates__container .templates__title.hide{display:none}"}},[1,"ifx-templates-ui",void 0,[[0,"fieldError","handleError"],[0,"toggleTemplates","filterTemplates"]]]),b=f,_=function(){"undefined"!=typeof customElements&&["ifx-templates-ui","ifx-alert","ifx-button","ifx-icon","ifx-icon-button","ifx-link","ifx-spinner","ifx-template","ifx-text-field"].forEach((e=>{switch(e){case"ifx-templates-ui":customElements.get(i(e))||customElements.define(i(e),f);break;case"ifx-alert":customElements.get(i(e))||r();break;case"ifx-button":customElements.get(i(e))||n();break;case"ifx-icon":customElements.get(i(e))||l();break;case"ifx-icon-button":customElements.get(i(e))||p();break;case"ifx-link":customElements.get(i(e))||c();break;case"ifx-spinner":customElements.get(i(e))||o();break;case"ifx-template":customElements.get(i(e))||m();break;case"ifx-text-field":customElements.get(i(e))||d()}}))};export{b as IfxTemplatesUi,_ as defineCustomElement}