playbook_ui 18.2.0.pre.rc.2 → 18.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_background/_background.tsx +3 -1
  3. data/app/pb_kits/playbook/pb_background/kit.schema.json +1 -0
  4. data/app/pb_kits/playbook/pb_caption/_caption.tsx +3 -1
  5. data/app/pb_kits/playbook/pb_caption/kit.schema.json +1 -0
  6. data/app/pb_kits/playbook/pb_container/_container.tsx +3 -1
  7. data/app/pb_kits/playbook/pb_container/kit.schema.json +1 -0
  8. data/app/pb_kits/playbook/pb_currency/_currency.tsx +3 -1
  9. data/app/pb_kits/playbook/pb_currency/kit.schema.json +1 -0
  10. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +3 -1
  11. data/app/pb_kits/playbook/pb_dashboard_value/kit.schema.json +1 -0
  12. data/app/pb_kits/playbook/pb_detail/_detail.tsx +3 -1
  13. data/app/pb_kits/playbook/pb_detail/kit.schema.json +1 -0
  14. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +6 -5
  15. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom.md +7 -2
  16. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom_rails.md +7 -2
  17. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_enable_time.html.erb +33 -0
  18. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_enable_time.jsx +42 -0
  19. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_enable_time.md +24 -0
  20. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_highlight.jsx +101 -0
  21. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_highlight.md +3 -0
  22. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +3 -0
  23. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -0
  24. data/app/pb_kits/playbook/pb_dropdown/index.js +19 -10
  25. data/app/pb_kits/playbook/pb_dropdown/quickpick/index.ts +60 -18
  26. data/app/pb_kits/playbook/pb_dropdown/quickpick_helper.rb +92 -3
  27. data/app/pb_kits/playbook/pb_dropdown/utilities/index.ts +8 -1
  28. data/app/pb_kits/playbook/pb_dropdown/utilities/quickpickDateSync.ts +137 -0
  29. data/app/pb_kits/playbook/pb_filter/Filter/InteractiveFilter.tsx +1 -1
  30. data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +3 -1
  31. data/app/pb_kits/playbook/pb_highlight/kit.schema.json +1 -0
  32. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +3 -1
  33. data/app/pb_kits/playbook/pb_icon_stat_value/kit.schema.json +1 -0
  34. data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +3 -1
  35. data/app/pb_kits/playbook/pb_icon_value/kit.schema.json +1 -0
  36. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +3 -1
  37. data/app/pb_kits/playbook/pb_label_value/kit.schema.json +1 -0
  38. data/app/pb_kits/playbook/pb_map/docs/_map_default.md +3 -3
  39. data/app/pb_kits/playbook/pb_message/_message.tsx +3 -1
  40. data/app/pb_kits/playbook/pb_message/kit.schema.json +1 -0
  41. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +3 -1
  42. data/app/pb_kits/playbook/pb_multiple_users/kit.schema.json +1 -0
  43. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +4 -2
  44. data/app/pb_kits/playbook/pb_multiple_users_stacked/kit.schema.json +1 -0
  45. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/MoreExtensionsDropdown.tsx +10 -3
  46. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +16 -1
  47. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +2 -3
  48. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.overrides.json +2 -3
  49. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_attributes.jsx +1 -5
  50. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.jsx +1 -5
  51. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.md +2 -3
  52. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.jsx +1 -5
  53. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.jsx +3 -13
  54. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.jsx +1 -5
  55. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.jsx +2 -3
  56. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_markdown_support.jsx +1 -2
  57. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.jsx +3 -13
  58. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_preview.jsx +1 -5
  59. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.jsx +1 -5
  60. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_simple.jsx +1 -5
  61. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_sticky.jsx +1 -5
  62. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_templates.jsx +1 -5
  63. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_more_extensions.jsx +3 -8
  64. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_more_extensions.md +1 -1
  65. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.md +2 -2
  66. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.test.js +2 -1
  67. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_advanced.test.js +7 -5
  68. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_rails.js +15 -4
  69. data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +3 -1
  70. data/app/pb_kits/playbook/pb_stat_value/kit.schema.json +1 -0
  71. data/app/pb_kits/playbook/pb_table/_table.tsx +70 -197
  72. data/app/pb_kits/playbook/pb_table/index.ts +53 -122
  73. data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +26 -3
  74. data/app/pb_kits/playbook/pb_table/utilities/stickyColumns.test.ts +266 -0
  75. data/app/pb_kits/playbook/pb_table/utilities/stickyColumns.ts +145 -0
  76. data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +3 -1
  77. data/app/pb_kits/playbook/pb_title_count/kit.schema.json +1 -0
  78. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +3 -1
  79. data/app/pb_kits/playbook/pb_title_detail/kit.schema.json +1 -0
  80. data/app/pb_kits/playbook/utilities/test/globalProps/onClick.test.js +237 -0
  81. data/dist/ai/all-schemas.json +16 -0
  82. data/dist/ai/forms.json +1 -1
  83. data/dist/ai/index.json +2 -2
  84. data/dist/ai/kits/background.schema.json +1 -0
  85. data/dist/ai/kits/caption.schema.json +1 -0
  86. data/dist/ai/kits/container.schema.json +1 -0
  87. data/dist/ai/kits/currency.schema.json +1 -0
  88. data/dist/ai/kits/dashboard_value.schema.json +1 -0
  89. data/dist/ai/kits/detail.schema.json +1 -0
  90. data/dist/ai/kits/highlight.schema.json +1 -0
  91. data/dist/ai/kits/icon_stat_value.schema.json +1 -0
  92. data/dist/ai/kits/icon_value.schema.json +1 -0
  93. data/dist/ai/kits/label_value.schema.json +1 -0
  94. data/dist/ai/kits/message.schema.json +1 -0
  95. data/dist/ai/kits/multiple_users.schema.json +1 -0
  96. data/dist/ai/kits/multiple_users_stacked.schema.json +1 -0
  97. data/dist/ai/kits/stat_value.schema.json +1 -0
  98. data/dist/ai/kits/title_count.schema.json +1 -0
  99. data/dist/ai/kits/title_detail.schema.json +1 -0
  100. data/dist/ai/playgrounds/rich_text_editor.json +1 -1
  101. data/dist/chunks/{_detail-BqqzPTNr.js → _detail-Bsvl694i.js} +2 -2
  102. data/dist/chunks/{_pb_line_graph-BGyCJjgG.js → _pb_line_graph-Du7xE9vl.js} +1 -1
  103. data/dist/chunks/_table-Bf6LGyL9.js +1 -0
  104. data/dist/chunks/_typeahead-w6S5Vx4b.js +1 -0
  105. data/dist/chunks/{globalProps-K1DCn3il.js → globalProps-B120NbSJ.js} +1 -1
  106. data/dist/chunks/{lib-7vm9BMqp.js → lib-Buo6zHEw.js} +1 -1
  107. data/dist/chunks/quickpickDateSync-DLDx4zce.js +1 -0
  108. data/dist/chunks/{time_picker_helper-BZutIzB3.js → time_picker_helper-CYGg0UQ0.js} +1 -1
  109. data/dist/chunks/vendor.js +2 -2
  110. data/dist/playbook-rails-react-bindings.js +1 -1
  111. data/dist/playbook-rails.js +1 -1
  112. data/dist/playbook.css +1 -1
  113. data/lib/playbook/version.rb +1 -1
  114. metadata +19 -13
  115. data/dist/chunks/_table-CEZU0qUK.js +0 -1
  116. data/dist/chunks/_typeahead-C7iPR5ZF.js +0 -1
@@ -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 p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}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 self={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;self.monthsContainer=fp._createElement("div","flatpickr-monthSelect-months");self.monthsContainer.tabIndex=-1;buildMonths();fp.rContainer.appendChild(self.monthsContainer);fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-"+config.theme)}function buildMonths(){if(!self.monthsContainer)return;clearNode2(self.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)}self.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(self.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||!self.monthsContainer)return;var currentlySelected=fp.rContainer.querySelector(".flatpickr-monthSelect-month.selected");var index=Array.prototype.indexOf.call(self.monthsContainer.children,document.activeElement);if(index===-1){var target=currentlySelected||self.monthsContainer.firstElementChild;target.focus();index=target.$i}if(shouldMove){self.monthsContainer.children[(12+index+shifts[e.keyCode])%12].focus()}else if(e.keyCode===13&&self.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(self.monthsContainer!==null){var months2=self.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$1);return monthSelect$1.exports}var monthSelectExports=requireMonthSelect();const monthSelectPlugin=getDefaultExportFromCjs(monthSelectExports);var weekSelect$2={exports:{}};var weekSelect$1=weekSelect$2.exports;var hasRequiredWeekSelect;function requireWeekSelect(){if(hasRequiredWeekSelect)return weekSelect$2.exports;hasRequiredWeekSelect=1;(function(module,exports){(function(global,factory){module.exports=factory()})(weekSelect$1,(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$2);return weekSelect$2.exports}var weekSelectExports=requireWeekSelect();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?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?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;const originalClear=fp.clear;fp.clear=function(...args){const current=pluginData.rangesNav.querySelector(".active");if(current){current.classList.remove("active")}activeLabel="";return originalClear.apply(this,args)};if(!isLabelMatchingSelectedDates(selectedDates)){(_a=pluginData.rangesButtons[activeLabel])==null?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 PB_DIALOG_FLOATING_ROOT_SELECTOR="[data-pb-dialog-floating-root]";const PB_FULLSCREEN_OVERLAY_SELECTOR=".fullscreen-overlay";const PB_MODAL_ABOVE_FULLSCREEN_Z_INDEX=1e6;const PB_FLOATING_OWNER_ATTR="data-pb-floating-owner";const DIALOG_DIRECT_FLOATING_ROOT=`:scope > ${PB_DIALOG_FLOATING_ROOT_SELECTOR}`;const POPOVER_FLOATING_ROOT=`:scope > .pb_popover_body > ${PB_DIALOG_FLOATING_ROOT_SELECTOR}`;function resolveDialogFloatingPortalHost(fromElement){const dialogEl=fromElement==null?void 0:fromElement.closest("dialog");if(dialogEl){return dialogEl.querySelector(DIALOG_DIRECT_FLOATING_ROOT)??dialogEl}const reactModalShell=fromElement==null?void 0:fromElement.closest(".pb_dialog");if(reactModalShell){return reactModalShell.querySelector(DIALOG_DIRECT_FLOATING_ROOT)??reactModalShell}const popoverEl=fromElement==null?void 0:fromElement.closest(".pb_popover_tooltip");if(popoverEl){return popoverEl.querySelector(POPOVER_FLOATING_ROOT)??popoverEl.querySelector(PB_DIALOG_FLOATING_ROOT_SELECTOR)??popoverEl}return null}function resolveFullscreenOverlayForElement(element){const overlay=element==null?void 0:element.closest(PB_FULLSCREEN_OVERLAY_SELECTOR);return overlay instanceof HTMLElement?overlay:null}function resolveFullscreenFloatingPortalHost(fromElement){const overlay=resolveFullscreenOverlayForElement(fromElement);if(!overlay)return null;return overlay.querySelector(DIALOG_DIRECT_FLOATING_ROOT)??overlay}function resolvePortaledKitHost(kitRoot,dialogCtxTarget){if(typeof document==="undefined")return null;if(kitRoot==null?void 0:kitRoot.closest(".pb_popover_tooltip")){const fullscreenHost=resolveFullscreenFloatingPortalHost(kitRoot);if(fullscreenHost){return fullscreenHost}return document.body}return resolveDialogFloatingPortalHost(kitRoot)??resolveFullscreenFloatingPortalHost(kitRoot)??dialogCtxTarget??null}function kitRequiresPortaledFloatingUi(kitRoot){if(!kitRoot)return false;return kitRoot.closest(".pb_popover_tooltip")!==null||kitRoot.closest("dialog")!==null||kitRoot.closest(".pb_dialog")!==null||kitRoot.closest(PB_FULLSCREEN_OVERLAY_SELECTOR)!==null}function resolveFloatingOwnerId(kitRoot){if(!kitRoot)return null;const marked=kitRoot.closest(`[${PB_FLOATING_OWNER_ATTR}]`);if(marked){return marked.getAttribute(PB_FLOATING_OWNER_ATTR)}const popoverTooltip=kitRoot.closest(".pb_popover_tooltip");if(popoverTooltip==null?void 0:popoverTooltip.id){return popoverTooltip.id}const dialogShell=kitRoot.closest("dialog, .pb_dialog");if(dialogShell==null?void 0:dialogShell.id){return dialogShell.id}return null}function setFloatingOwnerAttribute(element,ownerId){if(!element)return;if(ownerId){element.setAttribute(PB_FLOATING_OWNER_ATTR,ownerId)}else{element.removeAttribute(PB_FLOATING_OWNER_ATTR)}}function ownerScopeSelector(ownerId){return`[${PB_FLOATING_OWNER_ATTR}="${CSS.escape(ownerId)}"]`}function isPortaledFloatingMenuNode(target){return target.closest(".typeahead-kit-select__menu-portal")!==null||target.closest(".pb_multi_level_select_floating_shell")!==null||target.closest(".pb_dropdown_floating_shell")!==null||target.closest(".pb_date_picker_floating_shell")!==null||target.closest(".flatpickr-calendar")!==null||target.closest(".pb_time_picker_floating_shell")!==null||target.closest(".pb_time_picker_panel_portal")!==null||target.closest(".pb_time_picker_container")!==null||target.closest(".time_dropdown")!==null||target.closest(".time_dropdown_option")!==null}const PORTAL_OWNER_HIT_TEST_SELECTORS=[".typeahead-kit-select__menu-portal",".pb_multi_level_select_floating_shell",".pb_dropdown_floating_shell",".pb_date_picker_floating_shell",".flatpickr-calendar",".pb_time_picker_floating_shell",".pb_time_picker_panel_portal",".pb_time_picker_container",".time_dropdown",".time_dropdown_option"].join(", ");function pointInVisibleRect(x,y,rect){return rect.width>0&&rect.height>0&&x>=rect.left&&x<=rect.right&&y>=rect.top&&y<=rect.bottom}function portaledFloatingOwnerMenusAtPoint(x,y,ownerId){if(typeof document==="undefined"){return false}const roots=document.querySelectorAll(ownerScopeSelector(ownerId));for(const root of roots){if(root.classList.contains("pb_popover_tooltip")||root.classList.contains("pb_popover_body")||root.classList.contains("pb_popover_floating_root")){continue}const candidates=[root];root.querySelectorAll(PORTAL_OWNER_HIT_TEST_SELECTORS).forEach((node=>{candidates.push(node)}));for(const node of candidates){if(pointInVisibleRect(x,y,node.getBoundingClientRect())){return true}}}return false}function eventTargetAsElement(target){if(!target)return null;if(target instanceof HTMLElement)return target;if(target instanceof Node){return target.parentElement}return null}function isNativeSelectMenuInteraction(dialogElement,target){const el=eventTargetAsElement(target);const selectFromTarget=el instanceof HTMLSelectElement?el:(el==null?void 0:el.closest("select"))??null;if(selectFromTarget instanceof HTMLSelectElement&&dialogElement.contains(selectFromTarget)){return true}const active=document.activeElement;return active instanceof HTMLSelectElement&&dialogElement.contains(active)}function targetIsInsidePortaledFloatingKit(target,ownerId){if(!isPortaledFloatingMenuNode(target)){return false}if(!ownerId){return true}return target.closest(ownerScopeSelector(ownerId))!==null}function portaledFloatingKitAtPoint(x,y,ownerId){if(typeof document==="undefined"){return false}try{if(typeof document.elementsFromPoint==="function"){return document.elementsFromPoint(x,y).some((el=>{if(!(el instanceof HTMLElement))return false;return targetIsInsidePortaledFloatingKit(el,ownerId)}))}if(typeof document.elementFromPoint==="function"){const el=document.elementFromPoint(x,y);return el instanceof HTMLElement&&targetIsInsidePortaledFloatingKit(el,ownerId)}}catch{return false}return false}let portaledMenuPointerDown=null;function recordPortaledMenuPointerDown(ownerId,x,y){portaledMenuPointerDown={ownerId:ownerId,x:x,y:y,at:Date.now()}}function matchesPortaledMenuPointerDown(ownerId,x,y,maxAgeMs=750){const rec=portaledMenuPointerDown;if(!rec||rec.ownerId!==ownerId)return false;if(Date.now()-rec.at>maxAgeMs)return false;return Math.abs(rec.x-x)<=2&&Math.abs(rec.y-y)<=2}function isPortaledFloatingKitInteraction(target,ownerId,clientX,clientY){const el=eventTargetAsElement(target);if(el&&targetIsInsidePortaledFloatingKit(el,ownerId)){return true}if(clientX==null||clientY==null){return false}if(ownerId&&matchesPortaledMenuPointerDown(ownerId,clientX,clientY)){return true}if(ownerId&&portaledFloatingOwnerMenusAtPoint(clientX,clientY,ownerId)){return true}return portaledFloatingKitAtPoint(clientX,clientY,ownerId)}const PB_PORTALED_FLOATING_Z_INDEX="1002";const PB_PORTALED_FLOATING_Z_INDEX_MAX=10009;let portaledFloatingZIndexSeq=Number(PB_PORTALED_FLOATING_Z_INDEX);function nextPortaledFloatingZIndex(){portaledFloatingZIndexSeq=Math.min(portaledFloatingZIndexSeq+1,PB_PORTALED_FLOATING_Z_INDEX_MAX);return String(portaledFloatingZIndexSeq)}function resolvePortaledFloatingZIndex(_portalHost,preferred){const z=Number(preferred??PB_PORTALED_FLOATING_Z_INDEX);return String(Math.min(z,PB_PORTALED_FLOATING_Z_INDEX_MAX))}const PB_FLOATING_KIT_OPEN_EVENT="pb-floating-kit-open";function announceFloatingKitOpen(kitKind,ownerId){if(typeof document==="undefined")return;document.dispatchEvent(new CustomEvent(PB_FLOATING_KIT_OPEN_EVENT,{detail:{kitKind:kitKind,ownerId:ownerId}}))}function subscribeFloatingKitOpen(handler){if(typeof document==="undefined"){return()=>void 0}const listener=event=>{handler(event.detail)};document.addEventListener(PB_FLOATING_KIT_OPEN_EVENT,listener);return()=>document.removeEventListener(PB_FLOATING_KIT_OPEN_EVENT,listener)}function isPortalCoordinateRootBody(el){return el!=null&&el.nodeName==="BODY"}function positionFloatingShellToInput(args){const{shell:shell,inputViewportRect:inputViewportRect,menuEl:menuEl,maxMenuHeightPx:maxMenuHeightPx,positionHost:positionHost,styleTarget:styleTarget}=args;const coordHost=positionHost??shell.parentElement;if(!coordHost)return;const box=styleTarget??shell;const coordTopPx=inputViewportRect.bottom+4;box.style.margin="0";box.style.padding="0";box.style.pointerEvents="auto";box.style.zIndex=resolvePortaledFloatingZIndex(coordHost,args.zIndex??PB_PORTALED_FLOATING_Z_INDEX);box.style.width=`${Math.round(inputViewportRect.width)}px`;if(isPortalCoordinateRootBody(coordHost)){box.style.position="fixed";box.style.left=`${Math.round(inputViewportRect.left)}px`;box.style.top=`${Math.round(coordTopPx)}px`}else{const hr=coordHost.getBoundingClientRect();box.style.position="absolute";box.style.left=`${Math.round(inputViewportRect.left-hr.left)}px`;box.style.top=`${Math.round(inputViewportRect.bottom-hr.top+4)}px`}if(menuEl){const mh=Math.round(maxMenuHeightPx);menuEl.style.maxHeight=`${mh}px`;menuEl.style.overflow="auto"}}function positionDropdownPortalToWrapper(args){const margin=args.marginPx??5;const matchWrapperWidth=args.matchWrapperWidth??true;const preferBelow=args.preferBelow??false;const{panel:panel,wrapperViewportRect:wr,positionHost:positionHost}=args;const h=panel.getBoundingClientRect().height||panel.scrollHeight||0;const spaceBelow=window.innerHeight-wr.bottom;const spaceAbove=wr.top;let topPx;if(!preferBelow&&h>0&&spaceBelow<h+10&&spaceAbove>=h+10){topPx=wr.top-h-margin}else{topPx=wr.bottom+margin}panel.style.margin="0";panel.style.pointerEvents="auto";panel.style.zIndex=resolvePortaledFloatingZIndex(positionHost,args.zIndex??PB_PORTALED_FLOATING_Z_INDEX);if(matchWrapperWidth){panel.style.width=`${Math.round(wr.width)}px`}else{panel.style.removeProperty("width")}if(isPortalCoordinateRootBody(positionHost)){panel.style.position="fixed";panel.style.left=`${Math.round(wr.left)}px`;panel.style.top=`${Math.round(topPx)}px`}else{const hr=positionHost.getBoundingClientRect();panel.style.position="absolute";panel.style.left=`${Math.round(wr.left-hr.left)}px`;panel.style.top=`${Math.round(topPx-hr.top)}px`}}function subscribeFloatingKitReposition(reposition){if(typeof window==="undefined"||typeof document==="undefined"){return()=>void 0}const scrollOpts={capture:true,passive:true};let rafId=null;const run=()=>{if(rafId!=null)return;rafId=requestAnimationFrame((()=>{rafId=null;reposition()}))};window.addEventListener("scroll",run,scrollOpts);document.addEventListener("scroll",run,scrollOpts);window.addEventListener("resize",run);const vv=window.visualViewport;if(vv){vv.addEventListener("scroll",run);vv.addEventListener("resize",run)}return()=>{if(rafId!=null){cancelAnimationFrame(rafId);rafId=null}window.removeEventListener("scroll",run,scrollOpts);document.removeEventListener("scroll",run,scrollOpts);window.removeEventListener("resize",run);if(vv){vv.removeEventListener("scroll",run);vv.removeEventListener("resize",run)}}}const{angleDown:angleDown,angleLeft:angleLeft,angleRight:angleRight}=getAllIcons();const angleDownString=angleDown.string;const angleLeftString=angleLeft.string;const angleRightString=angleRight.string;const getPositionElement=element=>typeof element==="string"?document.querySelectorAll(element)[0]:element;const dateTokenWidths={Y:4,d:2,j:2,m:2,n:2,y:2};const escapeForCharacterClass=char=>char.replace(/[\\\]^-]/g,"\\$&");const withDateSeparators=(dateStr,format)=>{if(typeof dateStr!=="string")return dateStr;const tokens=[...(format||"").split(" ")[0]];const expectedLength=tokens.reduce(((total,token)=>total+(dateTokenWidths[token]||0)),0);const hasUnsupportedToken=tokens.some((token=>/[a-z]/i.test(token)&&!dateTokenWidths[token]));if(hasUnsupportedToken||expectedLength===0)return dateStr;const separators=[...new Set(tokens.filter((token=>!dateTokenWidths[token])))];const separatorClass=separators.map(escapeForCharacterClass).join("");const match=dateStr.match(new RegExp(`^(\\s*)([\\d${separatorClass}]*\\d)([\\s\\S]*)$`));if(!match)return dateStr;const[,leadingSpace,dateRun,rest]=match;const digits=separatorClass?dateRun.replace(new RegExp(`[${separatorClass}]`,"g"),""):dateRun;if(digits.length!==expectedLength)return dateStr;let position=0;const dated=tokens.map((token=>{const width=dateTokenWidths[token];if(!width)return token;position+=width;return digits.slice(position-width,position)})).join("");return`${leadingSpace}${dated}${rest}`};const datePickerHelper=(config,scrollContainer)=>{var _a,_b,_c;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",yearAscending:yearAscending,yearRange:yearRange,controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith,dialogPortalTarget:dialogPortalTarget,inline:inline=false}=config;const inputElForPortal=typeof document!=="undefined"?document.querySelector(`#${String(pickerId)}`):null;const kitRootForPortal=inputElForPortal==null?void 0:inputElForPortal.closest(".pb_date_picker_kit");const portalHost=!inline&&kitRootForPortal&&kitRequiresPortaledFloatingUi(kitRootForPortal)?resolvePortaledKitHost(kitRootForPortal,dialogPortalTarget??null):null;const floatingOwnerId=resolveFloatingOwnerId(kitRootForPortal);const effectiveStatic=portalHost?false:staticPosition;const existingInput=document.querySelector(`#${String(pickerId)}`);if(existingInput==null?void 0:existingInput._pbDatePickerOpenUnsub){existingInput._pbDatePickerOpenUnsub();delete existingInput._pbDatePickerOpenUnsub}if(existingInput==null?void 0:existingInput._flatpickr){existingInput._flatpickr.destroy()}let portalAppendShell;const removePortalShell=()=>{if(!portalHost)return;const shellSelector=`[data-pb-date-picker-floating-shell="${String(pickerId)}"]`;const shell=(portalAppendShell==null?void 0:portalAppendShell.isConnected)?portalAppendShell:portalHost.querySelector(shellSelector);shell==null?void 0:shell.remove();portalAppendShell=void 0};const ensurePortalShell=()=>{if(!portalHost)return void 0;if(portalAppendShell==null?void 0:portalAppendShell.isConnected)return portalAppendShell;const shellSelector=`[data-pb-date-picker-floating-shell="${String(pickerId)}"]`;portalAppendShell=portalHost.querySelector(shellSelector);if(!portalAppendShell){portalAppendShell=document.createElement("div");portalAppendShell.className="pb_date_picker_floating_shell pb_date_picker_kit";portalAppendShell.setAttribute("data-pb-date-picker-floating-shell",String(pickerId));portalAppendShell.addEventListener("mousedown",(e=>{e.stopPropagation()}));portalAppendShell.addEventListener("click",(e=>{e.stopPropagation()}));portalHost.appendChild(portalAppendShell)}setFloatingOwnerAttribute(portalAppendShell,floatingOwnerId);return portalAppendShell};const mountCalendarInPortalShell=fp=>{const shell=ensurePortalShell();if(!(shell==null?void 0:shell.isConnected)||!fp.calendarContainer)return;if(fp.calendarContainer.parentElement!==shell){shell.appendChild(fp.calendarContainer)}};let activePortalZIndex;let unsubscribeFloatingReposition=null;const defaultDateGetter=()=>{if(defaultDate===""){return null}else{return defaultDate}};const getMinMaxYears=()=>{const[minYear,maxYear]=yearRange;const extractYear=dateOption=>{if(!dateOption)return null;if(typeof dateOption==="number"){return dateOption}if(typeof dateOption==="string"){const match=dateOption.match(/\b(19|20)\d{2}\b/);return match?parseInt(match[0],10):null}if(dateOption instanceof Date){return dateOption.getFullYear()}return null};const setMinYear2=minDate?extractYear(minDate)??minYear:minYear;const setMaxYear2=maxDate?extractYear(maxDate)??maxYear:maxYear;return{setMinYear:setMinYear2,setMaxYear:setMaxYear2}};const{setMinYear:setMinYear,setMaxYear:setMaxYear}=getMinMaxYears();const getMinMaxDates=()=>{const setMinDate2=minDate||`01/01/${setMinYear}`;const setMaxDate2=maxDate||`12/31/${setMaxYear}`;return{setMinDate:setMinDate2,setMaxDate:setMaxDate2}};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?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 positionCalendarIfNeeded=fp=>{if(portalHost){mountCalendarInPortalShell(fp);fp._positionCalendar();return}const cal=document.querySelector(`#cal-${pickerId}`);if(!cal)return;const inputRect=fp.input.getBoundingClientRect();const h=cal.getBoundingClientRect().height||300;const spaceBelow=window.innerHeight-inputRect.bottom;const spaceAbove=inputRect.top;if(spaceBelow<h+10&&spaceAbove>=h+10){if(effectiveStatic){cal.style.top="auto";cal.style.bottom="calc(100% + 5px)"}else{cal.style.position="fixed";cal.style.top=`${Math.max(10,inputRect.top-h-5)}px`;cal.style.left=`${inputRect.left}px`}}else if(effectiveStatic){cal.style.top="";cal.style.bottom=""}else{Object.assign(cal.style,{position:"",top:"",left:"",bottom:"",right:"",transform:""});fp._positionCalendar()}};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 scrollEvent=()=>{var _a2;const fp=(_a2=document.querySelector(`#${pickerId}`))==null?void 0:_a2._flatpickr;fp==null?void 0:fp._positionCalendar()};function attachToScroll(scrollParent){var _a2;(_a2=document.querySelectorAll(scrollParent)[0])==null?void 0:_a2.addEventListener("scroll",scrollEvent,{passive:true})}function detachFromScroll(scrollParent=document.body){var _a2;(_a2=document.querySelectorAll(scrollParent)[0])==null?void 0:_a2.removeEventListener("scroll",scrollEvent)}const yearSelectId=`year-${pickerId}`;const yearDropdownFromCalendar=fp=>{var _a2;return((_a2=fp.calendarContainer)==null?void 0:_a2.querySelector(`#${yearSelectId}`))??null};const yearDropdownIsReady=fp=>{const dropdown=yearDropdownFromCalendar(fp);return dropdown!==null&&dropdown.options.length>0};const yearChangeHook=fp=>{var _a2;const yearInput=yearDropdownFromCalendar(fp);if(yearInput){yearInput.value=(_a2=fp.currentYear)==null?void 0:_a2.toString()}};const handleDatePickerChange=(fp,selectedDates)=>{const inputEl=fp.input;if(inputEl){const inlineDatePickerElem=inputEl.closest(".inline-date-picker");if(inlineDatePickerElem){if(selectedDates&&selectedDates.length>0){inlineDatePickerElem.classList.add("show-angle-down-icon")}else{inlineDatePickerElem.classList.remove("show-angle-down-icon")}}}};let resizeRepositionHandlerRef=null;const{setMinDate:setMinDate,setMaxDate:setMaxDate}=getMinMaxDates();const toDateObject=dateValue=>{if(!dateValue)return null;if(dateValue instanceof Date){return isNaN(dateValue.getTime())?null:dateValue}if(typeof dateValue==="string"){const parsed=new Date(dateValue);return isNaN(parsed.getTime())?null:parsed}if(typeof dateValue==="number"){return new Date(dateValue)}return null};const formatDateForFlatpickr=dateValue=>{const dateObj=toDateObject(dateValue);if(!dateObj)return null;const year=dateObj.getFullYear();const month=String(dateObj.getMonth()+1).padStart(2,"0");const day=String(dateObj.getDate()).padStart(2,"0");return`${year}-${month}-${day}`};const isDefaultDateBeforeMinDate=(defaultDateValue2,minDateValue)=>{if(!defaultDateValue2||!minDateValue)return false;const defaultDateObj=toDateObject(defaultDateValue2);const minDateObj=toDateObject(minDateValue);if(!defaultDateObj||!minDateObj)return false;const defaultDateOnly=new Date(defaultDateObj.getFullYear(),defaultDateObj.getMonth(),defaultDateObj.getDate());const minDateOnly=new Date(minDateObj.getFullYear(),minDateObj.getMonth(),minDateObj.getDate());return defaultDateOnly<minDateOnly};const isDefaultDateAfterMaxDate=(defaultDateValue2,maxDateValue)=>{if(!defaultDateValue2||!maxDateValue)return false;const defaultDateObj=toDateObject(defaultDateValue2);const maxDateObj=toDateObject(maxDateValue);if(!defaultDateObj||!maxDateObj)return false;const defaultDateOnly=new Date(defaultDateObj.getFullYear(),defaultDateObj.getMonth(),defaultDateObj.getDate());const maxDateOnly=new Date(maxDateObj.getFullYear(),maxDateObj.getMonth(),maxDateObj.getDate());return defaultDateOnly>maxDateOnly};const defaultDateValue=defaultDateGetter();const isBeforeMin=minDate&&isDefaultDateBeforeMinDate(defaultDateValue,setMinDate);const isAfterMax=maxDate&&isDefaultDateAfterMaxDate(defaultDateValue,setMaxDate);const hasOutOfRangeDefault=(isBeforeMin||isAfterMax)&&defaultDateValue;const effectiveMinDate=isBeforeMin&&defaultDateValue&&minDate?formatDateForFlatpickr(defaultDateValue)||setMinDate:setMinDate;const effectiveMaxDate=isAfterMax&&defaultDateValue&&maxDate?formatDateForFlatpickr(defaultDateValue)||setMaxDate:setMaxDate;const resolveDatePickerPortalWrapper=input=>input.closest(".date_picker_input_wrapper")??input.closest(".text_input_wrapper")??input.closest(".input_wrapper")??input.closest(".pb_date_picker_kit");const portalPositionFn=portalHost?self=>{mountCalendarInPortalShell(self);const shell=ensurePortalShell();const cal=self.calendarContainer;if(!cal||!shell)return;const wrap=resolveDatePickerPortalWrapper(self.input);const host=shell.parentElement;if(!wrap||!host)return;positionDropdownPortalToWrapper({panel:cal,wrapperViewportRect:wrap.getBoundingClientRect(),positionHost:host,matchWrapperWidth:selectionType==="quickpick",zIndex:activePortalZIndex})}:void 0;const setupYearMonthDropdowns=fp=>{var _a2,_b2,_c2,_d,_e;if(yearDropdownIsReady(fp)||!((_b2=(_a2=fp.yearElements)==null?void 0:_a2[0])==null?void 0:_b2.parentElement))return;fp.yearElements[0].parentElement.innerHTML=`<select class="numInput cur-year" type="number" tabIndex="-1" aria-label="Year" id="${yearSelectId}"></select>`;let years="";if(yearAscending){for(let year=setMinYear;year<=setMaxYear;year++){years+=`<option value="${year}">${year}</option>`}}else{for(let year=setMaxYear;year>=setMinYear;year--){years+=`<option value="${year}">${year}</option>`}}const dropdown=yearDropdownFromCalendar(fp);if(!dropdown)return;dropdown.innerHTML=years;dropdown.value=String(fp.currentYear);dropdown.addEventListener("input",(e=>{fp.changeYear(Number(e.target.value))}));if(fp.input.form){fp.input.form.addEventListener("reset",(()=>{setTimeout((()=>{dropdown.value=String(fp.currentYear);if(fp.monthsDropdownContainer){fp.monthsDropdownContainer.value=String(fp.currentMonth)}if(defaultDate){fp.setDate(defaultDate);yearChangeHook(fp)}}),0)}))}if(!((_c2=dropdown.nextElementSibling)==null?void 0:_c2.classList.contains("year-dropdown-icon"))){dropdown.insertAdjacentHTML("afterend",`<i class="year-dropdown-icon">${angleDownString}</i>`)}if(((_d=fp.monthElements[0])==null?void 0:_d.parentElement)&&!((_e=fp.calendarContainer)==null?void 0:_e.querySelector(".month-dropdown-icon"))){fp.monthElements[0].insertAdjacentHTML("afterend",`<i class="month-dropdown-icon">${angleDownString}</i>`)}};const assignCalendarId=fp=>{var _a2;const calEl=fp.calendarContainer??((_a2=fp.innerContainer)==null?void 0:_a2.parentElement);if(calEl){calEl.id=`cal-${pickerId}`}};flatpickr(`#${pickerId}`,{allowInput:allowInput,closeOnSelect:closeOnSelect,disableMobile:true,dateFormat:getDateFormat(),defaultDate:defaultDateGetter(),disable:disabledParser(),enableTime:enableTime,locale:{rangeSeparator:" to "},maxDate:effectiveMaxDate,minDate:effectiveMinDate,mode:mode,nextArrow:`<div style="height: 14px;">${angleRightString}</div>`,...allowInput&&{parseDate:(datestr,format2)=>flatpickr.parseDate(withDateSeparators(datestr,format2),format2)},onOpen:[(_selectedDates,_dateStr,fp)=>{activePortalZIndex=portalHost?resolvePortaledFloatingZIndex(portalHost,nextPortaledFloatingZIndex()):void 0;if(portalHost){mountCalendarInPortalShell(fp)}if(portalAppendShell){portalAppendShell.style.zIndex=activePortalZIndex;setFloatingOwnerAttribute(portalAppendShell,floatingOwnerId)}if(fp.calendarContainer){fp.calendarContainer.style.zIndex=activePortalZIndex;setFloatingOwnerAttribute(fp.calendarContainer,floatingOwnerId)}announceFloatingKitOpen("date-picker",floatingOwnerId);if(hasOutOfRangeDefault){const dateObj=toDateObject(defaultDateValue);if(dateObj){const inputIsBlank=!fp.input.value||fp.input.value.trim()==="";const noSelection=!fp.selectedDates||fp.selectedDates.length===0;if(inputIsBlank||noSelection){const formattedDate=fp.formatDate(dateObj,getDateFormat());if(formattedDate){fp.input.value=formattedDate}fp.selectedDates=[dateObj];fp.jumpToDate(dateObj);setTimeout((()=>{yearChangeHook(fp)}),0)}}}calendarResizer();if(resizeRepositionHandlerRef){window.removeEventListener("resize",resizeRepositionHandlerRef)}resizeRepositionHandlerRef=()=>{calendarResizer();positionCalendarIfNeeded(fp)};window.addEventListener("resize",resizeRepositionHandlerRef);if(!effectiveStatic&&scrollContainer)attachToScroll(scrollContainer);if(portalHost){unsubscribeFloatingReposition=subscribeFloatingKitReposition((()=>{positionCalendarIfNeeded(fp)}))}assignCalendarId(fp);positionCalendarIfNeeded(fp);setupYearMonthDropdowns(fp)}],onDestroy:[()=>{if(unsubscribeFloatingReposition){unsubscribeFloatingReposition();unsubscribeFloatingReposition=null}if(resizeRepositionHandlerRef){window.removeEventListener("resize",resizeRepositionHandlerRef);resizeRepositionHandlerRef=null}removePortalShell()}],onClose:[(selectedDates,dateStr,fp)=>{if(unsubscribeFloatingReposition){unsubscribeFloatingReposition();unsubscribeFloatingReposition=null}if(resizeRepositionHandlerRef){window.removeEventListener("resize",resizeRepositionHandlerRef);resizeRepositionHandlerRef=null}if(!effectiveStatic&&scrollContainer)detachFromScroll(scrollContainer);if(hasOutOfRangeDefault&&(!selectedDates||selectedDates.length===0)){const dateObj=toDateObject(defaultDateValue);if(dateObj&&fp.input){const formattedDate=fp.formatDate(dateObj,getDateFormat());if(formattedDate){setTimeout((()=>{if(fp.input&&(!fp.selectedDates||fp.selectedDates.length===0)){fp.input.value=formattedDate;fp.selectedDates=[dateObj];fp.jumpToDate(dateObj)}}),0)}}}onClose(selectedDates,dateStr)}],onChange:[(selectedDates,dateStr,fp)=>{handleDatePickerChange(fp,selectedDates);yearChangeHook(fp);onChange(dateStr,selectedDates)}],onYearChange:[(_selectedDates,_dateStr,fp)=>{yearChangeHook(fp)}],plugins:setPlugins(thisRangesEndToday,customQuickPickDates),position:portalPositionFn??position,positionElement:getPositionElement(positionElement),prevArrow:`<div style="height: 14px;">${angleLeftString}</div>`,static:effectiveStatic});const picker=(_a=document.querySelector(`#${pickerId}`))==null?void 0:_a._flatpickr;if(!picker)return;assignCalendarId(picker);if((isBeforeMin||isAfterMax)&&defaultDateValue){const dateObj=toDateObject(defaultDateValue);const formattedDate=dateObj?picker.formatDate(dateObj,getDateFormat()):null;setTimeout((()=>{if(!dateObj||!picker.input||!formattedDate)return;picker.setDate(dateObj,false);if(isBeforeMin&&setMinDate&&minDate){picker.set("minDate",setMinDate)}if(isAfterMax&&setMaxDate&&maxDate){picker.set("maxDate",setMaxDate)}picker.input.value=formattedDate;picker.selectedDates=[dateObj];setTimeout((()=>{yearChangeHook(picker)}),0);const restoreOutOfRangeValue=()=>{if(!picker.input)return;const inputIsBlank=!picker.input.value||picker.input.value.trim()==="";const noSelection=!picker.selectedDates||picker.selectedDates.length===0;if(inputIsBlank||noSelection){setTimeout((()=>{if(picker.input&&(!picker.input.value||picker.input.value.trim()==="")){picker.input.value=formattedDate}if(!picker.selectedDates||picker.selectedDates.length===0){picker.selectedDates=[dateObj];if(picker.isOpen){picker.jumpToDate(dateObj);picker.redraw();setTimeout((()=>{yearChangeHook(picker)}),0)}}}),0)}};const originalClear=picker.clear.bind(picker);picker.clear=function(...args){const result=originalClear(...args);setTimeout((()=>restoreOutOfRangeValue()),0);return result};picker.input.addEventListener("input",restoreOutOfRangeValue);picker.config.onClose.push((()=>{restoreOutOfRangeValue()}))}),10)}setupYearMonthDropdowns(picker);if(selectionType==="quickpick"&&(controlsStartId||controlsEndId)){picker.config.onClose.push((selectedDates=>{var _a2,_b2;const[start2,end2]=selectedDates;if(controlsStartId){const startPicker=(_a2=document.querySelector(`#${controlsStartId}`))==null?void 0:_a2._flatpickr;startPicker==null?void 0:startPicker.setDate(start2,true)}if(controlsEndId){const endPicker=(_b2=document.querySelector(`#${controlsEndId}`))==null?void 0:_b2._flatpickr;endPicker==null?void 0:endPicker.setDate(end2,true)}}))}if(syncStartWith){picker.config.onClose.push((selectedDates=>{var _a2;if(selectedDates==null?void 0:selectedDates.length){const element=document.querySelector(`#${syncStartWith}`);if((_a2=element==null?void 0:element._dropdownRef)==null?void 0:_a2.current){element._dropdownRef.current.clearSelected()}else if(element==null?void 0:element._pbDropdownInstance){element._pbDropdownInstance.clearSelected()}else{const quickpick=element==null?void 0:element._flatpickr;quickpick==null?void 0:quickpick.clear()}}}))}if(syncEndWith){picker.config.onClose.push((selectedDates=>{var _a2;if(selectedDates==null?void 0:selectedDates.length){const element=document.querySelector(`#${syncEndWith}`);if((_a2=element==null?void 0:element._dropdownRef)==null?void 0:_a2.current){element._dropdownRef.current.clearSelected()}else if(element==null?void 0:element._pbDropdownInstance){element._pbDropdownInstance.clearSelected()}else{const quickpick=element==null?void 0:element._flatpickr;quickpick==null?void 0:quickpick.clear()}}}))}const datePickerLabel=document.querySelector(`label[for="${pickerId}"]`);if(datePickerLabel){const labelWithRefs=datePickerLabel;const prev=labelWithRefs._pbDatePickerLabelHandlers;if(prev==null?void 0:prev.stopPointer){datePickerLabel.removeEventListener("mousedown",prev.stopPointer);datePickerLabel.removeEventListener("touchstart",prev.stopPointer)}if(prev==null?void 0:prev.click){datePickerLabel.removeEventListener("click",prev.click)}const stopPointerForFlatpickrDocClose2=e=>{e.stopPropagation()};const onDatePickerLabelClick=e=>{e.preventDefault();e.stopPropagation();if(picker.input.disabled)return;picker.toggle();if(picker.isOpen){picker.input.focus()}};datePickerLabel.addEventListener("mousedown",stopPointerForFlatpickrDocClose2);datePickerLabel.addEventListener("touchstart",stopPointerForFlatpickrDocClose2,{passive:true});datePickerLabel.addEventListener("click",onDatePickerLabelClick);labelWithRefs._pbDatePickerLabelHandlers={stopPointer:stopPointerForFlatpickrDocClose2,click:onDatePickerLabelClick}}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"}const stopPointerForFlatpickrDocClose=e=>{e.stopPropagation()};picker.input.addEventListener("mousedown",stopPointerForFlatpickrDocClose);picker.input.addEventListener("touchstart",stopPointerForFlatpickrDocClose,{passive:true});const calIconWrapper=document.querySelector(`#cal-icon-${pickerId}`);const isPointerInCalIcon=e=>{if(!calIconWrapper)return false;const rect=calIconWrapper.getBoundingClientRect();return e.clientX>=rect.left&&e.clientX<=rect.right&&e.clientY>=rect.top&&e.clientY<=rect.bottom};const openDatePickerFromUi=e=>{e.preventDefault();e.stopPropagation();if(picker.input.disabled)return;if(picker.isOpen){picker.close();return}picker.open();picker.input.focus()};const textInputWrapper=picker.input.closest(".text_input_wrapper");const inputWrapper=picker.input.closest(".input_wrapper");inputWrapper==null?void 0:inputWrapper.addEventListener("click",(e=>{if(e.target===picker.input)return;if(!isPointerInCalIcon(e)&&!(textInputWrapper==null?void 0:textInputWrapper.contains(e.target)))return;openDatePickerFromUi(e)}));const pickerInput=picker.input;pickerInput._pbDatePickerOpenUnsub=subscribeFloatingKitOpen((({kitKind:kitKind})=>{if(kitKind!=="date-picker"&&picker.isOpen){picker.close()}}));(_c=(_b=document.querySelector(`#${pickerId}`))==null?void 0:_b.parentElement)==null?void 0:_c.addEventListener("click",(e=>e.stopPropagation()))};const EMOJI_REGEX=new RegExp("\\p{Extended_Pictographic}|\\u200D|\\uFE0F|[\\u{1F3FB}-\\u{1F3FF}]","gu");const stripEmojisForTyping=text=>text.replace(EMOJI_REGEX,"");const stripEmojisForPaste=text=>stripEmojisForTyping(text).replace(/\s+/g," ").trim();const applyEmojiMask=element=>{const cursor=element.selectionStart;const original=element.value;const filtered=stripEmojisForTyping(original);if(original!==filtered){const beforeCursor=original.slice(0,cursor||0);const newCursor=stripEmojisForTyping(beforeCursor).length;element.value=filtered;element.selectionStart=element.selectionEnd=newCursor;return{value:filtered,cursor:newCursor}}return{value:original,cursor:cursor}};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$1(element){return element?(element.nodeName||"").toLowerCase():null}function getWindow$1(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$1(node){var OwnElement=getWindow$1(node).Element;return node instanceof OwnElement||node instanceof Element}function isHTMLElement$1(node){var OwnElement=getWindow$1(node).HTMLElement;return node instanceof OwnElement||node instanceof HTMLElement}function isShadowRoot$1(node){if(typeof ShadowRoot==="undefined"){return false}var OwnElement=getWindow$1(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$1(element)||!getNodeName$1(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,property){style2[property]="";return style2}),{});if(!isHTMLElement$1(element)||!getNodeName$1(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$1=Math.max;var min$1=Math.min;var round$1=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$1(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$1(element)){scaleX=element.offsetWidth>0?round$1(clientRect.width)/element.offsetWidth||1:1;scaleY=element.offsetHeight>0?round$1(clientRect.height)/element.offsetHeight||1:1}var _ref=isElement$1(element)?getWindow$1(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$1(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(parent,child){var rootNode=child.getRootNode&&child.getRootNode();if(parent.contains(child)){return true}else if(rootNode&&isShadowRoot$1(rootNode)){var next=child;do{if(next&&parent.isSameNode(next)){return true}next=next.parentNode||next.host}while(next)}return false}function getComputedStyle$1(element){return getWindow$1(element).getComputedStyle(element)}function isTableElement$1(element){return["table","td","th"].indexOf(getNodeName$1(element))>=0}function getDocumentElement$1(element){return((isElement$1(element)?element.ownerDocument:element.document)||window.document).documentElement}function getParentNode$1(element){if(getNodeName$1(element)==="html"){return element}return element.assignedSlot||element.parentNode||(isShadowRoot$1(element)?element.host:null)||getDocumentElement$1(element)}function getTrueOffsetParent$1(element){if(!isHTMLElement$1(element)||getComputedStyle$1(element).position==="fixed"){return null}return element.offsetParent}function getContainingBlock$1(element){var isFirefox=/firefox/i.test(getUAString());var isIE=/Trident/i.test(getUAString());if(isIE&&isHTMLElement$1(element)){var elementCss=getComputedStyle$1(element);if(elementCss.position==="fixed"){return null}}var currentNode=getParentNode$1(element);if(isShadowRoot$1(currentNode)){currentNode=currentNode.host}while(isHTMLElement$1(currentNode)&&["html","body"].indexOf(getNodeName$1(currentNode))<0){var css=getComputedStyle$1(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$1(element){var window2=getWindow$1(element);var offsetParent=getTrueOffsetParent$1(element);while(offsetParent&&isTableElement$1(offsetParent)&&getComputedStyle$1(offsetParent).position==="static"){offsetParent=getTrueOffsetParent$1(offsetParent)}if(offsetParent&&(getNodeName$1(offsetParent)==="html"||getNodeName$1(offsetParent)==="body"&&getComputedStyle$1(offsetParent).position==="static")){return window2}return offsetParent||getContainingBlock$1(element)||window2}function getMainAxisFromPlacement(placement){return["top","bottom"].indexOf(placement)>=0?"x":"y"}function within(min2,value,max2){return max$1(min2,min$1(value,max2))}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,keys){return keys.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$1(_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$1(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$2={name:"arrow",enabled:true,phase:"main",fn:arrow$1,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$1(x*dpr)/dpr||0,y:round$1(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$1(popper2);var heightProp="clientHeight";var widthProp="clientWidth";if(offsetParent===getWindow$1(popper2)){offsetParent=getDocumentElement$1(popper2);if(getComputedStyle$1(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$1(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$1(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$1(node);var scrollLeft=win.pageXOffset;var scrollTop=win.pageYOffset;return{scrollLeft:scrollLeft,scrollTop:scrollTop}}function getWindowScrollBarX$1(element){return getBoundingClientRect$1(getDocumentElement$1(element)).left+getWindowScroll(element).scrollLeft}function getViewportRect$1(element,strategy){var win=getWindow$1(element);var html=getDocumentElement$1(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$1(element),y:y}}function getDocumentRect$1(element){var _element$ownerDocumen;var html=getDocumentElement$1(element);var winScroll=getWindowScroll(element);var body=(_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body;var width=max$1(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0);var height=max$1(html.scrollHeight,html.clientHeight,body?body.scrollHeight:0,body?body.clientHeight:0);var x=-winScroll.scrollLeft+getWindowScrollBarX$1(element);var y=-winScroll.scrollTop;if(getComputedStyle$1(body||html).direction==="rtl"){x+=max$1(html.clientWidth,body?body.clientWidth:0)-width}return{width:width,height:height,x:x,y:y}}function isScrollParent(element){var _getComputedStyle=getComputedStyle$1(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$1(node))>=0){return node.ownerDocument.body}if(isHTMLElement$1(node)&&isScrollParent(node)){return node}return getScrollParent(getParentNode$1(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$1(scrollParent);var target=isBody?[win].concat(win.visualViewport||[],isScrollParent(scrollParent)?scrollParent:[]):scrollParent;var updatedList=list.concat(target);return isBody?updatedList:updatedList.concat(listScrollParents(getParentNode$1(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$1(element,strategy){var rect=getBoundingClientRect$1(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$1(element,strategy)):isElement$1(clippingParent)?getInnerBoundingClientRect$1(clippingParent,strategy):rectToClientRect(getDocumentRect$1(getDocumentElement$1(element)))}function getClippingParents(element){var clippingParents2=listScrollParents(getParentNode$1(element));var canEscapeClipping=["absolute","fixed"].indexOf(getComputedStyle$1(element).position)>=0;var clipperElement=canEscapeClipping&&isHTMLElement$1(element)?getOffsetParent$1(element):element;if(!isElement$1(clipperElement)){return[]}return clippingParents2.filter((function(clippingParent){return isElement$1(clippingParent)&&contains(clippingParent,clipperElement)&&getNodeName$1(clippingParent)!=="body"}))}function getClippingRect$1(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$1(rect.top,accRect.top);accRect.right=min$1(rect.right,accRect.right);accRect.bottom=min$1(rect.bottom,accRect.bottom);accRect.left=max$1(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$1(isElement$1(element)?element:element.contextElement||getDocumentElement$1(state.elements.popper),boundary,rootBoundary,strategy);var referenceClientRect=getBoundingClientRect$1(state.elements.reference);var popperOffsets2=computeOffsets({reference:referenceClientRect,element:popperRect,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$1(_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$2={name:"flip",enabled:true,phase:"main",fn:flip$1,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$1(_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$2={name:"offset",enabled:true,phase:"main",requires:["popperOffsets"],fn:offset$1};function popperOffsets(_ref){var state=_ref.state,name=_ref.name;state.modifiersData[name]=computeOffsets({reference:state.rects.reference,element:state.rects.popper,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 min2=offset2+overflow[mainSide];var max2=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$1(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$1(min2,tetherMin):min2,offset2,tether?max$1(max2,tetherMax):max2);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$1(node){if(node===getWindow$1(node)||!isHTMLElement$1(node)){return getWindowScroll(node)}else{return getHTMLElementScroll(node)}}function isElementScaled(element){var rect=element.getBoundingClientRect();var scaleX=round$1(rect.width)/element.offsetWidth||1;var scaleY=round$1(rect.height)/element.offsetHeight||1;return scaleX!==1||scaleY!==1}function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){if(isFixed===void 0){isFixed=false}var isOffsetParentAnElement=isHTMLElement$1(offsetParent);var offsetParentIsScaled=isHTMLElement$1(offsetParent)&&isElementScaled(offsetParent);var documentElement=getDocumentElement$1(offsetParent);var rect=getBoundingClientRect$1(elementOrVirtualElement,offsetParentIsScaled,isFixed);var scroll={scrollLeft:0,scrollTop:0};var offsets={x:0,y:0};if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName$1(offsetParent)!=="body"||isScrollParent(documentElement)){scroll=getNodeScroll$1(offsetParent)}if(isHTMLElement$1(offsetParent)){offsets=getBoundingClientRect$1(offsetParent,true);offsets.x+=offsetParent.clientLeft;offsets.y+=offsetParent.clientTop}else if(documentElement){offsets.x=getWindowScrollBarX$1(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$1(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(m){return m.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$1(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=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$2,flip$2,preventOverflow$1,arrow$2,hide$1];var createPopper=popperGenerator({defaultModifiers:defaultModifiers});const useFullScreen=(initial=false)=>{const[isFullscreen,setIsFullscreen]=useState(initial);const toggleFullScreen=()=>setIsFullscreen((prev=>!prev));return[isFullscreen,setIsFullscreen,toggleFullScreen]};class ElementObserver{constructor(matchDelegate,target=document){this.matchDelegate=matchDelegate;this.target=target}get mutationObserver(){return this._mutationObserver=this._mutationObserver||new MutationObserver((mutationList=>this.processMutationList(mutationList)))}start(){this.mutationObserver.observe(this.target,{attributes:true,childList:true,subtree:true});this.catchup()}stop(){this.mutationObserver.disconnect()}catchup(){this.handleAdditions(this.matchDelegate.matches(this.target))}processMutationList(mutationList){for(const mutation of mutationList){if(mutation.type=="attributes"){this.processAttributeChange(mutation.target)}else if(mutation.type=="childList"){this.processRemovedNodes(Array.from(mutation.removedNodes));this.processAddedNodes(Array.from(mutation.addedNodes))}}}processAttributeChange(node){if(node.nodeType!==Node.ELEMENT_NODE)return;const matches=this.matchDelegate.matches(node);if(matches.length===0)return this.matchDelegate.removeMatch(node);this.handleAdditions(matches)}processRemovedNodes(nodes){for(const node of nodes){if(node.nodeType!==Node.ELEMENT_NODE)continue;this.handleRemovals(this.matchDelegate.matches(node))}}processAddedNodes(nodes){for(const node of nodes){if(node.nodeType!==Node.ELEMENT_NODE)continue;this.handleAdditions(this.matchDelegate.matches(node))}}handleRemovals(elements){for(const element of elements)this.matchDelegate.removeMatch(element)}handleAdditions(elements){for(const element of elements)this.matchDelegate.addMatch(element)}}class PbEnhancedElement{constructor(element){this.element=element}static get elements(){return this._elements=this._elements||new Map}static get observer(){return this._observer=this._observer||new ElementObserver(this)}static get selector(){console.warn("Define a static property for selector or redefine the matches function in a subclass.",this);return null}static matches(node){if(!this.selector)return[];const matches=[];if(node.nodeType===Node.ELEMENT_NODE&&node.matches(this.selector))matches.push(node);matches.push(...node.querySelectorAll(this.selector));return matches}static addMatch(element){if(element._pbEnhanced||this.elements.has(element))return;const enhansedElement=new this(element);enhansedElement.connect();this.elements.set(element,enhansedElement);element._pbEnhanced=enhansedElement}static removeMatch(element){if(!this.elements.has(element))return;const enhansedElement=this.elements.get(element);enhansedElement.disconnect();this.elements.delete(element);delete element._pbEnhanced}static start(){this.observer.start()}static stop(){this.observer.stop()}connect(){console.warn("Redefine the connect function in a subclass.",this)}disconnect(){}}class PbTextarea extends PbEnhancedElement{constructor(){super(...arguments);this.skipNextEmojiFilter=false;this.onInput=()=>{if(!this.element)return;if(this.element.closest(".resize_auto")){this.element.style.height="auto";this.element.style.height=this.element.scrollHeight+"px"}};this.handleEmojiInput=()=>{if(!this.element||!this.hasEmojiMask())return;if(this.skipNextEmojiFilter){this.skipNextEmojiFilter=false;return}applyEmojiMask(this.element)};this.handleEmojiPaste=event=>{var _a;if(!this.element||!this.hasEmojiMask())return;const pastedText=((_a=event.clipboardData)==null?void 0:_a.getData("text"))||"";const filteredText=stripEmojisForPaste(pastedText);if(pastedText!==filteredText){event.preventDefault();const textarea=this.element;const start2=textarea.selectionStart||0;const end2=textarea.selectionEnd||0;const currentValue=textarea.value;const newValue=currentValue.slice(0,start2)+filteredText+currentValue.slice(end2);const newCursor=start2+filteredText.length;textarea.value=newValue;textarea.selectionStart=textarea.selectionEnd=newCursor;this.skipNextEmojiFilter=true;textarea.dispatchEvent(new Event("input",{bubbles:true}))}}}static get selector(){return'.resize_auto textarea, [data-pb-emoji-mask="true"]'}hasEmojiMask(){if(!this.element)return false;return this.element.dataset.pbEmojiMask==="true"}connect(){if(!this.element)return;if(this.element.closest(".resize_auto")){this.element.setAttribute("style","height:"+this.element.scrollHeight+"px;overflow-y:hidden;");this.element.addEventListener("input",this.onInput,false)}if(this.hasEmojiMask()){this.element.addEventListener("input",this.handleEmojiInput,false);this.element.addEventListener("paste",this.handleEmojiPaste,false)}}disconnect(){if(!this.element)return;this.element.removeEventListener("input",this.onInput,false);this.element.removeEventListener("input",this.handleEmojiInput,false);this.element.removeEventListener("paste",this.handleEmojiPaste,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 font_family_base='"Power Centra", "Helvetica Neue", Helvetica, Arial, sans_serif';const text_jumbo="36px";const text_largest="32px";const text_larger="27px";const text_large="20px";const text_base="15.5px";const text_default="15.5px";const text_normal="15.5px";const text_medium="15.5px";const text_small="14px";const text_smaller="12px";const text_smallest="11px";const heading_1="44px";const heading_2="32px";const heading_3="27px";const heading_4="15.5px";const lighter$1="300";const light$1="300";const bold="700";const regular="400";const typography={font_family_base:font_family_base,text_jumbo:text_jumbo,text_largest:text_largest,text_larger:text_larger,text_large:text_large,text_base:text_base,text_default:text_default,text_normal:text_normal,text_medium:text_medium,text_small:text_small,text_smaller:text_smaller,text_smallest:text_smallest,heading_1:heading_1,heading_2:heading_2,heading_3:heading_3,heading_4:heading_4,lighter:lighter$1,light:light$1,bold:bold,regular:regular};const pbIndicator={title:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}},secondaryTitle:{color:colors.text_lt_light,fontFamily:typography.font_family_base,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}},value:{fontFamily:typography.font_family_base,color:colors.text_lt_default,fontWeight:typography.lighter,fontSizes:{big:typography.heading_1,medium:typography.heading_1,small:typography.text_base,micro:typography.text_small}},secondaryValue:{fontFamily:typography.font_family_base,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}}};const POPOVER_OFFSET_Y=[0,20];class PbPopover extends PbEnhancedElement{constructor(){super(...arguments);this._unsubscribeFloatingReposition=null}static get selector(){return"[data-pb-popover-kit]"}moveTooltip(){let container=document.querySelector("body");if(this.appendTo==="parent"){container=this.element.parentElement&&this.element.parentElement}else if(this.appendTo){container=document.querySelector(this.appendTo)}container.appendChild(this.tooltip)}connect(){if(!this.triggerElement||!this.tooltip){console.warn("Popover requires both trigger and tooltip elements to be defined.");return}this.moveTooltip();this.popper=createPopper(this.triggerElement,this.tooltip,{placement:this.position,strategy:"fixed",modifiers:[{name:"offset",options:{offset:this.offset}}]});this._unsubscribeFloatingReposition=subscribeFloatingKitReposition((()=>{var _a,_b;if((_a=this.tooltip)==null?void 0:_a.classList.contains("show")){void((_b=this.popper)==null?void 0:_b.update())}}));this.triggerElement.addEventListener("click",(event=>{event.preventDefault();event.stopPropagation();if(!this.tooltip.classList.contains("show")){this.checkCloseTooltip()}setTimeout((()=>{this.toggleTooltip();this.popper.update()}),0)}))}disconnect(){var _a,_b;(_a=this._unsubscribeFloatingReposition)==null?void 0:_a.call(this);this._unsubscribeFloatingReposition=null;(_b=this.popper)==null?void 0:_b.destroy()}checkCloseTooltip(){document.querySelector("body").addEventListener("click",(event=>{const t=event.target;const isTooltipElement=event.target instanceof Element&&event.target.closest(`#${this.tooltipId}`)!==null;const isTriggerElement=event.target instanceof Element&&event.target.closest(`#${this.triggerElementId}`)!==null;const isPortaledKit=isPortaledFloatingKitInteraction(t,this.tooltipId,event.clientX,event.clientY);switch(this.closeOnClick){case"any":if(isPortaledKit)return;if(isTooltipElement||!isTooltipElement&&!isTriggerElement){this.hideTooltip()}break;case"outside":if(!isTooltipElement&&!isTriggerElement&&!isPortaledKit){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}get appendTo(){return this.element.dataset.pbPopoverAppendTo}}const TABLE_WRAPPER_SELECTOR="[data-pb-table-wrapper]";const TABLE_COLLAPSIBLE_WRAPPER_SELECTOR="[data-pb-table-collapsible-wrapper]";const TABLE_COLLAPSIBLE_CELL_SELECTOR="[data-pb-table-collapsible-cell-id]";class PbTable extends PbEnhancedElement{constructor(){super(...arguments);this.stickyLeftColumns=[];this.stickyRightColumns=[];this.stickyRightColumnsReversed=[]}static get selector(){return TABLE_WRAPPER_SELECTOR}connect(){if(this.element.classList.contains("table-responsive-collapse")){const headers=[];[].forEach.call(this.element.querySelectorAll("th"),(header=>{const colSpan=header.colSpan;for(let i=0;i<colSpan;i++){headers.push(header.textContent.replace(/\r?\n|\r/,""))}}));[].forEach.call(this.element.querySelectorAll("tbody tr"),(row=>{[].forEach.call(row.cells,((cell,headerIndex)=>{cell.setAttribute("data-title",headers[headerIndex])}))}))}this.initStickyLeftColumns();this.initStickyRightColumns();this.handleCollapsibleClick();this.handleCollapsibleRow()}initStickyLeftColumns(){const table=this.element.querySelector(".sticky-left-column");if(table){const classList=Array.from(table.classList);const stickyColumnClass=classList.find((cls=>cls.startsWith("sticky-left-columns-ids-")));if(stickyColumnClass){this.stickyLeftColumns=stickyColumnClass.replace("sticky-left-columns-ids-","").split("-");if(this.stickyLeftColumns.length>0){setTimeout((()=>{this.handleStickyLeftColumns();window.addEventListener("resize",(()=>this.handleStickyLeftColumns()))}),10)}}}}handleStickyLeftColumns(){let accumulatedWidth=0;this.stickyLeftColumns.forEach(((colId,index)=>{const isLastColumn=index===this.stickyLeftColumns.length-1;const header=this.element.querySelector(`th[data-sticky-id="${colId}"]`);const cells=this.element.querySelectorAll(`td[data-sticky-id="${colId}"]`);if(header){header.classList.add("sticky");header.style.left=`${accumulatedWidth}px`;if(!isLastColumn){header.classList.add("with-border-right");header.classList.remove("sticky-left-shadow")}else{header.classList.remove("with-border-right");header.classList.add("sticky-left-shadow")}const headerWidth=header.offsetWidth;accumulatedWidth+=headerWidth;cells.forEach((cell=>{cell.classList.add("sticky");cell.style.left=`${accumulatedWidth-headerWidth}px`;if(!isLastColumn){cell.classList.add("with-border-right");cell.classList.remove("sticky-left-shadow")}else{cell.classList.remove("with-border-right");cell.classList.add("sticky-left-shadow")}}))}}))}initStickyRightColumns(){const table=this.element.querySelector(".sticky-right-column");if(table){const classList=Array.from(table.classList);const stickyColumnClass=classList.find((cls=>cls.startsWith("sticky-right-columns-ids-")));if(stickyColumnClass){this.stickyRightColumns=stickyColumnClass.replace("sticky-right-columns-ids-","").split("-");this.stickyRightColumnsReversed=this.stickyRightColumns.reverse();if(this.stickyRightColumns.length>0){setTimeout((()=>{this.handleStickyRightColumns();window.addEventListener("resize",(()=>this.handleStickyRightColumns()))}),10)}}}}handleStickyRightColumns(){let accumulatedWidth=0;this.stickyRightColumnsReversed.forEach(((colId,index)=>{const isLastColumn=index===this.stickyRightColumns.length-1;const header=this.element.querySelector(`th[data-sticky-id="${colId}"]`);const cells=this.element.querySelectorAll(`td[data-sticky-id="${colId}"]`);if(header){header.classList.add("sticky");header.style.right=`${accumulatedWidth}px`;if(!isLastColumn){header.classList.add("with-border-left");header.classList.remove("sticky-right-shadow")}else{header.classList.remove("with-border-right");header.classList.add("sticky-right-shadow")}const headerWidth=header.offsetWidth;accumulatedWidth+=headerWidth;cells.forEach((cell=>{cell.classList.add("sticky");cell.style.right=`${accumulatedWidth-headerWidth}px`;if(!isLastColumn){cell.classList.add("with-border-left");cell.classList.remove("sticky-right-shadow")}else{cell.classList.remove("with-border-left");cell.classList.add("sticky-right-shadow")}}))}}))}handleCollapsibleClick(){const cells=this.element.querySelectorAll(TABLE_COLLAPSIBLE_CELL_SELECTOR);const collapsibleElements=this.element.querySelectorAll(TABLE_COLLAPSIBLE_WRAPPER_SELECTOR);if(cells.length>0){cells.forEach((cell=>{const cellId=cell.dataset.pbTableCollapsibleCellId;Array.from(cell.children).forEach((child=>{if(child.id===cellId){Array.from(child.children).forEach((svgChild=>{svgChild.id=cellId;Array.from(svgChild.children).forEach((pathChild=>{pathChild.id=cellId}))}))}}));cell.addEventListener("click",(event=>{if(event.target.id){document.dispatchEvent(new CustomEvent(`collapsed-toggle${event.currentTarget.id}`));const toggleElements=this.element.querySelectorAll(`.collapsible_border_toggle${event.currentTarget.id}`);toggleElements.forEach((element=>{element.classList.toggle("no-border");element.classList.toggle("border-active")}))}}))}))}else{collapsibleElements.forEach((collapsibleElement=>{collapsibleElement.addEventListener("click",(event=>{document.dispatchEvent(new CustomEvent(`collapsed-toggle${event.currentTarget.id}`));const toggleElements=this.element.querySelectorAll(`.collapsible_border_toggle${event.currentTarget.id}`);toggleElements.forEach((element=>{element.classList.toggle("no-border");element.classList.toggle("border-active")}))}))}))}}handleCollapsibleRow(){const collapsibleRows=this.element.querySelectorAll(".pb_table_collapsible_row");if(collapsibleRows.length>0){collapsibleRows.forEach((row=>{const previousRow=row.previousElementSibling;if(previousRow&&previousRow.tagName==="TR"){const tdCount=previousRow.querySelectorAll("td").length;const collapsibleTd=row.querySelector("td");if(collapsibleTd){collapsibleTd.colSpan=tdCount}}else{return}}))}}disconnect(){if(this.stickyLeftColumns.length>0){window.removeEventListener("resize",(()=>this.handleStickyLeftColumns()))}if(this.stickyRightColumns.length>0){window.removeEventListener("resize",(()=>this.handleStickyRightColumns()))}}}const min=Math.min;const max=Math.max;const round=Math.round;const floor=Math.floor;const createCoords=v=>({x:v,y:v});function hasWindow(){return typeof window!=="undefined"}function getNodeName(node){if(isNode(node)){return(node.nodeName||"").toLowerCase()}return"#document"}function getWindow(node){var _node$ownerDocument;return(node==null||(_node$ownerDocument=node.ownerDocument)==null?void 0:_node$ownerDocument.defaultView)||window}function getDocumentElement(node){var _ref;return(_ref=(isNode(node)?node.ownerDocument:node.document)||window.document)==null?void 0:_ref.documentElement}function isNode(value){if(!hasWindow()){return false}return value instanceof Node||value instanceof getWindow(value).Node}function isElement(value){if(!hasWindow()){return false}return value instanceof Element||value instanceof getWindow(value).Element}function isHTMLElement(value){if(!hasWindow()){return false}return value instanceof HTMLElement||value instanceof getWindow(value).HTMLElement}function isShadowRoot(value){if(!hasWindow()||typeof ShadowRoot==="undefined"){return false}return value instanceof ShadowRoot||value instanceof getWindow(value).ShadowRoot}function isOverflowElement(element){const{overflow:overflow,overflowX:overflowX,overflowY:overflowY,display:display}=getComputedStyle(element);return/auto|scroll|overlay|hidden|clip/.test(overflow+overflowY+overflowX)&&!["inline","contents"].includes(display)}function isTableElement(element){return["table","td","th"].includes(getNodeName(element))}function isTopLayer(element){return[":popover-open",":modal"].some((selector=>{try{return element.matches(selector)}catch(e){return false}}))}function isContainingBlock(elementOrCss){const webkit=isWebKit();const css=isElement(elementOrCss)?getComputedStyle(elementOrCss):elementOrCss;return["transform","translate","scale","rotate","perspective"].some((value=>css[value]?css[value]!=="none":false))||(css.containerType?css.containerType!=="normal":false)||!webkit&&(css.backdropFilter?css.backdropFilter!=="none":false)||!webkit&&(css.filter?css.filter!=="none":false)||["transform","translate","scale","rotate","perspective","filter"].some((value=>(css.willChange||"").includes(value)))||["paint","layout","strict","content"].some((value=>(css.contain||"").includes(value)))}function getContainingBlock(element){let currentNode=getParentNode(element);while(isHTMLElement(currentNode)&&!isLastTraversableNode(currentNode)){if(isContainingBlock(currentNode)){return currentNode}else if(isTopLayer(currentNode)){return null}currentNode=getParentNode(currentNode)}return null}function isWebKit(){if(typeof CSS==="undefined"||!CSS.supports)return false;return CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(node){return["html","body","#document"].includes(getNodeName(node))}function getComputedStyle(element){return getWindow(element).getComputedStyle(element)}function getNodeScroll(element){if(isElement(element)){return{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop}}return{scrollLeft:element.scrollX,scrollTop:element.scrollY}}function getParentNode(node){if(getNodeName(node)==="html"){return node}const result=node.assignedSlot||node.parentNode||isShadowRoot(node)&&node.host||getDocumentElement(node);return isShadowRoot(result)?result.host:result}function getNearestOverflowAncestor(node){const parentNode=getParentNode(node);if(isLastTraversableNode(parentNode)){return node.ownerDocument?node.ownerDocument.body:node.body}if(isHTMLElement(parentNode)&&isOverflowElement(parentNode)){return parentNode}return getNearestOverflowAncestor(parentNode)}function getOverflowAncestors(node,list,traverseIframes){var _node$ownerDocument2;if(list===void 0){list=[]}if(traverseIframes===void 0){traverseIframes=true}const scrollableAncestor=getNearestOverflowAncestor(node);const isBody=scrollableAncestor===((_node$ownerDocument2=node.ownerDocument)==null?void 0:_node$ownerDocument2.body);const win=getWindow(scrollableAncestor);if(isBody){const frameElement=getFrameElement(win);return list.concat(win,win.visualViewport||[],isOverflowElement(scrollableAncestor)?scrollableAncestor:[],frameElement&&traverseIframes?getOverflowAncestors(frameElement):[])}return list.concat(scrollableAncestor,getOverflowAncestors(scrollableAncestor,[],traverseIframes))}function getFrameElement(win){return win.parent&&Object.getPrototypeOf(win.parent)?win.frameElement:null}function getCssDimensions(element){const css=getComputedStyle(element);let width=parseFloat(css.width)||0;let height=parseFloat(css.height)||0;const hasOffset=isHTMLElement(element);const offsetWidth=hasOffset?element.offsetWidth:width;const offsetHeight=hasOffset?element.offsetHeight:height;const shouldFallback=round(width)!==offsetWidth||round(height)!==offsetHeight;if(shouldFallback){width=offsetWidth;height=offsetHeight}return{width:width,height:height,$:shouldFallback}}function unwrapElement(element){return!isElement(element)?element.contextElement:element}function getScale(element){const domElement=unwrapElement(element);if(!isHTMLElement(domElement)){return createCoords(1)}const rect=domElement.getBoundingClientRect();const{width:width,height:height,$:$}=getCssDimensions(domElement);let x=($?round(rect.width):rect.width)/width;let y=($?round(rect.height):rect.height)/height;if(!x||!Number.isFinite(x)){x=1}if(!y||!Number.isFinite(y)){y=1}return{x:x,y:y}}const noOffsets=createCoords(0);function getVisualOffsets(element){const win=getWindow(element);if(!isWebKit()||!win.visualViewport){return noOffsets}return{x:win.visualViewport.offsetLeft,y:win.visualViewport.offsetTop}}function shouldAddVisualOffsets(element,isFixed,floatingOffsetParent){if(isFixed===void 0){isFixed=false}if(!floatingOffsetParent||isFixed&&floatingOffsetParent!==getWindow(element)){return false}return isFixed}function getBoundingClientRect(element,includeScale,isFixedStrategy,offsetParent){if(includeScale===void 0){includeScale=false}if(isFixedStrategy===void 0){isFixedStrategy=false}const clientRect=element.getBoundingClientRect();const domElement=unwrapElement(element);let scale=createCoords(1);if(includeScale){if(offsetParent){if(isElement(offsetParent)){scale=getScale(offsetParent)}}else{scale=getScale(element)}}const visualOffsets=shouldAddVisualOffsets(domElement,isFixedStrategy,offsetParent)?getVisualOffsets(domElement):createCoords(0);let x=(clientRect.left+visualOffsets.x)/scale.x;let y=(clientRect.top+visualOffsets.y)/scale.y;let width=clientRect.width/scale.x;let height=clientRect.height/scale.y;if(domElement){const win=getWindow(domElement);const offsetWin=offsetParent&&isElement(offsetParent)?getWindow(offsetParent):offsetParent;let currentWin=win;let currentIFrame=getFrameElement(currentWin);while(currentIFrame&&offsetParent&&offsetWin!==currentWin){const iframeScale=getScale(currentIFrame);const iframeRect=currentIFrame.getBoundingClientRect();const css=getComputedStyle(currentIFrame);const left2=iframeRect.left+(currentIFrame.clientLeft+parseFloat(css.paddingLeft))*iframeScale.x;const top2=iframeRect.top+(currentIFrame.clientTop+parseFloat(css.paddingTop))*iframeScale.y;x*=iframeScale.x;y*=iframeScale.y;width*=iframeScale.x;height*=iframeScale.y;x+=left2;y+=top2;currentWin=getWindow(currentIFrame);currentIFrame=getFrameElement(currentWin)}}return rectToClientRect$1({width:width,height:height,x:x,y:y})}function getWindowScrollBarX(element,rect){const leftScroll=getNodeScroll(element).scrollLeft;if(!rect){return getBoundingClientRect(getDocumentElement(element)).left+leftScroll}return rect.left+leftScroll}function getHTMLOffset(documentElement,scroll,ignoreScrollbarX){if(ignoreScrollbarX===void 0){ignoreScrollbarX=false}const htmlRect=documentElement.getBoundingClientRect();const x=htmlRect.left+scroll.scrollLeft-(ignoreScrollbarX?0:getWindowScrollBarX(documentElement,htmlRect));const y=htmlRect.top+scroll.scrollTop;return{x:x,y:y}}function convertOffsetParentRelativeRectToViewportRelativeRect(_ref){let{elements:elements,rect:rect,offsetParent:offsetParent,strategy:strategy}=_ref;const isFixed=strategy==="fixed";const documentElement=getDocumentElement(offsetParent);const topLayer=elements?isTopLayer(elements.floating):false;if(offsetParent===documentElement||topLayer&&isFixed){return rect}let scroll={scrollLeft:0,scrollTop:0};let scale=createCoords(1);const offsets=createCoords(0);const isOffsetParentAnElement=isHTMLElement(offsetParent);if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement)){scroll=getNodeScroll(offsetParent)}if(isHTMLElement(offsetParent)){const offsetRect=getBoundingClientRect(offsetParent);scale=getScale(offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft;offsets.y=offsetRect.y+offsetParent.clientTop}}const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll,true):createCoords(0);return{width:rect.width*scale.x,height:rect.height*scale.y,x:rect.x*scale.x-scroll.scrollLeft*scale.x+offsets.x+htmlOffset.x,y:rect.y*scale.y-scroll.scrollTop*scale.y+offsets.y+htmlOffset.y}}function getClientRects(element){return Array.from(element.getClientRects())}function getDocumentRect(element){const html=getDocumentElement(element);const scroll=getNodeScroll(element);const body=element.ownerDocument.body;const width=max(html.scrollWidth,html.clientWidth,body.scrollWidth,body.clientWidth);const height=max(html.scrollHeight,html.clientHeight,body.scrollHeight,body.clientHeight);let x=-scroll.scrollLeft+getWindowScrollBarX(element);const y=-scroll.scrollTop;if(getComputedStyle(body).direction==="rtl"){x+=max(html.clientWidth,body.clientWidth)-width}return{width:width,height:height,x:x,y:y}}function getViewportRect(element,strategy){const win=getWindow(element);const html=getDocumentElement(element);const visualViewport=win.visualViewport;let width=html.clientWidth;let height=html.clientHeight;let x=0;let y=0;if(visualViewport){width=visualViewport.width;height=visualViewport.height;const visualViewportBased=isWebKit();if(!visualViewportBased||visualViewportBased&&strategy==="fixed"){x=visualViewport.offsetLeft;y=visualViewport.offsetTop}}return{width:width,height:height,x:x,y:y}}function getInnerBoundingClientRect(element,strategy){const clientRect=getBoundingClientRect(element,true,strategy==="fixed");const top2=clientRect.top+element.clientTop;const left2=clientRect.left+element.clientLeft;const scale=isHTMLElement(element)?getScale(element):createCoords(1);const width=element.clientWidth*scale.x;const height=element.clientHeight*scale.y;const x=left2*scale.x;const y=top2*scale.y;return{width:width,height:height,x:x,y:y}}function getClientRectFromClippingAncestor(element,clippingAncestor,strategy){let rect;if(clippingAncestor==="viewport"){rect=getViewportRect(element,strategy)}else if(clippingAncestor==="document"){rect=getDocumentRect(getDocumentElement(element))}else if(isElement(clippingAncestor)){rect=getInnerBoundingClientRect(clippingAncestor,strategy)}else{const visualOffsets=getVisualOffsets(element);rect={x:clippingAncestor.x-visualOffsets.x,y:clippingAncestor.y-visualOffsets.y,width:clippingAncestor.width,height:clippingAncestor.height}}return rectToClientRect$1(rect)}function hasFixedPositionAncestor(element,stopNode){const parentNode=getParentNode(element);if(parentNode===stopNode||!isElement(parentNode)||isLastTraversableNode(parentNode)){return false}return getComputedStyle(parentNode).position==="fixed"||hasFixedPositionAncestor(parentNode,stopNode)}function getClippingElementAncestors(element,cache){const cachedResult=cache.get(element);if(cachedResult){return cachedResult}let result=getOverflowAncestors(element,[],false).filter((el=>isElement(el)&&getNodeName(el)!=="body"));let currentContainingBlockComputedStyle=null;const elementIsFixed=getComputedStyle(element).position==="fixed";let currentNode=elementIsFixed?getParentNode(element):element;while(isElement(currentNode)&&!isLastTraversableNode(currentNode)){const computedStyle=getComputedStyle(currentNode);const currentNodeIsContaining=isContainingBlock(currentNode);if(!currentNodeIsContaining&&computedStyle.position==="fixed"){currentContainingBlockComputedStyle=null}const shouldDropCurrentNode=elementIsFixed?!currentNodeIsContaining&&!currentContainingBlockComputedStyle:!currentNodeIsContaining&&computedStyle.position==="static"&&!!currentContainingBlockComputedStyle&&["absolute","fixed"].includes(currentContainingBlockComputedStyle.position)||isOverflowElement(currentNode)&&!currentNodeIsContaining&&hasFixedPositionAncestor(element,currentNode);if(shouldDropCurrentNode){result=result.filter((ancestor=>ancestor!==currentNode))}else{currentContainingBlockComputedStyle=computedStyle}currentNode=getParentNode(currentNode)}cache.set(element,result);return result}function getClippingRect(_ref){let{element:element,boundary:boundary,rootBoundary:rootBoundary,strategy:strategy}=_ref;const elementClippingAncestors=boundary==="clippingAncestors"?isTopLayer(element)?[]:getClippingElementAncestors(element,this._c):[].concat(boundary);const clippingAncestors=[...elementClippingAncestors,rootBoundary];const firstClippingAncestor=clippingAncestors[0];const clippingRect=clippingAncestors.reduce(((accRect,clippingAncestor)=>{const rect=getClientRectFromClippingAncestor(element,clippingAncestor,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}),getClientRectFromClippingAncestor(element,firstClippingAncestor,strategy));return{width:clippingRect.right-clippingRect.left,height:clippingRect.bottom-clippingRect.top,x:clippingRect.left,y:clippingRect.top}}function getDimensions(element){const{width:width,height:height}=getCssDimensions(element);return{width:width,height:height}}function getRectRelativeToOffsetParent(element,offsetParent,strategy){const isOffsetParentAnElement=isHTMLElement(offsetParent);const documentElement=getDocumentElement(offsetParent);const isFixed=strategy==="fixed";const rect=getBoundingClientRect(element,true,isFixed,offsetParent);let scroll={scrollLeft:0,scrollTop:0};const offsets=createCoords(0);if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement)){scroll=getNodeScroll(offsetParent)}if(isOffsetParentAnElement){const offsetRect=getBoundingClientRect(offsetParent,true,isFixed,offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft;offsets.y=offsetRect.y+offsetParent.clientTop}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement)}}const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll):createCoords(0);const x=rect.left+scroll.scrollLeft-offsets.x-htmlOffset.x;const y=rect.top+scroll.scrollTop-offsets.y-htmlOffset.y;return{x:x,y:y,width:rect.width,height:rect.height}}function isStaticPositioned(element){return getComputedStyle(element).position==="static"}function getTrueOffsetParent(element,polyfill){if(!isHTMLElement(element)||getComputedStyle(element).position==="fixed"){return null}if(polyfill){return polyfill(element)}let rawOffsetParent=element.offsetParent;if(getDocumentElement(element)===rawOffsetParent){rawOffsetParent=rawOffsetParent.ownerDocument.body}return rawOffsetParent}function getOffsetParent(element,polyfill){const win=getWindow(element);if(isTopLayer(element)){return win}if(!isHTMLElement(element)){let svgOffsetParent=getParentNode(element);while(svgOffsetParent&&!isLastTraversableNode(svgOffsetParent)){if(isElement(svgOffsetParent)&&!isStaticPositioned(svgOffsetParent)){return svgOffsetParent}svgOffsetParent=getParentNode(svgOffsetParent)}return win}let offsetParent=getTrueOffsetParent(element,polyfill);while(offsetParent&&isTableElement(offsetParent)&&isStaticPositioned(offsetParent)){offsetParent=getTrueOffsetParent(offsetParent,polyfill)}if(offsetParent&&isLastTraversableNode(offsetParent)&&isStaticPositioned(offsetParent)&&!isContainingBlock(offsetParent)){return win}return offsetParent||getContainingBlock(element)||win}const getElementRects=async function(data){const getOffsetParentFn=this.getOffsetParent||getOffsetParent;const getDimensionsFn=this.getDimensions;const floatingDimensions=await getDimensionsFn(data.floating);return{reference:getRectRelativeToOffsetParent(data.reference,await getOffsetParentFn(data.floating),data.strategy),floating:{x:0,y:0,width:floatingDimensions.width,height:floatingDimensions.height}}};function isRTL(element){return getComputedStyle(element).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement,getClippingRect:getClippingRect,getOffsetParent:getOffsetParent,getElementRects:getElementRects,getClientRects:getClientRects,getDimensions:getDimensions,getScale:getScale,isElement:isElement,isRTL:isRTL};function rectsAreEqual(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}function observeMove(element,onMove){let io=null;let timeoutId;const root=getDocumentElement(element);function cleanup(){var _io;clearTimeout(timeoutId);(_io=io)==null||_io.disconnect();io=null}function refresh(skip,threshold){if(skip===void 0){skip=false}if(threshold===void 0){threshold=1}cleanup();const elementRectForRootMargin=element.getBoundingClientRect();const{left:left2,top:top2,width:width,height:height}=elementRectForRootMargin;if(!skip){onMove()}if(!width||!height){return}const insetTop=floor(top2);const insetRight=floor(root.clientWidth-(left2+width));const insetBottom=floor(root.clientHeight-(top2+height));const insetLeft=floor(left2);const rootMargin=-insetTop+"px "+-insetRight+"px "+-insetBottom+"px "+-insetLeft+"px";const options={rootMargin:rootMargin,threshold:max(0,min(1,threshold))||1};let isFirstUpdate=true;function handleObserve(entries){const ratio=entries[0].intersectionRatio;if(ratio!==threshold){if(!isFirstUpdate){return refresh()}if(!ratio){timeoutId=setTimeout((()=>{refresh(false,1e-7)}),1e3)}else{refresh(false,ratio)}}if(ratio===1&&!rectsAreEqual(elementRectForRootMargin,element.getBoundingClientRect())){refresh()}isFirstUpdate=false}try{io=new IntersectionObserver(handleObserve,{...options,root:root.ownerDocument})}catch(e){io=new IntersectionObserver(handleObserve,options)}io.observe(element)}refresh(true);return cleanup}function autoUpdate(reference2,floating,update,options){if(options===void 0){options={}}const{ancestorScroll:ancestorScroll=true,ancestorResize:ancestorResize=true,elementResize:elementResize=typeof ResizeObserver==="function",layoutShift:layoutShift=typeof IntersectionObserver==="function",animationFrame:animationFrame=false}=options;const referenceEl=unwrapElement(reference2);const ancestors=ancestorScroll||ancestorResize?[...referenceEl?getOverflowAncestors(referenceEl):[],...getOverflowAncestors(floating)]:[];ancestors.forEach((ancestor=>{ancestorScroll&&ancestor.addEventListener("scroll",update,{passive:true});ancestorResize&&ancestor.addEventListener("resize",update)}));const cleanupIo=referenceEl&&layoutShift?observeMove(referenceEl,update):null;let reobserveFrame=-1;let resizeObserver=null;if(elementResize){resizeObserver=new ResizeObserver((_ref=>{let[firstEntry]=_ref;if(firstEntry&&firstEntry.target===referenceEl&&resizeObserver){resizeObserver.unobserve(floating);cancelAnimationFrame(reobserveFrame);reobserveFrame=requestAnimationFrame((()=>{var _resizeObserver;(_resizeObserver=resizeObserver)==null||_resizeObserver.observe(floating)}))}update()}));if(referenceEl&&!animationFrame){resizeObserver.observe(referenceEl)}resizeObserver.observe(floating)}let frameId;let prevRefRect=animationFrame?getBoundingClientRect(reference2):null;if(animationFrame){frameLoop()}function frameLoop(){const nextRefRect=getBoundingClientRect(reference2);if(prevRefRect&&!rectsAreEqual(prevRefRect,nextRefRect)){update()}prevRefRect=nextRefRect;frameId=requestAnimationFrame(frameLoop)}update();return()=>{var _resizeObserver2;ancestors.forEach((ancestor=>{ancestorScroll&&ancestor.removeEventListener("scroll",update);ancestorResize&&ancestor.removeEventListener("resize",update)}));cleanupIo==null||cleanupIo();(_resizeObserver2=resizeObserver)==null||_resizeObserver2.disconnect();resizeObserver=null;if(animationFrame){cancelAnimationFrame(frameId)}}}const offset=offset$3;const shift=shift$1;const flip=flip$3;const arrow=arrow$3;const computePosition=(reference2,floating,options)=>{const cache=new Map;const mergedOptions={platform:platform,...options};const platformWithCache={...mergedOptions.platform,_c:cache};return computePosition$1(reference2,floating,{...mergedOptions,platform:platformWithCache})};const TOOLTIP_OFFSET=20;const TOOLTIP_TIMEOUT=250;const SAFE_ZONE_MARGIN=1;class PbTooltip extends PbEnhancedElement{static get selector(){return"[data-pb-tooltip-kit]"}connect(){this.triggerHandlers=new Map;if(this.tooltipInteraction){this.mouseMoveHandler=e=>{this.lastMouseX=e.clientX;this.lastMouseY=e.clientY};document.addEventListener("mousemove",this.mouseMoveHandler)}this.triggerElements.forEach((trigger=>{const method=this.effectiveTriggerMethod;const interactionEnabled=this.tooltipInteraction;if(method==="click"){const clickHandler=e=>{if(this.useClickToOpen){e.preventDefault();if(this.isTooltipVisible()){this.hideTooltip()}else{this.showTooltip(trigger)}}else{this.showTooltip(trigger)}};trigger.addEventListener("click",clickHandler);this.triggerHandlers.set(trigger,{click:clickHandler})}else{if(!this.useClickToOpen){const mouseenterHandler=()=>{clearSafeZoneListener(this);clearTimeout(this.mouseleaveTimeout);this.currentTrigger=trigger;const delayOpen=this.delayOpen?parseInt(this.delayOpen):TOOLTIP_TIMEOUT;this.mouseenterTimeout=setTimeout((()=>{this.showTooltip(trigger);if(interactionEnabled){this.checkCloseTooltip(trigger)}}),delayOpen)};const mouseleaveHandler=()=>{clearTimeout(this.mouseenterTimeout);if(this.delayClose){const delayClose=parseInt(this.delayClose);this.mouseleaveTimeout=setTimeout((()=>{if(interactionEnabled){this.attachSafeZoneListener()}else{this.hideTooltip()}}),delayClose)}else{if(interactionEnabled){this.attachSafeZoneListener()}else{this.hideTooltip()}}};trigger.addEventListener("mouseenter",mouseenterHandler);trigger.addEventListener("mouseleave",mouseleaveHandler);this.triggerHandlers.set(trigger,{mouseenter:mouseenterHandler,mouseleave:mouseleaveHandler});if(interactionEnabled){if(!this.tooltipMouseenterHandler){this.tooltipMouseenterHandler=()=>{clearSafeZoneListener(this)};this.tooltipMouseleaveHandler=()=>{this.attachSafeZoneListener()};this.tooltip.addEventListener("mouseenter",this.tooltipMouseenterHandler);this.tooltip.addEventListener("mouseleave",this.tooltipMouseleaveHandler)}}}}}))}disconnect(){clearTimeout(this.mouseenterTimeout);clearTimeout(this.mouseleaveTimeout);clearTimeout(this.autoHideTimeout);clearSafeZoneListener(this);if(this.cleanup){this.cleanup();this.cleanup=null}if(this.mouseMoveHandler){document.removeEventListener("mousemove",this.mouseMoveHandler)}this.triggerHandlers.forEach(((handlers,trigger)=>{Object.entries(handlers).forEach((([event,handler])=>{trigger.removeEventListener(event,handler)}))}));this.triggerHandlers.clear();if(this.tooltipMouseenterHandler){this.tooltip.removeEventListener("mouseenter",this.tooltipMouseenterHandler);this.tooltip.removeEventListener("mouseleave",this.tooltipMouseleaveHandler)}}isTooltipVisible(){return this.tooltip&&this.tooltip.classList.contains("show")}attachSafeZoneListener(){clearSafeZoneListener(this);this.safeZoneHandler=e=>{if(!this.currentTrigger)return;const triggerRect=this.currentTrigger.getBoundingClientRect();const tooltipRect=this.tooltip.getBoundingClientRect();const safeRect=getSafeZone(triggerRect,tooltipRect,this.position,SAFE_ZONE_MARGIN);if(!isPointInsideRect(e.clientX,e.clientY,safeRect)){this.hideTooltip();clearSafeZoneListener(this)}};document.addEventListener("mousemove",this.safeZoneHandler)}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;clearSafeZoneListener(this);this.tooltip.style.opacity="1";this.tooltip.style.visibility="visible";this.tooltip.style.pointerEvents="auto";if(this.cleanup){this.cleanup()}const arrowElement=document.querySelector(`#${this.tooltipId}-arrow`);this.cleanup=autoUpdate(trigger,this.tooltip,(()=>{computePosition(trigger,this.tooltip,{placement:this.position,strategy:"fixed",middleware:[offset({mainAxis:TOOLTIP_OFFSET,crossAxis:0}),flip(),shift(),arrow({element:arrowElement})]}).then((({x:x,y:y,placement:placement,middlewareData:middlewareData})=>{Object.assign(this.tooltip.style,{left:`${x}px`,top:`${y}px`,position:"fixed"});this.tooltip.setAttribute("data-popper-placement",placement);if(arrowElement&&middlewareData.arrow){const{x:arrowX,y:arrowY}=middlewareData.arrow;Object.assign(arrowElement.style,{left:arrowX!=null?`${arrowX}px`:"",top:arrowY!=null?`${arrowY}px`:"",position:"absolute"})}}))}));this.tooltip.classList.add("show");if(this.effectiveTriggerMethod==="click"&&!this.useClickToOpen){clearTimeout(this.autoHideTimeout);this.autoHideTimeout=setTimeout((()=>{this.hideTooltip()}),1e3)}}hideTooltip(){if(!this.tooltip)return;this.tooltip.classList.add("fade_out");setTimeout((()=>{if(this.cleanup){this.cleanup();this.cleanup=null}this.tooltip.classList.remove("show");this.tooltip.classList.remove("fade_out");this.tooltip.style.opacity="0";this.tooltip.style.visibility="hidden";this.tooltip.style.pointerEvents="none";this.tooltip.style.position="";this.tooltip.style.top="";this.tooltip.style.left="";this.tooltip.style.transform=""}),TOOLTIP_TIMEOUT)}get triggerElements(){let triggerEl;if(this.triggerElementId){triggerEl=document.querySelector(`#${this.triggerElementId}`)}else if(this.triggerElementSelector){const selectorIsId=this.triggerElementSelector.indexOf("#")>-1;triggerEl=selectorIsId?document.querySelector(this.triggerElementSelector):document.querySelectorAll(this.triggerElementSelector)}else{triggerEl=this.element}if(!triggerEl){console.error("Tooltip Kit: No valid trigger element found!");return[]}if(triggerEl.length===void 0){triggerEl=[triggerEl]}return 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}get triggerMethod(){return this.element.dataset.pbTooltipTriggerMethod||"hover"}get useClickToOpen(){return this.element.dataset.pbTooltipUseClickToOpen==="true"}get effectiveTriggerMethod(){return this.useClickToOpen?"click":this.triggerMethod}get tooltipInteraction(){return this.element.dataset.pbTooltipInteraction==="true"}get delayOpen(){return this.element.dataset.pbTooltipDelayOpen}get delayClose(){return this.element.dataset.pbTooltipDelayClose}}function clearSafeZoneListener(context){if(context.safeZoneHandler){document.removeEventListener("mousemove",context.safeZoneHandler);context.safeZoneHandler=null}}function getSafeZone(triggerRect,tooltipRect,placement,margin){let safeRect={};if(placement.startsWith("top")){safeRect.left=triggerRect.left-margin;safeRect.right=triggerRect.right+margin;safeRect.top=tooltipRect.bottom-margin;safeRect.bottom=triggerRect.top+margin}else if(placement.startsWith("bottom")){safeRect.left=triggerRect.left-margin;safeRect.right=triggerRect.right+margin;safeRect.top=triggerRect.bottom-margin;safeRect.bottom=tooltipRect.top+margin}else if(placement.startsWith("left")){safeRect.top=triggerRect.top-margin;safeRect.bottom=triggerRect.bottom+margin;safeRect.left=tooltipRect.right-margin;safeRect.right=triggerRect.left+margin}else if(placement.startsWith("right")){safeRect.top=triggerRect.top-margin;safeRect.bottom=triggerRect.bottom+margin;safeRect.left=triggerRect.right-margin;safeRect.right=tooltipRect.left+margin}else{safeRect={left:triggerRect.left-margin,right:triggerRect.right+margin,top:triggerRect.top-margin,bottom:triggerRect.bottom+margin}}return safeRect}function isPointInsideRect(x,y,rect){return x>=rect.left&&x<=rect.right&&y>=rect.top&&y<=rect.bottom}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)));if(this.clearOnContextChange&&this.searchContextElement){this.searchContextElement.addEventListener("change",(()=>{this.searchInputClear();this.resultsCacheClear();this.clearResults()}))}}get optionsByContext(){return this.element.dataset.pbTypeaheadKitOptionsByContext?JSON.parse(this.element.dataset.pbTypeaheadKitOptionsByContext):null}get searchContextElement(){var _a;const selector=this.element.dataset.pbTypeaheadKitSearchContextSelector;if(!selector)return null;const found=((_a=this.element.parentNode)==null?void 0:_a.querySelector(`#${selector}`))||this.element.closest(selector);return found||null}get clearOnContextChange(){return this.element.dataset.pbTypeaheadKitClearOnContextChange==="true"}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;if(this.optionsByContext&&Object.keys(this.optionsByContext).length>0){const contextArray=this.optionsByContext[searchContext]||[];const filteredResults=contextArray.filter((obj=>obj.label&&obj.label.toLowerCase().includes(searchTerm.toLowerCase())));const optionFragments=filteredResults.map((obj=>{const singleOption=document.createDocumentFragment();singleOption.appendChild(document.createTextNode(obj.label));return singleOption}));this.resultsCacheUpdate(searchTerm,searchContext,optionFragments)}else{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;const selectedText=resultOption.textContent.trim();this._validSelection=true;this.removeValidationError();if(this.searchContextElement)this.searchInput.value=selectedText;this.resultsCacheClear();if(!this.searchContextElement)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")}}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;else if(this.searchContextElement){return this.searchContextElement.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 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("pb_button_enabled","pb_button_disabled pb_button_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}}}))}};const lightest="1px";const lighter="2px";const light="4px";const normal$1="0";const heavy="5px";const heavier="6px";const heaviest="7px";const border_radius_xs="4px";const border_radius_sm="4px";const border_radius_md="6px";const border_radius_lg="8px";const border_radius_xl="16px";const border_radius_none="0";const border_radius_rounded="1000px";const _border_radius_module={lightest:lightest,lighter:lighter,light:light,normal:normal$1,heavy:heavy,heavier:heavier,heaviest:heaviest,border_radius_xs:border_radius_xs,border_radius_sm:border_radius_sm,border_radius_md:border_radius_md,border_radius_lg:border_radius_lg,border_radius_xl:border_radius_xl,border_radius_none:border_radius_none,border_radius_rounded:border_radius_rounded};const tightest="1";const tighter="1.2";const tight="1.4";const normal="1.5";const loose="1.6";const looser="1.8";const loosest="2";const _line_height_module={tightest:tightest,tighter:tighter,tight:tight,normal:normal,loose:loose,looser:looser,loosest:loosest};const opacity_1="0.1";const opacity_2="0.2";const opacity_3="0.3";const opacity_4="0.4";const opacity_5="0.5";const opacity_6="0.6";const opacity_7="0.7";const opacity_8="0.8";const opacity_9="0.9";const _opacity_module={opacity_1:opacity_1,opacity_2:opacity_2,opacity_3:opacity_3,opacity_4:opacity_4,opacity_5:opacity_5,opacity_6:opacity_6,opacity_7:opacity_7,opacity_8:opacity_8,opacity_9:opacity_9};const zindex_1="100";const zindex_2="100";const zindex_3="100";const zindex_4="100";const zindex_5="100";const zindex_6="100";const zindex_7="100";const zindex_8="100";const zindex_9="100";const _positioning_module={zindex_1:zindex_1,zindex_2:zindex_2,zindex_3:zindex_3,zindex_4:zindex_4,zindex_5:zindex_5,zindex_6:zindex_6,zindex_7:zindex_7,zindex_8:zindex_8,zindex_9:zindex_9};const hover_scale_sm="_scale-module__hover_scale_sm___mttFB";const hover_scale_md="_scale-module__hover_scale_md___ipMVm";const hover_scale_lg="_scale-module__hover_scale_lg___-EkY0";const _scale_module={hover_scale_sm:hover_scale_sm,hover_scale_md:hover_scale_md,hover_scale_lg:hover_scale_lg};const xs="575px";const sm="576px";const md="768px";const lg="992px";const xl="1200px";const _screen_sizes_module={xs:xs,sm:sm,md:md,lg:lg,xl:xl};const shadow_none="0 0 0 0 transparent";const shadow_deep="0 4px 10px 0 rgba(60, 106, 172, 0.16)";const shadow_deeper="0 12px 28px 0 rgba(60, 106, 172, 0.18)";const shadow_deepest="0 30px 38px 4px rgba(60, 106, 172, 0.2), 0 2px 14px 4px rgba(60, 106, 172, 0.1)";const _shadows_module={shadow_none:shadow_none,shadow_deep:shadow_deep,shadow_deeper:shadow_deeper,shadow_deepest:shadow_deepest};export{omitBy as $,kitRequiresPortaledFloatingUi as A,resolvePortaledKitHost as B,resolveFloatingOwnerId as C,setFloatingOwnerAttribute as D,positionFloatingShellToInput as E,subscribeFloatingKitOpen as F,recordPortaledMenuPointerDown as G,PB_FLOATING_OWNER_ATTR as H,resolvePortaledFloatingZIndex as I,nextPortaledFloatingZIndex as J,announceFloatingKitOpen as K,debounce$2 as L,PbPopover as M,PbTooltip as N,PbTypeahead as O,PbEnhancedElement as P,PbTable as Q,PbTextarea as R,formHelper as S,datePickerHelper as T,getAllIcons as U,spacing as V,useCollapsible as W,DateTime as X,uniqueId as Y,isPortaledFloatingKitInteraction as Z,resolveFullscreenOverlayForElement as _,get as a,isEmpty as a0,map as a1,partial as a2,find as a3,isString as a4,usePBCopy as a5,getAugmentedNamespace as a6,PB_MODAL_ABOVE_FULLSCREEN_Z_INDEX as a7,useDropdown as a8,ReactDOMServer as a9,useFullScreen as aa,cloneDeep as ab,mapTheme as ac,pbIndicator as ad,_border_radius_module as ae,_line_height_module as af,_opacity_module as ag,_positioning_module as ah,_scale_module as ai,_screen_sizes_module as aj,_shadows_module as ak,offset$3 as b,colors as c,flip$3 as d,arrow$3 as e,filter as f,getDefaultExportFromCjs as g,computePosition$1 as h,createCoords$1 as i,round$2 as j,min$2 as k,floor$1 as l,max$2 as m,noop as n,omit as o,stripEmojisForPaste as p,applyEmojiMask as q,rectToClientRect$1 as r,shift$1 as s,typography as t,positionDropdownPortalToWrapper as u,subscribeFloatingKitReposition as v,targetIsInsidePortaledFloatingKit as w,isNativeSelectMenuInteraction as x,createPopper as y,flatpickr 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 p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}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 self={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;self.monthsContainer=fp._createElement("div","flatpickr-monthSelect-months");self.monthsContainer.tabIndex=-1;buildMonths();fp.rContainer.appendChild(self.monthsContainer);fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-"+config.theme)}function buildMonths(){if(!self.monthsContainer)return;clearNode2(self.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)}self.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(self.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||!self.monthsContainer)return;var currentlySelected=fp.rContainer.querySelector(".flatpickr-monthSelect-month.selected");var index=Array.prototype.indexOf.call(self.monthsContainer.children,document.activeElement);if(index===-1){var target=currentlySelected||self.monthsContainer.firstElementChild;target.focus();index=target.$i}if(shouldMove){self.monthsContainer.children[(12+index+shifts[e.keyCode])%12].focus()}else if(e.keyCode===13&&self.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(self.monthsContainer!==null){var months2=self.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$1);return monthSelect$1.exports}var monthSelectExports=requireMonthSelect();const monthSelectPlugin=getDefaultExportFromCjs(monthSelectExports);var weekSelect$2={exports:{}};var weekSelect$1=weekSelect$2.exports;var hasRequiredWeekSelect;function requireWeekSelect(){if(hasRequiredWeekSelect)return weekSelect$2.exports;hasRequiredWeekSelect=1;(function(module,exports){(function(global,factory){module.exports=factory()})(weekSelect$1,(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$2);return weekSelect$2.exports}var weekSelectExports=requireWeekSelect();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?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?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;const originalClear=fp.clear;fp.clear=function(...args){const current=pluginData.rangesNav.querySelector(".active");if(current){current.classList.remove("active")}activeLabel="";return originalClear.apply(this,args)};if(!isLabelMatchingSelectedDates(selectedDates)){(_a=pluginData.rangesButtons[activeLabel])==null?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 PB_DIALOG_FLOATING_ROOT_SELECTOR="[data-pb-dialog-floating-root]";const PB_FULLSCREEN_OVERLAY_SELECTOR=".fullscreen-overlay";const PB_MODAL_ABOVE_FULLSCREEN_Z_INDEX=1e6;const PB_FLOATING_OWNER_ATTR="data-pb-floating-owner";const DIALOG_DIRECT_FLOATING_ROOT=`:scope > ${PB_DIALOG_FLOATING_ROOT_SELECTOR}`;const POPOVER_FLOATING_ROOT=`:scope > .pb_popover_body > ${PB_DIALOG_FLOATING_ROOT_SELECTOR}`;function resolveDialogFloatingPortalHost(fromElement){const dialogEl=fromElement==null?void 0:fromElement.closest("dialog");if(dialogEl){return dialogEl.querySelector(DIALOG_DIRECT_FLOATING_ROOT)??dialogEl}const reactModalShell=fromElement==null?void 0:fromElement.closest(".pb_dialog");if(reactModalShell){return reactModalShell.querySelector(DIALOG_DIRECT_FLOATING_ROOT)??reactModalShell}const popoverEl=fromElement==null?void 0:fromElement.closest(".pb_popover_tooltip");if(popoverEl){return popoverEl.querySelector(POPOVER_FLOATING_ROOT)??popoverEl.querySelector(PB_DIALOG_FLOATING_ROOT_SELECTOR)??popoverEl}return null}function resolveFullscreenOverlayForElement(element){const overlay=element==null?void 0:element.closest(PB_FULLSCREEN_OVERLAY_SELECTOR);return overlay instanceof HTMLElement?overlay:null}function resolveFullscreenFloatingPortalHost(fromElement){const overlay=resolveFullscreenOverlayForElement(fromElement);if(!overlay)return null;return overlay.querySelector(DIALOG_DIRECT_FLOATING_ROOT)??overlay}function resolvePortaledKitHost(kitRoot,dialogCtxTarget){if(typeof document==="undefined")return null;if(kitRoot==null?void 0:kitRoot.closest(".pb_popover_tooltip")){const fullscreenHost=resolveFullscreenFloatingPortalHost(kitRoot);if(fullscreenHost){return fullscreenHost}return document.body}return resolveDialogFloatingPortalHost(kitRoot)??resolveFullscreenFloatingPortalHost(kitRoot)??dialogCtxTarget??null}function kitRequiresPortaledFloatingUi(kitRoot){if(!kitRoot)return false;return kitRoot.closest(".pb_popover_tooltip")!==null||kitRoot.closest("dialog")!==null||kitRoot.closest(".pb_dialog")!==null||kitRoot.closest(PB_FULLSCREEN_OVERLAY_SELECTOR)!==null}function resolveFloatingOwnerId(kitRoot){if(!kitRoot)return null;const marked=kitRoot.closest(`[${PB_FLOATING_OWNER_ATTR}]`);if(marked){return marked.getAttribute(PB_FLOATING_OWNER_ATTR)}const popoverTooltip=kitRoot.closest(".pb_popover_tooltip");if(popoverTooltip==null?void 0:popoverTooltip.id){return popoverTooltip.id}const dialogShell=kitRoot.closest("dialog, .pb_dialog");if(dialogShell==null?void 0:dialogShell.id){return dialogShell.id}return null}function setFloatingOwnerAttribute(element,ownerId){if(!element)return;if(ownerId){element.setAttribute(PB_FLOATING_OWNER_ATTR,ownerId)}else{element.removeAttribute(PB_FLOATING_OWNER_ATTR)}}function ownerScopeSelector(ownerId){return`[${PB_FLOATING_OWNER_ATTR}="${CSS.escape(ownerId)}"]`}function isPortaledFloatingMenuNode(target){return target.closest(".typeahead-kit-select__menu-portal")!==null||target.closest(".pb_multi_level_select_floating_shell")!==null||target.closest(".pb_dropdown_floating_shell")!==null||target.closest(".pb_date_picker_floating_shell")!==null||target.closest(".flatpickr-calendar")!==null||target.closest(".pb_time_picker_floating_shell")!==null||target.closest(".pb_time_picker_panel_portal")!==null||target.closest(".pb_time_picker_container")!==null||target.closest(".time_dropdown")!==null||target.closest(".time_dropdown_option")!==null}const PORTAL_OWNER_HIT_TEST_SELECTORS=[".typeahead-kit-select__menu-portal",".pb_multi_level_select_floating_shell",".pb_dropdown_floating_shell",".pb_date_picker_floating_shell",".flatpickr-calendar",".pb_time_picker_floating_shell",".pb_time_picker_panel_portal",".pb_time_picker_container",".time_dropdown",".time_dropdown_option"].join(", ");function pointInVisibleRect(x,y,rect){return rect.width>0&&rect.height>0&&x>=rect.left&&x<=rect.right&&y>=rect.top&&y<=rect.bottom}function portaledFloatingOwnerMenusAtPoint(x,y,ownerId){if(typeof document==="undefined"){return false}const roots=document.querySelectorAll(ownerScopeSelector(ownerId));for(const root of roots){if(root.classList.contains("pb_popover_tooltip")||root.classList.contains("pb_popover_body")||root.classList.contains("pb_popover_floating_root")){continue}const candidates=[root];root.querySelectorAll(PORTAL_OWNER_HIT_TEST_SELECTORS).forEach((node=>{candidates.push(node)}));for(const node of candidates){if(pointInVisibleRect(x,y,node.getBoundingClientRect())){return true}}}return false}function eventTargetAsElement(target){if(!target)return null;if(target instanceof HTMLElement)return target;if(target instanceof Node){return target.parentElement}return null}function isNativeSelectMenuInteraction(dialogElement,target){const el=eventTargetAsElement(target);const selectFromTarget=el instanceof HTMLSelectElement?el:(el==null?void 0:el.closest("select"))??null;if(selectFromTarget instanceof HTMLSelectElement&&dialogElement.contains(selectFromTarget)){return true}const active=document.activeElement;return active instanceof HTMLSelectElement&&dialogElement.contains(active)}function targetIsInsidePortaledFloatingKit(target,ownerId){if(!isPortaledFloatingMenuNode(target)){return false}if(!ownerId){return true}return target.closest(ownerScopeSelector(ownerId))!==null}function portaledFloatingKitAtPoint(x,y,ownerId){if(typeof document==="undefined"){return false}try{if(typeof document.elementsFromPoint==="function"){return document.elementsFromPoint(x,y).some((el=>{if(!(el instanceof HTMLElement))return false;return targetIsInsidePortaledFloatingKit(el,ownerId)}))}if(typeof document.elementFromPoint==="function"){const el=document.elementFromPoint(x,y);return el instanceof HTMLElement&&targetIsInsidePortaledFloatingKit(el,ownerId)}}catch{return false}return false}let portaledMenuPointerDown=null;function recordPortaledMenuPointerDown(ownerId,x,y){portaledMenuPointerDown={ownerId:ownerId,x:x,y:y,at:Date.now()}}function matchesPortaledMenuPointerDown(ownerId,x,y,maxAgeMs=750){const rec=portaledMenuPointerDown;if(!rec||rec.ownerId!==ownerId)return false;if(Date.now()-rec.at>maxAgeMs)return false;return Math.abs(rec.x-x)<=2&&Math.abs(rec.y-y)<=2}function isPortaledFloatingKitInteraction(target,ownerId,clientX,clientY){const el=eventTargetAsElement(target);if(el&&targetIsInsidePortaledFloatingKit(el,ownerId)){return true}if(clientX==null||clientY==null){return false}if(ownerId&&matchesPortaledMenuPointerDown(ownerId,clientX,clientY)){return true}if(ownerId&&portaledFloatingOwnerMenusAtPoint(clientX,clientY,ownerId)){return true}return portaledFloatingKitAtPoint(clientX,clientY,ownerId)}const PB_PORTALED_FLOATING_Z_INDEX="1002";const PB_PORTALED_FLOATING_Z_INDEX_MAX=10009;let portaledFloatingZIndexSeq=Number(PB_PORTALED_FLOATING_Z_INDEX);function nextPortaledFloatingZIndex(){portaledFloatingZIndexSeq=Math.min(portaledFloatingZIndexSeq+1,PB_PORTALED_FLOATING_Z_INDEX_MAX);return String(portaledFloatingZIndexSeq)}function resolvePortaledFloatingZIndex(_portalHost,preferred){const z=Number(preferred??PB_PORTALED_FLOATING_Z_INDEX);return String(Math.min(z,PB_PORTALED_FLOATING_Z_INDEX_MAX))}const PB_FLOATING_KIT_OPEN_EVENT="pb-floating-kit-open";function announceFloatingKitOpen(kitKind,ownerId){if(typeof document==="undefined")return;document.dispatchEvent(new CustomEvent(PB_FLOATING_KIT_OPEN_EVENT,{detail:{kitKind:kitKind,ownerId:ownerId}}))}function subscribeFloatingKitOpen(handler){if(typeof document==="undefined"){return()=>void 0}const listener=event=>{handler(event.detail)};document.addEventListener(PB_FLOATING_KIT_OPEN_EVENT,listener);return()=>document.removeEventListener(PB_FLOATING_KIT_OPEN_EVENT,listener)}function isPortalCoordinateRootBody(el){return el!=null&&el.nodeName==="BODY"}function positionFloatingShellToInput(args){const{shell:shell,inputViewportRect:inputViewportRect,menuEl:menuEl,maxMenuHeightPx:maxMenuHeightPx,positionHost:positionHost,styleTarget:styleTarget}=args;const coordHost=positionHost??shell.parentElement;if(!coordHost)return;const box=styleTarget??shell;const coordTopPx=inputViewportRect.bottom+4;box.style.margin="0";box.style.padding="0";box.style.pointerEvents="auto";box.style.zIndex=resolvePortaledFloatingZIndex(coordHost,args.zIndex??PB_PORTALED_FLOATING_Z_INDEX);box.style.width=`${Math.round(inputViewportRect.width)}px`;if(isPortalCoordinateRootBody(coordHost)){box.style.position="fixed";box.style.left=`${Math.round(inputViewportRect.left)}px`;box.style.top=`${Math.round(coordTopPx)}px`}else{const hr=coordHost.getBoundingClientRect();box.style.position="absolute";box.style.left=`${Math.round(inputViewportRect.left-hr.left)}px`;box.style.top=`${Math.round(inputViewportRect.bottom-hr.top+4)}px`}if(menuEl){const mh=Math.round(maxMenuHeightPx);menuEl.style.maxHeight=`${mh}px`;menuEl.style.overflow="auto"}}function positionDropdownPortalToWrapper(args){const margin=args.marginPx??5;const matchWrapperWidth=args.matchWrapperWidth??true;const preferBelow=args.preferBelow??false;const{panel:panel,wrapperViewportRect:wr,positionHost:positionHost}=args;const h=panel.getBoundingClientRect().height||panel.scrollHeight||0;const spaceBelow=window.innerHeight-wr.bottom;const spaceAbove=wr.top;let topPx;if(!preferBelow&&h>0&&spaceBelow<h+10&&spaceAbove>=h+10){topPx=wr.top-h-margin}else{topPx=wr.bottom+margin}panel.style.margin="0";panel.style.pointerEvents="auto";panel.style.zIndex=resolvePortaledFloatingZIndex(positionHost,args.zIndex??PB_PORTALED_FLOATING_Z_INDEX);if(matchWrapperWidth){panel.style.width=`${Math.round(wr.width)}px`}else{panel.style.removeProperty("width")}if(isPortalCoordinateRootBody(positionHost)){panel.style.position="fixed";panel.style.left=`${Math.round(wr.left)}px`;panel.style.top=`${Math.round(topPx)}px`}else{const hr=positionHost.getBoundingClientRect();panel.style.position="absolute";panel.style.left=`${Math.round(wr.left-hr.left)}px`;panel.style.top=`${Math.round(topPx-hr.top)}px`}}function subscribeFloatingKitReposition(reposition){if(typeof window==="undefined"||typeof document==="undefined"){return()=>void 0}const scrollOpts={capture:true,passive:true};let rafId=null;const run=()=>{if(rafId!=null)return;rafId=requestAnimationFrame((()=>{rafId=null;reposition()}))};window.addEventListener("scroll",run,scrollOpts);document.addEventListener("scroll",run,scrollOpts);window.addEventListener("resize",run);const vv=window.visualViewport;if(vv){vv.addEventListener("scroll",run);vv.addEventListener("resize",run)}return()=>{if(rafId!=null){cancelAnimationFrame(rafId);rafId=null}window.removeEventListener("scroll",run,scrollOpts);document.removeEventListener("scroll",run,scrollOpts);window.removeEventListener("resize",run);if(vv){vv.removeEventListener("scroll",run);vv.removeEventListener("resize",run)}}}const{angleDown:angleDown,angleLeft:angleLeft,angleRight:angleRight}=getAllIcons();const angleDownString=angleDown.string;const angleLeftString=angleLeft.string;const angleRightString=angleRight.string;const getPositionElement=element=>typeof element==="string"?document.querySelectorAll(element)[0]:element;const dateTokenWidths={Y:4,d:2,j:2,m:2,n:2,y:2};const escapeForCharacterClass=char=>char.replace(/[\\\]^-]/g,"\\$&");const withDateSeparators=(dateStr,format)=>{if(typeof dateStr!=="string")return dateStr;const tokens=[...(format||"").split(" ")[0]];const expectedLength=tokens.reduce(((total,token)=>total+(dateTokenWidths[token]||0)),0);const hasUnsupportedToken=tokens.some((token=>/[a-z]/i.test(token)&&!dateTokenWidths[token]));if(hasUnsupportedToken||expectedLength===0)return dateStr;const separators=[...new Set(tokens.filter((token=>!dateTokenWidths[token])))];const separatorClass=separators.map(escapeForCharacterClass).join("");const match=dateStr.match(new RegExp(`^(\\s*)([\\d${separatorClass}]*\\d)([\\s\\S]*)$`));if(!match)return dateStr;const[,leadingSpace,dateRun,rest]=match;const digits=separatorClass?dateRun.replace(new RegExp(`[${separatorClass}]`,"g"),""):dateRun;if(digits.length!==expectedLength)return dateStr;let position=0;const dated=tokens.map((token=>{const width=dateTokenWidths[token];if(!width)return token;position+=width;return digits.slice(position-width,position)})).join("");return`${leadingSpace}${dated}${rest}`};const datePickerHelper=(config,scrollContainer)=>{var _a,_b,_c;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",yearAscending:yearAscending,yearRange:yearRange,controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith,dialogPortalTarget:dialogPortalTarget,inline:inline=false}=config;const inputElForPortal=typeof document!=="undefined"?document.querySelector(`#${String(pickerId)}`):null;const kitRootForPortal=inputElForPortal==null?void 0:inputElForPortal.closest(".pb_date_picker_kit");const portalHost=!inline&&kitRootForPortal&&kitRequiresPortaledFloatingUi(kitRootForPortal)?resolvePortaledKitHost(kitRootForPortal,dialogPortalTarget??null):null;const floatingOwnerId=resolveFloatingOwnerId(kitRootForPortal);const effectiveStatic=portalHost?false:staticPosition;const existingInput=document.querySelector(`#${String(pickerId)}`);if(existingInput==null?void 0:existingInput._pbDatePickerOpenUnsub){existingInput._pbDatePickerOpenUnsub();delete existingInput._pbDatePickerOpenUnsub}if(existingInput==null?void 0:existingInput._flatpickr){existingInput._flatpickr.destroy()}let portalAppendShell;const removePortalShell=()=>{if(!portalHost)return;const shellSelector=`[data-pb-date-picker-floating-shell="${String(pickerId)}"]`;const shell=(portalAppendShell==null?void 0:portalAppendShell.isConnected)?portalAppendShell:portalHost.querySelector(shellSelector);shell==null?void 0:shell.remove();portalAppendShell=void 0};const ensurePortalShell=()=>{if(!portalHost)return void 0;if(portalAppendShell==null?void 0:portalAppendShell.isConnected)return portalAppendShell;const shellSelector=`[data-pb-date-picker-floating-shell="${String(pickerId)}"]`;portalAppendShell=portalHost.querySelector(shellSelector);if(!portalAppendShell){portalAppendShell=document.createElement("div");portalAppendShell.className="pb_date_picker_floating_shell pb_date_picker_kit";portalAppendShell.setAttribute("data-pb-date-picker-floating-shell",String(pickerId));portalAppendShell.addEventListener("mousedown",(e=>{e.stopPropagation()}));portalAppendShell.addEventListener("click",(e=>{e.stopPropagation()}));portalHost.appendChild(portalAppendShell)}setFloatingOwnerAttribute(portalAppendShell,floatingOwnerId);return portalAppendShell};const mountCalendarInPortalShell=fp=>{const shell=ensurePortalShell();if(!(shell==null?void 0:shell.isConnected)||!fp.calendarContainer)return;if(fp.calendarContainer.parentElement!==shell){shell.appendChild(fp.calendarContainer)}};let activePortalZIndex;let unsubscribeFloatingReposition=null;const defaultDateGetter=()=>{if(defaultDate===""){return null}else{return defaultDate}};const getMinMaxYears=()=>{const[minYear,maxYear]=yearRange;const extractYear=dateOption=>{if(!dateOption)return null;if(typeof dateOption==="number"){return dateOption}if(typeof dateOption==="string"){const match=dateOption.match(/\b(19|20)\d{2}\b/);return match?parseInt(match[0],10):null}if(dateOption instanceof Date){return dateOption.getFullYear()}return null};const setMinYear2=minDate?extractYear(minDate)??minYear:minYear;const setMaxYear2=maxDate?extractYear(maxDate)??maxYear:maxYear;return{setMinYear:setMinYear2,setMaxYear:setMaxYear2}};const{setMinYear:setMinYear,setMaxYear:setMaxYear}=getMinMaxYears();const getMinMaxDates=()=>{const setMinDate2=minDate||`01/01/${setMinYear}`;const setMaxDate2=maxDate||`12/31/${setMaxYear}`;return{setMinDate:setMinDate2,setMaxDate:setMaxDate2}};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?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 positionCalendarIfNeeded=fp=>{if(portalHost){mountCalendarInPortalShell(fp);fp._positionCalendar();return}const cal=document.querySelector(`#cal-${pickerId}`);if(!cal)return;const inputRect=fp.input.getBoundingClientRect();const h=cal.getBoundingClientRect().height||300;const spaceBelow=window.innerHeight-inputRect.bottom;const spaceAbove=inputRect.top;if(spaceBelow<h+10&&spaceAbove>=h+10){if(effectiveStatic){cal.style.top="auto";cal.style.bottom="calc(100% + 5px)"}else{cal.style.position="fixed";cal.style.top=`${Math.max(10,inputRect.top-h-5)}px`;cal.style.left=`${inputRect.left}px`}}else if(effectiveStatic){cal.style.top="";cal.style.bottom=""}else{Object.assign(cal.style,{position:"",top:"",left:"",bottom:"",right:"",transform:""});fp._positionCalendar()}};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 scrollEvent=()=>{var _a2;const fp=(_a2=document.querySelector(`#${pickerId}`))==null?void 0:_a2._flatpickr;fp==null?void 0:fp._positionCalendar()};function attachToScroll(scrollParent){var _a2;(_a2=document.querySelectorAll(scrollParent)[0])==null?void 0:_a2.addEventListener("scroll",scrollEvent,{passive:true})}function detachFromScroll(scrollParent=document.body){var _a2;(_a2=document.querySelectorAll(scrollParent)[0])==null?void 0:_a2.removeEventListener("scroll",scrollEvent)}const yearSelectId=`year-${pickerId}`;const yearDropdownFromCalendar=fp=>{var _a2;return((_a2=fp.calendarContainer)==null?void 0:_a2.querySelector(`#${yearSelectId}`))??null};const yearDropdownIsReady=fp=>{const dropdown=yearDropdownFromCalendar(fp);return dropdown!==null&&dropdown.options.length>0};const yearChangeHook=fp=>{var _a2;const yearInput=yearDropdownFromCalendar(fp);if(yearInput){yearInput.value=(_a2=fp.currentYear)==null?void 0:_a2.toString()}};const handleDatePickerChange=(fp,selectedDates)=>{const inputEl=fp.input;if(inputEl){const inlineDatePickerElem=inputEl.closest(".inline-date-picker");if(inlineDatePickerElem){if(selectedDates&&selectedDates.length>0){inlineDatePickerElem.classList.add("show-angle-down-icon")}else{inlineDatePickerElem.classList.remove("show-angle-down-icon")}}}};let resizeRepositionHandlerRef=null;const{setMinDate:setMinDate,setMaxDate:setMaxDate}=getMinMaxDates();const toDateObject=dateValue=>{if(!dateValue)return null;if(dateValue instanceof Date){return isNaN(dateValue.getTime())?null:dateValue}if(typeof dateValue==="string"){const parsed=new Date(dateValue);return isNaN(parsed.getTime())?null:parsed}if(typeof dateValue==="number"){return new Date(dateValue)}return null};const formatDateForFlatpickr=dateValue=>{const dateObj=toDateObject(dateValue);if(!dateObj)return null;const year=dateObj.getFullYear();const month=String(dateObj.getMonth()+1).padStart(2,"0");const day=String(dateObj.getDate()).padStart(2,"0");return`${year}-${month}-${day}`};const isDefaultDateBeforeMinDate=(defaultDateValue2,minDateValue)=>{if(!defaultDateValue2||!minDateValue)return false;const defaultDateObj=toDateObject(defaultDateValue2);const minDateObj=toDateObject(minDateValue);if(!defaultDateObj||!minDateObj)return false;const defaultDateOnly=new Date(defaultDateObj.getFullYear(),defaultDateObj.getMonth(),defaultDateObj.getDate());const minDateOnly=new Date(minDateObj.getFullYear(),minDateObj.getMonth(),minDateObj.getDate());return defaultDateOnly<minDateOnly};const isDefaultDateAfterMaxDate=(defaultDateValue2,maxDateValue)=>{if(!defaultDateValue2||!maxDateValue)return false;const defaultDateObj=toDateObject(defaultDateValue2);const maxDateObj=toDateObject(maxDateValue);if(!defaultDateObj||!maxDateObj)return false;const defaultDateOnly=new Date(defaultDateObj.getFullYear(),defaultDateObj.getMonth(),defaultDateObj.getDate());const maxDateOnly=new Date(maxDateObj.getFullYear(),maxDateObj.getMonth(),maxDateObj.getDate());return defaultDateOnly>maxDateOnly};const defaultDateValue=defaultDateGetter();const isBeforeMin=minDate&&isDefaultDateBeforeMinDate(defaultDateValue,setMinDate);const isAfterMax=maxDate&&isDefaultDateAfterMaxDate(defaultDateValue,setMaxDate);const hasOutOfRangeDefault=(isBeforeMin||isAfterMax)&&defaultDateValue;const effectiveMinDate=isBeforeMin&&defaultDateValue&&minDate?formatDateForFlatpickr(defaultDateValue)||setMinDate:setMinDate;const effectiveMaxDate=isAfterMax&&defaultDateValue&&maxDate?formatDateForFlatpickr(defaultDateValue)||setMaxDate:setMaxDate;const resolveDatePickerPortalWrapper=input=>input.closest(".date_picker_input_wrapper")??input.closest(".text_input_wrapper")??input.closest(".input_wrapper")??input.closest(".pb_date_picker_kit");const portalPositionFn=portalHost?self=>{mountCalendarInPortalShell(self);const shell=ensurePortalShell();const cal=self.calendarContainer;if(!cal||!shell)return;const wrap=resolveDatePickerPortalWrapper(self.input);const host=shell.parentElement;if(!wrap||!host)return;positionDropdownPortalToWrapper({panel:cal,wrapperViewportRect:wrap.getBoundingClientRect(),positionHost:host,matchWrapperWidth:selectionType==="quickpick",zIndex:activePortalZIndex})}:void 0;const setupYearMonthDropdowns=fp=>{var _a2,_b2,_c2,_d,_e;if(yearDropdownIsReady(fp)||!((_b2=(_a2=fp.yearElements)==null?void 0:_a2[0])==null?void 0:_b2.parentElement))return;fp.yearElements[0].parentElement.innerHTML=`<select class="numInput cur-year" type="number" tabIndex="-1" aria-label="Year" id="${yearSelectId}"></select>`;let years="";if(yearAscending){for(let year=setMinYear;year<=setMaxYear;year++){years+=`<option value="${year}">${year}</option>`}}else{for(let year=setMaxYear;year>=setMinYear;year--){years+=`<option value="${year}">${year}</option>`}}const dropdown=yearDropdownFromCalendar(fp);if(!dropdown)return;dropdown.innerHTML=years;dropdown.value=String(fp.currentYear);dropdown.addEventListener("input",(e=>{fp.changeYear(Number(e.target.value))}));if(fp.input.form){fp.input.form.addEventListener("reset",(()=>{setTimeout((()=>{dropdown.value=String(fp.currentYear);if(fp.monthsDropdownContainer){fp.monthsDropdownContainer.value=String(fp.currentMonth)}if(defaultDate){fp.setDate(defaultDate);yearChangeHook(fp)}}),0)}))}if(!((_c2=dropdown.nextElementSibling)==null?void 0:_c2.classList.contains("year-dropdown-icon"))){dropdown.insertAdjacentHTML("afterend",`<i class="year-dropdown-icon">${angleDownString}</i>`)}if(((_d=fp.monthElements[0])==null?void 0:_d.parentElement)&&!((_e=fp.calendarContainer)==null?void 0:_e.querySelector(".month-dropdown-icon"))){fp.monthElements[0].insertAdjacentHTML("afterend",`<i class="month-dropdown-icon">${angleDownString}</i>`)}};const assignCalendarId=fp=>{var _a2;const calEl=fp.calendarContainer??((_a2=fp.innerContainer)==null?void 0:_a2.parentElement);if(calEl){calEl.id=`cal-${pickerId}`}};flatpickr(`#${pickerId}`,{allowInput:allowInput,closeOnSelect:closeOnSelect,disableMobile:true,dateFormat:getDateFormat(),defaultDate:defaultDateGetter(),disable:disabledParser(),enableTime:enableTime,locale:{rangeSeparator:" to "},maxDate:effectiveMaxDate,minDate:effectiveMinDate,mode:mode,nextArrow:`<div style="height: 14px;">${angleRightString}</div>`,...allowInput&&{parseDate:(datestr,format2)=>flatpickr.parseDate(withDateSeparators(datestr,format2),format2)},onOpen:[(_selectedDates,_dateStr,fp)=>{activePortalZIndex=portalHost?resolvePortaledFloatingZIndex(portalHost,nextPortaledFloatingZIndex()):void 0;if(portalHost){mountCalendarInPortalShell(fp)}if(portalAppendShell){portalAppendShell.style.zIndex=activePortalZIndex;setFloatingOwnerAttribute(portalAppendShell,floatingOwnerId)}if(fp.calendarContainer){fp.calendarContainer.style.zIndex=activePortalZIndex;setFloatingOwnerAttribute(fp.calendarContainer,floatingOwnerId)}announceFloatingKitOpen("date-picker",floatingOwnerId);if(hasOutOfRangeDefault){const dateObj=toDateObject(defaultDateValue);if(dateObj){const inputIsBlank=!fp.input.value||fp.input.value.trim()==="";const noSelection=!fp.selectedDates||fp.selectedDates.length===0;if(inputIsBlank||noSelection){const formattedDate=fp.formatDate(dateObj,getDateFormat());if(formattedDate){fp.input.value=formattedDate}fp.selectedDates=[dateObj];fp.jumpToDate(dateObj);setTimeout((()=>{yearChangeHook(fp)}),0)}}}calendarResizer();if(resizeRepositionHandlerRef){window.removeEventListener("resize",resizeRepositionHandlerRef)}resizeRepositionHandlerRef=()=>{calendarResizer();positionCalendarIfNeeded(fp)};window.addEventListener("resize",resizeRepositionHandlerRef);if(!effectiveStatic&&scrollContainer)attachToScroll(scrollContainer);if(portalHost){unsubscribeFloatingReposition=subscribeFloatingKitReposition((()=>{positionCalendarIfNeeded(fp)}))}assignCalendarId(fp);positionCalendarIfNeeded(fp);setupYearMonthDropdowns(fp)}],onDestroy:[()=>{if(unsubscribeFloatingReposition){unsubscribeFloatingReposition();unsubscribeFloatingReposition=null}if(resizeRepositionHandlerRef){window.removeEventListener("resize",resizeRepositionHandlerRef);resizeRepositionHandlerRef=null}removePortalShell()}],onClose:[(selectedDates,dateStr,fp)=>{if(unsubscribeFloatingReposition){unsubscribeFloatingReposition();unsubscribeFloatingReposition=null}if(resizeRepositionHandlerRef){window.removeEventListener("resize",resizeRepositionHandlerRef);resizeRepositionHandlerRef=null}if(!effectiveStatic&&scrollContainer)detachFromScroll(scrollContainer);if(hasOutOfRangeDefault&&(!selectedDates||selectedDates.length===0)){const dateObj=toDateObject(defaultDateValue);if(dateObj&&fp.input){const formattedDate=fp.formatDate(dateObj,getDateFormat());if(formattedDate){setTimeout((()=>{if(fp.input&&(!fp.selectedDates||fp.selectedDates.length===0)){fp.input.value=formattedDate;fp.selectedDates=[dateObj];fp.jumpToDate(dateObj)}}),0)}}}onClose(selectedDates,dateStr)}],onChange:[(selectedDates,dateStr,fp)=>{handleDatePickerChange(fp,selectedDates);yearChangeHook(fp);onChange(dateStr,selectedDates)}],onYearChange:[(_selectedDates,_dateStr,fp)=>{yearChangeHook(fp)}],plugins:setPlugins(thisRangesEndToday,customQuickPickDates),position:portalPositionFn??position,positionElement:getPositionElement(positionElement),prevArrow:`<div style="height: 14px;">${angleLeftString}</div>`,static:effectiveStatic});const picker=(_a=document.querySelector(`#${pickerId}`))==null?void 0:_a._flatpickr;if(!picker)return;assignCalendarId(picker);if((isBeforeMin||isAfterMax)&&defaultDateValue){const dateObj=toDateObject(defaultDateValue);const formattedDate=dateObj?picker.formatDate(dateObj,getDateFormat()):null;setTimeout((()=>{if(!dateObj||!picker.input||!formattedDate)return;picker.setDate(dateObj,false);if(isBeforeMin&&setMinDate&&minDate){picker.set("minDate",setMinDate)}if(isAfterMax&&setMaxDate&&maxDate){picker.set("maxDate",setMaxDate)}picker.input.value=formattedDate;picker.selectedDates=[dateObj];setTimeout((()=>{yearChangeHook(picker)}),0);const restoreOutOfRangeValue=()=>{if(!picker.input)return;const inputIsBlank=!picker.input.value||picker.input.value.trim()==="";const noSelection=!picker.selectedDates||picker.selectedDates.length===0;if(inputIsBlank||noSelection){setTimeout((()=>{if(picker.input&&(!picker.input.value||picker.input.value.trim()==="")){picker.input.value=formattedDate}if(!picker.selectedDates||picker.selectedDates.length===0){picker.selectedDates=[dateObj];if(picker.isOpen){picker.jumpToDate(dateObj);picker.redraw();setTimeout((()=>{yearChangeHook(picker)}),0)}}}),0)}};const originalClear=picker.clear.bind(picker);picker.clear=function(...args){const result=originalClear(...args);setTimeout((()=>restoreOutOfRangeValue()),0);return result};picker.input.addEventListener("input",restoreOutOfRangeValue);picker.config.onClose.push((()=>{restoreOutOfRangeValue()}))}),10)}setupYearMonthDropdowns(picker);if(selectionType==="quickpick"&&(controlsStartId||controlsEndId)){picker.config.onClose.push((selectedDates=>{var _a2,_b2;const[start2,end2]=selectedDates;if(controlsStartId){const startPicker=(_a2=document.querySelector(`#${controlsStartId}`))==null?void 0:_a2._flatpickr;startPicker==null?void 0:startPicker.setDate(start2,true)}if(controlsEndId){const endPicker=(_b2=document.querySelector(`#${controlsEndId}`))==null?void 0:_b2._flatpickr;endPicker==null?void 0:endPicker.setDate(end2,true)}}))}if(syncStartWith){picker.config.onClose.push((selectedDates=>{var _a2;if(selectedDates==null?void 0:selectedDates.length){const element=document.querySelector(`#${syncStartWith}`);if((_a2=element==null?void 0:element._dropdownRef)==null?void 0:_a2.current){element._dropdownRef.current.clearSelected()}else if(element==null?void 0:element._pbDropdownInstance){element._pbDropdownInstance.clearSelected()}else{const quickpick=element==null?void 0:element._flatpickr;quickpick==null?void 0:quickpick.clear()}}}))}if(syncEndWith){picker.config.onClose.push((selectedDates=>{var _a2;if(selectedDates==null?void 0:selectedDates.length){const element=document.querySelector(`#${syncEndWith}`);if((_a2=element==null?void 0:element._dropdownRef)==null?void 0:_a2.current){element._dropdownRef.current.clearSelected()}else if(element==null?void 0:element._pbDropdownInstance){element._pbDropdownInstance.clearSelected()}else{const quickpick=element==null?void 0:element._flatpickr;quickpick==null?void 0:quickpick.clear()}}}))}const datePickerLabel=document.querySelector(`label[for="${pickerId}"]`);if(datePickerLabel){const labelWithRefs=datePickerLabel;const prev=labelWithRefs._pbDatePickerLabelHandlers;if(prev==null?void 0:prev.stopPointer){datePickerLabel.removeEventListener("mousedown",prev.stopPointer);datePickerLabel.removeEventListener("touchstart",prev.stopPointer)}if(prev==null?void 0:prev.click){datePickerLabel.removeEventListener("click",prev.click)}const stopPointerForFlatpickrDocClose2=e=>{e.stopPropagation()};const onDatePickerLabelClick=e=>{e.preventDefault();e.stopPropagation();if(picker.input.disabled)return;picker.toggle();if(picker.isOpen){picker.input.focus()}};datePickerLabel.addEventListener("mousedown",stopPointerForFlatpickrDocClose2);datePickerLabel.addEventListener("touchstart",stopPointerForFlatpickrDocClose2,{passive:true});datePickerLabel.addEventListener("click",onDatePickerLabelClick);labelWithRefs._pbDatePickerLabelHandlers={stopPointer:stopPointerForFlatpickrDocClose2,click:onDatePickerLabelClick}}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"}const stopPointerForFlatpickrDocClose=e=>{e.stopPropagation()};picker.input.addEventListener("mousedown",stopPointerForFlatpickrDocClose);picker.input.addEventListener("touchstart",stopPointerForFlatpickrDocClose,{passive:true});const calIconWrapper=document.querySelector(`#cal-icon-${pickerId}`);const isPointerInCalIcon=e=>{if(!calIconWrapper)return false;const rect=calIconWrapper.getBoundingClientRect();return e.clientX>=rect.left&&e.clientX<=rect.right&&e.clientY>=rect.top&&e.clientY<=rect.bottom};const openDatePickerFromUi=e=>{e.preventDefault();e.stopPropagation();if(picker.input.disabled)return;if(picker.isOpen){picker.close();return}picker.open();picker.input.focus()};const textInputWrapper=picker.input.closest(".text_input_wrapper");const inputWrapper=picker.input.closest(".input_wrapper");inputWrapper==null?void 0:inputWrapper.addEventListener("click",(e=>{if(e.target===picker.input)return;if(!isPointerInCalIcon(e)&&!(textInputWrapper==null?void 0:textInputWrapper.contains(e.target)))return;openDatePickerFromUi(e)}));const pickerInput=picker.input;pickerInput._pbDatePickerOpenUnsub=subscribeFloatingKitOpen((({kitKind:kitKind})=>{if(kitKind!=="date-picker"&&picker.isOpen){picker.close()}}));(_c=(_b=document.querySelector(`#${pickerId}`))==null?void 0:_b.parentElement)==null?void 0:_c.addEventListener("click",(e=>e.stopPropagation()))};const EMOJI_REGEX=new RegExp("\\p{Extended_Pictographic}|\\u200D|\\uFE0F|[\\u{1F3FB}-\\u{1F3FF}]","gu");const stripEmojisForTyping=text=>text.replace(EMOJI_REGEX,"");const stripEmojisForPaste=text=>stripEmojisForTyping(text).replace(/\s+/g," ").trim();const applyEmojiMask=element=>{const cursor=element.selectionStart;const original=element.value;const filtered=stripEmojisForTyping(original);if(original!==filtered){const beforeCursor=original.slice(0,cursor||0);const newCursor=stripEmojisForTyping(beforeCursor).length;element.value=filtered;element.selectionStart=element.selectionEnd=newCursor;return{value:filtered,cursor:newCursor}}return{value:original,cursor:cursor}};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$1(element){return element?(element.nodeName||"").toLowerCase():null}function getWindow$1(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$1(node){var OwnElement=getWindow$1(node).Element;return node instanceof OwnElement||node instanceof Element}function isHTMLElement$1(node){var OwnElement=getWindow$1(node).HTMLElement;return node instanceof OwnElement||node instanceof HTMLElement}function isShadowRoot$1(node){if(typeof ShadowRoot==="undefined"){return false}var OwnElement=getWindow$1(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$1(element)||!getNodeName$1(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,property){style2[property]="";return style2}),{});if(!isHTMLElement$1(element)||!getNodeName$1(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$1=Math.max;var min$1=Math.min;var round$1=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$1(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$1(element)){scaleX=element.offsetWidth>0?round$1(clientRect.width)/element.offsetWidth||1:1;scaleY=element.offsetHeight>0?round$1(clientRect.height)/element.offsetHeight||1:1}var _ref=isElement$1(element)?getWindow$1(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$1(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(parent,child){var rootNode=child.getRootNode&&child.getRootNode();if(parent.contains(child)){return true}else if(rootNode&&isShadowRoot$1(rootNode)){var next=child;do{if(next&&parent.isSameNode(next)){return true}next=next.parentNode||next.host}while(next)}return false}function getComputedStyle$1(element){return getWindow$1(element).getComputedStyle(element)}function isTableElement$1(element){return["table","td","th"].indexOf(getNodeName$1(element))>=0}function getDocumentElement$1(element){return((isElement$1(element)?element.ownerDocument:element.document)||window.document).documentElement}function getParentNode$1(element){if(getNodeName$1(element)==="html"){return element}return element.assignedSlot||element.parentNode||(isShadowRoot$1(element)?element.host:null)||getDocumentElement$1(element)}function getTrueOffsetParent$1(element){if(!isHTMLElement$1(element)||getComputedStyle$1(element).position==="fixed"){return null}return element.offsetParent}function getContainingBlock$1(element){var isFirefox=/firefox/i.test(getUAString());var isIE=/Trident/i.test(getUAString());if(isIE&&isHTMLElement$1(element)){var elementCss=getComputedStyle$1(element);if(elementCss.position==="fixed"){return null}}var currentNode=getParentNode$1(element);if(isShadowRoot$1(currentNode)){currentNode=currentNode.host}while(isHTMLElement$1(currentNode)&&["html","body"].indexOf(getNodeName$1(currentNode))<0){var css=getComputedStyle$1(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$1(element){var window2=getWindow$1(element);var offsetParent=getTrueOffsetParent$1(element);while(offsetParent&&isTableElement$1(offsetParent)&&getComputedStyle$1(offsetParent).position==="static"){offsetParent=getTrueOffsetParent$1(offsetParent)}if(offsetParent&&(getNodeName$1(offsetParent)==="html"||getNodeName$1(offsetParent)==="body"&&getComputedStyle$1(offsetParent).position==="static")){return window2}return offsetParent||getContainingBlock$1(element)||window2}function getMainAxisFromPlacement(placement){return["top","bottom"].indexOf(placement)>=0?"x":"y"}function within(min2,value,max2){return max$1(min2,min$1(value,max2))}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,keys){return keys.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$1(_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$1(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$2={name:"arrow",enabled:true,phase:"main",fn:arrow$1,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$1(x*dpr)/dpr||0,y:round$1(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$1(popper2);var heightProp="clientHeight";var widthProp="clientWidth";if(offsetParent===getWindow$1(popper2)){offsetParent=getDocumentElement$1(popper2);if(getComputedStyle$1(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$1(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$1(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$1(node);var scrollLeft=win.pageXOffset;var scrollTop=win.pageYOffset;return{scrollLeft:scrollLeft,scrollTop:scrollTop}}function getWindowScrollBarX$1(element){return getBoundingClientRect$1(getDocumentElement$1(element)).left+getWindowScroll(element).scrollLeft}function getViewportRect$1(element,strategy){var win=getWindow$1(element);var html=getDocumentElement$1(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$1(element),y:y}}function getDocumentRect$1(element){var _element$ownerDocumen;var html=getDocumentElement$1(element);var winScroll=getWindowScroll(element);var body=(_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body;var width=max$1(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0);var height=max$1(html.scrollHeight,html.clientHeight,body?body.scrollHeight:0,body?body.clientHeight:0);var x=-winScroll.scrollLeft+getWindowScrollBarX$1(element);var y=-winScroll.scrollTop;if(getComputedStyle$1(body||html).direction==="rtl"){x+=max$1(html.clientWidth,body?body.clientWidth:0)-width}return{width:width,height:height,x:x,y:y}}function isScrollParent(element){var _getComputedStyle=getComputedStyle$1(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$1(node))>=0){return node.ownerDocument.body}if(isHTMLElement$1(node)&&isScrollParent(node)){return node}return getScrollParent(getParentNode$1(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$1(scrollParent);var target=isBody?[win].concat(win.visualViewport||[],isScrollParent(scrollParent)?scrollParent:[]):scrollParent;var updatedList=list.concat(target);return isBody?updatedList:updatedList.concat(listScrollParents(getParentNode$1(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$1(element,strategy){var rect=getBoundingClientRect$1(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$1(element,strategy)):isElement$1(clippingParent)?getInnerBoundingClientRect$1(clippingParent,strategy):rectToClientRect(getDocumentRect$1(getDocumentElement$1(element)))}function getClippingParents(element){var clippingParents2=listScrollParents(getParentNode$1(element));var canEscapeClipping=["absolute","fixed"].indexOf(getComputedStyle$1(element).position)>=0;var clipperElement=canEscapeClipping&&isHTMLElement$1(element)?getOffsetParent$1(element):element;if(!isElement$1(clipperElement)){return[]}return clippingParents2.filter((function(clippingParent){return isElement$1(clippingParent)&&contains(clippingParent,clipperElement)&&getNodeName$1(clippingParent)!=="body"}))}function getClippingRect$1(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$1(rect.top,accRect.top);accRect.right=min$1(rect.right,accRect.right);accRect.bottom=min$1(rect.bottom,accRect.bottom);accRect.left=max$1(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$1(isElement$1(element)?element:element.contextElement||getDocumentElement$1(state.elements.popper),boundary,rootBoundary,strategy);var referenceClientRect=getBoundingClientRect$1(state.elements.reference);var popperOffsets2=computeOffsets({reference:referenceClientRect,element:popperRect,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$1(_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$2={name:"flip",enabled:true,phase:"main",fn:flip$1,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$1(_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$2={name:"offset",enabled:true,phase:"main",requires:["popperOffsets"],fn:offset$1};function popperOffsets(_ref){var state=_ref.state,name=_ref.name;state.modifiersData[name]=computeOffsets({reference:state.rects.reference,element:state.rects.popper,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 min2=offset2+overflow[mainSide];var max2=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$1(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$1(min2,tetherMin):min2,offset2,tether?max$1(max2,tetherMax):max2);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$1(node){if(node===getWindow$1(node)||!isHTMLElement$1(node)){return getWindowScroll(node)}else{return getHTMLElementScroll(node)}}function isElementScaled(element){var rect=element.getBoundingClientRect();var scaleX=round$1(rect.width)/element.offsetWidth||1;var scaleY=round$1(rect.height)/element.offsetHeight||1;return scaleX!==1||scaleY!==1}function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){if(isFixed===void 0){isFixed=false}var isOffsetParentAnElement=isHTMLElement$1(offsetParent);var offsetParentIsScaled=isHTMLElement$1(offsetParent)&&isElementScaled(offsetParent);var documentElement=getDocumentElement$1(offsetParent);var rect=getBoundingClientRect$1(elementOrVirtualElement,offsetParentIsScaled,isFixed);var scroll={scrollLeft:0,scrollTop:0};var offsets={x:0,y:0};if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName$1(offsetParent)!=="body"||isScrollParent(documentElement)){scroll=getNodeScroll$1(offsetParent)}if(isHTMLElement$1(offsetParent)){offsets=getBoundingClientRect$1(offsetParent,true);offsets.x+=offsetParent.clientLeft;offsets.y+=offsetParent.clientTop}else if(documentElement){offsets.x=getWindowScrollBarX$1(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$1(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(m){return m.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$1(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=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$2,flip$2,preventOverflow$1,arrow$2,hide$1];var createPopper=popperGenerator({defaultModifiers:defaultModifiers});const useFullScreen=(initial=false)=>{const[isFullscreen,setIsFullscreen]=useState(initial);const toggleFullScreen=()=>setIsFullscreen((prev=>!prev));return[isFullscreen,setIsFullscreen,toggleFullScreen]};const measureStickyWidth=element=>{const rectWidth=element.getBoundingClientRect().width;return rectWidth>0?rectWidth:element.offsetWidth};const formatStickyOffset=offset2=>`${parseFloat(offset2.toFixed(3))}px`;const applyStickySideClasses=(element,isLastColumn,borderClass,shadowClass)=>{if(!isLastColumn){element.classList.add(borderClass);element.classList.remove(shadowClass)}else{element.classList.remove(borderClass);element.classList.add(shadowClass)}};const stickyHeaderSelector=colId=>`th[data-sticky-id="${colId}"], .pb_table_th[data-sticky-id="${colId}"]`;const stickyCellSelector=colId=>`td[data-sticky-id="${colId}"], .pb_table_td[data-sticky-id="${colId}"]`;const stickyHeaderRowTop=header=>{const row=header.closest("tr, .pb_table_tr");if(!row)return 0;let top2=0;let previous=row.previousElementSibling;while(previous){if(previous instanceof HTMLElement){top2+=previous.offsetHeight}previous=previous.previousElementSibling}return top2};const applyStickyHeaderTop=(table,headerElement)=>{if(!table.classList.contains("sticky-header"))return;headerElement.style.top=formatStickyOffset(stickyHeaderRowTop(headerElement))};const applyStickyColumns=(table,columnIds,side)=>{if(!columnIds.length)return;const orderedIds=side==="right"?[...columnIds].reverse():columnIds;const borderClass=side==="left"?"with-border-right":"with-border-left";const shadowClass=side==="left"?"sticky-left-shadow":"sticky-right-shadow";let accumulatedWidth=0;orderedIds.forEach(((colId,index)=>{const isLastColumn=index===orderedIds.length-1;const headers=table.querySelectorAll(stickyHeaderSelector(colId));const cells=table.querySelectorAll(stickyCellSelector(colId));if(!headers.length)return;const offset2=accumulatedWidth;const offsetValue=formatStickyOffset(offset2);let columnWidth=0;headers.forEach((header=>{const headerElement=header;headerElement.classList.add("sticky");headerElement.style[side]=offsetValue;applyStickyHeaderTop(table,headerElement);applyStickySideClasses(headerElement,isLastColumn,borderClass,shadowClass);columnWidth=Math.max(columnWidth,measureStickyWidth(headerElement))}));accumulatedWidth=offset2+columnWidth;cells.forEach((cell=>{const cellElement=cell;cellElement.classList.add("sticky");cellElement.style[side]=offsetValue;applyStickySideClasses(cellElement,isLastColumn,borderClass,shadowClass)}))}));if(table.classList.contains("sticky-header")){table.querySelectorAll("thead .sticky, .pb_table_thead .sticky").forEach((header=>{applyStickyHeaderTop(table,header)}))}};const scheduleStickyColumns=apply=>{let cancelled=false;let frameId=0;const run=()=>{if(!cancelled)apply()};frameId=requestAnimationFrame((()=>{run();frameId=requestAnimationFrame(run)}));const fonts=document.fonts;if(fonts==null?void 0:fonts.ready){fonts.ready.then(run).catch((()=>void 0))}return()=>{cancelled=true;cancelAnimationFrame(frameId)}};class ElementObserver{constructor(matchDelegate,target=document){this.matchDelegate=matchDelegate;this.target=target}get mutationObserver(){return this._mutationObserver=this._mutationObserver||new MutationObserver((mutationList=>this.processMutationList(mutationList)))}start(){this.mutationObserver.observe(this.target,{attributes:true,childList:true,subtree:true});this.catchup()}stop(){this.mutationObserver.disconnect()}catchup(){this.handleAdditions(this.matchDelegate.matches(this.target))}processMutationList(mutationList){for(const mutation of mutationList){if(mutation.type=="attributes"){this.processAttributeChange(mutation.target)}else if(mutation.type=="childList"){this.processRemovedNodes(Array.from(mutation.removedNodes));this.processAddedNodes(Array.from(mutation.addedNodes))}}}processAttributeChange(node){if(node.nodeType!==Node.ELEMENT_NODE)return;const matches=this.matchDelegate.matches(node);if(matches.length===0)return this.matchDelegate.removeMatch(node);this.handleAdditions(matches)}processRemovedNodes(nodes){for(const node of nodes){if(node.nodeType!==Node.ELEMENT_NODE)continue;this.handleRemovals(this.matchDelegate.matches(node))}}processAddedNodes(nodes){for(const node of nodes){if(node.nodeType!==Node.ELEMENT_NODE)continue;this.handleAdditions(this.matchDelegate.matches(node))}}handleRemovals(elements){for(const element of elements)this.matchDelegate.removeMatch(element)}handleAdditions(elements){for(const element of elements)this.matchDelegate.addMatch(element)}}class PbEnhancedElement{constructor(element){this.element=element}static get elements(){return this._elements=this._elements||new Map}static get observer(){return this._observer=this._observer||new ElementObserver(this)}static get selector(){console.warn("Define a static property for selector or redefine the matches function in a subclass.",this);return null}static matches(node){if(!this.selector)return[];const matches=[];if(node.nodeType===Node.ELEMENT_NODE&&node.matches(this.selector))matches.push(node);matches.push(...node.querySelectorAll(this.selector));return matches}static addMatch(element){if(element._pbEnhanced||this.elements.has(element))return;const enhansedElement=new this(element);enhansedElement.connect();this.elements.set(element,enhansedElement);element._pbEnhanced=enhansedElement}static removeMatch(element){if(!this.elements.has(element))return;const enhansedElement=this.elements.get(element);enhansedElement.disconnect();this.elements.delete(element);delete element._pbEnhanced}static start(){this.observer.start()}static stop(){this.observer.stop()}connect(){console.warn("Redefine the connect function in a subclass.",this)}disconnect(){}}class PbTextarea extends PbEnhancedElement{constructor(){super(...arguments);this.skipNextEmojiFilter=false;this.onInput=()=>{if(!this.element)return;if(this.element.closest(".resize_auto")){this.element.style.height="auto";this.element.style.height=this.element.scrollHeight+"px"}};this.handleEmojiInput=()=>{if(!this.element||!this.hasEmojiMask())return;if(this.skipNextEmojiFilter){this.skipNextEmojiFilter=false;return}applyEmojiMask(this.element)};this.handleEmojiPaste=event=>{var _a;if(!this.element||!this.hasEmojiMask())return;const pastedText=((_a=event.clipboardData)==null?void 0:_a.getData("text"))||"";const filteredText=stripEmojisForPaste(pastedText);if(pastedText!==filteredText){event.preventDefault();const textarea=this.element;const start2=textarea.selectionStart||0;const end2=textarea.selectionEnd||0;const currentValue=textarea.value;const newValue=currentValue.slice(0,start2)+filteredText+currentValue.slice(end2);const newCursor=start2+filteredText.length;textarea.value=newValue;textarea.selectionStart=textarea.selectionEnd=newCursor;this.skipNextEmojiFilter=true;textarea.dispatchEvent(new Event("input",{bubbles:true}))}}}static get selector(){return'.resize_auto textarea, [data-pb-emoji-mask="true"]'}hasEmojiMask(){if(!this.element)return false;return this.element.dataset.pbEmojiMask==="true"}connect(){if(!this.element)return;if(this.element.closest(".resize_auto")){this.element.setAttribute("style","height:"+this.element.scrollHeight+"px;overflow-y:hidden;");this.element.addEventListener("input",this.onInput,false)}if(this.hasEmojiMask()){this.element.addEventListener("input",this.handleEmojiInput,false);this.element.addEventListener("paste",this.handleEmojiPaste,false)}}disconnect(){if(!this.element)return;this.element.removeEventListener("input",this.onInput,false);this.element.removeEventListener("input",this.handleEmojiInput,false);this.element.removeEventListener("paste",this.handleEmojiPaste,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 font_family_base='"Power Centra", "Helvetica Neue", Helvetica, Arial, sans_serif';const text_jumbo="36px";const text_largest="32px";const text_larger="27px";const text_large="20px";const text_base="15.5px";const text_default="15.5px";const text_normal="15.5px";const text_medium="15.5px";const text_small="14px";const text_smaller="12px";const text_smallest="11px";const heading_1="44px";const heading_2="32px";const heading_3="27px";const heading_4="15.5px";const lighter$1="300";const light$1="300";const bold="700";const regular="400";const typography={font_family_base:font_family_base,text_jumbo:text_jumbo,text_largest:text_largest,text_larger:text_larger,text_large:text_large,text_base:text_base,text_default:text_default,text_normal:text_normal,text_medium:text_medium,text_small:text_small,text_smaller:text_smaller,text_smallest:text_smallest,heading_1:heading_1,heading_2:heading_2,heading_3:heading_3,heading_4:heading_4,lighter:lighter$1,light:light$1,bold:bold,regular:regular};const pbIndicator={title:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}},secondaryTitle:{color:colors.text_lt_light,fontFamily:typography.font_family_base,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}},value:{fontFamily:typography.font_family_base,color:colors.text_lt_default,fontWeight:typography.lighter,fontSizes:{big:typography.heading_1,medium:typography.heading_1,small:typography.text_base,micro:typography.text_small}},secondaryValue:{fontFamily:typography.font_family_base,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}}};const POPOVER_OFFSET_Y=[0,20];class PbPopover extends PbEnhancedElement{constructor(){super(...arguments);this._unsubscribeFloatingReposition=null}static get selector(){return"[data-pb-popover-kit]"}moveTooltip(){let container=document.querySelector("body");if(this.appendTo==="parent"){container=this.element.parentElement&&this.element.parentElement}else if(this.appendTo){container=document.querySelector(this.appendTo)}container.appendChild(this.tooltip)}connect(){if(!this.triggerElement||!this.tooltip){console.warn("Popover requires both trigger and tooltip elements to be defined.");return}this.moveTooltip();this.popper=createPopper(this.triggerElement,this.tooltip,{placement:this.position,strategy:"fixed",modifiers:[{name:"offset",options:{offset:this.offset}}]});this._unsubscribeFloatingReposition=subscribeFloatingKitReposition((()=>{var _a,_b;if((_a=this.tooltip)==null?void 0:_a.classList.contains("show")){void((_b=this.popper)==null?void 0:_b.update())}}));this.triggerElement.addEventListener("click",(event=>{event.preventDefault();event.stopPropagation();if(!this.tooltip.classList.contains("show")){this.checkCloseTooltip()}setTimeout((()=>{this.toggleTooltip();this.popper.update()}),0)}))}disconnect(){var _a,_b;(_a=this._unsubscribeFloatingReposition)==null?void 0:_a.call(this);this._unsubscribeFloatingReposition=null;(_b=this.popper)==null?void 0:_b.destroy()}checkCloseTooltip(){document.querySelector("body").addEventListener("click",(event=>{const t=event.target;const isTooltipElement=event.target instanceof Element&&event.target.closest(`#${this.tooltipId}`)!==null;const isTriggerElement=event.target instanceof Element&&event.target.closest(`#${this.triggerElementId}`)!==null;const isPortaledKit=isPortaledFloatingKitInteraction(t,this.tooltipId,event.clientX,event.clientY);switch(this.closeOnClick){case"any":if(isPortaledKit)return;if(isTooltipElement||!isTooltipElement&&!isTriggerElement){this.hideTooltip()}break;case"outside":if(!isTooltipElement&&!isTriggerElement&&!isPortaledKit){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}get appendTo(){return this.element.dataset.pbPopoverAppendTo}}const TABLE_WRAPPER_SELECTOR="[data-pb-table-wrapper]";const TABLE_COLLAPSIBLE_WRAPPER_SELECTOR="[data-pb-table-collapsible-wrapper]";const TABLE_COLLAPSIBLE_CELL_SELECTOR="[data-pb-table-collapsible-cell-id]";class PbTable extends PbEnhancedElement{constructor(){super(...arguments);this.stickyLeftColumns=[];this.stickyRightColumns=[];this.stickyTable=null;this.cancelStickySchedule=null;this.stickyResizeObserver=null;this.boundApplyStickyOffsets=()=>this.applyStickyOffsets()}static get selector(){return TABLE_WRAPPER_SELECTOR}connect(){if(this.element.classList.contains("table-responsive-collapse")){const headers=[];[].forEach.call(this.element.querySelectorAll("th"),(header=>{const colSpan=header.colSpan;for(let i=0;i<colSpan;i++){headers.push(header.textContent.replace(/\r?\n|\r/,""))}}));[].forEach.call(this.element.querySelectorAll("tbody tr"),(row=>{[].forEach.call(row.cells,((cell,headerIndex)=>{cell.setAttribute("data-title",headers[headerIndex])}))}))}this.initStickyColumns();this.handleCollapsibleClick();this.handleCollapsibleRow()}initStickyColumns(){const table=this.element.querySelector(".sticky-left-column, .sticky-right-column")||(this.element.classList.contains("sticky-left-column")||this.element.classList.contains("sticky-right-column")?this.element:null);if(!table)return;this.stickyTable=table;const classList=Array.from(table.classList);const stickyLeftClass=classList.find((cls=>cls.startsWith("sticky-left-columns-ids-")));const stickyRightClass=classList.find((cls=>cls.startsWith("sticky-right-columns-ids-")));if(stickyLeftClass){this.stickyLeftColumns=stickyLeftClass.replace("sticky-left-columns-ids-","").split("-")}if(stickyRightClass){this.stickyRightColumns=stickyRightClass.replace("sticky-right-columns-ids-","").split("-")}if(!this.stickyLeftColumns.length&&!this.stickyRightColumns.length)return;this.cancelStickySchedule=scheduleStickyColumns(this.boundApplyStickyOffsets);window.addEventListener("resize",this.boundApplyStickyOffsets);if(typeof ResizeObserver!=="undefined"){this.stickyResizeObserver=new ResizeObserver(this.boundApplyStickyOffsets);this.stickyResizeObserver.observe(table)}}applyStickyOffsets(){if(!this.stickyTable)return;if(this.stickyLeftColumns.length){applyStickyColumns(this.stickyTable,this.stickyLeftColumns,"left")}if(this.stickyRightColumns.length){applyStickyColumns(this.stickyTable,this.stickyRightColumns,"right")}}handleCollapsibleClick(){const cells=this.element.querySelectorAll(TABLE_COLLAPSIBLE_CELL_SELECTOR);const collapsibleElements=this.element.querySelectorAll(TABLE_COLLAPSIBLE_WRAPPER_SELECTOR);if(cells.length>0){cells.forEach((cell=>{const cellId=cell.dataset.pbTableCollapsibleCellId;Array.from(cell.children).forEach((child=>{if(child.id===cellId){Array.from(child.children).forEach((svgChild=>{svgChild.id=cellId;Array.from(svgChild.children).forEach((pathChild=>{pathChild.id=cellId}))}))}}));cell.addEventListener("click",(event=>{if(event.target.id){document.dispatchEvent(new CustomEvent(`collapsed-toggle${event.currentTarget.id}`));const toggleElements=this.element.querySelectorAll(`.collapsible_border_toggle${event.currentTarget.id}`);toggleElements.forEach((element=>{element.classList.toggle("no-border");element.classList.toggle("border-active")}))}}))}))}else{collapsibleElements.forEach((collapsibleElement=>{collapsibleElement.addEventListener("click",(event=>{document.dispatchEvent(new CustomEvent(`collapsed-toggle${event.currentTarget.id}`));const toggleElements=this.element.querySelectorAll(`.collapsible_border_toggle${event.currentTarget.id}`);toggleElements.forEach((element=>{element.classList.toggle("no-border");element.classList.toggle("border-active")}))}))}))}}handleCollapsibleRow(){const collapsibleRows=this.element.querySelectorAll(".pb_table_collapsible_row");if(collapsibleRows.length>0){collapsibleRows.forEach((row=>{const previousRow=row.previousElementSibling;if(previousRow&&previousRow.tagName==="TR"){const tdCount=previousRow.querySelectorAll("td").length;const collapsibleTd=row.querySelector("td");if(collapsibleTd){collapsibleTd.colSpan=tdCount}}else{return}}))}}disconnect(){var _a,_b;(_a=this.cancelStickySchedule)==null?void 0:_a.call(this);this.cancelStickySchedule=null;window.removeEventListener("resize",this.boundApplyStickyOffsets);(_b=this.stickyResizeObserver)==null?void 0:_b.disconnect();this.stickyResizeObserver=null;this.stickyTable=null}}const min=Math.min;const max=Math.max;const round=Math.round;const floor=Math.floor;const createCoords=v=>({x:v,y:v});function hasWindow(){return typeof window!=="undefined"}function getNodeName(node){if(isNode(node)){return(node.nodeName||"").toLowerCase()}return"#document"}function getWindow(node){var _node$ownerDocument;return(node==null||(_node$ownerDocument=node.ownerDocument)==null?void 0:_node$ownerDocument.defaultView)||window}function getDocumentElement(node){var _ref;return(_ref=(isNode(node)?node.ownerDocument:node.document)||window.document)==null?void 0:_ref.documentElement}function isNode(value){if(!hasWindow()){return false}return value instanceof Node||value instanceof getWindow(value).Node}function isElement(value){if(!hasWindow()){return false}return value instanceof Element||value instanceof getWindow(value).Element}function isHTMLElement(value){if(!hasWindow()){return false}return value instanceof HTMLElement||value instanceof getWindow(value).HTMLElement}function isShadowRoot(value){if(!hasWindow()||typeof ShadowRoot==="undefined"){return false}return value instanceof ShadowRoot||value instanceof getWindow(value).ShadowRoot}function isOverflowElement(element){const{overflow:overflow,overflowX:overflowX,overflowY:overflowY,display:display}=getComputedStyle(element);return/auto|scroll|overlay|hidden|clip/.test(overflow+overflowY+overflowX)&&!["inline","contents"].includes(display)}function isTableElement(element){return["table","td","th"].includes(getNodeName(element))}function isTopLayer(element){return[":popover-open",":modal"].some((selector=>{try{return element.matches(selector)}catch(e){return false}}))}function isContainingBlock(elementOrCss){const webkit=isWebKit();const css=isElement(elementOrCss)?getComputedStyle(elementOrCss):elementOrCss;return["transform","translate","scale","rotate","perspective"].some((value=>css[value]?css[value]!=="none":false))||(css.containerType?css.containerType!=="normal":false)||!webkit&&(css.backdropFilter?css.backdropFilter!=="none":false)||!webkit&&(css.filter?css.filter!=="none":false)||["transform","translate","scale","rotate","perspective","filter"].some((value=>(css.willChange||"").includes(value)))||["paint","layout","strict","content"].some((value=>(css.contain||"").includes(value)))}function getContainingBlock(element){let currentNode=getParentNode(element);while(isHTMLElement(currentNode)&&!isLastTraversableNode(currentNode)){if(isContainingBlock(currentNode)){return currentNode}else if(isTopLayer(currentNode)){return null}currentNode=getParentNode(currentNode)}return null}function isWebKit(){if(typeof CSS==="undefined"||!CSS.supports)return false;return CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(node){return["html","body","#document"].includes(getNodeName(node))}function getComputedStyle(element){return getWindow(element).getComputedStyle(element)}function getNodeScroll(element){if(isElement(element)){return{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop}}return{scrollLeft:element.scrollX,scrollTop:element.scrollY}}function getParentNode(node){if(getNodeName(node)==="html"){return node}const result=node.assignedSlot||node.parentNode||isShadowRoot(node)&&node.host||getDocumentElement(node);return isShadowRoot(result)?result.host:result}function getNearestOverflowAncestor(node){const parentNode=getParentNode(node);if(isLastTraversableNode(parentNode)){return node.ownerDocument?node.ownerDocument.body:node.body}if(isHTMLElement(parentNode)&&isOverflowElement(parentNode)){return parentNode}return getNearestOverflowAncestor(parentNode)}function getOverflowAncestors(node,list,traverseIframes){var _node$ownerDocument2;if(list===void 0){list=[]}if(traverseIframes===void 0){traverseIframes=true}const scrollableAncestor=getNearestOverflowAncestor(node);const isBody=scrollableAncestor===((_node$ownerDocument2=node.ownerDocument)==null?void 0:_node$ownerDocument2.body);const win=getWindow(scrollableAncestor);if(isBody){const frameElement=getFrameElement(win);return list.concat(win,win.visualViewport||[],isOverflowElement(scrollableAncestor)?scrollableAncestor:[],frameElement&&traverseIframes?getOverflowAncestors(frameElement):[])}return list.concat(scrollableAncestor,getOverflowAncestors(scrollableAncestor,[],traverseIframes))}function getFrameElement(win){return win.parent&&Object.getPrototypeOf(win.parent)?win.frameElement:null}function getCssDimensions(element){const css=getComputedStyle(element);let width=parseFloat(css.width)||0;let height=parseFloat(css.height)||0;const hasOffset=isHTMLElement(element);const offsetWidth=hasOffset?element.offsetWidth:width;const offsetHeight=hasOffset?element.offsetHeight:height;const shouldFallback=round(width)!==offsetWidth||round(height)!==offsetHeight;if(shouldFallback){width=offsetWidth;height=offsetHeight}return{width:width,height:height,$:shouldFallback}}function unwrapElement(element){return!isElement(element)?element.contextElement:element}function getScale(element){const domElement=unwrapElement(element);if(!isHTMLElement(domElement)){return createCoords(1)}const rect=domElement.getBoundingClientRect();const{width:width,height:height,$:$}=getCssDimensions(domElement);let x=($?round(rect.width):rect.width)/width;let y=($?round(rect.height):rect.height)/height;if(!x||!Number.isFinite(x)){x=1}if(!y||!Number.isFinite(y)){y=1}return{x:x,y:y}}const noOffsets=createCoords(0);function getVisualOffsets(element){const win=getWindow(element);if(!isWebKit()||!win.visualViewport){return noOffsets}return{x:win.visualViewport.offsetLeft,y:win.visualViewport.offsetTop}}function shouldAddVisualOffsets(element,isFixed,floatingOffsetParent){if(isFixed===void 0){isFixed=false}if(!floatingOffsetParent||isFixed&&floatingOffsetParent!==getWindow(element)){return false}return isFixed}function getBoundingClientRect(element,includeScale,isFixedStrategy,offsetParent){if(includeScale===void 0){includeScale=false}if(isFixedStrategy===void 0){isFixedStrategy=false}const clientRect=element.getBoundingClientRect();const domElement=unwrapElement(element);let scale=createCoords(1);if(includeScale){if(offsetParent){if(isElement(offsetParent)){scale=getScale(offsetParent)}}else{scale=getScale(element)}}const visualOffsets=shouldAddVisualOffsets(domElement,isFixedStrategy,offsetParent)?getVisualOffsets(domElement):createCoords(0);let x=(clientRect.left+visualOffsets.x)/scale.x;let y=(clientRect.top+visualOffsets.y)/scale.y;let width=clientRect.width/scale.x;let height=clientRect.height/scale.y;if(domElement){const win=getWindow(domElement);const offsetWin=offsetParent&&isElement(offsetParent)?getWindow(offsetParent):offsetParent;let currentWin=win;let currentIFrame=getFrameElement(currentWin);while(currentIFrame&&offsetParent&&offsetWin!==currentWin){const iframeScale=getScale(currentIFrame);const iframeRect=currentIFrame.getBoundingClientRect();const css=getComputedStyle(currentIFrame);const left2=iframeRect.left+(currentIFrame.clientLeft+parseFloat(css.paddingLeft))*iframeScale.x;const top2=iframeRect.top+(currentIFrame.clientTop+parseFloat(css.paddingTop))*iframeScale.y;x*=iframeScale.x;y*=iframeScale.y;width*=iframeScale.x;height*=iframeScale.y;x+=left2;y+=top2;currentWin=getWindow(currentIFrame);currentIFrame=getFrameElement(currentWin)}}return rectToClientRect$1({width:width,height:height,x:x,y:y})}function getWindowScrollBarX(element,rect){const leftScroll=getNodeScroll(element).scrollLeft;if(!rect){return getBoundingClientRect(getDocumentElement(element)).left+leftScroll}return rect.left+leftScroll}function getHTMLOffset(documentElement,scroll,ignoreScrollbarX){if(ignoreScrollbarX===void 0){ignoreScrollbarX=false}const htmlRect=documentElement.getBoundingClientRect();const x=htmlRect.left+scroll.scrollLeft-(ignoreScrollbarX?0:getWindowScrollBarX(documentElement,htmlRect));const y=htmlRect.top+scroll.scrollTop;return{x:x,y:y}}function convertOffsetParentRelativeRectToViewportRelativeRect(_ref){let{elements:elements,rect:rect,offsetParent:offsetParent,strategy:strategy}=_ref;const isFixed=strategy==="fixed";const documentElement=getDocumentElement(offsetParent);const topLayer=elements?isTopLayer(elements.floating):false;if(offsetParent===documentElement||topLayer&&isFixed){return rect}let scroll={scrollLeft:0,scrollTop:0};let scale=createCoords(1);const offsets=createCoords(0);const isOffsetParentAnElement=isHTMLElement(offsetParent);if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement)){scroll=getNodeScroll(offsetParent)}if(isHTMLElement(offsetParent)){const offsetRect=getBoundingClientRect(offsetParent);scale=getScale(offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft;offsets.y=offsetRect.y+offsetParent.clientTop}}const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll,true):createCoords(0);return{width:rect.width*scale.x,height:rect.height*scale.y,x:rect.x*scale.x-scroll.scrollLeft*scale.x+offsets.x+htmlOffset.x,y:rect.y*scale.y-scroll.scrollTop*scale.y+offsets.y+htmlOffset.y}}function getClientRects(element){return Array.from(element.getClientRects())}function getDocumentRect(element){const html=getDocumentElement(element);const scroll=getNodeScroll(element);const body=element.ownerDocument.body;const width=max(html.scrollWidth,html.clientWidth,body.scrollWidth,body.clientWidth);const height=max(html.scrollHeight,html.clientHeight,body.scrollHeight,body.clientHeight);let x=-scroll.scrollLeft+getWindowScrollBarX(element);const y=-scroll.scrollTop;if(getComputedStyle(body).direction==="rtl"){x+=max(html.clientWidth,body.clientWidth)-width}return{width:width,height:height,x:x,y:y}}function getViewportRect(element,strategy){const win=getWindow(element);const html=getDocumentElement(element);const visualViewport=win.visualViewport;let width=html.clientWidth;let height=html.clientHeight;let x=0;let y=0;if(visualViewport){width=visualViewport.width;height=visualViewport.height;const visualViewportBased=isWebKit();if(!visualViewportBased||visualViewportBased&&strategy==="fixed"){x=visualViewport.offsetLeft;y=visualViewport.offsetTop}}return{width:width,height:height,x:x,y:y}}function getInnerBoundingClientRect(element,strategy){const clientRect=getBoundingClientRect(element,true,strategy==="fixed");const top2=clientRect.top+element.clientTop;const left2=clientRect.left+element.clientLeft;const scale=isHTMLElement(element)?getScale(element):createCoords(1);const width=element.clientWidth*scale.x;const height=element.clientHeight*scale.y;const x=left2*scale.x;const y=top2*scale.y;return{width:width,height:height,x:x,y:y}}function getClientRectFromClippingAncestor(element,clippingAncestor,strategy){let rect;if(clippingAncestor==="viewport"){rect=getViewportRect(element,strategy)}else if(clippingAncestor==="document"){rect=getDocumentRect(getDocumentElement(element))}else if(isElement(clippingAncestor)){rect=getInnerBoundingClientRect(clippingAncestor,strategy)}else{const visualOffsets=getVisualOffsets(element);rect={x:clippingAncestor.x-visualOffsets.x,y:clippingAncestor.y-visualOffsets.y,width:clippingAncestor.width,height:clippingAncestor.height}}return rectToClientRect$1(rect)}function hasFixedPositionAncestor(element,stopNode){const parentNode=getParentNode(element);if(parentNode===stopNode||!isElement(parentNode)||isLastTraversableNode(parentNode)){return false}return getComputedStyle(parentNode).position==="fixed"||hasFixedPositionAncestor(parentNode,stopNode)}function getClippingElementAncestors(element,cache){const cachedResult=cache.get(element);if(cachedResult){return cachedResult}let result=getOverflowAncestors(element,[],false).filter((el=>isElement(el)&&getNodeName(el)!=="body"));let currentContainingBlockComputedStyle=null;const elementIsFixed=getComputedStyle(element).position==="fixed";let currentNode=elementIsFixed?getParentNode(element):element;while(isElement(currentNode)&&!isLastTraversableNode(currentNode)){const computedStyle=getComputedStyle(currentNode);const currentNodeIsContaining=isContainingBlock(currentNode);if(!currentNodeIsContaining&&computedStyle.position==="fixed"){currentContainingBlockComputedStyle=null}const shouldDropCurrentNode=elementIsFixed?!currentNodeIsContaining&&!currentContainingBlockComputedStyle:!currentNodeIsContaining&&computedStyle.position==="static"&&!!currentContainingBlockComputedStyle&&["absolute","fixed"].includes(currentContainingBlockComputedStyle.position)||isOverflowElement(currentNode)&&!currentNodeIsContaining&&hasFixedPositionAncestor(element,currentNode);if(shouldDropCurrentNode){result=result.filter((ancestor=>ancestor!==currentNode))}else{currentContainingBlockComputedStyle=computedStyle}currentNode=getParentNode(currentNode)}cache.set(element,result);return result}function getClippingRect(_ref){let{element:element,boundary:boundary,rootBoundary:rootBoundary,strategy:strategy}=_ref;const elementClippingAncestors=boundary==="clippingAncestors"?isTopLayer(element)?[]:getClippingElementAncestors(element,this._c):[].concat(boundary);const clippingAncestors=[...elementClippingAncestors,rootBoundary];const firstClippingAncestor=clippingAncestors[0];const clippingRect=clippingAncestors.reduce(((accRect,clippingAncestor)=>{const rect=getClientRectFromClippingAncestor(element,clippingAncestor,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}),getClientRectFromClippingAncestor(element,firstClippingAncestor,strategy));return{width:clippingRect.right-clippingRect.left,height:clippingRect.bottom-clippingRect.top,x:clippingRect.left,y:clippingRect.top}}function getDimensions(element){const{width:width,height:height}=getCssDimensions(element);return{width:width,height:height}}function getRectRelativeToOffsetParent(element,offsetParent,strategy){const isOffsetParentAnElement=isHTMLElement(offsetParent);const documentElement=getDocumentElement(offsetParent);const isFixed=strategy==="fixed";const rect=getBoundingClientRect(element,true,isFixed,offsetParent);let scroll={scrollLeft:0,scrollTop:0};const offsets=createCoords(0);if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement)){scroll=getNodeScroll(offsetParent)}if(isOffsetParentAnElement){const offsetRect=getBoundingClientRect(offsetParent,true,isFixed,offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft;offsets.y=offsetRect.y+offsetParent.clientTop}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement)}}const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll):createCoords(0);const x=rect.left+scroll.scrollLeft-offsets.x-htmlOffset.x;const y=rect.top+scroll.scrollTop-offsets.y-htmlOffset.y;return{x:x,y:y,width:rect.width,height:rect.height}}function isStaticPositioned(element){return getComputedStyle(element).position==="static"}function getTrueOffsetParent(element,polyfill){if(!isHTMLElement(element)||getComputedStyle(element).position==="fixed"){return null}if(polyfill){return polyfill(element)}let rawOffsetParent=element.offsetParent;if(getDocumentElement(element)===rawOffsetParent){rawOffsetParent=rawOffsetParent.ownerDocument.body}return rawOffsetParent}function getOffsetParent(element,polyfill){const win=getWindow(element);if(isTopLayer(element)){return win}if(!isHTMLElement(element)){let svgOffsetParent=getParentNode(element);while(svgOffsetParent&&!isLastTraversableNode(svgOffsetParent)){if(isElement(svgOffsetParent)&&!isStaticPositioned(svgOffsetParent)){return svgOffsetParent}svgOffsetParent=getParentNode(svgOffsetParent)}return win}let offsetParent=getTrueOffsetParent(element,polyfill);while(offsetParent&&isTableElement(offsetParent)&&isStaticPositioned(offsetParent)){offsetParent=getTrueOffsetParent(offsetParent,polyfill)}if(offsetParent&&isLastTraversableNode(offsetParent)&&isStaticPositioned(offsetParent)&&!isContainingBlock(offsetParent)){return win}return offsetParent||getContainingBlock(element)||win}const getElementRects=async function(data){const getOffsetParentFn=this.getOffsetParent||getOffsetParent;const getDimensionsFn=this.getDimensions;const floatingDimensions=await getDimensionsFn(data.floating);return{reference:getRectRelativeToOffsetParent(data.reference,await getOffsetParentFn(data.floating),data.strategy),floating:{x:0,y:0,width:floatingDimensions.width,height:floatingDimensions.height}}};function isRTL(element){return getComputedStyle(element).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement,getClippingRect:getClippingRect,getOffsetParent:getOffsetParent,getElementRects:getElementRects,getClientRects:getClientRects,getDimensions:getDimensions,getScale:getScale,isElement:isElement,isRTL:isRTL};function rectsAreEqual(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}function observeMove(element,onMove){let io=null;let timeoutId;const root=getDocumentElement(element);function cleanup(){var _io;clearTimeout(timeoutId);(_io=io)==null||_io.disconnect();io=null}function refresh(skip,threshold){if(skip===void 0){skip=false}if(threshold===void 0){threshold=1}cleanup();const elementRectForRootMargin=element.getBoundingClientRect();const{left:left2,top:top2,width:width,height:height}=elementRectForRootMargin;if(!skip){onMove()}if(!width||!height){return}const insetTop=floor(top2);const insetRight=floor(root.clientWidth-(left2+width));const insetBottom=floor(root.clientHeight-(top2+height));const insetLeft=floor(left2);const rootMargin=-insetTop+"px "+-insetRight+"px "+-insetBottom+"px "+-insetLeft+"px";const options={rootMargin:rootMargin,threshold:max(0,min(1,threshold))||1};let isFirstUpdate=true;function handleObserve(entries){const ratio=entries[0].intersectionRatio;if(ratio!==threshold){if(!isFirstUpdate){return refresh()}if(!ratio){timeoutId=setTimeout((()=>{refresh(false,1e-7)}),1e3)}else{refresh(false,ratio)}}if(ratio===1&&!rectsAreEqual(elementRectForRootMargin,element.getBoundingClientRect())){refresh()}isFirstUpdate=false}try{io=new IntersectionObserver(handleObserve,{...options,root:root.ownerDocument})}catch(e){io=new IntersectionObserver(handleObserve,options)}io.observe(element)}refresh(true);return cleanup}function autoUpdate(reference2,floating,update,options){if(options===void 0){options={}}const{ancestorScroll:ancestorScroll=true,ancestorResize:ancestorResize=true,elementResize:elementResize=typeof ResizeObserver==="function",layoutShift:layoutShift=typeof IntersectionObserver==="function",animationFrame:animationFrame=false}=options;const referenceEl=unwrapElement(reference2);const ancestors=ancestorScroll||ancestorResize?[...referenceEl?getOverflowAncestors(referenceEl):[],...getOverflowAncestors(floating)]:[];ancestors.forEach((ancestor=>{ancestorScroll&&ancestor.addEventListener("scroll",update,{passive:true});ancestorResize&&ancestor.addEventListener("resize",update)}));const cleanupIo=referenceEl&&layoutShift?observeMove(referenceEl,update):null;let reobserveFrame=-1;let resizeObserver=null;if(elementResize){resizeObserver=new ResizeObserver((_ref=>{let[firstEntry]=_ref;if(firstEntry&&firstEntry.target===referenceEl&&resizeObserver){resizeObserver.unobserve(floating);cancelAnimationFrame(reobserveFrame);reobserveFrame=requestAnimationFrame((()=>{var _resizeObserver;(_resizeObserver=resizeObserver)==null||_resizeObserver.observe(floating)}))}update()}));if(referenceEl&&!animationFrame){resizeObserver.observe(referenceEl)}resizeObserver.observe(floating)}let frameId;let prevRefRect=animationFrame?getBoundingClientRect(reference2):null;if(animationFrame){frameLoop()}function frameLoop(){const nextRefRect=getBoundingClientRect(reference2);if(prevRefRect&&!rectsAreEqual(prevRefRect,nextRefRect)){update()}prevRefRect=nextRefRect;frameId=requestAnimationFrame(frameLoop)}update();return()=>{var _resizeObserver2;ancestors.forEach((ancestor=>{ancestorScroll&&ancestor.removeEventListener("scroll",update);ancestorResize&&ancestor.removeEventListener("resize",update)}));cleanupIo==null||cleanupIo();(_resizeObserver2=resizeObserver)==null||_resizeObserver2.disconnect();resizeObserver=null;if(animationFrame){cancelAnimationFrame(frameId)}}}const offset=offset$3;const shift=shift$1;const flip=flip$3;const arrow=arrow$3;const computePosition=(reference2,floating,options)=>{const cache=new Map;const mergedOptions={platform:platform,...options};const platformWithCache={...mergedOptions.platform,_c:cache};return computePosition$1(reference2,floating,{...mergedOptions,platform:platformWithCache})};const TOOLTIP_OFFSET=20;const TOOLTIP_TIMEOUT=250;const SAFE_ZONE_MARGIN=1;class PbTooltip extends PbEnhancedElement{static get selector(){return"[data-pb-tooltip-kit]"}connect(){this.triggerHandlers=new Map;if(this.tooltipInteraction){this.mouseMoveHandler=e=>{this.lastMouseX=e.clientX;this.lastMouseY=e.clientY};document.addEventListener("mousemove",this.mouseMoveHandler)}this.triggerElements.forEach((trigger=>{const method=this.effectiveTriggerMethod;const interactionEnabled=this.tooltipInteraction;if(method==="click"){const clickHandler=e=>{if(this.useClickToOpen){e.preventDefault();if(this.isTooltipVisible()){this.hideTooltip()}else{this.showTooltip(trigger)}}else{this.showTooltip(trigger)}};trigger.addEventListener("click",clickHandler);this.triggerHandlers.set(trigger,{click:clickHandler})}else{if(!this.useClickToOpen){const mouseenterHandler=()=>{clearSafeZoneListener(this);clearTimeout(this.mouseleaveTimeout);this.currentTrigger=trigger;const delayOpen=this.delayOpen?parseInt(this.delayOpen):TOOLTIP_TIMEOUT;this.mouseenterTimeout=setTimeout((()=>{this.showTooltip(trigger);if(interactionEnabled){this.checkCloseTooltip(trigger)}}),delayOpen)};const mouseleaveHandler=()=>{clearTimeout(this.mouseenterTimeout);if(this.delayClose){const delayClose=parseInt(this.delayClose);this.mouseleaveTimeout=setTimeout((()=>{if(interactionEnabled){this.attachSafeZoneListener()}else{this.hideTooltip()}}),delayClose)}else{if(interactionEnabled){this.attachSafeZoneListener()}else{this.hideTooltip()}}};trigger.addEventListener("mouseenter",mouseenterHandler);trigger.addEventListener("mouseleave",mouseleaveHandler);this.triggerHandlers.set(trigger,{mouseenter:mouseenterHandler,mouseleave:mouseleaveHandler});if(interactionEnabled){if(!this.tooltipMouseenterHandler){this.tooltipMouseenterHandler=()=>{clearSafeZoneListener(this)};this.tooltipMouseleaveHandler=()=>{this.attachSafeZoneListener()};this.tooltip.addEventListener("mouseenter",this.tooltipMouseenterHandler);this.tooltip.addEventListener("mouseleave",this.tooltipMouseleaveHandler)}}}}}))}disconnect(){clearTimeout(this.mouseenterTimeout);clearTimeout(this.mouseleaveTimeout);clearTimeout(this.autoHideTimeout);clearSafeZoneListener(this);if(this.cleanup){this.cleanup();this.cleanup=null}if(this.mouseMoveHandler){document.removeEventListener("mousemove",this.mouseMoveHandler)}this.triggerHandlers.forEach(((handlers,trigger)=>{Object.entries(handlers).forEach((([event,handler])=>{trigger.removeEventListener(event,handler)}))}));this.triggerHandlers.clear();if(this.tooltipMouseenterHandler){this.tooltip.removeEventListener("mouseenter",this.tooltipMouseenterHandler);this.tooltip.removeEventListener("mouseleave",this.tooltipMouseleaveHandler)}}isTooltipVisible(){return this.tooltip&&this.tooltip.classList.contains("show")}attachSafeZoneListener(){clearSafeZoneListener(this);this.safeZoneHandler=e=>{if(!this.currentTrigger)return;const triggerRect=this.currentTrigger.getBoundingClientRect();const tooltipRect=this.tooltip.getBoundingClientRect();const safeRect=getSafeZone(triggerRect,tooltipRect,this.position,SAFE_ZONE_MARGIN);if(!isPointInsideRect(e.clientX,e.clientY,safeRect)){this.hideTooltip();clearSafeZoneListener(this)}};document.addEventListener("mousemove",this.safeZoneHandler)}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;clearSafeZoneListener(this);this.tooltip.style.opacity="1";this.tooltip.style.visibility="visible";this.tooltip.style.pointerEvents="auto";if(this.cleanup){this.cleanup()}const arrowElement=document.querySelector(`#${this.tooltipId}-arrow`);this.cleanup=autoUpdate(trigger,this.tooltip,(()=>{computePosition(trigger,this.tooltip,{placement:this.position,strategy:"fixed",middleware:[offset({mainAxis:TOOLTIP_OFFSET,crossAxis:0}),flip(),shift(),arrow({element:arrowElement})]}).then((({x:x,y:y,placement:placement,middlewareData:middlewareData})=>{Object.assign(this.tooltip.style,{left:`${x}px`,top:`${y}px`,position:"fixed"});this.tooltip.setAttribute("data-popper-placement",placement);if(arrowElement&&middlewareData.arrow){const{x:arrowX,y:arrowY}=middlewareData.arrow;Object.assign(arrowElement.style,{left:arrowX!=null?`${arrowX}px`:"",top:arrowY!=null?`${arrowY}px`:"",position:"absolute"})}}))}));this.tooltip.classList.add("show");if(this.effectiveTriggerMethod==="click"&&!this.useClickToOpen){clearTimeout(this.autoHideTimeout);this.autoHideTimeout=setTimeout((()=>{this.hideTooltip()}),1e3)}}hideTooltip(){if(!this.tooltip)return;this.tooltip.classList.add("fade_out");setTimeout((()=>{if(this.cleanup){this.cleanup();this.cleanup=null}this.tooltip.classList.remove("show");this.tooltip.classList.remove("fade_out");this.tooltip.style.opacity="0";this.tooltip.style.visibility="hidden";this.tooltip.style.pointerEvents="none";this.tooltip.style.position="";this.tooltip.style.top="";this.tooltip.style.left="";this.tooltip.style.transform=""}),TOOLTIP_TIMEOUT)}get triggerElements(){let triggerEl;if(this.triggerElementId){triggerEl=document.querySelector(`#${this.triggerElementId}`)}else if(this.triggerElementSelector){const selectorIsId=this.triggerElementSelector.indexOf("#")>-1;triggerEl=selectorIsId?document.querySelector(this.triggerElementSelector):document.querySelectorAll(this.triggerElementSelector)}else{triggerEl=this.element}if(!triggerEl){console.error("Tooltip Kit: No valid trigger element found!");return[]}if(triggerEl.length===void 0){triggerEl=[triggerEl]}return 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}get triggerMethod(){return this.element.dataset.pbTooltipTriggerMethod||"hover"}get useClickToOpen(){return this.element.dataset.pbTooltipUseClickToOpen==="true"}get effectiveTriggerMethod(){return this.useClickToOpen?"click":this.triggerMethod}get tooltipInteraction(){return this.element.dataset.pbTooltipInteraction==="true"}get delayOpen(){return this.element.dataset.pbTooltipDelayOpen}get delayClose(){return this.element.dataset.pbTooltipDelayClose}}function clearSafeZoneListener(context){if(context.safeZoneHandler){document.removeEventListener("mousemove",context.safeZoneHandler);context.safeZoneHandler=null}}function getSafeZone(triggerRect,tooltipRect,placement,margin){let safeRect={};if(placement.startsWith("top")){safeRect.left=triggerRect.left-margin;safeRect.right=triggerRect.right+margin;safeRect.top=tooltipRect.bottom-margin;safeRect.bottom=triggerRect.top+margin}else if(placement.startsWith("bottom")){safeRect.left=triggerRect.left-margin;safeRect.right=triggerRect.right+margin;safeRect.top=triggerRect.bottom-margin;safeRect.bottom=tooltipRect.top+margin}else if(placement.startsWith("left")){safeRect.top=triggerRect.top-margin;safeRect.bottom=triggerRect.bottom+margin;safeRect.left=tooltipRect.right-margin;safeRect.right=triggerRect.left+margin}else if(placement.startsWith("right")){safeRect.top=triggerRect.top-margin;safeRect.bottom=triggerRect.bottom+margin;safeRect.left=triggerRect.right-margin;safeRect.right=tooltipRect.left+margin}else{safeRect={left:triggerRect.left-margin,right:triggerRect.right+margin,top:triggerRect.top-margin,bottom:triggerRect.bottom+margin}}return safeRect}function isPointInsideRect(x,y,rect){return x>=rect.left&&x<=rect.right&&y>=rect.top&&y<=rect.bottom}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)));if(this.clearOnContextChange&&this.searchContextElement){this.searchContextElement.addEventListener("change",(()=>{this.searchInputClear();this.resultsCacheClear();this.clearResults()}))}}get optionsByContext(){return this.element.dataset.pbTypeaheadKitOptionsByContext?JSON.parse(this.element.dataset.pbTypeaheadKitOptionsByContext):null}get searchContextElement(){var _a;const selector=this.element.dataset.pbTypeaheadKitSearchContextSelector;if(!selector)return null;const found=((_a=this.element.parentNode)==null?void 0:_a.querySelector(`#${selector}`))||this.element.closest(selector);return found||null}get clearOnContextChange(){return this.element.dataset.pbTypeaheadKitClearOnContextChange==="true"}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;if(this.optionsByContext&&Object.keys(this.optionsByContext).length>0){const contextArray=this.optionsByContext[searchContext]||[];const filteredResults=contextArray.filter((obj=>obj.label&&obj.label.toLowerCase().includes(searchTerm.toLowerCase())));const optionFragments=filteredResults.map((obj=>{const singleOption=document.createDocumentFragment();singleOption.appendChild(document.createTextNode(obj.label));return singleOption}));this.resultsCacheUpdate(searchTerm,searchContext,optionFragments)}else{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;const selectedText=resultOption.textContent.trim();this._validSelection=true;this.removeValidationError();if(this.searchContextElement)this.searchInput.value=selectedText;this.resultsCacheClear();if(!this.searchContextElement)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")}}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;else if(this.searchContextElement){return this.searchContextElement.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 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("pb_button_enabled","pb_button_disabled pb_button_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}}}))}};const lightest="1px";const lighter="2px";const light="4px";const normal$1="0";const heavy="5px";const heavier="6px";const heaviest="7px";const border_radius_xs="4px";const border_radius_sm="4px";const border_radius_md="6px";const border_radius_lg="8px";const border_radius_xl="16px";const border_radius_none="0";const border_radius_rounded="1000px";const _border_radius_module={lightest:lightest,lighter:lighter,light:light,normal:normal$1,heavy:heavy,heavier:heavier,heaviest:heaviest,border_radius_xs:border_radius_xs,border_radius_sm:border_radius_sm,border_radius_md:border_radius_md,border_radius_lg:border_radius_lg,border_radius_xl:border_radius_xl,border_radius_none:border_radius_none,border_radius_rounded:border_radius_rounded};const tightest="1";const tighter="1.2";const tight="1.4";const normal="1.5";const loose="1.6";const looser="1.8";const loosest="2";const _line_height_module={tightest:tightest,tighter:tighter,tight:tight,normal:normal,loose:loose,looser:looser,loosest:loosest};const opacity_1="0.1";const opacity_2="0.2";const opacity_3="0.3";const opacity_4="0.4";const opacity_5="0.5";const opacity_6="0.6";const opacity_7="0.7";const opacity_8="0.8";const opacity_9="0.9";const _opacity_module={opacity_1:opacity_1,opacity_2:opacity_2,opacity_3:opacity_3,opacity_4:opacity_4,opacity_5:opacity_5,opacity_6:opacity_6,opacity_7:opacity_7,opacity_8:opacity_8,opacity_9:opacity_9};const zindex_1="100";const zindex_2="100";const zindex_3="100";const zindex_4="100";const zindex_5="100";const zindex_6="100";const zindex_7="100";const zindex_8="100";const zindex_9="100";const _positioning_module={zindex_1:zindex_1,zindex_2:zindex_2,zindex_3:zindex_3,zindex_4:zindex_4,zindex_5:zindex_5,zindex_6:zindex_6,zindex_7:zindex_7,zindex_8:zindex_8,zindex_9:zindex_9};const hover_scale_sm="_scale-module__hover_scale_sm___mttFB";const hover_scale_md="_scale-module__hover_scale_md___ipMVm";const hover_scale_lg="_scale-module__hover_scale_lg___-EkY0";const _scale_module={hover_scale_sm:hover_scale_sm,hover_scale_md:hover_scale_md,hover_scale_lg:hover_scale_lg};const xs="575px";const sm="576px";const md="768px";const lg="992px";const xl="1200px";const _screen_sizes_module={xs:xs,sm:sm,md:md,lg:lg,xl:xl};const shadow_none="0 0 0 0 transparent";const shadow_deep="0 4px 10px 0 rgba(60, 106, 172, 0.16)";const shadow_deeper="0 12px 28px 0 rgba(60, 106, 172, 0.18)";const shadow_deepest="0 30px 38px 4px rgba(60, 106, 172, 0.2), 0 2px 14px 4px rgba(60, 106, 172, 0.1)";const _shadows_module={shadow_none:shadow_none,shadow_deep:shadow_deep,shadow_deeper:shadow_deeper,shadow_deepest:shadow_deepest};export{omitBy as $,kitRequiresPortaledFloatingUi as A,resolvePortaledKitHost as B,resolveFloatingOwnerId as C,setFloatingOwnerAttribute as D,positionFloatingShellToInput as E,subscribeFloatingKitOpen as F,recordPortaledMenuPointerDown as G,PB_FLOATING_OWNER_ATTR as H,resolvePortaledFloatingZIndex as I,nextPortaledFloatingZIndex as J,announceFloatingKitOpen as K,debounce$2 as L,PbPopover as M,PbTooltip as N,PbTypeahead as O,PbEnhancedElement as P,PbTable as Q,PbTextarea as R,formHelper as S,datePickerHelper as T,getAllIcons as U,spacing as V,useCollapsible as W,DateTime as X,uniqueId as Y,isPortaledFloatingKitInteraction as Z,resolveFullscreenOverlayForElement as _,get as a,isEmpty as a0,map as a1,partial as a2,find as a3,scheduleStickyColumns as a4,applyStickyColumns as a5,isString as a6,usePBCopy as a7,getAugmentedNamespace as a8,PB_MODAL_ABOVE_FULLSCREEN_Z_INDEX as a9,useDropdown as aa,ReactDOMServer as ab,useFullScreen as ac,cloneDeep as ad,mapTheme as ae,pbIndicator as af,_border_radius_module as ag,_line_height_module as ah,_opacity_module as ai,_positioning_module as aj,_scale_module as ak,_screen_sizes_module as al,_shadows_module as am,offset$3 as b,colors as c,flip$3 as d,arrow$3 as e,filter as f,getDefaultExportFromCjs as g,computePosition$1 as h,createCoords$1 as i,round$2 as j,min$2 as k,floor$1 as l,max$2 as m,noop as n,omit as o,stripEmojisForPaste as p,applyEmojiMask as q,rectToClientRect$1 as r,shift$1 as s,typography as t,positionDropdownPortalToWrapper as u,subscribeFloatingKitReposition as v,targetIsInsidePortaledFloatingKit as w,isNativeSelectMenuInteraction as x,createPopper as y,flatpickr as z};