!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).EmblaCarouselAutoHeight=t()}(this,(function(){"use strict";function e(e={}){let t,n=[];const o=["select","slideFocus"];function i(){const{slideRegistry:e}=t.internalEngine(),o=e[t.selectedScrollSnap()];return o?o.map((e=>n[e])).reduce(((e,t)=>Math.max(e,t)),0):null}function s(){null!==i()&&(t.containerNode().style.height=`${i()}px`)}return{name:"autoHeight",options:e,init:function(e){t=e;const{options:{axis:i},slideRects:l}=t.internalEngine();"y"!==i&&(n=l.map((e=>e.height)),o.forEach((e=>t.on(e,s))),s())},destroy:function(){o.forEach((e=>t.off(e,s)));const e=t.containerNode();e.style.height="",e.getAttribute("style")||e.removeAttribute("style")}}}return e.globalOptions=void 0,e}));