@nanoporetech-digital/components 5.2.0 → 5.3.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 (263) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/{_commonjsHelpers-9f2314fc.js → _commonjsHelpers-29614748.js} +1 -17
  3. package/dist/cjs/_commonjsHelpers-29614748.js.map +1 -0
  4. package/dist/cjs/algoliasearch-lite.esm.browser-992a2eff.js +922 -0
  5. package/dist/cjs/algoliasearch-lite.esm.browser-992a2eff.js.map +1 -0
  6. package/dist/cjs/component-store-21cb4901.js +328 -0
  7. package/dist/cjs/component-store-21cb4901.js.map +1 -0
  8. package/dist/cjs/events-db0a42ee.js +39 -0
  9. package/dist/cjs/events-db0a42ee.js.map +1 -0
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/nano-alert.cjs.entry.js +9 -2
  12. package/dist/cjs/nano-alert.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nano-algolia-filter.cjs.entry.js +1 -2
  14. package/dist/cjs/nano-algolia-filter.cjs.entry.js.map +1 -1
  15. package/dist/cjs/nano-algolia-input.cjs.entry.js +8 -4
  16. package/dist/cjs/nano-algolia-input.cjs.entry.js.map +1 -1
  17. package/dist/cjs/nano-algolia.cjs.entry.js +4 -4
  18. package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
  19. package/dist/cjs/nano-components.cjs.js +1 -1
  20. package/dist/cjs/nano-datalist_3.cjs.entry.js +1 -1
  21. package/dist/cjs/nano-dialog.cjs.entry.js +23 -22
  22. package/dist/cjs/nano-dialog.cjs.entry.js.map +1 -1
  23. package/dist/cjs/nano-drawer.cjs.entry.js +169 -111
  24. package/dist/cjs/nano-drawer.cjs.entry.js.map +1 -1
  25. package/dist/cjs/nano-dropdown.cjs.entry.js +16 -2
  26. package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
  27. package/dist/cjs/nano-global-nav.cjs.entry.js +5 -6
  28. package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
  29. package/dist/cjs/nano-global-search-results.cjs.entry.js +2 -1
  30. package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
  31. package/dist/cjs/nano-slides.cjs.entry.js +1 -1
  32. package/dist/cjs/nano-sortable.cjs.entry.js +3 -15
  33. package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -1
  34. package/dist/cjs/nano-sticker.cjs.entry.js +16 -9
  35. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  36. package/dist/cjs/nano-tab-group.cjs.entry.js +1 -2
  37. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  38. package/dist/cjs/{nano-table-04993bb4.js → nano-table-e15cc6b0.js} +16 -15
  39. package/dist/cjs/nano-table-e15cc6b0.js.map +1 -0
  40. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  41. package/dist/cjs/{slot-a448c1a7.js → slot-2dd6ed1d.js} +20 -15
  42. package/dist/cjs/slot-2dd6ed1d.js.map +1 -0
  43. package/dist/cjs/{table.worker-85877b23.js → table.worker-8759e6ea.js} +2 -2
  44. package/dist/cjs/table.worker-8759e6ea.js.map +1 -0
  45. package/dist/collection/components/alert/alert.css +15 -0
  46. package/dist/collection/components/alert/alert.js +10 -2
  47. package/dist/collection/components/alert/alert.js.map +1 -1
  48. package/dist/collection/components/algolia/algolia-interface.js.map +1 -1
  49. package/dist/collection/components/algolia/algolia.js +1 -1
  50. package/dist/collection/components/algolia/algolia.js.map +1 -1
  51. package/dist/collection/components/dialog/dialog.css +1 -17
  52. package/dist/collection/components/dialog/dialog.js +31 -20
  53. package/dist/collection/components/dialog/dialog.js.map +1 -1
  54. package/dist/collection/components/drawer/drawer.css +136 -67
  55. package/dist/collection/components/drawer/drawer.js +282 -154
  56. package/dist/collection/components/drawer/drawer.js.map +1 -1
  57. package/dist/collection/components/dropdown/dropdown.css +10 -0
  58. package/dist/collection/components/dropdown/dropdown.js +15 -1
  59. package/dist/collection/components/dropdown/dropdown.js.map +1 -1
  60. package/dist/collection/components/global-nav/global-nav.js +2 -2
  61. package/dist/collection/components/global-nav/global-nav.js.map +1 -1
  62. package/dist/collection/components/global-nav/style/global-nav.css +5 -1
  63. package/dist/collection/components/global-search-results/global-search-results.js +2 -1
  64. package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
  65. package/dist/collection/components/sticker/sticker.js +16 -9
  66. package/dist/collection/components/sticker/sticker.js.map +1 -1
  67. package/dist/collection/components/table/table.js +10 -9
  68. package/dist/collection/components/table/table.js.map +1 -1
  69. package/dist/collection/components/table/table.pin-service.js +4 -4
  70. package/dist/collection/components/table/table.pin-service.js.map +1 -1
  71. package/dist/collection/utils/events.js +17 -0
  72. package/dist/collection/utils/events.js.map +1 -1
  73. package/dist/collection/utils/slot.js +19 -14
  74. package/dist/collection/utils/slot.js.map +1 -1
  75. package/dist/collection/utils/store/get-set.js +6 -12
  76. package/dist/collection/utils/store/get-set.js.map +1 -1
  77. package/dist/components/_commonjsHelpers.js +1 -16
  78. package/dist/components/_commonjsHelpers.js.map +1 -1
  79. package/dist/components/algolia.js +2 -2
  80. package/dist/components/algolia.js.map +1 -1
  81. package/dist/components/algoliasearch-lite.esm.browser.js +920 -0
  82. package/dist/components/algoliasearch-lite.esm.browser.js.map +1 -0
  83. package/dist/components/component-store.js +68 -2001
  84. package/dist/components/component-store.js.map +1 -1
  85. package/dist/components/dropdown.js +16 -2
  86. package/dist/components/dropdown.js.map +1 -1
  87. package/dist/components/events.js +36 -0
  88. package/dist/components/events.js.map +1 -0
  89. package/dist/components/nano-alert.js +10 -2
  90. package/dist/components/nano-alert.js.map +1 -1
  91. package/dist/components/nano-algolia-input.js +6 -1
  92. package/dist/components/nano-algolia-input.js.map +1 -1
  93. package/dist/components/nano-dialog.js +21 -20
  94. package/dist/components/nano-dialog.js.map +1 -1
  95. package/dist/components/nano-drawer.js +205 -122
  96. package/dist/components/nano-drawer.js.map +1 -1
  97. package/dist/components/nano-global-nav.js +4 -4
  98. package/dist/components/nano-global-nav.js.map +1 -1
  99. package/dist/components/nano-global-search-results.js +2 -1
  100. package/dist/components/nano-global-search-results.js.map +1 -1
  101. package/dist/components/nano-sortable.js +1 -13
  102. package/dist/components/nano-sortable.js.map +1 -1
  103. package/dist/components/slot.js +19 -14
  104. package/dist/components/slot.js.map +1 -1
  105. package/dist/components/sticker.js +16 -9
  106. package/dist/components/sticker.js.map +1 -1
  107. package/dist/components/table.js +14 -13
  108. package/dist/components/table.js.map +1 -1
  109. package/dist/esm/{_commonjsHelpers-e401b2a2.js → _commonjsHelpers-04a0e019.js} +2 -17
  110. package/dist/esm/_commonjsHelpers-04a0e019.js.map +1 -0
  111. package/dist/esm/algoliasearch-lite.esm.browser-04891fdc.js +920 -0
  112. package/dist/esm/algoliasearch-lite.esm.browser-04891fdc.js.map +1 -0
  113. package/dist/esm/component-store-65d7e36a.js +326 -0
  114. package/dist/esm/component-store-65d7e36a.js.map +1 -0
  115. package/dist/esm/events-6a805b42.js +36 -0
  116. package/dist/esm/events-6a805b42.js.map +1 -0
  117. package/dist/esm/loader.js +1 -1
  118. package/dist/esm/nano-alert.entry.js +9 -2
  119. package/dist/esm/nano-alert.entry.js.map +1 -1
  120. package/dist/esm/nano-algolia-filter.entry.js +1 -2
  121. package/dist/esm/nano-algolia-filter.entry.js.map +1 -1
  122. package/dist/esm/nano-algolia-input.entry.js +7 -3
  123. package/dist/esm/nano-algolia-input.entry.js.map +1 -1
  124. package/dist/esm/nano-algolia.entry.js +4 -4
  125. package/dist/esm/nano-algolia.entry.js.map +1 -1
  126. package/dist/esm/nano-components.js +1 -1
  127. package/dist/esm/nano-datalist_3.entry.js +1 -1
  128. package/dist/esm/nano-dialog.entry.js +23 -22
  129. package/dist/esm/nano-dialog.entry.js.map +1 -1
  130. package/dist/esm/nano-drawer.entry.js +171 -113
  131. package/dist/esm/nano-drawer.entry.js.map +1 -1
  132. package/dist/esm/nano-dropdown.entry.js +16 -2
  133. package/dist/esm/nano-dropdown.entry.js.map +1 -1
  134. package/dist/esm/nano-global-nav.entry.js +5 -6
  135. package/dist/esm/nano-global-nav.entry.js.map +1 -1
  136. package/dist/esm/nano-global-search-results.entry.js +2 -1
  137. package/dist/esm/nano-global-search-results.entry.js.map +1 -1
  138. package/dist/esm/nano-slides.entry.js +1 -1
  139. package/dist/esm/nano-sortable.entry.js +1 -13
  140. package/dist/esm/nano-sortable.entry.js.map +1 -1
  141. package/dist/esm/nano-sticker.entry.js +16 -9
  142. package/dist/esm/nano-sticker.entry.js.map +1 -1
  143. package/dist/esm/nano-tab-group.entry.js +1 -2
  144. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  145. package/dist/esm/{nano-table-91f09583.js → nano-table-5c5bd3f2.js} +16 -15
  146. package/dist/esm/nano-table-5c5bd3f2.js.map +1 -0
  147. package/dist/esm/nano-table.entry.js +1 -1
  148. package/dist/esm/{slot-a4f6e2af.js → slot-8126e238.js} +20 -15
  149. package/dist/esm/slot-8126e238.js.map +1 -0
  150. package/dist/esm/{table.worker-625475ba.js → table.worker-e7f4f50c.js} +2 -2
  151. package/dist/esm/table.worker-e7f4f50c.js.map +1 -0
  152. package/dist/nano-components/nano-components.css +1 -1
  153. package/dist/nano-components/nano-components.esm.js +1 -1
  154. package/dist/nano-components/nano-components.esm.js.map +1 -1
  155. package/dist/nano-components/p-0301e8f7.entry.js +5 -0
  156. package/dist/nano-components/p-0301e8f7.entry.js.map +1 -0
  157. package/dist/nano-components/p-27422aa9.entry.js +5 -0
  158. package/dist/nano-components/{p-6920ad69.entry.js.map → p-27422aa9.entry.js.map} +1 -1
  159. package/dist/nano-components/p-2d79f5b3.js +5 -0
  160. package/dist/nano-components/{p-0697795a.entry.js → p-31c23d6e.entry.js} +2 -2
  161. package/dist/nano-components/p-31c23d6e.entry.js.map +1 -0
  162. package/dist/nano-components/p-487de04d.entry.js.map +1 -1
  163. package/dist/nano-components/p-570d2e50.entry.js +5 -0
  164. package/dist/nano-components/p-570d2e50.entry.js.map +1 -0
  165. package/dist/nano-components/{p-3eb6d833.entry.js → p-5a4b3fa9.entry.js} +2 -2
  166. package/dist/nano-components/p-653ae985.js +5 -0
  167. package/dist/nano-components/p-653ae985.js.map +1 -0
  168. package/dist/nano-components/p-676a4744.entry.js +5 -0
  169. package/dist/nano-components/{p-d0eefd52.entry.js.map → p-676a4744.entry.js.map} +1 -1
  170. package/dist/nano-components/p-8fe51abf.js +5 -0
  171. package/dist/nano-components/{p-4884b65a.entry.js → p-90cd4f56.entry.js} +2 -2
  172. package/dist/nano-components/p-90cd4f56.entry.js.map +1 -0
  173. package/dist/nano-components/p-9ba81ed2.js +5 -0
  174. package/dist/nano-components/p-9ba81ed2.js.map +1 -0
  175. package/dist/nano-components/p-9bfdee71.js +5 -0
  176. package/dist/nano-components/p-9bfdee71.js.map +1 -0
  177. package/dist/nano-components/p-a8d6ca38.entry.js +5 -0
  178. package/dist/nano-components/p-a8d6ca38.entry.js.map +1 -0
  179. package/dist/nano-components/p-ace7743c.entry.js +5 -0
  180. package/dist/nano-components/p-ace7743c.entry.js.map +1 -0
  181. package/dist/nano-components/{p-17ee0c07.entry.js → p-bab2888b.entry.js} +2 -2
  182. package/dist/nano-components/p-bdb5b6fc.entry.js +5 -0
  183. package/dist/nano-components/p-bdb5b6fc.entry.js.map +1 -0
  184. package/dist/nano-components/p-cad86fb8.js +5 -0
  185. package/dist/nano-components/p-cad86fb8.js.map +1 -0
  186. package/dist/nano-components/p-dc565459.js +5 -0
  187. package/dist/nano-components/p-dc565459.js.map +1 -0
  188. package/dist/nano-components/p-ede12d35.entry.js +5 -0
  189. package/dist/nano-components/p-ede12d35.entry.js.map +1 -0
  190. package/dist/nano-components/p-f504b1df.entry.js +7 -0
  191. package/dist/nano-components/p-f504b1df.entry.js.map +1 -0
  192. package/dist/nano-components/{p-db370094.entry.js → p-f7a4c62b.entry.js} +2 -2
  193. package/dist/themes/london-calling.css.map +1 -1
  194. package/dist/themes/nanopore.cn.css.map +1 -1
  195. package/dist/themes/nanopore.css.map +1 -1
  196. package/dist/types/components/alert/alert.d.ts +1 -0
  197. package/dist/types/components/algolia/algolia-interface.d.ts +1 -1
  198. package/dist/types/components/algolia/algolia.d.ts +1 -1
  199. package/dist/types/components/dialog/dialog.d.ts +15 -4
  200. package/dist/types/components/drawer/drawer.d.ts +69 -50
  201. package/dist/types/components/sticker/sticker.d.ts +4 -4
  202. package/dist/types/components/table/table.d.ts +0 -1
  203. package/dist/types/components.d.ts +50 -28
  204. package/dist/types/types/algolia.d.ts +4 -0
  205. package/dist/types/types/scss.vars.d.ts +4 -0
  206. package/dist/types/utils/events.d.ts +7 -0
  207. package/dist/types/utils/slot.d.ts +3 -3
  208. package/docs-json.json +268 -61
  209. package/docs-vscode.json +28 -11
  210. package/hydrate/index.js +1345 -2245
  211. package/package.json +4 -4
  212. package/dist/cjs/_commonjsHelpers-9f2314fc.js.map +0 -1
  213. package/dist/cjs/algoliasearch.umd-689c1560.js +0 -15
  214. package/dist/cjs/algoliasearch.umd-689c1560.js.map +0 -1
  215. package/dist/cjs/component-store-f1dc1276.js +0 -2261
  216. package/dist/cjs/component-store-f1dc1276.js.map +0 -1
  217. package/dist/cjs/nano-table-04993bb4.js.map +0 -1
  218. package/dist/cjs/slot-a448c1a7.js.map +0 -1
  219. package/dist/cjs/table.worker-85877b23.js.map +0 -1
  220. package/dist/components/algoliasearch.umd.js +0 -13
  221. package/dist/components/algoliasearch.umd.js.map +0 -1
  222. package/dist/esm/_commonjsHelpers-e401b2a2.js.map +0 -1
  223. package/dist/esm/algoliasearch.umd-4f7efa84.js +0 -13
  224. package/dist/esm/algoliasearch.umd-4f7efa84.js.map +0 -1
  225. package/dist/esm/component-store-c23ebc9c.js +0 -2259
  226. package/dist/esm/component-store-c23ebc9c.js.map +0 -1
  227. package/dist/esm/nano-table-91f09583.js.map +0 -1
  228. package/dist/esm/slot-a4f6e2af.js.map +0 -1
  229. package/dist/esm/table.worker-625475ba.js.map +0 -1
  230. package/dist/nano-components/p-0697795a.entry.js.map +0 -1
  231. package/dist/nano-components/p-17b099cc.entry.js +0 -5
  232. package/dist/nano-components/p-17b099cc.entry.js.map +0 -1
  233. package/dist/nano-components/p-1a0b5bc3.js +0 -5
  234. package/dist/nano-components/p-1a0b5bc3.js.map +0 -1
  235. package/dist/nano-components/p-3de3449e.js +0 -5
  236. package/dist/nano-components/p-3de3449e.js.map +0 -1
  237. package/dist/nano-components/p-4884b65a.entry.js.map +0 -1
  238. package/dist/nano-components/p-58cf5446.js +0 -5
  239. package/dist/nano-components/p-58cf5446.js.map +0 -1
  240. package/dist/nano-components/p-6920ad69.entry.js +0 -5
  241. package/dist/nano-components/p-69a3e911.js +0 -5
  242. package/dist/nano-components/p-7baa9e14.entry.js +0 -5
  243. package/dist/nano-components/p-7baa9e14.entry.js.map +0 -1
  244. package/dist/nano-components/p-a362bd23.entry.js +0 -5
  245. package/dist/nano-components/p-a362bd23.entry.js.map +0 -1
  246. package/dist/nano-components/p-b04fd7ca.entry.js +0 -5
  247. package/dist/nano-components/p-b04fd7ca.entry.js.map +0 -1
  248. package/dist/nano-components/p-b72df1aa.entry.js +0 -5
  249. package/dist/nano-components/p-b72df1aa.entry.js.map +0 -1
  250. package/dist/nano-components/p-ce5efc3f.entry.js +0 -5
  251. package/dist/nano-components/p-ce5efc3f.entry.js.map +0 -1
  252. package/dist/nano-components/p-d0eefd52.entry.js +0 -5
  253. package/dist/nano-components/p-dfbf0d56.js +0 -5
  254. package/dist/nano-components/p-e2b2b015.entry.js +0 -5
  255. package/dist/nano-components/p-e2b2b015.entry.js.map +0 -1
  256. package/dist/nano-components/p-ed6adde2.js +0 -7
  257. package/dist/nano-components/p-ed6adde2.js.map +0 -1
  258. package/dist/types/dom.ie.d.ts +0 -3
  259. /package/dist/nano-components/{p-17ee0c07.entry.js.map → p-2d79f5b3.js.map} +0 -0
  260. /package/dist/nano-components/{p-3eb6d833.entry.js.map → p-5a4b3fa9.entry.js.map} +0 -0
  261. /package/dist/nano-components/{p-69a3e911.js.map → p-8fe51abf.js.map} +0 -0
  262. /package/dist/nano-components/{p-dfbf0d56.js.map → p-bab2888b.entry.js.map} +0 -0
  263. /package/dist/nano-components/{p-db370094.entry.js.map → p-f7a4c62b.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{p as e,H as a,b as o}from"./p-f6a8467a.js";export{s as setNonce}from"./p-f6a8467a.js";import"./p-d4f6ec9f.js";const n=()=>{{t(a.prototype)}const o=import.meta.url;const n={};if(o!==""){n.resourcesUrl=new URL(".",o).href}return e(n)};const t=e=>{const a=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return a.call(this,e)}const o=a.call(this,false);const n=this.childNodes;if(e){for(let e=0;e<n.length;e++){if(n[e].nodeType!==2){o.appendChild(n[e].cloneNode(true))}}}return o}};n().then((e=>o(JSON.parse('[["p-a362bd23",[[1,"nano-global-nav",{"env":[1],"ssoDataUrl":[1,"sso-data-url"],"myAccountData":[16],"ssoRedirect":[1,"sso-redirect"],"getMyAccountData":[4,"get-my-account-data"],"activeMyAccountSections":[16],"showSearch":[4,"show-search"],"showLogo":[4,"show-logo"],"logoUrl":[1,"logo-url"],"searchIndeces":[16],"myAccountUser":[1040],"searchAppId":[1025,"search-app-id"],"searchApiKey":[1025,"search-api-key"],"searchValue":[1025,"search-value"],"searchIndex":[1025,"search-index"],"cartCount":[1026,"cart-count"],"msgCount":[1026,"msg-count"],"cartUrl":[1025,"cart-url"],"msgUrl":[1025,"msg-url"],"userProfileUrl":[32],"hasLoggedinSlot":[32],"hasSiteSlot":[32],"hasPromotionSlot":[32],"aboutSlotLen":[32],"iconSlotLen":[32],"mainSlotLen":[32],"overflowSlotLen":[32],"searchSlotLen":[32],"thresholdReady":[32],"remoteDataReady":[32],"ready":[32],"isResizing":[32],"intersectRatio":[32],"threshold":[32],"modalOpen":[32],"modalIsOpen":[32],"searchBarShown":[32],"scrollingUp":[32],"showAutocomplete":[32],"secondaryMenuOpen":[32],"userMenuOpen":[32],"menuFullScreen":[32],"searchLoading":[32],"searchValInternal":[32],"internalSearchIndeces":[32],"submitSearch":[64],"toggleOverflowMenu":[64]},[[0,"nanoOpen","secondaryOpen"],[0,"nanoClose","secondaryClose"],[16,"click","menuClose"]]]]],["p-b38cabe2",[[1,"nano-demo"]]],["p-fecb72b9",[[6,"nano-date-input",{"invalid":[2564],"validityMessage":[2049,"validity-message"],"helperText":[4,"helper-text"],"helperTextFormat":[16],"floatLabel":[4,"float-label"],"name":[1],"readonly":[4],"size":[2],"form":[1],"firstDayOfWeek":[2,"first-day-of-week"],"localization":[16],"disabled":[4],"color":[1],"autofocus":[4],"clearInput":[4,"clear-input"],"label":[1],"placeholder":[1025],"value":[1537],"validateOn":[1,"validate-on"],"showInlineError":[516,"show-inline-error"],"dateOrder":[1,"date-order"],"required":[4],"min":[1],"max":[1],"hideLabel":[4,"hide-label"],"picker":[4],"initialPickerDate":[1,"initial-picker-date"],"pickerOpen":[1540,"picker-open"],"closeAfterPicked":[4,"close-after-picked"],"dropDownConfig":[6160],"dateValue":[2064],"isDateDisabled":[16],"pattern":[32],"inputValue":[32],"_invalid":[32],"reportValidity":[64],"setFocus":[64],"getInputElement":[64],"showError":[64]}]]],["p-b72df1aa",[[1,"nano-dialog",{"showRibbon":[4,"show-ribbon"],"open":[1540],"label":[1],"noHeader":[4,"no-header"],"noFooter":[4,"no-footer"],"noUserDismiss":[4,"no-user-dismiss"],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"hoist":[4],"isVisible":[32],"noDismiss":[32],"hasFooter":[32],"show":[64],"hide":[64]}]]],["p-ad6209ec",[[1,"nano-hero",{"imgSrc":[1,"img-src"],"imgSrcSet":[1,"img-src-set"],"largeScreenBP":[2,"large-screen-b-p"],"theme":[1],"level":[1],"hasIconBox":[32],"hasScrim":[32],"hasSecondaryContent":[32],"hasQuote":[32],"hasBg":[32],"hasBackBtn":[32],"hasCtas":[32],"breadCrumbs":[32],"iconBoxItems":[32]}]]],["p-e2b2b015",[[1,"nano-alert",{"open":[1540],"closable":[516],"color":[513],"duration":[2],"hoist":[4],"isModal":[32],"isToast":[32],"isShowing":[32],"label":[32],"show":[64],"hide":[64],"toast":[64],"alert":[64]}]]],["p-7ed03b91",[[6,"nano-file-upload",{"name":[1],"accept":[1],"capture":[1],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"label":[1],"placeholder":[1],"hideLabel":[4,"hide-label"],"required":[4],"disabled":[516],"clearInput":[4,"clear-input"],"showInlineError":[516,"show-inline-error"],"validateOn":[1025,"validate-on"],"form":[1],"invalid":[2564],"validityMessage":[2049,"validity-message"],"files":[6160],"value":[6145],"hasHelperSlot":[32],"hasLabelSlot":[32],"errorMessage":[32],"isDragging":[32],"fileList":[32],"hasFocus":[32],"_invalid":[32],"reportValidity":[64],"setFocus":[64],"getInputElement":[64],"showError":[64]},[[8,"click","globalClickHandler"],[8,"keydown","globalKeydownHandler"],[16,"reset","onReset"]]]]],["p-1b791810",[[1,"nano-overflow-nav",{"scrollControls":[4,"scroll-controls"],"orientation":[513],"activeHandler":[16],"inActiveHandler":[16],"isActiveHandler":[16],"instantReCalc":[32],"hasScrollControls":[32],"hideControlEnd":[32],"hideControlStart":[32],"syncActiveItem":[64]}]]],["p-b8e76fdf",[[1,"nano-tab",{"panel":[513],"active":[516],"disabled":[516],"closable":[4],"setFocus":[64],"removeFocus":[64]}]]],["p-487de04d",[[1,"nano-global-search-results",{"algoliaEle":[32],"currentWidth":[32],"apiKey":[32],"appId":[32],"index":[32]},[[16,"nanoSearchReset","handleGlobalNavReset"],[16,"nanoSearchResult","handleGlobalNavSearch"],[0,"nanoChange","handleReorder"],[0,"nanoResultsShown","attachListeners"],[16,"nanoNewResults","attachResultListeners"]]]]],["p-5d466a58",[[1,"nano-menu-drawer",{"open":[1028],"saveState":[4,"save-state"],"hideWidth":[2,"hide-width"],"hideHeight":[4,"hide-height"],"reset":[32],"widthOk":[32],"heightOk":[32],"isLoading":[32],"hide":[32]},[[0,"nanoOpen","cancelNavItemEvents"],[0,"nanoClose","cancelNavItemEvents"],[16,"nanoIsReady","handleGlobalNavReady"]]]]],["p-898cbac7",[[1,"nano-split-pane",{"position":[6146],"positionInPixels":[1026,"position-in-pixels"],"vertical":[516],"disabled":[516],"primary":[1],"snap":[1],"snapThreshold":[2,"snap-threshold"],"animationDuration":[2,"animation-duration"],"getPercentageToPixels":[64],"getPixelsToPercentage":[64]}]]],["p-d0eefd52",[[1,"nano-tab-group",{"placement":[513],"noScrollControls":[4,"no-scroll-controls"],"color":[1],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"disableSwipe":[4,"disable-swipe"],"hasScrollControls":[32],"hideControlRight":[32],"hideControlLeft":[32],"tab":[32],"show":[64]},[[0,"nanoTabClose","handleTabClose"]]]]],["p-207a1fbc",[[1,"nano-accordion",{"color":[1],"itemOpened":[32]},[[0,"nanoOpened","onToggleHandler"],[0,"nanoClosed","onClosedHandler"]]]]],["p-6920ad69",[[1,"nano-algolia-filter",{"filterName":[1,"filter-name"],"value":[1025],"operator":[1],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"changeEvent":[32],"internalValue":[32],"showFilter":[32],"indexResults":[32],"filterChanged":[32],"facets":[32],"tplRenderFn":[32],"globalStoreMethod":[32]},[[0,"nanoChange","handleChangeEvent"],[0,"change","handleChangeEvent"]]]]],["p-7baa9e14",[[1,"nano-algolia-input",{"appId":[1,"app-id"],"apiKey":[1,"api-key"],"searchIndex":[1040],"searchIndexName":[1,"search-index-name"],"minChars":[2,"min-chars"],"autoEmit":[4,"auto-emit"],"browseIndex":[1028,"browse-index"],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"searchStr":[32],"algoliaIndex":[32],"currentResults":[32],"search":[64]},[[0,"nanoChange","searchSubmit"]]]]],["p-93cfbdb6",[[1,"nano-algolia-pagination",{"maxToShow":[2,"max-to-show"],"currentPage":[32],"canGoPrev":[32],"canGoNext":[32],"show":[32],"tplRenderFn":[32],"indexResults":[32],"infiniteScroll":[32],"nextPage":[64],"prevPage":[64],"goToPage":[64]}]]],["p-288dbe6b",[[1,"nano-algolia-results",{"infiniteScroll":[4,"infinite-scroll"],"appendPages":[4,"append-pages"],"showResults":[32],"tplRenderFn":[32],"results":[32],"indexResults":[32],"resultsPage":[32],"changeEvent":[32],"facets":[32],"isLoading":[32]}]]],["p-fe7a0158",[[1,"nano-aspect-ratio",{"aspectRatio":[1,"aspect-ratio"],"fit":[1]}]]],["p-20383b2e",[[6,"nano-checkbox",{"hasFocus":[1540,"has-focus"],"checked":[1540],"disabled":[516],"value":[513],"name":[513],"required":[516],"type":[513],"label":[1],"indeterminate":[1540],"invalid":[2564],"validityMessage":[2049,"validity-message"],"color":[1],"form":[1],"inputType":[32],"_invalid":[32],"getInputElement":[64],"reportValidity":[64],"setError":[64],"setFocus":[64],"removeFocus":[64]},[[16,"reset","onReset"]]]]],["p-d74e2642",[[6,"nano-checkbox-group",{"validateOn":[1025,"validate-on"],"showInlineError":[4,"show-inline-error"],"min":[2],"max":[2],"disabled":[516],"legend":[1],"invalid":[2564],"validityMessage":[2049,"validity-message"],"value":[1025],"checkboxes":[32],"nativeCbs":[32],"errorMessage":[32],"showErrorMsg":[32],"hasHelperSlot":[32],"_invalid":[32],"reportValidity":[64],"showError":[64]},[[0,"nanoChange","handleValueChange"],[0,"nanoChange","handleCbChange"]]]]],["p-76a650b1",[[1,"nano-details",{"label":[1],"open":[1540],"noHandle":[4,"no-handle"],"iconRotation":[2,"icon-rotation"],"color":[1],"isLoading":[32]}]]],["p-b04fd7ca",[[1,"nano-drawer",{"open":[1540],"label":[1],"placement":[1],"contained":[4],"noHeader":[4,"no-header"],"type":[1],"contentSelector":[1,"content-selector"],"hasFooter":[32],"isVisible":[32],"show":[64],"hide":[64]}]]],["p-3dd8ae89",[[4,"nano-field-validator",{"validateOn":[1025,"validate-on"],"scrollToInvalid":[4,"scroll-to-invalid"],"dirty":[2564],"valid":[2564],"store":[2064],"payload":[2064],"showValidation":[2052,"show-validation"],"validationState":[2064],"extraFieldSelector":[1,"extra-field-selector"],"validation":[16],"submitted":[32],"userForm":[32],"_dirty":[32],"_valid":[32],"_store":[32],"setStore":[64],"setCustomValidity":[64],"resetValidity":[64],"scrollToFirstInvalid":[64]},[[0,"nanoChange","handleFieldChange"],[0,"input","handlePlainFieldChange"],[0,"change","handlePlainFieldChange"],[0,"submit","handleSubmit"]]]]],["p-bdef618c",[[1,"nano-grid-item"]]],["p-192902e0",[[6,"nano-range",{"color":[1],"debounce":[2],"name":[1],"dualKnobs":[4,"dual-knobs"],"min":[2],"max":[2],"pin":[4],"snaps":[4],"step":[2],"ticks":[4],"disabled":[4],"value":[1026],"ratioA":[32],"ratioB":[32],"pressedKnob":[32]}]]],["p-57085052",[[2,"nano-rating",{"value":[1538],"max":[2],"precision":[2],"readonly":[4],"disabled":[4],"name":[1],"symbolName":[1,"symbol-name"],"symbol":[16],"hoverValue":[32],"isHovering":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-cd2f5e97",[[1,"nano-slide",{"ready":[1540]}]]],["p-db370094",[[1,"nano-slides",{"options":[1040],"navbtns":[4],"pager":[4],"fullscreenbtn":[4],"fullscreen":[1540],"animation":[513],"currentSlide":[1538,"current-slide"],"autoplay":[8],"ready":[1540],"iCurrentSlide":[32],"slidesReady":[32],"didInit":[32],"update":[64],"updateAutoHeight":[64],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"getActiveIndex":[64],"length":[64],"isEnd":[64],"isBeginning":[64],"startAutoplay":[64],"stopAutoplay":[64],"lockSwipes":[64],"getflickity":[64],"reload":[64]}]]],["p-ce5efc3f",[[1,"nano-sortable",{"itemSelector":[1,"item-selector"],"handleSelector":[1,"handle-selector"],"dropzoneSelector":[1,"dropzone-selector"],"helperText":[1,"helper-text"],"itemDescriptor":[16],"grabbedHelperText":[16],"droppedHelperText":[16],"reorderHelperText":[16],"createKeyboardHandle":[16],"sortableHostElement":[16],"animationEnabled":[4,"animation-enabled"],"draggedClass":[1,"dragged-class"],"handleDraggedClass":[1,"handle-dragged-class"],"placeholderClass":[1,"placeholder-class"],"dropzoneActiveClass":[1,"dropzone-active-class"],"animationTiming":[8,"animation-timing"],"orientation":[1],"dragResize":[4,"drag-resize"],"keyboardSortActive":[32],"ariaTextList":[32],"refreshKeyboardHandles":[64]}]]],["p-cba50c3e",[[1,"nano-tab-content",{"name":[513],"active":[516],"ready":[32]}]]],["p-68928c59",[[1,"nano-spinner",{"type":[1],"overlay":[516],"hasText":[32]}]]],["p-17ee0c07",[[4,"nano-table",{"customRenderer":[16],"type":[1],"caption":[1],"showCaption":[4,"show-caption"],"loading":[4],"placeholderSize":[2,"placeholder-size"],"rows":[1040],"columns":[1040],"headRender":[16],"rowRender":[16],"footRender":[16],"showFooter":[4,"show-footer"],"perBlock":[2,"per-block"],"blocksLength":[2050,"blocks-length"],"searchTerm":[1,"search-term"],"customFilterFn":[16],"customSortFn":[16],"defaultSort":[4,"default-sort"],"virtualTotalItems":[2,"virtual-total-items"],"appliedFilters":[2064],"internalLoading":[32],"blocks":[32],"activeBlocks":[32],"resetSorting":[64],"addSort":[64],"resetFilters":[64],"addFilters":[64],"removeFilters":[64],"updateRow":[64]}]]],["p-4884b65a",[[1,"nano-algolia",{"showResults":[1028,"show-results"],"resultsPage":[1026,"results-page"],"appId":[1025,"app-id"],"apiKey":[1025,"api-key"],"searchIndex":[1040],"searchIndexName":[1025,"search-index-name"],"listenTo":[1,"listen-to"],"query":[1025],"operator":[1],"filters":[16],"tplEngine":[16],"tplRenderFn":[16],"replicaIndex":[1025,"replica-index"],"browseIndex":[1028,"browse-index"],"minChars":[2,"min-chars"],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"_dynFacetFilters":[32],"inputField":[32],"algoliaIndex":[32],"indeces":[32],"resultsEmitterEle":[32],"indexResults":[32],"filterChanged":[32],"currentHits":[32],"changeEvent":[32],"isLoading":[32],"wormholeState":[32],"removeFilters":[64]},[[0,"nanoTplUpdated","onAllTplUpdate"],[0,"nanoPageChanged","onPageChange"],[0,"nanoFilterChanged","onFilterChange"],[16,"nanoChange","handleInputChange"],[16,"change","handleInputChange"]]]]],["p-5984ae16",[[1,"nano-date-picker",{"selectedDate":[1025,"selected-date"],"min":[1],"max":[1],"firstDayOfWeek":[2,"first-day-of-week"],"localization":[16],"color":[1],"isDateDisabled":[16],"isModal":[4,"is-modal"],"firstFocusEle":[16],"activeFocus":[32],"focusedDay":[32],"setFocus":[64]}]]],["p-9b5429e1",[[1,"nano-img",{"alt":[1],"src":[1],"srcSet":[1,"src-set"],"lazy":[4],"background":[4],"autoHeight":[1,"auto-height"],"loadSrc":[32],"loadError":[32],"hasLoaded":[32],"imgStates":[32],"_src":[32]}],[1,"nano-grid",{"sSize":[8,"s-size"],"mSize":[8,"m-size"],"lSize":[8,"l-size"],"xlSize":[8,"xl-size"],"sCols":[2,"s-cols"],"mCols":[2,"m-cols"],"lCols":[2,"l-cols"],"xlCols":[2,"xl-cols"],"xxlCols":[2,"xxl-cols"],"sTpl":[1,"s-tpl"],"mTpl":[1,"m-tpl"],"lTpl":[1,"l-tpl"],"xlTpl":[1,"xl-tpl"],"xxlTpl":[1,"xxl-tpl"],"showHelper":[516,"show-helper"],"cacheKey":[32]}]]],["p-565793a2",[[6,"nano-input",{"invalid":[2564],"validityMessage":[2049,"validity-message"],"color":[1],"accept":[1],"autocapitalise":[1],"autocomplete":[1],"autocorrect":[1],"autofocus":[4],"clearInput":[4,"clear-input"],"clearOnEdit":[4,"clear-on-edit"],"debounce":[2],"disabled":[516],"inputmode":[1],"validateOn":[1025,"validate-on"],"showInlineError":[516,"show-inline-error"],"label":[1],"hideLabel":[4,"hide-label"],"floatLabel":[4,"float-label"],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[516],"required":[4],"spellcheck":[4],"step":[1],"size":[2],"type":[513],"form":[1],"value":[1025],"resize":[1],"rows":[2],"showCharCount":[4,"show-char-count"],"hasFocus":[32],"hasLabelSlot":[32],"hasHelperSlot":[32],"hasHelperEndSlot":[32],"errorMessage":[32],"datalist":[32],"_invalid":[32],"reportValidity":[64],"setFocus":[64],"select":[64],"getInputElement":[64],"showError":[64]},[[16,"reset","onReset"],[17,"mousedown","handleBlur"],[0,"keydown","handleBlur"]]]]],["p-20038e9c",[[1,"nano-progress-bar",{"value":[2],"indeterminate":[4],"showPercent":[4,"show-percent"]}]]],["p-0697795a",[[1,"nano-sticker",{"autoResize":[4,"auto-resize"],"isSticky":[1028,"is-sticky"],"offset":[1026],"position":[1],"quietMode":[1,"quiet-mode"],"hideOnNewStickers":[4,"hide-on-new-stickers"],"breakPointMax":[2,"break-point-max"],"breakPointMin":[2,"break-point-min"],"scrollParent":[1040],"stickTo":[1,"stick-to"],"isStuck":[32],"isRootSticker":[32],"hide":[32],"scrollHide":[32],"multiStickerHide":[32],"scrollingTo":[32],"quietModeIsOn":[32],"stuckCounter":[32],"stickerIndex":[32],"stickToEle":[32],"triggerPos":[32],"trigger":[32],"_offset":[32],"isHiding":[64],"isSticking":[64],"setTriggerPos":[64],"getTriggerPos":[64],"pauseHiding":[64]}]]],["p-17b099cc",[[1,"nano-dropdown",{"autoOpen":[4,"auto-open"],"open":[1540],"closeOnSelect":[4,"close-on-select"],"containingElement":[1040],"tetherTo":[16],"placement":[1],"distance":[2],"skidding":[2],"hoist":[4],"dialogTitle":[1,"dialog-title"],"eventType":[16],"show":[64],"hide":[64]},[[0,"nanoOpen","secondaryOpen"],[0,"nanoClose","secondaryClose"],[0,"nanoSelect","handlePanelSelect"]]]]],["p-3eb6d833",[[1,"nano-datalist",{"selected":[1040],"dropDownConfig":[6160],"options":[16],"input":[1],"type":[1],"activeOptions":[2064],"open":[1028],"disableFilter":[4,"disable-filter"],"disabled":[4],"actvOptEles":[32],"connectedInput":[32],"inputLabel":[32],"hasNoResult":[32],"shouldOpen":[32],"canOpen":[32],"optionIds":[32]}],[1,"nano-option",{"value":[1537],"label":[1537],"selected":[516],"disabled":[516],"filterMeta":[1,"filter-meta"],"hasFocus":[32]},[[0,"keydown","handleKeyDown"]]],[1,"nano-menu",{"hasFocus":[2052,"has-focus"],"type":[1],"label":[1],"setFocus":[64],"removeFocus":[64],"showActiveElement":[64],"resetActiveItem":[64]},[[17,"mousedown","handleBlur"],[0,"keydown","handleBlur"]]]]],["p-bf18e298",[[6,"nano-select",{"invalid":[2564],"validityMessage":[2049,"validity-message"],"color":[1],"autofocus":[4],"disabled":[516],"validateOn":[1025,"validate-on"],"showInlineError":[516,"show-inline-error"],"label":[1],"hideLabel":[4,"hide-label"],"floatLabel":[4,"float-label"],"multiple":[4],"name":[1],"placeholder":[1],"readonly":[516],"required":[4],"size":[2],"max":[2],"min":[2],"form":[1],"allowCustomValues":[4,"allow-custom-values"],"value":[6145],"options":[6160],"clearSelect":[4,"clear-select"],"mask":[4],"debounce":[2],"dropDownConfig":[1040],"currInsertIndex":[32],"showErrorMsg":[32],"errorMessage":[32],"hasFocus":[32],"hasLabelSlot":[32],"hasHelperSlot":[32],"hasHelperEndSlot":[32],"inputSearchVal":[32],"_invalid":[32],"_eOptions":[32],"reportValidity":[64],"setFocus":[64],"getSelectElement":[64],"showError":[64]},[[16,"reset","onReset"],[17,"mousedown","handleBlur"],[0,"keydown","handleBlur"]]],[0,"nano-global-nav-user-profile",{"myAccountUser":[16],"userProfileUrl":[1,"user-profile-url"]}],[1,"nano-nav-item",{"href":[1025],"target":[1],"disabled":[4],"open":[1540],"selected":[516],"secondaryActiveWidth":[2,"secondary-active-width"],"secondaryFallback":[16],"closeOnBlur":[4,"close-on-blur"],"notification":[4],"hasAnchorEle":[32],"didOpen":[32],"isInGlobalNav":[32],"isInMenuDrawer":[32],"isInMenu":[32],"hasFocus":[32],"setFocus":[64]},[[16,"click","handleClose"],[16,"keyup","handleClose"]]]]],["p-5aae2588",[[1,"nano-resize-observe",{"notifyContentFit":[1,"notify-content-fit"],"states":[1],"currentWidth":[32],"currentHeight":[32],"classNames":[32],"contentFitX":[32],"contentFitY":[32]}],[1,"nano-skeleton",{"animated":[4]}]]],["p-173cc842",[[1,"nano-icon",{"color":[1],"ariaLabel":[1537,"aria-label"],"flipRtl":[4,"flip-rtl"],"name":[1],"src":[1],"icon":[8],"size":[1],"lazy":[4],"svgContent":[32],"isVisible":[32],"isLoading":[32]}]]],["p-ebb98a9e",[[1,"nano-icon-button",{"iconName":[1,"icon-name"],"iconSrc":[1,"icon-src"],"type":[513],"name":[513],"value":[513],"label":[1],"showTooltip":[4,"show-tooltip"],"disabled":[516],"href":[1],"rel":[1],"target":[1],"form":[1],"setFocus":[64]}],[1,"nano-tooltip",{"content":[1],"placement":[1],"disabled":[4],"distance":[2],"open":[1540],"skidding":[2],"hoist":[4],"trigger":[1],"show":[64],"hide":[64]}]]]]'),e)));
4
+ import{p as e,H as a,b as o}from"./p-f6a8467a.js";export{s as setNonce}from"./p-f6a8467a.js";import"./p-d4f6ec9f.js";const n=()=>{{t(a.prototype)}const o=import.meta.url;const n={};if(o!==""){n.resourcesUrl=new URL(".",o).href}return e(n)};const t=e=>{const a=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return a.call(this,e)}const o=a.call(this,false);const n=this.childNodes;if(e){for(let e=0;e<n.length;e++){if(n[e].nodeType!==2){o.appendChild(n[e].cloneNode(true))}}}return o}};n().then((e=>o(JSON.parse('[["p-a8d6ca38",[[1,"nano-global-nav",{"env":[1],"ssoDataUrl":[1,"sso-data-url"],"myAccountData":[16],"ssoRedirect":[1,"sso-redirect"],"getMyAccountData":[4,"get-my-account-data"],"activeMyAccountSections":[16],"showSearch":[4,"show-search"],"showLogo":[4,"show-logo"],"logoUrl":[1,"logo-url"],"searchIndeces":[16],"myAccountUser":[1040],"searchAppId":[1025,"search-app-id"],"searchApiKey":[1025,"search-api-key"],"searchValue":[1025,"search-value"],"searchIndex":[1025,"search-index"],"cartCount":[1026,"cart-count"],"msgCount":[1026,"msg-count"],"cartUrl":[1025,"cart-url"],"msgUrl":[1025,"msg-url"],"userProfileUrl":[32],"hasLoggedinSlot":[32],"hasSiteSlot":[32],"hasPromotionSlot":[32],"aboutSlotLen":[32],"iconSlotLen":[32],"mainSlotLen":[32],"overflowSlotLen":[32],"searchSlotLen":[32],"thresholdReady":[32],"remoteDataReady":[32],"ready":[32],"isResizing":[32],"intersectRatio":[32],"threshold":[32],"modalOpen":[32],"modalIsOpen":[32],"searchBarShown":[32],"scrollingUp":[32],"showAutocomplete":[32],"secondaryMenuOpen":[32],"userMenuOpen":[32],"menuFullScreen":[32],"searchLoading":[32],"searchValInternal":[32],"internalSearchIndeces":[32],"submitSearch":[64],"toggleOverflowMenu":[64]},[[0,"nanoOpen","secondaryOpen"],[0,"nanoClose","secondaryClose"],[16,"click","menuClose"]]]]],["p-b38cabe2",[[1,"nano-demo"]]],["p-fecb72b9",[[6,"nano-date-input",{"invalid":[2564],"validityMessage":[2049,"validity-message"],"helperText":[4,"helper-text"],"helperTextFormat":[16],"floatLabel":[4,"float-label"],"name":[1],"readonly":[4],"size":[2],"form":[1],"firstDayOfWeek":[2,"first-day-of-week"],"localization":[16],"disabled":[4],"color":[1],"autofocus":[4],"clearInput":[4,"clear-input"],"label":[1],"placeholder":[1025],"value":[1537],"validateOn":[1,"validate-on"],"showInlineError":[516,"show-inline-error"],"dateOrder":[1,"date-order"],"required":[4],"min":[1],"max":[1],"hideLabel":[4,"hide-label"],"picker":[4],"initialPickerDate":[1,"initial-picker-date"],"pickerOpen":[1540,"picker-open"],"closeAfterPicked":[4,"close-after-picked"],"dropDownConfig":[6160],"dateValue":[2064],"isDateDisabled":[16],"pattern":[32],"inputValue":[32],"_invalid":[32],"reportValidity":[64],"setFocus":[64],"getInputElement":[64],"showError":[64]}]]],["p-570d2e50",[[1,"nano-dialog",{"showRibbon":[4,"show-ribbon"],"open":[1540],"label":[1],"noHeader":[4,"no-header"],"noFooter":[4,"no-footer"],"noUserDismiss":[4,"no-user-dismiss"],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"hoist":[4],"noDismiss":[32],"hasFooter":[32],"show":[64],"hide":[64]}]]],["p-ace7743c",[[1,"nano-drawer",{"open":[516],"label":[513],"placement":[513],"contained":[516],"noHeader":[516,"no-header"],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"noUserDismiss":[4,"no-user-dismiss"],"hoist":[4],"noDismiss":[32],"hasFooter":[32],"show":[64],"hide":[64]}]]],["p-ad6209ec",[[1,"nano-hero",{"imgSrc":[1,"img-src"],"imgSrcSet":[1,"img-src-set"],"largeScreenBP":[2,"large-screen-b-p"],"theme":[1],"level":[1],"hasIconBox":[32],"hasScrim":[32],"hasSecondaryContent":[32],"hasQuote":[32],"hasBg":[32],"hasBackBtn":[32],"hasCtas":[32],"breadCrumbs":[32],"iconBoxItems":[32]}]]],["p-bdb5b6fc",[[1,"nano-alert",{"open":[1540],"closable":[516],"color":[513],"duration":[2],"hoist":[4],"isModal":[32],"isToast":[32],"isShowing":[32],"label":[32],"noDismiss":[32],"show":[64],"hide":[64],"toast":[64],"alert":[64]}]]],["p-7ed03b91",[[6,"nano-file-upload",{"name":[1],"accept":[1],"capture":[1],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"label":[1],"placeholder":[1],"hideLabel":[4,"hide-label"],"required":[4],"disabled":[516],"clearInput":[4,"clear-input"],"showInlineError":[516,"show-inline-error"],"validateOn":[1025,"validate-on"],"form":[1],"invalid":[2564],"validityMessage":[2049,"validity-message"],"files":[6160],"value":[6145],"hasHelperSlot":[32],"hasLabelSlot":[32],"errorMessage":[32],"isDragging":[32],"fileList":[32],"hasFocus":[32],"_invalid":[32],"reportValidity":[64],"setFocus":[64],"getInputElement":[64],"showError":[64]},[[8,"click","globalClickHandler"],[8,"keydown","globalKeydownHandler"],[16,"reset","onReset"]]]]],["p-1b791810",[[1,"nano-overflow-nav",{"scrollControls":[4,"scroll-controls"],"orientation":[513],"activeHandler":[16],"inActiveHandler":[16],"isActiveHandler":[16],"instantReCalc":[32],"hasScrollControls":[32],"hideControlEnd":[32],"hideControlStart":[32],"syncActiveItem":[64]}]]],["p-b8e76fdf",[[1,"nano-tab",{"panel":[513],"active":[516],"disabled":[516],"closable":[4],"setFocus":[64],"removeFocus":[64]}]]],["p-487de04d",[[1,"nano-global-search-results",{"algoliaEle":[32],"currentWidth":[32],"apiKey":[32],"appId":[32],"index":[32]},[[16,"nanoSearchReset","handleGlobalNavReset"],[16,"nanoSearchResult","handleGlobalNavSearch"],[0,"nanoChange","handleReorder"],[0,"nanoResultsShown","attachListeners"],[16,"nanoNewResults","attachResultListeners"]]]]],["p-5d466a58",[[1,"nano-menu-drawer",{"open":[1028],"saveState":[4,"save-state"],"hideWidth":[2,"hide-width"],"hideHeight":[4,"hide-height"],"reset":[32],"widthOk":[32],"heightOk":[32],"isLoading":[32],"hide":[32]},[[0,"nanoOpen","cancelNavItemEvents"],[0,"nanoClose","cancelNavItemEvents"],[16,"nanoIsReady","handleGlobalNavReady"]]]]],["p-898cbac7",[[1,"nano-split-pane",{"position":[6146],"positionInPixels":[1026,"position-in-pixels"],"vertical":[516],"disabled":[516],"primary":[1],"snap":[1],"snapThreshold":[2,"snap-threshold"],"animationDuration":[2,"animation-duration"],"getPercentageToPixels":[64],"getPixelsToPercentage":[64]}]]],["p-676a4744",[[1,"nano-tab-group",{"placement":[513],"noScrollControls":[4,"no-scroll-controls"],"color":[1],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"disableSwipe":[4,"disable-swipe"],"hasScrollControls":[32],"hideControlRight":[32],"hideControlLeft":[32],"tab":[32],"show":[64]},[[0,"nanoTabClose","handleTabClose"]]]]],["p-207a1fbc",[[1,"nano-accordion",{"color":[1],"itemOpened":[32]},[[0,"nanoOpened","onToggleHandler"],[0,"nanoClosed","onClosedHandler"]]]]],["p-27422aa9",[[1,"nano-algolia-filter",{"filterName":[1,"filter-name"],"value":[1025],"operator":[1],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"changeEvent":[32],"internalValue":[32],"showFilter":[32],"indexResults":[32],"filterChanged":[32],"facets":[32],"tplRenderFn":[32],"globalStoreMethod":[32]},[[0,"nanoChange","handleChangeEvent"],[0,"change","handleChangeEvent"]]]]],["p-f504b1df",[[1,"nano-algolia-input",{"appId":[1,"app-id"],"apiKey":[1,"api-key"],"searchIndex":[1040],"searchIndexName":[1,"search-index-name"],"minChars":[2,"min-chars"],"autoEmit":[4,"auto-emit"],"browseIndex":[1028,"browse-index"],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"searchStr":[32],"algoliaIndex":[32],"currentResults":[32],"search":[64]},[[0,"nanoChange","searchSubmit"]]]]],["p-93cfbdb6",[[1,"nano-algolia-pagination",{"maxToShow":[2,"max-to-show"],"currentPage":[32],"canGoPrev":[32],"canGoNext":[32],"show":[32],"tplRenderFn":[32],"indexResults":[32],"infiniteScroll":[32],"nextPage":[64],"prevPage":[64],"goToPage":[64]}]]],["p-288dbe6b",[[1,"nano-algolia-results",{"infiniteScroll":[4,"infinite-scroll"],"appendPages":[4,"append-pages"],"showResults":[32],"tplRenderFn":[32],"results":[32],"indexResults":[32],"resultsPage":[32],"changeEvent":[32],"facets":[32],"isLoading":[32]}]]],["p-fe7a0158",[[1,"nano-aspect-ratio",{"aspectRatio":[1,"aspect-ratio"],"fit":[1]}]]],["p-20383b2e",[[6,"nano-checkbox",{"hasFocus":[1540,"has-focus"],"checked":[1540],"disabled":[516],"value":[513],"name":[513],"required":[516],"type":[513],"label":[1],"indeterminate":[1540],"invalid":[2564],"validityMessage":[2049,"validity-message"],"color":[1],"form":[1],"inputType":[32],"_invalid":[32],"getInputElement":[64],"reportValidity":[64],"setError":[64],"setFocus":[64],"removeFocus":[64]},[[16,"reset","onReset"]]]]],["p-d74e2642",[[6,"nano-checkbox-group",{"validateOn":[1025,"validate-on"],"showInlineError":[4,"show-inline-error"],"min":[2],"max":[2],"disabled":[516],"legend":[1],"invalid":[2564],"validityMessage":[2049,"validity-message"],"value":[1025],"checkboxes":[32],"nativeCbs":[32],"errorMessage":[32],"showErrorMsg":[32],"hasHelperSlot":[32],"_invalid":[32],"reportValidity":[64],"showError":[64]},[[0,"nanoChange","handleValueChange"],[0,"nanoChange","handleCbChange"]]]]],["p-76a650b1",[[1,"nano-details",{"label":[1],"open":[1540],"noHandle":[4,"no-handle"],"iconRotation":[2,"icon-rotation"],"color":[1],"isLoading":[32]}]]],["p-3dd8ae89",[[4,"nano-field-validator",{"validateOn":[1025,"validate-on"],"scrollToInvalid":[4,"scroll-to-invalid"],"dirty":[2564],"valid":[2564],"store":[2064],"payload":[2064],"showValidation":[2052,"show-validation"],"validationState":[2064],"extraFieldSelector":[1,"extra-field-selector"],"validation":[16],"submitted":[32],"userForm":[32],"_dirty":[32],"_valid":[32],"_store":[32],"setStore":[64],"setCustomValidity":[64],"resetValidity":[64],"scrollToFirstInvalid":[64]},[[0,"nanoChange","handleFieldChange"],[0,"input","handlePlainFieldChange"],[0,"change","handlePlainFieldChange"],[0,"submit","handleSubmit"]]]]],["p-bdef618c",[[1,"nano-grid-item"]]],["p-192902e0",[[6,"nano-range",{"color":[1],"debounce":[2],"name":[1],"dualKnobs":[4,"dual-knobs"],"min":[2],"max":[2],"pin":[4],"snaps":[4],"step":[2],"ticks":[4],"disabled":[4],"value":[1026],"ratioA":[32],"ratioB":[32],"pressedKnob":[32]}]]],["p-57085052",[[2,"nano-rating",{"value":[1538],"max":[2],"precision":[2],"readonly":[4],"disabled":[4],"name":[1],"symbolName":[1,"symbol-name"],"symbol":[16],"hoverValue":[32],"isHovering":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-cd2f5e97",[[1,"nano-slide",{"ready":[1540]}]]],["p-f7a4c62b",[[1,"nano-slides",{"options":[1040],"navbtns":[4],"pager":[4],"fullscreenbtn":[4],"fullscreen":[1540],"animation":[513],"currentSlide":[1538,"current-slide"],"autoplay":[8],"ready":[1540],"iCurrentSlide":[32],"slidesReady":[32],"didInit":[32],"update":[64],"updateAutoHeight":[64],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"getActiveIndex":[64],"length":[64],"isEnd":[64],"isBeginning":[64],"startAutoplay":[64],"stopAutoplay":[64],"lockSwipes":[64],"getflickity":[64],"reload":[64]}]]],["p-0301e8f7",[[1,"nano-sortable",{"itemSelector":[1,"item-selector"],"handleSelector":[1,"handle-selector"],"dropzoneSelector":[1,"dropzone-selector"],"helperText":[1,"helper-text"],"itemDescriptor":[16],"grabbedHelperText":[16],"droppedHelperText":[16],"reorderHelperText":[16],"createKeyboardHandle":[16],"sortableHostElement":[16],"animationEnabled":[4,"animation-enabled"],"draggedClass":[1,"dragged-class"],"handleDraggedClass":[1,"handle-dragged-class"],"placeholderClass":[1,"placeholder-class"],"dropzoneActiveClass":[1,"dropzone-active-class"],"animationTiming":[8,"animation-timing"],"orientation":[1],"dragResize":[4,"drag-resize"],"keyboardSortActive":[32],"ariaTextList":[32],"refreshKeyboardHandles":[64]}]]],["p-cba50c3e",[[1,"nano-tab-content",{"name":[513],"active":[516],"ready":[32]}]]],["p-68928c59",[[1,"nano-spinner",{"type":[1],"overlay":[516],"hasText":[32]}]]],["p-bab2888b",[[4,"nano-table",{"customRenderer":[16],"type":[1],"caption":[1],"showCaption":[4,"show-caption"],"loading":[4],"placeholderSize":[2,"placeholder-size"],"rows":[1040],"columns":[1040],"headRender":[16],"rowRender":[16],"footRender":[16],"showFooter":[4,"show-footer"],"perBlock":[2,"per-block"],"blocksLength":[2050,"blocks-length"],"searchTerm":[1,"search-term"],"customFilterFn":[16],"customSortFn":[16],"defaultSort":[4,"default-sort"],"virtualTotalItems":[2,"virtual-total-items"],"appliedFilters":[2064],"internalLoading":[32],"blocks":[32],"activeBlocks":[32],"resetSorting":[64],"addSort":[64],"resetFilters":[64],"addFilters":[64],"removeFilters":[64],"updateRow":[64]}]]],["p-90cd4f56",[[1,"nano-algolia",{"showResults":[1028,"show-results"],"resultsPage":[1026,"results-page"],"appId":[1025,"app-id"],"apiKey":[1025,"api-key"],"searchIndex":[1040],"searchIndexName":[1025,"search-index-name"],"listenTo":[1,"listen-to"],"query":[1025],"operator":[1],"filters":[16],"tplEngine":[16],"tplRenderFn":[16],"replicaIndex":[1025,"replica-index"],"browseIndex":[1028,"browse-index"],"minChars":[2,"min-chars"],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"_dynFacetFilters":[32],"inputField":[32],"algoliaIndex":[32],"indeces":[32],"resultsEmitterEle":[32],"indexResults":[32],"filterChanged":[32],"currentHits":[32],"changeEvent":[32],"isLoading":[32],"wormholeState":[32],"removeFilters":[64]},[[0,"nanoTplUpdated","onAllTplUpdate"],[0,"nanoPageChanged","onPageChange"],[0,"nanoFilterChanged","onFilterChange"],[16,"nanoChange","handleInputChange"],[16,"change","handleInputChange"]]]]],["p-5984ae16",[[1,"nano-date-picker",{"selectedDate":[1025,"selected-date"],"min":[1],"max":[1],"firstDayOfWeek":[2,"first-day-of-week"],"localization":[16],"color":[1],"isDateDisabled":[16],"isModal":[4,"is-modal"],"firstFocusEle":[16],"activeFocus":[32],"focusedDay":[32],"setFocus":[64]}]]],["p-9b5429e1",[[1,"nano-img",{"alt":[1],"src":[1],"srcSet":[1,"src-set"],"lazy":[4],"background":[4],"autoHeight":[1,"auto-height"],"loadSrc":[32],"loadError":[32],"hasLoaded":[32],"imgStates":[32],"_src":[32]}],[1,"nano-grid",{"sSize":[8,"s-size"],"mSize":[8,"m-size"],"lSize":[8,"l-size"],"xlSize":[8,"xl-size"],"sCols":[2,"s-cols"],"mCols":[2,"m-cols"],"lCols":[2,"l-cols"],"xlCols":[2,"xl-cols"],"xxlCols":[2,"xxl-cols"],"sTpl":[1,"s-tpl"],"mTpl":[1,"m-tpl"],"lTpl":[1,"l-tpl"],"xlTpl":[1,"xl-tpl"],"xxlTpl":[1,"xxl-tpl"],"showHelper":[516,"show-helper"],"cacheKey":[32]}]]],["p-565793a2",[[6,"nano-input",{"invalid":[2564],"validityMessage":[2049,"validity-message"],"color":[1],"accept":[1],"autocapitalise":[1],"autocomplete":[1],"autocorrect":[1],"autofocus":[4],"clearInput":[4,"clear-input"],"clearOnEdit":[4,"clear-on-edit"],"debounce":[2],"disabled":[516],"inputmode":[1],"validateOn":[1025,"validate-on"],"showInlineError":[516,"show-inline-error"],"label":[1],"hideLabel":[4,"hide-label"],"floatLabel":[4,"float-label"],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[516],"required":[4],"spellcheck":[4],"step":[1],"size":[2],"type":[513],"form":[1],"value":[1025],"resize":[1],"rows":[2],"showCharCount":[4,"show-char-count"],"hasFocus":[32],"hasLabelSlot":[32],"hasHelperSlot":[32],"hasHelperEndSlot":[32],"errorMessage":[32],"datalist":[32],"_invalid":[32],"reportValidity":[64],"setFocus":[64],"select":[64],"getInputElement":[64],"showError":[64]},[[16,"reset","onReset"],[17,"mousedown","handleBlur"],[0,"keydown","handleBlur"]]]]],["p-20038e9c",[[1,"nano-progress-bar",{"value":[2],"indeterminate":[4],"showPercent":[4,"show-percent"]}]]],["p-31c23d6e",[[1,"nano-sticker",{"autoResize":[4,"auto-resize"],"isSticky":[1028,"is-sticky"],"offset":[1026],"position":[1],"quietMode":[1,"quiet-mode"],"hideOnNewStickers":[4,"hide-on-new-stickers"],"breakPointMax":[2,"break-point-max"],"breakPointMin":[2,"break-point-min"],"scrollParent":[1040],"stickTo":[1,"stick-to"],"isStuck":[32],"isRootSticker":[32],"hide":[32],"scrollHide":[32],"multiStickerHide":[32],"scrollingTo":[32],"quietModeIsOn":[32],"stuckCounter":[32],"stickerIndex":[32],"stickToEle":[32],"triggerPos":[32],"trigger":[32],"_offset":[32],"isHiding":[64],"isSticking":[64],"setTriggerPos":[64],"getTriggerPos":[64],"pauseHiding":[64]}]]],["p-ede12d35",[[1,"nano-dropdown",{"autoOpen":[4,"auto-open"],"open":[1540],"closeOnSelect":[4,"close-on-select"],"containingElement":[1040],"tetherTo":[16],"placement":[1],"distance":[2],"skidding":[2],"hoist":[4],"dialogTitle":[1,"dialog-title"],"eventType":[16],"show":[64],"hide":[64]},[[0,"nanoOpen","secondaryOpen"],[0,"nanoClose","secondaryClose"],[0,"nanoSelect","handlePanelSelect"]]]]],["p-5a4b3fa9",[[1,"nano-datalist",{"selected":[1040],"dropDownConfig":[6160],"options":[16],"input":[1],"type":[1],"activeOptions":[2064],"open":[1028],"disableFilter":[4,"disable-filter"],"disabled":[4],"actvOptEles":[32],"connectedInput":[32],"inputLabel":[32],"hasNoResult":[32],"shouldOpen":[32],"canOpen":[32],"optionIds":[32]}],[1,"nano-option",{"value":[1537],"label":[1537],"selected":[516],"disabled":[516],"filterMeta":[1,"filter-meta"],"hasFocus":[32]},[[0,"keydown","handleKeyDown"]]],[1,"nano-menu",{"hasFocus":[2052,"has-focus"],"type":[1],"label":[1],"setFocus":[64],"removeFocus":[64],"showActiveElement":[64],"resetActiveItem":[64]},[[17,"mousedown","handleBlur"],[0,"keydown","handleBlur"]]]]],["p-bf18e298",[[6,"nano-select",{"invalid":[2564],"validityMessage":[2049,"validity-message"],"color":[1],"autofocus":[4],"disabled":[516],"validateOn":[1025,"validate-on"],"showInlineError":[516,"show-inline-error"],"label":[1],"hideLabel":[4,"hide-label"],"floatLabel":[4,"float-label"],"multiple":[4],"name":[1],"placeholder":[1],"readonly":[516],"required":[4],"size":[2],"max":[2],"min":[2],"form":[1],"allowCustomValues":[4,"allow-custom-values"],"value":[6145],"options":[6160],"clearSelect":[4,"clear-select"],"mask":[4],"debounce":[2],"dropDownConfig":[1040],"currInsertIndex":[32],"showErrorMsg":[32],"errorMessage":[32],"hasFocus":[32],"hasLabelSlot":[32],"hasHelperSlot":[32],"hasHelperEndSlot":[32],"inputSearchVal":[32],"_invalid":[32],"_eOptions":[32],"reportValidity":[64],"setFocus":[64],"getSelectElement":[64],"showError":[64]},[[16,"reset","onReset"],[17,"mousedown","handleBlur"],[0,"keydown","handleBlur"]]],[0,"nano-global-nav-user-profile",{"myAccountUser":[16],"userProfileUrl":[1,"user-profile-url"]}],[1,"nano-nav-item",{"href":[1025],"target":[1],"disabled":[4],"open":[1540],"selected":[516],"secondaryActiveWidth":[2,"secondary-active-width"],"secondaryFallback":[16],"closeOnBlur":[4,"close-on-blur"],"notification":[4],"hasAnchorEle":[32],"didOpen":[32],"isInGlobalNav":[32],"isInMenuDrawer":[32],"isInMenu":[32],"hasFocus":[32],"setFocus":[64]},[[16,"click","handleClose"],[16,"keyup","handleClose"]]]]],["p-5aae2588",[[1,"nano-resize-observe",{"notifyContentFit":[1,"notify-content-fit"],"states":[1],"currentWidth":[32],"currentHeight":[32],"classNames":[32],"contentFitX":[32],"contentFitY":[32]}],[1,"nano-skeleton",{"animated":[4]}]]],["p-173cc842",[[1,"nano-icon",{"color":[1],"ariaLabel":[1537,"aria-label"],"flipRtl":[4,"flip-rtl"],"name":[1],"src":[1],"icon":[8],"size":[1],"lazy":[4],"svgContent":[32],"isVisible":[32],"isLoading":[32]}]]],["p-ebb98a9e",[[1,"nano-icon-button",{"iconName":[1,"icon-name"],"iconSrc":[1,"icon-src"],"type":[513],"name":[513],"value":[513],"label":[1],"showTooltip":[4,"show-tooltip"],"disabled":[516],"href":[1],"rel":[1],"target":[1],"form":[1],"setFocus":[64]}],[1,"nano-tooltip",{"content":[1],"placement":[1],"disabled":[4],"distance":[2],"open":[1540],"skidding":[2],"hoist":[4],"trigger":[1],"show":[64],"hide":[64]}]]]]'),e)));
5
5
  //# sourceMappingURL=nano-components.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["patchBrowser","patchCloneNodeFix","H","prototype","importMeta","import","meta","url","opts","resourcesUrl","URL","href","promiseResolve","HTMLElementPrototype","nativeCloneNodeFn","cloneNode","deep","this","nodeName","call","clonedNode","srcChildNodes","childNodes","i","length","nodeType","appendChild","then","options","bootstrapLazy","JSON","parse"],"sources":["./node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v2.23.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cssVarShim) {\n // shim css vars\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":";;;qHAkBA,MAAMA,EAAe,KASO,CAEpBC,EAAkBC,EAAEC,UAC5B,CAiBI,MAAMC,EAAaC,OAAOC,KAAKC,IAC/B,MAAMC,EAA6D,GAenE,GAAuBJ,IAAe,GAAI,CACtCI,EAAKC,aAAe,IAAIC,IAAI,IAAKN,GAAYO,IACrD,CAYI,OAAOC,EAAeJ,EAAK,EA6C/B,MAAMP,EAAqBY,IACvB,MAAMC,EAAoBD,EAAqBE,UAC/CF,EAAqBE,UAAY,SAAUC,GACvC,GAAIC,KAAKC,WAAa,WAAY,CAC9B,OAAOJ,EAAkBK,KAAKF,KAAMD,EAChD,CACQ,MAAMI,EAAaN,EAAkBK,KAAKF,KAAM,OAChD,MAAMI,EAAgBJ,KAAKK,WAC3B,GAAIN,EAAM,CACN,IAAK,IAAIO,EAAI,EAAGA,EAAIF,EAAcG,OAAQD,IAAK,CAE3C,GAAIF,EAAcE,GAAGE,WAAa,EAAG,CACjCL,EAAWM,YAAYL,EAAcE,GAAGR,UAAU,MACtE,CACA,CACA,CACQ,OAAOK,CACf,CAAK,ECvILpB,IAAe2B,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,mykBAAuCH"}
1
+ {"version":3,"names":["patchBrowser","patchCloneNodeFix","H","prototype","importMeta","import","meta","url","opts","resourcesUrl","URL","href","promiseResolve","HTMLElementPrototype","nativeCloneNodeFn","cloneNode","deep","this","nodeName","call","clonedNode","srcChildNodes","childNodes","i","length","nodeType","appendChild","then","options","bootstrapLazy","JSON","parse"],"sources":["./node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v2.23.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cssVarShim) {\n // shim css vars\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":";;;qHAkBA,MAAMA,EAAe,KASO,CAEpBC,EAAkBC,EAAEC,UAC5B,CAiBI,MAAMC,EAAaC,OAAOC,KAAKC,IAC/B,MAAMC,EAA6D,GAenE,GAAuBJ,IAAe,GAAI,CACtCI,EAAKC,aAAe,IAAIC,IAAI,IAAKN,GAAYO,IACrD,CAYI,OAAOC,EAAeJ,EAAK,EA6C/B,MAAMP,EAAqBY,IACvB,MAAMC,EAAoBD,EAAqBE,UAC/CF,EAAqBE,UAAY,SAAUC,GACvC,GAAIC,KAAKC,WAAa,WAAY,CAC9B,OAAOJ,EAAkBK,KAAKF,KAAMD,EAChD,CACQ,MAAMI,EAAaN,EAAkBK,KAAKF,KAAM,OAChD,MAAMI,EAAgBJ,KAAKK,WAC3B,GAAIN,EAAM,CACN,IAAK,IAAIO,EAAI,EAAGA,EAAIF,EAAcG,OAAQD,IAAK,CAE3C,GAAIF,EAAcE,GAAGE,WAAa,EAAG,CACjCL,EAAWM,YAAYL,EAAcE,GAAGR,UAAU,MACtE,CACA,CACA,CACQ,OAAOK,CACf,CAAK,ECvILpB,IAAe2B,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,k2kBAAuCH"}
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Web Components for Nanopore digital Web Apps
3
+ */
4
+ import{w as t,r as i,c as s,d as e,h,a as n,g as r}from"./p-f6a8467a.js";import{d as o}from"./p-842cf127.js";import{d as a}from"./p-7bff5224.js";import{a as l}from"./p-9bfdee71.js";const d=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{position:relative;display:block}.sortable__live-region{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}";const f={horizontal:{x:1,y:0},vertical:{x:0,y:1}};let c=0;const u=class{handleItemSelectorChange(){this.refreshKeyboardHandles()}handleHandleSelectorChange(){this.refreshKeyboardHandles();this.attachMutationObserver()}handleCreateKeyboardHandleChange(){this.refreshKeyboardHandles()}handleSortableHostElement(t,i){if(i)this.removeEventHandlers(i);this.addEventHandlers();this.refreshKeyboardHandles();this.attachMutationObserver();if(this.sortableHostElement){this.sortableHostElement.style.position="relative"}}async refreshKeyboardHandles(){var t,i,s;if(this.handleSelector){if((t=this.keyboardHandleMap)===null||t===void 0?void 0:t.size){this.keyboardHandleMap.clear()}this.sortableHost.querySelectorAll(this.handleSelector).forEach((t=>{if(!t.getAttribute("aria-describedby"))t.setAttribute("aria-describedby",this.sortableId);const i=t.closest(this.itemSelector);if(i)this.keyboardHandleMap.set(t,i)}));return}if((i=this.keyboardHandleMap)===null||i===void 0?void 0:i.size){(s=this.keyboardHandleMap)===null||s===void 0?void 0:s.forEach(((t,i)=>i.remove()));this.keyboardHandleMap.clear()}this.sortableHost.querySelectorAll(this.itemSelector).forEach(((t,i)=>{const s=this.createKeyboardHandle(i,t);if(!s){console.error("`createKeyboardHandle` *must* return the handle element it creates");return}this.keyboardHandleMap.set(s,t);s.setAttribute("aria-describedby",this.sortableId)}))}get sortableHost(){if(this.sortableHostElement)return this.sortableHostElement;return this.host}addAriaMsg(t){this.ariaTextList=[...this.ariaTextList,t];setTimeout((()=>{const i=this.ariaTextList.indexOf(t);this.ariaTextList.splice(i,1);this.ariaTextList=[...this.ariaTextList]}),1e4)}updateUserSelectStyle(t){this.host.style.userSelect=t;this.host.style.MozUserSelect=t;this.host.style.msUserSelect=t;this.host.style.webkitUserSelect=t}hitTest(t,i){const{left:s,top:e,width:h,height:n}=t.getBoundingClientRect();const r=s+h/2;const o=e+n/2;return i.filter((t=>{const{left:i,right:s,top:e,bottom:h}=t.getBoundingClientRect();return!(r<i||r>s||o<e||o>h)}))}isAnimating(t){return this.animatedElements.indexOf(t)!==-1}animateNode(i,s=0,e=0){if(!i.animate){return}this.animatedElements.push(i);i.style.willChange="transform";t((()=>{this.animationPromise=new Promise((t=>{i.animate([{transform:`translate3d(${s}px, ${e}px, 0)`},{transform:"none"}],this.animationTiming).addEventListener("finish",(()=>{const s=this.animatedElements.indexOf(i);i.style.willChange="";if(s!==-1){this.animatedElements.splice(s,1)}t();delete this.animationPromise}),{once:true})}))}))}insertAtTarget(t,i){if(!t||!i)return;let s=[];if(this.animationEnabled){s=this.sortableNodes.map((t=>({x:t.offsetLeft,y:t.offsetTop})))}if(!t.isConnected||!i.isConnected)return;if(this.dropzoneNodes.indexOf(i)>-1){i.append(t)}else{const s=t.compareDocumentPosition(i);let e;if(s&this.host.DOCUMENT_POSITION_FOLLOWING){e=i.parentNode===t.parentNode?"afterend":"beforebegin"}if(s&this.host.DOCUMENT_POSITION_PRECEDING){e=i.parentNode===t.parentNode?"beforebegin":"afterend"}if(e)i.insertAdjacentElement(e,t)}if(this.animationEnabled){this.sortableNodes.forEach(((t,i)=>{const{x:e,y:h}=s[i];const n=e-t.offsetLeft;const r=h-t.offsetTop;if(n!==0||r!==0){this.animateNode(t,n,r)}}))}}reset(){if(this.draggedElementClone!==undefined&&this.draggedElementClone.parentNode!==null){this.draggedElementClone.parentNode.removeChild(this.draggedElementClone)}if(this.draggedElement&&this.draggedElement.parentNode&&this.draggedElementOrigin){this.draggedElement.classList.remove(this.placeholderClass)}if(this.dropzoneActiveClass&&this.dropzoneNodes.length){this.dropzoneNodes.forEach((t=>t.classList.remove(this.dropzoneActiveClass)))}delete this.draggedElementClone;delete this.draggedElement;this.dropzoneNodes=[];this.sortableNodes=[];this.animatedElements=[];this.dragRequestPending=false;this.updateUserSelectStyle("")}createClone(t){const i=t.cloneNode(true);if(t.id)i.id="clone__"+i.id;Array.from(i.children).forEach(((i,s)=>{const e=i;const h=t.children.item(s);if(h){e.style.width=`${h.offsetWidth}px`}}));const{offsetLeft:s,offsetTop:e,offsetWidth:h,offsetHeight:n}=t;Object.assign(i.style,{position:"absolute",left:`calc(${s}px - var(--grab-offset-x, 0px))`,top:`calc(${e}px - var(--grab-offset-y, 0px))`,height:this.dragResize?`${n}px`:undefined,width:this.dragResize?`${h}px`:undefined,willChange:"transform,opacity"});i.classList.add(this.draggedClass);return t.parentNode.appendChild(i)}removeEventHandlers(t){t=t||this.sortableHost;t.removeEventListener("mousedown",this.handleTrack);t.removeEventListener("touchstart",this.handleTrack);t.removeEventListener("keydown",this.handleKeydown)}addEventHandlers(t){t=t||this.sortableHost;l(t,"mousedown touchstart",this.handleTrack,{passive:true});t.addEventListener("keydown",this.handleKeydown)}attachMutationObserver(){if(this.mutationObserver){this.mutationObserver.disconnect();this.mutationObserver=undefined}this.mutationObserver=new MutationObserver((()=>{const t=Array.from(this.keyboardHandleMap.values());const i=Array.from(this.sortableHost.querySelectorAll(this.itemSelector));if(t.length!==i.length||!!i.find((i=>!t.includes(i)))){this.refreshKeyboardHandles()}}));this.mutationObserver.observe(this.sortableHost,{subtree:true,childList:true})}handleKeydown(t){const i=t.target;let s;let e;if(this.handleSelector){s=i.closest(this.handleSelector);e=i.closest(this.itemSelector)}else{e=this.keyboardHandleMap.get(i);s=i}if(!s||!e)return;const h=t=>{this.keyboardSortActive=t;this.draggedElement=t?e:undefined;e.classList.toggle(this.draggedClass,t);s.classList.toggle(this.handleDraggedClass,t);if(t){this.addAriaMsg(this.grabbedHelperText(e));document.addEventListener("mousedown",(()=>h(false)),{once:true})}else{this.addAriaMsg(this.droppedHelperText(e))}};if([" ","Space","Enter"].includes(t.key)){t.preventDefault();if(!this.keyboardSortActive){h(true);this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[];const t=this.nanoGrabbed.emit({element:e,index:this.sortableNodes.indexOf(e)});if(t.defaultPrevented){h(false);return}}else{h(false);this.nanoDropped.emit({element:e})}return}if(!this.keyboardSortActive)return;if(["Escape","Tab"].includes(t.key))h(false);let n=["Home","End"];if(!this.orientation||this.orientation==="horizontal")n=[...n,"ArrowRight","ArrowLeft"];if(!this.orientation||this.orientation==="vertical")n=[...n,"ArrowUp","ArrowDown"];if(!n.includes(t.key))return;t.preventDefault();this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[];this.dropzoneNodes=Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector))||[];const r=this.sortableNodes.indexOf(this.draggedElement);let o=-1;if(this.dropzoneNodes.length){const t=this.draggedElement.closest(this.dropzoneSelector);o=this.dropzoneNodes.indexOf(t);o=o>-1?o:-1}const a=r-1<0&&o>-1?this.dropzoneNodes[o-1]:this.sortableNodes[r-1];const l=r+1===this.sortableNodes.length&&o>-1?this.dropzoneNodes[o+1]:this.sortableNodes[r+1];if(t.key==="Home"){this.insertAtTarget(this.draggedElement,this.sortableNodes[0])}if(t.key==="End"){this.insertAtTarget(this.draggedElement,this.sortableNodes[this.sortableNodes.length-1])}if(["ArrowRight","ArrowDown"].includes(t.key)){this.insertAtTarget(this.draggedElement,l)}if(["ArrowLeft","ArrowUp"].includes(t.key)){this.insertAtTarget(this.draggedElement,a)}this.finishOrder();this.draggedElement=e;const d=()=>{requestAnimationFrame((()=>{typeof s["setFocus"]==="function"?s.setFocus():s.focus()}))};if(this.animationPromise)this.animationPromise.then((()=>d()));else d()}handleTrack(t){if(this.dragRequestPending||t.button&&t.button!==1)return;const i=t=>{if(t.cancelable)t.preventDefault();clearTimeout(this.mouseDownTimer)};const s=()=>{clearTimeout(this.mouseDownTimer);document.removeEventListener("touchmove",i);document.removeEventListener("contextmenu",this.finishOrder)};s();this.mouseDownTimer=window===null||window===void 0?void 0:window.setTimeout((()=>{if(!this.trackStart(t))return;document.addEventListener("touchmove",i,{passive:false});document.addEventListener("contextmenu",this.finishOrder);this.addAriaMsg(this.grabbedHelperText(this.draggedElement));o(this.sortableHost,{initialEvent:t,relative:true,onMove:(t,i)=>{this.trackMove(t,i)},onStop:()=>{this.nanoDropped.emit({element:this.draggedElement});s();const t=()=>{this.addAriaMsg(this.droppedHelperText(this.draggedElement));requestAnimationFrame((()=>this.finishOrder()))};if(this.animationPromise){this.animationPromise.then((()=>t()))}else t()}})}),150);l(document,"mouseup touchend touchmove",(()=>clearTimeout(this.mouseDownTimer)),{once:true})}trackStart(t){const i=t.target;let s;if(this.handleSelector){s=i.closest(this.handleSelector);if(!s)return;s.classList.add(this.handleDraggedClass)}const e=i.closest(this.itemSelector);if(!e)return false;this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[];const h=this.nanoGrabbed.emit({element:e,index:this.sortableNodes.indexOf(e)});if(h.defaultPrevented)return false;t.preventDefault();this.updateUserSelectStyle("none");this.dragRequestPending=true;this.draggedElement=e;this.dropzoneNodes=Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector))||[];this.draggedElementClone=this.createClone(e);this.draggedElementOrigin=e.nextSibling;this.animatedElements=[];this.draggedElement.classList.add(this.placeholderClass);return true}constructor(h){i(this,h);this.nanoOrderChange=s(this,"nanoOrderChange",7);this.nanoGrabbed=s(this,"nanoGrabbed",7);this.nanoDropped=s(this,"nanoDropped",7);this.dragRequestPending=false;this.sortableNodes=[];this.dropzoneNodes=[];this.animatedElements=[];this.keyboardHandleMap=new Map;this.sortableId=`nano-sortable-${c++}`;this.finishOrder=()=>{if(!this.draggedElement)return;const t=Array.from(this.sortableHost.querySelectorAll(this.itemSelector)).filter((t=>t!==this.draggedElementClone));const i=this.sortableNodes.indexOf(this.draggedElement);const s=t.indexOf(this.draggedElement);if(this.handleSelector){const t=this.draggedElement.querySelector(this.handleSelector);t.classList.remove(this.handleDraggedClass)}if(i!==s){const e=this.nanoOrderChange.emit({element:this.draggedElement,originalIndex:i,targetIndex:s});if(e.defaultPrevented){this.animationPromise=new Promise((s=>{setTimeout((()=>{this.insertAtTarget(this.draggedElement,t[i]);this.reset();this.dragRequestPending=false;s()}),200)}));return}this.addAriaMsg(this.reorderHelperText(this.draggedElement,t,s+1))}this.reset();this.dragRequestPending=false};this.trackMove=(i,s)=>{if(!this.draggedElementClone){return}if(this.orientation){i=i*f[this.orientation].x;s=s*f[this.orientation].y}t((()=>{Object.assign(this.draggedElementClone.style,{transform:`translate3d(${i}px, ${s}px, 0)`})}));let h=this.hitTest(this.draggedElementClone,this.sortableNodes)[0];let n;if(this.dropzoneSelector&&this.dropzoneActiveClass){e((()=>{n=this.draggedElement.closest(this.dropzoneSelector);t((()=>{this.dropzoneNodes.filter((t=>t!==n)).forEach((t=>t.classList.remove(this.dropzoneActiveClass)));n.classList.add(this.dropzoneActiveClass)}))}))}if(!h&&this.dropzoneNodes.length){h=this.hitTest(this.draggedElementClone,this.dropzoneNodes)[0];if(this.draggedElement.closest(this.dropzoneSelector)===h)return}if(h&&h!==this.draggedElement&&!this.isAnimating(h)){this.insertAtTarget(this.draggedElement,h)}};this.itemSelector="li";this.handleSelector=undefined;this.dropzoneSelector=undefined;this.helperText='Press "Space" or "Enter" to enable element reordering and use the arrow keys to reorder items.'+'Press "Escape" to cancel reordering. Alternatively, use your mouse to drag / reorder.';this.itemDescriptor=t=>`"${t===null||t===void 0?void 0:t.textContent.trim()}"`;this.grabbedHelperText=t=>`${this.itemDescriptor(t)} grabbed`;this.droppedHelperText=t=>`${this.itemDescriptor(t)} dropped`;this.reorderHelperText=(t,i,s)=>`The list has been reordered, ${this.itemDescriptor(t)} is now item ${s} of ${i.length}`;this.createKeyboardHandle=(t,i)=>{const s=`\n <nano-icon-button\n slot="end"\n icon-name="light/arrows"\n class="nano-sortable__keyboard-handle visually-hidden"\n label="Re-order this item"\n ></nano-icon-button>`;const e=globalThis.document.createElement("div");e.innerHTML=s;const h=e.children[0];i.append(h);return h};this.sortableHostElement=undefined;this.animationEnabled=true;this.draggedClass="nano-sortable__dragged";this.handleDraggedClass="nano-sortable__handle-dragged";this.placeholderClass="nano-sortable__placeholder";this.dropzoneActiveClass="";this.animationTiming={duration:200,easing:"ease-out"};this.orientation=undefined;this.dragResize=false;this.keyboardSortActive=false;this.ariaTextList=[];this.handleTrack=this.handleTrack.bind(this);this.handleKeydown=this.handleKeydown.bind(this);this.refreshKeyboardHandles=this.refreshKeyboardHandles.bind(this);this.refreshKeyboardHandles=a(this.refreshKeyboardHandles,500)}connectedCallback(){this.addEventHandlers();this.refreshKeyboardHandles();this.attachMutationObserver();if(!this.host.querySelector(`#${this.sortableId}`)){this.host.insertAdjacentHTML("beforeend",`<div class="visually-hidden" id="${this.sortableId}">${this.helperText}</div>`)}}disconnectedCallback(){var t;this.removeEventHandlers();(t=this.host.querySelector(`#${this.sortableId}`))===null||t===void 0?void 0:t.remove();if(this.mutationObserver){this.mutationObserver.disconnect();this.mutationObserver=undefined}}render(){return h(n,null,h("div",{class:"sortable__live-region","aria-live":"polite","aria-relevant":"additions","aria-atomic":"true",role:"log",part:"announcements"},this.ariaTextList.map((t=>h("div",null,t)))),h("slot",null))}get host(){return r(this)}static get watchers(){return{itemSelector:["handleItemSelectorChange"],handleSelector:["handleHandleSelectorChange"],createKeyboardHandle:["handleCreateKeyboardHandleChange"],sortableHostElement:["handleSortableHostElement"]}}};u.style=d;export{u as nano_sortable};
5
+ //# sourceMappingURL=p-0301e8f7.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sortableCss","orientationMap","horizontal","x","y","vertical","sortableIds","Sortable","handleItemSelectorChange","this","refreshKeyboardHandles","handleHandleSelectorChange","attachMutationObserver","handleCreateKeyboardHandleChange","handleSortableHostElement","_newVal","oldVal","removeEventHandlers","addEventHandlers","sortableHostElement","style","position","async","handleSelector","_a","keyboardHandleMap","size","clear","sortableHost","querySelectorAll","forEach","handle","getAttribute","setAttribute","sortableId","sortEle","closest","itemSelector","set","_b","_c","_ele","remove","ele","i","createKeyboardHandle","console","error","host","addAriaMsg","msg","ariaTextList","setTimeout","mIdx","indexOf","splice","updateUserSelectStyle","userSelect","MozUserSelect","msUserSelect","webkitUserSelect","hitTest","node","targets","left","l","top","t","width","w","height","h","getBoundingClientRect","filter","item","right","bottom","isAnimating","animatedElements","animateNode","dx","dy","animate","push","willChange","writeTask","animationPromise","Promise","resolve","transform","animationTiming","addEventListener","index","once","insertAtTarget","target","offsets","animationEnabled","sortableNodes","map","offsetLeft","offsetTop","isConnected","dropzoneNodes","append","nodeComparison","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","parentNode","DOCUMENT_POSITION_PRECEDING","insertAdjacentElement","sortableNode","reset","draggedElementClone","undefined","removeChild","draggedElement","draggedElementOrigin","classList","placeholderClass","dropzoneActiveClass","length","dze","dragRequestPending","createClone","clone","cloneNode","id","Array","from","children","nodeChild","clonedNodeChild","originalNodeChild","offsetWidth","offsetHeight","Object","assign","dragResize","add","draggedClass","appendChild","removeEventListener","handleTrack","handleKeydown","addListeners","passive","mutationObserver","disconnect","MutationObserver","currHandles","values","newHandles","find","includes","observe","subtree","childList","e","targetElement","foundHandle","get","activateSort","isActive","keyboardSortActive","toggle","handleDraggedClass","grabbedHelperText","document","droppedHelperText","key","preventDefault","nanoGrabbedEv","nanoGrabbed","emit","element","defaultPrevented","nanoDropped","moveKeys","orientation","dropzoneSelector","currIdx","curDzIdx","curDropzone","prevEle","nextEle","finishOrder","focus","requestAnimationFrame","setFocus","then","button","handleMove","cancelable","clearTimeout","mouseDownTimer","resetTrack","window","trackStart","drag","initialEvent","relative","onMove","trackMove","onStop","didStop","targetHandle","nextSibling","constructor","hostRef","Map","updated","originalIndex","targetIndex","querySelector","orderChangeEv","nanoOrderChange","reorderHelperText","activeDropzone","readTask","el","textContent","trim","itemDescriptor","elements","_number","_element","handleTpl","div","globalThis","createElement","innerHTML","duration","easing","bind","nanoDebounce","connectedCallback","insertAdjacentHTML","helperText","disconnectedCallback","render","Host","class","role","part","str"],"sources":["./src/components/sortable/sortable.scss?tag=nano-sortable&encapsulation=shadow","./src/components/sortable/sortable.tsx"],"sourcesContent":["@use '../../global/style/utilities/globals' as g;\n\n:host {\n position: relative;\n display: block;\n}\n\n.sortable__live-region {\n @include g.visually-hide();\n}\n","import {\n Prop,\n Element,\n Event,\n EventEmitter,\n h,\n Component,\n ComponentInterface,\n Watch,\n Method,\n State,\n Host,\n readTask,\n writeTask,\n Build,\n} from '@stencil/core';\nimport { drag } from '../../utils/drag';\nimport { nanoDebounce } from '../..';\nimport { addListeners } from '../../utils/events';\n\n// Orientation map to limit dragging to horizontal or vertical.\nconst orientationMap = {\n horizontal: { x: 1, y: 0 },\n vertical: { x: 0, y: 1 },\n};\n\nlet sortableIds = 0;\n\n/**\n * An accessible and flexible re-order / sort utility component.\n *\n *- Drag and drop via mouse, touch or keyboard\n *- Live announcements for screen readers\n *- Works with or without an explicit handle (although with is preferable)\n\n * @part announcements - the a11y, live region. Visually hidden by default\n *\n * @slot - The default slot containing any items you might want to sort\n */\n@Component({\n tag: 'nano-sortable',\n shadow: true,\n styleUrl: 'sortable.scss',\n})\nexport class Sortable implements ComponentInterface {\n /// Public API & surface ///\n\n /** A css query selector which matches a set of elements that should be sortable. e.g. `<li>` or `<tr>` */\n @Prop() itemSelector = 'li';\n @Watch('itemSelector')\n handleItemSelectorChange() {\n this.refreshKeyboardHandles();\n }\n\n /** A css query selector which matches an element *within* the `itemSelector` element\n * which will act like a drag handle. **Note** For keyboard a11y it's recommended\n * to use `handleSelector` when possible. Alternatively, the `createKeyboardHandle` prop will be used */\n @Prop() handleSelector?: string;\n @Watch('handleSelector')\n handleHandleSelectorChange() {\n this.refreshKeyboardHandles();\n this.attachMutationObserver();\n }\n\n /** When dragging between grouped collections of items, it is possible to drag all sortable items from one group to another.\n * At that point, you will not be able to drag items back to the original group.\n * A `dropzoneSelector` allows you to define a placeholder area where items can always be dropped.\n */\n @Prop() dropzoneSelector?: string;\n\n /** Accessibility helper text applied to handle controls */\n @Prop() helperText =\n 'Press \"Space\" or \"Enter\" to enable element reordering and use the arrow keys to reorder items.' +\n 'Press \"Escape\" to cancel reordering. Alternatively, use your mouse to drag / reorder.';\n\n /**\n * As a sortable element is interacted with, announcements are made to screen readers\n * - informing the user what is changing.\n * By default, the text from the element is extracted to describe the interacted with element.\n * Use this function to provide a more meaningful, concise item descriptor\n * @param el the element being interacted with\n * @returns a string, describing the element being interacted with\n */\n @Prop() itemDescriptor = (el: Element) => `\"${el?.textContent.trim()}\"`;\n\n /**\n * Used to generate a screen reader live update, informing the user of the current element being grabbed.\n * @param el the element that has been grabbed by the user\n * @returns a string, describing the element being grabbed\n */\n @Prop() grabbedHelperText = (el: Element) =>\n `${this.itemDescriptor(el)} grabbed`;\n\n /**\n * Used to generate a screen reader live update, informing the user of the current element being dropped.\n * @param el the element that has been dropped by the user\n * @returns a string, describing the element that has been dropped\n */\n @Prop() droppedHelperText = (el: Element) =>\n `${this.itemDescriptor(el)} dropped`;\n\n /**\n * Used to generate a screen reader live update, informing the user when items have been reordered.\n * @param el the element that has been reordered by the user\n * @param elements the elements in the sortable list\n * @param position the new position of the dropped element\n * @returns a string, describing the element being dropped\n */\n @Prop() reorderHelperText = (\n el: Element,\n elements: Element[],\n position: number\n ) =>\n `The list has been reordered, ${this.itemDescriptor(\n el\n )} is now item ${position} of ${elements.length}`;\n\n /**\n * A function that should attach a keyboard accessible control.\n * When a `handleSelector` is not used - to allow keyboard accessibility -\n * `createKeyboardHandle` should render a focusable element.\n *\n * If your sortable item is itself focusable,\n * you must use this function to render a control *outside* of the focusable element.\n * @param _number\n * @param _element\n * @returns a function that attaches a keyboard accessible handle control element.\n * The function itself *must* return the handle element.\n */\n @Prop() createKeyboardHandle = (_number: number, _element: Element) => {\n const handleTpl = /* html */ `\n <nano-icon-button\n slot=\"end\"\n icon-name=\"light/arrows\"\n class=\"nano-sortable__keyboard-handle visually-hidden\"\n label=\"Re-order this item\"\n ></nano-icon-button>`;\n const div = globalThis.document.createElement('div');\n div.innerHTML = handleTpl;\n\n const handle = div.children[0] as HTMLElement;\n _element.append(handle);\n return handle;\n };\n @Watch('createKeyboardHandle')\n handleCreateKeyboardHandleChange() {\n this.refreshKeyboardHandles();\n }\n\n /** use `sortableHostElement` to watch a sortable list without needing to wrap in `nano-sortable`.\n * Note that the `sortableHostElement` element css `position` will be set to `relative` */\n @Prop() sortableHostElement?: HTMLElement;\n @Watch('sortableHostElement')\n handleSortableHostElement(_newVal?, oldVal?: HTMLElement) {\n if (oldVal) this.removeEventHandlers(oldVal);\n\n this.addEventHandlers();\n this.refreshKeyboardHandles();\n this.attachMutationObserver();\n\n if (this.sortableHostElement) {\n // sortable host must have position relative\n this.sortableHostElement.style.position = 'relative';\n }\n }\n\n /** Items being sorted will animate into place */\n @Prop() animationEnabled = true;\n\n /** Use this class to change how the element looks whilst being sorted */\n @Prop() draggedClass = 'nano-sortable__dragged';\n\n /** Use this class to change how the handle looks whilst being sorted */\n @Prop() handleDraggedClass = 'nano-sortable__handle-dragged';\n\n /** Use this class to change how the element looks when acting as a placeholder */\n @Prop() placeholderClass = 'nano-sortable__placeholder';\n\n /** Used in-conjunction with `dropzoneSelector`, applied when a dropzone is dragged over */\n @Prop() dropzoneActiveClass?: string = '';\n\n /** The css animation timing applied when `animationEnabled` is `true` */\n @Prop() animationTiming: any = { duration: 200, easing: 'ease-out' };\n\n /** The axis to lock dragging elements to. `undefined` means any axis */\n @Prop() orientation?: 'horizontal' | 'vertical';\n\n /** Dragged items by default, will take whatever default css is applied in situ.\n * When sortable items' dimensions are dynamic (i.e they can shrink / grow via the space allowed) dragging items can look 'wrong'.\n * Apply `dragResize` to read & recreate the dragged items current dimensions when dragged. */\n @Prop() dragResize = false;\n\n /** Fired when an the order changes. Use this to update any underlying data model.\n * `event.preventDefault()` to prevent the element being moved; will revert to original position. */\n @Event() nanoOrderChange: EventEmitter<{\n element: HTMLElement;\n originalIndex: number;\n targetIndex: number;\n }>;\n\n /** Fired when a sortable element is picked-up; via keyboard, mouse or touch.\n * `event.preventDefault()` to prevent the element being picked-up. */\n @Event() nanoGrabbed: EventEmitter<{ element: HTMLElement; index: number }>;\n\n /** Fired when a sortable element is dropped after having been picked up. */\n @Event() nanoDropped: EventEmitter<{ element: HTMLElement }>;\n\n /** If sortable elements change dynamically, use this method to add handle controls to new elements */\n @Method()\n async refreshKeyboardHandles() {\n if (this.handleSelector) {\n if (this.keyboardHandleMap?.size) {\n this.keyboardHandleMap.clear();\n }\n\n this.sortableHost\n .querySelectorAll<HTMLElement>(this.handleSelector)\n .forEach((handle) => {\n if (!handle.getAttribute('aria-describedby'))\n handle.setAttribute('aria-describedby', this.sortableId);\n const sortEle = handle.closest<HTMLElement>(this.itemSelector);\n if (sortEle) this.keyboardHandleMap.set(handle, sortEle);\n });\n return;\n }\n\n if (this.keyboardHandleMap?.size) {\n this.keyboardHandleMap?.forEach((_ele, handle) => handle.remove());\n this.keyboardHandleMap.clear();\n }\n this.sortableHost\n .querySelectorAll<HTMLElement>(this.itemSelector)\n .forEach((ele, i) => {\n const handle = this.createKeyboardHandle(i, ele);\n if (!handle) {\n console.error(\n '`createKeyboardHandle` *must* return the handle element it creates'\n );\n return;\n }\n this.keyboardHandleMap.set(handle, ele);\n handle.setAttribute('aria-describedby', this.sortableId);\n });\n }\n\n /// Private state & logic ///\n\n @Element() host: HTMLNanoSortableElement;\n private dragRequestPending = false;\n private draggedElement?: HTMLElement;\n private draggedElementClone?: HTMLElement;\n private draggedElementOrigin?: HTMLElement;\n private sortableNodes: HTMLElement[] = [];\n private dropzoneNodes: HTMLElement[] = [];\n private animatedElements: HTMLElement[] = [];\n private animationPromise?: Promise<void>;\n private keyboardHandleMap: Map<HTMLElement, HTMLElement> = new Map();\n private sortableId = `nano-sortable-${sortableIds++}`;\n private mouseDownTimer: number;\n private mutationObserver: MutationObserver;\n\n @State() keyboardSortActive = false;\n @State() ariaTextList: string[] = [];\n\n /**\n * Get instance of sortable host.\n * By default it is `nano-sortable` which can be overridden by property `sortableHostElement`\n */\n get sortableHost() {\n if (this.sortableHostElement) return this.sortableHostElement;\n return this.host;\n }\n\n /**\n * Queues aria messages which are then displayed in a 'live' region.\n * Messages are cleared after 10s\n * @param msg aria message to announce\n */\n private addAriaMsg(msg: string) {\n this.ariaTextList = [...this.ariaTextList, msg];\n\n setTimeout(() => {\n const mIdx = this.ariaTextList.indexOf(msg);\n this.ariaTextList.splice(mIdx, 1);\n this.ariaTextList = [...this.ariaTextList];\n }, 10000);\n }\n\n /**\n * Try to stop text highlight whilst dragging\n * @param userSelect\n */\n private updateUserSelectStyle(userSelect: '' | 'none') {\n this.host.style.userSelect = userSelect;\n // @ts-ignore\n this.host.style.MozUserSelect = userSelect;\n // @ts-ignore\n this.host.style.msUserSelect = userSelect;\n this.host.style.webkitUserSelect = userSelect;\n }\n\n /**\n * Fast and simple hit test to check whether the center of a node intersects with the rectangle of any of the\n * given targets. Returns an array of matches.\n * @param node\n * @param targets\n * @returns all the items that currently intersect with the target node\n */\n private hitTest(node: HTMLElement, targets: HTMLElement[]): HTMLElement[] {\n const {\n left: l,\n top: t,\n width: w,\n height: h,\n } = node.getBoundingClientRect();\n const x = l + w / 2;\n const y = t + h / 2;\n\n return targets.filter((item) => {\n const { left, right, top, bottom } = item.getBoundingClientRect();\n return !(x < left || x > right || y < top || y > bottom);\n });\n }\n\n /**\n * Returns a boolean indicating whether the node is currently in an animation.\n * @param node\n * @returns whether a node is currently animating or not\n */\n private isAnimating(node: HTMLElement) {\n return this.animatedElements.indexOf(node) !== -1;\n }\n\n /**\n * Triggers a CSS animation on a node with the given dx and dy. Used following dom updates to make it appear as\n * if nodes animate from their old to their new position in the dom. */\n private animateNode(node: HTMLElement, dx = 0, dy = 0) {\n if (!node.animate) {\n return;\n }\n\n // keep a stack of currently animating nodes to exclude as drag & drop targets.\n this.animatedElements.push(node);\n\n node.style.willChange = 'transform';\n\n // animate from dx/dy (old node position) to none (new node position)\n writeTask(() => {\n this.animationPromise = new Promise((resolve) => {\n node\n .animate(\n [\n { transform: `translate3d(${dx}px, ${dy}px, 0)` },\n { transform: 'none' },\n ],\n this.animationTiming\n )\n .addEventListener(\n 'finish',\n () => {\n const index = this.animatedElements.indexOf(node);\n node.style.willChange = '';\n\n if (index !== -1) {\n // splice out when done to unlock as a valid target\n this.animatedElements.splice(index, 1);\n }\n\n resolve();\n delete this.animationPromise;\n },\n { once: true }\n );\n });\n });\n }\n\n /**\n * Inserts node at target to update sibling sorting. If the node precedes the target, it is inserted after it;\n * If it follows the target, it is inserted before it. This ensures any node can be dragged from the very\n * beginning to the very end and vice versa. The animateNode function is called for all nodes that moved because\n * of this dom update */\n private insertAtTarget(node: Element, target: HTMLElement) {\n if (!node || !target) return;\n\n let offsets: any[] = [];\n if (this.animationEnabled) {\n offsets = this.sortableNodes.map((item) => ({\n x: item.offsetLeft,\n y: item.offsetTop,\n }));\n }\n\n if (!node.isConnected || !target.isConnected) return;\n\n if (this.dropzoneNodes.indexOf(target) > -1) {\n target.append(node);\n } else {\n const nodeComparison = node.compareDocumentPosition(target);\n let position;\n\n if (nodeComparison & this.host.DOCUMENT_POSITION_FOLLOWING) {\n position =\n target.parentNode === node.parentNode ? 'afterend' : 'beforebegin';\n }\n if (nodeComparison & this.host.DOCUMENT_POSITION_PRECEDING) {\n position =\n target.parentNode === node.parentNode ? 'beforebegin' : 'afterend';\n }\n if (position) target.insertAdjacentElement(position, node);\n }\n\n if (this.animationEnabled) {\n this.sortableNodes.forEach((sortableNode, i) => {\n const { x, y } = offsets[i];\n const dx = x - sortableNode.offsetLeft;\n const dy = y - sortableNode.offsetTop;\n if (dx !== 0 || dy !== 0) {\n this.animateNode(sortableNode, dx, dy);\n }\n });\n }\n }\n\n private reset() {\n if (\n this.draggedElementClone !== undefined &&\n this.draggedElementClone.parentNode !== null\n ) {\n this.draggedElementClone.parentNode.removeChild(this.draggedElementClone);\n }\n\n if (\n this.draggedElement &&\n this.draggedElement.parentNode &&\n this.draggedElementOrigin\n ) {\n this.draggedElement.classList.remove(this.placeholderClass);\n }\n\n if (this.dropzoneActiveClass && this.dropzoneNodes.length) {\n this.dropzoneNodes.forEach((dze) =>\n dze.classList.remove(this.dropzoneActiveClass)\n );\n }\n\n delete this.draggedElementClone;\n delete this.draggedElement;\n\n this.dropzoneNodes = [];\n this.sortableNodes = [];\n this.animatedElements = [];\n this.dragRequestPending = false;\n this.updateUserSelectStyle('');\n }\n\n /**\n * Clones a given node to visually drag around. The original node is left in the same flow as its siblings.\n * Clone styles are added onto the style object directly, since the ::slotted()\n * selector can't universally target nodes that may be nested an unknown amount of shadow dom levels deep\n * @param node html node to clone\n * @returns the cloned html node\n */\n private createClone(node: HTMLElement): HTMLElement {\n const clone = node.cloneNode(true) as HTMLElement;\n if (node.id) clone.id = 'clone__' + clone.id;\n\n /**\n * Bugfix for table row sorting.\n * During dragging table rows shrink, so we manually set them width of original node.\n */\n Array.from(clone.children).forEach((nodeChild: HTMLElement, index) => {\n const clonedNodeChild = nodeChild;\n const originalNodeChild = node.children.item(index) as HTMLElement;\n\n if (originalNodeChild) {\n clonedNodeChild.style.width = `${originalNodeChild.offsetWidth}px`;\n }\n });\n const {\n offsetLeft: x,\n offsetTop: y,\n offsetWidth: w,\n offsetHeight: h,\n } = node;\n\n Object.assign(clone.style, {\n position: 'absolute',\n left: `calc(${x}px - var(--grab-offset-x, 0px))`,\n top: `calc(${y}px - var(--grab-offset-y, 0px))`,\n height: this.dragResize ? `${h}px` : undefined,\n width: this.dragResize ? `${w}px` : undefined,\n willChange: 'transform,opacity',\n });\n\n clone.classList.add(this.draggedClass);\n\n return node.parentNode!.appendChild(clone);\n }\n\n /// Event handlers ///\n\n private removeEventHandlers(ele?: HTMLElement) {\n ele = ele || this.sortableHost;\n ele.removeEventListener('mousedown', this.handleTrack);\n ele.removeEventListener('touchstart', this.handleTrack);\n ele.removeEventListener('keydown', this.handleKeydown);\n }\n\n private addEventHandlers(ele?: HTMLElement) {\n ele = ele || this.sortableHost;\n addListeners(ele, 'mousedown touchstart', this.handleTrack, {\n passive: true,\n });\n ele.addEventListener('keydown', this.handleKeydown);\n }\n\n /**\n * Watch for any changes in grab-able handle elements.\n */\n private attachMutationObserver() {\n if (!Build.isBrowser) return;\n\n if (this.mutationObserver) {\n this.mutationObserver.disconnect();\n this.mutationObserver = undefined;\n }\n\n this.mutationObserver = new MutationObserver(() => {\n const currHandles = Array.from(this.keyboardHandleMap.values());\n const newHandles = Array.from(\n this.sortableHost.querySelectorAll<HTMLElement>(this.itemSelector)\n );\n\n // simple test for equality\n if (\n currHandles.length !== newHandles.length ||\n !!newHandles.find((h) => !currHandles.includes(h))\n ) {\n this.refreshKeyboardHandles();\n }\n });\n this.mutationObserver.observe(this.sortableHost, {\n subtree: true,\n childList: true,\n });\n }\n\n private handleKeydown(e: KeyboardEvent) {\n const targetElement = e.target as HTMLElement;\n let foundHandle: HTMLElement;\n let sortEle: HTMLElement;\n\n if (this.handleSelector) {\n foundHandle = targetElement.closest(this.handleSelector);\n sortEle = targetElement.closest(this.itemSelector);\n } else {\n sortEle = this.keyboardHandleMap.get(targetElement);\n foundHandle = targetElement;\n }\n\n // have we found a handle and matching sort element from the keydown element\n if (!foundHandle || !sortEle) return;\n\n const activateSort = (isActive: boolean) => {\n this.keyboardSortActive = isActive;\n this.draggedElement = isActive ? sortEle : undefined;\n sortEle.classList.toggle(this.draggedClass, isActive);\n foundHandle.classList.toggle(this.handleDraggedClass, isActive);\n\n if (isActive) {\n this.addAriaMsg(this.grabbedHelperText(sortEle));\n document.addEventListener('mousedown', () => activateSort(false), {\n once: true,\n });\n } else {\n this.addAriaMsg(this.droppedHelperText(sortEle));\n }\n };\n\n // start editing this element's order?\n if ([' ', 'Space', 'Enter'].includes(e.key)) {\n e.preventDefault();\n\n if (!this.keyboardSortActive) {\n // grabbed the element\n activateSort(true);\n\n this.sortableNodes =\n Array.from(this.sortableHost.querySelectorAll(this.itemSelector)) ||\n [];\n const nanoGrabbedEv = this.nanoGrabbed.emit({\n element: sortEle,\n index: this.sortableNodes.indexOf(sortEle),\n });\n\n if (nanoGrabbedEv.defaultPrevented) {\n activateSort(false);\n return;\n }\n } else {\n // dropped the element\n activateSort(false);\n this.nanoDropped.emit({ element: sortEle });\n }\n return;\n }\n if (!this.keyboardSortActive) return;\n\n // Tabbing away from this handle - deactivate\n if (['Escape', 'Tab'].includes(e.key)) activateSort(false);\n\n let moveKeys = ['Home', 'End'];\n if (!this.orientation || this.orientation === 'horizontal')\n moveKeys = [...moveKeys, 'ArrowRight', 'ArrowLeft'];\n if (!this.orientation || this.orientation === 'vertical')\n moveKeys = [...moveKeys, 'ArrowUp', 'ArrowDown'];\n\n if (!moveKeys.includes(e.key)) return;\n\n // move the element with the keyboard\n e.preventDefault();\n\n /** Collect all elements that have drag positions.\n * Both sortable elements and 'dropzones' (placeholders where items can always be placed) */\n\n this.sortableNodes =\n Array.from(this.sortableHost.querySelectorAll(this.itemSelector)) || [];\n this.dropzoneNodes =\n Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector)) ||\n [];\n const currIdx = this.sortableNodes.indexOf(this.draggedElement);\n let curDzIdx: number = -1;\n\n if (this.dropzoneNodes.length) {\n const curDropzone = this.draggedElement.closest<HTMLElement>(\n this.dropzoneSelector\n );\n curDzIdx = this.dropzoneNodes.indexOf(curDropzone);\n curDzIdx = curDzIdx > -1 ? curDzIdx : -1;\n }\n\n /** If we don't have a next / prev sortable element in our list, test to see if there's a dropzone instead */\n const prevEle =\n currIdx - 1 < 0 && curDzIdx > -1\n ? this.dropzoneNodes[curDzIdx - 1]\n : this.sortableNodes[currIdx - 1];\n const nextEle =\n currIdx + 1 === this.sortableNodes.length && curDzIdx > -1\n ? this.dropzoneNodes[curDzIdx + 1]\n : this.sortableNodes[currIdx + 1];\n\n if (e.key === 'Home') {\n this.insertAtTarget(this.draggedElement, this.sortableNodes[0]);\n }\n if (e.key === 'End') {\n this.insertAtTarget(\n this.draggedElement,\n this.sortableNodes[this.sortableNodes.length - 1]\n );\n }\n if (['ArrowRight', 'ArrowDown'].includes(e.key)) {\n this.insertAtTarget(this.draggedElement, nextEle);\n }\n if (['ArrowLeft', 'ArrowUp'].includes(e.key)) {\n this.insertAtTarget(this.draggedElement, prevEle);\n }\n\n this.finishOrder();\n this.draggedElement = sortEle;\n\n const focus = () => {\n requestAnimationFrame(() => {\n typeof foundHandle['setFocus'] === 'function'\n ? (foundHandle as HTMLNanoIconButtonElement).setFocus()\n : foundHandle.focus();\n });\n };\n\n // replace focus to handle so we don't 'drop' the element\n if (this.animationPromise) this.animationPromise.then(() => focus());\n else focus();\n }\n\n /** Tracks a pointer from touchstart/mousedown to touchend/mouseup. */\n private handleTrack(e: PointerEvent) {\n // ignore if we've started dragging or right click\n if (this.dragRequestPending || (e.button && e.button !== 1)) return;\n\n // ignore touchmove events (namespace it so we can remove it)\n const handleMove = (e: Event) => {\n if (e.cancelable) e.preventDefault();\n clearTimeout(this.mouseDownTimer);\n };\n\n // remove temporary events and reset timer\n const resetTrack = () => {\n clearTimeout(this.mouseDownTimer);\n document.removeEventListener('touchmove', handleMove);\n document.removeEventListener('contextmenu', this.finishOrder);\n };\n resetTrack();\n\n // start a timer - only start dragging if pressed for 150ms\n this.mouseDownTimer = window?.setTimeout(() => {\n // ignore if this is not a valid drag target\n if (!this.trackStart(e)) return;\n\n // ignore touchmove events (they scroll the screen)\n document.addEventListener('touchmove', handleMove, {\n passive: false,\n });\n // cancel if user presses and holds (without move) for context menu\n document.addEventListener('contextmenu', this.finishOrder);\n\n this.addAriaMsg(this.grabbedHelperText(this.draggedElement));\n\n drag(this.sortableHost, {\n initialEvent: e,\n relative: true,\n onMove: (x, y) => {\n this.trackMove(x, y);\n },\n onStop: () => {\n this.nanoDropped.emit({ element: this.draggedElement });\n resetTrack();\n\n const didStop = () => {\n this.addAriaMsg(this.droppedHelperText(this.draggedElement));\n requestAnimationFrame(() => this.finishOrder());\n };\n if (this.animationPromise) {\n this.animationPromise.then(() => didStop());\n } else didStop();\n },\n });\n }, 150);\n\n // reset track timer & cancel DnD on mouseup / touchend / touchmove\n addListeners(\n document,\n 'mouseup touchend touchmove',\n () => clearTimeout(this.mouseDownTimer),\n { once: true }\n );\n }\n\n /**\n * Initialized a drag and drop sequence if a child node was clicked that matches the itemSelector property.\n * OR If a handleSelector is defined, a node matching this selector must be clicked instead\n * @returns boolean - whether tracking for this event should continue or not\n */\n private trackStart(e: Event) {\n const targetElement = e.target as HTMLElement;\n let targetHandle: HTMLElement;\n\n // If we have a handle set, return now if not being pressed\n if (this.handleSelector) {\n targetHandle = targetElement.closest(this.handleSelector);\n\n if (!targetHandle) return;\n targetHandle.classList.add(this.handleDraggedClass);\n }\n\n // Check that we've found the target element via itemSelector\n const node = targetElement.closest<HTMLElement>(this.itemSelector);\n if (!node) return false;\n\n this.sortableNodes =\n Array.from(this.sortableHost.querySelectorAll(this.itemSelector)) || [];\n const nanoGrabbedEv = this.nanoGrabbed.emit({\n element: node,\n index: this.sortableNodes.indexOf(node),\n });\n if (nanoGrabbedEv.defaultPrevented) return false;\n\n // Element found... start everything\n e.preventDefault();\n this.updateUserSelectStyle('none');\n this.dragRequestPending = true;\n this.draggedElement = node;\n this.dropzoneNodes =\n Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector)) ||\n [];\n this.draggedElementClone = this.createClone(node);\n this.draggedElementOrigin = node.nextSibling as HTMLElement;\n this.animatedElements = [];\n this.draggedElement!.classList.add(this.placeholderClass);\n return true;\n }\n\n /** Ends re-ordering */\n private finishOrder = () => {\n if (!this.draggedElement) return;\n\n const updated = Array.from(\n this.sortableHost.querySelectorAll<HTMLElement>(this.itemSelector)\n ).filter((ele) => ele !== this.draggedElementClone);\n const originalIndex = this.sortableNodes.indexOf(this.draggedElement);\n const targetIndex = updated.indexOf(this.draggedElement);\n\n if (this.handleSelector) {\n const targetHandle = this.draggedElement.querySelector(\n this.handleSelector\n );\n targetHandle.classList.remove(this.handleDraggedClass);\n }\n\n if (originalIndex !== targetIndex) {\n const orderChangeEv = this.nanoOrderChange.emit({\n element: this.draggedElement,\n originalIndex,\n targetIndex,\n });\n\n if (orderChangeEv.defaultPrevented) {\n /** Event was prevented, wait a moment to send element back to whence it came - gives a nicer visual queue */\n this.animationPromise = new Promise((resolve) => {\n setTimeout(() => {\n this.insertAtTarget(this.draggedElement, updated[originalIndex]);\n this.reset();\n this.dragRequestPending = false;\n resolve();\n }, 200);\n });\n return;\n }\n this.addAriaMsg(\n this.reorderHelperText(this.draggedElement, updated, targetIndex + 1)\n );\n }\n\n this.reset();\n this.dragRequestPending = false;\n };\n\n /**\n * Moves the active node's clone to follow the pointer. The node that the clone intersects with (via hitTest) is\n * the insert point for updated sorting */\n private trackMove = (x: number, y: number) => {\n if (!this.draggedElementClone) {\n return;\n }\n\n if (this.orientation) {\n x = x * orientationMap[this.orientation].x;\n y = y * orientationMap[this.orientation].y;\n }\n\n writeTask(() => {\n Object.assign(this.draggedElementClone!.style, {\n transform: `translate3d(${x}px, ${y}px, 0)`,\n });\n });\n\n let target = this.hitTest(this.draggedElementClone!, this.sortableNodes)[0];\n let activeDropzone: HTMLElement;\n\n if (this.dropzoneSelector && this.dropzoneActiveClass) {\n readTask(() => {\n activeDropzone = this.draggedElement.closest(this.dropzoneSelector);\n\n writeTask(() => {\n this.dropzoneNodes\n .filter((dze) => dze !== activeDropzone)\n .forEach((dze) => dze.classList.remove(this.dropzoneActiveClass));\n activeDropzone.classList.add(this.dropzoneActiveClass);\n });\n });\n }\n\n // didn't find a target - let's test to see if we can use a drop-zone instead\n if (!target && this.dropzoneNodes.length) {\n target = this.hitTest(this.draggedElementClone!, this.dropzoneNodes)[0];\n if (this.draggedElement.closest(this.dropzoneSelector) === target) return;\n }\n\n if (\n // if clone intersects with a valid target,\n target &&\n // other than its own origin,\n target !== this.draggedElement &&\n // and the target isn't currently animating, which causes false hit tests,\n !this.isAnimating(target)\n ) {\n this.insertAtTarget(this.draggedElement!, target);\n }\n };\n\n /// Component lifecycle ///\n\n constructor() {\n this.handleTrack = this.handleTrack.bind(this);\n this.handleKeydown = this.handleKeydown.bind(this);\n this.refreshKeyboardHandles = this.refreshKeyboardHandles.bind(this);\n this.refreshKeyboardHandles = nanoDebounce(\n this.refreshKeyboardHandles,\n 500\n );\n }\n\n connectedCallback() {\n this.addEventHandlers();\n this.refreshKeyboardHandles();\n this.attachMutationObserver();\n\n if (Build.isBrowser && !this.host.querySelector(`#${this.sortableId}`)) {\n // inject a light-dom / a11y description that we can connect sortable items to\n this.host.insertAdjacentHTML(\n 'beforeend',\n `<div class=\"visually-hidden\" id=\"${this.sortableId}\">${this.helperText}</div>`\n );\n }\n }\n\n disconnectedCallback() {\n this.removeEventHandlers();\n this.host.querySelector(`#${this.sortableId}`)?.remove();\n\n if (this.mutationObserver) {\n this.mutationObserver.disconnect();\n this.mutationObserver = undefined;\n }\n }\n\n render() {\n return (\n <Host>\n <div\n class=\"sortable__live-region\"\n aria-live=\"polite\"\n aria-relevant=\"additions\"\n aria-atomic=\"true\"\n role=\"log\"\n part=\"announcements\"\n >\n {this.ariaTextList.map((str) => (\n <div>{str}</div>\n ))}\n </div>\n <slot />\n </Host>\n );\n }\n}\n"],"mappings":";;;qLAAA,MAAMA,EAAc,+UCqBpB,MAAMC,EAAiB,CACrBC,WAAY,CAAEC,EAAG,EAAGC,EAAG,GACvBC,SAAU,CAAEF,EAAG,EAAGC,EAAG,IAGvB,IAAIE,EAAc,E,MAkBLC,EAAQ,MAMnBC,2BACEC,KAAKC,wB,CAQPC,6BACEF,KAAKC,yBACLD,KAAKG,wB,CAoFPC,mCACEJ,KAAKC,wB,CAOPI,0BAA0BC,EAAUC,GAClC,GAAIA,EAAQP,KAAKQ,oBAAoBD,GAErCP,KAAKS,mBACLT,KAAKC,yBACLD,KAAKG,yBAEL,GAAIH,KAAKU,oBAAqB,CAE5BV,KAAKU,oBAAoBC,MAAMC,SAAW,U,EA+C9CC,+B,UAC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ASqM,EAAIlG,SAAS,GAC5BgG,EAAS1H,OAAOzE,GAChB,OAAOA,CAAM,E,yDAyBY,K,kBAGJ,yB,wBAGM,gC,sBAGF,6B,yBAGY,G,qBAGR,CAAEyM,SAAU,IAAKC,OAAQ,Y,2CAQnC,M,wBAuES,M,kBACI,GAsnBhChO,KAAKsI,YAActI,KAAKsI,YAAY2F,KAAKjO,MACzCA,KAAKuI,cAAgBvI,KAAKuI,cAAc0F,KAAKjO,MAC7CA,KAAKC,uBAAyBD,KAAKC,uBAAuBgO,KAAKjO,MAC/DA,KAAKC,uBAAyBiO,EAC5BlO,KAAKC,uBACL,I,CAIJkO,oBACEnO,KAAKS,mBACLT,KAAKC,yBACLD,KAAKG,yBAEL,IAAwBH,KAAKuC,KAAKsK,cAAc,IAAI7M,KAAKyB,cAAe,CAEtEzB,KAAKuC,KAAK6L,mBACR,YACA,oCAAoCpO,KAAKyB,eAAezB,KAAKqO,mB,EAKnEC,uB,MACEtO,KAAKQ,uBACLO,EAAAf,KAAKuC,KAAKsK,cAAc,IAAI7M,KAAKyB,iBAAa,MAAAV,SAAA,SAAAA,EAAEkB,SAEhD,GAAIjC,KAAK0I,iBAAkB,CACzB1I,KAAK0I,iBAAiBC,aACtB3I,KAAK0I,iBAAmBjC,S,EAI5B8H,SACE,OACEzK,EAAC0K,EAAI,KACH1K,EAAA,OACE2K,MAAM,wBAAuB,YACnB,SAAQ,gBACJ,YAAW,cACb,OACZC,KAAK,MACLC,KAAK,iBAEJ3O,KAAK0C,aAAagD,KAAKkJ,GACtB9K,EAAA,WAAM8K,MAGV9K,EAAA,a"}
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Web Components for Nanopore digital Web Apps
3
+ */
4
+ import{r as t,c as i,w as s,h as e,a as h,g as n}from"./p-f6a8467a.js";import{C as l}from"./p-653ae985.js";import{W as r}from"./p-60a8c896.js";import"./p-7bff5224.js";const o=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{display:none}:host ::slotted([slot=filter-template]){display:none !important}:host(.show-filter){display:block}";const a=class{constructor(s){t(this,s);this.nanoFilterChanged=i(this,"nanoFilterChanged",7);this.nanoTplUpdated=i(this,"nanoTplUpdated",7);this.filterId=null;this.tplWillRnder=new Promise((t=>{this.tplDidRnder=t}));this.changeEvent=undefined;this.internalValue=[undefined];this.showFilter=false;this.indexResults=null;this.filterChanged=null;this.facets=undefined;this.tplRenderFn=undefined;this.globalStoreMethod=undefined;this.filterName=null;this.value="";this.operator="or";this.storeId=undefined;this.storeMethod="session"}valueSet(){const t=this.value;let i;if(typeof t==="string")i=t.length?t.split("|"):[];else i=this.value;if(this.didValueChange(i)){const t=this.setFieldValues(i);if(t&&t.length)this.internalValue=i;else{this.tplWillRnder.then((t=>{this.setFieldValues(i);this.internalValue=i}))}}}valueChanged(){this.value=this.internalValue;this.nanoFilterChanged.emit({filterId:this.filterId,facetName:this.filterName,value:this.internalValue,operator:this.operator})}appliedFilterChanged(){if(this.filterName&&this.filterChanged&&(this.filterChanged!==this.filterId||this.operator==="and")){this.updateContent()}}tplUpdate(){this.updateContent()}handleFilterChange(){if(this.indexResults&&this.indexResults.appliedFilters){const t=this.indexResults.appliedFilters.find((t=>t.name===this.filterName));if(!t)return;this.tplWillRnder.then((i=>{const s=this.setFieldValues(t.values);if(s&&s.length)this.value=s}))}this.updateContent()}handleChangeEvent(){const t=this.getFieldValues();if(this.didValueChange(t)){this.internalValue=t;return true}return false}updateContent(){const t=this.outputSlot||this.outputEle;if(!this.el)return;if(!this.templateStr)this.showFilter=true;else if(!this.filterName||!t||this.templateStr&&(!this.indexResults||!this.indexResults.origFilters[this.filterName])){this.showFilter=false}if(!t)return;if(!this.indexResults){if(this.templateStr){s((()=>{t.innerHTML=this.tplRenderFn(this.templateStr,{orig:{},dyn:{},selected:this.internalValue&&this.internalValue.length?this.internalValue:this.value});if(!this.value||!this.value.length)this.handleChangeEvent()}))}else if(!this.value||!this.value.length)this.handleChangeEvent();return}s((()=>{t.innerHTML=this.tplRenderFn(this.templateStr,{orig:Object.assign({},this.indexResults.origFilters[this.filterName]),dyn:Object.assign({},this.indexResults.dynFilters[this.filterName]),selected:this.internalValue&&this.internalValue.length?this.internalValue:this.value});this.tplDidRnder();this.setFieldValues();if(!this.showFilter)this.showFilter=true;this.nanoTplUpdated.emit(this.el)}))}getFieldValues(){const t=[];const i=this.outputSlot.querySelectorAll('input[type="checkbox"], input[type="radio"], select');for(let s=0;s<i.length;s++){const e=i[s];if(e.type==="select-multiple"){const i=e;for(let s=0;s<i.options.length;s++){if(!i.options[s].selected||!i.options[s].value.length)continue;t.push(i.options[s].value)}}else if(e.type!=="checkbox"&&e.type!=="radio"||e.checked&&e.value.length){t.push(e.value)}}return t}setFieldValues(t){t=t||this.internalValue;if(!t)return;const i=[];const s=this.outputSlot.querySelectorAll('input[type="checkbox"], input[type="radio"], select, nano-select, nano-checkbox');for(let e=0;e<s.length;e++){const h=s[e];if(h.disabled||h.type==="file"||h.type==="reset"||h.type==="submit"||h.type==="button")continue;if(h.type==="select-multiple"||h.type==="select-one"){const s=h;for(let e=0;e<s.options.length;e++){if(!t.includes(s.options[e].value))s.options[e].selected=false;else{i.push(s.value);s.options[e].selected=true;if(h.type==="select-one")s.value=s.options[e].value}}}else if(["checkbox","radio","tag","segment","segment-pill"].includes(h.type)){if(t.includes(h.value)){i.push(h.value);h.checked=true}else if(!t.length&&!h.value.length){h.checked=true}else h.checked=false}}return i}didValueChange(t){if(!!this.internalValue&&!t)return true;if(!this.internalValue&&!t)return false;if(this.internalValue&&t.length!==this.internalValue.length)return true;let i=false;for(let s=0;s<t.length;s++){if(!i&&(!this.internalValue||!this.internalValue.includes(t[s])))i=true}return i}connectedCallback(){this.templateSlot=this.el.querySelector('[slot="filter-template"]');this.outputSlot=this.el.querySelector('[slot="output"]');this.filterId=this.filterName+"_"+f++;if(!!this.templateSlot){this.templateStr=this.templateSlot.innerHTML;this.templateStr=this.templateStr.replace(/=&gt;/gm,"=>")}}componentWillLoad(){if(this.storeId)l.init(this,["value"],this.storeMethod||this.globalStoreMethod,this.storeId)}componentDidLoad(){this.updateContent();if(this.templateStr&&this.filterName&&this.indexResults&&this.indexResults.origFilters[this.filterName])this.showFilter=true}render(){return e(h,{class:{"show-filter":this.showFilter}},e("div",{ref:t=>this.outputEle=t},e("slot",{name:"output"})))}get el(){return n(this)}static get watchers(){return{value:["valueSet"],internalValue:["valueChanged"],facets:["appliedFilterChanged"],tplRenderFn:["tplUpdate"],indexResults:["handleFilterChange"]}}};r(a,["globalStoreMethod","indexResults","filterChanged","facets","tplRenderFn","changeEvent"]);let f=0;a.style=o;export{a as nano_algolia_filter};
5
+ //# sourceMappingURL=p-27422aa9.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["algoliaFilterCss","AlgoliaFilter","this","filterId","tplWillRnder","Promise","resolve","tplDidRnder","undefined","valueSet","valStr","value","vals","length","split","didValueChange","foundVals","setFieldValues","internalValue","then","_","valueChanged","nanoFilterChanged","emit","facetName","filterName","operator","appliedFilterChanged","filterChanged","updateContent","tplUpdate","handleFilterChange","indexResults","appliedFilters","foundValue","find","filter","name","values","handleChangeEvent","getFieldValues","outputTo","outputSlot","outputEle","el","templateStr","showFilter","origFilters","writeTask","innerHTML","tplRenderFn","orig","dyn","selected","Object","assign","dynFilters","nanoTplUpdated","fields","querySelectorAll","i","field","type","select","n","options","push","checked","found","disabled","includes","newVal","hasChanged","connectedCallback","templateSlot","querySelector","filterIds","replace","componentWillLoad","storeId","ComponentStore","init","storeMethod","globalStoreMethod","componentDidLoad","render","h","Host","class","ref","div","Wormhole"],"sources":["./src/components/algolia/algolia-filter.scss?tag=nano-algolia-filter&encapsulation=shadow","./src/components/algolia/algolia-filter.tsx"],"sourcesContent":[":host {\n display: none;\n\n ::slotted([slot='filter-template']) {\n display: none !important;\n }\n}\n\n:host(.show-filter) {\n display: block;\n}\n","import {\n Component,\n h,\n Element,\n Host,\n Prop,\n Watch,\n State,\n EventEmitter,\n Event,\n writeTask,\n Listen,\n} from '@stencil/core';\nimport {\n ComponentStore,\n StorageMethods,\n} from '../../utils/store/component-store';\nimport {\n SearchChangeEvent,\n Wormhole,\n WormholeConsumerConstructor,\n} from '../algolia/algolia-data';\nimport type {\n IndexResult,\n FilterChangeEventDetail,\n AlgoliaFacet,\n} from '../../interface';\n\n/**\n * Displays and syncs algolia filters\n * Must be nested within an nano-algolia component.\n * @slot filter-template - Template string (format from nano-algolia 'tplEngine' property).\n * @slot output - A placeholder for template output.\n */\n@Component({\n tag: 'nano-algolia-filter',\n shadow: true,\n styleUrl: 'algolia-filter.scss',\n})\nexport class AlgoliaFilter {\n @Element() el: HTMLNanoAlgoliaFilterElement;\n\n private templateStr: string;\n private templateSlot: HTMLElement;\n private outputSlot: HTMLElement;\n private outputEle: HTMLElement;\n private filterId: string = null;\n private tplDidRnder;\n private tplWillRnder = new Promise((resolve) => {\n this.tplDidRnder = resolve;\n });\n\n @State() changeEvent: SearchChangeEvent;\n @State() internalValue: Array<string> = [undefined];\n @State() showFilter: boolean = false;\n @State() indexResults: IndexResult = null;\n @State() filterChanged: string = null;\n @State() facets: AlgoliaFacet;\n @State() tplRenderFn: (...args: any[]) => string;\n @State() globalStoreMethod: StorageMethods;\n\n /**\n * Name of this filter - must match an appropriate algolia facet on a parent nano-algolia index to display\n */\n @Prop() filterName: string = null;\n\n /**\n * Set values of this filter. Will result in form elements being selected. '|' delimited string or array.\n */\n @Prop({ mutable: true }) value: string | Array<string> = '';\n\n /**\n * The internal operator joining filter values.\n */\n @Prop() operator: 'or' | 'and' = 'or';\n\n /**\n * Store search queries (against this ID) to the component store.\n * Use in conjunction with storeMethod\n */\n @Prop() storeId?: string;\n\n /**\n * The method of storage.\n * Either session storage, url hash (after the '#') or url query (after the '?').\n */\n @Prop() storeMethod: StorageMethods = 'session';\n\n /**\n * Emitted when the filter value changes\n */\n @Event() nanoFilterChanged!: EventEmitter<FilterChangeEventDetail>;\n\n /**\n * Emitted when templates are updated\n */\n @Event() nanoTplUpdated!: EventEmitter<HTMLNanoAlgoliaFilterElement>;\n\n // Public facing. When changed attempts to 'check' any relevant fields in the template.\n @Watch('value')\n valueSet() {\n const valStr = this.value as string;\n let vals;\n\n if (typeof valStr === 'string')\n vals = valStr.length ? valStr.split('|') : [];\n else vals = this.value as Array<string>;\n\n if (this.didValueChange(vals)) {\n const foundVals = this.setFieldValues(vals);\n // found in template, set the internal state (this emits the changed event)\n if (foundVals && foundVals.length) this.internalValue = vals;\n // not found in template, wait for it to render.\n else {\n this.tplWillRnder.then((_) => {\n this.setFieldValues(vals);\n this.internalValue = vals;\n });\n }\n }\n }\n\n // Value has changed and is reflected in template. Emit event.\n @Watch('internalValue')\n valueChanged() {\n this.value = this.internalValue;\n this.nanoFilterChanged.emit({\n filterId: this.filterId,\n facetName: this.filterName,\n value: this.internalValue,\n operator: this.operator,\n });\n }\n\n // New facets from algolia. Update template\n @Watch('facets')\n appliedFilterChanged() {\n if (\n this.filterName &&\n this.filterChanged &&\n (this.filterChanged !== this.filterId || this.operator === 'and')\n ) {\n this.updateContent();\n }\n }\n\n @Watch('tplRenderFn')\n tplUpdate() {\n this.updateContent();\n }\n\n @Watch('indexResults')\n handleFilterChange() {\n if (this.indexResults && this.indexResults.appliedFilters) {\n const foundValue = this.indexResults.appliedFilters.find(\n (filter) => filter.name === this.filterName\n );\n if (!foundValue) return;\n\n this.tplWillRnder.then((_) => {\n const foundVals = this.setFieldValues(foundValue.values);\n if (foundVals && foundVals.length) this.value = foundVals;\n });\n }\n this.updateContent();\n }\n\n @Listen('nanoChange')\n @Listen('change')\n handleChangeEvent() {\n const vals = this.getFieldValues();\n if (this.didValueChange(vals)) {\n this.internalValue = vals;\n return true;\n }\n return false;\n }\n\n private updateContent() {\n const outputTo = this.outputSlot || this.outputEle;\n if (!this.el) return;\n\n // there's no template so show output right away\n if (!this.templateStr) this.showFilter = true;\n // there's a template but no index set so hide filters atm\n else if (\n !this.filterName ||\n !outputTo ||\n (this.templateStr &&\n (!this.indexResults || !this.indexResults.origFilters[this.filterName]))\n ) {\n this.showFilter = false;\n }\n\n // there's no output element so nothing else to do\n if (!outputTo) return;\n\n // there's no index set atm but get any static filter values so we can apply them\n if (!this.indexResults) {\n if (this.templateStr) {\n writeTask(() => {\n outputTo.innerHTML = this.tplRenderFn(this.templateStr, {\n orig: {},\n dyn: {},\n selected:\n this.internalValue && this.internalValue.length\n ? this.internalValue\n : this.value,\n });\n if (!this.value || !this.value.length) this.handleChangeEvent();\n });\n } else if (!this.value || !this.value.length) this.handleChangeEvent();\n return;\n }\n\n // everything is in place - render as normal and set values\n writeTask(() => {\n outputTo.innerHTML = this.tplRenderFn(this.templateStr, {\n orig: { ...this.indexResults.origFilters[this.filterName] },\n dyn: { ...this.indexResults.dynFilters[this.filterName] },\n selected:\n this.internalValue && this.internalValue.length\n ? this.internalValue\n : this.value,\n });\n this.tplDidRnder();\n this.setFieldValues();\n\n if (!this.showFilter) this.showFilter = true;\n this.nanoTplUpdated.emit(this.el);\n });\n }\n\n // go through form elements and extract their current value\n private getFieldValues() {\n const values = [];\n const fields = this.outputSlot.querySelectorAll(\n 'input[type=\"checkbox\"], input[type=\"radio\"], select'\n );\n\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i] as HTMLInputElement;\n\n // If a multi-select, get all selections\n if (field.type === 'select-multiple') {\n const select: HTMLSelectElement = field as any;\n for (let n = 0; n < select.options.length; n++) {\n if (!select.options[n].selected || !select.options[n].value.length)\n continue;\n values.push(select.options[n].value);\n }\n } else if (\n (field.type !== 'checkbox' && field.type !== 'radio') ||\n (field.checked && field.value.length)\n ) {\n values.push(field.value);\n }\n }\n return values;\n }\n\n // go through form elements and select / check them as appropriate\n private setFieldValues(vals?: string[]): void | string[] {\n vals = vals || this.internalValue;\n if (!vals) return;\n\n const found = [];\n const fields = this.outputSlot.querySelectorAll(\n 'input[type=\"checkbox\"], input[type=\"radio\"], select, nano-select, nano-checkbox'\n );\n\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i] as HTMLInputElement;\n\n if (\n field.disabled ||\n field.type === 'file' ||\n field.type === 'reset' ||\n field.type === 'submit' ||\n field.type === 'button'\n )\n continue;\n\n if (field.type === 'select-multiple' || field.type === 'select-one') {\n const select: HTMLSelectElement = field as any;\n for (let n = 0; n < select.options.length; n++) {\n if (!vals.includes(select.options[n].value))\n select.options[n].selected = false;\n else {\n found.push(select.value);\n select.options[n].selected = true;\n if (field.type === 'select-one')\n select.value = select.options[n].value;\n }\n }\n } else if (\n ['checkbox', 'radio', 'tag', 'segment', 'segment-pill'].includes(\n field.type\n )\n ) {\n if (vals.includes(field.value)) {\n found.push(field.value);\n field.checked = true;\n } else if (!vals.length && !field.value.length) {\n field.checked = true;\n } else field.checked = false;\n }\n }\n return found;\n }\n\n private didValueChange(newVal: Array<string>) {\n if (!!this.internalValue && !newVal) return true;\n if (!this.internalValue && !newVal) return false;\n if (this.internalValue && newVal.length !== this.internalValue.length)\n return true;\n\n let hasChanged = false;\n for (let i = 0; i < newVal.length; i++) {\n if (\n !hasChanged &&\n (!this.internalValue || !this.internalValue.includes(newVal[i]))\n )\n hasChanged = true;\n }\n return hasChanged;\n }\n\n connectedCallback() {\n this.templateSlot = this.el.querySelector('[slot=\"filter-template\"]');\n this.outputSlot = this.el.querySelector('[slot=\"output\"]');\n this.filterId = this.filterName + '_' + filterIds++;\n\n if (!!this.templateSlot) {\n this.templateStr = this.templateSlot.innerHTML;\n this.templateStr = this.templateStr.replace(/=&gt;/gm, '=>');\n }\n }\n\n componentWillLoad() {\n if (this.storeId)\n ComponentStore.init(\n this,\n ['value'],\n this.storeMethod || this.globalStoreMethod,\n this.storeId\n );\n }\n\n componentDidLoad() {\n this.updateContent();\n\n if (\n this.templateStr &&\n this.filterName &&\n this.indexResults &&\n this.indexResults.origFilters[this.filterName]\n )\n this.showFilter = true;\n }\n\n render() {\n return (\n <Host\n class={{\n 'show-filter': this.showFilter,\n }}\n >\n <div ref={(div) => (this.outputEle = div)}>\n <slot name=\"output\" />\n </div>\n </Host>\n );\n }\n}\n\nWormhole(AlgoliaFilter as WormholeConsumerConstructor, [\n 'globalStoreMethod',\n 'indexResults',\n 'filterChanged',\n 'facets',\n 'tplRenderFn',\n 'changeEvent',\n]);\nlet filterIds = 0;\n"],"mappings":";;;+LAAA,MAAMA,EAAmB,gO,MCuCZC,EAAa,M,6HAOhBC,KAAAC,SAAmB,KAEnBD,KAAAE,aAAe,IAAIC,SAASC,IAClCJ,KAAKK,YAAcD,CAAO,I,8CAIY,CAACE,W,gBACV,M,kBACM,K,mBACJ,K,kGAQJ,K,WAK4B,G,cAKxB,K,wCAYK,S,CActCC,WACE,MAAMC,EAASR,KAAKS,MACpB,IAAIC,EAEJ,UAAWF,IAAW,SACpBE,EAAOF,EAAOG,OAASH,EAAOI,MAAM,KAAO,QACxCF,EAAOV,KAAKS,MAEjB,GAAIT,KAAKa,eAAeH,GAAO,CAC7B,MAAMI,EAAYd,KAAKe,eAAeL,GAEtC,GAAII,GAAaA,EAAUH,OAAQX,KAAKgB,cAAgBN,MAEnD,CACHV,KAAKE,aAAae,MAAMC,IACtBlB,KAAKe,eAAeL,GACpBV,KAAKgB,cAAgBN,CAAI,G,GAQjCS,eACEnB,KAAKS,MAAQT,KAAKgB,cAClBhB,KAAKoB,kBAAkBC,KAAK,CAC1BpB,SAAUD,KAAKC,SACfqB,UAAWtB,KAAKuB,WAChBd,MAAOT,KAAKgB,cACZQ,SAAUxB,KAAKwB,U,CAMnBC,uBACE,GACEzB,KAAKuB,YACLvB,KAAK0B,gBACJ1B,KAAK0B,gBAAkB1B,KAAKC,UAAYD,KAAKwB,WAAa,OAC3D,CACAxB,KAAK2B,e,EAKTC,YACE5B,KAAK2B,e,CAIPE,qBACE,GAAI7B,KAAK8B,cAAgB9B,KAAK8B,aAAaC,eAAgB,CACzD,MAAMC,EAAahC,KAAK8B,aAAaC,eAAeE,MACjDC,GAAWA,EAAOC,OAASnC,KAAKuB,aAEnC,IAAKS,EAAY,OAEjBhC,KAAKE,aA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,KAAKuB,YACLvB,KAAK8B,cACL9B,KAAK8B,aAAae,YAAY7C,KAAKuB,YAEnCvB,KAAK4C,WAAa,I,CAGtBuC,SACE,OACEC,EAACC,EAAI,CACHC,MAAO,CACL,cAAetF,KAAK4C,aAGtBwC,EAAA,OAAKG,IAAMC,GAASxF,KAAKyC,UAAY+C,GACnCJ,EAAA,QAAMjD,KAAK,Y,yMAOrBsD,EAAS1F,EAA8C,CACrD,oBACA,eACA,gBACA,SACA,cACA,gBAEF,IAAI2E,EAAY,E"}
1
+ {"version":3,"names":["algoliaFilterCss","AlgoliaFilter","this","filterId","tplWillRnder","Promise","resolve","tplDidRnder","undefined","valueSet","valStr","value","vals","length","split","didValueChange","foundVals","setFieldValues","internalValue","then","_","valueChanged","nanoFilterChanged","emit","facetName","filterName","operator","appliedFilterChanged","filterChanged","updateContent","tplUpdate","handleFilterChange","indexResults","appliedFilters","foundValue","find","filter","name","values","handleChangeEvent","getFieldValues","outputTo","outputSlot","outputEle","el","templateStr","showFilter","origFilters","writeTask","innerHTML","tplRenderFn","orig","dyn","selected","Object","assign","dynFilters","nanoTplUpdated","fields","querySelectorAll","i","field","type","select","n","options","push","checked","found","disabled","includes","newVal","hasChanged","connectedCallback","templateSlot","querySelector","filterIds","replace","componentWillLoad","storeId","ComponentStore","init","storeMethod","globalStoreMethod","componentDidLoad","render","h","Host","class","ref","div","Wormhole"],"sources":["./src/components/algolia/algolia-filter.scss?tag=nano-algolia-filter&encapsulation=shadow","./src/components/algolia/algolia-filter.tsx"],"sourcesContent":[":host {\n display: none;\n\n ::slotted([slot='filter-template']) {\n display: none !important;\n }\n}\n\n:host(.show-filter) {\n display: block;\n}\n","import {\n Component,\n h,\n Element,\n Host,\n Prop,\n Watch,\n State,\n EventEmitter,\n Event,\n writeTask,\n Listen,\n} from '@stencil/core';\nimport {\n ComponentStore,\n StorageMethods,\n} from '../../utils/store/component-store';\nimport {\n SearchChangeEvent,\n Wormhole,\n WormholeConsumerConstructor,\n} from '../algolia/algolia-data';\nimport type {\n IndexResult,\n FilterChangeEventDetail,\n AlgoliaFacet,\n} from '../../interface';\n\n/**\n * Displays and syncs algolia filters\n * Must be nested within an nano-algolia component.\n * @slot filter-template - Template string (format from nano-algolia 'tplEngine' property).\n * @slot output - A placeholder for template output.\n */\n@Component({\n tag: 'nano-algolia-filter',\n shadow: true,\n styleUrl: 'algolia-filter.scss',\n})\nexport class AlgoliaFilter {\n @Element() el: HTMLNanoAlgoliaFilterElement;\n\n private templateStr: string;\n private templateSlot: HTMLElement;\n private outputSlot: HTMLElement;\n private outputEle: HTMLElement;\n private filterId: string = null;\n private tplDidRnder;\n private tplWillRnder = new Promise((resolve) => {\n this.tplDidRnder = resolve;\n });\n\n @State() changeEvent: SearchChangeEvent;\n @State() internalValue: Array<string> = [undefined];\n @State() showFilter: boolean = false;\n @State() indexResults: IndexResult = null;\n @State() filterChanged: string = null;\n @State() facets: AlgoliaFacet;\n @State() tplRenderFn: (...args: any[]) => string;\n @State() globalStoreMethod: StorageMethods;\n\n /**\n * Name of this filter - must match an appropriate algolia facet on a parent nano-algolia index to display\n */\n @Prop() filterName: string = null;\n\n /**\n * Set values of this filter. Will result in form elements being selected. '|' delimited string or array.\n */\n @Prop({ mutable: true }) value: string | Array<string> = '';\n\n /**\n * The internal operator joining filter values.\n */\n @Prop() operator: 'or' | 'and' = 'or';\n\n /**\n * Store search queries (against this ID) to the component store.\n * Use in conjunction with storeMethod\n */\n @Prop() storeId?: string;\n\n /**\n * The method of storage.\n * Either session storage, url hash (after the '#') or url query (after the '?').\n */\n @Prop() storeMethod: StorageMethods = 'session';\n\n /**\n * Emitted when the filter value changes\n */\n @Event() nanoFilterChanged!: EventEmitter<FilterChangeEventDetail>;\n\n /**\n * Emitted when templates are updated\n */\n @Event() nanoTplUpdated!: EventEmitter<HTMLNanoAlgoliaFilterElement>;\n\n // Public facing. When changed attempts to 'check' any relevant fields in the template.\n @Watch('value')\n valueSet() {\n const valStr = this.value as string;\n let vals;\n\n if (typeof valStr === 'string')\n vals = valStr.length ? valStr.split('|') : [];\n else vals = this.value as Array<string>;\n\n if (this.didValueChange(vals)) {\n const foundVals = this.setFieldValues(vals);\n // found in template, set the internal state (this emits the changed event)\n if (foundVals && foundVals.length) this.internalValue = vals;\n // not found in template, wait for it to render.\n else {\n this.tplWillRnder.then((_) => {\n this.setFieldValues(vals);\n this.internalValue = vals;\n });\n }\n }\n }\n\n // Value has changed and is reflected in template. Emit event.\n @Watch('internalValue')\n valueChanged() {\n this.value = this.internalValue;\n this.nanoFilterChanged.emit({\n filterId: this.filterId,\n facetName: this.filterName,\n value: this.internalValue,\n operator: this.operator,\n });\n }\n\n // New facets from algolia. Update template\n @Watch('facets')\n appliedFilterChanged() {\n if (\n this.filterName &&\n this.filterChanged &&\n (this.filterChanged !== this.filterId || this.operator === 'and')\n ) {\n this.updateContent();\n }\n }\n\n @Watch('tplRenderFn')\n tplUpdate() {\n this.updateContent();\n }\n\n @Watch('indexResults')\n handleFilterChange() {\n if (this.indexResults && this.indexResults.appliedFilters) {\n const foundValue = this.indexResults.appliedFilters.find(\n (filter) => filter.name === this.filterName\n );\n if (!foundValue) return;\n\n this.tplWillRnder.then((_) => {\n const foundVals = this.setFieldValues(foundValue.values);\n if (foundVals && foundVals.length) this.value = foundVals;\n });\n }\n this.updateContent();\n }\n\n @Listen('nanoChange')\n @Listen('change')\n handleChangeEvent() {\n const vals = this.getFieldValues();\n if (this.didValueChange(vals)) {\n this.internalValue = vals;\n return true;\n }\n return false;\n }\n\n private updateContent() {\n const outputTo = this.outputSlot || this.outputEle;\n if (!this.el) return;\n\n // there's no template so show output right away\n if (!this.templateStr) this.showFilter = true;\n // there's a template but no index set so hide filters atm\n else if (\n !this.filterName ||\n !outputTo ||\n (this.templateStr &&\n (!this.indexResults || !this.indexResults.origFilters[this.filterName]))\n ) {\n this.showFilter = false;\n }\n\n // there's no output element so nothing else to do\n if (!outputTo) return;\n\n // there's no index set atm but get any static filter values so we can apply them\n if (!this.indexResults) {\n if (this.templateStr) {\n writeTask(() => {\n outputTo.innerHTML = this.tplRenderFn(this.templateStr, {\n orig: {},\n dyn: {},\n selected:\n this.internalValue && this.internalValue.length\n ? this.internalValue\n : this.value,\n });\n if (!this.value || !this.value.length) this.handleChangeEvent();\n });\n } else if (!this.value || !this.value.length) this.handleChangeEvent();\n return;\n }\n\n // everything is in place - render as normal and set values\n writeTask(() => {\n outputTo.innerHTML = this.tplRenderFn(this.templateStr, {\n orig: { ...this.indexResults.origFilters[this.filterName] },\n dyn: { ...this.indexResults.dynFilters[this.filterName] },\n selected:\n this.internalValue && this.internalValue.length\n ? this.internalValue\n : this.value,\n });\n this.tplDidRnder();\n this.setFieldValues();\n\n if (!this.showFilter) this.showFilter = true;\n this.nanoTplUpdated.emit(this.el);\n });\n }\n\n // go through form elements and extract their current value\n private getFieldValues() {\n const values = [];\n const fields = this.outputSlot.querySelectorAll(\n 'input[type=\"checkbox\"], input[type=\"radio\"], select'\n );\n\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i] as HTMLInputElement;\n\n // If a multi-select, get all selections\n if (field.type === 'select-multiple') {\n const select: HTMLSelectElement = field as any;\n for (let n = 0; n < select.options.length; n++) {\n if (!select.options[n].selected || !select.options[n].value.length)\n continue;\n values.push(select.options[n].value);\n }\n } else if (\n (field.type !== 'checkbox' && field.type !== 'radio') ||\n (field.checked && field.value.length)\n ) {\n values.push(field.value);\n }\n }\n return values;\n }\n\n // go through form elements and select / check them as appropriate\n private setFieldValues(vals?: string[]): void | string[] {\n vals = vals || this.internalValue;\n if (!vals) return;\n\n const found = [];\n const fields = this.outputSlot.querySelectorAll(\n 'input[type=\"checkbox\"], input[type=\"radio\"], select, nano-select, nano-checkbox'\n );\n\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i] as HTMLInputElement;\n\n if (\n field.disabled ||\n field.type === 'file' ||\n field.type === 'reset' ||\n field.type === 'submit' ||\n field.type === 'button'\n )\n continue;\n\n if (field.type === 'select-multiple' || field.type === 'select-one') {\n const select: HTMLSelectElement = field as any;\n for (let n = 0; n < select.options.length; n++) {\n if (!vals.includes(select.options[n].value))\n select.options[n].selected = false;\n else {\n found.push(select.value);\n select.options[n].selected = true;\n if (field.type === 'select-one')\n select.value = select.options[n].value;\n }\n }\n } else if (\n ['checkbox', 'radio', 'tag', 'segment', 'segment-pill'].includes(\n field.type\n )\n ) {\n if (vals.includes(field.value)) {\n found.push(field.value);\n field.checked = true;\n } else if (!vals.length && !field.value.length) {\n field.checked = true;\n } else field.checked = false;\n }\n }\n return found;\n }\n\n private didValueChange(newVal: Array<string>) {\n if (!!this.internalValue && !newVal) return true;\n if (!this.internalValue && !newVal) return false;\n if (this.internalValue && newVal.length !== this.internalValue.length)\n return true;\n\n let hasChanged = false;\n for (let i = 0; i < newVal.length; i++) {\n if (\n !hasChanged &&\n (!this.internalValue || !this.internalValue.includes(newVal[i]))\n )\n hasChanged = true;\n }\n return hasChanged;\n }\n\n connectedCallback() {\n this.templateSlot = this.el.querySelector('[slot=\"filter-template\"]');\n this.outputSlot = this.el.querySelector('[slot=\"output\"]');\n this.filterId = this.filterName + '_' + filterIds++;\n\n if (!!this.templateSlot) {\n this.templateStr = this.templateSlot.innerHTML;\n this.templateStr = this.templateStr.replace(/=&gt;/gm, '=>');\n }\n }\n\n componentWillLoad() {\n if (this.storeId)\n ComponentStore.init(\n this,\n ['value'],\n this.storeMethod || this.globalStoreMethod,\n this.storeId\n );\n }\n\n componentDidLoad() {\n this.updateContent();\n\n if (\n this.templateStr &&\n this.filterName &&\n this.indexResults &&\n this.indexResults.origFilters[this.filterName]\n )\n this.showFilter = true;\n }\n\n render() {\n return (\n <Host\n class={{\n 'show-filter': this.showFilter,\n }}\n >\n <div ref={(div) => (this.outputEle = div)}>\n <slot name=\"output\" />\n </div>\n </Host>\n );\n }\n}\n\nWormhole(AlgoliaFilter as WormholeConsumerConstructor, [\n 'globalStoreMethod',\n 'indexResults',\n 'filterChanged',\n 'facets',\n 'tplRenderFn',\n 'changeE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AAO,CACL,cAAetF,KAAK4C,aAGtBwC,EAAA,OAAKG,IAAMC,GAASxF,KAAKyC,UAAY+C,GACnCJ,EAAA,QAAMjD,KAAK,Y,yMAOrBsD,EAAS1F,EAA8C,CACrD,oBACA,eACA,gBACA,SACA,cACA,gBAEF,IAAI2E,EAAY,E"}
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Web Components for Nanopore digital Web Apps
3
+ */
4
+ import{c as t}from"./p-9ba81ed2.js";import"./p-f6a8467a.js";import"./p-ee045579.js";import"./p-7bff5224.js";import"./p-9ebbb814.js";const o="table.worker";const p="stencil.table.worker";const s=new URL("p-f258383d.js",import.meta.url).href;const r=new Blob(['importScripts("'+s+'")'],{type:"text/javascript"});const e=URL.createObjectURL(r);const c=t(e,o,p);URL.revokeObjectURL(e);export{c as worker,p as workerMsgId,o as workerName,s as workerPath};
5
+ //# sourceMappingURL=p-2d79f5b3.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{r as t,c as i,h as s,a as e,g as h}from"./p-f6a8467a.js";import{a as n}from"./p-257432ff.js";import{d as o}from"./p-7bff5224.js";const r=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--stuck-left:initial;--stuck-right:initial;--stuck-z-index:var(--nano-layer-index-menubar, 10);--top-hide:translateY(-110%);--bottom-hide:translateY(110%);display:block;max-inline-size:100%}:host([sticky]){position:sticky;transition:0.3s ease transform;will-change:min-block-size}:host([sticky][stuck]){inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index) !important}:host([sticky][hide][placed-top]){transform:var(--top-hide)}:host([sticky][hide][placed-bottom]){transform:var(--bottom-hide)}:host([sticky][index="1"]){z-index:calc(var(--stuck-z-index) + 1)}:host([sticky][index="2"]){z-index:calc(var(--stuck-z-index) + 2)}:host([sticky][index="3"]){z-index:calc(var(--stuck-z-index) + 3)}:host([sticky][index="4"]){z-index:calc(var(--stuck-z-index) + 4)}:host([sticky][index="5"]){z-index:calc(var(--stuck-z-index) + 5)}.sticker{display:inherit;max-inline-size:inherit;inline-size:100%}.sticker:not(.stuck){inline-size:auto !important}.sticker.sticky{transition:0.3s ease all;position:relative}:host([index="1"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 1)}:host([index="2"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 2)}:host([index="3"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 3)}:host([index="4"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 4)}:host([index="5"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 5)}.sticker.stuck{position:fixed;inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index);transform:translateY(0)}:host([placed-top]) .sticker.stuck{inset-block-start:0}:host([placed-bottom]) .sticker.stuck{inset-block-end:0}:host([placed-top]) .sticker.stuck.hide{transform:var(--top-hide)}:host([placed-bottom]) .sticker.stuck.hide{transform:var(--bottom-hide)}.sticker-content{display:flex;flex-wrap:wrap}';function a(t){return t instanceof Document?window.pageYOffset:t.scrollTop}function c(t,i){const s=i instanceof Document?document.documentElement:i;return n(t,s)}const f=class{constructor(s){t(this,s);this.nanoStuck=i(this,"nanoStuck",7);this.nanoUnstuck=i(this,"nanoUnstuck",7);this.nanoHide=i(this,"nanoHide",7);this.nanoShow=i(this,"nanoShow",7);this.isRtl=false;this.scrollPosCache=0;this.scrollPosThresholdCache=0;this.cacheOffset=0;this.pauseResizeWatcher=false;this.listenForScrollParent=false;this.positions=[];this.pauseHide=false;this.hasBootstrapped=false;this.setupParentResizeListener=()=>{if(!window["ResizeObserver"])return;if(this.parentSizeObserver){this.parentSizeObserver.disconnect();this.parentSizeObserver=undefined}this.parentSizeObserver=new ResizeObserver((t=>{for(const i of t){let t,s;if(i.contentRect.height)t=i.contentRect.height;if(i.contentRect.width)s=i.contentRect.width;if(typeof this.quietMode==="object"){if(s<this.quietMode.w||t<this.quietMode.h)this.quietModeIsOn=true;else this.quietModeIsOn=false}if(this.breakPointMin){if(s>this.breakPointMin)this.isSticky=true;else this.isSticky=false}if(this.breakPointMax){if(s<this.breakPointMax)this.isSticky=true;else this.isSticky=false}if(this.isRootSticker&&this.sticker&&this.autoResize)this.sticker.style.width=this.host.scrollWidth+"px"}}));const t=this.scrollParent instanceof Document?this.scrollParent.documentElement:this.scrollParent;if(t)this.parentSizeObserver.observe(t)};this.onStickToDisplayEvent=t=>{if(t.detail.sticker!==this.stickToEle)return;switch(t.type){case"nanoHide":this._offset=0;this.cacheOffset=this.offset;this.offset=0;if(!this.isStuck)this.moveTrigger(false);if(!this.isRootSticker&&this.quietModeIsOn){requestAnimationFrame((()=>{this.stickToEle.style.minHeight=this.stickToEleInitSize.height+(this.host.scrollHeight+(typeof this.cacheOffset==="object"?this.cacheOffset.v:this.cacheOffset))+"px";this.stickToEle.setTriggerPos(this.stickToEleInitSize.height*-1)}))}break;case"nanoShow":this._offset=this.stickToEleInitSize.height;this.offset=this.cacheOffset;this.moveTrigger(true);if(!this.isRootSticker&&this.quietModeIsOn){requestAnimationFrame((()=>{this.stickToEle.style.minHeight="";this.stickToEle.setTriggerPos(0)}))}break;case"nanoStuck":this.stickToEleInitSize=this.stickToEle.getBoundingClientRect();this._offset=this.stickToEleInitSize.height;break}};this.onStickEvent=async t=>{const i=t.detail?t.detail.sticker:null;if(!i||i.position!==this.position)return;const s=await i.getTriggerPos();if(t.type==="nanoStuck"&&i!==this.host&&i.scrollParent===this.host.scrollParent){this.stickerIndex++;if(!this.hideOnNewStickers)return;if(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top){this.multiStickerHide=true;this.stuckCounter++}}if(t.type==="nanoUnstuck"&&i!==this.host&&i.scrollParent===this.host.scrollParent){this.stickerIndex--;if(!this.hideOnNewStickers)return;if(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top){this.stuckCounter--;if(this.stuckCounter<1)this.multiStickerHide=false}}};this.onScroll=()=>{const t=a(this.scrollParent);if(t<this.scrollPosCache){if(!this.positions.includes("bottom"))this.handleScrollTo();else this.handleScrollAway(t)}if(t>this.scrollPosCache){if(!this.positions.includes("bottom"))this.handleScrollAway(t);else this.handleScrollTo()}this.scrollPosCache=t};this.isStuck=false;this.isRootSticker=true;this.hide=false;this.scrollHide=false;this.multiStickerHide=false;this.scrollingTo=false;this.quietModeIsOn=false;this.stuckCounter=0;this.stickerIndex=0;this.stickToEle=undefined;this.triggerPos=undefined;this.trigger=undefined;this._offset=0;this.autoResize=true;this.isSticky=true;this.offset=0;this.position="top";this.quietMode={h:600,w:600};this.hideOnNewStickers=true;this.breakPointMax=null;this.breakPointMin=null;this.scrollParent=undefined;this.stickTo=undefined}async isHiding(){return this.hide}async isSticking(){this.shouldStick();return this.isStuck}async setTriggerPos(t){return this._offset=t}async getTriggerPos(){return this.triggerPos}async pauseHiding(t){return this.pauseHide=t}updateTriggerOffset(){if(!this.trigger||!this.scrollParent||!this.listenForScrollParent)return;this.triggerPos=c(this.trigger,this.scrollParent)}stickerResizeListener(){if(!this.content||!window["ResizeObserver"])return;if(this.contentSizeObserver){this.contentSizeObserver.disconnect();this.contentSizeObserver=undefined}this.contentSizeObserver=new ResizeObserver((t=>{for(const i of t){if(this.pauseResizeWatcher)return;if(i.contentRect.height){if(this.position==="top")this.host.style.height=i.contentRect.height+"px";if(this.position==="bottom")this.host.style.minHeight=i.contentRect.height+"px"}}}));this.contentSizeObserver.observe(this.content)}quietModeChange(){if(this.quietMode==="on")requestAnimationFrame((()=>this.quietModeIsOn=true));else if(this.quietMode==="off")requestAnimationFrame((()=>this.quietModeIsOn=false))}setOffset(){this.trigger.setAttribute("style","");let t,i,s,e;const h=this.isRootSticker||this.stickToEle?this.sticker:this.host;if(!h)return;if(typeof this.offset==="object")({v:t,h:i}=this.offset);else t=i=this.offset;if(typeof this._offset==="object")({v:t=s,h:i=e}=this._offset);else s=e=this._offset;const n=s=>{const e=s.match(/(top|bottom)/)?t:i;o(s);h.style[s]=e+"px";if(e)this.host.style.setProperty("--hide-transform-amount",`(110% + ${e}px)`);else this.host.style.setProperty("--hide-transform-amount",null)};const o=h=>{const n=h.match(/(top|bottom)/)?t+s:i+e;this.trigger.style[h]=n*-1+"px";this.trigger.style.position="relative";this.trigger.style.height="1px"};if(this.positions.includes("start")&&this.isRtl||this.positions.includes("end")&&!this.isRtl)n("right");if(this.positions.includes("end")&&this.isRtl||this.positions.includes("start")&&!this.isRtl)n("left");if(this.positions.includes("top"))n("top");if(this.positions.includes("bottom"))n("bottom")}positionChange(){this.positions=this.position.split("-");this.setOffset()}async stuckChange(){if(this.isStuck){if(this.stickToEle){const t=this.host.children;this.slottedContent=Array.from(t);this.slottedContent.forEach((t=>{this.stickToEle.appendChild(t);t.style.order=this.stickerIndex+""}));this.nanoStuck.emit({sticker:this.stickToEle})}else this.nanoStuck.emit({sticker:this.host})}else{this.scrollHide=false;if(this.stickToEle){this.slottedContent.forEach((t=>{this.host.appendChild(t);t.style.order=""}));this.nanoUnstuck.emit({sticker:this.stickToEle})}else this.nanoUnstuck.emit({sticker:this.host})}}attachScrollListeners(){if(this.quietModeIsOn)this.scrollParent.addEventListener("scroll",this.onScroll,{passive:true,capture:false});else if(this.scrollParent){this.scrollParent.removeEventListener("scroll",this.onScroll);this.moveTrigger(true)}}handleParentEvents(t,i=null){if(!this.listenForScrollParent)return;if(i)this.manageListenersOnParent(false,i);if(this.scrollParent)this.manageListenersOnParent(!this.stickToEle)}stickToEleChange(t,i){if(this.stickToEle){this.stickToEle.addEventListener("nanoHide",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoShow",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoStuck",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoUnstuck",this.onStickToDisplayEvent)}if(i){i.removeEventListener("nanoHide",this.onStickToDisplayEvent);i.removeEventListener("nanoShow",this.onStickToDisplayEvent);i.removeEventListener("nanoStuck",this.onStickToDisplayEvent);i.removeEventListener("nanoUnstuck",this.onStickToDisplayEvent)}}stickToChange(){if(typeof this.stickTo==="string")this.stickToEle=this.scrollParent.querySelector(this.stickTo);else if(!!this.stickTo)this.stickToEle=this.stickTo;else this.stickToEle=undefined}visibilityDecisionHandler(){if(this.multiStickerHide||this.scrollHide)this.hide=true;else this.hide=false}handleHideChange(){if(this.hide)this.nanoHide.emit({sticker:this.host});else this.nanoShow.emit({sticker:this.host})}setupIO(){if(this.io){this.io.disconnect();this.io=undefined}if(!this.scrollParent||!this.hasBootstrapped||!this.trigger)return;this.isRootSticker=this.scrollParent instanceof Document;let t=this.scrollParent;if(this.scrollParent instanceof Document)t=null;this.io=new window.IntersectionObserver((t=>{if(this.pauseResizeWatcher||!this.isSticky)return;this.shouldStick(t.slice(-1)[0])}),{root:t});this.io.observe(this.trigger)}manageListenersOnParent(t,i){const s=i||this.scrollParent;if(!s)return;if(!t){try{if(this.quietModeIsOn)s.removeEventListener("scroll",this.onScroll);s.removeEventListener("nanoStuck",this.onStickEvent);s.removeEventListener("nanoUnstuck",this.onStickEvent)}catch(t){console.error("Events haven`t been added")}}else{s.addEventListener("nanoStuck",this.onStickEvent);s.addEventListener("nanoUnstuck",this.onStickEvent);if(this.quietModeIsOn)this.attachScrollListeners()}this.setupParentResizeListener()}handleScrollTo(){this.scrollPosThresholdCache=null;if(!this.scrollHide)return;if(this.scrollingTo!==true){this._offset=this.cacheOffset||this._offset}this.scrollingTo=true;this.scrollHide=false}handleScrollAway(t){if(this.scrollHide)return;if(!this.isStuck)return;if(this.scrollingTo!==false){this.cacheOffset=this._offset;this._offset=0}this.scrollingTo=false;if(!this.scrollPosThresholdCache)this.scrollPosThresholdCache=t;else if(!this.pauseHide&&Math.abs(t-this.scrollPosThresholdCache)>100)this.scrollHide=true}moveTrigger(t){if(this.positions.includes("bottom")&&!t||!this.positions.includes("bottom")&&t){this.host.parentNode.insertBefore(this.trigger,this.host)}else this.host.parentNode.insertBefore(this.trigger,this.host.nextSibling)}getScrollParent(){const t=/(auto|scroll)/;const i=(t,s)=>{if(t.parentNode===null){return s}return i(t.parentNode,s.concat([t]))};const s=(t,i)=>getComputedStyle(t,null).getPropertyValue(i);const e=t=>s(t,"overflow")+s(t,"overflow-y")+s(t,"overflow-x");const h=i=>t.test(e(i));const n=document.documentElement.getBoundingClientRect().height;const o=t=>{if(!(typeof t==="object"))return;const s=i(t,[]);return s.find((t=>h(t)&&t.getBoundingClientRect().height!==n))||document};return o(this.host)}shouldStick(t){let i;if(this.positions.includes("top")){if(!this.isRootSticker)i=c(this.trigger,this.scrollParent).top;else i=this.trigger.getBoundingClientRect().top;this.isStuck=i<-1}else if(this.positions.includes("bottom")){i=this.trigger.getBoundingClientRect().top;const s=t&&t.rootBounds?t.rootBounds:(this.scrollParent instanceof Document?document.documentElement:this.scrollParent).getBoundingClientRect();this.isStuck=i>s.height+s.top}}bootstrapGurantor(){this.hasBootstrapped=true;this.scrollParent=this.scrollParent||this.getScrollParent();this.isRootSticker=this.scrollParent instanceof Document;this.trigger=this.trigger||document.createElement("div");this.trigger.classList.add("sticker-trigger");this.positionChange();this.moveTrigger(true);this.quietModeChange();this.listenForScrollParent=true;this.handleParentEvents(true);this.stickerIndex=Array.from(this.scrollParent.querySelectorAll("nano-sticker")).filter((t=>t.position===this.position)).findIndex((t=>t===this.host));this.setOffset();this.stickerResizeListener();this.setupParentResizeListener();this.slottedContent=Array.from(this.host.children);this.slottedContent.forEach((t=>{t.style.order=this.stickerIndex+""}));this.updateTriggerOffset();this.stickToChange();this.setupIO();this.onStickToDisplayEvent=o(this.onStickToDisplayEvent,50)}connectedCallback(){this.isRtl=this.host.dir==="rtl"||this.host.ownerDocument.dir==="rtl";document.documentElement.addEventListener("nanoComponentsReady",(()=>{setTimeout((t=>this.bootstrapGurantor()),200)}));setTimeout((t=>{if(!this.hasBootstrapped)this.bootstrapGurantor()}),1e3)}disconnectedCallback(){if(this.io){this.io.disconnect();this.io=undefined}if(this.parentSizeObserver){this.parentSizeObserver.disconnect();this.parentSizeObserver=undefined}this.scrollParent=null;this.hasBootstrapped=false}render(){return s(e,{sticky:!this.isRootSticker&&!this.stickToEle&&this.isSticky,hide:this.hide&&this.isStuck,siblings:this.stuckCounter,index:this.stickerIndex,stuck:this.isStuck&&this.isSticky,"placed-bottom":this.positions.includes("bottom"),"placed-top":this.positions.includes("top"),"placed-end":this.positions.includes("end"),"placed-start":this.positions.includes("start")},s("div",{class:{sticker:true,sticky:this.isRootSticker&&this.isSticky,stuck:this.isStuck&&this.isRootSticker&&this.isSticky,hide:this.isRootSticker&&this.hide&&this.isStuck},ref:t=>this.sticker=t},s("div",{class:"sticker-content",ref:t=>this.content=t},s("slot",null))))}get host(){return h(this)}static get watchers(){return{trigger:["updateTriggerOffset"],scrollParent:["updateTriggerOffset","handleParentEvents","setupIO"],position:["stickerResizeListener","positionChange"],quietMode:["quietModeChange"],offset:["setOffset"],_offset:["setOffset"],isStuck:["stuckChange"],quietModeIsOn:["attachScrollListeners"],stickToEle:["handleParentEvents","stickToEleChange"],stickTo:["stickToChange"],multiStickerHide:["visibilityDecisionHandler"],scrollHide:["visibilityDecisionHandler"],hide:["handleHideChange"]}}};f.style=r;export{f as nano_sticker};
5
- //# sourceMappingURL=p-0697795a.entry.js.map
4
+ import{r as t,c as i,h as s,a as e,g as h}from"./p-f6a8467a.js";import{a as n}from"./p-257432ff.js";import{d as o}from"./p-7bff5224.js";const r=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--stuck-left:initial;--stuck-right:initial;--stuck-z-index:var(--nano-layer-index-menubar, 10);--top-hide:translateY(-110%);--bottom-hide:translateY(110%);display:block;max-inline-size:100%}:host([sticky]){position:sticky;transition:0.3s ease transform;will-change:min-block-size}:host([sticky][stuck]){inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index) !important}:host([sticky][hide][placed-top]){transform:var(--top-hide)}:host([sticky][hide][placed-bottom]){transform:var(--bottom-hide)}:host([sticky][index="1"]){z-index:calc(var(--stuck-z-index) + 1)}:host([sticky][index="2"]){z-index:calc(var(--stuck-z-index) + 2)}:host([sticky][index="3"]){z-index:calc(var(--stuck-z-index) + 3)}:host([sticky][index="4"]){z-index:calc(var(--stuck-z-index) + 4)}:host([sticky][index="5"]){z-index:calc(var(--stuck-z-index) + 5)}.sticker{display:inherit;max-inline-size:inherit;inline-size:100%}.sticker:not(.stuck){inline-size:auto !important}.sticker.sticky{transition:0.3s ease all;position:relative}:host([index="1"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 1)}:host([index="2"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 2)}:host([index="3"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 3)}:host([index="4"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 4)}:host([index="5"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 5)}.sticker.stuck{position:fixed;inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index);transform:translateY(0)}:host([placed-top]) .sticker.stuck{inset-block-start:0}:host([placed-bottom]) .sticker.stuck{inset-block-end:0}:host([placed-top]) .sticker.stuck.hide{transform:var(--top-hide)}:host([placed-bottom]) .sticker.stuck.hide{transform:var(--bottom-hide)}.sticker-content{display:flex;flex-wrap:wrap}';function a(t){return t instanceof Document?window.pageYOffset:t.scrollTop}function c(t,i){const s=i instanceof Document?document.documentElement:i;return n(t,s)}const f=class{constructor(s){t(this,s);this.nanoStuck=i(this,"nanoStuck",7);this.nanoUnstuck=i(this,"nanoUnstuck",7);this.nanoHide=i(this,"nanoHide",7);this.nanoShow=i(this,"nanoShow",7);this.isRtl=false;this.scrollPosCache=0;this.scrollPosThresholdCache=0;this.cacheOffset=0;this.pauseResizeWatcher=false;this.listenForScrollParent=false;this.positions=[];this.pauseHide=false;this.hasBootstrapped=false;this.setupParentResizeListener=()=>{if(!window["ResizeObserver"])return;if(this.parentSizeObserver){this.parentSizeObserver.disconnect();this.parentSizeObserver=undefined}this.parentSizeObserver=new ResizeObserver((t=>{for(const i of t){let t,s;if(i.contentRect.height)t=i.contentRect.height;if(i.contentRect.width)s=i.contentRect.width;if(typeof this.quietMode==="object"){if(s<this.quietMode.w||t<this.quietMode.h)this.quietModeIsOn=true;else this.quietModeIsOn=false}if(this.breakPointMin){if(s>this.breakPointMin)this.isSticky=true;else this.isSticky=false}if(this.breakPointMax){if(s<this.breakPointMax)this.isSticky=true;else this.isSticky=false}if(this.isRootSticker&&this.sticker&&this.autoResize)this.sticker.style.width=this.host.scrollWidth+"px"}}));const t=this.scrollParent instanceof Document?this.scrollParent.documentElement:this.scrollParent;if(t)this.parentSizeObserver.observe(t)};this.onStickToDisplayEvent=t=>{if(t.detail.sticker!==this.stickToEle)return;switch(t.type){case"nanoHide":this._offset=0;this.cacheOffset=this.offset;this.offset=0;if(!this.isStuck)this.moveTrigger(false);if(!this.isRootSticker&&this.quietModeIsOn){requestAnimationFrame((()=>{this.stickToEle.style.minHeight=this.stickToEleInitSize.height+(this.host.scrollHeight+(typeof this.cacheOffset==="object"?this.cacheOffset.v:this.cacheOffset))+"px";this.stickToEle.setTriggerPos(this.stickToEleInitSize.height*-1)}))}break;case"nanoShow":this._offset=this.stickToEleInitSize.height;this.offset=this.cacheOffset;this.moveTrigger(true);if(!this.isRootSticker&&this.quietModeIsOn){requestAnimationFrame((()=>{this.stickToEle.style.minHeight="";this.stickToEle.setTriggerPos(0)}))}break;case"nanoStuck":this.stickToEleInitSize=this.stickToEle.getBoundingClientRect();this._offset=this.stickToEleInitSize.height;break}};this.onStickEvent=async t=>{const i=t.detail?t.detail.sticker:null;if(!i||i.position!==this.position)return;const s=await i.getTriggerPos();if(t.type==="nanoStuck"&&i!==this.host&&i.scrollParent===this.host.scrollParent){this.stickerIndex++;if(!this.hideOnNewStickers)return;if(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top){this.multiStickerHide=true;this.stuckCounter++}}if(t.type==="nanoUnstuck"&&i!==this.host&&i.scrollParent===this.host.scrollParent){this.stickerIndex--;if(!this.hideOnNewStickers)return;if(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top){this.stuckCounter--;if(this.stuckCounter<1)this.multiStickerHide=false}}};this.onScroll=()=>{const t=a(this.scrollParent);if(t<this.scrollPosCache){if(!this.positions.includes("bottom"))this.handleScrollTo();else this.handleScrollAway(t)}if(t>this.scrollPosCache){if(!this.positions.includes("bottom"))this.handleScrollAway(t);else this.handleScrollTo()}this.scrollPosCache=t};this.isStuck=false;this.isRootSticker=true;this.hide=false;this.scrollHide=false;this.multiStickerHide=false;this.scrollingTo=false;this.quietModeIsOn=false;this.stuckCounter=0;this.stickerIndex=0;this.stickToEle=undefined;this.triggerPos=undefined;this.trigger=undefined;this._offset=0;this.autoResize=true;this.isSticky=true;this.offset=0;this.position="top";this.quietMode={h:600,w:600};this.hideOnNewStickers=true;this.breakPointMax=null;this.breakPointMin=null;this.scrollParent=undefined;this.stickTo=undefined}async isHiding(){return this.hide}async isSticking(){this.shouldStick();return this.isStuck}async setTriggerPos(t){return this._offset=t}async getTriggerPos(){return this.triggerPos}async pauseHiding(t){return this.pauseHide=t}updateTriggerOffset(){if(!this.trigger||!this.scrollParent||!this.listenForScrollParent)return;this.triggerPos=c(this.trigger,this.scrollParent)}stickerResizeListener(){if(!this.content||!window["ResizeObserver"])return;if(this.contentSizeObserver){this.contentSizeObserver.disconnect();this.contentSizeObserver=undefined}this.contentSizeObserver=new ResizeObserver((t=>{for(const i of t){if(this.pauseResizeWatcher)return;if(i.contentRect.height){if(this.position==="top")this.host.style.height=i.contentRect.height+"px";if(this.position==="bottom")this.host.style.minHeight=i.contentRect.height+"px"}}}));this.contentSizeObserver.observe(this.content)}quietModeChange(){if(this.quietMode==="on")requestAnimationFrame((()=>this.quietModeIsOn=true));else if(this.quietMode==="off")requestAnimationFrame((()=>this.quietModeIsOn=false))}setOffset(){this.trigger.setAttribute("style","");let t,i,s,e;const h=this.isRootSticker||this.stickToEle?this.sticker:this.host;if(!h)return;if(typeof this.offset==="object")({v:t,h:i}=this.offset);else t=i=this.offset;if(typeof this._offset==="object")({v:t=s,h:i=e}=this._offset);else s=e=this._offset;const n=s=>{const e=s.match(/(top|bottom)/)?t:i;o(s);h.style[s]=e+"px";if(e)this.host.style.setProperty("--hide-transform-amount",`(110% + ${e}px)`);else this.host.style.setProperty("--hide-transform-amount",null)};const o=h=>{const n=h.match(/(top|bottom)/)?t+s:i+e;this.trigger.style[h]=n*-1+"px";this.trigger.style.position="relative";this.trigger.style.minHeight="1px";this.trigger.style.maxHeight="1px";this.trigger.style.overflow="hidden"};if(this.positions.includes("start")&&this.isRtl||this.positions.includes("end")&&!this.isRtl)n("right");if(this.positions.includes("end")&&this.isRtl||this.positions.includes("start")&&!this.isRtl)n("left");if(this.positions.includes("top"))n("top");if(this.positions.includes("bottom"))n("bottom")}positionChange(){this.positions=this.position.split("-");this.setOffset()}async stuckChange(){if(this.isStuck){if(this.stickToEle){const t=this.host.children;this.slottedContent=Array.from(t);this.slottedContent.forEach((t=>{this.stickToEle.appendChild(t);t.style.order=this.stickerIndex+""}));this.nanoStuck.emit({sticker:this.stickToEle})}else this.nanoStuck.emit({sticker:this.host})}else{this.scrollHide=false;if(this.stickToEle){this.slottedContent.forEach((t=>{this.host.appendChild(t);t.style.order=""}));this.nanoUnstuck.emit({sticker:this.stickToEle})}else this.nanoUnstuck.emit({sticker:this.host})}}attachScrollListeners(){if(this.quietModeIsOn)this.scrollParent.addEventListener("scroll",this.onScroll,{passive:true,capture:false});else if(this.scrollParent){this.scrollParent.removeEventListener("scroll",this.onScroll);this.moveTrigger(true)}}handleParentEvents(t,i=null){if(!this.listenForScrollParent)return;if(i)this.manageListenersOnParent(false,i);if(this.scrollParent)this.manageListenersOnParent(!this.stickToEle)}stickToEleChange(t,i){if(this.stickToEle){this.stickToEle.addEventListener("nanoHide",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoShow",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoStuck",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoUnstuck",this.onStickToDisplayEvent)}if(i){i.removeEventListener("nanoHide",this.onStickToDisplayEvent);i.removeEventListener("nanoShow",this.onStickToDisplayEvent);i.removeEventListener("nanoStuck",this.onStickToDisplayEvent);i.removeEventListener("nanoUnstuck",this.onStickToDisplayEvent)}}stickToChange(){if(typeof this.stickTo==="string")this.stickToEle=this.scrollParent.querySelector(this.stickTo);else if(!!this.stickTo)this.stickToEle=this.stickTo;else this.stickToEle=undefined}visibilityDecisionHandler(){if(this.multiStickerHide||this.scrollHide)this.hide=true;else this.hide=false}handleHideChange(){if(this.hide)this.nanoHide.emit({sticker:this.host});else this.nanoShow.emit({sticker:this.host})}setupIO(){if(this.io){this.io.disconnect();this.io=undefined}if(!this.scrollParent||!this.hasBootstrapped||!this.trigger)return;this.isRootSticker=this.scrollParent instanceof Document;let t=this.scrollParent;if(this.scrollParent instanceof Document)t=null;this.io=new window.IntersectionObserver((t=>{if(this.pauseResizeWatcher||!this.isSticky)return;this.shouldStick(t.slice(-1)[0])}),{root:t});this.io.observe(this.trigger)}manageListenersOnParent(t,i){const s=i||this.scrollParent;if(!s)return;if(!t){try{if(this.quietModeIsOn)s.removeEventListener("scroll",this.onScroll);s.removeEventListener("nanoStuck",this.onStickEvent);s.removeEventListener("nanoUnstuck",this.onStickEvent)}catch(t){console.error("Events haven`t been added")}}else{s.addEventListener("nanoStuck",this.onStickEvent);s.addEventListener("nanoUnstuck",this.onStickEvent);if(this.quietModeIsOn)this.attachScrollListeners()}this.setupParentResizeListener()}handleScrollTo(){this.scrollPosThresholdCache=null;if(!this.scrollHide)return;if(this.scrollingTo!==true){this._offset=this.cacheOffset||this._offset}this.scrollingTo=true;this.scrollHide=false}handleScrollAway(t){if(this.scrollHide)return;if(!this.isStuck)return;if(this.scrollingTo!==false){this.cacheOffset=this._offset;this._offset=0}this.scrollingTo=false;if(!this.scrollPosThresholdCache)this.scrollPosThresholdCache=t;else if(!this.pauseHide&&Math.abs(t-this.scrollPosThresholdCache)>100)this.scrollHide=true}moveTrigger(t){if(this.positions.includes("bottom")&&!t||!this.positions.includes("bottom")&&t){this.host.parentNode.insertBefore(this.trigger,this.host)}else this.host.parentNode.insertBefore(this.trigger,this.host.nextSibling)}getScrollParent(){const t=/(auto|scroll)/;const i=(t,s)=>{if(t.parentNode===null){return s}return i(t.parentNode,s.concat([t]))};const s=(t,i)=>getComputedStyle(t,null).getPropertyValue(i);const e=t=>s(t,"overflow")+s(t,"overflow-y")+s(t,"overflow-x");const h=i=>t.test(e(i));const n=document.documentElement.getBoundingClientRect().height;const o=t=>{if(!(typeof t==="object"))return;const s=i(t,[]);return s.find((t=>h(t)&&t.getBoundingClientRect().height!==n))||document};return o(this.host)}shouldStick(t){let i;if(this.positions.includes("top")){if(!this.isRootSticker){i=c(this.trigger,this.scrollParent).top}else{i=this.trigger.getBoundingClientRect().top}this.isStuck=i<-1}else if(this.positions.includes("bottom")){i=this.trigger.getBoundingClientRect().top;const s=t&&t.rootBounds?t.rootBounds:(this.scrollParent instanceof Document?document.documentElement:this.scrollParent).getBoundingClientRect();this.isStuck=!t.isIntersecting||i>s.height+s.top}}bootstrapGurantor(){this.hasBootstrapped=true;this.scrollParent=this.scrollParent||this.getScrollParent();this.isRootSticker=this.scrollParent instanceof Document;this.trigger=this.trigger||document.createElement("div");this.trigger.innerHTML="&nbsp;";this.trigger.classList.add("sticker-trigger");this.positionChange();this.moveTrigger(true);this.quietModeChange();this.listenForScrollParent=true;this.handleParentEvents(true);this.stickerIndex=Array.from(this.scrollParent.querySelectorAll("nano-sticker")).filter((t=>t.position===this.position)).findIndex((t=>t===this.host));this.setOffset();this.stickerResizeListener();this.setupParentResizeListener();this.slottedContent=Array.from(this.host.children);this.slottedContent.forEach((t=>{t.style.order=this.stickerIndex+""}));this.updateTriggerOffset();this.stickToChange();this.setupIO();this.onStickToDisplayEvent=o(this.onStickToDisplayEvent,50)}connectedCallback(){this.isRtl=this.host.dir==="rtl"||this.host.ownerDocument.dir==="rtl";document.documentElement.addEventListener("nanoComponentsReady",(()=>{setTimeout((t=>this.bootstrapGurantor()),200)}));setTimeout((t=>{if(!this.hasBootstrapped)this.bootstrapGurantor()}),1e3)}disconnectedCallback(){if(this.io){this.io.disconnect();this.io=undefined}if(this.parentSizeObserver){this.parentSizeObserver.disconnect();this.parentSizeObserver=undefined}this.scrollParent=null;this.hasBootstrapped=false}render(){return s(e,{sticky:!this.isRootSticker&&!this.stickToEle&&this.isSticky,hide:this.hide&&this.isStuck,siblings:this.stuckCounter,index:this.stickerIndex,stuck:this.isStuck&&this.isSticky,"placed-bottom":this.positions.includes("bottom"),"placed-top":this.positions.includes("top"),"placed-end":this.positions.includes("end"),"placed-start":this.positions.includes("start")},s("div",{class:{sticker:true,sticky:this.isRootSticker&&this.isSticky,stuck:this.isStuck&&this.isRootSticker&&this.isSticky,hide:this.isRootSticker&&this.hide&&this.isStuck},ref:t=>this.sticker=t},s("div",{class:"sticker-content",ref:t=>this.content=t},s("slot",null))))}get host(){return h(this)}static get watchers(){return{trigger:["updateTriggerOffset"],scrollParent:["updateTriggerOffset","handleParentEvents","setupIO"],position:["stickerResizeListener","positionChange"],quietMode:["quietModeChange"],offset:["setOffset"],_offset:["setOffset"],isStuck:["stuckChange"],quietModeIsOn:["attachScrollListeners"],stickToEle:["handleParentEvents","stickToEleChange"],stickTo:["stickToChange"],multiStickerHide:["visibilityDecisionHandler"],scrollHide:["visibilityDecisionHandler"],hide:["handleHideChange"]}}};f.style=r;export{f as nano_sticker};
5
+ //# sourceMappingURL=p-31c23d6e.entry.js.map