import{h as t,t as s,p as e,H as a,F as r}from"./p-ZGVz1_9H.js";function l(s){let e=s.results||s,a=s.linkTarget||"_blank";return t("div",{class:"results"},t("ul",{role:"list",class:"cta-search-results"},null==e?void 0:e.map((s=>{var e,r;return t("li",{key:s.title,class:"cta-search-results-list"},t("div",{class:"px-4 sm:px-6 lg:px-8"},t("div",{class:"cta-search-container"},t("div",{class:"cta-search-container-two"},t("div",{class:"results-icon"},t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"}))),t("div",{class:"cta-search-container-three"},t("p",{class:"cta-search-text"},t("a",{href:null!==(e=s.link)&&void 0!==e?e:s.url,target:a},t("span",{class:"cta-search-text-position"}),s.title)),t("p",{class:"cta-search-description"},t("a",{href:null!==(r=s.link)&&void 0!==r?r:s.url,class:"relative truncate hover:underline",target:a},s.description)))),t("div",{class:"cta-search-list-arrow"},t("svg",{class:"h-5 w-5 flex-none text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},t("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"}))))))}))))}const i=e(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.categories={}}clearResultsHandler(t){this.categories={}}componentShouldUpdate(){if(this.categoryList&&this.categoryList.length>0){let t=this.categoryList.reduce(((t,s)=>((t[s.category]=t[s.category]||[]).push(s),t)),{});this.categories=t}else this.categories={}}render(){return Object.entries(this.categories).map((([s,e])=>t(r,null,t("div",null,t("h1",{class:"custom-title"},s)),t(l,{results:e,linkTarget:this.linkTarget}))))}static get style(){return"ai12z-category{font-family:var(--ai12z-font-family) !important;font-size:var(--ai12z-search-font-size, var(--ai12z-font-size)) !important}.custom-title{font-size:var(--ai12z-category-font-size);color:var(--ai12z-category-font-color)}"}},[0,"ai12z-category",{categoryList:[520,"category-list"],linkTarget:[513,"link-target"]},[[4,"clearResults","clearResultsHandler"]]]);function c(){"undefined"!=typeof customElements&&["ai12z-category"].forEach((t=>{"ai12z-category"===t&&(customElements.get(s(t))||customElements.define(s(t),i))}))}c();export{i as C,l as S,c as d}