"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length)return t[e.length-1];var o,a=(a=e[o=i-1],e=e[i],(n-a)/(e-a));return r&&(a=r(a)),o=t[o],t=t[i],o*(1-(a=a))+t*a}(f,h,g?u%g:u,w),d&&(c=s*d,"absolute"===m&&(c=Math.abs(c)),w+=c),c="px"==(p||_.includes(a)?"px":P.includes(a)?"deg":"")?0:3,c=w.toFixed(c),i[a]=y?y(c,b.domElement):c+p)}}b.applyStyles(i),b.onUpdate&&b.onUpdate(e,b.domElement)}),_defineProperty(this,"calculateTransforms",function(){b.transforms={};var e,l=b.laxInstance.windowWidth;for(e in b.transformsData)!function(e){var o=b.transformsData[e],a={},t=o.presets;(void 0===t?[]:t).forEach(function(e){var t,n=_slicedToArray(e.split(":"),3),r=n[0],i=n[1],e=n[2],n=window.lax.presets[r];n?(t=n(i,e),Object.keys(t).forEach(function(e){o[e]=t[e]})):console.error("Lax preset cannot be found with name: ",r)}),delete o.presets;for(var n in o)!function(e){var t=_slicedToArray(o[e],3),n=t[0],r=void 0===n?[-1e9,1e9]:n,n=t[1],n=void 0===n?[-1e9,1e9]:n,t=t[2],t=void 0===t?{}:t,i=b.domElement.getBoundingClientRect(),r=c(r,l).map(function(e){return d(e,i,b.groupIndex)}),n=c(n,l).map(function(e){return d(e,i,b.groupIndex)});a[e]=[r,n,t]}(n);b.transforms[e]=a}(e)}),_defineProperty(this,"applyStyles",function(e){var r,i,o,t=(r=e,i={transform:"",filter:""},o={translateX:1e-5,translateY:1e-5,translateZ:1e-5},Object.keys(r).forEach(function(e){var t=r[e],n=_.includes(e)?"px":P.includes(e)?"deg":"";s.includes(e)?o[e]=t:l.includes(e)?i.transform+="".concat(e,"(").concat(t).concat(n,") "):u.includes(e)?i.filter+="".concat(e,"(").concat(t).concat(n,") "):i[e]="".concat(t).concat(n," ")}),i.transform="translate3d(".concat(o.translateX,"px, ").concat(o.translateY,"px, ").concat(o.translateZ,"px) ").concat(i.transform),i);Object.keys(t).forEach(function(e){b.domElement.style.setProperty(e,t[e])})}),this.selector=e,this.laxInstance=t,this.domElement=n,this.transformsData=r,this.groupIndex=i;var a=void 0===(i=o.style)?{}:i,o=o.onUpdate;Object.keys(a).forEach(function(e){n.style.setProperty(e,a[e])}),o&&(this.onUpdate=o),this.calculateTransforms()}"undefined"!=typeof module&&void 0!==module.exports?module.exports=e:window.lax=e}();