@nanoporetech-digital/components 6.8.3 → 6.8.5

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 (82) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/{component-store-7427cb36.js → component-store-c2e19934.js} +16 -3
  3. package/dist/cjs/component-store-c2e19934.js.map +1 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/nano-algolia-filter.cjs.entry.js +1 -1
  6. package/dist/cjs/nano-algolia.cjs.entry.js +1 -1
  7. package/dist/cjs/nano-components.cjs.js +1 -1
  8. package/dist/cjs/nano-dialog.cjs.entry.js +1 -1
  9. package/dist/cjs/nano-drawer.cjs.entry.js +1 -1
  10. package/dist/cjs/nano-global-nav.cjs.entry.js +1 -1
  11. package/dist/cjs/nano-global-search-results.cjs.entry.js +1 -1
  12. package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nano-more-less.cjs.entry.js +6 -15
  14. package/dist/cjs/nano-more-less.cjs.entry.js.map +1 -1
  15. package/dist/cjs/nano-tab-group.cjs.entry.js +1 -1
  16. package/dist/cjs/{nano-table-649ed668.js → nano-table-0f34020f.js} +2 -2
  17. package/dist/cjs/{nano-table-649ed668.js.map → nano-table-0f34020f.js.map} +1 -1
  18. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  19. package/dist/cjs/{table.worker-ddc8bca9.js → table.worker-5cba101f.js} +2 -2
  20. package/dist/cjs/table.worker-5cba101f.js.map +1 -0
  21. package/dist/collection/components/checkbox/__tests__/__fixtures__/checkbox-templates.js +4 -4
  22. package/dist/collection/components/checkbox/__tests__/__fixtures__/checkbox-templates.js.map +1 -1
  23. package/dist/collection/components/global-search-results/global-search-results.js +1 -1
  24. package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
  25. package/dist/collection/components/more-less/more-less.js +6 -22
  26. package/dist/collection/components/more-less/more-less.js.map +1 -1
  27. package/dist/collection/utils/store/get-set.js +15 -2
  28. package/dist/collection/utils/store/get-set.js.map +1 -1
  29. package/dist/components/component-store.js +15 -2
  30. package/dist/components/component-store.js.map +1 -1
  31. package/dist/components/nano-global-search-results.js +1 -1
  32. package/dist/components/nano-global-search-results.js.map +1 -1
  33. package/dist/components/nano-more-less.js +7 -17
  34. package/dist/components/nano-more-less.js.map +1 -1
  35. package/dist/esm/{component-store-486d9d7a.js → component-store-64043183.js} +16 -3
  36. package/dist/esm/component-store-64043183.js.map +1 -0
  37. package/dist/esm/loader.js +1 -1
  38. package/dist/esm/nano-algolia-filter.entry.js +1 -1
  39. package/dist/esm/nano-algolia.entry.js +1 -1
  40. package/dist/esm/nano-components.js +1 -1
  41. package/dist/esm/nano-dialog.entry.js +1 -1
  42. package/dist/esm/nano-drawer.entry.js +1 -1
  43. package/dist/esm/nano-global-nav.entry.js +1 -1
  44. package/dist/esm/nano-global-search-results.entry.js +1 -1
  45. package/dist/esm/nano-global-search-results.entry.js.map +1 -1
  46. package/dist/esm/nano-more-less.entry.js +6 -15
  47. package/dist/esm/nano-more-less.entry.js.map +1 -1
  48. package/dist/esm/nano-tab-group.entry.js +1 -1
  49. package/dist/esm/{nano-table-cdb05d5f.js → nano-table-fc25f277.js} +2 -2
  50. package/dist/esm/{nano-table-cdb05d5f.js.map → nano-table-fc25f277.js.map} +1 -1
  51. package/dist/esm/nano-table.entry.js +1 -1
  52. package/dist/esm/{table.worker-81dca716.js → table.worker-55afec8e.js} +2 -2
  53. package/dist/esm/table.worker-55afec8e.js.map +1 -0
  54. package/dist/nano-components/component-store-64043183.js +5 -0
  55. package/dist/nano-components/component-store-64043183.js.map +1 -0
  56. package/dist/nano-components/nano-algolia-filter.entry.js +1 -1
  57. package/dist/nano-components/nano-algolia.entry.js +1 -1
  58. package/dist/nano-components/nano-components.esm.js +1 -1
  59. package/dist/nano-components/nano-components.esm.js.map +1 -1
  60. package/dist/nano-components/nano-dialog.entry.js +1 -1
  61. package/dist/nano-components/nano-drawer.entry.js +1 -1
  62. package/dist/nano-components/nano-global-nav.entry.js +1 -1
  63. package/dist/nano-components/nano-global-search-results.entry.js +1 -1
  64. package/dist/nano-components/nano-global-search-results.entry.js.map +1 -1
  65. package/dist/nano-components/nano-more-less.entry.js +1 -1
  66. package/dist/nano-components/nano-more-less.entry.js.map +1 -1
  67. package/dist/nano-components/nano-tab-group.entry.js +1 -1
  68. package/dist/nano-components/{nano-table-cdb05d5f.js → nano-table-fc25f277.js} +2 -2
  69. package/dist/nano-components/nano-table.entry.js +1 -1
  70. package/dist/nano-components/{table.worker-81dca716.js → table.worker-55afec8e.js} +2 -2
  71. package/dist/types/components/more-less/more-less.d.ts +0 -2
  72. package/docs-json.json +1 -1
  73. package/hydrate/index.js +23 -20
  74. package/package.json +2 -2
  75. package/dist/cjs/component-store-7427cb36.js.map +0 -1
  76. package/dist/cjs/table.worker-ddc8bca9.js.map +0 -1
  77. package/dist/esm/component-store-486d9d7a.js.map +0 -1
  78. package/dist/esm/table.worker-81dca716.js.map +0 -1
  79. package/dist/nano-components/component-store-486d9d7a.js +0 -5
  80. package/dist/nano-components/component-store-486d9d7a.js.map +0 -1
  81. /package/dist/nano-components/{nano-table-cdb05d5f.js.map → nano-table-fc25f277.js.map} +0 -0
  82. /package/dist/nano-components/{table.worker-81dca716.js.map → table.worker-55afec8e.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- export { T as nano_table } from './nano-table-cdb05d5f.js';
4
+ export { T as nano_table } from './nano-table-fc25f277.js';
5
5
  import './index-9695db0a.js';
6
6
  import './math-c02ddfda.js';
7
7
  import './throttle-ac4fcefa.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import { c as createWorker } from './nano-table-cdb05d5f.js';
4
+ import { c as createWorker } from './nano-table-fc25f277.js';
5
5
  import './index-9695db0a.js';
6
6
  import './math-c02ddfda.js';
7
7
  import './throttle-ac4fcefa.js';
@@ -18,4 +18,4 @@ URL.revokeObjectURL(url);
18
18
 
19
19
  export { worker, workerMsgId, workerName, workerPath };
20
20
 
21
- //# sourceMappingURL=table.worker-81dca716.js.map
21
+ //# sourceMappingURL=table.worker-55afec8e.js.map
@@ -0,0 +1 @@
1
+ {"file":"table.worker-55afec8e.js","mappings":";;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Web Components for Nanopore digital Web Apps
3
+ */
4
+ import{g as t}from"./index-9695db0a.js";import{d as e}from"./throttle-ac4fcefa.js";function s(t,e){const s=new URLSearchParams([...new URLSearchParams(t)].map((([t,e])=>[t.replace(/([[\]])/g,((t,e)=>e==="["?".":"")),e])));const n={};new Set(s.keys()).forEach((t=>{const r=s.getAll(t).join(",").split(",").map((t=>decodeURIComponent(t.replace(/\+/g," "))));const i=r.length===1?r[0]:r;let u=t;let o=e?e({firstRawValue:s.get(t).split(","),key:u,rawValue:r,value:i}):i;if(u.includes(".")){const[t,...e]=u.split(".");const s=n[t]||{};const r=e.pop();e.reduce(((t,e)=>t[e]??={}),s)[r]=o;u=t;o=s}n[u]=o}));return n}function n(t,e){if(!t)return"";const s=[["",t]];const n=new URLSearchParams;while(s.length){const[t,r]=s.pop();Object.entries(r).forEach((([r,i])=>{if(i==null&&e==null)return;const u=typeof i;const o=t?`${t}.${r}`:r;if(i!==null&&u==="object"&&!Array.isArray(i)){s.push([o,i])}else{let t=u==="string"?i:"";if(Array.isArray(i))t=i.join(",");else if(i?.toJSON)t=i.toJSON();else if(i?.toString)t=i.toString();else t=String(i);const s=e?e({flattenedKey:o,key:r,rawValue:i,value:t}):t;s!=null&&n.append(o,s)}}))}n.sort();return n.toString()}const r="nano-component-store:";const i=(t="hash",e=window)=>{if(!e||!e.location)return{};if(t==="hash"&&e.location.hash&&e.location.hash.match(/&|=/))return s(e.location.hash.replace(/^\#/,""));else if(t==="query"&&e.location.search&&e.location.search.match(/&|=/))return s(e.location.search.replace(/^\?/,""));return{}};const u=(t,e="hash",s=window,r="replace")=>{if(!s||!s.history)return;const i=e==="query"?s.location.search:s.location.hash;const u=e==="query"?s.location.pathname:s.location.pathname+s.location.search;let o=n(t);if(!o||!o.length){if(!i||!i.length)return;if(r==="replace")s.history.replaceState(null,null,u);else s.history.pushState(null,null,u);return}if(e==="hash"&&s.location.hash==="#"+o){try{document.querySelector("#"+o).focus()}catch(t){}return}o=(e==="hash"?"#":"?")+o;if(o===i)return;if(r==="replace")s.history.replaceState(null,null,u+o);else s.history.pushState(null,null,u+o)};const o=(t,e,n="hash",r=window,o="replace")=>{t=Object.keys(s(t))[0];const h={};for(const t in e){if(!e[t]||Array.isArray(e[t])&&!e[t].length){delete e[t]}}h[t]=e;let c=i(n,r);if(!c[t]&&!h[t])return;c={...c,...h};u(c,n,r,o)};const h=(t,e="hash",n=window)=>{t=Object.keys(s(t))[0];const r=i(e,n);return r[t]||null};const c=(t,e,s=window)=>{try{if(!e){s.sessionStorage.removeItem(r+t);return}s.sessionStorage.setItem(r+t,JSON.stringify(e))}catch(t){throw t}};const a=(t,e=window)=>{try{const s=e.sessionStorage.getItem(r+t);return s!==null?JSON.parse(s):null}catch(t){throw t}};const l=(t,e,s=window)=>{try{if(!e){s.localStorage.removeItem(r+t);return}s.localStorage.setItem(r+t,JSON.stringify(e))}catch(t){throw t}};const f=(t,e=window)=>{try{const s=e.localStorage.getItem(r+t);return s!==null?JSON.parse(s):null}catch(t){throw t}};const w=new Map;const d={init(e,s,n,r){const i=r||e.storeId||t(e).id;if(!i){console.error("No id set. You can only instantiate a new component store with an id. ");return}if(w.get(i)){console.error("Duplicate store id usage. A store ID must be unique!",i);return}const u=s.reduce(((t,s)=>{if(typeof e[s]!==undefined)t[s]=e[s];return t}),{});w.set(i,new p(i,e,s,u,n));const o=w.get(i);o.dispatchToProps();const h=e.connectedCallback;e.connectedCallback=function(){w.set(i,new p(i,e,s,u,n));const t=w.get(i);if(h){h.call(e)}if(t)t.dispatchToProps()};const c=e.componentDidRender;e.componentDidRender=function(){const t=w.get(i);if(c){c.call(e)}if(t)t.savePropsToStore()};const a=e.disconnectedCallback;e.disconnectedCallback=function(){const t=w.get(i);if(t)t.delete();w.delete(i);if(a){a.call(e)}}}};class p{constructor(t,s,n,r,i){this.method="session";this.initialState={};this.updateStore=true;this.onUrlChange=()=>{this.dispatchToProps(false)};this.savePropsToStore=()=>{if(this.updateStore){this.save(this.getData)}else if(!this.updateStore)this.updateStore=true};this.dispatchToProps=(t=true)=>{const e=this.retrieve();if(!e&&t)return;this.updateStore=t;this.keys.forEach((t=>{this.component[t]=e?e[t]:undefined}))};this.delete=()=>{if(this.method==="url-hash-push"||this.method==="url-query-push"){window.removeEventListener("popstate",this.onUrlChange)}};if(!t)throw new Error("No id set. You can only instantiate a new component store with an id");this.id=t;this.keys=n;this.component=s;if(r)this.initialState=r;if(i)this.method=i;this.savePropsToStore=e(this.savePropsToStore,500);if(this.method==="url-hash-push"||this.method==="url-query-push"){window.addEventListener("popstate",this.onUrlChange)}}equality(t,e){if(typeof t!==typeof e)return false;if(typeof t!=="object")return t===e;return JSON.stringify(t)===JSON.stringify(e)}get getData(){const t=this.keys.reduce(((t,e)=>{const s=this.equality(this.component[e],this.initialState[e]);if(typeof this.component[e]!=="undefined"&&!s){t[e]=this.component[e]}else if(s)delete t[e];return t}),{});return Object.keys(t).length?t:undefined}retrieve(){switch(this.method){case"url-hash":case"url-hash-push":return h(this.id,"hash");case"url-query":case"url-query-push":return h(this.id,"query");case"local":return f(this.id);default:return a(this.id)}}save(t){switch(this.method){case"url-hash":return o(this.id,t,"hash");case"url-query":return o(this.id,t,"query");case"url-hash-push":return o(this.id,t,"hash",window,"push");case"url-query-push":return o(this.id,t,"query",window,"push");case"local":return l(this.id,t);default:return c(this.id,t)}}}export{d as C};
5
+ //# sourceMappingURL=component-store-64043183.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["parse","searchParams","replacer","params","URLSearchParams","map","k","v","replace","_","s","t","Set","keys","forEach","paramKey","rawValue","getAll","join","split","n","decodeURIComponent","value","length","key","firstRawValue","get","includes","f","kl","o","l","pop","reduce","p","stringify","input","stack","sp","itemKey","itemValue","Object","entries","typeOfValue","flattenedKey","Array","isArray","push","toJSON","toString","String","vv","append","sort","STORAGE_NAME_SPACE","urlRead","from","win","window","location","hash","match","search","urlSave","object","to","method","history","oldQuery","basePath","pathname","queryStr","replaceState","pushState","document","querySelector","focus","e","urlSet","id","data","currentData","urlGet","sessionSet","sessionStorage","removeItem","setItem","JSON","sessionGet","configStr","getItem","storageSet","localStorage","storageGet","store","Map","ComponentStore","init","component","getId","storeId","getElement","console","error","initialState","acc","undefined","set","Store","componentstore","dispatchToProps","connectedCallback","call","componentDidRender","savePropsToStore","disconnectedCallback","delete","constructor","this","updateStore","onUrlChange","save","getData","savedData","retrieve","removeEventListener","Error","debounce","addEventListener","equality","val1","val2","isEqual","getset.urlGet","getset.storageGet","getset.sessionGet","getset.urlSet","getset.storageSet","getset.sessionSet"],"sources":["./node_modules/tyqs/dist/parse.js","./node_modules/tyqs/dist/stringify.js","./src/utils/store/get-set.ts","./src/utils/store/component-store.ts"],"sourcesContent":["export function parse(searchParams, replacer) {\n const params = new URLSearchParams([...new URLSearchParams(searchParams)].map(([k, v]) => [\n k.replace(/([[\\]])/g, (_, s) => s === '[' ? '.' : ''),\n v,\n ]));\n const t = {};\n new Set(params.keys()).forEach((paramKey) => {\n const rawValue = params\n .getAll(paramKey)\n .join(',')\n .split(',')\n .map(n => decodeURIComponent(n.replace(/\\+/g, ' ')));\n const value = rawValue.length === 1 ? rawValue[0] : rawValue;\n let key = paramKey;\n let v = replacer ?\n replacer({\n firstRawValue: params.get(paramKey).split(','),\n key,\n rawValue,\n value,\n }) :\n value;\n if (key.includes('.')) {\n const [f, ...kl] = key.split('.');\n const o = (t[f] || {});\n const l = kl.pop();\n (kl.reduce((p, n) => (p[n] ??= {}), o))[l] = v;\n key = f;\n v = o;\n }\n t[key] = v;\n });\n return t;\n}\n//# sourceMappingURL=parse.js.map","export function stringify(input, replacer) {\n if (!input)\n return '';\n const stack = [['', input]];\n const sp = new URLSearchParams();\n while (stack.length) {\n const [itemKey, itemValue] = stack.pop();\n Object.entries(itemValue).forEach(([key, rawValue]) => {\n if (rawValue == null && replacer == null)\n return;\n const typeOfValue = typeof (rawValue);\n const flattenedKey = itemKey ? `${itemKey}.${key}` : key;\n if (rawValue !== null && typeOfValue === 'object' && !Array.isArray(rawValue)) {\n stack.push([flattenedKey, rawValue]);\n }\n else {\n let value = typeOfValue === 'string' ? rawValue : '';\n if (Array.isArray(rawValue))\n value = rawValue.join(',');\n else if (rawValue?.toJSON)\n value = rawValue.toJSON();\n else if (rawValue?.toString)\n value = rawValue.toString();\n else\n value = String(rawValue);\n const vv = replacer ?\n replacer({ flattenedKey, key, rawValue, value }) :\n value;\n vv != null && sp.append(flattenedKey, vv);\n }\n });\n }\n sp.sort();\n return sp.toString();\n}\n//# sourceMappingURL=stringify.js.map","import { parse, stringify } from 'tyqs';\n\nconst STORAGE_NAME_SPACE = 'nano-component-store:';\n\nconst urlRead = (\n from: 'hash' | 'query' = 'hash',\n win: Window = window\n): void | object => {\n if (!win || !win.location) return {};\n if (from === 'hash' && win.location.hash && win.location.hash.match(/&|=/))\n return parse(win.location.hash.replace(/^\\#/, ''));\n else if (\n from === 'query' &&\n win.location.search &&\n win.location.search.match(/&|=/)\n )\n return parse(win.location.search.replace(/^\\?/, ''));\n return {};\n};\n\nconst urlSave = (\n object: object,\n to: 'hash' | 'query' = 'hash',\n win: Window = window,\n method: 'replace' | 'push' = 'replace'\n) => {\n if (!win || !win.history) return;\n const oldQuery = to === 'query' ? win.location.search : win.location.hash;\n const basePath =\n to === 'query'\n ? win.location.pathname\n : win.location.pathname + win.location.search;\n let queryStr = stringify(object);\n\n if (!queryStr || !queryStr.length) {\n if (!oldQuery || !oldQuery.length) return;\n if (method === 'replace') win.history.replaceState(null, null, basePath);\n else win.history.pushState(null, null, basePath);\n return;\n }\n\n if (to === 'hash' && win.location.hash === '#' + queryStr) {\n try {\n (document.querySelector('#' + queryStr) as HTMLElement).focus();\n } catch (e) {}\n return;\n }\n queryStr = (to === 'hash' ? '#' : '?') + queryStr;\n if (queryStr === oldQuery) return;\n if (method === 'replace')\n win.history.replaceState(null, null, basePath + queryStr);\n else win.history.pushState(null, null, basePath + queryStr);\n};\n\nexport const urlSet = (\n id: string,\n data: object,\n to: 'hash' | 'query' = 'hash',\n win: Window = window,\n method: 'replace' | 'push' = 'replace'\n) => {\n // sanitize the incoming key\n id = Object.keys(parse(id))[0];\n const object = {};\n\n // delete all empty incoming values\n for (const key in data) {\n if (!data[key] || (Array.isArray(data[key]) && !data[key].length)) {\n delete data[key];\n }\n }\n\n object[id] = data;\n let currentData = urlRead(to, win);\n\n // current data is empty and incoming data is empty\n // let's not do anything\n if (!currentData[id] && !object[id]) return;\n\n // let's merge current and incoming data and write it to the url\n currentData = { ...currentData, ...object };\n urlSave(currentData, to, win, method);\n};\n\nexport const urlGet = (\n key: string,\n to: 'hash' | 'query' = 'hash',\n win: Window = window\n) => {\n // sanitize the incoming key\n key = Object.keys(parse(key))[0];\n const currentData = urlRead(to, win);\n return currentData[key] || null;\n};\n\nexport const sessionSet = (\n key: string,\n object: object,\n win: Window = window\n) => {\n try {\n if (!object) {\n win.sessionStorage.removeItem(STORAGE_NAME_SPACE + key);\n return;\n }\n win.sessionStorage.setItem(\n STORAGE_NAME_SPACE + key,\n JSON.stringify(object)\n );\n } catch (e) {\n throw e;\n }\n};\n\nexport const sessionGet = (key: string, win: Window = window) => {\n try {\n const configStr = win.sessionStorage.getItem(STORAGE_NAME_SPACE + key);\n return configStr !== null ? JSON.parse(configStr) : null;\n } catch (e) {\n throw e;\n }\n};\n\nexport const storageSet = (\n key: string,\n object: object,\n win: Window = window\n) => {\n try {\n if (!object) {\n win.localStorage.removeItem(STORAGE_NAME_SPACE + key);\n return;\n }\n win.localStorage.setItem(STORAGE_NAME_SPACE + key, JSON.stringify(object));\n } catch (e) {\n throw e;\n }\n};\n\nexport const storageGet = (key: string, win: Window = window) => {\n try {\n const configStr = win.localStorage.getItem(STORAGE_NAME_SPACE + key);\n return configStr !== null ? JSON.parse(configStr) : null;\n } catch (e) {\n throw e;\n }\n};\n","import { getElement } from '@stencil/core';\nimport { debounce } from '../throttle';\nimport * as getset from './get-set';\n\nexport type StorageParams = Record<string, any>;\n\nexport type StorageMethods =\n | 'url-hash'\n | 'url-query'\n | 'url-hash-push'\n | 'url-query-push'\n | 'local'\n | 'session';\n\ninterface Component {\n connectedCallback?(): void;\n disconnectedCallback?(): void;\n componentDidRender?(): void;\n [key: string]: any;\n}\n\nconst store = new Map<string, Store>();\n\nexport const ComponentStore = {\n init(\n component: Component,\n keys: string[],\n method?: StorageMethods,\n id?: string\n ) {\n const getId = id || component.storeId || getElement(component).id;\n if (!getId) {\n console.error(\n 'No id set. You can only instantiate a new component store with an id. '\n );\n return;\n }\n if (store.get(getId)) {\n console.error(\n 'Duplicate store id usage. A store ID must be unique!',\n getId\n );\n return;\n }\n\n const initialState = keys.reduce((acc, key) => {\n if (typeof component[key] !== undefined) acc[key] = component[key];\n return acc;\n }, {});\n\n store.set(getId, new Store(getId, component, keys, initialState, method));\n const componentstore = store.get(getId);\n componentstore.dispatchToProps();\n\n const connectedCallback = component.connectedCallback;\n component.connectedCallback = function () {\n store.set(getId, new Store(getId, component, keys, initialState, method));\n const componentstore = store.get(getId);\n if (connectedCallback) {\n connectedCallback.call(component);\n }\n if (componentstore) componentstore.dispatchToProps();\n };\n\n const componentDidRender = component.componentDidRender;\n component.componentDidRender = function () {\n const componentstore = store.get(getId);\n if (componentDidRender) {\n componentDidRender.call(component);\n }\n if (componentstore) componentstore.savePropsToStore();\n };\n\n const disconnectedCallback = component.disconnectedCallback;\n component.disconnectedCallback = function () {\n const componentstore = store.get(getId);\n if (componentstore) componentstore.delete();\n store.delete(getId);\n if (disconnectedCallback) {\n disconnectedCallback.call(component);\n }\n };\n },\n};\n\nclass Store {\n private method: StorageMethods = 'session';\n private keys: string[];\n private id: string;\n private component: Component;\n private initialState: { [key: string]: any } = {};\n private updateStore: boolean = true;\n\n constructor(\n id: string,\n component: Component,\n keys: string[],\n initialState?: any,\n method?: StorageMethods\n ) {\n if (!id)\n throw new Error(\n 'No id set. You can only instantiate a new component store with an id'\n );\n this.id = id;\n this.keys = keys;\n this.component = component;\n if (initialState) this.initialState = initialState;\n if (method) this.method = method;\n\n this.savePropsToStore = debounce(this.savePropsToStore, 500);\n\n if (this.method === 'url-hash-push' || this.method === 'url-query-push') {\n window.addEventListener('popstate', this.onUrlChange);\n }\n }\n\n private onUrlChange = () => {\n this.dispatchToProps(false);\n };\n\n private equality(val1: any, val2: any) {\n if (typeof val1 !== typeof val2) return false;\n if (typeof val1 !== 'object') return val1 === val2;\n return JSON.stringify(val1) === JSON.stringify(val2);\n }\n\n get getData() {\n const data = this.keys.reduce((acc, key) => {\n const isEqual = this.equality(\n this.component[key],\n this.initialState[key]\n );\n if (typeof this.component[key] !== 'undefined' && !isEqual) {\n acc[key] = this.component[key];\n } else if (isEqual) delete acc[key];\n return acc;\n }, {});\n return Object.keys(data).length ? data : undefined;\n }\n\n private retrieve() {\n switch (this.method) {\n case 'url-hash':\n case 'url-hash-push':\n return getset.urlGet(this.id, 'hash');\n case 'url-query':\n case 'url-query-push':\n return getset.urlGet(this.id, 'query');\n case 'local':\n return getset.storageGet(this.id);\n default:\n return getset.sessionGet(this.id);\n }\n }\n\n private save(data: any) {\n switch (this.method) {\n case 'url-hash':\n return getset.urlSet(this.id, data, 'hash');\n case 'url-query':\n return getset.urlSet(this.id, data, 'query');\n case 'url-hash-push':\n return getset.urlSet(this.id, data, 'hash', window, 'push');\n case 'url-query-push':\n return getset.urlSet(this.id, data, 'query', window, 'push');\n case 'local':\n return getset.storageSet(this.id, data);\n default:\n return getset.sessionSet(this.id, data);\n }\n }\n\n public savePropsToStore = () => {\n if (this.updateStore) {\n this.save(this.getData);\n } else if (!this.updateStore) this.updateStore = true;\n };\n\n public dispatchToProps = (updateStore = true) => {\n const savedData = this.retrieve();\n if (!savedData && updateStore) return;\n\n // console.log('dispatching', savedData, this.id, this.initialState);\n this.updateStore = updateStore;\n\n this.keys.forEach((key) => {\n this.component[key] = savedData ? savedData[key] : undefined;\n });\n };\n\n public delete = () => {\n if (this.method === 'url-hash-push' || this.method === 'url-query-push') {\n window.removeEventListener('popstate', this.onUrlChange);\n }\n };\n}\n"],"mappings":";;;mFAAO,SAASA,EAAMC,EAAcC,GAChC,MAAMC,EAAS,IAAIC,gBAAgB,IAAI,IAAIA,gBAAgBH,IAAeI,KAAI,EAAEC,EAAGC,KAAO,CACtFD,EAAEE,QAAQ,YAAY,CAACC,EAAGC,IAAMA,IAAM,IAAM,IAAM,KAClDH,MAEJ,MAAMI,EAAI,GACV,IAAIC,IAAIT,EAAOU,QAAQC,SAASC,IAC5B,MAAMC,EAAWb,EACZc,OAAOF,GACPG,KAAK,KACLC,MAAM,KACNd,KAAIe,GAAKC,mBAAmBD,EAAEZ,QAAQ,MAAO,QAClD,MAAMc,EAAQN,EAASO,SAAW,EAAIP,EAAS,GAAKA,EACpD,IAAIQ,EAAMT,EACV,IAAIR,EAAIL,EACJA,EAAS,CACLuB,cAAetB,EAAOuB,IAAIX,GAAUI,MAAM,KAC1CK,MACAR,WACAM,UAEJA,EACJ,GAAIE,EAAIG,SAAS,KAAM,CACnB,MAAOC,KAAMC,GAAML,EAAIL,MAAM,KAC7B,MAAMW,EAAKnB,EAAEiB,IAAM,GACnB,MAAMG,EAAIF,EAAGG,MACZH,EAAGI,QAAO,CAACC,EAAGd,IAAOc,EAAEd,KAAO,IAAKU,GAAIC,GAAKxB,EAC7CiB,EAAMI,EACNrB,EAAIuB,CAChB,CACQnB,EAAEa,GAAOjB,CAAC,IAEd,OAAOI,CACX,CCjCO,SAASwB,EAAUC,EAAOlC,GAC7B,IAAKkC,EACD,MAAO,GACX,MAAMC,EAAQ,CAAC,CAAC,GAAID,IACpB,MAAME,EAAK,IAAIlC,gBACf,MAAOiC,EAAMd,OAAQ,CACjB,MAAOgB,EAASC,GAAaH,EAAML,MACnCS,OAAOC,QAAQF,GAAW1B,SAAQ,EAAEU,EAAKR,MACrC,GAAIA,GAAY,MAAQd,GAAY,KAChC,OACJ,MAAMyC,SAAc,EACpB,MAAMC,EAAeL,EAAU,GAAGA,KAAWf,IAAQA,EACrD,GAAIR,IAAa,MAAQ2B,IAAgB,WAAaE,MAAMC,QAAQ9B,GAAW,CAC3EqB,EAAMU,KAAK,CAACH,EAAc5B,GAC1C,KACiB,CACD,IAAIM,EAAQqB,IAAgB,SAAW3B,EAAW,GAClD,GAAI6B,MAAMC,QAAQ9B,GACdM,EAAQN,EAASE,KAAK,UACrB,GAAIF,GAAUgC,OACf1B,EAAQN,EAASgC,cAChB,GAAIhC,GAAUiC,SACf3B,EAAQN,EAASiC,gBAEjB3B,EAAQ4B,OAAOlC,GACnB,MAAMmC,EAAKjD,EACPA,EAAS,CAAE0C,eAAcpB,MAAKR,WAAUM,UACxCA,EACJ6B,GAAM,MAAQb,EAAGc,OAAOR,EAAcO,EACtD,IAEA,CACIb,EAAGe,OACH,OAAOf,EAAGW,UACd,CChCA,MAAMK,EAAqB,wBAE3B,MAAMC,EAAU,CACdC,EAAyB,OACzBC,EAAcC,UAEd,IAAKD,IAAQA,EAAIE,SAAU,MAAO,GAClC,GAAIH,IAAS,QAAUC,EAAIE,SAASC,MAAQH,EAAIE,SAASC,KAAKC,MAAM,OAClE,OAAO7D,EAAMyD,EAAIE,SAASC,KAAKpD,QAAQ,MAAO,UAC3C,GACHgD,IAAS,SACTC,EAAIE,SAASG,QACbL,EAAIE,SAASG,OAAOD,MAAM,OAE1B,OAAO7D,EAAMyD,EAAIE,SAASG,OAAOtD,QAAQ,MAAO,KAClD,MAAO,EAAE,EAGX,MAAMuD,EAAU,CACdC,EACAC,EAAuB,OACvBR,EAAcC,OACdQ,EAA6B,aAE7B,IAAKT,IAAQA,EAAIU,QAAS,OAC1B,MAAMC,EAAWH,IAAO,QAAUR,EAAIE,SAASG,OAASL,EAAIE,SAASC,KACrE,MAAMS,EACJJ,IAAO,QACHR,EAAIE,SAASW,SACbb,EAAIE,SAASW,SAAWb,EAAIE,SAASG,OAC3C,IAAIS,EAAWpC,EAAU6B,GAEzB,IAAKO,IAAaA,EAAShD,OAAQ,CACjC,IAAK6C,IAAaA,EAAS7C,OAAQ,OACnC,GAAI2C,IAAW,UAAWT,EAAIU,QAAQK,aAAa,KAAM,KAAMH,QAC1DZ,EAAIU,QAAQM,UAAU,KAAM,KAAMJ,GACvC,M,CAGF,GAAIJ,IAAO,QAAUR,EAAIE,SAASC,OAAS,IAAMW,EAAU,CACzD,IACGG,SAASC,cAAc,IAAMJ,GAA0BK,OAC9C,CAAV,MAAOC,GAAG,CACZ,M,CAEFN,GAAYN,IAAO,OAAS,IAAM,KAAOM,EACzC,GAAIA,IAAaH,EAAU,OAC3B,GAAIF,IAAW,UACbT,EAAIU,QAAQK,aAAa,KAAM,KAAMH,EAAWE,QAC7Cd,EAAIU,QAAQM,UAAU,KAAM,KAAMJ,EAAWE,EAAS,EAGtD,MAAMO,EAAS,CACpBC,EACAC,EACAf,EAAuB,OACvBR,EAAcC,OACdQ,EAA6B,aAG7Ba,EAAKtC,OAAO5B,KAAKb,EAAM+E,IAAK,GAC5B,MAAMf,EAAS,GAGf,IAAK,MAAMxC,KAAOwD,EAAM,CACtB,IAAKA,EAAKxD,IAASqB,MAAMC,QAAQkC,EAAKxD,MAAUwD,EAAKxD,GAAKD,OAAS,QAC1DyD,EAAKxD,E,EAIhBwC,EAAOe,GAAMC,EACb,IAAIC,EAAc1B,EAAQU,EAAIR,GAI9B,IAAKwB,EAAYF,KAAQf,EAAOe,GAAK,OAGrCE,EAAc,IAAKA,KAAgBjB,GACnCD,EAAQkB,EAAahB,EAAIR,EAAKS,EAAO,EAGhC,MAAMgB,EAAS,CACpB1D,EACAyC,EAAuB,OACvBR,EAAcC,UAGdlC,EAAMiB,OAAO5B,KAAKb,EAAMwB,IAAM,GAC9B,MAAMyD,EAAc1B,EAAQU,EAAIR,GAChC,OAAOwB,EAAYzD,IAAQ,IAAI,EAG1B,MAAM2D,EAAa,CACxB3D,EACAwC,EACAP,EAAcC,UAEd,IACE,IAAKM,EAAQ,CACXP,EAAI2B,eAAeC,WAAW/B,EAAqB9B,GACnD,M,CAEFiC,EAAI2B,eAAeE,QACjBhC,EAAqB9B,EACrB+D,KAAKpD,UAAU6B,G,CAEjB,MAAOa,GACP,MAAMA,C,GAIH,MAAMW,EAAa,CAAChE,EAAaiC,EAAcC,UACpD,IACE,MAAM+B,EAAYhC,EAAI2B,eAAeM,QAAQpC,EAAqB9B,GAClE,OAAOiE,IAAc,KAAOF,KAAKvF,MAAMyF,GAAa,I,CACpD,MAAOZ,GACP,MAAMA,C,GAIH,MAAMc,EAAa,CACxBnE,EACAwC,EACAP,EAAcC,UAEd,IACE,IAAKM,EAAQ,CACXP,EAAImC,aAAaP,WAAW/B,EAAqB9B,GACjD,M,CAEFiC,EAAImC,aAAaN,QAAQhC,EAAqB9B,EAAK+D,KAAKpD,UAAU6B,G,CAClE,MAAOa,GACP,MAAMA,C,GAIH,MAAMgB,EAAa,CAACrE,EAAaiC,EAAcC,UACpD,IACE,MAAM+B,EAAYhC,EAAImC,aAAaF,QAAQpC,EAAqB9B,GAChE,OAAOiE,IAAc,KAAOF,KAAKvF,MAAMyF,GAAa,I,CACpD,MAAOZ,GACP,MAAMA,C,GC3HV,MAAMiB,EAAQ,IAAIC,I,MAELC,EAAiB,CAC5BC,KACEC,EACArF,EACAqD,EACAa,GAEA,MAAMoB,EAAQpB,GAAMmB,EAAUE,SAAWC,EAAWH,GAAWnB,GAC/D,IAAKoB,EAAO,CACVG,QAAQC,MACN,0EAEF,M,CAEF,GAAIT,EAAMpE,IAAIyE,GAAQ,CACpBG,QAAQC,MACN,uDACAJ,GAEF,M,CAGF,MAAMK,EAAe3F,EAAKoB,QAAO,CAACwE,EAAKjF,KACrC,UAAW0E,EAAU1E,KAASkF,UAAWD,EAAIjF,GAAO0E,EAAU1E,GAC9D,OAAOiF,CAAG,GACT,IAEHX,EAAMa,IAAIR,EAAO,IAAIS,EAAMT,EAAOD,EAAWrF,EAAM2F,EAActC,IACjE,MAAM2C,EAAiBf,EAAMpE,IAAIyE,GACjCU,EAAeC,kBAEf,MAAMC,EAAoBb,EAAUa,kBACpCb,EAAUa,kBAAoB,WAC5BjB,EAAMa,IAAIR,EAAO,IAAIS,EAAMT,EAAOD,EAAWrF,EAAM2F,EAActC,IACjE,MAAM2C,EAAiBf,EAAMpE,IAAIyE,GACjC,GAAIY,EAAmB,CACrBA,EAAkBC,KAAKd,E,CAEzB,GAAIW,EAAgBA,EAAeC,iB,EAGrC,MAAMG,EAAqBf,EAAUe,mBACrCf,EAAUe,mBAAqB,WAC7B,MAAMJ,EAAiBf,EAAMpE,IAAIyE,GACjC,GAAIc,EAAoB,CACtBA,EAAmBD,KAAKd,E,CAE1B,GAAIW,EAAgBA,EAAeK,kB,EAGrC,MAAMC,EAAuBjB,EAAUiB,qBACvCjB,EAAUiB,qBAAuB,WAC/B,MAAMN,EAAiBf,EAAMpE,IAAIyE,GACjC,GAAIU,EAAgBA,EAAeO,SACnCtB,EAAMsB,OAAOjB,GACb,GAAIgB,EAAsB,CACxBA,EAAqBH,KAAKd,E,KAMlC,MAAMU,EAQJS,YACEtC,EACAmB,EACArF,EACA2F,EACAtC,GAZMoD,KAAApD,OAAyB,UAIzBoD,KAAAd,aAAuC,GACvCc,KAAAC,YAAuB,KA0BvBD,KAAAE,YAAc,KACpBF,KAAKR,gBAAgB,MAAM,EAuDtBQ,KAAAJ,iBAAmB,KACxB,GAAII,KAAKC,YAAa,CACpBD,KAAKG,KAAKH,KAAKI,Q,MACV,IAAKJ,KAAKC,YAAaD,KAAKC,YAAc,IAAI,EAGhDD,KAAAR,gBAAkB,CAACS,EAAc,QACtC,MAAMI,EAAYL,KAAKM,WACvB,IAAKD,GAAaJ,EAAa,OAG/BD,KAAKC,YAAcA,EAEnBD,KAAKzG,KAAKC,SAASU,IACjB8F,KAAKpB,UAAU1E,GAAOmG,EAAYA,EAAUnG,GAAOkF,SAAS,GAC5D,EAGGY,KAAAF,OAAS,KACd,GAAIE,KAAKpD,SAAW,iBAAmBoD,KAAKpD,SAAW,iBAAkB,CACvER,OAAOmE,oBAAoB,WAAYP,KAAKE,Y,GA7F9C,IAAKzC,EACH,MAAM,IAAI+C,MACR,wEAEJR,KAAKvC,GAAKA,EACVuC,KAAKzG,KAAOA,EACZyG,KAAKpB,UAAYA,EACjB,GAAIM,EAAcc,KAAKd,aAAeA,EACtC,GAAItC,EAAQoD,KAAKpD,OAASA,EAE1BoD,KAAKJ,iBAAmBa,EAAST,KAAKJ,iBAAkB,KAExD,GAAII,KAAKpD,SAAW,iBAAmBoD,KAAKpD,SAAW,iBAAkB,CACvER,OAAOsE,iBAAiB,WAAYV,KAAKE,Y,EAQrCS,SAASC,EAAWC,GAC1B,UAAWD,WAAgBC,EAAM,OAAO,MACxC,UAAWD,IAAS,SAAU,OAAOA,IAASC,EAC9C,OAAO5C,KAAKpD,UAAU+F,KAAU3C,KAAKpD,UAAUgG,E,CAG7CT,cACF,MAAM1C,EAAOsC,KAAKzG,KAAKoB,QAAO,CAACwE,EAAKjF,KAClC,MAAM4G,EAAUd,KAAKW,SACnBX,KAAKpB,UAAU1E,GACf8F,KAAKd,aAAahF,IAEpB,UAAW8F,KAAKpB,UAAU1E,KAAS,cAAgB4G,EAAS,CAC1D3B,EAAIjF,GAAO8F,KAAKpB,UAAU1E,E,MACrB,GAAI4G,SAAgB3B,EAAIjF,GAC/B,OAAOiF,CAAG,GACT,IACH,OAAOhE,OAAO5B,KAAKmE,GAAMzD,OAASyD,EAAO0B,S,CAGnCkB,WACN,OAAQN,KAAKpD,QACX,IAAK,WACL,IAAK,gBACH,OAAOmE,EAAcf,KAAKvC,GAAI,QAChC,IAAK,YACL,IAAK,iBACH,OAAOsD,EAAcf,KAAKvC,GAAI,SAChC,IAAK,QACH,OAAOuD,EAAkBhB,KAAKvC,IAChC,QACE,OAAOwD,EAAkBjB,KAAKvC,I,CAI5B0C,KAAKzC,GACX,OAAQsC,KAAKpD,QACX,IAAK,WACH,OAAOsE,EAAclB,KAAKvC,GAAIC,EAAM,QACtC,IAAK,YACH,OAAOwD,EAAclB,KAAKvC,GAAIC,EAAM,SACtC,IAAK,gBACH,OAAOwD,EAAclB,KAAKvC,GAAIC,EAAM,OAAQtB,OAAQ,QACtD,IAAK,iBACH,OAAO8E,EAAclB,KAAKvC,GAAIC,EAAM,QAAStB,OAAQ,QACvD,IAAK,QACH,OAAO+E,EAAkBnB,KAAKvC,GAAIC,GACpC,QACE,OAAO0D,EAAkBpB,KAAKvC,GAAIC,G"}
@@ -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,w as s,h as e,a as h,g as n}from"./index-9695db0a.js";import{C as l}from"./component-store-486d9d7a.js";import{W as o}from"./algolia-data-1b42827c.js";import"./throttle-ac4fcefa.js";const r=":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:{...this.indexResults.origFilters[this.filterName]},dyn:{...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"]}}};o(a,["globalStoreMethod","indexResults","filterChanged","facets","tplRenderFn","changeEvent"]);let f=0;a.style=r;export{a as nano_algolia_filter};
4
+ import{r as t,c as i,w as s,h as e,a as h,g as n}from"./index-9695db0a.js";import{C as l}from"./component-store-64043183.js";import{W as o}from"./algolia-data-1b42827c.js";import"./throttle-ac4fcefa.js";const r=":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:{...this.indexResults.origFilters[this.filterName]},dyn:{...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"]}}};o(a,["globalStoreMethod","indexResults","filterChanged","facets","tplRenderFn","changeEvent"]);let f=0;a.style=r;export{a as nano_algolia_filter};
5
5
  //# sourceMappingURL=nano-algolia-filter.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{g as t,e,r as i,c as s,w as n,d as r,h as o,a as l}from"./index-9695db0a.js";import{a as h}from"./algoliasearch-lite.esm.browser-d71a28dc.js";import{g as a}from"./dom-8599fac1.js";import{C as c}from"./component-store-486d9d7a.js";import{d as f}from"./throttle-ac4fcefa.js";import{S as u}from"./algolia-data-1b42827c.js";var d=new Map;var p=function(t,e){var i=t.fields,s=t.updater;i.forEach((function(t){s(t,e[t])}))};var m={create:function(e,i){var s=t(e);var n=new Map;var r={wormholes:n,state:i};d.set(e,r);var o=e.connectedCallback;e.connectedCallback=function(){d.set(e,r);if(o){o.call(e)}};var l=e.disconnectedCallback;e.disconnectedCallback=function(){d.delete(e);if(l){l.call(e)}};s.addEventListener("openWormhole",(function(t){t.stopPropagation();var e=t.detail,i=e.consumer,s=e.onOpen;if(n.has(i))return;if(typeof i!=="symbol"){var o=i.connectedCallback,l=i.disconnectedCallback;i.connectedCallback=function(){n.set(i,t.detail);if(o){o.call(i)}};i.disconnectedCallback=function(){n.delete(i);if(l){l.call(i)}}}n.set(i,t.detail);p(t.detail,r.state);s===null||s===void 0?void 0:s.resolve((function(){n.delete(i)}))}));s.addEventListener("closeWormhole",(function(t){var e=t.detail;n.delete(e)}))},Provider:function(t,i){var s=t.state;var n=e();if(d.has(n)){var r=d.get(n);r.state=s;r.wormholes.forEach((function(t){p(t,s)}))}return i}};class g{constructor(){this.queue=[];this.workingOnPromise=false;this.stop=false;this.limit=null}enqueue(t){return new Promise(((e,i)=>{this.queue.push({promise:t,resolve:e,reject:i});this.dequeue()}))}dequeue(){if(this.workingOnPromise){return false}if(this.stop){this.queue=[];this.stop=false;return}const t=this.queue.shift();if(!t){return false}try{this.workingOnPromise=true;t.promise().then((e=>{this.workingOnPromise=false;t.resolve(e);this.dequeue()})).catch((e=>{this.workingOnPromise=false;t.reject(e);this.dequeue()}))}catch(e){this.workingOnPromise=false;t.reject(e);this.dequeue()}return true}}g.pendingPromise=false;function y(t,e){if(Object.setPrototypeOf){Object.setPrototypeOf(t,e)}else{t.__proto__=e}}function w(t){const e=new Error(t);y(e,w.prototype);return e}w.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:false}});function b(t,e,i){const s=e.slice(0,i).split(/\n/);const n=s.length;const r=s[n-1].length+1;t+=" at line "+n+" col "+r+":\n\n"+" "+e.split(/\n/)[n-1]+"\n"+" "+Array(r).join(" ")+"^";throw w(t)}const v=new Function("return this")().Promise;let x=false;try{x=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError)){throw t}}function F(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function C(t,e,i){for(const s in e){if(F(e,s)){if(e[s]!=null&&typeof e[s]=="object"&&(s==="storage"||s==="prefixes")&&!i){t[s]=C({},e[s])}else{t[s]=e[s]}}}return t}function I(t,e,i,s){let n;let r;if(typeof e.autoTrim==="string"){n=r=e.autoTrim}else if(Array.isArray(e.autoTrim)){n=e.autoTrim[1];r=e.autoTrim[0]}if(i||i===false){n=i}if(s||s===false){r=s}if(n==="slurp"&&r==="slurp"){return t.trim()}if(n==="_"||n==="slurp"){if(!!String.prototype.trimLeft){t=t.trimLeft()}else{t=t.replace(/^[\s\uFEFF\xA0]+/,"")}}else if(n==="-"||n==="nl"){t=t.replace(/^(?:\n|\r|\r\n)/,"")}if(r==="_"||r==="slurp"){if(!!String.prototype.trimRight){t=t.trimRight()}else{t=t.replace(/[\s\uFEFF\xA0]+$/,"")}}else if(r==="-"||r==="nl"){t=t.replace(/(?:\n|\r|\r\n)$/,"")}return t}const S=/^async +/;const j=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g;const z=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g;const A=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;const R=/[.*+\-?^${}()|[\]\\]/g;function _(t){return R.test(t)?t.replace(R,"\\$&"):t}function k(t,e){if(e.rmWhitespace){t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")}j.lastIndex=0;z.lastIndex=0;A.lastIndex=0;const i=e.prefixes;const s=[i.h,i.b,i.i,i.r,i.c,i.e].reduce((function(t,e){if(t&&e){return t+"|"+_(e)}else if(e){return _(e)}else{return t}}),"");const n=new RegExp("([|()]|=>)|"+"('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+_(e.tags[1])+")","g");const r=new RegExp("([^]*?)"+_(e.tags[0])+"(-|_)?\\s*("+s+")?\\s*","g");let o=0;let l=false;function h(i,s){const h={f:[]};let a=0;let c="c";if(s==="h"||s==="b"||s==="c"){c="n"}else if(s==="r"){h.raw=true;s="i"}function f(i){const s=t.slice(o,i);let n=s.trim();if(c==="f"){if(n==="safe"){h.raw=true}else{if(e.async&&S.test(n)){n=n.replace(S,"");h.f.push([n,"",true])}else{h.f.push([n,""])}}}else if(c==="fp"){h.f[h.f.length-1][1]+=n}else if(c==="err"){if(n){const e=s.search(/\S/);b("invalid syntax",t,o+e)}}else{h[c]=n}o=i+1}n.lastIndex=o;let u;while((u=n.exec(t))!==null){const e=u[1];const i=u[2];const d=u[3];const p=u[4];const m=u[5];const g=u.index;if(e){if(e==="("){if(a===0){if(c==="n"){f(g);c="p"}else if(c==="f"){f(g);c="fp"}}a++}else if(e===")"){a--;if(a===0&&c!=="c"){f(g);c="err"}}else if(a===0&&e==="|"){f(g);c="f"}else if(e==="=>"){f(g);o+=1;c="res"}}else if(i){if(i==="/*"){const e=t.indexOf("*/",n.lastIndex);if(e===-1){b("unclosed comment",t,u.index)}n.lastIndex=e+2}else if(i==="'"){z.lastIndex=u.index;const e=z.exec(t);if(e){n.lastIndex=z.lastIndex}else{b("unclosed string",t,u.index)}}else if(i==='"'){A.lastIndex=u.index;const e=A.exec(t);if(e){n.lastIndex=A.lastIndex}else{b("unclosed string",t,u.index)}}else if(i==="`"){j.lastIndex=u.index;const e=j.exec(t);if(e){n.lastIndex=j.lastIndex}else{b("unclosed string",t,u.index)}}}else if(d){f(g);o=g+u[0].length;r.lastIndex=o;l=m;if(p&&s==="h"){s="s"}h.t=s;return h}}b("unclosed tag",t,i);return h}function a(s,n){s.b=[];s.d=[];let c=false;let f=[];function u(t,i){if(t){t=I(t,e,l,i);if(t){t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n");f.push(t)}}}let d;while((d=r.exec(t))!==null){const n=d[1];const r=d[2];const l=d[3]||"";let p;for(const t in i){if(i[t]===l){p=t;break}}u(n,r);o=d.index+d[0].length;if(!p){b("unrecognized tag type: "+l,t,o)}let m=h(d.index,p);const g=m.t;if(g==="h"){const t=m.n||"";if(e.async&&S.test(t)){m.a=true;m.n=t.replace(S,"")}m=a(m);f.push(m)}else if(g==="c"){if(s.n===m.n){if(c){c.d=f;s.b.push(c)}else{s.d=f}return s}else{b("Helper start and end don't match",t,d.index+d[0].length)}}else if(g==="b"){if(c){c.d=f;s.b.push(c)}else{s.d=f}const t=m.n||"";if(e.async&&S.test(t)){m.a=true;m.n=t.replace(S,"")}c=m;f=[]}else if(g==="s"){const t=m.n||"";if(e.async&&S.test(t)){m.a=true;m.n=t.replace(S,"")}f.push(m)}else{f.push(m)}}if(n){u(t.slice(o,t.length),false);s.d=f}else{throw w('unclosed helper "'+s.n+'"')}return s}const c=a({f:[]},true);if(e.plugins){for(let t=0;t<e.plugins.length;t++){const i=e.plugins[t];if(i.processAST){c.d=i.processAST(c.d,e)}}}return c.d}function T(t,e){const i=k(t,e);let s="var tR='';"+(e.useWith?"with("+e.varName+"||{}){":"")+q(i,e)+"if(cb){cb(null,tR)} return tR"+(e.useWith?"}":"");if(e.plugins){for(let t=0;t<e.plugins.length;t++){const i=e.plugins[t];if(i.processFnString){s=i.processFnString(s,e)}}}return s}function P(t,e){for(let i=0;i<e.length;i++){const s=e[i][0];const n=e[i][1];const r=e[i][2];t=(r?"await ":"")+"c.l('F','"+s+"')("+t;if(n){t+=","+n}t+=")"}return t}function O(t,e,i,s,n,r){let o="{exec:"+(n?"async ":"")+N(i,e,t)+",params:["+s+"]";if(r){o+=",name:'"+r+"'"}if(n){o+=",async:true"}o+="}";return o}function E(t,e){let i="[";for(let s=0;s<t.length;s++){const n=t[s];i+=O(e,n.res||"",n.d,n.p||"",n.a,n.n);if(s<t.length){i+=","}}i+="]";return i}function N(t,e,i){return"function("+e+"){var tR='';"+q(t,i)+"return tR}"}function q(t,e){let i=0;const s=t.length;let n="";for(i;i<s;i++){const s=t[i];if(typeof s==="string"){const t=s;n+="tR+='"+t+"';"}else{const t=s.t;let i=s.c||"";const r=s.f;const o=s.n||"";const l=s.p||"";const h=s.res||"";const a=s.b;const c=!!s.a;if(t==="i"){if(e.defaultFilter){i="c.l('F','"+e.defaultFilter+"')("+i+")"}let t=P(i,r);if(!s.raw&&e.autoEscape){t="c.l('F','e')("+t+")"}n+="tR+="+t+";"}else if(t==="h"){if(e.storage.nativeHelpers.get(o)){n+=e.storage.nativeHelpers.get(o)(s,e)}else{let t=(c?"await ":"")+"c.l('H','"+o+"')("+O(e,h,s.d,l,c);if(a){t+=","+E(a,e)}else{t+=",[]"}t+=",c)";n+="tR+="+P(t,r)+";"}}else if(t==="s"){n+="tR+="+P((c?"await ":"")+"c.l('H','"+o+"')({params:["+l+"]},[],c)",r)+";"}else if(t==="e"){n+=i+"\n"}}}return n}class H{constructor(t){this.cache=t}define(t,e){this.cache[t]=e}get(t){return this.cache[t]}remove(t){delete this.cache[t]}reset(){this.cache={}}load(t){C(this.cache,t,true)}}function L(t,e,i,s){if(e&&e.length>0){throw w((s?"Native":"")+"Helper '"+t+"' doesn't accept blocks")}if(i&&i.length>0){throw w((s?"Native":"")+"Helper '"+t+"' doesn't accept filters")}}function $(t,e,i,s,n){i(t[e],e).then((function(r){s+=r;if(e===t.length-1){n(s)}else{$(t,e+1,i,s,n)}}))}function D(t,e,i,s,n,r){s(e[i],t[e[i]]).then((function(o){n+=o;if(i===e.length-1){r(n)}else{D(t,e,i+1,s,n,r)}}))}const M={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function W(t){return M[t]}function U(t){const e=String(t);if(/[&<>"']/.test(e)){return e.replace(/[&<>"']/g,W)}else{return e}}const B=new H({});const K=new H({each:function(t,e){let i="";const s=t.params[0];L("each",e,false);if(t.async){return new Promise((function(e){$(s,0,t.exec,i,e)}))}else{for(let e=0;e<s.length;e++){i+=t.exec(s[e],e)}return i}},foreach:function(t,e){const i=t.params[0];L("foreach",e,false);if(t.async){return new Promise((function(e){D(i,Object.keys(i),0,t.exec,"",e)}))}else{let e="";for(const s in i){if(!F(i,s))continue;e+=t.exec(s,i[s])}return e}},include:function(t,e,i){L("include",e,false);const s=i.storage.templates.get(t.params[0]);if(!s){throw w('Could not fetch template "'+t.params[0]+'"')}return s(t.params[1],i)},extends:function(t,e,i){const s=t.params[1]||{};s.content=t.exec();for(let t=0;t<e.length;t++){const i=e[t];s[i.name]=i.exec()}const n=i.storage.templates.get(t.params[0]);if(!n){throw w('Could not fetch template "'+t.params[0]+'"')}return n(s,i)},useScope:function(t,e){L("useScope",e,false);return t.exec(t.params[0])}});const Q=new H({if:function(t,e){L("if",false,t.f,true);let i="if("+t.p+"){"+q(t.d,e)+"}";if(t.b){for(let s=0;s<t.b.length;s++){const n=t.b[s];if(n.n==="else"){i+="else{"+q(n.d,e)+"}"}else if(n.n==="elif"){i+="else if("+n.p+"){"+q(n.d,e)+"}"}}}return i},try:function(t,e){L("try",false,t.f,true);if(!t.b||t.b.length!==1||t.b[0].n!=="catch"){throw w("native helper 'try' only accepts 1 block, 'catch'")}let i="try{"+q(t.d,e)+"}";const s=t.b[0];i+="catch"+(s.res?"("+s.res+")":"")+"{"+q(s.d,e)+"}";return i},block:function(t,e){L("block",t.b,t.f,true);const i="if(!"+e.varName+"["+t.p+"]){tR+=("+N(t.d,"",e)+")()}else{tR+="+e.varName+"["+t.p+"]}";return i}});const G=new H({e:U});const J={varName:"it",autoTrim:[false,"nl"],autoEscape:true,defaultFilter:false,tags:["{{","}}"],l:function(t,e){if(t==="H"){const t=this.storage.helpers.get(e);if(t){return t}else{throw w("Can't find helper '"+e+"'")}}else if(t==="F"){const t=this.storage.filters.get(e);if(t){return t}else{throw w("Can't find filter '"+e+"'")}}},async:false,storage:{helpers:K,nativeHelpers:Q,filters:G,templates:B},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:false,plugins:[],useWith:false};J.l.bind(J);function V(t,e){const i={};C(i,J);if(e){C(i,e)}if(t){C(i,t)}i.l.bind(i);return i}function X(t,e){const i=V(e||{});let s=Function;if(i.async){if(x){s=x}else{throw w("This environment doesn't support async/await")}}try{return new s(i.varName,"c","cb",T(t,i))}catch(e){if(e instanceof SyntaxError){throw w("Bad template syntax\n\n"+e.message+"\n"+Array(e.message.length+1).join("=")+"\n"+T(t,i))}else{throw e}}}function Y(t,e){let i;if(e.cache&&e.name&&e.storage.templates.get(e.name)){return e.storage.templates.get(e.name)}if(typeof t==="function"){i=t}else{i=X(t,e)}if(e.cache&&e.name){e.storage.templates.define(e.name,i)}return i}function Z(t,e,i,s){const n=V(i||{});if(n.async){let i;if(!s){if(typeof v==="function"){return new v((function(s,r){try{i=Y(t,n)(e,n);s(i)}catch(t){r(t)}}))}else{throw w("Please provide a callback function, this env doesn't support Promises")}}else{try{Y(t,n)(e,n,s)}catch(t){return s(t)}}}else{return Y(t,n)(e,n)}}const tt=Object.freeze({__proto__:null,compileToString:T,compileScope:q,compileScopeIntoFunction:N,compile:X,parse:k,render:Z,helpers:K,nativeHelpers:Q,filters:G,templates:B,defaultConfig:J,getConfig:V});G.define("date_long",((t,e={year:"numeric",month:"long",day:"numeric"})=>{if(!t)return;const i=new Date(parseInt(t)*1e3);t=i.toLocaleDateString("en-GB",e);return t}));G.define("date_short",((t,e="d/m/y")=>{if(!t)return;const i=new Date(parseInt(t)*1e3);t=e.replace(/(d)/,i.getDate().toString());t=t.replace(/(m)/,(i.getMonth()+1).toString());t=t.replace(/(y)/,i.getFullYear().toString());return t}));G.define("public_name",(t=>{if(!t)return;t=t.split("_").map((t=>t.length<3?t.toUpperCase():t)).join(" ");return t.charAt(0).toUpperCase()+t.slice(1)}));G.define("trim_to",((t,e=100)=>{if(!t)return;if(t.length<=e)return t;return t.substr(0,e)+"..."}));G.define("classname",(t=>{if(!t)return;return t.replace(/[\W]+/g,"")}));G.define("abs_url",((t,e=null,i)=>{if(!e)return t;if(!t)return;let s=undefined;if(e.domains&&i&&i.origin){const t=e.domains.find((t=>t.origin===i.origin));s=t?t.domain:""}else if(e.domain)s=e.domain;if(t.match(/^http/)||!s)return t;if(!t.startsWith("/"))t="/"+t;return location.protocol+"//"+s+t}));G.define("replace",((t,e,i)=>t.replace(e,i)));G.define("remove_spaces",(t=>t.replace(/ /g,"_")));G.define("add_spaces",(t=>t=t.replace(/[_\-]/g," ")));G.define("capitalise",(t=>t=t.charAt(0).toUpperCase()+t.slice(1)));G.define("lowercase",(t=>t=t.toLowerCase()));const et=tt;const it=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{position:relative;display:block}:host ::slotted([slot=search-template]){display:none !important}.loader{opacity:0;position:fixed;block-size:100%;inline-size:100%;min-block-size:100%;max-block-size:100vh !important;max-inline-size:100vw !important;inset-inline-start:0;inset-block-start:0;z-index:-10;font-size:60px;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease, z-index 0.01s ease 0.2s}.loader.loading{opacity:1;z-index:10;transition:z-index 0.01s ease, opacity 0.2s ease 0.01s}.default{block-size:100%}.default:focus{outline:none}.results{opacity:0;outline:none;overflow:auto;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.01s ease 0.3s, z-index 0.01s ease 0.3s;transform:translate(0, 100px);visibility:hidden;z-index:-1;position:absolute;inset-block-start:0;inset-inline-start:0;display:none}.results-container{position:relative}.results.show{transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.3s ease 0.01s, opacity 0.3s ease 0.01s, overflow 0.01s ease 0.31s;transform:translate(0, 0);visibility:visible;opacity:1;z-index:10;overflow:hidden}.results.shown{block-size:auto !important;inline-size:auto !important;display:block;position:static;transform:none;z-index:auto;visibility:inherit;opacity:initial;overflow:visible}";const st=class{constructor(t){i(this,t);this.nanoDidLoad=s(this,"nanoDidLoad",7);this.nanoResultsShown=s(this,"nanoResultsShown",3);this.nanoBeforeQuery=s(this,"nanoBeforeQuery",7);this.nanoAfterQuery=s(this,"nanoAfterQuery",7);this.nanoNewResults=s(this,"nanoNewResults",7);this.staticFacetFilters={};this.dynFacetFilters={};this.hasLoadSlot=false;this.placedAlgoliaEles=[];this.promiseQueue=new g;this.searchChange=async()=>{if(!this.algoliaIndex)return;if(!this.query||this.query.length<this.minChars){if(!this.browseIndex){if(!this.query||this.query.length===0){this.handleSearchReset();return}else return}else if(this.query!=="*"){this.query="*";return}}this.isLoading=true;setTimeout((async()=>{this.resetPage();await this.algoliaSearch(u.Init);await this.updateContent();setTimeout((t=>this.isLoading=false),800);this.showResults=true;this.nanoResultsShown.emit({meta:this.indexResults,client:{appId:this.appId,apiKey:this.apiKey}})}),200)};this.makeAppliedFilters=()=>{const t=[];const e=e=>{Object.values(e).forEach((e=>{if(e.value&&e.value.length){const i=t.find((t=>t.name===e.facetName));if(!i)t.push({name:e.facetName,values:[...e.value]});else i.values=[...i.values,...e.value]}}))};e(this.dynFacetFilters);e(this.staticFacetFilters);if(t.length)return t;return null};this.algoliaSearch=async t=>this.promiseQueue.enqueue((()=>this.queueSearch(t)));this.queueSearch=async t=>{if(!this.algoliaIndex||!this.query||!this.searchIndex||!this.searchIndex.index)return;this.nanoBeforeQuery.emit(this.indexResults);if(u.Init===t)this.clearAllFacetFilters();const e={filters:this.algoliaFilterStr(),page:this.indexResults?this.indexResults.currentPage:0,clickAnalytics:true};if(this.searchIndex.filters)e.facets=this.searchIndex.filters;if(this.searchIndex.hitsPerPage)e.hitsPerPage=this.searchIndex.hitsPerPage;let i=await this.algoliaIndex.search(this.query,e);i=this.fixDomain(i);this.changeEvent=t;if(t===u.Init||!this.indexResults){this.indexResults={queryID:i.queryID,currentPage:0,totalHits:i.nbHits,hitsPerPage:null,origFilters:i.facets,query:this.query,domain:this.searchIndex.domain||null,totalHitsWithFilters:0,results:[],totalPages:0,appliedFilters:this.makeAppliedFilters(),indexName:this.searchIndex.name||null,index:this.searchIndex.index,searchIndex:this.searchIndex}}this.indexResults.dynFilters=i.facets;this.indexResults.results=i.hits;this.indexResults.totalHitsWithFilters=i.nbHits;this.indexResults.currentPage=i.page;this.indexResults.totalPages=i.nbPages;this.indexResults.hitsPerPage=i.hitsPerPage;this.indexResults.query=i.query;if(this.changeEvent!==u.Page&&this.changeEvent!==u.Replica){this.facets=i.facets}this.nanoAfterQuery.emit(this.indexResults);return new Promise((t=>{setTimeout((()=>t("tpl updated")),20)})).then((t=>{this.currentHits=this.indexResults.results;this.resultsPage=this.indexResults.currentPage}))};this.handleSearchReset=()=>{this.showResults=false;this.indexResults=null};this.onResultDisplay=()=>{n((()=>{this.resultsDiv.removeEventListener("transitionend",this.onResultDisplay);if(!this.showResults)this.resultsDiv.style.display="none";else{this.defaultDiv.style.display="none";this.resultsDiv.classList.add("shown");this.resultsDiv.style.minHeight="";this.resultsDiv.style.width=""}}))};this._dynFacetFilters={};this.inputField=undefined;this.algoliaIndex=undefined;this.indeces=[];this.indexResults=undefined;this.filterChanged="";this.currentHits=undefined;this.changeEvent=u.Init;this.isLoading=false;this.wormholeState=this;this.showResults=false;this.resultsPage=0;this.appId=undefined;this.apiKey=undefined;this.searchIndex={};this.searchIndexName="";this.listenTo=null;this.query="";this.operator="and";this.filters=[];this.tplRenderFn=et.render;this.replicaIndex="";this.browseIndex=false;this.minChars=2;this.storeId=undefined;this.storeMethod="session"}handleListenToChange(){if(!this.listenTo)return;const t=document.querySelector(this.listenTo);if(["nano-input","input"].includes(t.tagName.toLocaleLowerCase())){this.inputField=t}}async removeFilters(t,e){if(!t&&!e)this.clearAllFacetFilters();else{Object.keys(this._dynFacetFilters).forEach((i=>{if(t&&this._dynFacetFilters[i].facetName===t){if(!e)this._dynFacetFilters[i].element.value="";else{this._dynFacetFilters[i].element.value=this._dynFacetFilters[i].value.filter((t=>t!==e))}}}))}}onAllTplUpdate(t){t.stopPropagation();if(t.target.tagName==="NANO-ALGOLIA-RESULTS"){requestAnimationFrame((()=>{this.nanoNewResults.emit(this.indexResults)}))}}async onPageChange(t){if(!this.indexResults)return;let e=this.resultsPage;if(t){t.stopPropagation();e=t.detail.page}e=Math.min(this.indexResults.totalPages-1,e);e=Math.max(e,0);if(this.indexResults.currentPage===e)return;this.indexResults.currentPage=e;await this.algoliaSearch(u.Page)}async onFilterChange(t){t.stopPropagation();const e={};const i=t.detail;i.element=t.target;if(this.indexResults){if(this.staticFacetFilters[i.filterId])this.staticFacetFilters[i.filterId]=i;else{e[i.filterId]=i;this._dynFacetFilters={...this._dynFacetFilters,...e}}this.indexResults.appliedFilters=this.makeAppliedFilters()}else this.staticFacetFilters[i.filterId]=i;this.filterChanged=i.value&&i.value.length?i.filterId:"all";this.resetPage();this.algoliaSearch(u.Filter)}dynFacetFiltersChange(){Object.values(this._dynFacetFilters).forEach((t=>{if(this.host.ownerDocument===t.element.ownerDocument)this.dynFacetFilters[t.filterId]=t;else delete this.dynFacetFilters[t.filterId]}))}browseIndexChange(){if(this.browseIndex&&(!this.query||this.query.length<this.minChars)){this.query="*"}}inputFieldSet(){if(!this.inputField)return;if(this.query!=="*"&&this.inputField&&this.inputField.value!==this.query)this.inputField.value=this.query}queryChange(){this.searchChange()}async internalIndexSwitch(){if(!this.replicaIndex||!this.indexResults||this.indexResults.index===this.replicaIndex)return;this.indexResults.index=this.replicaIndex;this.algoliaIndex=this.algoliaClient.initIndex(this.indexResults.index);this.resetPage();this.algoliaSearch(u.Replica)}pageChange(){this.onPageChange()}searchIndexNameChange(){if(!this.searchIndexName||!this.searchIndexName.length||this.searchIndex&&this.searchIndex.index===this.searchIndexName)return;this.searchIndex={index:this.searchIndexName}}initAlgoliaClient(){if(!this.appId||!this.apiKey)return;this.algoliaClient=h(this.appId,this.apiKey)}initAlgoliaIndex(){if(!this.algoliaClient||!this.searchIndex)return;if(this.searchIndex.index){if(!this.searchIndex.hitsPerPage)this.searchIndex.hitsPerPage=100;if(this.replicaIndex)this.searchIndex.index=this.replicaIndex;this.searchIndexName=this.searchIndex.index;this.algoliaIndex=this.algoliaClient.initIndex(this.searchIndex.index);this.searchChange()}}showResultsChange(){if(!this.resultsDiv||!this.defaultDiv)return;if(this.showResults){this.resultsDiv.style.width=this.host.scrollWidth+"px";this.resultsDiv.style.minHeight=this.host.scrollHeight+"px";n((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.style.display="block";setTimeout((()=>this.resultsDiv.classList.add("show")),50)}))}else{n((()=>{this.resultsDiv.classList.remove("shown");this.defaultDiv.style.display="block";setTimeout((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.classList.remove("show");if(!!this.slottedInput)this.slottedInput.focus({preventScroll:true});else this.defaultDiv.focus({preventScroll:true})}),50)}))}}handleFilterpropChange(){this.algoliaSearch(u.Init)}fixDomain(t){if(!this.searchIndex||!this.searchIndex.domain)return t;t.hits.map((t=>{if(t.url&&!t.url.match(/^http/))t.url=location.protocol+"//"+this.searchIndex.domain+t.url}));return t}resetPage(){if(!this.indexResults)return;this.indexResults.currentPage=0}clearAllFacetFilters(){Object.values(this._dynFacetFilters).forEach((t=>{t.element.value=""}));this._dynFacetFilters={}}algoliaFilterStr(){const t={};const e=e=>{let i;let s;Object.keys(e).forEach((n=>{i=e[n];t[n]=t[n]||{name:i.facetName,or:[],and:[],not:[]};s=t[n][i.operator];if(i.value&&i.value.length){t[n][i.operator]=[...s,...i.value]}}))};e(this.dynFacetFilters);e(this.staticFacetFilters);const i=(t,e)=>{if(e.indexOf(" ")>-1)return t+':"'+e+'"';else return t+":"+e};let s=[];let n;let r;Object.values(t).forEach((function(t){Object.keys(t).filter((t=>t.match(/(or|and|not)/))).forEach((e=>{n=t;r=t.name;if(e==="or"||e==="and"){if(n[e].length){s.push("( "+n[e].map((t=>{if(t.length)return i(r,t)})).join(" "+e.toLocaleUpperCase()+" ")+" )")}}else{if(n.not.length){s.push("( "+n[e].map((t=>{if(t.length)return"NOT "+i(r,t)})).join(" AND ")+" )")}}}))}));s=[...this.filters,...s];return s.join(" "+this.operator.toLocaleUpperCase()+" ")}handleInputChange(t){if(t.target!==this.inputField)return;this.query=this.inputField.value}async updateContent(){return this.promiseQueue.enqueue((()=>this.updateContentQueue()))}async updateContentQueue(){const t=this.outputSlot||this.resultsDiv;if(!t||!this.tpl)return"no tpl";const e=document.createElement("div");e.innerHTML=this.tpl;const i=[];this.placedAlgoliaEles=[];Array.from(e.querySelectorAll("nano-algolia, nano-algolia-filter, nano-algolia-results")).forEach(((t,e)=>{const s=document.createElement("div");s.dataset.placeholderId=e.toString();s.classList.add("nano-ele-placeholder");i.push(t);t.parentNode.replaceChild(s,t)}));t.innerHTML=this.tplRenderFn(e.innerHTML.replace(/&gt;/gm,">").replace(/&lt;/gm,"<").replace(/&amp;/gm,"&"),this.indexResults);Array.from(t.querySelectorAll("div.nano-ele-placeholder")).forEach((t=>{t.parentNode.replaceChild(i[parseInt(t.dataset.placeholderId)],t);this.placedAlgoliaEles.push(i[parseInt(t.dataset.placeholderId)])}));if(!this.placedAlgoliaEles.length)return Promise.resolve("algolia setup");return new Promise((e=>{const i=s=>{this.placedAlgoliaEles=this.placedAlgoliaEles.filter((t=>t!==s.detail));if(!this.placedAlgoliaEles.length){setTimeout((()=>e("tpl updated")),500);t.removeEventListener("nanoTplUpdated",i)}};t.addEventListener("nanoTplUpdated",i)}))}componentWillLoad(){r((t=>{this.tplSlot=a(this.host,'[slot="template"]')[0];this.outputSlot=a(this.host,'[slot="output"]')[0];this.slottedInput=a(this.host,'[slot="search-input"]')[0];this.hasLoadSlot=!!a(this.host,'[slot="loader"]')[0];if(!!this.tplSlot)this.tpl=this.tplSlot.innerHTML||this.tplSlot.innerText;if(this.slottedInput&&(this.slottedInput.tagName.toLocaleLowerCase()==="nano-input"||this.slottedInput instanceof HTMLInputElement)){this.inputField=this.slottedInput}else if(this.slottedInput){this.inputField=this.slottedInput.querySelector('nano-input, input:not([type="radio"]):not([type="checkbox"])')}else this.handleListenToChange();n((t=>{if(this.showResults&&this.tpl)this.searchChange()}))}));this.searchIndexNameChange();this.initAlgoliaClient();this.initAlgoliaIndex();m.create(this,this.wormholeState);if(this.storeId){c.init(this,["query","replicaIndex"],this.storeMethod,this.storeId);c.init(this,["apiKey","appId","searchIndex"],"session",this.storeId+"_api")}this.internalIndexSwitch()}connectedCallback(){this.searchChange=f(this.searchChange,300);this.browseIndexChange();this.host.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.host}))}render(){const t={indexResults:this.indexResults,results:this.currentHits,filterChanged:this.filterChanged,tplRenderFn:this.tplRenderFn,resultsPage:this.resultsPage,changeEvent:this.changeEvent,facets:this.facets,algoliaIndex:this.algoliaIndex,searchIndex:this.searchIndex,globalStoreMethod:this.storeMethod,isLoading:this.isLoading};return o(l,{class:{"show-results":this.showResults,"is-loading":this.isLoading},"aria-busy":this.isLoading},this.hasLoadSlot&&o("div",{hidden:!this.isLoading},o("slot",{name:"loader"})),!this.hasLoadSlot&&o("div",{class:{loader:true,loading:this.isLoading}},o("nano-spinner",{overlay:true,type:"circle"})),o(m.Provider,{state:t},o("slot",{name:"search-input"}),o("div",{class:"results-container","aria-live":"polite"},o("div",{ref:t=>this.resultsDiv=t,class:"results"},o("slot",{name:"output"})))),o("div",{ref:t=>this.defaultDiv=t,class:"default",tabindex:"-1"},o("slot",null)))}get host(){return t(this)}static get watchers(){return{listenTo:["handleListenToChange"],_dynFacetFilters:["dynFacetFiltersChange"],browseIndex:["browseIndexChange"],inputField:["inputFieldSet"],query:["queryChange"],replicaIndex:["internalIndexSwitch"],resultsPage:["pageChange"],searchIndexName:["searchIndexNameChange"],apiKey:["initAlgoliaClient"],appId:["initAlgoliaClient"],searchIndex:["initAlgoliaIndex"],showResults:["showResultsChange"],filters:["handleFilterpropChange"]}}};st.style=it;export{st as nano_algolia};
4
+ import{g as t,e,r as i,c as s,w as n,d as r,h as o,a as l}from"./index-9695db0a.js";import{a as h}from"./algoliasearch-lite.esm.browser-d71a28dc.js";import{g as a}from"./dom-8599fac1.js";import{C as c}from"./component-store-64043183.js";import{d as f}from"./throttle-ac4fcefa.js";import{S as u}from"./algolia-data-1b42827c.js";var d=new Map;var p=function(t,e){var i=t.fields,s=t.updater;i.forEach((function(t){s(t,e[t])}))};var m={create:function(e,i){var s=t(e);var n=new Map;var r={wormholes:n,state:i};d.set(e,r);var o=e.connectedCallback;e.connectedCallback=function(){d.set(e,r);if(o){o.call(e)}};var l=e.disconnectedCallback;e.disconnectedCallback=function(){d.delete(e);if(l){l.call(e)}};s.addEventListener("openWormhole",(function(t){t.stopPropagation();var e=t.detail,i=e.consumer,s=e.onOpen;if(n.has(i))return;if(typeof i!=="symbol"){var o=i.connectedCallback,l=i.disconnectedCallback;i.connectedCallback=function(){n.set(i,t.detail);if(o){o.call(i)}};i.disconnectedCallback=function(){n.delete(i);if(l){l.call(i)}}}n.set(i,t.detail);p(t.detail,r.state);s===null||s===void 0?void 0:s.resolve((function(){n.delete(i)}))}));s.addEventListener("closeWormhole",(function(t){var e=t.detail;n.delete(e)}))},Provider:function(t,i){var s=t.state;var n=e();if(d.has(n)){var r=d.get(n);r.state=s;r.wormholes.forEach((function(t){p(t,s)}))}return i}};class g{constructor(){this.queue=[];this.workingOnPromise=false;this.stop=false;this.limit=null}enqueue(t){return new Promise(((e,i)=>{this.queue.push({promise:t,resolve:e,reject:i});this.dequeue()}))}dequeue(){if(this.workingOnPromise){return false}if(this.stop){this.queue=[];this.stop=false;return}const t=this.queue.shift();if(!t){return false}try{this.workingOnPromise=true;t.promise().then((e=>{this.workingOnPromise=false;t.resolve(e);this.dequeue()})).catch((e=>{this.workingOnPromise=false;t.reject(e);this.dequeue()}))}catch(e){this.workingOnPromise=false;t.reject(e);this.dequeue()}return true}}g.pendingPromise=false;function y(t,e){if(Object.setPrototypeOf){Object.setPrototypeOf(t,e)}else{t.__proto__=e}}function w(t){const e=new Error(t);y(e,w.prototype);return e}w.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:false}});function b(t,e,i){const s=e.slice(0,i).split(/\n/);const n=s.length;const r=s[n-1].length+1;t+=" at line "+n+" col "+r+":\n\n"+" "+e.split(/\n/)[n-1]+"\n"+" "+Array(r).join(" ")+"^";throw w(t)}const v=new Function("return this")().Promise;let x=false;try{x=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError)){throw t}}function F(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function C(t,e,i){for(const s in e){if(F(e,s)){if(e[s]!=null&&typeof e[s]=="object"&&(s==="storage"||s==="prefixes")&&!i){t[s]=C({},e[s])}else{t[s]=e[s]}}}return t}function I(t,e,i,s){let n;let r;if(typeof e.autoTrim==="string"){n=r=e.autoTrim}else if(Array.isArray(e.autoTrim)){n=e.autoTrim[1];r=e.autoTrim[0]}if(i||i===false){n=i}if(s||s===false){r=s}if(n==="slurp"&&r==="slurp"){return t.trim()}if(n==="_"||n==="slurp"){if(!!String.prototype.trimLeft){t=t.trimLeft()}else{t=t.replace(/^[\s\uFEFF\xA0]+/,"")}}else if(n==="-"||n==="nl"){t=t.replace(/^(?:\n|\r|\r\n)/,"")}if(r==="_"||r==="slurp"){if(!!String.prototype.trimRight){t=t.trimRight()}else{t=t.replace(/[\s\uFEFF\xA0]+$/,"")}}else if(r==="-"||r==="nl"){t=t.replace(/(?:\n|\r|\r\n)$/,"")}return t}const S=/^async +/;const j=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g;const z=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g;const A=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;const R=/[.*+\-?^${}()|[\]\\]/g;function _(t){return R.test(t)?t.replace(R,"\\$&"):t}function k(t,e){if(e.rmWhitespace){t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")}j.lastIndex=0;z.lastIndex=0;A.lastIndex=0;const i=e.prefixes;const s=[i.h,i.b,i.i,i.r,i.c,i.e].reduce((function(t,e){if(t&&e){return t+"|"+_(e)}else if(e){return _(e)}else{return t}}),"");const n=new RegExp("([|()]|=>)|"+"('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+_(e.tags[1])+")","g");const r=new RegExp("([^]*?)"+_(e.tags[0])+"(-|_)?\\s*("+s+")?\\s*","g");let o=0;let l=false;function h(i,s){const h={f:[]};let a=0;let c="c";if(s==="h"||s==="b"||s==="c"){c="n"}else if(s==="r"){h.raw=true;s="i"}function f(i){const s=t.slice(o,i);let n=s.trim();if(c==="f"){if(n==="safe"){h.raw=true}else{if(e.async&&S.test(n)){n=n.replace(S,"");h.f.push([n,"",true])}else{h.f.push([n,""])}}}else if(c==="fp"){h.f[h.f.length-1][1]+=n}else if(c==="err"){if(n){const e=s.search(/\S/);b("invalid syntax",t,o+e)}}else{h[c]=n}o=i+1}n.lastIndex=o;let u;while((u=n.exec(t))!==null){const e=u[1];const i=u[2];const d=u[3];const p=u[4];const m=u[5];const g=u.index;if(e){if(e==="("){if(a===0){if(c==="n"){f(g);c="p"}else if(c==="f"){f(g);c="fp"}}a++}else if(e===")"){a--;if(a===0&&c!=="c"){f(g);c="err"}}else if(a===0&&e==="|"){f(g);c="f"}else if(e==="=>"){f(g);o+=1;c="res"}}else if(i){if(i==="/*"){const e=t.indexOf("*/",n.lastIndex);if(e===-1){b("unclosed comment",t,u.index)}n.lastIndex=e+2}else if(i==="'"){z.lastIndex=u.index;const e=z.exec(t);if(e){n.lastIndex=z.lastIndex}else{b("unclosed string",t,u.index)}}else if(i==='"'){A.lastIndex=u.index;const e=A.exec(t);if(e){n.lastIndex=A.lastIndex}else{b("unclosed string",t,u.index)}}else if(i==="`"){j.lastIndex=u.index;const e=j.exec(t);if(e){n.lastIndex=j.lastIndex}else{b("unclosed string",t,u.index)}}}else if(d){f(g);o=g+u[0].length;r.lastIndex=o;l=m;if(p&&s==="h"){s="s"}h.t=s;return h}}b("unclosed tag",t,i);return h}function a(s,n){s.b=[];s.d=[];let c=false;let f=[];function u(t,i){if(t){t=I(t,e,l,i);if(t){t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n");f.push(t)}}}let d;while((d=r.exec(t))!==null){const n=d[1];const r=d[2];const l=d[3]||"";let p;for(const t in i){if(i[t]===l){p=t;break}}u(n,r);o=d.index+d[0].length;if(!p){b("unrecognized tag type: "+l,t,o)}let m=h(d.index,p);const g=m.t;if(g==="h"){const t=m.n||"";if(e.async&&S.test(t)){m.a=true;m.n=t.replace(S,"")}m=a(m);f.push(m)}else if(g==="c"){if(s.n===m.n){if(c){c.d=f;s.b.push(c)}else{s.d=f}return s}else{b("Helper start and end don't match",t,d.index+d[0].length)}}else if(g==="b"){if(c){c.d=f;s.b.push(c)}else{s.d=f}const t=m.n||"";if(e.async&&S.test(t)){m.a=true;m.n=t.replace(S,"")}c=m;f=[]}else if(g==="s"){const t=m.n||"";if(e.async&&S.test(t)){m.a=true;m.n=t.replace(S,"")}f.push(m)}else{f.push(m)}}if(n){u(t.slice(o,t.length),false);s.d=f}else{throw w('unclosed helper "'+s.n+'"')}return s}const c=a({f:[]},true);if(e.plugins){for(let t=0;t<e.plugins.length;t++){const i=e.plugins[t];if(i.processAST){c.d=i.processAST(c.d,e)}}}return c.d}function T(t,e){const i=k(t,e);let s="var tR='';"+(e.useWith?"with("+e.varName+"||{}){":"")+q(i,e)+"if(cb){cb(null,tR)} return tR"+(e.useWith?"}":"");if(e.plugins){for(let t=0;t<e.plugins.length;t++){const i=e.plugins[t];if(i.processFnString){s=i.processFnString(s,e)}}}return s}function P(t,e){for(let i=0;i<e.length;i++){const s=e[i][0];const n=e[i][1];const r=e[i][2];t=(r?"await ":"")+"c.l('F','"+s+"')("+t;if(n){t+=","+n}t+=")"}return t}function O(t,e,i,s,n,r){let o="{exec:"+(n?"async ":"")+N(i,e,t)+",params:["+s+"]";if(r){o+=",name:'"+r+"'"}if(n){o+=",async:true"}o+="}";return o}function E(t,e){let i="[";for(let s=0;s<t.length;s++){const n=t[s];i+=O(e,n.res||"",n.d,n.p||"",n.a,n.n);if(s<t.length){i+=","}}i+="]";return i}function N(t,e,i){return"function("+e+"){var tR='';"+q(t,i)+"return tR}"}function q(t,e){let i=0;const s=t.length;let n="";for(i;i<s;i++){const s=t[i];if(typeof s==="string"){const t=s;n+="tR+='"+t+"';"}else{const t=s.t;let i=s.c||"";const r=s.f;const o=s.n||"";const l=s.p||"";const h=s.res||"";const a=s.b;const c=!!s.a;if(t==="i"){if(e.defaultFilter){i="c.l('F','"+e.defaultFilter+"')("+i+")"}let t=P(i,r);if(!s.raw&&e.autoEscape){t="c.l('F','e')("+t+")"}n+="tR+="+t+";"}else if(t==="h"){if(e.storage.nativeHelpers.get(o)){n+=e.storage.nativeHelpers.get(o)(s,e)}else{let t=(c?"await ":"")+"c.l('H','"+o+"')("+O(e,h,s.d,l,c);if(a){t+=","+E(a,e)}else{t+=",[]"}t+=",c)";n+="tR+="+P(t,r)+";"}}else if(t==="s"){n+="tR+="+P((c?"await ":"")+"c.l('H','"+o+"')({params:["+l+"]},[],c)",r)+";"}else if(t==="e"){n+=i+"\n"}}}return n}class H{constructor(t){this.cache=t}define(t,e){this.cache[t]=e}get(t){return this.cache[t]}remove(t){delete this.cache[t]}reset(){this.cache={}}load(t){C(this.cache,t,true)}}function L(t,e,i,s){if(e&&e.length>0){throw w((s?"Native":"")+"Helper '"+t+"' doesn't accept blocks")}if(i&&i.length>0){throw w((s?"Native":"")+"Helper '"+t+"' doesn't accept filters")}}function $(t,e,i,s,n){i(t[e],e).then((function(r){s+=r;if(e===t.length-1){n(s)}else{$(t,e+1,i,s,n)}}))}function D(t,e,i,s,n,r){s(e[i],t[e[i]]).then((function(o){n+=o;if(i===e.length-1){r(n)}else{D(t,e,i+1,s,n,r)}}))}const M={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function W(t){return M[t]}function U(t){const e=String(t);if(/[&<>"']/.test(e)){return e.replace(/[&<>"']/g,W)}else{return e}}const B=new H({});const K=new H({each:function(t,e){let i="";const s=t.params[0];L("each",e,false);if(t.async){return new Promise((function(e){$(s,0,t.exec,i,e)}))}else{for(let e=0;e<s.length;e++){i+=t.exec(s[e],e)}return i}},foreach:function(t,e){const i=t.params[0];L("foreach",e,false);if(t.async){return new Promise((function(e){D(i,Object.keys(i),0,t.exec,"",e)}))}else{let e="";for(const s in i){if(!F(i,s))continue;e+=t.exec(s,i[s])}return e}},include:function(t,e,i){L("include",e,false);const s=i.storage.templates.get(t.params[0]);if(!s){throw w('Could not fetch template "'+t.params[0]+'"')}return s(t.params[1],i)},extends:function(t,e,i){const s=t.params[1]||{};s.content=t.exec();for(let t=0;t<e.length;t++){const i=e[t];s[i.name]=i.exec()}const n=i.storage.templates.get(t.params[0]);if(!n){throw w('Could not fetch template "'+t.params[0]+'"')}return n(s,i)},useScope:function(t,e){L("useScope",e,false);return t.exec(t.params[0])}});const Q=new H({if:function(t,e){L("if",false,t.f,true);let i="if("+t.p+"){"+q(t.d,e)+"}";if(t.b){for(let s=0;s<t.b.length;s++){const n=t.b[s];if(n.n==="else"){i+="else{"+q(n.d,e)+"}"}else if(n.n==="elif"){i+="else if("+n.p+"){"+q(n.d,e)+"}"}}}return i},try:function(t,e){L("try",false,t.f,true);if(!t.b||t.b.length!==1||t.b[0].n!=="catch"){throw w("native helper 'try' only accepts 1 block, 'catch'")}let i="try{"+q(t.d,e)+"}";const s=t.b[0];i+="catch"+(s.res?"("+s.res+")":"")+"{"+q(s.d,e)+"}";return i},block:function(t,e){L("block",t.b,t.f,true);const i="if(!"+e.varName+"["+t.p+"]){tR+=("+N(t.d,"",e)+")()}else{tR+="+e.varName+"["+t.p+"]}";return i}});const G=new H({e:U});const J={varName:"it",autoTrim:[false,"nl"],autoEscape:true,defaultFilter:false,tags:["{{","}}"],l:function(t,e){if(t==="H"){const t=this.storage.helpers.get(e);if(t){return t}else{throw w("Can't find helper '"+e+"'")}}else if(t==="F"){const t=this.storage.filters.get(e);if(t){return t}else{throw w("Can't find filter '"+e+"'")}}},async:false,storage:{helpers:K,nativeHelpers:Q,filters:G,templates:B},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:false,plugins:[],useWith:false};J.l.bind(J);function V(t,e){const i={};C(i,J);if(e){C(i,e)}if(t){C(i,t)}i.l.bind(i);return i}function X(t,e){const i=V(e||{});let s=Function;if(i.async){if(x){s=x}else{throw w("This environment doesn't support async/await")}}try{return new s(i.varName,"c","cb",T(t,i))}catch(e){if(e instanceof SyntaxError){throw w("Bad template syntax\n\n"+e.message+"\n"+Array(e.message.length+1).join("=")+"\n"+T(t,i))}else{throw e}}}function Y(t,e){let i;if(e.cache&&e.name&&e.storage.templates.get(e.name)){return e.storage.templates.get(e.name)}if(typeof t==="function"){i=t}else{i=X(t,e)}if(e.cache&&e.name){e.storage.templates.define(e.name,i)}return i}function Z(t,e,i,s){const n=V(i||{});if(n.async){let i;if(!s){if(typeof v==="function"){return new v((function(s,r){try{i=Y(t,n)(e,n);s(i)}catch(t){r(t)}}))}else{throw w("Please provide a callback function, this env doesn't support Promises")}}else{try{Y(t,n)(e,n,s)}catch(t){return s(t)}}}else{return Y(t,n)(e,n)}}const tt=Object.freeze({__proto__:null,compileToString:T,compileScope:q,compileScopeIntoFunction:N,compile:X,parse:k,render:Z,helpers:K,nativeHelpers:Q,filters:G,templates:B,defaultConfig:J,getConfig:V});G.define("date_long",((t,e={year:"numeric",month:"long",day:"numeric"})=>{if(!t)return;const i=new Date(parseInt(t)*1e3);t=i.toLocaleDateString("en-GB",e);return t}));G.define("date_short",((t,e="d/m/y")=>{if(!t)return;const i=new Date(parseInt(t)*1e3);t=e.replace(/(d)/,i.getDate().toString());t=t.replace(/(m)/,(i.getMonth()+1).toString());t=t.replace(/(y)/,i.getFullYear().toString());return t}));G.define("public_name",(t=>{if(!t)return;t=t.split("_").map((t=>t.length<3?t.toUpperCase():t)).join(" ");return t.charAt(0).toUpperCase()+t.slice(1)}));G.define("trim_to",((t,e=100)=>{if(!t)return;if(t.length<=e)return t;return t.substr(0,e)+"..."}));G.define("classname",(t=>{if(!t)return;return t.replace(/[\W]+/g,"")}));G.define("abs_url",((t,e=null,i)=>{if(!e)return t;if(!t)return;let s=undefined;if(e.domains&&i&&i.origin){const t=e.domains.find((t=>t.origin===i.origin));s=t?t.domain:""}else if(e.domain)s=e.domain;if(t.match(/^http/)||!s)return t;if(!t.startsWith("/"))t="/"+t;return location.protocol+"//"+s+t}));G.define("replace",((t,e,i)=>t.replace(e,i)));G.define("remove_spaces",(t=>t.replace(/ /g,"_")));G.define("add_spaces",(t=>t=t.replace(/[_\-]/g," ")));G.define("capitalise",(t=>t=t.charAt(0).toUpperCase()+t.slice(1)));G.define("lowercase",(t=>t=t.toLowerCase()));const et=tt;const it=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{position:relative;display:block}:host ::slotted([slot=search-template]){display:none !important}.loader{opacity:0;position:fixed;block-size:100%;inline-size:100%;min-block-size:100%;max-block-size:100vh !important;max-inline-size:100vw !important;inset-inline-start:0;inset-block-start:0;z-index:-10;font-size:60px;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease, z-index 0.01s ease 0.2s}.loader.loading{opacity:1;z-index:10;transition:z-index 0.01s ease, opacity 0.2s ease 0.01s}.default{block-size:100%}.default:focus{outline:none}.results{opacity:0;outline:none;overflow:auto;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.01s ease 0.3s, z-index 0.01s ease 0.3s;transform:translate(0, 100px);visibility:hidden;z-index:-1;position:absolute;inset-block-start:0;inset-inline-start:0;display:none}.results-container{position:relative}.results.show{transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.3s ease 0.01s, opacity 0.3s ease 0.01s, overflow 0.01s ease 0.31s;transform:translate(0, 0);visibility:visible;opacity:1;z-index:10;overflow:hidden}.results.shown{block-size:auto !important;inline-size:auto !important;display:block;position:static;transform:none;z-index:auto;visibility:inherit;opacity:initial;overflow:visible}";const st=class{constructor(t){i(this,t);this.nanoDidLoad=s(this,"nanoDidLoad",7);this.nanoResultsShown=s(this,"nanoResultsShown",3);this.nanoBeforeQuery=s(this,"nanoBeforeQuery",7);this.nanoAfterQuery=s(this,"nanoAfterQuery",7);this.nanoNewResults=s(this,"nanoNewResults",7);this.staticFacetFilters={};this.dynFacetFilters={};this.hasLoadSlot=false;this.placedAlgoliaEles=[];this.promiseQueue=new g;this.searchChange=async()=>{if(!this.algoliaIndex)return;if(!this.query||this.query.length<this.minChars){if(!this.browseIndex){if(!this.query||this.query.length===0){this.handleSearchReset();return}else return}else if(this.query!=="*"){this.query="*";return}}this.isLoading=true;setTimeout((async()=>{this.resetPage();await this.algoliaSearch(u.Init);await this.updateContent();setTimeout((t=>this.isLoading=false),800);this.showResults=true;this.nanoResultsShown.emit({meta:this.indexResults,client:{appId:this.appId,apiKey:this.apiKey}})}),200)};this.makeAppliedFilters=()=>{const t=[];const e=e=>{Object.values(e).forEach((e=>{if(e.value&&e.value.length){const i=t.find((t=>t.name===e.facetName));if(!i)t.push({name:e.facetName,values:[...e.value]});else i.values=[...i.values,...e.value]}}))};e(this.dynFacetFilters);e(this.staticFacetFilters);if(t.length)return t;return null};this.algoliaSearch=async t=>this.promiseQueue.enqueue((()=>this.queueSearch(t)));this.queueSearch=async t=>{if(!this.algoliaIndex||!this.query||!this.searchIndex||!this.searchIndex.index)return;this.nanoBeforeQuery.emit(this.indexResults);if(u.Init===t)this.clearAllFacetFilters();const e={filters:this.algoliaFilterStr(),page:this.indexResults?this.indexResults.currentPage:0,clickAnalytics:true};if(this.searchIndex.filters)e.facets=this.searchIndex.filters;if(this.searchIndex.hitsPerPage)e.hitsPerPage=this.searchIndex.hitsPerPage;let i=await this.algoliaIndex.search(this.query,e);i=this.fixDomain(i);this.changeEvent=t;if(t===u.Init||!this.indexResults){this.indexResults={queryID:i.queryID,currentPage:0,totalHits:i.nbHits,hitsPerPage:null,origFilters:i.facets,query:this.query,domain:this.searchIndex.domain||null,totalHitsWithFilters:0,results:[],totalPages:0,appliedFilters:this.makeAppliedFilters(),indexName:this.searchIndex.name||null,index:this.searchIndex.index,searchIndex:this.searchIndex}}this.indexResults.dynFilters=i.facets;this.indexResults.results=i.hits;this.indexResults.totalHitsWithFilters=i.nbHits;this.indexResults.currentPage=i.page;this.indexResults.totalPages=i.nbPages;this.indexResults.hitsPerPage=i.hitsPerPage;this.indexResults.query=i.query;if(this.changeEvent!==u.Page&&this.changeEvent!==u.Replica){this.facets=i.facets}this.nanoAfterQuery.emit(this.indexResults);return new Promise((t=>{setTimeout((()=>t("tpl updated")),20)})).then((t=>{this.currentHits=this.indexResults.results;this.resultsPage=this.indexResults.currentPage}))};this.handleSearchReset=()=>{this.showResults=false;this.indexResults=null};this.onResultDisplay=()=>{n((()=>{this.resultsDiv.removeEventListener("transitionend",this.onResultDisplay);if(!this.showResults)this.resultsDiv.style.display="none";else{this.defaultDiv.style.display="none";this.resultsDiv.classList.add("shown");this.resultsDiv.style.minHeight="";this.resultsDiv.style.width=""}}))};this._dynFacetFilters={};this.inputField=undefined;this.algoliaIndex=undefined;this.indeces=[];this.indexResults=undefined;this.filterChanged="";this.currentHits=undefined;this.changeEvent=u.Init;this.isLoading=false;this.wormholeState=this;this.showResults=false;this.resultsPage=0;this.appId=undefined;this.apiKey=undefined;this.searchIndex={};this.searchIndexName="";this.listenTo=null;this.query="";this.operator="and";this.filters=[];this.tplRenderFn=et.render;this.replicaIndex="";this.browseIndex=false;this.minChars=2;this.storeId=undefined;this.storeMethod="session"}handleListenToChange(){if(!this.listenTo)return;const t=document.querySelector(this.listenTo);if(["nano-input","input"].includes(t.tagName.toLocaleLowerCase())){this.inputField=t}}async removeFilters(t,e){if(!t&&!e)this.clearAllFacetFilters();else{Object.keys(this._dynFacetFilters).forEach((i=>{if(t&&this._dynFacetFilters[i].facetName===t){if(!e)this._dynFacetFilters[i].element.value="";else{this._dynFacetFilters[i].element.value=this._dynFacetFilters[i].value.filter((t=>t!==e))}}}))}}onAllTplUpdate(t){t.stopPropagation();if(t.target.tagName==="NANO-ALGOLIA-RESULTS"){requestAnimationFrame((()=>{this.nanoNewResults.emit(this.indexResults)}))}}async onPageChange(t){if(!this.indexResults)return;let e=this.resultsPage;if(t){t.stopPropagation();e=t.detail.page}e=Math.min(this.indexResults.totalPages-1,e);e=Math.max(e,0);if(this.indexResults.currentPage===e)return;this.indexResults.currentPage=e;await this.algoliaSearch(u.Page)}async onFilterChange(t){t.stopPropagation();const e={};const i=t.detail;i.element=t.target;if(this.indexResults){if(this.staticFacetFilters[i.filterId])this.staticFacetFilters[i.filterId]=i;else{e[i.filterId]=i;this._dynFacetFilters={...this._dynFacetFilters,...e}}this.indexResults.appliedFilters=this.makeAppliedFilters()}else this.staticFacetFilters[i.filterId]=i;this.filterChanged=i.value&&i.value.length?i.filterId:"all";this.resetPage();this.algoliaSearch(u.Filter)}dynFacetFiltersChange(){Object.values(this._dynFacetFilters).forEach((t=>{if(this.host.ownerDocument===t.element.ownerDocument)this.dynFacetFilters[t.filterId]=t;else delete this.dynFacetFilters[t.filterId]}))}browseIndexChange(){if(this.browseIndex&&(!this.query||this.query.length<this.minChars)){this.query="*"}}inputFieldSet(){if(!this.inputField)return;if(this.query!=="*"&&this.inputField&&this.inputField.value!==this.query)this.inputField.value=this.query}queryChange(){this.searchChange()}async internalIndexSwitch(){if(!this.replicaIndex||!this.indexResults||this.indexResults.index===this.replicaIndex)return;this.indexResults.index=this.replicaIndex;this.algoliaIndex=this.algoliaClient.initIndex(this.indexResults.index);this.resetPage();this.algoliaSearch(u.Replica)}pageChange(){this.onPageChange()}searchIndexNameChange(){if(!this.searchIndexName||!this.searchIndexName.length||this.searchIndex&&this.searchIndex.index===this.searchIndexName)return;this.searchIndex={index:this.searchIndexName}}initAlgoliaClient(){if(!this.appId||!this.apiKey)return;this.algoliaClient=h(this.appId,this.apiKey)}initAlgoliaIndex(){if(!this.algoliaClient||!this.searchIndex)return;if(this.searchIndex.index){if(!this.searchIndex.hitsPerPage)this.searchIndex.hitsPerPage=100;if(this.replicaIndex)this.searchIndex.index=this.replicaIndex;this.searchIndexName=this.searchIndex.index;this.algoliaIndex=this.algoliaClient.initIndex(this.searchIndex.index);this.searchChange()}}showResultsChange(){if(!this.resultsDiv||!this.defaultDiv)return;if(this.showResults){this.resultsDiv.style.width=this.host.scrollWidth+"px";this.resultsDiv.style.minHeight=this.host.scrollHeight+"px";n((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.style.display="block";setTimeout((()=>this.resultsDiv.classList.add("show")),50)}))}else{n((()=>{this.resultsDiv.classList.remove("shown");this.defaultDiv.style.display="block";setTimeout((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.classList.remove("show");if(!!this.slottedInput)this.slottedInput.focus({preventScroll:true});else this.defaultDiv.focus({preventScroll:true})}),50)}))}}handleFilterpropChange(){this.algoliaSearch(u.Init)}fixDomain(t){if(!this.searchIndex||!this.searchIndex.domain)return t;t.hits.map((t=>{if(t.url&&!t.url.match(/^http/))t.url=location.protocol+"//"+this.searchIndex.domain+t.url}));return t}resetPage(){if(!this.indexResults)return;this.indexResults.currentPage=0}clearAllFacetFilters(){Object.values(this._dynFacetFilters).forEach((t=>{t.element.value=""}));this._dynFacetFilters={}}algoliaFilterStr(){const t={};const e=e=>{let i;let s;Object.keys(e).forEach((n=>{i=e[n];t[n]=t[n]||{name:i.facetName,or:[],and:[],not:[]};s=t[n][i.operator];if(i.value&&i.value.length){t[n][i.operator]=[...s,...i.value]}}))};e(this.dynFacetFilters);e(this.staticFacetFilters);const i=(t,e)=>{if(e.indexOf(" ")>-1)return t+':"'+e+'"';else return t+":"+e};let s=[];let n;let r;Object.values(t).forEach((function(t){Object.keys(t).filter((t=>t.match(/(or|and|not)/))).forEach((e=>{n=t;r=t.name;if(e==="or"||e==="and"){if(n[e].length){s.push("( "+n[e].map((t=>{if(t.length)return i(r,t)})).join(" "+e.toLocaleUpperCase()+" ")+" )")}}else{if(n.not.length){s.push("( "+n[e].map((t=>{if(t.length)return"NOT "+i(r,t)})).join(" AND ")+" )")}}}))}));s=[...this.filters,...s];return s.join(" "+this.operator.toLocaleUpperCase()+" ")}handleInputChange(t){if(t.target!==this.inputField)return;this.query=this.inputField.value}async updateContent(){return this.promiseQueue.enqueue((()=>this.updateContentQueue()))}async updateContentQueue(){const t=this.outputSlot||this.resultsDiv;if(!t||!this.tpl)return"no tpl";const e=document.createElement("div");e.innerHTML=this.tpl;const i=[];this.placedAlgoliaEles=[];Array.from(e.querySelectorAll("nano-algolia, nano-algolia-filter, nano-algolia-results")).forEach(((t,e)=>{const s=document.createElement("div");s.dataset.placeholderId=e.toString();s.classList.add("nano-ele-placeholder");i.push(t);t.parentNode.replaceChild(s,t)}));t.innerHTML=this.tplRenderFn(e.innerHTML.replace(/&gt;/gm,">").replace(/&lt;/gm,"<").replace(/&amp;/gm,"&"),this.indexResults);Array.from(t.querySelectorAll("div.nano-ele-placeholder")).forEach((t=>{t.parentNode.replaceChild(i[parseInt(t.dataset.placeholderId)],t);this.placedAlgoliaEles.push(i[parseInt(t.dataset.placeholderId)])}));if(!this.placedAlgoliaEles.length)return Promise.resolve("algolia setup");return new Promise((e=>{const i=s=>{this.placedAlgoliaEles=this.placedAlgoliaEles.filter((t=>t!==s.detail));if(!this.placedAlgoliaEles.length){setTimeout((()=>e("tpl updated")),500);t.removeEventListener("nanoTplUpdated",i)}};t.addEventListener("nanoTplUpdated",i)}))}componentWillLoad(){r((t=>{this.tplSlot=a(this.host,'[slot="template"]')[0];this.outputSlot=a(this.host,'[slot="output"]')[0];this.slottedInput=a(this.host,'[slot="search-input"]')[0];this.hasLoadSlot=!!a(this.host,'[slot="loader"]')[0];if(!!this.tplSlot)this.tpl=this.tplSlot.innerHTML||this.tplSlot.innerText;if(this.slottedInput&&(this.slottedInput.tagName.toLocaleLowerCase()==="nano-input"||this.slottedInput instanceof HTMLInputElement)){this.inputField=this.slottedInput}else if(this.slottedInput){this.inputField=this.slottedInput.querySelector('nano-input, input:not([type="radio"]):not([type="checkbox"])')}else this.handleListenToChange();n((t=>{if(this.showResults&&this.tpl)this.searchChange()}))}));this.searchIndexNameChange();this.initAlgoliaClient();this.initAlgoliaIndex();m.create(this,this.wormholeState);if(this.storeId){c.init(this,["query","replicaIndex"],this.storeMethod,this.storeId);c.init(this,["apiKey","appId","searchIndex"],"session",this.storeId+"_api")}this.internalIndexSwitch()}connectedCallback(){this.searchChange=f(this.searchChange,300);this.browseIndexChange();this.host.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.host}))}render(){const t={indexResults:this.indexResults,results:this.currentHits,filterChanged:this.filterChanged,tplRenderFn:this.tplRenderFn,resultsPage:this.resultsPage,changeEvent:this.changeEvent,facets:this.facets,algoliaIndex:this.algoliaIndex,searchIndex:this.searchIndex,globalStoreMethod:this.storeMethod,isLoading:this.isLoading};return o(l,{class:{"show-results":this.showResults,"is-loading":this.isLoading},"aria-busy":this.isLoading},this.hasLoadSlot&&o("div",{hidden:!this.isLoading},o("slot",{name:"loader"})),!this.hasLoadSlot&&o("div",{class:{loader:true,loading:this.isLoading}},o("nano-spinner",{overlay:true,type:"circle"})),o(m.Provider,{state:t},o("slot",{name:"search-input"}),o("div",{class:"results-container","aria-live":"polite"},o("div",{ref:t=>this.resultsDiv=t,class:"results"},o("slot",{name:"output"})))),o("div",{ref:t=>this.defaultDiv=t,class:"default",tabindex:"-1"},o("slot",null)))}get host(){return t(this)}static get watchers(){return{listenTo:["handleListenToChange"],_dynFacetFilters:["dynFacetFiltersChange"],browseIndex:["browseIndexChange"],inputField:["inputFieldSet"],query:["queryChange"],replicaIndex:["internalIndexSwitch"],resultsPage:["pageChange"],searchIndexName:["searchIndexNameChange"],apiKey:["initAlgoliaClient"],appId:["initAlgoliaClient"],searchIndex:["initAlgoliaIndex"],showResults:["showResultsChange"],filters:["handleFilterpropChange"]}}};st.style=it;export{st as nano_algolia};
5
5
  //# sourceMappingURL=nano-algolia.entry.js.map
@@ -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"./index-9695db0a.js";export{s as setNonce}from"./index-9695db0a.js";import"./global-be484e8c.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('[["nano-global-nav",[[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],"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"]]]]],["nano-demo",[[1,"nano-demo"]]],["nano-date-input",[[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]}]]],["nano-dialog",[[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]}]]],["nano-drawer",[[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]}]]],["nano-hero",[[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]}]]],["nano-alert",[[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]}]]],["nano-file-upload",[[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"]]]]],["nano-overflow-nav",[[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]}]]],["nano-tab",[[1,"nano-tab",{"panel":[513],"active":[516],"disabled":[516],"closable":[4],"setFocus":[64],"removeFocus":[64]}]]],["nano-global-search-results",[[1,"nano-global-search-results",{"algoliaResults":[32],"algoliaEle":[32],"currentWidth":[32],"apiKey":[32],"appId":[32],"index":[32],"closeSearch":[64]},[[16,"nanoSearchReset","handleGlobalNavReset"],[16,"nanoSearchResult","handleGlobalNavSearch"],[0,"nanoChange","handleReorder"],[0,"nanoResultsShown","attachListeners"],[16,"nanoNewResults","attachResultListeners"]]]]],["nano-menu-drawer",[[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"]]]]],["nano-split-pane",[[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]}]]],["nano-tab-group",[[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"]]]]],["nano-accordion",[[1,"nano-accordion",{"color":[1],"itemOpened":[32]},[[0,"nanoOpened","onToggleHandler"],[0,"nanoClosed","onClosedHandler"]]]]],["nano-algolia-filter",[[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"]]]]],["nano-algolia-pagination",[[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]}]]],["nano-algolia-results",[[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]}]]],["nano-animation",[[1,"nano-animation",{"name":[1],"play":[1540],"delay":[2],"direction":[1],"duration":[2],"easing":[1],"endDelay":[2,"end-delay"],"fill":[1],"iterations":[2],"iterationStart":[2,"iteration-start"],"keyframes":[16],"playbackRate":[2,"playback-rate"],"currentTime":[6146,"current-time"],"cancel":[64],"finish":[64]}]]],["nano-checkbox",[[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"]]]]],["nano-checkbox-group",[[6,"nano-checkbox-group",{"validateOn":[1025,"validate-on"],"showInlineError":[4,"show-inline-error"],"min":[2],"max":[2],"disabled":[516],"legend":[1],"hideLegend":[4,"hide-legend"],"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"]]]]],["nano-details",[[1,"nano-details",{"label":[1],"open":[1540],"disabled":[1540],"noHandle":[4,"no-handle"],"iconRotation":[2,"icon-rotation"],"useCacheHeight":[4,"use-cache-height"]}]]],["nano-field-validator",[[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"]]]]],["nano-grid-item",[[1,"nano-grid-item"]]],["nano-intersection-observe",[[1,"nano-intersection-observe",{"root":[1],"rootMargin":[1,"root-margin"],"threshold":[1]}]]],["nano-more-less",[[1,"nano-more-less",{"show":[1540],"childrenSelector":[1,"children-selector"],"maxToShow":[2,"max-to-show"],"noHideBtn":[4,"no-hide-btn"],"slottedElements":[32]}]]],["nano-range",[[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]}]]],["nano-rating",[[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]}]]],["nano-slide",[[1,"nano-slide",{"ready":[1540]}]]],["nano-slides",[[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],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"getActiveIndex":[64],"length":[64],"isEnd":[64],"isBeginning":[64],"startAutoplay":[64],"stopAutoplay":[64],"lockSwipes":[64],"getflickity":[64],"reload":[64]}]]],["nano-sortable",[[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]}]]],["nano-tab-content",[[1,"nano-tab-content",{"name":[513],"active":[516],"ready":[32]}]]],["nano-spinner",[[1,"nano-spinner",{"type":[1],"overlay":[516],"hasText":[32]}]]],["nano-table",[[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]}]]],["nano-algolia",[[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],"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],"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"]]]]],["nano-date-picker",[[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]}]]],["nano-grid_2",[[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":[520,"s-size"],"mSize":[520,"m-size"],"lSize":[520,"l-size"],"xlSize":[520,"xl-size"],"sCols":[514,"s-cols"],"mCols":[514,"m-cols"],"lCols":[514,"l-cols"],"xlCols":[514,"xl-cols"],"xxlCols":[514,"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]}]]],["nano-input",[[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"]]]]],["nano-progress-bar",[[1,"nano-progress-bar",{"value":[2],"indeterminate":[4],"showPercent":[4,"show-percent"]}]]],["nano-sticker",[[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]}]]],["nano-dropdown",[[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":[1028],"dialogTitle":[1,"dialog-title"],"eventType":[16],"show":[64],"hide":[64]},[[0,"nanoOpen","secondaryOpen"],[0,"nanoClose","secondaryClose"],[0,"nanoSelect","handlePanelSelect"]]]]],["nano-datalist_3",[[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"]]]]],["nano-global-nav-user-profile_3",[[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],"maxValuesVisible":[1032,"max-values-visible"],"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],"valueTagTemplate":[16],"currInsertIndex":[32],"showErrorMsg":[32],"errorMessage":[32],"hasFocus":[32],"hasLabelSlot":[32],"hasHelperSlot":[32],"hasHelperEndSlot":[32],"inputSearchVal":[32],"_invalid":[32],"_elementOptions":[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"]]]]],["nano-resize-observe_2",[[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]}]]],["nano-icon",[[1,"nano-icon",{"color":[1],"role":[1537],"ariaLabel":[1537,"aria-label"],"flipRtl":[4,"flip-rtl"],"name":[1],"src":[1],"icon":[8],"size":[1],"lazy":[4],"svgContent":[32],"isVisible":[32],"isLoading":[32]}]]],["nano-icon-button_2",[[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":[1028],"trigger":[1],"show":[64],"hide":[64]}]]]]'),e)));
4
+ import{p as e,H as a,b as o}from"./index-9695db0a.js";export{s as setNonce}from"./index-9695db0a.js";import"./global-be484e8c.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('[["nano-global-nav",[[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],"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"]]]]],["nano-demo",[[1,"nano-demo"]]],["nano-date-input",[[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]}]]],["nano-dialog",[[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]}]]],["nano-drawer",[[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]}]]],["nano-hero",[[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]}]]],["nano-alert",[[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]}]]],["nano-file-upload",[[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"]]]]],["nano-overflow-nav",[[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]}]]],["nano-tab",[[1,"nano-tab",{"panel":[513],"active":[516],"disabled":[516],"closable":[4],"setFocus":[64],"removeFocus":[64]}]]],["nano-global-search-results",[[1,"nano-global-search-results",{"algoliaResults":[32],"algoliaEle":[32],"currentWidth":[32],"apiKey":[32],"appId":[32],"index":[32],"closeSearch":[64]},[[16,"nanoSearchReset","handleGlobalNavReset"],[16,"nanoSearchResult","handleGlobalNavSearch"],[0,"nanoChange","handleReorder"],[0,"nanoResultsShown","attachListeners"],[16,"nanoNewResults","attachResultListeners"]]]]],["nano-menu-drawer",[[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"]]]]],["nano-split-pane",[[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]}]]],["nano-tab-group",[[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"]]]]],["nano-accordion",[[1,"nano-accordion",{"color":[1],"itemOpened":[32]},[[0,"nanoOpened","onToggleHandler"],[0,"nanoClosed","onClosedHandler"]]]]],["nano-algolia-filter",[[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"]]]]],["nano-algolia-pagination",[[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]}]]],["nano-algolia-results",[[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]}]]],["nano-animation",[[1,"nano-animation",{"name":[1],"play":[1540],"delay":[2],"direction":[1],"duration":[2],"easing":[1],"endDelay":[2,"end-delay"],"fill":[1],"iterations":[2],"iterationStart":[2,"iteration-start"],"keyframes":[16],"playbackRate":[2,"playback-rate"],"currentTime":[6146,"current-time"],"cancel":[64],"finish":[64]}]]],["nano-checkbox",[[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"]]]]],["nano-checkbox-group",[[6,"nano-checkbox-group",{"validateOn":[1025,"validate-on"],"showInlineError":[4,"show-inline-error"],"min":[2],"max":[2],"disabled":[516],"legend":[1],"hideLegend":[4,"hide-legend"],"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"]]]]],["nano-details",[[1,"nano-details",{"label":[1],"open":[1540],"disabled":[1540],"noHandle":[4,"no-handle"],"iconRotation":[2,"icon-rotation"],"useCacheHeight":[4,"use-cache-height"]}]]],["nano-field-validator",[[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"]]]]],["nano-grid-item",[[1,"nano-grid-item"]]],["nano-intersection-observe",[[1,"nano-intersection-observe",{"root":[1],"rootMargin":[1,"root-margin"],"threshold":[1]}]]],["nano-more-less",[[1,"nano-more-less",{"show":[1540],"childrenSelector":[1,"children-selector"],"maxToShow":[2,"max-to-show"],"noHideBtn":[4,"no-hide-btn"]}]]],["nano-range",[[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]}]]],["nano-rating",[[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]}]]],["nano-slide",[[1,"nano-slide",{"ready":[1540]}]]],["nano-slides",[[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],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"getActiveIndex":[64],"length":[64],"isEnd":[64],"isBeginning":[64],"startAutoplay":[64],"stopAutoplay":[64],"lockSwipes":[64],"getflickity":[64],"reload":[64]}]]],["nano-sortable",[[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]}]]],["nano-tab-content",[[1,"nano-tab-content",{"name":[513],"active":[516],"ready":[32]}]]],["nano-spinner",[[1,"nano-spinner",{"type":[1],"overlay":[516],"hasText":[32]}]]],["nano-table",[[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]}]]],["nano-algolia",[[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],"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],"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"]]]]],["nano-date-picker",[[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]}]]],["nano-grid_2",[[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":[520,"s-size"],"mSize":[520,"m-size"],"lSize":[520,"l-size"],"xlSize":[520,"xl-size"],"sCols":[514,"s-cols"],"mCols":[514,"m-cols"],"lCols":[514,"l-cols"],"xlCols":[514,"xl-cols"],"xxlCols":[514,"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]}]]],["nano-input",[[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"]]]]],["nano-progress-bar",[[1,"nano-progress-bar",{"value":[2],"indeterminate":[4],"showPercent":[4,"show-percent"]}]]],["nano-sticker",[[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]}]]],["nano-dropdown",[[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":[1028],"dialogTitle":[1,"dialog-title"],"eventType":[16],"show":[64],"hide":[64]},[[0,"nanoOpen","secondaryOpen"],[0,"nanoClose","secondaryClose"],[0,"nanoSelect","handlePanelSelect"]]]]],["nano-datalist_3",[[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"]]]]],["nano-global-nav-user-profile_3",[[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],"maxValuesVisible":[1032,"max-values-visible"],"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],"valueTagTemplate":[16],"currInsertIndex":[32],"showErrorMsg":[32],"errorMessage":[32],"hasFocus":[32],"hasLabelSlot":[32],"hasHelperSlot":[32],"hasHelperEndSlot":[32],"inputSearchVal":[32],"_invalid":[32],"_elementOptions":[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"]]]]],["nano-resize-observe_2",[[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]}]]],["nano-icon",[[1,"nano-icon",{"color":[1],"role":[1537],"ariaLabel":[1537,"aria-label"],"flipRtl":[4,"flip-rtl"],"name":[1],"src":[1],"icon":[8],"size":[1],"lazy":[4],"svgContent":[32],"isVisible":[32],"isLoading":[32]}]]],["nano-icon-button_2",[[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":[1028],"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.2 | 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":";;;kIAkBA,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,0zlBAAuCH"}
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.2 | 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":";;;kIAkBA,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,mylBAAuCH"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{r as i,c as o,h as a,a as t,g as s}from"./index-9695db0a.js";import{M as e}from"./modal-88c117cd.js";import{l as n,u as r}from"./scroll-762b3e1a.js";import{h as l}from"./slot-8126e238.js";import{C as d}from"./component-store-486d9d7a.js";import"./tabbable-26a66a22.js";import"./dom-8599fac1.js";import"./throttle-ac4fcefa.js";const h=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--border-radius:var(--nano-layer-border-radius, var(--nano-border-radius-medium, 4px));--content-background:#fafafa;--footer-content:#e4e6e8;--scrim-color:var(--nano-layer-overlay-dark, rgb(74 74 74 / 50%));--box-shadow:var(--nano-layer-shadow-large, 0 2px 8px rgba(0, 0, 0, 0.2));--close-button-color:#b5aea7;--width:60rem;--tint-color:#00607b;--body-padding-v:var(--nano-spacing-large, 20px);--body-padding-h:var(--nano-spacing-large, 20px);--header-padding-v:var(--nano-spacing-medium, 16px);--header-padding-h:var(--nano-spacing-large, 20px);--footer-padding-v:var(--nano-spacing-medium, 16px);--footer-padding-h:var(--nano-spacing-large, 20px)}.dialog{display:flex;align-items:center;justify-content:center;position:fixed;inset:0;z-index:var(--nano-layer-index-modal, 700);border:none;inline-size:unset;block-size:unset;color:unset;background-color:unset}.dialog::backdrop{display:none}.dialog__panel{display:flex;flex-direction:column;z-index:2;inline-size:var(--width);max-inline-size:calc(100% - (var(--nano-spacing-xlarge, 24px) + var(--nano-scroll-lock-size)));max-block-size:calc(92vh - var(--nano-spacing-xlarge, 24px));background-color:var(--content-background);border-radius:var(--border-radius);box-shadow:var(--box-shadow);opacity:0;transform:scale(0.8);transition:var(--nano-transition-fast, 0.3s) opacity, var(--nano-transition-fast, 0.3s) transform}.dialog__panel:focus{outline:none}.dialog--with-ribbon .dialog__panel{border-block-start:5px solid var(--tint-color)}.dialog--open .dialog__panel{display:flex;opacity:1;transform:none}.dialog--nodismiss .dialog__panel{animation:cannotClose 0.25s ease-in-out 1}@keyframes cannotClose{0%{transform:scale(1)}50%{transform:scale(1.08)}100%{transform:scale(1)}}.dialog__header{flex:0 0 auto;display:flex;inline-size:100%;background-color:var(--content-background);border-radius:var(--border-radius) var(--border-radius) 0 0;transition:var(--nano-transition-fast, 0.1s) box-shadow;min-inline-size:auto}[stuck] .dialog__header{box-shadow:var(--nano-layer-shadow-medium, 0 2px 4px rgba(0, 0, 0, 0.2))}.dialog__title{flex:1 1 auto;font-size:var(--nano-fontsize-large, 1.25rem);line-height:1.6;padding-block:var(--header-padding-v);padding-inline:var(--header-padding-h)}.dialog .dialog__close-icon{flex:0 0 auto;display:flex;align-items:center;font-size:var(--nano-fontsize-xlarge, 1.5rem);padding-block:0;padding-inline:var(--header-padding-h);--color:var(--close-button-color)}.dialog__body{padding-block:0 var(--body-padding-v);padding-inline:var(--body-padding-h)}.dialog:not(.dialog--has-header) .dialog__body{padding-block-start:var(--body-padding-v)}.dialog__body ::slotted(*){max-inline-size:100%}.dialog__body-wrap{flex:1 1 auto;overflow:auto;-webkit-overflow-scrolling:touch;border-radius:var(--border-radius)}.dialog:not(.dialog--has-header) .dialog__body-wrap{border-radius:0 0 inherit inherit}.dialog:not(.dialog--has-footer) .dialog__body-wrap{border-radius:inherit inherit 0 0}.dialog__footer{inline-size:100%;padding-block:var(--footer-padding-v);padding-inline:var(--footer-padding-h);background:var(--footer-content);border-radius:0 0 var(--border-radius) var(--border-radius);position:relative;inset-block-start:1px;min-inline-size:auto}.dialog__footer ::slotted(button){margin-inline-end:var(--nano-spacing-small, 8px) !important}.dialog:not(.dialog--has-footer) .dialog__footer{display:none}.dialog__close-txt{color:var(--tint-color);border:none;text-decoration:underline;margin:0;text-underline-offset:4px;background-color:transparent;font:inherit;-webkit-box-align:center;cursor:pointer;font-size:var(--nano-fontsize-small, 0.875rem);padding:0.5rem;border-radius:var(--nano-border-radius-small, 2px);transition:box-shadow 100ms ease-in-out}.dialog__close-txt:focus{outline:none;box-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8)))}.dialog__overlay{position:fixed;inset:0 !important;background-color:var(--scrim-color);opacity:0;transition:var(--nano-transition-fast, 0.3s) opacity;-webkit-backdrop-filter:blur(var(--nano-layer-overlay-blur, 3px));backdrop-filter:blur(var(--nano-layer-overlay-blur, 3px))}.dialog--open .dialog__overlay{opacity:1}";let c=0;const p=class{constructor(a){i(this,a);this.nanoShow=o(this,"nanoShow",7);this.nanoAfterShow=o(this,"nanoAfterShow",7);this.nanoHide=o(this,"nanoHide",7);this.nanoAfterHide=o(this,"nanoAfterHide",7);this.nanoInitialFocus=o(this,"nanoInitialFocus",7);this.nanoRequestClose=o(this,"nanoRequestClose",7);this.componentId=`dialog-${++c}`;this.willShow=false;this.willHide=false;this.handleKeyDown=i=>{if(i.key==="Escape"){this.requestClose()}};this.requestClose=()=>{const i=this.nanoRequestClose.emit();if(!i.defaultPrevented&&!this.noUserDismiss){this.hide()}else{this.noDismiss=true;setTimeout((()=>this.noDismiss=false),250)}};this.handleTransitionEnd=i=>{if(i.propertyName==="opacity"&&i.composedPath().find((i=>i===this.panel||i===this.overlay))){this.willShow=false;this.willHide=false;this.open?this.nanoAfterShow.emit():this.nanoAfterHide.emit();if(!this.open)this.dialog.hidden=true}};this.handleSlotChange=()=>{this.hasFooter=l(this.host,"footer")};this.noDismiss=false;this.hasFooter=false;this.showRibbon=true;this.open=false;this.label=undefined;this.noHeader=false;this.noFooter=false;this.noUserDismiss=false;this.storeId=undefined;this.storeMethod="url-hash";this.hoist=false}get panel(){return this._panel}set panel(i){if(this._panel){this.panel.removeEventListener("transitionend",this.handleTransitionEnd)}i.addEventListener("transitionend",this.handleTransitionEnd);this._panel=i}handleOpenChange(){this.open?this.show():this.hide()}handleHoistChange(){if(globalThis.HTMLElement.prototype.hasOwnProperty("popover")||!this.hoist||Array.from(document.body.children).includes(this.host))return;document.body.prepend(this.host)}async show(){if(this.willShow){return}const i=this.nanoShow.emit();if(i.defaultPrevented){this.open=false;return}if(this.dialog)this.dialog.hidden=false;this.originalTrigger=document.activeElement;this.willShow=true;this.open=true;this.modal.activate();if(typeof this.dialog?.showPopover==="function"){this.dialog.showPopover()}n(this.host);if(this.open){this.host.addEventListener("nanoAfterShow",(()=>{const i=this.nanoInitialFocus.emit();if(!i.defaultPrevented){this.panel.focus({preventScroll:true})}}),{once:true})}}async hide(){if(this.willHide){return}const i=this.nanoHide.emit();if(i.defaultPrevented){this.open=true;return}this.willHide=true;this.open=false;this.modal.deactivate();this.stopVideos();const o=this.originalTrigger;if(o&&typeof o.focus==="function"){setTimeout((()=>o.focus()))}setTimeout((()=>{if(!this.open&&typeof this.dialog?.hidePopover==="function"){this.dialog.hidePopover()}r(this.host)}),300)}stopVideos(){const i=Array.from(this.host.querySelectorAll("iframe,video"));i.forEach((i=>{if(i.tagName.toLowerCase()==="video")i.pause();else{const o=i.src;i.src=o}}))}connectedCallback(){this.handleHoistChange();this.modal=new e(this.host)}componentWillLoad(){this.handleSlotChange();if(this.open)this.show();if(this.storeId)d.init(this,["open"],this.storeMethod,this.storeId)}componentDidLoad(){this.dialog.hidden=!this.open}disconnectedCallback(){r(this.host);if(!this.panel)return;this.panel.removeEventListener("transitionend",this.handleTransitionEnd)}render(){return a(t,null,a("div",{part:"base",class:{dialog:true,"dialog--open":this.open,"dialog--has-footer":!this.noFooter,"dialog--has-header":!this.noHeader,"dialog--nodismiss":this.noDismiss,"dialog--with-ribbon":this.showRibbon},onKeyDown:this.handleKeyDown,ref:i=>this.dialog=i,popover:"manual"},a("div",{part:"overlay",class:"dialog__overlay",ref:i=>this.overlay=i,onClick:this.requestClose}),a("div",{ref:i=>this.panel=i,part:"panel",class:"dialog__panel",role:"dialog","aria-modal":"true","aria-hidden":this.open?"false":"true","aria-label":this.noHeader?this.label:null,"aria-labelledby":!this.noHeader?`${this.componentId}-title`:null,tabIndex:-1},a("div",{class:"dialog__body-wrap"},!this.noHeader&&a("nano-sticker",null,a("header",{part:"header",class:"dialog__header"},a("span",{part:"title",class:"dialog__title",id:`${this.componentId}-title`},a("slot",{name:"label"},this.label||String.fromCharCode(65279))),!this.noUserDismiss&&a("nano-icon-button",{part:"close-button",exportparts:"base:close-button__base",class:"dialog__close-icon",label:"close dialog",onClick:this.requestClose,iconName:"light/times"}))),a("div",{part:"body",class:"dialog__body"},a("slot",null)),!this.noFooter&&(this.hasFooter||!this.noUserDismiss)&&a("nano-sticker",{position:"bottom"},a("footer",{part:"footer",class:"dialog__footer"},a("slot",{name:"footer",onSlotchange:this.handleSlotChange}),!this.noUserDismiss&&a("button",{class:"dialog__close-txt",onClick:this.requestClose},"Close")))))))}get host(){return s(this)}static get watchers(){return{open:["handleOpenChange"],hoist:["handleHoistChange"]}}};p.style=h;export{p as nano_dialog};
4
+ import{r as i,c as o,h as a,a as t,g as s}from"./index-9695db0a.js";import{M as e}from"./modal-88c117cd.js";import{l as n,u as r}from"./scroll-762b3e1a.js";import{h as l}from"./slot-8126e238.js";import{C as d}from"./component-store-64043183.js";import"./tabbable-26a66a22.js";import"./dom-8599fac1.js";import"./throttle-ac4fcefa.js";const h=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--border-radius:var(--nano-layer-border-radius, var(--nano-border-radius-medium, 4px));--content-background:#fafafa;--footer-content:#e4e6e8;--scrim-color:var(--nano-layer-overlay-dark, rgb(74 74 74 / 50%));--box-shadow:var(--nano-layer-shadow-large, 0 2px 8px rgba(0, 0, 0, 0.2));--close-button-color:#b5aea7;--width:60rem;--tint-color:#00607b;--body-padding-v:var(--nano-spacing-large, 20px);--body-padding-h:var(--nano-spacing-large, 20px);--header-padding-v:var(--nano-spacing-medium, 16px);--header-padding-h:var(--nano-spacing-large, 20px);--footer-padding-v:var(--nano-spacing-medium, 16px);--footer-padding-h:var(--nano-spacing-large, 20px)}.dialog{display:flex;align-items:center;justify-content:center;position:fixed;inset:0;z-index:var(--nano-layer-index-modal, 700);border:none;inline-size:unset;block-size:unset;color:unset;background-color:unset}.dialog::backdrop{display:none}.dialog__panel{display:flex;flex-direction:column;z-index:2;inline-size:var(--width);max-inline-size:calc(100% - (var(--nano-spacing-xlarge, 24px) + var(--nano-scroll-lock-size)));max-block-size:calc(92vh - var(--nano-spacing-xlarge, 24px));background-color:var(--content-background);border-radius:var(--border-radius);box-shadow:var(--box-shadow);opacity:0;transform:scale(0.8);transition:var(--nano-transition-fast, 0.3s) opacity, var(--nano-transition-fast, 0.3s) transform}.dialog__panel:focus{outline:none}.dialog--with-ribbon .dialog__panel{border-block-start:5px solid var(--tint-color)}.dialog--open .dialog__panel{display:flex;opacity:1;transform:none}.dialog--nodismiss .dialog__panel{animation:cannotClose 0.25s ease-in-out 1}@keyframes cannotClose{0%{transform:scale(1)}50%{transform:scale(1.08)}100%{transform:scale(1)}}.dialog__header{flex:0 0 auto;display:flex;inline-size:100%;background-color:var(--content-background);border-radius:var(--border-radius) var(--border-radius) 0 0;transition:var(--nano-transition-fast, 0.1s) box-shadow;min-inline-size:auto}[stuck] .dialog__header{box-shadow:var(--nano-layer-shadow-medium, 0 2px 4px rgba(0, 0, 0, 0.2))}.dialog__title{flex:1 1 auto;font-size:var(--nano-fontsize-large, 1.25rem);line-height:1.6;padding-block:var(--header-padding-v);padding-inline:var(--header-padding-h)}.dialog .dialog__close-icon{flex:0 0 auto;display:flex;align-items:center;font-size:var(--nano-fontsize-xlarge, 1.5rem);padding-block:0;padding-inline:var(--header-padding-h);--color:var(--close-button-color)}.dialog__body{padding-block:0 var(--body-padding-v);padding-inline:var(--body-padding-h)}.dialog:not(.dialog--has-header) .dialog__body{padding-block-start:var(--body-padding-v)}.dialog__body ::slotted(*){max-inline-size:100%}.dialog__body-wrap{flex:1 1 auto;overflow:auto;-webkit-overflow-scrolling:touch;border-radius:var(--border-radius)}.dialog:not(.dialog--has-header) .dialog__body-wrap{border-radius:0 0 inherit inherit}.dialog:not(.dialog--has-footer) .dialog__body-wrap{border-radius:inherit inherit 0 0}.dialog__footer{inline-size:100%;padding-block:var(--footer-padding-v);padding-inline:var(--footer-padding-h);background:var(--footer-content);border-radius:0 0 var(--border-radius) var(--border-radius);position:relative;inset-block-start:1px;min-inline-size:auto}.dialog__footer ::slotted(button){margin-inline-end:var(--nano-spacing-small, 8px) !important}.dialog:not(.dialog--has-footer) .dialog__footer{display:none}.dialog__close-txt{color:var(--tint-color);border:none;text-decoration:underline;margin:0;text-underline-offset:4px;background-color:transparent;font:inherit;-webkit-box-align:center;cursor:pointer;font-size:var(--nano-fontsize-small, 0.875rem);padding:0.5rem;border-radius:var(--nano-border-radius-small, 2px);transition:box-shadow 100ms ease-in-out}.dialog__close-txt:focus{outline:none;box-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8)))}.dialog__overlay{position:fixed;inset:0 !important;background-color:var(--scrim-color);opacity:0;transition:var(--nano-transition-fast, 0.3s) opacity;-webkit-backdrop-filter:blur(var(--nano-layer-overlay-blur, 3px));backdrop-filter:blur(var(--nano-layer-overlay-blur, 3px))}.dialog--open .dialog__overlay{opacity:1}";let c=0;const p=class{constructor(a){i(this,a);this.nanoShow=o(this,"nanoShow",7);this.nanoAfterShow=o(this,"nanoAfterShow",7);this.nanoHide=o(this,"nanoHide",7);this.nanoAfterHide=o(this,"nanoAfterHide",7);this.nanoInitialFocus=o(this,"nanoInitialFocus",7);this.nanoRequestClose=o(this,"nanoRequestClose",7);this.componentId=`dialog-${++c}`;this.willShow=false;this.willHide=false;this.handleKeyDown=i=>{if(i.key==="Escape"){this.requestClose()}};this.requestClose=()=>{const i=this.nanoRequestClose.emit();if(!i.defaultPrevented&&!this.noUserDismiss){this.hide()}else{this.noDismiss=true;setTimeout((()=>this.noDismiss=false),250)}};this.handleTransitionEnd=i=>{if(i.propertyName==="opacity"&&i.composedPath().find((i=>i===this.panel||i===this.overlay))){this.willShow=false;this.willHide=false;this.open?this.nanoAfterShow.emit():this.nanoAfterHide.emit();if(!this.open)this.dialog.hidden=true}};this.handleSlotChange=()=>{this.hasFooter=l(this.host,"footer")};this.noDismiss=false;this.hasFooter=false;this.showRibbon=true;this.open=false;this.label=undefined;this.noHeader=false;this.noFooter=false;this.noUserDismiss=false;this.storeId=undefined;this.storeMethod="url-hash";this.hoist=false}get panel(){return this._panel}set panel(i){if(this._panel){this.panel.removeEventListener("transitionend",this.handleTransitionEnd)}i.addEventListener("transitionend",this.handleTransitionEnd);this._panel=i}handleOpenChange(){this.open?this.show():this.hide()}handleHoistChange(){if(globalThis.HTMLElement.prototype.hasOwnProperty("popover")||!this.hoist||Array.from(document.body.children).includes(this.host))return;document.body.prepend(this.host)}async show(){if(this.willShow){return}const i=this.nanoShow.emit();if(i.defaultPrevented){this.open=false;return}if(this.dialog)this.dialog.hidden=false;this.originalTrigger=document.activeElement;this.willShow=true;this.open=true;this.modal.activate();if(typeof this.dialog?.showPopover==="function"){this.dialog.showPopover()}n(this.host);if(this.open){this.host.addEventListener("nanoAfterShow",(()=>{const i=this.nanoInitialFocus.emit();if(!i.defaultPrevented){this.panel.focus({preventScroll:true})}}),{once:true})}}async hide(){if(this.willHide){return}const i=this.nanoHide.emit();if(i.defaultPrevented){this.open=true;return}this.willHide=true;this.open=false;this.modal.deactivate();this.stopVideos();const o=this.originalTrigger;if(o&&typeof o.focus==="function"){setTimeout((()=>o.focus()))}setTimeout((()=>{if(!this.open&&typeof this.dialog?.hidePopover==="function"){this.dialog.hidePopover()}r(this.host)}),300)}stopVideos(){const i=Array.from(this.host.querySelectorAll("iframe,video"));i.forEach((i=>{if(i.tagName.toLowerCase()==="video")i.pause();else{const o=i.src;i.src=o}}))}connectedCallback(){this.handleHoistChange();this.modal=new e(this.host)}componentWillLoad(){this.handleSlotChange();if(this.open)this.show();if(this.storeId)d.init(this,["open"],this.storeMethod,this.storeId)}componentDidLoad(){this.dialog.hidden=!this.open}disconnectedCallback(){r(this.host);if(!this.panel)return;this.panel.removeEventListener("transitionend",this.handleTransitionEnd)}render(){return a(t,null,a("div",{part:"base",class:{dialog:true,"dialog--open":this.open,"dialog--has-footer":!this.noFooter,"dialog--has-header":!this.noHeader,"dialog--nodismiss":this.noDismiss,"dialog--with-ribbon":this.showRibbon},onKeyDown:this.handleKeyDown,ref:i=>this.dialog=i,popover:"manual"},a("div",{part:"overlay",class:"dialog__overlay",ref:i=>this.overlay=i,onClick:this.requestClose}),a("div",{ref:i=>this.panel=i,part:"panel",class:"dialog__panel",role:"dialog","aria-modal":"true","aria-hidden":this.open?"false":"true","aria-label":this.noHeader?this.label:null,"aria-labelledby":!this.noHeader?`${this.componentId}-title`:null,tabIndex:-1},a("div",{class:"dialog__body-wrap"},!this.noHeader&&a("nano-sticker",null,a("header",{part:"header",class:"dialog__header"},a("span",{part:"title",class:"dialog__title",id:`${this.componentId}-title`},a("slot",{name:"label"},this.label||String.fromCharCode(65279))),!this.noUserDismiss&&a("nano-icon-button",{part:"close-button",exportparts:"base:close-button__base",class:"dialog__close-icon",label:"close dialog",onClick:this.requestClose,iconName:"light/times"}))),a("div",{part:"body",class:"dialog__body"},a("slot",null)),!this.noFooter&&(this.hasFooter||!this.noUserDismiss)&&a("nano-sticker",{position:"bottom"},a("footer",{part:"footer",class:"dialog__footer"},a("slot",{name:"footer",onSlotchange:this.handleSlotChange}),!this.noUserDismiss&&a("button",{class:"dialog__close-txt",onClick:this.requestClose},"Close")))))))}get host(){return s(this)}static get watchers(){return{open:["handleOpenChange"],hoist:["handleHoistChange"]}}};p.style=h;export{p as nano_dialog};
5
5
  //# sourceMappingURL=nano-dialog.entry.js.map