"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),s=require("../../../helpers.js"),t=require("@gem-sdk/system"),r=require("./common/styles.js"),o=require("./common/classes.js"),a=require("../../settings/form-dropdown/configs/translate.js");exports.default=({builderProps:l,setting:d,advanced:i,pageContext:p,styles:n})=>{let{name:c,childItem:m,required:u}=d??{},g=m?.map((e,t)=>s.getDynamicSourceLocales({val:e,uid:l?.uid,settingId:s.createSettingId({id:a.FormDropdown?.childItem?.id,index:t}),pageContext:p??{}})),f=t.createStyle(r.composeContainerStyles(i,d)),y=t.createStyle({...r.composeFormDropdownStyles(i,d,n),...r.getAppendTypoStyleFirstTime(d)}),$=t.createStyle(r.getStyleOption(d)),S=t.createClass(o.composeContainerClasses(i,l)),v=t.createClass(o.composeFormDropdownClasses(d));return e.template`
    <gp-form-dropdown
      data-id="${l?.uid}"
      class="${S}"
      style="${f}"
    >
      <select
        type="email"
        class="${v}"
        style="${y}"
        ${t.If(u,"required")}
        name="${c}"
        gp-data='${JSON.stringify(d).replaceAll("'","&#039;")}'
      >
        ${t.If(!Number(d?.defaultOption),`<option class="gp-hidden" value="" disabled selected>
            ${d?.placeholder}
          </option>`)}
        ${g?.map(s=>e.template`
            <option
              value="${s}"
              style="${$}"
              ${t.If(!!Number(d?.defaultOption),`selected: ${s===g[Number(d?.defaultOption)-1]}`)}
            >
              ${s}
            </option>`).join("")}
      </select>
    </gp-form-dropdown>
    ${e.RenderIf(e.isLocalEnv,`<script ${s.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-form-dropdown-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${s.getSettingPreloadData('class="gps-link" delay',"src")}="${e.baseAssetURL}/assets-v2/gp-form-dropdown-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};
