UNPKG

@speechkit/speechkit-audio-player

Version:

A web player component that can play audio from https://speechkit.io

1 lines 22.2 kB
webpackJsonpspeechkit__name_([46],{"./node_modules/@beyondwords/audio-player/dist/module/iframe-helper.js":function(t,e,r){var n,o;!function(i){n=i,void 0!==(o="function"==typeof n?n.call(e,r,e,t):n)&&(t.exports=o)}(function(){"use strict";function t(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}function e(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){R(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function o(){var t=ht(["",""]);return o=function(){return t},t}function i(){var t=ht(["\n gtag('config', '","', {\n ","\n ","\n ","\n ","\n });\n"]);return i=function(){return t},t}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach(function(e){R(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var u,f,s=t(function(t){function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}t.exports=e}),l=t(function(t){var e=function(t){function e(t,e,o,i){var a=e&&e.prototype instanceof n?e:n,c=Object.create(a.prototype),f=new p(i||[]);return c._invoke=function(t,e,n){var o="suspendedStart";return function(i,a){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return h()}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var f=u(c,n);if(f){if(f===O)continue;return f}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===o)throw o="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o="executing";var s=r(t,e,n);if("normal"===s.type){if(o=n.done?"completed":"suspendedYield",s.arg===O)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o="completed",n.method="throw",n.arg=s.arg)}}}(t,o,f),c}function r(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function n(){}function o(){}function i(){}function a(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t,e){var n;this._invoke=function(o,i){function a(){return new e(function(n,a){!function n(o,i,a,c){var u=r(t[o],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"===s(l)&&v.call(l,"__await")?e.resolve(l.__await).then(function(t){n("next",t,a,c)},function(t){n("throw",t,a,c)}):e.resolve(l).then(function(t){f.value=t,a(f)},function(t){return n("throw",t,a,c)})}c(u.arg)}(o,i,n,a)})}return n=n?n.then(a,a):a()}}function u(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,u(t,e),"throw"===e.method))return O;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var o=r(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,O;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,O):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,O)}function f(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function l(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function p(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(f,this),this.reset(!0)}function d(t){if(t){var e=t[m];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(v.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:h}}function h(){return{value:void 0,done:!0}}var y=Object.prototype,v=y.hasOwnProperty,g="function"==typeof Symbol?Symbol:{},m=g.iterator||"@@iterator",b=g.asyncIterator||"@@asyncIterator",w=g.toStringTag||"@@toStringTag";t.wrap=e;var O={},x={};x[m]=function(){return this};var j=Object.getPrototypeOf,S=j&&j(j(d([])));S&&S!==y&&v.call(S,m)&&(x=S);var k=i.prototype=n.prototype=Object.create(x);return o.prototype=k.constructor=i,i.constructor=o,i[w]=o.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,i):(t.__proto__=i,w in t||(t[w]="GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},a(c.prototype),c.prototype[b]=function(){return this},t.AsyncIterator=c,t.async=function(r,n,o,i,a){void 0===a&&(a=Promise);var u=new c(e(r,n,o,i),a);return t.isGeneratorFunction(n)?u:u.next().then(function(t){return t.done?t.value:u.next()})},a(k),k[w]="Generator",k[m]=function(){return this},k.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=d,p.prototype={constructor:p,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(l),!t)for(var e in this)"t"===e.charAt(0)&&v.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,n){return i.type="throw",i.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}if(this.done)throw t;for(var r=this,n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=v.call(o,"catchLoc"),c=v.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&v.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,O):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),O},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),l(r),O}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;l(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:d(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),O}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}),p=function(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){function a(t){e(u,o,i,a,c,"next",t)}function c(t){e(u,o,i,a,c,"throw",t)}var u=t.apply(r,n);a(void 0)})}},d=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},h=function(t){if(Array.isArray(t))return d(t)},y=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)},v=function(t,e){if(t){if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}},g=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},m=function(t){return h(t)||y(t)||v(t)||g()},b=function(t){if(Array.isArray(t))return t},w=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}},O=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},x=function(t,e){return b(t)||w(t,e)||v(t,e)||O()},j=function(){},S=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.reduce(function(t,e){return function(){return t(e.apply(void 0,arguments))}})},k=function(t){return function e(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=t.length?t.apply(this,o):function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.apply(r,o.concat(n))}}},L=k(function(t,e){return null!=e&&(e.constructor===t||e instanceof t)}),A=function(t){return Number.isInteger(t)},E=L(String),_=(L(Function),L(Object),function(t){return"[object Object]"===Object.prototype.toString.call(t)}),P=Array.isArray,D=function(t){return!t},N=S(function(t){return"true"===t||"1"===t},function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return String(t).toLowerCase()}),I=(S(D,N),k(function(t,e){return t===e})),T=k(function(t,e,r){return t?e:r}),F=k(function(t,e){return e.map(function(e){return t(e)})}),C=k(function(t,e){var r=t<0?e.length+t:t;return E(e)?e.charAt(r):e[r]}),G=C(0),R=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},U=k(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Object.assign.apply(null,[{}].concat(m(Array.from(e))))}),q=k(function(t,e){return t.map(function(t){for(var r,n=U(e),o=0;o<t.length;){if(null==n)return;r=t[o],n=A(r)?C(r,n):n[r],o+=1}return n})}),M=k(function(t,e){return q([t],e)[0]}),J=k(function(t,e,r){return M(e,r)||t}),W=k(function(t,e){return M([t],e)}),z=k(function(t,e,r){return W(e,r)||t}),B=function(t,e){return Object.prototype.hasOwnProperty.call(e,t)},V=k(function(t,e){return Object.keys(e).filter(function(e){return!t.includes(e)}).reduce(function(t,r){return n(n({},t),{},R({},r,e[r]))},{})}),H=Object.keys,K=k(function(t,e){return B(e,t)}),Y=k(function(t,e,r){var n={};return H(e).filter(K(e)).forEach(function(o){n[o]=B(o,r)?t(o,e[o],r[o]):e[o]}),H(r).filter(K(r)).forEach(function(t){D(B(t,n))&&(n[t]=r[t])}),n}),$=k(function t(e,r,n){return Y(function(r,n,o){return _(n)&&_(o)?t(e,n,o):e(r,n,o)},r,n)}),Q=k(function(t,e){return $(function(t,e,r){return r},t,e)}),X=(W("default"),function(t,e,r,n){return t.addEventListener(e,r,n),function(){return t.removeEventListener(e,r,n)}}),Z=function(){return window==window.parent},tt=(S(function(t){return W(0,t.split("?"))},function(t){return W(0,t.split(":"))},function(t){return W([T(-1!==t.indexOf("@"),1,0)],t.split("@"))},function(t){return W([T(-1!==t.indexOf("//"),2,0)],t.split("/"))},function(t){return String(t||"")}),S(function(t){return t.replace(/^http(s)?:\/\//,"")},function(t){return E(t)?t:""}),S(G,function(t){return t.split("_")},function(t){return t.replace("-","_")},function(t){return t.toLowerCase()},function(t){return E(t)?t:""}),function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return Number.parseInt(t,e)}),et=(I(Node.ELEMENT_NODE),"dark"),rt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,e=arguments.length>1?arguments[1]:void 0,r=e.dmAttrName,n=e.htmlRef,o=I(et);new MutationObserver(function(e){e.forEach(function(e){"attributes"===e.type&&t(o(n.getAttribute(r)))})}).observe(n,{attributes:!0})},nt=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return t.reduce(function(t,e,n){return"".concat(t).concat(e).concat(r[n]||"")},"").split(/\s|\\n+/).join("")},ot=(S(function(t){var e=x(t,2)[1];return void 0===e?"":e},function(t){return/\.([^]{3,4})$/.exec(t)||[]}),function(t){return t.text().then(function(e){var r=t.headers.get("Content-Type"),n={text:e,json:null};if(r&&r.includes("application/json"))try{n.json=JSON.parse(e)}catch(t){n.json=null}return n})}),it={headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=UTF-8"}},at={shouldStringifyBody:!0},ct=(u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Q(it,e),o=U(at,r);return n.body&&o.shouldStringifyBody&&(n.body=JSON.stringify(n.body)),fetch(t,n).then(function(t){return Promise.all([t,ot(t)])}).then(function(t){var e=x(t,2),r=e[0],n=e[1];if(r.data=n.json||n.text,!r.ok)throw r;return r})},{get:function(t){var e=arguments;return p(l.mark(function r(){var n,o;return l.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.length>1&&void 0!==e[1]?e[1]:{},o=e.length>2?e[2]:void 0,r.abrupt("return",u(t,U({method:"GET"},n),o));case 3:case"end":return r.stop()}},r)}))()},post:function(t){var e=arguments;return p(l.mark(function r(){var n,o;return l.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.length>1&&void 0!==e[1]?e[1]:{},o=e.length>2?e[2]:void 0,r.abrupt("return",u(t,U({method:"POST"},n),o));case 3:case"end":return r.stop()}},r)}))()}}),ut=P(f=["hideFeedback","hideSKLink","customControls","ui_v1","gaFeature","podcast_like","podcast_like_sanofi","disabled_uuids","disabled_gaSk"])?f.reduce(function(t,e){return t[e]=e,t},{}):{},ft="PlaylistPlayer",st=function(t){var e=function(t){var e=/\/{2}[\w.:]{2,}\/p\/([\d]+)[\/]*/.exec(t)||[],r=x(e,2),n=r[0],o=void 0!==n&&n,i=r[1];return o?void 0===i?"":i:null}(t);if(e)return{type:ft,id:e};var r=/\/projects\/(.*)\/podcasts/.exec(t)||[],n=x(r,2),o=n[0],i=void 0!==o&&o,a=n[1];return i?{type:"MinimalPlayer",id:void 0===a?"":a}:null},lt=function(){var t=p(l.mark(function t(e,r){return l.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.reduce(function(){var t=p(l.mark(function t(n,o,i){return l.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n;case 2:return t.next=4,r(o,i,e);case 4:case"end":return t.stop()}},t)}));return function(e,r,n){return t.apply(this,arguments)}}(),void 0);case 2:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}(),pt=k(function(t,e){return new Promise(function(r){var n=e,o=/AppleWebKit\/([\d.]+)/.exec(navigator.userAgent);if(o&&parseFloat(o[1])>605){var i=t.location.href;if(!i.includes("my.speechkit.io")){var a=new URL(e),c=new URLSearchParams(a);c.set&&(c.set("articleUrl",i),n="".concat(e,"?").concat(c.toString()))}}if(!B("__cmp",t))return r(n);t.__cmp("getConsentData",null,function(t,e){if(e){var o={consentData:t.consentData,gdprApplies:t.gdprApplies},i=btoa(JSON.stringify(o));if(i){var a=new URL(n),c=new URLSearchParams(a);c.set&&(c.set("cmp",i),n="".concat(n,"?").concat(c.toString()))}}r(n)})})}),dt="https://audio.beyondwords.io",ht=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))},yt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return nt(o(),t).split(",")},vt=0,gt=function(){return t="script",document.createElement(t,e);var t,e},mt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";document.querySelector(e).appendChild(t)},bt=[],wt=!0,Ot=function(){return"function"==typeof gtag},xt=function(){if(wt){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];bt.push([].concat(e))}},jt=function(t,e){return T(t,e,"")},St=function(t){var e=t.id,r=t.pageLocation,n=t.enableSendPageViews,o=t.disableClientStorage;return nt(i(),e,jt(r,"'page_location': '".concat(r,"',")),jt(n,"'send_page_view': '".concat(n,"',")),jt(o,"'client_storage': 'none',"),jt(!1,"'debug_mode': true,"))},kt=function(t){var e=t.id,r=t.pId,n=t.enableSendPageViews,o=t.pageLocation,i=void 0===o?null:o,a=t.withInitDataLayer,c=void 0===a||a,u=t.disableClientStorage,f=void 0!==u&&u,s=t.withoutSpktGA,l=void 0!==s&&s,p=gt(),d=jt(c,"\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n "),h={id:e,pageLocation:i,disableClientStorage:f},y=jt(D(l),St(h)),v=jt(r,St(U(h,{id:r,enableSendPageViews:n})));p.text="\n ".concat(d,"\n ").concat(y,"\n ").concat(v,"\n "),mt(p),function t(){D(Ot())?setTimeout(t,200):(wt=!1,bt.forEach(function(t){gtag.apply(void 0,m(t))}),bt.length=0)}()},Lt=function(t){var e=t.src,r=/[?|&]id=([\w-]*)/.exec(e)||[],n=x(r,2),o=n[0],i=void 0!==o&&o,a=n[1];return i?void 0===a?"":a:null},At=function(t){return yt(t).includes(ut.disabled_gaSk)},Et=function t(e){if(!D(e&&e.id)){var r=S(function(t){return t.filter(function(t){return-1!==t.src.indexOf("id=")})},Array.from)(document.querySelectorAll("script[src*=googletagmanager\\.com]")),n="complete"===document.readyState;if(r.length){var o=e.pId,i=e.withoutSpktGA,a=F(Lt,r).includes(o);if(i&&a)return;kt(U({withInitDataLayer:D(Ot())},T(a,V(["pId"],e),e)))}else{if(n&&0===r.length)return e.pId&&vt<10?(vt+=1,setTimeout(function(){t(e)},200)):void function(t){var e=t.id,r=t.pId,n=t.withoutSpktGA,o=T(n&&r,r,e),i=gt();i.async=!0,i.type="text/javascript",i.src="https://www.googletagmanager.com/gtag/js?id=".concat(o,"&l=dataLayer"),mt(i,"head"),kt(t)}(e);n&&t(e)}}},_t=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Z()&&Et(c({pageLocation:window.location.href},t))};!function(t){if(!t.spktHelper){t.spktHelper=!0;var e,r,n=document.querySelector("html"),o=I(et),i=function(t){return function(e){t.contentWindow.postMessage({msg:"iframe-helper",data:{isDark:e}},"*")}},a={},c={},u=function(t){if(!e){var r=document.querySelectorAll("iframe#speechkit-io-iframe");e=Array.from(r)}return void 0!==t&&e[t]?e[t]:e},f=k(function(t,e,r){try{u(e).style[t]=r}catch(e){console.error("for ".concat(t),e)}}),s=f("display"),d=f("height");r=function(){var r=u();if(r.length){X(t,"message",function(t){for(var e=-1,f=0;f<r.length;f+=1){var l=r[f];if(t&&t.source&&(l.contentWindow==t.source||l.contentWindow==t.source.parent)){e=f;break}}if(-1!==e&&/http(s)?:\/\/(.*\.)?((staging-)?beyondwords\.io|speechkit\.io|spkt\.io|localhost)/.test(t.origin)){var p=t[t.message?"message":"data"];if(p&&p.msg&&"iframe-resize"===p.msg)return d(e,p.attrs.height),void(a[e]=!0);if(p&&p.attrs)!function(t,e){var r=u(t);r&&H(e.attrs).forEach(function(n){if(e.attrs[n]){if("onload"===n&&!a[t])return;r.setAttribute(n,e.attrs[n])}})}(e,p);else if("sk-fail"===p)s(e,"none");else if("sk-success"===p){s(e,"block");var h=u(e);h&&c[e]&&i(h)(o(n.getAttribute(c[e])))}else if(Array.isArray(p)&&"event"===p[0]){if(Ot())return void gtag.apply(void 0,m(p));xt.apply(void 0,m(p))}}},!1);var f=e.filter(function(t){return!!t.getAttribute("data-src")}),h=I(ft),y=function(t,e){return h(e)?"".concat(dt,"/cf/").concat(t,"?type=").concat(e):"".concat(dt,"/cf/").concat(t,"?article_url=").concat((r=window.location.href,window.encodeURIComponent(r)));var r},v=J(null),g=v(["podcast","podcast_id"]),b=v(["podcast","media"]);lt(f,function(){var e=p(l.mark(function e(r,a){var u,f,p,d,v,m,w,O,x,j,S,k,L,A;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=r.getAttribute("data-src"),e.prev=1,e.next=4,ct.get(u);case 4:if(f=e.sent,p=f.status,d=tt(p),!D(d>=200&&d<300)){e.next=9;break}throw new Error("Bad status");case 9:e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(1),s(a,"none"),e.abrupt("return");case 15:if(v=st(u)||{},m=v.id,w=v.type,O=pt(t),!m){e.next=45;break}return e.prev=18,e.next=21,ct.get(y(m,w));case 21:if(x=e.sent,j=x.data,S="".concat(dt,"/p/").concat(m),!D(h(w))){e.next=31;break}if(k=g(j),L=b(j),!D(k&&L.length)){e.next=30;break}return s(a,"none"),e.abrupt("return");case 30:S="".concat(dt,"/e/").concat(k);case 31:return e.t1=r,e.next=34,O(S);case 34:e.t2=e.sent,e.t1.setAttribute.call(e.t1,"src",e.t2),j.gtagSettings&&(l=j.featureFlags,yt(l).includes(ut.gaFeature))&&_t(U(j.gtagSettings,{withoutSpktGA:At(j.featureFlags)})),j.publisherDm&&Z()&&(A=z("data-user-color-scheme","dmAttrName",j),c[a]=A,rt(i(r),{htmlRef:n,dmAttrName:A}),i(o(n.getAttribute(A)))),e.next=43;break;case 40:e.prev=40,e.t3=e.catch(18),s(a,"none");case 43:e.next=50;break;case 45:return e.t4=r,e.next=48,O(u);case 48:e.t5=e.sent,e.t4.setAttribute.call(e.t4,"src",e.t5);case 50:case"end":return e.stop()}var l},e,null,[[1,11],[18,40]])}));return function(t,r){return e.apply(this,arguments)}}()).catch(j)}},["interactive","complete"].includes(document.readyState)?r():X(document,"DOMContentLoaded",r)}}(window)})}});