import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-Co4V4Zk-.js';
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-B85MJLTf.js';

var datepicker_min = {exports: {}};

var hasRequiredDatepicker_min;

function requireDatepicker_min () {
	if (hasRequiredDatepicker_min) return datepicker_min.exports;
	hasRequiredDatepicker_min = 1;
	(function (module, exports) {
		!function(e,t){module.exports=t();}(window,(function(){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:false,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=true,r.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:true,get:a});},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:true});},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:true,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n.r(t);var a=[],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=["January","February","March","April","May","June","July","August","September","October","November","December"],o={t:"top",r:"right",b:"bottom",l:"left",c:"centered"};function s(){}var l=["click","focusin","keydown","input"];function d(e){l.forEach((function(t){e.addEventListener(t,e===document?L:Y);}));}function c(e){return Array.isArray(e)?e.map(c):"[object Object]"===x(e)?Object.keys(e).reduce((function(t,n){return t[n]=c(e[n]),t}),{}):e}function u(e,t){var n=e.calendar.querySelector(".qs-overlay"),a=n&&!n.classList.contains("qs-hidden");t=t||new Date(e.currentYear,e.currentMonth),e.calendar.innerHTML=[h(t,e,a),f(t,e,a),v(e,a)].join(""),a&&window.requestAnimationFrame((function(){M(true,e);}));}function h(e,t,n){return ['<div class="qs-controls'+(n?" qs-blur":"")+'">','<div class="qs-arrow qs-left"></div>','<div class="qs-month-year'+(t.disableYearOverlay?" qs-disabled-year-overlay":"")+'">','<span class="qs-month">'+t.months[e.getMonth()]+"</span>",'<span class="qs-year">'+e.getFullYear()+"</span>","</div>",'<div class="qs-arrow qs-right"></div>',"</div>"].join("")}function f(e,t,n){var a=t.currentMonth,r=t.currentYear,i=t.dateSelected,o=t.maxDate,s=t.minDate,l=t.showAllDates,d=t.days,c=t.disabledDates,u=t.startDay,h=t.weekendIndices,f=t.events,v=t.getRange?t.getRange():{},m=+v.start,y=+v.end,p=g(new Date(e).setDate(1)),w=p.getDay()-u,D=w<0?7:0;p.setMonth(p.getMonth()+1),p.setDate(0);var b=p.getDate(),q=[],S=D+7*((w+b)/7|0);S+=(w+b)%7?7:0;for(var M=1;M<=S;M++){var E=(M-1)%7,x=d[E],C=M-(w>=0?w:7+w),L=new Date(r,a,C),Y=f[+L],j=C<1||C>b,O=j?C<1?-1:1:0,P=j&&!l,k=P?"":L.getDate(),N=+L==+i,_=E===h[0]||E===h[1],I=m!==y,A="qs-square "+x;Y&&!P&&(A+=" qs-event"),j&&(A+=" qs-outside-current-month"),!l&&j||(A+=" qs-num"),N&&(A+=" qs-active"),(c[+L]||t.disabler(L)||_&&t.noWeekends||s&&+L<+s||o&&+L>+o)&&!P&&(A+=" qs-disabled"),+g(new Date)==+L&&(A+=" qs-current"),+L===m&&y&&I&&(A+=" qs-range-start"),+L>m&&+L<y&&(A+=" qs-range-middle"),+L===y&&m&&I&&(A+=" qs-range-end"),P&&(A+=" qs-empty",k=""),q.push('<div class="'+A+'" data-direction="'+O+'">'+k+"</div>");}var R=d.map((function(e){return '<div class="qs-square qs-day">'+e+"</div>"})).concat(q);return R.unshift('<div class="qs-squares'+(n?" qs-blur":"")+'">'),R.push("</div>"),R.join("")}function v(e,t){var n=e.overlayPlaceholder,a=e.overlayButton;return ['<div class="qs-overlay'+(t?"":" qs-hidden")+'">',"<div>",'<input class="qs-overlay-year" placeholder="'+n+'" inputmode="numeric" />','<div class="qs-close">&#10005;</div>',"</div>",'<div class="qs-overlay-month-container">'+e.overlayMonths.map((function(e,t){return '<div class="qs-overlay-month" data-month-num="'+t+'">'+e+"</div>"})).join("")+"</div>",'<div class="qs-submit qs-disabled">'+a+"</div>","</div>"].join("")}function m(e,t,n){var a=t.el,r=t.calendar.querySelector(".qs-active"),i=e.textContent,o=t.sibling;(a.disabled||a.readOnly)&&t.respectDisabledReadOnly||(t.dateSelected=n?void 0:new Date(t.currentYear,t.currentMonth,i),r&&r.classList.remove("qs-active"),n||e.classList.add("qs-active"),p(a,t,n),n||q(t),o&&(y({instance:t,deselect:n}),t.first&&!o.dateSelected&&(o.currentYear=t.currentYear,o.currentMonth=t.currentMonth,o.currentMonthName=t.currentMonthName),u(t),u(o)),t.onSelect(t,n?void 0:new Date(t.dateSelected)));}function y(e){var t=e.instance.first?e.instance:e.instance.sibling,n=t.sibling;t===e.instance?e.deselect?(t.minDate=t.originalMinDate,n.minDate=n.originalMinDate):n.minDate=t.dateSelected:e.deselect?(n.maxDate=n.originalMaxDate,t.maxDate=t.originalMaxDate):t.maxDate=n.dateSelected;}function p(e,t,n){if(!t.nonInput)return n?e.value="":t.formatter!==s?t.formatter(e,t.dateSelected,t):void(e.value=t.dateSelected.toDateString())}function w(e,t,n,a){n||a?(n&&(t.currentYear=+n),a&&(t.currentMonth=+a)):(t.currentMonth+=e.contains("qs-right")?1:-1,12===t.currentMonth?(t.currentMonth=0,t.currentYear++):-1===t.currentMonth&&(t.currentMonth=11,t.currentYear--)),t.currentMonthName=t.months[t.currentMonth],u(t),t.onMonthChange(t);}function D(e){if(!e.noPosition){var t=e.position.top,n=e.position.right;if(e.position.centered)return e.calendarContainer.classList.add("qs-centered");var a=e.positionedEl.getBoundingClientRect(),r=e.el.getBoundingClientRect(),i=e.calendarContainer.getBoundingClientRect(),o=r.top-a.top+(t?-1*i.height:r.height)+"px",s=r.left-a.left+(n?r.width-i.width:0)+"px";e.calendarContainer.style.setProperty("top",o),e.calendarContainer.style.setProperty("left",s);}}function b(e){return "[object Date]"===x(e)&&"Invalid Date"!==e.toString()}function g(e){if(b(e)||"number"==typeof e&&!isNaN(e)){var t=new Date(+e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}}function q(e){e.disabled||!e.calendarContainer.classList.contains("qs-hidden")&&!e.alwaysShow&&("overlay"!==e.defaultView&&M(true,e),e.calendarContainer.classList.add("qs-hidden"),e.onHide(e));}function S(e){e.disabled||(e.calendarContainer.classList.remove("qs-hidden"),"overlay"===e.defaultView&&M(false,e),D(e),e.onShow(e));}function M(e,t){var n=t.calendar,a=n.querySelector(".qs-overlay"),r=a.querySelector(".qs-overlay-year"),i=n.querySelector(".qs-controls"),o=n.querySelector(".qs-squares");e?(a.classList.add("qs-hidden"),i.classList.remove("qs-blur"),o.classList.remove("qs-blur"),r.value=""):(a.classList.remove("qs-hidden"),i.classList.add("qs-blur"),o.classList.add("qs-blur"),r.focus());}function E(e,t,n,a){var r=isNaN(+(new Date).setFullYear(t.value||void 0)),i=r?null:t.value;if(13===e.which||13===e.keyCode||"click"===e.type)a?w(null,n,i,a):r||t.classList.contains("qs-disabled")||w(null,n,i);else if(n.calendar.contains(t)){n.calendar.querySelector(".qs-submit").classList[r?"add":"remove"]("qs-disabled");}}function x(e){return {}.toString.call(e)}function C(e){a.forEach((function(t){t!==e&&q(t);}));}function L(e){if(!e.__qs_shadow_dom){var t=e.which||e.keyCode,n=e.type,r=e.target,o=r.classList,s=a.filter((function(e){return e.calendar.contains(r)||e.el===r}))[0],l=s&&s.calendar.contains(r);if(!(s&&s.isMobile&&s.disableMobile))if("click"===n){if(!s)return a.forEach(q);if(s.disabled)return;var d=s.calendar,c=s.calendarContainer,h=s.disableYearOverlay,f=s.nonInput,v=d.querySelector(".qs-overlay-year"),y=!!d.querySelector(".qs-hidden"),p=d.querySelector(".qs-month-year").contains(r),D=r.dataset.monthNum;if(s.noPosition&&!l)(c.classList.contains("qs-hidden")?S:q)(s);else if(o.contains("qs-arrow"))w(o,s);else if(p||o.contains("qs-close"))h||M(!y,s);else if(D)E(e,v,s,D);else {if(o.contains("qs-disabled"))return;if(o.contains("qs-num")){var b=r.textContent,g=+r.dataset.direction,x=new Date(s.currentYear,s.currentMonth+g,b);if(g){s.currentYear=x.getFullYear(),s.currentMonth=x.getMonth(),s.currentMonthName=i[s.currentMonth],u(s);for(var L,Y=s.calendar.querySelectorAll('[data-direction="0"]'),j=0;!L;){var O=Y[j];O.textContent===b&&(L=O),j++;}r=L;}return void(+x==+s.dateSelected?m(r,s,true):r.classList.contains("qs-disabled")||m(r,s))}o.contains("qs-submit")?E(e,v,s):f&&r===s.el&&(S(s),C(s));}}else if("focusin"===n&&s)S(s),C(s);else if("keydown"===n&&9===t&&s)q(s);else if("keydown"===n&&s&&!s.disabled){var P=!s.calendar.querySelector(".qs-overlay").classList.contains("qs-hidden");13===t&&P&&l?E(e,r,s):27===t&&P&&l&&M(true,s);}else if("input"===n){if(!s||!s.calendar.contains(r))return;var k=s.calendar.querySelector(".qs-submit"),N=r.value.split("").reduce((function(e,t){return e||"0"!==t?e+(t.match(/[0-9]/)?t:""):""}),"").slice(0,4);r.value=N,k.classList[4===N.length?"remove":"add"]("qs-disabled");}}}function Y(e){L(e),e.__qs_shadow_dom=true;}function j(e,t){l.forEach((function(n){e.removeEventListener(n,t);}));}function O(){S(this);}function P(){q(this);}function k(e,t){var n=g(e),a=this.currentYear,r=this.currentMonth,i=this.sibling;if(null==e)return this.dateSelected=void 0,p(this.el,this,true),i&&(y({instance:this,deselect:true}),u(i)),u(this),this;if(!b(e))throw new Error("`setDate` needs a JavaScript Date object.");if(this.disabledDates[+n]||n<this.minDate||n>this.maxDate)throw new Error("You can't manually set a date that's disabled.");this.dateSelected=n,t&&(this.currentYear=n.getFullYear(),this.currentMonth=n.getMonth(),this.currentMonthName=this.months[n.getMonth()]),p(this.el,this),i&&(y({instance:this}),u(i));var o=a===n.getFullYear()&&r===n.getMonth();return o||t?u(this,n):o||u(this,new Date(a,r,1)),this}function N(e){return I(this,e,true)}function _(e){return I(this,e)}function I(e,t,n){var a=e.dateSelected,r=e.first,i=e.sibling,o=e.minDate,s=e.maxDate,l=g(t),d=n?"Min":"Max";function c(){return "original"+d+"Date"}function h(){return d.toLowerCase()+"Date"}function f(){return "set"+d}function v(){throw new Error("Out-of-range date passed to "+f())}if(null==t)e[c()]=void 0,i?(i[c()]=void 0,n?(r&&!a||!r&&!i.dateSelected)&&(e.minDate=void 0,i.minDate=void 0):(r&&!i.dateSelected||!r&&!a)&&(e.maxDate=void 0,i.maxDate=void 0)):e[h()]=void 0;else {if(!b(t))throw new Error("Invalid date passed to "+f());i?((r&&n&&l>(a||s)||r&&!n&&l<(i.dateSelected||o)||!r&&n&&l>(i.dateSelected||s)||!r&&!n&&l<(a||o))&&v(),e[c()]=l,i[c()]=l,(n&&(r&&!a||!r&&!i.dateSelected)||!n&&(r&&!i.dateSelected||!r&&!a))&&(e[h()]=l,i[h()]=l)):((n&&l>(a||s)||!n&&l<(a||o))&&v(),e[h()]=l);}return i&&u(i),u(e),e}function A(){var e=this.first?this:this.sibling,t=e.sibling;return {start:e.dateSelected,end:t.dateSelected}}function R(){var e=this.shadowDom,t=this.positionedEl,n=this.calendarContainer,r=this.sibling,i=this;this.inlinePosition&&(a.some((function(e){return e!==i&&e.positionedEl===t}))||t.style.setProperty("position",null));n.remove(),a=a.filter((function(e){return e!==i})),r&&delete r.sibling,a.length||j(document,L);var o=a.some((function(t){return t.shadowDom===e}));for(var s in e&&!o&&j(e,Y),this)delete this[s];a.length||l.forEach((function(e){document.removeEventListener(e,L);}));}function F(e,t){var n=new Date(e);if(!b(n))throw new Error("Invalid date passed to `navigate`");this.currentYear=n.getFullYear(),this.currentMonth=n.getMonth(),u(this),t&&this.onMonthChange(this);}function B(){var e=!this.calendarContainer.classList.contains("qs-hidden"),t=!this.calendarContainer.querySelector(".qs-overlay").classList.contains("qs-hidden");e&&M(t,this);}t.default=function(e,t){var n=function(e,t){var n,l,d=function(e){var t=c(e);t.events&&(t.events=t.events.reduce((function(e,t){if(!b(t))throw new Error('"options.events" must only contain valid JavaScript Date objects.');return e[+g(t)]=true,e}),{}));["startDate","dateSelected","minDate","maxDate"].forEach((function(e){var n=t[e];if(n&&!b(n))throw new Error('"options.'+e+'" needs to be a valid JavaScript Date object.');t[e]=g(n);}));var n=t.position,i=t.maxDate,l=t.minDate,d=t.dateSelected,u=t.overlayPlaceholder,h=t.overlayButton,f=t.startDay,v=t.id;if(t.startDate=g(t.startDate||d||new Date),t.disabledDates=(t.disabledDates||[]).reduce((function(e,t){var n=+g(t);if(!b(t))throw new Error('You supplied an invalid date to "options.disabledDates".');if(n===+g(d))throw new Error('"disabledDates" cannot contain the same date as "dateSelected".');return e[n]=1,e}),{}),t.hasOwnProperty("id")&&null==v)throw new Error("`id` cannot be `null` or `undefined`");if(null!=v){var m=a.filter((function(e){return e.id===v}));if(m.length>1)throw new Error("Only two datepickers can share an id.");m.length?(t.second=true,t.sibling=m[0]):t.first=true;}var y=["tr","tl","br","bl","c"].some((function(e){return n===e}));if(n&&!y)throw new Error('"options.position" must be one of the following: tl, tr, bl, br, or c.');function p(e){throw new Error('"dateSelected" in options is '+(e?"less":"greater")+' than "'+(e||"max")+'Date".')}if(t.position=function(e){var t=e[0],n=e[1],a={};a[o[t]]=1,n&&(a[o[n]]=1);return a}(n||"bl"),i<l)throw new Error('"maxDate" in options is less than "minDate".');d&&(l>d&&p("min"),i<d&&p());if(["onSelect","onShow","onHide","onMonthChange","formatter","disabler"].forEach((function(e){"function"!=typeof t[e]&&(t[e]=s);})),["customDays","customMonths","customOverlayMonths"].forEach((function(e,n){var a=t[e],r=n?12:7;if(a){if(!Array.isArray(a)||a.length!==r||a.some((function(e){return "string"!=typeof e})))throw new Error('"'+e+'" must be an array with '+r+" strings.");t[n?n<2?"months":"overlayMonths":"days"]=a;}})),f&&f>0&&f<7){var w=(t.customDays||r).slice(),D=w.splice(0,f);t.customDays=w.concat(D),t.startDay=+f,t.weekendIndices=[w.length-1,w.length];}else t.startDay=0,t.weekendIndices=[6,0];"string"!=typeof u&&delete t.overlayPlaceholder;"string"!=typeof h&&delete t.overlayButton;var q=t.defaultView;if(q&&"calendar"!==q&&"overlay"!==q)throw new Error('options.defaultView must either be "calendar" or "overlay".');return t.defaultView=q||"calendar",t}(t||{startDate:g(new Date),position:"bl",defaultView:"calendar"}),u=e;if("string"==typeof u)u="#"===u[0]?document.getElementById(u.slice(1)):document.querySelector(u);else {if("[object ShadowRoot]"===x(u))throw new Error("Using a shadow DOM as your selector is not supported.");for(var h,f=u.parentNode;!h;){var v=x(f);"[object HTMLDocument]"===v?h=true:"[object ShadowRoot]"===v?(h=true,n=f,l=f.host):f=f.parentNode;}}if(!u)throw new Error("No selector / element found.");if(a.some((function(e){return e.el===u})))throw new Error("A datepicker already exists on that element.");var m=u===document.body,y=n?u.parentElement||n:m?document.body:u.parentElement,w=n?u.parentElement||l:y,D=document.createElement("div"),q=document.createElement("div");D.className="qs-datepicker-container qs-hidden",q.className="qs-datepicker";var M={shadowDom:n,customElement:l,positionedEl:w,el:u,parent:y,nonInput:"INPUT"!==u.nodeName,noPosition:m,position:!m&&d.position,startDate:d.startDate,dateSelected:d.dateSelected,disabledDates:d.disabledDates,minDate:d.minDate,maxDate:d.maxDate,noWeekends:!!d.noWeekends,weekendIndices:d.weekendIndices,calendarContainer:D,calendar:q,currentMonth:(d.startDate||d.dateSelected).getMonth(),currentMonthName:(d.months||i)[(d.startDate||d.dateSelected).getMonth()],currentYear:(d.startDate||d.dateSelected).getFullYear(),events:d.events||{},defaultView:d.defaultView,setDate:k,remove:R,setMin:N,setMax:_,show:O,hide:P,navigate:F,toggleOverlay:B,onSelect:d.onSelect,onShow:d.onShow,onHide:d.onHide,onMonthChange:d.onMonthChange,formatter:d.formatter,disabler:d.disabler,months:d.months||i,days:d.customDays||r,startDay:d.startDay,overlayMonths:d.overlayMonths||(d.months||i).map((function(e){return e.slice(0,3)})),overlayPlaceholder:d.overlayPlaceholder||"4-digit year",overlayButton:d.overlayButton||"Submit",disableYearOverlay:!!d.disableYearOverlay,disableMobile:!!d.disableMobile,isMobile:"ontouchstart"in window,alwaysShow:!!d.alwaysShow,id:d.id,showAllDates:!!d.showAllDates,respectDisabledReadOnly:!!d.respectDisabledReadOnly,first:d.first,second:d.second};if(d.sibling){var E=d.sibling,C=M,L=E.minDate||C.minDate,Y=E.maxDate||C.maxDate;C.sibling=E,E.sibling=C,E.minDate=L,E.maxDate=Y,C.minDate=L,C.maxDate=Y,E.originalMinDate=L,E.originalMaxDate=Y,C.originalMinDate=L,C.originalMaxDate=Y,E.getRange=A,C.getRange=A;}d.dateSelected&&p(u,M);var j=getComputedStyle(w).position;m||j&&"static"!==j||(M.inlinePosition=true,w.style.setProperty("position","relative"));var I=a.filter((function(e){return e.positionedEl===M.positionedEl}));I.some((function(e){return e.inlinePosition}))&&(M.inlinePosition=true,I.forEach((function(e){e.inlinePosition=true;})));D.appendChild(q),y.appendChild(D),M.alwaysShow&&S(M);return M}(e,t);if(a.length||d(document),n.shadowDom&&(a.some((function(e){return e.shadowDom===n.shadowDom}))||d(n.shadowDom)),a.push(n),n.second){var l=n.sibling;y({instance:n,deselect:!n.dateSelected}),y({instance:l,deselect:!l.dateSelected}),u(l);}return u(n,n.startDate||n.dateSelected),n.alwaysShow&&D(n),n};}]).default})); 
	} (datepicker_min));
	return datepicker_min.exports;
}

var datepicker_minExports = requireDatepicker_min();
var datepicker = /*@__PURE__*/getDefaultExportFromCjs(datepicker_minExports);

const spwDatePickerCss = () => `@charset "UTF-8";.qs-datepicker-container{font-size:1rem;font-family:sans-serif;color:#000;position:absolute;width:15.625em;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;z-index:9001;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid grey;border-radius:.263921875em;overflow:hidden;background:#fff;-webkit-box-shadow:0 1.25em 1.25em -.9375em rgba(0,0,0,.3);box-shadow:0 1.25em 1.25em -.9375em rgba(0,0,0,.3)}.qs-datepicker-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.qs-centered{position:fixed;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.qs-hidden{display:none}.qs-overlay{position:absolute;top:0;left:0;background:rgba(0,0,0,.75);color:#fff;width:100%;height:100%;padding:.5em;z-index:1;opacity:1;-webkit-transition:opacity .3s;transition:opacity .3s;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.qs-overlay.qs-hidden{opacity:0;z-index:-1}.qs-overlay .qs-overlay-year{background:rgba(0,0,0,0);border:none;border-bottom:1px solid #fff;border-radius:0;color:#fff;font-size:.875em;padding:.25em 0;width:80%;text-align:center;margin:0 auto;display:block}.qs-overlay .qs-overlay-year::-webkit-inner-spin-button{-webkit-appearance:none}.qs-overlay .qs-close{padding:.5em;cursor:pointer;position:absolute;top:0;right:0}.qs-overlay .qs-submit{border:1px solid #fff;border-radius:.263921875em;padding:.5em;margin:0 auto auto;cursor:pointer;background:hsla(0,0%,50.2%,.4)}.qs-overlay .qs-submit.qs-disabled{color:grey;border-color:grey;cursor:not-allowed}.qs-overlay .qs-overlay-month-container{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.qs-overlay .qs-overlay-month{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:calc(100% / 3);cursor:pointer;opacity:.5;-webkit-transition:opacity .15s;transition:opacity .15s}.qs-overlay .qs-overlay-month.active,.qs-overlay .qs-overlay-month:hover{opacity:1}.qs-controls{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;background:#d3d3d3;-webkit-filter:blur(0);filter:blur(0);-webkit-transition:-webkit-filter .3s;transition:-webkit-filter .3s;transition:filter .3s;transition:filter .3s, -webkit-filter .3s}.qs-controls.qs-blur{-webkit-filter:blur(5px);filter:blur(5px)}.qs-arrow{height:1.5625em;width:1.5625em;position:relative;cursor:pointer;border-radius:.263921875em;-webkit-transition:background .15s;transition:background .15s}.qs-arrow:hover.qs-left:after{border-right-color:#000}.qs-arrow:hover.qs-right:after{border-left-color:#000}.qs-arrow:hover{background:rgba(0,0,0,.1)}.qs-arrow:after{content:"";border:.390625em solid rgba(0,0,0,0);position:absolute;top:50%;-webkit-transition:border .2s;transition:border .2s}.qs-arrow.qs-left:after{border-right-color:grey;right:50%;-webkit-transform:translate(25%,-50%);-ms-transform:translate(25%,-50%);transform:translate(25%,-50%)}.qs-arrow.qs-right:after{border-left-color:grey;left:50%;-webkit-transform:translate(-25%,-50%);-ms-transform:translate(-25%,-50%);transform:translate(-25%,-50%)}.qs-month-year{font-weight:700;-webkit-transition:border .2s;transition:border .2s;border-bottom:1px solid rgba(0,0,0,0)}.qs-month-year:not(.qs-disabled-year-overlay){cursor:pointer}.qs-month-year:not(.qs-disabled-year-overlay):hover{border-bottom:1px solid grey}.qs-month-year:active:focus,.qs-month-year:focus{outline:none}.qs-month{padding-right:.5ex}.qs-year{padding-left:.5ex}.qs-squares{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.3125em;-webkit-filter:blur(0);filter:blur(0);-webkit-transition:-webkit-filter .3s;transition:-webkit-filter .3s;transition:filter .3s;transition:filter .3s, -webkit-filter .3s}.qs-squares.qs-blur{-webkit-filter:blur(5px);filter:blur(5px)}.qs-square{width:calc(100% / 7);height:1.5625em;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;-webkit-transition:background .1s;transition:background .1s;border-radius:.263921875em}.qs-square:not(.qs-empty):not(.qs-disabled):not(.qs-day):not(.qs-active):hover{background:orange}.qs-current{font-weight:700;text-decoration:underline}.qs-active,.qs-range-end,.qs-range-start{background:#add8e6}.qs-range-start:not(.qs-range-6){border-top-right-radius:0;border-bottom-right-radius:0}.qs-range-middle{background:#d4ebf2}.qs-range-middle:not(.qs-range-0):not(.qs-range-6){border-radius:0}.qs-range-middle.qs-range-0{border-top-right-radius:0;border-bottom-right-radius:0}.qs-range-end:not(.qs-range-0),.qs-range-middle.qs-range-6{border-top-left-radius:0;border-bottom-left-radius:0}.qs-disabled,.qs-outside-current-month{opacity:.2}.qs-disabled{cursor:not-allowed}.qs-day,.qs-empty{cursor:default}.qs-day{font-weight:700;color:grey}.qs-event{position:relative}.qs-event:after{content:"";position:absolute;width:.46875em;height:.46875em;border-radius:50%;background:#07f;bottom:0;right:0}html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:var(--spw-ds-font-main)}body{margin:0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block;font-family:inherit;--spw-input-height:40px;--spw-input-padding:0 12px;--spw-input-text-align:left;--spw-input-font-size:16px;--spw-input-radius:4px;--spw-input-icon-search-color:var(--spw-color-themes-grey-grey-900);--spw-input-border:var(--spw-color-themes-grey-grey-800)}.qs-datepicker-container .qs-overlay .qs-overlay-year,.spw-date-picker__input{flex:1;width:100%;height:var(--spw-input-height);padding:var(--spw-input-padding);text-overflow:ellipsis;line-height:var(--spw-input-height);border-radius:var(--spw-input-radius);font-size:var(--spw-input-font-size);text-align:var(--spw-input-text-align);border:1px solid var(--spw-input-border)}.qs-datepicker-container .qs-overlay .qs-overlay-year:hover,.spw-date-picker__input:hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.qs-datepicker-container .qs-overlay .qs-overlay-year:focus,.spw-date-picker__input:focus,.qs-datepicker-container .qs-overlay .qs-overlay-year:focus-visible,.spw-date-picker__input:focus-visible{outline:3px solid white;outline-offset:0;box-shadow:0 0 0 6px black}.qs-datepicker-container .qs-overlay .qs-overlay-year:active,.spw-date-picker__input:active{border-color:var(--spw-input-border)}.spw-date-picker{position:relative}.spw-date-picker__field-message{margin-bottom:8px;margin-top:-4px}.spw-date-picker__input-container{position:relative;display:flex;align-items:center}.spw-date-picker--is-clear .spw-date-picker__input{padding-right:70px}.spw-date-picker__input--error{border-color:var(--spw-color-error, #dc2626)}.spw-date-picker__input--error:focus{border-color:var(--spw-color-error, #dc2626);box-shadow:0 0 0 3px var(--spw-color-error-light, rgba(220, 38, 38, 0.1))}.spw-date-picker__input--disabled{border-color:var(--spw-color-themes-grey-grey-400);background:var(--spw-color-themes-grey-grey-100);color:var(--spw-color-themes-grey-grey-500);cursor:not-allowed}.spw-date-picker__input--disabled::placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-date-picker__input--disabled:hover,.spw-date-picker__input--disabled:focus,.spw-date-picker__input--disabled:focus-visible{outline:none}.spw-date-picker__input--open{outline:3px solid white;outline-offset:0;box-shadow:0 0 0 6px black}.spw-date-picker__input::placeholder{color:var(--spw-color-text-placeholder, #9ca3af)}.spw-date-picker__icons{display:flex;align-items:center;position:absolute;top:50%;right:12px;gap:8px;transform:translateY(-50%)}.spw-date-picker--disabled .spw-date-picker__icons{pointer-events:none}.spw-date-picker__clear{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;cursor:pointer;padding:2px;font-size:16px;transition:all 0.2s ease-in}.spw-date-picker--disabled .spw-date-picker__clear{border-color:var(--spw-color-themes-grey-grey-500)}.spw-date-picker__icon{color:var(--spw-input-icon-search-color)}.spw-date-picker--disabled .spw-date-picker__icon{color:var(--spw-color-themes-grey-grey-500)}.spw-date-picker__icon--calendar{font-size:16px;cursor:pointer;color:var(--spw-color-themes-grey-grey-900)}.spw-date-picker__icon--clear{color:var(--spw-color-themes-grey-grey-900);font-size:16px}.spw-date-picker__icon--clear:hover{color:var(--spw-ds-primary)}.spw-date-picker__help{margin-top:0.25rem;font-size:0.75rem;line-height:1rem;color:var(--spw-color-text-secondary, #6b7280)}.spw-date-picker__error{display:flex;align-items:center;margin-top:0.25rem;font-size:0.75rem;line-height:1rem;color:var(--spw-color-error, #dc2626)}.spw-date-picker__error spw-icon{margin-right:0.25rem;font-size:0.75rem}.qs-datepicker-container{box-shadow:var(--spw-effect-elevation-6);border:none;width:320px;margin-top:6px}.qs-datepicker-container .qs-controls{padding:24px;padding-bottom:0;background:none;margin-bottom:16px;position:relative}.qs-datepicker-container .qs-month-year{font-size:14px;border:1px solid var(--spw-colors-support-grey-grey-300);border-radius:6px;padding:8px 16px}.qs-datepicker-container .qs-month-year:hover{border-color:var(--spw-colors-support-grey-grey-800)}.qs-datepicker-container .qs-arrow{position:absolute;top:24px;width:36px;height:36px;color:transparent}.qs-datepicker-container .qs-arrow:before{content:"";width:100%;height:100%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);font-family:var(--spw-ds-font-icons-solid);font-weight:700;font-size:16px;display:inline-flex;justify-content:center;align-items:center;color:var(--spw-colors-support-grey-grey-800)}.qs-datepicker-container .qs-arrow:after{display:none}.qs-datepicker-container .qs-arrow:hover{background:var(--spw-colors-support-grey-grey-200)}.qs-datepicker-container .qs-arrow:active{background:var(--spw-colors-support-grey-grey-300)}.qs-datepicker-container .qs-left{right:60px}.qs-datepicker-container .qs-left:before{content:"\\f053"}.qs-datepicker-container .qs-right{right:24px}.qs-datepicker-container .qs-right:before{content:"\\f054"}.qs-datepicker-container .qs-squares{padding:24px;padding-top:0;gap:4px 0}.qs-datepicker-container .qs-square{font-size:14px;text-transform:lowercase;height:36px}.qs-datepicker-container .qs-square:not(.qs-empty):not(.qs-disabled):not(.qs-day):not(.qs-active):hover{background:var(--spw-colors-support-grey-grey-400)}.qs-datepicker-container .qs-range-end:hover,.qs-datepicker-container .qr-range-start:hover{background:var(--spw-colors-support-grey-grey-800)}.qs-datepicker-container .qs-active,.qs-datepicker-container .qs-range-end,.qs-datepicker-container .qs-range-start,.qs-datepicker-container .qs-range-start.qs-disabled{background:var(--spw-colors-support-grey-grey-900);color:white;opacity:1}.qs-datepicker-container .qs-range-middle{background:var(--spw-colors-support-grey-grey-300)}.qs-datepicker-container .spw-date-range-start{background:var(--spw-colors-support-grey-grey-900) !important;color:white !important;opacity:1 !important;font-weight:700;border-radius:4px 0 0 4px !important}.qs-datepicker-container .spw-date-range-start:hover{background:var(--spw-colors-support-grey-grey-800) !important}.qs-datepicker-container .spw-date-range-end{background:var(--spw-colors-support-grey-grey-900) !important;color:white !important;opacity:1 !important;font-weight:700;border-radius:0 4px 4px 0 !important}.qs-datepicker-container .spw-date-range-end:hover{background:var(--spw-colors-support-grey-grey-800) !important}.qs-datepicker-container .spw-date-range-middle{background:var(--spw-colors-support-grey-grey-300) !important;border-radius:0 !important}.qs-datepicker-container .spw-date-range-middle:hover{background:var(--spw-colors-support-grey-grey-400) !important}.qs-datepicker-container .qs-day{font-weight:400;color:var(--spw-colors-support-grey-grey-800);padding-bottom:12px;border-radius:0;position:relative}.qs-datepicker-container .qs-day:after{content:"";position:absolute;bottom:0;left:0;width:68px;height:1px;background:var(--spw-colors-support-grey-grey-300)}.qs-datepicker-container .qs-day:nth-child(7):after{display:none}.qs-datepicker-container .qs-overlay{padding:24px;background:#fff}.qs-datepicker-container .qs-overlay-month{font-size:14px;color:var(--spw-colors-support-grey-grey-800);width:25%}.qs-datepicker-container .qs-close{color:var(--spw-colors-support-grey-grey-600);top:24px;left:24px;right:auto;padding:0;height:40px;width:32px;text-indent:-9999px;transition:all ease-in 0.2s}.qs-datepicker-container .qs-close:after{position:absolute;top:50%;transform:translateY(-50%);left:0;font-family:var(--spw-ds-font-icons-solid);font-weight:700;content:"\\f060";font-size:14px;text-indent:0}.qs-datepicker-container .qs-close:hover{color:var(--spw-colors-support-grey-grey-900)}.qs-datepicker-container .qs-blur{filter:none}.qs-datepicker-container .qs-overlay{transition:none}.qs-datepicker-container .qs-overlay .qs-overlay-year{color:var(--spw-colors-support-grey-grey-900);margin-bottom:24px;width:calc(100% - 80px);margin-left:28px}.qs-datepicker-container .qs-submit{position:absolute;text-indent:-9999px;top:24px;right:24px;width:40px;height:40px;border-radius:9999px;border:2px solid transparent;color:white;background:var(--spw-ds-primary);font-weight:700;font-size:14px;transition:all ease-in 0.2s}.qs-datepicker-container .qs-submit:after{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);font-family:var(--spw-ds-font-icons-solid);font-weight:700;content:"\\f00c";font-size:14px;text-indent:0}.qs-datepicker-container .qs-submit:hover{background:var(--spw-ds-variant)}.qs-datepicker-container .qs-submit:active{background:var(--spw-ds-active)}.qs-datepicker-container .qs-submit.qs-disabled{background:var(--spw-colors-support-grey-grey-400);border-color:var(--spw-colors-support-grey-grey-400);color:var(--spw-colors-support-grey-grey-500);opacity:1}`;

const SpwDatePicker = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.dateChange = createEvent(this, "dateChange", 7);
        this.datePickerOpen = createEvent(this, "datePickerOpen", 7);
        this.datePickerClose = createEvent(this, "datePickerClose", 7);
        if (hostRef.$hostElement$["s-ei"]) {
            this.internals = hostRef.$hostElement$["s-ei"];
        }
        else {
            this.internals = hostRef.$hostElement$.attachInternals();
            hostRef.$hostElement$["s-ei"] = this.internals;
        }
        /** Placeholder du champ de saisie */
        this.placeholder = 'JJ/MM/AAAA';
        /** Indique si le champ est requis */
        this.required = false;
        /** Indique si le champ est désactivé */
        this.disabled = false;
        /** Format de date à afficher */
        this.dateFormat = 'dd/MM/yyyy';
        /** Jours de la semaine désactivés (0=dimanche, 1=lundi, etc.) */
        this.disabledDays = [];
        /** Dates spécifiques désactivées (format ISO, ex: ["2026-01-01", "2026-12-25"]) */
        this.disabledDates = [];
        /** Position du datepicker */
        this.position = 'bl';
        /** Message d'erreur à afficher sous le champ */
        this.error = '';
        /** Message d'indication (hint) à afficher sous le champ */
        this.hint = '';
        /** Message de succès à afficher sous le champ */
        this.success = '';
        /** Message de warning à afficher sous le champ */
        this.warning = '';
        /** Affiche une icône d'erreur si vrai */
        this.showErrorIcon = true;
        /** Affiche une icône d'indication si vrai */
        this.showHintIcon = true;
        /** Affiche une icône de succès si vrai */
        this.showSuccessIcon = true;
        /** Affiche une icône de warning si vrai */
        this.showWarningIcon = true;
        /** Indique si le champ peut être effacé avec un bouton */
        this.isClear = false;
        /** Positionnement du tooltip */
        this.tooltipDirection = 'top';
        /** Curseur du tooltip */
        this.tooltipCursor = 'help';
        /** Si vrai, permet de définir un range de dates */
        this.range = false;
        /** Permet de définir l'input de début pour un range */
        this.isStart = false;
        /** Utilise un positionnement fixed pour le calendrier si nécessité de sortir du contexte (utile dans une modal avec overflow hidden) */
        this.fixedCalendar = false;
        this.isOpen = false;
        this.hasError = false;
        this.internalValue = '';
        this.isClearIconVisible = false;
        this.lastInputValue = '';
        this.isDeleting = false;
        this.parentScrollContainer = null;
        this.updateCalendarPosition = () => {
            var _a;
            if (!this.fixedCalendar || !((_a = this.datepickerInstance) === null || _a === void 0 ? void 0 : _a.calendarContainer) || !this.inputElement)
                return;
            const inputRect = this.inputElement.getBoundingClientRect();
            const calendarEl = this.datepickerInstance.calendarContainer;
            const calendarHeight = calendarEl.offsetHeight || 320;
            const viewportHeight = window.innerHeight;
            // Déterminer si on ouvre vers le haut ou le bas
            const spaceBelow = viewportHeight - inputRect.bottom;
            const spaceAbove = inputRect.top;
            const openAbove = spaceBelow < calendarHeight && spaceAbove > spaceBelow;
            let top;
            if (openAbove) {
                top = inputRect.top - calendarHeight - 6;
            }
            else {
                top = inputRect.bottom + 6;
            }
            // Positionner horizontalement selon la prop position
            let left;
            if (this.position === 'tr' || this.position === 'br') {
                left = inputRect.right - calendarEl.offsetWidth;
            }
            else {
                left = inputRect.left;
            }
            calendarEl.style.position = 'fixed';
            calendarEl.style.top = `${top}px`;
            calendarEl.style.left = `${left}px`;
            calendarEl.style.zIndex = '9999';
        };
        this.handleMaskedInput = (event) => {
            const target = event.target;
            const newValue = target.value;
            const cursorPosition = target.selectionStart || 0;
            this.isDeleting = newValue.length < this.lastInputValue.length;
            if (this.isDeleting) {
                this.internalValue = newValue;
                target.value = newValue;
                this.lastInputValue = newValue;
                setTimeout(() => {
                    if (this.inputElement) {
                        this.inputElement.setSelectionRange(cursorPosition, cursorPosition);
                    }
                }, 0);
            }
            else {
                const oldDigitCount = this.unmask(this.lastInputValue).length;
                const maskedValue = this.applyMaskSmart(newValue);
                const newDigitCount = this.unmask(maskedValue).length;
                this.internalValue = maskedValue;
                target.value = maskedValue;
                this.lastInputValue = maskedValue;
                setTimeout(() => {
                    if (this.inputElement) {
                        let newCursorPos = cursorPosition;
                        if (newDigitCount > oldDigitCount) {
                            if ((newDigitCount === 3 && oldDigitCount === 2) || (newDigitCount === 5 && oldDigitCount === 4)) {
                                newCursorPos = cursorPosition + 1;
                            }
                        }
                        newCursorPos = Math.min(newCursorPos, maskedValue.length);
                        this.inputElement.setSelectionRange(newCursorPos, newCursorPos);
                    }
                }, 0);
            }
            const digits = this.unmask(this.internalValue);
            if (digits.length === 8) {
                const parsedDate = this.parseDate(this.internalValue);
                if (parsedDate && !isNaN(parsedDate.getTime())) {
                    const isoString = this.toISODateString(parsedDate);
                    this.value = isoString;
                    this.internals.setFormValue(isoString);
                    this.isClearIconVisible = this.isClear && !!isoString;
                    const dateWithTime = new Date(isoString);
                    this.dateChange.emit({ value: isoString, date: dateWithTime });
                    if (this.datepickerInstance) {
                        this.datepickerInstance.setDate(parsedDate, true);
                    }
                }
            }
            else if (!this.internalValue) {
                this.value = '';
                this.internals.setFormValue(null);
                this.isClearIconVisible = false;
                this.dateChange.emit({ value: '', date: null });
                if (this.datepickerInstance) {
                    this.datepickerInstance.setDate(undefined, true);
                }
            }
        };
        this.handleInputChange = (event) => {
            this.handleMaskedInput(event);
        };
        this.handleInputFocus = () => {
            if (this.disabled)
                return;
            if (!this.datepickerInstance) {
                this.initializeDatepicker();
            }
            if (this.datepickerInstance && typeof this.datepickerInstance.show === 'function') {
                try {
                    this.datepickerInstance.show();
                }
                catch (error) {
                    console.warn("Erreur lors de l'ouverture du datepicker, réinitialisation...", error);
                    this.datepickerInstance = null;
                    this.initializeDatepicker();
                    if (this.datepickerInstance && typeof this.datepickerInstance.show === 'function') {
                        this.datepickerInstance.show();
                    }
                }
            }
        };
        this.handleClear = () => {
            this.resetInput();
        };
        this.handleCalendarIconClick = (ev) => {
            var _a, _b;
            ev.stopPropagation();
            if (this.disabled)
                return;
            if (this.isOpen) {
                (_a = this.datepickerInstance) === null || _a === void 0 ? void 0 : _a.hide();
            }
            else {
                if (!this.datepickerInstance) {
                    this.initializeDatepicker();
                }
                (_b = this.datepickerInstance) === null || _b === void 0 ? void 0 : _b.show();
            }
        };
        this.handleCalendarIconMouseDown = (ev) => {
            ev.preventDefault();
        };
        this.handleKeyDown = (ev) => {
            const target = ev.target;
            const isInputFocused = target === this.inputElement;
            const isCalendarFocused = target.closest('.qs-datepicker') !== null;
            if (isInputFocused) {
                switch (ev.key) {
                    case 'Tab':
                        if (!ev.shiftKey && this.isOpen) {
                            ev.preventDefault();
                            ev.stopPropagation();
                            setTimeout(() => {
                                var _a;
                                const calendarEl = (_a = this.datepickerInstance) === null || _a === void 0 ? void 0 : _a.calendarContainer;
                                if (calendarEl) {
                                    const focusableEls = [
                                        ...Array.from(calendarEl.querySelectorAll('.qs-arrow')),
                                        calendarEl.querySelector('.qs-month-year'),
                                        ...Array.from(calendarEl.querySelectorAll('.qs-square:not(.qs-day):not(.qs-empty)')),
                                    ].filter(Boolean);
                                    if (focusableEls[0]) {
                                        focusableEls[0].focus();
                                    }
                                }
                            }, 0);
                        }
                        break;
                    case 'Enter':
                        if (this.isOpen) {
                            ev.preventDefault();
                            this.datepickerInstance.hide();
                            this.inputElement.blur();
                        }
                        break;
                    case 'Escape':
                        if (this.isOpen) {
                            ev.preventDefault();
                            this.datepickerInstance.hide();
                            this.inputElement.focus();
                        }
                        break;
                }
            }
            else if (isCalendarFocused) {
                switch (ev.key) {
                    case 'Escape':
                        ev.preventDefault();
                        this.datepickerInstance.hide();
                        this.inputElement.focus();
                        break;
                    case 'Tab':
                        if (ev.shiftKey) {
                            ev.preventDefault();
                            this.inputElement.focus();
                        }
                        break;
                }
            }
        };
    }
    componentWillLoad() {
        this.uniqueId = `spw-date-picker-${Math.random().toString(36).substr(2, 9)}`;
        if (typeof this.disabledDays === 'string') {
            try {
                const parsed = JSON.parse(this.disabledDays);
                if (Array.isArray(parsed) && parsed.every(val => typeof val === 'number')) {
                    this.disabledDays = parsed;
                }
                else {
                    this.disabledDays = [];
                }
            }
            catch (_a) {
                this.disabledDays = [];
            }
        }
        if (typeof this.disabledDates === 'string') {
            try {
                const parsed = JSON.parse(this.disabledDates);
                if (Array.isArray(parsed) && parsed.every(val => typeof val === 'string')) {
                    this.disabledDates = parsed;
                }
                else {
                    this.disabledDates = [];
                }
            }
            catch (_b) {
                this.disabledDates = [];
            }
        }
        const start = this.value ? this.formatDate(new Date(this.value)) : '';
        this.internalValue = start;
        this.lastInputValue = this.internalValue;
        this.defaultValue = this.value;
        this.isClearIconVisible = this.isClear && !!this.value;
    }
    componentDidLoad() {
        var _a;
        this.initializeDatepicker();
        if (this.value) {
            const initialDate = new Date(this.value);
            if (!isNaN(initialDate.getTime())) {
                (_a = this.datepickerInstance) === null || _a === void 0 ? void 0 : _a.setDate(initialDate, true);
                if (this.inputElement) {
                    this.inputElement.value = this.formatDate(initialDate);
                    this.internalValue = this.formatDate(initialDate);
                }
            }
        }
        this.internals.setFormValue(this.value ? this.value : null);
    }
    connectedCallback() {
        if (!this.datepickerInstance && this.inputElement) {
            requestAnimationFrame(() => {
                this.initializeDatepicker();
            });
        }
        if (this.fixedCalendar) {
            window.addEventListener('scroll', this.updateCalendarPosition, true);
            window.addEventListener('resize', this.updateCalendarPosition);
        }
    }
    disconnectedCallback() {
        if (this.datepickerInstance && typeof this.datepickerInstance.remove === 'function') {
            setTimeout(() => {
                if (!this.el.isConnected && this.datepickerInstance) {
                    this.datepickerInstance.remove();
                    this.datepickerInstance = null;
                }
            }, 100);
        }
        if (this.fixedCalendar) {
            window.removeEventListener('scroll', this.updateCalendarPosition, true);
            window.removeEventListener('resize', this.updateCalendarPosition);
            this.cleanupParentScrollListener();
        }
    }
    findParentComponent() {
        if (!this.fixedCalendarParent)
            return null;
        let current = this.el;
        while (current) {
            if (current instanceof HTMLElement && current.tagName.toLowerCase() === this.fixedCalendarParent.toLowerCase()) {
                return current;
            }
            if (current.parentElement) {
                current = current.parentElement;
            }
            else {
                const rootNode = current.getRootNode();
                if (rootNode instanceof ShadowRoot) {
                    current = rootNode.host;
                }
                else {
                    break;
                }
            }
        }
        return null;
    }
    findScrollContainerInShadowRoot(parent) {
        const shadowRoot = parent.shadowRoot;
        if (!shadowRoot)
            return null;
        const elements = shadowRoot.querySelectorAll('*');
        let deepestScrollContainer = null;
        let maxDepth = -1;
        for (const el of Array.from(elements)) {
            const htmlEl = el;
            const style = window.getComputedStyle(htmlEl);
            const hasOverflow = style.overflow === 'auto' || style.overflow === 'scroll' || style.overflowY === 'auto' || style.overflowY === 'scroll';
            if (hasOverflow) {
                let depth = 0;
                let node = el;
                while (node && node !== shadowRoot) {
                    depth++;
                    node = node.parentNode;
                }
                if (depth > maxDepth) {
                    maxDepth = depth;
                    deepestScrollContainer = htmlEl;
                }
            }
        }
        return deepestScrollContainer;
    }
    ensureParentScrollListener() {
        if (!this.fixedCalendarParent || !this.fixedCalendar)
            return;
        if (this.parentScrollContainer)
            return;
        const parentComponent = this.findParentComponent();
        if (parentComponent) {
            this.parentScrollContainer = this.findScrollContainerInShadowRoot(parentComponent);
            if (this.parentScrollContainer) {
                this.parentScrollContainer.addEventListener('scroll', this.updateCalendarPosition);
            }
        }
    }
    cleanupParentScrollListener() {
        if (this.parentScrollContainer) {
            this.parentScrollContainer.removeEventListener('scroll', this.updateCalendarPosition);
            this.parentScrollContainer = null;
        }
    }
    watchValue(newValue) {
        if (this.datepickerInstance && newValue) {
            const date = new Date(newValue);
            if (!isNaN(date.getTime())) {
                this.datepickerInstance.setDate(date, true);
                const formattedDate = this.formatDate(date);
                this.inputElement.value = formattedDate;
                this.internalValue = formattedDate;
                this.lastInputValue = formattedDate;
            }
        }
        else if (this.datepickerInstance) {
            this.datepickerInstance.setDate(undefined, true);
            this.inputElement.value = '';
            this.internalValue = '';
            this.lastInputValue = '';
        }
        this.internals.setFormValue(newValue ? newValue : null);
        this.isClearIconVisible = this.isClear && !!newValue;
        this.updateRangeConstraints();
    }
    watchDisabled(isDisabled) {
        if (this.inputElement) {
            this.inputElement.disabled = isDisabled;
        }
    }
    watchMinDate(newMinDate) {
        if (this.datepickerInstance && newMinDate) {
            this.datepickerInstance.setMin(new Date(newMinDate));
        }
        else if (this.datepickerInstance) {
            this.datepickerInstance.setMin(undefined);
        }
    }
    watchMaxDate(newMaxDate) {
        if (this.datepickerInstance && newMaxDate) {
            this.datepickerInstance.setMax(new Date(newMaxDate));
        }
        else if (this.datepickerInstance) {
            this.datepickerInstance.setMax(undefined);
        }
    }
    /** Méthode pour ouvrir le datepicker */
    async open() {
        if (this.datepickerInstance) {
            this.datepickerInstance.show();
        }
    }
    /** Méthode pour fermer le datepicker */
    async close() {
        if (this.datepickerInstance) {
            this.datepickerInstance.hide();
        }
    }
    /** Méthode pour définir la date */
    async setDate(date) {
        if (this.datepickerInstance) {
            const dateObj = typeof date === 'string' ? new Date(date) : date;
            this.datepickerInstance.setDate(dateObj, true);
        }
    }
    /** Méthode pour récupérer la date */
    async getDate() {
        return this.datepickerInstance ? this.datepickerInstance.dateSelected : null;
    }
    /** Méthode pour récupérer le range de dates */
    async getRange() {
        if (!this.range || !this.rangeId) {
            return { start: null, end: null };
        }
        const { start, end } = this.getRangeSiblings();
        const startDate = (start === null || start === void 0 ? void 0 : start.value) ? new Date(start.value) : null;
        const endDate = (end === null || end === void 0 ? void 0 : end.value) ? new Date(end.value) : null;
        return {
            start: startDate && !isNaN(startDate.getTime()) ? startDate : null,
            end: endDate && !isNaN(endDate.getTime()) ? endDate : null,
        };
    }
    /** Méthode pour mettre à jour les contraintes min/max du datepicker */
    async updateConstraints(minDate, maxDate) {
        if (!this.datepickerInstance)
            return;
        if (minDate !== undefined) {
            if (typeof this.datepickerInstance.setMin === 'function') {
                this.datepickerInstance.setMin(minDate);
            }
            else {
                this.datepickerInstance.minDate = minDate;
            }
        }
        if (maxDate !== undefined) {
            if (typeof this.datepickerInstance.setMax === 'function') {
                this.datepickerInstance.setMax(maxDate);
            }
            else {
                this.datepickerInstance.maxDate = maxDate;
            }
        }
        if (this.isOpen && this.datepickerInstance.calendar) {
            this.datepickerInstance.hide();
            setTimeout(() => {
                this.datepickerInstance.show();
            }, 0);
        }
    }
    /** Méthode pour réinitialiser le datepicker */
    async resetInput() {
        this.value = '';
        this.internalValue = '';
        this.lastInputValue = '';
        this.internals.setFormValue(null);
        this.isClearIconVisible = false;
        if (this.inputElement) {
            this.inputElement.value = '';
        }
        if (this.datepickerInstance) {
            this.datepickerInstance.setDate(undefined, true);
        }
        this.dateChange.emit({ value: '', date: null });
        this.updateRangeConstraints();
    }
    /** Méthode pour réinitialiser les contraintes min/max du datepicker */
    async resetConstraints() {
        if (!this.datepickerInstance)
            return;
        if (typeof this.datepickerInstance.setMin === 'function') {
            this.datepickerInstance.setMin(this.minDate ? new Date(this.minDate) : undefined);
        }
        else {
            this.datepickerInstance.minDate = this.minDate ? new Date(this.minDate) : undefined;
        }
        if (typeof this.datepickerInstance.setMax === 'function') {
            this.datepickerInstance.setMax(this.maxDate ? new Date(this.maxDate) : undefined);
        }
        else {
            this.datepickerInstance.maxDate = this.maxDate ? new Date(this.maxDate) : undefined;
        }
        if (this.isOpen && this.datepickerInstance.calendar) {
            this.datepickerInstance.hide();
            setTimeout(() => {
                this.datepickerInstance.show();
            }, 0);
        }
    }
    toISODateString(date) {
        const year = date.getFullYear();
        const month = `${date.getMonth() + 1}`.padStart(2, '0');
        const day = `${date.getDate()}`.padStart(2, '0');
        if (this.range && !this.isStart) {
            return `${year}-${month}-${day}T23:59:59`;
        }
        return `${year}-${month}-${day}T00:00:00`;
    }
    getRangeSiblings() {
        if (!this.range || !this.rangeId)
            return { start: null, end: null };
        const selector = `spw-date-picker[range][range-id="${this.rangeId}"]`;
        const siblings = Array.from(document.querySelectorAll(selector));
        let start = null;
        let end = null;
        siblings.forEach(pickerEl => {
            if (pickerEl.hasAttribute('is-start')) {
                start = pickerEl;
            }
            else {
                end = pickerEl;
            }
        });
        return { start, end };
    }
    highlightRangeInCalendar() {
        var _a;
        if (!this.range || !this.rangeId || !((_a = this.datepickerInstance) === null || _a === void 0 ? void 0 : _a.calendar))
            return;
        const { start, end } = this.getRangeSiblings();
        if (!start || !end)
            return;
        const startValue = start.value;
        const endValue = end.value;
        if (!startValue || !endValue) {
            const allDates = this.datepickerInstance.calendar.querySelectorAll('.qs-square');
            allDates.forEach((dateEl) => {
                dateEl.classList.remove('spw-date-range-start', 'spw-date-range-end', 'spw-date-range-middle');
            });
            return;
        }
        const startDate = new Date(startValue);
        const endDate = new Date(endValue);
        if (isNaN(startDate.getTime()) || isNaN(endDate.getTime()))
            return;
        const allDates = this.datepickerInstance.calendar.querySelectorAll('.qs-square:not(.qs-empty)');
        allDates.forEach((dateEl) => {
            const dateNum = parseInt(dateEl.textContent || '0', 10);
            if (!dateNum)
                return;
            const currentMonth = this.datepickerInstance.currentMonth;
            const currentYear = this.datepickerInstance.currentYear;
            const cellDate = new Date(currentYear, currentMonth, dateNum);
            const cellDateOnly = new Date(cellDate.getFullYear(), cellDate.getMonth(), cellDate.getDate());
            const startDateOnly = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
            const endDateOnly = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
            if (cellDateOnly >= startDateOnly && cellDateOnly <= endDateOnly) {
                if (cellDateOnly.getTime() === startDateOnly.getTime()) {
                    dateEl.classList.add('spw-date-range-start');
                    dateEl.classList.remove('spw-date-range-middle', 'spw-date-range-end');
                }
                else if (cellDateOnly.getTime() === endDateOnly.getTime()) {
                    dateEl.classList.add('spw-date-range-end');
                    dateEl.classList.remove('spw-date-range-middle', 'spw-date-range-start');
                }
                else {
                    dateEl.classList.add('spw-date-range-middle');
                    dateEl.classList.remove('spw-date-range-start', 'spw-date-range-end');
                }
            }
            else {
                dateEl.classList.remove('spw-date-range-start', 'spw-date-range-end', 'spw-date-range-middle');
            }
        });
    }
    async updateRangeConstraints() {
        var _a, _b;
        if (!this.range || !this.rangeId)
            return;
        const { start, end } = this.getRangeSiblings();
        if (this.isStart && end) {
            await ((_a = end.componentOnReady) === null || _a === void 0 ? void 0 : _a.call(end));
            const startDate = this.value ? new Date(this.value) : null;
            if (startDate && !isNaN(startDate.getTime())) {
                await end.updateConstraints(startDate, undefined);
            }
            else {
                const endMinDate = end.minDate ? new Date(end.minDate) : undefined;
                await end.updateConstraints(endMinDate, undefined);
            }
        }
        if (!this.isStart && start) {
            await ((_b = start.componentOnReady) === null || _b === void 0 ? void 0 : _b.call(start));
            const endDate = this.value ? new Date(this.value) : null;
            if (endDate && !isNaN(endDate.getTime())) {
                await start.updateConstraints(undefined, endDate);
            }
            else {
                const startMaxDate = start.maxDate ? new Date(start.maxDate) : undefined;
                await start.updateConstraints(undefined, startMaxDate);
            }
        }
    }
    unmask(value) {
        return value ? value.replace(/[^0-9]/g, '') : '';
    }
    applyMaskSmart(value) {
        if (!value)
            return '';
        const digits = this.unmask(value);
        let result = '';
        for (let i = 0; i < digits.length && i < 8; i++) {
            if (i === 2 || i === 4) {
                result += '/';
            }
            result += digits[i];
        }
        return result;
    }
    setupCalendarNavigation() {
        if (!this.datepickerInstance)
            return;
        const calendarEl = this.datepickerInstance.calendarContainer;
        if (!calendarEl)
            return;
        const focusableEls = [
            ...Array.from(calendarEl.querySelectorAll('.qs-arrow')),
            calendarEl.querySelector('.qs-month-year'),
            ...Array.from(calendarEl.querySelectorAll('.qs-square:not(.qs-day):not(.qs-empty)')),
        ].filter(Boolean);
        focusableEls.forEach((el) => {
            el.setAttribute('tabindex', '0');
            el.addEventListener('keydown', (e) => {
                this.handleCalendarKeyDown(e, el, focusableEls);
            });
            // if (el.classList.contains('qs-square')) {
            //   el.addEventListener('click', () => {
            //     setTimeout(() => this.inputElement.focus(), 100);
            //   });
            // }
        });
    }
    handleCalendarKeyDown(e, currentElement, focusableEls) {
        const currentIndex = focusableEls.indexOf(currentElement);
        let newIndex = currentIndex;
        switch (e.key) {
            case 'ArrowRight':
                e.preventDefault();
                newIndex = Math.min(currentIndex + 1, focusableEls.length - 1);
                break;
            case 'ArrowLeft':
                e.preventDefault();
                newIndex = Math.max(currentIndex - 1, 0);
                break;
            case 'ArrowDown':
                e.preventDefault();
                newIndex = currentElement.classList.contains('qs-square') ? Math.min(currentIndex + 7, focusableEls.length - 1) : Math.min(currentIndex + 1, focusableEls.length - 1);
                break;
            case 'ArrowUp':
                e.preventDefault();
                newIndex = currentElement.classList.contains('qs-square') ? Math.max(currentIndex - 7, 0) : Math.max(currentIndex - 1, 0);
                break;
            case 'Home':
                e.preventDefault();
                newIndex = 0;
                break;
            case 'End':
                e.preventDefault();
                newIndex = focusableEls.length - 1;
                break;
            case 'Enter':
            case ' ':
                e.preventDefault();
                if (currentElement.classList.contains('qs-arrow')) {
                    currentElement.click();
                    setTimeout(() => currentElement.focus(), 0);
                }
                else {
                    currentElement.click();
                }
                return;
            case 'Escape':
                e.preventDefault();
                this.datepickerInstance.hide();
                this.inputElement.focus();
                return;
        }
        if (newIndex !== currentIndex) {
            const newElement = focusableEls[newIndex];
            if (newElement && !newElement.matches('.qs-day, .qs-disabled, .qs-empty')) {
                newElement.focus();
            }
        }
    }
    initializeDatepicker() {
        var _a;
        if (!this.inputElement) {
            const shadowInput = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input[type="text"]');
            if (shadowInput) {
                this.inputElement = shadowInput;
            }
            else {
                return;
            }
        }
        const options = {
            position: this.position,
            startDay: 1,
            customDays: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
            customMonths: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
            overlayPlaceholder: 'Année',
            overlayButton: 'Valider',
            formatter: (input, date) => {
                const formattedDate = this.formatDate(date);
                input.value = formattedDate;
                this.internalValue = formattedDate;
                this.lastInputValue = formattedDate;
            },
            disabler: (date) => {
                const disabledDays = this.disabledDays;
                if (disabledDays.includes(date.getDay()))
                    return true;
                const dateStr = date.toISOString().split('T')[0];
                const disabledDates = this.disabledDates;
                return disabledDates.includes(dateStr);
            },
            onSelect: (selectedDateOrInstance) => {
                const selectedDate = selectedDateOrInstance instanceof Date ? selectedDateOrInstance : selectedDateOrInstance === null || selectedDateOrInstance === void 0 ? void 0 : selectedDateOrInstance.dateSelected;
                if (!selectedDate || isNaN(selectedDate.getTime()))
                    return;
                const isoString = this.toISODateString(selectedDate);
                this.value = isoString;
                const formattedDate = this.formatDate(selectedDate);
                this.inputElement.value = formattedDate;
                this.internalValue = formattedDate;
                this.lastInputValue = formattedDate;
                this.internals.setFormValue(isoString);
                this.isClearIconVisible = this.isClear && !!isoString;
                const dateWithTime = new Date(isoString);
                this.dateChange.emit({ value: isoString, date: dateWithTime });
                this.updateRangeConstraints();
                setTimeout(() => {
                    var _a, _b;
                    this.highlightRangeInCalendar();
                    const { start, end } = this.getRangeSiblings();
                    const sibling = this.isStart ? end : start;
                    if (sibling && sibling.isOpen) {
                        (_b = (_a = sibling).highlightRangeInCalendar) === null || _b === void 0 ? void 0 : _b.call(_a);
                    }
                }, 50);
            },
            onShow: () => {
                this.isOpen = true;
                this.datePickerOpen.emit();
                if (this.fixedCalendar) {
                    this.ensureParentScrollListener();
                    requestAnimationFrame(() => {
                        this.updateCalendarPosition();
                    });
                }
                setTimeout(() => {
                    this.setupCalendarNavigation();
                    this.highlightRangeInCalendar();
                    setTimeout(() => this.highlightRangeInCalendar(), 50);
                    setTimeout(() => this.highlightRangeInCalendar(), 150);
                }, 100);
            },
            onHide: () => {
                this.isOpen = false;
                this.datePickerClose.emit();
            },
        };
        if (this.range && this.rangeId) {
            const { start, end } = this.getRangeSiblings();
            if (this.isStart) {
                if (end && end.value) {
                    const endDate = new Date(end.value);
                    if (!isNaN(endDate.getTime())) {
                        options.maxDate = endDate;
                    }
                }
            }
            else {
                if (start && start.value) {
                    const startDate = new Date(start.value);
                    if (!isNaN(startDate.getTime())) {
                        options.minDate = startDate;
                    }
                }
            }
        }
        else {
            if (this.minDate)
                options.minDate = new Date(this.minDate);
            if (this.maxDate)
                options.maxDate = new Date(this.maxDate);
        }
        if (this.datepickerInstance) {
            if (typeof this.datepickerInstance.remove === 'function') {
                this.datepickerInstance.remove();
            }
        }
        this.datepickerInstance = datepicker(this.inputElement, options);
        if (this.value) {
            const initialDate = new Date(this.value);
            if (!isNaN(initialDate.getTime())) {
                try {
                    this.datepickerInstance.setDate(initialDate, true);
                    const formattedDate = this.formatDate(initialDate);
                    this.inputElement.value = formattedDate;
                    this.internalValue = formattedDate;
                    this.lastInputValue = formattedDate;
                }
                catch (error) { }
            }
        }
    }
    formatDate(date) {
        if (!(date instanceof Date) || isNaN(date.getTime()))
            return '';
        const day = date.getDate().toString().padStart(2, '0');
        const month = (date.getMonth() + 1).toString().padStart(2, '0');
        const year = date.getFullYear();
        return this.dateFormat.replace('dd', day).replace('MM', month).replace('yyyy', year.toString());
    }
    parseDate(dateString) {
        const parts = dateString.split('/');
        if (parts.length === 3) {
            const day = parseInt(parts[0], 10);
            const month = parseInt(parts[1], 10) - 1;
            const year = parseInt(parts[2], 10);
            if (!isNaN(day) && !isNaN(month) && !isNaN(year)) {
                return new Date(year, month, day);
            }
        }
        return null;
    }
    formResetCallback() {
        var _a;
        this.value = (_a = this.defaultValue) !== null && _a !== void 0 ? _a : '';
        this.internalValue = this.defaultValue ? this.formatDate(new Date(this.defaultValue)) : '';
        this.lastInputValue = this.internalValue;
        this.internals.setFormValue(this.defaultValue ? this.defaultValue : null);
        this.isClearIconVisible = this.isClear && !!this.defaultValue;
        if (this.inputElement) {
            this.inputElement.value = this.internalValue;
        }
        if (this.datepickerInstance) {
            if (this.defaultValue) {
                const defaultDate = new Date(this.defaultValue);
                this.datepickerInstance.setDate(defaultDate, true);
            }
            else {
                this.datepickerInstance.setDate(undefined, true);
            }
        }
        const dateToEmit = this.defaultValue ? new Date(this.defaultValue) : null;
        this.dateChange.emit({ value: this.value, date: dateToEmit });
        this.updateRangeConstraints();
    }
    render() {
        const inputClass = {
            'spw-date-picker__input': true,
            'spw-date-picker__input--error': this.hasError,
            'spw-date-picker__input--disabled': this.disabled,
            'spw-date-picker__input--open': this.isOpen,
        };
        const containerClass = {
            'spw-date-picker': true,
            'spw-date-picker--is-clear': this.isClearIconVisible,
        };
        const errorMessage = this.error || this.internalError;
        return (h(Host, { key: '532d487da5196336bc86cfa98eb2b0cf4812fdfa' }, h("div", { key: 'bd0182c0dc06cf9a5ea846513bee1960c4a6b567', class: containerClass }, this.label && (h("spw-field-label", { key: 'aa8311ff9e5d1214a8b83613b01dd0fe75981542', label: this.label, required: this.required, tooltipTitle: this.tooltipTitle, tooltipText: this.tooltipText, tooltipMaxWidth: this.tooltipMaxWidth, tooltipDirection: this.tooltipDirection, tooltipCursor: this.tooltipCursor })), this.assistiveText && (h("spw-field-message", { key: 'ddf1fee6b4ac1e18c8bc6ddf433dcb58d07bfb87', class: "spw-date-picker__field-message", variant: "hint", showIcon: false }, this.assistiveText)), h("div", { key: '8445c6f924ce87b0a630b55d15bcf439f7ae208b', class: "spw-date-picker__input-container" }, h("input", { key: '2dccede48303f05eba9fa4f37cb179f6dd8eda65', ref: el => (this.inputElement = el), id: this.uniqueId, type: "text", class: inputClass, value: this.internalValue, placeholder: this.placeholder, disabled: this.disabled, required: this.required, onFocus: this.handleInputFocus, onInput: this.handleInputChange, onKeyDown: this.handleKeyDown, "aria-label": this.accAriaLabel || this.label || this.name, "aria-describedby": this.assistiveText || errorMessage ? `${this.uniqueId}-help ${this.uniqueId}-error` : undefined, "aria-invalid": this.hasError }), h("div", { key: '0d2a94739a90dce420005bab0639cadb29444939', class: "spw-date-picker__icons" }, this.isClearIconVisible && (h("span", { key: '37b50fb2c43d2ca1be2a39b7ce9dc65e84b1b69c', class: "spw-date-picker__clear", onClick: this.handleClear }, h("spw-icon", { key: '4668571785391971ff209c46bf74f71306487f28', class: "spw-date-picker__icon spw-date-picker__icon--clear", icon: "fa-xmark" }))), h("span", { key: '14714c220f11d9b223a69354725bddbe36eed30a', class: "spw-date-picker__calendar-trigger", onMouseDown: this.handleCalendarIconMouseDown, onClick: this.handleCalendarIconClick }, h("spw-icon", { key: '67ccce624a7aed6324d48be9d3ed7c0adbf2cedf', icon: "fa-calendar", variant: "fa-regular", class: "spw-date-picker__icon spw-date-picker__icon--calendar" })))), this.error && (h("spw-field-message", { key: '7d138427f2e0a4c9863a3f041006cb0113caf038', variant: "error", showIcon: this.showErrorIcon }, this.error)), this.hint && (h("spw-field-message", { key: 'fd3265202be2901f1ad32e8343cfd2193366d201', variant: "hint", showIcon: this.showHintIcon }, this.hint)), this.success && (h("spw-field-message", { key: '085721c834bf6adfbd45ff15d3bdaaf1b4af72fb', variant: "success", showIcon: this.showSuccessIcon }, this.success)), this.warning && (h("spw-field-message", { key: '4222fb895d724619a4be4faad50d884ef571e1c9', variant: "warning", showIcon: this.showWarningIcon }, this.warning)))));
    }
    static get formAssociated() { return true; }
    get el() { return getElement(this); }
    static get watchers() { return {
        "value": [{
                "watchValue": 0
            }],
        "disabled": [{
                "watchDisabled": 0
            }],
        "minDate": [{
                "watchMinDate": 0
            }],
        "maxDate": [{
                "watchMaxDate": 0
            }]
    }; }
};
SpwDatePicker.style = spwDatePickerCss();

export { SpwDatePicker as spw_date_picker };
