import{i as c,r as i,c as m,o as f,w as h,d as o,a as y,t as n}from"./vue.esm-bundler.js?ver=1.6.0";const p={class:"flex gap-2 items-center justify-between w-full mb-2.5 -mt-2"},C={class:"setting-label !mb-0"},v={class:"form-note"},b={__name:"Code",props:{field:{type:Object},value:{type:Object},fieldKey:{type:String}},setup(e){const s=e,r=()=>{const l="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let t="";for(let a=0;a<20;a++)t+=l.charAt(Math.floor(Math.random()*l.length));s.value[s.fieldKey]=t};return c(()=>{}),(l,t)=>{const a=i("el-input"),u=i("el-form-item");return f(),m(u,null,{default:h(()=>[o("div",p,[o("label",C,n(l.$t("Code")),1),o("span",{class:"text-system-dark text-xs cursor-pointer hover:underline dark:text-gray-50",onClick:r},n(l.$t("Generate Random Code")),1)]),y(a,{modelValue:e.value[e.fieldKey],"onUpdate:modelValue":t[0]||(t[0]=d=>e.value[e.fieldKey]=d),placeholder:e.field.placeholder,maxlength:"20",onInput:t[1]||(t[1]=d=>e.value[e.fieldKey]=e.value[e.fieldKey].toUpperCase())},null,8,["modelValue","placeholder"]),o("div",v,[o("p",null,n(l.$t("Customers must enter this code at checkout.")),1)])]),_:1})}}};export{b as default};
