import{_ as L}from"./DoF8xUrn.js";import{d as U,s as M,c as $,o as n,e as d,t as _,f as e,i as r,l as g,m as C,v as F,J as k,F as I,r as B,z as V,P,g as O,C as T,x as f,S as m}from"./DnIUILmw.js";import{_ as H}from"./CutLPIbK.js";import{_ as q}from"./DlAUqK2U.js";import{_ as A}from"./qXHAlCVI.js";import{_ as J}from"./BlJgmQ1r.js";const j={key:0,class:"lg:absolute lg:top-[50px] w-full rounded-t-xl lg:rounded-t-none lg:rounded-t-none lg:rounded-b-xl bg-cta-50 lg:pb-1.5 pb-3 pt-3 -mb-1 lg:-mt-0.5 text-xs font-bold text-center text-cta-500"},G={class:"w-full flex"},K={class:"w-2/4 inline-block"},R={key:0,class:k(["cursor-pointer text-base mb-1 block font-semibold"])},X={key:0},Y={class:"absolute top-0 left-0 py-2 ml-3 h-full flex items-center"},Z={key:0},Q={key:1,class:"absolute"},ee={class:"w-2/4 inline-block"},te={key:0,class:k(["cursor-pointer text-base mb-1 block font-semibold"])},oe={key:0},ne={class:"absolute top-0 left-0 py-2 ml-3 h-full flex items-center"},se={key:0},le={key:1,class:"absolute"},ae=["name","value"],re=["name","value"],ie=U({__name:"UiDaterangeInput",props:{design:{type:String,default:"normal"},highlightWhenEmpty:{type:Boolean,default:!1},label:{type:String,default:""},activeInput:{type:Boolean,default:!1},placeholderFrom:{type:String,default:""},placeholderTo:{type:String,default:""},nameFrom:{type:String,default:null},nameTo:{type:String,default:null},from:{type:String,default:""},to:{type:String,default:""},mandatoryFields:{type:Boolean,default:!1}},emits:["update:from","update:to","updateTemporaryBis"],setup(h,{emit:D}){const{translate:y}=M("UiDaterangeInput"),o=h,u=D,b=$(()=>o.label==="normal"),s=$(()=>o.label==="up"),l=$(()=>o.design==="normal"),i=$(()=>o.design==="slim");function S(w=!0){w?(u("updateTemporaryBis",null),u("update:to",null)):u("updateTemporaryBis",o.to)}return(w,x)=>{const c=L;return n(),d(I,null,[!o.from&&h.highlightWhenEmpty?(n(),d("div",j,_(e(y)("hint")),1)):r("",!0),g("div",G,[g("div",K,[e(s)?(n(),d("div",R,[C(_(e(y)("from"))+" ",1),o.mandatoryFields?(n(),d("span",X,"*")):r("",!0)])):r("",!0),g("div",{class:"block relative",onClick:x[0]||(x[0]=z=>S(!1))},[g("span",Y,[F(H,{src:"/svg/icons/calendar.svg",width:"22",height:"22",class:"fill-neutral-500"})]),g("div",{class:k([{"pl-11 pr-3 py-3 h-[55px]":e(l)&&e(s)},{"py-2":e(i)&&e(s)},{"pl-11 pr-3 pt-6 pb-1 h-[55px] text-lg font-semibold peer":e(l)&&!e(s)},{"pl-11 pr-6 pt-3 pb-1 text-base font-semibold peer":e(i)&&!e(s)},{"border-cta-500 ring-1 ring-cta-500":e(l)&&!o.from&&h.highlightWhenEmpty},{"border-neutral-200":(e(l)||e(i))&&o.from||(e(l)||e(i))&&!h.highlightWhenEmpty},"border rounded-l-xl bg-white text-left w-full focus:outline-none cursor-pointer active-input"])},[e(b)?(n(),d("div",{key:0,class:k([{"absolute text-lg text-petrol-500 font-semibold duration-200 transform top-4 z-10 origin-[0] left-11 scale-100 -translate-y-1":e(i)&&!o.from},{"absolute text-lg text-petrol-500 font-semibold duration-200 transform top-4 z-10 origin-[0] left-11 scale-[75%] -translate-y-3.5":e(i)&&o.from},{"absolute text-lg text-petrol-500 font-semibold duration-200 transform top-4 z-10 origin-[0] left-11 scale-100 translate-y-0":e(l)&&!o.from},{"absolute text-lg text-petrol-500 font-semibold duration-200 transform top-4 z-10 origin-[0] left-11 scale-[85%] -translate-y-2.5":e(l)&&o.from},"left-0 cursor-pointer"])},[C(_(e(y)("from"))+" ",1),o.mandatoryFields?(n(),d("span",Z,"*")):r("",!0)],2)):r("",!0),o.from?(n(),d("div",Q,_(o.from),1)):r("",!0)],2)])]),g("div",ee,[e(s)?(n(),d("div",te,[F(c,{domain:"UiDaterangeInput",name:"to"}),o.mandatoryFields?(n(),d("span",oe,"*")):r("",!0)])):r("",!0),g("div",{class:"block relative",onClick:S},[g("span",ne,[F(H,{src:"/svg/icons/calendar.svg",width:"22",height:"22",class:"fill-neutral-500"})]),g("div",{class:k([{"pl-11 pr-3 py-3 h-[55px]":e(l)&&e(s)},{"py-2":e(i)&&e(s)},{"pl-11 pr-3 pt-6 pb-1 h-[55px] text-lg font-semibold peer":e(l)&&!e(s)},{"pl-11 pr-6 pt-3 pb-1 text-base font-semibold peer":e(i)&&!e(s)},{"border-cta-500 ring-1 ring-cta-500":e(l)&&!o.from&&h.highlightWhenEmpty},{"border-neutral-200":(e(l)||e(i))&&o.from||(e(l)||e(i))&&!h.highlightWhenEmpty},"border border-l-transparent rounded-r-xl bg-white text-left w-full focus:outline-none cursor-pointer active-input"])},[e(b)?(n(),d("div",{key:0,class:k([{"absolute text-lg text-petrol-500 font-semibold duration-200 transform top-4 z-10 origin-[0] left-11 scale-100 -translate-y-1":e(i)&&!o.to},{"absolute text-lg text-petrol-500 font-semibold duration-200 transform top-4 z-10 origin-[0] left-11 scale-[75%] -translate-y-3.5":e(i)&&o.to},{"absolute text-lg text-petrol-500 font-semibold duration-200 transform top-4 z-10 origin-[0] left-11 scale-100 translate-y-0":e(l)&&!o.to},{"absolute text-lg text-petrol-500 font-semibold duration-200 transform top-4 z-10 origin-[0] left-11 scale-[85%] -translate-y-2.5":e(l)&&o.to},"left-0 cursor-pointer"])},[C(_(e(y)("to"))+" ",1),o.mandatoryFields?(n(),d("span",se,"*")):r("",!0)],2)):r("",!0),o.to?(n(),d("div",le,_(o.to),1)):r("",!0)],2)])])]),o.nameFrom?(n(),d("input",{key:1,name:o.nameFrom,value:o.from,type:"hidden"},null,8,ae)):r("",!0),o.nameTo?(n(),d("input",{key:2,name:o.nameTo,value:o.to,type:"hidden"},null,8,re)):r("",!0)],64)}}}),ge=q(ie,[["__scopeId","data-v-20e39058"]]),he=U({__name:"UiModalOrDropdown",props:{breakpoint:{type:Number,default:768},renderIfHidden:{type:Boolean,default:!0},design:{type:String,default:""},designHead:{type:String,default:""},customDesignFooter:{type:String,default:""},reduceHeightDropdown:{type:[Number,String],default:100}},emits:["shown","hidden","update:isOpen"],setup(h,{expose:D,emit:y}){const o=y,u=h,b=B(),s=B(),l=()=>{var t,p;(t=b.value)==null||t.show(),(p=s.value)==null||p.show(),window.history.pushState({modalOpen:!0,hash:""},"")},i=t=>{var p,v;(p=b.value)==null||p.hide(t),(v=s.value)==null||v.hide(t)},S=()=>{var t,p;(t=b.value)==null||t.show(),(p=s.value)==null||p.toggle()},w=()=>{o("shown")},x=t=>{o("hidden",t)},c=B(!0),z=$(()=>{var t,p;return!!((t=b.value)!=null&&t.isOpen||(p=s.value)!=null&&p.isOpen)}),N=t=>{o("update:isOpen",t)};D({show:l,hide:i,toggle:S,isOpen:z,isModal:c});const E=t=>{c.value=t.matches};let a;return a=window.matchMedia(`(max-width: ${u.breakpoint}px)`),V(()=>{c.value=a==null?void 0:a.matches,a==null||a.addEventListener("change",E)}),P(()=>{a==null||a.removeEventListener("change",E)}),window.addEventListener("popstate",t=>{c.value!==0?(t.preventDefault(),document.querySelectorAll("input").forEach(v=>{v.blur()}),i(),c.value=a==null?void 0:a.matches,a==null||a.addEventListener("change",E)):window.location.href=t.target.location.href}),(t,p)=>{const v=A,W=J;return n(),d(I,null,[e(c)?(n(),O(v,{key:0,ref_key:"modal",ref:b,"render-if-hidden":u.renderIfHidden,onShown:w,onHidden:x},T({head:f(()=>[t.$slots.head?m(t.$slots,"head",{key:0}):r("",!0)]),default:f(()=>[m(t.$slots,"default")]),_:2},[t.$slots.trigger?{name:"trigger",fn:f(()=>[m(t.$slots,"trigger")]),key:"0"}:void 0,t.$slots.footerClose?{name:"footerClose",fn:f(()=>[m(t.$slots,"footerClose")]),key:"1"}:void 0,t.$slots.foot?{name:"foot",fn:f(()=>[m(t.$slots,"foot")]),key:"2"}:void 0]),1032,["render-if-hidden"])):r("",!0),e(c)?r("",!0):(n(),O(W,{key:1,ref_key:"dropdown",ref:s,"custom-design-head":u.designHead,"custom-design":u.design,"custom-design-footer":u.customDesignFooter,"reduce-height":u.reduceHeightDropdown,"onUpdate:isOpen":N,onShown:w,onHidden:x},T({default:f(()=>[m(t.$slots,"default")]),_:2},[t.$slots.trigger?{name:"trigger",fn:f(()=>[m(t.$slots,"trigger")]),key:"0"}:void 0,t.$slots.head?{name:"head",fn:f(()=>[m(t.$slots,"head")]),key:"1"}:void 0,t.$slots.footerClose?{name:"footerClose",fn:f(()=>[m(t.$slots,"footerClose")]),key:"2"}:void 0,t.$slots.foot?{name:"foot",fn:f(()=>[m(t.$slots,"foot")]),key:"3"}:void 0]),1032,["custom-design-head","custom-design","custom-design-footer","reduce-height"]))],64)}}});export{ge as _,he as a};