!function(e){function t(t){for(var n,o,i=t[0],u=t[1],a=0,s=[];a1&&void 0!==arguments[1]?arguments[1]:function(){},n=document.createElement("script");n.type="text/javascript",n.onerror=function(){t(new Error("Script failed to load"))},n.readyState?n.onreadystatechange=function(){"loaded"!==n.readyState&&"complete"!==n.readyState||(n.onreadystatechange=null,t())}:n.onload=function(){t()},n.src=e,document.getElementsByTagName("head")[0].appendChild(n)}}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.a=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(5),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(2))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,u,a,c=1,s={},f=!1,l=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){h(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(o=l.documentElement,r=function(e){var t=l.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(u="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(u)&&h(+t.data.slice(u.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(u+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.message=t,this.props=n,this.error=Error(this.message),this.send=r},a={},c={},s={};function f(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];return new r.a(function(n,r){t?n(s[e.product.name].assets):i(e.composeUrl).then(function(e){var t=e.assets;return n(t)}).catch(function(){return r(e.fetchProductError())})})}},{key:"load",value:function(e,t){var n=this;return this.productIframe.ready().then(function(r){n.productIframe.injectMetadata(r,t),n.productIframe.injectAssets(r,e)}).catch(function(){return r.a.reject(n.loadProductError())})}},{key:"fetchProductError",value:function(){var e=this.product,t=e.name,n=e.id,r=e.features;return new u("compose product request failed",{product:t,id:n,features:r},!1)}},{key:"loadProductError",value:function(){var e=this.product,t=e.name,n=e.id,r=e.features;return new u("failed to load product",{product:t,id:n,features:r})}}])&&p(t.prototype,n),o&&p(t,o),e}(),h=n(1);function m(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];return new r.a(function(r,o){var u=t.snippet.getParentWindow();n?(u.zEACLoaded=!0,u.$zopim?r(c.products):r(a.products)):i("".concat("https://ekr.zdassets.com/","compose/").concat(e)).then(function(e){var t=e.products;u.zEACLoaded=!0,r(t)}).catch(function(){return o(t.error(e))})})}},{key:"loadProducts",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.map(function(e){return e.getProductAssets(n).then(function(n){return e.load(n,t.snippet.getZEQueue())}).catch(function(e){return r.a.reject(e)})})}},{key:"getProductLoaders",value:function(e){var t=this.snippet.getParentWindow();return e.map(function(e){return"zopim_chat"===e.name?new y(e.id,t):new d(e,t)})}},{key:"error",value:function(e){return new u("compose request failed",{key:e},!1)}}])&&v(t.prototype,n),o&&v(t,o),e}();function w(e,t){for(var n=0;n0&&void 0!==arguments[0])||arguments[0];return new r.a(function(t){!e||window.zESettings&&void 0!==window.zESettings.errorReporting&&!Boolean(window.zESettings.errorReporting)?window.console&&t(window.console):t(U||new r.a(function(e){n.e(1).then(n.t.bind(null,8,7)).then(function(t){var n=t.default;U=new n(W),e(U)})}))})};function N(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return B(r).then(function(o){var i=[e];r&&i.push(t,n),o.error.apply(o,Q(i.filter(function(e){return e})))})}try{!function(){if(!window.zEACLoaded){var e=function(e){return A.isSnippetPresent(e)?new A(e):e.document.zendeskHost&&e.document.zEQueue?new P(e):K.isSnippetPresent(e)?new K(e):new A(e)}(window),t=new b(e);e.parentDocumentReady().then(function(){return e.getKey()}).then(function(e){return t.getProducts(e,!1)}).then(function(e){return r.a.all(t.loadProducts(t.getProductLoaders(e),!1))}).catch(function(e){return N(e.message,e.error,e.props,e.send)})}}()}catch(e){N(e.message,e)}}]);