@watermarkinsights/ripple 5.4.0 → 5.5.0-2

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 (86) hide show
  1. package/dist/cjs/{chartFunctions-ef57119f.js → chartFunctions-ce6c7c16.js} +20 -21
  2. package/dist/cjs/{global-4ff34a0e.js → global-835ecb61.js} +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/priv-calendar.cjs.entry.js +13 -9
  5. package/dist/cjs/priv-navigator-item.cjs.entry.js +1 -1
  6. package/dist/cjs/ripple.cjs.js +1 -1
  7. package/dist/cjs/wm-chart.cjs.entry.js +3 -12
  8. package/dist/cjs/wm-date-range.cjs.entry.js +5 -1
  9. package/dist/cjs/wm-datepicker.cjs.entry.js +5 -1
  10. package/dist/cjs/wm-line-chart.cjs.entry.js +1 -1
  11. package/dist/cjs/wm-navigator.cjs.entry.js +12 -16
  12. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
  13. package/dist/collection/components/charts/chartFunctions.js +20 -21
  14. package/dist/collection/components/charts/wm-chart/wm-chart.css +4 -5
  15. package/dist/collection/components/charts/wm-chart/wm-chart.js +2 -11
  16. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +4 -5
  17. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +17 -9
  18. package/dist/collection/components/datepickers/wm-date-range.js +5 -1
  19. package/dist/collection/components/datepickers/wm-datepicker.js +5 -1
  20. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +3 -3
  21. package/dist/collection/components/wm-navigator/wm-navigator.css +1 -0
  22. package/dist/collection/components/wm-navigator/wm-navigator.js +13 -17
  23. package/dist/esm/{chartFunctions-d3fd6e7c.js → chartFunctions-0ebf83f3.js} +20 -21
  24. package/dist/esm/{global-588c6343.js → global-ec8d6686.js} +1 -1
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/esm/priv-calendar.entry.js +13 -9
  27. package/dist/esm/priv-navigator-item.entry.js +1 -1
  28. package/dist/esm/ripple.js +1 -1
  29. package/dist/esm/wm-chart.entry.js +3 -12
  30. package/dist/esm/wm-date-range.entry.js +5 -1
  31. package/dist/esm/wm-datepicker.entry.js +5 -1
  32. package/dist/esm/wm-line-chart.entry.js +1 -1
  33. package/dist/esm/wm-navigator.entry.js +12 -16
  34. package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
  35. package/dist/esm-es5/chartFunctions-0ebf83f3.js +1 -0
  36. package/dist/esm-es5/global-ec8d6686.js +1 -0
  37. package/dist/esm-es5/loader.js +1 -1
  38. package/dist/esm-es5/priv-calendar.entry.js +1 -1
  39. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  40. package/dist/esm-es5/ripple.js +1 -1
  41. package/dist/esm-es5/wm-chart.entry.js +1 -1
  42. package/dist/esm-es5/wm-date-range.entry.js +1 -1
  43. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  44. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  45. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  46. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  47. package/dist/ripple/p-011477e2.entry.js +1 -0
  48. package/dist/ripple/p-021ff5fa.system.entry.js +1 -0
  49. package/dist/ripple/p-204bdd73.entry.js +1 -0
  50. package/dist/ripple/{p-e7a64841.system.entry.js → p-28b70082.system.entry.js} +1 -1
  51. package/dist/ripple/p-361f6e59.system.js +1 -0
  52. package/dist/ripple/p-3b8b1b44.system.entry.js +1 -0
  53. package/dist/ripple/{p-f67fd802.system.entry.js → p-4a6854d3.system.entry.js} +1 -1
  54. package/dist/ripple/{p-e3de5bbd.system.entry.js → p-4c8db09c.system.entry.js} +1 -1
  55. package/dist/ripple/{p-0aa17cac.entry.js → p-4d0b1890.entry.js} +1 -1
  56. package/dist/ripple/p-5d0e2006.system.entry.js +1 -0
  57. package/dist/ripple/{p-763a01bc.system.js → p-811d5a9f.system.js} +1 -1
  58. package/dist/ripple/p-825bd63b.entry.js +1 -0
  59. package/dist/ripple/p-99dd083d.system.js +1 -0
  60. package/dist/ripple/p-a27d2177.entry.js +1 -0
  61. package/dist/ripple/p-ab0e197b.js +1 -0
  62. package/dist/ripple/{p-591918a4.entry.js → p-ade3d9a9.entry.js} +1 -1
  63. package/dist/ripple/p-c47811a2.entry.js +1 -0
  64. package/dist/ripple/{p-9a3e656a.entry.js → p-dbc112a6.entry.js} +1 -1
  65. package/dist/ripple/p-e3241417.system.entry.js +1 -0
  66. package/dist/ripple/p-f92bd0c1.js +1 -0
  67. package/dist/ripple/{p-49b7970e.system.entry.js → p-fd0aae67.system.entry.js} +1 -1
  68. package/dist/ripple/ripple.esm.js +1 -1
  69. package/dist/ripple/ripple.js +1 -1
  70. package/dist/types/global/interfaces.d.ts +1 -1
  71. package/package.json +1 -1
  72. package/dist/esm-es5/chartFunctions-d3fd6e7c.js +0 -1
  73. package/dist/esm-es5/global-588c6343.js +0 -1
  74. package/dist/ripple/p-0f0466c6.js +0 -1
  75. package/dist/ripple/p-2be33eb4.system.js +0 -1
  76. package/dist/ripple/p-3183bba8.entry.js +0 -1
  77. package/dist/ripple/p-4bacf5a7.system.entry.js +0 -1
  78. package/dist/ripple/p-5c10e2ae.entry.js +0 -1
  79. package/dist/ripple/p-75ba63ba.entry.js +0 -1
  80. package/dist/ripple/p-97aaa344.system.js +0 -1
  81. package/dist/ripple/p-bee9a5dc.js +0 -1
  82. package/dist/ripple/p-c91b10f3.system.entry.js +0 -1
  83. package/dist/ripple/p-cc4a429b.entry.js +0 -1
  84. package/dist/ripple/p-d86bd773.entry.js +0 -1
  85. package/dist/ripple/p-f4210450.system.entry.js +0 -1
  86. package/dist/ripple/p-fe8d02c3.system.entry.js +0 -1
@@ -1 +1 @@
1
- import{p as promiseResolve,b as bootstrapLazy}from"./index-558b5a82.js";export{s as setNonce}from"./index-558b5a82.js";import"./global-588c6343.js";var patchBrowser=function(){var e=import.meta.url;var a={};if(e!==""){a.resourcesUrl=new URL(".",e).href}return promiseResolve(a)};patchBrowser().then((function(e){return bootstrapLazy(JSON.parse('[["wm-file",[[17,"wm-file",{"name":[1],"type":[1],"fileActions":[1,"file-actions"],"lastUpdated":[1,"last-updated"],"progress":[514],"size":[1],"uploadedBy":[1,"uploaded-by"],"errorMessage":[1,"error-message"],"showInfo":[1025,"show-info"]}]]],["wm-tab-item_3",[[17,"wm-tab-list",{"customBackground":[1,"custom-background"],"customPadding":[1,"custom-padding"],"selectedTab":[1,"selected-tab"]},[[0,"tabItemLoaded","tabItemLoaded"],[0,"keydownOnTabItem","handleKeydown"]],{"selectedTab":["setSelected"]}],[17,"wm-tab-item",{"selected":[4],"show":[4],"tabId":[1,"tab-id"]}],[0,"wm-tab-panel",{"active":[1028],"tabId":[1025,"tab-id"]}]]],["wm-navigator",[[17,"wm-navigator",{"userName":[1,"user-name"],"email":[1],"authType":[2,"auth-type"],"connectionName":[1,"connection-name"],"logoutUrl":[1,"logout-url"],"products":[1],"loadFromUserinfo":[4,"load-from-userinfo"],"isOpen":[32],"itemIndexToFocus":[32]},[[0,"keydown","handleKeys"],[0,"keydownOnNavItem","handleKeydown"],[4,"click","handleClick"],[0,"buttonActivated","handleButtonClick"]],{"products":["parseData"]}]]],["wm-navigation_3",[[17,"wm-navigation",{"open":[1540]},[[0,"keydown","closeOnEscape"],[9,"resize","handleWindowResize"],[8,"wmNavigationHamburgerClicked","handleHamburgerClicked"],[0,"wmNavigationItemClicked","handleClickOnItem"]],{"open":["handleStateChange"]}],[17,"wm-navigation-hamburger",{"navId":[1,"nav-id"],"isTabbing":[32],"open":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[4,"wmNavigationStateChanged","handleNavigationStateChanged"]]],[17,"wm-navigation-item",{"href":[1],"text":[1],"active":[4]}]]],["wm-progress-indicator_3",[[17,"wm-progress-indicator",{"label":[1],"subinfo":[1],"completionMessage":[1,"completion-message"],"showLegend":[4,"show-legend"],"printMode":[4,"print-mode"],"printModeFormat":[1,"print-mode-format"],"isTabbing":[32],"mode":[32],"userIsNavigating":[32],"focusedSliceId":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"keydown","handleKeydown"],[0,"wmProgressSliceUpdated","handleSliceUpdate"]],{"mode":["handleModeUpdate"]}],[17,"wm-progress-monitor",{"breakpoint":[8],"groupLegend":[1,"group-legend"],"barLabelsWidth":[1,"bar-labels-width"]}],[1,"wm-progress-slice",{"legend":[1],"amount":[1],"popoverTitle":[1,"popover-title"],"popoverText":[1,"popover-text"],"popoverButtonText":[1,"popover-button-text"]}]]],["wm-chart",[[17,"wm-chart",{"chartType":[1,"chart-type"],"label":[1],"labelWidth":[1,"label-width"],"subinfo":[1],"valueFormat":[1,"value-format"],"showGrid":[4,"show-grid"],"showLegend":[4,"show-legend"],"showBarLegend":[4,"show-bar-legend"],"notStartedColor":[4,"not-started-color"],"printMode":[4,"print-mode"],"printModeFormat":[1,"print-mode-format"],"labelPosition":[1,"label-position"],"isTabbing":[32],"userIsNavigating":[32],"focusedSliceId":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"keydown","handleKeydown"],[0,"wmChartSliceUpdated","handleSliceUpdate"]]]]],["wm-date-range",[[17,"wm-date-range",{"dateFormat":[1,"date-format"],"disabled":[4],"errorMessage":[513,"error-message"],"invalidStart":[4,"invalid-start"],"invalidEnd":[4,"invalid-end"],"labelStart":[1,"label-start"],"labelEnd":[1,"label-end"],"preselected":[1],"requiredField":[4,"required-field"],"valueStart":[1025,"value-start"],"valueEnd":[1025,"value-end"],"availSpace":[32],"isExpanded":[32],"reformatDate":[64],"isValidISO":[64]},[[0,"keydown","handleKey"],[4,"click","blurHandler"],[8,"blur","handleBlurOnWindow"],[0,"popupBlurred","handlePopupBlurred"],[0,"cellTriggered","handleCellTriggered"],[0,"outOfCal","handleOutOfCal"],[0,"cellHovered","handleCellHovered"],[9,"resize","setAvailSpace"]],{"disabled":["handleDisabled"],"valueStart":["updateValueStart"],"valueEnd":["updateValueEnd"],"errorMessage":["handleErrorMessage"]}]]],["wm-datepicker",[[17,"wm-datepicker",{"value":[1025],"disabled":[4],"dateFormat":[1,"date-format"],"errorMessage":[513,"error-message"],"labelPosition":[1,"label-position"],"label":[1],"requiredField":[4,"required-field"],"preselected":[1],"isExpanded":[32],"reformatDate":[64],"isValidIso":[64]},[[0,"keydown","handleKey"],[4,"click","blurHandler"],[8,"blur","handleBlurOnWindow"],[0,"cellTriggered","handleCellTriggered"]],{"disabled":["handleDisabledChange"],"value":["updateValue"],"errorMessage":["announceError"]}]]],["wm-line-chart",[[1,"wm-line-chart",{"label":[1],"description":[1],"xAxisLabel":[1,"x-axis-label"],"yAxisLabel":[1,"y-axis-label"],"lineData":[513,"line-data"],"units":[1],"labelWidth":[1,"label-width"],"highlightQualifier":[1,"highlight-qualifier"],"highlightStart":[1,"highlight-start"],"highlightEnd":[1,"highlight-end"],"visibilityToggles":[4,"visibility-toggles"],"showDeltas":[4,"show-deltas"],"yRange":[1,"y-range"],"parsedLineData":[32],"popoverIndex":[32],"focusedLine":[32],"hiddenLines":[32],"isTabbing":[32],"intervalSkip":[32],"announcement":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"]],{"lineData":["parseData"],"intervalSkip":["handleIntervalSkip"]}]]],["wm-modal-footer",[[0,"wm-modal-footer",{"secondaryText":[1,"secondary-text"],"primaryText":[1,"primary-text"],"infoText":[1,"info-text"],"primaryActionDisabled":[4,"primary-action-disabled"],"deleteStyle":[4,"delete-style"]}]]],["wm-modal-header",[[0,"wm-modal-header",{"heading":[1],"subheading":[1]}]]],["wm-search",[[17,"wm-search",{"searchType":[1025,"search-type"],"disabled":[516],"placeholder":[1],"label":[1],"numResults":[1026,"num-results"],"value":[1537],"highlightedId":[1,"highlighted-id"],"highlightedName":[1,"highlighted-name"],"isTabbing":[32],"highlightedNum":[32],"previousBlurredValue":[32],"parentModal":[32],"announcement":[32],"updateValue":[64]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"]],{"numResults":["handleNumResultsUpdate"],"disabled":["handleDisabledChange"]}]]],["wm-chart-slice",[[0,"wm-chart-slice",{"legend":[1],"amount":[1],"popoverTitle":[1,"popover-title"],"popoverText":[1,"popover-text"],"popoverButtonText":[1,"popover-button-text"]}]]],["wm-file-list",[[17,"wm-file-list",{"showInfo":[1,"show-info"]}]]],["wm-input",[[17,"wm-input",{"label":[1],"labelPosition":[1,"label-position"],"value":[1025],"disabled":[4],"info":[1],"inputWidth":[1,"input-width"],"placeholder":[1],"requiredField":[4,"required-field"],"errorMessage":[1,"error-message"],"characterLimit":[2,"character-limit"],"symbolBefore":[1,"symbol-before"],"symbolAfter":[1,"symbol-after"],"textAfter":[1,"text-after"],"type":[1],"step":[2],"min":[2],"max":[2],"isSubmit":[4,"is-submit"],"announcement":[32]},null,{"disabled":["handleDisabledChange"],"errorMessage":["announceError"]}]]],["wm-modal",[[4,"wm-modal",{"open":[1540],"elementToFocus":[1025,"element-to-focus"],"modalType":[513,"modal-type"],"uid":[1537],"returnFocusEl":[32],"emitCloseEvent":[64],"emitPrimaryEvent":[64],"emitSecondaryEvent":[64]},null,{"open":["toggleModal"]}]]],["wm-pagination",[[17,"wm-pagination",{"currentPage":[2,"current-page"],"totalItems":[2,"total-items"],"itemsPerPage":[2,"items-per-page"],"value":[2],"isLargeSize":[4,"is-large-size"],"srAnnouncement":[32]},null,{"totalItems":["calculateTotalPages"],"itemsPerPage":["calculateTotalPages"]}]]],["wm-snackbar",[[1,"wm-snackbar",{"notifications":[1537],"isTabbing":[32],"announcement":[32]},[[4,"keydown","checkForTabbing"],[5,"mouseover","handleMouse"]],{"notifications":["updateSnacks"]}]]],["wm-tag-input",[[17,"wm-tag-input",{"label":[1],"errorMessage":[1,"error-message"],"info":[1],"labelPosition":[1,"label-position"],"maxTags":[2,"max-tags"],"placeholder":[1025],"requiredField":[4,"required-field"],"tagInputType":[1,"tag-input-type"],"helpText":[1,"help-text"],"addNew":[4,"add-new"],"characterLimit":[2,"character-limit"],"colHeaders":[1,"col-headers"],"colWidths":[1,"col-widths"],"colWrap":[1,"col-wrap"],"isKeying":[32],"isExpanded":[32],"liveRegionMessage":[32],"focusedOption":[32],"focusedColumn":[32],"focusedTagIndex":[32],"tagsList":[32]},[[8,"wmUserIsKeying","toggleKeyingOn"],[8,"wmUserIsTabbing","toggleKeyingOn"],[8,"wmUserIsNotKeying","toggleKeyingOff"],[8,"wmUserIsNotTabbing","toggleKeyingOff"],[0,"privTagOptionSelected","handleTagOptionSelected"],[0,"privTagOptionDeselected","handleTagOptionDeselected"],[4,"click","handleClick"],[11,"scroll","dismissTooltip"],[0,"blur","handleBlur"]],{"errorMessage":["announceError"]}]]],["wm-tag-option",[[0,"wm-tag-option",{"selected":[1540],"locked":[4],"col1":[1],"col2":[1],"col3":[1],"col4":[1],"emitSelectedEvent":[64],"emitDeselectedEvent":[64]},null,{"selected":["handleSelected"]}]]],["wm-textarea",[[1,"wm-textarea",{"label":[1],"labelPosition":[1,"label-position"],"value":[1025],"disabled":[4],"info":[1],"placeholder":[1],"requiredField":[4,"required-field"],"errorMessage":[1,"error-message"],"characterLimit":[2,"character-limit"],"inputWidth":[1,"input-width"],"inputHeight":[1,"input-height"],"announcement":[32]},null,{"disabled":["handleDisabledChange"],"errorMessage":["announceError"]}]]],["wm-timepicker",[[17,"wm-timepicker",{"disabled":[4],"value":[1025],"errorMessage":[1,"error-message"],"label":[1],"labelPosition":[1,"label-position"],"requiredField":[4,"required-field"],"preselected":[1],"isExpanded":[32],"isValidTime":[64],"reformatTime":[64]},[[0,"keydown","handleKey"]],{"disabled":["handleDisabledChange"],"value":["handleValueChange"],"errorMessage":["announceError"]}]]],["wm-toggletip",[[17,"wm-toggletip",{"label":[1],"tooltip":[1025],"tooltipPosition":[1537,"tooltip-position"],"targetSize":[1,"target-size"],"isOpen":[32]},[[0,"keydown","handleKeydown"],[4,"click","handleClick"]]]]],["wm-uploader",[[17,"wm-uploader",{"label":[1],"buttonText":[1,"button-text"],"icon":[1],"fileTypes":[1,"file-types"],"maxSize":[1,"max-size"],"maxFiles":[2,"max-files"],"errorMessage":[1,"error-message"],"requiredField":[4,"required-field"],"showInfo":[1,"show-info"],"isTabbing":[32],"notif":[32],"isCondensed":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"wmFileErrorCleared","handleFileErrorCleared"],[0,"wmFileDelete","storeDeletedId"]],{"errorMessage":["announceError"]}]]],["wm-wrapper",[[0,"wm-wrapper"]]],["priv-navigator-button",[[17,"priv-navigator-button",{"expanded":[1028],"altText":[1,"alt-text"]}]]],["priv-navigator-item",[[1,"priv-navigator-item",{"selected":[1028],"focused":[1028],"link":[1025]},[[0,"keydown","handleKeyDown"]]]]],["priv-calendar",[[0,"priv-calendar",{"disabled":[4],"view":[1025],"focusDate":[1025,"focus-date"],"startDate":[1,"start-date"],"endDate":[1,"end-date"],"hoverDate":[1,"hover-date"],"focusFirstFocusable":[64],"focusLastFocusable":[64],"focusCell":[64]},[[0,"keydown","handleKey"]],{"focusDate":["handleFocusDate"]}]]],["priv-chart-popover",[[0,"priv-chart-popover",{"open":[1028],"sliceDetails":[16]},[[4,"click","handleClickOnDocument"],[0,"click","handleClick"]],{"open":["handleOpenChange"],"sliceDetails":["handleDetailsChange"]}]]],["wm-option_2",[[17,"wm-select",{"disabled":[516],"maxHeight":[1,"max-height"],"label":[1025],"labelPosition":[1,"label-position"],"requiredField":[4,"required-field"],"errorMessage":[1025,"error-message"],"multiple":[4],"search":[4],"selectAll":[4,"select-all"],"placeholder":[1],"searchPlaceholder":[1,"search-placeholder"],"allSelectedMessage":[1,"all-selected-message"],"isExpanded":[32],"announcement":[32]},[[0,"wmOptionSelected","handleOptionSelection"],[0,"intCloneClicked","handleOptionCloneSelection"],[0,"wmEnterKeyPressed","handleChildEnter"],[0,"wmKeyUpPressed","handleChildUp"],[0,"wmKeyDownPressed","handleChildDown"],[0,"wmHomeKeyPressed","moveToFirstOption"],[0,"wmEndKeyPressed","moveToLastOption"],[0,"wmEscKeyPressed","closePopupOnEscape"],[0,"wmOptionBlurred","handleOptionBlur"],[6,"click","handleClick"],[0,"keydown","handleKey"],[0,"wmLetterPressed","findAndFocusOption"]],{"errorMessage":["announceError"],"disabled":["handleDisabledChange"]}],[1,"wm-option",{"value":[1],"subinfo":[1025],"disabled":[516],"selected":[516],"focused":[4],"searchTerm":[32]},[[0,"keydown","handleKeydown"],[0,"click","handleSelection"],[0,"blur","handleBlur"]],{"selected":["syncAriaSelected"],"disabled":["syncAriaDisabled","updateDisabledOnClick"]}]]],["wm-button",[[17,"wm-button",{"disabled":[516],"buttonType":[1025,"button-type"],"icon":[1537],"iconSize":[1,"icon-size"],"iconRotate":[2,"icon-rotate"],"iconFlip":[1,"icon-flip"],"tooltip":[1537],"labelForIdenticalButtons":[1,"label-for-identical-buttons"],"tooltipPosition":[1,"tooltip-position"],"permanentlyDelete":[4,"permanently-delete"],"textWrap":[4,"text-wrap"],"customBackground":[1,"custom-background"],"isSubmit":[4,"is-submit"],"isTabbing":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[11,"scroll","handleScroll"],[0,"keydown","handleKeydown"]],{"buttonType":["validateType"],"icon":["updateIcon"],"disabled":["handleDisabledChange"]}]]],["wm-action-menu_2",[[17,"wm-action-menu",{"tooltipPosition":[1,"tooltip-position"],"actionMenuType":[1,"action-menu-type"],"buttonText":[1,"button-text"],"disabled":[516],"tooltip":[1],"labelForIdenticalButtons":[1,"label-for-identical-buttons"],"darkMode":[4,"dark-mode"],"isExpanded":[32]},[[0,"wmMenuitemClicked","handleClickedItem"],[0,"wmKeyUpPressed","handleKeyUp"],[0,"wmKeyDownPressed","handleKeyDown"],[0,"wmHomeKeyPressed","handleHomeKey"],[0,"wmEndKeyPressed","handleEndKey"],[0,"wmTabKeyPressed","handleTabKey"],[0,"wmEscKeyPressed","handleEscKey"],[0,"keydown","handleKey"],[0,"wmMenuitemBlurred","handleMenuitemBlur"],[0,"wmLetterPressed","findAndFocusItem"]]],[1,"wm-menuitem",{"disabled":[4],"icon":[1025],"description":[1]},[[0,"keydown","handleKeydown"],[0,"click","handleClick"],[0,"blur","handleBlur"]],{"disabled":["setOnClick"]}]]]]'),e)}));
1
+ import{p as promiseResolve,b as bootstrapLazy}from"./index-558b5a82.js";export{s as setNonce}from"./index-558b5a82.js";import"./global-ec8d6686.js";var patchBrowser=function(){var e=import.meta.url;var a={};if(e!==""){a.resourcesUrl=new URL(".",e).href}return promiseResolve(a)};patchBrowser().then((function(e){return bootstrapLazy(JSON.parse('[["wm-file",[[17,"wm-file",{"name":[1],"type":[1],"fileActions":[1,"file-actions"],"lastUpdated":[1,"last-updated"],"progress":[514],"size":[1],"uploadedBy":[1,"uploaded-by"],"errorMessage":[1,"error-message"],"showInfo":[1025,"show-info"]}]]],["wm-tab-item_3",[[17,"wm-tab-list",{"customBackground":[1,"custom-background"],"customPadding":[1,"custom-padding"],"selectedTab":[1,"selected-tab"]},[[0,"tabItemLoaded","tabItemLoaded"],[0,"keydownOnTabItem","handleKeydown"]],{"selectedTab":["setSelected"]}],[17,"wm-tab-item",{"selected":[4],"show":[4],"tabId":[1,"tab-id"]}],[0,"wm-tab-panel",{"active":[1028],"tabId":[1025,"tab-id"]}]]],["wm-navigator",[[17,"wm-navigator",{"userName":[1,"user-name"],"email":[1],"authType":[2,"auth-type"],"connectionName":[1,"connection-name"],"logoutUrl":[1,"logout-url"],"products":[1],"loadFromUserinfo":[4,"load-from-userinfo"],"isOpen":[32],"itemIndexToFocus":[32]},[[0,"keydown","handleKeys"],[0,"keydownOnNavItem","handleKeydown"],[4,"click","handleClick"],[0,"buttonActivated","handleButtonClick"]],{"products":["parseData"]}]]],["wm-navigation_3",[[17,"wm-navigation",{"open":[1540]},[[0,"keydown","closeOnEscape"],[9,"resize","handleWindowResize"],[8,"wmNavigationHamburgerClicked","handleHamburgerClicked"],[0,"wmNavigationItemClicked","handleClickOnItem"]],{"open":["handleStateChange"]}],[17,"wm-navigation-hamburger",{"navId":[1,"nav-id"],"isTabbing":[32],"open":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[4,"wmNavigationStateChanged","handleNavigationStateChanged"]]],[17,"wm-navigation-item",{"href":[1],"text":[1],"active":[4]}]]],["wm-progress-indicator_3",[[17,"wm-progress-indicator",{"label":[1],"subinfo":[1],"completionMessage":[1,"completion-message"],"showLegend":[4,"show-legend"],"printMode":[4,"print-mode"],"printModeFormat":[1,"print-mode-format"],"isTabbing":[32],"mode":[32],"userIsNavigating":[32],"focusedSliceId":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"keydown","handleKeydown"],[0,"wmProgressSliceUpdated","handleSliceUpdate"]],{"mode":["handleModeUpdate"]}],[17,"wm-progress-monitor",{"breakpoint":[8],"groupLegend":[1,"group-legend"],"barLabelsWidth":[1,"bar-labels-width"]}],[1,"wm-progress-slice",{"legend":[1],"amount":[1],"popoverTitle":[1,"popover-title"],"popoverText":[1,"popover-text"],"popoverButtonText":[1,"popover-button-text"]}]]],["wm-chart",[[17,"wm-chart",{"chartType":[1,"chart-type"],"label":[1],"labelWidth":[1,"label-width"],"subinfo":[1],"valueFormat":[1,"value-format"],"showGrid":[4,"show-grid"],"showLegend":[4,"show-legend"],"showBarLegend":[4,"show-bar-legend"],"notStartedColor":[4,"not-started-color"],"printMode":[4,"print-mode"],"printModeFormat":[1,"print-mode-format"],"labelPosition":[1,"label-position"],"isTabbing":[32],"userIsNavigating":[32],"focusedSliceId":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"keydown","handleKeydown"],[0,"wmChartSliceUpdated","handleSliceUpdate"]]]]],["wm-date-range",[[17,"wm-date-range",{"dateFormat":[1,"date-format"],"disabled":[4],"errorMessage":[513,"error-message"],"invalidStart":[4,"invalid-start"],"invalidEnd":[4,"invalid-end"],"labelStart":[1,"label-start"],"labelEnd":[1,"label-end"],"preselected":[1],"requiredField":[4,"required-field"],"valueStart":[1025,"value-start"],"valueEnd":[1025,"value-end"],"availSpace":[32],"isExpanded":[32],"reformatDate":[64],"isValidISO":[64]},[[0,"keydown","handleKey"],[4,"click","blurHandler"],[8,"blur","handleBlurOnWindow"],[0,"popupBlurred","handlePopupBlurred"],[0,"cellTriggered","handleCellTriggered"],[0,"outOfCal","handleOutOfCal"],[0,"cellHovered","handleCellHovered"],[9,"resize","setAvailSpace"]],{"disabled":["handleDisabled"],"valueStart":["updateValueStart"],"valueEnd":["updateValueEnd"],"errorMessage":["handleErrorMessage"]}]]],["wm-datepicker",[[17,"wm-datepicker",{"value":[1025],"disabled":[4],"dateFormat":[1,"date-format"],"errorMessage":[513,"error-message"],"labelPosition":[1,"label-position"],"label":[1],"requiredField":[4,"required-field"],"preselected":[1],"isExpanded":[32],"reformatDate":[64],"isValidIso":[64]},[[0,"keydown","handleKey"],[4,"click","blurHandler"],[8,"blur","handleBlurOnWindow"],[0,"cellTriggered","handleCellTriggered"]],{"disabled":["handleDisabledChange"],"value":["updateValue"],"errorMessage":["announceError"]}]]],["wm-line-chart",[[1,"wm-line-chart",{"label":[1],"description":[1],"xAxisLabel":[1,"x-axis-label"],"yAxisLabel":[1,"y-axis-label"],"lineData":[513,"line-data"],"units":[1],"labelWidth":[1,"label-width"],"highlightQualifier":[1,"highlight-qualifier"],"highlightStart":[1,"highlight-start"],"highlightEnd":[1,"highlight-end"],"visibilityToggles":[4,"visibility-toggles"],"showDeltas":[4,"show-deltas"],"yRange":[1,"y-range"],"parsedLineData":[32],"popoverIndex":[32],"focusedLine":[32],"hiddenLines":[32],"isTabbing":[32],"intervalSkip":[32],"announcement":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"]],{"lineData":["parseData"],"intervalSkip":["handleIntervalSkip"]}]]],["wm-modal-footer",[[0,"wm-modal-footer",{"secondaryText":[1,"secondary-text"],"primaryText":[1,"primary-text"],"infoText":[1,"info-text"],"primaryActionDisabled":[4,"primary-action-disabled"],"deleteStyle":[4,"delete-style"]}]]],["wm-modal-header",[[0,"wm-modal-header",{"heading":[1],"subheading":[1]}]]],["wm-search",[[17,"wm-search",{"searchType":[1025,"search-type"],"disabled":[516],"placeholder":[1],"label":[1],"numResults":[1026,"num-results"],"value":[1537],"highlightedId":[1,"highlighted-id"],"highlightedName":[1,"highlighted-name"],"isTabbing":[32],"highlightedNum":[32],"previousBlurredValue":[32],"parentModal":[32],"announcement":[32],"updateValue":[64]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"]],{"numResults":["handleNumResultsUpdate"],"disabled":["handleDisabledChange"]}]]],["wm-chart-slice",[[0,"wm-chart-slice",{"legend":[1],"amount":[1],"popoverTitle":[1,"popover-title"],"popoverText":[1,"popover-text"],"popoverButtonText":[1,"popover-button-text"]}]]],["wm-file-list",[[17,"wm-file-list",{"showInfo":[1,"show-info"]}]]],["wm-input",[[17,"wm-input",{"label":[1],"labelPosition":[1,"label-position"],"value":[1025],"disabled":[4],"info":[1],"inputWidth":[1,"input-width"],"placeholder":[1],"requiredField":[4,"required-field"],"errorMessage":[1,"error-message"],"characterLimit":[2,"character-limit"],"symbolBefore":[1,"symbol-before"],"symbolAfter":[1,"symbol-after"],"textAfter":[1,"text-after"],"type":[1],"step":[2],"min":[2],"max":[2],"isSubmit":[4,"is-submit"],"announcement":[32]},null,{"disabled":["handleDisabledChange"],"errorMessage":["announceError"]}]]],["wm-modal",[[4,"wm-modal",{"open":[1540],"elementToFocus":[1025,"element-to-focus"],"modalType":[513,"modal-type"],"uid":[1537],"returnFocusEl":[32],"emitCloseEvent":[64],"emitPrimaryEvent":[64],"emitSecondaryEvent":[64]},null,{"open":["toggleModal"]}]]],["wm-pagination",[[17,"wm-pagination",{"currentPage":[2,"current-page"],"totalItems":[2,"total-items"],"itemsPerPage":[2,"items-per-page"],"value":[2],"isLargeSize":[4,"is-large-size"],"srAnnouncement":[32]},null,{"totalItems":["calculateTotalPages"],"itemsPerPage":["calculateTotalPages"]}]]],["wm-snackbar",[[1,"wm-snackbar",{"notifications":[1537],"isTabbing":[32],"announcement":[32]},[[4,"keydown","checkForTabbing"],[5,"mouseover","handleMouse"]],{"notifications":["updateSnacks"]}]]],["wm-tag-input",[[17,"wm-tag-input",{"label":[1],"errorMessage":[1,"error-message"],"info":[1],"labelPosition":[1,"label-position"],"maxTags":[2,"max-tags"],"placeholder":[1025],"requiredField":[4,"required-field"],"tagInputType":[1,"tag-input-type"],"helpText":[1,"help-text"],"addNew":[4,"add-new"],"characterLimit":[2,"character-limit"],"colHeaders":[1,"col-headers"],"colWidths":[1,"col-widths"],"colWrap":[1,"col-wrap"],"isKeying":[32],"isExpanded":[32],"liveRegionMessage":[32],"focusedOption":[32],"focusedColumn":[32],"focusedTagIndex":[32],"tagsList":[32]},[[8,"wmUserIsKeying","toggleKeyingOn"],[8,"wmUserIsTabbing","toggleKeyingOn"],[8,"wmUserIsNotKeying","toggleKeyingOff"],[8,"wmUserIsNotTabbing","toggleKeyingOff"],[0,"privTagOptionSelected","handleTagOptionSelected"],[0,"privTagOptionDeselected","handleTagOptionDeselected"],[4,"click","handleClick"],[11,"scroll","dismissTooltip"],[0,"blur","handleBlur"]],{"errorMessage":["announceError"]}]]],["wm-tag-option",[[0,"wm-tag-option",{"selected":[1540],"locked":[4],"col1":[1],"col2":[1],"col3":[1],"col4":[1],"emitSelectedEvent":[64],"emitDeselectedEvent":[64]},null,{"selected":["handleSelected"]}]]],["wm-textarea",[[1,"wm-textarea",{"label":[1],"labelPosition":[1,"label-position"],"value":[1025],"disabled":[4],"info":[1],"placeholder":[1],"requiredField":[4,"required-field"],"errorMessage":[1,"error-message"],"characterLimit":[2,"character-limit"],"inputWidth":[1,"input-width"],"inputHeight":[1,"input-height"],"announcement":[32]},null,{"disabled":["handleDisabledChange"],"errorMessage":["announceError"]}]]],["wm-timepicker",[[17,"wm-timepicker",{"disabled":[4],"value":[1025],"errorMessage":[1,"error-message"],"label":[1],"labelPosition":[1,"label-position"],"requiredField":[4,"required-field"],"preselected":[1],"isExpanded":[32],"isValidTime":[64],"reformatTime":[64]},[[0,"keydown","handleKey"]],{"disabled":["handleDisabledChange"],"value":["handleValueChange"],"errorMessage":["announceError"]}]]],["wm-toggletip",[[17,"wm-toggletip",{"label":[1],"tooltip":[1025],"tooltipPosition":[1537,"tooltip-position"],"targetSize":[1,"target-size"],"isOpen":[32]},[[0,"keydown","handleKeydown"],[4,"click","handleClick"]]]]],["wm-uploader",[[17,"wm-uploader",{"label":[1],"buttonText":[1,"button-text"],"icon":[1],"fileTypes":[1,"file-types"],"maxSize":[1,"max-size"],"maxFiles":[2,"max-files"],"errorMessage":[1,"error-message"],"requiredField":[4,"required-field"],"showInfo":[1,"show-info"],"isTabbing":[32],"notif":[32],"isCondensed":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[0,"wmFileErrorCleared","handleFileErrorCleared"],[0,"wmFileDelete","storeDeletedId"]],{"errorMessage":["announceError"]}]]],["wm-wrapper",[[0,"wm-wrapper"]]],["priv-navigator-button",[[17,"priv-navigator-button",{"expanded":[1028],"altText":[1,"alt-text"]}]]],["priv-navigator-item",[[1,"priv-navigator-item",{"selected":[1028],"focused":[1028],"link":[1025]},[[0,"keydown","handleKeyDown"]]]]],["priv-calendar",[[0,"priv-calendar",{"disabled":[4],"view":[1025],"focusDate":[1025,"focus-date"],"startDate":[1,"start-date"],"endDate":[1,"end-date"],"hoverDate":[1,"hover-date"],"focusFirstFocusable":[64],"focusLastFocusable":[64],"focusCell":[64]},[[0,"keydown","handleKey"]],{"focusDate":["handleFocusDate"]}]]],["priv-chart-popover",[[0,"priv-chart-popover",{"open":[1028],"sliceDetails":[16]},[[4,"click","handleClickOnDocument"],[0,"click","handleClick"]],{"open":["handleOpenChange"],"sliceDetails":["handleDetailsChange"]}]]],["wm-option_2",[[17,"wm-select",{"disabled":[516],"maxHeight":[1,"max-height"],"label":[1025],"labelPosition":[1,"label-position"],"requiredField":[4,"required-field"],"errorMessage":[1025,"error-message"],"multiple":[4],"search":[4],"selectAll":[4,"select-all"],"placeholder":[1],"searchPlaceholder":[1,"search-placeholder"],"allSelectedMessage":[1,"all-selected-message"],"isExpanded":[32],"announcement":[32]},[[0,"wmOptionSelected","handleOptionSelection"],[0,"intCloneClicked","handleOptionCloneSelection"],[0,"wmEnterKeyPressed","handleChildEnter"],[0,"wmKeyUpPressed","handleChildUp"],[0,"wmKeyDownPressed","handleChildDown"],[0,"wmHomeKeyPressed","moveToFirstOption"],[0,"wmEndKeyPressed","moveToLastOption"],[0,"wmEscKeyPressed","closePopupOnEscape"],[0,"wmOptionBlurred","handleOptionBlur"],[6,"click","handleClick"],[0,"keydown","handleKey"],[0,"wmLetterPressed","findAndFocusOption"]],{"errorMessage":["announceError"],"disabled":["handleDisabledChange"]}],[1,"wm-option",{"value":[1],"subinfo":[1025],"disabled":[516],"selected":[516],"focused":[4],"searchTerm":[32]},[[0,"keydown","handleKeydown"],[0,"click","handleSelection"],[0,"blur","handleBlur"]],{"selected":["syncAriaSelected"],"disabled":["syncAriaDisabled","updateDisabledOnClick"]}]]],["wm-button",[[17,"wm-button",{"disabled":[516],"buttonType":[1025,"button-type"],"icon":[1537],"iconSize":[1,"icon-size"],"iconRotate":[2,"icon-rotate"],"iconFlip":[1,"icon-flip"],"tooltip":[1537],"labelForIdenticalButtons":[1,"label-for-identical-buttons"],"tooltipPosition":[1,"tooltip-position"],"permanentlyDelete":[4,"permanently-delete"],"textWrap":[4,"text-wrap"],"customBackground":[1,"custom-background"],"isSubmit":[4,"is-submit"],"isTabbing":[32]},[[8,"wmUserIsTabbing","toggleTabbingOn"],[8,"wmUserIsNotTabbing","toggleTabbingOff"],[11,"scroll","handleScroll"],[0,"keydown","handleKeydown"]],{"buttonType":["validateType"],"icon":["updateIcon"],"disabled":["handleDisabledChange"]}]]],["wm-action-menu_2",[[17,"wm-action-menu",{"tooltipPosition":[1,"tooltip-position"],"actionMenuType":[1,"action-menu-type"],"buttonText":[1,"button-text"],"disabled":[516],"tooltip":[1],"labelForIdenticalButtons":[1,"label-for-identical-buttons"],"darkMode":[4,"dark-mode"],"isExpanded":[32]},[[0,"wmMenuitemClicked","handleClickedItem"],[0,"wmKeyUpPressed","handleKeyUp"],[0,"wmKeyDownPressed","handleKeyDown"],[0,"wmHomeKeyPressed","handleHomeKey"],[0,"wmEndKeyPressed","handleEndKey"],[0,"wmTabKeyPressed","handleTabKey"],[0,"wmEscKeyPressed","handleEscKey"],[0,"keydown","handleKey"],[0,"wmMenuitemBlurred","handleMenuitemBlur"],[0,"wmLetterPressed","findAndFocusItem"]]],[1,"wm-menuitem",{"disabled":[4],"icon":[1025],"description":[1]},[[0,"keydown","handleKeydown"],[0,"click","handleClick"],[0,"blur","handleBlur"]],{"disabled":["setOnClick"]}]]]]'),e)}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,o){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function p(e){try{s(o.next(e))}catch(e){a(e)}}function i(e){try{s(o["throw"](e))}catch(e){a(e)}}function s(e){e.done?r(e.value):n(e.value).then(p,i)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,n,a,p;return p={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(p[Symbol.iterator]=function(){return this}),p;function i(e){return function(t){return s([e,t])}}function s(i){if(o)throw new TypeError("Generator is already executing.");while(p&&(p=0,i[0]&&(r=0)),r)try{if(o=1,n&&(a=i[0]&2?n["return"]:i[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;if(n=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;n=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1];a=i;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(i);break}if(a[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];n=0}finally{o=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,f as forceUpdate,h,H as Host,g as getElement}from"./index-558b5a82.js";import{g as generateId,d as debounce}from"./functions-46843ea0.js";import{a as allChartsDetails,h as handleChartKeydown,g as getDetails,r as removeSegmentInfoHighlight,b as renderSimpleBar,c as renderStackedBar,d as renderDoughnut,e as renderInstructionsText,f as renderLegend,i as renderHiddenValuesMessage,j as exitChart,k as amountToPercent}from"./chartFunctions-d3fd6e7c.js";import{c as chartMessages}from"./intl-8b8740b9.js";var wmChartCss=":host{--wmcolor-chart-label-text-negative:var(--wmcolor-text-negative);--wmcolor-chart-label-text-positive:var(--wmcolor-text-positive);--wmcolor-chart-label-text:var(--wmcolor-text);--wmcolor-chart-subinfo-text:var(--wmcolor-text);--wmcolor-chart-value-text:var(--wmcolor-text);display:block}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-size:0.875rem;position:relative;outline:none;}:host .component-wrapper:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}:host .component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:600;position:relative}:host .component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:var(--wmcolor-chart-subinfo-text)}:host .component-wrapper .label.custom-width{width:var(--custom-label-width)}:host .component-wrapper .label.--none{display:none}:host .component-wrapper .doughnut-svg,:host .component-wrapper .inner-stacked-bar-wrapper{overflow:visible}:host .component-wrapper .bar-wrapper{-ms-flex-positive:1;flex-grow:1;width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper{width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values{display:-ms-flexbox;display:flex;gap:2px;margin-bottom:8px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper{display:-ms-flexbox;display:flex;gap:2px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper .stacked-bar-segment{height:30px;cursor:pointer}:host .component-wrapper .segment{print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .segment.fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}:host .component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}:host .component-wrapper .value-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .component-wrapper .value-wrapper .fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .value-wrapper .value.hidden{visibility:hidden}:host .component-wrapper .faded{opacity:0.3}:host .component-wrapper path:active,:host .component-wrapper path:hover,:host .component-wrapper path:focus,:host .component-wrapper .stacked-bar-segment:active,:host .component-wrapper .stacked-bar-segment:hover,:host .component-wrapper .stacked-bar-segment:focus{outline:none}:host .component-wrapper .stacked-bar-segment:active.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.stacked-bar-segment:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper path:active.doughnut-segment:not(:focus-visible),:host .component-wrapper path:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper path:focus.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:active.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.doughnut-segment:not(:focus-visible){-webkit-filter:url(#wmHoverDropShadow);filter:url(#wmHoverDropShadow)}:host .component-wrapper path::-moz-focus-inner,:host .component-wrapper .stacked-bar-segment::-moz-focus-inner{border:0;outline:none}:host .component-wrapper .stacked-bar-segment:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper #kfbg1{stroke:white;stroke-width:10px}:host .component-wrapper #kfstroke{stroke:var(--wmcolor-interactive-focus);stroke-width:6px}:host .component-wrapper #kfbg2{stroke:white;stroke-width:2px}:host .component-wrapper.doughnut{width:300px}:host .component-wrapper.doughnut1 label,:host .component-wrapper.doughnut1 .label-text,:host .component-wrapper.doughnut2 label,:host .component-wrapper.doughnut2 .label-text,:host .component-wrapper.doughnut2b label,:host .component-wrapper.doughnut2b .label-text,:host .component-wrapper.doughnut3 label,:host .component-wrapper.doughnut3 .label-text{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper.doughnut{-ms-flex-align:center;align-items:center}:host .component-wrapper.doughnut label{text-align:center;width:100%;padding-bottom:1.5rem}:host .component-wrapper.doughnut label .subinfo{position:absolute}:host .component-wrapper.doughnut .completion-message{padding-top:0.625rem}:host .component-wrapper.bar{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .component-wrapper.bar label .subinfo{position:initial}:host .component-wrapper.bar .chart-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper.bar .chart-wrapper .single-perc{width:4rem;-ms-flex:none;flex:none;display:-ms-flexbox;display:flex;height:30px;-ms-flex-align:center;align-items:center}:host .component-wrapper.bar .chart-wrapper .inner-stacked-bar-wrapper{-ms-flex:1;flex:1}:host .component-wrapper.bar .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){:host .component-wrapper.bar{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;-ms-flex:none;flex:none}:host .component-wrapper.bar .bar-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .component-wrapper.bar .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;-ms-flex-pack:center;justify-content:center}}:host .component-wrapper.bar2,:host .component-wrapper.bar2b,:host .component-wrapper.bar3,:host .component-wrapper.bar4,:host .component-wrapper.bar5{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar2b .inner-stacked-bar-wrapper,:host .component-wrapper.bar4 .inner-stacked-bar-wrapper,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper{height:30px;margin-bottom:0}:host .component-wrapper.bar2b .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar4 .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper.show-values{height:60px;margin-top:0}:host .component-wrapper.bar3 .chart-wrapper{position:relative;height:100px}:host .component-wrapper.bar3 .chart-wrapper .inner-stacked-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}:host .component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;height:90px;width:100%;overflow:visible;-webkit-transform:translateY(90px);transform:translateY(90px)}:host .component-wrapper.bar3 .chart-wrapper .axis line{stroke:var(--wmcolor-chart-gridline);stroke-width:1px}:host .component-wrapper.bar3 .chart-wrapper .axis text{-webkit-transform:translate(4px, 24px);transform:translate(4px, 24px);text-anchor:middle}:host .component-wrapper.bar3 .hidden-values-warning{margin-top:1.25rem}:host .component-wrapper.bar6,:host .component-wrapper.bar7{--chartPadding:48px;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar6 .chart-wrapper,:host .component-wrapper.bar7 .chart-wrapper{width:100%}:host .component-wrapper.bar6 .chart,:host .component-wrapper.bar7 .chart{position:relative;padding-right:var(--chartPadding)}:host .component-wrapper.bar6 .gridlines,:host .component-wrapper.bar7 .gridlines{position:absolute;left:var(--labelWidth);right:var(--chartPadding);top:0;bottom:0;background-image:linear-gradient(90deg, var(--wmcolor-chart-gridline) 1px, transparent 1px);background-position:-1px;border-left:1px solid var(--wmcolor-chart-gridline);border-bottom:1px solid var(--wmcolor-chart-gridline);background-size:var(--backgroundSize)}:host .component-wrapper.bar6 .rows,:host .component-wrapper.bar7 .rows{display:grid;grid-template-columns:var(--labelWidth) auto;grid-auto-rows:minmax(30px, 1fr);-ms-flex-align:center;align-items:center;position:relative;z-index:1}:host .component-wrapper.bar6 .rows .label,:host .component-wrapper.bar7 .rows .label{font-weight:400;padding:0 0.75rem 0 0;text-align:right;margin:0.75rem 0}:host .component-wrapper.bar6 .rows .label.hidden,:host .component-wrapper.bar7 .rows .label.hidden{visibility:hidden;white-space:nowrap}:host .component-wrapper.bar6 .bar,:host .component-wrapper.bar7 .bar{height:30px;position:relative}:host .component-wrapper.bar6 .bar .value,:host .component-wrapper.bar7 .bar .value{position:absolute;top:50%;right:-0.5rem;-webkit-transform:translate(100%, -50%);transform:translate(100%, -50%)}:host .component-wrapper.bar6 .x-axis,:host .component-wrapper.bar7 .x-axis{margin-left:var(--labelWidth);margin-right:var(--chartPadding);display:-ms-flexbox;display:flex;postion:relative}:host .component-wrapper.bar6 .tick,:host .component-wrapper.bar7 .tick{-ms-flex:1;flex:1;text-align:right}:host .component-wrapper.bar6 .tick span,:host .component-wrapper.bar7 .tick span{-webkit-transform:translateX(50%);transform:translateX(50%);display:inline-block}:host .component-wrapper.bar6 .zero,:host .component-wrapper.bar7 .zero{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%)}:host .component-wrapper.bar6 .bar:active,:host .component-wrapper.bar6 .bar:hover,:host .component-wrapper.bar6 .bar:focus,:host .component-wrapper.bar7 .bar:active,:host .component-wrapper.bar7 .bar:hover,:host .component-wrapper.bar7 .bar:focus{outline:none}:host .component-wrapper.bar6 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:focus.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:focus.bar:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper.bar6 .bar:focus-visible,:host .component-wrapper.bar7 .bar:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper.left-label{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;-ms-flex:none;flex:none;-ms-flex-item-align:end;align-self:flex-end;min-height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .component-wrapper .hidden-values-warning{font-size:0.75rem;font-style:italic;max-width:100%}:host .component-wrapper .hidden-values-warning.hidden{display:none}@media print{:host .component-wrapper .hidden-values-warning{display:none}}:host #chart-instructions{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .component-wrapper .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .component-wrapper .legend-wrapper .legend.bar6{display:none}:host .component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .component-wrapper .legend-wrapper .legend .legend-item{position:relative}:host .component-wrapper .legend-wrapper .legend .legend-item.faded{opacity:0.3}:host .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .component-wrapper .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem;print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .legend-wrapper .legend .print-value{display:none}:host .component-wrapper .legend-wrapper .legend .print-value.force-visible{display:unset}@media print{:host .component-wrapper .legend-wrapper .legend .print-value{display:unset}}:host .component-wrapper .legend-wrapper .legend.bar3{padding-bottom:1.25rem}";var Chart=function(){function e(e){var t=this;registerInstance(this,e);this.uid=generateId();this.slicesDetails=[];this.debouncedSliceUpdate=debounce((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,getDetails.call(this,this.currentChartType)];case 1:e.sent();forceUpdate(this.el);return[2]}}))}))}),100);this.chartType="doughnut1";this.label=undefined;this.labelWidth="150px";this.subinfo=undefined;this.valueFormat="none";this.showGrid=true;this.showLegend=true;this.showBarLegend=false;this.notStartedColor=false;this.printMode=false;this.printModeFormat="amount";this.labelPosition="top";this.isTabbing=false;this.userIsNavigating=false;this.focusedSliceId=undefined}Object.defineProperty(e.prototype,"popoverEl",{get:function(){return this.el.shadowRoot.querySelector("priv-chart-popover")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"sliceEls",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll(".segment"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"currentChartType",{get:function(){var e=this.chartType;if(this.chartType==="doughnut2"&&this.el.children.length>3){e="doughnut2b"}else if(this.chartType==="bar2"&&this.el.children.length>4){e="bar2b"}return e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartDetails",{get:function(){return allChartsDetails[this.currentChartType]},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ariaLabelText",{get:function(){var e="".concat(this.label);if(this.subinfo){e+=" ".concat(this.subinfo)}return e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDoughnut",{get:function(){return this.chartDetails.category==="doughnut"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isStackedBar",{get:function(){return this.chartDetails.category==="stackedBar"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isSimpleBar",{get:function(){return this.chartDetails.category==="simpleBar"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBar",{get:function(){return this.isStackedBar||this.isSimpleBar},enumerable:false,configurable:true});e.prototype.toggleTabbingOn=function(){this.isTabbing=true};e.prototype.toggleTabbingOff=function(){this.isTabbing=false};e.prototype.handleKeydown=function(e){handleChartKeydown.call(this,e)};e.prototype.showHiddenValuesMessage=function(e){var t=this;var r=this.el.shadowRoot.querySelector(".hidden-values-warning");if(r){e?r.classList.remove("hidden"):r.classList.add("hidden")}else{requestAnimationFrame((function(){return t.showHiddenValuesMessage(e)}))}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(r){switch(r.label){case 0:if(!this.label){throw new Error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.")}return[4,getDetails.call(this,this.currentChartType)];case 1:r.sent();if(!this.isDoughnut){e=new ResizeObserver((function(){forceUpdate(t.el)}));e.observe(this.el)}return[2]}}))}))};e.prototype.handleSliceUpdate=function(){this.debouncedSliceUpdate()};e.prototype.handlePopoverOpenChanged=function(e){var t=e.detail;if(!t){var r=Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex]"));removeSegmentInfoHighlight(r)}};e.prototype.renderBarText=function(e,t){var r;if(this.valueFormat==="percentage"){r=e.perc===0&&e.amount>0?"<1%":"".concat(e.perc,"%")}else if(this.valueFormat==="amount"){r=e.amount}var o=amountToPercent(e.amount,this.total,false);var n=this.el.offsetWidth;var a=o/100*n>=t;var p=a||e.amount==0?"".concat(o,"%"):"".concat(t,"px");return h("div",{class:"value-wrapper ".concat(a?"":"fixed-width"),style:{width:p}},h("span",{class:"value","data-value":e.amount,"data-segmentindex":e.index},e.amount>0&&r))};e.prototype.drawAxis=function(){if(this.currentChartType==="bar3"){return h("svg",{class:"axis"},h("line",{x1:"0",x2:"100%",y1:"0",y2:"0"}),h("line",{x1:"0",x2:"0",y1:"0",y2:"-85px"}),h("line",{class:"tick",x1:"0.5",x2:"0.5",y1:"0",y2:"6"}),h("text",{x:"0.5",y:"-6"},"0%"),h("line",{class:"tick",x1:"100%",x2:"100%",y1:"0",y2:"6"}),h("text",{x:"100%",y:"-6"},"100%"))}};e.prototype.renderChart=function(){if(this.isSimpleBar){return renderSimpleBar.call(this,this.currentChartType)}else if(this.isStackedBar&&this.total>0){return renderStackedBar.call(this,this.currentChartType)}else if(this.isDoughnut&&this.total>0){return renderDoughnut.call(this,this.currentChartType)}};e.prototype.render=function(){var e=this;return h(Host,{onBlur:function(){return exitChart.call(e)}},h("div",{ref:function(t){return e.componentWrapperEl=t},class:"component-wrapper ".concat(this.currentChartType," ").concat(this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""," ").concat(this.labelPosition==="left"&&this.currentChartType==="bar4"?"left-label":""),role:"application","aria-label":this.ariaLabelText,tabindex:0,"aria-roledescription":chartMessages.interactiveChart,"aria-describedby":"chart-instructions"},h("label",{id:"label-".concat(this.uid),class:"label --".concat(this.labelPosition),htmlFor:"graphic-".concat(this.uid)},h("span",{class:"label-text"},this.label),this.subinfo?h("span",{class:"subinfo"},this.subinfo):""),this.isBar&&renderLegend.call(this,this.currentChartType),this.renderChart(),this.isDoughnut&&renderLegend.call(this,this.currentChartType),h("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":"",onIntChartPopoverOpenChanged:function(t){return e.handlePopoverOpenChanged(t)}}),this.isBar&&!this.printMode&&renderHiddenValuesMessage()),renderInstructionsText())};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Chart.style=wmChartCss;export{Chart as wm_chart};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,o){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function p(e){try{s(o.next(e))}catch(e){a(e)}}function i(e){try{s(o["throw"](e))}catch(e){a(e)}}function s(e){e.done?r(e.value):n(e.value).then(p,i)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,n,a,p;return p={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(p[Symbol.iterator]=function(){return this}),p;function i(e){return function(t){return s([e,t])}}function s(i){if(o)throw new TypeError("Generator is already executing.");while(p&&(p=0,i[0]&&(r=0)),r)try{if(o=1,n&&(a=i[0]&2?n["return"]:i[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;if(n=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;n=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1];a=i;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(i);break}if(a[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];n=0}finally{o=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,f as forceUpdate,h,H as Host,g as getElement}from"./index-558b5a82.js";import{g as generateId,d as debounce}from"./functions-46843ea0.js";import{a as allChartsDetails,h as handleChartKeydown,g as getDetails,r as removeSegmentInfoHighlight,b as renderSimpleBar,c as renderStackedBar,d as renderDoughnut,e as renderInstructionsText,f as renderLegend,i as renderHiddenValuesMessage,j as exitChart,k as amountToPercent}from"./chartFunctions-0ebf83f3.js";import{c as chartMessages}from"./intl-8b8740b9.js";var wmChartCss=":host{--wmcolor-chart-label-text-negative:var(--wmcolor-text-negative);--wmcolor-chart-label-text-positive:var(--wmcolor-text-positive);--wmcolor-chart-label-text:var(--wmcolor-text);--wmcolor-chart-subinfo-text:var(--wmcolor-text);--wmcolor-chart-value-text:var(--wmcolor-text);display:block}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-size:0.875rem;position:relative;outline:none;}:host .component-wrapper:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}:host .component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:600;position:relative}:host .component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:var(--wmcolor-chart-subinfo-text)}:host .component-wrapper .label.custom-width{width:var(--custom-label-width)}:host .component-wrapper .label.--none{display:none}:host .component-wrapper .doughnut-svg,:host .component-wrapper .inner-stacked-bar-wrapper{overflow:visible}:host .component-wrapper .bar-wrapper{-ms-flex-positive:1;flex-grow:1;width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper{width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values{display:-ms-flexbox;display:flex;gap:2px;margin-bottom:8px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper{display:-ms-flexbox;display:flex;gap:2px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper .stacked-bar-segment{height:30px;cursor:pointer}:host .component-wrapper .segment{print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .segment.fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}:host .component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}:host .component-wrapper .value-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .component-wrapper .value-wrapper .fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .value-wrapper .value.hidden{visibility:hidden}:host .component-wrapper .faded{opacity:0.3}:host .component-wrapper path:active,:host .component-wrapper path:hover,:host .component-wrapper path:focus,:host .component-wrapper .stacked-bar-segment:active,:host .component-wrapper .stacked-bar-segment:hover,:host .component-wrapper .stacked-bar-segment:focus{outline:none}:host .component-wrapper .stacked-bar-segment:active.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.stacked-bar-segment:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper path:active.doughnut-segment:not(:focus-visible),:host .component-wrapper path:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper path:focus.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:active.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.doughnut-segment:not(:focus-visible){-webkit-filter:url(#wmHoverDropShadow);filter:url(#wmHoverDropShadow)}:host .component-wrapper path::-moz-focus-inner,:host .component-wrapper .stacked-bar-segment::-moz-focus-inner{border:0;outline:none}:host .component-wrapper .stacked-bar-segment:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper #kfbg1{stroke:white;stroke-width:10px}:host .component-wrapper #kfstroke{stroke:var(--wmcolor-interactive-focus);stroke-width:6px}:host .component-wrapper #kfbg2{stroke:white;stroke-width:2px}:host .component-wrapper.doughnut{width:300px}:host .component-wrapper.doughnut1 label,:host .component-wrapper.doughnut1 .label-text,:host .component-wrapper.doughnut2 label,:host .component-wrapper.doughnut2 .label-text,:host .component-wrapper.doughnut3 label,:host .component-wrapper.doughnut3 .label-text{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper.doughnut{-ms-flex-align:center;align-items:center}:host .component-wrapper.doughnut label{text-align:center;width:100%;padding-bottom:1.5rem}:host .component-wrapper.doughnut label .subinfo{position:absolute}:host .component-wrapper.doughnut .completion-message{padding-top:0.625rem}:host .component-wrapper.bar{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .component-wrapper.bar label .subinfo{position:initial}:host .component-wrapper.bar .chart-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper.bar .chart-wrapper .single-perc{width:4rem;-ms-flex:none;flex:none;display:-ms-flexbox;display:flex;height:30px;-ms-flex-align:center;align-items:center}:host .component-wrapper.bar .chart-wrapper .inner-stacked-bar-wrapper{-ms-flex:1;flex:1}:host .component-wrapper.bar .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){:host .component-wrapper.bar{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;-ms-flex:none;flex:none}:host .component-wrapper.bar .bar-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .component-wrapper.bar .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;-ms-flex-pack:center;justify-content:center}}:host .component-wrapper.bar2,:host .component-wrapper.bar3,:host .component-wrapper.bar4,:host .component-wrapper.bar5{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar4 .inner-stacked-bar-wrapper,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper{height:30px;margin-bottom:0}:host .component-wrapper.bar4 .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper.show-values{height:60px;margin-top:0}:host .component-wrapper.bar3 .chart-wrapper{position:relative;height:100px}:host .component-wrapper.bar3 .chart-wrapper .inner-stacked-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}:host .component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;height:90px;width:100%;overflow:visible;-webkit-transform:translateY(90px);transform:translateY(90px)}:host .component-wrapper.bar3 .chart-wrapper .axis line{stroke:var(--wmcolor-chart-gridline);stroke-width:1px}:host .component-wrapper.bar3 .chart-wrapper .axis text{-webkit-transform:translate(4px, 24px);transform:translate(4px, 24px);text-anchor:middle}:host .component-wrapper.bar3 .hidden-values-warning{margin-top:1.25rem}:host .component-wrapper.bar6,:host .component-wrapper.bar7{--chartPadding:48px;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar6 .chart-wrapper,:host .component-wrapper.bar7 .chart-wrapper{width:100%}:host .component-wrapper.bar6 .chart,:host .component-wrapper.bar7 .chart{position:relative;padding-right:var(--chartPadding)}:host .component-wrapper.bar6 .gridlines,:host .component-wrapper.bar7 .gridlines{position:absolute;left:var(--labelWidth);right:var(--chartPadding);top:0;bottom:0;background-image:linear-gradient(90deg, var(--wmcolor-chart-gridline) 1px, transparent 1px);background-position:-1px;border-left:1px solid var(--wmcolor-chart-gridline);border-bottom:1px solid var(--wmcolor-chart-gridline);background-size:var(--backgroundSize)}:host .component-wrapper.bar6 .rows,:host .component-wrapper.bar7 .rows{display:grid;grid-template-columns:var(--labelWidth) auto;grid-auto-rows:minmax(30px, 1fr);-ms-flex-align:center;align-items:center;position:relative;z-index:1}:host .component-wrapper.bar6 .rows .label,:host .component-wrapper.bar7 .rows .label{font-weight:400;padding:0 0.75rem 0 0;text-align:right;margin:0.75rem 0}:host .component-wrapper.bar6 .rows .label.hidden,:host .component-wrapper.bar7 .rows .label.hidden{visibility:hidden;white-space:nowrap}:host .component-wrapper.bar6 .bar,:host .component-wrapper.bar7 .bar{height:30px;position:relative}:host .component-wrapper.bar6 .bar .value,:host .component-wrapper.bar7 .bar .value{position:absolute;top:50%;right:-0.5rem;-webkit-transform:translate(100%, -50%);transform:translate(100%, -50%)}:host .component-wrapper.bar6 .x-axis,:host .component-wrapper.bar7 .x-axis{margin-left:var(--labelWidth);margin-right:var(--chartPadding);display:-ms-flexbox;display:flex;postion:relative}:host .component-wrapper.bar6 .tick,:host .component-wrapper.bar7 .tick{-ms-flex:1;flex:1;text-align:right}:host .component-wrapper.bar6 .tick span,:host .component-wrapper.bar7 .tick span{-webkit-transform:translateX(50%);transform:translateX(50%);display:inline-block}:host .component-wrapper.bar6 .zero,:host .component-wrapper.bar7 .zero{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%)}:host .component-wrapper.bar6 .bar:active,:host .component-wrapper.bar6 .bar:hover,:host .component-wrapper.bar6 .bar:focus,:host .component-wrapper.bar7 .bar:active,:host .component-wrapper.bar7 .bar:hover,:host .component-wrapper.bar7 .bar:focus{outline:none}:host .component-wrapper.bar6 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:focus.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:focus.bar:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper.bar6 .bar:focus-visible,:host .component-wrapper.bar7 .bar:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper.left-label{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;-ms-flex:none;flex:none;-ms-flex-item-align:end;align-self:flex-end;min-height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .component-wrapper .hidden-values-warning{font-size:0.75rem;font-style:italic;max-width:100%}:host .component-wrapper .hidden-values-warning.hidden{display:none}@media print{:host .component-wrapper .hidden-values-warning{display:none}}:host #chart-instructions{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .component-wrapper .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .component-wrapper .legend-wrapper .legend.bar6{display:none}:host .component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .component-wrapper .legend-wrapper .legend .legend-item{position:relative}:host .component-wrapper .legend-wrapper .legend .legend-item.faded{opacity:0.3}:host .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .component-wrapper .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem;print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .legend-wrapper .legend .print-value{display:none}:host .component-wrapper .legend-wrapper .legend .print-value.force-visible{display:unset}@media print{:host .component-wrapper .legend-wrapper .legend .print-value{display:unset}}:host .component-wrapper .legend-wrapper .legend.bar3{padding-bottom:1.25rem}";var Chart=function(){function e(e){var t=this;registerInstance(this,e);this.uid=generateId();this.slicesDetails=[];this.debouncedSliceUpdate=debounce((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,getDetails.call(this,this.currentChartType)];case 1:e.sent();forceUpdate(this.el);return[2]}}))}))}),100);this.chartType="doughnut1";this.label=undefined;this.labelWidth="150px";this.subinfo=undefined;this.valueFormat="none";this.showGrid=true;this.showLegend=true;this.showBarLegend=false;this.notStartedColor=false;this.printMode=false;this.printModeFormat="amount";this.labelPosition="top";this.isTabbing=false;this.userIsNavigating=false;this.focusedSliceId=undefined}Object.defineProperty(e.prototype,"popoverEl",{get:function(){return this.el.shadowRoot.querySelector("priv-chart-popover")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"sliceEls",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll(".segment"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"currentChartType",{get:function(){return this.chartType},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartDetails",{get:function(){return allChartsDetails[this.currentChartType]},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ariaLabelText",{get:function(){var e="".concat(this.label);if(this.subinfo){e+=" ".concat(this.subinfo)}return e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDoughnut",{get:function(){return this.chartDetails.category==="doughnut"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isStackedBar",{get:function(){return this.chartDetails.category==="stackedBar"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isSimpleBar",{get:function(){return this.chartDetails.category==="simpleBar"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBar",{get:function(){return this.isStackedBar||this.isSimpleBar},enumerable:false,configurable:true});e.prototype.toggleTabbingOn=function(){this.isTabbing=true};e.prototype.toggleTabbingOff=function(){this.isTabbing=false};e.prototype.handleKeydown=function(e){handleChartKeydown.call(this,e)};e.prototype.showHiddenValuesMessage=function(e){var t=this;var r=this.el.shadowRoot.querySelector(".hidden-values-warning");if(r){e?r.classList.remove("hidden"):r.classList.add("hidden")}else{requestAnimationFrame((function(){return t.showHiddenValuesMessage(e)}))}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(r){switch(r.label){case 0:if(!this.label){throw new Error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.")}return[4,getDetails.call(this,this.currentChartType)];case 1:r.sent();if(!this.isDoughnut){e=new ResizeObserver((function(){forceUpdate(t.el)}));e.observe(this.el)}return[2]}}))}))};e.prototype.handleSliceUpdate=function(){this.debouncedSliceUpdate()};e.prototype.handlePopoverOpenChanged=function(e){var t=e.detail;if(!t){var r=Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex]"));removeSegmentInfoHighlight(r)}};e.prototype.renderBarText=function(e,t){var r;if(this.valueFormat==="percentage"){r=e.perc===0&&e.amount>0?"<1%":"".concat(e.perc,"%")}else if(this.valueFormat==="amount"){r=e.amount}var o=amountToPercent(e.amount,this.total,false);var n=this.el.offsetWidth;var a=o/100*n>=t;var p=a||e.amount==0?"".concat(o,"%"):"".concat(t,"px");return h("div",{class:"value-wrapper ".concat(a?"":"fixed-width"),style:{width:p}},h("span",{class:"value","data-value":e.amount,"data-segmentindex":e.index},e.amount>0&&r))};e.prototype.drawAxis=function(){if(this.currentChartType==="bar3"){return h("svg",{class:"axis"},h("line",{x1:"0",x2:"100%",y1:"0",y2:"0"}),h("line",{x1:"0",x2:"0",y1:"0",y2:"-85px"}),h("line",{class:"tick",x1:"0.5",x2:"0.5",y1:"0",y2:"6"}),h("text",{x:"0.5",y:"-6"},"0%"),h("line",{class:"tick",x1:"100%",x2:"100%",y1:"0",y2:"6"}),h("text",{x:"100%",y:"-6"},"100%"))}};e.prototype.renderChart=function(){if(this.isSimpleBar){return renderSimpleBar.call(this,this.currentChartType)}else if(this.isStackedBar&&this.total>0){return renderStackedBar.call(this,this.currentChartType)}else if(this.isDoughnut&&this.total>0){return renderDoughnut.call(this,this.currentChartType)}};e.prototype.render=function(){var e=this;return h(Host,{onBlur:function(){return exitChart.call(e)}},h("div",{ref:function(t){return e.componentWrapperEl=t},class:"component-wrapper ".concat(this.currentChartType," ").concat(this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""," ").concat(this.labelPosition==="left"&&this.currentChartType==="bar4"?"left-label":""),role:"application","aria-label":this.ariaLabelText,tabindex:0,"aria-roledescription":chartMessages.interactiveChart,"aria-describedby":"chart-instructions"},h("label",{id:"label-".concat(this.uid),class:"label --".concat(this.labelPosition),htmlFor:"graphic-".concat(this.uid)},h("span",{class:"label-text"},this.label),this.subinfo?h("span",{class:"subinfo"},this.subinfo):""),this.isBar&&renderLegend.call(this,this.currentChartType),this.renderChart(),this.isDoughnut&&renderLegend.call(this,this.currentChartType),h("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":"",onIntChartPopoverOpenChanged:function(t){return e.handlePopoverOpenChanged(t)}}),this.isBar&&!this.printMode&&renderHiddenValuesMessage()),renderInstructionsText())};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Chart.style=wmChartCss;export{Chart as wm_chart};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,r,i){function a(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function s(t){try{l(i["throw"](t))}catch(t){n(t)}}function l(t){t.done?r(t.value):a(t.value).then(o,s)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,a,n,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return l([t,e])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(i=1,a&&(n=s[0]&2?a["return"]:s[0]?a["throw"]||((n=a["return"])&&n.call(a),0):a.next)&&!(n=n.call(a,s[1])).done)return n;if(a=0,n)s=[s[0]&2,n.value];switch(s[0]){case 0:case 1:n=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!n||s[1]>n[0]&&s[1]<n[3])){r.label=s[1];break}if(s[0]===6&&r.label<n[1]){r.label=n[1];n=s;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(s);break}if(n[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];a=0}finally{i=n=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,j as dateToISO,a as handleDisabledAttribute,k as shouldOpenUp,A as getContextMeasurements,B as dateFind,C as calendar_months,D as findParentWithHiddenOverflow,i as intl}from"./functions-46843ea0.js";var datepickerCss=':host{--wmcolor-datepicker-background:var(--wmcolor-background);--wmcolor-datepicker-day-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-day-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-day-text-outside:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-day-text-selected:var(--wmcolor-interactive-text-selected);--wmcolor-datepicker-day-text:var(--wmcolor-text);--wmcolor-datepicker-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-input-background:var(--wmcolor-input-background);--wmcolor-datepicker-input-border:var(--wmcolor-input-border);--wmcolor-datepicker-input-text-disabled:var(--wmcolor-input-text-disabled);--wmcolor-datepicker-input-text:var(--wmcolor-input-text);--wmcolor-datepicker-month-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-month-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-month-background:var(--wmcolor-text);--wmcolor-datepicker-month-border:var(--wmcolor-border-light);--wmcolor-datepicker-month-text-selected:var(--wmcolor-text-ondark);--wmcolor-datepicker-month-text:var(--wmcolor-interactive);--wmcolor-datepicker-navigation-background-hover:var(--wmcolor-button-background-navigational-hover);--wmcolor-datepicker-navigation-background:var(--wmcolor-button-background-navigational);--wmcolor-datepicker-navigation-text:var(--wmcolor-button-icon-navigational);--wmcolor-datepicker-selector-background:var(--wmcolor-button-background-secondary);--wmcolor-datepicker-selector-border:var(--wmcolor-button-border-secondary);--wmcolor-datepicker-selector-text:var(--wmcolor-button-text-secondary);--wmcolor-datepicker-toggle-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-toggle-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-toggle-background:var(--wmcolor-input-background);--wmcolor-datepicker-toggle-icon-disabled:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-toggle-icon:var(--wmcolor-interactive);--wmcolor-datepicker-weekdays-background:var(--wmcolor-table-header-background);--wmcolor-datepicker-weekdays-text:var(--wmcolor-text);font-family:inherit}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{position:relative}:host .wrapper .single-wrapper,:host .wrapper .range-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .date-input{border-radius:3px;color:var(--wmcolor-datepicker-input-text);font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;-ms-flex:1;flex:1;margin:0;background-color:var(--wmcolor-datepicker-input-background)}:host .wrapper .date-input:disabled{background-color:var(--wmcolor-datepicker-input-background-disabled);color:var(--wmcolor-datepicker-input-text-disabled)}:host .wrapper .date-input:focus{outline:none}:host .wrapper .input{height:2.5rem;border:1px solid var(--wmcolor-datepicker-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;}:host .wrapper #single-date-input{height:100%;border:none;border-radius:3px;-webkit-margin-end:3px;margin-inline-end:3px}:host .wrapper .range-wrapper{max-width:257px;display:grid;grid-template-rows:minmax(21px, 1fr) 38px;grid-template-columns:120px 17px 120px;grid-template-areas:"start-label-wrapper . end-label-wrapper" "start-date-input hyphen end-date-input"}:host .wrapper .range-wrapper #start-label-wrapper{grid-area:start-label-wrapper}:host .wrapper .range-wrapper #end-label-wrapper{grid-area:end-label-wrapper}:host .wrapper .range-wrapper #start-date-input{grid-area:start-date-input}:host .wrapper .range-wrapper #hyphen{grid-area:hyphen}:host .wrapper .range-wrapper #end-date-input{grid-area:end-date-input}:host .wrapper .range-wrapper .label{text-wrap:wrap}:host .wrapper .range-wrapper.cal{max-width:305px;-webkit-column-gap:4px;-moz-column-gap:4px;column-gap:4px;grid-template-columns:120px 17px 120px 36px;grid-template-areas:"start-label-wrapper . end-label-wrapper ." "start-date-input hyphen end-date-input toggle-wrapper"}:host .wrapper .range-wrapper.cal #toggle-wrapper{grid-area:toggle-wrapper}:host .wrapper #start-date-input,:host .wrapper #end-date-input{max-width:120px}:host .wrapper #start-date-input:focus,:host .wrapper #end-date-input:focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper.invalid .input,:host .wrapper .date-input.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:4px;top:100%;left:0}:host .wrapper .error:not(:empty){margin-top:0.25rem}:host .wrapper.focus #single-date-input{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var DateRange=function(){function t(t){registerInstance(this,t);this.wmRangeSelection=createEvent(this,"wmRangeSelection",7);this.wmStartInputBlur=createEvent(this,"wmStartInputBlur",7);this.wmEndInputBlur=createEvent(this,"wmEndInputBlur",7);this.openUp=false;this.calWidth=681;this.popupClicked=false;this.toggleButtonClicked=false;this.formats={"mm/dd/yyyy":"US","dd/mm/yyyy":"INT","yyyy/mm/dd":"ISO"};this.dateFormat="mm/dd/yyyy";this.disabled=false;this.errorMessage=undefined;this.invalidStart=false;this.invalidEnd=false;this.labelStart="";this.labelEnd="";this.preselected=undefined;this.requiredField=false;this.valueStart="";this.valueEnd="";this.availSpace=0;this.isExpanded=false}Object.defineProperty(t.prototype,"_disabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focusDates",{get:function(){var t=this.toISO(this.valueStart);var e=dateToISO(new Date);if(this._isValidISO(t)){e=t}else if(this.preselected&&this._isValidISO(this.preselected)){e=this.preselected}var r=this.toJSDate(e);if(r.getUTCMonth()==11){r.setYear(r.getUTCFullYear()+1)}r.setMonth((r.getUTCMonth()+1)%12,1);var i=dateToISO(r);var a=this.toISO(this.valueEnd);if(this._isValidISO(a)){var n=this.isSameMonth(e,a);if(!n){i=a;if(!t){var o=this.toJSDate(i);var s=o.getUTCMonth()-1;if(s==-1){s=11;o.setYear(o.getUTCFullYear()-1)}o.setMonth(s,1);e=dateToISO(o)}}}return[e,i]},enumerable:false,configurable:true});t.prototype.isSameMonth=function(t,e){if(t&&e){return t.slice(0,-3)===e.slice(0,-3)}else{return false}};t.prototype.toJSDate=function(t){if(t&&this._isValidISO(t)){var e=new Date;e.setUTCFullYear(parseInt(t.split("-")[0]),parseInt(t.split("-")[1])-1,parseInt(t.split("-")[2]));return e}else{return undefined}};t.prototype.toISO=function(t){return this._reformatDate(this.formats[this.dateFormat],"ISO",t)};t.prototype.handleDisabled=function(){handleDisabledAttribute(this.el,this._disabled)};t.prototype.updateValueStart=function(){this.startInputEl.value=this.valueStart?this.valueStart:""};t.prototype.updateValueEnd=function(){this.endInputEl.value=this.valueEnd?this.valueEnd:""};t.prototype.handleErrorMessage=function(){var t=this;if(this.errorMessage){setTimeout((function(){return t.announce(t.errorMessage)}),100)}};t.prototype.togglePopup=function(){this.isExpanded?this.closePopup():this.openPopup();this.toggleButtonClicked=true};t.prototype.closePopup=function(t){var e=this;if(t===void 0){t=false}this.date1=undefined;this.date2=undefined;this.startCalEl.startDate=undefined;this.startCalEl.endDate=undefined;this.startCalEl.hoverDate=undefined;this.endCalEl.startDate=undefined;this.endCalEl.endDate=undefined;this.endCalEl.hoverDate=undefined;this.isExpanded=false;this.startCalEl.view="day";this.endCalEl.view="day";this.popupEl.classList.remove("open");window.setTimeout((function(){e.popupEl.style.visibility="hidden"}),250);if(t){this.toggleEl.focus()}};t.prototype.openPopup=function(){var t=this;this.openUp=shouldOpenUp(this.el,this.popupEl.clientHeight,this.labelEl.clientHeight);var e=getContextMeasurements(this.el),r=e.spaceLeft,i=e.spaceRight;if(i>=this.calWidth-this.el.clientWidth){this.popupEl.style.left="0";this.popupEl.style.right="auto"}else if(r>=this.calWidth-this.el.clientWidth){this.popupEl.style.right="0";this.popupEl.style.left="auto"}else{var a=(this.availSpace-this.calWidth)/2-r;this.popupEl.style.left="".concat(a,"px");this.popupEl.style.right="auto"}this.popupEl.style.visibility="visible";window.requestAnimationFrame((function(){t.popupEl.classList.add("open")}));this.isExpanded=true;this.startCalEl.focusDate=this.focusDates[0];this.endCalEl.focusDate=this.focusDates[1];this.startCalEl.focusCell();if(this.valueStart){var n=this.toISO(this.valueStart);if(this._isValidISO(n)){this.startCalEl.startDate=n}if(this.valueEnd){var o=this.toISO(this.valueEnd);if(this._isValidISO(o)){if(this.isSameMonth(n,o)){this.startCalEl.endDate=o}else{this.endCalEl.endDate=o}}}}};t.prototype.handleFocus=function(){this.wrapperEl.classList.add("focus")};t.prototype.handleBlur=function(){this.wrapperEl.classList.remove("focus")};t.prototype.handleStartInputBlur=function(){this.wmStartInputBlur.emit()};t.prototype.handleEndInputBlur=function(){this.wmEndInputBlur.emit()};t.prototype.handleStartInput=function(t){this.valueStart=t.target.value};t.prototype.handleEndInput=function(t){this.valueEnd=t.target.value};t.prototype.handleKey=function(t){switch(t.key){case"Escape":t.preventDefault();t.stopPropagation();this.closePopup(true);break}};t.prototype.blurHandler=function(){if(!this.popupClicked&&!this.toggleButtonClicked&&this.isExpanded){this.closePopup()}this.popupClicked=false;this.toggleButtonClicked=false};t.prototype.handleBlurOnWindow=function(){if(this.isExpanded){this.closePopup()}};t.prototype.handleDateFocus=function(t){var e=t.target;var r=e.focusDate;var i=this.startCalEl.focusDate.slice(0,-3);var a=this.endCalEl.focusDate.slice(0,-3);if(e==this.startCalEl){if(i>=a){this.endCalEl.focusDate=dateFind.month.increase(this.startCalEl.focusDate,1)}}else if(e==this.endCalEl){if(a<=i){this.startCalEl.focusDate=dateFind.month.decrease(this.endCalEl.focusDate,1)}}if(this.oldFocusVal){var n=dateFind.year.asInt(r);var o=dateFind.year.asInt(this.oldFocusVal);var s=dateFind.month.asInt(r);var l=dateFind.month.asInt(this.oldFocusVal);if(e.view==="day"){if(n!=o||s!=l){this.liveRegionEl.innerHTML="Viewing ".concat(calendar_months[s-1],", ").concat(n)}}else{if(n!=o){this.liveRegionEl.innerHTML="".concat(n," selected.")}else if(s!=l){this.liveRegionEl.innerHTML="".concat(calendar_months[s-1],", ").concat(n)}}}this.oldFocusVal=e.focusDate};t.prototype.handlePopupBlurred=function(t){if(t.detail.relatedTarget!==this.el){var e=new CustomEvent("blur");e.relatedTarget=t.detail.relatedTarget;this.el.dispatchEvent(e)}};t.prototype.handleCellTriggered=function(t){var e=t.detail.cal;var r=t.detail.cell;var i=r.getAttribute("data-year")+"-"+r.getAttribute("data-month")+"-"+r.textContent.padStart(2,"0");if(this.startCalEl.endDate||this.endCalEl.endDate){this.startCalEl.startDate=undefined;this.startCalEl.endDate=undefined;this.endCalEl.startDate=undefined;this.endCalEl.endDate=undefined;e.startDate=i;this.date1=i;this.date2=undefined}else if(this.date1&&i!==this.date1){if(this.date1>i){this.date2=this.date1;this.date1=i}else{this.date2=i}var a={startDate:{iso:this.date1,us:this._reformatDate("ISO","US",this.date1),int:this._reformatDate("ISO","INT",this.date1)},endDate:{iso:this.date2,us:this._reformatDate("ISO","US",this.date2),int:this._reformatDate("ISO","INT",this.date2)}};this.wmRangeSelection.emit(a);this.closePopup(true);this.date1=undefined;this.date2=undefined}else{e.startDate=i;this.date1=i}var n=new CustomEvent("input");this.el.dispatchEvent(n);var o=new CustomEvent("change");this.el.dispatchEvent(o)};t.prototype.handleOutOfCal=function(){this.startCalEl.hoverDate=undefined;this.endCalEl.hoverDate=undefined};t.prototype.handleCellHovered=function(t){this.startCalEl.hoverDate=this.startCalEl.startDate===t.detail?undefined:t.detail;this.endCalEl.hoverDate=this.endCalEl.startDate===t.detail?undefined:t.detail};t.prototype.reformatDate=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this._reformatDate(t,e,r)]}))}))};t.prototype._reformatDate=function(t,e,r){if(t!=="ISO"&&e!=="ISO")return"";if(!t||!e||!r)return"";var i=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;if(!i.test(r)){return r}else{var a=r.replace(/[\-\.]/gi,"/").split("/");switch(e){case"US":return a[1].padStart(2,"0")+"/"+a[2].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"INT":return a[2].padStart(2,"0")+"/"+a[1].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"ISO":if(t==="US"){return a[2].padStart(4,"20")+"-"+a[0].padStart(2,"0")+"-"+a[1].padStart(2,"0")}else if(t==="INT"){return a[2].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[0].padStart(2,"0")}else if(t==="ISO"){return a[0].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[2].padStart(2,"0")}default:return a.join("/")}}};t.prototype.isValidISO=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this._isValidISO(t)]}))}))};t.prototype._isValidISO=function(t){var e=/^\d\d\d\d[-]\d\d[-]\d\d$/;if(!t||!e.test(t)){return false}else{var r=t.split("-");var i=parseInt(r[2],10);var a=parseInt(r[1],10);var n=parseInt(r[0],10);if(n<1e3||n>3e3||a==0||a>12)return false;var o=[31,28,31,30,31,30,31,31,30,31,30,31];if(n%400==0||n%100!=0&&n%4==0)o[1]=29;return i>0&&i<=o[a-1]}};t.prototype.setAvailSpace=function(){this.availSpace=(this.hiddenOverflowParent||document.body).clientWidth};t.prototype.componentWillLoad=function(){var t=this;if(this.labelStart===""||this.labelEnd===""){console.error("For accessibility reasons you must specify labels for the date range inputs.")}handleDisabledAttribute(this.el,this._disabled);this.hiddenOverflowParent=findParentWithHiddenOverflow(this.el);if(this.hiddenOverflowParent){var e=new ResizeObserver((function(){t.availSpace=t.hiddenOverflowParent.clientWidth}));e.observe(this.hiddenOverflowParent)}this.setAvailSpace()};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.liveRegionEl.textContent=t};t.prototype.renderCalendars=function(){var t=this;if(this.calWidth<=this.availSpace){return h(Fragment,null,h("div",{class:"popup-wrapper ".concat(this.startCalEl&&this.startCalEl.view,"-view ").concat(this.openUp?"expand-upwards":""),id:"popup-wrapper",ref:function(e){return t.popupEl=e},onClick:function(){return t.popupClicked=true},style:{display:"flex"}},h("div",{class:"trapfocus",tabIndex:this.isExpanded?0:undefined,onFocus:function(){return t.endCalEl.focusLastFocusable()}}),h("priv-calendar",{ref:function(e){return t.startCalEl=e},onClick:function(){return t.popupClicked=true},onDateFocus:function(e){return t.handleDateFocus(e)}}),h("priv-calendar",{ref:function(e){return t.endCalEl=e},onClick:function(){return t.popupClicked=true},onDateFocus:function(e){return t.handleDateFocus(e)}}),h("div",{class:"trapfocus",tabIndex:this.isExpanded?0:undefined,onFocus:function(){return t.startCalEl.focusFirstFocusable()}})))}};t.prototype.render=function(){var t=this;return h(Host,{"aria-busy":"false"},h("div",{ref:function(e){return t.wrapperEl=e},class:"wrapper"},h("div",{class:"range-wrapper ".concat(this.calWidth<=this.availSpace?"cal":"")},h("div",{class:"label-wrapper",id:"start-label-wrapper"},h("label",{ref:function(e){return t.labelEl=e},id:"startlabel",htmlFor:"start-date-input",class:"label",title:"".concat(this.labelStart," (").concat(this.dateFormat,")")},this.labelStart,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",{class:"label-wrapper",id:"end-label-wrapper"},h("label",{id:"endlabel",htmlFor:"end-date-input",class:"label",title:"".concat(this.labelEnd," (").concat(this.dateFormat,")")},this.labelEnd,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("input",{disabled:this._disabled,type:"text",id:"start-date-input",class:"date-input input ".concat(this.invalidStart?"invalid":""),name:"start-date",placeholder:this.dateFormat,value:this.valueStart,onFocus:function(){return t.handleFocus()},onInput:function(e){return t.handleStartInput(e)},onBlur:function(){return t.handleStartInputBlur()},ref:function(e){return t.startInputEl=e},"aria-describedby":"error","aria-label":this.labelStart,"aria-required":this.requiredField?"true":null}),h("div",{id:"hyphen"}," - "),h("input",{disabled:this._disabled,type:"text",id:"end-date-input",class:"date-input input ".concat(this.invalidEnd?"invalid":""),name:"end-date",placeholder:this.dateFormat,value:this.valueEnd,onFocus:function(){return t.handleFocus()},onInput:function(e){return t.handleEndInput(e)},onBlur:function(){return t.handleEndInputBlur()},ref:function(e){return t.endInputEl=e},"aria-describedby":"error","aria-label":this.labelEnd,"aria-required":this.requiredField?"true":null}),h("div",{class:"toggle-wrapper",id:"toggle-wrapper"},this.calWidth<=this.availSpace&&h("button",{disabled:this.disabled,onClick:this.togglePopup.bind(this),"aria-describedby":"date-input",ref:function(e){return t.toggleEl=e},"aria-expanded":"".concat(this.isExpanded),class:"toggle",id:"toggle"},h("span",{class:"calendar",title:intl.formatMessage({id:"date.calendarView",defaultMessage:"Calendar View",description:"Calendar button"})}))),this.renderCalendars()),h("div",null,h("div",{id:"live-region","aria-live":"polite","aria-relevant":"text",class:"sr-only"}),h("div",{id:"month-title",class:"sr-only"},intl.formatMessage({id:"date.selectMonth",defaultMessage:"Activate to select a month.",description:"Calendar button"})),h("div",{id:"year-title",class:"sr-only"},intl.formatMessage({id:"date.selectYear",defaultMessage:"Activate to select a year.",description:"Calendar button"}))),h("div",{id:"error",class:"error"},this.errorMessage),h("div",{ref:function(e){return t.liveRegionEl=e},class:"sr-only","aria-live":"polite","aria-atomic":"true"})))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["handleDisabled"],valueStart:["updateValueStart"],valueEnd:["updateValueEnd"],errorMessage:["handleErrorMessage"]}},enumerable:false,configurable:true});return t}();DateRange.style=datepickerCss;export{DateRange as wm_date_range};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,r,i){function a(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function s(t){try{l(i["throw"](t))}catch(t){n(t)}}function l(t){t.done?r(t.value):a(t.value).then(o,s)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,a,n,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return l([t,e])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(i=1,a&&(n=s[0]&2?a["return"]:s[0]?a["throw"]||((n=a["return"])&&n.call(a),0):a.next)&&!(n=n.call(a,s[1])).done)return n;if(a=0,n)s=[s[0]&2,n.value];switch(s[0]){case 0:case 1:n=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!n||s[1]>n[0]&&s[1]<n[3])){r.label=s[1];break}if(s[0]===6&&r.label<n[1]){r.label=n[1];n=s;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(s);break}if(n[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];a=0}finally{i=n=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,j as dateToISO,a as handleDisabledAttribute,k as shouldOpenUp,A as getContextMeasurements,B as dateFind,C as calendar_months,D as findParentWithHiddenOverflow,i as intl}from"./functions-46843ea0.js";var datepickerCss=':host{--wmcolor-datepicker-background:var(--wmcolor-background);--wmcolor-datepicker-day-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-day-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-day-text-outside:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-day-text-selected:var(--wmcolor-interactive-text-selected);--wmcolor-datepicker-day-text:var(--wmcolor-text);--wmcolor-datepicker-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-input-background:var(--wmcolor-input-background);--wmcolor-datepicker-input-border:var(--wmcolor-input-border);--wmcolor-datepicker-input-text-disabled:var(--wmcolor-input-text-disabled);--wmcolor-datepicker-input-text:var(--wmcolor-input-text);--wmcolor-datepicker-month-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-month-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-month-background:var(--wmcolor-text);--wmcolor-datepicker-month-border:var(--wmcolor-border-light);--wmcolor-datepicker-month-text-selected:var(--wmcolor-text-ondark);--wmcolor-datepicker-month-text:var(--wmcolor-interactive);--wmcolor-datepicker-navigation-background-hover:var(--wmcolor-button-background-navigational-hover);--wmcolor-datepicker-navigation-background:var(--wmcolor-button-background-navigational);--wmcolor-datepicker-navigation-text:var(--wmcolor-button-icon-navigational);--wmcolor-datepicker-selector-background:var(--wmcolor-button-background-secondary);--wmcolor-datepicker-selector-border:var(--wmcolor-button-border-secondary);--wmcolor-datepicker-selector-text:var(--wmcolor-button-text-secondary);--wmcolor-datepicker-toggle-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-toggle-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-toggle-background:var(--wmcolor-input-background);--wmcolor-datepicker-toggle-icon-disabled:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-toggle-icon:var(--wmcolor-interactive);--wmcolor-datepicker-weekdays-background:var(--wmcolor-table-header-background);--wmcolor-datepicker-weekdays-text:var(--wmcolor-text);font-family:inherit}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{position:relative}:host .wrapper .single-wrapper,:host .wrapper .range-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .date-input{border-radius:3px;color:var(--wmcolor-datepicker-input-text);font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;-ms-flex:1;flex:1;margin:0;background-color:var(--wmcolor-datepicker-input-background)}:host .wrapper .date-input:disabled{background-color:var(--wmcolor-datepicker-input-background-disabled);color:var(--wmcolor-datepicker-input-text-disabled)}:host .wrapper .date-input:focus{outline:none}:host .wrapper .input{height:2.5rem;border:1px solid var(--wmcolor-datepicker-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;}:host .wrapper #single-date-input{height:100%;border:none;border-radius:3px;-webkit-margin-end:3px;margin-inline-end:3px}:host .wrapper .range-wrapper{max-width:257px;display:grid;grid-template-rows:minmax(21px, 1fr) 38px;grid-template-columns:120px 17px 120px;grid-template-areas:"start-label-wrapper . end-label-wrapper" "start-date-input hyphen end-date-input"}:host .wrapper .range-wrapper #start-label-wrapper{grid-area:start-label-wrapper}:host .wrapper .range-wrapper #end-label-wrapper{grid-area:end-label-wrapper}:host .wrapper .range-wrapper #start-date-input{grid-area:start-date-input}:host .wrapper .range-wrapper #hyphen{grid-area:hyphen}:host .wrapper .range-wrapper #end-date-input{grid-area:end-date-input}:host .wrapper .range-wrapper .label{text-wrap:wrap}:host .wrapper .range-wrapper.cal{max-width:305px;-webkit-column-gap:4px;-moz-column-gap:4px;column-gap:4px;grid-template-columns:120px 17px 120px 36px;grid-template-areas:"start-label-wrapper . end-label-wrapper ." "start-date-input hyphen end-date-input toggle-wrapper"}:host .wrapper .range-wrapper.cal #toggle-wrapper{grid-area:toggle-wrapper}:host .wrapper #start-date-input,:host .wrapper #end-date-input{max-width:120px}:host .wrapper #start-date-input:focus,:host .wrapper #end-date-input:focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper.invalid .input,:host .wrapper .date-input.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:4px;top:100%;left:0}:host .wrapper .error:not(:empty){margin-top:0.25rem}:host .wrapper.focus #single-date-input{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var DateRange=function(){function t(t){registerInstance(this,t);this.wmRangeSelection=createEvent(this,"wmRangeSelection",7);this.wmStartInputBlur=createEvent(this,"wmStartInputBlur",7);this.wmEndInputBlur=createEvent(this,"wmEndInputBlur",7);this.openUp=false;this.calWidth=681;this.popupClicked=false;this.toggleButtonClicked=false;this.formats={"mm/dd/yyyy":"US","dd/mm/yyyy":"INT","yyyy/mm/dd":"ISO"};this.dateFormat="mm/dd/yyyy";this.disabled=false;this.errorMessage=undefined;this.invalidStart=false;this.invalidEnd=false;this.labelStart="";this.labelEnd="";this.preselected=undefined;this.requiredField=false;this.valueStart="";this.valueEnd="";this.availSpace=0;this.isExpanded=false}Object.defineProperty(t.prototype,"_disabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focusDates",{get:function(){var t=this.toISO(this.valueStart);var e=dateToISO(new Date);if(this._isValidISO(t)){e=t}else if(this.preselected&&this._isValidISO(this.preselected)){e=this.preselected}var r=this.toJSDate(e);if(r.getUTCMonth()==11){r.setYear(r.getUTCFullYear()+1)}r.setMonth((r.getUTCMonth()+1)%12,1);var i=dateToISO(r);var a=this.toISO(this.valueEnd);if(this._isValidISO(a)){var n=this.isSameMonth(e,a);if(!n){i=a;if(!t){var o=this.toJSDate(i);var s=o.getUTCMonth()-1;if(s==-1){s=11;o.setYear(o.getUTCFullYear()-1)}o.setMonth(s,1);e=dateToISO(o)}}}return[e,i]},enumerable:false,configurable:true});t.prototype.isSameMonth=function(t,e){if(t&&e){return t.slice(0,-3)===e.slice(0,-3)}else{return false}};t.prototype.toJSDate=function(t){if(t&&this._isValidISO(t)){var e=new Date;e.setUTCFullYear(parseInt(t.split("-")[0]),parseInt(t.split("-")[1])-1,parseInt(t.split("-")[2]));return e}else{return undefined}};t.prototype.toISO=function(t){return this._reformatDate(this.formats[this.dateFormat],"ISO",t)};t.prototype.handleDisabled=function(){handleDisabledAttribute(this.el,this._disabled)};t.prototype.updateValueStart=function(){this.startInputEl.value=this.valueStart?this.valueStart:""};t.prototype.updateValueEnd=function(){this.endInputEl.value=this.valueEnd?this.valueEnd:""};t.prototype.handleErrorMessage=function(){var t=this;if(this.errorMessage){setTimeout((function(){return t.announce(t.errorMessage)}),100)}};t.prototype.togglePopup=function(){this.isExpanded?this.closePopup():this.openPopup();this.toggleButtonClicked=true};t.prototype.closePopup=function(t){var e=this;if(t===void 0){t=false}this.date1=undefined;this.date2=undefined;this.startCalEl.startDate=undefined;this.startCalEl.endDate=undefined;this.startCalEl.hoverDate=undefined;this.endCalEl.startDate=undefined;this.endCalEl.endDate=undefined;this.endCalEl.hoverDate=undefined;this.isExpanded=false;this.startCalEl.view="day";this.endCalEl.view="day";this.popupEl.classList.remove("open");window.setTimeout((function(){e.popupEl.style.visibility="hidden"}),250);if(t){this.toggleEl.focus()}};t.prototype.openPopup=function(){var t=this;this.openUp=shouldOpenUp(this.el,this.popupEl.clientHeight,this.labelEl.clientHeight);var e=getContextMeasurements(this.el),r=e.spaceLeft,i=e.spaceRight;if(i>=this.calWidth-this.el.clientWidth){this.popupEl.style.left="0";this.popupEl.style.right="auto"}else if(r>=this.calWidth-this.el.clientWidth){this.popupEl.style.right="0";this.popupEl.style.left="auto"}else{var a=(this.availSpace-this.calWidth)/2-r;this.popupEl.style.left="".concat(a,"px");this.popupEl.style.right="auto"}this.popupEl.style.visibility="visible";window.requestAnimationFrame((function(){t.popupEl.classList.add("open")}));this.isExpanded=true;this.startCalEl.focusDate=this.focusDates[0];this.endCalEl.focusDate=this.focusDates[1];this.startCalEl.focusCell();if(this.valueStart){var n=this.toISO(this.valueStart);if(this._isValidISO(n)){this.startCalEl.startDate=n}if(this.valueEnd){var o=this.toISO(this.valueEnd);if(this._isValidISO(o)){if(this.isSameMonth(n,o)){this.startCalEl.endDate=o}else{this.endCalEl.endDate=o}}}}};t.prototype.handleFocus=function(){this.wrapperEl.classList.add("focus")};t.prototype.handleBlur=function(){this.wrapperEl.classList.remove("focus")};t.prototype.handleStartInputBlur=function(){this.wmStartInputBlur.emit()};t.prototype.handleEndInputBlur=function(){this.wmEndInputBlur.emit()};t.prototype.handleStartInput=function(t){this.valueStart=t.target.value};t.prototype.handleEndInput=function(t){this.valueEnd=t.target.value};t.prototype.handleKey=function(t){switch(t.key){case"Escape":t.preventDefault();t.stopPropagation();this.closePopup(true);break}};t.prototype.blurHandler=function(){if(!this.popupClicked&&!this.toggleButtonClicked&&this.isExpanded){this.closePopup()}this.popupClicked=false;this.toggleButtonClicked=false};t.prototype.handleBlurOnWindow=function(){if(this.isExpanded){this.closePopup()}};t.prototype.handleDateFocus=function(t){var e=t.target;var r=e.focusDate;var i=this.startCalEl.focusDate.slice(0,-3);var a=this.endCalEl.focusDate.slice(0,-3);if(e==this.startCalEl){if(i>=a){this.endCalEl.focusDate=dateFind.month.increase(this.startCalEl.focusDate,1)}}else if(e==this.endCalEl){if(a<=i){this.startCalEl.focusDate=dateFind.month.decrease(this.endCalEl.focusDate,1)}}if(this.oldFocusVal){var n=dateFind.year.asInt(r);var o=dateFind.year.asInt(this.oldFocusVal);var s=dateFind.month.asInt(r);var l=dateFind.month.asInt(this.oldFocusVal);if(e.view==="day"){if(n!=o||s!=l){this.liveRegionEl.innerHTML="Viewing ".concat(calendar_months[s-1],", ").concat(n)}}else{if(n!=o){this.liveRegionEl.innerHTML="".concat(n," selected.")}else if(s!=l){this.liveRegionEl.innerHTML="".concat(calendar_months[s-1],", ").concat(n)}}}this.oldFocusVal=e.focusDate};t.prototype.handlePopupBlurred=function(t){if(t.detail.relatedTarget!==this.el){var e=new CustomEvent("blur");e.relatedTarget=t.detail.relatedTarget;this.el.dispatchEvent(e)}};t.prototype.handleCellTriggered=function(t){var e=t.detail.cal;var r=t.detail.cell;var i=r.getAttribute("data-year")+"-"+r.getAttribute("data-month")+"-"+r.textContent.padStart(2,"0");if(this.startCalEl.endDate||this.endCalEl.endDate){this.startCalEl.startDate=undefined;this.startCalEl.endDate=undefined;this.endCalEl.startDate=undefined;this.endCalEl.endDate=undefined;e.startDate=i;this.date1=i;this.date2=undefined}else if(this.date1&&i!==this.date1){if(this.date1>i){this.date2=this.date1;this.date1=i}else{this.date2=i}var a={startDate:{iso:this.date1,us:this._reformatDate("ISO","US",this.date1),int:this._reformatDate("ISO","INT",this.date1)},endDate:{iso:this.date2,us:this._reformatDate("ISO","US",this.date2),int:this._reformatDate("ISO","INT",this.date2)}};this.wmRangeSelection.emit(a);this.closePopup(true);this.date1=undefined;this.date2=undefined}else{e.startDate=i;this.date1=i}var n=new CustomEvent("input");this.el.dispatchEvent(n);var o=new CustomEvent("change");this.el.dispatchEvent(o)};t.prototype.handleOutOfCal=function(){this.startCalEl.hoverDate=undefined;this.endCalEl.hoverDate=undefined};t.prototype.handleCellHovered=function(t){this.startCalEl.hoverDate=this.startCalEl.startDate===t.detail?undefined:t.detail;this.endCalEl.hoverDate=this.endCalEl.startDate===t.detail?undefined:t.detail};t.prototype.reformatDate=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this._reformatDate(t,e,r)]}))}))};t.prototype._reformatDate=function(t,e,r){if(t!=="ISO"&&e!=="ISO")return"";if(!t||!e||!r)return"";var i=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;if(!i.test(r)){return r}else{var a=r.replace(/[\-\.]/gi,"/").split("/");switch(e){case"US":return a[1].padStart(2,"0")+"/"+a[2].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"INT":return a[2].padStart(2,"0")+"/"+a[1].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"ISO":if(t==="US"){return a[2].padStart(4,"20")+"-"+a[0].padStart(2,"0")+"-"+a[1].padStart(2,"0")}else if(t==="INT"){return a[2].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[0].padStart(2,"0")}else if(t==="ISO"){return a[0].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[2].padStart(2,"0")}default:return a.join("/")}}};t.prototype.isValidISO=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this._isValidISO(t)]}))}))};t.prototype._isValidISO=function(t){var e=/^\d\d\d\d[-]\d\d[-]\d\d$/;if(!t||!e.test(t)){return false}else{var r=t.split("-");var i=parseInt(r[2],10);var a=parseInt(r[1],10);var n=parseInt(r[0],10);if(n<1e3||n>3e3||a==0||a>12)return false;var o=[31,28,31,30,31,30,31,31,30,31,30,31];if(n%400==0||n%100!=0&&n%4==0)o[1]=29;return i>0&&i<=o[a-1]}};t.prototype.setAvailSpace=function(){this.availSpace=(this.hiddenOverflowParent||document.body).clientWidth};t.prototype.componentWillLoad=function(){var t=this;if(this.labelStart===""||this.labelEnd===""){console.error("For accessibility reasons you must specify labels for the date range inputs.")}handleDisabledAttribute(this.el,this._disabled);this.hiddenOverflowParent=findParentWithHiddenOverflow(this.el);if(this.hiddenOverflowParent){var e=new ResizeObserver((function(){t.availSpace=t.hiddenOverflowParent.clientWidth}));e.observe(this.hiddenOverflowParent)}this.setAvailSpace()};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.liveRegionEl.textContent=t};t.prototype.renderCalendars=function(){var t=this;if(this.calWidth<=this.availSpace){return h(Fragment,null,h("div",{class:"popup-wrapper ".concat(this.startCalEl&&this.startCalEl.view,"-view ").concat(this.openUp?"expand-upwards":""),id:"popup-wrapper",ref:function(e){return t.popupEl=e},onClick:function(){return t.popupClicked=true},style:{display:"flex"}},h("div",{class:"trapfocus",tabIndex:this.isExpanded?0:undefined,onFocus:function(){return t.endCalEl.focusLastFocusable()}}),h("priv-calendar",{ref:function(e){return t.startCalEl=e},onClick:function(){return t.popupClicked=true},onDateFocus:function(e){return t.handleDateFocus(e)}}),h("priv-calendar",{ref:function(e){return t.endCalEl=e},onClick:function(){return t.popupClicked=true},onDateFocus:function(e){return t.handleDateFocus(e)}}),h("div",{class:"trapfocus",tabIndex:this.isExpanded?0:undefined,onFocus:function(){return t.startCalEl.focusFirstFocusable()}})))}};t.prototype.render=function(){var t=this;return h(Host,{"aria-busy":"false"},h("div",{ref:function(e){return t.wrapperEl=e},class:"wrapper"},h("div",{class:"range-wrapper ".concat(this.calWidth<=this.availSpace?"cal":"")},h("div",{class:"label-wrapper",id:"start-label-wrapper"},h("label",{ref:function(e){return t.labelEl=e},id:"startlabel",htmlFor:"start-date-input",class:"label",title:"".concat(this.labelStart," (").concat(this.dateFormat,")")},this.labelStart,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",{class:"label-wrapper",id:"end-label-wrapper"},h("label",{id:"endlabel",htmlFor:"end-date-input",class:"label",title:"".concat(this.labelEnd," (").concat(this.dateFormat,")")},this.labelEnd,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("input",{disabled:this._disabled,type:"text",id:"start-date-input",class:"date-input input ".concat(this.invalidStart?"invalid":""),name:"start-date",placeholder:this.dateFormat,value:this.valueStart,onFocus:function(){return t.handleFocus()},onInput:function(e){return t.handleStartInput(e)},onBlur:function(){return t.handleStartInputBlur()},ref:function(e){return t.startInputEl=e},"aria-describedby":"error","aria-label":this.labelStart,"aria-required":this.requiredField?"true":null}),h("div",{id:"hyphen"}," - "),h("input",{disabled:this._disabled,type:"text",id:"end-date-input",class:"date-input input ".concat(this.invalidEnd?"invalid":""),name:"end-date",placeholder:this.dateFormat,value:this.valueEnd,onFocus:function(){return t.handleFocus()},onInput:function(e){return t.handleEndInput(e)},onBlur:function(){return t.handleEndInputBlur()},ref:function(e){return t.endInputEl=e},"aria-describedby":"error","aria-label":this.labelEnd,"aria-required":this.requiredField?"true":null}),h("div",{class:"toggle-wrapper",id:"toggle-wrapper"},this.calWidth<=this.availSpace&&h("button",{disabled:this.disabled,onClick:this.togglePopup.bind(this),"aria-describedby":"start-date-input end-date-input","aria-label":intl.formatMessage({id:"date.selectRange",defaultMessage:"Select range",description:"Button text for screen readers."}),ref:function(e){return t.toggleEl=e},"aria-expanded":"".concat(this.isExpanded),class:"toggle",id:"toggle"},h("span",{class:"calendar",title:intl.formatMessage({id:"date.calendarView",defaultMessage:"Calendar View",description:"Calendar button"})}))),this.renderCalendars()),h("div",null,h("div",{id:"live-region","aria-live":"polite","aria-relevant":"text",class:"sr-only"}),h("div",{id:"month-title",class:"sr-only"},intl.formatMessage({id:"date.selectMonth",defaultMessage:"Activate to select a month.",description:"Calendar button"})),h("div",{id:"year-title",class:"sr-only"},intl.formatMessage({id:"date.selectYear",defaultMessage:"Activate to select a year.",description:"Calendar button"}))),h("div",{id:"error",class:"error"},this.errorMessage),h("div",{ref:function(e){return t.liveRegionEl=e},class:"sr-only","aria-live":"polite","aria-atomic":"true"})))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["handleDisabled"],valueStart:["updateValueStart"],valueEnd:["updateValueEnd"],errorMessage:["handleErrorMessage"]}},enumerable:false,configurable:true});return t}();DateRange.style=datepickerCss;export{DateRange as wm_date_range};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?r(e.value):a(e.value).then(n,s)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,a,o,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(r=0)),r)try{if(i=1,a&&(o=s[0]&2?a["return"]:s[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;if(a=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];a=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,j as dateToISO,a as handleDisabledAttribute,k as shouldOpenUp,l as hasRoomRight,i as intl}from"./functions-46843ea0.js";var datepickerCss=':host{--wmcolor-datepicker-background:var(--wmcolor-background);--wmcolor-datepicker-day-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-day-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-day-text-outside:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-day-text-selected:var(--wmcolor-interactive-text-selected);--wmcolor-datepicker-day-text:var(--wmcolor-text);--wmcolor-datepicker-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-input-background:var(--wmcolor-input-background);--wmcolor-datepicker-input-border:var(--wmcolor-input-border);--wmcolor-datepicker-input-text-disabled:var(--wmcolor-input-text-disabled);--wmcolor-datepicker-input-text:var(--wmcolor-input-text);--wmcolor-datepicker-month-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-month-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-month-background:var(--wmcolor-text);--wmcolor-datepicker-month-border:var(--wmcolor-border-light);--wmcolor-datepicker-month-text-selected:var(--wmcolor-text-ondark);--wmcolor-datepicker-month-text:var(--wmcolor-interactive);--wmcolor-datepicker-navigation-background-hover:var(--wmcolor-button-background-navigational-hover);--wmcolor-datepicker-navigation-background:var(--wmcolor-button-background-navigational);--wmcolor-datepicker-navigation-text:var(--wmcolor-button-icon-navigational);--wmcolor-datepicker-selector-background:var(--wmcolor-button-background-secondary);--wmcolor-datepicker-selector-border:var(--wmcolor-button-border-secondary);--wmcolor-datepicker-selector-text:var(--wmcolor-button-text-secondary);--wmcolor-datepicker-toggle-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-toggle-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-toggle-background:var(--wmcolor-input-background);--wmcolor-datepicker-toggle-icon-disabled:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-toggle-icon:var(--wmcolor-interactive);--wmcolor-datepicker-weekdays-background:var(--wmcolor-table-header-background);--wmcolor-datepicker-weekdays-text:var(--wmcolor-text);font-family:inherit}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{position:relative}:host .wrapper .single-wrapper,:host .wrapper .range-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .date-input{border-radius:3px;color:var(--wmcolor-datepicker-input-text);font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;-ms-flex:1;flex:1;margin:0;background-color:var(--wmcolor-datepicker-input-background)}:host .wrapper .date-input:disabled{background-color:var(--wmcolor-datepicker-input-background-disabled);color:var(--wmcolor-datepicker-input-text-disabled)}:host .wrapper .date-input:focus{outline:none}:host .wrapper .input{height:2.5rem;border:1px solid var(--wmcolor-datepicker-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;}:host .wrapper #single-date-input{height:100%;border:none;border-radius:3px;-webkit-margin-end:3px;margin-inline-end:3px}:host .wrapper .range-wrapper{max-width:257px;display:grid;grid-template-rows:minmax(21px, 1fr) 38px;grid-template-columns:120px 17px 120px;grid-template-areas:"start-label-wrapper . end-label-wrapper" "start-date-input hyphen end-date-input"}:host .wrapper .range-wrapper #start-label-wrapper{grid-area:start-label-wrapper}:host .wrapper .range-wrapper #end-label-wrapper{grid-area:end-label-wrapper}:host .wrapper .range-wrapper #start-date-input{grid-area:start-date-input}:host .wrapper .range-wrapper #hyphen{grid-area:hyphen}:host .wrapper .range-wrapper #end-date-input{grid-area:end-date-input}:host .wrapper .range-wrapper .label{text-wrap:wrap}:host .wrapper .range-wrapper.cal{max-width:305px;-webkit-column-gap:4px;-moz-column-gap:4px;column-gap:4px;grid-template-columns:120px 17px 120px 36px;grid-template-areas:"start-label-wrapper . end-label-wrapper ." "start-date-input hyphen end-date-input toggle-wrapper"}:host .wrapper .range-wrapper.cal #toggle-wrapper{grid-area:toggle-wrapper}:host .wrapper #start-date-input,:host .wrapper #end-date-input{max-width:120px}:host .wrapper #start-date-input:focus,:host .wrapper #end-date-input:focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper.invalid .input,:host .wrapper .date-input.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:4px;top:100%;left:0}:host .wrapper .error:not(:empty){margin-top:0.25rem}:host .wrapper.focus #single-date-input{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var DatePicker=function(){function e(e){registerInstance(this,e);this.wmDatepickerDateSelected=createEvent(this,"wmDatepickerDateSelected",7);this.wmDatepickerInputBlurred=createEvent(this,"wmDatepickerInputBlurred",7);this.openUp=false;this.popupClicked=false;this.toggleButtonClicked=false;this.value="";this.disabled=false;this.dateFormat="mm/dd/yyyy";this.errorMessage=undefined;this.labelPosition="top";this.label="";this.requiredField=false;this.preselected=undefined;this.isExpanded=false}Object.defineProperty(e.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"calendarDate",{get:function(){var e=dateToISO(new Date);var t={"mm/dd/yyyy":"US","dd/mm/yyyy":"INT","yyyy/mm/dd":"ISO"};if(this.value&&t[this.dateFormat]&&this.isValidIsoInternal(this.reformatDateInternal(t[this.dateFormat],"ISO",this.value))){e=this.reformatDateInternal(t[this.dateFormat],"ISO",this.value)}else if(this.preselected){e=this.preselected}return e},enumerable:false,configurable:true});e.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.updateValue=function(){this.inputEl.value=this.value?this.value:""};e.prototype.announceError=function(){var e=this;if(this.errorMessage){setTimeout((function(){return e.announce(e.errorMessage)}),100)}};e.prototype.togglePopup=function(){this.isExpanded?this.closePopup():this.openPopup();this.toggleButtonClicked=true};e.prototype.closePopup=function(e){var t=this;if(e===void 0){e=false}this.isExpanded=false;this.calEl.view="day";this.calEl.view="day";this.popupEl.classList.remove("open");window.setTimeout((function(){t.popupEl.style.visibility="hidden"}),250);if(e){this.toggleEl.focus()}};e.prototype.openPopup=function(){var e=this;this.openUp=shouldOpenUp(this.el,this.popupEl.clientHeight,this.labelWrapperEl.clientHeight);if(hasRoomRight(this.el,336)){this.popupEl.style.left="0";this.popupEl.style.right="auto"}else{this.popupEl.style.right="0";this.popupEl.style.left="auto"}this.popupEl.style.visibility="visible";window.requestAnimationFrame((function(){e.popupEl.classList.add("open")}));this.isExpanded=true;this.calEl.focusDate=this.calendarDate;this.calEl.startDate=this.calendarDate;this.calEl.focusCell()};e.prototype.handleInput=function(e){this.value=e.target.value};e.prototype.handleInputBlur=function(){this.dpWrapperEl.classList.remove("focus");this.wmDatepickerInputBlurred.emit()};e.prototype.handleInputFocus=function(){this.dpWrapperEl.classList.add("focus")};e.prototype.handleInputChange=function(){var e=new CustomEvent("change");this.el.dispatchEvent(e)};e.prototype.handleKey=function(e){switch(e.key){case"Escape":e.preventDefault();e.stopPropagation();this.closePopup(true);break}};e.prototype.blurHandler=function(){if(!this.popupClicked&&!this.toggleButtonClicked&&this.isExpanded){this.closePopup()}this.popupClicked=false;this.toggleButtonClicked=false};e.prototype.handleBlurOnWindow=function(){if(this.isExpanded){this.closePopup()}};e.prototype.handleCellTriggered=function(e){var t=e.detail.cell;var r=t.getAttribute("data-year")+"-"+t.getAttribute("data-month")+"-"+t.textContent.padStart(2,"0");this.wmDatepickerDateSelected.emit({date:r});var i=new CustomEvent("input");this.el.dispatchEvent(i);var a=new CustomEvent("change");this.el.dispatchEvent(a);this.closePopup(true)};e.prototype.reformatDate=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.reformatDateInternal(e,t,r)]}))}))};e.prototype.reformatDateInternal=function(e,t,r){var i=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;if(!r){return""}else if(!i.test(r)){return r}else{var a=r.replace(/[\-\.]/gi,"/").split("/");switch(t){case"US":return a[1].padStart(2,"0")+"/"+a[2].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"INT":return a[2].padStart(2,"0")+"/"+a[1].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"ISO":if(e==="US"){return a[2].padStart(4,"20")+"-"+a[0].padStart(2,"0")+"-"+a[1].padStart(2,"0")}else if(e==="INT"){return a[2].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[0].padStart(2,"0")}else if(e==="ISO"){return a[0].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[2].padStart(2,"0")}default:return a.join("/")}}};e.prototype.isValidIso=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.isValidIsoInternal(e)]}))}))};e.prototype.isValidIsoInternal=function(e){var t=/^\d\d\d\d[-]\d\d[-]\d\d$/;if(!e||!t.test(e)){return false}else{var r=e.split("-");var i=parseInt(r[2],10);var a=parseInt(r[1],10);var o=parseInt(r[0],10);if(o<1e3||o>3e3||a==0||a>12)return false;var n=[31,28,31,30,31,30,31,31,30,31,30,31];if(o%400==0||o%100!=0&&o%4==0)n[1]=29;return i>0&&i<=n[a-1]}};e.prototype.componentWillLoad=function(){if(this.label===""){console.error("You must include a label prop for the datepicker input (for accessibility reasons), even if the label position is none.")}handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.componentDidLoad=function(){var e=this;this.calEl.addEventListener("click",(function(){e.popupClicked=true}))};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.liveRegionEl.textContent=e};e.prototype.render=function(){var e=this;return h(Host,{"aria-busy":"false",class:"".concat(this.errorMessage?"invalid":"")},h("div",{ref:function(t){return e.dpWrapperEl=t},class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},h("div",{class:"label-wrapper",ref:function(t){return e.labelWrapperEl=t}},this.labelPosition!=="none"&&h("label",{id:"datepickerLabel",htmlFor:"date-input",class:"label",title:"".concat(this.label," (").concat(this.dateFormat,")")},this.label,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",null,h("div",{class:"single-wrapper input"},h("input",{disabled:this.isDisabled,type:"text",id:"single-date-input",class:"date-input",name:"date",placeholder:this.dateFormat,value:this.value,onFocus:function(){return e.handleInputFocus()},onInput:function(t){return e.handleInput(t)},onBlur:function(){return e.handleInputBlur()},onChange:function(){return e.handleInputChange()},ref:function(t){return e.inputEl=t},"aria-describedby":"error","aria-label":this.label,"aria-required":this.requiredField?"true":null}),h("div",{class:"container",id:"wm-container"},h("button",{disabled:this.disabled,onClick:this.togglePopup.bind(this),"aria-describedby":"date-input",ref:function(t){return e.toggleEl=t},"aria-expanded":"".concat(this.isExpanded),class:"toggle",id:"toggle"},h("span",{class:"calendar",title:intl.formatMessage({id:"date.calendarView",defaultMessage:"Calendar View",description:"Calendar button"})})),h("div",{class:"popup-wrapper ".concat(this.calEl&&this.calEl.view,"-view ").concat(this.openUp?"expand-upwards":""),id:"popup-wrapper",ref:function(t){return e.popupEl=t},onClick:function(){return e.popupClicked=true}},h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusLastFocusable()}}),h("priv-calendar",{ref:function(t){return e.calEl=t},startDate:this.calendarDate,focusDate:this.calendarDate,class:"inside"}),h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusFirstFocusable()}})),h("div",{id:"live-region","aria-live":"polite","aria-relevant":"text",class:"sr-only"}),h("div",{id:"month-title",class:"sr-only"},intl.formatMessage({id:"date.selectMonth",defaultMessage:"Activate to select a month.",description:"Calendar button"})),h("div",{id:"year-title",class:"sr-only"},intl.formatMessage({id:"date.selectYear",defaultMessage:"Activate to select a year.",description:"Calendar button"})))),h("div",{id:"error",class:"error"},this.errorMessage),h("div",{ref:function(t){return e.liveRegionEl=t},class:"sr-only","aria-live":"polite","aria-atomic":"true"}))))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{disabled:["handleDisabledChange"],value:["updateValue"],errorMessage:["announceError"]}},enumerable:false,configurable:true});return e}();DatePicker.style=datepickerCss;export{DatePicker as wm_datepicker};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?r(e.value):a(e.value).then(n,s)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,a,o,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(r=0)),r)try{if(i=1,a&&(o=s[0]&2?a["return"]:s[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;if(a=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];a=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,j as dateToISO,a as handleDisabledAttribute,k as shouldOpenUp,l as hasRoomRight,i as intl}from"./functions-46843ea0.js";var datepickerCss=':host{--wmcolor-datepicker-background:var(--wmcolor-background);--wmcolor-datepicker-day-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-day-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-day-text-outside:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-day-text-selected:var(--wmcolor-interactive-text-selected);--wmcolor-datepicker-day-text:var(--wmcolor-text);--wmcolor-datepicker-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-input-background:var(--wmcolor-input-background);--wmcolor-datepicker-input-border:var(--wmcolor-input-border);--wmcolor-datepicker-input-text-disabled:var(--wmcolor-input-text-disabled);--wmcolor-datepicker-input-text:var(--wmcolor-input-text);--wmcolor-datepicker-month-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-month-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-month-background:var(--wmcolor-text);--wmcolor-datepicker-month-border:var(--wmcolor-border-light);--wmcolor-datepicker-month-text-selected:var(--wmcolor-text-ondark);--wmcolor-datepicker-month-text:var(--wmcolor-interactive);--wmcolor-datepicker-navigation-background-hover:var(--wmcolor-button-background-navigational-hover);--wmcolor-datepicker-navigation-background:var(--wmcolor-button-background-navigational);--wmcolor-datepicker-navigation-text:var(--wmcolor-button-icon-navigational);--wmcolor-datepicker-selector-background:var(--wmcolor-button-background-secondary);--wmcolor-datepicker-selector-border:var(--wmcolor-button-border-secondary);--wmcolor-datepicker-selector-text:var(--wmcolor-button-text-secondary);--wmcolor-datepicker-toggle-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-toggle-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-toggle-background:var(--wmcolor-input-background);--wmcolor-datepicker-toggle-icon-disabled:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-toggle-icon:var(--wmcolor-interactive);--wmcolor-datepicker-weekdays-background:var(--wmcolor-table-header-background);--wmcolor-datepicker-weekdays-text:var(--wmcolor-text);font-family:inherit}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{position:relative}:host .wrapper .single-wrapper,:host .wrapper .range-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .date-input{border-radius:3px;color:var(--wmcolor-datepicker-input-text);font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;-ms-flex:1;flex:1;margin:0;background-color:var(--wmcolor-datepicker-input-background)}:host .wrapper .date-input:disabled{background-color:var(--wmcolor-datepicker-input-background-disabled);color:var(--wmcolor-datepicker-input-text-disabled)}:host .wrapper .date-input:focus{outline:none}:host .wrapper .input{height:2.5rem;border:1px solid var(--wmcolor-datepicker-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;}:host .wrapper #single-date-input{height:100%;border:none;border-radius:3px;-webkit-margin-end:3px;margin-inline-end:3px}:host .wrapper .range-wrapper{max-width:257px;display:grid;grid-template-rows:minmax(21px, 1fr) 38px;grid-template-columns:120px 17px 120px;grid-template-areas:"start-label-wrapper . end-label-wrapper" "start-date-input hyphen end-date-input"}:host .wrapper .range-wrapper #start-label-wrapper{grid-area:start-label-wrapper}:host .wrapper .range-wrapper #end-label-wrapper{grid-area:end-label-wrapper}:host .wrapper .range-wrapper #start-date-input{grid-area:start-date-input}:host .wrapper .range-wrapper #hyphen{grid-area:hyphen}:host .wrapper .range-wrapper #end-date-input{grid-area:end-date-input}:host .wrapper .range-wrapper .label{text-wrap:wrap}:host .wrapper .range-wrapper.cal{max-width:305px;-webkit-column-gap:4px;-moz-column-gap:4px;column-gap:4px;grid-template-columns:120px 17px 120px 36px;grid-template-areas:"start-label-wrapper . end-label-wrapper ." "start-date-input hyphen end-date-input toggle-wrapper"}:host .wrapper .range-wrapper.cal #toggle-wrapper{grid-area:toggle-wrapper}:host .wrapper #start-date-input,:host .wrapper #end-date-input{max-width:120px}:host .wrapper #start-date-input:focus,:host .wrapper #end-date-input:focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper.invalid .input,:host .wrapper .date-input.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:4px;top:100%;left:0}:host .wrapper .error:not(:empty){margin-top:0.25rem}:host .wrapper.focus #single-date-input{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var DatePicker=function(){function e(e){registerInstance(this,e);this.wmDatepickerDateSelected=createEvent(this,"wmDatepickerDateSelected",7);this.wmDatepickerInputBlurred=createEvent(this,"wmDatepickerInputBlurred",7);this.openUp=false;this.popupClicked=false;this.toggleButtonClicked=false;this.value="";this.disabled=false;this.dateFormat="mm/dd/yyyy";this.errorMessage=undefined;this.labelPosition="top";this.label="";this.requiredField=false;this.preselected=undefined;this.isExpanded=false}Object.defineProperty(e.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"calendarDate",{get:function(){var e=dateToISO(new Date);var t={"mm/dd/yyyy":"US","dd/mm/yyyy":"INT","yyyy/mm/dd":"ISO"};if(this.value&&t[this.dateFormat]&&this.isValidIsoInternal(this.reformatDateInternal(t[this.dateFormat],"ISO",this.value))){e=this.reformatDateInternal(t[this.dateFormat],"ISO",this.value)}else if(this.preselected){e=this.preselected}return e},enumerable:false,configurable:true});e.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.updateValue=function(){this.inputEl.value=this.value?this.value:""};e.prototype.announceError=function(){var e=this;if(this.errorMessage){setTimeout((function(){return e.announce(e.errorMessage)}),100)}};e.prototype.togglePopup=function(){this.isExpanded?this.closePopup():this.openPopup();this.toggleButtonClicked=true};e.prototype.closePopup=function(e){var t=this;if(e===void 0){e=false}this.isExpanded=false;this.calEl.view="day";this.calEl.view="day";this.popupEl.classList.remove("open");window.setTimeout((function(){t.popupEl.style.visibility="hidden"}),250);if(e){this.toggleEl.focus()}};e.prototype.openPopup=function(){var e=this;this.openUp=shouldOpenUp(this.el,this.popupEl.clientHeight,this.labelWrapperEl.clientHeight);if(hasRoomRight(this.el,336)){this.popupEl.style.left="0";this.popupEl.style.right="auto"}else{this.popupEl.style.right="0";this.popupEl.style.left="auto"}this.popupEl.style.visibility="visible";window.requestAnimationFrame((function(){e.popupEl.classList.add("open")}));this.isExpanded=true;this.calEl.focusDate=this.calendarDate;this.calEl.startDate=this.calendarDate;this.calEl.focusCell()};e.prototype.handleInput=function(e){this.value=e.target.value};e.prototype.handleInputBlur=function(){this.dpWrapperEl.classList.remove("focus");this.wmDatepickerInputBlurred.emit()};e.prototype.handleInputFocus=function(){this.dpWrapperEl.classList.add("focus")};e.prototype.handleInputChange=function(){var e=new CustomEvent("change");this.el.dispatchEvent(e)};e.prototype.handleKey=function(e){switch(e.key){case"Escape":e.preventDefault();e.stopPropagation();this.closePopup(true);break}};e.prototype.blurHandler=function(){if(!this.popupClicked&&!this.toggleButtonClicked&&this.isExpanded){this.closePopup()}this.popupClicked=false;this.toggleButtonClicked=false};e.prototype.handleBlurOnWindow=function(){if(this.isExpanded){this.closePopup()}};e.prototype.handleCellTriggered=function(e){var t=e.detail.cell;var r=t.getAttribute("data-year")+"-"+t.getAttribute("data-month")+"-"+t.textContent.padStart(2,"0");this.wmDatepickerDateSelected.emit({date:r});var i=new CustomEvent("input");this.el.dispatchEvent(i);var a=new CustomEvent("change");this.el.dispatchEvent(a);this.closePopup(true)};e.prototype.reformatDate=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.reformatDateInternal(e,t,r)]}))}))};e.prototype.reformatDateInternal=function(e,t,r){var i=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;if(!r){return""}else if(!i.test(r)){return r}else{var a=r.replace(/[\-\.]/gi,"/").split("/");switch(t){case"US":return a[1].padStart(2,"0")+"/"+a[2].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"INT":return a[2].padStart(2,"0")+"/"+a[1].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"ISO":if(e==="US"){return a[2].padStart(4,"20")+"-"+a[0].padStart(2,"0")+"-"+a[1].padStart(2,"0")}else if(e==="INT"){return a[2].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[0].padStart(2,"0")}else if(e==="ISO"){return a[0].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[2].padStart(2,"0")}default:return a.join("/")}}};e.prototype.isValidIso=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.isValidIsoInternal(e)]}))}))};e.prototype.isValidIsoInternal=function(e){var t=/^\d\d\d\d[-]\d\d[-]\d\d$/;if(!e||!t.test(e)){return false}else{var r=e.split("-");var i=parseInt(r[2],10);var a=parseInt(r[1],10);var o=parseInt(r[0],10);if(o<1e3||o>3e3||a==0||a>12)return false;var n=[31,28,31,30,31,30,31,31,30,31,30,31];if(o%400==0||o%100!=0&&o%4==0)n[1]=29;return i>0&&i<=n[a-1]}};e.prototype.componentWillLoad=function(){if(this.label===""){console.error("You must include a label prop for the datepicker input (for accessibility reasons), even if the label position is none.")}handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.componentDidLoad=function(){var e=this;this.calEl.addEventListener("click",(function(){e.popupClicked=true}))};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.liveRegionEl.textContent=e};e.prototype.render=function(){var e=this;return h(Host,{"aria-busy":"false",class:"".concat(this.errorMessage?"invalid":"")},h("div",{ref:function(t){return e.dpWrapperEl=t},class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},h("div",{class:"label-wrapper",ref:function(t){return e.labelWrapperEl=t}},this.labelPosition!=="none"&&h("label",{id:"datepickerLabel",htmlFor:"date-input",class:"label",title:"".concat(this.label," (").concat(this.dateFormat,")")},this.label,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",null,h("div",{class:"single-wrapper input"},h("input",{disabled:this.isDisabled,type:"text",id:"single-date-input",class:"date-input",name:"date",placeholder:this.dateFormat,value:this.value,onFocus:function(){return e.handleInputFocus()},onInput:function(t){return e.handleInput(t)},onBlur:function(){return e.handleInputBlur()},onChange:function(){return e.handleInputChange()},ref:function(t){return e.inputEl=t},"aria-describedby":"error","aria-label":this.label,"aria-required":this.requiredField?"true":null}),h("div",{class:"container",id:"wm-container"},h("button",{disabled:this.disabled,onClick:this.togglePopup.bind(this),"aria-label":intl.formatMessage({id:"date.selectDate",defaultMessage:"Select date",description:"Button text for screen readers."}),"aria-describedby":"single-date-input",ref:function(t){return e.toggleEl=t},"aria-expanded":"".concat(this.isExpanded),class:"toggle",id:"toggle"},h("span",{class:"calendar",title:intl.formatMessage({id:"date.calendarView",defaultMessage:"Calendar View",description:"Calendar button"})})),h("div",{class:"popup-wrapper ".concat(this.calEl&&this.calEl.view,"-view ").concat(this.openUp?"expand-upwards":""),id:"popup-wrapper",ref:function(t){return e.popupEl=t},onClick:function(){return e.popupClicked=true}},h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusLastFocusable()}}),h("priv-calendar",{ref:function(t){return e.calEl=t},startDate:this.calendarDate,focusDate:this.calendarDate,class:"inside"}),h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusFirstFocusable()}})),h("div",{id:"live-region","aria-live":"polite","aria-relevant":"text",class:"sr-only"}),h("div",{id:"month-title",class:"sr-only"},intl.formatMessage({id:"date.selectMonth",defaultMessage:"Activate to select a month.",description:"Calendar button"})),h("div",{id:"year-title",class:"sr-only"},intl.formatMessage({id:"date.selectYear",defaultMessage:"Activate to select a year.",description:"Calendar button"})))),h("div",{id:"error",class:"error"},this.errorMessage),h("div",{ref:function(t){return e.liveRegionEl=t},class:"sr-only","aria-live":"polite","aria-atomic":"true"}))))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{disabled:["handleDisabledChange"],value:["updateValue"],errorMessage:["announceError"]}},enumerable:false,configurable:true});return e}();DatePicker.style=datepickerCss;export{DatePicker as wm_datepicker};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,i,e,r){function n(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){t.done?e(t.value):n(t.value).then(a,s)}l((r=r.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,n,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return l([t,i])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(e=0)),e)try{if(r=1,n&&(o=s[0]&2?n["return"]:s[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;if(n=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){e.label=s[1];break}if(s[0]===6&&e.label<o[1]){e.label=o[1];o=s;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(s);break}if(o[2])e.ops.pop();e.trys.pop();continue}s=i.call(t,e)}catch(t){s=[6,t];n=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,f as forceUpdate,h,H as Host,g as getElement}from"./index-558b5a82.js";import{d as debounce,E as transposeMatrix,x as csvToArray,F as wrapAround,G as getSmallestSkipInterval,H as calcPercentageInRange}from"./functions-46843ea0.js";import{n as abbrNumber,o as getInterval}from"./chartFunctions-d3fd6e7c.js";import{l as lineChartMessages,c as chartMessages,g as globalMessages}from"./intl-8b8740b9.js";var wmLineChartCss=':host{--wmcolor-linechart-currentposition:var(--wmcolor-lavender);--wmcolor-linechart-delta-text-negative:var(--wmcolor-text-negative);--wmcolor-linechart-delta-text-positive:var(--wmcolor-text-positive);--wmcolor-linechart-gridline:var(--wmcolor-chart-gridline);--wmcolor-linechart-highlight-background:var(--wmcolor-interactive-background-highlight);--wmcolor-linechart-popover-background:var(--wmcolor-chart-popover-background);display:block;height:500px;width:100%;font-size:14px;overflow-y:visible;overflow-x:auto}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:562px;width:100%;height:100%;outline:none}:host .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;position:relative;color:var(--iconColor);-webkit-transform:var(--translation, unset);transform:var(--translation, unset)}:host .icon:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:var(--icon);padding:0 3px;z-index:1}:host .icon:after{color:white;position:absolute;left:3px;-webkit-transform:scale(180%);transform:scale(180%);display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:var(--icon);z-index:0}:host .legend{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px 16px;margin-top:4px;margin-bottom:16px}:host .legend .legend-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:default;font-weight:600}:host .legend .legend-label.faded{opacity:0.3}:host .legend .legend-label .icon{margin-right:4px}:host .legend .visibility-toggle{margin-left:4px}:host .chart-wrapper{position:relative;-ms-flex-positive:1;flex-grow:1;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:1fr auto auto;margin-right:16px}:host .chart-label{font-size:14px;font-weight:600}:host .chart-label.--y-axis{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:var(--labelWidth);align-self:center;margin-right:16px;grid-area:1/1/2/2;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}:host .chart-label.--x-axis{margin-top:16px;text-align:center;grid-area:3/3/4/4}:host .y-intervals{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;grid-area:1/2/2/3;margin-right:4px}:host .y-intervals .y-interval{text-align:right}:host .x-intervals{display:grid;grid-template-columns:var(--columns);grid-area:2/3/3/4;line-height:1;margin-top:4px}:host .x-intervals .x-interval{text-align:center}:host .x-intervals .x-interval:first-child{text-align:left}:host .x-intervals .x-interval:last-child{text-align:right}:host .x-intervals .x-interval.hidden{visibility:hidden}:host .plot-area{position:relative;grid-area:1/3/2/4;background-image:linear-gradient(90deg, var(--wmcolor-linechart-gridline) 1px, transparent 1px);border-bottom:1px solid var(--wmcolor-linechart-gridline);background-size:var(--backgroundSize)}:host .plot-area.right-border{border-right:1px solid var(--wmcolor-linechart-gridline)}:host .line{position:absolute;width:100%;height:100%}:host .line .icon{position:absolute;-webkit-transform:var(--translation);transform:var(--translation);left:var(--xPosition);top:var(--yPosition);z-index:1}:host .line .icon:focus{z-index:2;outline:none}:host .line .icon:focus:before{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:0;border-radius:3px}:host .line .line-svg{height:100%;width:100%}:host .line.faded{opacity:0.3}:host .line.focused{z-index:1}:host .line.hidden{visibility:hidden}:host .hover-area-wrapper{position:absolute;width:100%;height:100%;top:0;left:0;display:grid;grid-template-rows:1fr;grid-template-columns:var(--columns)}:host .hover-indicator{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;height:100%;width:2px;border:1px solid var(--wmcolor-linechart-currentposition);-webkit-transform:translateX(-50%);transform:translateX(-50%);left:var(--xPosition);grid-column:3/4;grid-row:1/2;pointer-events:none}:host .popover{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:400px;background-color:var(--wmcolor-linechart-popover-background);position:absolute;top:var(--topPosition, 0);left:var(--leftPosition, unset);right:var(--rightPosition, unset);padding:16px;border-radius:5px;-webkit-box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);-webkit-transform:translateY(-50%);transform:translateY(-50%);line-height:1;z-index:3;grid-column:3/4;grid-row:1/2;pointer-events:none;-webkit-box-sizing:border-box;box-sizing:border-box}:host .popover .title{font-size:16px;font-weight:600}:host .popover .comparison-title{font-style:italic;margin-top:4px}:host .popover .unit{font-size:12px;font-weight:600}:host .popover .unit.--x{margin-left:4px}:host .popover .popover-table{margin-top:16px}:host .popover .popover-table .popover-row{line-height:1}:host .popover .popover-table .popover-row:not(:last-child) td{padding-bottom:8px}:host .popover .popover-table .popover-row .row-label{font-weight:600;padding-right:16px;overflow-wrap:anywhere}:host .popover .popover-table .popover-row .row-label .icon{margin-right:4px}:host .popover .popover-table .popover-row .row-value,:host .popover .popover-table .popover-row .delta{text-align:right;white-space:nowrap}:host .popover .popover-table .popover-row .delta{padding-left:12px;font-weight:600}:host .popover .popover-table .popover-row .delta.--positive{color:var(--wmcolor-linechart-delta-text-positive)}:host .popover .popover-table .popover-row .delta.--negative{color:var(--wmcolor-linechart-delta-text-negative)}:host .highlight{position:absolute;height:100%;background-color:color-mix(in srgb, var(--wmcolor-linechart-highlight-background) 60%, transparent);left:var(--startPercentage);right:var(--endPercentage)}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var LineChart=function(){function t(t){var i=this;registerInstance(this,t);this.minTickWidth=120;this.popoverData=[];this.focusedDataPoint=[0,0];this.dataPointMatrix=[];this.xIntervals=[];this.displayedXIntervals=[];this.yIntervals=[];this.lineStyles=[{color:"#8b86ca",icon:"f536"},{color:"#2e1b46",icon:"f12f"},{color:"#0089e4",icon:"f763"},{color:"#088000",icon:"f4ce"},{color:"#ea8500",icon:"f70a"},{color:"#d54f41",icon:"f536"},{color:"#146ca9",icon:"f6ff"}];this.debouncedResize=debounce((function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){this.displayedXIntervals=this.determineDisplayedXIntervals();return[2]}))}))}),100);this.label=undefined;this.description="";this.xAxisLabel=undefined;this.yAxisLabel=undefined;this.lineData=undefined;this.units="null,null";this.labelWidth="120px";this.highlightQualifier="highlighted";this.highlightStart=undefined;this.highlightEnd=undefined;this.visibilityToggles=false;this.showDeltas=false;this.yRange=undefined;this.parsedLineData={};this.popoverIndex=-1;this.focusedLine=-1;this.hiddenLines=[];this.isTabbing=false;this.intervalSkip=0;this.announcement=""}t.prototype.parseData=function(){var t=this;this.parsedLineData=JSON.parse(this.lineData);this.yIntervals=this.calcYIntervals().reverse();this.xIntervals=Object.keys(Object.values(this.parsedLineData)[0]);this.displayedXIntervals=this.determineDisplayedXIntervals();this.dataPointMatrix=Object.entries(this.parsedLineData).map((function(i){return t.buildLineDataPointDetails(i[0],i[1])}));this.popoverData=transposeMatrix(this.dataPointMatrix)};t.prototype.handleIntervalSkip=function(){this.parseData()};Object.defineProperty(t.prototype,"hasPartialInterval",{get:function(){return this.intervalSkip>0&&this.xIntervals.length%2===0},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"parsedUnits",{get:function(){return csvToArray(this.units).map((function(t){return t==="null"?null:t}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"visibilityToggleEls",{get:function(){return this.legendEl.querySelectorAll("wm-button")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"lineEls",{get:function(){return this.plotAreaEl.querySelectorAll(".line")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"firstVisibleLineIdx",{get:function(){var t=0;while(this.hiddenLines.includes(t)){t++}return t<this.dataPointMatrix.length?t:-1},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"pointEls",{get:function(){return this.plotAreaEl.querySelectorAll(".point")},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.componentWillLoad=function(){this.parseData()};t.prototype.componentDidLoad=function(){var t=this;var i=new ResizeObserver((function(){return t.debouncedResize()}));i.observe(this.el)};t.prototype.handleVisibilityToggleKeydown=function(t,i){switch(t.key){case"Tab":if(!t.shiftKey&&this.firstVisibleLineIdx!==-1){t.preventDefault();this.announce(this.lineFocusMessage(this.firstVisibleLineIdx));this.focusDataPoint(this.firstVisibleLineIdx,0)}break;case"ArrowUp":case"ArrowLeft":t.preventDefault();var e=wrapAround(i,-1,this.dataPointMatrix.length-1);this.visibilityToggleEls[e].focus();break;case"ArrowDown":case"ArrowRight":t.preventDefault();var r=wrapAround(i,1,this.dataPointMatrix.length-1);this.visibilityToggleEls[r].focus();break}};t.prototype.handleDataPointKeydown=function(t){var i=this.focusedDataPoint,e=i[0],r=i[1];var n=this.lineEls[e].querySelectorAll(".point").length;var o=this.dataPointMatrix.length;switch(t.key){case"Tab":if(t.shiftKey&&this.visibilityToggles){t.preventDefault();this.visibilityToggleEls[0].focus()}break;case"ArrowUp":t.preventDefault();var a=e;do{a=wrapAround(a,-1,o-1)}while(this.hiddenLines.includes(a));this.announce(this.lineFocusMessage(a));this.focusDataPoint(a,r);break;case"ArrowDown":t.preventDefault();var s=e;do{s=wrapAround(s,1,o-1)}while(this.hiddenLines.includes(s));this.announce(this.lineFocusMessage(s));this.focusDataPoint(s,r);break;case"ArrowLeft":t.preventDefault();var l=wrapAround(r,-1,n-1);this.focusDataPoint(e,l);break;case"ArrowRight":t.preventDefault();var h=wrapAround(r,1,n-1);this.focusDataPoint(e,h);break}};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.lineFocusMessage=function(t){var i=this.dataPointMatrix[t][0].lineLabel;var e=this.dataPointMatrix[t].filter((function(t){return t.yValue!==null})).length;return"".concat(i,", line ").concat(t+1," of ").concat(this.dataPointMatrix.length," with ").concat(e," data points")};t.prototype.focusDataPoint=function(t,i){var e=this.lineEls[t];var r=e.querySelectorAll(".point")[i];this.pointEls.forEach((function(t){return t.tabIndex=-1}));r.tabIndex=0;r.focus();this.focusedDataPoint=[t,i]};t.prototype.focusDataPointByEl=function(t){var i=parseInt(t.dataset.lineidx);var e=Array.from(t.parentElement.querySelectorAll(".point")).indexOf(t);this.pointEls.forEach((function(t){return t.tabIndex=-1}));t.tabIndex=0;t.focus();this.focusedDataPoint=[i,e]};t.prototype.calcYIntervals=function(){var t=[];if(this.yRange){t=csvToArray(this.yRange).map((function(t){return parseInt(t)}))}else{var i=[];var e=Object.values(this.parsedLineData).flat();e.forEach((function(t){return i.push.apply(i,Object.values(t))}));var r=i.filter((function(t){return t!==null}));var n=Math.min.apply(Math,r);var o=Math.max.apply(Math,r);var a=getInterval(o-n,4);var s=a;while(n%a!==0&&s>0){n--;s--}a=getInterval(o-n,4);var l=n;while(l<=o+a){t.push(l);l+=a}}return t};t.prototype.determineDisplayedXIntervals=function(){var t=this.plotAreaEl&&this.plotAreaEl.clientWidth>0?Math.round(this.plotAreaEl.clientWidth/this.minTickWidth):this.xIntervals.length;var i=getSmallestSkipInterval(this.xIntervals,t),e=i.skipInterval,r=i.skippedList;this.intervalSkip=e;return r};t.prototype.buildLineDataPointDetails=function(t,i){var e=this;var r=[];var n=Object.entries(i);var o;n.forEach((function(i,a){var s=i[0],l=i[1];var h=100/(n.length-1)*a;var c=l===null?null:100-calcPercentageInRange(l,e.yIntervals[e.yIntervals.length-1],e.yIntervals[0]);if(a===0){h+=e.plotAreaEl&&e.plotAreaEl.clientWidth>0?8/e.plotAreaEl.clientWidth*100:1}if(s===e.highlightStart&&!o){o=true}r.push({lineLabel:t,xValue:s,yValue:l,xPositionPercent:h,yPositionPercent:c,highlighted:o});if(s===e.highlightEnd&&o){o=false}}));return r};t.prototype.toggleLineVisibility=function(t){if(this.hiddenLines.includes(t)){this.hiddenLines=this.hiddenLines.filter((function(i){return i!==t}))}else{this.hiddenLines.push(t)}forceUpdate(this.el)};t.prototype.resetDataPointFocus=function(){this.popoverIndex=-1;this.pointEls.forEach((function(t){return t.tabIndex=-1}));if(this.firstVisibleLineIdx!==-1){var t=this.lineEls[this.firstVisibleLineIdx];var i=t.querySelectorAll(".point")[0];i.tabIndex=0;this.focusedDataPoint=[this.firstVisibleLineIdx,0]}};t.prototype.calcDelta=function(t,i){var e;if(t.yValue===null||i.yValue===null){e=lineChartMessages.noData}else if(t.yValue==i.yValue){e="0%"}else if(i.yValue==0){e="-"}else{var r=(t.yValue-i.yValue)/i.yValue*100;var n=Math.round(r*100)/100;e="".concat(n>0?"+":"").concat(n,"%")}return e};t.prototype.renderLegend=function(){var t=this;var i=Object.keys(this.parsedLineData);return h("div",{ref:function(i){return t.legendEl=i},class:"legend"},i.map((function(i,e){var r=t.hiddenLines.includes(e);var n=t.focusedLine!==-1&&t.focusedLine!==e;return h("div",{id:"legend-label-".concat(e),class:"legend-label ".concat(n?"faded":""),onMouseEnter:function(){return t.focusedLine=r?-1:e},onMouseLeave:function(){return t.focusedLine=-1}},t.renderIcon(e),i,t.visibilityToggles&&t.renderVisibilityToggle(i,e,r))})))};t.prototype.renderVisibilityToggle=function(t,i,e){var r=this;return h("wm-button",{id:"visibility-button-".concat(i),class:"visibility-toggle","label-for-identical-buttons":"".concat(i===0?"Toggle line visibility list with ".concat(this.dataPointMatrix.length," items"):""," ").concat(e?globalMessages.show:globalMessages.hide," ").concat(t," toggle ").concat(e?"pressed":""),"button-type":"navigational",tooltip:e?globalMessages.show:globalMessages.hide,tooltipPosition:"bottom",icon:e?"f209":"f208",onClick:function(){return r.toggleLineVisibility(i)},onKeyDown:function(t){return r.handleVisibilityToggleKeydown(t,i)},onFocus:function(){return r.popoverIndex=-1}})};t.prototype.renderIcon=function(t){var i=this.lineStyles[t],e=i.color,r=i.icon;var n={"--iconColor":e,"--icon":'"\\'.concat(r,'"'),"--translation":t===5?"rotate(180deg)":"unset"};return h("span",{class:"icon",style:n})};t.prototype.renderXIntervals=function(){var t=this;var i={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return h("div",{class:"x-intervals",style:i},this.xIntervals.map((function(i){return h("span",{class:"x-interval ".concat(t.displayedXIntervals.includes(i)?"":"hidden")},i)})))};t.prototype.renderYIntervals=function(){var t=this;return h("div",{ref:function(i){return t.yIntervalsEl=i},class:"y-intervals"},this.yIntervals.map((function(t){return h("span",{class:"y-interval"},abbrNumber(t))})))};t.prototype.renderData=function(){var t=this;return this.dataPointMatrix.map((function(i,e){var r=t.focusedLine===e?"focused":"faded";var n=t.hiddenLines.includes(e);return h("div",{class:"line ".concat(t.focusedLine!==-1?r:""," ").concat(n?"hidden":"")},t.renderLines(e),t.renderPoints(e))}))};t.prototype.renderPoints=function(t){var i=this;var e=this.dataPointMatrix[t];return h("div",{class:"line-icons"},e.map((function(r,n){var o=r.lineLabel,a=r.xValue,s=r.yValue,l=r.xPositionPercent,c=r.yPositionPercent,u=r.highlighted;if(s!==null){var p=i.lineStyles[t],f=p.color,v=p.icon;var d=t===0&&n===0?0:undefined;var g={"--icon":'"\\'.concat(v,'"'),"--iconColor":f,"--xPosition":l+"%","--yPosition":c+"%","--translation":t===5?"translate(-50%, -50%) rotate(180deg)":"translate(-50%, -50%)"};var b="".concat(o," ").concat(u?i.highlightQualifier:""," ").concat(i.xAxisLabel," ").concat(a+(i.parsedUnits[0]?i.parsedUnits[0]:""),", ").concat(i.yAxisLabel,": ").concat(s+(i.parsedUnits[1]?i.parsedUnits[1]:""));if(i.showDeltas&&n>0){var x=e[n-1];var m=lineChartMessages.getChangeSince(x.xValue);b+=", ".concat(m," ").concat(i.calcDelta(r,x))}return h("span",{id:"".concat(o,"-").concat(n),role:"img","aria-label":b,tabIndex:d,class:"point icon",style:g,"data-lineidx":t,"data-xvalue":a,onKeyDown:function(t){return i.handleDataPointKeydown(t)},onFocus:function(){return i.popoverIndex=n},onClick:function(t){return i.focusDataPointByEl(t.target)},onMouseEnter:function(){return i.popoverIndex=n}})}})))};t.prototype.renderLines=function(t){var i=this;var e=this.dataPointMatrix[t];return h("svg",{class:"line-svg"},e.map((function(r,n){var o=r.yValue!==null&&n!==e.length-1&&e[n+1].yValue!==null;if(o){var a=i.lineStyles[t].color;var s=r.xPositionPercent,l=r.yPositionPercent;var c=e[n+1],u=c.xPositionPercent,p=c.yPositionPercent;return h("line",{x1:s+"%",y1:l+"%",x2:u+"%",y2:p+"%",stroke:a,"stroke-width":"2px"})}})))};t.prototype.renderHoverAreas=function(){var t=this;var i={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return h("div",{class:"hover-area-wrapper",style:i,onMouseLeave:function(){return t.popoverIndex=-1}},this.xIntervals.map((function(i,e){return h("div",{onMouseEnter:function(){return t.popoverIndex=e}})})))};t.prototype.renderPopover=function(){var t=this;var i=this.popoverData&&this.popoverData[this.popoverIndex]&&this.plotAreaEl.querySelector('.point[data-xvalue="'.concat(this.dataPointMatrix[0][this.popoverIndex].xValue,'"]'));if(!i){return""}var e=this.popoverData[this.popoverIndex];var r=e[0].xPositionPercent;var n=e.map((function(t){return t.yPositionPercent})).filter((function(t){return t!==null}));var o=n.reduce((function(t,i){return t+i}),0)/n.length;var a=this.plotAreaEl.querySelector('.point[data-xvalue="'.concat(this.dataPointMatrix[0][this.popoverIndex].xValue,'"]'));var s=this.el.getBoundingClientRect();var l=a.getBoundingClientRect();var c=s.right-l.right;var u=l.left-s.left;var p=c>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var f=u>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var v=8/this.plotAreaEl.clientWidth*100;var d={"--leftPosition":p?r+v+"%":"unset","--rightPosition":f?100-r+v+"%":"unset","--topPosition":o+"%",transform:"translateY(-50%)"};if(!f&&!p){var g="0px - ".concat(this.labelWidth," - 20px - ").concat(this.yIntervalsEl.clientWidth+"px"," + ").concat(this.el.scrollLeft+"px"," + 2px");d={"--leftPosition":"0%","--topPosition":"0%",maxWidth:Math.min(this.el.clientWidth-2,400)+"px",transform:"translateX(calc(".concat(g,"))")}}return h("div",{ref:function(i){return t.popoverEl=i},class:"popover",style:d},h("div",{class:"title"},e[0].xValue,this.parsedUnits[0]&&h("span",{class:"unit --x"},"(",this.parsedUnits[0],")")),this.showDeltas&&this.popoverIndex>0&&h("div",{class:"comparison-title"},lineChartMessages.getChangeSince(this.popoverData[this.popoverIndex-1][0].xValue)),this.renderPopoverTable())};t.prototype.renderPopoverTable=function(){var t=this;var i=this.popoverData[this.popoverIndex];return h("table",{class:"popover-table"},i.map((function(i,e){if(!t.hiddenLines.includes(e)){var r=i.lineLabel,n=i.yValue;var o=t.popoverIndex>0?t.popoverData[t.popoverIndex-1][e]:null;var a=n!==null?(new Intl.NumberFormat).format(n):null;return h("tr",{class:"popover-row"},h("td",null,t.renderIcon(e)),h("td",{class:"row-label"},r),h("td",{class:"row-value"},n===null?lineChartMessages.noData:a,n!==null&&t.parsedUnits[1]&&h("span",{class:"unit --y"},t.parsedUnits[1])),t.showDeltas&&o&&t.renderDeltas(i,o))}})))};t.prototype.renderDeltas=function(t,i){var e=this.calcDelta(t,i);var r=e.toString()[0]=="+"||e=="-"?"positive":e.toString()[0]=="-"?"negative":"";return i&&h("td",{class:"delta --".concat(r)},e)};t.prototype.renderHoverIndicator=function(){var t=this.dataPointMatrix.length>0&&this.dataPointMatrix[0][this.popoverIndex];if(!t){return""}var i=this.dataPointMatrix[0][this.popoverIndex].xPositionPercent;var e={"--xPosition":i+"%"};return h("div",{class:"hover-indicator",style:e})};t.prototype.renderHighlight=function(){var t=this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightStart)].xPositionPercent;var i=this.highlightEnd?100-this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightEnd)].xPositionPercent:0;var e={"--startPercentage":t+"%","--endPercentage":i+"%"};return h("div",{class:"highlight",style:e})};t.prototype.render=function(){var t=this;return h(Host,{onBlur:function(){return t.resetDataPointFocus()},onMouseLeave:function(){return t.popoverIndex=-1}},h("div",{class:"component-wrapper",role:"application","aria-roledescription":chartMessages.interactiveChart,"aria-label":this.label,"aria-describedby":"chart-description"},this.renderLegend(),h("div",{class:"chart-wrapper"},h("div",{class:"chart-label --y-axis",style:{"--labelWidth":this.labelWidth}},this.yAxisLabel,this.parsedUnits[1]&&" (".concat(this.parsedUnits[1],")")),this.renderYIntervals(),h("div",{ref:function(i){return t.plotAreaEl=i},class:"plot-area ".concat(this.hasPartialInterval?"":"right-border"),style:{"--backgroundSize":"".concat(this.dataPointMatrix[0][this.xIntervals.indexOf(this.displayedXIntervals[1])].xPositionPercent,"%")}},this.highlightStart&&this.renderHighlight(),this.renderData(),this.renderHoverAreas()),this.popoverIndex!==-1&&this.renderHoverIndicator(),this.popoverIndex!==-1&&this.renderPopover(),this.renderXIntervals(),h("div",{class:"chart-label --x-axis"},this.xAxisLabel,this.parsedUnits[0]&&" (".concat(this.parsedUnits[0],")"))),h("div",{id:"chart-description",class:"sr-only"},"".concat(lineChartMessages.instructions," ").concat(this.description)),h("div",{ref:function(i){return t.liveRegionEl=i},"aria-live":"polite",class:"sr-only"},this.announcement)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{lineData:["parseData"],intervalSkip:["handleIntervalSkip"]}},enumerable:false,configurable:true});return t}();LineChart.style=wmLineChartCss;export{LineChart as wm_line_chart};
1
+ var __awaiter=this&&this.__awaiter||function(t,i,e,r){function n(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){t.done?e(t.value):n(t.value).then(a,s)}l((r=r.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,n,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return l([t,i])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(e=0)),e)try{if(r=1,n&&(o=s[0]&2?n["return"]:s[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;if(n=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){e.label=s[1];break}if(s[0]===6&&e.label<o[1]){e.label=o[1];o=s;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(s);break}if(o[2])e.ops.pop();e.trys.pop();continue}s=i.call(t,e)}catch(t){s=[6,t];n=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,f as forceUpdate,h,H as Host,g as getElement}from"./index-558b5a82.js";import{d as debounce,E as transposeMatrix,x as csvToArray,F as wrapAround,G as getSmallestSkipInterval,H as calcPercentageInRange}from"./functions-46843ea0.js";import{n as abbrNumber,o as getInterval}from"./chartFunctions-0ebf83f3.js";import{l as lineChartMessages,c as chartMessages,g as globalMessages}from"./intl-8b8740b9.js";var wmLineChartCss=':host{--wmcolor-linechart-currentposition:var(--wmcolor-lavender);--wmcolor-linechart-delta-text-negative:var(--wmcolor-text-negative);--wmcolor-linechart-delta-text-positive:var(--wmcolor-text-positive);--wmcolor-linechart-gridline:var(--wmcolor-chart-gridline);--wmcolor-linechart-highlight-background:var(--wmcolor-interactive-background-highlight);--wmcolor-linechart-popover-background:var(--wmcolor-chart-popover-background);display:block;height:500px;width:100%;font-size:14px;overflow-y:visible;overflow-x:auto}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:562px;width:100%;height:100%;outline:none}:host .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;position:relative;color:var(--iconColor);-webkit-transform:var(--translation, unset);transform:var(--translation, unset)}:host .icon:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:var(--icon);padding:0 3px;z-index:1}:host .icon:after{color:white;position:absolute;left:3px;-webkit-transform:scale(180%);transform:scale(180%);display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:var(--icon);z-index:0}:host .legend{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px 16px;margin-top:4px;margin-bottom:16px}:host .legend .legend-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:default;font-weight:600}:host .legend .legend-label.faded{opacity:0.3}:host .legend .legend-label .icon{margin-right:4px}:host .legend .visibility-toggle{margin-left:4px}:host .chart-wrapper{position:relative;-ms-flex-positive:1;flex-grow:1;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:1fr auto auto;margin-right:16px}:host .chart-label{font-size:14px;font-weight:600}:host .chart-label.--y-axis{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:var(--labelWidth);align-self:center;margin-right:16px;grid-area:1/1/2/2;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}:host .chart-label.--x-axis{margin-top:16px;text-align:center;grid-area:3/3/4/4}:host .y-intervals{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;grid-area:1/2/2/3;margin-right:4px}:host .y-intervals .y-interval{text-align:right}:host .x-intervals{display:grid;grid-template-columns:var(--columns);grid-area:2/3/3/4;line-height:1;margin-top:4px}:host .x-intervals .x-interval{text-align:center}:host .x-intervals .x-interval:first-child{text-align:left}:host .x-intervals .x-interval:last-child{text-align:right}:host .x-intervals .x-interval.hidden{visibility:hidden}:host .plot-area{position:relative;grid-area:1/3/2/4;background-image:linear-gradient(90deg, var(--wmcolor-linechart-gridline) 1px, transparent 1px);border-bottom:1px solid var(--wmcolor-linechart-gridline);background-size:var(--backgroundSize)}:host .plot-area.right-border{border-right:1px solid var(--wmcolor-linechart-gridline)}:host .line{position:absolute;width:100%;height:100%}:host .line .icon{position:absolute;-webkit-transform:var(--translation);transform:var(--translation);left:var(--xPosition);top:var(--yPosition);z-index:1}:host .line .icon:focus{z-index:2;outline:none}:host .line .icon:focus:before{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:0;border-radius:3px}:host .line .line-svg{height:100%;width:100%}:host .line.faded{opacity:0.3}:host .line.focused{z-index:1}:host .line.hidden{visibility:hidden}:host .hover-area-wrapper{position:absolute;width:100%;height:100%;top:0;left:0;display:grid;grid-template-rows:1fr;grid-template-columns:var(--columns)}:host .hover-indicator{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;height:100%;width:2px;border:1px solid var(--wmcolor-linechart-currentposition);-webkit-transform:translateX(-50%);transform:translateX(-50%);left:var(--xPosition);grid-column:3/4;grid-row:1/2;pointer-events:none}:host .popover{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:400px;background-color:var(--wmcolor-linechart-popover-background);position:absolute;top:var(--topPosition, 0);left:var(--leftPosition, unset);right:var(--rightPosition, unset);padding:16px;border-radius:5px;-webkit-box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);-webkit-transform:translateY(-50%);transform:translateY(-50%);line-height:1;z-index:3;grid-column:3/4;grid-row:1/2;pointer-events:none;-webkit-box-sizing:border-box;box-sizing:border-box}:host .popover .title{font-size:16px;font-weight:600}:host .popover .comparison-title{font-style:italic;margin-top:4px}:host .popover .unit{font-size:12px;font-weight:600}:host .popover .unit.--x{margin-left:4px}:host .popover .popover-table{margin-top:16px}:host .popover .popover-table .popover-row{line-height:1}:host .popover .popover-table .popover-row:not(:last-child) td{padding-bottom:8px}:host .popover .popover-table .popover-row .row-label{font-weight:600;padding-right:16px;overflow-wrap:anywhere}:host .popover .popover-table .popover-row .row-label .icon{margin-right:4px}:host .popover .popover-table .popover-row .row-value,:host .popover .popover-table .popover-row .delta{text-align:right;white-space:nowrap}:host .popover .popover-table .popover-row .delta{padding-left:12px;font-weight:600}:host .popover .popover-table .popover-row .delta.--positive{color:var(--wmcolor-linechart-delta-text-positive)}:host .popover .popover-table .popover-row .delta.--negative{color:var(--wmcolor-linechart-delta-text-negative)}:host .highlight{position:absolute;height:100%;background-color:color-mix(in srgb, var(--wmcolor-linechart-highlight-background) 60%, transparent);left:var(--startPercentage);right:var(--endPercentage)}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var LineChart=function(){function t(t){var i=this;registerInstance(this,t);this.minTickWidth=120;this.popoverData=[];this.focusedDataPoint=[0,0];this.dataPointMatrix=[];this.xIntervals=[];this.displayedXIntervals=[];this.yIntervals=[];this.lineStyles=[{color:"#8b86ca",icon:"f536"},{color:"#2e1b46",icon:"f12f"},{color:"#0089e4",icon:"f763"},{color:"#088000",icon:"f4ce"},{color:"#ea8500",icon:"f70a"},{color:"#d54f41",icon:"f536"},{color:"#146ca9",icon:"f6ff"}];this.debouncedResize=debounce((function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){this.displayedXIntervals=this.determineDisplayedXIntervals();return[2]}))}))}),100);this.label=undefined;this.description="";this.xAxisLabel=undefined;this.yAxisLabel=undefined;this.lineData=undefined;this.units="null,null";this.labelWidth="120px";this.highlightQualifier="highlighted";this.highlightStart=undefined;this.highlightEnd=undefined;this.visibilityToggles=false;this.showDeltas=false;this.yRange=undefined;this.parsedLineData={};this.popoverIndex=-1;this.focusedLine=-1;this.hiddenLines=[];this.isTabbing=false;this.intervalSkip=0;this.announcement=""}t.prototype.parseData=function(){var t=this;this.parsedLineData=JSON.parse(this.lineData);this.yIntervals=this.calcYIntervals().reverse();this.xIntervals=Object.keys(Object.values(this.parsedLineData)[0]);this.displayedXIntervals=this.determineDisplayedXIntervals();this.dataPointMatrix=Object.entries(this.parsedLineData).map((function(i){return t.buildLineDataPointDetails(i[0],i[1])}));this.popoverData=transposeMatrix(this.dataPointMatrix)};t.prototype.handleIntervalSkip=function(){this.parseData()};Object.defineProperty(t.prototype,"hasPartialInterval",{get:function(){return this.intervalSkip>0&&this.xIntervals.length%2===0},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"parsedUnits",{get:function(){return csvToArray(this.units).map((function(t){return t==="null"?null:t}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"visibilityToggleEls",{get:function(){return this.legendEl.querySelectorAll("wm-button")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"lineEls",{get:function(){return this.plotAreaEl.querySelectorAll(".line")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"firstVisibleLineIdx",{get:function(){var t=0;while(this.hiddenLines.includes(t)){t++}return t<this.dataPointMatrix.length?t:-1},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"pointEls",{get:function(){return this.plotAreaEl.querySelectorAll(".point")},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.componentWillLoad=function(){this.parseData()};t.prototype.componentDidLoad=function(){var t=this;var i=new ResizeObserver((function(){return t.debouncedResize()}));i.observe(this.el)};t.prototype.handleVisibilityToggleKeydown=function(t,i){switch(t.key){case"Tab":if(!t.shiftKey&&this.firstVisibleLineIdx!==-1){t.preventDefault();this.announce(this.lineFocusMessage(this.firstVisibleLineIdx));this.focusDataPoint(this.firstVisibleLineIdx,0)}break;case"ArrowUp":case"ArrowLeft":t.preventDefault();var e=wrapAround(i,-1,this.dataPointMatrix.length-1);this.visibilityToggleEls[e].focus();break;case"ArrowDown":case"ArrowRight":t.preventDefault();var r=wrapAround(i,1,this.dataPointMatrix.length-1);this.visibilityToggleEls[r].focus();break}};t.prototype.handleDataPointKeydown=function(t){var i=this.focusedDataPoint,e=i[0],r=i[1];var n=this.lineEls[e].querySelectorAll(".point").length;var o=this.dataPointMatrix.length;switch(t.key){case"Tab":if(t.shiftKey&&this.visibilityToggles){t.preventDefault();this.visibilityToggleEls[0].focus()}break;case"ArrowUp":t.preventDefault();var a=e;do{a=wrapAround(a,-1,o-1)}while(this.hiddenLines.includes(a));this.announce(this.lineFocusMessage(a));this.focusDataPoint(a,r);break;case"ArrowDown":t.preventDefault();var s=e;do{s=wrapAround(s,1,o-1)}while(this.hiddenLines.includes(s));this.announce(this.lineFocusMessage(s));this.focusDataPoint(s,r);break;case"ArrowLeft":t.preventDefault();var l=wrapAround(r,-1,n-1);this.focusDataPoint(e,l);break;case"ArrowRight":t.preventDefault();var h=wrapAround(r,1,n-1);this.focusDataPoint(e,h);break}};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.lineFocusMessage=function(t){var i=this.dataPointMatrix[t][0].lineLabel;var e=this.dataPointMatrix[t].filter((function(t){return t.yValue!==null})).length;return"".concat(i,", line ").concat(t+1," of ").concat(this.dataPointMatrix.length," with ").concat(e," data points")};t.prototype.focusDataPoint=function(t,i){var e=this.lineEls[t];var r=e.querySelectorAll(".point")[i];this.pointEls.forEach((function(t){return t.tabIndex=-1}));r.tabIndex=0;r.focus();this.focusedDataPoint=[t,i]};t.prototype.focusDataPointByEl=function(t){var i=parseInt(t.dataset.lineidx);var e=Array.from(t.parentElement.querySelectorAll(".point")).indexOf(t);this.pointEls.forEach((function(t){return t.tabIndex=-1}));t.tabIndex=0;t.focus();this.focusedDataPoint=[i,e]};t.prototype.calcYIntervals=function(){var t=[];if(this.yRange){t=csvToArray(this.yRange).map((function(t){return parseInt(t)}))}else{var i=[];var e=Object.values(this.parsedLineData).flat();e.forEach((function(t){return i.push.apply(i,Object.values(t))}));var r=i.filter((function(t){return t!==null}));var n=Math.min.apply(Math,r);var o=Math.max.apply(Math,r);var a=getInterval(o-n,4);var s=a;while(n%a!==0&&s>0){n--;s--}a=getInterval(o-n,4);var l=n;while(l<=o+a){t.push(l);l+=a}}return t};t.prototype.determineDisplayedXIntervals=function(){var t=this.plotAreaEl&&this.plotAreaEl.clientWidth>0?Math.round(this.plotAreaEl.clientWidth/this.minTickWidth):this.xIntervals.length;var i=getSmallestSkipInterval(this.xIntervals,t),e=i.skipInterval,r=i.skippedList;this.intervalSkip=e;return r};t.prototype.buildLineDataPointDetails=function(t,i){var e=this;var r=[];var n=Object.entries(i);var o;n.forEach((function(i,a){var s=i[0],l=i[1];var h=100/(n.length-1)*a;var c=l===null?null:100-calcPercentageInRange(l,e.yIntervals[e.yIntervals.length-1],e.yIntervals[0]);if(a===0){h+=e.plotAreaEl&&e.plotAreaEl.clientWidth>0?8/e.plotAreaEl.clientWidth*100:1}if(s===e.highlightStart&&!o){o=true}r.push({lineLabel:t,xValue:s,yValue:l,xPositionPercent:h,yPositionPercent:c,highlighted:o});if(s===e.highlightEnd&&o){o=false}}));return r};t.prototype.toggleLineVisibility=function(t){if(this.hiddenLines.includes(t)){this.hiddenLines=this.hiddenLines.filter((function(i){return i!==t}))}else{this.hiddenLines.push(t)}forceUpdate(this.el)};t.prototype.resetDataPointFocus=function(){this.popoverIndex=-1;this.pointEls.forEach((function(t){return t.tabIndex=-1}));if(this.firstVisibleLineIdx!==-1){var t=this.lineEls[this.firstVisibleLineIdx];var i=t.querySelectorAll(".point")[0];i.tabIndex=0;this.focusedDataPoint=[this.firstVisibleLineIdx,0]}};t.prototype.calcDelta=function(t,i){var e;if(t.yValue===null||i.yValue===null){e=lineChartMessages.noData}else if(t.yValue==i.yValue){e="0%"}else if(i.yValue==0){e="-"}else{var r=(t.yValue-i.yValue)/i.yValue*100;var n=Math.round(r*100)/100;e="".concat(n>0?"+":"").concat(n,"%")}return e};t.prototype.renderLegend=function(){var t=this;var i=Object.keys(this.parsedLineData);return h("div",{ref:function(i){return t.legendEl=i},class:"legend"},i.map((function(i,e){var r=t.hiddenLines.includes(e);var n=t.focusedLine!==-1&&t.focusedLine!==e;return h("div",{id:"legend-label-".concat(e),class:"legend-label ".concat(n?"faded":""),onMouseEnter:function(){return t.focusedLine=r?-1:e},onMouseLeave:function(){return t.focusedLine=-1}},t.renderIcon(e),i,t.visibilityToggles&&t.renderVisibilityToggle(i,e,r))})))};t.prototype.renderVisibilityToggle=function(t,i,e){var r=this;return h("wm-button",{id:"visibility-button-".concat(i),class:"visibility-toggle","label-for-identical-buttons":"".concat(i===0?"Toggle line visibility list with ".concat(this.dataPointMatrix.length," items"):""," ").concat(e?globalMessages.show:globalMessages.hide," ").concat(t," toggle ").concat(e?"pressed":""),"button-type":"navigational",tooltip:e?globalMessages.show:globalMessages.hide,tooltipPosition:"bottom",icon:e?"f209":"f208",onClick:function(){return r.toggleLineVisibility(i)},onKeyDown:function(t){return r.handleVisibilityToggleKeydown(t,i)},onFocus:function(){return r.popoverIndex=-1}})};t.prototype.renderIcon=function(t){var i=this.lineStyles[t],e=i.color,r=i.icon;var n={"--iconColor":e,"--icon":'"\\'.concat(r,'"'),"--translation":t===5?"rotate(180deg)":"unset"};return h("span",{class:"icon",style:n})};t.prototype.renderXIntervals=function(){var t=this;var i={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return h("div",{class:"x-intervals",style:i},this.xIntervals.map((function(i){return h("span",{class:"x-interval ".concat(t.displayedXIntervals.includes(i)?"":"hidden")},i)})))};t.prototype.renderYIntervals=function(){var t=this;return h("div",{ref:function(i){return t.yIntervalsEl=i},class:"y-intervals"},this.yIntervals.map((function(t){return h("span",{class:"y-interval"},abbrNumber(t))})))};t.prototype.renderData=function(){var t=this;return this.dataPointMatrix.map((function(i,e){var r=t.focusedLine===e?"focused":"faded";var n=t.hiddenLines.includes(e);return h("div",{class:"line ".concat(t.focusedLine!==-1?r:""," ").concat(n?"hidden":"")},t.renderLines(e),t.renderPoints(e))}))};t.prototype.renderPoints=function(t){var i=this;var e=this.dataPointMatrix[t];return h("div",{class:"line-icons"},e.map((function(r,n){var o=r.lineLabel,a=r.xValue,s=r.yValue,l=r.xPositionPercent,c=r.yPositionPercent,u=r.highlighted;if(s!==null){var p=i.lineStyles[t],f=p.color,v=p.icon;var d=t===0&&n===0?0:undefined;var g={"--icon":'"\\'.concat(v,'"'),"--iconColor":f,"--xPosition":l+"%","--yPosition":c+"%","--translation":t===5?"translate(-50%, -50%) rotate(180deg)":"translate(-50%, -50%)"};var b="".concat(o," ").concat(u?i.highlightQualifier:""," ").concat(i.xAxisLabel," ").concat(a+(i.parsedUnits[0]?i.parsedUnits[0]:""),", ").concat(i.yAxisLabel,": ").concat(s+(i.parsedUnits[1]?i.parsedUnits[1]:""));if(i.showDeltas&&n>0){var x=e[n-1];var m=lineChartMessages.getChangeSince(x.xValue);b+=", ".concat(m," ").concat(i.calcDelta(r,x))}return h("span",{id:"".concat(o,"-").concat(n),role:"img","aria-label":b,tabIndex:d,class:"point icon",style:g,"data-lineidx":t,"data-xvalue":a,onKeyDown:function(t){return i.handleDataPointKeydown(t)},onFocus:function(){return i.popoverIndex=n},onClick:function(t){return i.focusDataPointByEl(t.target)},onMouseEnter:function(){return i.popoverIndex=n}})}})))};t.prototype.renderLines=function(t){var i=this;var e=this.dataPointMatrix[t];return h("svg",{class:"line-svg"},e.map((function(r,n){var o=r.yValue!==null&&n!==e.length-1&&e[n+1].yValue!==null;if(o){var a=i.lineStyles[t].color;var s=r.xPositionPercent,l=r.yPositionPercent;var c=e[n+1],u=c.xPositionPercent,p=c.yPositionPercent;return h("line",{x1:s+"%",y1:l+"%",x2:u+"%",y2:p+"%",stroke:a,"stroke-width":"2px"})}})))};t.prototype.renderHoverAreas=function(){var t=this;var i={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return h("div",{class:"hover-area-wrapper",style:i,onMouseLeave:function(){return t.popoverIndex=-1}},this.xIntervals.map((function(i,e){return h("div",{onMouseEnter:function(){return t.popoverIndex=e}})})))};t.prototype.renderPopover=function(){var t=this;var i=this.popoverData&&this.popoverData[this.popoverIndex]&&this.plotAreaEl.querySelector('.point[data-xvalue="'.concat(this.dataPointMatrix[0][this.popoverIndex].xValue,'"]'));if(!i){return""}var e=this.popoverData[this.popoverIndex];var r=e[0].xPositionPercent;var n=e.map((function(t){return t.yPositionPercent})).filter((function(t){return t!==null}));var o=n.reduce((function(t,i){return t+i}),0)/n.length;var a=this.plotAreaEl.querySelector('.point[data-xvalue="'.concat(this.dataPointMatrix[0][this.popoverIndex].xValue,'"]'));var s=this.el.getBoundingClientRect();var l=a.getBoundingClientRect();var c=s.right-l.right;var u=l.left-s.left;var p=c>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var f=u>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var v=8/this.plotAreaEl.clientWidth*100;var d={"--leftPosition":p?r+v+"%":"unset","--rightPosition":f?100-r+v+"%":"unset","--topPosition":o+"%",transform:"translateY(-50%)"};if(!f&&!p){var g="0px - ".concat(this.labelWidth," - 20px - ").concat(this.yIntervalsEl.clientWidth+"px"," + ").concat(this.el.scrollLeft+"px"," + 2px");d={"--leftPosition":"0%","--topPosition":"0%",maxWidth:Math.min(this.el.clientWidth-2,400)+"px",transform:"translateX(calc(".concat(g,"))")}}return h("div",{ref:function(i){return t.popoverEl=i},class:"popover",style:d},h("div",{class:"title"},e[0].xValue,this.parsedUnits[0]&&h("span",{class:"unit --x"},"(",this.parsedUnits[0],")")),this.showDeltas&&this.popoverIndex>0&&h("div",{class:"comparison-title"},lineChartMessages.getChangeSince(this.popoverData[this.popoverIndex-1][0].xValue)),this.renderPopoverTable())};t.prototype.renderPopoverTable=function(){var t=this;var i=this.popoverData[this.popoverIndex];return h("table",{class:"popover-table"},i.map((function(i,e){if(!t.hiddenLines.includes(e)){var r=i.lineLabel,n=i.yValue;var o=t.popoverIndex>0?t.popoverData[t.popoverIndex-1][e]:null;var a=n!==null?(new Intl.NumberFormat).format(n):null;return h("tr",{class:"popover-row"},h("td",null,t.renderIcon(e)),h("td",{class:"row-label"},r),h("td",{class:"row-value"},n===null?lineChartMessages.noData:a,n!==null&&t.parsedUnits[1]&&h("span",{class:"unit --y"},t.parsedUnits[1])),t.showDeltas&&o&&t.renderDeltas(i,o))}})))};t.prototype.renderDeltas=function(t,i){var e=this.calcDelta(t,i);var r=e.toString()[0]=="+"||e=="-"?"positive":e.toString()[0]=="-"?"negative":"";return i&&h("td",{class:"delta --".concat(r)},e)};t.prototype.renderHoverIndicator=function(){var t=this.dataPointMatrix.length>0&&this.dataPointMatrix[0][this.popoverIndex];if(!t){return""}var i=this.dataPointMatrix[0][this.popoverIndex].xPositionPercent;var e={"--xPosition":i+"%"};return h("div",{class:"hover-indicator",style:e})};t.prototype.renderHighlight=function(){var t=this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightStart)].xPositionPercent;var i=this.highlightEnd?100-this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightEnd)].xPositionPercent:0;var e={"--startPercentage":t+"%","--endPercentage":i+"%"};return h("div",{class:"highlight",style:e})};t.prototype.render=function(){var t=this;return h(Host,{onBlur:function(){return t.resetDataPointFocus()},onMouseLeave:function(){return t.popoverIndex=-1}},h("div",{class:"component-wrapper",role:"application","aria-roledescription":chartMessages.interactiveChart,"aria-label":this.label,"aria-describedby":"chart-description"},this.renderLegend(),h("div",{class:"chart-wrapper"},h("div",{class:"chart-label --y-axis",style:{"--labelWidth":this.labelWidth}},this.yAxisLabel,this.parsedUnits[1]&&" (".concat(this.parsedUnits[1],")")),this.renderYIntervals(),h("div",{ref:function(i){return t.plotAreaEl=i},class:"plot-area ".concat(this.hasPartialInterval?"":"right-border"),style:{"--backgroundSize":"".concat(this.dataPointMatrix[0][this.xIntervals.indexOf(this.displayedXIntervals[1])].xPositionPercent,"%")}},this.highlightStart&&this.renderHighlight(),this.renderData(),this.renderHoverAreas()),this.popoverIndex!==-1&&this.renderHoverIndicator(),this.popoverIndex!==-1&&this.renderPopover(),this.renderXIntervals(),h("div",{class:"chart-label --x-axis"},this.xAxisLabel,this.parsedUnits[0]&&" (".concat(this.parsedUnits[0],")"))),h("div",{id:"chart-description",class:"sr-only"},"".concat(lineChartMessages.instructions," ").concat(this.description)),h("div",{ref:function(i){return t.liveRegionEl=i},"aria-live":"polite",class:"sr-only"},this.announcement)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{lineData:["parseData"],intervalSkip:["handleIntervalSkip"]}},enumerable:false,configurable:true});return t}();LineChart.style=wmLineChartCss;export{LineChart as wm_line_chart};