((e,t)=>{"object"==typeof exports&&"object"==typeof module?module.exports=t(require("./foundation.core"),require("jquery"),require("./foundation.util.mediaQuery"),require("./foundation.util.motion")):"function"==typeof define&&define.amd?define(["./foundation.core","jquery","./foundation.util.mediaQuery","./foundation.util.motion"],t):"object"==typeof exports?exports.__FOUNDATION_EXTERNAL__=t(require("./foundation.core"),require("jquery"),require("./foundation.util.mediaQuery"),require("./foundation.util.motion")):(e.__FOUNDATION_EXTERNAL__=e.__FOUNDATION_EXTERNAL__||{},e.__FOUNDATION_EXTERNAL__["foundation.interchange"]=t(e.__FOUNDATION_EXTERNAL__["foundation.core"],e.jQuery,e.__FOUNDATION_EXTERNAL__["foundation.util.mediaQuery"],e.__FOUNDATION_EXTERNAL__["foundation.util.motion"]))})(self,function(t,n,i,r){return a={"./js/foundation.interchange.js":function(e,t,n){n.r(t),n.d(t,{Interchange:function(){return g}});var t=n("jquery"),r=n.n(t),i=n("./foundation.util.mediaQuery"),a=n("./foundation.core"),s=n("./js/foundation.util.triggers.js");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 l(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=o(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==o(e)?e:e+""))(i.key),i)}}function u(e,t,n){t=f(t);var i=e,t=c()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n);if(!t||"object"!=o(t)&&"function"!=typeof t){if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");if(void 0===(t=i))throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var g=(e=>{function o(){var e=this,t=o;if(e instanceof t)return u(this,o,arguments);throw new TypeError("Cannot call a class as a function")}var t,n=o;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&d(n,e),n=o,(e=[{key:"_setup",value:function(e,t){this.$element=e,this.options=r().extend({},o.defaults,this.$element.data(),t),this.rules=[],this.currentPath="",this.className="Interchange",s.Triggers.init(r()),this._init(),this._events()}},{key:"_init",value:function(){i.MediaQuery._init();var e=this.$element[0].id||(0,a.GetYoDigits)(6,"interchange");this.$element.attr({"data-resize":e,id:e}),this._parseOptions(),this._addBreakpoints(),this._generateRules(),this._reflow()}},{key:"_events",value:function(){var e=this;this.$element.off("resizeme.zf.trigger").on("resizeme.zf.trigger",function(){return e._reflow()})}},{key:"_reflow",value:function(){var e,t,n;for(t in this.rules)this.rules.hasOwnProperty(t)&&(n=this.rules[t],window.matchMedia(n.query).matches)&&(e=n);e&&this.replace(e.path)}},{key:"_parseOptions",value:function(){void 0===this.options.type?this.options.type="auto":-1===["auto","src","background","html"].indexOf(this.options.type)&&(console.warn('Warning: invalid value "'.concat(this.options.type,'" for Interchange option "type"')),this.options.type="auto")}},{key:"_addBreakpoints",value:function(){for(var e in i.MediaQuery.queries)i.MediaQuery.queries.hasOwnProperty(e)&&(e=i.MediaQuery.queries[e],o.SPECIAL_QUERIES[e.name]=e.value)}},{key:"_generateRules",value:function(){var e,t,n,i=[],r=this.options.rules||this.$element.data("interchange");for(e in r="string"==typeof r?r.match(/\[.*?, .*?\]/g):r)r.hasOwnProperty(e)&&(t=(n=r[e].slice(1,-1).split(", ")).slice(0,-1).join(""),n=n[n.length-1],o.SPECIAL_QUERIES[n]&&(n=o.SPECIAL_QUERIES[n]),i.push({path:t,query:n}));this.rules=i}},{key:"replace",value:function(t){var n,e,i=this;this.currentPath!==t&&(n="replaced.zf.interchange","src"===(e="auto"===(e=this.options.type)?"IMG"===this.$element[0].nodeName?"src":t.match(/\.(gif|jpe?g|png|svg|tiff)([?#].*)?/i)?"background":"html":e)?this.$element.attr("src",t).on("load",function(){i.currentPath=t}).trigger(n):"background"===e?(t=t.replace(/\(/g,"%28").replace(/\)/g,"%29"),this.$element.css({"background-image":"url("+t+")"}).trigger(n)):"html"===e&&r().get(t,function(e){i.$element.html(e).trigger(n),r()(e).foundation(),i.currentPath=t}))}},{key:"_destroy",value:function(){this.$element.off("resizeme.zf.trigger")}}])&&l(n.prototype,e),t&&l(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n})(a.Plugin);g.defaults={rules:null,type:"auto"},g.SPECIAL_QUERIES={landscape:"screen and (orientation: landscape)",portrait:"screen and (orientation: portrait)",retina:"only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)"}},"./js/foundation.util.triggers.js":function(e,t,n){n.r(t),n.d(t,{Triggers:function(){return u}});var t=n("jquery"),o=n.n(t),i=n("./foundation.core"),r=n("./foundation.util.motion");function a(e){return(a="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 s(t,n){t.data(n).split(" ").forEach(function(e){o()("#".concat(e))["close"===n?"trigger":"triggerHandler"]("".concat(n,".zf.trigger"),[t])})}var l=(()=>{for(var e=["WebKit","Moz","O","Ms",""],t=0;t