@nanoporetech-digital/components 8.12.0 → 8.12.1

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 (99) hide show
  1. package/dist/cjs/{fade-CPjR03EH.js → fade-B_RYQMUR.js} +1 -1
  2. package/dist/cjs/{fullscreen-Bzjv2HGI.js → fullscreen-DRJ-K03z.js} +1 -1
  3. package/dist/cjs/{lazyload-BNO_n6W8.js → lazyload-CQY_vK8q.js} +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/nano-card-carousel.cjs.entry.js +1 -1
  6. package/dist/cjs/nano-components.cjs.js +1 -1
  7. package/dist/cjs/nano-icon-button_2.cjs.entry.js +2 -2
  8. package/dist/cjs/{nano-slides-C2K7j1yc.js → nano-slides-CXg2hNth.js} +56 -49
  9. package/dist/cjs/nano-slides.cjs.entry.js +1 -1
  10. package/dist/cjs/nano-sortable.cjs.entry.js +1 -1
  11. package/dist/cjs/nano-step-accordion.cjs.entry.js +1 -1
  12. package/dist/cjs/nano-step-breadcrumb.cjs.entry.js +2 -2
  13. package/dist/cjs/nano-sticker.cjs.entry.js +2 -2
  14. package/dist/cjs/nano-tab-content.cjs.entry.js +2 -2
  15. package/dist/cjs/nano-tab.cjs.entry.js +2 -2
  16. package/dist/cjs/nano-table.cjs.entry.js +2 -2
  17. package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
  18. package/dist/collection/components/card-carousel/card-carousel.css +13 -7
  19. package/dist/collection/components/slides/lib/js/flickity.js +1 -1
  20. package/dist/collection/components/slides/lib/js/prev-next-button.js +3 -4
  21. package/dist/collection/components/slides/lib/js/utils/get-size.js +1 -1
  22. package/dist/collection/components/slides/slides.css +0 -2
  23. package/dist/collection/components/slides/slides.js +49 -39
  24. package/dist/collection/components/sortable/sortable.js +1 -1
  25. package/dist/collection/components/step-accordion/step-accordion.js +1 -1
  26. package/dist/collection/components/step-breadcrumb/step-breadcrumb.js +2 -2
  27. package/dist/collection/components/sticker/sticker.js +2 -2
  28. package/dist/collection/components/table/table.js +2 -2
  29. package/dist/collection/components/tabs/tab-content.js +2 -2
  30. package/dist/collection/components/tabs/tab.js +2 -2
  31. package/dist/collection/components/tooltip/tooltip.js +2 -2
  32. package/dist/components/nano-card-carousel.js +1 -1
  33. package/dist/components/nano-sortable.js +1 -1
  34. package/dist/components/nano-step-accordion.js +1 -1
  35. package/dist/components/nano-step-breadcrumb.js +2 -2
  36. package/dist/components/nano-tab-content.js +2 -2
  37. package/dist/components/nano-tab.js +2 -2
  38. package/dist/components/nano-table.js +2 -2
  39. package/dist/components/slides.js +55 -46
  40. package/dist/components/sticker.js +2 -2
  41. package/dist/components/tooltip.js +2 -2
  42. package/dist/esm/{fade-DWf-ekic.js → fade-B-zhtzv8.js} +1 -1
  43. package/dist/esm/{fullscreen-DWET5K4U.js → fullscreen-DXVJLaN3.js} +1 -1
  44. package/dist/esm/{lazyload-BSH0U2zW.js → lazyload-DUQP_u2u.js} +1 -1
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm/nano-card-carousel.entry.js +1 -1
  47. package/dist/esm/nano-components.js +1 -1
  48. package/dist/esm/nano-icon-button_2.entry.js +2 -2
  49. package/dist/esm/{nano-slides-BU8CjO-X.js → nano-slides-BygteMbF.js} +57 -49
  50. package/dist/esm/nano-slides.entry.js +1 -1
  51. package/dist/esm/nano-sortable.entry.js +1 -1
  52. package/dist/esm/nano-step-accordion.entry.js +1 -1
  53. package/dist/esm/nano-step-breadcrumb.entry.js +2 -2
  54. package/dist/esm/nano-sticker.entry.js +2 -2
  55. package/dist/esm/nano-tab-content.entry.js +2 -2
  56. package/dist/esm/nano-tab.entry.js +2 -2
  57. package/dist/esm/nano-table.entry.js +2 -2
  58. package/dist/nano-components/{fade-DWf-ekic.js → fade-B-zhtzv8.js} +1 -1
  59. package/dist/nano-components/{fullscreen-DWET5K4U.js → fullscreen-DXVJLaN3.js} +1 -1
  60. package/dist/nano-components/{lazyload-BSH0U2zW.js → lazyload-DUQP_u2u.js} +1 -1
  61. package/dist/nano-components/nano-card-carousel.entry.js +1 -1
  62. package/dist/nano-components/nano-components.css +12 -8
  63. package/dist/nano-components/nano-components.esm.js +1 -1
  64. package/dist/nano-components/nano-icon-button_2.entry.js +1 -1
  65. package/dist/nano-components/nano-slides-BygteMbF.js +22 -0
  66. package/dist/nano-components/nano-slides.entry.js +1 -1
  67. package/dist/nano-components/nano-sortable.entry.js +1 -1
  68. package/dist/nano-components/nano-step-accordion.entry.js +1 -1
  69. package/dist/nano-components/nano-step-breadcrumb.entry.js +1 -1
  70. package/dist/nano-components/nano-sticker.entry.js +1 -1
  71. package/dist/nano-components/nano-tab-content.entry.js +1 -1
  72. package/dist/nano-components/nano-tab.entry.js +1 -1
  73. package/dist/nano-components/nano-table.entry.js +1 -1
  74. package/dist/style/components.css +1 -1
  75. package/dist/style/components.css.map +1 -1
  76. package/dist/style/nano.css +1 -1
  77. package/dist/style/nano.css.map +1 -1
  78. package/dist/types/components/slides/slides.d.ts +3 -2
  79. package/docs-json.json +2 -2
  80. package/hydrate/index.js +167 -293
  81. package/hydrate/index.mjs +167 -293
  82. package/package.json +2 -2
  83. package/dist/cjs/page-dots-Db7Ce8kX.js +0 -139
  84. package/dist/collection/components/slides/lib/js/page-dots.js +0 -136
  85. package/dist/components/page-dots.js +0 -135
  86. package/dist/esm/page-dots-Ckyic5vY.js +0 -137
  87. package/dist/nano-components/nano-slides-BU8CjO-X.js +0 -22
  88. package/dist/nano-components/page-dots-Ckyic5vY.js +0 -4
  89. package/dist/types/components/slides/lib/js/page-dots.d.ts +0 -1
  90. /package/dist/types/builds/{x6knoJK1 → 6SyqsxUA}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/generate-vue-component.d.ts +0 -0
  91. /package/dist/types/builds/{x6knoJK1 → 6SyqsxUA}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/index.d.ts +0 -0
  92. /package/dist/types/builds/{x6knoJK1 → 6SyqsxUA}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/output-vue.d.ts +0 -0
  93. /package/dist/types/builds/{x6knoJK1 → 6SyqsxUA}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/plugin.d.ts +0 -0
  94. /package/dist/types/builds/{x6knoJK1 → 6SyqsxUA}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/types.d.ts +0 -0
  95. /package/dist/types/builds/{x6knoJK1 → 6SyqsxUA}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/utils.d.ts +0 -0
  96. /package/dist/types/builds/{x6knoJK1 → 6SyqsxUA}/0/Digital/nano-components/packages/components/.stencil/stencil.config.d.ts +0 -0
  97. /package/dist/types/builds/{x6knoJK1 → 6SyqsxUA}/0/Digital/nano-components/packages/components/.stencil/stencil.config.prod.d.ts +0 -0
  98. /package/dist/types/builds/{x6knoJK1 → 6SyqsxUA}/0/Digital/nano-components/packages/components/.stencil/testing/mocks/intersection-observer.d.ts +0 -0
  99. /package/dist/types/builds/{x6knoJK1 → 6SyqsxUA}/0/Digital/nano-components/packages/components/.stencil/wdio.conf.d.ts +0 -0
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * Custom elements for Nanopore-Digital Web applications
3
+ */
4
+ import{r as t,c as i,g as s,e as n,d as e,a as o}from"./index-BM3Om9WE.js";import{t as h,h as c}from"./renderer-DpNDfhNy.js";function r(){}const a=r.prototype;
5
+ /*!
6
+ * getSize v2.0.3
7
+ * measure size of elements
8
+ * MIT license
9
+ */
10
+ function l(t){const i=parseFloat(t);return-1==t?.indexOf("%")&&!isNaN(i)&&i}a.on=function(t,i){if(!t||!i)return;const s=this._events=this._events||{},n=s[t]=s[t]||[];return-1==n.indexOf(i)&&n.push(i),this},a.once=function(t,i){if(!t||!i)return;this.on(t,i);const s=this._onceEvents=this._onceEvents||{};return(s[t]=s[t]||{})[i]=!0,this},a.off=function(t,i){const s=this._events&&this._events[t];if(!s||!s.length)return;const n=s.indexOf(i);return-1!=n&&s.splice(n,1),this},a.emitEvent=function(t,i){let s=this._events&&this._events[t];if(!s||!s.length)return;s=s.slice(0),i=i||[];const n=this._onceEvents&&this._onceEvents[t];for(let e=0;e<s.length;e++){const o=s[e];n&&n[o]&&(this.off(t,o),delete n[o]),o.apply(this,i)}return this},a.allOff=function(){delete this._events,delete this._onceEvents};const u="undefined"==typeof console?function(){}:function(t){console.error(t)},f=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],d=f.length;function p(t){const i=getComputedStyle(t);return i||u("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),i}let y,b=!1;function g(t){if(function(){if(b)return;b=!0;const t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";const i=document.body||document.documentElement;i.appendChild(t);const s=p(t);y=200==Math.round(l(s.width)),g.isBoxSizeOuter=y,i.removeChild(t)}(),"string"==typeof t&&(t=document.querySelector(t)),!t||"object"!=typeof t||!t.nodeType)return;const i=p(t);if("none"==i.display)return function(){const t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(let i=0;i<d;i++)t[f[i]]=0;return t}();const s={};s.width=t.offsetWidth,s.height=t.offsetHeight;const n=s.isBorderBox="border-box"==i.boxSizing;for(let t=0;t<d;t++){const n=f[t],e=parseFloat(i[n]);s[n]=isNaN(e)?0:e}const e=s.paddingLeft+s.paddingRight,o=s.paddingTop+s.paddingBottom,h=s.marginLeft+s.marginRight,c=s.marginTop+s.marginBottom,r=s.borderLeftWidth+s.borderRightWidth,a=s.borderTopWidth+s.borderBottomWidth,u=n&&y,m=l(i.width);!1!==m&&(s.width=m+(u?0:e+r));const v=l(i.height);return!1!==v&&(s.height=v+(u?0:o+a)),s.innerWidth=s.width-(e+r),s.innerHeight=s.height-(o+a),s.outerWidth=s.width+h,s.outerHeight=s.height+c,s}const m={extend:function(t,i){for(const s in i)t[s]=i[s];return t},docReady:function(t){const i=document.readyState;"complete"==i||"interactive"==i?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},toDashed:function(t){return t.replace(/(.)([A-Z])/g,(function(t,i,s){return i+"-"+s})).toLowerCase()},modulo:function(t,i){return(t%i+i)%i}},v=Array.prototype.slice;m.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?v.call(t):[t]},m.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if((t=t.parentElement).matches(i))return t},m.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},m.handleEvent=function(t){const i="on"+t.type;this[i]&&this[i](t)},m.filterFindElements=function(t,i){t=m.makeArray(t);const s=[];return t.forEach((function(t){if(!(t instanceof HTMLElement))return;if(!i)return void s.push(t);t.matches(i)&&s.push(t);const n=t.querySelectorAll(i);for(let t=0;t<n.length;t++)s.push(n[t])})),s},m.debounceMethod=function(t,i,s){s=s||100;const n=t.prototype[i],e=i+"Timeout";t.prototype[i]=function(...t){clearTimeout(this[e]);const i=this;this[e]=setTimeout((function(){n.apply(i,t),delete i[e]}),s)}};const k=window.console;function w(t,i){this.element=t,this.parent=i,this.create()}m.htmlInit=function(t,i){m.docReady((function(){const s=m.toDashed(i),n="data-"+s,e=document.querySelectorAll("["+n+"]"),o=document.querySelectorAll(".js-"+s),h=m.makeArray(e).concat(m.makeArray(o)),c=n+"-options";h.forEach((function(i){const s=i.getAttribute(n)||i.getAttribute(c);let e;try{e=s&&JSON.parse(s)}catch(t){return void(k&&k.error("Error parsing "+n+" on "+i.className+": "+t))}new t(i,e)}))}))};const x=w.prototype;function S(t){this.parent=t,this.isOriginLeft="left"==t.originSide,this.cells=[],this.outerWidth=0,this.height=0}x.create=function(){this.element.style.position="absolute",this.element.setAttribute("aria-hidden","true"),this.x=0,this.shift=0,Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.setAttribute("tabindex","-1")}))},x.destroy=function(){this.unselect(),this.element.style.position="",this.element.style[this.parent.originSide]=""},x.getSize=function(){this.size=g(this.element)},x.setPosition=function(t){this.x=t,this.updateTarget(),this.renderPosition(t)},x.updateTarget=x.setDefaultTarget=function(){this.target=this.x+this.size["left"==this.parent.originSide?"marginLeft":"marginRight"]+this.size.width*this.parent.cellAlign},x.renderPosition=function(t){this.element.style[this.parent.originSide]=this.parent.getPositionValue(t)},x.select=function(){this.element.classList.add("is-selected"),this.element.removeAttribute("aria-hidden"),Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.removeAttribute("tabindex")}))},x.unselect=function(){this.element.classList.remove("is-selected"),this.element.setAttribute("aria-hidden","true"),Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.setAttribute("tabindex","-1")}))},x.wrapShift=function(t){this.shift=t,this.renderPosition(this.x+this.parent.slideableWidth*t)},x.remove=function(){this.element.parentNode.removeChild(this.element)};const z=S.prototype;z.addCell=function(t){this.cells.push(t),this.outerWidth+=t.size.outerWidth,this.height=Math.max(t.size.outerHeight,this.height),1==this.cells.length&&(this.x=t.x,this.firstMargin=t.size[this.isOriginLeft?"marginLeft":"marginRight"])},z.updateTarget=function(){const t=this.isOriginLeft?"marginRight":"marginLeft",i=this.getLastCell();this.target=this.x+this.firstMargin+(this.outerWidth-(this.firstMargin+(i?i.size[t]:0)))*this.parent.cellAlign},z.getLastCell=function(){return this.cells[this.cells.length-1]},z.select=function(){this.cells.forEach((function(t){t.select()}))},z.unselect=function(){this.cells.forEach((function(t){t.unselect()}))},z.getCellElements=function(){return this.cells.map((function(t){return t.element}))};const C={startAnimation:function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},animate:function(){this.applyDragForce(),this.applySelectedAttraction();const t=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(t),this.isAnimating){const t=this;requestAnimationFrame((function(){t.animate()}))}},positionSlider:function(){let t=this.x;this.options.wrapAround&&this.cells.length>1&&(t=m.modulo(t,this.slideableWidth),t-=this.slideableWidth,this.shiftWrapCells(t)),this.setTranslateX(t,this.isAnimating),this.dispatchScrollEvent()},setTranslateX:function(t){t+=this.cursorPosition;const i=this.getPositionValue(t=this.options.rightToLeft?-t:t);this.slider.style.transform="translate3d("+i+",0,0)"},dispatchScrollEvent:function(){const t=this.slides[0];if(!t)return;const i=-this.x-t.target;this.dispatchEvent("scroll",null,[i/this.slidesWidth,i])},positionSliderAtSelected:function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},getPositionValue:function(t){return this.options.percentPosition?.01*Math.round(t/this.size.innerWidth*1e4)+"%":Math.round(t)+"px"},settle:function(t){this.isPointerDown||Math.round(100*this.x)!=Math.round(100*t)||this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},shiftWrapCells:function(t){this._shiftCells(this.beforeShiftCells,this.cursorPosition+t,-1),this._shiftCells(this.afterShiftCells,this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition),1)},_shiftCells:function(t,i,s){for(let n=0;n<t.length;n++){const e=t[n];e.wrapShift(i>0?s:0),i-=e.size.outerWidth}},_unshiftCells:function(t){if(t&&t.length)for(let i=0;i<t.length;i++)t[i].wrapShift(0)},integratePhysics:function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},applyForce:function(t){this.velocity+=t},getFrictionFactor:function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},getRestingPosition:function(){return this.x+this.velocity/(1-this.getFrictionFactor())},applyDragForce:function(){this.isDraggable&&this.isPointerDown&&this.applyForce(this.dragX-this.x-this.velocity)},applySelectedAttraction:function(){this.isDraggable&&this.isPointerDown||this.isFreeScrolling||!this.slides.length||this.applyForce((-1*this.selectedSlide.target-this.x)*this.options.selectedAttraction)}},M=window.getComputedStyle,T=window.console;function A(t,i){for(t=m.makeArray(t);t.length;)i.appendChild(t.shift())}let E=0;const P={};function D(t,i){const s=m.getQueryElement(t);if(s){if(this.element=s,this.element.flickityGUID){const t=P[this.element.flickityGUID];if(!P[this.element.flickityGUID])return;return t.option(i),t}this.options=m.extend({},this.constructor.defaults),this.option(i),this._create()}else T&&T.error("Bad element for Flickity: "+(s||t))}D.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},D.createMethods=[];const F=D.prototype;m.extend(F,r.prototype),F._create=function(){const t=this.guid=++E;this.element.flickityGUID=t,P[t]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this.viewport.setAttribute("part","slide-viewport"),this._createSlider(),(this.options.resize||this.options.watchCSS)&&window.addEventListener("resize",this);for(const t in this.options.on)this.on(t,this.options.on[t]);D.createMethods.forEach((function(t){this[t]()}),this),this.options.watchCSS?this.watchCSS():this.activate()},F.option=function(t){m.extend(this.options,t)},F.activate=function(){this.isActive||(this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize(),A(this.element.children,this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate"),this.selectInitialIndex(),this.isInitActivated=!0,this.dispatchEvent("ready"))},F._createSlider=function(){const t=document.createElement("div");t.className="flickity-slider",t.style[this.originSide]=0,this.slider=t},F._filterFindCellElements=function(t){return m.filterFindElements(t,this.options.cellSelector)},F.reloadCells=function(){let t=this.slider.children;if(this.slider.getRootNode().host){t=[];for(const i of this.slider.getRootNode().host.children)"assignedElements"in i?t=[...t,...i.assignedElements()]:t.push(i)}this.cells=this._makeCells(t),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},F._makeCells=function(t){return this._filterFindCellElements(t).map((function(t){return new w(t,this)}),this)},F.getLastCell=function(){return this.cells[this.cells.length-1]},F.getLastSlide=function(){return this.slides[this.slides.length-1]},F.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},F._positionCells=function(t){this.maxCellHeight=(t=t||0)&&this.maxCellHeight||0;let i=0;if(t>0){const s=this.cells[t-1];i=s.x+s.size.outerWidth}const s=this.cells.length;for(let n=t;n<s;n++){const t=this.cells[n];t.setPosition(i),i+=t.size.outerWidth,this.maxCellHeight=Math.max(t.size.outerHeight,this.maxCellHeight)}this.slideableWidth=i,this.updateSlides(),this._containSlides(),this.slidesWidth=s?this.getLastSlide().target-this.slides[0].target:0},F._sizeCells=function(t){t.forEach((function(t){t.getSize()}))},F.updateSlides=function(){if(this.slides=[],!this.cells.length)return;let t=new S(this);this.slides.push(t);const i="left"==this.originSide?"marginRight":"marginLeft",s=this._getCanCellFit();this.cells.forEach((function(n,e){t.cells.length?(s.call(this,e,t.outerWidth-t.firstMargin+(n.size.outerWidth-n.size[i]))||(t.updateTarget(),t=new S(this),this.slides.push(t)),t.addCell(n)):t.addCell(n)}),this),t.updateTarget(),this.updateSelectedSlide()},F._getCanCellFit=function(){const t=this.options.groupCells;if(!t)return function(){return!1};if("number"==typeof t){const i=parseInt(t,10);return function(t){return t%i!=0}}const i="string"==typeof t&&t.match(/^(\d+)%$/),s=i?parseInt(i[1],10)/100:1;return function(t,i){return i<=(this.size.innerWidth+1)*s}},F._init=F.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},F.getSize=function(){this.size=g(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};const L={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};function R(){}F.setCellAlign=function(){const t=L[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign},F.setGallerySize=function(){this.options.setGallerySize&&(this.viewport.style.height=(this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight)+"px")},F._getWrapShiftCells=function(){if(!this.options.wrapAround)return;this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);let t=this.cursorPosition;this.beforeShiftCells=this._getGapCells(t,this.cells.length-1,-1),t=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(t,0,1)},F._getGapCells=function(t,i,s){const n=[];for(;t>0;){const e=this.cells[i];if(!e)break;n.push(e),i+=s,t-=e.size.outerWidth}return n},F._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length)return;const t=this.options.rightToLeft,i=t?"marginRight":"marginLeft",s=t?"marginLeft":"marginRight",n=this.slideableWidth-this.getLastCell().size[s],e=n<this.size.innerWidth,o=this.cursorPosition+this.cells[0].size[i],h=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach((function(t){e?t.target=n*this.cellAlign:(t.target=Math.max(t.target,o),t.target=Math.min(t.target,h))}),this)},F.dispatchEvent=function(t,i,s){const n=i?[i].concat(s):s;this.emitEvent(t,n)},F.select=function(t,i,s){if(!this.isActive)return;if(t=parseInt(t,10),this._wrapSelect(t),(this.options.wrapAround||i)&&(t=m.modulo(t,this.slides.length)),!this.slides[t])return;const n=this.selectedIndex;this.selectedIndex=t,this.updateSelectedSlide(),s?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select",null,[t]),t!=n&&this.dispatchEvent("change",null,[t]),this.dispatchEvent("cellSelect")},F._wrapSelect=function(t){const i=this.slides.length;if(!(this.options.wrapAround&&i>1))return t;const s=m.modulo(t,i),n=Math.abs(s-this.selectedIndex),e=Math.abs(s+i-this.selectedIndex),o=Math.abs(s-i-this.selectedIndex);!this.isDragSelect&&e<n?t+=i:!this.isDragSelect&&o<n&&(t-=i),t<0?this.x-=this.slideableWidth:t>=i&&(this.x+=this.slideableWidth)},F.previous=function(t,i){this.select(this.selectedIndex-1,t,i)},F.next=function(t,i){this.select(this.selectedIndex+1,t,i)},F.updateSelectedSlide=function(){const t=this.slides[this.selectedIndex];t&&(this.unselectSelectedSlide(),this.selectedSlide=t,t.select(),this.selectedCells=t.cells,this.selectedElements=t.getCellElements(),this.selectedCell=t.cells[0],this.selectedElement=this.selectedElements[0])},F.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},F.selectInitialIndex=function(){const t=this.options.initialIndex;if(this.isInitActivated)return void this.select(this.selectedIndex,!1,!0);if(t&&"string"==typeof t&&this.queryCell(t))return void this.selectCell(t,!1,!0);let i=0;t&&this.slides[t]&&(i=t),this.select(i,!1,!0)},F.selectCell=function(t,i,s){const n=this.queryCell(t);if(!n)return;const e=this.getCellSlideIndex(n);this.select(e,i,s)},F.getCellSlideIndex=function(t){for(let i=0;i<this.slides.length;i++)if(-1!=this.slides[i].cells.indexOf(t))return i},F.getCell=function(t){for(let i=0;i<this.cells.length;i++){const s=this.cells[i];if(s.element==t)return s}},F.getCells=function(t){t=m.makeArray(t);const i=[];return t.forEach((function(t){const s=this.getCell(t);s&&i.push(s)}),this),i},F.getCellElements=function(){return this.cells.map((function(t){return t.element}))},F.getParentCell=function(t){return this.getCell(t)||(t=m.getParent(t,".flickity-slider > *"),this.getCell(t))},F.getAdjacentCellElements=function(t,i){if(!t)return this.selectedSlide.getCellElements();i=void 0===i?this.selectedIndex:i;const s=this.slides.length;if(1+2*t>=s)return this.getCellElements();let n=[];for(let e=i-t;e<=i+t;e++){const t=this.options.wrapAround?m.modulo(e,s):e,i=this.slides[t];i&&(n=n.concat(i.getCellElements()))}return n},F.queryCell=function(t){if("number"==typeof t)return this.cells[t];if("string"==typeof t){if(t.match(/^[#\.]?[\d\/]/))return;t=this.element.querySelector(t)}return this.getCell(t)},F.uiChange=function(){this.emitEvent("uiChange")},F.childUIPointerDown=function(t){"touchstart"!=t.type&&t.preventDefault(),this.focus()},F.onresize=function(){this.watchCSS(),this.resize()},m.debounceMethod(D,"onresize",150),F.resize=function(){this.isActive&&(this.getSize(),this.options.wrapAround&&(this.x=m.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize"),this.selectCell(this.selectedElements&&this.selectedElements[0],!1,!0))},F.watchCSS=function(){this.options.watchCSS&&(-1!=M(this.element,":after").content.indexOf("flickity")?this.activate():this.deactivate())},F.onkeydown=function(t){const i=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||i)return;const s=D.keyboardHandlers[t.keyCode];s&&s.call(this)},D.keyboardHandlers={37:function(){const t=this.options.rightToLeft?"next":"previous";this.uiChange(),this[t]()},39:function(){const t=this.options.rightToLeft?"previous":"next";this.uiChange(),this[t]()}},F.focus=function(){const t=window.pageYOffset;this.element.focus({preventScroll:!0}),window.pageYOffset!=t&&window.scrollTo(window.pageXOffset,t)},F.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach((function(t){t.destroy()})),this.element.removeChild(this.viewport),A(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},F.destroy=function(){this.deactivate(),window.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),delete this.element.flickityGUID,delete P[this.guid]},m.extend(F,C),D.data=function(t){const i=(t=m.getQueryElement(t))&&t.flickityGUID;return i&&P[i]},m.htmlInit(D,"flickity"),D.Cell=w,D.Slide=S;const O=R.prototype=Object.create(r.prototype);O.bindStartEvent=function(t){this._bindStartEvent(t,!0)},O.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},O._bindStartEvent=function(t,i){i=void 0===i||i;let s="mousedown";"ontouchstart"in window?s="touchstart":window.PointerEvent&&(s="pointerdown"),t[i?"addEventListener":"removeEventListener"](s,this)},O.handleEvent=function(t){const i="on"+t.type;this[i]&&this[i](t)},O.getTouch=function(t){for(let i=0;i<t.length;i++){const s=t[i];if(s.identifier==this.pointerIdentifier)return s}},O.onmousedown=function(t){const i=t.button;i&&0!==i&&1!==i||this._pointerDown(t,t)},O.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])},O.onpointerdown=function(t){this._pointerDown(t,t)},O._pointerDown=function(t,i){t.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==i.pointerId?i.pointerId:i.identifier,this.pointerDown(t,i))},O.pointerDown=function(t,i){this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,i])};const N={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};
11
+ /*!
12
+ * Unidragger v2.4.0
13
+ * Draggable base class
14
+ * MIT license
15
+ */
16
+ function j(){}O._bindPostStartEvents=function(t){if(!t)return;const i=N[t.type];i.forEach((function(t){window.addEventListener(t,this)}),this),this._boundPointerEvents=i},O._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach((function(t){window.removeEventListener(t,this)}),this),delete this._boundPointerEvents)},O.onmousemove=function(t){this._pointerMove(t,t)},O.onpointermove=function(t){t.pointerId==this.pointerIdentifier&&this._pointerMove(t,t)},O.ontouchmove=function(t){const i=this.getTouch(t.changedTouches);i&&this._pointerMove(t,i)},O._pointerMove=function(t,i){this.pointerMove(t,i)},O.pointerMove=function(t,i){this.emitEvent("pointerMove",[t,i])},O.onmouseup=function(t){this._pointerUp(t,t)},O.onpointerup=function(t){t.pointerId==this.pointerIdentifier&&this._pointerUp(t,t)},O.ontouchend=function(t){const i=this.getTouch(t.changedTouches);i&&this._pointerUp(t,i)},O._pointerUp=function(t,i){this._pointerDone(),this.pointerUp(t,i)},O.pointerUp=function(t,i){this.emitEvent("pointerUp",[t,i])},O._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},O._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},O.pointerDone=
17
+ /*!
18
+ * Unipointer v2.4.0
19
+ * base class for doing one thing with pointer event
20
+ * MIT license
21
+ */
22
+ function(){},O.onpointercancel=function(t){t.pointerId==this.pointerIdentifier&&this._pointerCancel(t,t)},O.ontouchcancel=function(t){const i=this.getTouch(t.changedTouches);i&&this._pointerCancel(t,i)},O._pointerCancel=function(t,i){this._pointerDone(),this.pointerCancel(t,i)},O.pointerCancel=function(t,i){this.emitEvent("pointerCancel",[t,i])},R.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};const B=j.prototype=Object.create(R.prototype);B.bindHandles=function(){this._bindHandles(!0)},B.unbindHandles=function(){this._bindHandles(!1)},B._bindHandles=function(t){const i=(t=void 0===t||t)?"addEventListener":"removeEventListener",s=t?this._touchActionValue:"";for(let n=0;n<this.handles.length;n++){const e=this.handles[n];this._bindStartEvent(e,t),e[i]("click",this),window.PointerEvent&&(e.style.touchAction=s)}},B._touchActionValue="none",B.pointerDown=function(t,i){this.okayPointerDown(t)&&(this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY},t.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,i]))};const I={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},_={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};B.okayPointerDown=function(t){const i=!I[t.target.nodeName]||_[t.target.type];return i||this._pointerReset(),i},B.pointerDownBlur=function(){const t=document.activeElement;t&&t.blur&&t!=document.body&&t.blur()},B.pointerMove=function(t,i){const s=this._dragPointerMove(t,i);this.emitEvent("pointerMove",[t,i,s]),this._dragMove(t,i,s)},B._dragPointerMove=function(t,i){const s={x:i.pageX-this.pointerDownPointer.pageX,y:i.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(s)&&this._dragStart(t,i),s},B.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3},B.pointerUp=function(t,i){this.emitEvent("pointerUp",[t,i]),this._dragPointerUp(t,i)},B._dragPointerUp=function(t,i){this.isDragging?this._dragEnd(t,i):this._staticClick(t,i)},B._dragStart=function(t,i){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(t,i)},B.dragStart=function(t,i){this.emitEvent("dragStart",[t,i])},B._dragMove=function(t,i,s){this.isDragging&&this.dragMove(t,i,s)},B.dragMove=function(t,i,s){t.preventDefault(),this.emitEvent("dragMove",[t,i,s])},B._dragEnd=function(t,i){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(t,i)},B.dragEnd=function(t,i){this.emitEvent("dragEnd",[t,i])},B.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},B._staticClick=function(t,i){this.isIgnoringMouseUp&&"mouseup"==t.type||(this.staticClick(t,i),"mouseup"!=t.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},B.staticClick=function(t,i){this.emitEvent("staticClick",[t,i])},j.getPointerPoint=R.getPointerPoint;const W=D;(()=>{m.extend(D.defaults,{draggable:">1",dragThreshold:3}),D.createMethods.push("_createDrag");const t=D.prototype;m.extend(t,j.prototype),t._touchActionValue="pan-y";const i="createTouch"in document;let s=!1;t._createDrag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable),i&&!s&&(window.addEventListener("touchmove",(function(){})),s=!0)},t.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},t.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},t.updateDraggable=function(){this.isDraggable=">1"==this.options.draggable?this.slides.length>1:this.options.draggable,this.isDraggable?this.element.classList.add("is-draggable"):this.element.classList.remove("is-draggable")},t.bindDrag=function(){this.options.draggable=!0,this.updateDraggable()},t.unbindDrag=function(){this.options.draggable=!1,this.updateDraggable()},t._uiChangeDrag=function(){delete this.isFreeScrolling},t.pointerDown=function(t,i){this.isDraggable?this.okayPointerDown(t)&&(this._pointerDownPreventDefault(t),this.pointerDownFocus(t),document.activeElement!=this.element&&this.pointerDownBlur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=e(),window.addEventListener("scroll",this),this._pointerDownDefault(t,i)):this._pointerDownDefault(t,i)},t._pointerDownDefault=function(t,i){this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY},this._bindPostStartEvents(t),this.dispatchEvent("pointerDown",t,[i])};const n={INPUT:!0,TEXTAREA:!0,SELECT:!0};function e(){return{x:window.scrollX,y:window.scrollY}}t.pointerDownFocus=function(t){n[t.target.nodeName]||this.focus()},t._pointerDownPreventDefault=function(t){"touchstart"==t.type||"touch"==t.pointerType||n[t.target.nodeName]||t.preventDefault()},t.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold},t.pointerUp=function(t,i){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",t,[i]),this._dragPointerUp(t,i)},t.pointerDone=function(){window.removeEventListener("scroll",this),delete this.pointerDownScroll},t.dragStart=function(t,i){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),window.removeEventListener("scroll",this),this.dispatchEvent("dragStart",t,[i]))},t.pointerMove=function(t,i){const s=this._dragPointerMove(t,i);this.dispatchEvent("pointerMove",t,[i,s]),this._dragMove(t,i,s)},t.dragMove=function(t,i,s){if(!this.isDraggable)return;t.preventDefault(),this.previousDragX=this.dragX;const n=this.options.rightToLeft?-1:1;this.options.wrapAround&&(s.x=s.x%this.slideableWidth);let e=this.dragStartPosition+s.x*n;if(!this.options.wrapAround&&this.slides.length){const t=Math.max(-this.slides[0].target,this.dragStartPosition);e=e>t?.5*(e+t):e;const i=Math.min(-this.getLastSlide().target,this.dragStartPosition);e=e<i?.5*(e+i):e}this.dragX=e,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",t,[i,s])},t.dragEnd=function(t,i){if(!this.isDraggable)return;this.options.freeScroll&&(this.isFreeScrolling=!0);let s=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){const t=this.getRestingPosition();this.isFreeScrolling=-t>this.slides[0].target&&-t<this.getLastSlide().target}else this.options.freeScroll||s!=this.selectedIndex||(s+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.options.wrapAround,this.select(s),delete this.isDragSelect,this.dispatchEvent("dragEnd",t,[i])},t.dragEndRestingSelect=function(){const t=this.getRestingPosition(),i=Math.abs(this.getSlideDistance(-t,this.selectedIndex)),s=this._getClosestResting(t,i,1),n=this._getClosestResting(t,i,-1);return s.distance<n.distance?s.index:n.index},t._getClosestResting=function(t,i,s){let n=this.selectedIndex,e=1/0;const o=this.options.contain&&!this.options.wrapAround?function(t,i){return t<=i}:function(t,i){return t<i};for(;o(i,e)&&(n+=s,e=i,null!==(i=this.getSlideDistance(-t,n)));)i=Math.abs(i);return{distance:e,index:n-s}},t.getSlideDistance=function(t,i){const s=this.slides.length,n=this.options.wrapAround&&s>1,e=n?m.modulo(i,s):i,o=this.slides[e];if(!o)return null;const h=n?this.slideableWidth*Math.floor(i/s):0;return t-(o.target+h)},t.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;const t=this.getSlideDistance(-this.dragX,this.selectedIndex),i=this.previousDragX-this.dragX;return t>0&&i>0?1:t<0&&i<0?-1:0},t.staticClick=function(t,i){const s=this.getParentCell(t.target),n=s&&s.element,e=s&&this.cells.indexOf(s);this.dispatchEvent("staticClick",t,[i,n,e])},t.onscroll=function(){const t=e(),i=this.pointerDownScroll.y-t.y;(Math.abs(this.pointerDownScroll.x-t.x)>3||Math.abs(i)>3)&&this._pointerDone()}})(),(()=>{function t(t,i){this.direction=t,this.parent=i,this.parentElement=this.parent.element.shadowRoot||this.parent.element,this._create()}(t.prototype=Object.create(R.prototype))._create=function(){this.isEnabled=!0,this.isPrevious=-1==this.direction,this.isLeft=this.direction==(this.parent.options.rightToLeft?1:-1);const t=this.element=document.createElement("button");t.className="flickity-button flickity-prev-next-button",this.isPrevious?(t.classList.add("previous"),t.setAttribute("part","navigation-button navigation-button--previous")):(t.classList.add("next"),t.setAttribute("part","navigation-button navigation-button--next")),t.setAttribute("type","button"),this.disable(),t.setAttribute("aria-label",this.isPrevious?"Previous":"Next");const i=document.createElement("slot");i.name=this.isPrevious?"previous-icon":"next-icon",t.appendChild(i),i.addEventListener("slotchange",(()=>{i.assignedElements({flatten:!0}).forEach((t=>{t.removeAttribute("hidden")}))}));const s=document.createElement("span");s.className="button-icon "+(this.isPrevious?"button-icon--previous":"button-icon--next"),s.setAttribute("part","navigation-icon"),i.appendChild(s),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},t.prototype.activate=function(){this.bindStartEvent(this.element),this.element.addEventListener("click",this),this.parentElement.appendChild(this.element)},t.prototype.deactivate=function(){this.parentElement.removeChild(this.element),this.unbindStartEvent(this.element),this.element.removeEventListener("click",this)},t.prototype.handleEvent=m.handleEvent,t.prototype.onclick=function(){this.isEnabled&&(this.parent.uiChange(),this.parent[this.isPrevious?"previous":"next"]())},t.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},t.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},t.prototype.update=function(){const t=this.parent.slides;this.parent.options.wrapAround&&t.length>1?this.enable():this[this.parent.selectedIndex==(this.isPrevious?0:t.length?t.length-1:0)?"disable":"enable"]()},t.prototype.destroy=function(){this.deactivate(),this.allOff()},m.extend(D.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),D.createMethods.push("_createPrevNextButtons");const i=D.prototype;i._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new t(-1,this),this.nextButton=new t(1,this),this.on("activate",this.activatePrevNextButtons))},i.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},i.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},D.PrevNextButton=t})(),(()=>{function t(t){this.parent=t,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}(t.prototype=Object.create(r.prototype)).play=function(){"playing"!=this.state&&(document.hidden?document.addEventListener("visibilitychange",this.onVisibilityPlay):(this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()))},t.prototype.tick=function(){if("playing"!=this.state)return;let t=this.parent.options.autoPlay;t="number"==typeof t?t:3e3;const i=this;this.clear(),this.timeout=setTimeout((function(){i.parent.next(!0),i.tick()}),t)},t.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},t.prototype.clear=function(){clearTimeout(this.timeout)},t.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},t.prototype.unpause=function(){"paused"==this.state&&this.play()},t.prototype.visibilityChange=function(){this[document.hidden?"pause":"unpause"]()},t.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},m.extend(D.defaults,{pauseAutoPlayOnHover:!0}),D.createMethods.push("_createPlayer");const i=D.prototype;i._createPlayer=function(){this.player=new t(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},i.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},i.playPlayer=function(){this.player.play()},i.stopPlayer=function(){this.player.stop()},i.pausePlayer=function(){this.player.pause()},i.unpausePlayer=function(){this.player.unpause()},i.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},i.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},i.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},D.Player=t})();const U=class{constructor(s){t(this,s),this.nanoSlidesDidLoad=i(this,"nanoSlidesDidLoad",7),this.nanoSlidesReady=i(this,"nanoSlidesReady",7),this.nanoSlidesSelect=i(this,"nanoSlidesSelect",7),this.nanoSlidesChange=i(this,"nanoSlidesChange",7),this.nanoSlidesScroll=i(this,"nanoSlidesScroll",7),this.nanoSlidesTransitionEnd=i(this,"nanoSlidesTransitionEnd",7),this.nanoSlidesDragStart=i(this,"nanoSlidesDragStart",7),this.nanoSlidesDragMove=i(this,"nanoSlidesDragMove",7),this.nanoSlidesDragEnd=i(this,"nanoSlidesDragEnd",7),this.nanoSlidesTap=i(this,"nanoSlidesTap",7),this.nanoSlidesFullscreenChange=i(this,"nanoSlidesFullscreenChange",7)}flickityEl;flickityReady=!1;mutationO;resizeO;readyflickity;flickity=new Promise((t=>{this.readyflickity=t}));syncflickity;childrenEles;hasFullScreenModule=!1;hasLazyLoadModule=!1;hasFadeModule=!1;iCurrentSlide;slidesReady;didInit=!1;slideCount=0;get host(){return s(this)}options={};async optionsChanged(){if(this.flickityReady){const t=await this.getflickity(),i=Object.assign(t.options,this.options);await this.loadFlickityModules(i),await this.update()}}navbtns=!1;async navbtnsChanged(){Array.from(this._getRoot().querySelectorAll(".flickity-prev-next-button")).forEach((t=>{t.hidden=!this.navbtns}))}pager=!1;async pagerChanged(){const t=this._getRoot().querySelector(".flickity-page-dots");t&&(t.hidden=!this.pager)}fullscreenbtn=!1;async fullscreenBtnChanged(){const t=this._getRoot().querySelector(".flickity-fullscreen-button");t&&(t.hidden=!this.fullscreenbtn)}fullscreen=!1;async fullscreenChanged(t,i){const s=await this.getflickity();this.fullscreen?s.viewFullscreen():void 0!==i&&s.exitFullscreen()}animation="scroll";async animationChange(t,i){const[s,n]=await Promise.all([this.getflickity(),this.waitForSlides(this.host)]);if(n.forEach((t=>{t.style.left=void 0})),"parallax"===i&&(s.off("scroll",this.parallax),n.forEach(((t,i)=>{this.childrenEles&&this.childrenEles[i]&&(this.childrenEles[i].style.transform=void 0)})),this.update()),"function"==typeof i&&s.off("scroll",i),"function"==typeof this.animation)return this.updateOptions({fade:!1,percentPosition:!0}),void s.on("scroll",this.animation);switch(this.animation){case"fade":this.updateOptions({fade:!0,percentPosition:!0});break;case"parallax":this.updateOptions({fade:!1,percentPosition:!0}),s.on("scroll",this.parallax);break;default:this.updateOptions({fade:!1,percentPosition:!0})}}updateOptions(t){this.options={...this.options,...t}}currentSlide=0;currentSlideChange(){this.currentSlide!==this.iCurrentSlide&&this.slideTo(this.currentSlide)}internalSlideChange(){this.currentSlide=this.iCurrentSlide}autoplay=!1;async autoPlayChange(){await this.stopAutoplay(),this.autoplay&&("string"==typeof this.autoplay&&(this.autoplay=parseInt(this.autoplay)),this.autoplay>0&&this.startAutoplay(this.autoplay))}ready=!1;nanoSlidesDidLoad;nanoSlidesReady;nanoSlidesSelect;nanoSlidesChange;nanoSlidesScroll;nanoSlidesTransitionEnd;nanoSlidesDragStart;nanoSlidesDragMove;nanoSlidesDragEnd;nanoSlidesTap;nanoSlidesFullscreenChange;async update(){const[t]=await Promise.all([this.getflickity(),this.waitForSlides(this.host)]);this.childrenEles=this.host.querySelectorAll(`${h("nano-slide")} > *`),t.reloadCells(),t.resize(),t.reposition()}async slideTo(t,i){(await this.getflickity()).select(t,i)}async slideNext(t,i){(await this.getflickity()).next(i,t)}async slidePrev(t,i){(await this.getflickity()).previous(t,i)}async getActiveIndex(){return(await this.getflickity()).selectedIndex}async length(){return(await this.getflickity()).slides.length}async isEnd(){const t=await this.getflickity();return t.selectedIndex===t.slides.length-1}async isBeginning(){return 0===(await this.getflickity()).selectedIndex}async startAutoplay(t){const i=await this.getflickity();t&&(this.options={autoPlay:t}),setTimeout((()=>i.playPlayer()))}async stopAutoplay(){(await this.getflickity()).stopPlayer()}async lockSwipes(t){const i=await this.getflickity();i.options.draggable=!t,i.updateDraggable()}async getflickity(){return this.flickity}async reload(){this.destroyflickity(),setTimeout((()=>this.initflickity()),20)}_getRoot(){return this.host.shadowRoot?this.host.shadowRoot:this.host}parallax=async()=>{const t=await this.flickity;t.cells.forEach((i=>{let s=t.x;var n;t.options.wrapAround&&t.cells.length>1&&(s=(s%(n=t.slideableWidth)+n)%n,s-=t.slideableWidth);let e=-1*(i.target+s)/3;i.shift<0?e=-1*(i.target-t.slideableWidth+s)/3:i.shift>0&&(e=-1*(i.target+(s+t.slideableWidth))/3),i.element.children[0].style.transform="translate3d("+e+"px, 0, 0)",i.element.style.setProperty("--animation-amount",(3*e/i.size.width*100).toString())}))};isActive(t){return t===this.currentSlide}handleFullscreen=t=>{this.fullscreen=t,this.nanoSlidesFullscreenChange.emit(t)};handleSlideSelect=t=>{this.iCurrentSlide=t,this.nanoSlidesSelect.emit(t)};destroyflickity(){const t=this.syncflickity;void 0!==t&&(t.destroy(),this.flickity=new Promise((t=>{this.readyflickity=t})),this.flickityReady=!1,this.syncflickity=void 0,this.ready=!1),this.didInit=!1}async loadFlickityModules(t){!this.hasFullScreenModule&&t.fullscreen&&(await import("./fullscreen-DXVJLaN3.js"),this.hasFullScreenModule=!0),!this.hasLazyLoadModule&&t.lazyLoad&&(await import("./lazyload-DUQP_u2u.js"),this.hasLazyLoadModule=!0),!this.hasFadeModule&&t.fade&&(await import("./fade-B-zhtzv8.js"),this.hasFadeModule=!0)}async initflickity(){const t=this.normalizeOptions();await this.loadFlickityModules(t),await this.waitForSlides(this.host),this.flickityEl=this.flickityEl||this._getRoot().querySelector(".flickity-container"),this.flickityEl&&(this.slidesReady=!0,this.flickityEl.classList.contains("flickity-enabled")&&this.destroyflickity(),this.flickityEl.style.height=this.flickityEl.getBoundingClientRect().height+"px",setTimeout((()=>{this.flickityEl.style.height="";const i=new W(this.flickityEl,t);this.flickityReady=!0,this.syncflickity=i,this.animationChange(),this.navbtnsChanged(),this.pagerChanged(),this.fullscreenChanged(),this.fullscreenBtnChanged(),this.readyflickity(i),this.ready=!0,window.ResizeObserver&&(this.resizeO&&(this.resizeO.disconnect(),this.resizeO=void 0),(this.resizeO=new ResizeObserver((()=>{n((()=>{const t=this.host.shadowRoot.querySelector(".flickity-viewport");e((()=>{t&&(t.style.height=""),i.resize()}))}))}))).observe(this.host))}),100))}normalizeOptions(){const t={cellSelector:h("nano-slide"),contain:!0,prevNextButtons:!0,fullscreen:this.fullscreen,accessibility:!0,imagesLoaded:!0};"fade"===this.animation&&(t.fade=!0),this.currentSlide>0&&(t.initialIndex=this.currentSlide),this.autoplay&&("string"==typeof this.autoplay&&(this.autoplay=parseInt(this.autoplay)),this.autoplay>0&&(t.autoPlay=this.autoplay));const i={on:{...this.options&&this.options.on?this.options.on:{},ready:()=>{setTimeout((()=>{this.nanoSlidesReady.emit()}),20)},select:this.handleSlideSelect,change:this.nanoSlidesChange.emit,scroll:this.nanoSlidesScroll.emit,settle:()=>requestAnimationFrame((()=>this.nanoSlidesTransitionEnd.emit())),dragStart:()=>requestAnimationFrame((()=>this.nanoSlidesDragStart.emit())),dragMove:()=>requestAnimationFrame((()=>this.nanoSlidesDragMove.emit())),dragEnd:()=>requestAnimationFrame((()=>this.nanoSlidesDragEnd.emit())),staticClick:this.nanoSlidesTap.emit,fullscreenChange:this.handleFullscreen}};return{...t,...i,...this.options}}waitForSlides=t=>{const i=Array.from(t.querySelectorAll(h("nano-slide")));this.slideCount=i.length;let s=i.filter((t=>!t.ready));return s.length?new Promise((n=>{const e=o=>{s=s.filter((t=>t!==o.target)),s.length||(n(i),t.removeEventListener("nanoSlideReady",e),t.removeEventListener("nano-slide-ready",e))};t.addEventListener("nanoSlideReady",e),t.addEventListener("nano-slide-ready",e)})):Promise.resolve(i)};componentDidLoad(){this.nanoSlidesDidLoad.emit(),this.didInit||(this.didInit=!0,this.initflickity()),"undefined"!=typeof window&&window.MutationObserver&&(this.mutationO=new MutationObserver((t=>{t[0].addedNodes[0]&&t[0].addedNodes[0].nodeName.toLowerCase()===h("nano-slide")&&this.flickityReady&&this.update()}))).observe(this.host,{childList:!0,subtree:!0})}disconnectedCallback(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0),this.resizeO&&(this.resizeO.disconnect(),this.resizeO=void 0),this.destroyflickity()}render(){return c(o,{key:"6dedc1589f5ae629975f38303f658de914c8f506",class:"nano-slides"},c("div",{key:"528c7b10972b258ef0345525a9fa82c289ecc083",class:{slideshow:!0,ready:this.ready,"not-ready":!this.ready},part:"base"},c("div",{key:"4d16a4da0692f53500c755600a539edf5dc2d606",ref:t=>this.flickityEl=t,class:{"flickity-container":!0,"slides-ready":this.slidesReady,"slides-not-ready":!this.slidesReady},part:"slide-container"},c("slot",{key:"ddcdf042f8d25069c08578e7417e3f5571386b76"})),c("div",{key:"5a456eee7631c979fef473352d2c4beec7a5cf2e",class:"ui-extras"},c("slot",{key:"3994bac2fd8111223df9e3886481edf72b0f2d54",name:"ui"})),this.slideCount>1&&this.pager&&c("div",{key:"2966cef941d7232110ba4dbba0aefdb33e757216",class:"pagination flickity-page-dots",part:"pagination"},Array.from({length:this.slideCount}).map(((t,i)=>c("button",{part:"pagination-item--active",key:i,class:{"pagination-btn":!0,"pagination-btn--active":this.isActive(i),"is-selected":this.isActive(i),dot:!0},"aria-current":this.isActive(i)?"step":void 0,onClick:()=>{this.isActive(i)||this.slideTo(i)}},c("span",{class:"pagination-btn__label"},"Go to slide ",i+1)))))))}static get watchers(){return{options:["optionsChanged"],navbtns:["navbtnsChanged"],pager:["pagerChanged"],fullscreenbtn:["fullscreenBtnChanged"],fullscreen:["fullscreenChanged"],animation:["animationChange"],currentSlide:["currentSlideChange"],iCurrentSlide:["internalSlideChange"],autoplay:["autoPlayChange"]}}};U.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--dot-color:var(--nano-color-neutral-400);--dot-color-active:var(--nano-color-primary-1000);--navbtns-icon-color:var(--dot-color-active);--navbtns-bg-color:transparent;--navbtns-icon-color-disabled:var(--dot-color-active);--navbtns-bg-color-disabled:transparent;--navbtns-width:1.875rem;--navbtns-height:2.75rem;--fsbtn-icon-color:var(--dot-color-active);--fsbtn-bg-color:transparent;--flip-icon-ltr:0;--flip-icon-rtl:1;display:block;-webkit-user-select:none;user-select:none;overflow:hidden;transition:opacity 0.2s;opacity:0;max-inline-size:100vw}:host:dir(rtl){--flip-icon-ltr:1;--flip-icon-rtl:0}:host([ready]){opacity:1}.slideshow{max-block-size:100%;min-block-size:inherit;block-size:inherit;position:relative}.slideshow.not-ready{inline-size:100%;overflow:hidden}.flickity-container{opacity:0;transition:opacity 0.2s;display:flex;block-size:fit-content}.not-ready .flickity-container{inline-size:fit-content;block-size:fit-content}.flickity-container.slides-ready{min-block-size:inherit;max-block-size:inherit;block-size:inherit;inline-size:auto}[hidden]{display:none !important}.ui-extras{pointer-events:none;position:absolute;block-size:100%;inline-size:100%;inset-block-start:0;inset-inline-start:0}.ui-extras *{pointer-events:all}/*! Flickity v2.2.1\nhttps://flickity.metafizzy.co\n---------------------------------------------- */.flickity-enabled{position:relative;opacity:1}.flickity-enabled:focus{outline:none}.flickity-viewport{overflow:hidden;position:relative;min-block-size:100%;flex:1}.flickity-slider{position:absolute;inline-size:100%;block-size:100%}.flickity-enabled.is-draggable{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.flickity-enabled.is-draggable .flickity-viewport{cursor:move;cursor:grab;cursor:grab}.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down{cursor:grabbing}.flickity-button{position:absolute;background:var(--navbtns-bg-color);border:none;color:#333;opacity:0.75}.flickity-button:hover{opacity:1;cursor:pointer}.flickity-button:focus{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset)}.flickity-button:active{opacity:0.6}.flickity-button:disabled{opacity:0.3;cursor:auto;pointer-events:none;background:var(--navbtns-bg-color-disabled)}.button-icon{display:block}.button-icon::after{content:"";display:block;background-size:cover;inline-size:var(--navbtns-width);block-size:var(--navbtns-height);background-color:var(--navbtns-icon-color);-webkit-mask-image:var(--nano-component-icon-chevron);mask-image:var(--nano-component-icon-chevron);transition:color var(--nano-transition-fast) ease;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;transform-origin:center;margin-inline-start:auto;rotate:calc(180deg * var(--flip-icon-ltr));-webkit-mask-size:cover;mask-size:cover}.button-icon--previous::after{rotate:calc(180deg * var(--flip-icon-rtl))}.flickity-button:disabled .button-icon::after{background-color:var(--navbtns-icon-color-disabled)}.flickity-prev-next-button{inset-block-start:50%;transform:translateY(-50%)}.flickity-prev-next-button.previous{inset-inline-start:10px}.flickity-prev-next-button.next{inset-inline-end:10px}.flickity-rtl .flickity-prev-next-button.previous{inset-inline:auto 10px}.flickity-rtl .flickity-prev-next-button.next{inset-inline:10px auto}.flickity-prev-next-button .flickity-button-icon{position:absolute;inset-inline-start:20%;inset-block-start:20%;inline-size:60%;block-size:60%}.flickity-page-dots{inline-size:100%;padding:0;margin:0;text-align:center;line-height:1;z-index:4;display:inline-flex;justify-content:center;inset-block-end:0}.flickity-rtl .flickity-page-dots{direction:rtl}.flickity-page-dots .dot{all:unset;text-indent:200%;white-space:nowrap;overflow:hidden;display:inline-block;display:inline-block;position:relative;inline-size:1.25rem;block-size:0.375rem;margin-block:0;cursor:pointer;padding:calc(var(--nano-spacing-md) / 2)}.flickity-page-dots .dot::after{content:"";position:absolute;inset:0;background:currentcolor;background:var(--dot-color);margin:calc(var(--nano-spacing-md) / 2)}.flickity-page-dots .dot:focus-visible{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset);z-index:1}.flickity-page-dots .dot.is-selected::after{background:var(--dot-color-active)}.flickity-enabled.is-fullscreen{position:fixed;inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;background:hsla(0, 0%, 0%, 0.9);padding-block-end:35px;z-index:100}.flickity-enabled.is-fullscreen .flickity-page-dots{inset-block-end:45px}html.is-flickity-fullscreen{overflow:hidden}.flickity-fullscreen-button{display:block;inset-inline-end:10px;inset-block-start:10px;inline-size:24px;block-size:24px;border-radius:4px;background:var(--fsbtn-bg-color);fill:var(--fsbtn-icon-color)}.flickity-rtl .flickity-fullscreen-button{inset-inline:10px auto}.flickity-fullscreen-button-exit{display:none}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-exit{display:block}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-view{display:none}.flickity-fullscreen-button .flickity-button-icon{position:absolute;inline-size:16px;block-size:16px;inset-inline-start:4px;inset-block-start:4px}.flickity-enabled.is-fade .flickity-slider>*{pointer-events:none;z-index:0}.flickity-enabled.is-fade .flickity-slider ::slotted(.is-selected){pointer-events:auto;z-index:1}';export{D as F,U as S,m as u}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Custom elements for Nanopore-Digital Web applications
3
3
  */
4
- export{S as nano_slides}from"./nano-slides-BU8CjO-X.js";import"./index-BM3Om9WE.js";import"./renderer-DpNDfhNy.js";
4
+ export{S as nano_slides}from"./nano-slides-BygteMbF.js";import"./index-BM3Om9WE.js";import"./renderer-DpNDfhNy.js";
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Custom elements for Nanopore-Digital Web applications
3
3
  */
4
- import{g as t,d as e,e as i,r as s,c as h,a as r}from"./index-BM3Om9WE.js";import{h as o}from"./renderer-DpNDfhNy.js";import{d as n}from"./drag-BLOEuv-q.js";import{d as a}from"./throttle-C93FMm2Z.js";import{a as d}from"./events-ClRFmcmJ.js";const l={horizontal:{x:1,y:0},vertical:{x:0,y:1}};let c=0;const m=class{itemSelector="li";handleItemSelectorChange(){this.refreshKeyboardHandles()}handleSelector;handleHandleSelectorChange(){this.refreshKeyboardHandles(),this.attachMutationObserver()}dropzoneSelector;helperText='Press "Space" or "Enter" to enable element reordering and use the arrow keys to reorder items.Press "Escape" to cancel reordering. Alternatively, use your mouse to drag / reorder.';itemDescriptor=t=>`"${t?.textContent.trim()}"`;grabbedHelperText=t=>`${this.itemDescriptor(t)} grabbed`;droppedHelperText=t=>`${this.itemDescriptor(t)} dropped`;reorderHelperText=(t,e,i)=>`The list has been reordered, ${this.itemDescriptor(t)} is now item ${i} of ${e.length}`;createKeyboardHandle=(t,e)=>{const i=document.createElement("div");i.innerHTML='\n <nano-icon-button\n slot="end"\n icon-name="light/arrows-up-down-left-right"\n class="nano-sortable__keyboard-handle visually-hidden"\n label="Re-order this item"\n ></nano-icon-button>';const s=i.children[0];return e.append(s),s};handleCreateKeyboardHandleChange(){this.refreshKeyboardHandles()}sortableHostElement;handleSortableHostElement(t,e){e&&this.removeEventHandlers(e),this.addEventHandlers(),this.refreshKeyboardHandles(),this.attachMutationObserver(),this.sortableHostElement&&(this.sortableHostElement.style.position="relative")}animationEnabled=!0;draggedClass="nano-sortable__dragged";handleDraggedClass="nano-sortable__handle-dragged";placeholderClass="nano-sortable__placeholder";dropzoneActiveClass="";animationTiming={duration:200,easing:"ease-out"};orientation;dragResize=!1;nanoOrderChange;nanoGrabbed;nanoDropped;async refreshKeyboardHandles(){if(this.handleSelector)return this.keyboardHandleMap?.size&&this.keyboardHandleMap.clear(),void this.sortableHost.querySelectorAll(this.handleSelector).forEach((t=>{t.getAttribute("aria-describedby")||t.setAttribute("aria-describedby",this.sortableId);const e=t.closest(this.itemSelector);e&&this.keyboardHandleMap.set(t,e)}));this.keyboardHandleMap?.size&&(this.keyboardHandleMap?.forEach(((t,e)=>e.remove())),this.keyboardHandleMap.clear()),this.sortableHost.querySelectorAll(this.itemSelector).forEach(((t,e)=>{const i=this.createKeyboardHandle(e,t);i?(this.keyboardHandleMap.set(i,t),i.setAttribute("aria-describedby",this.sortableId)):console.error("`createKeyboardHandle` *must* return the handle element it creates")}))}get host(){return t(this)}dragRequestPending=!1;draggedElement;draggedElementClone;draggedElementOrigin;sortableNodes=[];dropzoneNodes=[];animatedElements=[];animationPromise;keyboardHandleMap=new Map;sortableId="nano-sortable-"+c++;mouseDownTimer;mutationObserver;keyboardSortActive=!1;ariaTextList=[];get sortableHost(){return this.sortableHostElement?this.sortableHostElement:this.host}addAriaMsg(t){this.ariaTextList=[...this.ariaTextList,t],setTimeout((()=>{const e=this.ariaTextList.indexOf(t);this.ariaTextList.splice(e,1),this.ariaTextList=[...this.ariaTextList]}),1e4)}updateUserSelectStyle(t){this.host.style.userSelect=t}hitTest(t,e){const{left:i,top:s,width:h,height:r}=t.getBoundingClientRect(),o=i+h/2,n=s+r/2;return e.filter((t=>{const{left:e,right:i,top:s,bottom:h}=t.getBoundingClientRect();return!(o<e||o>i||n<s||n>h)}))}isAnimating(t){return-1!==this.animatedElements.indexOf(t)}animateNode(t,i=0,s=0){t.animate&&(this.animatedElements.push(t),t.style.willChange="transform",e((()=>{this.animationPromise=new Promise((e=>{t.animate([{transform:`translate3d(${i}px, ${s}px, 0)`},{transform:"none"}],this.animationTiming).addEventListener("finish",(()=>{const i=this.animatedElements.indexOf(t);t.style.willChange="",-1!==i&&this.animatedElements.splice(i,1),e(),delete this.animationPromise}),{once:!0})}))})))}insertAtTarget(t,e){if(!t||!e)return;let i=[];if(this.animationEnabled&&(i=this.sortableNodes.map((t=>({x:t.offsetLeft,y:t.offsetTop})))),t.isConnected&&e.isConnected){if(this.dropzoneNodes.indexOf(e)>-1)e.append(t);else{const i=t.compareDocumentPosition(e);let s;i&this.host.DOCUMENT_POSITION_FOLLOWING&&(s=e.parentNode===t.parentNode?"afterend":"beforebegin"),i&this.host.DOCUMENT_POSITION_PRECEDING&&(s=e.parentNode===t.parentNode?"beforebegin":"afterend"),s&&e.insertAdjacentElement(s,t)}this.animationEnabled&&this.sortableNodes.forEach(((t,e)=>{const{x:s,y:h}=i[e],r=s-t.offsetLeft,o=h-t.offsetTop;0===r&&0===o||this.animateNode(t,r,o)}))}}reset(){void 0!==this.draggedElementClone&&null!==this.draggedElementClone.parentNode&&this.draggedElementClone.parentNode.removeChild(this.draggedElementClone),this.draggedElement&&this.draggedElement.parentNode&&this.draggedElementOrigin&&this.draggedElement.classList.remove(this.placeholderClass),this.dropzoneActiveClass&&this.dropzoneNodes.length&&this.dropzoneNodes.forEach((t=>t.classList.remove(this.dropzoneActiveClass))),delete this.draggedElementClone,delete this.draggedElement,this.dropzoneNodes=[],this.sortableNodes=[],this.animatedElements=[],this.dragRequestPending=!1,this.updateUserSelectStyle("")}createClone(t){const e=t.cloneNode(!0);t.id&&(e.id="clone__"+e.id),Array.from(e.children).forEach(((e,i)=>{const s=e,h=t.children.item(i);h&&(s.style.width=`${h.offsetWidth}px`)}));const{offsetLeft:i,offsetTop:s,offsetWidth:h,offsetHeight:r}=t;return Object.assign(e.style,{position:"absolute",left:`calc(${i}px - var(--grab-offset-x, 0px))`,top:`calc(${s}px - var(--grab-offset-y, 0px))`,height:this.dragResize?`${r}px`:void 0,width:this.dragResize?`${h}px`:void 0,willChange:"transform,opacity"}),e.classList.add(this.draggedClass),t.parentNode.appendChild(e)}removeEventHandlers(t){(t=t||this.sortableHost).removeEventListener("mousedown",this.handleTrack),t.removeEventListener("touchstart",this.handleTrack),t.removeEventListener("keydown",this.handleKeydown)}addEventHandlers(t){d(t=t||this.sortableHost,"mousedown touchstart",this.handleTrack,{passive:!0}),t.addEventListener("keydown",this.handleKeydown)}attachMutationObserver(){this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=void 0),this.mutationObserver=new MutationObserver((()=>{const t=Array.from(this.keyboardHandleMap.values()),e=Array.from(this.sortableHost.querySelectorAll(this.itemSelector));(t.length!==e.length||e.find((e=>!t.includes(e))))&&this.refreshKeyboardHandles()})),this.mutationObserver.observe(this.sortableHost,{subtree:!0,childList:!0})}handleKeydown(t){const e=t.target;let i,s;if(this.handleSelector?(i=e.closest(this.handleSelector),s=e.closest(this.itemSelector)):(s=this.keyboardHandleMap.get(e),i=e),!i||!s)return;const h=t=>{this.keyboardSortActive=t,this.draggedElement=t?s:void 0,s.classList.toggle(this.draggedClass,t),i.classList.toggle(this.handleDraggedClass,t),t?(this.addAriaMsg(this.grabbedHelperText(s)),document.addEventListener("mousedown",(()=>h(!1)),{once:!0})):this.addAriaMsg(this.droppedHelperText(s))};if([" ","Space","Enter"].includes(t.key)){if(t.preventDefault(),this.keyboardSortActive)h(!1),this.nanoDropped.emit({element:s});else if(h(!0),this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],this.nanoGrabbed.emit({element:s,index:this.sortableNodes.indexOf(s)}).defaultPrevented)return void h(!1);return}if(!this.keyboardSortActive)return;["Escape","Tab"].includes(t.key)&&h(!1);let r=["Home","End"];if(this.orientation&&"horizontal"!==this.orientation||(r=[...r,"ArrowRight","ArrowLeft"]),this.orientation&&"vertical"!==this.orientation||(r=[...r,"ArrowUp","ArrowDown"]),!r.includes(t.key))return;t.preventDefault(),this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],this.dropzoneNodes=Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector))||[];const o=this.sortableNodes.indexOf(this.draggedElement);let n=-1;if(this.dropzoneNodes.length){const t=this.draggedElement.closest(this.dropzoneSelector);n=this.dropzoneNodes.indexOf(t),n=n>-1?n:-1}const a=o-1<0&&n>-1?this.dropzoneNodes[n-1]:this.sortableNodes[o-1],d=o+1===this.sortableNodes.length&&n>-1?this.dropzoneNodes[n+1]:this.sortableNodes[o+1];"Home"===t.key&&this.insertAtTarget(this.draggedElement,this.sortableNodes[0]),"End"===t.key&&this.insertAtTarget(this.draggedElement,this.sortableNodes[this.sortableNodes.length-1]),["ArrowRight","ArrowDown"].includes(t.key)&&this.insertAtTarget(this.draggedElement,d),["ArrowLeft","ArrowUp"].includes(t.key)&&this.insertAtTarget(this.draggedElement,a),this.finishOrder(),this.draggedElement=s;const l=()=>{requestAnimationFrame((()=>{"function"==typeof i.setFocus?i.setFocus():i.focus()}))};this.animationPromise?this.animationPromise.then((()=>l())):l()}handleTrack(t){if(this.dragRequestPending||t.button&&1!==t.button)return;const e=t=>{t.cancelable&&t.preventDefault(),clearTimeout(this.mouseDownTimer)},i=()=>{clearTimeout(this.mouseDownTimer),document.removeEventListener("touchmove",e),document.removeEventListener("contextmenu",this.finishOrder)};i(),this.mouseDownTimer=window?.setTimeout((()=>{this.trackStart(t)&&(document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("contextmenu",this.finishOrder),this.addAriaMsg(this.grabbedHelperText(this.draggedElement)),n(this.sortableHost,{initialEvent:t,relative:!0,onMove:(t,e)=>{this.trackMove(t,e)},onStop:()=>{this.nanoDropped.emit({element:this.draggedElement}),i();const t=()=>{this.addAriaMsg(this.droppedHelperText(this.draggedElement)),requestAnimationFrame((()=>this.finishOrder()))};this.animationPromise?this.animationPromise.then((()=>t())):t()}}))}),150),d(document,"mouseup touchend touchmove",(()=>clearTimeout(this.mouseDownTimer)),{once:!0})}trackStart(t){const e=t.target;let i;if(this.handleSelector){if(i=e.closest(this.handleSelector),!i)return;i.classList.add(this.handleDraggedClass)}const s=e.closest(this.itemSelector);return!!s&&(this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],!this.nanoGrabbed.emit({element:s,index:this.sortableNodes.indexOf(s)}).defaultPrevented&&(t.preventDefault(),this.updateUserSelectStyle("none"),this.dragRequestPending=!0,this.draggedElement=s,this.dropzoneNodes=Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector))||[],this.draggedElementClone=this.createClone(s),this.draggedElementOrigin=s.nextSibling,this.animatedElements=[],this.draggedElement.classList.add(this.placeholderClass),!0))}finishOrder=()=>{if(!this.draggedElement)return;const t=Array.from(this.sortableHost.querySelectorAll(this.itemSelector)).filter((t=>t!==this.draggedElementClone)),e=this.sortableNodes.indexOf(this.draggedElement),i=t.indexOf(this.draggedElement);if(this.handleSelector&&this.draggedElement.querySelector(this.handleSelector).classList.remove(this.handleDraggedClass),e!==i){if(this.nanoOrderChange.emit({element:this.draggedElement,originalIndex:e,targetIndex:i}).defaultPrevented)return void(this.animationPromise=new Promise((i=>{setTimeout((()=>{this.insertAtTarget(this.draggedElement,t[e]),this.reset(),this.dragRequestPending=!1,i()}),200)})));this.addAriaMsg(this.reorderHelperText(this.draggedElement,t,i+1))}this.reset(),this.dragRequestPending=!1};trackMove=(t,s)=>{if(!this.draggedElementClone)return;this.orientation&&(t*=l[this.orientation].x,s*=l[this.orientation].y),e((()=>{Object.assign(this.draggedElementClone.style,{transform:`translate3d(${t}px, ${s}px, 0)`})}));let h,r=this.hitTest(this.draggedElementClone,this.sortableNodes)[0];this.dropzoneSelector&&this.dropzoneActiveClass&&i((()=>{h=this.draggedElement.closest(this.dropzoneSelector),e((()=>{this.dropzoneNodes.filter((t=>t!==h)).forEach((t=>t.classList.remove(this.dropzoneActiveClass))),h.classList.add(this.dropzoneActiveClass)}))})),!r&&this.dropzoneNodes.length&&(r=this.hitTest(this.draggedElementClone,this.dropzoneNodes)[0],this.draggedElement.closest(this.dropzoneSelector)===r)||r&&r!==this.draggedElement&&!this.isAnimating(r)&&this.insertAtTarget(this.draggedElement,r)};constructor(t){s(this,t),this.nanoOrderChange=h(this,"nanoOrderChange",7),this.nanoGrabbed=h(this,"nanoGrabbed",7),this.nanoDropped=h(this,"nanoDropped",7),this.handleTrack=this.handleTrack.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.refreshKeyboardHandles=this.refreshKeyboardHandles.bind(this),this.refreshKeyboardHandles=a(this.refreshKeyboardHandles,500)}connectedCallback(){this.addEventHandlers(),this.refreshKeyboardHandles(),this.attachMutationObserver(),this.host.querySelector(`#${this.sortableId}`)||this.host.insertAdjacentHTML("beforeend",`<div class="visually-hidden" id="${this.sortableId}">${this.helperText}</div>`)}disconnectedCallback(){this.removeEventHandlers(),this.host.querySelector(`#${this.sortableId}`)?.remove(),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=void 0)}render(){return o(r,{key:"290c407551a2742f1aea13b69bf6e76783ac04cf",class:"nano-sortable"},o("div",{key:"85d9c75f73d2c010bf8a8944855ef4b9af8ca24e",class:"sortable__live-region","aria-live":"polite","aria-relevant":"additions","aria-atomic":"true",role:"log",part:"announcements"},this.ariaTextList.map((t=>o("div",null,t)))),o("slot",{key:"9c7984602c800c36731218593811876aac6ed948"}))}static get watchers(){return{itemSelector:["handleItemSelectorChange"],handleSelector:["handleHandleSelectorChange"],createKeyboardHandle:["handleCreateKeyboardHandleChange"],sortableHostElement:["handleSortableHostElement"]}}};m.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{position:relative;display:block}.sortable__live-region{clip-path:inset(50%);block-size:1px;overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}";export{m as nano_sortable}
4
+ import{g as t,d as e,e as i,r as s,c as h,a as r}from"./index-BM3Om9WE.js";import{h as o}from"./renderer-DpNDfhNy.js";import{d as n}from"./drag-BLOEuv-q.js";import{d as a}from"./throttle-C93FMm2Z.js";import{a as d}from"./events-ClRFmcmJ.js";const l={horizontal:{x:1,y:0},vertical:{x:0,y:1}};let c=0;const m=class{itemSelector="li";handleItemSelectorChange(){this.refreshKeyboardHandles()}handleSelector;handleHandleSelectorChange(){this.refreshKeyboardHandles(),this.attachMutationObserver()}dropzoneSelector;helperText='Press "Space" or "Enter" to enable element reordering and use the arrow keys to reorder items.Press "Escape" to cancel reordering. Alternatively, use your mouse to drag / reorder.';itemDescriptor=t=>`"${t?.textContent.trim()}"`;grabbedHelperText=t=>`${this.itemDescriptor(t)} grabbed`;droppedHelperText=t=>`${this.itemDescriptor(t)} dropped`;reorderHelperText=(t,e,i)=>`The list has been reordered, ${this.itemDescriptor(t)} is now item ${i} of ${e.length}`;createKeyboardHandle=(t,e)=>{const i=document.createElement("div");i.innerHTML='\n <nano-icon-button\n slot="end"\n icon-name="light/arrows-up-down-left-right"\n class="nano-sortable__keyboard-handle visually-hidden"\n label="Re-order this item"\n ></nano-icon-button>';const s=i.children[0];return e.append(s),s};handleCreateKeyboardHandleChange(){this.refreshKeyboardHandles()}sortableHostElement;handleSortableHostElement(t,e){e&&this.removeEventHandlers(e),this.addEventHandlers(),this.refreshKeyboardHandles(),this.attachMutationObserver(),this.sortableHostElement&&(this.sortableHostElement.style.position="relative")}animationEnabled=!0;draggedClass="nano-sortable__dragged";handleDraggedClass="nano-sortable__handle-dragged";placeholderClass="nano-sortable__placeholder";dropzoneActiveClass="";animationTiming={duration:200,easing:"ease-out"};orientation;dragResize=!1;nanoOrderChange;nanoGrabbed;nanoDropped;async refreshKeyboardHandles(){if(this.handleSelector)return this.keyboardHandleMap?.size&&this.keyboardHandleMap.clear(),void this.sortableHost.querySelectorAll(this.handleSelector).forEach((t=>{t.getAttribute("aria-describedby")||t.setAttribute("aria-describedby",this.sortableId);const e=t.closest(this.itemSelector);e&&this.keyboardHandleMap.set(t,e)}));this.keyboardHandleMap?.size&&(this.keyboardHandleMap?.forEach(((t,e)=>e.remove())),this.keyboardHandleMap.clear()),this.sortableHost.querySelectorAll(this.itemSelector).forEach(((t,e)=>{const i=this.createKeyboardHandle(e,t);i?(this.keyboardHandleMap.set(i,t),i.setAttribute("aria-describedby",this.sortableId)):console.error("`createKeyboardHandle` *must* return the handle element it creates")}))}get host(){return t(this)}dragRequestPending=!1;draggedElement;draggedElementClone;draggedElementOrigin;sortableNodes=[];dropzoneNodes=[];animatedElements=[];animationPromise;keyboardHandleMap=new Map;sortableId="nano-sortable-"+c++;mouseDownTimer;mutationObserver;keyboardSortActive=!1;ariaTextList=[];get sortableHost(){return this.sortableHostElement?this.sortableHostElement:this.host}addAriaMsg(t){this.ariaTextList=[...this.ariaTextList,t],setTimeout((()=>{const e=this.ariaTextList.indexOf(t);this.ariaTextList.splice(e,1),this.ariaTextList=[...this.ariaTextList]}),1e4)}updateUserSelectStyle(t){this.host.style.userSelect=t}hitTest(t,e){const{left:i,top:s,width:h,height:r}=t.getBoundingClientRect(),o=i+h/2,n=s+r/2;return e.filter((t=>{const{left:e,right:i,top:s,bottom:h}=t.getBoundingClientRect();return!(o<e||o>i||n<s||n>h)}))}isAnimating(t){return-1!==this.animatedElements.indexOf(t)}animateNode(t,i=0,s=0){t.animate&&(this.animatedElements.push(t),t.style.willChange="transform",e((()=>{this.animationPromise=new Promise((e=>{t.animate([{transform:`translate3d(${i}px, ${s}px, 0)`},{transform:"none"}],this.animationTiming).addEventListener("finish",(()=>{const i=this.animatedElements.indexOf(t);t.style.willChange="",-1!==i&&this.animatedElements.splice(i,1),e(),delete this.animationPromise}),{once:!0})}))})))}insertAtTarget(t,e){if(!t||!e)return;let i=[];if(this.animationEnabled&&(i=this.sortableNodes.map((t=>({x:t.offsetLeft,y:t.offsetTop})))),t.isConnected&&e.isConnected){if(this.dropzoneNodes.indexOf(e)>-1)e.append(t);else{const i=t.compareDocumentPosition(e);let s;i&this.host.DOCUMENT_POSITION_FOLLOWING&&(s=e.parentNode===t.parentNode?"afterend":"beforebegin"),i&this.host.DOCUMENT_POSITION_PRECEDING&&(s=e.parentNode===t.parentNode?"beforebegin":"afterend"),s&&e.insertAdjacentElement(s,t)}this.animationEnabled&&this.sortableNodes.forEach(((t,e)=>{const{x:s,y:h}=i[e],r=s-t.offsetLeft,o=h-t.offsetTop;0===r&&0===o||this.animateNode(t,r,o)}))}}reset(){void 0!==this.draggedElementClone&&null!==this.draggedElementClone.parentNode&&this.draggedElementClone.parentNode.removeChild(this.draggedElementClone),this.draggedElement&&this.draggedElement.parentNode&&this.draggedElementOrigin&&this.draggedElement.classList.remove(this.placeholderClass),this.dropzoneActiveClass&&this.dropzoneNodes.length&&this.dropzoneNodes.forEach((t=>t.classList.remove(this.dropzoneActiveClass))),delete this.draggedElementClone,delete this.draggedElement,this.dropzoneNodes=[],this.sortableNodes=[],this.animatedElements=[],this.dragRequestPending=!1,this.updateUserSelectStyle("")}createClone(t){const e=t.cloneNode(!0);t.id&&(e.id="clone__"+e.id),Array.from(e.children).forEach(((e,i)=>{const s=e,h=t.children.item(i);h&&(s.style.width=`${h.offsetWidth}px`)}));const{offsetLeft:i,offsetTop:s,offsetWidth:h,offsetHeight:r}=t;return Object.assign(e.style,{position:"absolute",left:`calc(${i}px - var(--grab-offset-x, 0px))`,top:`calc(${s}px - var(--grab-offset-y, 0px))`,height:this.dragResize?`${r}px`:void 0,width:this.dragResize?`${h}px`:void 0,willChange:"transform,opacity"}),e.classList.add(this.draggedClass),t.parentNode.appendChild(e)}removeEventHandlers(t){(t=t||this.sortableHost).removeEventListener("mousedown",this.handleTrack),t.removeEventListener("touchstart",this.handleTrack),t.removeEventListener("keydown",this.handleKeydown)}addEventHandlers(t){d(t=t||this.sortableHost,"mousedown touchstart",this.handleTrack,{passive:!0}),t.addEventListener("keydown",this.handleKeydown)}attachMutationObserver(){this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=void 0),this.mutationObserver=new MutationObserver((()=>{const t=Array.from(this.keyboardHandleMap.values()),e=Array.from(this.sortableHost.querySelectorAll(this.itemSelector));(t.length!==e.length||e.find((e=>!t.includes(e))))&&this.refreshKeyboardHandles()})),this.mutationObserver.observe(this.sortableHost,{subtree:!0,childList:!0})}handleKeydown(t){const e=t.target;let i,s;if(this.handleSelector?(i=e.closest(this.handleSelector),s=e.closest(this.itemSelector)):(s=this.keyboardHandleMap.get(e),i=e),!i||!s)return;const h=t=>{this.keyboardSortActive=t,this.draggedElement=t?s:void 0,s.classList.toggle(this.draggedClass,t),i.classList.toggle(this.handleDraggedClass,t),t?(this.addAriaMsg(this.grabbedHelperText(s)),document.addEventListener("mousedown",(()=>h(!1)),{once:!0})):this.addAriaMsg(this.droppedHelperText(s))};if([" ","Space","Enter"].includes(t.key)){if(t.preventDefault(),this.keyboardSortActive)h(!1),this.nanoDropped.emit({element:s});else if(h(!0),this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],this.nanoGrabbed.emit({element:s,index:this.sortableNodes.indexOf(s)}).defaultPrevented)return void h(!1);return}if(!this.keyboardSortActive)return;["Escape","Tab"].includes(t.key)&&h(!1);let r=["Home","End"];if(this.orientation&&"horizontal"!==this.orientation||(r=[...r,"ArrowRight","ArrowLeft"]),this.orientation&&"vertical"!==this.orientation||(r=[...r,"ArrowUp","ArrowDown"]),!r.includes(t.key))return;t.preventDefault(),this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],this.dropzoneNodes=Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector))||[];const o=this.sortableNodes.indexOf(this.draggedElement);let n=-1;if(this.dropzoneNodes.length){const t=this.draggedElement.closest(this.dropzoneSelector);n=this.dropzoneNodes.indexOf(t),n=n>-1?n:-1}const a=o-1<0&&n>-1?this.dropzoneNodes[n-1]:this.sortableNodes[o-1],d=o+1===this.sortableNodes.length&&n>-1?this.dropzoneNodes[n+1]:this.sortableNodes[o+1];"Home"===t.key&&this.insertAtTarget(this.draggedElement,this.sortableNodes[0]),"End"===t.key&&this.insertAtTarget(this.draggedElement,this.sortableNodes[this.sortableNodes.length-1]),["ArrowRight","ArrowDown"].includes(t.key)&&this.insertAtTarget(this.draggedElement,d),["ArrowLeft","ArrowUp"].includes(t.key)&&this.insertAtTarget(this.draggedElement,a),this.finishOrder(),this.draggedElement=s;const l=()=>{requestAnimationFrame((()=>{"function"==typeof i.setFocus?i.setFocus():i.focus()}))};this.animationPromise?this.animationPromise.then((()=>l())):l()}handleTrack(t){if(this.dragRequestPending||t.button&&1!==t.button)return;const e=t=>{t.cancelable&&t.preventDefault(),clearTimeout(this.mouseDownTimer)},i=()=>{clearTimeout(this.mouseDownTimer),document.removeEventListener("touchmove",e),document.removeEventListener("contextmenu",this.finishOrder)};i(),this.mouseDownTimer=window?.setTimeout((()=>{this.trackStart(t)&&(document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("contextmenu",this.finishOrder),this.addAriaMsg(this.grabbedHelperText(this.draggedElement)),n(this.sortableHost,{initialEvent:t,relative:!0,onMove:(t,e)=>{this.trackMove(t,e)},onStop:()=>{this.nanoDropped.emit({element:this.draggedElement}),i();const t=()=>{this.addAriaMsg(this.droppedHelperText(this.draggedElement)),requestAnimationFrame((()=>this.finishOrder()))};this.animationPromise?this.animationPromise.then((()=>t())):t()}}))}),150),d(document,"mouseup touchend touchmove",(()=>clearTimeout(this.mouseDownTimer)),{once:!0})}trackStart(t){const e=t.target;let i;if(this.handleSelector){if(i=e.closest(this.handleSelector),!i)return;i.classList.add(this.handleDraggedClass)}const s=e.closest(this.itemSelector);return!!s&&(this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],!this.nanoGrabbed.emit({element:s,index:this.sortableNodes.indexOf(s)}).defaultPrevented&&(t.preventDefault(),this.updateUserSelectStyle("none"),this.dragRequestPending=!0,this.draggedElement=s,this.dropzoneNodes=Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector))||[],this.draggedElementClone=this.createClone(s),this.draggedElementOrigin=s.nextSibling,this.animatedElements=[],this.draggedElement.classList.add(this.placeholderClass),!0))}finishOrder=()=>{if(!this.draggedElement)return;const t=Array.from(this.sortableHost.querySelectorAll(this.itemSelector)).filter((t=>t!==this.draggedElementClone)),e=this.sortableNodes.indexOf(this.draggedElement),i=t.indexOf(this.draggedElement);if(this.handleSelector&&this.draggedElement.querySelector(this.handleSelector).classList.remove(this.handleDraggedClass),e!==i){if(this.nanoOrderChange.emit({element:this.draggedElement,originalIndex:e,targetIndex:i}).defaultPrevented)return void(this.animationPromise=new Promise((i=>{setTimeout((()=>{this.insertAtTarget(this.draggedElement,t[e]),this.reset(),this.dragRequestPending=!1,i()}),200)})));this.addAriaMsg(this.reorderHelperText(this.draggedElement,t,i+1))}this.reset(),this.dragRequestPending=!1};trackMove=(t,s)=>{if(!this.draggedElementClone)return;this.orientation&&(t*=l[this.orientation].x,s*=l[this.orientation].y),e((()=>{Object.assign(this.draggedElementClone.style,{transform:`translate3d(${t}px, ${s}px, 0)`})}));let h,r=this.hitTest(this.draggedElementClone,this.sortableNodes)[0];this.dropzoneSelector&&this.dropzoneActiveClass&&i((()=>{h=this.draggedElement.closest(this.dropzoneSelector),e((()=>{this.dropzoneNodes.filter((t=>t!==h)).forEach((t=>t.classList.remove(this.dropzoneActiveClass))),h.classList.add(this.dropzoneActiveClass)}))})),!r&&this.dropzoneNodes.length&&(r=this.hitTest(this.draggedElementClone,this.dropzoneNodes)[0],this.draggedElement.closest(this.dropzoneSelector)===r)||r&&r!==this.draggedElement&&!this.isAnimating(r)&&this.insertAtTarget(this.draggedElement,r)};constructor(t){s(this,t),this.nanoOrderChange=h(this,"nanoOrderChange",7),this.nanoGrabbed=h(this,"nanoGrabbed",7),this.nanoDropped=h(this,"nanoDropped",7),this.handleTrack=this.handleTrack.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.refreshKeyboardHandles=this.refreshKeyboardHandles.bind(this),this.refreshKeyboardHandles=a(this.refreshKeyboardHandles,500)}connectedCallback(){this.addEventHandlers(),this.refreshKeyboardHandles(),this.attachMutationObserver(),this.host.querySelector(`#${this.sortableId}`)||this.host.insertAdjacentHTML("beforeend",`<div class="visually-hidden" id="${this.sortableId}">${this.helperText}</div>`)}disconnectedCallback(){this.removeEventHandlers(),this.host.querySelector(`#${this.sortableId}`)?.remove(),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=void 0)}render(){return o(r,{key:"8417261830f3b91247c7b7a6c6b75b348dc19bfb",class:"nano-sortable"},o("div",{key:"ce86bd07503d4afd4f3927c53df7e271a538755e",class:"sortable__live-region","aria-live":"polite","aria-relevant":"additions","aria-atomic":"true",role:"log",part:"announcements"},this.ariaTextList.map((t=>o("div",null,t)))),o("slot",{key:"94e4576b27bb98af4375b855a5d440dcb9d06667"}))}static get watchers(){return{itemSelector:["handleItemSelectorChange"],handleSelector:["handleHandleSelectorChange"],createKeyboardHandle:["handleCreateKeyboardHandleChange"],sortableHostElement:["handleSortableHostElement"]}}};m.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{position:relative;display:block}.sortable__live-region{clip-path:inset(50%);block-size:1px;overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}";export{m as nano_sortable}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Custom elements for Nanopore-Digital Web applications
3
3
  */
4
- import{r as e,c as n,g as t,j as o,F as a}from"./index-BM3Om9WE.js";import{h as r}from"./renderer-DpNDfhNy.js";const i=class{constructor(t){e(this,t),this.nanoStepActive=n(this,"nanoStepActive",7)}get host(){return t(this)}nanoDetails;gridWorking=!0;activeStep=0;handleActiveStepChange(e,n){this.steps[e]?.enabled?this.nanoStepActive.emit({index:e,step:this.steps[e]}).defaultPrevented&&(this.activeStep=n):this.activeStep=n}_steps=[];stepProxyHandler={set:(e,n,t)=>(e[n]=t,o(this.host),!0)};get steps(){return this._steps}set steps(e){this._steps=[],e.forEach((e=>{const n=new Proxy(e,this.stepProxyHandler);this._steps.push(n)}))}nanoStepActive;handleToggle(e){e.detail.index!==this.activeStep&&(this.activeStep=e.detail.index)}isDetailsGridWorking(e){const n=document.createElement("div");n.style.gridColumn="2",n.style.height="1px",n.style.width="1px",n.style.visibility="hidden",e.appendChild(n);const t=e.getBoundingClientRect().x,o=n.getBoundingClientRect().x;return e.removeChild(n),Math.abs(o-t)>1}componentDidLoad(){if(!this.nanoDetails)return;const e=this.nanoDetails.shadowRoot.querySelector("details");e&&(this.gridWorking=this.isDetailsGridWorking(e))}render(){return r("nano-accordion",{key:"3676ae38e897988059d679e2f3b3291641a4a2b0",alwaysOpen:!0,onNanoToggle:e=>this.handleToggle(e)},this.steps.map(((e,n)=>r("nano-details",{open:n===this.activeStep,disabled:!e.enabled,class:{step:!0,"step--active":n===this.activeStep,"step--complete":e.complete,"step--grid-working":this.gridWorking,"step--grid-not-working":!this.gridWorking,"step--disabled":!e.enabled},ref:e=>this.nanoDetails=e},r("span",{class:"step-icon",slot:"icon-start"},n+1),r("div",{class:"step-header",slot:"label"},r("span",{class:"step-title "+(e.complete?"complete":"")},e.title),e.complete&&r(a,null,r("span",null," - "),r("span",{class:"step-change"},"Change"))),r("span",{slot:"icon-end"}),r("div",{class:"step-content"},r("slot",{name:`step-${n}`}))))))}static get watchers(){return{activeStep:["handleActiveStepChange"]}}};i.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:block}.nano-details{--padding:0;--btn-bg-color--hover:transparent;--btn-bg-color--active:transparent;border:none;margin-block-end:var(--nano-spacing-sm)}.nano-details::part(base){display:grid;grid-template-rows:auto auto;grid-template-columns:auto 1fr;gap:var(--nano-spacing-sm) 1.625rem}.nano-details.step--grid-working::part(base)::before{content:"";display:block;grid-column:1;grid-row:2;inline-size:1rem;min-block-size:1rem;border-inline-end:2px solid var(--nano-color-neutral-300)}.nano-details.step--grid-working::part(base)::after{content:"";grid-column:1;grid-row:2;inline-size:0.4rem;block-size:0.4rem;place-self:end end;translate:-50% 0;inset-inline-start:calc(50% - 2.5px);position:relative;border-inline-end:2px solid var(--nano-color-neutral-300);border-block-end:2px solid var(--nano-color-neutral-300);rotate:45deg}.nano-details:last-of-type::part(base)::before{min-block-size:0}.nano-details:last-of-type::part(base)::after{display:none}.nano-details::part(header){grid-column:1/-1;grid-row:1;display:inline-flex;gap:var(--nano-spacing-sm)}.nano-details::part(body){grid-column:2;grid-row:2}.nano-details::part(content-wrapper){padding:1px}.nano-details.step--grid-not-working::part(header){padding-block-end:var(--nano-spacing-sm)}.nano-details.step--grid-not-working::part(body){padding:0 0 0 2.5625rem}.step .step-header{display:inline-flex;gap:var(--nano-spacing-sm);align-items:center}.step .step-icon{display:inline-flex;align-items:center;justify-content:center;inline-size:2rem;block-size:2rem;border-radius:var(--nano-border-radius-circle);background-color:transparent;color:var(--nano-color-neutral-1400);border:1px solid var(--nano-color-neutral-300)}.step.step--complete .step-icon{background-color:var(--nano-color-success-1000);color:var(--nano-color-base-0);border:none}.step[open] .step-icon{background-color:var(--nano-color-primary-1000);color:var(--nano-color-base-0);border:none}.step .step-change{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);text-decoration:underline;color:var(--nano-color-primary-1200)}';export{i as nano_step_accordion}
4
+ import{r as e,c as n,g as t,j as o,F as a}from"./index-BM3Om9WE.js";import{h as r}from"./renderer-DpNDfhNy.js";const i=class{constructor(t){e(this,t),this.nanoStepActive=n(this,"nanoStepActive",7)}get host(){return t(this)}nanoDetails;gridWorking=!0;activeStep=0;handleActiveStepChange(e,n){this.steps[e]?.enabled?this.nanoStepActive.emit({index:e,step:this.steps[e]}).defaultPrevented&&(this.activeStep=n):this.activeStep=n}_steps=[];stepProxyHandler={set:(e,n,t)=>(e[n]=t,o(this.host),!0)};get steps(){return this._steps}set steps(e){this._steps=[],e.forEach((e=>{const n=new Proxy(e,this.stepProxyHandler);this._steps.push(n)}))}nanoStepActive;handleToggle(e){e.detail.index!==this.activeStep&&(this.activeStep=e.detail.index)}isDetailsGridWorking(e){const n=document.createElement("div");n.style.gridColumn="2",n.style.height="1px",n.style.width="1px",n.style.visibility="hidden",e.appendChild(n);const t=e.getBoundingClientRect().x,o=n.getBoundingClientRect().x;return e.removeChild(n),Math.abs(o-t)>1}componentDidLoad(){if(!this.nanoDetails)return;const e=this.nanoDetails.shadowRoot.querySelector("details");e&&(this.gridWorking=this.isDetailsGridWorking(e))}render(){return r("nano-accordion",{key:"1832da76f2bff202722bb28c049d75d11149b321",alwaysOpen:!0,onNanoToggle:e=>this.handleToggle(e)},this.steps.map(((e,n)=>r("nano-details",{open:n===this.activeStep,disabled:!e.enabled,class:{step:!0,"step--active":n===this.activeStep,"step--complete":e.complete,"step--grid-working":this.gridWorking,"step--grid-not-working":!this.gridWorking,"step--disabled":!e.enabled},ref:e=>this.nanoDetails=e},r("span",{class:"step-icon",slot:"icon-start"},n+1),r("div",{class:"step-header",slot:"label"},r("span",{class:"step-title "+(e.complete?"complete":"")},e.title),e.complete&&r(a,null,r("span",null," - "),r("span",{class:"step-change"},"Change"))),r("span",{slot:"icon-end"}),r("div",{class:"step-content"},r("slot",{name:`step-${n}`}))))))}static get watchers(){return{activeStep:["handleActiveStepChange"]}}};i.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:block}.nano-details{--padding:0;--btn-bg-color--hover:transparent;--btn-bg-color--active:transparent;border:none;margin-block-end:var(--nano-spacing-sm)}.nano-details::part(base){display:grid;grid-template-rows:auto auto;grid-template-columns:auto 1fr;gap:var(--nano-spacing-sm) 1.625rem}.nano-details.step--grid-working::part(base)::before{content:"";display:block;grid-column:1;grid-row:2;inline-size:1rem;min-block-size:1rem;border-inline-end:2px solid var(--nano-color-neutral-300)}.nano-details.step--grid-working::part(base)::after{content:"";grid-column:1;grid-row:2;inline-size:0.4rem;block-size:0.4rem;place-self:end end;translate:-50% 0;inset-inline-start:calc(50% - 2.5px);position:relative;border-inline-end:2px solid var(--nano-color-neutral-300);border-block-end:2px solid var(--nano-color-neutral-300);rotate:45deg}.nano-details:last-of-type::part(base)::before{min-block-size:0}.nano-details:last-of-type::part(base)::after{display:none}.nano-details::part(header){grid-column:1/-1;grid-row:1;display:inline-flex;gap:var(--nano-spacing-sm)}.nano-details::part(body){grid-column:2;grid-row:2}.nano-details::part(content-wrapper){padding:1px}.nano-details.step--grid-not-working::part(header){padding-block-end:var(--nano-spacing-sm)}.nano-details.step--grid-not-working::part(body){padding:0 0 0 2.5625rem}.step .step-header{display:inline-flex;gap:var(--nano-spacing-sm);align-items:center}.step .step-icon{display:inline-flex;align-items:center;justify-content:center;inline-size:2rem;block-size:2rem;border-radius:var(--nano-border-radius-circle);background-color:transparent;color:var(--nano-color-neutral-1400);border:1px solid var(--nano-color-neutral-300)}.step.step--complete .step-icon{background-color:var(--nano-color-success-1000);color:var(--nano-color-base-0);border:none}.step[open] .step-icon{background-color:var(--nano-color-primary-1000);color:var(--nano-color-base-0);border:none}.step .step-change{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);text-decoration:underline;color:var(--nano-color-primary-1200)}';export{i as nano_step_accordion}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Custom elements for Nanopore-Digital Web applications
3
3
  */
4
- import{r as e,c as t,g as i,j as n,a as s}from"./index-BM3Om9WE.js";import{h as a}from"./renderer-DpNDfhNy.js";import{C as o}from"./constructible-style-B2_GfhhS.js";import{a as r}from"./style-Ds52s5za.js";const l=class{constructor(i){e(this,i),this.nanoStepActive=t(this,"nanoStepActive",7)}get host(){return i(this)}calculatedWidth;cacheKey;activeStep=0;handleActiveStepChange(e,t){this.steps[e]?.enabled?this.nanoStepActive.emit({index:e,step:this.steps[e]}).defaultPrevented&&(this.activeStep=t):this.activeStep=t}nanoStepActive;_steps=[];stepProxyHandler={set:(e,t,i)=>(e[t]=i,n(this.host),!0)};get steps(){return this._steps}set steps(e){this._steps=[],e.forEach((e=>{const t=new Proxy(e,this.stepProxyHandler);this._steps.push(t)}))}handleStepsChange(){const e=this._steps.length,t=this._steps.reduce(((e,t)=>e+t.title.length),0);this.cacheKey="step-breadcrumb-"+e+t,this.calculatedWidth=`calc(${t}ch + ${1.5*e}rem + ${1.875*(e-1)}rem + ${10*e}px)`}styles=()=>`@container (width > ${this.calculatedWidth}) {\n .step-list.mobile.${this.cacheKey} { display: none; }\n .step-list.desktop.${this.cacheKey} { display: flex; }\n }\n @container (width <= ${this.calculatedWidth}) {\n .step-list.mobile.${this.cacheKey} { display: block; }\n .step-list.desktop.${this.cacheKey} { display: none; }\n }`;componentWillLoad(){this.handleStepsChange(),r(this.host.shadowRoot)}ControlTag=({step:e,index:t})=>a(e.enabled?e.href?"A":"BUTTON":"SPAN",{href:e.href||void 0,class:{"step-item":!0,"step-item--active":t===this.activeStep,"step-item--complete":e.complete,"step-item--disabled":!e.enabled},onClick:()=>{e.enabled&&(this.activeStep=t)}},a("span",{class:"step-item-icon",slot:"icon-start"},t+1),a("span",{class:"step-item-title"},e.title));render(){const e=this.steps.filter((e=>e.href)).length>0?"nav":"div";return a(s,{key:"c1b1866d4889830fa70d570df0bea118561df7bf"},a(e,{key:"630fc450433bd177410e4e69730781cec88b0ea5",class:"step-wrapper"},a("ul",{key:"d8b35166bbb9b01df388387997f4b2a4dc612f55",class:`step-list desktop ${this.cacheKey}`},this.steps.map(((e,t)=>a("li",{class:"step-item-wrapper",key:t},a(this.ControlTag,{step:e,index:t}))))),a("div",{key:"aa8e3119c641c02f4ac960d4e415c7c327249c8e",class:`step-list mobile ${this.cacheKey}`},a("nano-dropdown",{key:"61172362d21ec93527e431ab96d9f66075aa52dc",dialogTitle:"Steps",class:"step-dropdown"},a("button",{key:"8edb7e0ddac43cff9b001ba504f003d6df64895f",slot:"trigger",class:"step-trigger"},a("div",{key:"a7ba7d9b0c6724ce19bd556cbfef2fdd9dc36f2b",class:"step-progress-circle",role:"progressbar","aria-valuenow":"2","aria-valuemin":"0","aria-valuemax":"5",style:{"--value":""+(this.activeStep+1),"--max":""+this.steps.length}},a("span",{key:"d84750e092190edd64cd3cecc7a36e2b8b400fbe",class:"step-progress-text"},a("strong",{key:"6b2f3cd970a2e64299c0d9f85ee59cd93a041858"},this.activeStep+1)," of"," ",this.steps.length)),a("div",{key:"53ebc1b869804b2bae5dc6e9a8cdb2e78027c0c2",class:"step-trigger-text"},a("div",{key:"b419abee3f2fa764f19f9f3910347dac89f7b278",class:"step-trigger-now"},this.steps[0|this.activeStep]?.title||"Select a step"),a("div",{key:"6c307ffcd845df90950811e0e88e624ebec495a4",class:"step-trigger-next"},this.steps[this.activeStep+1]?.title||"Next step")),a("nano-icon",{key:"1c012c4bf4e264a328dad23317f73451148176fc",class:"step-trigger-icon",name:"light/chevron-down"})),a("nano-menu",{key:"ef2bac97f59de0f9b63837cb5c0d67958b32d3ce"},this.steps.map(((e,t)=>a("nano-nav-item",{class:{"step-item-mobile":!0,"step-item-mobile step-item--active":t===this.activeStep,"step-item-mobile step-item--complete":e.complete},disabled:!e.enabled,key:t,onClick:()=>{e.enabled&&(this.activeStep=t)},href:e.href||void 0},a("span",{class:"step-item-icon",slot:"icon-start"},t+1),a("span",{class:"step-item-title"},e.title)))))))))}static get watchers(){return{activeStep:["handleActiveStepChange"],steps:["handleStepsChange"]}}};(function(e,t,i,n){var s,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(o=(a<3?s(o):a>3?s(t,i,o):s(t,i))||o);a>3&&o&&Object.defineProperty(t,i,o)})([o({cacheKeyProperty:"calculatedWidth"}),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:type",Object)],l.prototype,"styles",void 0),l.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:block;--background:var(--nano-color-base-0)}.step-wrapper{container-type:inline-size}.step-list.desktop{display:flex;flex-direction:row;align-items:center;justify-content:space-between;list-style:none;padding:0;margin:0;position:relative;z-index:1}.step-list.desktop::before{content:"";display:block;flex-grow:1;block-size:1px;background-color:var(--nano-color-neutral-300);position:absolute;inset-block-start:50%;z-index:-1;inset-inline-start:0;inline-size:100%}.step-item-wrapper{flex:0 1 auto;display:inline-flex;align-items:center;cursor:pointer}.step-item-wrapper:last-of-type{flex:0 1 auto}.step-item-wrapper:last-of-type .step-item{padding-inline-end:0}.step-item-wrapper:first-of-type::before{display:none}.step-item-wrapper:first-of-type .step-item{padding-inline-start:0}.step-item-wrapper::before{content:"";grid-column:2;grid-row:1;inline-size:0.4rem;block-size:0.4rem;place-self:center end;inset-block-start:0.5px;position:relative;border-inline-end:1px solid var(--nano-color-neutral-300);border-block-end:1px solid var(--nano-color-neutral-300);rotate:-45deg}:dir(rtl) .step-item-wrapper::after{rotate:45deg}.step-item{all:unset;display:inline-flex;align-items:center;gap:var(--nano-spacing-sm);background-color:var(--background);padding:0 var(--nano-spacing-sm);position:relative}.step-item:focus-visible{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset);z-index:1}.step-item.step-item--disabled{cursor:not-allowed}.step-item.step-item--disabled>*{opacity:0.5}.step-item-icon{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);display:inline-flex;align-items:center;justify-content:center;inline-size:1.5rem;block-size:1.5rem;border-radius:var(--nano-border-radius-circle);background-color:transparent;color:var(--nano-color-neutral-1400);border:1px solid var(--nano-color-neutral-300)}.step-item--complete .step-item-icon{background-color:var(--nano-color-success-1000);color:var(--nano-color-base-0);border:none}.step-item--active .step-item-icon{background-color:var(--nano-color-primary-1000);color:var(--nano-color-base-0);border:none}.step-dropdown{inline-size:100%;min-inline-size:300px}.step-trigger{all:unset;display:inline-flex;gap:var(--nano-spacing-md);align-items:center;inline-size:100%;cursor:pointer}.step-trigger-text{display:flex;flex-direction:column}.step-trigger-now{font-weight:var(--nano-font-weight-normal);font-size:var(--nano-font-size-xl);line-height:var(--nano-line-height-denser);text-wrap:balance;color:var(--nano-color-neutral-1400)}.step-trigger-next{font-size:var(--nano-font-size-2xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);color:var(--nano-color-neutral-1000)}.step-trigger-icon{margin-inline-start:auto;color:var(--nano-color-primary-1000);transition:var(--nano-transition-x-fast) rotate}[open] .step-trigger-icon{rotate:180deg}.step-progress-circle{--size:64px;--thickness:4px;inline-size:var(--size);min-inline-size:var(--size);aspect-ratio:1/1;border-radius:50%;display:grid;place-items:center;position:relative}.step-progress-circle::before{content:"";position:absolute;inset:0;border-radius:50%;background:conic-gradient(var(--nano-color-success-1000) calc(var(--value) / var(--max) * 360deg), var(--nano-color-neutral-100) 0);-webkit-mask:radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%);mask:radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%)}.step-progress-title{font-size:var(--nano-font-size-sm);line-height:var(--nano-line-height-normal);font-weight:var(--nano-font-weight-bold);white-space:nowrap;color:var(--nano-color-neutral-1000)}.step-progress-title strong{color:var(--nano-color-neutral-1400)}';export{l as nano_step_breadcrumb}
4
+ import{r as e,c as t,g as i,j as n,a as s}from"./index-BM3Om9WE.js";import{h as a}from"./renderer-DpNDfhNy.js";import{C as o}from"./constructible-style-B2_GfhhS.js";import{a as r}from"./style-Ds52s5za.js";const l=class{constructor(i){e(this,i),this.nanoStepActive=t(this,"nanoStepActive",7)}get host(){return i(this)}calculatedWidth;cacheKey;activeStep=0;handleActiveStepChange(e,t){this.steps[e]?.enabled?this.nanoStepActive.emit({index:e,step:this.steps[e]}).defaultPrevented&&(this.activeStep=t):this.activeStep=t}nanoStepActive;_steps=[];stepProxyHandler={set:(e,t,i)=>(e[t]=i,n(this.host),!0)};get steps(){return this._steps}set steps(e){this._steps=[],e.forEach((e=>{const t=new Proxy(e,this.stepProxyHandler);this._steps.push(t)}))}handleStepsChange(){const e=this._steps.length,t=this._steps.reduce(((e,t)=>e+t.title.length),0);this.cacheKey="step-breadcrumb-"+e+t,this.calculatedWidth=`calc(${t}ch + ${1.5*e}rem + ${1.875*(e-1)}rem + ${10*e}px)`}styles=()=>`@container (width > ${this.calculatedWidth}) {\n .step-list.mobile.${this.cacheKey} { display: none; }\n .step-list.desktop.${this.cacheKey} { display: flex; }\n }\n @container (width <= ${this.calculatedWidth}) {\n .step-list.mobile.${this.cacheKey} { display: block; }\n .step-list.desktop.${this.cacheKey} { display: none; }\n }`;componentWillLoad(){this.handleStepsChange(),r(this.host.shadowRoot)}ControlTag=({step:e,index:t})=>a(e.enabled?e.href?"A":"BUTTON":"SPAN",{href:e.href||void 0,class:{"step-item":!0,"step-item--active":t===this.activeStep,"step-item--complete":e.complete,"step-item--disabled":!e.enabled},onClick:()=>{e.enabled&&(this.activeStep=t)}},a("span",{class:"step-item-icon",slot:"icon-start"},t+1),a("span",{class:"step-item-title"},e.title));render(){const e=this.steps.filter((e=>e.href)).length>0?"nav":"div";return a(s,{key:"cbda942c6f8110d4d82131a1c9e4b14edf24b0c3"},a(e,{key:"b7fb3d26dd43a9407a75051be48e20b7633a8838",class:"step-wrapper"},a("ul",{key:"fbc4be8dea505488507b6ad77b412888e92e1b0a",class:`step-list desktop ${this.cacheKey}`},this.steps.map(((e,t)=>a("li",{class:"step-item-wrapper",key:t},a(this.ControlTag,{step:e,index:t}))))),a("div",{key:"3303c111f3f5b55afdae780c389dd62f66ab41e5",class:`step-list mobile ${this.cacheKey}`},a("nano-dropdown",{key:"5e53b5c612f04201304b3ad740a87c3b702becae",dialogTitle:"Steps",class:"step-dropdown"},a("button",{key:"04adf74e007e5de4504a297e65f32a284d3ab086",slot:"trigger",class:"step-trigger"},a("div",{key:"0820a4a1bdcb5c7123e266885c7632f2c0b1efa2",class:"step-progress-circle",role:"progressbar","aria-valuenow":"2","aria-valuemin":"0","aria-valuemax":"5",style:{"--value":""+(this.activeStep+1),"--max":""+this.steps.length}},a("span",{key:"9548a830bc2c09209276fc8ff3c2c19a9ca9f867",class:"step-progress-text"},a("strong",{key:"5b4df74d1ae187cbc221e2b0e3ce2822ffc15dda"},this.activeStep+1)," of"," ",this.steps.length)),a("div",{key:"5f2188ff4aa1a405517f1916852f90ebd52851de",class:"step-trigger-text"},a("div",{key:"0c78fd73afea02abc1b97b86c12568cd9cd722d3",class:"step-trigger-now"},this.steps[0|this.activeStep]?.title||"Select a step"),a("div",{key:"39ba2b211cb3500be635661372a12660c6f1dc07",class:"step-trigger-next"},this.steps[this.activeStep+1]?.title||"Next step")),a("nano-icon",{key:"ed4a5818efd6e7ff4be154b4e7ec230bdf4a6003",class:"step-trigger-icon",name:"light/chevron-down"})),a("nano-menu",{key:"64b46fdbc7d6317e4ea0899c51017a3238f154d2"},this.steps.map(((e,t)=>a("nano-nav-item",{class:{"step-item-mobile":!0,"step-item-mobile step-item--active":t===this.activeStep,"step-item-mobile step-item--complete":e.complete},disabled:!e.enabled,key:t,onClick:()=>{e.enabled&&(this.activeStep=t)},href:e.href||void 0},a("span",{class:"step-item-icon",slot:"icon-start"},t+1),a("span",{class:"step-item-title"},e.title)))))))))}static get watchers(){return{activeStep:["handleActiveStepChange"],steps:["handleStepsChange"]}}};(function(e,t,i,n){var s,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(o=(a<3?s(o):a>3?s(t,i,o):s(t,i))||o);a>3&&o&&Object.defineProperty(t,i,o)})([o({cacheKeyProperty:"calculatedWidth"}),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:type",Object)],l.prototype,"styles",void 0),l.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:block;--background:var(--nano-color-base-0)}.step-wrapper{container-type:inline-size}.step-list.desktop{display:flex;flex-direction:row;align-items:center;justify-content:space-between;list-style:none;padding:0;margin:0;position:relative;z-index:1}.step-list.desktop::before{content:"";display:block;flex-grow:1;block-size:1px;background-color:var(--nano-color-neutral-300);position:absolute;inset-block-start:50%;z-index:-1;inset-inline-start:0;inline-size:100%}.step-item-wrapper{flex:0 1 auto;display:inline-flex;align-items:center;cursor:pointer}.step-item-wrapper:last-of-type{flex:0 1 auto}.step-item-wrapper:last-of-type .step-item{padding-inline-end:0}.step-item-wrapper:first-of-type::before{display:none}.step-item-wrapper:first-of-type .step-item{padding-inline-start:0}.step-item-wrapper::before{content:"";grid-column:2;grid-row:1;inline-size:0.4rem;block-size:0.4rem;place-self:center end;inset-block-start:0.5px;position:relative;border-inline-end:1px solid var(--nano-color-neutral-300);border-block-end:1px solid var(--nano-color-neutral-300);rotate:-45deg}:dir(rtl) .step-item-wrapper::after{rotate:45deg}.step-item{all:unset;display:inline-flex;align-items:center;gap:var(--nano-spacing-sm);background-color:var(--background);padding:0 var(--nano-spacing-sm);position:relative}.step-item:focus-visible{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset);z-index:1}.step-item.step-item--disabled{cursor:not-allowed}.step-item.step-item--disabled>*{opacity:0.5}.step-item-icon{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);display:inline-flex;align-items:center;justify-content:center;inline-size:1.5rem;block-size:1.5rem;border-radius:var(--nano-border-radius-circle);background-color:transparent;color:var(--nano-color-neutral-1400);border:1px solid var(--nano-color-neutral-300)}.step-item--complete .step-item-icon{background-color:var(--nano-color-success-1000);color:var(--nano-color-base-0);border:none}.step-item--active .step-item-icon{background-color:var(--nano-color-primary-1000);color:var(--nano-color-base-0);border:none}.step-dropdown{inline-size:100%;min-inline-size:300px}.step-trigger{all:unset;display:inline-flex;gap:var(--nano-spacing-md);align-items:center;inline-size:100%;cursor:pointer}.step-trigger-text{display:flex;flex-direction:column}.step-trigger-now{font-weight:var(--nano-font-weight-normal);font-size:var(--nano-font-size-xl);line-height:var(--nano-line-height-denser);text-wrap:balance;color:var(--nano-color-neutral-1400)}.step-trigger-next{font-size:var(--nano-font-size-2xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);color:var(--nano-color-neutral-1000)}.step-trigger-icon{margin-inline-start:auto;color:var(--nano-color-primary-1000);transition:var(--nano-transition-x-fast) rotate}[open] .step-trigger-icon{rotate:180deg}.step-progress-circle{--size:64px;--thickness:4px;inline-size:var(--size);min-inline-size:var(--size);aspect-ratio:1/1;border-radius:50%;display:grid;place-items:center;position:relative}.step-progress-circle::before{content:"";position:absolute;inset:0;border-radius:50%;background:conic-gradient(var(--nano-color-success-1000) calc(var(--value) / var(--max) * 360deg), var(--nano-color-neutral-100) 0);-webkit-mask:radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%);mask:radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%)}.step-progress-title{font-size:var(--nano-font-size-sm);line-height:var(--nano-line-height-normal);font-weight:var(--nano-font-weight-bold);white-space:nowrap;color:var(--nano-color-neutral-1000)}.step-progress-title strong{color:var(--nano-color-neutral-1400)}';export{l as nano_step_breadcrumb}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Custom elements for Nanopore-Digital Web applications
3
3
  */
4
- import{r as t,c as i,g as s,a as e}from"./index-BM3Om9WE.js";import{a as h}from"./dom-dlicJTEJ.js";import{d as n}from"./throttle-C93FMm2Z.js";import{f as o}from"./scroll-1nFw8CNk.js";import{t as r,h as a}from"./renderer-DpNDfhNy.js";function c(t,i){const s=i instanceof Document?document.documentElement:i;return h(t,s)}const d=class{constructor(s){t(this,s),this.nanoStuck=i(this,"nanoStuck",7),this.nanoUnstuck=i(this,"nanoUnstuck",7),this.nanoHide=i(this,"nanoHide",7),this.nanoShow=i(this,"nanoShow",7)}isRtl=!1;io;contentSizeObserver;parentSizeObserver;sticker;content;scrollPosCache=0;scrollPosThresholdCache=0;cacheOffset=0;slottedContent;pauseResizeWatcher=!1;listenForScrollParent=!1;stickToEleInitSize;positions=[];pauseHide=!1;hasBootstrapped=!1;get host(){return s(this)}isStuck=!1;isRootSticker=!0;hide=!1;scrollHide=!1;multiStickerHide=!1;scrollingTo=!1;quietModeIsOn=!1;stuckCounter=0;stickerIndex=0;stickToEle;triggerPos;trigger;_offset=0;autoResize=!0;isSticky=!0;offset=0;position="top";quietMode={h:600,w:600};hideOnNewStickers=!0;breakPointMax=null;breakPointMin=null;scrollParent;stickTo;nanoStuck;nanoUnstuck;nanoHide;nanoShow;async isHiding(){return this.hide}async isSticking(){return this.shouldStick(),this.isStuck}async setTriggerPos(t){return this._offset=t}async getTriggerPos(){return this.triggerPos}async pauseHiding(t){this.pauseHide=t}updateTriggerOffset(){this.trigger&&this.scrollParent&&this.listenForScrollParent&&(this.triggerPos=c(this.trigger,this.scrollParent))}stickerResizeListener(){this.content&&window.ResizeObserver&&(this.contentSizeObserver&&(this.contentSizeObserver.disconnect(),this.contentSizeObserver=void 0),this.contentSizeObserver=new ResizeObserver((t=>{for(const i of t){if(this.pauseResizeWatcher)return;i.contentRect.height&&("top"===this.position&&(this.host.style.height=i.contentRect.height+"px"),"bottom"===this.position&&(this.host.style.minHeight=i.contentRect.height+"px"))}})),this.contentSizeObserver.observe(this.content))}quietModeChange(){"on"===this.quietMode?requestAnimationFrame((()=>this.quietModeIsOn=!0)):"off"===this.quietMode&&requestAnimationFrame((()=>this.quietModeIsOn=!1))}setOffset(){let t,i,s,e;this.trigger&&this.trigger.setAttribute("style","");const h=this.isRootSticker||this.stickToEle?this.sticker:this.host;if(!h)return;"object"==typeof this.offset?({v:t,h:i}=this.offset):t=i=this.offset,"object"==typeof this._offset?({v:t=s,h:i=e}=this._offset):s=e=this._offset;const n=s=>{const e=s.match(/(top|bottom)/)?t:i;o(s),h.style[s]=e+"px",this.host.style.setProperty("--hide-transform-amount",e?`(110% + ${e}px)`:null)},o=h=>{const n=h.match(/(top|bottom)/)?t+s:i+e;this.trigger.style[h]=-1*n+"px",this.trigger.style.position="relative",this.trigger.style.minHeight="1px",this.trigger.style.maxHeight="1px",this.trigger.style.overflow="hidden"};(this.positions.includes("start")&&this.isRtl||this.positions.includes("end")&&!this.isRtl)&&n("right"),(this.positions.includes("end")&&this.isRtl||this.positions.includes("start")&&!this.isRtl)&&n("left"),this.positions.includes("top")&&n("top"),this.positions.includes("bottom")&&n("bottom")}positionChange(){this.positions=this.position.split("-"),this.setOffset()}async stuckChange(){this.isStuck?this.stickToEle?(this.slottedContent=Array.from(this.host.children),this.slottedContent.forEach((t=>{this.stickToEle.appendChild(t),t.style.order=this.stickerIndex+""})),this.nanoStuck.emit({sticker:this.stickToEle})):this.nanoStuck.emit({sticker:this.host}):(this.scrollHide=!1,this.stickToEle?(this.slottedContent.forEach((t=>{this.host.appendChild(t),t.style.order=""})),this.nanoUnstuck.emit({sticker:this.stickToEle})):this.nanoUnstuck.emit({sticker:this.host}))}attachScrollListeners(){this.quietModeIsOn?this.scrollParent.addEventListener("scroll",this.onScroll,{passive:!0,capture:!1}):this.scrollParent&&(this.scrollParent.removeEventListener("scroll",this.onScroll),this.moveTrigger(!0))}handleParentEvents(t,i=null){this.listenForScrollParent&&(i&&this.manageListenersOnParent(!1,i),this.scrollParent&&this.manageListenersOnParent(!this.stickToEle))}stickToEleChange(t,i){this.stickToEle&&(this.stickToEle.addEventListener("nanoHide",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoShow",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoStuck",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoUnstuck",this.onStickToDisplayEvent)),i&&(i.removeEventListener("nanoHide",this.onStickToDisplayEvent),i.removeEventListener("nanoShow",this.onStickToDisplayEvent),i.removeEventListener("nanoStuck",this.onStickToDisplayEvent),i.removeEventListener("nanoUnstuck",this.onStickToDisplayEvent))}stickToChange(){this.stickToEle="string"==typeof this.stickTo?this.scrollParent.querySelector(this.stickTo):this.stickTo?this.stickTo:void 0}visibilityDecisionHandler(){this.hide=!(!this.multiStickerHide&&!this.scrollHide)}handleHideChange(){this.hide?this.nanoHide.emit({sticker:this.host}):this.nanoShow.emit({sticker:this.host})}setupIO(){if(this.io&&(this.io.disconnect(),this.io=void 0),!this.scrollParent||!this.hasBootstrapped||!this.trigger)return;this.isRootSticker=this.scrollParent instanceof Document;let t=this.scrollParent;this.scrollParent instanceof Document&&(t=null),this.io=new window.IntersectionObserver((t=>{!this.pauseResizeWatcher&&this.isSticky&&this.shouldStick(t.slice(-1)[0])}),{root:t}),this.io.observe(this.trigger)}setupParentResizeListener=()=>{if(!window.ResizeObserver)return;this.parentSizeObserver&&(this.parentSizeObserver.disconnect(),this.parentSizeObserver=void 0),this.parentSizeObserver=new ResizeObserver((t=>{for(const i of t){let t,s;i.contentRect.height&&(t=i.contentRect.height),i.contentRect.width&&(s=i.contentRect.width),"object"==typeof this.quietMode&&(this.quietModeIsOn=s<this.quietMode.w||t<this.quietMode.h),this.breakPointMin&&(this.isSticky=s>this.breakPointMin),this.breakPointMax&&(this.isSticky=s<this.breakPointMax),this.isRootSticker&&this.sticker&&this.autoResize&&(this.sticker.style.width=this.host.scrollWidth+"px")}}));const t=this.scrollParent instanceof Document?this.scrollParent.documentElement:this.scrollParent;t&&this.parentSizeObserver.observe(t)};onStickToDisplayEvent=t=>{if(t.detail.sticker===this.stickToEle)switch(t.type){case"nanoHide":this._offset=0,this.cacheOffset=this.offset,this.offset=0,this.isStuck||this.moveTrigger(!1),!this.isRootSticker&&this.quietModeIsOn&&requestAnimationFrame((()=>{this.stickToEle.style.minHeight=this.stickToEleInitSize.height+(this.host.scrollHeight+("object"==typeof this.cacheOffset?this.cacheOffset.v:this.cacheOffset))+"px",this.stickToEle.setTriggerPos(-1*this.stickToEleInitSize.height)}));break;case"nanoShow":this._offset=this.stickToEleInitSize.height,this.offset=this.cacheOffset,this.moveTrigger(!0),!this.isRootSticker&&this.quietModeIsOn&&requestAnimationFrame((()=>{this.stickToEle.style.minHeight="",this.stickToEle.setTriggerPos(0)}));break;case"nanoStuck":this.stickToEleInitSize=this.stickToEle.getBoundingClientRect(),this._offset=this.stickToEleInitSize.height}};manageListenersOnParent(t,i){const s=i||this.scrollParent;if(s){if(t)s.addEventListener("nanoStuck",this.onStickEvent),s.addEventListener("nanoUnstuck",this.onStickEvent),this.quietModeIsOn&&this.attachScrollListeners();else try{this.quietModeIsOn&&s.removeEventListener("scroll",this.onScroll),s.removeEventListener("nanoStuck",this.onStickEvent),s.removeEventListener("nanoUnstuck",this.onStickEvent)}catch(t){console.error("Events haven`t been added")}this.setupParentResizeListener()}}onStickEvent=async t=>{const i=t.detail?t.detail.sticker:null;if(!i||i.position!==this.position)return;const s=await i.getTriggerPos();if("nanoStuck"===t.type&&i!==this.host&&i.scrollParent===this.host.scrollParent){if(this.stickerIndex++,!this.hideOnNewStickers)return;(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top)&&(this.multiStickerHide=!0,this.stuckCounter++)}if("nanoUnstuck"===t.type&&i!==this.host&&i.scrollParent===this.host.scrollParent){if(this.stickerIndex--,!this.hideOnNewStickers)return;(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top)&&(this.stuckCounter--,this.stuckCounter<1&&(this.multiStickerHide=!1))}};onScroll=()=>{const t=(i=this.scrollParent)instanceof Document?window.pageYOffset:i.scrollTop;var i;t<this.scrollPosCache&&(this.positions.includes("bottom")?this.handleScrollAway(t):this.handleScrollTo()),t>this.scrollPosCache&&(this.positions.includes("bottom")?this.handleScrollTo():this.handleScrollAway(t)),this.scrollPosCache=t};handleScrollTo(){this.scrollPosThresholdCache=null,this.scrollHide&&(!0!==this.scrollingTo&&(this._offset=this.cacheOffset||this._offset),this.scrollingTo=!0,this.scrollHide=!1)}handleScrollAway(t){this.scrollHide||this.isStuck&&(!1!==this.scrollingTo&&(this.cacheOffset=this._offset,this._offset=0),this.scrollingTo=!1,this.scrollPosThresholdCache?!this.pauseHide&&Math.abs(t-this.scrollPosThresholdCache)>100&&(this.scrollHide=!0):this.scrollPosThresholdCache=t)}moveTrigger(t){this.positions.includes("bottom")&&!t||!this.positions.includes("bottom")&&t?this.host.parentNode.insertBefore(this.trigger,this.host):this.host.parentNode.insertBefore(this.trigger,this.host.nextSibling)}shouldStick(t){let i;if(this.positions.includes("top"))i=this.isRootSticker?this.trigger.getBoundingClientRect().top:c(this.trigger,this.scrollParent).top,this.isStuck=i<-1;else if(this.positions.includes("bottom")){i=this.trigger.getBoundingClientRect().top;const s=t&&t.rootBounds?t.rootBounds:(this.scrollParent instanceof Document?document.documentElement:this.scrollParent).getBoundingClientRect();this.isStuck=!t.isIntersecting||i>s.height+s.top}}bootstrapGurantor(){this.hasBootstrapped=!0;const t=this.scrollParent||o(this.host);this.scrollParent=t===document.documentElement?document:t,this.isRootSticker=this.scrollParent instanceof Document,this.trigger=this.trigger||document.createElement("div"),this.trigger.innerHTML="&nbsp;",this.trigger.classList.add("sticker-trigger"),this.positionChange(),this.moveTrigger(!0),this.quietModeChange(),this.listenForScrollParent=!0,this.handleParentEvents(!0),this.stickerIndex=Array.from(this.scrollParent.querySelectorAll(r("nano-sticker"))).filter((t=>t.position===this.position)).findIndex((t=>t===this.host)),this.setOffset(),this.stickerResizeListener(),this.setupParentResizeListener(),this.slottedContent=Array.from(this.host.children),this.slottedContent.forEach((t=>{t.style.order=this.stickerIndex+""})),this.updateTriggerOffset(),this.stickToChange(),this.setupIO(),this.onStickToDisplayEvent=n(this.onStickToDisplayEvent,50)}connectedCallback(){this.isRtl="rtl"===this.host.dir||"rtl"===this.host.ownerDocument.dir,setTimeout((()=>{this.hasBootstrapped||this.bootstrapGurantor()}),1e3)}disconnectedCallback(){this.io&&(this.io.disconnect(),this.io=void 0),this.parentSizeObserver&&(this.parentSizeObserver.disconnect(),this.parentSizeObserver=void 0),this.scrollParent=null,this.hasBootstrapped=!1}render(){return a(e,{key:"f339585bb8f9d509f374404a6462b482ee7f7001",sticky:!this.isRootSticker&&!this.stickToEle&&this.isSticky,hide:this.hide&&this.isStuck,siblings:this.stuckCounter,index:this.stickerIndex,stuck:this.isStuck&&this.isSticky,"placed-bottom":this.positions.includes("bottom"),"placed-top":this.positions.includes("top"),"placed-end":this.positions.includes("end"),"placed-start":this.positions.includes("start"),class:"nano-sticker"},a("div",{key:"a0825842c7fb6fd7ab7e15a6775547693e38c1cb",class:{sticker:!0,sticky:this.isRootSticker&&this.isSticky,stuck:this.isStuck&&this.isRootSticker&&this.isSticky,hide:this.isRootSticker&&this.hide&&this.isStuck},ref:t=>this.sticker=t},a("div",{key:"3693b4a7c4daf5b5208b36a158b0d0b1f3ced9b0",class:"sticker-content",ref:t=>this.content=t},a("slot",{key:"526f2d5e88882133ec67866d90cdf18b95ce86cc"}))))}static get watchers(){return{trigger:["updateTriggerOffset"],scrollParent:["updateTriggerOffset","handleParentEvents","setupIO"],position:["stickerResizeListener","positionChange"],quietMode:["quietModeChange"],offset:["setOffset"],_offset:["setOffset"],isStuck:["stuckChange"],quietModeIsOn:["attachScrollListeners"],stickToEle:["handleParentEvents","stickToEleChange"],stickTo:["stickToChange"],multiStickerHide:["visibilityDecisionHandler"],scrollHide:["visibilityDecisionHandler"],hide:["handleHideChange"]}}};d.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--stuck-left:initial;--stuck-right:initial;--stuck-z-index:var(--nano-z-index-menubar);--top-hide:translateY(-110%);--bottom-hide:translateY(110%);display:block;max-inline-size:100%}:host([sticky]){position:sticky;transition:0.3s ease transform;will-change:min-block-size}:host([sticky][stuck]){inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index) !important}:host([sticky][hide][placed-top]){transform:var(--top-hide)}:host([sticky][hide][placed-bottom]){transform:var(--bottom-hide)}:host([sticky][index="1"]){z-index:calc(var(--stuck-z-index) + 1)}:host([sticky][index="2"]){z-index:calc(var(--stuck-z-index) + 2)}:host([sticky][index="3"]){z-index:calc(var(--stuck-z-index) + 3)}:host([sticky][index="4"]){z-index:calc(var(--stuck-z-index) + 4)}:host([sticky][index="5"]){z-index:calc(var(--stuck-z-index) + 5)}.sticker{display:inherit;max-inline-size:inherit;inline-size:100%}.sticker:not(.stuck){inline-size:auto !important}.sticker.sticky{transition:0.3s ease all;position:relative}:host([index="1"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 1)}:host([index="2"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 2)}:host([index="3"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 3)}:host([index="4"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 4)}:host([index="5"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 5)}.sticker.stuck{position:fixed;inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index);transform:translateY(0)}:host([placed-top]) .sticker.stuck{inset-block-start:0}:host([placed-bottom]) .sticker.stuck{inset-block-end:0}:host([placed-top]) .sticker.stuck.hide{transform:var(--top-hide)}:host([placed-bottom]) .sticker.stuck.hide{transform:var(--bottom-hide)}.sticker-content{display:flex;flex-wrap:wrap}';export{d as nano_sticker}
4
+ import{r as t,c as i,g as s,a as e}from"./index-BM3Om9WE.js";import{a as h}from"./dom-dlicJTEJ.js";import{d as n}from"./throttle-C93FMm2Z.js";import{f as o}from"./scroll-1nFw8CNk.js";import{t as r,h as a}from"./renderer-DpNDfhNy.js";function c(t,i){const s=i instanceof Document?document.documentElement:i;return h(t,s)}const d=class{constructor(s){t(this,s),this.nanoStuck=i(this,"nanoStuck",7),this.nanoUnstuck=i(this,"nanoUnstuck",7),this.nanoHide=i(this,"nanoHide",7),this.nanoShow=i(this,"nanoShow",7)}isRtl=!1;io;contentSizeObserver;parentSizeObserver;sticker;content;scrollPosCache=0;scrollPosThresholdCache=0;cacheOffset=0;slottedContent;pauseResizeWatcher=!1;listenForScrollParent=!1;stickToEleInitSize;positions=[];pauseHide=!1;hasBootstrapped=!1;get host(){return s(this)}isStuck=!1;isRootSticker=!0;hide=!1;scrollHide=!1;multiStickerHide=!1;scrollingTo=!1;quietModeIsOn=!1;stuckCounter=0;stickerIndex=0;stickToEle;triggerPos;trigger;_offset=0;autoResize=!0;isSticky=!0;offset=0;position="top";quietMode={h:600,w:600};hideOnNewStickers=!0;breakPointMax=null;breakPointMin=null;scrollParent;stickTo;nanoStuck;nanoUnstuck;nanoHide;nanoShow;async isHiding(){return this.hide}async isSticking(){return this.shouldStick(),this.isStuck}async setTriggerPos(t){return this._offset=t}async getTriggerPos(){return this.triggerPos}async pauseHiding(t){this.pauseHide=t}updateTriggerOffset(){this.trigger&&this.scrollParent&&this.listenForScrollParent&&(this.triggerPos=c(this.trigger,this.scrollParent))}stickerResizeListener(){this.content&&window.ResizeObserver&&(this.contentSizeObserver&&(this.contentSizeObserver.disconnect(),this.contentSizeObserver=void 0),this.contentSizeObserver=new ResizeObserver((t=>{for(const i of t){if(this.pauseResizeWatcher)return;i.contentRect.height&&("top"===this.position&&(this.host.style.height=i.contentRect.height+"px"),"bottom"===this.position&&(this.host.style.minHeight=i.contentRect.height+"px"))}})),this.contentSizeObserver.observe(this.content))}quietModeChange(){"on"===this.quietMode?requestAnimationFrame((()=>this.quietModeIsOn=!0)):"off"===this.quietMode&&requestAnimationFrame((()=>this.quietModeIsOn=!1))}setOffset(){let t,i,s,e;this.trigger&&this.trigger.setAttribute("style","");const h=this.isRootSticker||this.stickToEle?this.sticker:this.host;if(!h)return;"object"==typeof this.offset?({v:t,h:i}=this.offset):t=i=this.offset,"object"==typeof this._offset?({v:t=s,h:i=e}=this._offset):s=e=this._offset;const n=s=>{const e=s.match(/(top|bottom)/)?t:i;o(s),h.style[s]=e+"px",this.host.style.setProperty("--hide-transform-amount",e?`(110% + ${e}px)`:null)},o=h=>{const n=h.match(/(top|bottom)/)?t+s:i+e;this.trigger.style[h]=-1*n+"px",this.trigger.style.position="relative",this.trigger.style.minHeight="1px",this.trigger.style.maxHeight="1px",this.trigger.style.overflow="hidden"};(this.positions.includes("start")&&this.isRtl||this.positions.includes("end")&&!this.isRtl)&&n("right"),(this.positions.includes("end")&&this.isRtl||this.positions.includes("start")&&!this.isRtl)&&n("left"),this.positions.includes("top")&&n("top"),this.positions.includes("bottom")&&n("bottom")}positionChange(){this.positions=this.position.split("-"),this.setOffset()}async stuckChange(){this.isStuck?this.stickToEle?(this.slottedContent=Array.from(this.host.children),this.slottedContent.forEach((t=>{this.stickToEle.appendChild(t),t.style.order=this.stickerIndex+""})),this.nanoStuck.emit({sticker:this.stickToEle})):this.nanoStuck.emit({sticker:this.host}):(this.scrollHide=!1,this.stickToEle?(this.slottedContent.forEach((t=>{this.host.appendChild(t),t.style.order=""})),this.nanoUnstuck.emit({sticker:this.stickToEle})):this.nanoUnstuck.emit({sticker:this.host}))}attachScrollListeners(){this.quietModeIsOn?this.scrollParent.addEventListener("scroll",this.onScroll,{passive:!0,capture:!1}):this.scrollParent&&(this.scrollParent.removeEventListener("scroll",this.onScroll),this.moveTrigger(!0))}handleParentEvents(t,i=null){this.listenForScrollParent&&(i&&this.manageListenersOnParent(!1,i),this.scrollParent&&this.manageListenersOnParent(!this.stickToEle))}stickToEleChange(t,i){this.stickToEle&&(this.stickToEle.addEventListener("nanoHide",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoShow",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoStuck",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoUnstuck",this.onStickToDisplayEvent)),i&&(i.removeEventListener("nanoHide",this.onStickToDisplayEvent),i.removeEventListener("nanoShow",this.onStickToDisplayEvent),i.removeEventListener("nanoStuck",this.onStickToDisplayEvent),i.removeEventListener("nanoUnstuck",this.onStickToDisplayEvent))}stickToChange(){this.stickToEle="string"==typeof this.stickTo?this.scrollParent.querySelector(this.stickTo):this.stickTo?this.stickTo:void 0}visibilityDecisionHandler(){this.hide=!(!this.multiStickerHide&&!this.scrollHide)}handleHideChange(){this.hide?this.nanoHide.emit({sticker:this.host}):this.nanoShow.emit({sticker:this.host})}setupIO(){if(this.io&&(this.io.disconnect(),this.io=void 0),!this.scrollParent||!this.hasBootstrapped||!this.trigger)return;this.isRootSticker=this.scrollParent instanceof Document;let t=this.scrollParent;this.scrollParent instanceof Document&&(t=null),this.io=new window.IntersectionObserver((t=>{!this.pauseResizeWatcher&&this.isSticky&&this.shouldStick(t.slice(-1)[0])}),{root:t}),this.io.observe(this.trigger)}setupParentResizeListener=()=>{if(!window.ResizeObserver)return;this.parentSizeObserver&&(this.parentSizeObserver.disconnect(),this.parentSizeObserver=void 0),this.parentSizeObserver=new ResizeObserver((t=>{for(const i of t){let t,s;i.contentRect.height&&(t=i.contentRect.height),i.contentRect.width&&(s=i.contentRect.width),"object"==typeof this.quietMode&&(this.quietModeIsOn=s<this.quietMode.w||t<this.quietMode.h),this.breakPointMin&&(this.isSticky=s>this.breakPointMin),this.breakPointMax&&(this.isSticky=s<this.breakPointMax),this.isRootSticker&&this.sticker&&this.autoResize&&(this.sticker.style.width=this.host.scrollWidth+"px")}}));const t=this.scrollParent instanceof Document?this.scrollParent.documentElement:this.scrollParent;t&&this.parentSizeObserver.observe(t)};onStickToDisplayEvent=t=>{if(t.detail.sticker===this.stickToEle)switch(t.type){case"nanoHide":this._offset=0,this.cacheOffset=this.offset,this.offset=0,this.isStuck||this.moveTrigger(!1),!this.isRootSticker&&this.quietModeIsOn&&requestAnimationFrame((()=>{this.stickToEle.style.minHeight=this.stickToEleInitSize.height+(this.host.scrollHeight+("object"==typeof this.cacheOffset?this.cacheOffset.v:this.cacheOffset))+"px",this.stickToEle.setTriggerPos(-1*this.stickToEleInitSize.height)}));break;case"nanoShow":this._offset=this.stickToEleInitSize.height,this.offset=this.cacheOffset,this.moveTrigger(!0),!this.isRootSticker&&this.quietModeIsOn&&requestAnimationFrame((()=>{this.stickToEle.style.minHeight="",this.stickToEle.setTriggerPos(0)}));break;case"nanoStuck":this.stickToEleInitSize=this.stickToEle.getBoundingClientRect(),this._offset=this.stickToEleInitSize.height}};manageListenersOnParent(t,i){const s=i||this.scrollParent;if(s){if(t)s.addEventListener("nanoStuck",this.onStickEvent),s.addEventListener("nanoUnstuck",this.onStickEvent),this.quietModeIsOn&&this.attachScrollListeners();else try{this.quietModeIsOn&&s.removeEventListener("scroll",this.onScroll),s.removeEventListener("nanoStuck",this.onStickEvent),s.removeEventListener("nanoUnstuck",this.onStickEvent)}catch(t){console.error("Events haven`t been added")}this.setupParentResizeListener()}}onStickEvent=async t=>{const i=t.detail?t.detail.sticker:null;if(!i||i.position!==this.position)return;const s=await i.getTriggerPos();if("nanoStuck"===t.type&&i!==this.host&&i.scrollParent===this.host.scrollParent){if(this.stickerIndex++,!this.hideOnNewStickers)return;(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top)&&(this.multiStickerHide=!0,this.stuckCounter++)}if("nanoUnstuck"===t.type&&i!==this.host&&i.scrollParent===this.host.scrollParent){if(this.stickerIndex--,!this.hideOnNewStickers)return;(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top)&&(this.stuckCounter--,this.stuckCounter<1&&(this.multiStickerHide=!1))}};onScroll=()=>{const t=(i=this.scrollParent)instanceof Document?window.pageYOffset:i.scrollTop;var i;t<this.scrollPosCache&&(this.positions.includes("bottom")?this.handleScrollAway(t):this.handleScrollTo()),t>this.scrollPosCache&&(this.positions.includes("bottom")?this.handleScrollTo():this.handleScrollAway(t)),this.scrollPosCache=t};handleScrollTo(){this.scrollPosThresholdCache=null,this.scrollHide&&(!0!==this.scrollingTo&&(this._offset=this.cacheOffset||this._offset),this.scrollingTo=!0,this.scrollHide=!1)}handleScrollAway(t){this.scrollHide||this.isStuck&&(!1!==this.scrollingTo&&(this.cacheOffset=this._offset,this._offset=0),this.scrollingTo=!1,this.scrollPosThresholdCache?!this.pauseHide&&Math.abs(t-this.scrollPosThresholdCache)>100&&(this.scrollHide=!0):this.scrollPosThresholdCache=t)}moveTrigger(t){this.positions.includes("bottom")&&!t||!this.positions.includes("bottom")&&t?this.host.parentNode.insertBefore(this.trigger,this.host):this.host.parentNode.insertBefore(this.trigger,this.host.nextSibling)}shouldStick(t){let i;if(this.positions.includes("top"))i=this.isRootSticker?this.trigger.getBoundingClientRect().top:c(this.trigger,this.scrollParent).top,this.isStuck=i<-1;else if(this.positions.includes("bottom")){i=this.trigger.getBoundingClientRect().top;const s=t&&t.rootBounds?t.rootBounds:(this.scrollParent instanceof Document?document.documentElement:this.scrollParent).getBoundingClientRect();this.isStuck=!t.isIntersecting||i>s.height+s.top}}bootstrapGurantor(){this.hasBootstrapped=!0;const t=this.scrollParent||o(this.host);this.scrollParent=t===document.documentElement?document:t,this.isRootSticker=this.scrollParent instanceof Document,this.trigger=this.trigger||document.createElement("div"),this.trigger.innerHTML="&nbsp;",this.trigger.classList.add("sticker-trigger"),this.positionChange(),this.moveTrigger(!0),this.quietModeChange(),this.listenForScrollParent=!0,this.handleParentEvents(!0),this.stickerIndex=Array.from(this.scrollParent.querySelectorAll(r("nano-sticker"))).filter((t=>t.position===this.position)).findIndex((t=>t===this.host)),this.setOffset(),this.stickerResizeListener(),this.setupParentResizeListener(),this.slottedContent=Array.from(this.host.children),this.slottedContent.forEach((t=>{t.style.order=this.stickerIndex+""})),this.updateTriggerOffset(),this.stickToChange(),this.setupIO(),this.onStickToDisplayEvent=n(this.onStickToDisplayEvent,50)}connectedCallback(){this.isRtl="rtl"===this.host.dir||"rtl"===this.host.ownerDocument.dir,setTimeout((()=>{this.hasBootstrapped||this.bootstrapGurantor()}),1e3)}disconnectedCallback(){this.io&&(this.io.disconnect(),this.io=void 0),this.parentSizeObserver&&(this.parentSizeObserver.disconnect(),this.parentSizeObserver=void 0),this.scrollParent=null,this.hasBootstrapped=!1}render(){return a(e,{key:"a8a1f92fa8f2039b7d69cc147f1f8aad270243f5",sticky:!this.isRootSticker&&!this.stickToEle&&this.isSticky,hide:this.hide&&this.isStuck,siblings:this.stuckCounter,index:this.stickerIndex,stuck:this.isStuck&&this.isSticky,"placed-bottom":this.positions.includes("bottom"),"placed-top":this.positions.includes("top"),"placed-end":this.positions.includes("end"),"placed-start":this.positions.includes("start"),class:"nano-sticker"},a("div",{key:"0197385d3dbbef5b3ca2e25bb8b58eae96ebfd2c",class:{sticker:!0,sticky:this.isRootSticker&&this.isSticky,stuck:this.isStuck&&this.isRootSticker&&this.isSticky,hide:this.isRootSticker&&this.hide&&this.isStuck},ref:t=>this.sticker=t},a("div",{key:"e9e2e931b30f6c1b3278ee96d132c40772b35f8a",class:"sticker-content",ref:t=>this.content=t},a("slot",{key:"7724a7b761972a7499945135e184a52f11811c9c"}))))}static get watchers(){return{trigger:["updateTriggerOffset"],scrollParent:["updateTriggerOffset","handleParentEvents","setupIO"],position:["stickerResizeListener","positionChange"],quietMode:["quietModeChange"],offset:["setOffset"],_offset:["setOffset"],isStuck:["stuckChange"],quietModeIsOn:["attachScrollListeners"],stickToEle:["handleParentEvents","stickToEleChange"],stickTo:["stickToChange"],multiStickerHide:["visibilityDecisionHandler"],scrollHide:["visibilityDecisionHandler"],hide:["handleHideChange"]}}};d.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--stuck-left:initial;--stuck-right:initial;--stuck-z-index:var(--nano-z-index-menubar);--top-hide:translateY(-110%);--bottom-hide:translateY(110%);display:block;max-inline-size:100%}:host([sticky]){position:sticky;transition:0.3s ease transform;will-change:min-block-size}:host([sticky][stuck]){inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index) !important}:host([sticky][hide][placed-top]){transform:var(--top-hide)}:host([sticky][hide][placed-bottom]){transform:var(--bottom-hide)}:host([sticky][index="1"]){z-index:calc(var(--stuck-z-index) + 1)}:host([sticky][index="2"]){z-index:calc(var(--stuck-z-index) + 2)}:host([sticky][index="3"]){z-index:calc(var(--stuck-z-index) + 3)}:host([sticky][index="4"]){z-index:calc(var(--stuck-z-index) + 4)}:host([sticky][index="5"]){z-index:calc(var(--stuck-z-index) + 5)}.sticker{display:inherit;max-inline-size:inherit;inline-size:100%}.sticker:not(.stuck){inline-size:auto !important}.sticker.sticky{transition:0.3s ease all;position:relative}:host([index="1"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 1)}:host([index="2"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 2)}:host([index="3"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 3)}:host([index="4"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 4)}:host([index="5"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 5)}.sticker.stuck{position:fixed;inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index);transform:translateY(0)}:host([placed-top]) .sticker.stuck{inset-block-start:0}:host([placed-bottom]) .sticker.stuck{inset-block-end:0}:host([placed-top]) .sticker.stuck.hide{transform:var(--top-hide)}:host([placed-bottom]) .sticker.stuck.hide{transform:var(--bottom-hide)}.sticker-content{display:flex;flex-wrap:wrap}';export{d as nano_sticker}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Custom elements for Nanopore-Digital Web applications
3
3
  */
4
- import{r as t,g as a,a as n}from"./index-BM3Om9WE.js";import{h as e}from"./renderer-DpNDfhNy.js";let o=0;const i=class{constructor(a){t(this,a)}tabContentId="nano-tab-content-"+ ++o;ready=!1;get host(){return a(this)}name="";active=!1;componentDidLoad(){requestAnimationFrame((()=>this.ready=!0))}render(){return e(n,{key:"7899878aa521145bc4fe77a7e81ddbd2d48b739e",id:this.host.id||this.tabContentId,style:{display:this.active?"block":"none"},role:"tabpanel","aria-hidden":this.active?"false":"true",class:{ready:this.ready,"nano-tab-content":!0}},e("div",{key:"68d1c780cf1f6d4d0ef77b1dafa7766aa08ba52b",part:"base",class:"nano-tab-content"},e("slot",{key:"d8be1c667173f69f74fbead600d79bf96da42cbe"})))}};i.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:block;opacity:1;animation:opacity 0.3s ease-in-out forwards;animation-duration:0s !important}:host(.ready){animation-duration:0.3s !important}@media only screen and (width <= 768px){:host([animation-dir=left]){animation:slide-right 0.3s ease-in-out;opacity:1}:host([animation-dir=right]){animation:slide-left 0.3s ease-in-out;opacity:1}}.nano-tab-content{position:relative}@keyframes opacity{0%{opacity:0}100%{opacity:1}}@keyframes slide-left{0%{transform:translate3d(-100%, 0, 0)}50%{transform:translate3d(0%) translate3d(-0.9em)}100%{transform:translate3d(0, 0, 0)}}@keyframes slide-right{0%{transform:translate3d(100%, 0, 0)}50%{transform:translateX(0%) translate3d(0.9em)}100%{transform:translate3d(0, 0, 0)}}@media (prefers-reduced-motion: reduce){*{animation:none !important}}";export{i as nano_tab_content}
4
+ import{r as t,g as a,a as n}from"./index-BM3Om9WE.js";import{h as e}from"./renderer-DpNDfhNy.js";let o=0;const i=class{constructor(a){t(this,a)}tabContentId="nano-tab-content-"+ ++o;ready=!1;get host(){return a(this)}name="";active=!1;componentDidLoad(){requestAnimationFrame((()=>this.ready=!0))}render(){return e(n,{key:"115f9e8de93aa80ebaf9d965b7142cc0fd415a2d",id:this.host.id||this.tabContentId,style:{display:this.active?"block":"none"},role:"tabpanel","aria-hidden":this.active?"false":"true",class:{ready:this.ready,"nano-tab-content":!0}},e("div",{key:"38103778c1cdc28329d46f8709c1258430c0d1d3",part:"base",class:"nano-tab-content"},e("slot",{key:"4fd7291a060d0e9a8a538e3df70cc1eb3c7cc25a"})))}};i.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:block;opacity:1;animation:opacity 0.3s ease-in-out forwards;animation-duration:0s !important}:host(.ready){animation-duration:0.3s !important}@media only screen and (width <= 768px){:host([animation-dir=left]){animation:slide-right 0.3s ease-in-out;opacity:1}:host([animation-dir=right]){animation:slide-left 0.3s ease-in-out;opacity:1}}.nano-tab-content{position:relative}@keyframes opacity{0%{opacity:0}100%{opacity:1}}@keyframes slide-left{0%{transform:translate3d(-100%, 0, 0)}50%{transform:translate3d(0%) translate3d(-0.9em)}100%{transform:translate3d(0, 0, 0)}}@keyframes slide-right{0%{transform:translate3d(100%, 0, 0)}50%{transform:translateX(0%) translate3d(0.9em)}100%{transform:translate3d(0, 0, 0)}}@media (prefers-reduced-motion: reduce){*{animation:none !important}}";export{i as nano_tab_content}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Custom elements for Nanopore-Digital Web applications
3
3
  */
4
- import{r as a,c as o,g as t,a as e}from"./index-BM3Om9WE.js";import{h as r}from"./renderer-DpNDfhNy.js";let n=0;const i=class{constructor(t){a(this,t),this.nanoTabClose=o(this,"nanoTabClose",7)}tabId="nano-tab-"+ ++n;tab;get host(){return t(this)}panel="";active=!1;disabled=!1;closable=!1;href;target;nanoTabClose;async setFocus(){this.tab.focus({preventScroll:!0})}async removeFocus(){this.tab.blur()}handleCloseClick=()=>{this.nanoTabClose.emit()};handleCloseKeydown=a=>{" "===a.key&&(a.preventDefault(),this.handleCloseClick())};render(){return r(e,{key:"a78bb242b893196388ea298631cecba3ac1b3303",id:this.host.id||this.tabId,role:"tab","aria-disabled":this.disabled?"true":"false","aria-selected":this.active?"true":"false",class:"nano-tab"},r(this.href?"a":"div",{key:"6abd3439ce894ba2ca18087046346e9642c213ae",part:`base${this.active?" base--active":""}${this.disabled?" base--disabled":""}${this.closable?" base--closable":""}`,class:{tab:!0,"tab--active":this.active,"tab--disabled":this.disabled,"tab--closable":this.closable},href:this.href,target:this.target},r("slot",{key:"b4e779982bce5a76fdb31835d7ff94f4234d522d",name:"start"}),r("div",{key:"b4e271107a4a4f49fd97843afbf6c217b312c498",part:"label",ref:a=>this.tab=a,tabindex:this.disabled||!this.active||this.href?"-1":"0",class:"tab__label"},r("slot",{key:"ca2f8f7f9173a8fa4d2d803252790ba34e1c2130"})),r("slot",{key:"a9a5784d19f896b46da0e7fe8df118664564fd07",name:"end"}),this.closable&&!this.disabled&&r("nano-icon-button",{key:"ee1a92727d890e634b4d42343cc5a73cfd3055b3",label:"Close this tab",iconName:"light/xmark",class:"tab__close-button",onClick:this.handleCloseClick,onKeyDown:this.handleCloseKeydown,part:"close-button"})))}};i.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--border:2px solid var(--nano-color-neutral-300);--border-hover-color:var(--nano-color-primary-700);--border-active-color:var(--nano-color-primary-1000);--text-hover-color:var(--nano-color-primary-1000);--text-active-color:var(--nano-color-primary-1100);--padding:var(--nano-spacing-md);font-size:var(--nano-font-size-sm);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);display:inline-block;cursor:pointer;color:var(--nano-color-neutral-1400);border:var(--border);border-inline-end-width:0;border-inline-start-width:0;border-block-start-width:0;border-block-end:var(--border)}:host(:not([disabled]):hover){border-color:var(--border-hover-color);color:var(--text-hover-color)}:host(:not([disabled]):active),:host([active]){border-color:var(--border-active-color);color:var(--text-active-color)}:host(.nano-sortable__dragged){background:var(--nano-color-base-0);opacity:0.9 !important;box-shadow:var(--nano-shadow-l0) !important}.tab{all:unset;padding:var(--padding);display:flex;white-space:nowrap;align-items:center;position:relative;gap:var(--nano-spacing-sm);justify-content:center}.tab[href]:focus{outline:var(--nano-focus-ring);outline-offset:-3px}.tab.tab--disabled{opacity:0.5;cursor:not-allowed}.tab.tab--closable{padding-inline-end:calc(var(--padding) - var(--nano-spacing-sm))}.tab ::slotted(*),.tab::slotted(*){display:flex;align-items:center}.tab ::slotted(.nano-sortable__keyboard-handle){position:absolute;inset-inline-end:-1em;z-index:1}.tab:not(.tab--disabled):has(.tab__label:focus-visible){outline:var(--nano-focus-ring);outline-offset:-3px}.tab__label{display:flex;flex-direction:column;gap:var(--nano-spacing-sm);align-items:center}.tab__label:focus{outline:none}.tab__close-button{color:var(--nano-color-primary-1200);--hover-color:var(--nano-color-primary-700)}";export{i as nano_tab}
4
+ import{r as a,c as o,g as e,a as t}from"./index-BM3Om9WE.js";import{h as r}from"./renderer-DpNDfhNy.js";let n=0;const i=class{constructor(e){a(this,e),this.nanoTabClose=o(this,"nanoTabClose",7)}tabId="nano-tab-"+ ++n;tab;get host(){return e(this)}panel="";active=!1;disabled=!1;closable=!1;href;target;nanoTabClose;async setFocus(){this.tab.focus({preventScroll:!0})}async removeFocus(){this.tab.blur()}handleCloseClick=()=>{this.nanoTabClose.emit()};handleCloseKeydown=a=>{" "===a.key&&(a.preventDefault(),this.handleCloseClick())};render(){return r(t,{key:"1d0f5f7cbd4b2ecee010b3a97fc939d10e3cfa1b",id:this.host.id||this.tabId,role:"tab","aria-disabled":this.disabled?"true":"false","aria-selected":this.active?"true":"false",class:"nano-tab"},r(this.href?"a":"div",{key:"7a02bafe7fb706f16ce46ec41cc21b2fe5021785",part:`base${this.active?" base--active":""}${this.disabled?" base--disabled":""}${this.closable?" base--closable":""}`,class:{tab:!0,"tab--active":this.active,"tab--disabled":this.disabled,"tab--closable":this.closable},href:this.href,target:this.target},r("slot",{key:"0477ea2cd084a6bb7dcb657d677cc144d7b7f382",name:"start"}),r("div",{key:"d9008020efe31daba60e0e5686d3dd705b459ae1",part:"label",ref:a=>this.tab=a,tabindex:this.disabled||!this.active||this.href?"-1":"0",class:"tab__label"},r("slot",{key:"afb668fab779adcdf990173b904360ac6cb7b420"})),r("slot",{key:"2d80bad66affc2034dfc9dca90b70bfc392e7e60",name:"end"}),this.closable&&!this.disabled&&r("nano-icon-button",{key:"93a8a4df41648e0ddea8131510e07086c252fde9",label:"Close this tab",iconName:"light/xmark",class:"tab__close-button",onClick:this.handleCloseClick,onKeyDown:this.handleCloseKeydown,part:"close-button"})))}};i.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--border:2px solid var(--nano-color-neutral-300);--border-hover-color:var(--nano-color-primary-700);--border-active-color:var(--nano-color-primary-1000);--text-hover-color:var(--nano-color-primary-1000);--text-active-color:var(--nano-color-primary-1100);--padding:var(--nano-spacing-md);font-size:var(--nano-font-size-sm);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);display:inline-block;cursor:pointer;color:var(--nano-color-neutral-1400);border:var(--border);border-inline-end-width:0;border-inline-start-width:0;border-block-start-width:0;border-block-end:var(--border)}:host(:not([disabled]):hover){border-color:var(--border-hover-color);color:var(--text-hover-color)}:host(:not([disabled]):active),:host([active]){border-color:var(--border-active-color);color:var(--text-active-color)}:host(.nano-sortable__dragged){background:var(--nano-color-base-0);opacity:0.9 !important;box-shadow:var(--nano-shadow-l0) !important}.tab{all:unset;padding:var(--padding);display:flex;white-space:nowrap;align-items:center;position:relative;gap:var(--nano-spacing-sm);justify-content:center}.tab[href]:focus{outline:var(--nano-focus-ring);outline-offset:-3px}.tab.tab--disabled{opacity:0.5;cursor:not-allowed}.tab.tab--closable{padding-inline-end:calc(var(--padding) - var(--nano-spacing-sm))}.tab ::slotted(*),.tab::slotted(*){display:flex;align-items:center}.tab ::slotted(.nano-sortable__keyboard-handle){position:absolute;inset-inline-end:-1em;z-index:1}.tab:not(.tab--disabled):has(.tab__label:focus-visible){outline:var(--nano-focus-ring);outline-offset:-3px}.tab__label{display:flex;flex-direction:column;gap:var(--nano-spacing-sm);align-items:center}.tab__label:focus{outline:none}.tab__close-button{color:var(--nano-color-primary-1200);--hover-color:var(--nano-color-primary-700)}";export{i as nano_tab}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Custom elements for Nanopore-Digital Web applications
3
3
  */
4
- import{g as t,r as e,a as o}from"./index-BM3Om9WE.js";import{d as n}from"./throttle-C93FMm2Z.js";import{t as s,h as a}from"./renderer-DpNDfhNy.js";const i=class{get host(){return t(this)}propsReady=!1;compact="auto";handleCompactChange(){this.setupProperties()}scrollable=!0;hideCaption=!1;handleHideCaptionChange(){const t=this.caption;t&&t.classList.toggle("visually-hidden",this.hideCaption)}disableClickableRows=!1;resizeObserver;mutationObserver;intersectionObserver;settingUp=!1;get table(){return this.host.querySelector("table")}get caption(){return this.host.querySelector("caption")||(console.error("nano-table: No caption found. For better a11y, please add a <caption> element to the table."),null)}setupProperties=()=>{const t=this.table;if(!t||this.settingUp)return;if(this.settingUp=!0,!this.disableClickableRows){const t=Array.from(this.host.querySelectorAll("tr"));for(const e of t)1===this.getRowClickElements(e).length?(e.setAttribute("clickable","true"),e.addEventListener("click",this.rowClickHandler)):(e.removeAttribute("clickable"),e.removeEventListener("click",this.rowClickHandler))}const e=t.querySelectorAll("thead, tbody, tfoot");let o=0;if(t.querySelector("[sticky=start], [sticky=end]")){for(const t of e)t.style.setProperty("--section-height",`${t.offsetHeight}px`);const t=Array.from(this.host.querySelectorAll("thead th, thead td"));for(const e of t)e.matches("[sticky=start]")&&(this.makeCellsSticky(e,"start",o),o>0&&e.style.setProperty("--sticky-start",`${o}px`),o+=e.offsetWidth-1);o=0;for(const e of[...t].reverse())e.matches("[sticky=end]")&&(this.makeCellsSticky(e,"end",o),o>0&&e.style.setProperty("--sticky-end",`${o}px`),o+=e.offsetWidth-1)}if(t.querySelector("[sticky=top]")){o=0;for(const t of e){const e=Array.from(t.querySelectorAll("tr[sticky]"));for(const[t,n]of e.entries())n.matches("[sticky=top]")&&o>0&&n.style.setProperty("--sticky-top",`${o}px`),t===e.length-1&&(o+=n.offsetHeight-1)}}this.settingUp=!1,this.propsReady=!0};getRowClickElements(t){const e=t.querySelectorAll("a"),o=t.querySelectorAll("button"),n=Array.from(t.querySelectorAll('input[type="checkbox"]')).filter((t=>!t.closest("nano-checkbox"))),s=Array.from(t.querySelectorAll('input[type="radio"]')).filter((t=>!t.closest("nano-checkbox")));return[...e,...o,...t.querySelectorAll("nano-checkbox"),...n,...s]}rowClickHandler=t=>{const e=t.target,o=e.closest("tr");if(!o)return;const n=this.getRowClickElements(o);1===n.length&&e.closest(n[0].tagName)!==n[0]&&n[0].click()};makeCellsSticky(t,e,o=0){const n=t.closest("table"),s=t.closest("tr"),a=Array.from(s.cells);let i=0;for(const e of a){if(e===t)break;i+=e.colSpan||1}for(const t of n.tBodies)for(const n of t.rows){let t=0;for(const s of n.cells){const n=s.colSpan||1;if(t<=i&&i<t+n){s.setAttribute("sticky",e),o>0&&s.style.setProperty("--sticky-"+e,`${o}px`);break}t+=n}}}addObservers(){this.resizeObserver=new ResizeObserver((()=>{this.setupProperties()})),this.resizeObserver.observe(this.host),this.mutationObserver=new MutationObserver((()=>{this.setupProperties()}));const t=this.table;this.mutationObserver.observe(t,{childList:!0,subtree:!0}),this.intersectionObserver=new IntersectionObserver((()=>{this.setupProperties(),this.intersectionObserver.disconnect()}),{threshold:1}),this.intersectionObserver.observe(t)}cleanUpObservers(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null)}constructor(t){e(this,t),this.setupProperties=n(this.setupProperties,100)}connectedCallback(){this.addObservers(),this.handleHideCaptionChange()}componentDidRender(){!1!==this.scrollable&&this.table&&customElements.whenDefined(s("nano-masked-overflow")).then((()=>{this.host.querySelector(".nano-table__overflow")?.appendChild(this.table)}))}disconnectedCallback(){this.cleanUpObservers()}render(){return a(o,{key:"e2ee468673f70252fc559a82e48b74f12273e416",class:{"nano-table":!0,"nano-table--props-ready":this.propsReady}},this.scrollable&&a("nano-masked-overflow",{key:"63091df4a07695276d762d2a5ad5f535c9ed67dd",hideScrollbars:!1,scrollControls:!1,label:this.caption?.textContent||void 0,class:"nano-table__overflow-container"},a("div",{key:"2defbb73d6077d95351c50685c70e6c32f05fd87",class:"nano-table__overflow"})),a("slot",{key:"71a9d57114363f976eb139d494a8383795a67a8b"}))}static get watchers(){return{compact:["handleCompactChange"],hideCaption:["handleHideCaptionChange"]}}};i.style=".sc-nano-table-h,*.sc-nano-table,*.sc-nano-table::before,*.sc-nano-table::after{box-sizing:border-box}[hidden].sc-nano-table{display:none !important}@media (prefers-reduced-motion: reduce){.sc-nano-table-h,*.sc-nano-table,*.sc-nano-table::before,*.sc-nano-table::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}.sc-nano-table-h,*.sc-nano-table,*.sc-nano-table::before,*.sc-nano-table::after{box-sizing:border-box}[hidden].sc-nano-table{display:none !important}@media (prefers-reduced-motion: reduce){.sc-nano-table-h,*.sc-nano-table,*.sc-nano-table::before,*.sc-nano-table::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}";export{i as nano_table}
4
+ import{g as t,r as e,a as o}from"./index-BM3Om9WE.js";import{d as n}from"./throttle-C93FMm2Z.js";import{t as a,h as s}from"./renderer-DpNDfhNy.js";const i=class{get host(){return t(this)}propsReady=!1;compact="auto";handleCompactChange(){this.setupProperties()}scrollable=!0;hideCaption=!1;handleHideCaptionChange(){const t=this.caption;t&&t.classList.toggle("visually-hidden",this.hideCaption)}disableClickableRows=!1;resizeObserver;mutationObserver;intersectionObserver;settingUp=!1;get table(){return this.host.querySelector("table")}get caption(){return this.host.querySelector("caption")||(console.error("nano-table: No caption found. For better a11y, please add a <caption> element to the table."),null)}setupProperties=()=>{const t=this.table;if(!t||this.settingUp)return;if(this.settingUp=!0,!this.disableClickableRows){const t=Array.from(this.host.querySelectorAll("tr"));for(const e of t)1===this.getRowClickElements(e).length?(e.setAttribute("clickable","true"),e.addEventListener("click",this.rowClickHandler)):(e.removeAttribute("clickable"),e.removeEventListener("click",this.rowClickHandler))}const e=t.querySelectorAll("thead, tbody, tfoot");let o=0;if(t.querySelector("[sticky=start], [sticky=end]")){for(const t of e)t.style.setProperty("--section-height",`${t.offsetHeight}px`);const t=Array.from(this.host.querySelectorAll("thead th, thead td"));for(const e of t)e.matches("[sticky=start]")&&(this.makeCellsSticky(e,"start",o),o>0&&e.style.setProperty("--sticky-start",`${o}px`),o+=e.offsetWidth-1);o=0;for(const e of[...t].reverse())e.matches("[sticky=end]")&&(this.makeCellsSticky(e,"end",o),o>0&&e.style.setProperty("--sticky-end",`${o}px`),o+=e.offsetWidth-1)}if(t.querySelector("[sticky=top]")){o=0;for(const t of e){const e=Array.from(t.querySelectorAll("tr[sticky]"));for(const[t,n]of e.entries())n.matches("[sticky=top]")&&o>0&&n.style.setProperty("--sticky-top",`${o}px`),t===e.length-1&&(o+=n.offsetHeight-1)}}this.settingUp=!1,this.propsReady=!0};getRowClickElements(t){const e=t.querySelectorAll("a"),o=t.querySelectorAll("button"),n=Array.from(t.querySelectorAll('input[type="checkbox"]')).filter((t=>!t.closest("nano-checkbox"))),a=Array.from(t.querySelectorAll('input[type="radio"]')).filter((t=>!t.closest("nano-checkbox")));return[...e,...o,...t.querySelectorAll("nano-checkbox"),...n,...a]}rowClickHandler=t=>{const e=t.target,o=e.closest("tr");if(!o)return;const n=this.getRowClickElements(o);1===n.length&&e.closest(n[0].tagName)!==n[0]&&n[0].click()};makeCellsSticky(t,e,o=0){const n=t.closest("table"),a=t.closest("tr"),s=Array.from(a.cells);let i=0;for(const e of s){if(e===t)break;i+=e.colSpan||1}for(const t of n.tBodies)for(const n of t.rows){let t=0;for(const a of n.cells){const n=a.colSpan||1;if(t<=i&&i<t+n){a.setAttribute("sticky",e),o>0&&a.style.setProperty("--sticky-"+e,`${o}px`);break}t+=n}}}addObservers(){this.resizeObserver=new ResizeObserver((()=>{this.setupProperties()})),this.resizeObserver.observe(this.host),this.mutationObserver=new MutationObserver((()=>{this.setupProperties()}));const t=this.table;this.mutationObserver.observe(t,{childList:!0,subtree:!0}),this.intersectionObserver=new IntersectionObserver((()=>{this.setupProperties(),this.intersectionObserver.disconnect()}),{threshold:1}),this.intersectionObserver.observe(t)}cleanUpObservers(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null)}constructor(t){e(this,t),this.setupProperties=n(this.setupProperties,100)}connectedCallback(){this.addObservers(),this.handleHideCaptionChange()}componentDidRender(){!1!==this.scrollable&&this.table&&customElements.whenDefined(a("nano-masked-overflow")).then((()=>{this.host.querySelector(".nano-table__overflow")?.appendChild(this.table)}))}disconnectedCallback(){this.cleanUpObservers()}render(){return s(o,{key:"54758d3dbda3695305222d5717ad0503d355dc42",class:{"nano-table":!0,"nano-table--props-ready":this.propsReady}},this.scrollable&&s("nano-masked-overflow",{key:"28386faf317ffb158e7c743a9891c07d1843bcaf",hideScrollbars:!1,scrollControls:!1,label:this.caption?.textContent||void 0,class:"nano-table__overflow-container"},s("div",{key:"b3c3169a26443abbc19761df5bd543edafae52f2",class:"nano-table__overflow"})),s("slot",{key:"a2ced54f3b39798c78a06fded180291111dfd1b1"}))}static get watchers(){return{compact:["handleCompactChange"],hideCaption:["handleHideCaptionChange"]}}};i.style=".sc-nano-table-h,*.sc-nano-table,*.sc-nano-table::before,*.sc-nano-table::after{box-sizing:border-box}[hidden].sc-nano-table{display:none !important}@media (prefers-reduced-motion: reduce){.sc-nano-table-h,*.sc-nano-table,*.sc-nano-table::before,*.sc-nano-table::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}.sc-nano-table-h,*.sc-nano-table,*.sc-nano-table::before,*.sc-nano-table::after{box-sizing:border-box}[hidden].sc-nano-table{display:none !important}@media (prefers-reduced-motion: reduce){.sc-nano-table-h,*.sc-nano-table,*.sc-nano-table::before,*.sc-nano-table::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}";export{i as nano_table}