const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./widget-DZZgQDKu.css","./RangeTime-DTG_67T0.css","./main-CWmBI_q2.css","./SingleTime-DkOZqMnv.css"])))=>i.map(i=>d[i]);
import{a as H,C as M,b as r,e as k,_ as V,k as I,o as N,m as l,g as i,p,q as n,f as T,L as R,n as E,D as v,u as a,r as B,I as w}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import{u as L,c as O,n as W,a as z}from"./widget-BUAABBRb.js";import{c as U}from"./ThankYouPage-bf4cLsjC.js";import{_ as j}from"./RequiredHint.vue_vue_type_style_index_0_lang-R4Bqx90z.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./translationsStore-DBJu9sBR.js";import"./index-CEuXXsrq.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const G={class:"ccb-field__label"},J={class:"ccb-field__title"},K={key:0,class:"ccb-field-required-mark"},Q={key:0,class:"ccb-field__descriptions ccb-before"},X={key:0,class:"ccb-field__description"},Y={class:"ccb-field__input-wrapper"},Z={key:1,class:"ccb-field__descriptions ccb-after"},ee={key:0,class:"ccb-field__description"},de=H({__name:"TimePicker",props:{field:{}},setup(C){const D=C,{field:e}=M(D),f=L(),u=O(),$=W(),q=r(()=>{var t;return((t=z().getWarningTexts)==null?void 0:t.requiredMsg)||""}),P=r(()=>typeof e.value.range=="string"?e.value.range==="1":e.value.range),x=r(()=>e.value.useInterval?e.value.minInterval||"1h":""),_=r(()=>{const s=e.value.placeholderHours.length>0?e.value.placeholderHours:new Date().getHours(),t=e.value.placeholderTime.length>0?e.value.placeholderTime:new Date().getMinutes();return{hours:s,minutes:t,seconds:0}}),c=r(()=>e.value.format||!1),A=r(()=>P.value?k(()=>V(()=>import("./RangeTime-BCW7m-3x.js"),__vite__mapDeps([0,1,2]),import.meta.url)):k(()=>V(()=>import("./SingleTime-Bx-iI4SO.js"),__vite__mapDeps([0,3,2]),import.meta.url))),g=r(()=>u.checkFieldRequired(e.value)),o=I(null);N(()=>{o.value={hours:Number(_.value.hours),minutes:Number(_.value.minutes),seconds:0},e.value.displayValue=b.value,u.updateField(e.value.alias,e.value,!0)});const b=r(()=>{if(!o.value)return"";if(Array.isArray(o.value)){const s=o.value[0],t=o.value[1];return`${d(s)} - ${d(t)}`}else return d(o.value)}),d=s=>{const{hours:t,minutes:m}=s,y=m.toString().padStart(2,"0");if(c.value)return`${t.toString().padStart(2,"0")}:${y}`;{const S=t>=12?"PM":"AM";return`${t%12||12}:${y} ${S}`}},F=()=>{e.value.displayValue=b.value,u.updateField(e.value.alias,e.value),$.applyConditionForField(e.value.alias)},h=r(()=>{var s;return((s=e.value)==null?void 0:s.additionalStyles)||""});return(s,t)=>(i(),l("div",{class:w(["ccb-field ccb-timePicker-field",{required:g.value,"ccb-24-hours":c.value,"ccb-field-disabled":a(e).disabled,[h.value]:h.value}])},[p("div",G,[g.value?(i(),T(j,{key:0,text:q.value},null,8,["text"])):n("",!0),p("div",J,[R(v(a(e).label),1),a(e).required?(i(),l("span",K,"*")):n("",!0),E(U)])]),a(f).descriptionPosition==="before"?(i(),l("div",Q,[a(e).description?(i(),l("div",X,v(a(e).description),1)):n("",!0)])):n("",!0),p("div",Y,[(i(),T(B(A.value),{modelValue:o.value,"onUpdate:modelValue":[t[0]||(t[0]=m=>o.value=m),F],alias:a(e).alias,format:c.value,default:"23:05",field:a(e),"min-interval":x.value},null,8,["modelValue","alias","format","field","min-interval"]))]),a(f).descriptionPosition==="after"?(i(),l("div",Z,[a(e).description?(i(),l("div",ee,v(a(e).description),1)):n("",!0)])):n("",!0)],2))}});export{de as default};
//# sourceMappingURL=index-Bh76trHK.js.map
