playbook_ui 14.8.0.pre.rc.7 → 14.8.0.pre.rc.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,4 +26,4 @@ object-assign
26
26
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27
27
  PERFORMANCE OF THIS SOFTWARE.
28
28
  ***************************************************************************** */
29
- var __assign2=function(){__assign2=Object.assign||function __assign3(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p2 in s)if(Object.prototype.hasOwnProperty.call(s,p2))t[p2]=s[p2]}return t};return __assign2.apply(this,arguments)};var monthToStr2=function(monthNumber,shorthand,locale){return locale.months[shorthand?"shorthand":"longhand"][monthNumber]};function clearNode2(node){while(node.firstChild)node.removeChild(node.firstChild)}function getEventTarget2(event){try{if(typeof event.composedPath==="function"){var path=event.composedPath();return path[0]}return event.target}catch(error2){return event.target}}var defaultConfig={shorthand:false,dateFormat:"F Y",altFormat:"F Y",theme:"light"};function monthSelectPlugin2(pluginConfig){var config=__assign2(__assign2({},defaultConfig),pluginConfig);return function(fp){fp.config.dateFormat=config.dateFormat;fp.config.altFormat=config.altFormat;var self2={monthsContainer:null};function clearUnnecessaryDOMElements(){if(!fp.rContainer)return;clearNode2(fp.rContainer);for(var index=0;index<fp.monthElements.length;index++){var element=fp.monthElements[index];if(!element.parentNode)continue;element.parentNode.removeChild(element)}}function build(){if(!fp.rContainer)return;self2.monthsContainer=fp._createElement("div","flatpickr-monthSelect-months");self2.monthsContainer.tabIndex=-1;buildMonths();fp.rContainer.appendChild(self2.monthsContainer);fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-"+config.theme)}function buildMonths(){if(!self2.monthsContainer)return;clearNode2(self2.monthsContainer);var frag=document.createDocumentFragment();for(var i=0;i<12;i++){var month=fp.createDay("flatpickr-monthSelect-month",new Date(fp.currentYear,i),0,i);if(month.dateObj.getMonth()===(new Date).getMonth()&&month.dateObj.getFullYear()===(new Date).getFullYear())month.classList.add("today");month.textContent=monthToStr2(i,config.shorthand,fp.l10n);month.addEventListener("click",selectMonth);frag.appendChild(month)}self2.monthsContainer.appendChild(frag);if(fp.config.minDate&&fp.currentYear===fp.config.minDate.getFullYear())fp.prevMonthNav.classList.add("flatpickr-disabled");else fp.prevMonthNav.classList.remove("flatpickr-disabled");if(fp.config.maxDate&&fp.currentYear===fp.config.maxDate.getFullYear())fp.nextMonthNav.classList.add("flatpickr-disabled");else fp.nextMonthNav.classList.remove("flatpickr-disabled")}function bindEvents(){fp._bind(fp.prevMonthNav,"click",(function(e){e.preventDefault();e.stopPropagation();fp.changeYear(fp.currentYear-1);selectYear();buildMonths()}));fp._bind(fp.nextMonthNav,"click",(function(e){e.preventDefault();e.stopPropagation();fp.changeYear(fp.currentYear+1);selectYear();buildMonths()}));fp._bind(self2.monthsContainer,"mouseover",(function(e){if(fp.config.mode==="range")fp.onMouseOver(getEventTarget2(e),"flatpickr-monthSelect-month")}))}function setCurrentlySelected(){if(!fp.rContainer)return;if(!fp.selectedDates.length)return;var currentlySelected=fp.rContainer.querySelectorAll(".flatpickr-monthSelect-month.selected");for(var index=0;index<currentlySelected.length;index++){currentlySelected[index].classList.remove("selected")}var targetMonth=fp.selectedDates[0].getMonth();var month=fp.rContainer.querySelector(".flatpickr-monthSelect-month:nth-child("+(targetMonth+1)+")");if(month){month.classList.add("selected")}}function selectYear(){var selectedDate=fp.selectedDates[0];if(selectedDate){selectedDate=new Date(selectedDate);selectedDate.setFullYear(fp.currentYear);if(fp.config.minDate&&selectedDate<fp.config.minDate){selectedDate=fp.config.minDate}if(fp.config.maxDate&&selectedDate>fp.config.maxDate){selectedDate=fp.config.maxDate}fp.currentYear=selectedDate.getFullYear()}fp.currentYearElement.value=String(fp.currentYear);if(fp.rContainer){var months2=fp.rContainer.querySelectorAll(".flatpickr-monthSelect-month");months2.forEach((function(month){month.dateObj.setFullYear(fp.currentYear);if(fp.config.minDate&&month.dateObj<fp.config.minDate||fp.config.maxDate&&month.dateObj>fp.config.maxDate){month.classList.add("flatpickr-disabled")}else{month.classList.remove("flatpickr-disabled")}}))}setCurrentlySelected()}function selectMonth(e){e.preventDefault();e.stopPropagation();var eventTarget=getEventTarget2(e);if(!(eventTarget instanceof Element))return;if(eventTarget.classList.contains("flatpickr-disabled"))return;if(eventTarget.classList.contains("notAllowed"))return;setMonth(eventTarget.dateObj);if(fp.config.closeOnSelect){var single=fp.config.mode==="single";var range=fp.config.mode==="range"&&fp.selectedDates.length===2;if(single||range)fp.close()}}function setMonth(date){var selectedDate=new Date(fp.currentYear,date.getMonth(),date.getDate());var selectedDates=[];switch(fp.config.mode){case"single":selectedDates=[selectedDate];break;case"multiple":selectedDates.push(selectedDate);break;case"range":if(fp.selectedDates.length===2){selectedDates=[selectedDate]}else{selectedDates=fp.selectedDates.concat([selectedDate]);selectedDates.sort((function(a,b){return a.getTime()-b.getTime()}))}break}fp.setDate(selectedDates,true);setCurrentlySelected()}var shifts={37:-1,39:1,40:3,38:-3};function onKeyDown(_,__,___,e){var shouldMove=shifts[e.keyCode]!==void 0;if(!shouldMove&&e.keyCode!==13){return}if(!fp.rContainer||!self2.monthsContainer)return;var currentlySelected=fp.rContainer.querySelector(".flatpickr-monthSelect-month.selected");var index=Array.prototype.indexOf.call(self2.monthsContainer.children,document.activeElement);if(index===-1){var target=currentlySelected||self2.monthsContainer.firstElementChild;target.focus();index=target.$i}if(shouldMove){self2.monthsContainer.children[(12+index+shifts[e.keyCode])%12].focus()}else if(e.keyCode===13&&self2.monthsContainer.contains(document.activeElement)){setMonth(document.activeElement.dateObj)}}function closeHook(){var _a;if(((_a=fp.config)===null||_a===void 0?void 0:_a.mode)==="range"&&fp.selectedDates.length===1)fp.clear(false);if(!fp.selectedDates.length)buildMonths()}function stubCurrentMonth(){config._stubbedCurrentMonth=fp._initialDate.getMonth();fp._initialDate.setMonth(config._stubbedCurrentMonth);fp.currentMonth=config._stubbedCurrentMonth}function unstubCurrentMonth(){if(!config._stubbedCurrentMonth)return;fp._initialDate.setMonth(config._stubbedCurrentMonth);fp.currentMonth=config._stubbedCurrentMonth;delete config._stubbedCurrentMonth}function destroyPluginInstance(){if(self2.monthsContainer!==null){var months2=self2.monthsContainer.querySelectorAll(".flatpickr-monthSelect-month");for(var index=0;index<months2.length;index++){months2[index].removeEventListener("click",selectMonth)}}}return{onParseConfig:function(){fp.config.enableTime=false},onValueUpdate:setCurrentlySelected,onKeyDown:onKeyDown,onReady:[stubCurrentMonth,clearUnnecessaryDOMElements,build,bindEvents,setCurrentlySelected,function(){fp.config.onClose.push(closeHook);fp.loadedPlugins.push("monthSelect")}],onDestroy:[unstubCurrentMonth,destroyPluginInstance,function(){fp.config.onClose=fp.config.onClose.filter((function(hook){return hook!==closeHook}))}]}}}return monthSelectPlugin2}))})(monthSelect);var monthSelectExports=monthSelect.exports;const monthSelectPlugin=getDefaultExportFromCjs(monthSelectExports);var weekSelect$1={exports:{}};(function(module2,exports2){(function(global2,factory){module2.exports=factory()})(commonjsGlobal,(function(){function getEventTarget2(event){try{if(typeof event.composedPath==="function"){var path=event.composedPath();return path[0]}return event.target}catch(error2){return event.target}}function weekSelectPlugin(){return function(fp){function onDayHover(event){var day=getEventTarget2(event);if(!day.classList.contains("flatpickr-day"))return;var days2=fp.days.childNodes;var dayIndex=day.$i;var dayIndSeven=dayIndex/7;var weekStartDay=days2[7*Math.floor(dayIndSeven)].dateObj;var weekEndDay=days2[7*Math.ceil(dayIndSeven+.01)-1].dateObj;for(var i=days2.length;i--;){var day_1=days2[i];var date=day_1.dateObj;if(date>weekEndDay||date<weekStartDay)day_1.classList.remove("inRange");else day_1.classList.add("inRange")}}function highlightWeek(){var selDate=fp.latestSelectedDateObj;if(selDate!==void 0&&selDate.getMonth()===fp.currentMonth&&selDate.getFullYear()===fp.currentYear){fp.weekStartDay=fp.days.childNodes[7*Math.floor(fp.selectedDateElem.$i/7)].dateObj;fp.weekEndDay=fp.days.childNodes[7*Math.ceil(fp.selectedDateElem.$i/7+.01)-1].dateObj}var days2=fp.days.childNodes;for(var i=days2.length;i--;){var date=days2[i].dateObj;if(date>=fp.weekStartDay&&date<=fp.weekEndDay)days2[i].classList.add("week","selected")}}function clearHover(){var days2=fp.days.childNodes;for(var i=days2.length;i--;)days2[i].classList.remove("inRange")}function onReady(){if(fp.daysContainer!==void 0)fp.daysContainer.addEventListener("mouseover",onDayHover)}function onDestroy(){if(fp.daysContainer!==void 0)fp.daysContainer.removeEventListener("mouseover",onDayHover)}return{onValueUpdate:highlightWeek,onMonthChange:highlightWeek,onYearChange:highlightWeek,onOpen:highlightWeek,onClose:clearHover,onParseConfig:function(){fp.config.mode="single";fp.config.enableTime=false;fp.config.dateFormat=fp.config.dateFormat?fp.config.dateFormat:"\\W\\e\\e\\k #W, Y";fp.config.altFormat=fp.config.altFormat?fp.config.altFormat:"\\W\\e\\e\\k #W, Y"},onReady:[onReady,highlightWeek,function(){fp.loadedPlugins.push("weekSelect")}],onDestroy:onDestroy}}}return weekSelectPlugin}))})(weekSelect$1);var weekSelectExports=weekSelect$1.exports;const weekSelect=getDefaultExportFromCjs(weekSelectExports);const getTimezoneText=inputDate=>{const tzAbbr=inputDate.toLocaleDateString("en-US",{day:"2-digit",timeZoneName:"short"}).slice(4);const tzText=inputDate.toLocaleDateString("en-US",{day:"2-digit",timeZoneName:"long"}).slice(4);return`${tzAbbr} (${tzText})`};function timeSelectPlugin(props){return function(fp){const generateMeridiemCard=text=>{const selectableCard=document.createElement("div");selectableCard.className="pb_selectable_card_kit_enabled";const cardInput=document.createElement("input"),cardInputId=`datePicker-${fp.element.id}-${text}`;cardInput.className="datePicker-AMPM";cardInput.id=cardInputId;cardInput.name="datepicker-ampm";cardInput.type="radio";cardInput.value=text;const cardLabel=document.createElement("label"),cardLabelBuffer=document.createElement("div");cardLabel.className=`label-${text.toLowerCase()}`;cardLabel.setAttribute("for",cardInputId);cardLabelBuffer.className="buffer";cardLabelBuffer.innerHTML=text;cardLabel.append(cardLabelBuffer);selectableCard.prepend(cardInput);selectableCard.append(cardLabel);return selectableCard};const generateMeridiemToggle=()=>{fp.amPM.style.display="none";const formGroupKit=document.createElement("div");formGroupKit.className="pb_form_group_kit";const amCard=generateMeridiemCard("AM");amCard.addEventListener("click",(()=>{fp.selectedDates[0].setHours(fp.selectedDates[0].getHours()%12+12*0);fp.setDate(fp.selectedDates[0],true)}));const pmCard=generateMeridiemCard("PM");pmCard.addEventListener("click",(()=>{fp.selectedDates[0].setHours(fp.selectedDates[0].getHours()%12+12*1);fp.setDate(fp.selectedDates[0],true)}));formGroupKit.prepend(amCard);formGroupKit.append(pmCard);const meridiemContainer=document.createElement("div");meridiemContainer.className="meridiem";meridiemContainer.append(formGroupKit);fp.timeContainer.append(meridiemContainer)};const getMeridiem=dateObj=>dateObj[0].getHours()<12?"AM":"PM";const updateMeridiemToggle=forceClick=>{if(!fp.selectedDates.length)return;const uncheckedClass="pb_selectable_card_kit_enabled",checkedClass="pb_selectable_card_kit_checked_enabled",pickerAM=document.getElementById(`datePicker-${fp.element.id}-AM`),pickerPM=document.getElementById(`datePicker-${fp.element.id}-PM`),meridiem=getMeridiem(fp.selectedDates);{pickerAM.checked=false;pickerPM.checked=false;pickerPM.checked=meridiem==="PM";pickerAM.checked=meridiem==="AM"}if(meridiem==="PM"){pickerPM.parentElement.className=checkedClass;pickerAM.parentElement.className=uncheckedClass}else if(meridiem==="AM"){pickerAM.parentElement.className=checkedClass;pickerPM.parentElement.className=uncheckedClass}};return{onValueUpdate(){updateMeridiemToggle()},onOpen(){updateMeridiemToggle()},onReady(){const id=fp.input.id;if(!id||!(fp===null||fp===void 0?void 0:fp.timeContainer))return;fp.timeContainer.classList.add("pb_time_selection");fp.minuteElement.step="1";if(props.caption){const captionContainer=document.createElement("div");captionContainer.className="pb_caption_kit_md";captionContainer.innerHTML=props===null||props===void 0?void 0:props.caption;fp.timeContainer.prepend(captionContainer)}generateMeridiemToggle();updateMeridiemToggle();if(props.showTimezone){const subcaptionContainer=document.createElement("div");subcaptionContainer.className="pb_caption_kit_xs";subcaptionContainer.innerHTML=getTimezoneText(fp._initialDate);fp.timeContainer.append(subcaptionContainer)}fp.loadedPlugins.push("timeSelectPlugin")}}}}let activeLabel="";const quickPickPlugin=(thisRangesEndToday,customQuickPickDates,defaultDate)=>function(fp){const today=new Date;const yesterday=DateTime.getYesterdayDate(new Date);const thisWeekStartDate=DateTime.getFirstDayOfWeek(new Date);const thisWeekEndDate=thisRangesEndToday?new Date:DateTime.getLastDayOfWeek(new Date);const lastWeekStartDate=DateTime.getPreviousWeekStartDate(new Date);const lastWeekEndDate=DateTime.getPreviousWeekEndDate(new Date);const thisMonthStartDate=DateTime.getMonthStartDate(new Date);const thisMonthEndDate=thisRangesEndToday?new Date:DateTime.getMonthEndDate(new Date);const lastMonthStartDate=DateTime.getPreviousMonthStartDate(new Date);const lastMonthEndDate=DateTime.getPreviousMonthEndDate(new Date);const thisQuarterStartDate=DateTime.getQuarterStartDate(new Date);const thisQuarterEndDate=thisRangesEndToday?new Date:DateTime.getQuarterEndDate(new Date);const lastQuarterStartDate=DateTime.getPreviousQuarterStartDate(new Date);const lastQuarterEndDate=DateTime.getPreviousQuarterEndDate(new Date);const thisYearStartDate=DateTime.getYearStartDate(new Date);const thisYearEndDate=thisRangesEndToday?new Date:DateTime.getYearEndDate(new Date);const lastYearStartDate=DateTime.getPreviousYearStartDate(new Date);const lastYearEndDate=DateTime.getPreviousYearEndDate(new Date);const calculateDateRange=(timePeriod,amount)=>{const endDate=new Date;const startDate=new Date;switch(timePeriod){case"days":startDate.setDate(endDate.getDate()-amount);break;case"weeks":startDate.setDate(endDate.getDate()-amount*7);break;case"months":startDate.setMonth(endDate.getMonth()-amount);break;case"quarters":startDate.setMonth(endDate.getMonth()-amount*3);break;case"years":startDate.setFullYear(endDate.getFullYear()-amount);break;default:throw new Error("Invalid time period")}return[startDate,endDate]};let ranges={Today:[today,today],Yesterday:[yesterday,yesterday],"This week":[thisWeekStartDate,thisWeekEndDate],"This month":[thisMonthStartDate,thisMonthEndDate],"This quarter":[thisQuarterStartDate,thisQuarterEndDate],"This year":[thisYearStartDate,thisYearEndDate],"Last week":[lastWeekStartDate,lastWeekEndDate],"Last month":[lastMonthStartDate,lastMonthEndDate],"Last quarter":[lastQuarterStartDate,lastQuarterEndDate],"Last year":[lastYearStartDate,lastYearEndDate]};if(customQuickPickDates&&Object.keys(customQuickPickDates).length!==0){if(customQuickPickDates.dates.length&&customQuickPickDates.override===false){customQuickPickDates.dates.forEach((item=>{if(Array.isArray(item.value)){ranges[item.label]=item.value.map((dateStr=>new Date(dateStr)))}else{ranges[item.label]=calculateDateRange(item.value.timePeriod,item.value.amount)}}))}else if(customQuickPickDates.dates.length&&customQuickPickDates.override!==false){ranges={};customQuickPickDates.dates.forEach((item=>{if(Array.isArray(item.value)){ranges[item.label]=item.value.map((dateStr=>new Date(dateStr)))}else{ranges[item.label]=calculateDateRange(item.value.timePeriod,item.value.amount)}}))}}const rangesNav=document.createElement("ul");const pluginData={ranges:ranges,rangesNav:rangesNav,rangesButtons:[]};const addRangeButton=label=>{const div2=document.createElement("div");div2.className="nav-item-link";div2.innerHTML=label;pluginData.rangesButtons[label]=div2;const item=document.createElement("li");item.className="nav-item";item.appendChild(pluginData.rangesButtons[label]);pluginData.rangesNav.appendChild(item);return pluginData.rangesButtons[label]};const selectActiveRangeButton=selectedDates=>{const current=pluginData.rangesNav.querySelector(".active");if(current){current.classList.remove("active")}if(selectedDates.length>0&&activeLabel){pluginData.rangesButtons[activeLabel].classList.add("active")}};const isLabelMatchingSelectedDates=selectedDates=>activeLabel&&selectedDates[0].toDateString()===pluginData.ranges[activeLabel][0].toDateString()&&selectedDates[1].toDateString()===pluginData.ranges[activeLabel][1].toDateString();return{onReady(selectedDates){let defaultDateRange;for(const[label,range]of Object.entries(pluginData.ranges)){addRangeButton(label).addEventListener("click",(function(){const start2=new Date(range[0]);const end2=new Date(range[1]);if(!start2){fp.clear()}else{activeLabel=label;fp.setDate([start2,end2],true);fp.close()}}));if(defaultDate){if(label.toLowerCase()===defaultDate.toLowerCase()){activeLabel=label;defaultDateRange=range}}}if(pluginData.rangesNav.children.length>0){fp.calendarContainer.prepend(pluginData.rangesNav);pluginData.rangesNav.classList.add("quick-pick-ul");fp.calendarContainer.classList.add("quick-pick-drop-down");selectActiveRangeButton(selectedDates)}if(defaultDateRange){fp.setDate(defaultDateRange,false);selectActiveRangeButton(defaultDateRange)}},onValueUpdate(selectedDates){selectActiveRangeButton(selectedDates)},onClose(selectedDates){var _a;if(!isLabelMatchingSelectedDates(selectedDates)){(_a=pluginData.rangesButtons[activeLabel])===null||_a===void 0?void 0:_a.classList.remove("active");activeLabel=""}if(selectedDates.length===1){fp.setDate([selectedDates[0],selectedDates[0]],true)}if(selectedDates.length<2&&selectedDates.length>0){fp.input.placeholder=fp.formatDate(this.selectedDates[0],fp.config.dateFormat)}}}};const angleDown=getAllIcons().angleDown.string;const getPositionElement=element=>typeof element==="string"?document.querySelectorAll(element)[0]:element;const datePickerHelper=(config,scrollContainer)=>{const noop2=()=>{};const{allowInput:allowInput,closeOnSelect:closeOnSelect=true,customQuickPickDates:customQuickPickDates={override:true,dates:[]},defaultDate:defaultDate,disableDate:disableDate,disableRange:disableRange,disableWeekdays:disableWeekdays,enableTime:enableTime,format:format,maxDate:maxDate,minDate:minDate,mode:mode,onChange:onChange=noop2,onClose:onClose=noop2,pickerId:pickerId,plugins:plugins,position:position="auto",positionElement:positionElement,required:required,selectionType:selectionType,showTimezone:showTimezone,staticPosition:staticPosition=true,thisRangesEndToday:thisRangesEndToday=false,timeCaption:timeCaption="Select Time",timeFormat:timeFormat="at h:i K",yearRange:yearRange}=config;const defaultDateGetter=()=>{if(defaultDate===""){return null}else{return defaultDate}};const disabledWeekDays=()=>[date=>{const weekdayObj={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};return date.getDay()===weekdayObj[disableWeekdays[0]]||date.getDay()===weekdayObj[disableWeekdays[1]]||date.getDay()===weekdayObj[disableWeekdays[2]]||date.getDay()===weekdayObj[disableWeekdays[3]]||date.getDay()===weekdayObj[disableWeekdays[4]]||date.getDay()===weekdayObj[disableWeekdays[5]]||date.getDay()===weekdayObj[disableWeekdays[6]]}];const disabledParser=()=>{const disabledArray=[];disableDate&&disableDate.length>0&&disabledArray.push(...disableDate);disableRange&&disableRange.length>0&&disabledArray.push(...disableRange);disableWeekdays&&disableWeekdays.length>0&&disabledArray.push(...disabledWeekDays());return disabledArray};const calendarResizer=()=>{const cal=document.querySelector(`#cal-${pickerId}.open`);const parentInput=cal.parentElement;if((cal===null||cal===void 0?void 0:cal.getBoundingClientRect().right)>window.innerWidth){parentInput.style.display="flex";parentInput.style.justifyContent="center"}if(cal.offsetWidth<=parentInput.offsetWidth){parentInput.style.display="";parentInput.style.justifyContent=""}};const setPlugins=(thisRangesEndToday2,customQuickPickDates2)=>{const pluginList=[];if(selectionType==="month"||plugins.length>0){pluginList.push(monthSelectPlugin({shorthand:true,dateFormat:"F Y",altFormat:"F Y"}))}else if(selectionType==="week"){pluginList.push(weekSelect())}else if(selectionType==="quickpick"){pluginList.push(quickPickPlugin(thisRangesEndToday2,customQuickPickDates2,defaultDate))}if(enableTime)pluginList.push(timeSelectPlugin({caption:timeCaption,showTimezone:showTimezone}));return pluginList};const getDateFormat=()=>enableTime?`${format} ${timeFormat}`:format;const initialPicker=document.querySelector(`#${pickerId}`)._flatpickr;const scrollEvent=()=>{initialPicker._positionCalendar()};function attachToScroll(scrollParent){var _a;(_a=document.querySelectorAll(scrollParent)[0])===null||_a===void 0?void 0:_a.addEventListener("scroll",scrollEvent,{passive:true})}function detachFromScroll(scrollParent=document.body){var _a;(_a=document.querySelectorAll(scrollParent)[0])===null||_a===void 0?void 0:_a.removeEventListener("scroll",scrollEvent)}const yearChangeHook=fp=>{var _a;const yearInput=document.querySelector(`#year-${fp.input.id}`);yearInput.value=(_a=fp.currentYear)===null||_a===void 0?void 0:_a.toString()};flatpickr(`#${pickerId}`,{allowInput:allowInput,closeOnSelect:closeOnSelect,disableMobile:true,dateFormat:getDateFormat(),defaultDate:defaultDateGetter(),disable:disabledParser(),enableTime:enableTime,locale:{rangeSeparator:" to "},maxDate:maxDate,minDate:minDate,mode:mode,nextArrow:'<i class="far fa-angle-right"></i>',onOpen:[()=>{calendarResizer();window.addEventListener("resize",calendarResizer);if(!staticPosition&&scrollContainer)attachToScroll(scrollContainer)}],onClose:[(selectedDates,dateStr)=>{window.removeEventListener("resize",calendarResizer);if(!staticPosition&&scrollContainer)detachFromScroll(scrollContainer);onClose(selectedDates,dateStr)}],onChange:[(selectedDates,dateStr,fp)=>{yearChangeHook(fp);onChange(dateStr,selectedDates)}],onYearChange:[(_selectedDates,_dateStr,fp)=>{yearChangeHook(fp)}],plugins:setPlugins(thisRangesEndToday,customQuickPickDates),position:position,positionElement:getPositionElement(positionElement),prevArrow:'<i class="far fa-angle-left"></i>',static:staticPosition});const picker=document.querySelector(`#${pickerId}`)._flatpickr;picker.innerContainer.parentElement.id=`cal-${pickerId}`;picker.yearElements[0].parentElement.innerHTML=`<select class="numInput cur-year" type="number" tabIndex="-1" aria-label="Year" id="year-${pickerId}"></select>`;let years="";for(let year=yearRange[1];year>=yearRange[0];year--){years+=`<option value="${year}">${year}</option>`}const dropdown=document.querySelector(`#year-${pickerId}`);dropdown.innerHTML=years;dropdown.value=picker.currentYear;dropdown.addEventListener("input",(e=>{picker.changeYear(Number(e.target.value))}));if(picker.input.form){picker.input.form.addEventListener("reset",(()=>{setTimeout((()=>{dropdown.value=picker.currentYear;picker.monthsDropdownContainer.value=picker.currentMonth;if(defaultDate){picker.setDate(defaultDate);yearChangeHook(picker)}}),0)}))}dropdown.insertAdjacentHTML("afterend",`<i class="year-dropdown-icon">${angleDown}</i>`);if(picker.monthElements[0].parentElement){return picker.monthElements[0].insertAdjacentHTML("afterend",`<i class="month-dropdown-icon">${angleDown}</i>`)}if(allowInput){picker.input.removeAttribute("readonly")}if(required){picker.input.removeAttribute("readonly");picker.input.addEventListener("keydown",(e=>e.preventDefault()));picker.input.style.caretColor="transparent";picker.input.style.cursor="pointer"}document.querySelector(`#${pickerId}`).parentElement.addEventListener("click",(e=>e.stopPropagation()))};const useDropdown=(initial=true)=>{const[isDropDownClosed,setIsDropDownClosed]=useState(initial);const toggleDropdown=()=>setIsDropDownClosed((prev=>!prev));return[isDropDownClosed,setIsDropDownClosed,toggleDropdown]};var top="top";var bottom="bottom";var right="right";var left="left";var auto="auto";var basePlacements=[top,bottom,right,left];var start="start";var end="end";var clippingParents="clippingParents";var viewport="viewport";var popper="popper";var reference="reference";var variationPlacements=basePlacements.reduce((function(acc,placement){return acc.concat([placement+"-"+start,placement+"-"+end])}),[]);var placements=[].concat(basePlacements,[auto]).reduce((function(acc,placement){return acc.concat([placement,placement+"-"+start,placement+"-"+end])}),[]);var beforeRead="beforeRead";var read="read";var afterRead="afterRead";var beforeMain="beforeMain";var main="main";var afterMain="afterMain";var beforeWrite="beforeWrite";var write="write";var afterWrite="afterWrite";var modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(element){return element?(element.nodeName||"").toLowerCase():null}function getWindow(node){if(node==null){return window}if(node.toString()!=="[object Window]"){var ownerDocument=node.ownerDocument;return ownerDocument?ownerDocument.defaultView||window:window}return node}function isElement(node){var OwnElement=getWindow(node).Element;return node instanceof OwnElement||node instanceof Element}function isHTMLElement(node){var OwnElement=getWindow(node).HTMLElement;return node instanceof OwnElement||node instanceof HTMLElement}function isShadowRoot(node){if(typeof ShadowRoot==="undefined"){return false}var OwnElement=getWindow(node).ShadowRoot;return node instanceof OwnElement||node instanceof ShadowRoot}function applyStyles(_ref){var state=_ref.state;Object.keys(state.elements).forEach((function(name){var style=state.styles[name]||{};var attributes=state.attributes[name]||{};var element=state.elements[name];if(!isHTMLElement(element)||!getNodeName(element)){return}Object.assign(element.style,style);Object.keys(attributes).forEach((function(name2){var value=attributes[name2];if(value===false){element.removeAttribute(name2)}else{element.setAttribute(name2,value===true?"":value)}}))}))}function effect$2(_ref2){var state=_ref2.state;var initialStyles={popper:{position:state.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(state.elements.popper.style,initialStyles.popper);state.styles=initialStyles;if(state.elements.arrow){Object.assign(state.elements.arrow.style,initialStyles.arrow)}return function(){Object.keys(state.elements).forEach((function(name){var element=state.elements[name];var attributes=state.attributes[name]||{};var styleProperties=Object.keys(state.styles.hasOwnProperty(name)?state.styles[name]:initialStyles[name]);var style=styleProperties.reduce((function(style2,property2){style2[property2]="";return style2}),{});if(!isHTMLElement(element)||!getNodeName(element)){return}Object.assign(element.style,style);Object.keys(attributes).forEach((function(attribute){element.removeAttribute(attribute)}))}))}}const applyStyles$1={name:"applyStyles",enabled:true,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(placement){return placement.split("-")[0]}var max=Math.max;var min=Math.min;var round=Math.round;function getUAString(){var uaData=navigator.userAgentData;if(uaData!=null&&uaData.brands&&Array.isArray(uaData.brands)){return uaData.brands.map((function(item){return item.brand+"/"+item.version})).join(" ")}return navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(element,includeScale,isFixedStrategy){if(includeScale===void 0){includeScale=false}if(isFixedStrategy===void 0){isFixedStrategy=false}var clientRect=element.getBoundingClientRect();var scaleX=1;var scaleY=1;if(includeScale&&isHTMLElement(element)){scaleX=element.offsetWidth>0?round(clientRect.width)/element.offsetWidth||1:1;scaleY=element.offsetHeight>0?round(clientRect.height)/element.offsetHeight||1:1}var _ref=isElement(element)?getWindow(element):window,visualViewport=_ref.visualViewport;var addVisualOffsets=!isLayoutViewport()&&isFixedStrategy;var x=(clientRect.left+(addVisualOffsets&&visualViewport?visualViewport.offsetLeft:0))/scaleX;var y=(clientRect.top+(addVisualOffsets&&visualViewport?visualViewport.offsetTop:0))/scaleY;var width=clientRect.width/scaleX;var height=clientRect.height/scaleY;return{width:width,height:height,top:y,right:x+width,bottom:y+height,left:x,x:x,y:y}}function getLayoutRect(element){var clientRect=getBoundingClientRect(element);var width=element.offsetWidth;var height=element.offsetHeight;if(Math.abs(clientRect.width-width)<=1){width=clientRect.width}if(Math.abs(clientRect.height-height)<=1){height=clientRect.height}return{x:element.offsetLeft,y:element.offsetTop,width:width,height:height}}function contains(parent2,child){var rootNode=child.getRootNode&&child.getRootNode();if(parent2.contains(child)){return true}else if(rootNode&&isShadowRoot(rootNode)){var next=child;do{if(next&&parent2.isSameNode(next)){return true}next=next.parentNode||next.host}while(next)}return false}function getComputedStyle(element){return getWindow(element).getComputedStyle(element)}function isTableElement(element){return["table","td","th"].indexOf(getNodeName(element))>=0}function getDocumentElement(element){return((isElement(element)?element.ownerDocument:element.document)||window.document).documentElement}function getParentNode(element){if(getNodeName(element)==="html"){return element}return element.assignedSlot||element.parentNode||(isShadowRoot(element)?element.host:null)||getDocumentElement(element)}function getTrueOffsetParent(element){if(!isHTMLElement(element)||getComputedStyle(element).position==="fixed"){return null}return element.offsetParent}function getContainingBlock(element){var isFirefox=/firefox/i.test(getUAString());var isIE=/Trident/i.test(getUAString());if(isIE&&isHTMLElement(element)){var elementCss=getComputedStyle(element);if(elementCss.position==="fixed"){return null}}var currentNode=getParentNode(element);if(isShadowRoot(currentNode)){currentNode=currentNode.host}while(isHTMLElement(currentNode)&&["html","body"].indexOf(getNodeName(currentNode))<0){var css=getComputedStyle(currentNode);if(css.transform!=="none"||css.perspective!=="none"||css.contain==="paint"||["transform","perspective"].indexOf(css.willChange)!==-1||isFirefox&&css.willChange==="filter"||isFirefox&&css.filter&&css.filter!=="none"){return currentNode}else{currentNode=currentNode.parentNode}}return null}function getOffsetParent(element){var window2=getWindow(element);var offsetParent=getTrueOffsetParent(element);while(offsetParent&&isTableElement(offsetParent)&&getComputedStyle(offsetParent).position==="static"){offsetParent=getTrueOffsetParent(offsetParent)}if(offsetParent&&(getNodeName(offsetParent)==="html"||getNodeName(offsetParent)==="body"&&getComputedStyle(offsetParent).position==="static")){return window2}return offsetParent||getContainingBlock(element)||window2}function getMainAxisFromPlacement(placement){return["top","bottom"].indexOf(placement)>=0?"x":"y"}function within(min$1,value,max$1){return max(min$1,min(value,max$1))}function withinMaxClamp(min2,value,max2){var v=within(min2,value,max2);return v>max2?max2:v}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(paddingObject){return Object.assign({},getFreshSideObject(),paddingObject)}function expandToHashMap(value,keys2){return keys2.reduce((function(hashMap,key){hashMap[key]=value;return hashMap}),{})}var toPaddingObject=function toPaddingObject2(padding,state){padding=typeof padding==="function"?padding(Object.assign({},state.rects,{placement:state.placement})):padding;return mergePaddingObject(typeof padding!=="number"?padding:expandToHashMap(padding,basePlacements))};function arrow(_ref){var _state$modifiersData$;var state=_ref.state,name=_ref.name,options=_ref.options;var arrowElement=state.elements.arrow;var popperOffsets2=state.modifiersData.popperOffsets;var basePlacement=getBasePlacement(state.placement);var axis=getMainAxisFromPlacement(basePlacement);var isVertical=[left,right].indexOf(basePlacement)>=0;var len=isVertical?"height":"width";if(!arrowElement||!popperOffsets2){return}var paddingObject=toPaddingObject(options.padding,state);var arrowRect=getLayoutRect(arrowElement);var minProp=axis==="y"?top:left;var maxProp=axis==="y"?bottom:right;var endDiff=state.rects.reference[len]+state.rects.reference[axis]-popperOffsets2[axis]-state.rects.popper[len];var startDiff=popperOffsets2[axis]-state.rects.reference[axis];var arrowOffsetParent=getOffsetParent(arrowElement);var clientSize=arrowOffsetParent?axis==="y"?arrowOffsetParent.clientHeight||0:arrowOffsetParent.clientWidth||0:0;var centerToReference=endDiff/2-startDiff/2;var min2=paddingObject[minProp];var max2=clientSize-arrowRect[len]-paddingObject[maxProp];var center=clientSize/2-arrowRect[len]/2+centerToReference;var offset2=within(min2,center,max2);var axisProp=axis;state.modifiersData[name]=(_state$modifiersData$={},_state$modifiersData$[axisProp]=offset2,_state$modifiersData$.centerOffset=offset2-center,_state$modifiersData$)}function effect$1(_ref2){var state=_ref2.state,options=_ref2.options;var _options$element=options.element,arrowElement=_options$element===void 0?"[data-popper-arrow]":_options$element;if(arrowElement==null){return}if(typeof arrowElement==="string"){arrowElement=state.elements.popper.querySelector(arrowElement);if(!arrowElement){return}}if(!contains(state.elements.popper,arrowElement)){return}state.elements.arrow=arrowElement}const arrow$1={name:"arrow",enabled:true,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(placement){return placement.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(_ref,win){var x=_ref.x,y=_ref.y;var dpr=win.devicePixelRatio||1;return{x:round(x*dpr)/dpr||0,y:round(y*dpr)/dpr||0}}function mapToStyles(_ref2){var _Object$assign2;var popper2=_ref2.popper,popperRect=_ref2.popperRect,placement=_ref2.placement,variation=_ref2.variation,offsets=_ref2.offsets,position=_ref2.position,gpuAcceleration=_ref2.gpuAcceleration,adaptive=_ref2.adaptive,roundOffsets=_ref2.roundOffsets,isFixed=_ref2.isFixed;var _offsets$x=offsets.x,x=_offsets$x===void 0?0:_offsets$x,_offsets$y=offsets.y,y=_offsets$y===void 0?0:_offsets$y;var _ref3=typeof roundOffsets==="function"?roundOffsets({x:x,y:y}):{x:x,y:y};x=_ref3.x;y=_ref3.y;var hasX=offsets.hasOwnProperty("x");var hasY=offsets.hasOwnProperty("y");var sideX=left;var sideY=top;var win=window;if(adaptive){var offsetParent=getOffsetParent(popper2);var heightProp="clientHeight";var widthProp="clientWidth";if(offsetParent===getWindow(popper2)){offsetParent=getDocumentElement(popper2);if(getComputedStyle(offsetParent).position!=="static"&&position==="absolute"){heightProp="scrollHeight";widthProp="scrollWidth"}}offsetParent=offsetParent;if(placement===top||(placement===left||placement===right)&&variation===end){sideY=bottom;var offsetY=isFixed&&offsetParent===win&&win.visualViewport?win.visualViewport.height:offsetParent[heightProp];y-=offsetY-popperRect.height;y*=gpuAcceleration?1:-1}if(placement===left||(placement===top||placement===bottom)&&variation===end){sideX=right;var offsetX=isFixed&&offsetParent===win&&win.visualViewport?win.visualViewport.width:offsetParent[widthProp];x-=offsetX-popperRect.width;x*=gpuAcceleration?1:-1}}var commonStyles=Object.assign({position:position},adaptive&&unsetSides);var _ref4=roundOffsets===true?roundOffsetsByDPR({x:x,y:y},getWindow(popper2)):{x:x,y:y};x=_ref4.x;y=_ref4.y;if(gpuAcceleration){var _Object$assign;return Object.assign({},commonStyles,(_Object$assign={},_Object$assign[sideY]=hasY?"0":"",_Object$assign[sideX]=hasX?"0":"",_Object$assign.transform=(win.devicePixelRatio||1)<=1?"translate("+x+"px, "+y+"px)":"translate3d("+x+"px, "+y+"px, 0)",_Object$assign))}return Object.assign({},commonStyles,(_Object$assign2={},_Object$assign2[sideY]=hasY?y+"px":"",_Object$assign2[sideX]=hasX?x+"px":"",_Object$assign2.transform="",_Object$assign2))}function computeStyles(_ref5){var state=_ref5.state,options=_ref5.options;var _options$gpuAccelerat=options.gpuAcceleration,gpuAcceleration=_options$gpuAccelerat===void 0?true:_options$gpuAccelerat,_options$adaptive=options.adaptive,adaptive=_options$adaptive===void 0?true:_options$adaptive,_options$roundOffsets=options.roundOffsets,roundOffsets=_options$roundOffsets===void 0?true:_options$roundOffsets;var commonStyles={placement:getBasePlacement(state.placement),variation:getVariation(state.placement),popper:state.elements.popper,popperRect:state.rects.popper,gpuAcceleration:gpuAcceleration,isFixed:state.options.strategy==="fixed"};if(state.modifiersData.popperOffsets!=null){state.styles.popper=Object.assign({},state.styles.popper,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.popperOffsets,position:state.options.strategy,adaptive:adaptive,roundOffsets:roundOffsets})))}if(state.modifiersData.arrow!=null){state.styles.arrow=Object.assign({},state.styles.arrow,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.arrow,position:"absolute",adaptive:false,roundOffsets:roundOffsets})))}state.attributes.popper=Object.assign({},state.attributes.popper,{"data-popper-placement":state.placement})}const computeStyles$1={name:"computeStyles",enabled:true,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:true};function effect(_ref){var state=_ref.state,instance=_ref.instance,options=_ref.options;var _options$scroll=options.scroll,scroll=_options$scroll===void 0?true:_options$scroll,_options$resize=options.resize,resize=_options$resize===void 0?true:_options$resize;var window2=getWindow(state.elements.popper);var scrollParents=[].concat(state.scrollParents.reference,state.scrollParents.popper);if(scroll){scrollParents.forEach((function(scrollParent){scrollParent.addEventListener("scroll",instance.update,passive)}))}if(resize){window2.addEventListener("resize",instance.update,passive)}return function(){if(scroll){scrollParents.forEach((function(scrollParent){scrollParent.removeEventListener("scroll",instance.update,passive)}))}if(resize){window2.removeEventListener("resize",instance.update,passive)}}}const eventListeners={name:"eventListeners",enabled:true,phase:"write",fn:function fn(){},effect:effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,(function(matched){return hash$1[matched]}))}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(placement){return placement.replace(/start|end/g,(function(matched){return hash[matched]}))}function getWindowScroll(node){var win=getWindow(node);var scrollLeft=win.pageXOffset;var scrollTop=win.pageYOffset;return{scrollLeft:scrollLeft,scrollTop:scrollTop}}function getWindowScrollBarX(element){return getBoundingClientRect(getDocumentElement(element)).left+getWindowScroll(element).scrollLeft}function getViewportRect(element,strategy){var win=getWindow(element);var html=getDocumentElement(element);var visualViewport=win.visualViewport;var width=html.clientWidth;var height=html.clientHeight;var x=0;var y=0;if(visualViewport){width=visualViewport.width;height=visualViewport.height;var layoutViewport=isLayoutViewport();if(layoutViewport||!layoutViewport&&strategy==="fixed"){x=visualViewport.offsetLeft;y=visualViewport.offsetTop}}return{width:width,height:height,x:x+getWindowScrollBarX(element),y:y}}function getDocumentRect(element){var _element$ownerDocumen;var html=getDocumentElement(element);var winScroll=getWindowScroll(element);var body=(_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body;var width=max(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0);var height=max(html.scrollHeight,html.clientHeight,body?body.scrollHeight:0,body?body.clientHeight:0);var x=-winScroll.scrollLeft+getWindowScrollBarX(element);var y=-winScroll.scrollTop;if(getComputedStyle(body||html).direction==="rtl"){x+=max(html.clientWidth,body?body.clientWidth:0)-width}return{width:width,height:height,x:x,y:y}}function isScrollParent(element){var _getComputedStyle=getComputedStyle(element),overflow=_getComputedStyle.overflow,overflowX=_getComputedStyle.overflowX,overflowY=_getComputedStyle.overflowY;return/auto|scroll|overlay|hidden/.test(overflow+overflowY+overflowX)}function getScrollParent(node){if(["html","body","#document"].indexOf(getNodeName(node))>=0){return node.ownerDocument.body}if(isHTMLElement(node)&&isScrollParent(node)){return node}return getScrollParent(getParentNode(node))}function listScrollParents(element,list){var _element$ownerDocumen;if(list===void 0){list=[]}var scrollParent=getScrollParent(element);var isBody=scrollParent===((_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body);var win=getWindow(scrollParent);var target=isBody?[win].concat(win.visualViewport||[],isScrollParent(scrollParent)?scrollParent:[]):scrollParent;var updatedList=list.concat(target);return isBody?updatedList:updatedList.concat(listScrollParents(getParentNode(target)))}function rectToClientRect(rect){return Object.assign({},rect,{left:rect.x,top:rect.y,right:rect.x+rect.width,bottom:rect.y+rect.height})}function getInnerBoundingClientRect(element,strategy){var rect=getBoundingClientRect(element,false,strategy==="fixed");rect.top=rect.top+element.clientTop;rect.left=rect.left+element.clientLeft;rect.bottom=rect.top+element.clientHeight;rect.right=rect.left+element.clientWidth;rect.width=element.clientWidth;rect.height=element.clientHeight;rect.x=rect.left;rect.y=rect.top;return rect}function getClientRectFromMixedType(element,clippingParent,strategy){return clippingParent===viewport?rectToClientRect(getViewportRect(element,strategy)):isElement(clippingParent)?getInnerBoundingClientRect(clippingParent,strategy):rectToClientRect(getDocumentRect(getDocumentElement(element)))}function getClippingParents(element){var clippingParents2=listScrollParents(getParentNode(element));var canEscapeClipping=["absolute","fixed"].indexOf(getComputedStyle(element).position)>=0;var clipperElement=canEscapeClipping&&isHTMLElement(element)?getOffsetParent(element):element;if(!isElement(clipperElement)){return[]}return clippingParents2.filter((function(clippingParent){return isElement(clippingParent)&&contains(clippingParent,clipperElement)&&getNodeName(clippingParent)!=="body"}))}function getClippingRect(element,boundary,rootBoundary,strategy){var mainClippingParents=boundary==="clippingParents"?getClippingParents(element):[].concat(boundary);var clippingParents2=[].concat(mainClippingParents,[rootBoundary]);var firstClippingParent=clippingParents2[0];var clippingRect=clippingParents2.reduce((function(accRect,clippingParent){var rect=getClientRectFromMixedType(element,clippingParent,strategy);accRect.top=max(rect.top,accRect.top);accRect.right=min(rect.right,accRect.right);accRect.bottom=min(rect.bottom,accRect.bottom);accRect.left=max(rect.left,accRect.left);return accRect}),getClientRectFromMixedType(element,firstClippingParent,strategy));clippingRect.width=clippingRect.right-clippingRect.left;clippingRect.height=clippingRect.bottom-clippingRect.top;clippingRect.x=clippingRect.left;clippingRect.y=clippingRect.top;return clippingRect}function computeOffsets(_ref){var reference2=_ref.reference,element=_ref.element,placement=_ref.placement;var basePlacement=placement?getBasePlacement(placement):null;var variation=placement?getVariation(placement):null;var commonX=reference2.x+reference2.width/2-element.width/2;var commonY=reference2.y+reference2.height/2-element.height/2;var offsets;switch(basePlacement){case top:offsets={x:commonX,y:reference2.y-element.height};break;case bottom:offsets={x:commonX,y:reference2.y+reference2.height};break;case right:offsets={x:reference2.x+reference2.width,y:commonY};break;case left:offsets={x:reference2.x-element.width,y:commonY};break;default:offsets={x:reference2.x,y:reference2.y}}var mainAxis=basePlacement?getMainAxisFromPlacement(basePlacement):null;if(mainAxis!=null){var len=mainAxis==="y"?"height":"width";switch(variation){case start:offsets[mainAxis]=offsets[mainAxis]-(reference2[len]/2-element[len]/2);break;case end:offsets[mainAxis]=offsets[mainAxis]+(reference2[len]/2-element[len]/2);break}}return offsets}function detectOverflow(state,options){if(options===void 0){options={}}var _options=options,_options$placement=_options.placement,placement=_options$placement===void 0?state.placement:_options$placement,_options$strategy=_options.strategy,strategy=_options$strategy===void 0?state.strategy:_options$strategy,_options$boundary=_options.boundary,boundary=_options$boundary===void 0?clippingParents:_options$boundary,_options$rootBoundary=_options.rootBoundary,rootBoundary=_options$rootBoundary===void 0?viewport:_options$rootBoundary,_options$elementConte=_options.elementContext,elementContext=_options$elementConte===void 0?popper:_options$elementConte,_options$altBoundary=_options.altBoundary,altBoundary=_options$altBoundary===void 0?false:_options$altBoundary,_options$padding=_options.padding,padding=_options$padding===void 0?0:_options$padding;var paddingObject=mergePaddingObject(typeof padding!=="number"?padding:expandToHashMap(padding,basePlacements));var altContext=elementContext===popper?reference:popper;var popperRect=state.rects.popper;var element=state.elements[altBoundary?altContext:elementContext];var clippingClientRect=getClippingRect(isElement(element)?element:element.contextElement||getDocumentElement(state.elements.popper),boundary,rootBoundary,strategy);var referenceClientRect=getBoundingClientRect(state.elements.reference);var popperOffsets2=computeOffsets({reference:referenceClientRect,element:popperRect,strategy:"absolute",placement:placement});var popperClientRect=rectToClientRect(Object.assign({},popperRect,popperOffsets2));var elementClientRect=elementContext===popper?popperClientRect:referenceClientRect;var overflowOffsets={top:clippingClientRect.top-elementClientRect.top+paddingObject.top,bottom:elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom,left:clippingClientRect.left-elementClientRect.left+paddingObject.left,right:elementClientRect.right-clippingClientRect.right+paddingObject.right};var offsetData=state.modifiersData.offset;if(elementContext===popper&&offsetData){var offset2=offsetData[placement];Object.keys(overflowOffsets).forEach((function(key){var multiply=[right,bottom].indexOf(key)>=0?1:-1;var axis=[top,bottom].indexOf(key)>=0?"y":"x";overflowOffsets[key]+=offset2[axis]*multiply}))}return overflowOffsets}function computeAutoPlacement(state,options){if(options===void 0){options={}}var _options=options,placement=_options.placement,boundary=_options.boundary,rootBoundary=_options.rootBoundary,padding=_options.padding,flipVariations=_options.flipVariations,_options$allowedAutoP=_options.allowedAutoPlacements,allowedAutoPlacements=_options$allowedAutoP===void 0?placements:_options$allowedAutoP;var variation=getVariation(placement);var placements$1=variation?flipVariations?variationPlacements:variationPlacements.filter((function(placement2){return getVariation(placement2)===variation})):basePlacements;var allowedPlacements=placements$1.filter((function(placement2){return allowedAutoPlacements.indexOf(placement2)>=0}));if(allowedPlacements.length===0){allowedPlacements=placements$1}var overflows=allowedPlacements.reduce((function(acc,placement2){acc[placement2]=detectOverflow(state,{placement:placement2,boundary:boundary,rootBoundary:rootBoundary,padding:padding})[getBasePlacement(placement2)];return acc}),{});return Object.keys(overflows).sort((function(a,b){return overflows[a]-overflows[b]}))}function getExpandedFallbackPlacements(placement){if(getBasePlacement(placement)===auto){return[]}var oppositePlacement=getOppositePlacement(placement);return[getOppositeVariationPlacement(placement),oppositePlacement,getOppositeVariationPlacement(oppositePlacement)]}function flip(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;if(state.modifiersData[name]._skip){return}var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?true:_options$altAxis,specifiedFallbackPlacements=options.fallbackPlacements,padding=options.padding,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,_options$flipVariatio=options.flipVariations,flipVariations=_options$flipVariatio===void 0?true:_options$flipVariatio,allowedAutoPlacements=options.allowedAutoPlacements;var preferredPlacement=state.options.placement;var basePlacement=getBasePlacement(preferredPlacement);var isBasePlacement=basePlacement===preferredPlacement;var fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipVariations?[getOppositePlacement(preferredPlacement)]:getExpandedFallbackPlacements(preferredPlacement));var placements2=[preferredPlacement].concat(fallbackPlacements).reduce((function(acc,placement2){return acc.concat(getBasePlacement(placement2)===auto?computeAutoPlacement(state,{placement:placement2,boundary:boundary,rootBoundary:rootBoundary,padding:padding,flipVariations:flipVariations,allowedAutoPlacements:allowedAutoPlacements}):placement2)}),[]);var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var checksMap=new Map;var makeFallbackChecks=true;var firstFittingPlacement=placements2[0];for(var i=0;i<placements2.length;i++){var placement=placements2[i];var _basePlacement=getBasePlacement(placement);var isStartVariation=getVariation(placement)===start;var isVertical=[top,bottom].indexOf(_basePlacement)>=0;var len=isVertical?"width":"height";var overflow=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,altBoundary:altBoundary,padding:padding});var mainVariationSide=isVertical?isStartVariation?right:left:isStartVariation?bottom:top;if(referenceRect[len]>popperRect[len]){mainVariationSide=getOppositePlacement(mainVariationSide)}var altVariationSide=getOppositePlacement(mainVariationSide);var checks=[];if(checkMainAxis){checks.push(overflow[_basePlacement]<=0)}if(checkAltAxis){checks.push(overflow[mainVariationSide]<=0,overflow[altVariationSide]<=0)}if(checks.every((function(check){return check}))){firstFittingPlacement=placement;makeFallbackChecks=false;break}checksMap.set(placement,checks)}if(makeFallbackChecks){var numberOfChecks=flipVariations?3:1;var _loop=function _loop2(_i2){var fittingPlacement=placements2.find((function(placement2){var checks2=checksMap.get(placement2);if(checks2){return checks2.slice(0,_i2).every((function(check){return check}))}}));if(fittingPlacement){firstFittingPlacement=fittingPlacement;return"break"}};for(var _i=numberOfChecks;_i>0;_i--){var _ret=_loop(_i);if(_ret==="break")break}}if(state.placement!==firstFittingPlacement){state.modifiersData[name]._skip=true;state.placement=firstFittingPlacement;state.reset=true}}const flip$1={name:"flip",enabled:true,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:false}};function getSideOffsets(overflow,rect,preventedOffsets){if(preventedOffsets===void 0){preventedOffsets={x:0,y:0}}return{top:overflow.top-rect.height-preventedOffsets.y,right:overflow.right-rect.width+preventedOffsets.x,bottom:overflow.bottom-rect.height+preventedOffsets.y,left:overflow.left-rect.width-preventedOffsets.x}}function isAnySideFullyClipped(overflow){return[top,right,bottom,left].some((function(side){return overflow[side]>=0}))}function hide(_ref){var state=_ref.state,name=_ref.name;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var preventedOffsets=state.modifiersData.preventOverflow;var referenceOverflow=detectOverflow(state,{elementContext:"reference"});var popperAltOverflow=detectOverflow(state,{altBoundary:true});var referenceClippingOffsets=getSideOffsets(referenceOverflow,referenceRect);var popperEscapeOffsets=getSideOffsets(popperAltOverflow,popperRect,preventedOffsets);var isReferenceHidden=isAnySideFullyClipped(referenceClippingOffsets);var hasPopperEscaped=isAnySideFullyClipped(popperEscapeOffsets);state.modifiersData[name]={referenceClippingOffsets:referenceClippingOffsets,popperEscapeOffsets:popperEscapeOffsets,isReferenceHidden:isReferenceHidden,hasPopperEscaped:hasPopperEscaped};state.attributes.popper=Object.assign({},state.attributes.popper,{"data-popper-reference-hidden":isReferenceHidden,"data-popper-escaped":hasPopperEscaped})}const hide$1={name:"hide",enabled:true,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(placement,rects,offset2){var basePlacement=getBasePlacement(placement);var invertDistance=[left,top].indexOf(basePlacement)>=0?-1:1;var _ref=typeof offset2==="function"?offset2(Object.assign({},rects,{placement:placement})):offset2,skidding=_ref[0],distance=_ref[1];skidding=skidding||0;distance=(distance||0)*invertDistance;return[left,right].indexOf(basePlacement)>=0?{x:distance,y:skidding}:{x:skidding,y:distance}}function offset(_ref2){var state=_ref2.state,options=_ref2.options,name=_ref2.name;var _options$offset=options.offset,offset2=_options$offset===void 0?[0,0]:_options$offset;var data=placements.reduce((function(acc,placement){acc[placement]=distanceAndSkiddingToXY(placement,state.rects,offset2);return acc}),{});var _data$state$placement=data[state.placement],x=_data$state$placement.x,y=_data$state$placement.y;if(state.modifiersData.popperOffsets!=null){state.modifiersData.popperOffsets.x+=x;state.modifiersData.popperOffsets.y+=y}state.modifiersData[name]=data}const offset$1={name:"offset",enabled:true,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(_ref){var state=_ref.state,name=_ref.name;state.modifiersData[name]=computeOffsets({reference:state.rects.reference,element:state.rects.popper,strategy:"absolute",placement:state.placement})}const popperOffsets$1={name:"popperOffsets",enabled:true,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(axis){return axis==="x"?"y":"x"}function preventOverflow(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?false:_options$altAxis,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,padding=options.padding,_options$tether=options.tether,tether=_options$tether===void 0?true:_options$tether,_options$tetherOffset=options.tetherOffset,tetherOffset=_options$tetherOffset===void 0?0:_options$tetherOffset;var overflow=detectOverflow(state,{boundary:boundary,rootBoundary:rootBoundary,padding:padding,altBoundary:altBoundary});var basePlacement=getBasePlacement(state.placement);var variation=getVariation(state.placement);var isBasePlacement=!variation;var mainAxis=getMainAxisFromPlacement(basePlacement);var altAxis=getAltAxis(mainAxis);var popperOffsets2=state.modifiersData.popperOffsets;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var tetherOffsetValue=typeof tetherOffset==="function"?tetherOffset(Object.assign({},state.rects,{placement:state.placement})):tetherOffset;var normalizedTetherOffsetValue=typeof tetherOffsetValue==="number"?{mainAxis:tetherOffsetValue,altAxis:tetherOffsetValue}:Object.assign({mainAxis:0,altAxis:0},tetherOffsetValue);var offsetModifierState=state.modifiersData.offset?state.modifiersData.offset[state.placement]:null;var data={x:0,y:0};if(!popperOffsets2){return}if(checkMainAxis){var _offsetModifierState$;var mainSide=mainAxis==="y"?top:left;var altSide=mainAxis==="y"?bottom:right;var len=mainAxis==="y"?"height":"width";var offset2=popperOffsets2[mainAxis];var min$1=offset2+overflow[mainSide];var max$1=offset2-overflow[altSide];var additive=tether?-popperRect[len]/2:0;var minLen=variation===start?referenceRect[len]:popperRect[len];var maxLen=variation===start?-popperRect[len]:-referenceRect[len];var arrowElement=state.elements.arrow;var arrowRect=tether&&arrowElement?getLayoutRect(arrowElement):{width:0,height:0};var arrowPaddingObject=state.modifiersData["arrow#persistent"]?state.modifiersData["arrow#persistent"].padding:getFreshSideObject();var arrowPaddingMin=arrowPaddingObject[mainSide];var arrowPaddingMax=arrowPaddingObject[altSide];var arrowLen=within(0,referenceRect[len],arrowRect[len]);var minOffset=isBasePlacement?referenceRect[len]/2-additive-arrowLen-arrowPaddingMin-normalizedTetherOffsetValue.mainAxis:minLen-arrowLen-arrowPaddingMin-normalizedTetherOffsetValue.mainAxis;var maxOffset=isBasePlacement?-referenceRect[len]/2+additive+arrowLen+arrowPaddingMax+normalizedTetherOffsetValue.mainAxis:maxLen+arrowLen+arrowPaddingMax+normalizedTetherOffsetValue.mainAxis;var arrowOffsetParent=state.elements.arrow&&getOffsetParent(state.elements.arrow);var clientOffset=arrowOffsetParent?mainAxis==="y"?arrowOffsetParent.clientTop||0:arrowOffsetParent.clientLeft||0:0;var offsetModifierValue=(_offsetModifierState$=offsetModifierState==null?void 0:offsetModifierState[mainAxis])!=null?_offsetModifierState$:0;var tetherMin=offset2+minOffset-offsetModifierValue-clientOffset;var tetherMax=offset2+maxOffset-offsetModifierValue;var preventedOffset=within(tether?min(min$1,tetherMin):min$1,offset2,tether?max(max$1,tetherMax):max$1);popperOffsets2[mainAxis]=preventedOffset;data[mainAxis]=preventedOffset-offset2}if(checkAltAxis){var _offsetModifierState$2;var _mainSide=mainAxis==="x"?top:left;var _altSide=mainAxis==="x"?bottom:right;var _offset=popperOffsets2[altAxis];var _len=altAxis==="y"?"height":"width";var _min=_offset+overflow[_mainSide];var _max=_offset-overflow[_altSide];var isOriginSide=[top,left].indexOf(basePlacement)!==-1;var _offsetModifierValue=(_offsetModifierState$2=offsetModifierState==null?void 0:offsetModifierState[altAxis])!=null?_offsetModifierState$2:0;var _tetherMin=isOriginSide?_min:_offset-referenceRect[_len]-popperRect[_len]-_offsetModifierValue+normalizedTetherOffsetValue.altAxis;var _tetherMax=isOriginSide?_offset+referenceRect[_len]+popperRect[_len]-_offsetModifierValue-normalizedTetherOffsetValue.altAxis:_max;var _preventedOffset=tether&&isOriginSide?withinMaxClamp(_tetherMin,_offset,_tetherMax):within(tether?_tetherMin:_min,_offset,tether?_tetherMax:_max);popperOffsets2[altAxis]=_preventedOffset;data[altAxis]=_preventedOffset-_offset}state.modifiersData[name]=data}const preventOverflow$1={name:"preventOverflow",enabled:true,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(element){return{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop}}function getNodeScroll(node){if(node===getWindow(node)||!isHTMLElement(node)){return getWindowScroll(node)}else{return getHTMLElementScroll(node)}}function isElementScaled(element){var rect=element.getBoundingClientRect();var scaleX=round(rect.width)/element.offsetWidth||1;var scaleY=round(rect.height)/element.offsetHeight||1;return scaleX!==1||scaleY!==1}function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){if(isFixed===void 0){isFixed=false}var isOffsetParentAnElement=isHTMLElement(offsetParent);var offsetParentIsScaled=isHTMLElement(offsetParent)&&isElementScaled(offsetParent);var documentElement=getDocumentElement(offsetParent);var rect=getBoundingClientRect(elementOrVirtualElement,offsetParentIsScaled,isFixed);var scroll={scrollLeft:0,scrollTop:0};var offsets={x:0,y:0};if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=="body"||isScrollParent(documentElement)){scroll=getNodeScroll(offsetParent)}if(isHTMLElement(offsetParent)){offsets=getBoundingClientRect(offsetParent,true);offsets.x+=offsetParent.clientLeft;offsets.y+=offsetParent.clientTop}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement)}}return{x:rect.left+scroll.scrollLeft-offsets.x,y:rect.top+scroll.scrollTop-offsets.y,width:rect.width,height:rect.height}}function order(modifiers){var map2=new Map;var visited=new Set;var result=[];modifiers.forEach((function(modifier){map2.set(modifier.name,modifier)}));function sort(modifier){visited.add(modifier.name);var requires=[].concat(modifier.requires||[],modifier.requiresIfExists||[]);requires.forEach((function(dep){if(!visited.has(dep)){var depModifier=map2.get(dep);if(depModifier){sort(depModifier)}}}));result.push(modifier)}modifiers.forEach((function(modifier){if(!visited.has(modifier.name)){sort(modifier)}}));return result}function orderModifiers(modifiers){var orderedModifiers=order(modifiers);return modifierPhases.reduce((function(acc,phase){return acc.concat(orderedModifiers.filter((function(modifier){return modifier.phase===phase})))}),[])}function debounce(fn2){var pending;return function(){if(!pending){pending=new Promise((function(resolve){Promise.resolve().then((function(){pending=void 0;resolve(fn2())}))}))}return pending}}function mergeByName(modifiers){var merged=modifiers.reduce((function(merged2,current){var existing=merged2[current.name];merged2[current.name]=existing?Object.assign({},existing,current,{options:Object.assign({},existing.options,current.options),data:Object.assign({},existing.data,current.data)}):current;return merged2}),{});return Object.keys(merged).map((function(key){return merged[key]}))}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}return!args.some((function(element){return!(element&&typeof element.getBoundingClientRect==="function")}))}function popperGenerator(generatorOptions){if(generatorOptions===void 0){generatorOptions={}}var _generatorOptions=generatorOptions,_generatorOptions$def=_generatorOptions.defaultModifiers,defaultModifiers2=_generatorOptions$def===void 0?[]:_generatorOptions$def,_generatorOptions$def2=_generatorOptions.defaultOptions,defaultOptions=_generatorOptions$def2===void 0?DEFAULT_OPTIONS:_generatorOptions$def2;return function createPopper2(reference2,popper2,options){if(options===void 0){options=defaultOptions}var state={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,defaultOptions),modifiersData:{},elements:{reference:reference2,popper:popper2},attributes:{},styles:{}};var effectCleanupFns=[];var isDestroyed=false;var instance={state:state,setOptions:function setOptions(setOptionsAction){var options2=typeof setOptionsAction==="function"?setOptionsAction(state.options):setOptionsAction;cleanupModifierEffects();state.options=Object.assign({},defaultOptions,state.options,options2);state.scrollParents={reference:isElement(reference2)?listScrollParents(reference2):reference2.contextElement?listScrollParents(reference2.contextElement):[],popper:listScrollParents(popper2)};var orderedModifiers=orderModifiers(mergeByName([].concat(defaultModifiers2,state.options.modifiers)));state.orderedModifiers=orderedModifiers.filter((function(m2){return m2.enabled}));runModifierEffects();return instance.update()},forceUpdate:function forceUpdate(){if(isDestroyed){return}var _state$elements=state.elements,reference3=_state$elements.reference,popper3=_state$elements.popper;if(!areValidElements(reference3,popper3)){return}state.rects={reference:getCompositeRect(reference3,getOffsetParent(popper3),state.options.strategy==="fixed"),popper:getLayoutRect(popper3)};state.reset=false;state.placement=state.options.placement;state.orderedModifiers.forEach((function(modifier){return state.modifiersData[modifier.name]=Object.assign({},modifier.data)}));for(var index=0;index<state.orderedModifiers.length;index++){if(state.reset===true){state.reset=false;index=-1;continue}var _state$orderedModifie=state.orderedModifiers[index],fn2=_state$orderedModifie.fn,_state$orderedModifie2=_state$orderedModifie.options,_options=_state$orderedModifie2===void 0?{}:_state$orderedModifie2,name=_state$orderedModifie.name;if(typeof fn2==="function"){state=fn2({state:state,options:_options,name:name,instance:instance})||state}}},update:debounce((function(){return new Promise((function(resolve){instance.forceUpdate();resolve(state)}))})),destroy:function destroy(){cleanupModifierEffects();isDestroyed=true}};if(!areValidElements(reference2,popper2)){return instance}instance.setOptions(options).then((function(state2){if(!isDestroyed&&options.onFirstUpdate){options.onFirstUpdate(state2)}}));function runModifierEffects(){state.orderedModifiers.forEach((function(_ref){var name=_ref.name,_ref$options=_ref.options,options2=_ref$options===void 0?{}:_ref$options,effect2=_ref.effect;if(typeof effect2==="function"){var cleanupFn=effect2({state:state,name:name,instance:instance,options:options2});var noopFn=function noopFn2(){};effectCleanupFns.push(cleanupFn||noopFn)}}))}function cleanupModifierEffects(){effectCleanupFns.forEach((function(fn2){return fn2()}));effectCleanupFns=[]}return instance}}var defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1];var createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1});var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1];var createPopper=popperGenerator({defaultModifiers:defaultModifiers});class PbTextarea extends PbEnhancedElement{static get selector(){return".resize_auto textarea"}onInput(){this.style.height="auto";this.style.height=this.scrollHeight+"px"}connect(){this.element.setAttribute("style","height:"+this.element.scrollHeight+"px;overflow-y:hidden;");this.element.addEventListener("input",this.onInput,false)}}const mapTheme={marker:colors.primary_action,maptiles:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",flyToConfig:{zoom:13,bearing:0,curve:1.42,easing:function(t){return t},essential:true},zoomConfig:{duration:1e3},mapConfig:{style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",zoom:13,attributionControl:false}};const POPOVER_OFFSET_Y=[0,20];class PbPopover extends PbEnhancedElement{static get selector(){return"[data-pb-popover-kit]"}moveTooltip(){document.querySelector("body").appendChild(this.tooltip)}connect(){this.moveTooltip();this.popper=createPopper(this.triggerElement,this.tooltip,{placement:this.position,strategy:"fixed",modifiers:[{name:"offset",options:{offset:this.offset}}]});this.triggerElement.addEventListener("click",(event=>{event.preventDefault();event.stopPropagation();if(!this.tooltip.classList.contains("show")){this.checkCloseTooltip()}setTimeout((()=>{this.toggleTooltip();this.popper.update()}),0)}))}checkCloseTooltip(){document.querySelector("body").addEventListener("click",(({target:target})=>{const isTooltipElement=target.closest(`#${this.tooltipId}`)!==null;const isTriggerElement=target.closest(`#${this.triggerElementId}`)!==null;switch(this.closeOnClick){case"any":if(isTooltipElement||!isTooltipElement&&!isTriggerElement){this.hideTooltip()}break;case"outside":if(!isTooltipElement&&!isTriggerElement){this.hideTooltip()}break;case"inside":if(isTooltipElement){this.hideTooltip()}break}}),true)}hideTooltip(){this.tooltip.classList.remove("show");this.tooltip.classList.add("hide")}toggleTooltip(){this.tooltip.classList.toggle("show");this.tooltip.classList.toggle("hide")}get triggerElement(){return this._triggerElement=this._triggerElement||document.querySelector(`#${this.triggerElementId}`)}get tooltip(){return this._tooltip=this._tooltip||this.element.querySelector(`#${this.tooltipId}`)}get position(){return this.element.dataset.pbPopoverPosition}get triggerElementId(){return this.element.dataset.pbPopoverTriggerElementId}get tooltipId(){return this.element.dataset.pbPopoverTooltipId}get offset(){return this.element.dataset.pbPopoverOffset==="true"?POPOVER_OFFSET_Y:[0,0]}get closeOnClick(){return this.element.dataset.pbPopoverCloseOnClick}}const TOOLTIP_OFFSET=[0,20];const TOOLTIP_TIMEOUT=250;class PbTooltip extends PbEnhancedElement{static get selector(){return"[data-pb-tooltip-kit]"}connect(){this.triggerElements.forEach((trigger=>{trigger.addEventListener("mouseenter",(()=>{this.mouseenterTimeout=setTimeout((()=>{this.showTooltip(trigger);this.checkCloseTooltip(trigger)}),TOOLTIP_TIMEOUT);trigger.addEventListener("mouseleave",(()=>{clearTimeout(this.mouseenterTimeout);setTimeout((()=>{this.hideTooltip()}),0)}),{once:true})}))}));this.tooltip.addEventListener("mouseenter",(()=>{clearTimeout(this.mouseenterTimeout)}));this.tooltip.addEventListener("mouseleave",(()=>{this.hideTooltip()}))}checkCloseTooltip(trigger){document.querySelector("body").addEventListener("click",(({target:target})=>{const isTooltip=target.closest(`#${this.tooltipId}`)===this.tooltip;const isTrigger=target.closest(this.triggerElementSelector)===trigger;if(isTrigger||isTooltip){this.checkCloseTooltip(trigger)}else{this.hideTooltip()}}),{once:true})}showTooltip(trigger){if(this.shouldShowTooltip==="false")return;this.popper=createPopper$1(trigger,this.tooltip,{placement:this.position,strategy:"fixed",modifiers:[{name:"offset",options:{offset:TOOLTIP_OFFSET}},{name:"arrow",options:{element:document.querySelector(`#${this.tooltipId}-arrow`)}},offset$1,preventOverflow$1,flip$1]});this.tooltip.classList.add("show")}hideTooltip(){this.tooltip.classList.add("fade_out");setTimeout((()=>{if(!this.popper)return;this.popper.destroy();this.tooltip.classList.remove("show");this.tooltip.classList.remove("fade_out")}),TOOLTIP_TIMEOUT)}get triggerElements(){let triggerEl;if(this.triggerElementId){triggerEl=document.querySelector(`#${this.triggerElementId}`)}else{const selectorIsId=this.triggerElementSelector.indexOf("#")>-1;triggerEl=selectorIsId?document.querySelector(`${this.triggerElementSelector}`):document.querySelectorAll(`${this.triggerElementSelector}`)}if(!triggerEl){console.error("Tooltip Kit: an invalid or unavailable DOM reference was provided!");return[]}if(!triggerEl.length)triggerEl=[triggerEl];return this._triggerElements=this._triggerElements||triggerEl}get tooltip(){return this._tooltip=this._tooltip||this.element.querySelector(`#${this.tooltipId}`)}get position(){return this.element.dataset.pbTooltipPosition}get triggerElementId(){return this.element.dataset.pbTooltipTriggerElementId}get tooltipId(){return this.element.dataset.pbTooltipTooltipId}get triggerElementSelector(){return this.element.dataset.pbTooltipTriggerElementSelector}get shouldShowTooltip(){return this.element.dataset.pbTooltipShowTooltip}}class PbTypeahead extends PbEnhancedElement{static get selector(){return"[data-pb-typeahead-kit]"}connect(){var _a;this.element.addEventListener("keydown",(event=>this.handleKeydown(event)));this.searchInput.addEventListener("focus",(()=>this.debouncedSearch()));this.searchInput.addEventListener("input",(()=>this.debouncedSearch()));this.resultsElement.addEventListener("click",(event=>this.optionSelected(event)));(_a=this.element.closest("form"))===null||_a===void 0?void 0:_a.addEventListener("submit",(event=>this.handleFormSubmission(event)))}handleKeydown(event){if(event.key==="ArrowUp"){event.preventDefault();this.focusPreviousOption()}else if(event.key==="ArrowDown"){event.preventDefault();this.focusNextOption()}}search(){if(this.searchTerm.length<parseInt(this.searchTermMinimumLength))return this.clearResults();this.toggleResultsLoadingIndicator(true);this.showResults();const searchTerm=this.searchTerm;const searchContext=this.searchContext;const search={searchingFor:searchTerm,searchingContext:searchContext,setResults:results=>{this.resultsCacheUpdate(searchTerm,searchContext,results)}};this.element.dispatchEvent(new CustomEvent("pb-typeahead-kit-search",{bubbles:true,detail:search}))}resultsCacheUpdate(searchTerm,searchContext,results){const searchTermAndContext=this.cacheKeyFor(searchTerm,searchContext);if(this.resultsOptionCache.has(searchTermAndContext))this.resultsOptionCache.delete(searchTermAndContext);if(this.resultsOptionCache.size>32)this.resultsOptionCache.delete(this.resultsOptionCache.keys().next().value);this.resultsOptionCache.set(searchTermAndContext,results);this.showResults()}resultsCacheClear(){this.resultsOptionCache.clear()}get debouncedSearch(){return this._debouncedSearch=this._debouncedSearch||debounce$2(this.search,parseInt(this.searchDebounceTimeout)).bind(this)}showResults(){if(!this.resultsOptionCache.has(this.searchTermAndContext))return;this.toggleResultsLoadingIndicator(false);this.clearResults();for(const result of this.resultsOptionCache.get(this.searchTermAndContext)){this.resultsElement.appendChild(this.newResultOption(result.cloneNode(true)))}for(const result of this.resultsElement.querySelectorAll("[data-result-option-item]")){result.addEventListener("mousedown",(event=>this.optionSelected(event)))}}optionSelected(event){const resultOption=event.target.closest("[data-result-option-item]");if(!resultOption)return;this._validSelection=true;this.removeValidationError();this.resultsCacheClear();this.searchInputClear();this.clearResults();this.element.dispatchEvent(new CustomEvent("pb-typeahead-kit-result-option-selected",{bubbles:true,detail:{selected:resultOption,typeahead:this}}))}removeValidationError(){const inputWrapper=this.searchInput.closest(".text_input_wrapper");if(inputWrapper){const errorMessage=inputWrapper.querySelector(".pb_body_kit_negative");if(errorMessage){errorMessage.style.display="none"}this.searchInput.classList.remove("error")}}showValidationError(){const inputWrapper=this.searchInput.closest(".text_input_wrapper");if(inputWrapper){const errorMessage=inputWrapper.querySelector(".pb_body_kit_negative");if(errorMessage){errorMessage.style.display="block"}this.searchInput.classList.add("error")}}handleFormSubmission(event){if(!this._validSelection){this.showValidationError();event.preventDefault()}}clearResults(){this.resultsElement.innerHTML=""}newResultOption(content){const resultOption=this.resultOptionTemplate.content.cloneNode(true);resultOption.querySelector('slot[name="content"]').replaceWith(content);return resultOption}focusPreviousOption(){const currentIndex=this.resultOptionItems.indexOf(this.currentSelectedResultOptionItem);const previousIndex=currentIndex-1;const previousOptionItem=this.resultOptionItems[previousIndex]||this.resultOptionItems[this.resultOptionItems.length-1];previousOptionItem.focus()}focusNextOption(){const currentIndex=this.resultOptionItems.indexOf(this.currentSelectedResultOptionItem);const nextIndex=currentIndex+1;const nextOptionItem=this.resultOptionItems[nextIndex]||this.resultOptionItems[0];nextOptionItem.focus()}get resultOptionItems(){return Array.from(this.resultsElement.querySelectorAll("[data-result-option-item]"))}get currentSelectedResultOptionItem(){return document.activeElement.closest("[data-result-option-item]")}get searchInput(){return this._searchInput=this._searchInput||this.element.querySelector('input[type="search"]')}get searchTerm(){return this.searchInput.value}get searchContext(){if(this._searchContext)return this._searchContext;const selector=this.element.dataset.searchContextValueSelector;if(selector)return(this.element.parentNode.querySelector(selector)||this.element.closest(selector)).value;return null}set searchContext(value){this._searchContext=value}get searchTermAndContext(){return this.cacheKeyFor(this.searchTerm,this.searchContext)}cacheKeyFor(searchTerm,searchContext){return[searchTerm,JSON.stringify(searchContext)].join()}searchInputClear(){this.searchInput.value=""}get searchTermMinimumLength(){return this.element.dataset.pbTypeaheadKitSearchTermMinimumLength}get searchDebounceTimeout(){return this.element.dataset.pbTypeaheadKitSearchDebounceTimeout}get resultsElement(){return this._resultsElement=this._resultsElement||this.element.querySelector("[data-pb-typeahead-kit-results]")}get resultOptionTemplate(){return this._resultOptionTemplate=this._resultOptionTemplate||this.element.querySelector("template[data-pb-typeahead-kit-result-option]")}get resultsOptionCache(){return this._resultsOptionCache=this._resultsOptionCache||new Map}get resultsLoadingIndicator(){return this._resultsLoadingIndicator=this._resultsLoadingIndicator||this.element.querySelector("[data-pb-typeahead-kit-loading-indicator]")}toggleResultsLoadingIndicator(visible){let visibilityProperty="0";if(visible)visibilityProperty="1";this.resultsLoadingIndicator.style.opacity=visibilityProperty}}const dialogHelper=()=>{const openTrigger=document.querySelectorAll("[data-open-dialog]");const closeTrigger=document.querySelectorAll("[data-close-dialog]");const dialogs=document.querySelectorAll(".pb_dialog_rails");const loadingButton=document.querySelector('[data-disable-with="Loading"]');if(loadingButton){loadingButton.addEventListener("click",(function(){const okayLoadingButton=document.querySelector('[data-disable-with="Loading"]');const cancelButton=document.querySelector('[data-disable-cancel-with="Loading"]');let currentClass=okayLoadingButton.className;let cancelClass=cancelButton?cancelButton.className:"";let newClass=currentClass.replace("_enabled","_disabled_loading");let newCancelClass=cancelClass.replace("_enabled","_disabled");okayLoadingButton.disabled=true;if(cancelButton)cancelButton.disabled=true;okayLoadingButton.className=newClass;if(cancelButton)cancelButton.className=newCancelClass}))}openTrigger.forEach((open=>{open.addEventListener("click",(()=>{var openTriggerData=open.dataset.openDialog;var targetDialog=document.getElementById(openTriggerData);if(targetDialog.open)return;targetDialog.showModal()}))}));closeTrigger.forEach((close=>{close.addEventListener("click",(()=>{var closeTriggerData=close.dataset.closeDialog;document.getElementById(closeTriggerData).close()}))}));dialogs.forEach((dialogElement=>{dialogElement.addEventListener("mousedown",(event=>{const dialogParentDataset=dialogElement.parentElement.dataset;if(dialogParentDataset.overlayClick==="overlay_close")return;const dialogModal=event.target.getBoundingClientRect();const clickedOutsideDialogModal=event.clientX<dialogModal.left||event.clientX>dialogModal.right||event.clientY<dialogModal.top||event.clientY>dialogModal.bottom;if(clickedOutsideDialogModal){dialogElement.close();event.stopPropagation()}}))}))};const formHelper=()=>{const loadingForm=document.querySelector(".pb_form_loading");if(loadingForm){loadingForm.addEventListener("submit",(function(event){const submitButton=event["submitter"];const cancelButton=event["target"].querySelector('button[type="reset"]');if(submitButton){let currentClass=submitButton.className;let newClass=currentClass.replace("_enabled","_disabled_loading");let cancelClass=cancelButton?cancelButton.className:"";let newCancelClass=cancelClass.replace("_enabled","_disabled");submitButton.disabled=true;submitButton.className=newClass;if(cancelButton){cancelButton.disabled=true;cancelButton.className=newCancelClass}}}))}};export{useCollapsible as A,getAugmentedNamespace as B,createPopper as C,DateTime as D,uniqueId as E,typography as F,cloneDeep as G,isString as H,mapTheme as I,PbEnhancedElement as P,datePickerHelper as a,dialogHelper as b,PbPopover as c,debounce$2 as d,PbTooltip as e,formHelper as f,PbTypeahead as g,PbTable as h,PbTextarea as i,getAllIcons as j,isEmpty as k,find as l,map as m,commonjsGlobal as n,omitBy as o,partial as p,getDefaultExportFromCjs as q,highchartsDarkTheme as r,highchartsTheme as s,noop as t,useDropdown as u,colors as v,filter as w,omit as x,get as y,merge as z};
29
+ var __assign2=function(){__assign2=Object.assign||function __assign3(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p2 in s)if(Object.prototype.hasOwnProperty.call(s,p2))t[p2]=s[p2]}return t};return __assign2.apply(this,arguments)};var monthToStr2=function(monthNumber,shorthand,locale){return locale.months[shorthand?"shorthand":"longhand"][monthNumber]};function clearNode2(node){while(node.firstChild)node.removeChild(node.firstChild)}function getEventTarget2(event){try{if(typeof event.composedPath==="function"){var path=event.composedPath();return path[0]}return event.target}catch(error2){return event.target}}var defaultConfig={shorthand:false,dateFormat:"F Y",altFormat:"F Y",theme:"light"};function monthSelectPlugin2(pluginConfig){var config=__assign2(__assign2({},defaultConfig),pluginConfig);return function(fp){fp.config.dateFormat=config.dateFormat;fp.config.altFormat=config.altFormat;var self2={monthsContainer:null};function clearUnnecessaryDOMElements(){if(!fp.rContainer)return;clearNode2(fp.rContainer);for(var index=0;index<fp.monthElements.length;index++){var element=fp.monthElements[index];if(!element.parentNode)continue;element.parentNode.removeChild(element)}}function build(){if(!fp.rContainer)return;self2.monthsContainer=fp._createElement("div","flatpickr-monthSelect-months");self2.monthsContainer.tabIndex=-1;buildMonths();fp.rContainer.appendChild(self2.monthsContainer);fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-"+config.theme)}function buildMonths(){if(!self2.monthsContainer)return;clearNode2(self2.monthsContainer);var frag=document.createDocumentFragment();for(var i=0;i<12;i++){var month=fp.createDay("flatpickr-monthSelect-month",new Date(fp.currentYear,i),0,i);if(month.dateObj.getMonth()===(new Date).getMonth()&&month.dateObj.getFullYear()===(new Date).getFullYear())month.classList.add("today");month.textContent=monthToStr2(i,config.shorthand,fp.l10n);month.addEventListener("click",selectMonth);frag.appendChild(month)}self2.monthsContainer.appendChild(frag);if(fp.config.minDate&&fp.currentYear===fp.config.minDate.getFullYear())fp.prevMonthNav.classList.add("flatpickr-disabled");else fp.prevMonthNav.classList.remove("flatpickr-disabled");if(fp.config.maxDate&&fp.currentYear===fp.config.maxDate.getFullYear())fp.nextMonthNav.classList.add("flatpickr-disabled");else fp.nextMonthNav.classList.remove("flatpickr-disabled")}function bindEvents(){fp._bind(fp.prevMonthNav,"click",(function(e){e.preventDefault();e.stopPropagation();fp.changeYear(fp.currentYear-1);selectYear();buildMonths()}));fp._bind(fp.nextMonthNav,"click",(function(e){e.preventDefault();e.stopPropagation();fp.changeYear(fp.currentYear+1);selectYear();buildMonths()}));fp._bind(self2.monthsContainer,"mouseover",(function(e){if(fp.config.mode==="range")fp.onMouseOver(getEventTarget2(e),"flatpickr-monthSelect-month")}))}function setCurrentlySelected(){if(!fp.rContainer)return;if(!fp.selectedDates.length)return;var currentlySelected=fp.rContainer.querySelectorAll(".flatpickr-monthSelect-month.selected");for(var index=0;index<currentlySelected.length;index++){currentlySelected[index].classList.remove("selected")}var targetMonth=fp.selectedDates[0].getMonth();var month=fp.rContainer.querySelector(".flatpickr-monthSelect-month:nth-child("+(targetMonth+1)+")");if(month){month.classList.add("selected")}}function selectYear(){var selectedDate=fp.selectedDates[0];if(selectedDate){selectedDate=new Date(selectedDate);selectedDate.setFullYear(fp.currentYear);if(fp.config.minDate&&selectedDate<fp.config.minDate){selectedDate=fp.config.minDate}if(fp.config.maxDate&&selectedDate>fp.config.maxDate){selectedDate=fp.config.maxDate}fp.currentYear=selectedDate.getFullYear()}fp.currentYearElement.value=String(fp.currentYear);if(fp.rContainer){var months2=fp.rContainer.querySelectorAll(".flatpickr-monthSelect-month");months2.forEach((function(month){month.dateObj.setFullYear(fp.currentYear);if(fp.config.minDate&&month.dateObj<fp.config.minDate||fp.config.maxDate&&month.dateObj>fp.config.maxDate){month.classList.add("flatpickr-disabled")}else{month.classList.remove("flatpickr-disabled")}}))}setCurrentlySelected()}function selectMonth(e){e.preventDefault();e.stopPropagation();var eventTarget=getEventTarget2(e);if(!(eventTarget instanceof Element))return;if(eventTarget.classList.contains("flatpickr-disabled"))return;if(eventTarget.classList.contains("notAllowed"))return;setMonth(eventTarget.dateObj);if(fp.config.closeOnSelect){var single=fp.config.mode==="single";var range=fp.config.mode==="range"&&fp.selectedDates.length===2;if(single||range)fp.close()}}function setMonth(date){var selectedDate=new Date(fp.currentYear,date.getMonth(),date.getDate());var selectedDates=[];switch(fp.config.mode){case"single":selectedDates=[selectedDate];break;case"multiple":selectedDates.push(selectedDate);break;case"range":if(fp.selectedDates.length===2){selectedDates=[selectedDate]}else{selectedDates=fp.selectedDates.concat([selectedDate]);selectedDates.sort((function(a,b){return a.getTime()-b.getTime()}))}break}fp.setDate(selectedDates,true);setCurrentlySelected()}var shifts={37:-1,39:1,40:3,38:-3};function onKeyDown(_,__,___,e){var shouldMove=shifts[e.keyCode]!==void 0;if(!shouldMove&&e.keyCode!==13){return}if(!fp.rContainer||!self2.monthsContainer)return;var currentlySelected=fp.rContainer.querySelector(".flatpickr-monthSelect-month.selected");var index=Array.prototype.indexOf.call(self2.monthsContainer.children,document.activeElement);if(index===-1){var target=currentlySelected||self2.monthsContainer.firstElementChild;target.focus();index=target.$i}if(shouldMove){self2.monthsContainer.children[(12+index+shifts[e.keyCode])%12].focus()}else if(e.keyCode===13&&self2.monthsContainer.contains(document.activeElement)){setMonth(document.activeElement.dateObj)}}function closeHook(){var _a;if(((_a=fp.config)===null||_a===void 0?void 0:_a.mode)==="range"&&fp.selectedDates.length===1)fp.clear(false);if(!fp.selectedDates.length)buildMonths()}function stubCurrentMonth(){config._stubbedCurrentMonth=fp._initialDate.getMonth();fp._initialDate.setMonth(config._stubbedCurrentMonth);fp.currentMonth=config._stubbedCurrentMonth}function unstubCurrentMonth(){if(!config._stubbedCurrentMonth)return;fp._initialDate.setMonth(config._stubbedCurrentMonth);fp.currentMonth=config._stubbedCurrentMonth;delete config._stubbedCurrentMonth}function destroyPluginInstance(){if(self2.monthsContainer!==null){var months2=self2.monthsContainer.querySelectorAll(".flatpickr-monthSelect-month");for(var index=0;index<months2.length;index++){months2[index].removeEventListener("click",selectMonth)}}}return{onParseConfig:function(){fp.config.enableTime=false},onValueUpdate:setCurrentlySelected,onKeyDown:onKeyDown,onReady:[stubCurrentMonth,clearUnnecessaryDOMElements,build,bindEvents,setCurrentlySelected,function(){fp.config.onClose.push(closeHook);fp.loadedPlugins.push("monthSelect")}],onDestroy:[unstubCurrentMonth,destroyPluginInstance,function(){fp.config.onClose=fp.config.onClose.filter((function(hook){return hook!==closeHook}))}]}}}return monthSelectPlugin2}))})(monthSelect);var monthSelectExports=monthSelect.exports;const monthSelectPlugin=getDefaultExportFromCjs(monthSelectExports);var weekSelect$1={exports:{}};(function(module2,exports2){(function(global2,factory){module2.exports=factory()})(commonjsGlobal,(function(){function getEventTarget2(event){try{if(typeof event.composedPath==="function"){var path=event.composedPath();return path[0]}return event.target}catch(error2){return event.target}}function weekSelectPlugin(){return function(fp){function onDayHover(event){var day=getEventTarget2(event);if(!day.classList.contains("flatpickr-day"))return;var days2=fp.days.childNodes;var dayIndex=day.$i;var dayIndSeven=dayIndex/7;var weekStartDay=days2[7*Math.floor(dayIndSeven)].dateObj;var weekEndDay=days2[7*Math.ceil(dayIndSeven+.01)-1].dateObj;for(var i=days2.length;i--;){var day_1=days2[i];var date=day_1.dateObj;if(date>weekEndDay||date<weekStartDay)day_1.classList.remove("inRange");else day_1.classList.add("inRange")}}function highlightWeek(){var selDate=fp.latestSelectedDateObj;if(selDate!==void 0&&selDate.getMonth()===fp.currentMonth&&selDate.getFullYear()===fp.currentYear){fp.weekStartDay=fp.days.childNodes[7*Math.floor(fp.selectedDateElem.$i/7)].dateObj;fp.weekEndDay=fp.days.childNodes[7*Math.ceil(fp.selectedDateElem.$i/7+.01)-1].dateObj}var days2=fp.days.childNodes;for(var i=days2.length;i--;){var date=days2[i].dateObj;if(date>=fp.weekStartDay&&date<=fp.weekEndDay)days2[i].classList.add("week","selected")}}function clearHover(){var days2=fp.days.childNodes;for(var i=days2.length;i--;)days2[i].classList.remove("inRange")}function onReady(){if(fp.daysContainer!==void 0)fp.daysContainer.addEventListener("mouseover",onDayHover)}function onDestroy(){if(fp.daysContainer!==void 0)fp.daysContainer.removeEventListener("mouseover",onDayHover)}return{onValueUpdate:highlightWeek,onMonthChange:highlightWeek,onYearChange:highlightWeek,onOpen:highlightWeek,onClose:clearHover,onParseConfig:function(){fp.config.mode="single";fp.config.enableTime=false;fp.config.dateFormat=fp.config.dateFormat?fp.config.dateFormat:"\\W\\e\\e\\k #W, Y";fp.config.altFormat=fp.config.altFormat?fp.config.altFormat:"\\W\\e\\e\\k #W, Y"},onReady:[onReady,highlightWeek,function(){fp.loadedPlugins.push("weekSelect")}],onDestroy:onDestroy}}}return weekSelectPlugin}))})(weekSelect$1);var weekSelectExports=weekSelect$1.exports;const weekSelect=getDefaultExportFromCjs(weekSelectExports);const getTimezoneText=inputDate=>{const tzAbbr=inputDate.toLocaleDateString("en-US",{day:"2-digit",timeZoneName:"short"}).slice(4);const tzText=inputDate.toLocaleDateString("en-US",{day:"2-digit",timeZoneName:"long"}).slice(4);return`${tzAbbr} (${tzText})`};function timeSelectPlugin(props){return function(fp){const generateMeridiemCard=text=>{const selectableCard=document.createElement("div");selectableCard.className="pb_selectable_card_kit_enabled";const cardInput=document.createElement("input"),cardInputId=`datePicker-${fp.element.id}-${text}`;cardInput.className="datePicker-AMPM";cardInput.id=cardInputId;cardInput.name="datepicker-ampm";cardInput.type="radio";cardInput.value=text;const cardLabel=document.createElement("label"),cardLabelBuffer=document.createElement("div");cardLabel.className=`label-${text.toLowerCase()}`;cardLabel.setAttribute("for",cardInputId);cardLabelBuffer.className="buffer";cardLabelBuffer.innerHTML=text;cardLabel.append(cardLabelBuffer);selectableCard.prepend(cardInput);selectableCard.append(cardLabel);return selectableCard};const generateMeridiemToggle=()=>{fp.amPM.style.display="none";const formGroupKit=document.createElement("div");formGroupKit.className="pb_form_group_kit";const amCard=generateMeridiemCard("AM");amCard.addEventListener("click",(()=>{fp.selectedDates[0].setHours(fp.selectedDates[0].getHours()%12+12*0);fp.setDate(fp.selectedDates[0],true)}));const pmCard=generateMeridiemCard("PM");pmCard.addEventListener("click",(()=>{fp.selectedDates[0].setHours(fp.selectedDates[0].getHours()%12+12*1);fp.setDate(fp.selectedDates[0],true)}));formGroupKit.prepend(amCard);formGroupKit.append(pmCard);const meridiemContainer=document.createElement("div");meridiemContainer.className="meridiem";meridiemContainer.append(formGroupKit);fp.timeContainer.append(meridiemContainer)};const getMeridiem=dateObj=>dateObj[0].getHours()<12?"AM":"PM";const updateMeridiemToggle=forceClick=>{if(!fp.selectedDates.length)return;const uncheckedClass="pb_selectable_card_kit_enabled",checkedClass="pb_selectable_card_kit_checked_enabled",pickerAM=document.getElementById(`datePicker-${fp.element.id}-AM`),pickerPM=document.getElementById(`datePicker-${fp.element.id}-PM`),meridiem=getMeridiem(fp.selectedDates);{pickerAM.checked=false;pickerPM.checked=false;pickerPM.checked=meridiem==="PM";pickerAM.checked=meridiem==="AM"}if(meridiem==="PM"){pickerPM.parentElement.className=checkedClass;pickerAM.parentElement.className=uncheckedClass}else if(meridiem==="AM"){pickerAM.parentElement.className=checkedClass;pickerPM.parentElement.className=uncheckedClass}};return{onValueUpdate(){updateMeridiemToggle()},onOpen(){updateMeridiemToggle()},onReady(){const id=fp.input.id;if(!id||!(fp===null||fp===void 0?void 0:fp.timeContainer))return;fp.timeContainer.classList.add("pb_time_selection");fp.minuteElement.step="1";if(props.caption){const captionContainer=document.createElement("div");captionContainer.className="pb_caption_kit_md";captionContainer.innerHTML=props===null||props===void 0?void 0:props.caption;fp.timeContainer.prepend(captionContainer)}generateMeridiemToggle();updateMeridiemToggle();if(props.showTimezone){const subcaptionContainer=document.createElement("div");subcaptionContainer.className="pb_caption_kit_xs";subcaptionContainer.innerHTML=getTimezoneText(fp._initialDate);fp.timeContainer.append(subcaptionContainer)}fp.loadedPlugins.push("timeSelectPlugin")}}}}let activeLabel="";const quickPickPlugin=(thisRangesEndToday,customQuickPickDates,defaultDate)=>function(fp){const today=new Date;const yesterday=DateTime.getYesterdayDate(new Date);const thisWeekStartDate=DateTime.getFirstDayOfWeek(new Date);const thisWeekEndDate=thisRangesEndToday?new Date:DateTime.getLastDayOfWeek(new Date);const lastWeekStartDate=DateTime.getPreviousWeekStartDate(new Date);const lastWeekEndDate=DateTime.getPreviousWeekEndDate(new Date);const thisMonthStartDate=DateTime.getMonthStartDate(new Date);const thisMonthEndDate=thisRangesEndToday?new Date:DateTime.getMonthEndDate(new Date);const lastMonthStartDate=DateTime.getPreviousMonthStartDate(new Date);const lastMonthEndDate=DateTime.getPreviousMonthEndDate(new Date);const thisQuarterStartDate=DateTime.getQuarterStartDate(new Date);const thisQuarterEndDate=thisRangesEndToday?new Date:DateTime.getQuarterEndDate(new Date);const lastQuarterStartDate=DateTime.getPreviousQuarterStartDate(new Date);const lastQuarterEndDate=DateTime.getPreviousQuarterEndDate(new Date);const thisYearStartDate=DateTime.getYearStartDate(new Date);const thisYearEndDate=thisRangesEndToday?new Date:DateTime.getYearEndDate(new Date);const lastYearStartDate=DateTime.getPreviousYearStartDate(new Date);const lastYearEndDate=DateTime.getPreviousYearEndDate(new Date);const calculateDateRange=(timePeriod,amount)=>{const endDate=new Date;const startDate=new Date;switch(timePeriod){case"days":startDate.setDate(endDate.getDate()-amount);break;case"weeks":startDate.setDate(endDate.getDate()-amount*7);break;case"months":startDate.setMonth(endDate.getMonth()-amount);break;case"quarters":startDate.setMonth(endDate.getMonth()-amount*3);break;case"years":startDate.setFullYear(endDate.getFullYear()-amount);break;default:throw new Error("Invalid time period")}return[startDate,endDate]};let ranges={Today:[today,today],Yesterday:[yesterday,yesterday],"This week":[thisWeekStartDate,thisWeekEndDate],"This month":[thisMonthStartDate,thisMonthEndDate],"This quarter":[thisQuarterStartDate,thisQuarterEndDate],"This year":[thisYearStartDate,thisYearEndDate],"Last week":[lastWeekStartDate,lastWeekEndDate],"Last month":[lastMonthStartDate,lastMonthEndDate],"Last quarter":[lastQuarterStartDate,lastQuarterEndDate],"Last year":[lastYearStartDate,lastYearEndDate]};if(customQuickPickDates&&Object.keys(customQuickPickDates).length!==0){if(customQuickPickDates.dates.length&&customQuickPickDates.override===false){customQuickPickDates.dates.forEach((item=>{if(Array.isArray(item.value)){ranges[item.label]=item.value.map((dateStr=>new Date(dateStr)))}else{ranges[item.label]=calculateDateRange(item.value.timePeriod,item.value.amount)}}))}else if(customQuickPickDates.dates.length&&customQuickPickDates.override!==false){ranges={};customQuickPickDates.dates.forEach((item=>{if(Array.isArray(item.value)){ranges[item.label]=item.value.map((dateStr=>new Date(dateStr)))}else{ranges[item.label]=calculateDateRange(item.value.timePeriod,item.value.amount)}}))}}const rangesNav=document.createElement("ul");const pluginData={ranges:ranges,rangesNav:rangesNav,rangesButtons:[]};const addRangeButton=label=>{const div2=document.createElement("div");div2.className="nav-item-link";div2.innerHTML=label;pluginData.rangesButtons[label]=div2;const item=document.createElement("li");item.className="nav-item";item.appendChild(pluginData.rangesButtons[label]);pluginData.rangesNav.appendChild(item);return pluginData.rangesButtons[label]};const selectActiveRangeButton=selectedDates=>{const current=pluginData.rangesNav.querySelector(".active");if(current){current.classList.remove("active")}if(selectedDates.length>0&&activeLabel){pluginData.rangesButtons[activeLabel].classList.add("active")}};const isLabelMatchingSelectedDates=selectedDates=>activeLabel&&selectedDates[0].toDateString()===pluginData.ranges[activeLabel][0].toDateString()&&selectedDates[1].toDateString()===pluginData.ranges[activeLabel][1].toDateString();return{onReady(selectedDates){let defaultDateRange;for(const[label,range]of Object.entries(pluginData.ranges)){addRangeButton(label).addEventListener("click",(function(){const start2=new Date(range[0]);const end2=new Date(range[1]);if(!start2){fp.clear()}else{activeLabel=label;fp.setDate([start2,end2],true);fp.close()}}));if(defaultDate){if(label.toLowerCase()===defaultDate.toLowerCase()){activeLabel=label;defaultDateRange=range}}}if(pluginData.rangesNav.children.length>0){fp.calendarContainer.prepend(pluginData.rangesNav);pluginData.rangesNav.classList.add("quick-pick-ul");fp.calendarContainer.classList.add("quick-pick-drop-down");selectActiveRangeButton(selectedDates)}if(defaultDateRange){fp.setDate(defaultDateRange,false);selectActiveRangeButton(defaultDateRange)}},onValueUpdate(selectedDates){selectActiveRangeButton(selectedDates)},onClose(selectedDates){var _a;if(!isLabelMatchingSelectedDates(selectedDates)){(_a=pluginData.rangesButtons[activeLabel])===null||_a===void 0?void 0:_a.classList.remove("active");activeLabel=""}if(selectedDates.length===1){fp.setDate([selectedDates[0],selectedDates[0]],true)}if(selectedDates.length<2&&selectedDates.length>0){fp.input.placeholder=fp.formatDate(this.selectedDates[0],fp.config.dateFormat)}}}};const angleDown=getAllIcons().angleDown.string;const getPositionElement=element=>typeof element==="string"?document.querySelectorAll(element)[0]:element;const datePickerHelper=(config,scrollContainer)=>{const noop2=()=>{};const{allowInput:allowInput,closeOnSelect:closeOnSelect=true,customQuickPickDates:customQuickPickDates={override:true,dates:[]},defaultDate:defaultDate,disableDate:disableDate,disableRange:disableRange,disableWeekdays:disableWeekdays,enableTime:enableTime,format:format,maxDate:maxDate,minDate:minDate,mode:mode,onChange:onChange=noop2,onClose:onClose=noop2,pickerId:pickerId,plugins:plugins,position:position="auto",positionElement:positionElement,required:required,selectionType:selectionType,showTimezone:showTimezone,staticPosition:staticPosition=true,thisRangesEndToday:thisRangesEndToday=false,timeCaption:timeCaption="Select Time",timeFormat:timeFormat="at h:i K",yearRange:yearRange}=config;const defaultDateGetter=()=>{if(defaultDate===""){return null}else{return defaultDate}};const disabledWeekDays=()=>[date=>{const weekdayObj={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};return date.getDay()===weekdayObj[disableWeekdays[0]]||date.getDay()===weekdayObj[disableWeekdays[1]]||date.getDay()===weekdayObj[disableWeekdays[2]]||date.getDay()===weekdayObj[disableWeekdays[3]]||date.getDay()===weekdayObj[disableWeekdays[4]]||date.getDay()===weekdayObj[disableWeekdays[5]]||date.getDay()===weekdayObj[disableWeekdays[6]]}];const disabledParser=()=>{const disabledArray=[];disableDate&&disableDate.length>0&&disabledArray.push(...disableDate);disableRange&&disableRange.length>0&&disabledArray.push(...disableRange);disableWeekdays&&disableWeekdays.length>0&&disabledArray.push(...disabledWeekDays());return disabledArray};const calendarResizer=()=>{const cal=document.querySelector(`#cal-${pickerId}.open`);const parentInput=cal.parentElement;if((cal===null||cal===void 0?void 0:cal.getBoundingClientRect().right)>window.innerWidth){parentInput.style.display="flex";parentInput.style.justifyContent="center"}if(cal.offsetWidth<=parentInput.offsetWidth){parentInput.style.display="";parentInput.style.justifyContent=""}};const setPlugins=(thisRangesEndToday2,customQuickPickDates2)=>{const pluginList=[];if(selectionType==="month"||plugins.length>0){pluginList.push(monthSelectPlugin({shorthand:true,dateFormat:"F Y",altFormat:"F Y"}))}else if(selectionType==="week"){pluginList.push(weekSelect())}else if(selectionType==="quickpick"){pluginList.push(quickPickPlugin(thisRangesEndToday2,customQuickPickDates2,defaultDate))}if(enableTime)pluginList.push(timeSelectPlugin({caption:timeCaption,showTimezone:showTimezone}));return pluginList};const getDateFormat=()=>enableTime?`${format} ${timeFormat}`:format;const initialPicker=document.querySelector(`#${pickerId}`)._flatpickr;const scrollEvent=()=>{initialPicker._positionCalendar()};function attachToScroll(scrollParent){var _a;(_a=document.querySelectorAll(scrollParent)[0])===null||_a===void 0?void 0:_a.addEventListener("scroll",scrollEvent,{passive:true})}function detachFromScroll(scrollParent=document.body){var _a;(_a=document.querySelectorAll(scrollParent)[0])===null||_a===void 0?void 0:_a.removeEventListener("scroll",scrollEvent)}const yearChangeHook=fp=>{var _a;const yearInput=document.querySelector(`#year-${fp.input.id}`);yearInput.value=(_a=fp.currentYear)===null||_a===void 0?void 0:_a.toString()};flatpickr(`#${pickerId}`,{allowInput:allowInput,closeOnSelect:closeOnSelect,disableMobile:true,dateFormat:getDateFormat(),defaultDate:defaultDateGetter(),disable:disabledParser(),enableTime:enableTime,locale:{rangeSeparator:" to "},maxDate:maxDate,minDate:minDate,mode:mode,nextArrow:'<i class="far fa-angle-right"></i>',onOpen:[()=>{calendarResizer();window.addEventListener("resize",calendarResizer);if(!staticPosition&&scrollContainer)attachToScroll(scrollContainer)}],onClose:[(selectedDates,dateStr)=>{window.removeEventListener("resize",calendarResizer);if(!staticPosition&&scrollContainer)detachFromScroll(scrollContainer);onClose(selectedDates,dateStr)}],onChange:[(selectedDates,dateStr,fp)=>{yearChangeHook(fp);onChange(dateStr,selectedDates)}],onYearChange:[(_selectedDates,_dateStr,fp)=>{yearChangeHook(fp)}],plugins:setPlugins(thisRangesEndToday,customQuickPickDates),position:position,positionElement:getPositionElement(positionElement),prevArrow:'<i class="far fa-angle-left"></i>',static:staticPosition});const picker=document.querySelector(`#${pickerId}`)._flatpickr;picker.innerContainer.parentElement.id=`cal-${pickerId}`;picker.yearElements[0].parentElement.innerHTML=`<select class="numInput cur-year" type="number" tabIndex="-1" aria-label="Year" id="year-${pickerId}"></select>`;let years="";for(let year=yearRange[1];year>=yearRange[0];year--){years+=`<option value="${year}">${year}</option>`}const dropdown=document.querySelector(`#year-${pickerId}`);dropdown.innerHTML=years;dropdown.value=picker.currentYear;dropdown.addEventListener("input",(e=>{picker.changeYear(Number(e.target.value))}));if(picker.input.form){picker.input.form.addEventListener("reset",(()=>{setTimeout((()=>{dropdown.value=picker.currentYear;picker.monthsDropdownContainer.value=picker.currentMonth;if(defaultDate){picker.setDate(defaultDate);yearChangeHook(picker)}}),0)}))}dropdown.insertAdjacentHTML("afterend",`<i class="year-dropdown-icon">${angleDown}</i>`);if(picker.monthElements[0].parentElement){return picker.monthElements[0].insertAdjacentHTML("afterend",`<i class="month-dropdown-icon">${angleDown}</i>`)}if(allowInput){picker.input.removeAttribute("readonly")}if(required){picker.input.removeAttribute("readonly");picker.input.addEventListener("keydown",(e=>e.preventDefault()));picker.input.style.caretColor="transparent";picker.input.style.cursor="pointer"}document.querySelector(`#${pickerId}`).parentElement.addEventListener("click",(e=>e.stopPropagation()))};const useDropdown=(initial=true)=>{const[isDropDownClosed,setIsDropDownClosed]=useState(initial);const toggleDropdown=()=>setIsDropDownClosed((prev=>!prev));return[isDropDownClosed,setIsDropDownClosed,toggleDropdown]};var top="top";var bottom="bottom";var right="right";var left="left";var auto="auto";var basePlacements=[top,bottom,right,left];var start="start";var end="end";var clippingParents="clippingParents";var viewport="viewport";var popper="popper";var reference="reference";var variationPlacements=basePlacements.reduce((function(acc,placement){return acc.concat([placement+"-"+start,placement+"-"+end])}),[]);var placements=[].concat(basePlacements,[auto]).reduce((function(acc,placement){return acc.concat([placement,placement+"-"+start,placement+"-"+end])}),[]);var beforeRead="beforeRead";var read="read";var afterRead="afterRead";var beforeMain="beforeMain";var main="main";var afterMain="afterMain";var beforeWrite="beforeWrite";var write="write";var afterWrite="afterWrite";var modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(element){return element?(element.nodeName||"").toLowerCase():null}function getWindow(node){if(node==null){return window}if(node.toString()!=="[object Window]"){var ownerDocument=node.ownerDocument;return ownerDocument?ownerDocument.defaultView||window:window}return node}function isElement(node){var OwnElement=getWindow(node).Element;return node instanceof OwnElement||node instanceof Element}function isHTMLElement(node){var OwnElement=getWindow(node).HTMLElement;return node instanceof OwnElement||node instanceof HTMLElement}function isShadowRoot(node){if(typeof ShadowRoot==="undefined"){return false}var OwnElement=getWindow(node).ShadowRoot;return node instanceof OwnElement||node instanceof ShadowRoot}function applyStyles(_ref){var state=_ref.state;Object.keys(state.elements).forEach((function(name){var style=state.styles[name]||{};var attributes=state.attributes[name]||{};var element=state.elements[name];if(!isHTMLElement(element)||!getNodeName(element)){return}Object.assign(element.style,style);Object.keys(attributes).forEach((function(name2){var value=attributes[name2];if(value===false){element.removeAttribute(name2)}else{element.setAttribute(name2,value===true?"":value)}}))}))}function effect$2(_ref2){var state=_ref2.state;var initialStyles={popper:{position:state.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(state.elements.popper.style,initialStyles.popper);state.styles=initialStyles;if(state.elements.arrow){Object.assign(state.elements.arrow.style,initialStyles.arrow)}return function(){Object.keys(state.elements).forEach((function(name){var element=state.elements[name];var attributes=state.attributes[name]||{};var styleProperties=Object.keys(state.styles.hasOwnProperty(name)?state.styles[name]:initialStyles[name]);var style=styleProperties.reduce((function(style2,property2){style2[property2]="";return style2}),{});if(!isHTMLElement(element)||!getNodeName(element)){return}Object.assign(element.style,style);Object.keys(attributes).forEach((function(attribute){element.removeAttribute(attribute)}))}))}}const applyStyles$1={name:"applyStyles",enabled:true,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(placement){return placement.split("-")[0]}var max=Math.max;var min=Math.min;var round=Math.round;function getUAString(){var uaData=navigator.userAgentData;if(uaData!=null&&uaData.brands&&Array.isArray(uaData.brands)){return uaData.brands.map((function(item){return item.brand+"/"+item.version})).join(" ")}return navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(element,includeScale,isFixedStrategy){if(includeScale===void 0){includeScale=false}if(isFixedStrategy===void 0){isFixedStrategy=false}var clientRect=element.getBoundingClientRect();var scaleX=1;var scaleY=1;if(includeScale&&isHTMLElement(element)){scaleX=element.offsetWidth>0?round(clientRect.width)/element.offsetWidth||1:1;scaleY=element.offsetHeight>0?round(clientRect.height)/element.offsetHeight||1:1}var _ref=isElement(element)?getWindow(element):window,visualViewport=_ref.visualViewport;var addVisualOffsets=!isLayoutViewport()&&isFixedStrategy;var x=(clientRect.left+(addVisualOffsets&&visualViewport?visualViewport.offsetLeft:0))/scaleX;var y=(clientRect.top+(addVisualOffsets&&visualViewport?visualViewport.offsetTop:0))/scaleY;var width=clientRect.width/scaleX;var height=clientRect.height/scaleY;return{width:width,height:height,top:y,right:x+width,bottom:y+height,left:x,x:x,y:y}}function getLayoutRect(element){var clientRect=getBoundingClientRect(element);var width=element.offsetWidth;var height=element.offsetHeight;if(Math.abs(clientRect.width-width)<=1){width=clientRect.width}if(Math.abs(clientRect.height-height)<=1){height=clientRect.height}return{x:element.offsetLeft,y:element.offsetTop,width:width,height:height}}function contains(parent2,child){var rootNode=child.getRootNode&&child.getRootNode();if(parent2.contains(child)){return true}else if(rootNode&&isShadowRoot(rootNode)){var next=child;do{if(next&&parent2.isSameNode(next)){return true}next=next.parentNode||next.host}while(next)}return false}function getComputedStyle(element){return getWindow(element).getComputedStyle(element)}function isTableElement(element){return["table","td","th"].indexOf(getNodeName(element))>=0}function getDocumentElement(element){return((isElement(element)?element.ownerDocument:element.document)||window.document).documentElement}function getParentNode(element){if(getNodeName(element)==="html"){return element}return element.assignedSlot||element.parentNode||(isShadowRoot(element)?element.host:null)||getDocumentElement(element)}function getTrueOffsetParent(element){if(!isHTMLElement(element)||getComputedStyle(element).position==="fixed"){return null}return element.offsetParent}function getContainingBlock(element){var isFirefox=/firefox/i.test(getUAString());var isIE=/Trident/i.test(getUAString());if(isIE&&isHTMLElement(element)){var elementCss=getComputedStyle(element);if(elementCss.position==="fixed"){return null}}var currentNode=getParentNode(element);if(isShadowRoot(currentNode)){currentNode=currentNode.host}while(isHTMLElement(currentNode)&&["html","body"].indexOf(getNodeName(currentNode))<0){var css=getComputedStyle(currentNode);if(css.transform!=="none"||css.perspective!=="none"||css.contain==="paint"||["transform","perspective"].indexOf(css.willChange)!==-1||isFirefox&&css.willChange==="filter"||isFirefox&&css.filter&&css.filter!=="none"){return currentNode}else{currentNode=currentNode.parentNode}}return null}function getOffsetParent(element){var window2=getWindow(element);var offsetParent=getTrueOffsetParent(element);while(offsetParent&&isTableElement(offsetParent)&&getComputedStyle(offsetParent).position==="static"){offsetParent=getTrueOffsetParent(offsetParent)}if(offsetParent&&(getNodeName(offsetParent)==="html"||getNodeName(offsetParent)==="body"&&getComputedStyle(offsetParent).position==="static")){return window2}return offsetParent||getContainingBlock(element)||window2}function getMainAxisFromPlacement(placement){return["top","bottom"].indexOf(placement)>=0?"x":"y"}function within(min$1,value,max$1){return max(min$1,min(value,max$1))}function withinMaxClamp(min2,value,max2){var v=within(min2,value,max2);return v>max2?max2:v}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(paddingObject){return Object.assign({},getFreshSideObject(),paddingObject)}function expandToHashMap(value,keys2){return keys2.reduce((function(hashMap,key){hashMap[key]=value;return hashMap}),{})}var toPaddingObject=function toPaddingObject2(padding,state){padding=typeof padding==="function"?padding(Object.assign({},state.rects,{placement:state.placement})):padding;return mergePaddingObject(typeof padding!=="number"?padding:expandToHashMap(padding,basePlacements))};function arrow(_ref){var _state$modifiersData$;var state=_ref.state,name=_ref.name,options=_ref.options;var arrowElement=state.elements.arrow;var popperOffsets2=state.modifiersData.popperOffsets;var basePlacement=getBasePlacement(state.placement);var axis=getMainAxisFromPlacement(basePlacement);var isVertical=[left,right].indexOf(basePlacement)>=0;var len=isVertical?"height":"width";if(!arrowElement||!popperOffsets2){return}var paddingObject=toPaddingObject(options.padding,state);var arrowRect=getLayoutRect(arrowElement);var minProp=axis==="y"?top:left;var maxProp=axis==="y"?bottom:right;var endDiff=state.rects.reference[len]+state.rects.reference[axis]-popperOffsets2[axis]-state.rects.popper[len];var startDiff=popperOffsets2[axis]-state.rects.reference[axis];var arrowOffsetParent=getOffsetParent(arrowElement);var clientSize=arrowOffsetParent?axis==="y"?arrowOffsetParent.clientHeight||0:arrowOffsetParent.clientWidth||0:0;var centerToReference=endDiff/2-startDiff/2;var min2=paddingObject[minProp];var max2=clientSize-arrowRect[len]-paddingObject[maxProp];var center=clientSize/2-arrowRect[len]/2+centerToReference;var offset2=within(min2,center,max2);var axisProp=axis;state.modifiersData[name]=(_state$modifiersData$={},_state$modifiersData$[axisProp]=offset2,_state$modifiersData$.centerOffset=offset2-center,_state$modifiersData$)}function effect$1(_ref2){var state=_ref2.state,options=_ref2.options;var _options$element=options.element,arrowElement=_options$element===void 0?"[data-popper-arrow]":_options$element;if(arrowElement==null){return}if(typeof arrowElement==="string"){arrowElement=state.elements.popper.querySelector(arrowElement);if(!arrowElement){return}}if(!contains(state.elements.popper,arrowElement)){return}state.elements.arrow=arrowElement}const arrow$1={name:"arrow",enabled:true,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(placement){return placement.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(_ref,win){var x=_ref.x,y=_ref.y;var dpr=win.devicePixelRatio||1;return{x:round(x*dpr)/dpr||0,y:round(y*dpr)/dpr||0}}function mapToStyles(_ref2){var _Object$assign2;var popper2=_ref2.popper,popperRect=_ref2.popperRect,placement=_ref2.placement,variation=_ref2.variation,offsets=_ref2.offsets,position=_ref2.position,gpuAcceleration=_ref2.gpuAcceleration,adaptive=_ref2.adaptive,roundOffsets=_ref2.roundOffsets,isFixed=_ref2.isFixed;var _offsets$x=offsets.x,x=_offsets$x===void 0?0:_offsets$x,_offsets$y=offsets.y,y=_offsets$y===void 0?0:_offsets$y;var _ref3=typeof roundOffsets==="function"?roundOffsets({x:x,y:y}):{x:x,y:y};x=_ref3.x;y=_ref3.y;var hasX=offsets.hasOwnProperty("x");var hasY=offsets.hasOwnProperty("y");var sideX=left;var sideY=top;var win=window;if(adaptive){var offsetParent=getOffsetParent(popper2);var heightProp="clientHeight";var widthProp="clientWidth";if(offsetParent===getWindow(popper2)){offsetParent=getDocumentElement(popper2);if(getComputedStyle(offsetParent).position!=="static"&&position==="absolute"){heightProp="scrollHeight";widthProp="scrollWidth"}}offsetParent=offsetParent;if(placement===top||(placement===left||placement===right)&&variation===end){sideY=bottom;var offsetY=isFixed&&offsetParent===win&&win.visualViewport?win.visualViewport.height:offsetParent[heightProp];y-=offsetY-popperRect.height;y*=gpuAcceleration?1:-1}if(placement===left||(placement===top||placement===bottom)&&variation===end){sideX=right;var offsetX=isFixed&&offsetParent===win&&win.visualViewport?win.visualViewport.width:offsetParent[widthProp];x-=offsetX-popperRect.width;x*=gpuAcceleration?1:-1}}var commonStyles=Object.assign({position:position},adaptive&&unsetSides);var _ref4=roundOffsets===true?roundOffsetsByDPR({x:x,y:y},getWindow(popper2)):{x:x,y:y};x=_ref4.x;y=_ref4.y;if(gpuAcceleration){var _Object$assign;return Object.assign({},commonStyles,(_Object$assign={},_Object$assign[sideY]=hasY?"0":"",_Object$assign[sideX]=hasX?"0":"",_Object$assign.transform=(win.devicePixelRatio||1)<=1?"translate("+x+"px, "+y+"px)":"translate3d("+x+"px, "+y+"px, 0)",_Object$assign))}return Object.assign({},commonStyles,(_Object$assign2={},_Object$assign2[sideY]=hasY?y+"px":"",_Object$assign2[sideX]=hasX?x+"px":"",_Object$assign2.transform="",_Object$assign2))}function computeStyles(_ref5){var state=_ref5.state,options=_ref5.options;var _options$gpuAccelerat=options.gpuAcceleration,gpuAcceleration=_options$gpuAccelerat===void 0?true:_options$gpuAccelerat,_options$adaptive=options.adaptive,adaptive=_options$adaptive===void 0?true:_options$adaptive,_options$roundOffsets=options.roundOffsets,roundOffsets=_options$roundOffsets===void 0?true:_options$roundOffsets;var commonStyles={placement:getBasePlacement(state.placement),variation:getVariation(state.placement),popper:state.elements.popper,popperRect:state.rects.popper,gpuAcceleration:gpuAcceleration,isFixed:state.options.strategy==="fixed"};if(state.modifiersData.popperOffsets!=null){state.styles.popper=Object.assign({},state.styles.popper,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.popperOffsets,position:state.options.strategy,adaptive:adaptive,roundOffsets:roundOffsets})))}if(state.modifiersData.arrow!=null){state.styles.arrow=Object.assign({},state.styles.arrow,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.arrow,position:"absolute",adaptive:false,roundOffsets:roundOffsets})))}state.attributes.popper=Object.assign({},state.attributes.popper,{"data-popper-placement":state.placement})}const computeStyles$1={name:"computeStyles",enabled:true,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:true};function effect(_ref){var state=_ref.state,instance=_ref.instance,options=_ref.options;var _options$scroll=options.scroll,scroll=_options$scroll===void 0?true:_options$scroll,_options$resize=options.resize,resize=_options$resize===void 0?true:_options$resize;var window2=getWindow(state.elements.popper);var scrollParents=[].concat(state.scrollParents.reference,state.scrollParents.popper);if(scroll){scrollParents.forEach((function(scrollParent){scrollParent.addEventListener("scroll",instance.update,passive)}))}if(resize){window2.addEventListener("resize",instance.update,passive)}return function(){if(scroll){scrollParents.forEach((function(scrollParent){scrollParent.removeEventListener("scroll",instance.update,passive)}))}if(resize){window2.removeEventListener("resize",instance.update,passive)}}}const eventListeners={name:"eventListeners",enabled:true,phase:"write",fn:function fn(){},effect:effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,(function(matched){return hash$1[matched]}))}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(placement){return placement.replace(/start|end/g,(function(matched){return hash[matched]}))}function getWindowScroll(node){var win=getWindow(node);var scrollLeft=win.pageXOffset;var scrollTop=win.pageYOffset;return{scrollLeft:scrollLeft,scrollTop:scrollTop}}function getWindowScrollBarX(element){return getBoundingClientRect(getDocumentElement(element)).left+getWindowScroll(element).scrollLeft}function getViewportRect(element,strategy){var win=getWindow(element);var html=getDocumentElement(element);var visualViewport=win.visualViewport;var width=html.clientWidth;var height=html.clientHeight;var x=0;var y=0;if(visualViewport){width=visualViewport.width;height=visualViewport.height;var layoutViewport=isLayoutViewport();if(layoutViewport||!layoutViewport&&strategy==="fixed"){x=visualViewport.offsetLeft;y=visualViewport.offsetTop}}return{width:width,height:height,x:x+getWindowScrollBarX(element),y:y}}function getDocumentRect(element){var _element$ownerDocumen;var html=getDocumentElement(element);var winScroll=getWindowScroll(element);var body=(_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body;var width=max(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0);var height=max(html.scrollHeight,html.clientHeight,body?body.scrollHeight:0,body?body.clientHeight:0);var x=-winScroll.scrollLeft+getWindowScrollBarX(element);var y=-winScroll.scrollTop;if(getComputedStyle(body||html).direction==="rtl"){x+=max(html.clientWidth,body?body.clientWidth:0)-width}return{width:width,height:height,x:x,y:y}}function isScrollParent(element){var _getComputedStyle=getComputedStyle(element),overflow=_getComputedStyle.overflow,overflowX=_getComputedStyle.overflowX,overflowY=_getComputedStyle.overflowY;return/auto|scroll|overlay|hidden/.test(overflow+overflowY+overflowX)}function getScrollParent(node){if(["html","body","#document"].indexOf(getNodeName(node))>=0){return node.ownerDocument.body}if(isHTMLElement(node)&&isScrollParent(node)){return node}return getScrollParent(getParentNode(node))}function listScrollParents(element,list){var _element$ownerDocumen;if(list===void 0){list=[]}var scrollParent=getScrollParent(element);var isBody=scrollParent===((_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body);var win=getWindow(scrollParent);var target=isBody?[win].concat(win.visualViewport||[],isScrollParent(scrollParent)?scrollParent:[]):scrollParent;var updatedList=list.concat(target);return isBody?updatedList:updatedList.concat(listScrollParents(getParentNode(target)))}function rectToClientRect(rect){return Object.assign({},rect,{left:rect.x,top:rect.y,right:rect.x+rect.width,bottom:rect.y+rect.height})}function getInnerBoundingClientRect(element,strategy){var rect=getBoundingClientRect(element,false,strategy==="fixed");rect.top=rect.top+element.clientTop;rect.left=rect.left+element.clientLeft;rect.bottom=rect.top+element.clientHeight;rect.right=rect.left+element.clientWidth;rect.width=element.clientWidth;rect.height=element.clientHeight;rect.x=rect.left;rect.y=rect.top;return rect}function getClientRectFromMixedType(element,clippingParent,strategy){return clippingParent===viewport?rectToClientRect(getViewportRect(element,strategy)):isElement(clippingParent)?getInnerBoundingClientRect(clippingParent,strategy):rectToClientRect(getDocumentRect(getDocumentElement(element)))}function getClippingParents(element){var clippingParents2=listScrollParents(getParentNode(element));var canEscapeClipping=["absolute","fixed"].indexOf(getComputedStyle(element).position)>=0;var clipperElement=canEscapeClipping&&isHTMLElement(element)?getOffsetParent(element):element;if(!isElement(clipperElement)){return[]}return clippingParents2.filter((function(clippingParent){return isElement(clippingParent)&&contains(clippingParent,clipperElement)&&getNodeName(clippingParent)!=="body"}))}function getClippingRect(element,boundary,rootBoundary,strategy){var mainClippingParents=boundary==="clippingParents"?getClippingParents(element):[].concat(boundary);var clippingParents2=[].concat(mainClippingParents,[rootBoundary]);var firstClippingParent=clippingParents2[0];var clippingRect=clippingParents2.reduce((function(accRect,clippingParent){var rect=getClientRectFromMixedType(element,clippingParent,strategy);accRect.top=max(rect.top,accRect.top);accRect.right=min(rect.right,accRect.right);accRect.bottom=min(rect.bottom,accRect.bottom);accRect.left=max(rect.left,accRect.left);return accRect}),getClientRectFromMixedType(element,firstClippingParent,strategy));clippingRect.width=clippingRect.right-clippingRect.left;clippingRect.height=clippingRect.bottom-clippingRect.top;clippingRect.x=clippingRect.left;clippingRect.y=clippingRect.top;return clippingRect}function computeOffsets(_ref){var reference2=_ref.reference,element=_ref.element,placement=_ref.placement;var basePlacement=placement?getBasePlacement(placement):null;var variation=placement?getVariation(placement):null;var commonX=reference2.x+reference2.width/2-element.width/2;var commonY=reference2.y+reference2.height/2-element.height/2;var offsets;switch(basePlacement){case top:offsets={x:commonX,y:reference2.y-element.height};break;case bottom:offsets={x:commonX,y:reference2.y+reference2.height};break;case right:offsets={x:reference2.x+reference2.width,y:commonY};break;case left:offsets={x:reference2.x-element.width,y:commonY};break;default:offsets={x:reference2.x,y:reference2.y}}var mainAxis=basePlacement?getMainAxisFromPlacement(basePlacement):null;if(mainAxis!=null){var len=mainAxis==="y"?"height":"width";switch(variation){case start:offsets[mainAxis]=offsets[mainAxis]-(reference2[len]/2-element[len]/2);break;case end:offsets[mainAxis]=offsets[mainAxis]+(reference2[len]/2-element[len]/2);break}}return offsets}function detectOverflow(state,options){if(options===void 0){options={}}var _options=options,_options$placement=_options.placement,placement=_options$placement===void 0?state.placement:_options$placement,_options$strategy=_options.strategy,strategy=_options$strategy===void 0?state.strategy:_options$strategy,_options$boundary=_options.boundary,boundary=_options$boundary===void 0?clippingParents:_options$boundary,_options$rootBoundary=_options.rootBoundary,rootBoundary=_options$rootBoundary===void 0?viewport:_options$rootBoundary,_options$elementConte=_options.elementContext,elementContext=_options$elementConte===void 0?popper:_options$elementConte,_options$altBoundary=_options.altBoundary,altBoundary=_options$altBoundary===void 0?false:_options$altBoundary,_options$padding=_options.padding,padding=_options$padding===void 0?0:_options$padding;var paddingObject=mergePaddingObject(typeof padding!=="number"?padding:expandToHashMap(padding,basePlacements));var altContext=elementContext===popper?reference:popper;var popperRect=state.rects.popper;var element=state.elements[altBoundary?altContext:elementContext];var clippingClientRect=getClippingRect(isElement(element)?element:element.contextElement||getDocumentElement(state.elements.popper),boundary,rootBoundary,strategy);var referenceClientRect=getBoundingClientRect(state.elements.reference);var popperOffsets2=computeOffsets({reference:referenceClientRect,element:popperRect,strategy:"absolute",placement:placement});var popperClientRect=rectToClientRect(Object.assign({},popperRect,popperOffsets2));var elementClientRect=elementContext===popper?popperClientRect:referenceClientRect;var overflowOffsets={top:clippingClientRect.top-elementClientRect.top+paddingObject.top,bottom:elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom,left:clippingClientRect.left-elementClientRect.left+paddingObject.left,right:elementClientRect.right-clippingClientRect.right+paddingObject.right};var offsetData=state.modifiersData.offset;if(elementContext===popper&&offsetData){var offset2=offsetData[placement];Object.keys(overflowOffsets).forEach((function(key){var multiply=[right,bottom].indexOf(key)>=0?1:-1;var axis=[top,bottom].indexOf(key)>=0?"y":"x";overflowOffsets[key]+=offset2[axis]*multiply}))}return overflowOffsets}function computeAutoPlacement(state,options){if(options===void 0){options={}}var _options=options,placement=_options.placement,boundary=_options.boundary,rootBoundary=_options.rootBoundary,padding=_options.padding,flipVariations=_options.flipVariations,_options$allowedAutoP=_options.allowedAutoPlacements,allowedAutoPlacements=_options$allowedAutoP===void 0?placements:_options$allowedAutoP;var variation=getVariation(placement);var placements$1=variation?flipVariations?variationPlacements:variationPlacements.filter((function(placement2){return getVariation(placement2)===variation})):basePlacements;var allowedPlacements=placements$1.filter((function(placement2){return allowedAutoPlacements.indexOf(placement2)>=0}));if(allowedPlacements.length===0){allowedPlacements=placements$1}var overflows=allowedPlacements.reduce((function(acc,placement2){acc[placement2]=detectOverflow(state,{placement:placement2,boundary:boundary,rootBoundary:rootBoundary,padding:padding})[getBasePlacement(placement2)];return acc}),{});return Object.keys(overflows).sort((function(a,b){return overflows[a]-overflows[b]}))}function getExpandedFallbackPlacements(placement){if(getBasePlacement(placement)===auto){return[]}var oppositePlacement=getOppositePlacement(placement);return[getOppositeVariationPlacement(placement),oppositePlacement,getOppositeVariationPlacement(oppositePlacement)]}function flip(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;if(state.modifiersData[name]._skip){return}var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?true:_options$altAxis,specifiedFallbackPlacements=options.fallbackPlacements,padding=options.padding,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,_options$flipVariatio=options.flipVariations,flipVariations=_options$flipVariatio===void 0?true:_options$flipVariatio,allowedAutoPlacements=options.allowedAutoPlacements;var preferredPlacement=state.options.placement;var basePlacement=getBasePlacement(preferredPlacement);var isBasePlacement=basePlacement===preferredPlacement;var fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipVariations?[getOppositePlacement(preferredPlacement)]:getExpandedFallbackPlacements(preferredPlacement));var placements2=[preferredPlacement].concat(fallbackPlacements).reduce((function(acc,placement2){return acc.concat(getBasePlacement(placement2)===auto?computeAutoPlacement(state,{placement:placement2,boundary:boundary,rootBoundary:rootBoundary,padding:padding,flipVariations:flipVariations,allowedAutoPlacements:allowedAutoPlacements}):placement2)}),[]);var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var checksMap=new Map;var makeFallbackChecks=true;var firstFittingPlacement=placements2[0];for(var i=0;i<placements2.length;i++){var placement=placements2[i];var _basePlacement=getBasePlacement(placement);var isStartVariation=getVariation(placement)===start;var isVertical=[top,bottom].indexOf(_basePlacement)>=0;var len=isVertical?"width":"height";var overflow=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,altBoundary:altBoundary,padding:padding});var mainVariationSide=isVertical?isStartVariation?right:left:isStartVariation?bottom:top;if(referenceRect[len]>popperRect[len]){mainVariationSide=getOppositePlacement(mainVariationSide)}var altVariationSide=getOppositePlacement(mainVariationSide);var checks=[];if(checkMainAxis){checks.push(overflow[_basePlacement]<=0)}if(checkAltAxis){checks.push(overflow[mainVariationSide]<=0,overflow[altVariationSide]<=0)}if(checks.every((function(check){return check}))){firstFittingPlacement=placement;makeFallbackChecks=false;break}checksMap.set(placement,checks)}if(makeFallbackChecks){var numberOfChecks=flipVariations?3:1;var _loop=function _loop2(_i2){var fittingPlacement=placements2.find((function(placement2){var checks2=checksMap.get(placement2);if(checks2){return checks2.slice(0,_i2).every((function(check){return check}))}}));if(fittingPlacement){firstFittingPlacement=fittingPlacement;return"break"}};for(var _i=numberOfChecks;_i>0;_i--){var _ret=_loop(_i);if(_ret==="break")break}}if(state.placement!==firstFittingPlacement){state.modifiersData[name]._skip=true;state.placement=firstFittingPlacement;state.reset=true}}const flip$1={name:"flip",enabled:true,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:false}};function getSideOffsets(overflow,rect,preventedOffsets){if(preventedOffsets===void 0){preventedOffsets={x:0,y:0}}return{top:overflow.top-rect.height-preventedOffsets.y,right:overflow.right-rect.width+preventedOffsets.x,bottom:overflow.bottom-rect.height+preventedOffsets.y,left:overflow.left-rect.width-preventedOffsets.x}}function isAnySideFullyClipped(overflow){return[top,right,bottom,left].some((function(side){return overflow[side]>=0}))}function hide(_ref){var state=_ref.state,name=_ref.name;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var preventedOffsets=state.modifiersData.preventOverflow;var referenceOverflow=detectOverflow(state,{elementContext:"reference"});var popperAltOverflow=detectOverflow(state,{altBoundary:true});var referenceClippingOffsets=getSideOffsets(referenceOverflow,referenceRect);var popperEscapeOffsets=getSideOffsets(popperAltOverflow,popperRect,preventedOffsets);var isReferenceHidden=isAnySideFullyClipped(referenceClippingOffsets);var hasPopperEscaped=isAnySideFullyClipped(popperEscapeOffsets);state.modifiersData[name]={referenceClippingOffsets:referenceClippingOffsets,popperEscapeOffsets:popperEscapeOffsets,isReferenceHidden:isReferenceHidden,hasPopperEscaped:hasPopperEscaped};state.attributes.popper=Object.assign({},state.attributes.popper,{"data-popper-reference-hidden":isReferenceHidden,"data-popper-escaped":hasPopperEscaped})}const hide$1={name:"hide",enabled:true,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(placement,rects,offset2){var basePlacement=getBasePlacement(placement);var invertDistance=[left,top].indexOf(basePlacement)>=0?-1:1;var _ref=typeof offset2==="function"?offset2(Object.assign({},rects,{placement:placement})):offset2,skidding=_ref[0],distance=_ref[1];skidding=skidding||0;distance=(distance||0)*invertDistance;return[left,right].indexOf(basePlacement)>=0?{x:distance,y:skidding}:{x:skidding,y:distance}}function offset(_ref2){var state=_ref2.state,options=_ref2.options,name=_ref2.name;var _options$offset=options.offset,offset2=_options$offset===void 0?[0,0]:_options$offset;var data=placements.reduce((function(acc,placement){acc[placement]=distanceAndSkiddingToXY(placement,state.rects,offset2);return acc}),{});var _data$state$placement=data[state.placement],x=_data$state$placement.x,y=_data$state$placement.y;if(state.modifiersData.popperOffsets!=null){state.modifiersData.popperOffsets.x+=x;state.modifiersData.popperOffsets.y+=y}state.modifiersData[name]=data}const offset$1={name:"offset",enabled:true,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(_ref){var state=_ref.state,name=_ref.name;state.modifiersData[name]=computeOffsets({reference:state.rects.reference,element:state.rects.popper,strategy:"absolute",placement:state.placement})}const popperOffsets$1={name:"popperOffsets",enabled:true,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(axis){return axis==="x"?"y":"x"}function preventOverflow(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?false:_options$altAxis,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,padding=options.padding,_options$tether=options.tether,tether=_options$tether===void 0?true:_options$tether,_options$tetherOffset=options.tetherOffset,tetherOffset=_options$tetherOffset===void 0?0:_options$tetherOffset;var overflow=detectOverflow(state,{boundary:boundary,rootBoundary:rootBoundary,padding:padding,altBoundary:altBoundary});var basePlacement=getBasePlacement(state.placement);var variation=getVariation(state.placement);var isBasePlacement=!variation;var mainAxis=getMainAxisFromPlacement(basePlacement);var altAxis=getAltAxis(mainAxis);var popperOffsets2=state.modifiersData.popperOffsets;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var tetherOffsetValue=typeof tetherOffset==="function"?tetherOffset(Object.assign({},state.rects,{placement:state.placement})):tetherOffset;var normalizedTetherOffsetValue=typeof tetherOffsetValue==="number"?{mainAxis:tetherOffsetValue,altAxis:tetherOffsetValue}:Object.assign({mainAxis:0,altAxis:0},tetherOffsetValue);var offsetModifierState=state.modifiersData.offset?state.modifiersData.offset[state.placement]:null;var data={x:0,y:0};if(!popperOffsets2){return}if(checkMainAxis){var _offsetModifierState$;var mainSide=mainAxis==="y"?top:left;var altSide=mainAxis==="y"?bottom:right;var len=mainAxis==="y"?"height":"width";var offset2=popperOffsets2[mainAxis];var min$1=offset2+overflow[mainSide];var max$1=offset2-overflow[altSide];var additive=tether?-popperRect[len]/2:0;var minLen=variation===start?referenceRect[len]:popperRect[len];var maxLen=variation===start?-popperRect[len]:-referenceRect[len];var arrowElement=state.elements.arrow;var arrowRect=tether&&arrowElement?getLayoutRect(arrowElement):{width:0,height:0};var arrowPaddingObject=state.modifiersData["arrow#persistent"]?state.modifiersData["arrow#persistent"].padding:getFreshSideObject();var arrowPaddingMin=arrowPaddingObject[mainSide];var arrowPaddingMax=arrowPaddingObject[altSide];var arrowLen=within(0,referenceRect[len],arrowRect[len]);var minOffset=isBasePlacement?referenceRect[len]/2-additive-arrowLen-arrowPaddingMin-normalizedTetherOffsetValue.mainAxis:minLen-arrowLen-arrowPaddingMin-normalizedTetherOffsetValue.mainAxis;var maxOffset=isBasePlacement?-referenceRect[len]/2+additive+arrowLen+arrowPaddingMax+normalizedTetherOffsetValue.mainAxis:maxLen+arrowLen+arrowPaddingMax+normalizedTetherOffsetValue.mainAxis;var arrowOffsetParent=state.elements.arrow&&getOffsetParent(state.elements.arrow);var clientOffset=arrowOffsetParent?mainAxis==="y"?arrowOffsetParent.clientTop||0:arrowOffsetParent.clientLeft||0:0;var offsetModifierValue=(_offsetModifierState$=offsetModifierState==null?void 0:offsetModifierState[mainAxis])!=null?_offsetModifierState$:0;var tetherMin=offset2+minOffset-offsetModifierValue-clientOffset;var tetherMax=offset2+maxOffset-offsetModifierValue;var preventedOffset=within(tether?min(min$1,tetherMin):min$1,offset2,tether?max(max$1,tetherMax):max$1);popperOffsets2[mainAxis]=preventedOffset;data[mainAxis]=preventedOffset-offset2}if(checkAltAxis){var _offsetModifierState$2;var _mainSide=mainAxis==="x"?top:left;var _altSide=mainAxis==="x"?bottom:right;var _offset=popperOffsets2[altAxis];var _len=altAxis==="y"?"height":"width";var _min=_offset+overflow[_mainSide];var _max=_offset-overflow[_altSide];var isOriginSide=[top,left].indexOf(basePlacement)!==-1;var _offsetModifierValue=(_offsetModifierState$2=offsetModifierState==null?void 0:offsetModifierState[altAxis])!=null?_offsetModifierState$2:0;var _tetherMin=isOriginSide?_min:_offset-referenceRect[_len]-popperRect[_len]-_offsetModifierValue+normalizedTetherOffsetValue.altAxis;var _tetherMax=isOriginSide?_offset+referenceRect[_len]+popperRect[_len]-_offsetModifierValue-normalizedTetherOffsetValue.altAxis:_max;var _preventedOffset=tether&&isOriginSide?withinMaxClamp(_tetherMin,_offset,_tetherMax):within(tether?_tetherMin:_min,_offset,tether?_tetherMax:_max);popperOffsets2[altAxis]=_preventedOffset;data[altAxis]=_preventedOffset-_offset}state.modifiersData[name]=data}const preventOverflow$1={name:"preventOverflow",enabled:true,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(element){return{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop}}function getNodeScroll(node){if(node===getWindow(node)||!isHTMLElement(node)){return getWindowScroll(node)}else{return getHTMLElementScroll(node)}}function isElementScaled(element){var rect=element.getBoundingClientRect();var scaleX=round(rect.width)/element.offsetWidth||1;var scaleY=round(rect.height)/element.offsetHeight||1;return scaleX!==1||scaleY!==1}function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){if(isFixed===void 0){isFixed=false}var isOffsetParentAnElement=isHTMLElement(offsetParent);var offsetParentIsScaled=isHTMLElement(offsetParent)&&isElementScaled(offsetParent);var documentElement=getDocumentElement(offsetParent);var rect=getBoundingClientRect(elementOrVirtualElement,offsetParentIsScaled,isFixed);var scroll={scrollLeft:0,scrollTop:0};var offsets={x:0,y:0};if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=="body"||isScrollParent(documentElement)){scroll=getNodeScroll(offsetParent)}if(isHTMLElement(offsetParent)){offsets=getBoundingClientRect(offsetParent,true);offsets.x+=offsetParent.clientLeft;offsets.y+=offsetParent.clientTop}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement)}}return{x:rect.left+scroll.scrollLeft-offsets.x,y:rect.top+scroll.scrollTop-offsets.y,width:rect.width,height:rect.height}}function order(modifiers){var map2=new Map;var visited=new Set;var result=[];modifiers.forEach((function(modifier){map2.set(modifier.name,modifier)}));function sort(modifier){visited.add(modifier.name);var requires=[].concat(modifier.requires||[],modifier.requiresIfExists||[]);requires.forEach((function(dep){if(!visited.has(dep)){var depModifier=map2.get(dep);if(depModifier){sort(depModifier)}}}));result.push(modifier)}modifiers.forEach((function(modifier){if(!visited.has(modifier.name)){sort(modifier)}}));return result}function orderModifiers(modifiers){var orderedModifiers=order(modifiers);return modifierPhases.reduce((function(acc,phase){return acc.concat(orderedModifiers.filter((function(modifier){return modifier.phase===phase})))}),[])}function debounce(fn2){var pending;return function(){if(!pending){pending=new Promise((function(resolve){Promise.resolve().then((function(){pending=void 0;resolve(fn2())}))}))}return pending}}function mergeByName(modifiers){var merged=modifiers.reduce((function(merged2,current){var existing=merged2[current.name];merged2[current.name]=existing?Object.assign({},existing,current,{options:Object.assign({},existing.options,current.options),data:Object.assign({},existing.data,current.data)}):current;return merged2}),{});return Object.keys(merged).map((function(key){return merged[key]}))}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}return!args.some((function(element){return!(element&&typeof element.getBoundingClientRect==="function")}))}function popperGenerator(generatorOptions){if(generatorOptions===void 0){generatorOptions={}}var _generatorOptions=generatorOptions,_generatorOptions$def=_generatorOptions.defaultModifiers,defaultModifiers2=_generatorOptions$def===void 0?[]:_generatorOptions$def,_generatorOptions$def2=_generatorOptions.defaultOptions,defaultOptions=_generatorOptions$def2===void 0?DEFAULT_OPTIONS:_generatorOptions$def2;return function createPopper2(reference2,popper2,options){if(options===void 0){options=defaultOptions}var state={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,defaultOptions),modifiersData:{},elements:{reference:reference2,popper:popper2},attributes:{},styles:{}};var effectCleanupFns=[];var isDestroyed=false;var instance={state:state,setOptions:function setOptions(setOptionsAction){var options2=typeof setOptionsAction==="function"?setOptionsAction(state.options):setOptionsAction;cleanupModifierEffects();state.options=Object.assign({},defaultOptions,state.options,options2);state.scrollParents={reference:isElement(reference2)?listScrollParents(reference2):reference2.contextElement?listScrollParents(reference2.contextElement):[],popper:listScrollParents(popper2)};var orderedModifiers=orderModifiers(mergeByName([].concat(defaultModifiers2,state.options.modifiers)));state.orderedModifiers=orderedModifiers.filter((function(m2){return m2.enabled}));runModifierEffects();return instance.update()},forceUpdate:function forceUpdate(){if(isDestroyed){return}var _state$elements=state.elements,reference3=_state$elements.reference,popper3=_state$elements.popper;if(!areValidElements(reference3,popper3)){return}state.rects={reference:getCompositeRect(reference3,getOffsetParent(popper3),state.options.strategy==="fixed"),popper:getLayoutRect(popper3)};state.reset=false;state.placement=state.options.placement;state.orderedModifiers.forEach((function(modifier){return state.modifiersData[modifier.name]=Object.assign({},modifier.data)}));for(var index=0;index<state.orderedModifiers.length;index++){if(state.reset===true){state.reset=false;index=-1;continue}var _state$orderedModifie=state.orderedModifiers[index],fn2=_state$orderedModifie.fn,_state$orderedModifie2=_state$orderedModifie.options,_options=_state$orderedModifie2===void 0?{}:_state$orderedModifie2,name=_state$orderedModifie.name;if(typeof fn2==="function"){state=fn2({state:state,options:_options,name:name,instance:instance})||state}}},update:debounce((function(){return new Promise((function(resolve){instance.forceUpdate();resolve(state)}))})),destroy:function destroy(){cleanupModifierEffects();isDestroyed=true}};if(!areValidElements(reference2,popper2)){return instance}instance.setOptions(options).then((function(state2){if(!isDestroyed&&options.onFirstUpdate){options.onFirstUpdate(state2)}}));function runModifierEffects(){state.orderedModifiers.forEach((function(_ref){var name=_ref.name,_ref$options=_ref.options,options2=_ref$options===void 0?{}:_ref$options,effect2=_ref.effect;if(typeof effect2==="function"){var cleanupFn=effect2({state:state,name:name,instance:instance,options:options2});var noopFn=function noopFn2(){};effectCleanupFns.push(cleanupFn||noopFn)}}))}function cleanupModifierEffects(){effectCleanupFns.forEach((function(fn2){return fn2()}));effectCleanupFns=[]}return instance}}var defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1];var createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1});var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1];var createPopper=popperGenerator({defaultModifiers:defaultModifiers});class PbTextarea extends PbEnhancedElement{static get selector(){return".resize_auto textarea"}onInput(){this.style.height="auto";this.style.height=this.scrollHeight+"px"}connect(){this.element.setAttribute("style","height:"+this.element.scrollHeight+"px;overflow-y:hidden;");this.element.addEventListener("input",this.onInput,false)}}const mapTheme={marker:colors.primary_action,maptiles:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",flyToConfig:{zoom:13,bearing:0,curve:1.42,easing:function(t){return t},essential:true},zoomConfig:{duration:1e3},mapConfig:{style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",zoom:13,attributionControl:false}};const POPOVER_OFFSET_Y=[0,20];class PbPopover extends PbEnhancedElement{static get selector(){return"[data-pb-popover-kit]"}moveTooltip(){document.querySelector("body").appendChild(this.tooltip)}connect(){this.moveTooltip();this.popper=createPopper(this.triggerElement,this.tooltip,{placement:this.position,strategy:"fixed",modifiers:[{name:"offset",options:{offset:this.offset}}]});this.triggerElement.addEventListener("click",(event=>{event.preventDefault();event.stopPropagation();if(!this.tooltip.classList.contains("show")){this.checkCloseTooltip()}setTimeout((()=>{this.toggleTooltip();this.popper.update()}),0)}))}checkCloseTooltip(){document.querySelector("body").addEventListener("click",(({target:target})=>{const isTooltipElement=target.closest(`#${this.tooltipId}`)!==null;const isTriggerElement=target.closest(`#${this.triggerElementId}`)!==null;switch(this.closeOnClick){case"any":if(isTooltipElement||!isTooltipElement&&!isTriggerElement){this.hideTooltip()}break;case"outside":if(!isTooltipElement&&!isTriggerElement){this.hideTooltip()}break;case"inside":if(isTooltipElement){this.hideTooltip()}break}}),true)}hideTooltip(){this.tooltip.classList.remove("show");this.tooltip.classList.add("hide")}toggleTooltip(){this.tooltip.classList.toggle("show");this.tooltip.classList.toggle("hide")}get triggerElement(){return this._triggerElement=this._triggerElement||document.querySelector(`#${this.triggerElementId}`)}get tooltip(){return this._tooltip=this._tooltip||this.element.querySelector(`#${this.tooltipId}`)}get position(){return this.element.dataset.pbPopoverPosition}get triggerElementId(){return this.element.dataset.pbPopoverTriggerElementId}get tooltipId(){return this.element.dataset.pbPopoverTooltipId}get offset(){return this.element.dataset.pbPopoverOffset==="true"?POPOVER_OFFSET_Y:[0,0]}get closeOnClick(){return this.element.dataset.pbPopoverCloseOnClick}}const TOOLTIP_OFFSET=[0,20];const TOOLTIP_TIMEOUT=250;class PbTooltip extends PbEnhancedElement{static get selector(){return"[data-pb-tooltip-kit]"}connect(){this.triggerElements.forEach((trigger=>{trigger.addEventListener("mouseenter",(()=>{this.mouseenterTimeout=setTimeout((()=>{this.showTooltip(trigger);this.checkCloseTooltip(trigger)}),TOOLTIP_TIMEOUT);trigger.addEventListener("mouseleave",(()=>{clearTimeout(this.mouseenterTimeout);setTimeout((()=>{this.hideTooltip()}),0)}),{once:true})}))}));this.tooltip.addEventListener("mouseenter",(()=>{clearTimeout(this.mouseenterTimeout)}));this.tooltip.addEventListener("mouseleave",(()=>{this.hideTooltip()}))}checkCloseTooltip(trigger){document.querySelector("body").addEventListener("click",(({target:target})=>{const isTooltip=target.closest(`#${this.tooltipId}`)===this.tooltip;const isTrigger=target.closest(this.triggerElementSelector)===trigger;if(isTrigger||isTooltip){this.checkCloseTooltip(trigger)}else{this.hideTooltip()}}),{once:true})}showTooltip(trigger){if(this.shouldShowTooltip==="false")return;this.popper=createPopper$1(trigger,this.tooltip,{placement:this.position,strategy:"fixed",modifiers:[{name:"offset",options:{offset:TOOLTIP_OFFSET}},{name:"arrow",options:{element:document.querySelector(`#${this.tooltipId}-arrow`)}},offset$1,preventOverflow$1,flip$1]});this.tooltip.classList.add("show")}hideTooltip(){this.tooltip.classList.add("fade_out");setTimeout((()=>{if(!this.popper)return;this.popper.destroy();this.tooltip.classList.remove("show");this.tooltip.classList.remove("fade_out")}),TOOLTIP_TIMEOUT)}get triggerElements(){let triggerEl;if(this.triggerElementId){triggerEl=document.querySelector(`#${this.triggerElementId}`)}else{const selectorIsId=this.triggerElementSelector.indexOf("#")>-1;triggerEl=selectorIsId?document.querySelector(`${this.triggerElementSelector}`):document.querySelectorAll(`${this.triggerElementSelector}`)}if(!triggerEl){console.error("Tooltip Kit: an invalid or unavailable DOM reference was provided!");return[]}if(!triggerEl.length)triggerEl=[triggerEl];return this._triggerElements=this._triggerElements||triggerEl}get tooltip(){return this._tooltip=this._tooltip||this.element.querySelector(`#${this.tooltipId}`)}get position(){return this.element.dataset.pbTooltipPosition}get triggerElementId(){return this.element.dataset.pbTooltipTriggerElementId}get tooltipId(){return this.element.dataset.pbTooltipTooltipId}get triggerElementSelector(){return this.element.dataset.pbTooltipTriggerElementSelector}get shouldShowTooltip(){return this.element.dataset.pbTooltipShowTooltip}}class PbTypeahead extends PbEnhancedElement{static get selector(){return"[data-pb-typeahead-kit]"}connect(){this.element.addEventListener("keydown",(event=>this.handleKeydown(event)));this.searchInput.addEventListener("focus",(()=>this.debouncedSearch()));this.searchInput.addEventListener("input",(()=>this.debouncedSearch()));this.resultsElement.addEventListener("click",(event=>this.optionSelected(event)))}handleKeydown(event){if(event.key==="ArrowUp"){event.preventDefault();this.focusPreviousOption()}else if(event.key==="ArrowDown"){event.preventDefault();this.focusNextOption()}}search(){if(this.searchTerm.length<parseInt(this.searchTermMinimumLength))return this.clearResults();this.toggleResultsLoadingIndicator(true);this.showResults();const searchTerm=this.searchTerm;const searchContext=this.searchContext;const search={searchingFor:searchTerm,searchingContext:searchContext,setResults:results=>{this.resultsCacheUpdate(searchTerm,searchContext,results)}};this.element.dispatchEvent(new CustomEvent("pb-typeahead-kit-search",{bubbles:true,detail:search}))}resultsCacheUpdate(searchTerm,searchContext,results){const searchTermAndContext=this.cacheKeyFor(searchTerm,searchContext);if(this.resultsOptionCache.has(searchTermAndContext))this.resultsOptionCache.delete(searchTermAndContext);if(this.resultsOptionCache.size>32)this.resultsOptionCache.delete(this.resultsOptionCache.keys().next().value);this.resultsOptionCache.set(searchTermAndContext,results);this.showResults()}resultsCacheClear(){this.resultsOptionCache.clear()}get debouncedSearch(){return this._debouncedSearch=this._debouncedSearch||debounce$2(this.search,parseInt(this.searchDebounceTimeout)).bind(this)}showResults(){if(!this.resultsOptionCache.has(this.searchTermAndContext))return;this.toggleResultsLoadingIndicator(false);this.clearResults();for(const result of this.resultsOptionCache.get(this.searchTermAndContext)){this.resultsElement.appendChild(this.newResultOption(result.cloneNode(true)))}for(const result of this.resultsElement.querySelectorAll("[data-result-option-item]")){result.addEventListener("mousedown",(event=>this.optionSelected(event)))}}optionSelected(event){const resultOption=event.target.closest("[data-result-option-item]");if(!resultOption)return;this.resultsCacheClear();this.searchInputClear();this.clearResults();this.element.dispatchEvent(new CustomEvent("pb-typeahead-kit-result-option-selected",{bubbles:true,detail:{selected:resultOption,typeahead:this}}))}clearResults(){this.resultsElement.innerHTML=""}newResultOption(content){const resultOption=this.resultOptionTemplate.content.cloneNode(true);resultOption.querySelector('slot[name="content"]').replaceWith(content);return resultOption}focusPreviousOption(){const currentIndex=this.resultOptionItems.indexOf(this.currentSelectedResultOptionItem);const previousIndex=currentIndex-1;const previousOptionItem=this.resultOptionItems[previousIndex]||this.resultOptionItems[this.resultOptionItems.length-1];previousOptionItem.focus()}focusNextOption(){const currentIndex=this.resultOptionItems.indexOf(this.currentSelectedResultOptionItem);const nextIndex=currentIndex+1;const nextOptionItem=this.resultOptionItems[nextIndex]||this.resultOptionItems[0];nextOptionItem.focus()}get resultOptionItems(){return Array.from(this.resultsElement.querySelectorAll("[data-result-option-item]"))}get currentSelectedResultOptionItem(){return document.activeElement.closest("[data-result-option-item]")}get searchInput(){return this._searchInput=this._searchInput||this.element.querySelector('input[type="search"]')}get searchTerm(){return this.searchInput.value}get searchContext(){if(this._searchContext)return this._searchContext;const selector=this.element.dataset.searchContextValueSelector;if(selector)return(this.element.parentNode.querySelector(selector)||this.element.closest(selector)).value;return null}set searchContext(value){this._searchContext=value}get searchTermAndContext(){return this.cacheKeyFor(this.searchTerm,this.searchContext)}cacheKeyFor(searchTerm,searchContext){return[searchTerm,JSON.stringify(searchContext)].join()}searchInputClear(){this.searchInput.value=""}get searchTermMinimumLength(){return this.element.dataset.pbTypeaheadKitSearchTermMinimumLength}get searchDebounceTimeout(){return this.element.dataset.pbTypeaheadKitSearchDebounceTimeout}get resultsElement(){return this._resultsElement=this._resultsElement||this.element.querySelector("[data-pb-typeahead-kit-results]")}get resultOptionTemplate(){return this._resultOptionTemplate=this._resultOptionTemplate||this.element.querySelector("template[data-pb-typeahead-kit-result-option]")}get resultsOptionCache(){return this._resultsOptionCache=this._resultsOptionCache||new Map}get resultsLoadingIndicator(){return this._resultsLoadingIndicator=this._resultsLoadingIndicator||this.element.querySelector("[data-pb-typeahead-kit-loading-indicator]")}toggleResultsLoadingIndicator(visible){var visibilityProperty="0";if(visible)visibilityProperty="1";this.resultsLoadingIndicator.style.opacity=visibilityProperty}}const dialogHelper=()=>{const openTrigger=document.querySelectorAll("[data-open-dialog]");const closeTrigger=document.querySelectorAll("[data-close-dialog]");const dialogs=document.querySelectorAll(".pb_dialog_rails");const loadingButton=document.querySelector('[data-disable-with="Loading"]');if(loadingButton){loadingButton.addEventListener("click",(function(){const okayLoadingButton=document.querySelector('[data-disable-with="Loading"]');const cancelButton=document.querySelector('[data-disable-cancel-with="Loading"]');let currentClass=okayLoadingButton.className;let cancelClass=cancelButton?cancelButton.className:"";let newClass=currentClass.replace("_enabled","_disabled_loading");let newCancelClass=cancelClass.replace("_enabled","_disabled");okayLoadingButton.disabled=true;if(cancelButton)cancelButton.disabled=true;okayLoadingButton.className=newClass;if(cancelButton)cancelButton.className=newCancelClass}))}openTrigger.forEach((open=>{open.addEventListener("click",(()=>{var openTriggerData=open.dataset.openDialog;var targetDialog=document.getElementById(openTriggerData);if(targetDialog.open)return;targetDialog.showModal()}))}));closeTrigger.forEach((close=>{close.addEventListener("click",(()=>{var closeTriggerData=close.dataset.closeDialog;document.getElementById(closeTriggerData).close()}))}));dialogs.forEach((dialogElement=>{dialogElement.addEventListener("mousedown",(event=>{const dialogParentDataset=dialogElement.parentElement.dataset;if(dialogParentDataset.overlayClick==="overlay_close")return;const dialogModal=event.target.getBoundingClientRect();const clickedOutsideDialogModal=event.clientX<dialogModal.left||event.clientX>dialogModal.right||event.clientY<dialogModal.top||event.clientY>dialogModal.bottom;if(clickedOutsideDialogModal){dialogElement.close();event.stopPropagation()}}))}))};const formHelper=()=>{const loadingForm=document.querySelector(".pb_form_loading");if(loadingForm){loadingForm.addEventListener("submit",(function(event){const submitButton=event["submitter"];const cancelButton=event["target"].querySelector('button[type="reset"]');if(submitButton){let currentClass=submitButton.className;let newClass=currentClass.replace("_enabled","_disabled_loading");let cancelClass=cancelButton?cancelButton.className:"";let newCancelClass=cancelClass.replace("_enabled","_disabled");submitButton.disabled=true;submitButton.className=newClass;if(cancelButton){cancelButton.disabled=true;cancelButton.className=newCancelClass}}}))}};export{useCollapsible as A,getAugmentedNamespace as B,createPopper as C,DateTime as D,uniqueId as E,typography as F,cloneDeep as G,isString as H,mapTheme as I,PbEnhancedElement as P,datePickerHelper as a,dialogHelper as b,PbPopover as c,debounce$2 as d,PbTooltip as e,formHelper as f,PbTypeahead as g,PbTable as h,PbTextarea as i,getAllIcons as j,isEmpty as k,find as l,map as m,commonjsGlobal as n,omitBy as o,partial as p,getDefaultExportFromCjs as q,highchartsDarkTheme as r,highchartsTheme as s,noop as t,useDropdown as u,colors as v,filter as w,omit as x,get as y,merge as z};
@@ -1 +1 @@
1
- import{P as PbEnhancedElement,d as debounce}from"./lib-GRGYd9YR.js";const KIT_SELECTOR='[class^="pb_"][class*="_kit"]';const ERROR_MESSAGE_SELECTOR=".pb_body_kit_negative";const FORM_SELECTOR='form[data-pb-form-validation="true"]';const REQUIRED_FIELDS_SELECTOR="input[required],textarea[required],select[required]";const FIELD_EVENTS=["change","valid","invalid"];class PbFormValidation extends PbEnhancedElement{static get selector(){return FORM_SELECTOR}connect(){this.formValidationFields.forEach((field=>{FIELD_EVENTS.forEach((e=>{field.addEventListener(e,debounce((event=>{this.validateFormField(event)}),250),false)}))}))}validateFormField(event){event.preventDefault();const{target:target}=event;target.setCustomValidity("");const isValid=event.target.validity.valid;if(isValid){this.clearError(target)}else{this.showValidationMessage(target)}}showValidationMessage(target){const{parentElement:parentElement}=target;this.clearError(target);parentElement.closest(KIT_SELECTOR).classList.add("error");const errorMessageContainer=this.errorMessageContainer;if(target.dataset.message)target.setCustomValidity(target.dataset.message);errorMessageContainer.innerHTML=target.validationMessage;parentElement.appendChild(errorMessageContainer)}clearError(target){const{parentElement:parentElement}=target;parentElement.closest(KIT_SELECTOR).classList.remove("error");const errorMessageContainer=parentElement.querySelector(ERROR_MESSAGE_SELECTOR);if(errorMessageContainer)errorMessageContainer.remove()}get errorMessageContainer(){const errorContainer=document.createElement("div");const kitClassName=ERROR_MESSAGE_SELECTOR.replace(/\./,"");errorContainer.classList.add(kitClassName);return errorContainer}get formValidationFields(){return this._formValidationFields=this._formValidationFields||this.element.querySelectorAll(REQUIRED_FIELDS_SELECTOR)}}window.PbFormValidation=PbFormValidation;
1
+ import{P as PbEnhancedElement,d as debounce}from"./lib-BC6ESsxG.js";const KIT_SELECTOR='[class^="pb_"][class*="_kit"]';const ERROR_MESSAGE_SELECTOR=".pb_body_kit_negative";const FORM_SELECTOR='form[data-pb-form-validation="true"]';const REQUIRED_FIELDS_SELECTOR="input[required],textarea[required],select[required]";const FIELD_EVENTS=["change","valid","invalid"];class PbFormValidation extends PbEnhancedElement{static get selector(){return FORM_SELECTOR}connect(){this.formValidationFields.forEach((field=>{FIELD_EVENTS.forEach((e=>{field.addEventListener(e,debounce((event=>{this.validateFormField(event)}),250),false)}))}))}validateFormField(event){event.preventDefault();const{target:target}=event;target.setCustomValidity("");const isValid=event.target.validity.valid;if(isValid){this.clearError(target)}else{this.showValidationMessage(target)}}showValidationMessage(target){const{parentElement:parentElement}=target;this.clearError(target);parentElement.closest(KIT_SELECTOR).classList.add("error");const errorMessageContainer=this.errorMessageContainer;if(target.dataset.message)target.setCustomValidity(target.dataset.message);errorMessageContainer.innerHTML=target.validationMessage;parentElement.appendChild(errorMessageContainer)}clearError(target){const{parentElement:parentElement}=target;parentElement.closest(KIT_SELECTOR).classList.remove("error");const errorMessageContainer=parentElement.querySelector(ERROR_MESSAGE_SELECTOR);if(errorMessageContainer)errorMessageContainer.remove()}get errorMessageContainer(){const errorContainer=document.createElement("div");const kitClassName=ERROR_MESSAGE_SELECTOR.replace(/\./,"");errorContainer.classList.add(kitClassName);return errorContainer}get formValidationFields(){return this._formValidationFields=this._formValidationFields||this.element.querySelectorAll(REQUIRED_FIELDS_SELECTOR)}}window.PbFormValidation=PbFormValidation;
@@ -1 +1 @@
1
- import"./_weekday_stacked-BP8UVQtC.js";import"./lazysizes-B7xYodB-.js";import"./_typeahead-DPeGdNBp.js";import"./lib-GRGYd9YR.js";import"react/jsx-runtime";import"react";import"react-dom";import"react-trix";import"trix";import"react-is";
1
+ import"./_weekday_stacked-uMIX8f-A.js";import"./lazysizes-B7xYodB-.js";import"./_typeahead-D0PihN_3.js";import"./lib-BC6ESsxG.js";import"react/jsx-runtime";import"react";import"react-dom";import"react-trix";import"trix";import"react-is";