!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Readmore",[],t):"object"==typeof exports?exports.Readmore=t():e.Readmore=t()}(window,function(){return o={"./node_modules/@babel/runtime/helpers/classCallCheck.js":function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},"./node_modules/@babel/runtime/helpers/createClass.js":function(e,t){function n(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e}},"./node_modules/@babel/runtime/helpers/typeof.js":function(t,e){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return"function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?t.exports=n=function(e){return o(e)}:t.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)},n(e)}t.exports=n},"./src/readmore.js":function(e,t,o){"use strict";o.r(t);var n=o("./node_modules/@babel/runtime/helpers/classCallCheck.js"),s=o.n(n),n=o("./node_modules/@babel/runtime/helpers/createClass.js"),r=o.n(n),n=o("./node_modules/@babel/runtime/helpers/typeof.js"),d=o.n(n),i=0,a=[];function c(e,t,o){for(var n=0;n<e.length;n+=1)t.call(o,e[n],n)}function u(){return i+=1,"rmjs-".concat(i)}function f(e){e.style.height="auto";var t=parseInt(e.getBoundingClientRect().height,10),o=parseInt(window.getComputedStyle(e).maxHeight,10),n=parseInt(e.readmore.defaultHeight,10);e.readmore.expandedHeight=t,e.readmore.maxHeight=o,e.readmore.collapsedHeight=o||e.readmore.collapsedHeight||n,e.style.maxHeight="none"}function p(e,t){var o,n;a[e]||(o="",t.embedCSS&&""!==t.blockCSS&&(o+="".concat(e," + [data-readmore-toggle], ").concat(e,"[data-readmore] {\n        ").concat(t.blockCSS,"\n      }")),o+="".concat(e,"[data-readmore] {\n      transition: height ").concat(t.speed,"ms;\n      overflow: hidden;\n    }"),t=document,o=o,(n=t.createElement("style")).type="text/css",n.styleSheet?n.styleSheet.cssText=o:n.appendChild(t.createTextNode(o)),t.getElementsByTagName("head")[0].appendChild(n),a[e]=!0)}function m(e,t,o){var n=e,e=("function"==typeof e&&(n=e(t)),e=n,(n=document.createElement("div")).innerHTML=e,n.firstChild);return e.setAttribute("data-readmore-toggle",t.id),e.setAttribute("aria-controls",t.id),e.addEventListener("click",function(e){this.toggle(t,e)}.bind(o)),e}[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach(function(e){Object.prototype.hasOwnProperty.call(e,"remove")||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})});function h(){for(var e=this,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];var r=g&&!b;clearTimeout(b),b=setTimeout(function(){b=null,g||l.apply(e,o)},y),r&&l.apply(this,o)}var l,y,g,b,v={speed:y=100,collapsedHeight:200,heightMargin:16,moreLink:'<a href="#">Read More</a>',lessLink:'<a href="#">Close</a>',embedCSS:!0,blockCSS:"display: block; width: 100%;",startOpen:!(l=function(){c(document.querySelectorAll("[data-readmore]"),function(e){var t="true"===e.getAttribute("aria-expanded");f(e),e.style.height="".concat(t?e.readmore.expandedHeight:e.readmore.collapsedHeight,"px")})}),sourceOrder:"after",blockProcessed:function(){},beforeToggle:function(){},afterToggle:function(){}},o=function(){function l(){var n=this;if(s()(this,l),"undefined"!=typeof window&&"undefined"!=typeof document&&document.querySelectorAll&&window.addEventListener){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var r=t[0],i=t[1],a="string"==typeof r?document.querySelectorAll(r):r.nodeName?[r]:r;a.length&&(this.options=function t(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];var r={}.hasOwnProperty,i=o[0],a=o[1];if(2<o.length){var l=[];for(Object.keys(o).forEach(function(e){l.push(o[e])});2<l.length;){var s=l.shift(),c=l.shift();l.unshift(t(s,c))}i=l.shift(),a=l.shift()}return a&&Object.keys(a).forEach(function(e){r.call(a,e)&&("object"===d()(a[e])?(i[e]=i[e]||{},i[e]=t(i[e],a[e])):i[e]=a[e])}),i}({},v,i),"string"==typeof r?p(r,this.options):(this.instanceSelector=".".concat(u()),p(this.instanceSelector,this.options)),window.addEventListener("load",h),window.addEventListener("resize",h),this.elements=[],c(a,function(e){n.instanceSelector&&e.classList.add(n.instanceSelector.substr(1));var t=n.options.startOpen,o=(e.readmore={defaultHeight:n.options.collapsedHeight,heightMargin:n.options.heightMargin},f(e),e.readmore.heightMargin);e.getBoundingClientRect().height<=e.readmore.collapsedHeight+o?"function"==typeof n.options.blockProcessed&&n.options.blockProcessed(e,!1):(e.setAttribute("data-readmore",""),e.setAttribute("aria-expanded",t),e.id=e.id||u(),o=m(t?n.options.lessLink:n.options.moreLink,e,n),e.parentNode.insertBefore(o,"before"===n.options.sourceOrder?e:e.nextSibling),e.style.height="".concat(t?e.readmore.expandedHeight:e.readmore.collapsedHeight,"px"),"function"==typeof n.options.blockProcessed&&n.options.blockProcessed(e,!0),n.elements.push(e))}))}}return r()(l,[{key:"toggle",value:function(){function e(t){var o=document.querySelector('[aria-controls="'.concat(t.id,'"]')),n=t.getBoundingClientRect().height<=t.readmore.collapsedHeight,e=n?t.readmore.expandedHeight:t.readmore.collapsedHeight;function r(e){"function"==typeof i.options.afterToggle&&i.options.afterToggle(o,t,n),e.stopPropagation(),t.setAttribute("aria-expanded",n),t.removeEventListener("transitionend",r,!1)}"function"==typeof i.options.beforeToggle&&!1===i.options.beforeToggle(o,t,!n)||(t.style.height="".concat(e,"px"),t.addEventListener("transitionend",r,!1),i.options.speed<1&&r.call(i,{target:t}),(e=n?i.options.lessLink:i.options.moreLink)?o&&o.parentNode&&o.parentNode.replaceChild(m(e,t,i),o):o.remove())}var i=this,t=arguments.length<=0?void 0:arguments[0];if(!(t="string"==typeof t?document.querySelectorAll(t):t))throw new Error("Element MUST be either an HTML node or querySelector string");var o=arguments.length<=1?void 0:arguments[1];o&&(o.preventDefault(),o.stopPropagation()),"object"!==d()(t)||t.nodeName?e(t):c(t,e)}},{key:"destroy",value:function(e){var o=this,e=e?"string"==typeof e?document.querySelectorAll(e):e.nodeName?[e]:e:this.elements;c(e,function(t){var e;-1!==o.elements.indexOf(t)&&(o.elements=o.elements.filter(function(e){return e!==t}),o.instanceSelector&&t.classList.remove(o.instanceSelector.substr(1)),delete t.readmore,t.style.height="initial",t.style.maxHeight="initial",t.removeAttribute("data-readmore"),t.removeAttribute("aria-expanded"),(e=document.querySelector('[aria-controls="'.concat(t.id,'"]')))&&e.remove(),-1!==t.id.indexOf("rmjs-")&&t.removeAttribute("id"))})}}]),l}();o.VERSION="3.0.0-beta-1",t.default=o},0:function(e,t,o){e.exports=o("./src/readmore.js")}},n={},r.m=o,r.c=n,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0).default;function r(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return o[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var o,n});