import{p as e,H as t,g as a,h as s,t as i}from"./p-Bpcl2TqF.js";import{d as r}from"./p-BdAO9PV5.js";import{d as n}from"./p-DtIGLtyC.js";import{d as l}from"./p-KvSIaMXJ.js";import{d as p}from"./p-C8Y5he7P.js";import{d as c}from"./p-D9XRTfuC.js";import{d as o}from"./p-SPGxvXYj.js";import{d as f}from"./p-CUlfNLu7.js";import{d as m}from"./p-uZq-wRGz.js";const d=()=>`*{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}`;const b=e(class e extends t{constructor(e){super();if(e!==false){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){const t=this.el.shadowRoot.querySelector(".templates__wrapper").querySelectorAll("ifx-template");t.forEach((t=>{t.toggleTemplate(e)}))}handleError(e){const t=this.el.shadowRoot.querySelector(".alert__wrapper");if(e.detail){t.classList.add("show")}else{t.classList.remove("show")}}filterTemplates(e){const t=this.el.shadowRoot.querySelector(".templates__title");const a=this.el.shadowRoot.querySelector(".back__btn-wrapper");if(e.detail){t.classList.add("hide");if(e.detail!=="details"){a.classList.add("show")}this.toggleTemplate(e.detail)}else{t.classList.remove("hide");a.classList.remove("show");this.toggleTemplate(null)}}closeAlert(){const e=this.el.shadowRoot.querySelector(".alert__wrapper");e.classList.remove("show")}render(){return s("div",{key:"29c772490e68cc71ee5115470c7be4769ed4d321",class:"templates__container"},s("div",{key:"e01f48549b2f41541d7bf09ed784bee2503582bf",class:"back__btn-wrapper"},s("ifx-icon-button",{key:"a58c2fa0fcd6f2bf04dfd4f71aede46bb1071c8b",onClick:()=>this.filterTemplates(false),shape:"round",variant:"tertiary",icon:"arrow-left-16",target:"_blank",size:"m"}),s("div",{key:"7acfbaf0dd6bb121cbc597779d9608aef8e994e3",class:"alert__wrapper"},s("ifx-alert",{key:"cea1452563f7f7a015e0cd3796fd225aac95db77",onClick:()=>this.closeAlert(),"aria-live":"assertive",variant:"danger",icon:"c-info-16"},"All fields are mandatory"))),s("h2",{key:"77f108daf1d6ee1431b75b7dea7650d254e59012",class:"templates__title"},"Choose your template"),s("div",{key:"aa1795f74d93e14abd98c116ae832529caaef353",class:"templates__wrapper"},s("ifx-template",{key:"c1dd2731ef19aebb90a5446d6bb09dc121450a51",name:"template-01",thumbnail:this.tableTemplate}),s("ifx-template",{key:"a6f8d753ce70bb3d4d1799496935e6887bc9a76d",name:"template-02",thumbnail:this.wizardTemplate})))}static get assetsDirs(){return["assets"]}static get style(){return d()}},[1,"ifx-templates-ui",undefined,[[0,"fieldError","handleError"],[0,"toggleTemplates","filterTemplates"]]]);function _(){if(typeof customElements==="undefined"){return}const e=["ifx-templates-ui","ifx-alert","ifx-button","ifx-icon","ifx-icon-button","ifx-link","ifx-spinner","ifx-template","ifx-text-field"];e.forEach((e=>{switch(e){case"ifx-templates-ui":if(!customElements.get(i(e))){customElements.define(i(e),b)}break;case"ifx-alert":if(!customElements.get(i(e))){r()}break;case"ifx-button":if(!customElements.get(i(e))){n()}break;case"ifx-icon":if(!customElements.get(i(e))){l()}break;case"ifx-icon-button":if(!customElements.get(i(e))){p()}break;case"ifx-link":if(!customElements.get(i(e))){c()}break;case"ifx-spinner":if(!customElements.get(i(e))){o()}break;case"ifx-template":if(!customElements.get(i(e))){f()}break;case"ifx-text-field":if(!customElements.get(i(e))){m()}break}}))}const u=b;const h=_;export{u as IfxTemplatesUi,h as defineCustomElement};
//# sourceMappingURL=ifx-templates-ui.js.map