'use client';
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{cls as r}from"@gem-sdk/core";let Select=({builderProps:a,setting:l={},className:p,style:n})=>{let{options:d="",arrow:o=!0,disabled:i=!1,iconSvg:s}=l,c=`<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
              <path d="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"></path>
            </svg>`;s&&(c=s);let g=e=>{let r=[];try{r=JSON.parse(e)}catch(e){}if(r.length)return r.map((e,r)=>{let a=e?.content||"",l=e?.value||"",p=e?.disabled||!1;return t("option",{value:l,disabled:p,children:a},r)})};return e("div",{"data-id":a?.uid,className:r("gp-relative",p),"data-testid":"select",children:[t("select",{style:n,disabled:i,className:r(p,"gp-w-full gp-appearance-none gp-rounded-[3px] gp-border gp-border-solid gp-border-[#e2e8f0] gp-px-4 gp-py-2 gp-outline-0",{"gp-cursor-pointer":!i,"gp-cursor-not-allowed":i}),children:g(d)}),o&&t("span",{"aria-hidden":"true",className:"gp-pointer-events-none gp-absolute gp-right-[6px] gp-top-[calc(50%_-_0.5em)] gp-inline-flex gp-h-4 gp-w-4",dangerouslySetInnerHTML:{__html:c}})]})};export{Select as default};
