@watermarkinsights/ripple 5.6.0-7 → 5.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/dist/cjs/{chartFunctions-995023b1.js → chartFunctions-6fd43417.js} +1 -1
  2. package/dist/cjs/{functions-e24249e6.js → functions-04149f6d.js} +0 -6
  3. package/dist/cjs/{global-8b5f83e4.js → global-4a315ae6.js} +1 -1
  4. package/dist/cjs/index-e86c28b6.js +0 -12
  5. package/dist/cjs/{intl-5aeba788.js → intl-b1e99809.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/priv-calendar.cjs.entry.js +1 -1
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +1 -1
  9. package/dist/cjs/ripple.cjs.js +2 -2
  10. package/dist/cjs/wm-action-menu_2.cjs.entry.js +1 -1
  11. package/dist/cjs/wm-button.cjs.entry.js +1 -1
  12. package/dist/cjs/wm-chart.cjs.entry.js +3 -3
  13. package/dist/cjs/wm-date-range.cjs.entry.js +1 -1
  14. package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
  15. package/dist/cjs/wm-file.cjs.entry.js +1 -1
  16. package/dist/cjs/wm-input.cjs.entry.js +2 -2
  17. package/dist/cjs/wm-line-chart.cjs.entry.js +3 -3
  18. package/dist/cjs/wm-modal-header.cjs.entry.js +2 -2
  19. package/dist/cjs/wm-modal.cjs.entry.js +1 -1
  20. package/dist/cjs/wm-navigation_3.cjs.entry.js +2 -2
  21. package/dist/cjs/wm-navigator.cjs.entry.js +1 -1
  22. package/dist/cjs/wm-option_2.cjs.entry.js +338 -33
  23. package/dist/cjs/wm-pagination.cjs.entry.js +1 -1
  24. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
  25. package/dist/cjs/wm-search.cjs.entry.js +2 -2
  26. package/dist/cjs/wm-snackbar.cjs.entry.js +2 -2
  27. package/dist/cjs/wm-tab-item_3.cjs.entry.js +1 -1
  28. package/dist/cjs/wm-tag-input.cjs.entry.js +2 -2
  29. package/dist/cjs/wm-tag-option.cjs.entry.js +1 -1
  30. package/dist/cjs/wm-textarea.cjs.entry.js +2 -2
  31. package/dist/cjs/wm-timepicker.cjs.entry.js +1 -1
  32. package/dist/cjs/wm-toggletip.cjs.entry.js +1 -1
  33. package/dist/cjs/wm-uploader.cjs.entry.js +2 -2
  34. package/dist/collection/collection-manifest.json +2 -5
  35. package/dist/collection/components/wm-option/wm-option.js +9 -35
  36. package/dist/collection/components/wm-option/wm-option.spec.js +1 -1
  37. package/dist/collection/components/{selects/wm-select → wm-select}/wm-select.css +74 -0
  38. package/dist/collection/components/{selects/wm-select → wm-select}/wm-select.js +383 -16
  39. package/dist/collection/components/{selects/wm-select → wm-select}/wm-select.spec.js +62 -62
  40. package/dist/collection/global/functions.js +0 -5
  41. package/dist/esm/{chartFunctions-dfcb1edf.js → chartFunctions-f5eb7f59.js} +1 -1
  42. package/dist/esm/{functions-b791a892.js → functions-cf37f81f.js} +1 -6
  43. package/dist/esm/{global-5c6da026.js → global-016b76a8.js} +1 -1
  44. package/dist/esm/index-558b5a82.js +0 -12
  45. package/dist/esm/{intl-f2f7ce8b.js → intl-c72b75dc.js} +1 -1
  46. package/dist/esm/loader.js +2 -2
  47. package/dist/esm/priv-calendar.entry.js +1 -1
  48. package/dist/esm/priv-chart-popover.entry.js +1 -1
  49. package/dist/esm/ripple.js +2 -2
  50. package/dist/esm/wm-action-menu_2.entry.js +1 -1
  51. package/dist/esm/wm-button.entry.js +1 -1
  52. package/dist/esm/wm-chart.entry.js +3 -3
  53. package/dist/esm/wm-date-range.entry.js +1 -1
  54. package/dist/esm/wm-datepicker.entry.js +1 -1
  55. package/dist/esm/wm-file.entry.js +1 -1
  56. package/dist/esm/wm-input.entry.js +2 -2
  57. package/dist/esm/wm-line-chart.entry.js +3 -3
  58. package/dist/esm/wm-modal-header.entry.js +2 -2
  59. package/dist/esm/wm-modal.entry.js +1 -1
  60. package/dist/esm/wm-navigation_3.entry.js +2 -2
  61. package/dist/esm/wm-navigator.entry.js +1 -1
  62. package/dist/esm/wm-option_2.entry.js +338 -33
  63. package/dist/esm/wm-pagination.entry.js +1 -1
  64. package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
  65. package/dist/esm/wm-search.entry.js +2 -2
  66. package/dist/esm/wm-snackbar.entry.js +2 -2
  67. package/dist/esm/wm-tab-item_3.entry.js +1 -1
  68. package/dist/esm/wm-tag-input.entry.js +2 -2
  69. package/dist/esm/wm-tag-option.entry.js +1 -1
  70. package/dist/esm/wm-textarea.entry.js +2 -2
  71. package/dist/esm/wm-timepicker.entry.js +1 -1
  72. package/dist/esm/wm-toggletip.entry.js +1 -1
  73. package/dist/esm/wm-uploader.entry.js +2 -2
  74. package/dist/esm-es5/{chartFunctions-dfcb1edf.js → chartFunctions-f5eb7f59.js} +1 -1
  75. package/dist/esm-es5/{functions-b791a892.js → functions-cf37f81f.js} +1 -1
  76. package/dist/esm-es5/global-016b76a8.js +1 -0
  77. package/dist/esm-es5/index-558b5a82.js +1 -1
  78. package/dist/esm-es5/{intl-f2f7ce8b.js → intl-c72b75dc.js} +1 -1
  79. package/dist/esm-es5/loader.js +1 -1
  80. package/dist/esm-es5/priv-calendar.entry.js +1 -1
  81. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  82. package/dist/esm-es5/ripple.js +1 -1
  83. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  84. package/dist/esm-es5/wm-button.entry.js +1 -1
  85. package/dist/esm-es5/wm-chart.entry.js +1 -1
  86. package/dist/esm-es5/wm-date-range.entry.js +1 -1
  87. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  88. package/dist/esm-es5/wm-file.entry.js +1 -1
  89. package/dist/esm-es5/wm-input.entry.js +1 -1
  90. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  91. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  92. package/dist/esm-es5/wm-modal.entry.js +1 -1
  93. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  94. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  95. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  96. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  97. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  98. package/dist/esm-es5/wm-search.entry.js +1 -1
  99. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  100. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  101. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  102. package/dist/esm-es5/wm-tag-option.entry.js +1 -1
  103. package/dist/esm-es5/wm-textarea.entry.js +1 -1
  104. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  105. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  106. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  107. package/dist/ripple/{p-c1e3c2fb.entry.js → p-04f9a60a.entry.js} +1 -1
  108. package/dist/ripple/{p-41550baa.entry.js → p-0b570b66.entry.js} +1 -1
  109. package/dist/ripple/{p-5300b15d.entry.js → p-0d05b4a9.entry.js} +1 -1
  110. package/dist/ripple/p-11aaef56.system.entry.js +1 -0
  111. package/dist/ripple/{p-b01f9998.system.entry.js → p-120dbdc8.system.entry.js} +1 -1
  112. package/dist/ripple/{p-f24572f5.entry.js → p-1aef4b40.entry.js} +1 -1
  113. package/dist/ripple/{p-13f51c06.entry.js → p-20a800a7.entry.js} +1 -1
  114. package/dist/ripple/{p-236af552.entry.js → p-24103be5.entry.js} +1 -1
  115. package/dist/ripple/{p-1389302e.system.entry.js → p-2ccf8450.system.entry.js} +1 -1
  116. package/dist/ripple/{p-6cc07645.system.entry.js → p-2d0bcc88.system.entry.js} +1 -1
  117. package/dist/ripple/{p-0b1c6965.system.entry.js → p-2d0e4020.system.entry.js} +1 -1
  118. package/dist/ripple/{p-215793a4.entry.js → p-31094930.entry.js} +1 -1
  119. package/dist/ripple/{p-1e625a5e.entry.js → p-3ea0e27c.entry.js} +1 -1
  120. package/dist/ripple/{p-db9657eb.system.entry.js → p-446e0b2c.system.entry.js} +1 -1
  121. package/dist/ripple/{p-72165bd2.entry.js → p-451433a6.entry.js} +1 -1
  122. package/dist/ripple/p-481a9e2f.system.js +1 -0
  123. package/dist/ripple/{p-45f9ad09.entry.js → p-508362c5.entry.js} +1 -1
  124. package/dist/ripple/{p-3deaf4d9.system.entry.js → p-53519eed.system.entry.js} +1 -1
  125. package/dist/ripple/p-55668879.system.js +1 -0
  126. package/dist/ripple/{p-725230dd.system.entry.js → p-5967bd2a.system.entry.js} +1 -1
  127. package/dist/ripple/{p-5a9e3108.system.entry.js → p-5db92638.system.entry.js} +1 -1
  128. package/dist/ripple/{p-3e415c49.system.entry.js → p-5f793375.system.entry.js} +1 -1
  129. package/dist/ripple/p-6636a40b.system.entry.js +1 -0
  130. package/dist/ripple/{p-f90e4094.entry.js → p-6f4c4231.entry.js} +1 -1
  131. package/dist/ripple/{p-828adbf1.system.js → p-74032162.system.js} +1 -1
  132. package/dist/ripple/{p-5284791c.entry.js → p-762429a8.entry.js} +1 -1
  133. package/dist/ripple/{p-16f65bf4.js → p-76825602.js} +1 -1
  134. package/dist/ripple/{p-c47fab48.entry.js → p-76d53189.entry.js} +1 -1
  135. package/dist/ripple/{p-fa4f1030.system.entry.js → p-7f483c55.system.entry.js} +1 -1
  136. package/dist/ripple/{p-a3c01e10.system.entry.js → p-7fdcce90.system.entry.js} +1 -1
  137. package/dist/ripple/{p-cad0c5f9.system.entry.js → p-8008f0f2.system.entry.js} +1 -1
  138. package/dist/ripple/{p-3d50db36.entry.js → p-86d81e42.entry.js} +1 -1
  139. package/dist/ripple/{p-f2101a0d.entry.js → p-8a11ee6f.entry.js} +1 -1
  140. package/dist/ripple/{p-c2e00d4a.system.entry.js → p-8b272d80.system.entry.js} +1 -1
  141. package/dist/ripple/{p-885c3527.entry.js → p-9603168d.entry.js} +1 -1
  142. package/dist/ripple/{p-f40e1468.system.entry.js → p-97f276aa.system.entry.js} +1 -1
  143. package/dist/ripple/{p-749597da.system.entry.js → p-984287f7.system.entry.js} +1 -1
  144. package/dist/ripple/{p-ff1ed90f.entry.js → p-9b75d56c.entry.js} +1 -1
  145. package/dist/ripple/{p-a0ecb6d7.system.entry.js → p-9df3574d.system.entry.js} +1 -1
  146. package/dist/ripple/p-a40b0af9.system.js +1 -0
  147. package/dist/ripple/p-a895f1ef.entry.js +1 -0
  148. package/dist/ripple/{p-e081fdc2.system.entry.js → p-ae4460f2.system.entry.js} +1 -1
  149. package/dist/ripple/{p-b9dbf1f4.entry.js → p-bd142645.entry.js} +1 -1
  150. package/dist/ripple/{p-aea13873.entry.js → p-c61366fd.entry.js} +1 -1
  151. package/dist/ripple/{p-ca971eac.system.entry.js → p-c9200deb.system.entry.js} +1 -1
  152. package/dist/ripple/{p-6d129ef8.system.entry.js → p-cd51ee87.system.entry.js} +1 -1
  153. package/dist/ripple/{p-465d44f0.system.entry.js → p-ce8c6180.system.entry.js} +1 -1
  154. package/dist/ripple/{p-84ba5b74.entry.js → p-d0387d35.entry.js} +1 -1
  155. package/dist/ripple/{p-ed1f6b8d.system.entry.js → p-d8994408.system.entry.js} +1 -1
  156. package/dist/ripple/{p-eddbcb21.js → p-db190563.js} +1 -1
  157. package/dist/ripple/{p-83be63f6.entry.js → p-db8917e4.entry.js} +1 -1
  158. package/dist/ripple/{p-505eca1c.system.entry.js → p-dc7a6037.system.entry.js} +1 -1
  159. package/dist/ripple/{p-e687176d.entry.js → p-dfd1b720.entry.js} +1 -1
  160. package/dist/ripple/{p-df157138.entry.js → p-e3899e1f.entry.js} +1 -1
  161. package/dist/ripple/{p-30b905eb.system.entry.js → p-ed1971ff.system.entry.js} +1 -1
  162. package/dist/ripple/{p-2e79fa49.entry.js → p-f177d841.entry.js} +1 -1
  163. package/dist/ripple/{p-149a22bf.entry.js → p-f4b64ded.entry.js} +1 -1
  164. package/dist/ripple/p-f9494a9d.js +1 -0
  165. package/dist/ripple/{p-21d372ed.js → p-fb229776.js} +1 -1
  166. package/dist/ripple/{p-81c2df85.system.js → p-fb751343.system.js} +1 -1
  167. package/dist/ripple/{p-c853e185.system.entry.js → p-ffa15c47.system.entry.js} +1 -1
  168. package/dist/ripple/ripple.esm.js +1 -1
  169. package/dist/ripple/ripple.js +1 -1
  170. package/dist/types/components/wm-option/wm-option.d.ts +1 -2
  171. package/dist/types/components/{selects/priv-option-list/priv-option-list.d.ts → wm-select/wm-select.d.ts} +65 -37
  172. package/dist/types/components.d.ts +2 -148
  173. package/dist/types/global/functions.d.ts +0 -1
  174. package/package.json +2 -2
  175. package/dist/cjs/priv-option-list.cjs.entry.js +0 -384
  176. package/dist/cjs/wm-nested-select.cjs.entry.js +0 -295
  177. package/dist/cjs/wm-optgroup.cjs.entry.js +0 -56
  178. package/dist/collection/components/selects/priv-option-list/priv-option-list.css +0 -104
  179. package/dist/collection/components/selects/priv-option-list/priv-option-list.js +0 -714
  180. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +0 -378
  181. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +0 -581
  182. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +0 -77
  183. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +0 -197
  184. package/dist/collection/dev/nested-select.js +0 -62
  185. package/dist/esm/priv-option-list.entry.js +0 -380
  186. package/dist/esm/wm-nested-select.entry.js +0 -291
  187. package/dist/esm/wm-optgroup.entry.js +0 -52
  188. package/dist/esm-es5/global-5c6da026.js +0 -1
  189. package/dist/esm-es5/priv-option-list.entry.js +0 -1
  190. package/dist/esm-es5/wm-nested-select.entry.js +0 -1
  191. package/dist/esm-es5/wm-optgroup.entry.js +0 -1
  192. package/dist/ripple/p-104c0e9b.system.entry.js +0 -1
  193. package/dist/ripple/p-17c8aac1.system.entry.js +0 -1
  194. package/dist/ripple/p-24ba754f.entry.js +0 -1
  195. package/dist/ripple/p-2fb58947.entry.js +0 -1
  196. package/dist/ripple/p-4564a101.system.entry.js +0 -1
  197. package/dist/ripple/p-4ca5ed96.entry.js +0 -1
  198. package/dist/ripple/p-50388b6f.system.entry.js +0 -1
  199. package/dist/ripple/p-5a8e86e9.system.js +0 -1
  200. package/dist/ripple/p-5b9babd9.system.entry.js +0 -1
  201. package/dist/ripple/p-61262e66.js +0 -1
  202. package/dist/ripple/p-8835adfb.entry.js +0 -1
  203. package/dist/ripple/p-aa4a7527.system.js +0 -1
  204. package/dist/ripple/p-ae82b3d2.system.js +0 -1
  205. package/dist/types/components/selects/wm-nested-select/wm-nested-select.d.ts +0 -55
  206. package/dist/types/components/selects/wm-optgroup/wm-optgroup.d.ts +0 -16
  207. package/dist/types/components/selects/wm-select/wm-select.d.ts +0 -53
  208. /package/dist/collection/components/{selects/wm-select → wm-select}/wm-select.e2e.js +0 -0
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,r,e,i){function n(t){return t instanceof e?t:new e((function(r){r(t)}))}return new(e||(e=Promise))((function(e,a){function s(t){try{u(i.next(t))}catch(t){a(t)}}function o(t){try{u(i["throw"](t))}catch(t){a(t)}}function u(t){t.done?e(t.value):n(t.value).then(s,o)}u((i=i.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(r){return u([t,r])}}function u(o){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(e=0)),e)try{if(i=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;n=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){e.label=o[1];break}if(o[0]===6&&e.label<a[1]){e.label=a[1];a=o;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(o);break}if(a[2])e.ops.pop();e.trys.pop();continue}o=r.call(t,e)}catch(t){o=[6,t];n=0}finally{i=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,r,e){if(e||arguments.length===2)for(var i=0,n=r.length,a;i<n;i++){if(a||!(i in r)){if(!a)a=Array.prototype.slice.call(r,0,i);a[i]=r[i]}}return t.concat(a||Array.prototype.slice.call(r))};System.register(["./p-ab8d78cc.system.js","./p-ae82b3d2.system.js"],(function(t){"use strict";var r,e,i,n,a;return{setters:[function(t){r=t.h},function(t){e=t.i;i=t.c;n=t.e;a=t.f}],execute:function(){t({b:U,c:L,d:K,e:j,f:P,g:D,h:z,i:X,j:B,k:d,l:Q,m:J,n:f,o:w,r:O});var s={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"};var o=t("a",{doughnut:{size:155,colors:[s.forest,s.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[s.lavender,s.midnight,s.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[s.periwinkle,s.cyan,s.midnight,s.salmon,s.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[s.lavender,s.midnight,"#0089e4",s.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[s.forest,s.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[s.gray,s.periwinkle,s.midnight,s.cyan,s.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",s.cyan,"#8e4129",s.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[s.salmon,s.cyan,s.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[s.gray,s.lavender,s.midnight,"#0089e4",s.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[s.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[s.periwinkle,s.cyan,s.salmon,s.gray],padding:0,category:"simpleBar"}});function u(t){return t==="percentage"||t==="amount"?"show-values":""}var c=e.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are hidden when too close together.",description:"Text displayed when a chart has some values hidden"});var h=e.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function f(t){return t>999||t<-999?Math.round(t/100)/10+"K":t}function d(t,r,e){return e?Math.round(t*100/r):Math.round(t*1e4/r)/100}function l(t,r){return t*360/r}function v(t){return parseFloat((Math.floor(t*100)/100).toFixed(2))}function g(t,r,e,i){var n=v(t+t*r*Math.cos(Math.PI*e/180));var a=v(t+t*r*Math.sin(Math.PI*e/180));if(i!==undefined){var s=v(t+t*r*Math.cos(Math.PI*i/180));var o=v(t+t*r*Math.sin(Math.PI*i/180));return{x1:n,y1:a,x2:s,y2:o}}return{x:n,y:a}}function p(t,r,e,i,n){var a=v(n/2*t);return"A ".concat(a,", ").concat(a," 0 ").concat(r," ").concat(v(e),", ").concat(v(i))}function b(t,r,e,i,n){var a=(t-r)*(n-i)/(e-r)+i;return a<i?i:a>n?n:a}function m(t){return b(t,300,900,70,150)}function y(t){return Math.round(t/m(t))}function w(t,r){var e=t/r;var i=Math.pow(10,Math.floor(Math.log10(e)));var n=e/i;var a;if(n>5){a=10*i}else if(n>3){a=5*i}else if(n>2){a=3*i}else if(n>1.5){a=2*i}else if(n>1){a=1.5*i}else{a=i}return a}function x(t){if(this.popoverEl&&this.popoverEl.open&&t.key==="Enter"){var r=this.popoverEl.querySelector("button");r&&r.click()}}function k(t,r){if(this.popoverEl&&!this.isTabbing){r.coords={x:t.clientX,y:t.clientY};A(this.popoverEl,r);N(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),r)}}function M(t,r){if(this.popoverEl&&this.isTabbing){this.focusedSliceId=r.id;r.coords=n(t.target);r.coords.x=r.coords.x+30;r.coords.y=r.coords.y+30;A(this.popoverEl,r);N(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),r)}}function z(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault();this.isTabbing=true;C.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault();this.isTabbing=true;_.call(this);break;case"Tab":B.call(this);break;case"Escape":this.popoverEl.open=false;this.userIsNavigating=false;break}}function A(t,r){t.open=false;if(r.title&&r.text){t.sliceDetails=Object.assign({},r);window.setTimeout((function(){return t.open=true}),30)}}function _(){var t=a(document.activeElement);var r=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;S.call(this,r)}function C(){if(this.sliceEls){var t=a(document.activeElement);var r=this.sliceEls.indexOf(t);if(r===-1){r=0}else if(r===0){r=this.sliceEls.length-1}else{r-=1}S.call(this,r)}}function S(t){var r=this;if(this.sliceEls&&this.el){this.userIsNavigating=true;this.componentWrapperEl.tabIndex=-1;this.el.focusable=false;this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.sliceEls[t].tabIndex=0;this.sliceEls[t].focusable=true;this.sliceEls[t].focus();this.focusedSliceId=this.sliceEls[t].id;window.setTimeout((function(){if(r.popoverEl){r.popoverEl.open=true}}),10)}}function B(){var t=this;this.focusedSliceId=undefined;this.sliceEls&&this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.userIsNavigating=false;window.setTimeout((function(){t.componentWrapperEl.tabIndex=0;t.el.focusable=true;if(t.popoverEl){t.popoverEl.open=false}}),100)}function D(t){return __awaiter(this,void 0,void 0,(function(){var r,e,i;var n=this;return __generator(this,(function(a){this.slicesDetails=[];r=0;e=Array.from(this.el.children);this.total=e.reduce((function(t,r){return t+=parseInt(r.getAttribute("amount")||"0")}),0);i=__spreadArray([],o[t].colors,true);if(this.chartType==="bar2"&&this.el.children.length<=4){i.splice(2,1)}if(t==="bar3"&&e.length===2){i=[i[1],i[3]]}if(t==="doughnut2"&&e.length<5){i.splice(2,1);if(e.length<4){i.shift()}}if(t==="bar5"&&!this.notStartedColor){i.shift()}e.forEach((function(e,a){var o=parseInt(e.getAttribute("amount")||"0");var u=d(o,n.total,true);var c=a;if(t==="bar6"){c=0}var h={amount:o,perc:u,legend:e.getAttribute("legend"),color:i[c]||s.gray,offset:r,id:"".concat(n.uid,"-").concat(a+1),title:e.getAttribute("popover-title"),text:e.getAttribute("popover-text"),buttonText:e.getAttribute("popover-button-text"),sliceRef:e,inSmallCluster:false,index:a};r+=o;n.slicesDetails.push(h)}));return[2]}))}))}function F(t,r){var e=__spreadArray([],t,true).sort((function(t,r){return t.amount===r.amount?0:t.amount>r.amount?-1:1}));var i=0;e.filter((function(t){return t.amount>0})).forEach((function(t,n){var a=e[n===0?e.length-1:n-1];var s=e[n===e.length-1?0:n+1];var o=d(a.amount,r,true);var u=d(s.amount,r,true);var c=t.perc===0?8:5;var h=t.perc<4;var f=o<c;var l=u<c;var v=h&&(f||l);t.inSmallCluster=v;t.offset=i;i+=t.amount}));return e}function T(t,r,e){var i=l(r,this.total)-90;var n=t/this.total*360;var a=i+n;var s=n>180?"1 1":"0 1";var o=n>180?"1 0":"0 0";var u=this.chartDetails.size/2;var c=this.chartDetails.thickness;var h=1;var f=e==="doughnut";var d=1.5;var v=f?2.25:3;if(n===360){a-=.01}var b=g(u,h,i+d,a);var m=g(u,c,i+v,a);var y="M ".concat(b.x1,", ").concat(b.y1," ");var w=p(h,s,b.x2,b.y2,this.chartDetails.size);var x=" L ".concat(m.x2,", ").concat(m.y2," ");var k=p(c,o,m.x1,m.y1,this.chartDetails.size);return y+w+x+k+" z"}function j(){var t=e.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return r("div",{id:"chart-instructions"},t)}function I(){return r("defs",null,r("filter",{id:"wmHoverDropShadow"},r("feGaussianBlur",{stdDeviation:"3"}),r("feOffset",{result:"offsetblur"}),r("feFlood",{"flood-color":"#333"}),r("feComposite",{operator:"in",in2:"offsetblur"}),r("feMerge",null,r("feMergeNode",null),r("feMergeNode",{in:"SourceGraphic"}))))}function H(t,r,e){var i=r.map((function(t){return l(t.amount,e)}));var n=i.some((function(r){return r!==0&&r<t}));if(n){var a=i.map((function(r){return r==0?r:Math.max(r,t)}));var s=a.reduce((function(r,e){return r+(e>t&&e!==0?e:0)}),0);var o=a.reduce((function(r,e){return r+(e>t&&e!==0?0:e)}),0);var u=360-o;var c=s-u;var h=c/u;var f=a.map((function(r){return r>t?r-h*r:r==0?0:t}));var d=0;r=r.map((function(t,r){var i=f[r]/360*e;var n=d;d+=i;return Object.assign(Object.assign({},t),{amount:i,offset:n})}))}return r}function K(t){var e=this;var i=this.chartDetails.size+this.chartDetails.padding;var n=t==="doughnut";var a=n?this.slicesDetails:F(this.slicesDetails,this.total);a=H(7,a,this.total);return r("div",{class:"chart-wrapper doughnut-wrapper"},r("svg",{width:i+"px",height:i+"px",id:"graphic-".concat(this.uid),class:"doughnut-svg"},I(),a.map((function(r){return E.call(e,r,t)})),G.call(this),n?r("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},d(a[0].amount,this.total,true)+"%"):r("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")"),"text-anchor":"middle","dominant-baseline":"middle"},a.map((function(t){return t.amount>0&&!t.inSmallCluster?W.call(e,t):""})))))}function N(t,r){t.forEach((function(t){if(t.dataset.segmentindex&&parseInt(t.dataset.segmentindex)!==r.index){t.classList.add("faded")}else{t.classList.remove("faded")}}))}function O(t){t.forEach((function(t){t.classList.remove("faded")}))}function E(t,e){var i=this;var n=d(t.amount,this.total,true)+"%";return!isNaN(t.amount)&&r("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},r("path",{id:t.id,class:"segment doughnut-segment",fill:t.amount?t.color:"transparent",d:T.call(this,t.amount,t.offset,e),onClick:function(r){return k.call(i,r,t)},onFocus:function(r){return M.call(i,r,t)},onKeyDown:function(t){return x.call(i,t)},role:"img","aria-label":"".concat(t.legend,", ").concat(n),"data-segmentindex":t.index}))}function G(){return this.isTabbing?r("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},r("use",{tabindex:-1,id:"kfbg1",xlinkHref:"#".concat(this.focusedSliceId)}),r("use",{tabindex:-1,id:"kfstroke",xlinkHref:"#".concat(this.focusedSliceId)}),r("use",{tabindex:-1,id:"kfbg2",xlinkHref:"#".concat(this.focusedSliceId)})):""}function W(t){var e=l(t.offset+t.amount/2,this.total);var i=g(this.chartDetails.size/2,1.4,e-90),n=i.x,a=i.y;return r("text",{class:"value",x:n+"px",y:a+"px","data-segmentindex":t.index},"".concat(t.perc>0?t.perc:"<1","%"))}function L(t){var e=this;var i=t==="bar";var n=this.el.shadowRoot.querySelectorAll(".value");if(n.length>0){requestAnimationFrame((function(){var t=[];var r=4;var i=false;n.forEach((function(e){e.classList.remove("hidden");var n=parseInt(e.dataset.value);if(t.length>0&&n!=0){var a=e.getBoundingClientRect().left-r;t.forEach((function(t){var r=parseInt(t.dataset.value);var s=t.getBoundingClientRect().right>a;if(s){var o=n<r?e:t;o.classList.add("hidden");i=true}}))}if(!e.classList.contains("hidden")&&n>0){t.push(e)}}));(e.isBar||e.isDoughnut)&&e.showHiddenValuesMessage(i)}))}return r("div",{class:"chart-wrapper bar-wrapper"},i?r("div",{class:"single-perc"},d(this.slicesDetails[0].amount,this.total,true)+"%"):"",this.chartType==="bar3"&&this.drawAxis(),r("div",{class:"inner-stacked-bar-wrapper ".concat(u(this.valueFormat))},!i?r("div",{class:"values ".concat(this.valueFormat)},this.slicesDetails.map((function(t){return e.renderBarText(t,5)}))):"",r("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((function(t){return R.call(e,t,5)}))),i?Q.call(this):""),this.chartType==="bar3"?r("div",{class:"bar3-axis-label","aria-hidden":"true"},r("span",null,"0%"),r("span",null,"100%")):"")}function R(t,e){var i=this;var n=d(t.amount,this.total,false);var a=this.el.shadowRoot.querySelector(".stacked-bar-segments-wrapper");var s=a?a.offsetWidth:this.el.offsetWidth;var o=n/100*s>=e;var u=o||t.amount==0?"".concat(n,"%"):"".concat(e,"px");var c="";if(this.valueFormat=="percentage"){c="".concat(d(t.amount,this.total,true)," %")}else if(this.valueFormat=="amount"){c=t.amount.toString()}return r("div",{class:"segment stacked-bar-segment ".concat(d(t.amount,this.total,false)===0?"zero":""," ").concat(o?"":"fixed-width"),style:{backgroundColor:t.color,width:u},onClick:function(r){return k.call(i,r,t)},onFocus:function(r){return M.call(i,r,t)},onKeyDown:function(t){return x.call(i,t)},"data-segmentindex":t.index},r("span",{class:"sr-only"},"".concat(t.legend," ").concat(c)))}function U(t){var e=this;var n=this.slicesDetails.map((function(t){return t.amount})).reduce((function(t,r){return t>r?t:r}));var a=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);var s=48;var o=this.el.getBoundingClientRect().width;var c=o-a-s;var h=y(c);var d=w(n,h);var l=h*d;var v=Math.floor((l-n)/d);h-=v;this.el.style.setProperty("--backgroundSize",100/h+"%");this.el.style.setProperty("--labelWidth",this.labelWidth);if(t==="bar7"&&!this.showBarLegend){this.el.style.setProperty("--labelWidth","0px")}var g=[];this.slicesDetails.forEach((function(r){r.legend&&g.push(V(r.legend,e.showBarLegend,t));g.push(q.call(e,r,d,h,n))}));var p=[];for(var b=1;b<=h;b++){var m=f(i(b,d));p.push(r("div",{class:"tick"},r("span",null,m)))}var x=t==="bar6"&&this.showGrid&&this.el.getBoundingClientRect().width>300;return r("div",{class:"chart-wrapper simple-bar-wrapper"},r("div",{class:"chart ".concat(u(this.valueFormat))},x&&r("div",{class:"gridlines"}),r("div",{class:"rows"},g)),x&&r("div",{class:"x-axis","aria-hidden":"true"},r("div",{class:"zero"},r("span",null,"0")),p))}function V(t,e,i){var n=i==="bar7"&&!e?" hidden":"";return r("label",{class:"label".concat(n)},t)}function q(t,e,i,n){var a=this;var s=this.currentChartType==="bar6"?e*i:n;var o=d(t.amount,s,false);var u=o?o+"%":"1px";var c=f(t.amount);var h=this.valueFormat==="amount"?c:"";if(this.currentChartType==="bar6"&&this.valueFormat==="percentage"){h=t.amount+"%"}else if(this.currentChartType==="bar7"&&this.valueFormat==="percentage"){h=(this.total===0?"0":d(t.amount,this.total,true))+"%"}return r("div",{class:"bar segment",style:{backgroundColor:t.color,width:u},onClick:function(r){return k.call(a,r,t)},onFocus:function(r){return M.call(a,r,t)},onKeyDown:function(t){return x.call(a,t)},"data-segmentindex":t.index},r("div",{class:"value"},h))}function P(t){var e=this;if(this.showLegend){var i=this.slicesDetails.reduce((function(t,r){return t=r.inSmallCluster?true:t}),false);this.isDoughnut&&this.showHiddenValuesMessage(i);return r("div",{class:"legend-wrapper"},r("div",{class:"legend ".concat(t," ").concat(this.mode==="bar"?"--top":"--bottom"),"aria-hidden":"true"},this.slicesDetails.map((function(t){var r=e.printModeFormat=="amount"?"".concat(t.amount,"/").concat(e.total):"".concat(d(t.amount,e.total,true),"%");if(!!t.amount||!!t.legend){return J.call(e,{key:t.legend,color:t.color},r,t)}}))),this.isDoughnut&&!this.printMode&&X())}}function J(t,e,i){var n=this;if(e===void 0){e=""}if(i===void 0){i=null}var a=function(t){if(i){i.coords={x:t.clientX,y:t.clientY};A(n.popoverEl,i);N(Array.from(n.el.shadowRoot.querySelectorAll("[data-segmentindex")),i)}};return r("div",{class:"legend-item",onClick:function(t){return a(t)},"data-segmentindex":i?i.index:null},r("div",{class:"legend-color",style:{backgroundColor:t.color}}),r("div",{class:"legend-text"},t.key,e&&r("span",{class:"print-value ".concat(this.printMode?"force-visible":"")},": ",e)))}function Q(){if(this.completionMessage){return r("div",{class:"completion-message"},this.completionMessage)}}function X(){return r("div",{class:"hidden-values-warning hidden"},c,r("br",null),h)}}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,r,e,i){function n(t){return t instanceof e?t:new e((function(r){r(t)}))}return new(e||(e=Promise))((function(e,a){function s(t){try{u(i.next(t))}catch(t){a(t)}}function o(t){try{u(i["throw"](t))}catch(t){a(t)}}function u(t){t.done?e(t.value):n(t.value).then(s,o)}u((i=i.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(r){return u([t,r])}}function u(o){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(e=0)),e)try{if(i=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;n=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){e.label=o[1];break}if(o[0]===6&&e.label<a[1]){e.label=a[1];a=o;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(o);break}if(a[2])e.ops.pop();e.trys.pop();continue}o=r.call(t,e)}catch(t){o=[6,t];n=0}finally{i=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,r,e){if(e||arguments.length===2)for(var i=0,n=r.length,a;i<n;i++){if(a||!(i in r)){if(!a)a=Array.prototype.slice.call(r,0,i);a[i]=r[i]}}return t.concat(a||Array.prototype.slice.call(r))};System.register(["./p-ab8d78cc.system.js","./p-55668879.system.js"],(function(t){"use strict";var r,e,i,n,a;return{setters:[function(t){r=t.h},function(t){e=t.i;i=t.c;n=t.e;a=t.f}],execute:function(){t({b:U,c:L,d:K,e:j,f:P,g:D,h:z,i:X,j:B,k:d,l:Q,m:J,n:f,o:w,r:O});var s={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"};var o=t("a",{doughnut:{size:155,colors:[s.forest,s.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[s.lavender,s.midnight,s.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[s.periwinkle,s.cyan,s.midnight,s.salmon,s.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[s.lavender,s.midnight,"#0089e4",s.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[s.forest,s.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[s.gray,s.periwinkle,s.midnight,s.cyan,s.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",s.cyan,"#8e4129",s.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[s.salmon,s.cyan,s.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[s.gray,s.lavender,s.midnight,"#0089e4",s.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[s.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[s.periwinkle,s.cyan,s.salmon,s.gray],padding:0,category:"simpleBar"}});function u(t){return t==="percentage"||t==="amount"?"show-values":""}var c=e.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are hidden when too close together.",description:"Text displayed when a chart has some values hidden"});var h=e.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function f(t){return t>999||t<-999?Math.round(t/100)/10+"K":t}function d(t,r,e){return e?Math.round(t*100/r):Math.round(t*1e4/r)/100}function l(t,r){return t*360/r}function v(t){return parseFloat((Math.floor(t*100)/100).toFixed(2))}function g(t,r,e,i){var n=v(t+t*r*Math.cos(Math.PI*e/180));var a=v(t+t*r*Math.sin(Math.PI*e/180));if(i!==undefined){var s=v(t+t*r*Math.cos(Math.PI*i/180));var o=v(t+t*r*Math.sin(Math.PI*i/180));return{x1:n,y1:a,x2:s,y2:o}}return{x:n,y:a}}function p(t,r,e,i,n){var a=v(n/2*t);return"A ".concat(a,", ").concat(a," 0 ").concat(r," ").concat(v(e),", ").concat(v(i))}function b(t,r,e,i,n){var a=(t-r)*(n-i)/(e-r)+i;return a<i?i:a>n?n:a}function m(t){return b(t,300,900,70,150)}function y(t){return Math.round(t/m(t))}function w(t,r){var e=t/r;var i=Math.pow(10,Math.floor(Math.log10(e)));var n=e/i;var a;if(n>5){a=10*i}else if(n>3){a=5*i}else if(n>2){a=3*i}else if(n>1.5){a=2*i}else if(n>1){a=1.5*i}else{a=i}return a}function x(t){if(this.popoverEl&&this.popoverEl.open&&t.key==="Enter"){var r=this.popoverEl.querySelector("button");r&&r.click()}}function k(t,r){if(this.popoverEl&&!this.isTabbing){r.coords={x:t.clientX,y:t.clientY};A(this.popoverEl,r);N(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),r)}}function M(t,r){if(this.popoverEl&&this.isTabbing){this.focusedSliceId=r.id;r.coords=n(t.target);r.coords.x=r.coords.x+30;r.coords.y=r.coords.y+30;A(this.popoverEl,r);N(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),r)}}function z(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault();this.isTabbing=true;C.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault();this.isTabbing=true;_.call(this);break;case"Tab":B.call(this);break;case"Escape":this.popoverEl.open=false;this.userIsNavigating=false;break}}function A(t,r){t.open=false;if(r.title&&r.text){t.sliceDetails=Object.assign({},r);window.setTimeout((function(){return t.open=true}),30)}}function _(){var t=a(document.activeElement);var r=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;S.call(this,r)}function C(){if(this.sliceEls){var t=a(document.activeElement);var r=this.sliceEls.indexOf(t);if(r===-1){r=0}else if(r===0){r=this.sliceEls.length-1}else{r-=1}S.call(this,r)}}function S(t){var r=this;if(this.sliceEls&&this.el){this.userIsNavigating=true;this.componentWrapperEl.tabIndex=-1;this.el.focusable=false;this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.sliceEls[t].tabIndex=0;this.sliceEls[t].focusable=true;this.sliceEls[t].focus();this.focusedSliceId=this.sliceEls[t].id;window.setTimeout((function(){if(r.popoverEl){r.popoverEl.open=true}}),10)}}function B(){var t=this;this.focusedSliceId=undefined;this.sliceEls&&this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.userIsNavigating=false;window.setTimeout((function(){t.componentWrapperEl.tabIndex=0;t.el.focusable=true;if(t.popoverEl){t.popoverEl.open=false}}),100)}function D(t){return __awaiter(this,void 0,void 0,(function(){var r,e,i;var n=this;return __generator(this,(function(a){this.slicesDetails=[];r=0;e=Array.from(this.el.children);this.total=e.reduce((function(t,r){return t+=parseInt(r.getAttribute("amount")||"0")}),0);i=__spreadArray([],o[t].colors,true);if(this.chartType==="bar2"&&this.el.children.length<=4){i.splice(2,1)}if(t==="bar3"&&e.length===2){i=[i[1],i[3]]}if(t==="doughnut2"&&e.length<5){i.splice(2,1);if(e.length<4){i.shift()}}if(t==="bar5"&&!this.notStartedColor){i.shift()}e.forEach((function(e,a){var o=parseInt(e.getAttribute("amount")||"0");var u=d(o,n.total,true);var c=a;if(t==="bar6"){c=0}var h={amount:o,perc:u,legend:e.getAttribute("legend"),color:i[c]||s.gray,offset:r,id:"".concat(n.uid,"-").concat(a+1),title:e.getAttribute("popover-title"),text:e.getAttribute("popover-text"),buttonText:e.getAttribute("popover-button-text"),sliceRef:e,inSmallCluster:false,index:a};r+=o;n.slicesDetails.push(h)}));return[2]}))}))}function F(t,r){var e=__spreadArray([],t,true).sort((function(t,r){return t.amount===r.amount?0:t.amount>r.amount?-1:1}));var i=0;e.filter((function(t){return t.amount>0})).forEach((function(t,n){var a=e[n===0?e.length-1:n-1];var s=e[n===e.length-1?0:n+1];var o=d(a.amount,r,true);var u=d(s.amount,r,true);var c=t.perc===0?8:5;var h=t.perc<4;var f=o<c;var l=u<c;var v=h&&(f||l);t.inSmallCluster=v;t.offset=i;i+=t.amount}));return e}function T(t,r,e){var i=l(r,this.total)-90;var n=t/this.total*360;var a=i+n;var s=n>180?"1 1":"0 1";var o=n>180?"1 0":"0 0";var u=this.chartDetails.size/2;var c=this.chartDetails.thickness;var h=1;var f=e==="doughnut";var d=1.5;var v=f?2.25:3;if(n===360){a-=.01}var b=g(u,h,i+d,a);var m=g(u,c,i+v,a);var y="M ".concat(b.x1,", ").concat(b.y1," ");var w=p(h,s,b.x2,b.y2,this.chartDetails.size);var x=" L ".concat(m.x2,", ").concat(m.y2," ");var k=p(c,o,m.x1,m.y1,this.chartDetails.size);return y+w+x+k+" z"}function j(){var t=e.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return r("div",{id:"chart-instructions"},t)}function I(){return r("defs",null,r("filter",{id:"wmHoverDropShadow"},r("feGaussianBlur",{stdDeviation:"3"}),r("feOffset",{result:"offsetblur"}),r("feFlood",{"flood-color":"#333"}),r("feComposite",{operator:"in",in2:"offsetblur"}),r("feMerge",null,r("feMergeNode",null),r("feMergeNode",{in:"SourceGraphic"}))))}function H(t,r,e){var i=r.map((function(t){return l(t.amount,e)}));var n=i.some((function(r){return r!==0&&r<t}));if(n){var a=i.map((function(r){return r==0?r:Math.max(r,t)}));var s=a.reduce((function(r,e){return r+(e>t&&e!==0?e:0)}),0);var o=a.reduce((function(r,e){return r+(e>t&&e!==0?0:e)}),0);var u=360-o;var c=s-u;var h=c/u;var f=a.map((function(r){return r>t?r-h*r:r==0?0:t}));var d=0;r=r.map((function(t,r){var i=f[r]/360*e;var n=d;d+=i;return Object.assign(Object.assign({},t),{amount:i,offset:n})}))}return r}function K(t){var e=this;var i=this.chartDetails.size+this.chartDetails.padding;var n=t==="doughnut";var a=n?this.slicesDetails:F(this.slicesDetails,this.total);a=H(7,a,this.total);return r("div",{class:"chart-wrapper doughnut-wrapper"},r("svg",{width:i+"px",height:i+"px",id:"graphic-".concat(this.uid),class:"doughnut-svg"},I(),a.map((function(r){return E.call(e,r,t)})),G.call(this),n?r("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},d(a[0].amount,this.total,true)+"%"):r("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")"),"text-anchor":"middle","dominant-baseline":"middle"},a.map((function(t){return t.amount>0&&!t.inSmallCluster?W.call(e,t):""})))))}function N(t,r){t.forEach((function(t){if(t.dataset.segmentindex&&parseInt(t.dataset.segmentindex)!==r.index){t.classList.add("faded")}else{t.classList.remove("faded")}}))}function O(t){t.forEach((function(t){t.classList.remove("faded")}))}function E(t,e){var i=this;var n=d(t.amount,this.total,true)+"%";return!isNaN(t.amount)&&r("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},r("path",{id:t.id,class:"segment doughnut-segment",fill:t.amount?t.color:"transparent",d:T.call(this,t.amount,t.offset,e),onClick:function(r){return k.call(i,r,t)},onFocus:function(r){return M.call(i,r,t)},onKeyDown:function(t){return x.call(i,t)},role:"img","aria-label":"".concat(t.legend,", ").concat(n),"data-segmentindex":t.index}))}function G(){return this.isTabbing?r("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},r("use",{tabindex:-1,id:"kfbg1",xlinkHref:"#".concat(this.focusedSliceId)}),r("use",{tabindex:-1,id:"kfstroke",xlinkHref:"#".concat(this.focusedSliceId)}),r("use",{tabindex:-1,id:"kfbg2",xlinkHref:"#".concat(this.focusedSliceId)})):""}function W(t){var e=l(t.offset+t.amount/2,this.total);var i=g(this.chartDetails.size/2,1.4,e-90),n=i.x,a=i.y;return r("text",{class:"value",x:n+"px",y:a+"px","data-segmentindex":t.index},"".concat(t.perc>0?t.perc:"<1","%"))}function L(t){var e=this;var i=t==="bar";var n=this.el.shadowRoot.querySelectorAll(".value");if(n.length>0){requestAnimationFrame((function(){var t=[];var r=4;var i=false;n.forEach((function(e){e.classList.remove("hidden");var n=parseInt(e.dataset.value);if(t.length>0&&n!=0){var a=e.getBoundingClientRect().left-r;t.forEach((function(t){var r=parseInt(t.dataset.value);var s=t.getBoundingClientRect().right>a;if(s){var o=n<r?e:t;o.classList.add("hidden");i=true}}))}if(!e.classList.contains("hidden")&&n>0){t.push(e)}}));(e.isBar||e.isDoughnut)&&e.showHiddenValuesMessage(i)}))}return r("div",{class:"chart-wrapper bar-wrapper"},i?r("div",{class:"single-perc"},d(this.slicesDetails[0].amount,this.total,true)+"%"):"",this.chartType==="bar3"&&this.drawAxis(),r("div",{class:"inner-stacked-bar-wrapper ".concat(u(this.valueFormat))},!i?r("div",{class:"values ".concat(this.valueFormat)},this.slicesDetails.map((function(t){return e.renderBarText(t,5)}))):"",r("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((function(t){return R.call(e,t,5)}))),i?Q.call(this):""),this.chartType==="bar3"?r("div",{class:"bar3-axis-label","aria-hidden":"true"},r("span",null,"0%"),r("span",null,"100%")):"")}function R(t,e){var i=this;var n=d(t.amount,this.total,false);var a=this.el.shadowRoot.querySelector(".stacked-bar-segments-wrapper");var s=a?a.offsetWidth:this.el.offsetWidth;var o=n/100*s>=e;var u=o||t.amount==0?"".concat(n,"%"):"".concat(e,"px");var c="";if(this.valueFormat=="percentage"){c="".concat(d(t.amount,this.total,true)," %")}else if(this.valueFormat=="amount"){c=t.amount.toString()}return r("div",{class:"segment stacked-bar-segment ".concat(d(t.amount,this.total,false)===0?"zero":""," ").concat(o?"":"fixed-width"),style:{backgroundColor:t.color,width:u},onClick:function(r){return k.call(i,r,t)},onFocus:function(r){return M.call(i,r,t)},onKeyDown:function(t){return x.call(i,t)},"data-segmentindex":t.index},r("span",{class:"sr-only"},"".concat(t.legend," ").concat(c)))}function U(t){var e=this;var n=this.slicesDetails.map((function(t){return t.amount})).reduce((function(t,r){return t>r?t:r}));var a=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);var s=48;var o=this.el.getBoundingClientRect().width;var c=o-a-s;var h=y(c);var d=w(n,h);var l=h*d;var v=Math.floor((l-n)/d);h-=v;this.el.style.setProperty("--backgroundSize",100/h+"%");this.el.style.setProperty("--labelWidth",this.labelWidth);if(t==="bar7"&&!this.showBarLegend){this.el.style.setProperty("--labelWidth","0px")}var g=[];this.slicesDetails.forEach((function(r){r.legend&&g.push(V(r.legend,e.showBarLegend,t));g.push(q.call(e,r,d,h,n))}));var p=[];for(var b=1;b<=h;b++){var m=f(i(b,d));p.push(r("div",{class:"tick"},r("span",null,m)))}var x=t==="bar6"&&this.showGrid&&this.el.getBoundingClientRect().width>300;return r("div",{class:"chart-wrapper simple-bar-wrapper"},r("div",{class:"chart ".concat(u(this.valueFormat))},x&&r("div",{class:"gridlines"}),r("div",{class:"rows"},g)),x&&r("div",{class:"x-axis","aria-hidden":"true"},r("div",{class:"zero"},r("span",null,"0")),p))}function V(t,e,i){var n=i==="bar7"&&!e?" hidden":"";return r("label",{class:"label".concat(n)},t)}function q(t,e,i,n){var a=this;var s=this.currentChartType==="bar6"?e*i:n;var o=d(t.amount,s,false);var u=o?o+"%":"1px";var c=f(t.amount);var h=this.valueFormat==="amount"?c:"";if(this.currentChartType==="bar6"&&this.valueFormat==="percentage"){h=t.amount+"%"}else if(this.currentChartType==="bar7"&&this.valueFormat==="percentage"){h=(this.total===0?"0":d(t.amount,this.total,true))+"%"}return r("div",{class:"bar segment",style:{backgroundColor:t.color,width:u},onClick:function(r){return k.call(a,r,t)},onFocus:function(r){return M.call(a,r,t)},onKeyDown:function(t){return x.call(a,t)},"data-segmentindex":t.index},r("div",{class:"value"},h))}function P(t){var e=this;if(this.showLegend){var i=this.slicesDetails.reduce((function(t,r){return t=r.inSmallCluster?true:t}),false);this.isDoughnut&&this.showHiddenValuesMessage(i);return r("div",{class:"legend-wrapper"},r("div",{class:"legend ".concat(t," ").concat(this.mode==="bar"?"--top":"--bottom"),"aria-hidden":"true"},this.slicesDetails.map((function(t){var r=e.printModeFormat=="amount"?"".concat(t.amount,"/").concat(e.total):"".concat(d(t.amount,e.total,true),"%");if(!!t.amount||!!t.legend){return J.call(e,{key:t.legend,color:t.color},r,t)}}))),this.isDoughnut&&!this.printMode&&X())}}function J(t,e,i){var n=this;if(e===void 0){e=""}if(i===void 0){i=null}var a=function(t){if(i){i.coords={x:t.clientX,y:t.clientY};A(n.popoverEl,i);N(Array.from(n.el.shadowRoot.querySelectorAll("[data-segmentindex")),i)}};return r("div",{class:"legend-item",onClick:function(t){return a(t)},"data-segmentindex":i?i.index:null},r("div",{class:"legend-color",style:{backgroundColor:t.color}}),r("div",{class:"legend-text"},t.key,e&&r("span",{class:"print-value ".concat(this.printMode?"force-visible":"")},": ",e)))}function Q(){if(this.completionMessage){return r("div",{class:"completion-message"},this.completionMessage)}}function X(){return r("div",{class:"hidden-values-warning hidden"},c,r("br",null),h)}}}}));
@@ -1 +1 @@
1
- import{r as t,c as e,f as i,h as r,g as o}from"./p-568c595f.js";import{i as a,d as s,u as n,m as l,h,v as d,w as c,s as p,k as g,x as u}from"./p-16f65bf4.js";import{g as m}from"./p-21d372ed.js";const w=class{constructor(r){t(this,r),this.wmTagInputTagAdded=e(this,"wmTagInputTagAdded",7),this.addNewHelpText=a.formatMessage({id:"tagInput.addNewHelpText",defaultMessage:"Press the Enter or Comma key to add a new tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.selectionHelpText=a.formatMessage({id:"tagInput.selectionHelpText",defaultMessage:"Search and select a tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.maxTagsReachedMessage=a.formatMessage({id:"tagInput.maxTagsReached",defaultMessage:"No more tags can be added because the limit has been reached."}),this.tagAreaInstructions=a.formatMessage({id:"tagInput.tagAreaInstructions",defaultMessage:"tag selection. Press Backspace or Delete to remove a tag."}),this.tagsAddedMessage=a.formatMessage({id:"tagInput.tagsAdded",defaultMessage:"Tags added",description:"Full message for context: 'Tags added: x/y"}),this.openUp=!1,this.inModal=!1,this.debouncedUpdate=s((()=>i(this.el)),30),this.label=void 0,this.errorMessage=void 0,this.info=void 0,this.labelPosition="top",this.maxTags=void 0,this.placeholder=void 0,this.requiredField=!1,this.tagInputType="dropdown",this.helpText=void 0,this.addNew=!0,this.characterLimit=50,this.colHeaders=void 0,this.colWidths=void 0,this.colWrap=void 0,this.isKeying=!1,this.isExpanded=!1,this.liveRegionMessage="",this.focusedOption=void 0,this.focusedColumn=0,this.focusedTagIndex=void 0,this.tagsList=[]}toggleKeyingOn(){this.isKeying=!0}toggleKeyingOff(){this.isKeying=!1}get isDropdown(){return"dropdown"===this.tagInputType}get isTable(){return"table"===this.tagInputType}get charCount(){return this.inputEl?this.inputEl.value.length:0}get tooltipVisible(){return document.getElementById("wm-tooltip").classList.contains("show")}get optionEls(){return Array.from(this.el.querySelectorAll("wm-tag-option"))}get filteredOptionEls(){const t=this.inputEl?this.inputEl.value.toLowerCase():"";return Array.from(this.optionEls).filter((e=>{let i="";return this.isDropdown?i=e.textContent.toLowerCase():this.isTable&&(i=[e.col1,e.col2,e.col3,e.col4].join("").toLowerCase()),i.includes(t)}))}get taggedOptions(){return this.optionEls.filter((t=>t.selected||t.locked))}get _tagEls(){return this.tagAreaEl?Array.from(this.tagAreaEl.querySelectorAll(".tag")):[]}get focusedTag(){if(void 0!==this.focusedTagIndex&&this.focusedTagIndex>=0)return this._tagEls[this.focusedTagIndex]}tagOptionFromEl(t){return"add-new-btn"===t.id?void 0:this.el.querySelector("#"+t.id)}tagOptionFromTag(t){const e=t.id.replace("tag-","");return this.el.querySelector("#"+e)}elFromTagOption(t){return this.el.shadowRoot.querySelector("#"+t.id)}get _focusedOption(){return this.focusedOption?this.elFromTagOption(this.focusedOption):this.addNewButton&&this.addNewButton.classList.contains("focused")?this.addNewButton:void 0}get _focusedCell(){if(this._focusedOption)return Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn||0]}get inputActiveDescendantId(){return this._focusedOption?this.isTable?Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn].id:this._focusedOption.id:null}get tagLimitReached(){return!!(this.maxTags&&this.taggedOptions.length>=this.maxTags)}get noResultsMessage(){return a.formatMessage({id:"tagInput.noResults",defaultMessage:"No results match your search.",description:"Message displayed when a user's search returns empty."})}get inputMinimumWidth(){if(this._tagEls){const t=getComputedStyle(this.inputEl),e=getComputedStyle(this._tagEls[this._tagEls.length-1]),i=[t.paddingLeft,t.paddingRight,t.marginLeft,t.marginRight,e.marginRight].reduce(((t,e)=>t+parseInt(e.replace("px",""))),0);return Math.max(150,n(this.inputEl,this.placeholder).width+i)}return 150}getTagName(t){return this.isDropdown?t.textContent:t.col1}isExistingTag(t){return this.optionEls.map((t=>this.getTagName(t).toLowerCase())).includes(t.toLowerCase())}tagAddedMessage(t){return a.formatMessage({id:"tagInput.tagAdded",defaultMessage:"{tagName} added.",description:"A confirmation for adding a tag."},{tagName:t})}tagRemovedMessage(t){return a.formatMessage({id:"tagInput.tagRemoved",defaultMessage:"{tagName} removed.",description:"A confirmation for removing a tag."},{tagName:t})}tagAlreadyAddedMessage(t){return a.formatMessage({id:"tagInput.tagAlreadyAdded",defaultMessage:"{tagName} has already been added.",description:"An alert for adding a tag that is already present."},{tagName:t})}tagLockedMessage(t){return a.formatMessage({id:"tagInput.tagLocked",defaultMessage:"{tagName} is locked and cannot be removed.",description:"An alert for when a user tries to remove a tag that is locked."},{tagName:t})}isElOrChild(t){return t===this.el||this.el.shadowRoot.contains(t)||this.el.contains(t)}componentWillLoad(){this.placeholder||(this.placeholder=this.createPlaceholderDefault(this.addNew,this.optionEls.length>0)),this.label||console.error("wm-tag-input must have a label property"),this.el.focus=()=>{const t=this._tagEls[0];t?(this.tagAreaEl.focus(),this.focusTag(t)):this.inputEl.focus()},new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el),this.el.closest("wm-modal")&&(this.inModal=!0);const t=[],e=[];this.optionEls.forEach((i=>{i.locked?t.push(i):i.selected&&e.push(i)})),this.tagsList=[...t,...e]}componentDidLoad(){new MutationObserver((t=>t.forEach((t=>this.handleChangeAnnouncement(t))))).observe(this.el,{subtree:!0,attributes:!0,attributeFilter:["selected"],childList:!0}),new MutationObserver((t=>t.forEach((t=>this.handleOptionListChange(t))))).observe(this.el,{childList:!0}),this.tagAreaEl&&new MutationObserver((t=>t.forEach((t=>this.handleTagListChange(t))))).observe(this.tagAreaEl,{childList:!0})}handleChangeAnnouncement(t){const e=t.target;if("childList"==t.type&&t.removedNodes.length>0)this.announce(this.tagRemovedMessage(t.removedNodes[0].textContent));else if("attributes"==t.type){const t=this.getTagName(e);if(e.selected){let e=this.tagAddedMessage(t);this.tagLimitReached&&(e+=` ${this.maxTagsReachedMessage}`),this.announce(e)}else this.announce(this.tagRemovedMessage(t))}}handleOptionListChange(t){const e=Array.from(t.addedNodes);e.length>0&&e.forEach((t=>!this.tagsList.includes(t)&&this.tagsList.push(t)));const i=Array.from(t.removedNodes);i.length>0&&(this.tagsList=this.tagsList.filter((t=>!i.includes(t))))}handleTagOptionSelected(t){this.tagsList=this.tagsList.concat(t.target)}handleTagOptionDeselected(t){const e=t.target;this.tagsList=this.tagsList.filter((t=>t!=e))}handleTagListChange(t){const e=Array.from(t.addedNodes);e&&e.forEach((t=>{t.classList.add("highlight")}));const i=t.removedNodes[0];i&&(i.classList.remove("highlight"),this.focusedTag?this.focusTag(this.focusedTag):this._tagEls.length>0?this.focusTag(this._tagEls[this._tagEls.length-1]):this.inputEl.focus())}componentDidRender(){this.positionInput(),this._tagEls.forEach((t=>{const e=t.querySelector(".tag-text"),i=this.el.shadowRoot.querySelector(".tags-and-input-wrapper"),r=e.getBoundingClientRect().left,o=i.getBoundingClientRect().right-10-8-28,a=t.id.replace("tag-",""),s=a&&this.el.querySelector("#"+a);s&&(e.textContent=l(e,this.getTagName(s),o-r,5))}))}createPlaceholderDefault(t,e){const i=a.formatMessage({id:"tagInput.placeholderAddAndSearch",defaultMessage:"Add or search for a tag",description:"Placeholder text. Use imperative"}),r=a.formatMessage({id:"tagInput.placeholderSearch",defaultMessage:"Search and select a tag",description:"Placeholder text. Use imperative"}),o=a.formatMessage({id:"tagInput.placeholderAdd",defaultMessage:"Add a new tag",description:"Placeholder text. Use imperative"});let s="";return t&&e?s=i:!t&&e?s=r:t&&(s=o),s}handleClick(t){this.isDropdown&&!this.el.contains(t.target)&&this.isExpanded&&this.closeDropdown()}announceError(){this.errorMessage&&setTimeout((()=>this.announce(this.errorMessage)),100)}handleOptionClick(t){let e;t.preventDefault(),this.resetInput(),this.isTable?(e=t.target,e=this.tagOptionFromEl(e.closest("tr"))):e=this.tagOptionFromEl(t.target),e.click(),e.locked?this.announce(this.tagLockedMessage(this.getTagName(e))):e.selected?this.isTable&&e.emitDeselectedEvent():e.emitSelectedEvent()}dismissTooltip(){this.tooltipVisible&&h()}handleInputKeyDown(t){switch(/^.$/.test(t.key)&&this.charCount>=this.characterLimit&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),t.key){case"Enter":t.preventDefault(),this.handleInputEnter();break;case"ArrowDown":t.preventDefault(),this.handleInputArrowDown();break;case"ArrowUp":t.preventDefault(),this.handleInputArrowUp();break;case"ArrowLeft":this.isTable&&(t.preventDefault(),this.focusPrevCell());break;case"ArrowRight":this.isTable&&(t.preventDefault(),this.focusNextCell());break;case"Escape":this.isDropdown&&this.isExpanded&&(t.preventDefault(),this.closeDropdown());break;case"ArrowLeft":case"Backspace":this.handleInputBackspace()}}handleInputFocus(){this.isDropdown&&(this.openDropdown(),this.clearOptionFocus())}handleInputChanged(t){this.clearOptionFocus(),this.isDropdown&&(this.charCount>=this.characterLimit-5&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),this.isExpanded||this.openDropdown());const e=t.target.value;e.includes(",")&&this.addNew?this.addTags(e):this.announceExistingOptions()}handleInputEnter(){if(this.focusedOption)this.focusedOption.locked?this.announce(this.tagLockedMessage(this.getTagName(this.focusedOption))):(this.focusedOption.click(),this.focusedOption.selected?this.isTable&&this.focusedOption.emitDeselectedEvent():this.focusedOption.emitSelectedEvent(),this.resetInput());else if(this.isDropdown){const t=this.inputEl.value;t&&(this.isExistingTag(t)?this.announce(this.tagAlreadyAddedMessage(t)):this.addTags(t),this.resetInput())}}handleInputArrowDown(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&"add-new-btn"===this.addNewButton.id&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=d(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=d(t,this._focusedOption,!0);this.focusOption(e)}}handleInputArrowUp(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=c(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=c(t,this._focusedOption,!0);this.focusOption(e)}}handleInputBackspace(){""===this.inputEl.value&&this._tagEls.length>0&&(this.isKeying=!0,window.requestAnimationFrame((()=>{this.tagAreaEl.focus(),this.focusTag(this._tagEls[this._tagEls.length-1])})))}handleTagAreaKeyDown(t){switch(t.key){case"ArrowLeft":case"ArrowUp":if(t.preventDefault(),this.focusedTag){const t=c(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"ArrowRight":case"ArrowDown":if(t.preventDefault(),this.focusedTag){const t=d(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"Backspace":case"Delete":if(this.focusedTag){const t=this.tagOptionFromTag(this.focusedTag);t.locked?this.announce(this.tagLockedMessage(this.getTagName(t))):t.emitDeselectedEvent()}}}handleBlur(t){this.dismissTooltip(),this.clearOptionFocus(),this.isElOrChild(t.relatedTarget)||(this.fieldWrapperEl.classList.remove("focused"),this.isDropdown&&this.closeDropdown())}handleTagAreaFocus(t){if(this.isDropdown&&this.closeDropdown(),this._tagEls.length>0){const e=t.relatedTarget;this.focusTag(e&&"input"===e.id?this._tagEls[this._tagEls.length-1]:this._tagEls[0])}}focusPrevCell(){this.focusedOption&&this.focusedColumn>0&&(this.focusedColumn-=1)}focusNextCell(){if(this._focusedOption){const t=this._focusedOption.querySelectorAll("td").length-1;this.focusedColumn<t&&(this.focusedColumn+=1)}}focusOption(t){if(t){if(this.focusedOption=this.tagOptionFromEl(t),t===this.addNewButton?this.addNewButton.classList.add("focused"):this.addNewButton&&this.addNewButton.classList.remove("focused"),this.isTable){const t=this._focusedOption.querySelector(".cell-content-wrapper"),e=t.scrollWidth>t.clientWidth;this.dismissTooltip(),e&&p("bottom",this._focusedOption,this._focusedOption.innerText)}t.scrollIntoView({block:"nearest"})}}showTooltipIfTruncated(t){const e=t.querySelector(".tag-text").textContent,i=t.id.replace("tag-","");if(i){const r=this.el.querySelector("#"+i),o=this.getTagName(r);e!==o&&e.includes("...")&&p("bottom",t,o)}}focusTag(t){this.focusedTagIndex=this._tagEls.indexOf(t),t.scrollIntoView({block:"nearest"}),window.requestAnimationFrame((()=>{h(),this.showTooltipIfTruncated(t)}))}clearOptionFocus(){this.focusedOption=void 0,this.focusedColumn=0}openDropdown(){this.openUp=g(this.el,this.dropdownEl.clientHeight,this.el.clientHeight,-2),this.isExpanded=!0}closeDropdown(){this.clearOptionFocus(),this.isExpanded=!1}resetInput(){this.inputEl.value=""}announce(t){this.liveRegionEl.textContent===t&&(t+=" "),this.liveRegionMessage=t}addTags(t){const e=t.split(",").filter((t=>t.match(/\S/)));e.forEach((t=>{this.wmTagInputTagAdded.emit(t)})),this.announce(this.tagAddedMessage(e.join(", "))),this.resetInput()}announceExistingOptions(){window.requestAnimationFrame((()=>{const t=a.formatMessage({id:"tagInput.existingOptions",defaultMessage:"{num, plural, one {1 existing option.} other {# existing options.}}"},{num:this.filteredOptionEls.length});this.announce(t)}))}generateCharacterLimitWarning(t,e){let i=m.getCharactersEntered(t,e);return t>=e&&(i+=` ${m.characterLimitReached}`),i}positionInput(){if(this.tagAreaEl){const t=this._tagEls[this._tagEls.length-1];if(this.inputEl.style.position="static",this.inputEl.style.width="100%",this.inputEl.classList.add("extended"),t){const e=this.tagAreaEl.getBoundingClientRect().right-t.getBoundingClientRect().right;e>=this.inputMinimumWidth&&(this.inputEl.style.position="absolute",this.inputEl.style.top=t.offsetTop.toString()+"px",this.inputEl.style.width=(e-8).toString()+"px",this.inputEl.classList.remove("extended"))}}}handleTagMouseEnter(t){this.showTooltipIfTruncated(t.target)}renderDropdown(){return r("div",{class:`dropdown-wrapper ${this.isExpanded?"open":""} ${this.openUp?"upwards":""}`,ref:t=>this.dropdownEl=t},r("div",{id:"help-text",class:"help-text"},this.renderHelpText()),r("ul",{class:"dropdown",id:"dropdown",role:"listbox","aria-multiselectable":"true","aria-expanded":this.isExpanded?"true":"false","aria-label":this.label,tabindex:-1},this.inputEl&&this.renderAddNewButton(),this.filteredOptionEls.map((t=>this.renderListItem(t)))))}renderHelpText(){if(this.helpText)return this.helpText;let t="";return this.optionEls.length>0&&(t=this.selectionHelpText),this.addNew&&(t+=" "+this.addNewHelpText),t}renderAddNewButton(){const t=this.inputEl.value.trim(),e=this.inputEl.value.match(/\S/),i=this.isExistingTag(this.inputEl.value.trim());return this.addNew&&e&&!i&&r("li",{ref:t=>this.addNewButton=t,id:"add-new-btn",class:"add-new-btn",onClick:()=>this.addTags(t)},"Add "+t)}renderTable(){return r("div",{class:"table-wrapper",onScroll:()=>this.dismissTooltip()},r("table",{id:"table",role:"grid",class:this.colWidths?"fixed-widths":"","aria-label":this.label,"aria-multiselectable":"true"},this.renderTableHeaders(),this.filteredOptionEls.length?this.filteredOptionEls.map((t=>this.renderTableRow(t))):r("div",{class:"no-results"},this.noResultsMessage)))}renderTableHeaders(){return r("tr",{class:"headers",role:"row"},u(this.colHeaders).map(((t,e)=>{let i="wrap";return this.colWrap&&u(this.colWrap)[e]&&(i=u(this.colWrap)[e]),r("th",{class:`header-cell ${i}`,role:"columnheader",width:this.colWidths?u(this.colWidths)[e]:""},t)})))}renderTag(t){const e=this.focusedTag&&this.focusedTag.id==="tag-"+t.id?"focused":"",i=this.getTagName(t);return r("li",{id:"tag-"+t.id,role:"option",class:`tag ${e} ${t.locked?"locked":""}`,"aria-describedby":`tag-${t.id}-description`,onMouseEnter:t=>this.handleTagMouseEnter(t),onMouseLeave:h},r("span",{class:"sr-only"},i),r("div",{class:"description",id:`tag-${t.id}-description`},t.locked?"locked":""),r("span",{class:"tag-text","aria-hidden":"true"},i),t.locked?r("div",{class:"icon lock"}):r("button",{class:"icon remove-btn",tabIndex:-1,onClick:()=>t.emitDeselectedEvent()}))}renderTags(){return this.tagsList.map((t=>this.renderTag(t)))}renderTagCounter(){if(this.maxTags)return r("div",{class:"lower-row"},r("div",{id:"max-tags"},this.renderMaxTags()))}renderMaxTags(){if(this.helpText)return this.helpText;{let t=`${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;return this.tagLimitReached&&(t+=`- ${this.maxTagsReachedMessage}`),t}}handleCellMouseEnter(t){const e=t.target,i=e.querySelector(".cell-content-wrapper");i.scrollWidth>i.clientWidth&&p("bottom",e,e.innerText)}renderTableCells(t){return[t.col1,t.col2,t.col3,t.col4].filter((t=>!!t)).map(((e,i)=>{const o=`${t.id}-col${i+1}`;let a="wrap";return this.colWrap&&u(this.colWrap)[i]&&(a=u(this.colWrap)[i]),r("td",{id:o,class:{focused:!!this._focusedCell&&o===this._focusedCell.id},role:"gridcell","aria-describedby":`${o}-description`,"aria-selected":t.selected?"true":"false","aria-readonly":t.locked?"true":null,onMouseEnter:t=>this.handleCellMouseEnter(t),onMouseLeave:()=>h()},r("div",{class:`cell-content-wrapper ${a}`},e),r("div",{class:"description",id:`${o}-description`},t.locked?"locked":""))}))}renderTableRow(t){return r("tr",{id:t.id,class:{selected:t.selected,locked:t.locked,focused:!(!this.focusedOption||t!==this.focusedOption)},onClick:t=>this.handleOptionClick(t)},this.renderTableCells(t))}renderListItem(t){if(this.inputEl)return r("li",{id:t.id,role:"option",class:"option "+(this.focusedOption&&t===this.focusedOption?"focused":""),"aria-selected":t.selected?"true":"false",onClick:t=>this.handleOptionClick(t)},t.textContent)}render(){return r("div",{class:`wrapper label-${this.labelPosition} ${this.errorMessage?"invalid":""}`},r("div",{class:"label-wrapper"},r("label",{class:"label",htmlFor:"input"},this.label,this.requiredField&&r("span",{class:"required","aria-hidden":"true"},"*"))),r("div",{class:`field-wrapper ${this.el.shadowRoot.activeElement===this.inputEl?"focused":""} ${this.errorMessage?"invalid":""}`,ref:t=>this.fieldWrapperEl=t},r("div",{class:"upper-row"},r("div",{class:"tags-and-input-wrapper "+(this.inModal?"in-modal":"")},r("ul",{ref:t=>this.tagAreaEl=t,class:`tag-area ${0===this.taggedOptions.length&&"empty"} ${this.isKeying?"user-is-keying":""}`,role:"listbox","aria-activedescendant":this.focusedTag?this.focusedTag.id:null,"aria-orientation":"horizontal","aria-label":`${this.label} ${this.tagAreaInstructions}`,tabindex:this._tagEls.length>0?0:-1,"aria-describedby":"info max-tags",onFocus:t=>this.handleTagAreaFocus(t),onBlur:t=>{this.focusedTagIndex=void 0,this.handleBlur(t)},onKeyDown:t=>this.handleTagAreaKeyDown(t)},this.renderTags()),r("input",{id:"input",class:"input",role:"combobox",ref:t=>this.inputEl=t,autocomplete:"off","aria-required":this.requiredField?"true":null,"aria-controls":this.tagInputType,"aria-describedby":`help-text${this.errorMessage?" error ":""} max-tags`,"aria-label":`${this.label} ${this.isDropdown?m.getCharacterLimit(this.characterLimit):""}`,"aria-expanded":this.isDropdown?this.isExpanded.toString():null,"aria-activedescendant":this.inputActiveDescendantId,placeholder:this.placeholder,maxLength:this.isDropdown?this.characterLimit:void 0,onInput:t=>this.handleInputChanged(t),onBlur:t=>{this.handleBlur(t)},onFocus:()=>this.handleInputFocus(),onKeyDown:t=>this.handleInputKeyDown(t)})),this.isDropdown&&r("div",{class:"character-count"},this.charCount,"/",this.characterLimit)),this.renderTagCounter(),this.isDropdown&&this.renderDropdown()),this.info&&r("div",{id:"info",class:"info-text"},this.info),r("div",{id:"error"},this.errorMessage),r("div",{class:"sr-only","aria-live":"polite",ref:t=>this.liveRegionEl=t,"aria-atomic":"true"},this.liveRegionMessage),this.isTable&&this.renderTable())}static get delegatesFocus(){return!0}get el(){return o(this)}static get watchers(){return{errorMessage:["announceError"]}}};w.style=':host{--wmcolor-taginput-altrow-background-table:var(--wmcolor-table-altrow-background);--wmcolor-taginput-border:var(--wmcolor-input-border);--wmcolor-taginput-charcount-background:var(--wmcolor-input-charcount-background);--wmcolor-taginput-header-background-table:var(--wmcolor-table-header-background);--wmcolor-taginput-help-text:var(--wmcolor-text);--wmcolor-taginput-icon:var(--wmcolor-icon-accent);--wmcolor-taginput-maxtags-background:var(--wmcolor-background-readonly);--wmcolor-taginput-maxtags-border:var(--wmcolor-input-border);--wmcolor-taginput-maxtags-text:var(--wmcolor-text);--wmcolor-taginput-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-taginput-option-background:var(--wmcolor-option-background);--wmcolor-taginput-option-border:var(--wmcolor-option-border);--wmcolor-taginput-option-text-selected:var(--wmcolor-option-text-disabled);--wmcolor-taginput-option-text:var(--wmcolor-interactive);--wmcolor-taginput-row-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-taginput-row-background-selected:var(--wmcolor-table-row-background-selected);--wmcolor-taginput-row-background-table:var(--wmcolor-table-row-background);--wmcolor-taginput-row-border-selected:var(--wmcolor-table-row-border-selected);--wmcolor-taginput-tag-background-focus:var(--wmcolor-palelilacgray-dark);--wmcolor-taginput-tag-background-highlight:var(--wmcolor-interactive-background-highlight);--wmcolor-taginput-tag-background-locked:var(--wmcolor-interactive-disabled);--wmcolor-taginput-tag-background:var(--wmcolor-palelilacgray);--wmcolor-taginput-tag-text-locked:var(--wmcolor-text-ondark);--wmcolor-taginput-tag-text:var(--wmcolor-text);--wmcolor-taginput-tagbutton-background-hover:var(--wmcolor-button-background-icononly-hover);--wmcolor-taginput-tagbutton-border:var(--wmcolor-button-border-icononly);--wmcolor-taginput-tagbutton-icon-hover:var(--wmcolor-button-icon-icononly-hover);--wmcolor-taginput-tagbutton-icon:var(--wmcolor-button-icon-icononly);font-family:inherit;width:100%;display:block;max-height:80vh}:host *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}: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{width:100%;height:100%;max-height:inherit;min-height:inherit;position:relative}:host .field-wrapper{position:relative;width:100%;border:1px solid;border-color:var(--wmcolor-taginput-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .field-wrapper.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:not(.label-left) .field-wrapper{-ms-flex-negative:0;flex-shrink:0}:host .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:var(--wmcolor-taginput-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper{position:relative;width:100%;padding:8px 8px 8px 6px;overflow:auto;max-height:200px}:host .tags-and-input-wrapper.in-modal{max-height:20vh}:host .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;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:"\\f349";color:var(--wmcolor-taginput-icon);padding:0.75rem 0.5rem 0.75rem 0.75rem;line-height:normal;font-size:1.12rem}:host .lower-row{width:100%;min-height:1.875rem}:host #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:1.875rem;background-color:var(--wmcolor-taginput-maxtags-background);padding:0.5rem 1rem;color:var(--wmcolor-taginput-maxtags-text);font-size:0.875rem;border-top:1px solid var(--wmcolor-taginput-maxtags-border);border-radius:0 0 3px 3px}:host .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0;margin:0;gap:8px}:host .tag-area:focus{outline:none}:host .tag-area li{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:var(--wmcolor-taginput-tag-text);background-color:var(--wmcolor-taginput-tag-background);padding:0.5rem 0.625rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area li.highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}@keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}:host .tag-area li.locked{background-color:var(--wmcolor-taginput-tag-background-locked);color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area li .icon.remove-btn{border:1px solid var(--wmcolor-taginput-tagbutton-border);color:var(--wmcolor-taginput-tagbutton-icon);border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1)}:host .tag-area li .icon.remove-btn:hover{color:var(--wmcolor-taginput-tagbutton-icon-hover);background-color:var(--wmcolor-taginput-tagbutton-background-hover)}:host .tag-area li .icon.remove-btn: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:"\\f156"}:host .tag-area li .icon.lock{color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon.lock: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:"\\f341"}:host .tag-area.user-is-keying:focus-visible li.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:3px}:host .input{font-family:inherit;border:none;height:1.75rem;padding:0;margin:0;right:8px}:host .input:focus{outline:none}:host .tag-area:not(.empty)+.input.extended{-webkit-margin-before:8px;margin-block-start:8px}:host .dropdown-wrapper{margin:0;padding:0;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:calc(100% + 2px);right:0;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:var(--wmcolor-taginput-option-background);list-style:none;min-height:2.6875rem;white-space:pre-wrap;overflow-wrap:anywhere}:host .dropdown-wrapper li.option,:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div.option,:host .dropdown-wrapper div.add-new-btn{cursor:pointer;color:var(--wmcolor-taginput-option-text);font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li.option[aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div.option[aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:var(--wmcolor-taginput-option-text-selected);font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li.option:hover:not([aria-selected=true]),:host .dropdown-wrapper li.option.focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div.option:hover:not([aria-selected=true]),:host .dropdown-wrapper div.option.focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused{outline:none;background:var(--wmcolor-taginput-option-background-hover)}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text{color:var(--wmcolor-taginput-help-text);height:auto;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child){border-bottom:2px solid var(--wmcolor-taginput-option-border)}:host .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper{overflow:auto;margin-top:1.5rem}:host .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers{height:2.5rem;background-color:var(--wmcolor-taginput-header-background-table)}:host .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr:nth-child(even){background-color:var(--wmcolor-taginput-altrow-background-table)}:host .table-wrapper tr.selected,:host .table-wrapper tr.locked{background-color:var(--wmcolor-taginput-row-background-selected);-webkit-box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);font-weight:500}:host .table-wrapper tr.focused,:host .table-wrapper tr:hover:not(.locked){background-color:var(--wmcolor-taginput-row-background-hover);-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper tr.locked td{cursor:auto}:host .table-wrapper tr.locked td:first-child .cell-content-wrapper: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:"\\f33e";margin-right:0.5rem;color:var(--wmcolor-taginput-tag-text)}:host .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}:host .table-wrapper td .cell-content-wrapper.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .description{display:none}:host .no-results{padding:1.25rem 1.5rem}: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}:host #error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem}:host #error:not(:empty){margin-top:0.25rem}';export{w as wm_tag_input}
1
+ import{r as t,c as e,f as i,h as r,g as o}from"./p-568c595f.js";import{i as a,d as s,u as n,m as l,h,v as d,w as c,s as p,k as g,x as u}from"./p-76825602.js";import{g as m}from"./p-fb229776.js";const w=class{constructor(r){t(this,r),this.wmTagInputTagAdded=e(this,"wmTagInputTagAdded",7),this.addNewHelpText=a.formatMessage({id:"tagInput.addNewHelpText",defaultMessage:"Press the Enter or Comma key to add a new tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.selectionHelpText=a.formatMessage({id:"tagInput.selectionHelpText",defaultMessage:"Search and select a tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.maxTagsReachedMessage=a.formatMessage({id:"tagInput.maxTagsReached",defaultMessage:"No more tags can be added because the limit has been reached."}),this.tagAreaInstructions=a.formatMessage({id:"tagInput.tagAreaInstructions",defaultMessage:"tag selection. Press Backspace or Delete to remove a tag."}),this.tagsAddedMessage=a.formatMessage({id:"tagInput.tagsAdded",defaultMessage:"Tags added",description:"Full message for context: 'Tags added: x/y"}),this.openUp=!1,this.inModal=!1,this.debouncedUpdate=s((()=>i(this.el)),30),this.label=void 0,this.errorMessage=void 0,this.info=void 0,this.labelPosition="top",this.maxTags=void 0,this.placeholder=void 0,this.requiredField=!1,this.tagInputType="dropdown",this.helpText=void 0,this.addNew=!0,this.characterLimit=50,this.colHeaders=void 0,this.colWidths=void 0,this.colWrap=void 0,this.isKeying=!1,this.isExpanded=!1,this.liveRegionMessage="",this.focusedOption=void 0,this.focusedColumn=0,this.focusedTagIndex=void 0,this.tagsList=[]}toggleKeyingOn(){this.isKeying=!0}toggleKeyingOff(){this.isKeying=!1}get isDropdown(){return"dropdown"===this.tagInputType}get isTable(){return"table"===this.tagInputType}get charCount(){return this.inputEl?this.inputEl.value.length:0}get tooltipVisible(){return document.getElementById("wm-tooltip").classList.contains("show")}get optionEls(){return Array.from(this.el.querySelectorAll("wm-tag-option"))}get filteredOptionEls(){const t=this.inputEl?this.inputEl.value.toLowerCase():"";return Array.from(this.optionEls).filter((e=>{let i="";return this.isDropdown?i=e.textContent.toLowerCase():this.isTable&&(i=[e.col1,e.col2,e.col3,e.col4].join("").toLowerCase()),i.includes(t)}))}get taggedOptions(){return this.optionEls.filter((t=>t.selected||t.locked))}get _tagEls(){return this.tagAreaEl?Array.from(this.tagAreaEl.querySelectorAll(".tag")):[]}get focusedTag(){if(void 0!==this.focusedTagIndex&&this.focusedTagIndex>=0)return this._tagEls[this.focusedTagIndex]}tagOptionFromEl(t){return"add-new-btn"===t.id?void 0:this.el.querySelector("#"+t.id)}tagOptionFromTag(t){const e=t.id.replace("tag-","");return this.el.querySelector("#"+e)}elFromTagOption(t){return this.el.shadowRoot.querySelector("#"+t.id)}get _focusedOption(){return this.focusedOption?this.elFromTagOption(this.focusedOption):this.addNewButton&&this.addNewButton.classList.contains("focused")?this.addNewButton:void 0}get _focusedCell(){if(this._focusedOption)return Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn||0]}get inputActiveDescendantId(){return this._focusedOption?this.isTable?Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn].id:this._focusedOption.id:null}get tagLimitReached(){return!!(this.maxTags&&this.taggedOptions.length>=this.maxTags)}get noResultsMessage(){return a.formatMessage({id:"tagInput.noResults",defaultMessage:"No results match your search.",description:"Message displayed when a user's search returns empty."})}get inputMinimumWidth(){if(this._tagEls){const t=getComputedStyle(this.inputEl),e=getComputedStyle(this._tagEls[this._tagEls.length-1]),i=[t.paddingLeft,t.paddingRight,t.marginLeft,t.marginRight,e.marginRight].reduce(((t,e)=>t+parseInt(e.replace("px",""))),0);return Math.max(150,n(this.inputEl,this.placeholder).width+i)}return 150}getTagName(t){return this.isDropdown?t.textContent:t.col1}isExistingTag(t){return this.optionEls.map((t=>this.getTagName(t).toLowerCase())).includes(t.toLowerCase())}tagAddedMessage(t){return a.formatMessage({id:"tagInput.tagAdded",defaultMessage:"{tagName} added.",description:"A confirmation for adding a tag."},{tagName:t})}tagRemovedMessage(t){return a.formatMessage({id:"tagInput.tagRemoved",defaultMessage:"{tagName} removed.",description:"A confirmation for removing a tag."},{tagName:t})}tagAlreadyAddedMessage(t){return a.formatMessage({id:"tagInput.tagAlreadyAdded",defaultMessage:"{tagName} has already been added.",description:"An alert for adding a tag that is already present."},{tagName:t})}tagLockedMessage(t){return a.formatMessage({id:"tagInput.tagLocked",defaultMessage:"{tagName} is locked and cannot be removed.",description:"An alert for when a user tries to remove a tag that is locked."},{tagName:t})}isElOrChild(t){return t===this.el||this.el.shadowRoot.contains(t)||this.el.contains(t)}componentWillLoad(){this.placeholder||(this.placeholder=this.createPlaceholderDefault(this.addNew,this.optionEls.length>0)),this.label||console.error("wm-tag-input must have a label property"),this.el.focus=()=>{const t=this._tagEls[0];t?(this.tagAreaEl.focus(),this.focusTag(t)):this.inputEl.focus()},new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el),this.el.closest("wm-modal")&&(this.inModal=!0);const t=[],e=[];this.optionEls.forEach((i=>{i.locked?t.push(i):i.selected&&e.push(i)})),this.tagsList=[...t,...e]}componentDidLoad(){new MutationObserver((t=>t.forEach((t=>this.handleChangeAnnouncement(t))))).observe(this.el,{subtree:!0,attributes:!0,attributeFilter:["selected"],childList:!0}),new MutationObserver((t=>t.forEach((t=>this.handleOptionListChange(t))))).observe(this.el,{childList:!0}),this.tagAreaEl&&new MutationObserver((t=>t.forEach((t=>this.handleTagListChange(t))))).observe(this.tagAreaEl,{childList:!0})}handleChangeAnnouncement(t){const e=t.target;if("childList"==t.type&&t.removedNodes.length>0)this.announce(this.tagRemovedMessage(t.removedNodes[0].textContent));else if("attributes"==t.type){const t=this.getTagName(e);if(e.selected){let e=this.tagAddedMessage(t);this.tagLimitReached&&(e+=` ${this.maxTagsReachedMessage}`),this.announce(e)}else this.announce(this.tagRemovedMessage(t))}}handleOptionListChange(t){const e=Array.from(t.addedNodes);e.length>0&&e.forEach((t=>!this.tagsList.includes(t)&&this.tagsList.push(t)));const i=Array.from(t.removedNodes);i.length>0&&(this.tagsList=this.tagsList.filter((t=>!i.includes(t))))}handleTagOptionSelected(t){this.tagsList=this.tagsList.concat(t.target)}handleTagOptionDeselected(t){const e=t.target;this.tagsList=this.tagsList.filter((t=>t!=e))}handleTagListChange(t){const e=Array.from(t.addedNodes);e&&e.forEach((t=>{t.classList.add("highlight")}));const i=t.removedNodes[0];i&&(i.classList.remove("highlight"),this.focusedTag?this.focusTag(this.focusedTag):this._tagEls.length>0?this.focusTag(this._tagEls[this._tagEls.length-1]):this.inputEl.focus())}componentDidRender(){this.positionInput(),this._tagEls.forEach((t=>{const e=t.querySelector(".tag-text"),i=this.el.shadowRoot.querySelector(".tags-and-input-wrapper"),r=e.getBoundingClientRect().left,o=i.getBoundingClientRect().right-10-8-28,a=t.id.replace("tag-",""),s=a&&this.el.querySelector("#"+a);s&&(e.textContent=l(e,this.getTagName(s),o-r,5))}))}createPlaceholderDefault(t,e){const i=a.formatMessage({id:"tagInput.placeholderAddAndSearch",defaultMessage:"Add or search for a tag",description:"Placeholder text. Use imperative"}),r=a.formatMessage({id:"tagInput.placeholderSearch",defaultMessage:"Search and select a tag",description:"Placeholder text. Use imperative"}),o=a.formatMessage({id:"tagInput.placeholderAdd",defaultMessage:"Add a new tag",description:"Placeholder text. Use imperative"});let s="";return t&&e?s=i:!t&&e?s=r:t&&(s=o),s}handleClick(t){this.isDropdown&&!this.el.contains(t.target)&&this.isExpanded&&this.closeDropdown()}announceError(){this.errorMessage&&setTimeout((()=>this.announce(this.errorMessage)),100)}handleOptionClick(t){let e;t.preventDefault(),this.resetInput(),this.isTable?(e=t.target,e=this.tagOptionFromEl(e.closest("tr"))):e=this.tagOptionFromEl(t.target),e.click(),e.locked?this.announce(this.tagLockedMessage(this.getTagName(e))):e.selected?this.isTable&&e.emitDeselectedEvent():e.emitSelectedEvent()}dismissTooltip(){this.tooltipVisible&&h()}handleInputKeyDown(t){switch(/^.$/.test(t.key)&&this.charCount>=this.characterLimit&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),t.key){case"Enter":t.preventDefault(),this.handleInputEnter();break;case"ArrowDown":t.preventDefault(),this.handleInputArrowDown();break;case"ArrowUp":t.preventDefault(),this.handleInputArrowUp();break;case"ArrowLeft":this.isTable&&(t.preventDefault(),this.focusPrevCell());break;case"ArrowRight":this.isTable&&(t.preventDefault(),this.focusNextCell());break;case"Escape":this.isDropdown&&this.isExpanded&&(t.preventDefault(),this.closeDropdown());break;case"ArrowLeft":case"Backspace":this.handleInputBackspace()}}handleInputFocus(){this.isDropdown&&(this.openDropdown(),this.clearOptionFocus())}handleInputChanged(t){this.clearOptionFocus(),this.isDropdown&&(this.charCount>=this.characterLimit-5&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),this.isExpanded||this.openDropdown());const e=t.target.value;e.includes(",")&&this.addNew?this.addTags(e):this.announceExistingOptions()}handleInputEnter(){if(this.focusedOption)this.focusedOption.locked?this.announce(this.tagLockedMessage(this.getTagName(this.focusedOption))):(this.focusedOption.click(),this.focusedOption.selected?this.isTable&&this.focusedOption.emitDeselectedEvent():this.focusedOption.emitSelectedEvent(),this.resetInput());else if(this.isDropdown){const t=this.inputEl.value;t&&(this.isExistingTag(t)?this.announce(this.tagAlreadyAddedMessage(t)):this.addTags(t),this.resetInput())}}handleInputArrowDown(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&"add-new-btn"===this.addNewButton.id&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=d(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=d(t,this._focusedOption,!0);this.focusOption(e)}}handleInputArrowUp(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=c(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=c(t,this._focusedOption,!0);this.focusOption(e)}}handleInputBackspace(){""===this.inputEl.value&&this._tagEls.length>0&&(this.isKeying=!0,window.requestAnimationFrame((()=>{this.tagAreaEl.focus(),this.focusTag(this._tagEls[this._tagEls.length-1])})))}handleTagAreaKeyDown(t){switch(t.key){case"ArrowLeft":case"ArrowUp":if(t.preventDefault(),this.focusedTag){const t=c(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"ArrowRight":case"ArrowDown":if(t.preventDefault(),this.focusedTag){const t=d(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"Backspace":case"Delete":if(this.focusedTag){const t=this.tagOptionFromTag(this.focusedTag);t.locked?this.announce(this.tagLockedMessage(this.getTagName(t))):t.emitDeselectedEvent()}}}handleBlur(t){this.dismissTooltip(),this.clearOptionFocus(),this.isElOrChild(t.relatedTarget)||(this.fieldWrapperEl.classList.remove("focused"),this.isDropdown&&this.closeDropdown())}handleTagAreaFocus(t){if(this.isDropdown&&this.closeDropdown(),this._tagEls.length>0){const e=t.relatedTarget;this.focusTag(e&&"input"===e.id?this._tagEls[this._tagEls.length-1]:this._tagEls[0])}}focusPrevCell(){this.focusedOption&&this.focusedColumn>0&&(this.focusedColumn-=1)}focusNextCell(){if(this._focusedOption){const t=this._focusedOption.querySelectorAll("td").length-1;this.focusedColumn<t&&(this.focusedColumn+=1)}}focusOption(t){if(t){if(this.focusedOption=this.tagOptionFromEl(t),t===this.addNewButton?this.addNewButton.classList.add("focused"):this.addNewButton&&this.addNewButton.classList.remove("focused"),this.isTable){const t=this._focusedOption.querySelector(".cell-content-wrapper"),e=t.scrollWidth>t.clientWidth;this.dismissTooltip(),e&&p("bottom",this._focusedOption,this._focusedOption.innerText)}t.scrollIntoView({block:"nearest"})}}showTooltipIfTruncated(t){const e=t.querySelector(".tag-text").textContent,i=t.id.replace("tag-","");if(i){const r=this.el.querySelector("#"+i),o=this.getTagName(r);e!==o&&e.includes("...")&&p("bottom",t,o)}}focusTag(t){this.focusedTagIndex=this._tagEls.indexOf(t),t.scrollIntoView({block:"nearest"}),window.requestAnimationFrame((()=>{h(),this.showTooltipIfTruncated(t)}))}clearOptionFocus(){this.focusedOption=void 0,this.focusedColumn=0}openDropdown(){this.openUp=g(this.el,this.dropdownEl.clientHeight,this.el.clientHeight,-2),this.isExpanded=!0}closeDropdown(){this.clearOptionFocus(),this.isExpanded=!1}resetInput(){this.inputEl.value=""}announce(t){this.liveRegionEl.textContent===t&&(t+=" "),this.liveRegionMessage=t}addTags(t){const e=t.split(",").filter((t=>t.match(/\S/)));e.forEach((t=>{this.wmTagInputTagAdded.emit(t)})),this.announce(this.tagAddedMessage(e.join(", "))),this.resetInput()}announceExistingOptions(){window.requestAnimationFrame((()=>{const t=a.formatMessage({id:"tagInput.existingOptions",defaultMessage:"{num, plural, one {1 existing option.} other {# existing options.}}"},{num:this.filteredOptionEls.length});this.announce(t)}))}generateCharacterLimitWarning(t,e){let i=m.getCharactersEntered(t,e);return t>=e&&(i+=` ${m.characterLimitReached}`),i}positionInput(){if(this.tagAreaEl){const t=this._tagEls[this._tagEls.length-1];if(this.inputEl.style.position="static",this.inputEl.style.width="100%",this.inputEl.classList.add("extended"),t){const e=this.tagAreaEl.getBoundingClientRect().right-t.getBoundingClientRect().right;e>=this.inputMinimumWidth&&(this.inputEl.style.position="absolute",this.inputEl.style.top=t.offsetTop.toString()+"px",this.inputEl.style.width=(e-8).toString()+"px",this.inputEl.classList.remove("extended"))}}}handleTagMouseEnter(t){this.showTooltipIfTruncated(t.target)}renderDropdown(){return r("div",{class:`dropdown-wrapper ${this.isExpanded?"open":""} ${this.openUp?"upwards":""}`,ref:t=>this.dropdownEl=t},r("div",{id:"help-text",class:"help-text"},this.renderHelpText()),r("ul",{class:"dropdown",id:"dropdown",role:"listbox","aria-multiselectable":"true","aria-expanded":this.isExpanded?"true":"false","aria-label":this.label,tabindex:-1},this.inputEl&&this.renderAddNewButton(),this.filteredOptionEls.map((t=>this.renderListItem(t)))))}renderHelpText(){if(this.helpText)return this.helpText;let t="";return this.optionEls.length>0&&(t=this.selectionHelpText),this.addNew&&(t+=" "+this.addNewHelpText),t}renderAddNewButton(){const t=this.inputEl.value.trim(),e=this.inputEl.value.match(/\S/),i=this.isExistingTag(this.inputEl.value.trim());return this.addNew&&e&&!i&&r("li",{ref:t=>this.addNewButton=t,id:"add-new-btn",class:"add-new-btn",onClick:()=>this.addTags(t)},"Add "+t)}renderTable(){return r("div",{class:"table-wrapper",onScroll:()=>this.dismissTooltip()},r("table",{id:"table",role:"grid",class:this.colWidths?"fixed-widths":"","aria-label":this.label,"aria-multiselectable":"true"},this.renderTableHeaders(),this.filteredOptionEls.length?this.filteredOptionEls.map((t=>this.renderTableRow(t))):r("div",{class:"no-results"},this.noResultsMessage)))}renderTableHeaders(){return r("tr",{class:"headers",role:"row"},u(this.colHeaders).map(((t,e)=>{let i="wrap";return this.colWrap&&u(this.colWrap)[e]&&(i=u(this.colWrap)[e]),r("th",{class:`header-cell ${i}`,role:"columnheader",width:this.colWidths?u(this.colWidths)[e]:""},t)})))}renderTag(t){const e=this.focusedTag&&this.focusedTag.id==="tag-"+t.id?"focused":"",i=this.getTagName(t);return r("li",{id:"tag-"+t.id,role:"option",class:`tag ${e} ${t.locked?"locked":""}`,"aria-describedby":`tag-${t.id}-description`,onMouseEnter:t=>this.handleTagMouseEnter(t),onMouseLeave:h},r("span",{class:"sr-only"},i),r("div",{class:"description",id:`tag-${t.id}-description`},t.locked?"locked":""),r("span",{class:"tag-text","aria-hidden":"true"},i),t.locked?r("div",{class:"icon lock"}):r("button",{class:"icon remove-btn",tabIndex:-1,onClick:()=>t.emitDeselectedEvent()}))}renderTags(){return this.tagsList.map((t=>this.renderTag(t)))}renderTagCounter(){if(this.maxTags)return r("div",{class:"lower-row"},r("div",{id:"max-tags"},this.renderMaxTags()))}renderMaxTags(){if(this.helpText)return this.helpText;{let t=`${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;return this.tagLimitReached&&(t+=`- ${this.maxTagsReachedMessage}`),t}}handleCellMouseEnter(t){const e=t.target,i=e.querySelector(".cell-content-wrapper");i.scrollWidth>i.clientWidth&&p("bottom",e,e.innerText)}renderTableCells(t){return[t.col1,t.col2,t.col3,t.col4].filter((t=>!!t)).map(((e,i)=>{const o=`${t.id}-col${i+1}`;let a="wrap";return this.colWrap&&u(this.colWrap)[i]&&(a=u(this.colWrap)[i]),r("td",{id:o,class:{focused:!!this._focusedCell&&o===this._focusedCell.id},role:"gridcell","aria-describedby":`${o}-description`,"aria-selected":t.selected?"true":"false","aria-readonly":t.locked?"true":null,onMouseEnter:t=>this.handleCellMouseEnter(t),onMouseLeave:()=>h()},r("div",{class:`cell-content-wrapper ${a}`},e),r("div",{class:"description",id:`${o}-description`},t.locked?"locked":""))}))}renderTableRow(t){return r("tr",{id:t.id,class:{selected:t.selected,locked:t.locked,focused:!(!this.focusedOption||t!==this.focusedOption)},onClick:t=>this.handleOptionClick(t)},this.renderTableCells(t))}renderListItem(t){if(this.inputEl)return r("li",{id:t.id,role:"option",class:"option "+(this.focusedOption&&t===this.focusedOption?"focused":""),"aria-selected":t.selected?"true":"false",onClick:t=>this.handleOptionClick(t)},t.textContent)}render(){return r("div",{class:`wrapper label-${this.labelPosition} ${this.errorMessage?"invalid":""}`},r("div",{class:"label-wrapper"},r("label",{class:"label",htmlFor:"input"},this.label,this.requiredField&&r("span",{class:"required","aria-hidden":"true"},"*"))),r("div",{class:`field-wrapper ${this.el.shadowRoot.activeElement===this.inputEl?"focused":""} ${this.errorMessage?"invalid":""}`,ref:t=>this.fieldWrapperEl=t},r("div",{class:"upper-row"},r("div",{class:"tags-and-input-wrapper "+(this.inModal?"in-modal":"")},r("ul",{ref:t=>this.tagAreaEl=t,class:`tag-area ${0===this.taggedOptions.length&&"empty"} ${this.isKeying?"user-is-keying":""}`,role:"listbox","aria-activedescendant":this.focusedTag?this.focusedTag.id:null,"aria-orientation":"horizontal","aria-label":`${this.label} ${this.tagAreaInstructions}`,tabindex:this._tagEls.length>0?0:-1,"aria-describedby":"info max-tags",onFocus:t=>this.handleTagAreaFocus(t),onBlur:t=>{this.focusedTagIndex=void 0,this.handleBlur(t)},onKeyDown:t=>this.handleTagAreaKeyDown(t)},this.renderTags()),r("input",{id:"input",class:"input",role:"combobox",ref:t=>this.inputEl=t,autocomplete:"off","aria-required":this.requiredField?"true":null,"aria-controls":this.tagInputType,"aria-describedby":`help-text${this.errorMessage?" error ":""} max-tags`,"aria-label":`${this.label} ${this.isDropdown?m.getCharacterLimit(this.characterLimit):""}`,"aria-expanded":this.isDropdown?this.isExpanded.toString():null,"aria-activedescendant":this.inputActiveDescendantId,placeholder:this.placeholder,maxLength:this.isDropdown?this.characterLimit:void 0,onInput:t=>this.handleInputChanged(t),onBlur:t=>{this.handleBlur(t)},onFocus:()=>this.handleInputFocus(),onKeyDown:t=>this.handleInputKeyDown(t)})),this.isDropdown&&r("div",{class:"character-count"},this.charCount,"/",this.characterLimit)),this.renderTagCounter(),this.isDropdown&&this.renderDropdown()),this.info&&r("div",{id:"info",class:"info-text"},this.info),r("div",{id:"error"},this.errorMessage),r("div",{class:"sr-only","aria-live":"polite",ref:t=>this.liveRegionEl=t,"aria-atomic":"true"},this.liveRegionMessage),this.isTable&&this.renderTable())}static get delegatesFocus(){return!0}get el(){return o(this)}static get watchers(){return{errorMessage:["announceError"]}}};w.style=':host{--wmcolor-taginput-altrow-background-table:var(--wmcolor-table-altrow-background);--wmcolor-taginput-border:var(--wmcolor-input-border);--wmcolor-taginput-charcount-background:var(--wmcolor-input-charcount-background);--wmcolor-taginput-header-background-table:var(--wmcolor-table-header-background);--wmcolor-taginput-help-text:var(--wmcolor-text);--wmcolor-taginput-icon:var(--wmcolor-icon-accent);--wmcolor-taginput-maxtags-background:var(--wmcolor-background-readonly);--wmcolor-taginput-maxtags-border:var(--wmcolor-input-border);--wmcolor-taginput-maxtags-text:var(--wmcolor-text);--wmcolor-taginput-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-taginput-option-background:var(--wmcolor-option-background);--wmcolor-taginput-option-border:var(--wmcolor-option-border);--wmcolor-taginput-option-text-selected:var(--wmcolor-option-text-disabled);--wmcolor-taginput-option-text:var(--wmcolor-interactive);--wmcolor-taginput-row-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-taginput-row-background-selected:var(--wmcolor-table-row-background-selected);--wmcolor-taginput-row-background-table:var(--wmcolor-table-row-background);--wmcolor-taginput-row-border-selected:var(--wmcolor-table-row-border-selected);--wmcolor-taginput-tag-background-focus:var(--wmcolor-palelilacgray-dark);--wmcolor-taginput-tag-background-highlight:var(--wmcolor-interactive-background-highlight);--wmcolor-taginput-tag-background-locked:var(--wmcolor-interactive-disabled);--wmcolor-taginput-tag-background:var(--wmcolor-palelilacgray);--wmcolor-taginput-tag-text-locked:var(--wmcolor-text-ondark);--wmcolor-taginput-tag-text:var(--wmcolor-text);--wmcolor-taginput-tagbutton-background-hover:var(--wmcolor-button-background-icononly-hover);--wmcolor-taginput-tagbutton-border:var(--wmcolor-button-border-icononly);--wmcolor-taginput-tagbutton-icon-hover:var(--wmcolor-button-icon-icononly-hover);--wmcolor-taginput-tagbutton-icon:var(--wmcolor-button-icon-icononly);font-family:inherit;width:100%;display:block;max-height:80vh}:host *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}: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{width:100%;height:100%;max-height:inherit;min-height:inherit;position:relative}:host .field-wrapper{position:relative;width:100%;border:1px solid;border-color:var(--wmcolor-taginput-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .field-wrapper.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:not(.label-left) .field-wrapper{-ms-flex-negative:0;flex-shrink:0}:host .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:var(--wmcolor-taginput-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper{position:relative;width:100%;padding:8px 8px 8px 6px;overflow:auto;max-height:200px}:host .tags-and-input-wrapper.in-modal{max-height:20vh}:host .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;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:"\\f349";color:var(--wmcolor-taginput-icon);padding:0.75rem 0.5rem 0.75rem 0.75rem;line-height:normal;font-size:1.12rem}:host .lower-row{width:100%;min-height:1.875rem}:host #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:1.875rem;background-color:var(--wmcolor-taginput-maxtags-background);padding:0.5rem 1rem;color:var(--wmcolor-taginput-maxtags-text);font-size:0.875rem;border-top:1px solid var(--wmcolor-taginput-maxtags-border);border-radius:0 0 3px 3px}:host .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0;margin:0;gap:8px}:host .tag-area:focus{outline:none}:host .tag-area li{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:var(--wmcolor-taginput-tag-text);background-color:var(--wmcolor-taginput-tag-background);padding:0.5rem 0.625rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area li.highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}@keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}:host .tag-area li.locked{background-color:var(--wmcolor-taginput-tag-background-locked);color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area li .icon.remove-btn{border:1px solid var(--wmcolor-taginput-tagbutton-border);color:var(--wmcolor-taginput-tagbutton-icon);border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1)}:host .tag-area li .icon.remove-btn:hover{color:var(--wmcolor-taginput-tagbutton-icon-hover);background-color:var(--wmcolor-taginput-tagbutton-background-hover)}:host .tag-area li .icon.remove-btn: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:"\\f156"}:host .tag-area li .icon.lock{color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon.lock: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:"\\f341"}:host .tag-area.user-is-keying:focus-visible li.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:3px}:host .input{font-family:inherit;border:none;height:1.75rem;padding:0;margin:0;right:8px}:host .input:focus{outline:none}:host .tag-area:not(.empty)+.input.extended{-webkit-margin-before:8px;margin-block-start:8px}:host .dropdown-wrapper{margin:0;padding:0;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:calc(100% + 2px);right:0;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:var(--wmcolor-taginput-option-background);list-style:none;min-height:2.6875rem;white-space:pre-wrap;overflow-wrap:anywhere}:host .dropdown-wrapper li.option,:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div.option,:host .dropdown-wrapper div.add-new-btn{cursor:pointer;color:var(--wmcolor-taginput-option-text);font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li.option[aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div.option[aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:var(--wmcolor-taginput-option-text-selected);font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li.option:hover:not([aria-selected=true]),:host .dropdown-wrapper li.option.focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div.option:hover:not([aria-selected=true]),:host .dropdown-wrapper div.option.focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused{outline:none;background:var(--wmcolor-taginput-option-background-hover)}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text{color:var(--wmcolor-taginput-help-text);height:auto;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child){border-bottom:2px solid var(--wmcolor-taginput-option-border)}:host .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper{overflow:auto;margin-top:1.5rem}:host .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers{height:2.5rem;background-color:var(--wmcolor-taginput-header-background-table)}:host .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr:nth-child(even){background-color:var(--wmcolor-taginput-altrow-background-table)}:host .table-wrapper tr.selected,:host .table-wrapper tr.locked{background-color:var(--wmcolor-taginput-row-background-selected);-webkit-box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);font-weight:500}:host .table-wrapper tr.focused,:host .table-wrapper tr:hover:not(.locked){background-color:var(--wmcolor-taginput-row-background-hover);-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper tr.locked td{cursor:auto}:host .table-wrapper tr.locked td:first-child .cell-content-wrapper: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:"\\f33e";margin-right:0.5rem;color:var(--wmcolor-taginput-tag-text)}:host .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}:host .table-wrapper td .cell-content-wrapper.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .description{display:none}:host .no-results{padding:1.25rem 1.5rem}: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}:host #error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem}:host #error:not(:empty){margin-top:0.25rem}';export{w as wm_tag_input}